diff --git a/README.md b/README.md index d1f09c99265e..a9f02513b81c 100644 --- a/README.md +++ b/README.md @@ -81,10 +81,18 @@ Next, get the code: #### Making the switch If you have previously worked in this repo using the `npm` workflow, the first time you switch to using Rush you should commit or stash any untracked files and then get back to a clean state by running `rush reset-workspace` before proceeding any further. This will get rid of any latent package-lock files, as well as your existing (incompatible) node_modules directories. You can then proceed down the path outlined below. -#### Warning for VSCode users +#### Warnings for VSCode users Visual Studio Code has a feature which will automatically fetch and install @types packages for you, using the standard npm package manager. This will cause problems with your node_modules directory, since Rush uses PNPM which lays out this directory quite differently. It's highly recommended that you ensure "Typescript: Disable Automatic Type Acquisition" is checked in your VSCode Workspace Settings (or ensure `typescript.disableAutomaticTypeAcquisition` is present in your .vscode/settings.json file). -#### Warning for Windows users +The current version of VSCode for Windows has a bug that may cause a "file locked" error when you run any Rush command that modifies your node_modules directory: +``` +ERROR: Error: Error: EPERM: operation not permitted, mkdir 'C:\XXXXX\node_modules' +Often this is caused by a file lock from a process such as your text editor, command prompt, or "gulp serve" +``` + +This bug is fixed in the Insiders build of VSCode (1.34), and will be included in the next release. Until then, you can resolve this by running the "Typescript: Restart TS server" command from the Command Palette to release the lock on the files. + +#### Warnings for Windows users Git for Windows has a bug where repository files may be unintentionally removed by `git clean -df` when a directory is locally linked. Because Rush creates local links between packages, you may encounter this. It's highly recommended to use the `rush reset-workspace` command to get your working directory back to a clean state instead. If you prefer to run `git clean -df` manually, you must first run `rush unlink` so that the operation can be performed safely. ### Inner loop developer workflow with Rush @@ -93,7 +101,7 @@ Git for Windows has a bug where repository files may be unintentionally removed Run `rush update` to install the current set of package dependencies in all projects inside the repo. -To add a new dependency (assuming the dependency is published on the NPM registry), navigate to the project's directory and run `rush add -p "" [--dev]`. This will update the project's package.json and then automatically run `rush update` to install the package into the project's node_modules directory. Do not use `npm install [--save | --save-dev]`. +To add a new dependency (assuming the dependency is published on the NPM registry), navigate to the project's directory and run `rush add -p "" --caret [--dev]`. This will add the dependency at its latest version to the project's package.json, and then automatically run `rush update` to install the package into the project's node_modules directory. If you know the specific version of the package you want, you can instead run `rush add -p ""` - make sure to use the caret before the version number. Do not use `npm install [--save | --save-dev]`. To add a dependency on another library within the Azure SDK, you can follow the same procedure as above as long as the library is also published to the NPM registry. Additionally, as long as the local copy of that library satisfies the SemVer range you specify when you run `rush add`, that library will be locally linked rather than downloaded from the registry. If the library has not yet been published to the NPM registry, you can't use `rush add`. In this case, you must manually edit the package.json to add the dependency and then run `rush update` to locally link the library into the project's node_modules directory. @@ -225,4 +233,4 @@ Currently, the tests for client libraries in this repository are running against | ----------- | -------------------- | ----------- | ------------------- | | **Node 8** | x | x | x | | **Node 10** | x | x | x | -| **Node 11** | x | x | x | +| **Node 12** | x | x | x | diff --git a/eng/pipelines/templates/jobs/archetype-sdk-client.yml b/eng/pipelines/templates/jobs/archetype-sdk-client.yml new file mode 100644 index 000000000000..b147d6bdf498 --- /dev/null +++ b/eng/pipelines/templates/jobs/archetype-sdk-client.yml @@ -0,0 +1,176 @@ +jobs: + - job: "Build" + variables: + - template: ../variables/globals.yml + + pool: + vmImage: "ubuntu-16.04" + + steps: + - task: NodeTool@0 + inputs: + versionSpec: "$(NodeVersion)" + displayName: "Install Node.js $(NodeVersion)" + + - script: | + node common/scripts/install-run-rush.js install + displayName: "Install dependencies" + + - ${{ if eq(parameters.PackageName,'')}}: + - script: | + node common/scripts/install-run-rush.js build --verbose + displayName: "Build libraries" + - script: | + node common/scripts/install-run-rush.js pack --verbose + displayName: "Pack libraries" + + - ${{ if ne(parameters.PackageName,'')}}: + - script: | + node common/scripts/install-run-rush.js build --verbose --to ${{parameters.PackageName}} + displayName: "Build libraries" + - script: | + node common/scripts/install-run-rush.js pack --verbose --to ${{parameters.PackageName}} + displayName: "Pack libraries" + + - task: CopyFiles@2 + inputs: + contents: "sdk/**/**/*.tgz" + targetFolder: $(Build.ArtifactStagingDirectory) + flattenFolders: true + displayName: "Copy packages" + + - task: PublishPipelineArtifact@0 + condition: succeededOrFailed() + displayName: "Publish artifacts" + inputs: + artifactName: packages + targetPath: $(Build.ArtifactStagingDirectory) + + - job: "Analyze" + variables: + - template: ../variables/globals.yml + + pool: + vmImage: "ubuntu-16.04" + + steps: + - task: UsePythonVersion@0 + displayName: "Use Python 3.6" + inputs: + versionSpec: "3.6" + + - task: NodeTool@0 + inputs: + versionSpec: "$(NodeVersion)" + displayName: "Install Node.js $(NodeVersion)" + + - script: | + pip install setuptools wheel + pip install doc-warden + ward scan -d $(Build.SourcesDirectory) -c $(Build.SourcesDirectory)/.docsettings.yml + displayName: "Verify Readmes" + + - ${{ if eq(parameters.PackageName,'')}}: + - script: | + node common/scripts/install-run-rush.js install + node common/scripts/install-run-rush.js audit + condition: and(succeeded(), eq(variables['RunNpmAudit'], 'true')) + displayName: "Audit packages" + + - ${{ if ne(parameters.PackageName,'')}}: + - script: | + node common/scripts/install-run-rush.js install + node common/scripts/install-run-rush.js audit --to ${{parameters.PackageName}} + condition: and(succeeded(), eq(variables['RunNpmAudit'], 'true')) + displayName: "Audit packages" + + - task: ms.vss-governance-buildtask.governance-build-task-component-detection.ComponentGovernanceComponentDetection@0 + # ComponentGovernance is currently unable to run on pull requests of public projects. Running on non-PR + # builds should be sufficient. + condition: and(succeededOrFailed(), ne(variables['Build.Reason'], 'PullRequest')) + displayName: "Component Detection" + + - job: "Test" + + strategy: + matrix: + Linux_Node8: + OSName: "Linux" + OSVmImage: "ubuntu-16.04" + NodeVersion: "8.x" + Linux_Node10: + OSName: "Linux" + OSVmImage: "ubuntu-16.04" + NodeVersion: "10.x" + Linux_Node12: + OSName: "Linux" + OSVmImage: "ubuntu-16.04" + NodeVersion: "12.x" + macOS_Node8: + OSName: "macOS" + OSVmImage: "macOS-10.13" + NodeVersion: "8.x" + macOS_Node10: + OSName: "macOS" + OSVmImage: "macOS-10.13" + NodeVersion: "10.x" + macOS_Node12: + OSName: "macOS" + OSVmImage: "macOS-10.13" + NodeVersion: "12.x" + Windows_Node8: + OSName: "Windows" + OSVmImage: "vs2017-win2016" + NodeVersion: "8.x" + Windows_Node10: + OSName: "Windows" + OSVmImage: "vs2017-win2016" + NodeVersion: "10.x" + Windows_Node12: + OSName: "Windows" + OSVmImage: "vs2017-win2016" + NodeVersion: "12.x" + + pool: + vmImage: "$(OSVmImage)" + + steps: + - task: NodeTool@0 + inputs: + versionSpec: "$(NodeVersion)" + displayName: "Install Node.js $(NodeVersion)" + + - script: | + node common/scripts/install-run-rush.js install + displayName: "Install dependencies" + + # If there is no package name, then don't use the --to option. + - ${{ if eq(parameters.PackageName,'')}}: + - script: | + node common/scripts/install-run-rush.js build --verbose + displayName: 'Build libraries"' + - script: | + node common/scripts/install-run-rush.js build:test --verbose + displayName: "Build test assets" + - script: | + node common/scripts/install-run-rush.js unit-test --verbose + displayName: "Test libraries" + + # On the other hand, if there is a PackageName, supply the --to option. + - ${{ if ne(parameters.PackageName,'')}}: + - script: | + node common/scripts/install-run-rush.js build --verbose --to ${{parameters.PackageName}} + displayName: 'Build libraries"' + - script: | + node common/scripts/install-run-rush.js build:test --verbose --to ${{parameters.PackageName}} + displayName: "Build test assets" + - script: | + node common/scripts/install-run-rush.js unit-test --verbose --to ${{parameters.PackageName}} + displayName: "Test libraries" + + - task: PublishTestResults@2 + inputs: + testResultsFiles: "**/test-results.xml" + testRunTitle: "$(OSName) Node $(NodeVersion)" + condition: succeededOrFailed() + displayName: "Publish test results" diff --git a/eng/pipelines/templates/variables/globals.yml b/eng/pipelines/templates/variables/globals.yml new file mode 100644 index 000000000000..430e586b1491 --- /dev/null +++ b/eng/pipelines/templates/variables/globals.yml @@ -0,0 +1,2 @@ +variables: + NodeVersion: '10.x' diff --git a/sdk/appservice/arm-appservice-profile-2019-03-01-hybrid/LICENSE.txt b/sdk/appservice/arm-appservice-profile-2019-03-01-hybrid/LICENSE.txt new file mode 100644 index 000000000000..b73b4a1293c3 --- /dev/null +++ b/sdk/appservice/arm-appservice-profile-2019-03-01-hybrid/LICENSE.txt @@ -0,0 +1,21 @@ +The MIT License (MIT) + +Copyright (c) 2019 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/sdk/appservice/arm-appservice-profile-2019-03-01-hybrid/README.md b/sdk/appservice/arm-appservice-profile-2019-03-01-hybrid/README.md new file mode 100644 index 000000000000..cf292a606f22 --- /dev/null +++ b/sdk/appservice/arm-appservice-profile-2019-03-01-hybrid/README.md @@ -0,0 +1,96 @@ +## Azure WebSiteManagementClient SDK for JavaScript + +This package contains an isomorphic SDK for WebSiteManagementClient. + +### Currently supported environments + +- Node.js version 6.x.x or higher +- Browser JavaScript + +### How to Install + +```bash +npm install @azure/arm-appservice-profile-2019-03-01-hybrid +``` + +### How to use + +#### nodejs - Authentication, client creation and list certificates as an example written in TypeScript. + +##### Install @azure/ms-rest-nodeauth + +```bash +npm install @azure/ms-rest-nodeauth +``` + +##### Sample code + +```typescript +import * as msRest from "@azure/ms-rest-js"; +import * as msRestAzure from "@azure/ms-rest-azure-js"; +import * as msRestNodeAuth from "@azure/ms-rest-nodeauth"; +import { WebSiteManagementClient, WebSiteManagementModels, WebSiteManagementMappers } from "@azure/arm-appservice-profile-2019-03-01-hybrid"; +const subscriptionId = process.env["AZURE_SUBSCRIPTION_ID"]; + +msRestNodeAuth.interactiveLogin().then((creds) => { + const client = new WebSiteManagementClient(creds, subscriptionId); + client.certificates.list().then((result) => { + console.log("The result is:"); + console.log(result); + }); +}).catch((err) => { + console.error(err); +}); +``` + +#### browser - Authentication, client creation and list certificates as an example written in JavaScript. + +##### Install @azure/ms-rest-browserauth + +```bash +npm install @azure/ms-rest-browserauth +``` + +##### Sample code + +See https://github.com/Azure/ms-rest-browserauth to learn how to authenticate to Azure in the browser. + +- index.html +```html + + + + @azure/arm-appservice-profile-2019-03-01-hybrid sample + + + + + + + + +``` + +## Related projects + +- [Microsoft Azure SDK for Javascript](https://github.com/Azure/azure-sdk-for-js) diff --git a/sdk/appservice/arm-appservice-profile-2019-03-01-hybrid/package.json b/sdk/appservice/arm-appservice-profile-2019-03-01-hybrid/package.json new file mode 100644 index 000000000000..703c41e0442c --- /dev/null +++ b/sdk/appservice/arm-appservice-profile-2019-03-01-hybrid/package.json @@ -0,0 +1,58 @@ +{ + "name": "@azure/arm-appservice-profile-2019-03-01-hybrid", + "author": "Microsoft Corporation", + "description": "WebSiteManagementClient Library with typescript type definitions for node.js and browser.", + "version": "1.0.0", + "dependencies": { + "@azure/ms-rest-azure-js": "^1.3.2", + "@azure/ms-rest-js": "^1.8.1", + "tslib": "^1.9.3" + }, + "keywords": [ + "node", + "azure", + "typescript", + "browser", + "isomorphic" + ], + "license": "MIT", + "main": "./dist/arm-appservice-profile-2019-03-01-hybrid.js", + "module": "./esm/webSiteManagementClient.js", + "types": "./esm/webSiteManagementClient.d.ts", + "devDependencies": { + "typescript": "^3.1.1", + "rollup": "^0.66.2", + "rollup-plugin-node-resolve": "^3.4.0", + "rollup-plugin-sourcemaps": "^0.4.2", + "uglify-js": "^3.4.9" + }, + "homepage": "https://github.com/azure/azure-sdk-for-js", + "repository": { + "type": "git", + "url": "https://github.com/azure/azure-sdk-for-js.git" + }, + "bugs": { + "url": "https://github.com/azure/azure-sdk-for-js/issues" + }, + "files": [ + "dist/**/*.js", + "dist/**/*.js.map", + "dist/**/*.d.ts", + "dist/**/*.d.ts.map", + "esm/**/*.js", + "esm/**/*.js.map", + "esm/**/*.d.ts", + "esm/**/*.d.ts.map", + "src/**/*.ts", + "README.md", + "rollup.config.js", + "tsconfig.json" + ], + "scripts": { + "build": "tsc && rollup -c rollup.config.js && npm run minify", + "minify": "uglifyjs -c -m --comments --source-map \"content='./dist/arm-appservice-profile-2019-03-01-hybrid.js.map'\" -o ./dist/arm-appservice-profile-2019-03-01-hybrid.min.js ./dist/arm-appservice-profile-2019-03-01-hybrid.js", + "prepack": "npm install && npm run build" + }, + "sideEffects": false, + "autoPublish": true +} diff --git a/sdk/appservice/arm-appservice-profile-2019-03-01-hybrid/rollup.config.js b/sdk/appservice/arm-appservice-profile-2019-03-01-hybrid/rollup.config.js new file mode 100644 index 000000000000..101fd341c213 --- /dev/null +++ b/sdk/appservice/arm-appservice-profile-2019-03-01-hybrid/rollup.config.js @@ -0,0 +1,37 @@ +import rollup from "rollup"; +import nodeResolve from "rollup-plugin-node-resolve"; +import sourcemaps from "rollup-plugin-sourcemaps"; + +/** + * @type {rollup.RollupFileOptions} + */ +const config = { + input: "./esm/webSiteManagementClient.js", + external: [ + "@azure/ms-rest-js", + "@azure/ms-rest-azure-js" + ], + output: { + file: "./dist/arm-appservice-profile-2019-03-01-hybrid.js", + format: "umd", + name: "Azure.ArmAppserviceProfile20190301Hybrid", + sourcemap: true, + globals: { + "@azure/ms-rest-js": "msRest", + "@azure/ms-rest-azure-js": "msRestAzure" + }, + banner: `/* + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */` + }, + plugins: [ + nodeResolve({ module: true }), + sourcemaps() + ] +}; + +export default config; diff --git a/sdk/appservice/arm-appservice-profile-2019-03-01-hybrid/src/models/appServicePlansMappers.ts b/sdk/appservice/arm-appservice-profile-2019-03-01-hybrid/src/models/appServicePlansMappers.ts new file mode 100644 index 000000000000..82ac3c095957 --- /dev/null +++ b/sdk/appservice/arm-appservice-profile-2019-03-01-hybrid/src/models/appServicePlansMappers.ts @@ -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. + */ + +export { + ApiDefinitionInfo, + ApplicationLogsConfig, + AppServicePlan, + AppServicePlanCollection, + AppServicePlanPatchResource, + AutoHealActions, + AutoHealCustomAction, + AutoHealRules, + AutoHealTriggers, + AzureBlobStorageApplicationLogsConfig, + AzureBlobStorageHttpLogsConfig, + AzureStorageInfoValue, + AzureStoragePropertyDictionaryResource, + AzureTableStorageApplicationLogsConfig, + BackupItem, + BackupRequest, + BackupSchedule, + BaseResource, + BillingMeter, + Capability, + Certificate, + CertificatePatchResource, + CloningInfo, + CloudError, + ConnectionStringDictionary, + ConnStringInfo, + ConnStringValueTypePair, + ContinuousWebJob, + CorsSettings, + CsmUsageQuota, + CsmUsageQuotaCollection, + CustomHostnameAnalysisResult, + DatabaseBackupSetting, + DefaultErrorResponse, + DefaultErrorResponseError, + DefaultErrorResponseErrorDetailsItem, + DeletedAppRestoreRequest, + DeletedSite, + Deployment, + EnabledConfig, + ErrorEntity, + Experiments, + FileSystemApplicationLogsConfig, + FileSystemHttpLogsConfig, + FunctionEnvelope, + FunctionSecrets, + GeoDistribution, + GeoRegion, + HandlerMapping, + HostingEnvironmentProfile, + HostNameBinding, + HostNameSslState, + HttpLogsConfig, + HybridConnection, + HybridConnectionCollection, + HybridConnectionKey, + HybridConnectionLimits, + Identifier, + IpSecurityRestriction, + LocalizableString, + ManagedServiceIdentity, + ManagedServiceIdentityUserAssignedIdentitiesValue, + MigrateMySqlRequest, + MigrateMySqlStatus, + MSDeploy, + MSDeployLog, + MSDeployLogEntry, + MSDeployStatus, + NameValuePair, + NetworkFeatures, + PremierAddOn, + PremierAddOnOffer, + PremierAddOnPatchResource, + PrivateAccess, + PrivateAccessSubnet, + PrivateAccessVirtualNetwork, + ProcessInfo, + ProcessModuleInfo, + ProcessThreadInfo, + ProxyOnlyResource, + PublicCertificate, + PushSettings, + RampUpRule, + Recommendation, + RecommendationRule, + RelayServiceConnectionEntity, + RequestsBasedTrigger, + Resource, + ResourceCollection, + ResourceMetric, + ResourceMetricAvailability, + ResourceMetricCollection, + ResourceMetricDefinition, + ResourceMetricDefinitionCollection, + ResourceMetricName, + ResourceMetricProperty, + ResourceMetricValue, + RestoreRequest, + Site, + SiteAuthSettings, + SiteConfig, + SiteConfigResource, + SiteConfigurationSnapshotInfo, + SiteExtensionInfo, + SiteInstance, + SiteLimits, + SiteLogsConfig, + SiteMachineKey, + SitePatchResource, + SitePhpErrorLogFlag, + SiteSourceControl, + SkuCapacity, + SkuDescription, + SlotConfigNamesResource, + SlotDifference, + SlotSwapStatus, + SlowRequestsBasedTrigger, + Snapshot, + SnapshotRecoverySource, + SnapshotRestoreRequest, + SourceControl, + StatusCodesBasedTrigger, + StorageMigrationOptions, + StorageMigrationResponse, + StringDictionary, + SwiftVirtualNetwork, + TriggeredJobHistory, + TriggeredJobRun, + TriggeredWebJob, + User, + VirtualApplication, + VirtualDirectory, + VnetGateway, + VnetInfo, + VnetParameters, + VnetRoute, + VnetValidationFailureDetails, + VnetValidationTestFailure, + WebAppCollection, + WebJob +} from "../models/mappers"; diff --git a/sdk/appservice/arm-appservice-profile-2019-03-01-hybrid/src/models/certificatesMappers.ts b/sdk/appservice/arm-appservice-profile-2019-03-01-hybrid/src/models/certificatesMappers.ts new file mode 100644 index 000000000000..7bec2cc38f0e --- /dev/null +++ b/sdk/appservice/arm-appservice-profile-2019-03-01-hybrid/src/models/certificatesMappers.ts @@ -0,0 +1,138 @@ +/* + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +export { + ApiDefinitionInfo, + ApplicationLogsConfig, + AppServicePlan, + AppServicePlanPatchResource, + AutoHealActions, + AutoHealCustomAction, + AutoHealRules, + AutoHealTriggers, + AzureBlobStorageApplicationLogsConfig, + AzureBlobStorageHttpLogsConfig, + AzureStorageInfoValue, + AzureStoragePropertyDictionaryResource, + AzureTableStorageApplicationLogsConfig, + BackupItem, + BackupRequest, + BackupSchedule, + BaseResource, + BillingMeter, + Capability, + Certificate, + CertificateCollection, + CertificatePatchResource, + CloningInfo, + CloudError, + ConnectionStringDictionary, + ConnStringInfo, + ConnStringValueTypePair, + ContinuousWebJob, + CorsSettings, + CustomHostnameAnalysisResult, + DatabaseBackupSetting, + DefaultErrorResponse, + DefaultErrorResponseError, + DefaultErrorResponseErrorDetailsItem, + DeletedAppRestoreRequest, + DeletedSite, + Deployment, + EnabledConfig, + ErrorEntity, + Experiments, + FileSystemApplicationLogsConfig, + FileSystemHttpLogsConfig, + FunctionEnvelope, + FunctionSecrets, + GeoDistribution, + GeoRegion, + HandlerMapping, + HostingEnvironmentProfile, + HostNameBinding, + HostNameSslState, + HttpLogsConfig, + HybridConnection, + HybridConnectionKey, + HybridConnectionLimits, + Identifier, + IpSecurityRestriction, + ManagedServiceIdentity, + ManagedServiceIdentityUserAssignedIdentitiesValue, + MigrateMySqlRequest, + MigrateMySqlStatus, + MSDeploy, + MSDeployLog, + MSDeployLogEntry, + MSDeployStatus, + NameValuePair, + NetworkFeatures, + PremierAddOn, + PremierAddOnOffer, + PremierAddOnPatchResource, + PrivateAccess, + PrivateAccessSubnet, + PrivateAccessVirtualNetwork, + ProcessInfo, + ProcessModuleInfo, + ProcessThreadInfo, + ProxyOnlyResource, + PublicCertificate, + PushSettings, + RampUpRule, + Recommendation, + RecommendationRule, + RelayServiceConnectionEntity, + RequestsBasedTrigger, + Resource, + ResourceMetricAvailability, + ResourceMetricDefinition, + RestoreRequest, + Site, + SiteAuthSettings, + SiteConfig, + SiteConfigResource, + SiteConfigurationSnapshotInfo, + SiteExtensionInfo, + SiteInstance, + SiteLimits, + SiteLogsConfig, + SiteMachineKey, + SitePatchResource, + SitePhpErrorLogFlag, + SiteSourceControl, + SkuCapacity, + SkuDescription, + SlotConfigNamesResource, + SlotDifference, + SlotSwapStatus, + SlowRequestsBasedTrigger, + Snapshot, + SnapshotRecoverySource, + SnapshotRestoreRequest, + SourceControl, + StatusCodesBasedTrigger, + StorageMigrationOptions, + StorageMigrationResponse, + StringDictionary, + SwiftVirtualNetwork, + TriggeredJobHistory, + TriggeredJobRun, + TriggeredWebJob, + User, + VirtualApplication, + VirtualDirectory, + VnetGateway, + VnetInfo, + VnetParameters, + VnetRoute, + VnetValidationFailureDetails, + VnetValidationTestFailure, + WebJob +} from "../models/mappers"; diff --git a/sdk/appservice/arm-appservice-profile-2019-03-01-hybrid/src/models/index.ts b/sdk/appservice/arm-appservice-profile-2019-03-01-hybrid/src/models/index.ts new file mode 100644 index 000000000000..f63d756b67f8 --- /dev/null +++ b/sdk/appservice/arm-appservice-profile-2019-03-01-hybrid/src/models/index.ts @@ -0,0 +1,15891 @@ +/* + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for 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, CloudError, AzureServiceClientOptions } from "@azure/ms-rest-azure-js"; +import * as msRest from "@azure/ms-rest-js"; + +export { BaseResource, CloudError }; + +/** + * Specification for an App Service Environment to use for this resource. + */ +export interface HostingEnvironmentProfile { + /** + * Resource ID of the App Service Environment. + */ + id?: string; + /** + * Name of the App Service Environment. + * **NOTE: This property will not be serialized. It can only be populated by the server.** + */ + readonly name?: string; + /** + * Resource type of the App Service Environment. + * **NOTE: This property will not be serialized. It can only be populated by the server.** + */ + readonly type?: string; +} + +/** + * Azure resource. This resource is tracked in Azure Resource Manager + */ +export interface Resource extends BaseResource { + /** + * Resource Id. + * **NOTE: This property will not be serialized. It can only be populated by the server.** + */ + readonly id?: string; + /** + * Resource Name. + * **NOTE: This property will not be serialized. It can only be populated by the server.** + */ + readonly name?: string; + /** + * Kind of resource. + */ + kind?: string; + /** + * Resource Location. + */ + location: string; + /** + * Resource type. + * **NOTE: This property will not be serialized. It can only be populated by the server.** + */ + readonly type?: string; + /** + * Resource tags. + */ + tags?: { [propertyName: string]: string }; +} + +/** + * SSL certificate for an app. + */ +export interface Certificate extends Resource { + /** + * Friendly name of the certificate. + * **NOTE: This property will not be serialized. It can only be populated by the server.** + */ + readonly friendlyName?: string; + /** + * Subject name of the certificate. + * **NOTE: This property will not be serialized. It can only be populated by the server.** + */ + readonly subjectName?: string; + /** + * Host names the certificate applies to. + */ + hostNames?: string[]; + /** + * Pfx blob. + */ + pfxBlob?: Uint8Array; + /** + * App name. + * **NOTE: This property will not be serialized. It can only be populated by the server.** + */ + readonly siteName?: string; + /** + * Self link. + * **NOTE: This property will not be serialized. It can only be populated by the server.** + */ + readonly selfLink?: string; + /** + * Certificate issuer. + * **NOTE: This property will not be serialized. It can only be populated by the server.** + */ + readonly issuer?: string; + /** + * Certificate issue Date. + * **NOTE: This property will not be serialized. It can only be populated by the server.** + */ + readonly issueDate?: Date; + /** + * Certificate expiration date. + * **NOTE: This property will not be serialized. It can only be populated by the server.** + */ + readonly expirationDate?: Date; + /** + * Certificate password. + */ + password: string; + /** + * Certificate thumbprint. + * **NOTE: This property will not be serialized. It can only be populated by the server.** + */ + readonly thumbprint?: string; + /** + * Is the certificate valid?. + * **NOTE: This property will not be serialized. It can only be populated by the server.** + */ + readonly valid?: boolean; + /** + * Raw bytes of .cer file + * **NOTE: This property will not be serialized. It can only be populated by the server.** + */ + readonly cerBlob?: Uint8Array; + /** + * Public key hash. + * **NOTE: This property will not be serialized. It can only be populated by the server.** + */ + readonly publicKeyHash?: string; + /** + * Specification for the App Service Environment to use for the certificate. + * **NOTE: This property will not be serialized. It can only be populated by the server.** + */ + readonly hostingEnvironmentProfile?: HostingEnvironmentProfile; + /** + * Key Vault Csm resource Id. + */ + keyVaultId?: string; + /** + * Key Vault secret name. + */ + keyVaultSecretName?: string; + /** + * Status of the Key Vault secret. Possible values include: 'Initialized', + * 'WaitingOnCertificateOrder', 'Succeeded', 'CertificateOrderFailed', + * 'OperationNotPermittedOnKeyVault', 'AzureServiceUnauthorizedToAccessKeyVault', + * 'KeyVaultDoesNotExist', 'KeyVaultSecretDoesNotExist', 'UnknownError', 'ExternalPrivateKey', + * 'Unknown' + * **NOTE: This property will not be serialized. It can only be populated by the server.** + */ + readonly keyVaultSecretStatus?: KeyVaultSecretStatus; + /** + * Resource ID of the associated App Service plan, formatted as: + * "/subscriptions/{subscriptionID}/resourceGroups/{groupName}/providers/Microsoft.Web/serverfarms/{appServicePlanName}". + */ + serverFarmId?: string; +} + +/** + * Azure proxy only resource. This resource is not tracked by Azure Resource Manager. + */ +export interface ProxyOnlyResource extends BaseResource { + /** + * Resource Id. + * **NOTE: This property will not be serialized. It can only be populated by the server.** + */ + readonly id?: string; + /** + * Resource Name. + * **NOTE: This property will not be serialized. It can only be populated by the server.** + */ + readonly name?: string; + /** + * Kind of resource. + */ + kind?: string; + /** + * Resource type. + * **NOTE: This property will not be serialized. It can only be populated by the server.** + */ + readonly type?: string; +} + +/** + * ARM resource for a certificate. + */ +export interface CertificatePatchResource extends ProxyOnlyResource { + /** + * Friendly name of the certificate. + * **NOTE: This property will not be serialized. It can only be populated by the server.** + */ + readonly friendlyName?: string; + /** + * Subject name of the certificate. + * **NOTE: This property will not be serialized. It can only be populated by the server.** + */ + readonly subjectName?: string; + /** + * Host names the certificate applies to. + */ + hostNames?: string[]; + /** + * Pfx blob. + */ + pfxBlob?: Uint8Array; + /** + * App name. + * **NOTE: This property will not be serialized. It can only be populated by the server.** + */ + readonly siteName?: string; + /** + * Self link. + * **NOTE: This property will not be serialized. It can only be populated by the server.** + */ + readonly selfLink?: string; + /** + * Certificate issuer. + * **NOTE: This property will not be serialized. It can only be populated by the server.** + */ + readonly issuer?: string; + /** + * Certificate issue Date. + * **NOTE: This property will not be serialized. It can only be populated by the server.** + */ + readonly issueDate?: Date; + /** + * Certificate expiration date. + * **NOTE: This property will not be serialized. It can only be populated by the server.** + */ + readonly expirationDate?: Date; + /** + * Certificate password. + */ + password: string; + /** + * Certificate thumbprint. + * **NOTE: This property will not be serialized. It can only be populated by the server.** + */ + readonly thumbprint?: string; + /** + * Is the certificate valid?. + * **NOTE: This property will not be serialized. It can only be populated by the server.** + */ + readonly valid?: boolean; + /** + * Raw bytes of .cer file + * **NOTE: This property will not be serialized. It can only be populated by the server.** + */ + readonly cerBlob?: Uint8Array; + /** + * Public key hash. + * **NOTE: This property will not be serialized. It can only be populated by the server.** + */ + readonly publicKeyHash?: string; + /** + * Specification for the App Service Environment to use for the certificate. + * **NOTE: This property will not be serialized. It can only be populated by the server.** + */ + readonly hostingEnvironmentProfile?: HostingEnvironmentProfile; + /** + * Key Vault Csm resource Id. + */ + keyVaultId?: string; + /** + * Key Vault secret name. + */ + keyVaultSecretName?: string; + /** + * Status of the Key Vault secret. Possible values include: 'Initialized', + * 'WaitingOnCertificateOrder', 'Succeeded', 'CertificateOrderFailed', + * 'OperationNotPermittedOnKeyVault', 'AzureServiceUnauthorizedToAccessKeyVault', + * 'KeyVaultDoesNotExist', 'KeyVaultSecretDoesNotExist', 'UnknownError', 'ExternalPrivateKey', + * 'Unknown' + * **NOTE: This property will not be serialized. It can only be populated by the server.** + */ + readonly keyVaultSecretStatus?: KeyVaultSecretStatus; + /** + * Resource ID of the associated App Service plan, formatted as: + * "/subscriptions/{subscriptionID}/resourceGroups/{groupName}/providers/Microsoft.Web/serverfarms/{appServicePlanName}". + */ + serverFarmId?: string; +} + +/** + * Virtual Network route contract used to pass routing information for a Virtual Network. + */ +export interface VnetRoute extends ProxyOnlyResource { + /** + * The starting address for this route. This may also include a CIDR notation, in which case the + * end address must not be specified. + */ + startAddress?: string; + /** + * The ending address for this route. If the start address is specified in CIDR notation, this + * must be omitted. + */ + endAddress?: string; + /** + * 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' + */ + routeType?: RouteType; +} + +/** + * Virtual Network information contract. + */ +export interface VnetInfo extends ProxyOnlyResource { + /** + * The Virtual Network's resource ID. + */ + vnetResourceId?: string; + /** + * The client certificate thumbprint. + * **NOTE: This property will not be serialized. It can only be populated by the server.** + */ + readonly certThumbprint?: string; + /** + * A certificate file (.cer) blob containing the public key of the private key used to + * authenticate a + * Point-To-Site VPN connection. + */ + certBlob?: string; + /** + * The routes that this Virtual Network connection uses. + * **NOTE: This property will not be serialized. It can only be populated by the server.** + */ + readonly routes?: VnetRoute[]; + /** + * true if a resync is required; otherwise, false. + * **NOTE: This property will not be serialized. It can only be populated by the server.** + */ + readonly resyncRequired?: boolean; + /** + * DNS servers to be used by this Virtual Network. This should be a comma-separated list of IP + * addresses. + */ + dnsServers?: string; + /** + * Flag that is used to denote if this is VNET injection + */ + isSwift?: boolean; +} + +/** + * The Virtual Network gateway contract. This is used to give the Virtual Network gateway access to + * the VPN package. + */ +export interface VnetGateway extends ProxyOnlyResource { + /** + * The Virtual Network name. + */ + vnetName?: string; + /** + * The URI where the VPN package can be downloaded. + */ + vpnPackageUri: string; +} + +/** + * User credentials used for publishing activity. + */ +export interface User extends ProxyOnlyResource { + /** + * Username used for publishing. + */ + publishingUserName: string; + /** + * Password used for publishing. + */ + publishingPassword?: string; + /** + * Password hash used for publishing. + */ + publishingPasswordHash?: string; + /** + * Password hash salt used for publishing. + */ + publishingPasswordHashSalt?: string; + /** + * Url of SCM site. + */ + scmUri?: string; +} + +/** + * A snapshot of an app. + */ +export interface Snapshot extends ProxyOnlyResource { + /** + * The time the snapshot was taken. + * **NOTE: This property will not be serialized. It can only be populated by the server.** + */ + readonly time?: string; +} + +/** + * Metrics availability and retention. + */ +export interface ResourceMetricAvailability { + /** + * Time grain . + * **NOTE: This property will not be serialized. It can only be populated by the server.** + */ + readonly timeGrain?: string; + /** + * Retention period for the current time grain. + * **NOTE: This property will not be serialized. It can only be populated by the server.** + */ + readonly retention?: string; +} + +/** + * Metadata for the metrics. + */ +export interface ResourceMetricDefinition extends ProxyOnlyResource { + /** + * Unit of the metric. + * **NOTE: This property will not be serialized. It can only be populated by the server.** + */ + readonly unit?: string; + /** + * Primary aggregation type. + * **NOTE: This property will not be serialized. It can only be populated by the server.** + */ + readonly primaryAggregationType?: string; + /** + * List of time grains supported for the metric together with retention period. + * **NOTE: This property will not be serialized. It can only be populated by the server.** + */ + readonly metricAvailabilities?: ResourceMetricAvailability[]; + /** + * Resource URI. + * **NOTE: This property will not be serialized. It can only be populated by the server.** + */ + readonly resourceUri?: string; + /** + * Resource metric definition properties. + * **NOTE: This property will not be serialized. It can only be populated by the server.** + */ + readonly properties?: { [propertyName: string]: string }; +} + +/** + * Push settings for the App. + */ +export interface PushSettings extends ProxyOnlyResource { + /** + * Gets or sets a flag indicating whether the Push endpoint is enabled. + */ + isPushEnabled: boolean; + /** + * Gets or sets a JSON string containing a list of tags that are whitelisted for use by the push + * registration endpoint. + */ + tagWhitelistJson?: string; + /** + * Gets or sets a JSON string containing a list of tags that require user authentication to be + * used in the push registration endpoint. + * Tags can consist of alphanumeric characters and the following: + * '_', '@', '#', '.', ':', '-'. + * Validation should be performed at the PushRequestHandler. + */ + tagsRequiringAuth?: string; + /** + * Gets or sets a JSON string containing a list of dynamic tags that will be evaluated from user + * claims in the push registration endpoint. + */ + dynamicTagsJson?: string; +} + +/** + * A domain specific resource identifier. + */ +export interface Identifier extends ProxyOnlyResource { + /** + * String representation of the identity. + */ + identifierId?: string; +} + +/** + * Hybrid Connection key contract. This has the send key name and value for a Hybrid Connection. + */ +export interface HybridConnectionKey extends ProxyOnlyResource { + /** + * The name of the send key. + * **NOTE: This property will not be serialized. It can only be populated by the server.** + */ + readonly sendKeyName?: string; + /** + * The value of the send key. + * **NOTE: This property will not be serialized. It can only be populated by the server.** + */ + readonly sendKeyValue?: string; +} + +/** + * Hybrid Connection contract. This is used to configure a Hybrid Connection. + */ +export interface HybridConnection extends ProxyOnlyResource { + /** + * The name of the Service Bus namespace. + */ + serviceBusNamespace?: string; + /** + * The name of the Service Bus relay. + */ + relayName?: string; + /** + * The ARM URI to the Service Bus relay. + */ + relayArmUri?: string; + /** + * The hostname of the endpoint. + */ + hostname?: string; + /** + * The port of the endpoint. + */ + port?: number; + /** + * The name of the Service Bus key which has Send permissions. This is used to authenticate to + * Service Bus. + */ + sendKeyName?: string; + /** + * 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. + */ + sendKeyValue?: string; + /** + * The suffix for the service bus endpoint. By default this is .servicebus.windows.net + */ + serviceBusSuffix?: string; +} + +/** + * A deleted app. + */ +export interface DeletedSite extends ProxyOnlyResource { + /** + * Numeric id for the deleted site + * **NOTE: This property will not be serialized. It can only be populated by the server.** + */ + readonly deletedSiteId?: number; + /** + * Time in UTC when the app was deleted. + * **NOTE: This property will not be serialized. It can only be populated by the server.** + */ + readonly deletedTimestamp?: string; + /** + * Subscription containing the deleted site + * **NOTE: This property will not be serialized. It can only be populated by the server.** + */ + readonly subscription?: string; + /** + * ResourceGroup that contained the deleted site + * **NOTE: This property will not be serialized. It can only be populated by the server.** + */ + readonly resourceGroup?: string; + /** + * Name of the deleted site + * **NOTE: This property will not be serialized. It can only be populated by the server.** + */ + readonly deletedSiteName?: string; + /** + * Slot of the deleted site + * **NOTE: This property will not be serialized. It can only be populated by the server.** + */ + readonly slot?: string; + /** + * Kind of site that was deleted + * **NOTE: This property will not be serialized. It can only be populated by the server.** + */ + readonly deletedSiteKind?: string; + /** + * Geo Region of the deleted site + * **NOTE: This property will not be serialized. It can only be populated by the server.** + */ + readonly geoRegionName?: string; +} + +/** + * An interface representing ManagedServiceIdentityUserAssignedIdentitiesValue. + */ +export interface ManagedServiceIdentityUserAssignedIdentitiesValue { + /** + * Principal Id of user assigned identity + * **NOTE: This property will not be serialized. It can only be populated by the server.** + */ + readonly principalId?: string; + /** + * Client Id of user assigned identity + * **NOTE: This property will not be serialized. It can only be populated by the server.** + */ + readonly clientId?: string; +} + +/** + * Managed service identity. + */ +export interface ManagedServiceIdentity { + /** + * Type of managed service identity. Possible values include: 'SystemAssigned', 'UserAssigned', + * 'SystemAssigned, UserAssigned', 'None' + */ + type?: ManagedServiceIdentityType; + /** + * Tenant of managed service identity. + * **NOTE: This property will not be serialized. It can only be populated by the server.** + */ + readonly tenantId?: string; + /** + * Principal Id of managed service identity. + * **NOTE: This property will not be serialized. It can only be populated by the server.** + */ + readonly principalId?: string; + /** + * The list of user assigned identities associated with the resource. The user identity + * dictionary key references will be ARM resource ids in the form: + * '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedIdentity/userAssignedIdentities/{identityName} + */ + userAssignedIdentities?: { [propertyName: string]: ManagedServiceIdentityUserAssignedIdentitiesValue }; +} + +/** + * A global distribution definition. + */ +export interface GeoDistribution { + /** + * Location. + */ + location?: string; + /** + * NumberOfWorkers. + */ + numberOfWorkers?: number; +} + +/** + * The status of the last successful slot swap operation. + */ +export interface SlotSwapStatus { + /** + * The time the last successful slot swap completed. + * **NOTE: This property will not be serialized. It can only be populated by the server.** + */ + readonly timestampUtc?: Date; + /** + * The source slot of the last swap operation. + * **NOTE: This property will not be serialized. It can only be populated by the server.** + */ + readonly sourceSlotName?: string; + /** + * The destination slot of the last swap operation. + * **NOTE: This property will not be serialized. It can only be populated by the server.** + */ + readonly destinationSlotName?: string; +} + +/** + * Information needed for cloning operation. + */ +export interface CloningInfo { + /** + * Correlation ID of cloning operation. This ID ties multiple cloning operations + * together to use the same snapshot. + */ + correlationId?: string; + /** + * true to overwrite destination app; otherwise, false. + */ + overwrite?: boolean; + /** + * true to clone custom hostnames from source app; otherwise, false. + */ + cloneCustomHostNames?: boolean; + /** + * true to clone source control from source app; otherwise, false. + */ + cloneSourceControl?: boolean; + /** + * 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. + */ + sourceWebAppId: string; + /** + * Location of source app ex: West US or North Europe + */ + sourceWebAppLocation?: string; + /** + * App Service Environment. + */ + hostingEnvironment?: string; + /** + * 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. + */ + appSettingsOverrides?: { [propertyName: string]: string }; + /** + * true to configure load balancing for source and destination app. + */ + configureLoadBalancing?: boolean; + /** + * 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}. + */ + trafficManagerProfileId?: string; + /** + * Name of Traffic Manager profile to create. This is only needed if Traffic Manager profile does + * not already exist. + */ + trafficManagerProfileName?: string; +} + +/** + * IP security restriction on an app. + */ +export interface IpSecurityRestriction { + /** + * 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. + */ + ipAddress?: string; + /** + * Subnet mask for the range of IP addresses the restriction is valid for. + */ + subnetMask?: string; + /** + * Virtual network resource id + */ + vnetSubnetResourceId?: string; + /** + * (internal) Vnet traffic tag + */ + vnetTrafficTag?: number; + /** + * (internal) Subnet traffic tag + */ + subnetTrafficTag?: number; + /** + * Allow or Deny access for this IP range. + */ + action?: string; + /** + * Defines what this IP filter will be used for. This is to support IP filtering on proxies. + * Possible values include: 'Default', 'XffProxy' + */ + tag?: IpFilterTag; + /** + * Priority of IP restriction rule. + */ + priority?: number; + /** + * IP restriction rule name. + */ + name?: string; + /** + * IP restriction rule description. + */ + description?: string; +} + +/** + * Information about the formal API definition for the app. + */ +export interface ApiDefinitionInfo { + /** + * The URL of the API definition. + */ + url?: string; +} + +/** + * Cross-Origin Resource Sharing (CORS) settings for the app. + */ +export interface CorsSettings { + /** + * Gets or sets the list of origins that should be allowed to make cross-origin + * calls (for example: http://example.com:12345). Use "*" to allow all. + */ + allowedOrigins?: string[]; + /** + * Gets or sets whether CORS requests with credentials are allowed. See + * https://developer.mozilla.org/en-US/docs/Web/HTTP/CORS#Requests_with_credentials + * for more details. + */ + supportCredentials?: boolean; +} + +/** + * Custom action to be executed + * when an auto heal rule is triggered. + */ +export interface AutoHealCustomAction { + /** + * Executable to be run. + */ + exe?: string; + /** + * Parameters for the executable. + */ + parameters?: string; +} + +/** + * Actions which to take by the auto-heal module when a rule is triggered. + */ +export interface AutoHealActions { + /** + * Predefined action to be taken. Possible values include: 'Recycle', 'LogEvent', 'CustomAction' + */ + actionType?: AutoHealActionType; + /** + * Custom action to be taken. + */ + customAction?: AutoHealCustomAction; + /** + * Minimum time the process must execute + * before taking the action + */ + minProcessExecutionTime?: string; +} + +/** + * Trigger based on request execution time. + */ +export interface SlowRequestsBasedTrigger { + /** + * Time taken. + */ + timeTaken?: string; + /** + * Request Count. + */ + count?: number; + /** + * Time interval. + */ + timeInterval?: string; +} + +/** + * Trigger based on status code. + */ +export interface StatusCodesBasedTrigger { + /** + * HTTP status code. + */ + status?: number; + /** + * Request Sub Status. + */ + subStatus?: number; + /** + * Win32 error code. + */ + win32Status?: number; + /** + * Request Count. + */ + count?: number; + /** + * Time interval. + */ + timeInterval?: string; +} + +/** + * Trigger based on total requests. + */ +export interface RequestsBasedTrigger { + /** + * Request Count. + */ + count?: number; + /** + * Time interval. + */ + timeInterval?: string; +} + +/** + * Triggers for auto-heal. + */ +export interface AutoHealTriggers { + /** + * A rule based on total requests. + */ + requests?: RequestsBasedTrigger; + /** + * A rule based on private bytes. + */ + privateBytesInKB?: number; + /** + * A rule based on status codes. + */ + statusCodes?: StatusCodesBasedTrigger[]; + /** + * A rule based on request execution time. + */ + slowRequests?: SlowRequestsBasedTrigger; +} + +/** + * Rules that can be defined for auto-heal. + */ +export interface AutoHealRules { + /** + * Conditions that describe when to execute the auto-heal actions. + */ + triggers?: AutoHealTriggers; + /** + * Actions to be executed when a rule is triggered. + */ + actions?: AutoHealActions; +} + +/** + * Metric limits set on an app. + */ +export interface SiteLimits { + /** + * Maximum allowed CPU usage percentage. + */ + maxPercentageCpu?: number; + /** + * Maximum allowed memory usage in MB. + */ + maxMemoryInMb?: number; + /** + * Maximum allowed disk size usage in MB. + */ + maxDiskSizeInMb?: number; +} + +/** + * Routing rules for ramp up testing. This rule allows to redirect static traffic % to a slot or to + * gradually change routing % based on performance. + */ +export interface RampUpRule { + /** + * Hostname of a slot to which the traffic will be redirected if decided to. E.g. + * myapp-stage.azurewebsites.net. + */ + actionHostName?: string; + /** + * Percentage of the traffic which will be redirected to ActionHostName. + */ + reroutePercentage?: number; + /** + * In auto ramp up scenario this is the step to add/remove from ReroutePercentage + * until it reaches + * MinReroutePercentage or MaxReroutePercentage. Site metrics are + * checked every N minutes specified in ChangeIntervalInMinutes. + * Custom decision algorithm can be provided in TiPCallback site extension which URL can be + * specified in ChangeDecisionCallbackUrl. + */ + changeStep?: number; + /** + * Specifies interval in minutes to reevaluate ReroutePercentage. + */ + changeIntervalInMinutes?: number; + /** + * Specifies lower boundary above which ReroutePercentage will stay. + */ + minReroutePercentage?: number; + /** + * Specifies upper boundary below which ReroutePercentage will stay. + */ + maxReroutePercentage?: number; + /** + * 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/ + */ + changeDecisionCallbackUrl?: string; + /** + * Name of the routing rule. The recommended name would be to point to the slot which will + * receive the traffic in the experiment. + */ + name?: string; +} + +/** + * Routing rules in production experiments. + */ +export interface Experiments { + /** + * List of ramp-up rules. + */ + rampUpRules?: RampUpRule[]; +} + +/** + * Directory for virtual application. + */ +export interface VirtualDirectory { + /** + * Path to virtual application. + */ + virtualPath?: string; + /** + * Physical path. + */ + physicalPath?: string; +} + +/** + * Virtual application in an app. + */ +export interface VirtualApplication { + /** + * Virtual path. + */ + virtualPath?: string; + /** + * Physical path. + */ + physicalPath?: string; + /** + * true if preloading is enabled; otherwise, false. + */ + preloadEnabled?: boolean; + /** + * Virtual directories for virtual application. + */ + virtualDirectories?: VirtualDirectory[]; +} + +/** + * 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. + */ +export interface HandlerMapping { + /** + * Requests with this extension will be handled using the specified FastCGI application. + */ + extension?: string; + /** + * The absolute path to the FastCGI application. + */ + scriptProcessor?: string; + /** + * Command-line arguments to be passed to the script processor. + */ + argumentsProperty?: string; +} + +/** + * MachineKey of an app. + */ +export interface SiteMachineKey { + /** + * MachineKey validation. + */ + validation?: string; + /** + * Validation key. + */ + validationKey?: string; + /** + * Algorithm used for decryption. + */ + decryption?: string; + /** + * Decryption key. + */ + decryptionKey?: string; +} + +/** + * Database connection string information. + */ +export interface ConnStringInfo { + /** + * Name of connection string. + */ + name?: string; + /** + * Connection string value. + */ + connectionString?: string; + /** + * Type of database. Possible values include: 'MySql', 'SQLServer', 'SQLAzure', 'Custom', + * 'NotificationHub', 'ServiceBus', 'EventHub', 'ApiHub', 'DocDb', 'RedisCache', 'PostgreSQL' + */ + type?: ConnectionStringType; +} + +/** + * Azure Files or Blob Storage access information value for dictionary storage. + */ +export interface AzureStorageInfoValue { + /** + * Type of storage. Possible values include: 'AzureFiles', 'AzureBlob' + */ + type?: AzureStorageType; + /** + * Name of the storage account. + */ + accountName?: string; + /** + * Name of the file share (container name, for Blob storage). + */ + shareName?: string; + /** + * Access key for the storage account. + */ + accessKey?: string; + /** + * Path to mount the storage within the site's runtime environment. + */ + mountPath?: string; + /** + * State of the storage account. Possible values include: 'Ok', 'InvalidCredentials', + * 'InvalidShare' + * **NOTE: This property will not be serialized. It can only be populated by the server.** + */ + readonly state?: AzureStorageState; +} + +/** + * Name value pair. + */ +export interface NameValuePair { + /** + * Pair name. + */ + name?: string; + /** + * Pair value. + */ + value?: string; +} + +/** + * Configuration of an App Service app. + */ +export interface SiteConfig { + /** + * Number of workers. + */ + numberOfWorkers?: number; + /** + * Default documents. + */ + defaultDocuments?: string[]; + /** + * .NET Framework version. Default value: 'v4.6'. + */ + netFrameworkVersion?: string; + /** + * Version of PHP. + */ + phpVersion?: string; + /** + * Version of Python. + */ + pythonVersion?: string; + /** + * Version of Node.js. + */ + nodeVersion?: string; + /** + * Linux App Framework and version + */ + linuxFxVersion?: string; + /** + * Xenon App Framework and version + */ + windowsFxVersion?: string; + /** + * true if request tracing is enabled; otherwise, false. + */ + requestTracingEnabled?: boolean; + /** + * Request tracing expiration time. + */ + requestTracingExpirationTime?: Date; + /** + * true if remote debugging is enabled; otherwise, false. + */ + remoteDebuggingEnabled?: boolean; + /** + * Remote debugging version. + */ + remoteDebuggingVersion?: string; + /** + * true if HTTP logging is enabled; otherwise, false. + */ + httpLoggingEnabled?: boolean; + /** + * HTTP logs directory size limit. + */ + logsDirectorySizeLimit?: number; + /** + * true if detailed error logging is enabled; otherwise, false. + */ + detailedErrorLoggingEnabled?: boolean; + /** + * Publishing user name. + */ + publishingUsername?: string; + /** + * Application settings. + */ + appSettings?: NameValuePair[]; + /** + * User-provided Azure storage accounts. + */ + azureStorageAccounts?: { [propertyName: string]: AzureStorageInfoValue }; + /** + * Connection strings. + */ + connectionStrings?: ConnStringInfo[]; + /** + * Site MachineKey. + * **NOTE: This property will not be serialized. It can only be populated by the server.** + */ + readonly machineKey?: SiteMachineKey; + /** + * Handler mappings. + */ + handlerMappings?: HandlerMapping[]; + /** + * Document root. + */ + documentRoot?: string; + /** + * SCM type. Possible values include: 'None', 'Dropbox', 'Tfs', 'LocalGit', 'GitHub', + * 'CodePlexGit', 'CodePlexHg', 'BitbucketGit', 'BitbucketHg', 'ExternalGit', 'ExternalHg', + * 'OneDrive', 'VSO' + */ + scmType?: ScmType; + /** + * true to use 32-bit worker process; otherwise, false. + */ + use32BitWorkerProcess?: boolean; + /** + * true if WebSocket is enabled; otherwise, false. + */ + webSocketsEnabled?: boolean; + /** + * true if Always On is enabled; otherwise, false. + */ + alwaysOn?: boolean; + /** + * Java version. + */ + javaVersion?: string; + /** + * Java container. + */ + javaContainer?: string; + /** + * Java container version. + */ + javaContainerVersion?: string; + /** + * App command line to launch. + */ + appCommandLine?: string; + /** + * Managed pipeline mode. Possible values include: 'Integrated', 'Classic' + */ + managedPipelineMode?: ManagedPipelineMode; + /** + * Virtual applications. + */ + virtualApplications?: VirtualApplication[]; + /** + * Site load balancing. Possible values include: 'WeightedRoundRobin', 'LeastRequests', + * 'LeastResponseTime', 'WeightedTotalTraffic', 'RequestHash' + */ + loadBalancing?: SiteLoadBalancing; + /** + * This is work around for polymorphic types. + */ + experiments?: Experiments; + /** + * Site limits. + */ + limits?: SiteLimits; + /** + * true if Auto Heal is enabled; otherwise, false. + */ + autoHealEnabled?: boolean; + /** + * Auto Heal rules. + */ + autoHealRules?: AutoHealRules; + /** + * Tracing options. + */ + tracingOptions?: string; + /** + * Virtual Network name. + */ + vnetName?: string; + /** + * Cross-Origin Resource Sharing (CORS) settings. + */ + cors?: CorsSettings; + /** + * Push endpoint settings. + */ + push?: PushSettings; + /** + * Information about the formal API definition for the app. + */ + apiDefinition?: ApiDefinitionInfo; + /** + * Auto-swap slot name. + */ + autoSwapSlotName?: string; + /** + * true to enable local MySQL; otherwise, false. Default value: false. + */ + localMySqlEnabled?: boolean; + /** + * Managed Service Identity Id + */ + managedServiceIdentityId?: number; + /** + * Explicit Managed Service Identity Id + */ + xManagedServiceIdentityId?: number; + /** + * IP security restrictions for main. + */ + ipSecurityRestrictions?: IpSecurityRestriction[]; + /** + * IP security restrictions for scm. + */ + scmIpSecurityRestrictions?: IpSecurityRestriction[]; + /** + * IP security restrictions for scm to use main. + */ + scmIpSecurityRestrictionsUseMain?: boolean; + /** + * Http20Enabled: configures a web site to allow clients to connect over http2.0. Default value: + * true. + */ + http20Enabled?: boolean; + /** + * MinTlsVersion: configures the minimum version of TLS required for SSL requests. Possible + * values include: '1.0', '1.1', '1.2' + */ + minTlsVersion?: SupportedTlsVersions; + /** + * State of FTP / FTPS service. Possible values include: 'AllAllowed', 'FtpsOnly', 'Disabled' + */ + ftpsState?: FtpsState; + /** + * Number of reserved instances. + * This setting only applies to the Consumption Plan + */ + reservedInstanceCount?: number; +} + +/** + * SSL-enabled hostname. + */ +export interface HostNameSslState { + /** + * Hostname. + */ + name?: string; + /** + * SSL type. Possible values include: 'Disabled', 'SniEnabled', 'IpBasedEnabled' + */ + sslState?: SslState; + /** + * Virtual IP address assigned to the hostname if IP based SSL is enabled. + */ + virtualIP?: string; + /** + * SSL certificate thumbprint. + */ + thumbprint?: string; + /** + * Set to true to update existing hostname. + */ + toUpdate?: boolean; + /** + * Indicates whether the hostname is a standard or repository hostname. Possible values include: + * 'Standard', 'Repository' + */ + hostType?: HostType; +} + +/** + * A web app, a mobile app backend, or an API app. + */ +export interface Site extends Resource { + /** + * Current state of the app. + * **NOTE: This property will not be serialized. It can only be populated by the server.** + */ + readonly state?: string; + /** + * Hostnames associated with the app. + * **NOTE: This property will not be serialized. It can only be populated by the server.** + */ + readonly hostNames?: string[]; + /** + * Name of the repository site. + * **NOTE: This property will not be serialized. It can only be populated by the server.** + */ + readonly repositorySiteName?: string; + /** + * State indicating whether the app has exceeded its quota usage. Read-only. Possible values + * include: 'Normal', 'Exceeded' + * **NOTE: This property will not be serialized. It can only be populated by the server.** + */ + readonly usageState?: UsageState; + /** + * true if the app is enabled; otherwise, false. Setting this value to + * false disables the app (takes the app offline). + */ + enabled?: boolean; + /** + * Enabled hostnames for the app.Hostnames need to be assigned (see HostNames) AND enabled. + * Otherwise, + * the app is not served on those hostnames. + * **NOTE: This property will not be serialized. It can only be populated by the server.** + */ + readonly enabledHostNames?: string[]; + /** + * Management information availability state for the app. Possible values include: 'Normal', + * 'Limited', 'DisasterRecoveryMode' + * **NOTE: This property will not be serialized. It can only be populated by the server.** + */ + readonly availabilityState?: SiteAvailabilityState; + /** + * Hostname SSL states are used to manage the SSL bindings for app's hostnames. + */ + hostNameSslStates?: HostNameSslState[]; + /** + * Resource ID of the associated App Service plan, formatted as: + * "/subscriptions/{subscriptionID}/resourceGroups/{groupName}/providers/Microsoft.Web/serverfarms/{appServicePlanName}". + */ + serverFarmId?: string; + /** + * true if reserved; otherwise, false. Default value: false. + */ + reserved?: boolean; + /** + * Obsolete: Hyper-V sandbox. Default value: false. + */ + isXenon?: boolean; + /** + * Hyper-V sandbox. Default value: false. + */ + hyperV?: boolean; + /** + * Last time the app was modified, in UTC. Read-only. + * **NOTE: This property will not be serialized. It can only be populated by the server.** + */ + readonly lastModifiedTimeUtc?: Date; + /** + * Configuration of the app. + */ + siteConfig?: SiteConfig; + /** + * Azure Traffic Manager hostnames associated with the app. Read-only. + * **NOTE: This property will not be serialized. It can only be populated by the server.** + */ + readonly trafficManagerHostNames?: string[]; + /** + * true to stop SCM (KUDU) site when the app is stopped; otherwise, + * false. The default is false. Default value: false. + */ + scmSiteAlsoStopped?: boolean; + /** + * Specifies which deployment slot this app will swap into. Read-only. + * **NOTE: This property will not be serialized. It can only be populated by the server.** + */ + readonly targetSwapSlot?: string; + /** + * App Service Environment to use for the app. + */ + hostingEnvironmentProfile?: HostingEnvironmentProfile; + /** + * 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. + */ + clientAffinityEnabled?: boolean; + /** + * true to enable client certificate authentication (TLS mutual authentication); + * otherwise, false. Default is false. + */ + clientCertEnabled?: boolean; + /** + * client certificate authentication comma-separated exclusion paths + */ + clientCertExclusionPaths?: string; + /** + * true to disable the public hostnames of the app; otherwise, false. + * If true, the app is only accessible via API management process. + */ + hostNamesDisabled?: boolean; + /** + * 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. + * **NOTE: This property will not be serialized. It can only be populated by the server.** + */ + readonly outboundIpAddresses?: string; + /** + * List of IP addresses that the app uses for outbound connections (e.g. database access). + * Includes VIPs from all tenants. Read-only. + * **NOTE: This property will not be serialized. It can only be populated by the server.** + */ + readonly possibleOutboundIpAddresses?: string; + /** + * Size of the function container. + */ + containerSize?: number; + /** + * Maximum allowed daily memory-time quota (applicable on dynamic apps only). + */ + dailyMemoryTimeQuota?: number; + /** + * App suspended till in case memory-time quota is exceeded. + * **NOTE: This property will not be serialized. It can only be populated by the server.** + */ + readonly suspendedTill?: Date; + /** + * Maximum number of workers. + * This only applies to Functions container. + * **NOTE: This property will not be serialized. It can only be populated by the server.** + */ + readonly maxNumberOfWorkers?: number; + /** + * If specified during app creation, the app is cloned from a source app. + */ + cloningInfo?: CloningInfo; + /** + * Name of the resource group the app belongs to. Read-only. + * **NOTE: This property will not be serialized. It can only be populated by the server.** + */ + readonly resourceGroup?: string; + /** + * true if the app is a default container; otherwise, false. + * **NOTE: This property will not be serialized. It can only be populated by the server.** + */ + readonly isDefaultContainer?: boolean; + /** + * Default hostname of the app. Read-only. + * **NOTE: This property will not be serialized. It can only be populated by the server.** + */ + readonly defaultHostName?: string; + /** + * Status of the last deployment slot swap operation. + * **NOTE: This property will not be serialized. It can only be populated by the server.** + */ + readonly slotSwapStatus?: SlotSwapStatus; + /** + * HttpsOnly: configures a web site to accept only https requests. Issues redirect for + * http requests + */ + httpsOnly?: boolean; + /** + * Site redundancy mode. Possible values include: 'None', 'Manual', 'Failover', 'ActiveActive', + * 'GeoRedundant' + */ + redundancyMode?: RedundancyMode; + /** + * Specifies an operation id if this site has a pending operation. + * **NOTE: This property will not be serialized. It can only be populated by the server.** + */ + readonly inProgressOperationId?: string; + /** + * GeoDistributions for this site + */ + geoDistributions?: GeoDistribution[]; + identity?: ManagedServiceIdentity; +} + +/** + * Describes the capabilities/features allowed for a specific SKU. + */ +export interface Capability { + /** + * Name of the SKU capability. + */ + name?: string; + /** + * Value of the SKU capability. + */ + value?: string; + /** + * Reason of the SKU capability. + */ + reason?: string; +} + +/** + * Description of the App Service plan scale options. + */ +export interface SkuCapacity { + /** + * Minimum number of workers for this App Service plan SKU. + */ + minimum?: number; + /** + * Maximum number of workers for this App Service plan SKU. + */ + maximum?: number; + /** + * Default number of workers for this App Service plan SKU. + */ + default?: number; + /** + * Available scale configurations for an App Service plan. + */ + scaleType?: string; +} + +/** + * Description of a SKU for a scalable resource. + */ +export interface SkuDescription { + /** + * Name of the resource SKU. + */ + name?: string; + /** + * Service tier of the resource SKU. + */ + tier?: string; + /** + * Size specifier of the resource SKU. + */ + size?: string; + /** + * Family code of the resource SKU. + */ + family?: string; + /** + * Current number of instances assigned to the resource. + */ + capacity?: number; + /** + * Min, max, and default scale values of the SKU. + */ + skuCapacity?: SkuCapacity; + /** + * Locations of the SKU. + */ + locations?: string[]; + /** + * Capabilities of the SKU, e.g., is traffic manager enabled? + */ + capabilities?: Capability[]; +} + +/** + * App Service plan. + */ +export interface AppServicePlan extends Resource { + /** + * Target worker tier assigned to the App Service plan. + */ + workerTierName?: string; + /** + * App Service plan status. Possible values include: 'Ready', 'Pending', 'Creating' + * **NOTE: This property will not be serialized. It can only be populated by the server.** + */ + readonly status?: StatusOptions; + /** + * App Service plan subscription. + * **NOTE: This property will not be serialized. It can only be populated by the server.** + */ + readonly subscription?: string; + /** + * Specification for the App Service Environment to use for the App Service plan. + */ + hostingEnvironmentProfile?: HostingEnvironmentProfile; + /** + * Maximum number of instances that can be assigned to this App Service plan. + * **NOTE: This property will not be serialized. It can only be populated by the server.** + */ + readonly maximumNumberOfWorkers?: number; + /** + * Geographical location for the App Service plan. + * **NOTE: This property will not be serialized. It can only be populated by the server.** + */ + readonly geoRegion?: string; + /** + * 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. + */ + perSiteScaling?: boolean; + /** + * Maximum number of total workers allowed for this ElasticScaleEnabled App Service Plan + */ + maximumElasticWorkerCount?: number; + /** + * Number of apps assigned to this App Service plan. + * **NOTE: This property will not be serialized. It can only be populated by the server.** + */ + readonly numberOfSites?: number; + /** + * If true, this App Service Plan owns spot instances. + */ + isSpot?: boolean; + /** + * The time when the server farm expires. Valid only if it is a spot server farm. + */ + spotExpirationTime?: Date; + /** + * The time when the server farm free offer expires. + */ + freeOfferExpirationTime?: Date; + /** + * Resource group of the App Service plan. + * **NOTE: This property will not be serialized. It can only be populated by the server.** + */ + readonly resourceGroup?: string; + /** + * If Linux app service plan true, false otherwise. Default value: + * false. + */ + reserved?: boolean; + /** + * Obsolete: If Hyper-V container app service plan true, false + * otherwise. Default value: false. + */ + isXenon?: boolean; + /** + * If Hyper-V container app service plan true, false otherwise. Default + * value: false. + */ + hyperV?: boolean; + /** + * Scaling worker count. + */ + targetWorkerCount?: number; + /** + * Scaling worker size ID. + */ + targetWorkerSizeId?: number; + /** + * Provisioning state of the App Service Environment. Possible values include: 'Succeeded', + * 'Failed', 'Canceled', 'InProgress', 'Deleting' + * **NOTE: This property will not be serialized. It can only be populated by the server.** + */ + readonly provisioningState?: ProvisioningState; + sku?: SkuDescription; +} + +/** + * Detailed errors. + */ +export interface DefaultErrorResponseErrorDetailsItem { + /** + * Standardized string to programmatically identify the error. + * **NOTE: This property will not be serialized. It can only be populated by the server.** + */ + readonly code?: string; + /** + * Detailed error description and debugging information. + * **NOTE: This property will not be serialized. It can only be populated by the server.** + */ + readonly message?: string; + /** + * Detailed error description and debugging information. + * **NOTE: This property will not be serialized. It can only be populated by the server.** + */ + readonly target?: string; +} + +/** + * Error model. + */ +export interface DefaultErrorResponseError { + /** + * Standardized string to programmatically identify the error. + * **NOTE: This property will not be serialized. It can only be populated by the server.** + */ + readonly code?: string; + /** + * Detailed error description and debugging information. + * **NOTE: This property will not be serialized. It can only be populated by the server.** + */ + readonly message?: string; + /** + * Detailed error description and debugging information. + * **NOTE: This property will not be serialized. It can only be populated by the server.** + */ + readonly target?: string; + details?: DefaultErrorResponseErrorDetailsItem[]; + /** + * More information to debug error. + * **NOTE: This property will not be serialized. It can only be populated by the server.** + */ + readonly innererror?: string; +} + +/** + * App Service error response. + */ +export interface DefaultErrorResponse { + /** + * Error model. + * **NOTE: This property will not be serialized. It can only be populated by the server.** + */ + readonly error?: DefaultErrorResponseError; +} + +/** + * Specification for using a Virtual Network. + */ +export interface VirtualNetworkProfile { + /** + * Resource id of the Virtual Network. + */ + id?: string; + /** + * Name of the Virtual Network (read-only). + * **NOTE: This property will not be serialized. It can only be populated by the server.** + */ + readonly name?: string; + /** + * Resource type of the Virtual Network (read-only). + * **NOTE: This property will not be serialized. It can only be populated by the server.** + */ + readonly type?: string; + /** + * Subnet within the Virtual Network. + */ + subnet?: string; +} + +/** + * Worker pool of an App Service Environment. + */ +export interface WorkerPool { + /** + * Worker size ID for referencing this worker pool. + */ + workerSizeId?: number; + /** + * Shared or dedicated app hosting. Possible values include: 'Shared', 'Dedicated', 'Dynamic' + */ + computeMode?: ComputeModeOptions; + /** + * VM size of the worker pool instances. + */ + workerSize?: string; + /** + * Number of instances in the worker pool. + */ + workerCount?: number; + /** + * Names of all instances in the worker pool (read only). + * **NOTE: This property will not be serialized. It can only be populated by the server.** + */ + readonly instanceNames?: string[]; +} + +/** + * Virtual IP mapping. + */ +export interface VirtualIPMapping { + /** + * Virtual IP address. + */ + virtualIP?: string; + /** + * Internal HTTP port. + */ + internalHttpPort?: number; + /** + * Internal HTTPS port. + */ + internalHttpsPort?: number; + /** + * Is virtual IP mapping in use. + */ + inUse?: boolean; +} + +/** + * Stamp capacity information. + */ +export interface StampCapacity { + /** + * Name of the stamp. + */ + name?: string; + /** + * Available capacity (# of machines, bytes of storage etc...). + */ + availableCapacity?: number; + /** + * Total capacity (# of machines, bytes of storage etc...). + */ + totalCapacity?: number; + /** + * Name of the unit. + */ + unit?: string; + /** + * Shared/dedicated workers. Possible values include: 'Shared', 'Dedicated', 'Dynamic' + */ + computeMode?: ComputeModeOptions; + /** + * Size of the machines. Possible values include: 'Small', 'Medium', 'Large', 'D1', 'D2', 'D3', + * 'Default' + */ + workerSize?: WorkerSizeOptions; + /** + * Size ID of machines: + * 0 - Small + * 1 - Medium + * 2 - Large + */ + workerSizeId?: number; + /** + * If true, it includes basic apps. + * Basic apps are not used for capacity allocation. + */ + excludeFromCapacityAllocation?: boolean; + /** + * true if capacity is applicable for all apps; otherwise, false. + */ + isApplicableForAllComputeModes?: boolean; + /** + * Shared or Dedicated. + */ + siteMode?: string; + /** + * Is this a linux stamp capacity + */ + isLinux?: boolean; +} + +/** + * Network access control entry. + */ +export interface NetworkAccessControlEntry { + /** + * Action object. Possible values include: 'Permit', 'Deny' + */ + action?: AccessControlEntryAction; + /** + * Description of network access control entry. + */ + description?: string; + /** + * Order of precedence. + */ + order?: number; + /** + * Remote subnet. + */ + remoteSubnet?: string; +} + +/** + * Description of an App Service Environment. + */ +export interface AppServiceEnvironment { + /** + * Name of the App Service Environment. + */ + name: string; + /** + * Location of the App Service Environment, e.g. "West US". + */ + location: string; + /** + * Provisioning state of the App Service Environment. Possible values include: 'Succeeded', + * 'Failed', 'Canceled', 'InProgress', 'Deleting' + * **NOTE: This property will not be serialized. It can only be populated by the server.** + */ + readonly provisioningState?: ProvisioningState; + /** + * Current status of the App Service Environment. Possible values include: 'Preparing', 'Ready', + * 'Scaling', 'Deleting' + * **NOTE: This property will not be serialized. It can only be populated by the server.** + */ + readonly status?: HostingEnvironmentStatus; + /** + * Name of the Virtual Network for the App Service Environment. + */ + vnetName?: string; + /** + * Resource group of the Virtual Network. + */ + vnetResourceGroupName?: string; + /** + * Subnet of the Virtual Network. + */ + vnetSubnetName?: string; + /** + * Description of the Virtual Network. + */ + virtualNetwork: VirtualNetworkProfile; + /** + * Specifies which endpoints to serve internally in the Virtual Network for the App Service + * Environment. Possible values include: 'None', 'Web', 'Publishing' + */ + internalLoadBalancingMode?: InternalLoadBalancingMode; + /** + * Front-end VM size, e.g. "Medium", "Large". + */ + multiSize?: string; + /** + * Number of front-end instances. + */ + multiRoleCount?: number; + /** + * Description of worker pools with worker size IDs, VM sizes, and number of workers in each + * pool. + */ + workerPools: WorkerPool[]; + /** + * Number of IP SSL addresses reserved for the App Service Environment. + */ + ipsslAddressCount?: number; + /** + * Edition of the metadata database for the App Service Environment, e.g. "Standard". + * **NOTE: This property will not be serialized. It can only be populated by the server.** + */ + readonly databaseEdition?: string; + /** + * Service objective of the metadata database for the App Service Environment, e.g. "S0". + * **NOTE: This property will not be serialized. It can only be populated by the server.** + */ + readonly databaseServiceObjective?: string; + /** + * Number of upgrade domains of the App Service Environment. + * **NOTE: This property will not be serialized. It can only be populated by the server.** + */ + readonly upgradeDomains?: number; + /** + * Subscription of the App Service Environment. + * **NOTE: This property will not be serialized. It can only be populated by the server.** + */ + readonly subscriptionId?: string; + /** + * DNS suffix of the App Service Environment. + */ + dnsSuffix?: string; + /** + * Last deployment action on the App Service Environment. + * **NOTE: This property will not be serialized. It can only be populated by the server.** + */ + readonly lastAction?: string; + /** + * Result of the last deployment action on the App Service Environment. + * **NOTE: This property will not be serialized. It can only be populated by the server.** + */ + readonly lastActionResult?: string; + /** + * List of comma separated strings describing which VM sizes are allowed for front-ends. + * **NOTE: This property will not be serialized. It can only be populated by the server.** + */ + readonly allowedMultiSizes?: string; + /** + * List of comma separated strings describing which VM sizes are allowed for workers. + * **NOTE: This property will not be serialized. It can only be populated by the server.** + */ + readonly allowedWorkerSizes?: string; + /** + * Maximum number of VMs in the App Service Environment. + * **NOTE: This property will not be serialized. It can only be populated by the server.** + */ + readonly maximumNumberOfMachines?: number; + /** + * Description of IP SSL mapping for the App Service Environment. + * **NOTE: This property will not be serialized. It can only be populated by the server.** + */ + readonly vipMappings?: VirtualIPMapping[]; + /** + * Current total, used, and available worker capacities. + * **NOTE: This property will not be serialized. It can only be populated by the server.** + */ + readonly environmentCapacities?: StampCapacity[]; + /** + * Access control list for controlling traffic to the App Service Environment. + */ + networkAccessControlList?: NetworkAccessControlEntry[]; + /** + * True/false indicating whether the App Service Environment is healthy. + * **NOTE: This property will not be serialized. It can only be populated by the server.** + */ + readonly environmentIsHealthy?: boolean; + /** + * Detailed message about with results of the last check of the App Service Environment. + * **NOTE: This property will not be serialized. It can only be populated by the server.** + */ + readonly environmentStatus?: string; + /** + * Resource group of the App Service Environment. + * **NOTE: This property will not be serialized. It can only be populated by the server.** + */ + readonly resourceGroup?: string; + /** + * Scale factor for front-ends. + */ + frontEndScaleFactor?: number; + /** + * Default Scale Factor for FrontEnds. + * **NOTE: This property will not be serialized. It can only be populated by the server.** + */ + readonly defaultFrontEndScaleFactor?: number; + /** + * API Management Account associated with the App Service Environment. + */ + apiManagementAccountId?: string; + /** + * 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). + */ + suspended?: boolean; + /** + * 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). + */ + dynamicCacheEnabled?: boolean; + /** + * Custom settings for changing the behavior of the App Service Environment. + */ + clusterSettings?: NameValuePair[]; + /** + * User added ip ranges to whitelist on ASE db + */ + userWhitelistedIpRanges?: string[]; + /** + * Flag that displays whether an ASE has linux workers or not + */ + hasLinuxWorkers?: boolean; + /** + * Key Vault ID for ILB App Service Environment default SSL certificate + */ + sslCertKeyVaultId?: string; + /** + * Key Vault Secret Name for ILB App Service Environment default SSL certificate + */ + sslCertKeyVaultSecretName?: string; +} + +/** + * Meta data about operation used for display in portal. + */ +export interface CsmOperationDisplay { + provider?: string; + resource?: string; + operation?: string; + description?: string; +} + +/** + * 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 + */ +export interface Dimension { + name?: string; + displayName?: string; + internalName?: string; + toBeExportedForShoebox?: boolean; +} + +/** + * Retention policy of a resource metric. + */ +export interface MetricAvailability { + timeGrain?: string; + blobDuration?: string; +} + +/** + * Definition of a single resource metric. + */ +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[]; +} + +/** + * Log Definition of a single resource metric. + */ +export interface LogSpecification { + name?: string; + displayName?: string; + blobDuration?: string; +} + +/** + * Resource metrics service provided by Microsoft.Insights resource provider. + */ +export interface ServiceSpecification { + metricSpecifications?: MetricSpecification[]; + logSpecifications?: LogSpecification[]; +} + +/** + * Properties available for a Microsoft.Web resource provider operation. + */ +export interface CsmOperationDescriptionProperties { + serviceSpecification?: ServiceSpecification; +} + +/** + * Description of an operation available for Microsoft.Web resource provider. + */ +export interface CsmOperationDescription { + name?: string; + display?: CsmOperationDisplay; + origin?: string; + properties?: CsmOperationDescriptionProperties; +} + +/** + * Localizable string object containing the name and a localized value. + */ +export interface LocalizableString { + /** + * Non-localized name. + */ + value?: string; + /** + * Localized name. + */ + localizedValue?: string; +} + +/** + * Usage of the quota resource. + */ +export interface CsmUsageQuota { + /** + * Units of measurement for the quota resource. + */ + unit?: string; + /** + * Next reset time for the resource counter. + */ + nextResetTime?: Date; + /** + * The current value of the resource counter. + */ + currentValue?: number; + /** + * The resource limit. + */ + limit?: number; + /** + * Quota name. + */ + name?: LocalizableString; +} + +/** + * Body of the error response returned from the API. + */ +export interface ErrorEntity { + /** + * Type of error. + */ + extendedCode?: string; + /** + * Message template. + */ + messageTemplate?: string; + /** + * Parameters for the template. + */ + parameters?: string[]; + /** + * Inner errors. + */ + innerErrors?: ErrorEntity[]; + /** + * Basic error code. + */ + code?: string; + /** + * Any details of the error. + */ + message?: string; +} + +/** + * Identifies an object. + */ +export interface NameIdentifier { + /** + * Name of the object. + */ + name?: string; +} + +/** + * An operation on a resource. + */ +export interface Operation { + /** + * Operation ID. + */ + id?: string; + /** + * Operation name. + */ + name?: string; + /** + * The current status of the operation. Possible values include: 'InProgress', 'Failed', + * 'Succeeded', 'TimedOut', 'Created' + */ + status?: OperationStatus; + /** + * Any errors associate with the operation. + */ + errors?: ErrorEntity[]; + /** + * Time when operation has started. + */ + createdTime?: Date; + /** + * Time when operation has been updated. + */ + modifiedTime?: Date; + /** + * Time when operation will expire. + */ + expirationTime?: Date; + /** + * Applicable only for stamp operation ids. + */ + geoMasterOperationId?: string; +} + +/** + * Name of a metric for any resource . + */ +export interface ResourceMetricName { + /** + * metric name value. + * **NOTE: This property will not be serialized. It can only be populated by the server.** + */ + readonly value?: string; + /** + * Localized metric name value. + * **NOTE: This property will not be serialized. It can only be populated by the server.** + */ + readonly localizedValue?: string; +} + +/** + * Resource metric property. + */ +export interface ResourceMetricProperty { + /** + * Key for resource metric property. + */ + key?: string; + /** + * Value of pair. + */ + value?: string; +} + +/** + * Value of resource metric. + */ +export interface ResourceMetricValue { + /** + * Value timestamp. + * **NOTE: This property will not be serialized. It can only be populated by the server.** + */ + readonly timestamp?: string; + /** + * Value average. + * **NOTE: This property will not be serialized. It can only be populated by the server.** + */ + readonly average?: number; + /** + * Value minimum. + * **NOTE: This property will not be serialized. It can only be populated by the server.** + */ + readonly minimum?: number; + /** + * Value maximum. + * **NOTE: This property will not be serialized. It can only be populated by the server.** + */ + readonly maximum?: number; + /** + * Value total. + * **NOTE: This property will not be serialized. It can only be populated by the server.** + */ + readonly total?: number; + /** + * Value count. + * **NOTE: This property will not be serialized. It can only be populated by the server.** + */ + readonly count?: number; + /** + * Resource metric properties collection. + * **NOTE: This property will not be serialized. It can only be populated by the server.** + */ + readonly properties?: ResourceMetricProperty[]; +} + +/** + * Object representing a metric for any resource . + */ +export interface ResourceMetric { + /** + * Name of metric. + * **NOTE: This property will not be serialized. It can only be populated by the server.** + */ + readonly name?: ResourceMetricName; + /** + * Metric unit. + * **NOTE: This property will not be serialized. It can only be populated by the server.** + */ + readonly unit?: string; + /** + * Metric granularity. E.g PT1H, PT5M, P1D + * **NOTE: This property will not be serialized. It can only be populated by the server.** + */ + readonly timeGrain?: string; + /** + * Metric start time. + * **NOTE: This property will not be serialized. It can only be populated by the server.** + */ + readonly startTime?: Date; + /** + * Metric end time. + * **NOTE: This property will not be serialized. It can only be populated by the server.** + */ + readonly endTime?: Date; + /** + * Metric resource Id. + * **NOTE: This property will not be serialized. It can only be populated by the server.** + */ + readonly resourceId?: string; + /** + * Resource Id. + * **NOTE: This property will not be serialized. It can only be populated by the server.** + */ + readonly id?: string; + /** + * Metric values. + * **NOTE: This property will not be serialized. It can only be populated by the server.** + */ + readonly metricValues?: ResourceMetricValue[]; + /** + * Resource metric properties collection. + * **NOTE: This property will not be serialized. It can only be populated by the server.** + */ + readonly properties?: ResourceMetricProperty[]; +} + +/** + * Application logs to file system configuration. + */ +export interface FileSystemApplicationLogsConfig { + /** + * Log level. Possible values include: 'Off', 'Verbose', 'Information', 'Warning', 'Error'. + * Default value: 'Off'. + */ + level?: LogLevel; +} + +/** + * Application logs to Azure table storage configuration. + */ +export interface AzureTableStorageApplicationLogsConfig { + /** + * Log level. Possible values include: 'Off', 'Verbose', 'Information', 'Warning', 'Error' + */ + level?: LogLevel; + /** + * SAS URL to an Azure table with add/query/delete permissions. + */ + sasUrl: string; +} + +/** + * Application logs azure blob storage configuration. + */ +export interface AzureBlobStorageApplicationLogsConfig { + /** + * Log level. Possible values include: 'Off', 'Verbose', 'Information', 'Warning', 'Error' + */ + level?: LogLevel; + /** + * SAS url to a azure blob container with read/write/list/delete permissions. + */ + sasUrl?: string; + /** + * Retention in days. + * Remove blobs older than X days. + * 0 or lower means no retention. + */ + retentionInDays?: number; +} + +/** + * Application logs configuration. + */ +export interface ApplicationLogsConfig { + /** + * Application logs to file system configuration. + */ + fileSystem?: FileSystemApplicationLogsConfig; + /** + * Application logs to azure table storage configuration. + */ + azureTableStorage?: AzureTableStorageApplicationLogsConfig; + /** + * Application logs to blob storage configuration. + */ + azureBlobStorage?: AzureBlobStorageApplicationLogsConfig; +} + +/** + * Http logs to azure blob storage configuration. + */ +export interface AzureBlobStorageHttpLogsConfig { + /** + * SAS url to a azure blob container with read/write/list/delete permissions. + */ + sasUrl?: string; + /** + * Retention in days. + * Remove blobs older than X days. + * 0 or lower means no retention. + */ + retentionInDays?: number; + /** + * True if configuration is enabled, false if it is disabled and null if configuration is not + * set. + */ + enabled?: boolean; +} + +/** + * AzureStorageInfo dictionary resource. + */ +export interface AzureStoragePropertyDictionaryResource extends ProxyOnlyResource { + /** + * Azure storage accounts. + */ + properties?: { [propertyName: string]: AzureStorageInfoValue }; +} + +/** + * Database backup settings. + */ +export interface DatabaseBackupSetting { + /** + * Database type (e.g. SqlAzure / MySql). Possible values include: 'SqlAzure', 'MySql', + * 'LocalMySql', 'PostgreSql' + */ + databaseType: DatabaseType; + name?: string; + /** + * Contains a connection string name that is linked to the SiteConfig.ConnectionStrings. + * This is used during restore with overwrite connection strings options. + */ + connectionStringName?: string; + /** + * 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. + */ + connectionString?: string; +} + +/** + * Backup description. + */ +export interface BackupItem extends ProxyOnlyResource { + /** + * Id of the backup. + * **NOTE: This property will not be serialized. It can only be populated by the server.** + */ + readonly backupId?: number; + /** + * SAS URL for the storage account container which contains this backup. + * **NOTE: This property will not be serialized. It can only be populated by the server.** + */ + readonly storageAccountUrl?: string; + /** + * Name of the blob which contains data for this backup. + * **NOTE: This property will not be serialized. It can only be populated by the server.** + */ + readonly blobName?: string; + /** + * Name of this backup. + * **NOTE: This property will not be serialized. It can only be populated by the server.** + */ + readonly backupItemName?: string; + /** + * Backup status. Possible values include: 'InProgress', 'Failed', 'Succeeded', 'TimedOut', + * 'Created', 'Skipped', 'PartiallySucceeded', 'DeleteInProgress', 'DeleteFailed', 'Deleted' + * **NOTE: This property will not be serialized. It can only be populated by the server.** + */ + readonly status?: BackupItemStatus; + /** + * Size of the backup in bytes. + * **NOTE: This property will not be serialized. It can only be populated by the server.** + */ + readonly sizeInBytes?: number; + /** + * Timestamp of the backup creation. + * **NOTE: This property will not be serialized. It can only be populated by the server.** + */ + readonly created?: Date; + /** + * Details regarding this backup. Might contain an error message. + * **NOTE: This property will not be serialized. It can only be populated by the server.** + */ + readonly log?: string; + /** + * List of databases included in the backup. + * **NOTE: This property will not be serialized. It can only be populated by the server.** + */ + readonly databases?: DatabaseBackupSetting[]; + /** + * True if this backup has been created due to a schedule being triggered. + * **NOTE: This property will not be serialized. It can only be populated by the server.** + */ + readonly scheduled?: boolean; + /** + * Timestamp of a last restore operation which used this backup. + * **NOTE: This property will not be serialized. It can only be populated by the server.** + */ + readonly lastRestoreTimeStamp?: Date; + /** + * Timestamp when this backup finished. + * **NOTE: This property will not be serialized. It can only be populated by the server.** + */ + readonly finishedTimeStamp?: Date; + /** + * Unique correlation identifier. Please use this along with the timestamp while communicating + * with Azure support. + * **NOTE: This property will not be serialized. It can only be populated by the server.** + */ + readonly correlationId?: string; + /** + * Size of the original web app which has been backed up. + * **NOTE: This property will not be serialized. It can only be populated by the server.** + */ + readonly websiteSizeInBytes?: number; +} + +/** + * Description of a backup schedule. Describes how often should be the backup performed and what + * should be the retention policy. + */ +export interface BackupSchedule { + /** + * 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. + */ + frequencyInterval: number; + /** + * 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'. + */ + frequencyUnit: FrequencyUnit; + /** + * 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. + */ + keepAtLeastOneBackup: boolean; + /** + * After how many days backups should be deleted. Default value: 30. + */ + retentionPeriodInDays: number; + /** + * When the schedule should start working. + */ + startTime?: Date; + /** + * Last time when this schedule was triggered. + * **NOTE: This property will not be serialized. It can only be populated by the server.** + */ + readonly lastExecutionTime?: Date; +} + +/** + * Description of a backup which will be performed. + */ +export interface BackupRequest extends ProxyOnlyResource { + /** + * Name of the backup. + */ + backupName?: string; + /** + * True if the backup schedule is enabled (must be included in that case), false if the backup + * schedule should be disabled. + */ + enabled?: boolean; + /** + * SAS URL to the container. + */ + storageAccountUrl: string; + /** + * Schedule for the backup if it is executed periodically. + */ + backupSchedule?: BackupSchedule; + /** + * Databases included in the backup. + */ + databases?: DatabaseBackupSetting[]; +} + +/** + * Database connection string value to type pair. + */ +export interface ConnStringValueTypePair { + /** + * Value of pair. + */ + value: string; + /** + * Type of database. Possible values include: 'MySql', 'SQLServer', 'SQLAzure', 'Custom', + * 'NotificationHub', 'ServiceBus', 'EventHub', 'ApiHub', 'DocDb', 'RedisCache', 'PostgreSQL' + */ + type: ConnectionStringType; +} + +/** + * String dictionary resource. + */ +export interface ConnectionStringDictionary extends ProxyOnlyResource { + /** + * Connection strings. + */ + properties?: { [propertyName: string]: ConnStringValueTypePair }; +} + +/** + * Continuous Web Job Information. + */ +export interface ContinuousWebJob extends ProxyOnlyResource { + /** + * Job status. Possible values include: 'Initializing', 'Starting', 'Running', 'PendingRestart', + * 'Stopped' + */ + status?: ContinuousWebJobStatus; + /** + * Detailed status. + */ + detailedStatus?: string; + /** + * Log URL. + */ + logUrl?: string; + /** + * Run command. + */ + runCommand?: string; + /** + * Job URL. + */ + url?: string; + /** + * Extra Info URL. + */ + extraInfoUrl?: string; + /** + * Job type. Possible values include: 'Continuous', 'Triggered' + */ + webJobType?: WebJobType; + /** + * Error information. + */ + error?: string; + /** + * Using SDK? + */ + usingSdk?: boolean; + /** + * Job settings. + */ + settings?: { [propertyName: string]: any }; +} + +/** + * Publishing options for requested profile. + */ +export interface CsmPublishingProfileOptions { + /** + * Name of the format. Valid values are: + * FileZilla3 + * WebDeploy -- default + * Ftp. Possible values include: 'FileZilla3', 'WebDeploy', 'Ftp' + */ + format?: PublishingProfileFormat; + /** + * Include the DisasterRecover endpoint if true + */ + includeDisasterRecoveryEndpoints?: boolean; +} + +/** + * Deployment slot parameters. + */ +export interface CsmSlotEntity { + /** + * Destination deployment slot during swap operation. + */ + targetSlot: string; + /** + * true to preserve Virtual Network to the slot during swap; otherwise, + * false. + */ + preserveVnet: boolean; +} + +/** + * Custom domain analysis. + */ +export interface CustomHostnameAnalysisResult extends ProxyOnlyResource { + /** + * true if hostname is already verified; otherwise, false. + * **NOTE: This property will not be serialized. It can only be populated by the server.** + */ + readonly isHostnameAlreadyVerified?: boolean; + /** + * DNS verification test result. Possible values include: 'Passed', 'Failed', 'Skipped' + * **NOTE: This property will not be serialized. It can only be populated by the server.** + */ + readonly customDomainVerificationTest?: DnsVerificationTestResult; + /** + * Raw failure information if DNS verification fails. + * **NOTE: This property will not be serialized. It can only be populated by the server.** + */ + readonly customDomainVerificationFailureInfo?: ErrorEntity; + /** + * true if there is a conflict on a scale unit; otherwise, false. + * **NOTE: This property will not be serialized. It can only be populated by the server.** + */ + readonly hasConflictOnScaleUnit?: boolean; + /** + * true if there is a conflict across subscriptions; otherwise, false. + * **NOTE: This property will not be serialized. It can only be populated by the server.** + */ + readonly hasConflictAcrossSubscription?: boolean; + /** + * Name of the conflicting app on scale unit if it's within the same subscription. + * **NOTE: This property will not be serialized. It can only be populated by the server.** + */ + readonly conflictingAppResourceId?: string; + /** + * CName records controller can see for this hostname. + */ + cNameRecords?: string[]; + /** + * TXT records controller can see for this hostname. + */ + txtRecords?: string[]; + /** + * A records controller can see for this hostname. + */ + aRecords?: string[]; + /** + * Alternate CName records controller can see for this hostname. + */ + alternateCNameRecords?: string[]; + /** + * Alternate TXT records controller can see for this hostname. + */ + alternateTxtRecords?: string[]; +} + +/** + * Details about restoring a deleted app. + */ +export interface DeletedAppRestoreRequest extends ProxyOnlyResource { + /** + * ARM resource ID of the deleted app. Example: + * /subscriptions/{subId}/providers/Microsoft.Web/deletedSites/{deletedSiteId} + */ + deletedSiteId?: string; + /** + * If true, deleted site configuration, in addition to content, will be restored. + */ + recoverConfiguration?: boolean; + /** + * 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. + */ + snapshotTime?: string; + /** + * If true, the snapshot is retrieved from DRSecondary endpoint. + */ + useDRSecondary?: boolean; +} + +/** + * User credentials used for publishing activity. + */ +export interface Deployment extends ProxyOnlyResource { + /** + * Deployment status. + */ + status?: number; + /** + * Details about deployment status. + */ + message?: string; + /** + * Who authored the deployment. + */ + author?: string; + /** + * Who performed the deployment. + */ + deployer?: string; + /** + * Author email. + */ + authorEmail?: string; + /** + * Start time. + */ + startTime?: Date; + /** + * End time. + */ + endTime?: Date; + /** + * True if deployment is currently active, false if completed and null if not started. + */ + active?: boolean; + /** + * Details on deployment. + */ + details?: string; +} + +/** + * Enabled configuration. + */ +export interface EnabledConfig { + /** + * True if configuration is enabled, false if it is disabled and null if configuration is not + * set. + */ + enabled?: boolean; +} + +/** + * Http logs to file system configuration. + */ +export interface FileSystemHttpLogsConfig { + /** + * 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. + */ + retentionInMb?: number; + /** + * Retention in days. + * Remove files older than X days. + * 0 or lower means no retention. + */ + retentionInDays?: number; + /** + * True if configuration is enabled, false if it is disabled and null if configuration is not + * set. + */ + enabled?: boolean; +} + +/** + * Web Job Information. + */ +export interface FunctionEnvelope extends ProxyOnlyResource { + /** + * Function App ID. + */ + functionAppId?: string; + /** + * Script root path URI. + */ + scriptRootPathHref?: string; + /** + * Script URI. + */ + scriptHref?: string; + /** + * Config URI. + */ + configHref?: string; + /** + * Secrets file URI. + */ + secretsFileHref?: string; + /** + * Function URI. + */ + href?: string; + /** + * Config information. + */ + config?: any; + /** + * File list. + */ + files?: { [propertyName: string]: string }; + /** + * Test data used when testing via the Azure Portal. + */ + testData?: string; +} + +/** + * Function secrets. + */ +export interface FunctionSecrets extends ProxyOnlyResource { + /** + * Secret key. + */ + key?: string; + /** + * Trigger URL. + */ + triggerUrl?: string; +} + +/** + * A hostname binding object. + */ +export interface HostNameBinding extends ProxyOnlyResource { + /** + * App Service app name. + */ + siteName?: string; + /** + * Fully qualified ARM domain resource URI. + */ + domainId?: string; + /** + * Azure resource name. + */ + azureResourceName?: string; + /** + * Azure resource type. Possible values include: 'Website', 'TrafficManager' + */ + azureResourceType?: AzureResourceType; + /** + * Custom DNS record type. Possible values include: 'CName', 'A' + */ + customHostNameDnsRecordType?: CustomHostNameDnsRecordType; + /** + * Hostname type. Possible values include: 'Verified', 'Managed' + */ + hostNameType?: HostNameType; + /** + * SSL type. Possible values include: 'Disabled', 'SniEnabled', 'IpBasedEnabled' + */ + sslState?: SslState; + /** + * SSL certificate thumbprint + */ + thumbprint?: string; + /** + * Virtual IP address assigned to the hostname if IP based SSL is enabled. + * **NOTE: This property will not be serialized. It can only be populated by the server.** + */ + readonly virtualIP?: string; +} + +/** + * Http logs configuration. + */ +export interface HttpLogsConfig { + /** + * Http logs to file system configuration. + */ + fileSystem?: FileSystemHttpLogsConfig; + /** + * Http logs to azure blob storage configuration. + */ + azureBlobStorage?: AzureBlobStorageHttpLogsConfig; +} + +/** + * MSDeploy ARM PUT information + */ +export interface MSDeploy extends ProxyOnlyResource { + /** + * Package URI + */ + packageUri?: string; + /** + * SQL Connection String + */ + connectionString?: string; + /** + * Database Type + */ + dbType?: string; + /** + * URI of MSDeploy Parameters file. Must not be set if SetParameters is used. + */ + setParametersXmlFileUri?: string; + /** + * MSDeploy Parameters. Must not be set if SetParametersXmlFileUri is used. + */ + setParameters?: { [propertyName: string]: string }; + /** + * 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. + */ + skipAppData?: boolean; + /** + * Sets the AppOffline rule while the MSDeploy operation executes. + * Setting is false by default. + */ + appOffline?: boolean; +} + +/** + * MSDeploy log entry + */ +export interface MSDeployLogEntry { + /** + * Timestamp of log entry + * **NOTE: This property will not be serialized. It can only be populated by the server.** + */ + readonly time?: Date; + /** + * Log entry type. Possible values include: 'Message', 'Warning', 'Error' + * **NOTE: This property will not be serialized. It can only be populated by the server.** + */ + readonly type?: MSDeployLogEntryType; + /** + * Log entry message + * **NOTE: This property will not be serialized. It can only be populated by the server.** + */ + readonly message?: string; +} + +/** + * MSDeploy log + */ +export interface MSDeployLog extends ProxyOnlyResource { + /** + * List of log entry messages + * **NOTE: This property will not be serialized. It can only be populated by the server.** + */ + readonly entries?: MSDeployLogEntry[]; +} + +/** + * MSDeploy ARM response + */ +export interface MSDeployStatus extends ProxyOnlyResource { + /** + * Username of deployer + * **NOTE: This property will not be serialized. It can only be populated by the server.** + */ + readonly deployer?: string; + /** + * Provisioning state. Possible values include: 'accepted', 'running', 'succeeded', 'failed', + * 'canceled' + * **NOTE: This property will not be serialized. It can only be populated by the server.** + */ + readonly provisioningState?: MSDeployProvisioningState; + /** + * Start time of deploy operation + * **NOTE: This property will not be serialized. It can only be populated by the server.** + */ + readonly startTime?: Date; + /** + * End time of deploy operation + * **NOTE: This property will not be serialized. It can only be populated by the server.** + */ + readonly endTime?: Date; + /** + * Whether the deployment operation has completed + * **NOTE: This property will not be serialized. It can only be populated by the server.** + */ + readonly complete?: boolean; +} + +/** + * MySQL migration request. + */ +export interface MigrateMySqlRequest extends ProxyOnlyResource { + /** + * Connection string to the remote MySQL database. + */ + connectionString: string; + /** + * The type of migration operation to be done. Possible values include: 'LocalToRemote', + * 'RemoteToLocal' + */ + migrationType: MySqlMigrationType; +} + +/** + * MySQL migration status. + */ +export interface MigrateMySqlStatus extends ProxyOnlyResource { + /** + * Status of the migration task. Possible values include: 'InProgress', 'Failed', 'Succeeded', + * 'TimedOut', 'Created' + * **NOTE: This property will not be serialized. It can only be populated by the server.** + */ + readonly migrationOperationStatus?: OperationStatus; + /** + * Operation ID for the migration task. + * **NOTE: This property will not be serialized. It can only be populated by the server.** + */ + readonly operationId?: string; + /** + * True if the web app has in app MySql enabled + * **NOTE: This property will not be serialized. It can only be populated by the server.** + */ + readonly localMySqlEnabled?: boolean; +} + +/** + * Hybrid Connection for an App Service app. + */ +export interface RelayServiceConnectionEntity extends ProxyOnlyResource { + entityName?: string; + entityConnectionString?: string; + resourceType?: string; + resourceConnectionString?: string; + hostname?: string; + port?: number; + biztalkUri?: string; +} + +/** + * Full view of network features for an app (presently VNET integration and Hybrid Connections). + */ +export interface NetworkFeatures extends ProxyOnlyResource { + /** + * The Virtual Network name. + * **NOTE: This property will not be serialized. It can only be populated by the server.** + */ + readonly virtualNetworkName?: string; + /** + * The Virtual Network summary view. + * **NOTE: This property will not be serialized. It can only be populated by the server.** + */ + readonly virtualNetworkConnection?: VnetInfo; + /** + * The Hybrid Connections summary view. + * **NOTE: This property will not be serialized. It can only be populated by the server.** + */ + readonly hybridConnections?: RelayServiceConnectionEntity[]; + /** + * The Hybrid Connection V2 (Service Bus) view. + * **NOTE: This property will not be serialized. It can only be populated by the server.** + */ + readonly hybridConnectionsV2?: HybridConnection[]; +} + +/** + * Network trace + */ +export interface NetworkTrace { + /** + * Local file path for the captured network trace file. + */ + path?: string; + /** + * Current status of the network trace operation, same as Operation.Status + * (InProgress/Succeeded/Failed). + */ + status?: string; + /** + * Detailed message of a network trace operation, e.g. error message in case of failure. + */ + message?: string; +} + +/** + * Performance monitor sample in a set. + */ +export interface PerfMonSample { + /** + * Point in time for which counter was measured. + */ + time?: Date; + /** + * Name of the server on which the measurement is made. + */ + instanceName?: string; + /** + * Value of counter at a certain time. + */ + value?: number; +} + +/** + * Metric information. + */ +export interface PerfMonSet { + /** + * Unique key name of the counter. + */ + name?: string; + /** + * Start time of the period. + */ + startTime?: Date; + /** + * End time of the period. + */ + endTime?: Date; + /** + * Presented time grain. + */ + timeGrain?: string; + /** + * Collection of workers that are active during this time. + */ + values?: PerfMonSample[]; +} + +/** + * Performance monitor API response. + */ +export interface PerfMonResponse { + /** + * The response code. + */ + code?: string; + /** + * The message. + */ + message?: string; + /** + * The performance monitor counters. + */ + data?: PerfMonSet; +} + +/** + * Premier add-on. + */ +export interface PremierAddOn extends Resource { + /** + * Premier add on SKU. + */ + sku?: string; + /** + * Premier add on Product. + */ + product?: string; + /** + * Premier add on Vendor. + */ + vendor?: string; + /** + * Premier add on Marketplace publisher. + */ + marketplacePublisher?: string; + /** + * Premier add on Marketplace offer. + */ + marketplaceOffer?: string; +} + +/** + * ARM resource for a PremierAddOn. + */ +export interface PremierAddOnPatchResource extends ProxyOnlyResource { + /** + * Premier add on SKU. + */ + sku?: string; + /** + * Premier add on Product. + */ + product?: string; + /** + * Premier add on Vendor. + */ + vendor?: string; + /** + * Premier add on Marketplace publisher. + */ + marketplacePublisher?: string; + /** + * Premier add on Marketplace offer. + */ + marketplaceOffer?: string; +} + +/** + * Description of a Virtual Network subnet that is useable for private site access. + */ +export interface PrivateAccessSubnet { + /** + * The name of the subnet. + */ + name?: string; + /** + * The key (ID) of the subnet. + */ + key?: number; +} + +/** + * Description of a Virtual Network that is useable for private site access. + */ +export interface PrivateAccessVirtualNetwork { + /** + * The name of the Virtual Network. + */ + name?: string; + /** + * The key (ID) of the Virtual Network. + */ + key?: number; + /** + * The ARM uri of the Virtual Network + */ + resourceId?: string; + /** + * 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. + */ + subnets?: PrivateAccessSubnet[]; +} + +/** + * Description of the parameters of Private Access for a Web Site. + */ +export interface PrivateAccess extends ProxyOnlyResource { + /** + * Whether private access is enabled or not. + */ + enabled?: boolean; + /** + * The Virtual Networks (and subnets) allowed to access the site privately. + */ + virtualNetworks?: PrivateAccessVirtualNetwork[]; +} + +/** + * Process Thread Information. + */ +export interface ProcessThreadInfo extends ProxyOnlyResource { + /** + * Site extension ID. + * **NOTE: This property will not be serialized. It can only be populated by the server.** + */ + readonly identifier?: number; + /** + * HRef URI. + */ + href?: string; + /** + * Process URI. + */ + process?: string; + /** + * Start address. + */ + startAddress?: string; + /** + * Current thread priority. + */ + currentPriority?: number; + /** + * Thread priority level. + */ + priorityLevel?: string; + /** + * Base priority. + */ + basePriority?: number; + /** + * Start time. + */ + startTime?: Date; + /** + * Total processor time. + */ + totalProcessorTime?: string; + /** + * User processor time. + */ + userProcessorTime?: string; + /** + * Privileged processor time. + */ + priviledgedProcessorTime?: string; + /** + * Thread state. + */ + state?: string; + /** + * Wait reason. + */ + waitReason?: string; +} + +/** + * Process Module Information. + */ +export interface ProcessModuleInfo extends ProxyOnlyResource { + /** + * Base address. Used as module identifier in ARM resource URI. + */ + baseAddress?: string; + /** + * File name. + */ + fileName?: string; + /** + * HRef URI. + */ + href?: string; + /** + * File path. + */ + filePath?: string; + /** + * Module memory size. + */ + moduleMemorySize?: number; + /** + * File version. + */ + fileVersion?: string; + /** + * File description. + */ + fileDescription?: string; + /** + * Product name. + */ + product?: string; + /** + * Product version. + */ + productVersion?: string; + /** + * Is debug? + */ + isDebug?: boolean; + /** + * Module language (locale). + */ + language?: string; +} + +/** + * Process Information. + */ +export interface ProcessInfo extends ProxyOnlyResource { + /** + * ARM Identifier for deployment. + * **NOTE: This property will not be serialized. It can only be populated by the server.** + */ + readonly identifier?: number; + /** + * Deployment name. + */ + deploymentName?: string; + /** + * HRef URI. + */ + href?: string; + /** + * Minidump URI. + */ + minidump?: string; + /** + * Is profile running? + */ + isProfileRunning?: boolean; + /** + * Is the IIS Profile running? + */ + isIisProfileRunning?: boolean; + /** + * IIS Profile timeout (seconds). + */ + iisProfileTimeoutInSeconds?: number; + /** + * Parent process. + */ + parent?: string; + /** + * Child process list. + */ + children?: string[]; + /** + * Thread list. + */ + threads?: ProcessThreadInfo[]; + /** + * List of open files. + */ + openFileHandles?: string[]; + /** + * List of modules. + */ + modules?: ProcessModuleInfo[]; + /** + * File name of this process. + */ + fileName?: string; + /** + * Command line. + */ + commandLine?: string; + /** + * User name. + */ + userName?: string; + /** + * Handle count. + */ + handleCount?: number; + /** + * Module count. + */ + moduleCount?: number; + /** + * Thread count. + */ + threadCount?: number; + /** + * Start time. + */ + startTime?: Date; + /** + * Total CPU time. + */ + totalCpuTime?: string; + /** + * User CPU time. + */ + userCpuTime?: string; + /** + * Privileged CPU time. + */ + privilegedCpuTime?: string; + /** + * Working set. + */ + workingSet?: number; + /** + * Peak working set. + */ + peakWorkingSet?: number; + /** + * Private memory size. + */ + privateMemory?: number; + /** + * Virtual memory size. + */ + virtualMemory?: number; + /** + * Peak virtual memory usage. + */ + peakVirtualMemory?: number; + /** + * Paged system memory. + */ + pagedSystemMemory?: number; + /** + * Non-paged system memory. + */ + nonPagedSystemMemory?: number; + /** + * Paged memory. + */ + pagedMemory?: number; + /** + * Peak paged memory. + */ + peakPagedMemory?: number; + /** + * Time stamp. + */ + timeStamp?: Date; + /** + * List of environment variables. + */ + environmentVariables?: { [propertyName: string]: string }; + /** + * Is this the SCM site? + */ + isScmSite?: boolean; + /** + * Is this a Web Job? + */ + isWebjob?: boolean; + /** + * Description of process. + */ + description?: string; +} + +/** + * Public certificate object + */ +export interface PublicCertificate extends ProxyOnlyResource { + /** + * Public Certificate byte array + */ + blob?: Uint8Array; + /** + * Public Certificate Location. Possible values include: 'CurrentUserMy', 'LocalMachineMy', + * 'Unknown' + */ + publicCertificateLocation?: PublicCertificateLocation; + /** + * Certificate Thumbprint + * **NOTE: This property will not be serialized. It can only be populated by the server.** + */ + readonly thumbprint?: string; +} + +/** + * Description of a restore request. + */ +export interface RestoreRequest extends ProxyOnlyResource { + /** + * SAS URL to the container. + */ + storageAccountUrl: string; + /** + * Name of a blob which contains the backup. + */ + blobName?: string; + /** + * true if the restore operation can overwrite target app; otherwise, + * false. true is needed if trying to restore over an existing app. + */ + overwrite: boolean; + /** + * Name of an app. + */ + siteName?: string; + /** + * Collection of databases which should be restored. This list has to match the list of databases + * included in the backup. + */ + databases?: DatabaseBackupSetting[]; + /** + * Changes a logic when restoring an app with custom domains. true to remove custom + * domains automatically. If false, 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. + */ + ignoreConflictingHostNames?: boolean; + /** + * Ignore the databases and only restore the site content. Default value: false. + */ + ignoreDatabases?: boolean; + /** + * Specify app service plan that will own restored site. + */ + appServicePlan?: string; + /** + * Operation type. Possible values include: 'Default', 'Clone', 'Relocation', 'Snapshot', + * 'CloudFS'. Default value: 'Default'. + */ + operationType?: BackupRestoreOperationType; + /** + * true if SiteConfig.ConnectionStrings should be set in new app; otherwise, + * false. + */ + adjustConnectionStrings?: boolean; + /** + * App Service Environment name, if needed (only when restoring an app to an App Service + * Environment). + */ + hostingEnvironment?: string; +} + +/** + * Configuration settings for the Azure App Service Authentication / Authorization feature. + */ +export interface SiteAuthSettings extends ProxyOnlyResource { + /** + * true if the Authentication / Authorization feature is enabled for the current + * app; otherwise, false. + */ + enabled?: boolean; + /** + * 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. + */ + runtimeVersion?: string; + /** + * The action to take when an unauthenticated client attempts to access the app. Possible values + * include: 'RedirectToLoginPage', 'AllowAnonymous' + */ + unauthenticatedClientAction?: UnauthenticatedClientAction; + /** + * true to durably store platform-specific security tokens that are obtained during + * login flows; otherwise, false. + * The default is false. + */ + tokenStoreEnabled?: boolean; + /** + * 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. + */ + allowedExternalRedirectUrls?: string[]; + /** + * 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' + */ + defaultProvider?: BuiltInAuthenticationProvider; + /** + * 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. + */ + tokenRefreshExtensionHours?: number; + /** + * 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 + */ + clientId?: string; + /** + * 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 + */ + clientSecret?: string; + /** + * An alternative to the client secret, that is the thumbprint of a certificate used for signing + * purposes. This property acts as + * a replacement for the Client Secret. It is also optional. + */ + clientSecretCertificateThumbprint?: string; + /** + * 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 + */ + issuer?: string; + /** + * Gets a value indicating whether the issuer should be a valid HTTPS url and be validated as + * such. + */ + validateIssuer?: boolean; + /** + * 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. + */ + allowedAudiences?: string[]; + /** + * Login parameters to send to the OpenID Connect authorization endpoint when + * a user logs in. Each parameter must be in the form "key=value". + */ + additionalLoginParams?: string[]; + /** + * 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/ + */ + googleClientId?: string; + /** + * 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/ + */ + googleClientSecret?: string; + /** + * 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/ + */ + googleOAuthScopes?: string[]; + /** + * 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 + */ + facebookAppId?: string; + /** + * 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 + */ + facebookAppSecret?: string; + /** + * 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 + */ + facebookOAuthScopes?: string[]; + /** + * 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 + */ + twitterConsumerKey?: string; + /** + * 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 + */ + twitterConsumerSecret?: string; + /** + * 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 + */ + microsoftAccountClientId?: string; + /** + * 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 + */ + microsoftAccountClientSecret?: string; + /** + * 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 + */ + microsoftAccountOAuthScopes?: string[]; +} + +/** + * An app cloneability criterion. + */ +export interface SiteCloneabilityCriterion { + /** + * Name of criterion. + */ + name?: string; + /** + * Description of criterion. + */ + description?: string; +} + +/** + * Represents whether or not an app is cloneable. + */ +export interface SiteCloneability { + /** + * Name of app. Possible values include: 'Cloneable', 'PartiallyCloneable', 'NotCloneable' + */ + result?: CloneAbilityResult; + /** + * List of features enabled on app that prevent cloning. + */ + blockingFeatures?: SiteCloneabilityCriterion[]; + /** + * 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. + */ + unsupportedFeatures?: SiteCloneabilityCriterion[]; + /** + * List of blocking application characteristics. + */ + blockingCharacteristics?: SiteCloneabilityCriterion[]; +} + +/** + * Web app configuration ARM resource. + */ +export interface SiteConfigResource extends ProxyOnlyResource { + /** + * Number of workers. + */ + numberOfWorkers?: number; + /** + * Default documents. + */ + defaultDocuments?: string[]; + /** + * .NET Framework version. Default value: 'v4.6'. + */ + netFrameworkVersion?: string; + /** + * Version of PHP. + */ + phpVersion?: string; + /** + * Version of Python. + */ + pythonVersion?: string; + /** + * Version of Node.js. + */ + nodeVersion?: string; + /** + * Linux App Framework and version + */ + linuxFxVersion?: string; + /** + * Xenon App Framework and version + */ + windowsFxVersion?: string; + /** + * true if request tracing is enabled; otherwise, false. + */ + requestTracingEnabled?: boolean; + /** + * Request tracing expiration time. + */ + requestTracingExpirationTime?: Date; + /** + * true if remote debugging is enabled; otherwise, false. + */ + remoteDebuggingEnabled?: boolean; + /** + * Remote debugging version. + */ + remoteDebuggingVersion?: string; + /** + * true if HTTP logging is enabled; otherwise, false. + */ + httpLoggingEnabled?: boolean; + /** + * HTTP logs directory size limit. + */ + logsDirectorySizeLimit?: number; + /** + * true if detailed error logging is enabled; otherwise, false. + */ + detailedErrorLoggingEnabled?: boolean; + /** + * Publishing user name. + */ + publishingUsername?: string; + /** + * Application settings. + */ + appSettings?: NameValuePair[]; + /** + * User-provided Azure storage accounts. + */ + azureStorageAccounts?: { [propertyName: string]: AzureStorageInfoValue }; + /** + * Connection strings. + */ + connectionStrings?: ConnStringInfo[]; + /** + * Site MachineKey. + * **NOTE: This property will not be serialized. It can only be populated by the server.** + */ + readonly machineKey?: SiteMachineKey; + /** + * Handler mappings. + */ + handlerMappings?: HandlerMapping[]; + /** + * Document root. + */ + documentRoot?: string; + /** + * SCM type. Possible values include: 'None', 'Dropbox', 'Tfs', 'LocalGit', 'GitHub', + * 'CodePlexGit', 'CodePlexHg', 'BitbucketGit', 'BitbucketHg', 'ExternalGit', 'ExternalHg', + * 'OneDrive', 'VSO' + */ + scmType?: ScmType; + /** + * true to use 32-bit worker process; otherwise, false. + */ + use32BitWorkerProcess?: boolean; + /** + * true if WebSocket is enabled; otherwise, false. + */ + webSocketsEnabled?: boolean; + /** + * true if Always On is enabled; otherwise, false. + */ + alwaysOn?: boolean; + /** + * Java version. + */ + javaVersion?: string; + /** + * Java container. + */ + javaContainer?: string; + /** + * Java container version. + */ + javaContainerVersion?: string; + /** + * App command line to launch. + */ + appCommandLine?: string; + /** + * Managed pipeline mode. Possible values include: 'Integrated', 'Classic' + */ + managedPipelineMode?: ManagedPipelineMode; + /** + * Virtual applications. + */ + virtualApplications?: VirtualApplication[]; + /** + * Site load balancing. Possible values include: 'WeightedRoundRobin', 'LeastRequests', + * 'LeastResponseTime', 'WeightedTotalTraffic', 'RequestHash' + */ + loadBalancing?: SiteLoadBalancing; + /** + * This is work around for polymorphic types. + */ + experiments?: Experiments; + /** + * Site limits. + */ + limits?: SiteLimits; + /** + * true if Auto Heal is enabled; otherwise, false. + */ + autoHealEnabled?: boolean; + /** + * Auto Heal rules. + */ + autoHealRules?: AutoHealRules; + /** + * Tracing options. + */ + tracingOptions?: string; + /** + * Virtual Network name. + */ + vnetName?: string; + /** + * Cross-Origin Resource Sharing (CORS) settings. + */ + cors?: CorsSettings; + /** + * Push endpoint settings. + */ + push?: PushSettings; + /** + * Information about the formal API definition for the app. + */ + apiDefinition?: ApiDefinitionInfo; + /** + * Auto-swap slot name. + */ + autoSwapSlotName?: string; + /** + * true to enable local MySQL; otherwise, false. Default value: false. + */ + localMySqlEnabled?: boolean; + /** + * Managed Service Identity Id + */ + managedServiceIdentityId?: number; + /** + * Explicit Managed Service Identity Id + */ + xManagedServiceIdentityId?: number; + /** + * IP security restrictions for main. + */ + ipSecurityRestrictions?: IpSecurityRestriction[]; + /** + * IP security restrictions for scm. + */ + scmIpSecurityRestrictions?: IpSecurityRestriction[]; + /** + * IP security restrictions for scm to use main. + */ + scmIpSecurityRestrictionsUseMain?: boolean; + /** + * Http20Enabled: configures a web site to allow clients to connect over http2.0. Default value: + * true. + */ + http20Enabled?: boolean; + /** + * MinTlsVersion: configures the minimum version of TLS required for SSL requests. Possible + * values include: '1.0', '1.1', '1.2' + */ + minTlsVersion?: SupportedTlsVersions; + /** + * State of FTP / FTPS service. Possible values include: 'AllAllowed', 'FtpsOnly', 'Disabled' + */ + ftpsState?: FtpsState; + /** + * Number of reserved instances. + * This setting only applies to the Consumption Plan + */ + reservedInstanceCount?: number; +} + +/** + * A snapshot of a web app configuration. + */ +export interface SiteConfigurationSnapshotInfo extends ProxyOnlyResource { + /** + * The time the snapshot was taken. + * **NOTE: This property will not be serialized. It can only be populated by the server.** + */ + readonly time?: Date; + /** + * The id of the snapshot + * **NOTE: This property will not be serialized. It can only be populated by the server.** + */ + readonly snapshotId?: number; +} + +/** + * Site Extension Information. + */ +export interface SiteExtensionInfo extends ProxyOnlyResource { + /** + * Site extension ID. + */ + extensionId?: string; + title?: string; + /** + * Site extension type. Possible values include: 'Gallery', 'WebRoot' + */ + extensionType?: SiteExtensionType; + /** + * Summary description. + */ + summary?: string; + /** + * Detailed description. + */ + description?: string; + /** + * Version information. + */ + version?: string; + /** + * Extension URL. + */ + extensionUrl?: string; + /** + * Project URL. + */ + projectUrl?: string; + /** + * Icon URL. + */ + iconUrl?: string; + /** + * License URL. + */ + licenseUrl?: string; + /** + * Feed URL. + */ + feedUrl?: string; + /** + * List of authors. + */ + authors?: string[]; + /** + * Installer command line parameters. + */ + installerCommandLineParams?: string; + /** + * Published timestamp. + */ + publishedDateTime?: Date; + /** + * Count of downloads. + */ + downloadCount?: number; + /** + * true if the local version is the latest version; false otherwise. + */ + localIsLatestVersion?: boolean; + /** + * Local path. + */ + localPath?: string; + /** + * Installed timestamp. + */ + installedDateTime?: Date; + /** + * Provisioning state. + */ + provisioningState?: string; + /** + * Site Extension comment. + */ + comment?: string; +} + +/** + * Instance of an app. + */ +export interface SiteInstance extends ProxyOnlyResource { + /** + * Name of instance. + * **NOTE: This property will not be serialized. It can only be populated by the server.** + */ + readonly siteInstanceName?: string; +} + +/** + * Configuration of App Service site logs. + */ +export interface SiteLogsConfig extends ProxyOnlyResource { + /** + * Application logs configuration. + */ + applicationLogs?: ApplicationLogsConfig; + /** + * HTTP logs configuration. + */ + httpLogs?: HttpLogsConfig; + /** + * Failed requests tracing configuration. + */ + failedRequestsTracing?: EnabledConfig; + /** + * Detailed error messages configuration. + */ + detailedErrorMessages?: EnabledConfig; +} + +/** + * ARM resource for a site. + */ +export interface SitePatchResource extends ProxyOnlyResource { + /** + * Current state of the app. + * **NOTE: This property will not be serialized. It can only be populated by the server.** + */ + readonly state?: string; + /** + * Hostnames associated with the app. + * **NOTE: This property will not be serialized. It can only be populated by the server.** + */ + readonly hostNames?: string[]; + /** + * Name of the repository site. + * **NOTE: This property will not be serialized. It can only be populated by the server.** + */ + readonly repositorySiteName?: string; + /** + * State indicating whether the app has exceeded its quota usage. Read-only. Possible values + * include: 'Normal', 'Exceeded' + * **NOTE: This property will not be serialized. It can only be populated by the server.** + */ + readonly usageState?: UsageState; + /** + * true if the app is enabled; otherwise, false. Setting this value to + * false disables the app (takes the app offline). + */ + enabled?: boolean; + /** + * Enabled hostnames for the app.Hostnames need to be assigned (see HostNames) AND enabled. + * Otherwise, + * the app is not served on those hostnames. + * **NOTE: This property will not be serialized. It can only be populated by the server.** + */ + readonly enabledHostNames?: string[]; + /** + * Management information availability state for the app. Possible values include: 'Normal', + * 'Limited', 'DisasterRecoveryMode' + * **NOTE: This property will not be serialized. It can only be populated by the server.** + */ + readonly availabilityState?: SiteAvailabilityState; + /** + * Hostname SSL states are used to manage the SSL bindings for app's hostnames. + */ + hostNameSslStates?: HostNameSslState[]; + /** + * Resource ID of the associated App Service plan, formatted as: + * "/subscriptions/{subscriptionID}/resourceGroups/{groupName}/providers/Microsoft.Web/serverfarms/{appServicePlanName}". + */ + serverFarmId?: string; + /** + * true if reserved; otherwise, false. Default value: false. + */ + reserved?: boolean; + /** + * Obsolete: Hyper-V sandbox. Default value: false. + */ + isXenon?: boolean; + /** + * Hyper-V sandbox. Default value: false. + */ + hyperV?: boolean; + /** + * Last time the app was modified, in UTC. Read-only. + * **NOTE: This property will not be serialized. It can only be populated by the server.** + */ + readonly lastModifiedTimeUtc?: Date; + /** + * Configuration of the app. + */ + siteConfig?: SiteConfig; + /** + * Azure Traffic Manager hostnames associated with the app. Read-only. + * **NOTE: This property will not be serialized. It can only be populated by the server.** + */ + readonly trafficManagerHostNames?: string[]; + /** + * true to stop SCM (KUDU) site when the app is stopped; otherwise, + * false. The default is false. Default value: false. + */ + scmSiteAlsoStopped?: boolean; + /** + * Specifies which deployment slot this app will swap into. Read-only. + * **NOTE: This property will not be serialized. It can only be populated by the server.** + */ + readonly targetSwapSlot?: string; + /** + * App Service Environment to use for the app. + */ + hostingEnvironmentProfile?: HostingEnvironmentProfile; + /** + * 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. + */ + clientAffinityEnabled?: boolean; + /** + * true to enable client certificate authentication (TLS mutual authentication); + * otherwise, false. Default is false. + */ + clientCertEnabled?: boolean; + /** + * client certificate authentication comma-separated exclusion paths + */ + clientCertExclusionPaths?: string; + /** + * true to disable the public hostnames of the app; otherwise, false. + * If true, the app is only accessible via API management process. + */ + hostNamesDisabled?: boolean; + /** + * 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. + * **NOTE: This property will not be serialized. It can only be populated by the server.** + */ + readonly outboundIpAddresses?: string; + /** + * List of IP addresses that the app uses for outbound connections (e.g. database access). + * Includes VIPs from all tenants. Read-only. + * **NOTE: This property will not be serialized. It can only be populated by the server.** + */ + readonly possibleOutboundIpAddresses?: string; + /** + * Size of the function container. + */ + containerSize?: number; + /** + * Maximum allowed daily memory-time quota (applicable on dynamic apps only). + */ + dailyMemoryTimeQuota?: number; + /** + * App suspended till in case memory-time quota is exceeded. + * **NOTE: This property will not be serialized. It can only be populated by the server.** + */ + readonly suspendedTill?: Date; + /** + * Maximum number of workers. + * This only applies to Functions container. + * **NOTE: This property will not be serialized. It can only be populated by the server.** + */ + readonly maxNumberOfWorkers?: number; + /** + * If specified during app creation, the app is cloned from a source app. + */ + cloningInfo?: CloningInfo; + /** + * Name of the resource group the app belongs to. Read-only. + * **NOTE: This property will not be serialized. It can only be populated by the server.** + */ + readonly resourceGroup?: string; + /** + * true if the app is a default container; otherwise, false. + * **NOTE: This property will not be serialized. It can only be populated by the server.** + */ + readonly isDefaultContainer?: boolean; + /** + * Default hostname of the app. Read-only. + * **NOTE: This property will not be serialized. It can only be populated by the server.** + */ + readonly defaultHostName?: string; + /** + * Status of the last deployment slot swap operation. + * **NOTE: This property will not be serialized. It can only be populated by the server.** + */ + readonly slotSwapStatus?: SlotSwapStatus; + /** + * HttpsOnly: configures a web site to accept only https requests. Issues redirect for + * http requests + */ + httpsOnly?: boolean; + /** + * Site redundancy mode. Possible values include: 'None', 'Manual', 'Failover', 'ActiveActive', + * 'GeoRedundant' + */ + redundancyMode?: RedundancyMode; + /** + * Specifies an operation id if this site has a pending operation. + * **NOTE: This property will not be serialized. It can only be populated by the server.** + */ + readonly inProgressOperationId?: string; + /** + * GeoDistributions for this site + */ + geoDistributions?: GeoDistribution[]; + identity?: ManagedServiceIdentity; +} + +/** + * Used for getting PHP error logging flag. + */ +export interface SitePhpErrorLogFlag extends ProxyOnlyResource { + /** + * Local log_errors setting. + */ + localLogErrors?: string; + /** + * Master log_errors setting. + */ + masterLogErrors?: string; + /** + * Local log_errors_max_len setting. + */ + localLogErrorsMaxLength?: string; + /** + * Master log_errors_max_len setting. + */ + masterLogErrorsMaxLength?: string; +} + +/** + * Source control configuration for an app. + */ +export interface SiteSourceControl extends ProxyOnlyResource { + /** + * Repository or source control URL. + */ + repoUrl?: string; + /** + * Name of branch to use for deployment. + */ + branch?: string; + /** + * true to limit to manual integration; false to enable continuous + * integration (which configures webhooks into online repos like GitHub). + */ + isManualIntegration?: boolean; + /** + * true to enable deployment rollback; otherwise, false. + */ + deploymentRollbackEnabled?: boolean; + /** + * true for a Mercurial repository; false for a Git repository. + */ + isMercurial?: boolean; +} + +/** + * Slot Config names azure resource. + */ +export interface SlotConfigNamesResource extends ProxyOnlyResource { + /** + * List of connection string names. + */ + connectionStringNames?: string[]; + /** + * List of application settings names. + */ + appSettingNames?: string[]; + /** + * List of external Azure storage account identifiers. + */ + azureStorageConfigNames?: string[]; +} + +/** + * A setting difference between two deployment slots of an app. + */ +export interface SlotDifference extends ProxyOnlyResource { + /** + * Level of the difference: Information, Warning or Error. + * **NOTE: This property will not be serialized. It can only be populated by the server.** + */ + readonly level?: string; + /** + * The type of the setting: General, AppSetting or ConnectionString. + * **NOTE: This property will not be serialized. It can only be populated by the server.** + */ + readonly settingType?: string; + /** + * Rule that describes how to process the setting difference during a slot swap. + * **NOTE: This property will not be serialized. It can only be populated by the server.** + */ + readonly diffRule?: string; + /** + * Name of the setting. + * **NOTE: This property will not be serialized. It can only be populated by the server.** + */ + readonly settingName?: string; + /** + * Value of the setting in the current slot. + * **NOTE: This property will not be serialized. It can only be populated by the server.** + */ + readonly valueInCurrentSlot?: string; + /** + * Value of the setting in the target slot. + * **NOTE: This property will not be serialized. It can only be populated by the server.** + */ + readonly valueInTargetSlot?: string; + /** + * Description of the setting difference. + * **NOTE: This property will not be serialized. It can only be populated by the server.** + */ + readonly description?: string; +} + +/** + * Specifies the web app that snapshot contents will be retrieved from. + */ +export interface SnapshotRecoverySource { + /** + * Geographical location of the source web app, e.g. SouthEastAsia, SouthCentralUS + */ + location?: string; + /** + * 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. + */ + id?: string; +} + +/** + * Details about app recovery operation. + */ +export interface SnapshotRestoreRequest extends ProxyOnlyResource { + /** + * Point in time in which the app restore should be done, formatted as a DateTime string. + */ + snapshotTime?: string; + /** + * Optional. Specifies the web app that snapshot contents will be retrieved from. + * If empty, the targeted web app will be used as the source. + */ + recoverySource?: SnapshotRecoverySource; + /** + * If true the restore operation can overwrite source app; otherwise, + * false. + */ + overwrite: boolean; + /** + * If true, site configuration, in addition to content, will be reverted. + */ + recoverConfiguration?: boolean; + /** + * If true, custom hostname conflicts will be ignored when recovering to a target web app. + * This setting is only necessary when RecoverConfiguration is enabled. + */ + ignoreConflictingHostNames?: boolean; + /** + * If true, the snapshot is retrieved from DRSecondary endpoint. + */ + useDRSecondary?: boolean; +} + +/** + * Options for app content migration. + */ +export interface StorageMigrationOptions extends ProxyOnlyResource { + /** + * AzureFiles connection string. + */ + azurefilesConnectionString: string; + /** + * AzureFiles share. + */ + azurefilesShare: string; + /** + * trueif the app should be switched over; otherwise, false. Default + * value: false. + */ + switchSiteAfterMigration?: boolean; + /** + * true if the app should be read only during copy operation; otherwise, + * false. Default value: false. + */ + blockWriteAccessToSite?: boolean; +} + +/** + * Response for a migration of app content request. + */ +export interface StorageMigrationResponse extends ProxyOnlyResource { + /** + * When server starts the migration process, it will return an operation ID identifying that + * particular migration operation. + * **NOTE: This property will not be serialized. It can only be populated by the server.** + */ + readonly operationId?: string; +} + +/** + * String dictionary resource. + */ +export interface StringDictionary extends ProxyOnlyResource { + /** + * Settings. + */ + properties?: { [propertyName: string]: string }; +} + +/** + * Swift Virtual Network Contract. This is used to enable the new Swift way of doing virtual + * network integration. + */ +export interface SwiftVirtualNetwork extends ProxyOnlyResource { + /** + * 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. + */ + subnetResourceId?: string; + /** + * A flag that specifies if the scale unit this Web App is on supports Swift integration. + */ + swiftSupported?: boolean; +} + +/** + * Triggered Web Job Run Information. + */ +export interface TriggeredJobRun extends ProxyOnlyResource { + /** + * Job ID. + */ + webJobId?: string; + /** + * Job name. + */ + webJobName?: string; + /** + * Job status. Possible values include: 'Success', 'Failed', 'Error' + */ + status?: TriggeredWebJobStatus; + /** + * Start time. + */ + startTime?: Date; + /** + * End time. + */ + endTime?: Date; + /** + * Job duration. + */ + duration?: string; + /** + * Output URL. + */ + outputUrl?: string; + /** + * Error URL. + */ + errorUrl?: string; + /** + * Job URL. + */ + url?: string; + /** + * Job name. + */ + jobName?: string; + /** + * Job trigger. + */ + trigger?: string; +} + +/** + * Triggered Web Job History. List of Triggered Web Job Run Information elements. + */ +export interface TriggeredJobHistory extends ProxyOnlyResource { + /** + * List of triggered web job runs. + */ + runs?: TriggeredJobRun[]; +} + +/** + * Triggered Web Job Information. + */ +export interface TriggeredWebJob extends ProxyOnlyResource { + /** + * Latest job run information. + */ + latestRun?: TriggeredJobRun; + /** + * History URL. + */ + historyUrl?: string; + /** + * Scheduler Logs URL. + */ + schedulerLogsUrl?: string; + /** + * Run command. + */ + runCommand?: string; + /** + * Job URL. + */ + url?: string; + /** + * Extra Info URL. + */ + extraInfoUrl?: string; + /** + * Job type. Possible values include: 'Continuous', 'Triggered' + */ + webJobType?: WebJobType; + /** + * Error information. + */ + error?: string; + /** + * Using SDK? + */ + usingSdk?: boolean; + /** + * Job settings. + */ + settings?: { [propertyName: string]: any }; +} + +/** + * Web Job Information. + */ +export interface WebJob extends ProxyOnlyResource { + /** + * Run command. + */ + runCommand?: string; + /** + * Job URL. + */ + url?: string; + /** + * Extra Info URL. + */ + extraInfoUrl?: string; + /** + * Job type. Possible values include: 'Continuous', 'Triggered' + */ + webJobType?: WebJobType; + /** + * Error information. + */ + error?: string; + /** + * Using SDK? + */ + usingSdk?: boolean; + /** + * Job settings. + */ + settings?: { [propertyName: string]: any }; +} + +/** + * App Service billing entity that contains information about meter which the Azure billing system + * utilizes to charge users for services. + */ +export interface BillingMeter extends ProxyOnlyResource { + /** + * Meter GUID onboarded in Commerce + */ + meterId?: string; + /** + * Azure Location of billable resource + */ + billingLocation?: string; + /** + * Short Name from App Service Azure pricing Page + */ + shortName?: string; + /** + * Friendly name of the meter + */ + friendlyName?: string; + /** + * App Service ResourceType meter used for + */ + resourceType?: string; + /** + * App Service OS type meter used for + */ + osType?: string; +} + +/** + * Object with a list of the resources that need to be moved and the resource group they should be + * moved to. + */ +export interface CsmMoveResourceEnvelope { + targetResourceGroup?: string; + resources?: string[]; +} + +/** + * Geographical region. + */ +export interface GeoRegion extends ProxyOnlyResource { + /** + * Region description. + * **NOTE: This property will not be serialized. It can only be populated by the server.** + */ + readonly description?: string; + /** + * Display name for region. + * **NOTE: This property will not be serialized. It can only be populated by the server.** + */ + readonly displayName?: string; +} + +/** + * Information needed to create resources on an App Service Environment. + */ +export interface HostingEnvironmentDeploymentInfo { + /** + * Name of the App Service Environment. + */ + name?: string; + /** + * Location of the App Service Environment. + */ + location?: string; +} + +/** + * List of available locations (regions or App Service Environments) for + * deployment of App Service resources. + */ +export interface DeploymentLocations { + /** + * Available regions. + */ + locations?: GeoRegion[]; + /** + * Available App Service Environments with full descriptions of the environments. + */ + hostingEnvironments?: AppServiceEnvironment[]; + /** + * Available App Service Environments with basic information. + */ + hostingEnvironmentDeploymentInfos?: HostingEnvironmentDeploymentInfo[]; +} + +/** + * A Global SKU Description. + */ +export interface GlobalCsmSkuDescription { + /** + * Name of the resource SKU. + */ + name?: string; + /** + * Service Tier of the resource SKU. + */ + tier?: string; + /** + * Size specifier of the resource SKU. + */ + size?: string; + /** + * Family code of the resource SKU. + */ + family?: string; + /** + * Min, max, and default scale values of the SKU. + */ + capacity?: SkuCapacity; + /** + * Locations of the SKU. + */ + locations?: string[]; + /** + * Capabilities of the SKU, e.g., is traffic manager enabled? + */ + capabilities?: Capability[]; +} + +/** + * Premier add-on offer. + */ +export interface PremierAddOnOffer extends ProxyOnlyResource { + /** + * Premier add on SKU. + */ + sku?: string; + /** + * Premier add on offer Product. + */ + product?: string; + /** + * Premier add on offer Vendor. + */ + vendor?: string; + /** + * true if promotion code is required; otherwise, false. + */ + promoCodeRequired?: boolean; + /** + * Premier add on offer Quota. + */ + quota?: number; + /** + * App Service plans this offer is restricted to. Possible values include: 'None', 'Free', + * 'Shared', 'Basic', 'Standard', 'Premium' + */ + webHostingPlanRestrictions?: AppServicePlanRestrictions; + /** + * Privacy policy URL. + */ + privacyPolicyUrl?: string; + /** + * Legal terms URL. + */ + legalTermsUrl?: string; + /** + * Marketplace publisher. + */ + marketplacePublisher?: string; + /** + * Marketplace offer. + */ + marketplaceOffer?: string; +} + +/** + * Information regarding availability of a resource name. + */ +export interface ResourceNameAvailability { + /** + * true indicates name is valid and available. false indicates the name + * is invalid, unavailable, or both. + */ + nameAvailable?: boolean; + /** + * 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' + */ + reason?: InAvailabilityReasonType; + /** + * 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. + */ + message?: string; +} + +/** + * Resource name availability request content. + */ +export interface ResourceNameAvailabilityRequest { + /** + * Resource name to verify. + */ + name: string; + /** + * 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' + */ + type: CheckNameResourceTypes; + /** + * Is fully qualified domain name. + */ + isFqdn?: boolean; +} + +/** + * Collection of SKU information. + */ +export interface SkuInfos { + /** + * Resource type that this SKU applies to. + */ + resourceType?: string; + /** + * List of SKUs the subscription is able to use. + */ + skus?: GlobalCsmSkuDescription[]; +} + +/** + * The source control OAuth token. + */ +export interface SourceControl extends ProxyOnlyResource { + /** + * OAuth access token. + */ + token?: string; + /** + * OAuth access token secret. + */ + tokenSecret?: string; + /** + * OAuth refresh token. + */ + refreshToken?: string; + /** + * OAuth token expiration. + */ + expirationTime?: Date; +} + +/** + * Container settings validation request context + */ +export interface ValidateContainerSettingsRequest { + /** + * Base URL of the container registry + */ + baseUrl?: string; + /** + * Username for to access the container registry + */ + username?: string; + /** + * Password for to access the container registry + */ + password?: string; + /** + * Repository name (image name) + */ + repository?: string; + /** + * Image tag + */ + tag?: string; + /** + * Platform (windows or linux) + */ + platform?: string; +} + +/** + * Resource validation request content. + */ +export interface ValidateRequest { + /** + * Resource name to verify. + */ + name: string; + /** + * Resource type used for verification. Possible values include: 'ServerFarm', 'Site' + */ + type: ValidateResourceTypes; + /** + * Expected location of the resource. + */ + location: string; + /** + * ARM resource ID of an App Service plan that would host the app. + */ + serverFarmId?: string; + /** + * Name of the target SKU for the App Service plan. + */ + skuName?: string; + /** + * true if App Service plan is for Linux workers; otherwise, false. + */ + needLinuxWorkers?: boolean; + /** + * true if App Service plan is for Spot instances; otherwise, false. + */ + isSpot?: boolean; + /** + * Target capacity of the App Service plan (number of VMs). + */ + capacity?: number; + /** + * Name of App Service Environment where app or App Service plan should be created. + */ + hostingEnvironment?: string; + /** + * true if App Service plan is running as a windows container + */ + isXenon?: boolean; +} + +/** + * Error details for when validation fails. + */ +export interface ValidateResponseError { + /** + * Validation error code. + */ + code?: string; + /** + * Validation error message. + */ + message?: string; +} + +/** + * Describes the result of resource validation. + */ +export interface ValidateResponse { + /** + * Result of validation. + */ + status?: string; + /** + * Error details for the case when validation fails. + */ + error?: ValidateResponseError; +} + +/** + * The required set of inputs to validate a VNET + */ +export interface VnetParameters extends ProxyOnlyResource { + /** + * The Resource Group of the VNET to be validated + */ + vnetResourceGroup?: string; + /** + * The name of the VNET to be validated + */ + vnetName?: string; + /** + * The subnet name to be validated + */ + vnetSubnetName?: string; +} + +/** + * A class that describes a test that failed during NSG and UDR validation. + */ +export interface VnetValidationTestFailure extends ProxyOnlyResource { + /** + * The name of the test that failed. + */ + testName?: string; + /** + * The details of what caused the failure, e.g. the blocking rule name, etc. + */ + details?: string; +} + +/** + * A class that describes the reason for a validation failure. + */ +export interface VnetValidationFailureDetails extends ProxyOnlyResource { + /** + * A flag describing whether or not validation failed. + */ + failed?: boolean; + /** + * A list of tests that failed in the validation. + */ + failedTests?: VnetValidationTestFailure[]; +} + +/** + * ARM resource for a app service plan. + */ +export interface AppServicePlanPatchResource extends ProxyOnlyResource { + /** + * Target worker tier assigned to the App Service plan. + */ + workerTierName?: string; + /** + * App Service plan status. Possible values include: 'Ready', 'Pending', 'Creating' + * **NOTE: This property will not be serialized. It can only be populated by the server.** + */ + readonly status?: StatusOptions; + /** + * App Service plan subscription. + * **NOTE: This property will not be serialized. It can only be populated by the server.** + */ + readonly subscription?: string; + /** + * Specification for the App Service Environment to use for the App Service plan. + */ + hostingEnvironmentProfile?: HostingEnvironmentProfile; + /** + * Maximum number of instances that can be assigned to this App Service plan. + * **NOTE: This property will not be serialized. It can only be populated by the server.** + */ + readonly maximumNumberOfWorkers?: number; + /** + * Geographical location for the App Service plan. + * **NOTE: This property will not be serialized. It can only be populated by the server.** + */ + readonly geoRegion?: string; + /** + * 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. + */ + perSiteScaling?: boolean; + /** + * Maximum number of total workers allowed for this ElasticScaleEnabled App Service Plan + */ + maximumElasticWorkerCount?: number; + /** + * Number of apps assigned to this App Service plan. + * **NOTE: This property will not be serialized. It can only be populated by the server.** + */ + readonly numberOfSites?: number; + /** + * If true, this App Service Plan owns spot instances. + */ + isSpot?: boolean; + /** + * The time when the server farm expires. Valid only if it is a spot server farm. + */ + spotExpirationTime?: Date; + /** + * The time when the server farm free offer expires. + */ + freeOfferExpirationTime?: Date; + /** + * Resource group of the App Service plan. + * **NOTE: This property will not be serialized. It can only be populated by the server.** + */ + readonly resourceGroup?: string; + /** + * If Linux app service plan true, false otherwise. Default value: + * false. + */ + reserved?: boolean; + /** + * Obsolete: If Hyper-V container app service plan true, false + * otherwise. Default value: false. + */ + isXenon?: boolean; + /** + * If Hyper-V container app service plan true, false otherwise. Default + * value: false. + */ + hyperV?: boolean; + /** + * Scaling worker count. + */ + targetWorkerCount?: number; + /** + * Scaling worker size ID. + */ + targetWorkerSizeId?: number; + /** + * Provisioning state of the App Service Environment. Possible values include: 'Succeeded', + * 'Failed', 'Canceled', 'InProgress', 'Deleting' + * **NOTE: This property will not be serialized. It can only be populated by the server.** + */ + readonly provisioningState?: ProvisioningState; +} + +/** + * Hybrid Connection limits contract. This is used to return the plan limits of Hybrid Connections. + */ +export interface HybridConnectionLimits extends ProxyOnlyResource { + /** + * The current number of Hybrid Connections. + * **NOTE: This property will not be serialized. It can only be populated by the server.** + */ + readonly current?: number; + /** + * The maximum number of Hybrid Connections allowed. + * **NOTE: This property will not be serialized. It can only be populated by the server.** + */ + readonly maximum?: number; +} + +/** + * Application stack minor version. + */ +export interface StackMinorVersion { + /** + * Application stack minor version (display only). + */ + displayVersion?: string; + /** + * Application stack minor version (runtime only). + */ + runtimeVersion?: string; + /** + * true if this is the default minor version; otherwise, false. + */ + isDefault?: boolean; + /** + * true if this supports Remote Debugging, otherwise false. + */ + isRemoteDebuggingEnabled?: boolean; +} + +/** + * Application stack major version. + */ +export interface StackMajorVersion { + /** + * Application stack major version (display only). + */ + displayVersion?: string; + /** + * Application stack major version (runtime only). + */ + runtimeVersion?: string; + /** + * true if this is the default major version; otherwise, false. + */ + isDefault?: boolean; + /** + * Minor versions associated with the major version. + */ + minorVersions?: StackMinorVersion[]; + /** + * true if this supports Application Insights; otherwise, false. + */ + applicationInsights?: boolean; +} + +/** + * Application stack. + */ +export interface ApplicationStack { + /** + * Application stack name. + */ + name?: string; + /** + * Application stack display name. + */ + display?: string; + /** + * Application stack dependency. + */ + dependency?: string; + /** + * List of major versions available. + */ + majorVersions?: StackMajorVersion[]; + /** + * List of frameworks associated with application stack. + */ + frameworks?: ApplicationStack[]; +} + +/** + * Represents a recommendation result generated by the recommendation engine. + */ +export interface Recommendation extends ProxyOnlyResource { + /** + * Timestamp when this instance was created. + */ + creationTime?: Date; + /** + * A GUID value that each recommendation object is associated with. + */ + recommendationId?: string; + /** + * Full ARM resource ID string that this recommendation object is associated with. + */ + resourceId?: string; + /** + * Name of a resource type this recommendation applies, e.g. Subscription, ServerFarm, Site. + * Possible values include: 'ServerFarm', 'Subscription', 'WebSite' + */ + resourceScope?: ResourceScopeType; + /** + * Unique name of the rule. + */ + ruleName?: string; + /** + * UI friendly name of the rule (may not be unique). + */ + displayName?: string; + /** + * Recommendation text. + */ + message?: string; + /** + * Level indicating how critical this recommendation can impact. Possible values include: + * 'Critical', 'Warning', 'Information', 'NonUrgentSuggestion' + */ + level?: NotificationLevel; + /** + * List of channels that this recommendation can apply. Possible values include: 'Notification', + * 'Api', 'Email', 'Webhook', 'All' + */ + channels?: Channels; + /** + * The list of category tags that this recommendation belongs to. + * **NOTE: This property will not be serialized. It can only be populated by the server.** + */ + readonly categoryTags?: string[]; + /** + * Name of action recommended by this object. + */ + actionName?: string; + /** + * True if this recommendation is still valid (i.e. "actionable"). False if it is invalid. + */ + enabled?: number; + /** + * The list of states of this recommendation. If it's null then it should be considered "Active". + */ + states?: string[]; + /** + * The beginning time in UTC of a range that the recommendation refers to. + */ + startTime?: Date; + /** + * The end time in UTC of a range that the recommendation refers to. + */ + endTime?: Date; + /** + * When to notify this recommendation next in UTC. Null means that this will never be notified + * anymore. + */ + nextNotificationTime?: Date; + /** + * Date and time in UTC when this notification expires. + */ + notificationExpirationTime?: Date; + /** + * Last timestamp in UTC this instance was actually notified. Null means that this recommendation + * hasn't been notified yet. + */ + notifiedTime?: Date; + /** + * A metric value measured by the rule. + */ + score?: number; + /** + * True if this is associated with a dynamically added rule + */ + isDynamic?: boolean; + /** + * Extension name of the portal if exists. + */ + extensionName?: string; + /** + * Deep link to a blade on the portal. + */ + bladeName?: string; + /** + * Forward link to an external document associated with the rule. + */ + forwardLink?: string; +} + +/** + * Represents a recommendation rule that the recommendation engine can perform. + */ +export interface RecommendationRule extends ProxyOnlyResource { + /** + * Unique name of the rule. + */ + recommendationName?: string; + /** + * UI friendly name of the rule. + */ + displayName?: string; + /** + * Localized name of the rule (Good for UI). + */ + message?: string; + /** + * 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. + */ + recommendationId?: string; + /** + * Localized detailed description of the rule. + */ + description?: string; + /** + * Name of action that is recommended by this rule in string. + */ + actionName?: string; + /** + * Level of impact indicating how critical this rule is. Possible values include: 'Critical', + * 'Warning', 'Information', 'NonUrgentSuggestion' + */ + level?: NotificationLevel; + /** + * List of available channels that this rule applies. Possible values include: 'Notification', + * 'Api', 'Email', 'Webhook', 'All' + */ + channels?: Channels; + /** + * The list of category tags that this recommendation rule belongs to. + * **NOTE: This property will not be serialized. It can only be populated by the server.** + */ + readonly categoryTags?: string[]; + /** + * True if this is associated with a dynamically added rule + */ + isDynamic?: boolean; + /** + * Extension name of the portal if exists. Applicable to dynamic rule only. + */ + extensionName?: string; + /** + * Deep link to a blade on the portal. Applicable to dynamic rule only. + */ + bladeName?: string; + /** + * Forward link to an external document associated with the rule. Applicable to dynamic rule + * only. + */ + forwardLink?: string; +} + +/** + * Optional Parameters. + */ +export interface WebAppsListByResourceGroupOptionalParams extends msRest.RequestOptionsBase { + /** + * Specify true to include deployment slots in results. The default is false, + * which only gives you the production slot of all apps. + */ + includeSlots?: boolean; +} + +/** + * Optional Parameters. + */ +export interface WebAppsDeleteMethodOptionalParams extends msRest.RequestOptionsBase { + /** + * If true, web app metrics are also deleted. + */ + deleteMetrics?: boolean; + /** + * 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. + */ + deleteEmptyServerFarm?: boolean; +} + +/** + * Optional Parameters. + */ +export interface WebAppsAnalyzeCustomHostnameOptionalParams extends msRest.RequestOptionsBase { + /** + * Custom hostname. + */ + hostName?: string; +} + +/** + * Optional Parameters. + */ +export interface WebAppsListMetricsOptionalParams extends msRest.RequestOptionsBase { + /** + * Specify "true" to include metric details in the response. It is "false" by default. + */ + details?: boolean; + /** + * 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]'. + */ + filter?: string; +} + +/** + * Optional Parameters. + */ +export interface WebAppsStartWebSiteNetworkTraceOptionalParams extends msRest.RequestOptionsBase { + /** + * The duration to keep capturing in seconds. + */ + durationInSeconds?: number; + /** + * The maximum frame length in bytes (Optional). + */ + maxFrameLength?: number; + /** + * The Blob URL to store capture file. + */ + sasUrl?: string; +} + +/** + * Optional Parameters. + */ +export interface WebAppsStartWebSiteNetworkTraceOperationOptionalParams extends msRest.RequestOptionsBase { + /** + * The duration to keep capturing in seconds. + */ + durationInSeconds?: number; + /** + * The maximum frame length in bytes (Optional). + */ + maxFrameLength?: number; + /** + * The Blob URL to store capture file. + */ + sasUrl?: string; +} + +/** + * Optional Parameters. + */ +export interface WebAppsListPerfMonCountersOptionalParams extends msRest.RequestOptionsBase { + /** + * 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]'. + */ + filter?: string; +} + +/** + * Optional Parameters. + */ +export interface WebAppsRestartOptionalParams extends msRest.RequestOptionsBase { + /** + * Specify true to apply the configuration settings and restarts the app only if necessary. By + * default, the API always restarts and reprovisions the app. + */ + softRestart?: boolean; + /** + * Specify true to block until the app is restarted. By default, it is set to false, and the API + * responds immediately (asynchronous). + */ + synchronous?: boolean; +} + +/** + * Optional Parameters. + */ +export interface WebAppsDeleteSlotOptionalParams extends msRest.RequestOptionsBase { + /** + * If true, web app metrics are also deleted. + */ + deleteMetrics?: boolean; + /** + * 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. + */ + deleteEmptyServerFarm?: boolean; +} + +/** + * Optional Parameters. + */ +export interface WebAppsAnalyzeCustomHostnameSlotOptionalParams extends msRest.RequestOptionsBase { + /** + * Custom hostname. + */ + hostName?: string; +} + +/** + * Optional Parameters. + */ +export interface WebAppsListMetricsSlotOptionalParams extends msRest.RequestOptionsBase { + /** + * Specify "true" to include metric details in the response. It is "false" by default. + */ + details?: boolean; + /** + * 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]'. + */ + filter?: string; +} + +/** + * Optional Parameters. + */ +export interface WebAppsStartWebSiteNetworkTraceSlotOptionalParams extends msRest.RequestOptionsBase { + /** + * The duration to keep capturing in seconds. + */ + durationInSeconds?: number; + /** + * The maximum frame length in bytes (Optional). + */ + maxFrameLength?: number; + /** + * The Blob URL to store capture file. + */ + sasUrl?: string; +} + +/** + * Optional Parameters. + */ +export interface WebAppsStartWebSiteNetworkTraceOperationSlotOptionalParams extends msRest.RequestOptionsBase { + /** + * The duration to keep capturing in seconds. + */ + durationInSeconds?: number; + /** + * The maximum frame length in bytes (Optional). + */ + maxFrameLength?: number; + /** + * The Blob URL to store capture file. + */ + sasUrl?: string; +} + +/** + * Optional Parameters. + */ +export interface WebAppsListPerfMonCountersSlotOptionalParams extends msRest.RequestOptionsBase { + /** + * 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]'. + */ + filter?: string; +} + +/** + * Optional Parameters. + */ +export interface WebAppsRestartSlotOptionalParams extends msRest.RequestOptionsBase { + /** + * Specify true to apply the configuration settings and restarts the app only if necessary. By + * default, the API always restarts and reprovisions the app. + */ + softRestart?: boolean; + /** + * Specify true to block until the app is restarted. By default, it is set to false, and the API + * responds immediately (asynchronous). + */ + synchronous?: boolean; +} + +/** + * Optional Parameters. + */ +export interface WebAppsStartNetworkTraceSlotOptionalParams extends msRest.RequestOptionsBase { + /** + * The duration to keep capturing in seconds. + */ + durationInSeconds?: number; + /** + * The maximum frame length in bytes (Optional). + */ + maxFrameLength?: number; + /** + * The Blob URL to store capture file. + */ + sasUrl?: string; +} + +/** + * Optional Parameters. + */ +export interface WebAppsListUsagesSlotOptionalParams extends msRest.RequestOptionsBase { + /** + * 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]'. + */ + filter?: string; +} + +/** + * Optional Parameters. + */ +export interface WebAppsStartNetworkTraceOptionalParams extends msRest.RequestOptionsBase { + /** + * The duration to keep capturing in seconds. + */ + durationInSeconds?: number; + /** + * The maximum frame length in bytes (Optional). + */ + maxFrameLength?: number; + /** + * The Blob URL to store capture file. + */ + sasUrl?: string; +} + +/** + * Optional Parameters. + */ +export interface WebAppsListUsagesOptionalParams extends msRest.RequestOptionsBase { + /** + * 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]'. + */ + filter?: string; +} + +/** + * Optional Parameters. + */ +export interface WebAppsBeginStartWebSiteNetworkTraceOperationOptionalParams extends msRest.RequestOptionsBase { + /** + * The duration to keep capturing in seconds. + */ + durationInSeconds?: number; + /** + * The maximum frame length in bytes (Optional). + */ + maxFrameLength?: number; + /** + * The Blob URL to store capture file. + */ + sasUrl?: string; +} + +/** + * Optional Parameters. + */ +export interface WebAppsBeginStartWebSiteNetworkTraceOperationSlotOptionalParams extends msRest.RequestOptionsBase { + /** + * The duration to keep capturing in seconds. + */ + durationInSeconds?: number; + /** + * The maximum frame length in bytes (Optional). + */ + maxFrameLength?: number; + /** + * The Blob URL to store capture file. + */ + sasUrl?: string; +} + +/** + * Optional Parameters. + */ +export interface WebAppsBeginStartNetworkTraceSlotOptionalParams extends msRest.RequestOptionsBase { + /** + * The duration to keep capturing in seconds. + */ + durationInSeconds?: number; + /** + * The maximum frame length in bytes (Optional). + */ + maxFrameLength?: number; + /** + * The Blob URL to store capture file. + */ + sasUrl?: string; +} + +/** + * Optional Parameters. + */ +export interface WebAppsBeginStartNetworkTraceOptionalParams extends msRest.RequestOptionsBase { + /** + * The duration to keep capturing in seconds. + */ + durationInSeconds?: number; + /** + * The maximum frame length in bytes (Optional). + */ + maxFrameLength?: number; + /** + * The Blob URL to store capture file. + */ + sasUrl?: string; +} + +/** + * Optional Parameters. + */ +export interface WebSiteManagementClientListBillingMetersOptionalParams extends msRest.RequestOptionsBase { + /** + * Azure Location of billable resource + */ + billingLocation?: string; + /** + * App Service OS type meters used for + */ + osType?: string; +} + +/** + * Optional Parameters. + */ +export interface WebSiteManagementClientCheckNameAvailabilityOptionalParams extends msRest.RequestOptionsBase { + /** + * Is fully qualified domain name. + */ + isFqdn?: boolean; +} + +/** + * Optional Parameters. + */ +export interface WebSiteManagementClientListGeoRegionsOptionalParams extends msRest.RequestOptionsBase { + /** + * Name of SKU used to filter the regions. Possible values include: 'Free', 'Shared', 'Basic', + * 'Standard', 'Premium', 'Dynamic', 'Isolated', 'PremiumV2', 'ElasticPremium', 'ElasticIsolated' + */ + sku?: SkuName; + /** + * Specify true if you want to filter to only regions that support Linux workers. + */ + linuxWorkersEnabled?: boolean; + /** + * Specify true if you want to filter to only regions that support Xenon workers. + */ + xenonWorkersEnabled?: boolean; + /** + * Specify true if you want to filter to only regions that support Linux Consumption + * Workers. + */ + linuxDynamicWorkersEnabled?: boolean; +} + +/** + * Optional Parameters. + */ +export interface WebSiteManagementClientListSiteIdentifiersAssignedToHostNameOptionalParams extends msRest.RequestOptionsBase { + /** + * Name of the object. + */ + name?: string; +} + +/** + * Optional Parameters. + */ +export interface AppServicePlansListOptionalParams extends msRest.RequestOptionsBase { + /** + * 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. + */ + detailed?: boolean; +} + +/** + * Optional Parameters. + */ +export interface AppServicePlansListMetricsOptionalParams extends msRest.RequestOptionsBase { + /** + * Specify true to include instance details. The default is false. + */ + details?: boolean; + /** + * 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]'. + */ + filter?: string; +} + +/** + * Optional Parameters. + */ +export interface AppServicePlansRestartWebAppsOptionalParams extends msRest.RequestOptionsBase { + /** + * Specify true to perform a soft restart, applies the configuration settings and + * restarts the apps if necessary. The default is false, which always restarts and + * reprovisions the apps + */ + softRestart?: boolean; +} + +/** + * Optional Parameters. + */ +export interface AppServicePlansListWebAppsOptionalParams extends msRest.RequestOptionsBase { + /** + * 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 + */ + skipToken?: string; + /** + * Supported filter: $filter=state eq running. Returns only web apps that are currently running + */ + filter?: string; + /** + * List page size. If specified, results are paged. + */ + top?: string; +} + +/** + * Optional Parameters. + */ +export interface AppServicePlansListUsagesOptionalParams extends msRest.RequestOptionsBase { + /** + * Return only usages/metrics specified in the filter. Filter conforms to odata syntax. Example: + * $filter=(name.value eq 'Metric1' or name.value eq 'Metric2'). + */ + filter?: string; +} + +/** + * Optional Parameters. + */ +export interface ProviderGetAvailableStacksOptionalParams extends msRest.RequestOptionsBase { + /** + * Possible values include: 'Windows', 'Linux', 'WindowsFunctions', 'LinuxFunctions' + */ + osTypeSelected?: OsTypeSelected; +} + +/** + * Optional Parameters. + */ +export interface ProviderGetAvailableStacksOnPremOptionalParams extends msRest.RequestOptionsBase { + /** + * Possible values include: 'Windows', 'Linux', 'WindowsFunctions', 'LinuxFunctions' + */ + osTypeSelected?: OsTypeSelected1; +} + +/** + * Optional Parameters. + */ +export interface RecommendationsListOptionalParams extends msRest.RequestOptionsBase { + /** + * Specify true to return only the most critical recommendations. The default is + * false, which returns all recommendations. + */ + featured?: boolean; + /** + * Filter is specified by using OData syntax. Example: $filter=channel eq 'Api' or channel eq + * 'Notification' and startTime eq 2014-01-01T00:00:00Z and endTime eq 2014-12-31T23:59:59Z and + * timeGrain eq duration'[PT1H|PT1M|P1D] + */ + filter?: string; +} + +/** + * Optional Parameters. + */ +export interface RecommendationsListHistoryForHostingEnvironmentOptionalParams extends msRest.RequestOptionsBase { + /** + * Specify false to return all recommendations. The default is true, + * which returns only expired recommendations. + */ + expiredOnly?: boolean; + /** + * Filter is specified by using OData syntax. Example: $filter=channel eq 'Api' or channel eq + * 'Notification' and startTime eq 2014-01-01T00:00:00Z and endTime eq 2014-12-31T23:59:59Z and + * timeGrain eq duration'[PT1H|PT1M|P1D] + */ + filter?: string; +} + +/** + * Optional Parameters. + */ +export interface RecommendationsListRecommendedRulesForHostingEnvironmentOptionalParams extends msRest.RequestOptionsBase { + /** + * Specify true to return only the most critical recommendations. The default is + * false, which returns all recommendations. + */ + featured?: boolean; + /** + * Return only channels specified in the filter. Filter is specified by using OData syntax. + * Example: $filter=channel eq 'Api' or channel eq 'Notification' + */ + filter?: string; +} + +/** + * Optional Parameters. + */ +export interface RecommendationsGetRuleDetailsByHostingEnvironmentOptionalParams extends msRest.RequestOptionsBase { + /** + * Specify true to update the last-seen timestamp of the recommendation object. + */ + updateSeen?: boolean; + /** + * The GUID of the recommendation object if you query an expired one. You don't need to specify + * it to query an active entry. + */ + recommendationId?: string; +} + +/** + * Optional Parameters. + */ +export interface RecommendationsListHistoryForWebAppOptionalParams extends msRest.RequestOptionsBase { + /** + * Specify false to return all recommendations. The default is true, + * which returns only expired recommendations. + */ + expiredOnly?: boolean; + /** + * Filter is specified by using OData syntax. Example: $filter=channel eq 'Api' or channel eq + * 'Notification' and startTime eq 2014-01-01T00:00:00Z and endTime eq 2014-12-31T23:59:59Z and + * timeGrain eq duration'[PT1H|PT1M|P1D] + */ + filter?: string; +} + +/** + * Optional Parameters. + */ +export interface RecommendationsListRecommendedRulesForWebAppOptionalParams extends msRest.RequestOptionsBase { + /** + * Specify true to return only the most critical recommendations. The default is + * false, which returns all recommendations. + */ + featured?: boolean; + /** + * Return only channels specified in the filter. Filter is specified by using OData syntax. + * Example: $filter=channel eq 'Api' or channel eq 'Notification' + */ + filter?: string; +} + +/** + * Optional Parameters. + */ +export interface RecommendationsGetRuleDetailsByWebAppOptionalParams extends msRest.RequestOptionsBase { + /** + * Specify true to update the last-seen timestamp of the recommendation object. + */ + updateSeen?: boolean; + /** + * The GUID of the recommendation object if you query an expired one. You don't need to specify + * it to query an active entry. + */ + recommendationId?: string; +} + +/** + * An interface representing WebSiteManagementClientOptions. + */ +export interface WebSiteManagementClientOptions extends AzureServiceClientOptions { + baseUri?: string; +} + +/** + * @interface + * Collection of certificates. + * @extends Array + */ +export interface CertificateCollection extends Array { + /** + * Link to next page of resources. + * **NOTE: This property will not be serialized. It can only be populated by the server.** + */ + readonly nextLink?: string; +} + +/** + * @interface + * Collection of App Service apps. + * @extends Array + */ +export interface WebAppCollection extends Array { + /** + * Link to next page of resources. + * **NOTE: This property will not be serialized. It can only be populated by the server.** + */ + readonly nextLink?: string; +} + +/** + * @interface + * Collection of backup items. + * @extends Array + */ +export interface BackupItemCollection extends Array { + /** + * Link to next page of resources. + * **NOTE: This property will not be serialized. It can only be populated by the server.** + */ + readonly nextLink?: string; +} + +/** + * @interface + * Collection of site configurations. + * @extends Array + */ +export interface SiteConfigResourceCollection extends Array { + /** + * Link to next page of resources. + * **NOTE: This property will not be serialized. It can only be populated by the server.** + */ + readonly nextLink?: string; +} + +/** + * @interface + * Collection of metadata for the app configuration snapshots that can be restored. + * @extends Array + */ +export interface SiteConfigurationSnapshotInfoCollection extends Array { + /** + * Link to next page of resources. + * **NOTE: This property will not be serialized. It can only be populated by the server.** + */ + readonly nextLink?: string; +} + +/** + * @interface + * Collection of Kudu continuous web job information elements. + * @extends Array + */ +export interface ContinuousWebJobCollection extends Array { + /** + * Link to next page of resources. + * **NOTE: This property will not be serialized. It can only be populated by the server.** + */ + readonly nextLink?: string; +} + +/** + * @interface + * Collection of app deployments. + * @extends Array + */ +export interface DeploymentCollection extends Array { + /** + * Link to next page of resources. + * **NOTE: This property will not be serialized. It can only be populated by the server.** + */ + readonly nextLink?: string; +} + +/** + * @interface + * Collection of identifiers. + * @extends Array + */ +export interface IdentifierCollection extends Array { + /** + * Link to next page of resources. + * **NOTE: This property will not be serialized. It can only be populated by the server.** + */ + readonly nextLink?: string; +} + +/** + * @interface + * Collection of Kudu function information elements. + * @extends Array + */ +export interface FunctionEnvelopeCollection extends Array { + /** + * Link to next page of resources. + * **NOTE: This property will not be serialized. It can only be populated by the server.** + */ + readonly nextLink?: string; +} + +/** + * @interface + * Collection of hostname bindings. + * @extends Array + */ +export interface HostNameBindingCollection extends Array { + /** + * Link to next page of resources. + * **NOTE: This property will not be serialized. It can only be populated by the server.** + */ + readonly nextLink?: string; +} + +/** + * @interface + * Collection of app instances. + * @extends Array + */ +export interface WebAppInstanceCollection extends Array { + /** + * Link to next page of resources. + * **NOTE: This property will not be serialized. It can only be populated by the server.** + */ + readonly nextLink?: string; +} + +/** + * @interface + * Collection of Kudu process information elements. + * @extends Array + */ +export interface ProcessInfoCollection extends Array { + /** + * Link to next page of resources. + * **NOTE: This property will not be serialized. It can only be populated by the server.** + */ + readonly nextLink?: string; +} + +/** + * @interface + * Collection of Kudu thread information elements. + * @extends Array + */ +export interface ProcessModuleInfoCollection extends Array { + /** + * Link to next page of resources. + * **NOTE: This property will not be serialized. It can only be populated by the server.** + */ + readonly nextLink?: string; +} + +/** + * @interface + * Collection of Kudu thread information elements. + * @extends Array + */ +export interface ProcessThreadInfoCollection extends Array { + /** + * Link to next page of resources. + * **NOTE: This property will not be serialized. It can only be populated by the server.** + */ + readonly nextLink?: string; +} + +/** + * @interface + * Collection of metric definitions. + * @extends Array + */ +export interface ResourceMetricDefinitionCollection extends Array { + /** + * Link to next page of resources. + * **NOTE: This property will not be serialized. It can only be populated by the server.** + */ + readonly nextLink?: string; +} + +/** + * @interface + * Collection of metric responses. + * @extends Array + */ +export interface ResourceMetricCollection extends Array { + /** + * Link to next page of resources. + * **NOTE: This property will not be serialized. It can only be populated by the server.** + */ + readonly nextLink?: string; +} + +/** + * @interface + * Collection of performance monitor counters. + * @extends Array + */ +export interface PerfMonCounterCollection extends Array { + /** + * Link to next page of resources. + * **NOTE: This property will not be serialized. It can only be populated by the server.** + */ + readonly nextLink?: string; +} + +/** + * @interface + * Collection of public certificates + * @extends Array + */ +export interface PublicCertificateCollection extends Array { + /** + * Link to next page of resources. + * **NOTE: This property will not be serialized. It can only be populated by the server.** + */ + readonly nextLink?: string; +} + +/** + * @interface + * Collection of Kudu site extension information elements. + * @extends Array + */ +export interface SiteExtensionInfoCollection extends Array { + /** + * Link to next page of resources. + * **NOTE: This property will not be serialized. It can only be populated by the server.** + */ + readonly nextLink?: string; +} + +/** + * @interface + * Collection of slot differences. + * @extends Array + */ +export interface SlotDifferenceCollection extends Array { + /** + * Link to next page of resources. + * **NOTE: This property will not be serialized. It can only be populated by the server.** + */ + readonly nextLink?: string; +} + +/** + * @interface + * Collection of snapshots which can be used to revert an app to a previous time. + * @extends Array + */ +export interface SnapshotCollection extends Array { + /** + * Link to next page of resources. + * **NOTE: This property will not be serialized. It can only be populated by the server.** + */ + readonly nextLink?: string; +} + +/** + * @interface + * Collection of Kudu continuous web job information elements. + * @extends Array + */ +export interface TriggeredWebJobCollection extends Array { + /** + * Link to next page of resources. + * **NOTE: This property will not be serialized. It can only be populated by the server.** + */ + readonly nextLink?: string; +} + +/** + * @interface + * Collection of Kudu continuous web job information elements. + * @extends Array + */ +export interface TriggeredJobHistoryCollection extends Array { + /** + * Link to next page of resources. + * **NOTE: This property will not be serialized. It can only be populated by the server.** + */ + readonly nextLink?: string; +} + +/** + * @interface + * Collection of CSM usage quotas. + * @extends Array + */ +export interface CsmUsageQuotaCollection extends Array { + /** + * Link to next page of resources. + * **NOTE: This property will not be serialized. It can only be populated by the server.** + */ + readonly nextLink?: string; +} + +/** + * @interface + * Collection of Kudu web job information elements. + * @extends Array + */ +export interface WebJobCollection extends Array { + /** + * Link to next page of resources. + * **NOTE: This property will not be serialized. It can only be populated by the server.** + */ + readonly nextLink?: string; +} + +/** + * @interface + * Collection of source controls. + * @extends Array + */ +export interface SourceControlCollection extends Array { + /** + * Link to next page of resources. + * **NOTE: This property will not be serialized. It can only be populated by the server.** + */ + readonly nextLink?: string; +} + +/** + * @interface + * Collection of Billing Meters + * @extends Array + */ +export interface BillingMeterCollection extends Array { + /** + * Link to next page of resources. + * **NOTE: This property will not be serialized. It can only be populated by the server.** + */ + readonly nextLink?: string; +} + +/** + * @interface + * Collection of geographical regions. + * @extends Array + */ +export interface GeoRegionCollection extends Array { + /** + * Link to next page of resources. + * **NOTE: This property will not be serialized. It can only be populated by the server.** + */ + readonly nextLink?: string; +} + +/** + * @interface + * Collection of premier add-on offers. + * @extends Array + */ +export interface PremierAddOnOfferCollection extends Array { + /** + * Link to next page of resources. + * **NOTE: This property will not be serialized. It can only be populated by the server.** + */ + readonly nextLink?: string; +} + +/** + * @interface + * Collection of App Service plans. + * @extends Array + */ +export interface AppServicePlanCollection extends Array { + /** + * Link to next page of resources. + * **NOTE: This property will not be serialized. It can only be populated by the server.** + */ + readonly nextLink?: string; +} + +/** + * @interface + * Collection of resources. + * @extends Array + */ +export interface ResourceCollection extends Array { + /** + * Link to next page of resources. + * **NOTE: This property will not be serialized. It can only be populated by the server.** + */ + readonly nextLink?: string; +} + +/** + * @interface + * Collection of hostname bindings. + * @extends Array + */ +export interface HybridConnectionCollection extends Array { + /** + * Link to next page of resources. + * **NOTE: This property will not be serialized. It can only be populated by the server.** + */ + readonly nextLink?: string; +} + +/** + * @interface + * Collection of Application Stacks + * @extends Array + */ +export interface ApplicationStackCollection extends Array { + /** + * Link to next page of resources. + * **NOTE: This property will not be serialized. It can only be populated by the server.** + */ + readonly nextLink?: string; +} + +/** + * @interface + * Collection of Azure resource manager operation metadata. + * @extends Array + */ +export interface CsmOperationCollection extends Array { + /** + * Link to next page of resources. + * **NOTE: This property will not be serialized. It can only be populated by the server.** + */ + readonly nextLink?: string; +} + +/** + * @interface + * Collection of recommendations. + * @extends Array + */ +export interface RecommendationCollection extends Array { + /** + * Link to next page of resources. + * **NOTE: This property will not be serialized. It can only be populated by the server.** + */ + readonly nextLink?: string; +} + +/** + * Defines values for KeyVaultSecretStatus. + * Possible values include: 'Initialized', 'WaitingOnCertificateOrder', 'Succeeded', + * 'CertificateOrderFailed', 'OperationNotPermittedOnKeyVault', + * 'AzureServiceUnauthorizedToAccessKeyVault', 'KeyVaultDoesNotExist', + * 'KeyVaultSecretDoesNotExist', 'UnknownError', 'ExternalPrivateKey', 'Unknown' + * @readonly + * @enum {string} + */ +export type KeyVaultSecretStatus = 'Initialized' | 'WaitingOnCertificateOrder' | 'Succeeded' | 'CertificateOrderFailed' | 'OperationNotPermittedOnKeyVault' | 'AzureServiceUnauthorizedToAccessKeyVault' | 'KeyVaultDoesNotExist' | 'KeyVaultSecretDoesNotExist' | 'UnknownError' | 'ExternalPrivateKey' | 'Unknown'; + +/** + * Defines values for RouteType. + * Possible values include: 'DEFAULT', 'INHERITED', 'STATIC' + * @readonly + * @enum {string} + */ +export type RouteType = 'DEFAULT' | 'INHERITED' | 'STATIC'; + +/** + * Defines values for ManagedServiceIdentityType. + * Possible values include: 'SystemAssigned', 'UserAssigned', 'SystemAssigned, UserAssigned', + * 'None' + * @readonly + * @enum {string} + */ +export type ManagedServiceIdentityType = 'SystemAssigned' | 'UserAssigned' | 'SystemAssigned, UserAssigned' | 'None'; + +/** + * Defines values for IpFilterTag. + * Possible values include: 'Default', 'XffProxy' + * @readonly + * @enum {string} + */ +export type IpFilterTag = 'Default' | 'XffProxy'; + +/** + * Defines values for AutoHealActionType. + * Possible values include: 'Recycle', 'LogEvent', 'CustomAction' + * @readonly + * @enum {string} + */ +export type AutoHealActionType = 'Recycle' | 'LogEvent' | 'CustomAction'; + +/** + * Defines values for ConnectionStringType. + * Possible values include: 'MySql', 'SQLServer', 'SQLAzure', 'Custom', 'NotificationHub', + * 'ServiceBus', 'EventHub', 'ApiHub', 'DocDb', 'RedisCache', 'PostgreSQL' + * @readonly + * @enum {string} + */ +export type ConnectionStringType = 'MySql' | 'SQLServer' | 'SQLAzure' | 'Custom' | 'NotificationHub' | 'ServiceBus' | 'EventHub' | 'ApiHub' | 'DocDb' | 'RedisCache' | 'PostgreSQL'; + +/** + * Defines values for AzureStorageType. + * Possible values include: 'AzureFiles', 'AzureBlob' + * @readonly + * @enum {string} + */ +export type AzureStorageType = 'AzureFiles' | 'AzureBlob'; + +/** + * Defines values for AzureStorageState. + * Possible values include: 'Ok', 'InvalidCredentials', 'InvalidShare' + * @readonly + * @enum {string} + */ +export type AzureStorageState = 'Ok' | 'InvalidCredentials' | 'InvalidShare'; + +/** + * Defines values for ScmType. + * Possible values include: 'None', 'Dropbox', 'Tfs', 'LocalGit', 'GitHub', 'CodePlexGit', + * 'CodePlexHg', 'BitbucketGit', 'BitbucketHg', 'ExternalGit', 'ExternalHg', 'OneDrive', 'VSO' + * @readonly + * @enum {string} + */ +export type ScmType = 'None' | 'Dropbox' | 'Tfs' | 'LocalGit' | 'GitHub' | 'CodePlexGit' | 'CodePlexHg' | 'BitbucketGit' | 'BitbucketHg' | 'ExternalGit' | 'ExternalHg' | 'OneDrive' | 'VSO'; + +/** + * Defines values for ManagedPipelineMode. + * Possible values include: 'Integrated', 'Classic' + * @readonly + * @enum {string} + */ +export type ManagedPipelineMode = 'Integrated' | 'Classic'; + +/** + * Defines values for SiteLoadBalancing. + * Possible values include: 'WeightedRoundRobin', 'LeastRequests', 'LeastResponseTime', + * 'WeightedTotalTraffic', 'RequestHash' + * @readonly + * @enum {string} + */ +export type SiteLoadBalancing = 'WeightedRoundRobin' | 'LeastRequests' | 'LeastResponseTime' | 'WeightedTotalTraffic' | 'RequestHash'; + +/** + * Defines values for SupportedTlsVersions. + * Possible values include: '1.0', '1.1', '1.2' + * @readonly + * @enum {string} + */ +export type SupportedTlsVersions = '1.0' | '1.1' | '1.2'; + +/** + * Defines values for FtpsState. + * Possible values include: 'AllAllowed', 'FtpsOnly', 'Disabled' + * @readonly + * @enum {string} + */ +export type FtpsState = 'AllAllowed' | 'FtpsOnly' | 'Disabled'; + +/** + * Defines values for SslState. + * Possible values include: 'Disabled', 'SniEnabled', 'IpBasedEnabled' + * @readonly + * @enum {string} + */ +export type SslState = 'Disabled' | 'SniEnabled' | 'IpBasedEnabled'; + +/** + * Defines values for HostType. + * Possible values include: 'Standard', 'Repository' + * @readonly + * @enum {string} + */ +export type HostType = 'Standard' | 'Repository'; + +/** + * Defines values for UsageState. + * Possible values include: 'Normal', 'Exceeded' + * @readonly + * @enum {string} + */ +export type UsageState = 'Normal' | 'Exceeded'; + +/** + * Defines values for SiteAvailabilityState. + * Possible values include: 'Normal', 'Limited', 'DisasterRecoveryMode' + * @readonly + * @enum {string} + */ +export type SiteAvailabilityState = 'Normal' | 'Limited' | 'DisasterRecoveryMode'; + +/** + * Defines values for RedundancyMode. + * Possible values include: 'None', 'Manual', 'Failover', 'ActiveActive', 'GeoRedundant' + * @readonly + * @enum {string} + */ +export type RedundancyMode = 'None' | 'Manual' | 'Failover' | 'ActiveActive' | 'GeoRedundant'; + +/** + * Defines values for StatusOptions. + * Possible values include: 'Ready', 'Pending', 'Creating' + * @readonly + * @enum {string} + */ +export type StatusOptions = 'Ready' | 'Pending' | 'Creating'; + +/** + * Defines values for ProvisioningState. + * Possible values include: 'Succeeded', 'Failed', 'Canceled', 'InProgress', 'Deleting' + * @readonly + * @enum {string} + */ +export type ProvisioningState = 'Succeeded' | 'Failed' | 'Canceled' | 'InProgress' | 'Deleting'; + +/** + * Defines values for HostingEnvironmentStatus. + * Possible values include: 'Preparing', 'Ready', 'Scaling', 'Deleting' + * @readonly + * @enum {string} + */ +export type HostingEnvironmentStatus = 'Preparing' | 'Ready' | 'Scaling' | 'Deleting'; + +/** + * Defines values for InternalLoadBalancingMode. + * Possible values include: 'None', 'Web', 'Publishing' + * @readonly + * @enum {string} + */ +export type InternalLoadBalancingMode = 'None' | 'Web' | 'Publishing'; + +/** + * Defines values for ComputeModeOptions. + * Possible values include: 'Shared', 'Dedicated', 'Dynamic' + * @readonly + * @enum {string} + */ +export type ComputeModeOptions = 'Shared' | 'Dedicated' | 'Dynamic'; + +/** + * Defines values for WorkerSizeOptions. + * Possible values include: 'Small', 'Medium', 'Large', 'D1', 'D2', 'D3', 'Default' + * @readonly + * @enum {string} + */ +export type WorkerSizeOptions = 'Small' | 'Medium' | 'Large' | 'D1' | 'D2' | 'D3' | 'Default'; + +/** + * Defines values for AccessControlEntryAction. + * Possible values include: 'Permit', 'Deny' + * @readonly + * @enum {string} + */ +export type AccessControlEntryAction = 'Permit' | 'Deny'; + +/** + * Defines values for OperationStatus. + * Possible values include: 'InProgress', 'Failed', 'Succeeded', 'TimedOut', 'Created' + * @readonly + * @enum {string} + */ +export type OperationStatus = 'InProgress' | 'Failed' | 'Succeeded' | 'TimedOut' | 'Created'; + +/** + * Defines values for LogLevel. + * Possible values include: 'Off', 'Verbose', 'Information', 'Warning', 'Error' + * @readonly + * @enum {string} + */ +export type LogLevel = 'Off' | 'Verbose' | 'Information' | 'Warning' | 'Error'; + +/** + * Defines values for BackupItemStatus. + * Possible values include: 'InProgress', 'Failed', 'Succeeded', 'TimedOut', 'Created', 'Skipped', + * 'PartiallySucceeded', 'DeleteInProgress', 'DeleteFailed', 'Deleted' + * @readonly + * @enum {string} + */ +export type BackupItemStatus = 'InProgress' | 'Failed' | 'Succeeded' | 'TimedOut' | 'Created' | 'Skipped' | 'PartiallySucceeded' | 'DeleteInProgress' | 'DeleteFailed' | 'Deleted'; + +/** + * Defines values for DatabaseType. + * Possible values include: 'SqlAzure', 'MySql', 'LocalMySql', 'PostgreSql' + * @readonly + * @enum {string} + */ +export type DatabaseType = 'SqlAzure' | 'MySql' | 'LocalMySql' | 'PostgreSql'; + +/** + * Defines values for FrequencyUnit. + * Possible values include: 'Day', 'Hour' + * @readonly + * @enum {string} + */ +export type FrequencyUnit = 'Day' | 'Hour'; + +/** + * Defines values for ContinuousWebJobStatus. + * Possible values include: 'Initializing', 'Starting', 'Running', 'PendingRestart', 'Stopped' + * @readonly + * @enum {string} + */ +export type ContinuousWebJobStatus = 'Initializing' | 'Starting' | 'Running' | 'PendingRestart' | 'Stopped'; + +/** + * Defines values for WebJobType. + * Possible values include: 'Continuous', 'Triggered' + * @readonly + * @enum {string} + */ +export type WebJobType = 'Continuous' | 'Triggered'; + +/** + * Defines values for PublishingProfileFormat. + * Possible values include: 'FileZilla3', 'WebDeploy', 'Ftp' + * @readonly + * @enum {string} + */ +export type PublishingProfileFormat = 'FileZilla3' | 'WebDeploy' | 'Ftp'; + +/** + * Defines values for DnsVerificationTestResult. + * Possible values include: 'Passed', 'Failed', 'Skipped' + * @readonly + * @enum {string} + */ +export type DnsVerificationTestResult = 'Passed' | 'Failed' | 'Skipped'; + +/** + * Defines values for AzureResourceType. + * Possible values include: 'Website', 'TrafficManager' + * @readonly + * @enum {string} + */ +export type AzureResourceType = 'Website' | 'TrafficManager'; + +/** + * Defines values for CustomHostNameDnsRecordType. + * Possible values include: 'CName', 'A' + * @readonly + * @enum {string} + */ +export type CustomHostNameDnsRecordType = 'CName' | 'A'; + +/** + * Defines values for HostNameType. + * Possible values include: 'Verified', 'Managed' + * @readonly + * @enum {string} + */ +export type HostNameType = 'Verified' | 'Managed'; + +/** + * Defines values for MSDeployLogEntryType. + * Possible values include: 'Message', 'Warning', 'Error' + * @readonly + * @enum {string} + */ +export type MSDeployLogEntryType = 'Message' | 'Warning' | 'Error'; + +/** + * Defines values for MSDeployProvisioningState. + * Possible values include: 'accepted', 'running', 'succeeded', 'failed', 'canceled' + * @readonly + * @enum {string} + */ +export type MSDeployProvisioningState = 'accepted' | 'running' | 'succeeded' | 'failed' | 'canceled'; + +/** + * Defines values for MySqlMigrationType. + * Possible values include: 'LocalToRemote', 'RemoteToLocal' + * @readonly + * @enum {string} + */ +export type MySqlMigrationType = 'LocalToRemote' | 'RemoteToLocal'; + +/** + * Defines values for PublicCertificateLocation. + * Possible values include: 'CurrentUserMy', 'LocalMachineMy', 'Unknown' + * @readonly + * @enum {string} + */ +export type PublicCertificateLocation = 'CurrentUserMy' | 'LocalMachineMy' | 'Unknown'; + +/** + * Defines values for BackupRestoreOperationType. + * Possible values include: 'Default', 'Clone', 'Relocation', 'Snapshot', 'CloudFS' + * @readonly + * @enum {string} + */ +export type BackupRestoreOperationType = 'Default' | 'Clone' | 'Relocation' | 'Snapshot' | 'CloudFS'; + +/** + * Defines values for UnauthenticatedClientAction. + * Possible values include: 'RedirectToLoginPage', 'AllowAnonymous' + * @readonly + * @enum {string} + */ +export type UnauthenticatedClientAction = 'RedirectToLoginPage' | 'AllowAnonymous'; + +/** + * Defines values for BuiltInAuthenticationProvider. + * Possible values include: 'AzureActiveDirectory', 'Facebook', 'Google', 'MicrosoftAccount', + * 'Twitter' + * @readonly + * @enum {string} + */ +export type BuiltInAuthenticationProvider = 'AzureActiveDirectory' | 'Facebook' | 'Google' | 'MicrosoftAccount' | 'Twitter'; + +/** + * Defines values for CloneAbilityResult. + * Possible values include: 'Cloneable', 'PartiallyCloneable', 'NotCloneable' + * @readonly + * @enum {string} + */ +export type CloneAbilityResult = 'Cloneable' | 'PartiallyCloneable' | 'NotCloneable'; + +/** + * Defines values for SiteExtensionType. + * Possible values include: 'Gallery', 'WebRoot' + * @readonly + * @enum {string} + */ +export type SiteExtensionType = 'Gallery' | 'WebRoot'; + +/** + * Defines values for TriggeredWebJobStatus. + * Possible values include: 'Success', 'Failed', 'Error' + * @readonly + * @enum {string} + */ +export type TriggeredWebJobStatus = 'Success' | 'Failed' | 'Error'; + +/** + * Defines values for AppServicePlanRestrictions. + * Possible values include: 'None', 'Free', 'Shared', 'Basic', 'Standard', 'Premium' + * @readonly + * @enum {string} + */ +export type AppServicePlanRestrictions = 'None' | 'Free' | 'Shared' | 'Basic' | 'Standard' | 'Premium'; + +/** + * Defines values for InAvailabilityReasonType. + * Possible values include: 'Invalid', 'AlreadyExists' + * @readonly + * @enum {string} + */ +export type InAvailabilityReasonType = 'Invalid' | 'AlreadyExists'; + +/** + * Defines values for CheckNameResourceTypes. + * Possible values include: 'Site', 'Slot', 'HostingEnvironment', 'PublishingUser', + * 'Microsoft.Web/sites', 'Microsoft.Web/sites/slots', 'Microsoft.Web/hostingEnvironments', + * 'Microsoft.Web/publishingUsers' + * @readonly + * @enum {string} + */ +export type CheckNameResourceTypes = 'Site' | 'Slot' | 'HostingEnvironment' | 'PublishingUser' | 'Microsoft.Web/sites' | 'Microsoft.Web/sites/slots' | 'Microsoft.Web/hostingEnvironments' | 'Microsoft.Web/publishingUsers'; + +/** + * Defines values for ValidateResourceTypes. + * Possible values include: 'ServerFarm', 'Site' + * @readonly + * @enum {string} + */ +export type ValidateResourceTypes = 'ServerFarm' | 'Site'; + +/** + * Defines values for ResourceScopeType. + * Possible values include: 'ServerFarm', 'Subscription', 'WebSite' + * @readonly + * @enum {string} + */ +export type ResourceScopeType = 'ServerFarm' | 'Subscription' | 'WebSite'; + +/** + * Defines values for NotificationLevel. + * Possible values include: 'Critical', 'Warning', 'Information', 'NonUrgentSuggestion' + * @readonly + * @enum {string} + */ +export type NotificationLevel = 'Critical' | 'Warning' | 'Information' | 'NonUrgentSuggestion'; + +/** + * Defines values for Channels. + * Possible values include: 'Notification', 'Api', 'Email', 'Webhook', 'All' + * @readonly + * @enum {string} + */ +export type Channels = 'Notification' | 'Api' | 'Email' | 'Webhook' | 'All'; + +/** + * Defines values for SkuName. + * Possible values include: 'Free', 'Shared', 'Basic', 'Standard', 'Premium', 'Dynamic', + * 'Isolated', 'PremiumV2', 'ElasticPremium', 'ElasticIsolated' + * @readonly + * @enum {string} + */ +export type SkuName = 'Free' | 'Shared' | 'Basic' | 'Standard' | 'Premium' | 'Dynamic' | 'Isolated' | 'PremiumV2' | 'ElasticPremium' | 'ElasticIsolated'; + +/** + * Defines values for OsTypeSelected. + * Possible values include: 'Windows', 'Linux', 'WindowsFunctions', 'LinuxFunctions' + * @readonly + * @enum {string} + */ +export type OsTypeSelected = 'Windows' | 'Linux' | 'WindowsFunctions' | 'LinuxFunctions'; + +/** + * Defines values for OsTypeSelected1. + * Possible values include: 'Windows', 'Linux', 'WindowsFunctions', 'LinuxFunctions' + * @readonly + * @enum {string} + */ +export type OsTypeSelected1 = 'Windows' | 'Linux' | 'WindowsFunctions' | 'LinuxFunctions'; + +/** + * Contains response data for the list operation. + */ +export type CertificatesListResponse = CertificateCollection & { + /** + * The underlying HTTP response. + */ + _response: msRest.HttpResponse & { + /** + * The response body as text (string format) + */ + bodyAsText: string; + + /** + * The response body as parsed JSON or XML + */ + parsedBody: CertificateCollection; + }; +}; + +/** + * Contains response data for the listByResourceGroup operation. + */ +export type CertificatesListByResourceGroupResponse = CertificateCollection & { + /** + * The underlying HTTP response. + */ + _response: msRest.HttpResponse & { + /** + * The response body as text (string format) + */ + bodyAsText: string; + + /** + * The response body as parsed JSON or XML + */ + parsedBody: CertificateCollection; + }; +}; + +/** + * Contains response data for the get operation. + */ +export type CertificatesGetResponse = Certificate & { + /** + * The underlying HTTP response. + */ + _response: msRest.HttpResponse & { + /** + * The response body as text (string format) + */ + bodyAsText: string; + + /** + * The response body as parsed JSON or XML + */ + parsedBody: Certificate; + }; +}; + +/** + * Contains response data for the createOrUpdate operation. + */ +export type CertificatesCreateOrUpdateResponse = Certificate & { + /** + * The underlying HTTP response. + */ + _response: msRest.HttpResponse & { + /** + * The response body as text (string format) + */ + bodyAsText: string; + + /** + * The response body as parsed JSON or XML + */ + parsedBody: Certificate; + }; +}; + +/** + * Contains response data for the update operation. + */ +export type CertificatesUpdateResponse = Certificate & { + /** + * The underlying HTTP response. + */ + _response: msRest.HttpResponse & { + /** + * The response body as text (string format) + */ + bodyAsText: string; + + /** + * The response body as parsed JSON or XML + */ + parsedBody: Certificate; + }; +}; + +/** + * Contains response data for the listNext operation. + */ +export type CertificatesListNextResponse = CertificateCollection & { + /** + * The underlying HTTP response. + */ + _response: msRest.HttpResponse & { + /** + * The response body as text (string format) + */ + bodyAsText: string; + + /** + * The response body as parsed JSON or XML + */ + parsedBody: CertificateCollection; + }; +}; + +/** + * Contains response data for the listByResourceGroupNext operation. + */ +export type CertificatesListByResourceGroupNextResponse = CertificateCollection & { + /** + * The underlying HTTP response. + */ + _response: msRest.HttpResponse & { + /** + * The response body as text (string format) + */ + bodyAsText: string; + + /** + * The response body as parsed JSON or XML + */ + parsedBody: CertificateCollection; + }; +}; + +/** + * Contains response data for the list operation. + */ +export type WebAppsListResponse = WebAppCollection & { + /** + * The underlying HTTP response. + */ + _response: msRest.HttpResponse & { + /** + * The response body as text (string format) + */ + bodyAsText: string; + + /** + * The response body as parsed JSON or XML + */ + parsedBody: WebAppCollection; + }; +}; + +/** + * Contains response data for the listByResourceGroup operation. + */ +export type WebAppsListByResourceGroupResponse = WebAppCollection & { + /** + * The underlying HTTP response. + */ + _response: msRest.HttpResponse & { + /** + * The response body as text (string format) + */ + bodyAsText: string; + + /** + * The response body as parsed JSON or XML + */ + parsedBody: WebAppCollection; + }; +}; + +/** + * Contains response data for the get operation. + */ +export type WebAppsGetResponse = Site & { + /** + * The underlying HTTP response. + */ + _response: msRest.HttpResponse & { + /** + * The response body as text (string format) + */ + bodyAsText: string; + + /** + * The response body as parsed JSON or XML + */ + parsedBody: Site; + }; +}; + +/** + * Contains response data for the createOrUpdate operation. + */ +export type WebAppsCreateOrUpdateResponse = Site & { + /** + * The underlying HTTP response. + */ + _response: msRest.HttpResponse & { + /** + * The response body as text (string format) + */ + bodyAsText: string; + + /** + * The response body as parsed JSON or XML + */ + parsedBody: Site; + }; +}; + +/** + * Contains response data for the update operation. + */ +export type WebAppsUpdateResponse = Site & { + /** + * The underlying HTTP response. + */ + _response: msRest.HttpResponse & { + /** + * The response body as text (string format) + */ + bodyAsText: string; + + /** + * The response body as parsed JSON or XML + */ + parsedBody: Site; + }; +}; + +/** + * Contains response data for the analyzeCustomHostname operation. + */ +export type WebAppsAnalyzeCustomHostnameResponse = CustomHostnameAnalysisResult & { + /** + * The underlying HTTP response. + */ + _response: msRest.HttpResponse & { + /** + * The response body as text (string format) + */ + bodyAsText: string; + + /** + * The response body as parsed JSON or XML + */ + parsedBody: CustomHostnameAnalysisResult; + }; +}; + +/** + * Contains response data for the backup operation. + */ +export type WebAppsBackupResponse = BackupItem & { + /** + * The underlying HTTP response. + */ + _response: msRest.HttpResponse & { + /** + * The response body as text (string format) + */ + bodyAsText: string; + + /** + * The response body as parsed JSON or XML + */ + parsedBody: BackupItem; + }; +}; + +/** + * Contains response data for the listBackups operation. + */ +export type WebAppsListBackupsResponse = BackupItemCollection & { + /** + * The underlying HTTP response. + */ + _response: msRest.HttpResponse & { + /** + * The response body as text (string format) + */ + bodyAsText: string; + + /** + * The response body as parsed JSON or XML + */ + parsedBody: BackupItemCollection; + }; +}; + +/** + * Contains response data for the getBackupStatus operation. + */ +export type WebAppsGetBackupStatusResponse = BackupItem & { + /** + * The underlying HTTP response. + */ + _response: msRest.HttpResponse & { + /** + * The response body as text (string format) + */ + bodyAsText: string; + + /** + * The response body as parsed JSON or XML + */ + parsedBody: BackupItem; + }; +}; + +/** + * Contains response data for the listBackupStatusSecrets operation. + */ +export type WebAppsListBackupStatusSecretsResponse = BackupItem & { + /** + * The underlying HTTP response. + */ + _response: msRest.HttpResponse & { + /** + * The response body as text (string format) + */ + bodyAsText: string; + + /** + * The response body as parsed JSON or XML + */ + parsedBody: BackupItem; + }; +}; + +/** + * Contains response data for the listConfigurations operation. + */ +export type WebAppsListConfigurationsResponse = SiteConfigResourceCollection & { + /** + * The underlying HTTP response. + */ + _response: msRest.HttpResponse & { + /** + * The response body as text (string format) + */ + bodyAsText: string; + + /** + * The response body as parsed JSON or XML + */ + parsedBody: SiteConfigResourceCollection; + }; +}; + +/** + * Contains response data for the updateApplicationSettings operation. + */ +export type WebAppsUpdateApplicationSettingsResponse = StringDictionary & { + /** + * The underlying HTTP response. + */ + _response: msRest.HttpResponse & { + /** + * The response body as text (string format) + */ + bodyAsText: string; + + /** + * The response body as parsed JSON or XML + */ + parsedBody: StringDictionary; + }; +}; + +/** + * Contains response data for the listApplicationSettings operation. + */ +export type WebAppsListApplicationSettingsResponse = StringDictionary & { + /** + * The underlying HTTP response. + */ + _response: msRest.HttpResponse & { + /** + * The response body as text (string format) + */ + bodyAsText: string; + + /** + * The response body as parsed JSON or XML + */ + parsedBody: StringDictionary; + }; +}; + +/** + * Contains response data for the updateAuthSettings operation. + */ +export type WebAppsUpdateAuthSettingsResponse = SiteAuthSettings & { + /** + * The underlying HTTP response. + */ + _response: msRest.HttpResponse & { + /** + * The response body as text (string format) + */ + bodyAsText: string; + + /** + * The response body as parsed JSON or XML + */ + parsedBody: SiteAuthSettings; + }; +}; + +/** + * Contains response data for the getAuthSettings operation. + */ +export type WebAppsGetAuthSettingsResponse = SiteAuthSettings & { + /** + * The underlying HTTP response. + */ + _response: msRest.HttpResponse & { + /** + * The response body as text (string format) + */ + bodyAsText: string; + + /** + * The response body as parsed JSON or XML + */ + parsedBody: SiteAuthSettings; + }; +}; + +/** + * Contains response data for the updateAzureStorageAccounts operation. + */ +export type WebAppsUpdateAzureStorageAccountsResponse = AzureStoragePropertyDictionaryResource & { + /** + * The underlying HTTP response. + */ + _response: msRest.HttpResponse & { + /** + * The response body as text (string format) + */ + bodyAsText: string; + + /** + * The response body as parsed JSON or XML + */ + parsedBody: AzureStoragePropertyDictionaryResource; + }; +}; + +/** + * Contains response data for the listAzureStorageAccounts operation. + */ +export type WebAppsListAzureStorageAccountsResponse = AzureStoragePropertyDictionaryResource & { + /** + * The underlying HTTP response. + */ + _response: msRest.HttpResponse & { + /** + * The response body as text (string format) + */ + bodyAsText: string; + + /** + * The response body as parsed JSON or XML + */ + parsedBody: AzureStoragePropertyDictionaryResource; + }; +}; + +/** + * Contains response data for the updateBackupConfiguration operation. + */ +export type WebAppsUpdateBackupConfigurationResponse = BackupRequest & { + /** + * The underlying HTTP response. + */ + _response: msRest.HttpResponse & { + /** + * The response body as text (string format) + */ + bodyAsText: string; + + /** + * The response body as parsed JSON or XML + */ + parsedBody: BackupRequest; + }; +}; + +/** + * Contains response data for the getBackupConfiguration operation. + */ +export type WebAppsGetBackupConfigurationResponse = BackupRequest & { + /** + * The underlying HTTP response. + */ + _response: msRest.HttpResponse & { + /** + * The response body as text (string format) + */ + bodyAsText: string; + + /** + * The response body as parsed JSON or XML + */ + parsedBody: BackupRequest; + }; +}; + +/** + * Contains response data for the updateConnectionStrings operation. + */ +export type WebAppsUpdateConnectionStringsResponse = ConnectionStringDictionary & { + /** + * The underlying HTTP response. + */ + _response: msRest.HttpResponse & { + /** + * The response body as text (string format) + */ + bodyAsText: string; + + /** + * The response body as parsed JSON or XML + */ + parsedBody: ConnectionStringDictionary; + }; +}; + +/** + * Contains response data for the listConnectionStrings operation. + */ +export type WebAppsListConnectionStringsResponse = ConnectionStringDictionary & { + /** + * The underlying HTTP response. + */ + _response: msRest.HttpResponse & { + /** + * The response body as text (string format) + */ + bodyAsText: string; + + /** + * The response body as parsed JSON or XML + */ + parsedBody: ConnectionStringDictionary; + }; +}; + +/** + * Contains response data for the getDiagnosticLogsConfiguration operation. + */ +export type WebAppsGetDiagnosticLogsConfigurationResponse = SiteLogsConfig & { + /** + * The underlying HTTP response. + */ + _response: msRest.HttpResponse & { + /** + * The response body as text (string format) + */ + bodyAsText: string; + + /** + * The response body as parsed JSON or XML + */ + parsedBody: SiteLogsConfig; + }; +}; + +/** + * Contains response data for the updateDiagnosticLogsConfig operation. + */ +export type WebAppsUpdateDiagnosticLogsConfigResponse = SiteLogsConfig & { + /** + * The underlying HTTP response. + */ + _response: msRest.HttpResponse & { + /** + * The response body as text (string format) + */ + bodyAsText: string; + + /** + * The response body as parsed JSON or XML + */ + parsedBody: SiteLogsConfig; + }; +}; + +/** + * Contains response data for the updateMetadata operation. + */ +export type WebAppsUpdateMetadataResponse = StringDictionary & { + /** + * The underlying HTTP response. + */ + _response: msRest.HttpResponse & { + /** + * The response body as text (string format) + */ + bodyAsText: string; + + /** + * The response body as parsed JSON or XML + */ + parsedBody: StringDictionary; + }; +}; + +/** + * Contains response data for the listMetadata operation. + */ +export type WebAppsListMetadataResponse = StringDictionary & { + /** + * The underlying HTTP response. + */ + _response: msRest.HttpResponse & { + /** + * The response body as text (string format) + */ + bodyAsText: string; + + /** + * The response body as parsed JSON or XML + */ + parsedBody: StringDictionary; + }; +}; + +/** + * Contains response data for the listPublishingCredentials operation. + */ +export type WebAppsListPublishingCredentialsResponse = User & { + /** + * The underlying HTTP response. + */ + _response: msRest.HttpResponse & { + /** + * The response body as text (string format) + */ + bodyAsText: string; + + /** + * The response body as parsed JSON or XML + */ + parsedBody: User; + }; +}; + +/** + * Contains response data for the updateSitePushSettings operation. + */ +export type WebAppsUpdateSitePushSettingsResponse = PushSettings & { + /** + * The underlying HTTP response. + */ + _response: msRest.HttpResponse & { + /** + * The response body as text (string format) + */ + bodyAsText: string; + + /** + * The response body as parsed JSON or XML + */ + parsedBody: PushSettings; + }; +}; + +/** + * Contains response data for the listSitePushSettings operation. + */ +export type WebAppsListSitePushSettingsResponse = PushSettings & { + /** + * The underlying HTTP response. + */ + _response: msRest.HttpResponse & { + /** + * The response body as text (string format) + */ + bodyAsText: string; + + /** + * The response body as parsed JSON or XML + */ + parsedBody: PushSettings; + }; +}; + +/** + * Contains response data for the listSlotConfigurationNames operation. + */ +export type WebAppsListSlotConfigurationNamesResponse = SlotConfigNamesResource & { + /** + * The underlying HTTP response. + */ + _response: msRest.HttpResponse & { + /** + * The response body as text (string format) + */ + bodyAsText: string; + + /** + * The response body as parsed JSON or XML + */ + parsedBody: SlotConfigNamesResource; + }; +}; + +/** + * Contains response data for the updateSlotConfigurationNames operation. + */ +export type WebAppsUpdateSlotConfigurationNamesResponse = SlotConfigNamesResource & { + /** + * The underlying HTTP response. + */ + _response: msRest.HttpResponse & { + /** + * The response body as text (string format) + */ + bodyAsText: string; + + /** + * The response body as parsed JSON or XML + */ + parsedBody: SlotConfigNamesResource; + }; +}; + +/** + * Contains response data for the getConfiguration operation. + */ +export type WebAppsGetConfigurationResponse = SiteConfigResource & { + /** + * The underlying HTTP response. + */ + _response: msRest.HttpResponse & { + /** + * The response body as text (string format) + */ + bodyAsText: string; + + /** + * The response body as parsed JSON or XML + */ + parsedBody: SiteConfigResource; + }; +}; + +/** + * Contains response data for the createOrUpdateConfiguration operation. + */ +export type WebAppsCreateOrUpdateConfigurationResponse = SiteConfigResource & { + /** + * The underlying HTTP response. + */ + _response: msRest.HttpResponse & { + /** + * The response body as text (string format) + */ + bodyAsText: string; + + /** + * The response body as parsed JSON or XML + */ + parsedBody: SiteConfigResource; + }; +}; + +/** + * Contains response data for the updateConfiguration operation. + */ +export type WebAppsUpdateConfigurationResponse = SiteConfigResource & { + /** + * The underlying HTTP response. + */ + _response: msRest.HttpResponse & { + /** + * The response body as text (string format) + */ + bodyAsText: string; + + /** + * The response body as parsed JSON or XML + */ + parsedBody: SiteConfigResource; + }; +}; + +/** + * Contains response data for the listConfigurationSnapshotInfo operation. + */ +export type WebAppsListConfigurationSnapshotInfoResponse = SiteConfigurationSnapshotInfoCollection & { + /** + * The underlying HTTP response. + */ + _response: msRest.HttpResponse & { + /** + * The response body as text (string format) + */ + bodyAsText: string; + + /** + * The response body as parsed JSON or XML + */ + parsedBody: SiteConfigurationSnapshotInfoCollection; + }; +}; + +/** + * Contains response data for the getConfigurationSnapshot operation. + */ +export type WebAppsGetConfigurationSnapshotResponse = SiteConfigResource & { + /** + * The underlying HTTP response. + */ + _response: msRest.HttpResponse & { + /** + * The response body as text (string format) + */ + bodyAsText: string; + + /** + * The response body as parsed JSON or XML + */ + parsedBody: SiteConfigResource; + }; +}; + +/** + * Contains response data for the getWebSiteContainerLogs operation. + */ +export type WebAppsGetWebSiteContainerLogsResponse = { + /** + * BROWSER ONLY + * + * The response body as a browser Blob. + * Always undefined in node.js. + */ + blobBody?: Promise; + + /** + * NODEJS ONLY + * + * The response body as a node.js Readable stream. + * Always undefined in the browser. + */ + readableStreamBody?: NodeJS.ReadableStream; + + /** + * The underlying HTTP response. + */ + _response: msRest.HttpResponse; +}; + +/** + * Contains response data for the getContainerLogsZip operation. + */ +export type WebAppsGetContainerLogsZipResponse = { + /** + * BROWSER ONLY + * + * The response body as a browser Blob. + * Always undefined in node.js. + */ + blobBody?: Promise; + + /** + * NODEJS ONLY + * + * The response body as a node.js Readable stream. + * Always undefined in the browser. + */ + readableStreamBody?: NodeJS.ReadableStream; + + /** + * The underlying HTTP response. + */ + _response: msRest.HttpResponse; +}; + +/** + * Contains response data for the listContinuousWebJobs operation. + */ +export type WebAppsListContinuousWebJobsResponse = ContinuousWebJobCollection & { + /** + * The underlying HTTP response. + */ + _response: msRest.HttpResponse & { + /** + * The response body as text (string format) + */ + bodyAsText: string; + + /** + * The response body as parsed JSON or XML + */ + parsedBody: ContinuousWebJobCollection; + }; +}; + +/** + * Contains response data for the getContinuousWebJob operation. + */ +export type WebAppsGetContinuousWebJobResponse = ContinuousWebJob & { + /** + * The underlying HTTP response. + */ + _response: msRest.HttpResponse & { + /** + * The response body as text (string format) + */ + bodyAsText: string; + + /** + * The response body as parsed JSON or XML + */ + parsedBody: ContinuousWebJob; + }; +}; + +/** + * Contains response data for the listDeployments operation. + */ +export type WebAppsListDeploymentsResponse = DeploymentCollection & { + /** + * The underlying HTTP response. + */ + _response: msRest.HttpResponse & { + /** + * The response body as text (string format) + */ + bodyAsText: string; + + /** + * The response body as parsed JSON or XML + */ + parsedBody: DeploymentCollection; + }; +}; + +/** + * Contains response data for the getDeployment operation. + */ +export type WebAppsGetDeploymentResponse = Deployment & { + /** + * The underlying HTTP response. + */ + _response: msRest.HttpResponse & { + /** + * The response body as text (string format) + */ + bodyAsText: string; + + /** + * The response body as parsed JSON or XML + */ + parsedBody: Deployment; + }; +}; + +/** + * Contains response data for the createDeployment operation. + */ +export type WebAppsCreateDeploymentResponse = Deployment & { + /** + * The underlying HTTP response. + */ + _response: msRest.HttpResponse & { + /** + * The response body as text (string format) + */ + bodyAsText: string; + + /** + * The response body as parsed JSON or XML + */ + parsedBody: Deployment; + }; +}; + +/** + * Contains response data for the listDeploymentLog operation. + */ +export type WebAppsListDeploymentLogResponse = Deployment & { + /** + * The underlying HTTP response. + */ + _response: msRest.HttpResponse & { + /** + * The response body as text (string format) + */ + bodyAsText: string; + + /** + * The response body as parsed JSON or XML + */ + parsedBody: Deployment; + }; +}; + +/** + * Contains response data for the discoverBackup operation. + */ +export type WebAppsDiscoverBackupResponse = RestoreRequest & { + /** + * The underlying HTTP response. + */ + _response: msRest.HttpResponse & { + /** + * The response body as text (string format) + */ + bodyAsText: string; + + /** + * The response body as parsed JSON or XML + */ + parsedBody: RestoreRequest; + }; +}; + +/** + * Contains response data for the listDomainOwnershipIdentifiers operation. + */ +export type WebAppsListDomainOwnershipIdentifiersResponse = IdentifierCollection & { + /** + * The underlying HTTP response. + */ + _response: msRest.HttpResponse & { + /** + * The response body as text (string format) + */ + bodyAsText: string; + + /** + * The response body as parsed JSON or XML + */ + parsedBody: IdentifierCollection; + }; +}; + +/** + * Contains response data for the getDomainOwnershipIdentifier operation. + */ +export type WebAppsGetDomainOwnershipIdentifierResponse = Identifier & { + /** + * The underlying HTTP response. + */ + _response: msRest.HttpResponse & { + /** + * The response body as text (string format) + */ + bodyAsText: string; + + /** + * The response body as parsed JSON or XML + */ + parsedBody: Identifier; + }; +}; + +/** + * Contains response data for the createOrUpdateDomainOwnershipIdentifier operation. + */ +export type WebAppsCreateOrUpdateDomainOwnershipIdentifierResponse = Identifier & { + /** + * The underlying HTTP response. + */ + _response: msRest.HttpResponse & { + /** + * The response body as text (string format) + */ + bodyAsText: string; + + /** + * The response body as parsed JSON or XML + */ + parsedBody: Identifier; + }; +}; + +/** + * Contains response data for the updateDomainOwnershipIdentifier operation. + */ +export type WebAppsUpdateDomainOwnershipIdentifierResponse = Identifier & { + /** + * The underlying HTTP response. + */ + _response: msRest.HttpResponse & { + /** + * The response body as text (string format) + */ + bodyAsText: string; + + /** + * The response body as parsed JSON or XML + */ + parsedBody: Identifier; + }; +}; + +/** + * Contains response data for the getMSDeployStatus operation. + */ +export type WebAppsGetMSDeployStatusResponse = MSDeployStatus & { + /** + * The underlying HTTP response. + */ + _response: msRest.HttpResponse & { + /** + * The response body as text (string format) + */ + bodyAsText: string; + + /** + * The response body as parsed JSON or XML + */ + parsedBody: MSDeployStatus; + }; +}; + +/** + * Contains response data for the createMSDeployOperation operation. + */ +export type WebAppsCreateMSDeployOperationResponse = MSDeployStatus & { + /** + * The underlying HTTP response. + */ + _response: msRest.HttpResponse & { + /** + * The response body as text (string format) + */ + bodyAsText: string; + + /** + * The response body as parsed JSON or XML + */ + parsedBody: MSDeployStatus; + }; +}; + +/** + * Contains response data for the getMSDeployLog operation. + */ +export type WebAppsGetMSDeployLogResponse = MSDeployLog & { + /** + * The underlying HTTP response. + */ + _response: msRest.HttpResponse & { + /** + * The response body as text (string format) + */ + bodyAsText: string; + + /** + * The response body as parsed JSON or XML + */ + parsedBody: MSDeployLog; + }; +}; + +/** + * Contains response data for the listFunctions operation. + */ +export type WebAppsListFunctionsResponse = FunctionEnvelopeCollection & { + /** + * The underlying HTTP response. + */ + _response: msRest.HttpResponse & { + /** + * The response body as text (string format) + */ + bodyAsText: string; + + /** + * The response body as parsed JSON or XML + */ + parsedBody: FunctionEnvelopeCollection; + }; +}; + +/** + * Contains response data for the getFunctionsAdminToken operation. + */ +export type WebAppsGetFunctionsAdminTokenResponse = { + /** + * The parsed response body. + */ + body: string; + + /** + * The underlying HTTP response. + */ + _response: msRest.HttpResponse & { + /** + * The response body as text (string format) + */ + bodyAsText: string; + + /** + * The response body as parsed JSON or XML + */ + parsedBody: string; + }; +}; + +/** + * Contains response data for the getFunction operation. + */ +export type WebAppsGetFunctionResponse = FunctionEnvelope & { + /** + * The underlying HTTP response. + */ + _response: msRest.HttpResponse & { + /** + * The response body as text (string format) + */ + bodyAsText: string; + + /** + * The response body as parsed JSON or XML + */ + parsedBody: FunctionEnvelope; + }; +}; + +/** + * Contains response data for the createFunction operation. + */ +export type WebAppsCreateFunctionResponse = FunctionEnvelope & { + /** + * The underlying HTTP response. + */ + _response: msRest.HttpResponse & { + /** + * The response body as text (string format) + */ + bodyAsText: string; + + /** + * The response body as parsed JSON or XML + */ + parsedBody: FunctionEnvelope; + }; +}; + +/** + * Contains response data for the listFunctionSecrets operation. + */ +export type WebAppsListFunctionSecretsResponse = FunctionSecrets & { + /** + * The underlying HTTP response. + */ + _response: msRest.HttpResponse & { + /** + * The response body as text (string format) + */ + bodyAsText: string; + + /** + * The response body as parsed JSON or XML + */ + parsedBody: FunctionSecrets; + }; +}; + +/** + * Contains response data for the listHostNameBindings operation. + */ +export type WebAppsListHostNameBindingsResponse = HostNameBindingCollection & { + /** + * The underlying HTTP response. + */ + _response: msRest.HttpResponse & { + /** + * The response body as text (string format) + */ + bodyAsText: string; + + /** + * The response body as parsed JSON or XML + */ + parsedBody: HostNameBindingCollection; + }; +}; + +/** + * Contains response data for the getHostNameBinding operation. + */ +export type WebAppsGetHostNameBindingResponse = HostNameBinding & { + /** + * The underlying HTTP response. + */ + _response: msRest.HttpResponse & { + /** + * The response body as text (string format) + */ + bodyAsText: string; + + /** + * The response body as parsed JSON or XML + */ + parsedBody: HostNameBinding; + }; +}; + +/** + * Contains response data for the createOrUpdateHostNameBinding operation. + */ +export type WebAppsCreateOrUpdateHostNameBindingResponse = HostNameBinding & { + /** + * The underlying HTTP response. + */ + _response: msRest.HttpResponse & { + /** + * The response body as text (string format) + */ + bodyAsText: string; + + /** + * The response body as parsed JSON or XML + */ + parsedBody: HostNameBinding; + }; +}; + +/** + * Contains response data for the getHybridConnection operation. + */ +export type WebAppsGetHybridConnectionResponse = HybridConnection & { + /** + * The underlying HTTP response. + */ + _response: msRest.HttpResponse & { + /** + * The response body as text (string format) + */ + bodyAsText: string; + + /** + * The response body as parsed JSON or XML + */ + parsedBody: HybridConnection; + }; +}; + +/** + * Contains response data for the createOrUpdateHybridConnection operation. + */ +export type WebAppsCreateOrUpdateHybridConnectionResponse = HybridConnection & { + /** + * The underlying HTTP response. + */ + _response: msRest.HttpResponse & { + /** + * The response body as text (string format) + */ + bodyAsText: string; + + /** + * The response body as parsed JSON or XML + */ + parsedBody: HybridConnection; + }; +}; + +/** + * Contains response data for the updateHybridConnection operation. + */ +export type WebAppsUpdateHybridConnectionResponse = HybridConnection & { + /** + * The underlying HTTP response. + */ + _response: msRest.HttpResponse & { + /** + * The response body as text (string format) + */ + bodyAsText: string; + + /** + * The response body as parsed JSON or XML + */ + parsedBody: HybridConnection; + }; +}; + +/** + * Contains response data for the listHybridConnectionKeys operation. + */ +export type WebAppsListHybridConnectionKeysResponse = HybridConnectionKey & { + /** + * The underlying HTTP response. + */ + _response: msRest.HttpResponse & { + /** + * The response body as text (string format) + */ + bodyAsText: string; + + /** + * The response body as parsed JSON or XML + */ + parsedBody: HybridConnectionKey; + }; +}; + +/** + * Contains response data for the listHybridConnections operation. + */ +export type WebAppsListHybridConnectionsResponse = HybridConnection & { + /** + * The underlying HTTP response. + */ + _response: msRest.HttpResponse & { + /** + * The response body as text (string format) + */ + bodyAsText: string; + + /** + * The response body as parsed JSON or XML + */ + parsedBody: HybridConnection; + }; +}; + +/** + * Contains response data for the listRelayServiceConnections operation. + */ +export type WebAppsListRelayServiceConnectionsResponse = RelayServiceConnectionEntity & { + /** + * The underlying HTTP response. + */ + _response: msRest.HttpResponse & { + /** + * The response body as text (string format) + */ + bodyAsText: string; + + /** + * The response body as parsed JSON or XML + */ + parsedBody: RelayServiceConnectionEntity; + }; +}; + +/** + * Contains response data for the getRelayServiceConnection operation. + */ +export type WebAppsGetRelayServiceConnectionResponse = RelayServiceConnectionEntity & { + /** + * The underlying HTTP response. + */ + _response: msRest.HttpResponse & { + /** + * The response body as text (string format) + */ + bodyAsText: string; + + /** + * The response body as parsed JSON or XML + */ + parsedBody: RelayServiceConnectionEntity; + }; +}; + +/** + * Contains response data for the createOrUpdateRelayServiceConnection operation. + */ +export type WebAppsCreateOrUpdateRelayServiceConnectionResponse = RelayServiceConnectionEntity & { + /** + * The underlying HTTP response. + */ + _response: msRest.HttpResponse & { + /** + * The response body as text (string format) + */ + bodyAsText: string; + + /** + * The response body as parsed JSON or XML + */ + parsedBody: RelayServiceConnectionEntity; + }; +}; + +/** + * Contains response data for the updateRelayServiceConnection operation. + */ +export type WebAppsUpdateRelayServiceConnectionResponse = RelayServiceConnectionEntity & { + /** + * The underlying HTTP response. + */ + _response: msRest.HttpResponse & { + /** + * The response body as text (string format) + */ + bodyAsText: string; + + /** + * The response body as parsed JSON or XML + */ + parsedBody: RelayServiceConnectionEntity; + }; +}; + +/** + * Contains response data for the listInstanceIdentifiers operation. + */ +export type WebAppsListInstanceIdentifiersResponse = WebAppInstanceCollection & { + /** + * The underlying HTTP response. + */ + _response: msRest.HttpResponse & { + /** + * The response body as text (string format) + */ + bodyAsText: string; + + /** + * The response body as parsed JSON or XML + */ + parsedBody: WebAppInstanceCollection; + }; +}; + +/** + * Contains response data for the getInstanceMsDeployStatus operation. + */ +export type WebAppsGetInstanceMsDeployStatusResponse = MSDeployStatus & { + /** + * The underlying HTTP response. + */ + _response: msRest.HttpResponse & { + /** + * The response body as text (string format) + */ + bodyAsText: string; + + /** + * The response body as parsed JSON or XML + */ + parsedBody: MSDeployStatus; + }; +}; + +/** + * Contains response data for the createInstanceMSDeployOperation operation. + */ +export type WebAppsCreateInstanceMSDeployOperationResponse = MSDeployStatus & { + /** + * The underlying HTTP response. + */ + _response: msRest.HttpResponse & { + /** + * The response body as text (string format) + */ + bodyAsText: string; + + /** + * The response body as parsed JSON or XML + */ + parsedBody: MSDeployStatus; + }; +}; + +/** + * Contains response data for the getInstanceMSDeployLog operation. + */ +export type WebAppsGetInstanceMSDeployLogResponse = MSDeployLog & { + /** + * The underlying HTTP response. + */ + _response: msRest.HttpResponse & { + /** + * The response body as text (string format) + */ + bodyAsText: string; + + /** + * The response body as parsed JSON or XML + */ + parsedBody: MSDeployLog; + }; +}; + +/** + * Contains response data for the listInstanceProcesses operation. + */ +export type WebAppsListInstanceProcessesResponse = ProcessInfoCollection & { + /** + * The underlying HTTP response. + */ + _response: msRest.HttpResponse & { + /** + * The response body as text (string format) + */ + bodyAsText: string; + + /** + * The response body as parsed JSON or XML + */ + parsedBody: ProcessInfoCollection; + }; +}; + +/** + * Contains response data for the getInstanceProcess operation. + */ +export type WebAppsGetInstanceProcessResponse = ProcessInfo & { + /** + * The underlying HTTP response. + */ + _response: msRest.HttpResponse & { + /** + * The response body as text (string format) + */ + bodyAsText: string; + + /** + * The response body as parsed JSON or XML + */ + parsedBody: ProcessInfo; + }; +}; + +/** + * Contains response data for the getInstanceProcessDump operation. + */ +export type WebAppsGetInstanceProcessDumpResponse = { + /** + * BROWSER ONLY + * + * The response body as a browser Blob. + * Always undefined in node.js. + */ + blobBody?: Promise; + + /** + * NODEJS ONLY + * + * The response body as a node.js Readable stream. + * Always undefined in the browser. + */ + readableStreamBody?: NodeJS.ReadableStream; + + /** + * The underlying HTTP response. + */ + _response: msRest.HttpResponse; +}; + +/** + * Contains response data for the listInstanceProcessModules operation. + */ +export type WebAppsListInstanceProcessModulesResponse = ProcessModuleInfoCollection & { + /** + * The underlying HTTP response. + */ + _response: msRest.HttpResponse & { + /** + * The response body as text (string format) + */ + bodyAsText: string; + + /** + * The response body as parsed JSON or XML + */ + parsedBody: ProcessModuleInfoCollection; + }; +}; + +/** + * Contains response data for the getInstanceProcessModule operation. + */ +export type WebAppsGetInstanceProcessModuleResponse = ProcessModuleInfo & { + /** + * The underlying HTTP response. + */ + _response: msRest.HttpResponse & { + /** + * The response body as text (string format) + */ + bodyAsText: string; + + /** + * The response body as parsed JSON or XML + */ + parsedBody: ProcessModuleInfo; + }; +}; + +/** + * Contains response data for the listInstanceProcessThreads operation. + */ +export type WebAppsListInstanceProcessThreadsResponse = ProcessThreadInfoCollection & { + /** + * The underlying HTTP response. + */ + _response: msRest.HttpResponse & { + /** + * The response body as text (string format) + */ + bodyAsText: string; + + /** + * The response body as parsed JSON or XML + */ + parsedBody: ProcessThreadInfoCollection; + }; +}; + +/** + * Contains response data for the getInstanceProcessThread operation. + */ +export type WebAppsGetInstanceProcessThreadResponse = ProcessThreadInfo & { + /** + * The underlying HTTP response. + */ + _response: msRest.HttpResponse & { + /** + * The response body as text (string format) + */ + bodyAsText: string; + + /** + * The response body as parsed JSON or XML + */ + parsedBody: ProcessThreadInfo; + }; +}; + +/** + * Contains response data for the isCloneable operation. + */ +export type WebAppsIsCloneableResponse = SiteCloneability & { + /** + * The underlying HTTP response. + */ + _response: msRest.HttpResponse & { + /** + * The response body as text (string format) + */ + bodyAsText: string; + + /** + * The response body as parsed JSON or XML + */ + parsedBody: SiteCloneability; + }; +}; + +/** + * Contains response data for the listSyncFunctionTriggers operation. + */ +export type WebAppsListSyncFunctionTriggersResponse = FunctionSecrets & { + /** + * The underlying HTTP response. + */ + _response: msRest.HttpResponse & { + /** + * The response body as text (string format) + */ + bodyAsText: string; + + /** + * The response body as parsed JSON or XML + */ + parsedBody: FunctionSecrets; + }; +}; + +/** + * Contains response data for the listMetricDefinitions operation. + */ +export type WebAppsListMetricDefinitionsResponse = ResourceMetricDefinitionCollection & { + /** + * The underlying HTTP response. + */ + _response: msRest.HttpResponse & { + /** + * The response body as text (string format) + */ + bodyAsText: string; + + /** + * The response body as parsed JSON or XML + */ + parsedBody: ResourceMetricDefinitionCollection; + }; +}; + +/** + * Contains response data for the listMetrics operation. + */ +export type WebAppsListMetricsResponse = ResourceMetricCollection & { + /** + * The underlying HTTP response. + */ + _response: msRest.HttpResponse & { + /** + * The response body as text (string format) + */ + bodyAsText: string; + + /** + * The response body as parsed JSON or XML + */ + parsedBody: ResourceMetricCollection; + }; +}; + +/** + * Contains response data for the migrateStorage operation. + */ +export type WebAppsMigrateStorageResponse = StorageMigrationResponse & { + /** + * The underlying HTTP response. + */ + _response: msRest.HttpResponse & { + /** + * The response body as text (string format) + */ + bodyAsText: string; + + /** + * The response body as parsed JSON or XML + */ + parsedBody: StorageMigrationResponse; + }; +}; + +/** + * Contains response data for the migrateMySql operation. + */ +export type WebAppsMigrateMySqlResponse = Operation & { + /** + * The underlying HTTP response. + */ + _response: msRest.HttpResponse & { + /** + * The response body as text (string format) + */ + bodyAsText: string; + + /** + * The response body as parsed JSON or XML + */ + parsedBody: Operation; + }; +}; + +/** + * Contains response data for the getMigrateMySqlStatus operation. + */ +export type WebAppsGetMigrateMySqlStatusResponse = MigrateMySqlStatus & { + /** + * The underlying HTTP response. + */ + _response: msRest.HttpResponse & { + /** + * The response body as text (string format) + */ + bodyAsText: string; + + /** + * The response body as parsed JSON or XML + */ + parsedBody: MigrateMySqlStatus; + }; +}; + +/** + * Contains response data for the getSwiftVirtualNetworkConnection operation. + */ +export type WebAppsGetSwiftVirtualNetworkConnectionResponse = SwiftVirtualNetwork & { + /** + * The underlying HTTP response. + */ + _response: msRest.HttpResponse & { + /** + * The response body as text (string format) + */ + bodyAsText: string; + + /** + * The response body as parsed JSON or XML + */ + parsedBody: SwiftVirtualNetwork; + }; +}; + +/** + * Contains response data for the createOrUpdateSwiftVirtualNetworkConnection operation. + */ +export type WebAppsCreateOrUpdateSwiftVirtualNetworkConnectionResponse = SwiftVirtualNetwork & { + /** + * The underlying HTTP response. + */ + _response: msRest.HttpResponse & { + /** + * The response body as text (string format) + */ + bodyAsText: string; + + /** + * The response body as parsed JSON or XML + */ + parsedBody: SwiftVirtualNetwork; + }; +}; + +/** + * Contains response data for the updateSwiftVirtualNetworkConnection operation. + */ +export type WebAppsUpdateSwiftVirtualNetworkConnectionResponse = SwiftVirtualNetwork & { + /** + * The underlying HTTP response. + */ + _response: msRest.HttpResponse & { + /** + * The response body as text (string format) + */ + bodyAsText: string; + + /** + * The response body as parsed JSON or XML + */ + parsedBody: SwiftVirtualNetwork; + }; +}; + +/** + * Contains response data for the listNetworkFeatures operation. + */ +export type WebAppsListNetworkFeaturesResponse = NetworkFeatures & { + /** + * The underlying HTTP response. + */ + _response: msRest.HttpResponse & { + /** + * The response body as text (string format) + */ + bodyAsText: string; + + /** + * The response body as parsed JSON or XML + */ + parsedBody: NetworkFeatures; + }; +}; + +/** + * Contains response data for the getNetworkTraceOperation operation. + */ +export type WebAppsGetNetworkTraceOperationResponse = Array & { + /** + * The underlying HTTP response. + */ + _response: msRest.HttpResponse & { + /** + * The response body as text (string format) + */ + bodyAsText: string; + + /** + * The response body as parsed JSON or XML + */ + parsedBody: NetworkTrace[]; + }; +}; + +/** + * Contains response data for the startWebSiteNetworkTrace operation. + */ +export type WebAppsStartWebSiteNetworkTraceResponse = { + /** + * The parsed response body. + */ + body: string; + + /** + * The underlying HTTP response. + */ + _response: msRest.HttpResponse & { + /** + * The response body as text (string format) + */ + bodyAsText: string; + + /** + * The response body as parsed JSON or XML + */ + parsedBody: string; + }; +}; + +/** + * Contains response data for the startWebSiteNetworkTraceOperation operation. + */ +export type WebAppsStartWebSiteNetworkTraceOperationResponse = Array & { + /** + * The underlying HTTP response. + */ + _response: msRest.HttpResponse & { + /** + * The response body as text (string format) + */ + bodyAsText: string; + + /** + * The response body as parsed JSON or XML + */ + parsedBody: NetworkTrace[]; + }; +}; + +/** + * Contains response data for the getNetworkTraces operation. + */ +export type WebAppsGetNetworkTracesResponse = Array & { + /** + * The underlying HTTP response. + */ + _response: msRest.HttpResponse & { + /** + * The response body as text (string format) + */ + bodyAsText: string; + + /** + * The response body as parsed JSON or XML + */ + parsedBody: NetworkTrace[]; + }; +}; + +/** + * Contains response data for the getNetworkTraceOperationV2 operation. + */ +export type WebAppsGetNetworkTraceOperationV2Response = Array & { + /** + * The underlying HTTP response. + */ + _response: msRest.HttpResponse & { + /** + * The response body as text (string format) + */ + bodyAsText: string; + + /** + * The response body as parsed JSON or XML + */ + parsedBody: NetworkTrace[]; + }; +}; + +/** + * Contains response data for the getNetworkTracesV2 operation. + */ +export type WebAppsGetNetworkTracesV2Response = Array & { + /** + * The underlying HTTP response. + */ + _response: msRest.HttpResponse & { + /** + * The response body as text (string format) + */ + bodyAsText: string; + + /** + * The response body as parsed JSON or XML + */ + parsedBody: NetworkTrace[]; + }; +}; + +/** + * Contains response data for the listPerfMonCounters operation. + */ +export type WebAppsListPerfMonCountersResponse = PerfMonCounterCollection & { + /** + * The underlying HTTP response. + */ + _response: msRest.HttpResponse & { + /** + * The response body as text (string format) + */ + bodyAsText: string; + + /** + * The response body as parsed JSON or XML + */ + parsedBody: PerfMonCounterCollection; + }; +}; + +/** + * Contains response data for the getSitePhpErrorLogFlag operation. + */ +export type WebAppsGetSitePhpErrorLogFlagResponse = SitePhpErrorLogFlag & { + /** + * The underlying HTTP response. + */ + _response: msRest.HttpResponse & { + /** + * The response body as text (string format) + */ + bodyAsText: string; + + /** + * The response body as parsed JSON or XML + */ + parsedBody: SitePhpErrorLogFlag; + }; +}; + +/** + * Contains response data for the listPremierAddOns operation. + */ +export type WebAppsListPremierAddOnsResponse = PremierAddOn & { + /** + * The underlying HTTP response. + */ + _response: msRest.HttpResponse & { + /** + * The response body as text (string format) + */ + bodyAsText: string; + + /** + * The response body as parsed JSON or XML + */ + parsedBody: PremierAddOn; + }; +}; + +/** + * Contains response data for the getPremierAddOn operation. + */ +export type WebAppsGetPremierAddOnResponse = PremierAddOn & { + /** + * The underlying HTTP response. + */ + _response: msRest.HttpResponse & { + /** + * The response body as text (string format) + */ + bodyAsText: string; + + /** + * The response body as parsed JSON or XML + */ + parsedBody: PremierAddOn; + }; +}; + +/** + * Contains response data for the addPremierAddOn operation. + */ +export type WebAppsAddPremierAddOnResponse = PremierAddOn & { + /** + * The underlying HTTP response. + */ + _response: msRest.HttpResponse & { + /** + * The response body as text (string format) + */ + bodyAsText: string; + + /** + * The response body as parsed JSON or XML + */ + parsedBody: PremierAddOn; + }; +}; + +/** + * Contains response data for the updatePremierAddOn operation. + */ +export type WebAppsUpdatePremierAddOnResponse = PremierAddOn & { + /** + * The underlying HTTP response. + */ + _response: msRest.HttpResponse & { + /** + * The response body as text (string format) + */ + bodyAsText: string; + + /** + * The response body as parsed JSON or XML + */ + parsedBody: PremierAddOn; + }; +}; + +/** + * Contains response data for the getPrivateAccess operation. + */ +export type WebAppsGetPrivateAccessResponse = PrivateAccess & { + /** + * The underlying HTTP response. + */ + _response: msRest.HttpResponse & { + /** + * The response body as text (string format) + */ + bodyAsText: string; + + /** + * The response body as parsed JSON or XML + */ + parsedBody: PrivateAccess; + }; +}; + +/** + * Contains response data for the putPrivateAccessVnet operation. + */ +export type WebAppsPutPrivateAccessVnetResponse = PrivateAccess & { + /** + * The underlying HTTP response. + */ + _response: msRest.HttpResponse & { + /** + * The response body as text (string format) + */ + bodyAsText: string; + + /** + * The response body as parsed JSON or XML + */ + parsedBody: PrivateAccess; + }; +}; + +/** + * Contains response data for the listProcesses operation. + */ +export type WebAppsListProcessesResponse = ProcessInfoCollection & { + /** + * The underlying HTTP response. + */ + _response: msRest.HttpResponse & { + /** + * The response body as text (string format) + */ + bodyAsText: string; + + /** + * The response body as parsed JSON or XML + */ + parsedBody: ProcessInfoCollection; + }; +}; + +/** + * Contains response data for the getProcess operation. + */ +export type WebAppsGetProcessResponse = ProcessInfo & { + /** + * The underlying HTTP response. + */ + _response: msRest.HttpResponse & { + /** + * The response body as text (string format) + */ + bodyAsText: string; + + /** + * The response body as parsed JSON or XML + */ + parsedBody: ProcessInfo; + }; +}; + +/** + * Contains response data for the getProcessDump operation. + */ +export type WebAppsGetProcessDumpResponse = { + /** + * BROWSER ONLY + * + * The response body as a browser Blob. + * Always undefined in node.js. + */ + blobBody?: Promise; + + /** + * NODEJS ONLY + * + * The response body as a node.js Readable stream. + * Always undefined in the browser. + */ + readableStreamBody?: NodeJS.ReadableStream; + + /** + * The underlying HTTP response. + */ + _response: msRest.HttpResponse; +}; + +/** + * Contains response data for the listProcessModules operation. + */ +export type WebAppsListProcessModulesResponse = ProcessModuleInfoCollection & { + /** + * The underlying HTTP response. + */ + _response: msRest.HttpResponse & { + /** + * The response body as text (string format) + */ + bodyAsText: string; + + /** + * The response body as parsed JSON or XML + */ + parsedBody: ProcessModuleInfoCollection; + }; +}; + +/** + * Contains response data for the getProcessModule operation. + */ +export type WebAppsGetProcessModuleResponse = ProcessModuleInfo & { + /** + * The underlying HTTP response. + */ + _response: msRest.HttpResponse & { + /** + * The response body as text (string format) + */ + bodyAsText: string; + + /** + * The response body as parsed JSON or XML + */ + parsedBody: ProcessModuleInfo; + }; +}; + +/** + * Contains response data for the listProcessThreads operation. + */ +export type WebAppsListProcessThreadsResponse = ProcessThreadInfoCollection & { + /** + * The underlying HTTP response. + */ + _response: msRest.HttpResponse & { + /** + * The response body as text (string format) + */ + bodyAsText: string; + + /** + * The response body as parsed JSON or XML + */ + parsedBody: ProcessThreadInfoCollection; + }; +}; + +/** + * Contains response data for the getProcessThread operation. + */ +export type WebAppsGetProcessThreadResponse = ProcessThreadInfo & { + /** + * The underlying HTTP response. + */ + _response: msRest.HttpResponse & { + /** + * The response body as text (string format) + */ + bodyAsText: string; + + /** + * The response body as parsed JSON or XML + */ + parsedBody: ProcessThreadInfo; + }; +}; + +/** + * Contains response data for the listPublicCertificates operation. + */ +export type WebAppsListPublicCertificatesResponse = PublicCertificateCollection & { + /** + * The underlying HTTP response. + */ + _response: msRest.HttpResponse & { + /** + * The response body as text (string format) + */ + bodyAsText: string; + + /** + * The response body as parsed JSON or XML + */ + parsedBody: PublicCertificateCollection; + }; +}; + +/** + * Contains response data for the getPublicCertificate operation. + */ +export type WebAppsGetPublicCertificateResponse = PublicCertificate & { + /** + * The underlying HTTP response. + */ + _response: msRest.HttpResponse & { + /** + * The response body as text (string format) + */ + bodyAsText: string; + + /** + * The response body as parsed JSON or XML + */ + parsedBody: PublicCertificate; + }; +}; + +/** + * Contains response data for the createOrUpdatePublicCertificate operation. + */ +export type WebAppsCreateOrUpdatePublicCertificateResponse = PublicCertificate & { + /** + * The underlying HTTP response. + */ + _response: msRest.HttpResponse & { + /** + * The response body as text (string format) + */ + bodyAsText: string; + + /** + * The response body as parsed JSON or XML + */ + parsedBody: PublicCertificate; + }; +}; + +/** + * Contains response data for the listPublishingProfileXmlWithSecrets operation. + */ +export type WebAppsListPublishingProfileXmlWithSecretsResponse = { + /** + * BROWSER ONLY + * + * The response body as a browser Blob. + * Always undefined in node.js. + */ + blobBody?: Promise; + + /** + * NODEJS ONLY + * + * The response body as a node.js Readable stream. + * Always undefined in the browser. + */ + readableStreamBody?: NodeJS.ReadableStream; + + /** + * The underlying HTTP response. + */ + _response: msRest.HttpResponse; +}; + +/** + * Contains response data for the listSiteExtensions operation. + */ +export type WebAppsListSiteExtensionsResponse = SiteExtensionInfoCollection & { + /** + * The underlying HTTP response. + */ + _response: msRest.HttpResponse & { + /** + * The response body as text (string format) + */ + bodyAsText: string; + + /** + * The response body as parsed JSON or XML + */ + parsedBody: SiteExtensionInfoCollection; + }; +}; + +/** + * Contains response data for the getSiteExtension operation. + */ +export type WebAppsGetSiteExtensionResponse = SiteExtensionInfo & { + /** + * The underlying HTTP response. + */ + _response: msRest.HttpResponse & { + /** + * The response body as text (string format) + */ + bodyAsText: string; + + /** + * The response body as parsed JSON or XML + */ + parsedBody: SiteExtensionInfo; + }; +}; + +/** + * Contains response data for the installSiteExtension operation. + */ +export type WebAppsInstallSiteExtensionResponse = SiteExtensionInfo & { + /** + * The underlying HTTP response. + */ + _response: msRest.HttpResponse & { + /** + * The response body as text (string format) + */ + bodyAsText: string; + + /** + * The response body as parsed JSON or XML + */ + parsedBody: SiteExtensionInfo; + }; +}; + +/** + * Contains response data for the listSlots operation. + */ +export type WebAppsListSlotsResponse = WebAppCollection & { + /** + * The underlying HTTP response. + */ + _response: msRest.HttpResponse & { + /** + * The response body as text (string format) + */ + bodyAsText: string; + + /** + * The response body as parsed JSON or XML + */ + parsedBody: WebAppCollection; + }; +}; + +/** + * Contains response data for the getSlot operation. + */ +export type WebAppsGetSlotResponse = Site & { + /** + * The underlying HTTP response. + */ + _response: msRest.HttpResponse & { + /** + * The response body as text (string format) + */ + bodyAsText: string; + + /** + * The response body as parsed JSON or XML + */ + parsedBody: Site; + }; +}; + +/** + * Contains response data for the createOrUpdateSlot operation. + */ +export type WebAppsCreateOrUpdateSlotResponse = Site & { + /** + * The underlying HTTP response. + */ + _response: msRest.HttpResponse & { + /** + * The response body as text (string format) + */ + bodyAsText: string; + + /** + * The response body as parsed JSON or XML + */ + parsedBody: Site; + }; +}; + +/** + * Contains response data for the updateSlot operation. + */ +export type WebAppsUpdateSlotResponse = Site & { + /** + * The underlying HTTP response. + */ + _response: msRest.HttpResponse & { + /** + * The response body as text (string format) + */ + bodyAsText: string; + + /** + * The response body as parsed JSON or XML + */ + parsedBody: Site; + }; +}; + +/** + * Contains response data for the analyzeCustomHostnameSlot operation. + */ +export type WebAppsAnalyzeCustomHostnameSlotResponse = CustomHostnameAnalysisResult & { + /** + * The underlying HTTP response. + */ + _response: msRest.HttpResponse & { + /** + * The response body as text (string format) + */ + bodyAsText: string; + + /** + * The response body as parsed JSON or XML + */ + parsedBody: CustomHostnameAnalysisResult; + }; +}; + +/** + * Contains response data for the backupSlot operation. + */ +export type WebAppsBackupSlotResponse = BackupItem & { + /** + * The underlying HTTP response. + */ + _response: msRest.HttpResponse & { + /** + * The response body as text (string format) + */ + bodyAsText: string; + + /** + * The response body as parsed JSON or XML + */ + parsedBody: BackupItem; + }; +}; + +/** + * Contains response data for the listBackupsSlot operation. + */ +export type WebAppsListBackupsSlotResponse = BackupItemCollection & { + /** + * The underlying HTTP response. + */ + _response: msRest.HttpResponse & { + /** + * The response body as text (string format) + */ + bodyAsText: string; + + /** + * The response body as parsed JSON or XML + */ + parsedBody: BackupItemCollection; + }; +}; + +/** + * Contains response data for the getBackupStatusSlot operation. + */ +export type WebAppsGetBackupStatusSlotResponse = BackupItem & { + /** + * The underlying HTTP response. + */ + _response: msRest.HttpResponse & { + /** + * The response body as text (string format) + */ + bodyAsText: string; + + /** + * The response body as parsed JSON or XML + */ + parsedBody: BackupItem; + }; +}; + +/** + * Contains response data for the listBackupStatusSecretsSlot operation. + */ +export type WebAppsListBackupStatusSecretsSlotResponse = BackupItem & { + /** + * The underlying HTTP response. + */ + _response: msRest.HttpResponse & { + /** + * The response body as text (string format) + */ + bodyAsText: string; + + /** + * The response body as parsed JSON or XML + */ + parsedBody: BackupItem; + }; +}; + +/** + * Contains response data for the listConfigurationsSlot operation. + */ +export type WebAppsListConfigurationsSlotResponse = SiteConfigResourceCollection & { + /** + * The underlying HTTP response. + */ + _response: msRest.HttpResponse & { + /** + * The response body as text (string format) + */ + bodyAsText: string; + + /** + * The response body as parsed JSON or XML + */ + parsedBody: SiteConfigResourceCollection; + }; +}; + +/** + * Contains response data for the updateApplicationSettingsSlot operation. + */ +export type WebAppsUpdateApplicationSettingsSlotResponse = StringDictionary & { + /** + * The underlying HTTP response. + */ + _response: msRest.HttpResponse & { + /** + * The response body as text (string format) + */ + bodyAsText: string; + + /** + * The response body as parsed JSON or XML + */ + parsedBody: StringDictionary; + }; +}; + +/** + * Contains response data for the listApplicationSettingsSlot operation. + */ +export type WebAppsListApplicationSettingsSlotResponse = StringDictionary & { + /** + * The underlying HTTP response. + */ + _response: msRest.HttpResponse & { + /** + * The response body as text (string format) + */ + bodyAsText: string; + + /** + * The response body as parsed JSON or XML + */ + parsedBody: StringDictionary; + }; +}; + +/** + * Contains response data for the updateAuthSettingsSlot operation. + */ +export type WebAppsUpdateAuthSettingsSlotResponse = SiteAuthSettings & { + /** + * The underlying HTTP response. + */ + _response: msRest.HttpResponse & { + /** + * The response body as text (string format) + */ + bodyAsText: string; + + /** + * The response body as parsed JSON or XML + */ + parsedBody: SiteAuthSettings; + }; +}; + +/** + * Contains response data for the getAuthSettingsSlot operation. + */ +export type WebAppsGetAuthSettingsSlotResponse = SiteAuthSettings & { + /** + * The underlying HTTP response. + */ + _response: msRest.HttpResponse & { + /** + * The response body as text (string format) + */ + bodyAsText: string; + + /** + * The response body as parsed JSON or XML + */ + parsedBody: SiteAuthSettings; + }; +}; + +/** + * Contains response data for the updateAzureStorageAccountsSlot operation. + */ +export type WebAppsUpdateAzureStorageAccountsSlotResponse = AzureStoragePropertyDictionaryResource & { + /** + * The underlying HTTP response. + */ + _response: msRest.HttpResponse & { + /** + * The response body as text (string format) + */ + bodyAsText: string; + + /** + * The response body as parsed JSON or XML + */ + parsedBody: AzureStoragePropertyDictionaryResource; + }; +}; + +/** + * Contains response data for the listAzureStorageAccountsSlot operation. + */ +export type WebAppsListAzureStorageAccountsSlotResponse = AzureStoragePropertyDictionaryResource & { + /** + * The underlying HTTP response. + */ + _response: msRest.HttpResponse & { + /** + * The response body as text (string format) + */ + bodyAsText: string; + + /** + * The response body as parsed JSON or XML + */ + parsedBody: AzureStoragePropertyDictionaryResource; + }; +}; + +/** + * Contains response data for the updateBackupConfigurationSlot operation. + */ +export type WebAppsUpdateBackupConfigurationSlotResponse = BackupRequest & { + /** + * The underlying HTTP response. + */ + _response: msRest.HttpResponse & { + /** + * The response body as text (string format) + */ + bodyAsText: string; + + /** + * The response body as parsed JSON or XML + */ + parsedBody: BackupRequest; + }; +}; + +/** + * Contains response data for the getBackupConfigurationSlot operation. + */ +export type WebAppsGetBackupConfigurationSlotResponse = BackupRequest & { + /** + * The underlying HTTP response. + */ + _response: msRest.HttpResponse & { + /** + * The response body as text (string format) + */ + bodyAsText: string; + + /** + * The response body as parsed JSON or XML + */ + parsedBody: BackupRequest; + }; +}; + +/** + * Contains response data for the updateConnectionStringsSlot operation. + */ +export type WebAppsUpdateConnectionStringsSlotResponse = ConnectionStringDictionary & { + /** + * The underlying HTTP response. + */ + _response: msRest.HttpResponse & { + /** + * The response body as text (string format) + */ + bodyAsText: string; + + /** + * The response body as parsed JSON or XML + */ + parsedBody: ConnectionStringDictionary; + }; +}; + +/** + * Contains response data for the listConnectionStringsSlot operation. + */ +export type WebAppsListConnectionStringsSlotResponse = ConnectionStringDictionary & { + /** + * The underlying HTTP response. + */ + _response: msRest.HttpResponse & { + /** + * The response body as text (string format) + */ + bodyAsText: string; + + /** + * The response body as parsed JSON or XML + */ + parsedBody: ConnectionStringDictionary; + }; +}; + +/** + * Contains response data for the getDiagnosticLogsConfigurationSlot operation. + */ +export type WebAppsGetDiagnosticLogsConfigurationSlotResponse = SiteLogsConfig & { + /** + * The underlying HTTP response. + */ + _response: msRest.HttpResponse & { + /** + * The response body as text (string format) + */ + bodyAsText: string; + + /** + * The response body as parsed JSON or XML + */ + parsedBody: SiteLogsConfig; + }; +}; + +/** + * Contains response data for the updateDiagnosticLogsConfigSlot operation. + */ +export type WebAppsUpdateDiagnosticLogsConfigSlotResponse = SiteLogsConfig & { + /** + * The underlying HTTP response. + */ + _response: msRest.HttpResponse & { + /** + * The response body as text (string format) + */ + bodyAsText: string; + + /** + * The response body as parsed JSON or XML + */ + parsedBody: SiteLogsConfig; + }; +}; + +/** + * Contains response data for the updateMetadataSlot operation. + */ +export type WebAppsUpdateMetadataSlotResponse = StringDictionary & { + /** + * The underlying HTTP response. + */ + _response: msRest.HttpResponse & { + /** + * The response body as text (string format) + */ + bodyAsText: string; + + /** + * The response body as parsed JSON or XML + */ + parsedBody: StringDictionary; + }; +}; + +/** + * Contains response data for the listMetadataSlot operation. + */ +export type WebAppsListMetadataSlotResponse = StringDictionary & { + /** + * The underlying HTTP response. + */ + _response: msRest.HttpResponse & { + /** + * The response body as text (string format) + */ + bodyAsText: string; + + /** + * The response body as parsed JSON or XML + */ + parsedBody: StringDictionary; + }; +}; + +/** + * Contains response data for the listPublishingCredentialsSlot operation. + */ +export type WebAppsListPublishingCredentialsSlotResponse = User & { + /** + * The underlying HTTP response. + */ + _response: msRest.HttpResponse & { + /** + * The response body as text (string format) + */ + bodyAsText: string; + + /** + * The response body as parsed JSON or XML + */ + parsedBody: User; + }; +}; + +/** + * Contains response data for the updateSitePushSettingsSlot operation. + */ +export type WebAppsUpdateSitePushSettingsSlotResponse = PushSettings & { + /** + * The underlying HTTP response. + */ + _response: msRest.HttpResponse & { + /** + * The response body as text (string format) + */ + bodyAsText: string; + + /** + * The response body as parsed JSON or XML + */ + parsedBody: PushSettings; + }; +}; + +/** + * Contains response data for the listSitePushSettingsSlot operation. + */ +export type WebAppsListSitePushSettingsSlotResponse = PushSettings & { + /** + * The underlying HTTP response. + */ + _response: msRest.HttpResponse & { + /** + * The response body as text (string format) + */ + bodyAsText: string; + + /** + * The response body as parsed JSON or XML + */ + parsedBody: PushSettings; + }; +}; + +/** + * Contains response data for the getConfigurationSlot operation. + */ +export type WebAppsGetConfigurationSlotResponse = SiteConfigResource & { + /** + * The underlying HTTP response. + */ + _response: msRest.HttpResponse & { + /** + * The response body as text (string format) + */ + bodyAsText: string; + + /** + * The response body as parsed JSON or XML + */ + parsedBody: SiteConfigResource; + }; +}; + +/** + * Contains response data for the createOrUpdateConfigurationSlot operation. + */ +export type WebAppsCreateOrUpdateConfigurationSlotResponse = SiteConfigResource & { + /** + * The underlying HTTP response. + */ + _response: msRest.HttpResponse & { + /** + * The response body as text (string format) + */ + bodyAsText: string; + + /** + * The response body as parsed JSON or XML + */ + parsedBody: SiteConfigResource; + }; +}; + +/** + * Contains response data for the updateConfigurationSlot operation. + */ +export type WebAppsUpdateConfigurationSlotResponse = SiteConfigResource & { + /** + * The underlying HTTP response. + */ + _response: msRest.HttpResponse & { + /** + * The response body as text (string format) + */ + bodyAsText: string; + + /** + * The response body as parsed JSON or XML + */ + parsedBody: SiteConfigResource; + }; +}; + +/** + * Contains response data for the listConfigurationSnapshotInfoSlot operation. + */ +export type WebAppsListConfigurationSnapshotInfoSlotResponse = SiteConfigurationSnapshotInfoCollection & { + /** + * The underlying HTTP response. + */ + _response: msRest.HttpResponse & { + /** + * The response body as text (string format) + */ + bodyAsText: string; + + /** + * The response body as parsed JSON or XML + */ + parsedBody: SiteConfigurationSnapshotInfoCollection; + }; +}; + +/** + * Contains response data for the getConfigurationSnapshotSlot operation. + */ +export type WebAppsGetConfigurationSnapshotSlotResponse = SiteConfigResource & { + /** + * The underlying HTTP response. + */ + _response: msRest.HttpResponse & { + /** + * The response body as text (string format) + */ + bodyAsText: string; + + /** + * The response body as parsed JSON or XML + */ + parsedBody: SiteConfigResource; + }; +}; + +/** + * Contains response data for the getWebSiteContainerLogsSlot operation. + */ +export type WebAppsGetWebSiteContainerLogsSlotResponse = { + /** + * BROWSER ONLY + * + * The response body as a browser Blob. + * Always undefined in node.js. + */ + blobBody?: Promise; + + /** + * NODEJS ONLY + * + * The response body as a node.js Readable stream. + * Always undefined in the browser. + */ + readableStreamBody?: NodeJS.ReadableStream; + + /** + * The underlying HTTP response. + */ + _response: msRest.HttpResponse; +}; + +/** + * Contains response data for the getContainerLogsZipSlot operation. + */ +export type WebAppsGetContainerLogsZipSlotResponse = { + /** + * BROWSER ONLY + * + * The response body as a browser Blob. + * Always undefined in node.js. + */ + blobBody?: Promise; + + /** + * NODEJS ONLY + * + * The response body as a node.js Readable stream. + * Always undefined in the browser. + */ + readableStreamBody?: NodeJS.ReadableStream; + + /** + * The underlying HTTP response. + */ + _response: msRest.HttpResponse; +}; + +/** + * Contains response data for the listContinuousWebJobsSlot operation. + */ +export type WebAppsListContinuousWebJobsSlotResponse = ContinuousWebJobCollection & { + /** + * The underlying HTTP response. + */ + _response: msRest.HttpResponse & { + /** + * The response body as text (string format) + */ + bodyAsText: string; + + /** + * The response body as parsed JSON or XML + */ + parsedBody: ContinuousWebJobCollection; + }; +}; + +/** + * Contains response data for the getContinuousWebJobSlot operation. + */ +export type WebAppsGetContinuousWebJobSlotResponse = ContinuousWebJob & { + /** + * The underlying HTTP response. + */ + _response: msRest.HttpResponse & { + /** + * The response body as text (string format) + */ + bodyAsText: string; + + /** + * The response body as parsed JSON or XML + */ + parsedBody: ContinuousWebJob; + }; +}; + +/** + * Contains response data for the listDeploymentsSlot operation. + */ +export type WebAppsListDeploymentsSlotResponse = DeploymentCollection & { + /** + * The underlying HTTP response. + */ + _response: msRest.HttpResponse & { + /** + * The response body as text (string format) + */ + bodyAsText: string; + + /** + * The response body as parsed JSON or XML + */ + parsedBody: DeploymentCollection; + }; +}; + +/** + * Contains response data for the getDeploymentSlot operation. + */ +export type WebAppsGetDeploymentSlotResponse = Deployment & { + /** + * The underlying HTTP response. + */ + _response: msRest.HttpResponse & { + /** + * The response body as text (string format) + */ + bodyAsText: string; + + /** + * The response body as parsed JSON or XML + */ + parsedBody: Deployment; + }; +}; + +/** + * Contains response data for the createDeploymentSlot operation. + */ +export type WebAppsCreateDeploymentSlotResponse = Deployment & { + /** + * The underlying HTTP response. + */ + _response: msRest.HttpResponse & { + /** + * The response body as text (string format) + */ + bodyAsText: string; + + /** + * The response body as parsed JSON or XML + */ + parsedBody: Deployment; + }; +}; + +/** + * Contains response data for the listDeploymentLogSlot operation. + */ +export type WebAppsListDeploymentLogSlotResponse = Deployment & { + /** + * The underlying HTTP response. + */ + _response: msRest.HttpResponse & { + /** + * The response body as text (string format) + */ + bodyAsText: string; + + /** + * The response body as parsed JSON or XML + */ + parsedBody: Deployment; + }; +}; + +/** + * Contains response data for the discoverBackupSlot operation. + */ +export type WebAppsDiscoverBackupSlotResponse = RestoreRequest & { + /** + * The underlying HTTP response. + */ + _response: msRest.HttpResponse & { + /** + * The response body as text (string format) + */ + bodyAsText: string; + + /** + * The response body as parsed JSON or XML + */ + parsedBody: RestoreRequest; + }; +}; + +/** + * Contains response data for the listDomainOwnershipIdentifiersSlot operation. + */ +export type WebAppsListDomainOwnershipIdentifiersSlotResponse = IdentifierCollection & { + /** + * The underlying HTTP response. + */ + _response: msRest.HttpResponse & { + /** + * The response body as text (string format) + */ + bodyAsText: string; + + /** + * The response body as parsed JSON or XML + */ + parsedBody: IdentifierCollection; + }; +}; + +/** + * Contains response data for the getDomainOwnershipIdentifierSlot operation. + */ +export type WebAppsGetDomainOwnershipIdentifierSlotResponse = Identifier & { + /** + * The underlying HTTP response. + */ + _response: msRest.HttpResponse & { + /** + * The response body as text (string format) + */ + bodyAsText: string; + + /** + * The response body as parsed JSON or XML + */ + parsedBody: Identifier; + }; +}; + +/** + * Contains response data for the createOrUpdateDomainOwnershipIdentifierSlot operation. + */ +export type WebAppsCreateOrUpdateDomainOwnershipIdentifierSlotResponse = Identifier & { + /** + * The underlying HTTP response. + */ + _response: msRest.HttpResponse & { + /** + * The response body as text (string format) + */ + bodyAsText: string; + + /** + * The response body as parsed JSON or XML + */ + parsedBody: Identifier; + }; +}; + +/** + * Contains response data for the updateDomainOwnershipIdentifierSlot operation. + */ +export type WebAppsUpdateDomainOwnershipIdentifierSlotResponse = Identifier & { + /** + * The underlying HTTP response. + */ + _response: msRest.HttpResponse & { + /** + * The response body as text (string format) + */ + bodyAsText: string; + + /** + * The response body as parsed JSON or XML + */ + parsedBody: Identifier; + }; +}; + +/** + * Contains response data for the getMSDeployStatusSlot operation. + */ +export type WebAppsGetMSDeployStatusSlotResponse = MSDeployStatus & { + /** + * The underlying HTTP response. + */ + _response: msRest.HttpResponse & { + /** + * The response body as text (string format) + */ + bodyAsText: string; + + /** + * The response body as parsed JSON or XML + */ + parsedBody: MSDeployStatus; + }; +}; + +/** + * Contains response data for the createMSDeployOperationSlot operation. + */ +export type WebAppsCreateMSDeployOperationSlotResponse = MSDeployStatus & { + /** + * The underlying HTTP response. + */ + _response: msRest.HttpResponse & { + /** + * The response body as text (string format) + */ + bodyAsText: string; + + /** + * The response body as parsed JSON or XML + */ + parsedBody: MSDeployStatus; + }; +}; + +/** + * Contains response data for the getMSDeployLogSlot operation. + */ +export type WebAppsGetMSDeployLogSlotResponse = MSDeployLog & { + /** + * The underlying HTTP response. + */ + _response: msRest.HttpResponse & { + /** + * The response body as text (string format) + */ + bodyAsText: string; + + /** + * The response body as parsed JSON or XML + */ + parsedBody: MSDeployLog; + }; +}; + +/** + * Contains response data for the listInstanceFunctionsSlot operation. + */ +export type WebAppsListInstanceFunctionsSlotResponse = FunctionEnvelopeCollection & { + /** + * The underlying HTTP response. + */ + _response: msRest.HttpResponse & { + /** + * The response body as text (string format) + */ + bodyAsText: string; + + /** + * The response body as parsed JSON or XML + */ + parsedBody: FunctionEnvelopeCollection; + }; +}; + +/** + * Contains response data for the getFunctionsAdminTokenSlot operation. + */ +export type WebAppsGetFunctionsAdminTokenSlotResponse = { + /** + * The parsed response body. + */ + body: string; + + /** + * The underlying HTTP response. + */ + _response: msRest.HttpResponse & { + /** + * The response body as text (string format) + */ + bodyAsText: string; + + /** + * The response body as parsed JSON or XML + */ + parsedBody: string; + }; +}; + +/** + * Contains response data for the getInstanceFunctionSlot operation. + */ +export type WebAppsGetInstanceFunctionSlotResponse = FunctionEnvelope & { + /** + * The underlying HTTP response. + */ + _response: msRest.HttpResponse & { + /** + * The response body as text (string format) + */ + bodyAsText: string; + + /** + * The response body as parsed JSON or XML + */ + parsedBody: FunctionEnvelope; + }; +}; + +/** + * Contains response data for the createInstanceFunctionSlot operation. + */ +export type WebAppsCreateInstanceFunctionSlotResponse = FunctionEnvelope & { + /** + * The underlying HTTP response. + */ + _response: msRest.HttpResponse & { + /** + * The response body as text (string format) + */ + bodyAsText: string; + + /** + * The response body as parsed JSON or XML + */ + parsedBody: FunctionEnvelope; + }; +}; + +/** + * Contains response data for the listFunctionSecretsSlot operation. + */ +export type WebAppsListFunctionSecretsSlotResponse = FunctionSecrets & { + /** + * The underlying HTTP response. + */ + _response: msRest.HttpResponse & { + /** + * The response body as text (string format) + */ + bodyAsText: string; + + /** + * The response body as parsed JSON or XML + */ + parsedBody: FunctionSecrets; + }; +}; + +/** + * Contains response data for the listHostNameBindingsSlot operation. + */ +export type WebAppsListHostNameBindingsSlotResponse = HostNameBindingCollection & { + /** + * The underlying HTTP response. + */ + _response: msRest.HttpResponse & { + /** + * The response body as text (string format) + */ + bodyAsText: string; + + /** + * The response body as parsed JSON or XML + */ + parsedBody: HostNameBindingCollection; + }; +}; + +/** + * Contains response data for the getHostNameBindingSlot operation. + */ +export type WebAppsGetHostNameBindingSlotResponse = HostNameBinding & { + /** + * The underlying HTTP response. + */ + _response: msRest.HttpResponse & { + /** + * The response body as text (string format) + */ + bodyAsText: string; + + /** + * The response body as parsed JSON or XML + */ + parsedBody: HostNameBinding; + }; +}; + +/** + * Contains response data for the createOrUpdateHostNameBindingSlot operation. + */ +export type WebAppsCreateOrUpdateHostNameBindingSlotResponse = HostNameBinding & { + /** + * The underlying HTTP response. + */ + _response: msRest.HttpResponse & { + /** + * The response body as text (string format) + */ + bodyAsText: string; + + /** + * The response body as parsed JSON or XML + */ + parsedBody: HostNameBinding; + }; +}; + +/** + * Contains response data for the getHybridConnectionSlot operation. + */ +export type WebAppsGetHybridConnectionSlotResponse = HybridConnection & { + /** + * The underlying HTTP response. + */ + _response: msRest.HttpResponse & { + /** + * The response body as text (string format) + */ + bodyAsText: string; + + /** + * The response body as parsed JSON or XML + */ + parsedBody: HybridConnection; + }; +}; + +/** + * Contains response data for the createOrUpdateHybridConnectionSlot operation. + */ +export type WebAppsCreateOrUpdateHybridConnectionSlotResponse = HybridConnection & { + /** + * The underlying HTTP response. + */ + _response: msRest.HttpResponse & { + /** + * The response body as text (string format) + */ + bodyAsText: string; + + /** + * The response body as parsed JSON or XML + */ + parsedBody: HybridConnection; + }; +}; + +/** + * Contains response data for the updateHybridConnectionSlot operation. + */ +export type WebAppsUpdateHybridConnectionSlotResponse = HybridConnection & { + /** + * The underlying HTTP response. + */ + _response: msRest.HttpResponse & { + /** + * The response body as text (string format) + */ + bodyAsText: string; + + /** + * The response body as parsed JSON or XML + */ + parsedBody: HybridConnection; + }; +}; + +/** + * Contains response data for the listHybridConnectionKeysSlot operation. + */ +export type WebAppsListHybridConnectionKeysSlotResponse = HybridConnectionKey & { + /** + * The underlying HTTP response. + */ + _response: msRest.HttpResponse & { + /** + * The response body as text (string format) + */ + bodyAsText: string; + + /** + * The response body as parsed JSON or XML + */ + parsedBody: HybridConnectionKey; + }; +}; + +/** + * Contains response data for the listHybridConnectionsSlot operation. + */ +export type WebAppsListHybridConnectionsSlotResponse = HybridConnection & { + /** + * The underlying HTTP response. + */ + _response: msRest.HttpResponse & { + /** + * The response body as text (string format) + */ + bodyAsText: string; + + /** + * The response body as parsed JSON or XML + */ + parsedBody: HybridConnection; + }; +}; + +/** + * Contains response data for the listRelayServiceConnectionsSlot operation. + */ +export type WebAppsListRelayServiceConnectionsSlotResponse = RelayServiceConnectionEntity & { + /** + * The underlying HTTP response. + */ + _response: msRest.HttpResponse & { + /** + * The response body as text (string format) + */ + bodyAsText: string; + + /** + * The response body as parsed JSON or XML + */ + parsedBody: RelayServiceConnectionEntity; + }; +}; + +/** + * Contains response data for the getRelayServiceConnectionSlot operation. + */ +export type WebAppsGetRelayServiceConnectionSlotResponse = RelayServiceConnectionEntity & { + /** + * The underlying HTTP response. + */ + _response: msRest.HttpResponse & { + /** + * The response body as text (string format) + */ + bodyAsText: string; + + /** + * The response body as parsed JSON or XML + */ + parsedBody: RelayServiceConnectionEntity; + }; +}; + +/** + * Contains response data for the createOrUpdateRelayServiceConnectionSlot operation. + */ +export type WebAppsCreateOrUpdateRelayServiceConnectionSlotResponse = RelayServiceConnectionEntity & { + /** + * The underlying HTTP response. + */ + _response: msRest.HttpResponse & { + /** + * The response body as text (string format) + */ + bodyAsText: string; + + /** + * The response body as parsed JSON or XML + */ + parsedBody: RelayServiceConnectionEntity; + }; +}; + +/** + * Contains response data for the updateRelayServiceConnectionSlot operation. + */ +export type WebAppsUpdateRelayServiceConnectionSlotResponse = RelayServiceConnectionEntity & { + /** + * The underlying HTTP response. + */ + _response: msRest.HttpResponse & { + /** + * The response body as text (string format) + */ + bodyAsText: string; + + /** + * The response body as parsed JSON or XML + */ + parsedBody: RelayServiceConnectionEntity; + }; +}; + +/** + * Contains response data for the listInstanceIdentifiersSlot operation. + */ +export type WebAppsListInstanceIdentifiersSlotResponse = WebAppInstanceCollection & { + /** + * The underlying HTTP response. + */ + _response: msRest.HttpResponse & { + /** + * The response body as text (string format) + */ + bodyAsText: string; + + /** + * The response body as parsed JSON or XML + */ + parsedBody: WebAppInstanceCollection; + }; +}; + +/** + * Contains response data for the getInstanceMsDeployStatusSlot operation. + */ +export type WebAppsGetInstanceMsDeployStatusSlotResponse = MSDeployStatus & { + /** + * The underlying HTTP response. + */ + _response: msRest.HttpResponse & { + /** + * The response body as text (string format) + */ + bodyAsText: string; + + /** + * The response body as parsed JSON or XML + */ + parsedBody: MSDeployStatus; + }; +}; + +/** + * Contains response data for the createInstanceMSDeployOperationSlot operation. + */ +export type WebAppsCreateInstanceMSDeployOperationSlotResponse = MSDeployStatus & { + /** + * The underlying HTTP response. + */ + _response: msRest.HttpResponse & { + /** + * The response body as text (string format) + */ + bodyAsText: string; + + /** + * The response body as parsed JSON or XML + */ + parsedBody: MSDeployStatus; + }; +}; + +/** + * Contains response data for the getInstanceMSDeployLogSlot operation. + */ +export type WebAppsGetInstanceMSDeployLogSlotResponse = MSDeployLog & { + /** + * The underlying HTTP response. + */ + _response: msRest.HttpResponse & { + /** + * The response body as text (string format) + */ + bodyAsText: string; + + /** + * The response body as parsed JSON or XML + */ + parsedBody: MSDeployLog; + }; +}; + +/** + * Contains response data for the listInstanceProcessesSlot operation. + */ +export type WebAppsListInstanceProcessesSlotResponse = ProcessInfoCollection & { + /** + * The underlying HTTP response. + */ + _response: msRest.HttpResponse & { + /** + * The response body as text (string format) + */ + bodyAsText: string; + + /** + * The response body as parsed JSON or XML + */ + parsedBody: ProcessInfoCollection; + }; +}; + +/** + * Contains response data for the getInstanceProcessSlot operation. + */ +export type WebAppsGetInstanceProcessSlotResponse = ProcessInfo & { + /** + * The underlying HTTP response. + */ + _response: msRest.HttpResponse & { + /** + * The response body as text (string format) + */ + bodyAsText: string; + + /** + * The response body as parsed JSON or XML + */ + parsedBody: ProcessInfo; + }; +}; + +/** + * Contains response data for the getInstanceProcessDumpSlot operation. + */ +export type WebAppsGetInstanceProcessDumpSlotResponse = { + /** + * BROWSER ONLY + * + * The response body as a browser Blob. + * Always undefined in node.js. + */ + blobBody?: Promise; + + /** + * NODEJS ONLY + * + * The response body as a node.js Readable stream. + * Always undefined in the browser. + */ + readableStreamBody?: NodeJS.ReadableStream; + + /** + * The underlying HTTP response. + */ + _response: msRest.HttpResponse; +}; + +/** + * Contains response data for the listInstanceProcessModulesSlot operation. + */ +export type WebAppsListInstanceProcessModulesSlotResponse = ProcessModuleInfoCollection & { + /** + * The underlying HTTP response. + */ + _response: msRest.HttpResponse & { + /** + * The response body as text (string format) + */ + bodyAsText: string; + + /** + * The response body as parsed JSON or XML + */ + parsedBody: ProcessModuleInfoCollection; + }; +}; + +/** + * Contains response data for the getInstanceProcessModuleSlot operation. + */ +export type WebAppsGetInstanceProcessModuleSlotResponse = ProcessModuleInfo & { + /** + * The underlying HTTP response. + */ + _response: msRest.HttpResponse & { + /** + * The response body as text (string format) + */ + bodyAsText: string; + + /** + * The response body as parsed JSON or XML + */ + parsedBody: ProcessModuleInfo; + }; +}; + +/** + * Contains response data for the listInstanceProcessThreadsSlot operation. + */ +export type WebAppsListInstanceProcessThreadsSlotResponse = ProcessThreadInfoCollection & { + /** + * The underlying HTTP response. + */ + _response: msRest.HttpResponse & { + /** + * The response body as text (string format) + */ + bodyAsText: string; + + /** + * The response body as parsed JSON or XML + */ + parsedBody: ProcessThreadInfoCollection; + }; +}; + +/** + * Contains response data for the getInstanceProcessThreadSlot operation. + */ +export type WebAppsGetInstanceProcessThreadSlotResponse = ProcessThreadInfo & { + /** + * The underlying HTTP response. + */ + _response: msRest.HttpResponse & { + /** + * The response body as text (string format) + */ + bodyAsText: string; + + /** + * The response body as parsed JSON or XML + */ + parsedBody: ProcessThreadInfo; + }; +}; + +/** + * Contains response data for the isCloneableSlot operation. + */ +export type WebAppsIsCloneableSlotResponse = SiteCloneability & { + /** + * The underlying HTTP response. + */ + _response: msRest.HttpResponse & { + /** + * The response body as text (string format) + */ + bodyAsText: string; + + /** + * The response body as parsed JSON or XML + */ + parsedBody: SiteCloneability; + }; +}; + +/** + * Contains response data for the listSyncFunctionTriggersSlot operation. + */ +export type WebAppsListSyncFunctionTriggersSlotResponse = FunctionSecrets & { + /** + * The underlying HTTP response. + */ + _response: msRest.HttpResponse & { + /** + * The response body as text (string format) + */ + bodyAsText: string; + + /** + * The response body as parsed JSON or XML + */ + parsedBody: FunctionSecrets; + }; +}; + +/** + * Contains response data for the listMetricDefinitionsSlot operation. + */ +export type WebAppsListMetricDefinitionsSlotResponse = ResourceMetricDefinitionCollection & { + /** + * The underlying HTTP response. + */ + _response: msRest.HttpResponse & { + /** + * The response body as text (string format) + */ + bodyAsText: string; + + /** + * The response body as parsed JSON or XML + */ + parsedBody: ResourceMetricDefinitionCollection; + }; +}; + +/** + * Contains response data for the listMetricsSlot operation. + */ +export type WebAppsListMetricsSlotResponse = ResourceMetricCollection & { + /** + * The underlying HTTP response. + */ + _response: msRest.HttpResponse & { + /** + * The response body as text (string format) + */ + bodyAsText: string; + + /** + * The response body as parsed JSON or XML + */ + parsedBody: ResourceMetricCollection; + }; +}; + +/** + * Contains response data for the getMigrateMySqlStatusSlot operation. + */ +export type WebAppsGetMigrateMySqlStatusSlotResponse = MigrateMySqlStatus & { + /** + * The underlying HTTP response. + */ + _response: msRest.HttpResponse & { + /** + * The response body as text (string format) + */ + bodyAsText: string; + + /** + * The response body as parsed JSON or XML + */ + parsedBody: MigrateMySqlStatus; + }; +}; + +/** + * Contains response data for the getSwiftVirtualNetworkConnectionSlot operation. + */ +export type WebAppsGetSwiftVirtualNetworkConnectionSlotResponse = SwiftVirtualNetwork & { + /** + * The underlying HTTP response. + */ + _response: msRest.HttpResponse & { + /** + * The response body as text (string format) + */ + bodyAsText: string; + + /** + * The response body as parsed JSON or XML + */ + parsedBody: SwiftVirtualNetwork; + }; +}; + +/** + * Contains response data for the createOrUpdateSwiftVirtualNetworkConnectionSlot operation. + */ +export type WebAppsCreateOrUpdateSwiftVirtualNetworkConnectionSlotResponse = SwiftVirtualNetwork & { + /** + * The underlying HTTP response. + */ + _response: msRest.HttpResponse & { + /** + * The response body as text (string format) + */ + bodyAsText: string; + + /** + * The response body as parsed JSON or XML + */ + parsedBody: SwiftVirtualNetwork; + }; +}; + +/** + * Contains response data for the updateSwiftVirtualNetworkConnectionSlot operation. + */ +export type WebAppsUpdateSwiftVirtualNetworkConnectionSlotResponse = SwiftVirtualNetwork & { + /** + * The underlying HTTP response. + */ + _response: msRest.HttpResponse & { + /** + * The response body as text (string format) + */ + bodyAsText: string; + + /** + * The response body as parsed JSON or XML + */ + parsedBody: SwiftVirtualNetwork; + }; +}; + +/** + * Contains response data for the listNetworkFeaturesSlot operation. + */ +export type WebAppsListNetworkFeaturesSlotResponse = NetworkFeatures & { + /** + * The underlying HTTP response. + */ + _response: msRest.HttpResponse & { + /** + * The response body as text (string format) + */ + bodyAsText: string; + + /** + * The response body as parsed JSON or XML + */ + parsedBody: NetworkFeatures; + }; +}; + +/** + * Contains response data for the getNetworkTraceOperationSlot operation. + */ +export type WebAppsGetNetworkTraceOperationSlotResponse = Array & { + /** + * The underlying HTTP response. + */ + _response: msRest.HttpResponse & { + /** + * The response body as text (string format) + */ + bodyAsText: string; + + /** + * The response body as parsed JSON or XML + */ + parsedBody: NetworkTrace[]; + }; +}; + +/** + * Contains response data for the startWebSiteNetworkTraceSlot operation. + */ +export type WebAppsStartWebSiteNetworkTraceSlotResponse = { + /** + * The parsed response body. + */ + body: string; + + /** + * The underlying HTTP response. + */ + _response: msRest.HttpResponse & { + /** + * The response body as text (string format) + */ + bodyAsText: string; + + /** + * The response body as parsed JSON or XML + */ + parsedBody: string; + }; +}; + +/** + * Contains response data for the startWebSiteNetworkTraceOperationSlot operation. + */ +export type WebAppsStartWebSiteNetworkTraceOperationSlotResponse = Array & { + /** + * The underlying HTTP response. + */ + _response: msRest.HttpResponse & { + /** + * The response body as text (string format) + */ + bodyAsText: string; + + /** + * The response body as parsed JSON or XML + */ + parsedBody: NetworkTrace[]; + }; +}; + +/** + * Contains response data for the getNetworkTracesSlot operation. + */ +export type WebAppsGetNetworkTracesSlotResponse = Array & { + /** + * The underlying HTTP response. + */ + _response: msRest.HttpResponse & { + /** + * The response body as text (string format) + */ + bodyAsText: string; + + /** + * The response body as parsed JSON or XML + */ + parsedBody: NetworkTrace[]; + }; +}; + +/** + * Contains response data for the getNetworkTraceOperationSlotV2 operation. + */ +export type WebAppsGetNetworkTraceOperationSlotV2Response = Array & { + /** + * The underlying HTTP response. + */ + _response: msRest.HttpResponse & { + /** + * The response body as text (string format) + */ + bodyAsText: string; + + /** + * The response body as parsed JSON or XML + */ + parsedBody: NetworkTrace[]; + }; +}; + +/** + * Contains response data for the getNetworkTracesSlotV2 operation. + */ +export type WebAppsGetNetworkTracesSlotV2Response = Array & { + /** + * The underlying HTTP response. + */ + _response: msRest.HttpResponse & { + /** + * The response body as text (string format) + */ + bodyAsText: string; + + /** + * The response body as parsed JSON or XML + */ + parsedBody: NetworkTrace[]; + }; +}; + +/** + * Contains response data for the listPerfMonCountersSlot operation. + */ +export type WebAppsListPerfMonCountersSlotResponse = PerfMonCounterCollection & { + /** + * The underlying HTTP response. + */ + _response: msRest.HttpResponse & { + /** + * The response body as text (string format) + */ + bodyAsText: string; + + /** + * The response body as parsed JSON or XML + */ + parsedBody: PerfMonCounterCollection; + }; +}; + +/** + * Contains response data for the getSitePhpErrorLogFlagSlot operation. + */ +export type WebAppsGetSitePhpErrorLogFlagSlotResponse = SitePhpErrorLogFlag & { + /** + * The underlying HTTP response. + */ + _response: msRest.HttpResponse & { + /** + * The response body as text (string format) + */ + bodyAsText: string; + + /** + * The response body as parsed JSON or XML + */ + parsedBody: SitePhpErrorLogFlag; + }; +}; + +/** + * Contains response data for the listPremierAddOnsSlot operation. + */ +export type WebAppsListPremierAddOnsSlotResponse = PremierAddOn & { + /** + * The underlying HTTP response. + */ + _response: msRest.HttpResponse & { + /** + * The response body as text (string format) + */ + bodyAsText: string; + + /** + * The response body as parsed JSON or XML + */ + parsedBody: PremierAddOn; + }; +}; + +/** + * Contains response data for the getPremierAddOnSlot operation. + */ +export type WebAppsGetPremierAddOnSlotResponse = PremierAddOn & { + /** + * The underlying HTTP response. + */ + _response: msRest.HttpResponse & { + /** + * The response body as text (string format) + */ + bodyAsText: string; + + /** + * The response body as parsed JSON or XML + */ + parsedBody: PremierAddOn; + }; +}; + +/** + * Contains response data for the addPremierAddOnSlot operation. + */ +export type WebAppsAddPremierAddOnSlotResponse = PremierAddOn & { + /** + * The underlying HTTP response. + */ + _response: msRest.HttpResponse & { + /** + * The response body as text (string format) + */ + bodyAsText: string; + + /** + * The response body as parsed JSON or XML + */ + parsedBody: PremierAddOn; + }; +}; + +/** + * Contains response data for the updatePremierAddOnSlot operation. + */ +export type WebAppsUpdatePremierAddOnSlotResponse = PremierAddOn & { + /** + * The underlying HTTP response. + */ + _response: msRest.HttpResponse & { + /** + * The response body as text (string format) + */ + bodyAsText: string; + + /** + * The response body as parsed JSON or XML + */ + parsedBody: PremierAddOn; + }; +}; + +/** + * Contains response data for the getPrivateAccessSlot operation. + */ +export type WebAppsGetPrivateAccessSlotResponse = PrivateAccess & { + /** + * The underlying HTTP response. + */ + _response: msRest.HttpResponse & { + /** + * The response body as text (string format) + */ + bodyAsText: string; + + /** + * The response body as parsed JSON or XML + */ + parsedBody: PrivateAccess; + }; +}; + +/** + * Contains response data for the putPrivateAccessVnetSlot operation. + */ +export type WebAppsPutPrivateAccessVnetSlotResponse = PrivateAccess & { + /** + * The underlying HTTP response. + */ + _response: msRest.HttpResponse & { + /** + * The response body as text (string format) + */ + bodyAsText: string; + + /** + * The response body as parsed JSON or XML + */ + parsedBody: PrivateAccess; + }; +}; + +/** + * Contains response data for the listProcessesSlot operation. + */ +export type WebAppsListProcessesSlotResponse = ProcessInfoCollection & { + /** + * The underlying HTTP response. + */ + _response: msRest.HttpResponse & { + /** + * The response body as text (string format) + */ + bodyAsText: string; + + /** + * The response body as parsed JSON or XML + */ + parsedBody: ProcessInfoCollection; + }; +}; + +/** + * Contains response data for the getProcessSlot operation. + */ +export type WebAppsGetProcessSlotResponse = ProcessInfo & { + /** + * The underlying HTTP response. + */ + _response: msRest.HttpResponse & { + /** + * The response body as text (string format) + */ + bodyAsText: string; + + /** + * The response body as parsed JSON or XML + */ + parsedBody: ProcessInfo; + }; +}; + +/** + * Contains response data for the getProcessDumpSlot operation. + */ +export type WebAppsGetProcessDumpSlotResponse = { + /** + * BROWSER ONLY + * + * The response body as a browser Blob. + * Always undefined in node.js. + */ + blobBody?: Promise; + + /** + * NODEJS ONLY + * + * The response body as a node.js Readable stream. + * Always undefined in the browser. + */ + readableStreamBody?: NodeJS.ReadableStream; + + /** + * The underlying HTTP response. + */ + _response: msRest.HttpResponse; +}; + +/** + * Contains response data for the listProcessModulesSlot operation. + */ +export type WebAppsListProcessModulesSlotResponse = ProcessModuleInfoCollection & { + /** + * The underlying HTTP response. + */ + _response: msRest.HttpResponse & { + /** + * The response body as text (string format) + */ + bodyAsText: string; + + /** + * The response body as parsed JSON or XML + */ + parsedBody: ProcessModuleInfoCollection; + }; +}; + +/** + * Contains response data for the getProcessModuleSlot operation. + */ +export type WebAppsGetProcessModuleSlotResponse = ProcessModuleInfo & { + /** + * The underlying HTTP response. + */ + _response: msRest.HttpResponse & { + /** + * The response body as text (string format) + */ + bodyAsText: string; + + /** + * The response body as parsed JSON or XML + */ + parsedBody: ProcessModuleInfo; + }; +}; + +/** + * Contains response data for the listProcessThreadsSlot operation. + */ +export type WebAppsListProcessThreadsSlotResponse = ProcessThreadInfoCollection & { + /** + * The underlying HTTP response. + */ + _response: msRest.HttpResponse & { + /** + * The response body as text (string format) + */ + bodyAsText: string; + + /** + * The response body as parsed JSON or XML + */ + parsedBody: ProcessThreadInfoCollection; + }; +}; + +/** + * Contains response data for the getProcessThreadSlot operation. + */ +export type WebAppsGetProcessThreadSlotResponse = ProcessThreadInfo & { + /** + * The underlying HTTP response. + */ + _response: msRest.HttpResponse & { + /** + * The response body as text (string format) + */ + bodyAsText: string; + + /** + * The response body as parsed JSON or XML + */ + parsedBody: ProcessThreadInfo; + }; +}; + +/** + * Contains response data for the listPublicCertificatesSlot operation. + */ +export type WebAppsListPublicCertificatesSlotResponse = PublicCertificateCollection & { + /** + * The underlying HTTP response. + */ + _response: msRest.HttpResponse & { + /** + * The response body as text (string format) + */ + bodyAsText: string; + + /** + * The response body as parsed JSON or XML + */ + parsedBody: PublicCertificateCollection; + }; +}; + +/** + * Contains response data for the getPublicCertificateSlot operation. + */ +export type WebAppsGetPublicCertificateSlotResponse = PublicCertificate & { + /** + * The underlying HTTP response. + */ + _response: msRest.HttpResponse & { + /** + * The response body as text (string format) + */ + bodyAsText: string; + + /** + * The response body as parsed JSON or XML + */ + parsedBody: PublicCertificate; + }; +}; + +/** + * Contains response data for the createOrUpdatePublicCertificateSlot operation. + */ +export type WebAppsCreateOrUpdatePublicCertificateSlotResponse = PublicCertificate & { + /** + * The underlying HTTP response. + */ + _response: msRest.HttpResponse & { + /** + * The response body as text (string format) + */ + bodyAsText: string; + + /** + * The response body as parsed JSON or XML + */ + parsedBody: PublicCertificate; + }; +}; + +/** + * Contains response data for the listPublishingProfileXmlWithSecretsSlot operation. + */ +export type WebAppsListPublishingProfileXmlWithSecretsSlotResponse = { + /** + * BROWSER ONLY + * + * The response body as a browser Blob. + * Always undefined in node.js. + */ + blobBody?: Promise; + + /** + * NODEJS ONLY + * + * The response body as a node.js Readable stream. + * Always undefined in the browser. + */ + readableStreamBody?: NodeJS.ReadableStream; + + /** + * The underlying HTTP response. + */ + _response: msRest.HttpResponse; +}; + +/** + * Contains response data for the listSiteExtensionsSlot operation. + */ +export type WebAppsListSiteExtensionsSlotResponse = SiteExtensionInfoCollection & { + /** + * The underlying HTTP response. + */ + _response: msRest.HttpResponse & { + /** + * The response body as text (string format) + */ + bodyAsText: string; + + /** + * The response body as parsed JSON or XML + */ + parsedBody: SiteExtensionInfoCollection; + }; +}; + +/** + * Contains response data for the getSiteExtensionSlot operation. + */ +export type WebAppsGetSiteExtensionSlotResponse = SiteExtensionInfo & { + /** + * The underlying HTTP response. + */ + _response: msRest.HttpResponse & { + /** + * The response body as text (string format) + */ + bodyAsText: string; + + /** + * The response body as parsed JSON or XML + */ + parsedBody: SiteExtensionInfo; + }; +}; + +/** + * Contains response data for the installSiteExtensionSlot operation. + */ +export type WebAppsInstallSiteExtensionSlotResponse = SiteExtensionInfo & { + /** + * The underlying HTTP response. + */ + _response: msRest.HttpResponse & { + /** + * The response body as text (string format) + */ + bodyAsText: string; + + /** + * The response body as parsed JSON or XML + */ + parsedBody: SiteExtensionInfo; + }; +}; + +/** + * Contains response data for the listSlotDifferencesSlot operation. + */ +export type WebAppsListSlotDifferencesSlotResponse = SlotDifferenceCollection & { + /** + * The underlying HTTP response. + */ + _response: msRest.HttpResponse & { + /** + * The response body as text (string format) + */ + bodyAsText: string; + + /** + * The response body as parsed JSON or XML + */ + parsedBody: SlotDifferenceCollection; + }; +}; + +/** + * Contains response data for the listSnapshotsSlot operation. + */ +export type WebAppsListSnapshotsSlotResponse = SnapshotCollection & { + /** + * The underlying HTTP response. + */ + _response: msRest.HttpResponse & { + /** + * The response body as text (string format) + */ + bodyAsText: string; + + /** + * The response body as parsed JSON or XML + */ + parsedBody: SnapshotCollection; + }; +}; + +/** + * Contains response data for the listSnapshotsFromDRSecondarySlot operation. + */ +export type WebAppsListSnapshotsFromDRSecondarySlotResponse = SnapshotCollection & { + /** + * The underlying HTTP response. + */ + _response: msRest.HttpResponse & { + /** + * The response body as text (string format) + */ + bodyAsText: string; + + /** + * The response body as parsed JSON or XML + */ + parsedBody: SnapshotCollection; + }; +}; + +/** + * Contains response data for the getSourceControlSlot operation. + */ +export type WebAppsGetSourceControlSlotResponse = SiteSourceControl & { + /** + * The underlying HTTP response. + */ + _response: msRest.HttpResponse & { + /** + * The response body as text (string format) + */ + bodyAsText: string; + + /** + * The response body as parsed JSON or XML + */ + parsedBody: SiteSourceControl; + }; +}; + +/** + * Contains response data for the createOrUpdateSourceControlSlot operation. + */ +export type WebAppsCreateOrUpdateSourceControlSlotResponse = SiteSourceControl & { + /** + * The underlying HTTP response. + */ + _response: msRest.HttpResponse & { + /** + * The response body as text (string format) + */ + bodyAsText: string; + + /** + * The response body as parsed JSON or XML + */ + parsedBody: SiteSourceControl; + }; +}; + +/** + * Contains response data for the updateSourceControlSlot operation. + */ +export type WebAppsUpdateSourceControlSlotResponse = SiteSourceControl & { + /** + * The underlying HTTP response. + */ + _response: msRest.HttpResponse & { + /** + * The response body as text (string format) + */ + bodyAsText: string; + + /** + * The response body as parsed JSON or XML + */ + parsedBody: SiteSourceControl; + }; +}; + +/** + * Contains response data for the startNetworkTraceSlot operation. + */ +export type WebAppsStartNetworkTraceSlotResponse = Array & { + /** + * The underlying HTTP response. + */ + _response: msRest.HttpResponse & { + /** + * The response body as text (string format) + */ + bodyAsText: string; + + /** + * The response body as parsed JSON or XML + */ + parsedBody: NetworkTrace[]; + }; +}; + +/** + * Contains response data for the listTriggeredWebJobsSlot operation. + */ +export type WebAppsListTriggeredWebJobsSlotResponse = TriggeredWebJobCollection & { + /** + * The underlying HTTP response. + */ + _response: msRest.HttpResponse & { + /** + * The response body as text (string format) + */ + bodyAsText: string; + + /** + * The response body as parsed JSON or XML + */ + parsedBody: TriggeredWebJobCollection; + }; +}; + +/** + * Contains response data for the getTriggeredWebJobSlot operation. + */ +export type WebAppsGetTriggeredWebJobSlotResponse = TriggeredWebJob & { + /** + * The underlying HTTP response. + */ + _response: msRest.HttpResponse & { + /** + * The response body as text (string format) + */ + bodyAsText: string; + + /** + * The response body as parsed JSON or XML + */ + parsedBody: TriggeredWebJob; + }; +}; + +/** + * Contains response data for the listTriggeredWebJobHistorySlot operation. + */ +export type WebAppsListTriggeredWebJobHistorySlotResponse = TriggeredJobHistoryCollection & { + /** + * The underlying HTTP response. + */ + _response: msRest.HttpResponse & { + /** + * The response body as text (string format) + */ + bodyAsText: string; + + /** + * The response body as parsed JSON or XML + */ + parsedBody: TriggeredJobHistoryCollection; + }; +}; + +/** + * Contains response data for the getTriggeredWebJobHistorySlot operation. + */ +export type WebAppsGetTriggeredWebJobHistorySlotResponse = TriggeredJobHistory & { + /** + * The underlying HTTP response. + */ + _response: msRest.HttpResponse & { + /** + * The response body as text (string format) + */ + bodyAsText: string; + + /** + * The response body as parsed JSON or XML + */ + parsedBody: TriggeredJobHistory; + }; +}; + +/** + * Contains response data for the listUsagesSlot operation. + */ +export type WebAppsListUsagesSlotResponse = CsmUsageQuotaCollection & { + /** + * The underlying HTTP response. + */ + _response: msRest.HttpResponse & { + /** + * The response body as text (string format) + */ + bodyAsText: string; + + /** + * The response body as parsed JSON or XML + */ + parsedBody: CsmUsageQuotaCollection; + }; +}; + +/** + * Contains response data for the listVnetConnectionsSlot operation. + */ +export type WebAppsListVnetConnectionsSlotResponse = Array & { + /** + * The underlying HTTP response. + */ + _response: msRest.HttpResponse & { + /** + * The response body as text (string format) + */ + bodyAsText: string; + + /** + * The response body as parsed JSON or XML + */ + parsedBody: VnetInfo[]; + }; +}; + +/** + * Contains response data for the getVnetConnectionSlot operation. + */ +export type WebAppsGetVnetConnectionSlotResponse = VnetInfo & { + /** + * The underlying HTTP response. + */ + _response: msRest.HttpResponse & { + /** + * The response body as text (string format) + */ + bodyAsText: string; + + /** + * The response body as parsed JSON or XML + */ + parsedBody: VnetInfo; + }; +}; + +/** + * Contains response data for the createOrUpdateVnetConnectionSlot operation. + */ +export type WebAppsCreateOrUpdateVnetConnectionSlotResponse = VnetInfo & { + /** + * The underlying HTTP response. + */ + _response: msRest.HttpResponse & { + /** + * The response body as text (string format) + */ + bodyAsText: string; + + /** + * The response body as parsed JSON or XML + */ + parsedBody: VnetInfo; + }; +}; + +/** + * Contains response data for the updateVnetConnectionSlot operation. + */ +export type WebAppsUpdateVnetConnectionSlotResponse = VnetInfo & { + /** + * The underlying HTTP response. + */ + _response: msRest.HttpResponse & { + /** + * The response body as text (string format) + */ + bodyAsText: string; + + /** + * The response body as parsed JSON or XML + */ + parsedBody: VnetInfo; + }; +}; + +/** + * Contains response data for the getVnetConnectionGatewaySlot operation. + */ +export type WebAppsGetVnetConnectionGatewaySlotResponse = VnetGateway & { + /** + * The underlying HTTP response. + */ + _response: msRest.HttpResponse & { + /** + * The response body as text (string format) + */ + bodyAsText: string; + + /** + * The response body as parsed JSON or XML + */ + parsedBody: VnetGateway; + }; +}; + +/** + * Contains response data for the createOrUpdateVnetConnectionGatewaySlot operation. + */ +export type WebAppsCreateOrUpdateVnetConnectionGatewaySlotResponse = VnetGateway & { + /** + * The underlying HTTP response. + */ + _response: msRest.HttpResponse & { + /** + * The response body as text (string format) + */ + bodyAsText: string; + + /** + * The response body as parsed JSON or XML + */ + parsedBody: VnetGateway; + }; +}; + +/** + * Contains response data for the updateVnetConnectionGatewaySlot operation. + */ +export type WebAppsUpdateVnetConnectionGatewaySlotResponse = VnetGateway & { + /** + * The underlying HTTP response. + */ + _response: msRest.HttpResponse & { + /** + * The response body as text (string format) + */ + bodyAsText: string; + + /** + * The response body as parsed JSON or XML + */ + parsedBody: VnetGateway; + }; +}; + +/** + * Contains response data for the listWebJobsSlot operation. + */ +export type WebAppsListWebJobsSlotResponse = WebJobCollection & { + /** + * The underlying HTTP response. + */ + _response: msRest.HttpResponse & { + /** + * The response body as text (string format) + */ + bodyAsText: string; + + /** + * The response body as parsed JSON or XML + */ + parsedBody: WebJobCollection; + }; +}; + +/** + * Contains response data for the getWebJobSlot operation. + */ +export type WebAppsGetWebJobSlotResponse = WebJob & { + /** + * The underlying HTTP response. + */ + _response: msRest.HttpResponse & { + /** + * The response body as text (string format) + */ + bodyAsText: string; + + /** + * The response body as parsed JSON or XML + */ + parsedBody: WebJob; + }; +}; + +/** + * Contains response data for the listSlotDifferencesFromProduction operation. + */ +export type WebAppsListSlotDifferencesFromProductionResponse = SlotDifferenceCollection & { + /** + * The underlying HTTP response. + */ + _response: msRest.HttpResponse & { + /** + * The response body as text (string format) + */ + bodyAsText: string; + + /** + * The response body as parsed JSON or XML + */ + parsedBody: SlotDifferenceCollection; + }; +}; + +/** + * Contains response data for the listSnapshots operation. + */ +export type WebAppsListSnapshotsResponse = SnapshotCollection & { + /** + * The underlying HTTP response. + */ + _response: msRest.HttpResponse & { + /** + * The response body as text (string format) + */ + bodyAsText: string; + + /** + * The response body as parsed JSON or XML + */ + parsedBody: SnapshotCollection; + }; +}; + +/** + * Contains response data for the listSnapshotsFromDRSecondary operation. + */ +export type WebAppsListSnapshotsFromDRSecondaryResponse = SnapshotCollection & { + /** + * The underlying HTTP response. + */ + _response: msRest.HttpResponse & { + /** + * The response body as text (string format) + */ + bodyAsText: string; + + /** + * The response body as parsed JSON or XML + */ + parsedBody: SnapshotCollection; + }; +}; + +/** + * Contains response data for the getSourceControl operation. + */ +export type WebAppsGetSourceControlResponse = SiteSourceControl & { + /** + * The underlying HTTP response. + */ + _response: msRest.HttpResponse & { + /** + * The response body as text (string format) + */ + bodyAsText: string; + + /** + * The response body as parsed JSON or XML + */ + parsedBody: SiteSourceControl; + }; +}; + +/** + * Contains response data for the createOrUpdateSourceControl operation. + */ +export type WebAppsCreateOrUpdateSourceControlResponse = SiteSourceControl & { + /** + * The underlying HTTP response. + */ + _response: msRest.HttpResponse & { + /** + * The response body as text (string format) + */ + bodyAsText: string; + + /** + * The response body as parsed JSON or XML + */ + parsedBody: SiteSourceControl; + }; +}; + +/** + * Contains response data for the updateSourceControl operation. + */ +export type WebAppsUpdateSourceControlResponse = SiteSourceControl & { + /** + * The underlying HTTP response. + */ + _response: msRest.HttpResponse & { + /** + * The response body as text (string format) + */ + bodyAsText: string; + + /** + * The response body as parsed JSON or XML + */ + parsedBody: SiteSourceControl; + }; +}; + +/** + * Contains response data for the startNetworkTrace operation. + */ +export type WebAppsStartNetworkTraceResponse = Array & { + /** + * The underlying HTTP response. + */ + _response: msRest.HttpResponse & { + /** + * The response body as text (string format) + */ + bodyAsText: string; + + /** + * The response body as parsed JSON or XML + */ + parsedBody: NetworkTrace[]; + }; +}; + +/** + * Contains response data for the listTriggeredWebJobs operation. + */ +export type WebAppsListTriggeredWebJobsResponse = TriggeredWebJobCollection & { + /** + * The underlying HTTP response. + */ + _response: msRest.HttpResponse & { + /** + * The response body as text (string format) + */ + bodyAsText: string; + + /** + * The response body as parsed JSON or XML + */ + parsedBody: TriggeredWebJobCollection; + }; +}; + +/** + * Contains response data for the getTriggeredWebJob operation. + */ +export type WebAppsGetTriggeredWebJobResponse = TriggeredWebJob & { + /** + * The underlying HTTP response. + */ + _response: msRest.HttpResponse & { + /** + * The response body as text (string format) + */ + bodyAsText: string; + + /** + * The response body as parsed JSON or XML + */ + parsedBody: TriggeredWebJob; + }; +}; + +/** + * Contains response data for the listTriggeredWebJobHistory operation. + */ +export type WebAppsListTriggeredWebJobHistoryResponse = TriggeredJobHistoryCollection & { + /** + * The underlying HTTP response. + */ + _response: msRest.HttpResponse & { + /** + * The response body as text (string format) + */ + bodyAsText: string; + + /** + * The response body as parsed JSON or XML + */ + parsedBody: TriggeredJobHistoryCollection; + }; +}; + +/** + * Contains response data for the getTriggeredWebJobHistory operation. + */ +export type WebAppsGetTriggeredWebJobHistoryResponse = TriggeredJobHistory & { + /** + * The underlying HTTP response. + */ + _response: msRest.HttpResponse & { + /** + * The response body as text (string format) + */ + bodyAsText: string; + + /** + * The response body as parsed JSON or XML + */ + parsedBody: TriggeredJobHistory; + }; +}; + +/** + * Contains response data for the listUsages operation. + */ +export type WebAppsListUsagesResponse = CsmUsageQuotaCollection & { + /** + * The underlying HTTP response. + */ + _response: msRest.HttpResponse & { + /** + * The response body as text (string format) + */ + bodyAsText: string; + + /** + * The response body as parsed JSON or XML + */ + parsedBody: CsmUsageQuotaCollection; + }; +}; + +/** + * Contains response data for the listVnetConnections operation. + */ +export type WebAppsListVnetConnectionsResponse = Array & { + /** + * The underlying HTTP response. + */ + _response: msRest.HttpResponse & { + /** + * The response body as text (string format) + */ + bodyAsText: string; + + /** + * The response body as parsed JSON or XML + */ + parsedBody: VnetInfo[]; + }; +}; + +/** + * Contains response data for the getVnetConnection operation. + */ +export type WebAppsGetVnetConnectionResponse = VnetInfo & { + /** + * The underlying HTTP response. + */ + _response: msRest.HttpResponse & { + /** + * The response body as text (string format) + */ + bodyAsText: string; + + /** + * The response body as parsed JSON or XML + */ + parsedBody: VnetInfo; + }; +}; + +/** + * Contains response data for the createOrUpdateVnetConnection operation. + */ +export type WebAppsCreateOrUpdateVnetConnectionResponse = VnetInfo & { + /** + * The underlying HTTP response. + */ + _response: msRest.HttpResponse & { + /** + * The response body as text (string format) + */ + bodyAsText: string; + + /** + * The response body as parsed JSON or XML + */ + parsedBody: VnetInfo; + }; +}; + +/** + * Contains response data for the updateVnetConnection operation. + */ +export type WebAppsUpdateVnetConnectionResponse = VnetInfo & { + /** + * The underlying HTTP response. + */ + _response: msRest.HttpResponse & { + /** + * The response body as text (string format) + */ + bodyAsText: string; + + /** + * The response body as parsed JSON or XML + */ + parsedBody: VnetInfo; + }; +}; + +/** + * Contains response data for the getVnetConnectionGateway operation. + */ +export type WebAppsGetVnetConnectionGatewayResponse = VnetGateway & { + /** + * The underlying HTTP response. + */ + _response: msRest.HttpResponse & { + /** + * The response body as text (string format) + */ + bodyAsText: string; + + /** + * The response body as parsed JSON or XML + */ + parsedBody: VnetGateway; + }; +}; + +/** + * Contains response data for the createOrUpdateVnetConnectionGateway operation. + */ +export type WebAppsCreateOrUpdateVnetConnectionGatewayResponse = VnetGateway & { + /** + * The underlying HTTP response. + */ + _response: msRest.HttpResponse & { + /** + * The response body as text (string format) + */ + bodyAsText: string; + + /** + * The response body as parsed JSON or XML + */ + parsedBody: VnetGateway; + }; +}; + +/** + * Contains response data for the updateVnetConnectionGateway operation. + */ +export type WebAppsUpdateVnetConnectionGatewayResponse = VnetGateway & { + /** + * The underlying HTTP response. + */ + _response: msRest.HttpResponse & { + /** + * The response body as text (string format) + */ + bodyAsText: string; + + /** + * The response body as parsed JSON or XML + */ + parsedBody: VnetGateway; + }; +}; + +/** + * Contains response data for the listWebJobs operation. + */ +export type WebAppsListWebJobsResponse = WebJobCollection & { + /** + * The underlying HTTP response. + */ + _response: msRest.HttpResponse & { + /** + * The response body as text (string format) + */ + bodyAsText: string; + + /** + * The response body as parsed JSON or XML + */ + parsedBody: WebJobCollection; + }; +}; + +/** + * Contains response data for the getWebJob operation. + */ +export type WebAppsGetWebJobResponse = WebJob & { + /** + * The underlying HTTP response. + */ + _response: msRest.HttpResponse & { + /** + * The response body as text (string format) + */ + bodyAsText: string; + + /** + * The response body as parsed JSON or XML + */ + parsedBody: WebJob; + }; +}; + +/** + * Contains response data for the beginCreateOrUpdate operation. + */ +export type WebAppsBeginCreateOrUpdateResponse = Site & { + /** + * The underlying HTTP response. + */ + _response: msRest.HttpResponse & { + /** + * The response body as text (string format) + */ + bodyAsText: string; + + /** + * The response body as parsed JSON or XML + */ + parsedBody: Site; + }; +}; + +/** + * Contains response data for the beginListPublishingCredentials operation. + */ +export type WebAppsBeginListPublishingCredentialsResponse = User & { + /** + * The underlying HTTP response. + */ + _response: msRest.HttpResponse & { + /** + * The response body as text (string format) + */ + bodyAsText: string; + + /** + * The response body as parsed JSON or XML + */ + parsedBody: User; + }; +}; + +/** + * Contains response data for the beginCreateMSDeployOperation operation. + */ +export type WebAppsBeginCreateMSDeployOperationResponse = MSDeployStatus & { + /** + * The underlying HTTP response. + */ + _response: msRest.HttpResponse & { + /** + * The response body as text (string format) + */ + bodyAsText: string; + + /** + * The response body as parsed JSON or XML + */ + parsedBody: MSDeployStatus; + }; +}; + +/** + * Contains response data for the beginCreateFunction operation. + */ +export type WebAppsBeginCreateFunctionResponse = FunctionEnvelope & { + /** + * The underlying HTTP response. + */ + _response: msRest.HttpResponse & { + /** + * The response body as text (string format) + */ + bodyAsText: string; + + /** + * The response body as parsed JSON or XML + */ + parsedBody: FunctionEnvelope; + }; +}; + +/** + * Contains response data for the beginCreateInstanceMSDeployOperation operation. + */ +export type WebAppsBeginCreateInstanceMSDeployOperationResponse = MSDeployStatus & { + /** + * The underlying HTTP response. + */ + _response: msRest.HttpResponse & { + /** + * The response body as text (string format) + */ + bodyAsText: string; + + /** + * The response body as parsed JSON or XML + */ + parsedBody: MSDeployStatus; + }; +}; + +/** + * Contains response data for the beginMigrateStorage operation. + */ +export type WebAppsBeginMigrateStorageResponse = StorageMigrationResponse & { + /** + * The underlying HTTP response. + */ + _response: msRest.HttpResponse & { + /** + * The response body as text (string format) + */ + bodyAsText: string; + + /** + * The response body as parsed JSON or XML + */ + parsedBody: StorageMigrationResponse; + }; +}; + +/** + * Contains response data for the beginMigrateMySql operation. + */ +export type WebAppsBeginMigrateMySqlResponse = Operation & { + /** + * The underlying HTTP response. + */ + _response: msRest.HttpResponse & { + /** + * The response body as text (string format) + */ + bodyAsText: string; + + /** + * The response body as parsed JSON or XML + */ + parsedBody: Operation; + }; +}; + +/** + * Contains response data for the beginStartWebSiteNetworkTraceOperation operation. + */ +export type WebAppsBeginStartWebSiteNetworkTraceOperationResponse = Array & { + /** + * The underlying HTTP response. + */ + _response: msRest.HttpResponse & { + /** + * The response body as text (string format) + */ + bodyAsText: string; + + /** + * The response body as parsed JSON or XML + */ + parsedBody: NetworkTrace[]; + }; +}; + +/** + * Contains response data for the beginInstallSiteExtension operation. + */ +export type WebAppsBeginInstallSiteExtensionResponse = SiteExtensionInfo & { + /** + * The underlying HTTP response. + */ + _response: msRest.HttpResponse & { + /** + * The response body as text (string format) + */ + bodyAsText: string; + + /** + * The response body as parsed JSON or XML + */ + parsedBody: SiteExtensionInfo; + }; +}; + +/** + * Contains response data for the beginCreateOrUpdateSlot operation. + */ +export type WebAppsBeginCreateOrUpdateSlotResponse = Site & { + /** + * The underlying HTTP response. + */ + _response: msRest.HttpResponse & { + /** + * The response body as text (string format) + */ + bodyAsText: string; + + /** + * The response body as parsed JSON or XML + */ + parsedBody: Site; + }; +}; + +/** + * Contains response data for the beginListPublishingCredentialsSlot operation. + */ +export type WebAppsBeginListPublishingCredentialsSlotResponse = User & { + /** + * The underlying HTTP response. + */ + _response: msRest.HttpResponse & { + /** + * The response body as text (string format) + */ + bodyAsText: string; + + /** + * The response body as parsed JSON or XML + */ + parsedBody: User; + }; +}; + +/** + * Contains response data for the beginCreateMSDeployOperationSlot operation. + */ +export type WebAppsBeginCreateMSDeployOperationSlotResponse = MSDeployStatus & { + /** + * The underlying HTTP response. + */ + _response: msRest.HttpResponse & { + /** + * The response body as text (string format) + */ + bodyAsText: string; + + /** + * The response body as parsed JSON or XML + */ + parsedBody: MSDeployStatus; + }; +}; + +/** + * Contains response data for the beginCreateInstanceFunctionSlot operation. + */ +export type WebAppsBeginCreateInstanceFunctionSlotResponse = FunctionEnvelope & { + /** + * The underlying HTTP response. + */ + _response: msRest.HttpResponse & { + /** + * The response body as text (string format) + */ + bodyAsText: string; + + /** + * The response body as parsed JSON or XML + */ + parsedBody: FunctionEnvelope; + }; +}; + +/** + * Contains response data for the beginCreateInstanceMSDeployOperationSlot operation. + */ +export type WebAppsBeginCreateInstanceMSDeployOperationSlotResponse = MSDeployStatus & { + /** + * The underlying HTTP response. + */ + _response: msRest.HttpResponse & { + /** + * The response body as text (string format) + */ + bodyAsText: string; + + /** + * The response body as parsed JSON or XML + */ + parsedBody: MSDeployStatus; + }; +}; + +/** + * Contains response data for the beginStartWebSiteNetworkTraceOperationSlot operation. + */ +export type WebAppsBeginStartWebSiteNetworkTraceOperationSlotResponse = Array & { + /** + * The underlying HTTP response. + */ + _response: msRest.HttpResponse & { + /** + * The response body as text (string format) + */ + bodyAsText: string; + + /** + * The response body as parsed JSON or XML + */ + parsedBody: NetworkTrace[]; + }; +}; + +/** + * Contains response data for the beginInstallSiteExtensionSlot operation. + */ +export type WebAppsBeginInstallSiteExtensionSlotResponse = SiteExtensionInfo & { + /** + * The underlying HTTP response. + */ + _response: msRest.HttpResponse & { + /** + * The response body as text (string format) + */ + bodyAsText: string; + + /** + * The response body as parsed JSON or XML + */ + parsedBody: SiteExtensionInfo; + }; +}; + +/** + * Contains response data for the beginCreateOrUpdateSourceControlSlot operation. + */ +export type WebAppsBeginCreateOrUpdateSourceControlSlotResponse = SiteSourceControl & { + /** + * The underlying HTTP response. + */ + _response: msRest.HttpResponse & { + /** + * The response body as text (string format) + */ + bodyAsText: string; + + /** + * The response body as parsed JSON or XML + */ + parsedBody: SiteSourceControl; + }; +}; + +/** + * Contains response data for the beginStartNetworkTraceSlot operation. + */ +export type WebAppsBeginStartNetworkTraceSlotResponse = Array & { + /** + * The underlying HTTP response. + */ + _response: msRest.HttpResponse & { + /** + * The response body as text (string format) + */ + bodyAsText: string; + + /** + * The response body as parsed JSON or XML + */ + parsedBody: NetworkTrace[]; + }; +}; + +/** + * Contains response data for the beginCreateOrUpdateSourceControl operation. + */ +export type WebAppsBeginCreateOrUpdateSourceControlResponse = SiteSourceControl & { + /** + * The underlying HTTP response. + */ + _response: msRest.HttpResponse & { + /** + * The response body as text (string format) + */ + bodyAsText: string; + + /** + * The response body as parsed JSON or XML + */ + parsedBody: SiteSourceControl; + }; +}; + +/** + * Contains response data for the beginStartNetworkTrace operation. + */ +export type WebAppsBeginStartNetworkTraceResponse = Array & { + /** + * The underlying HTTP response. + */ + _response: msRest.HttpResponse & { + /** + * The response body as text (string format) + */ + bodyAsText: string; + + /** + * The response body as parsed JSON or XML + */ + parsedBody: NetworkTrace[]; + }; +}; + +/** + * Contains response data for the listNext operation. + */ +export type WebAppsListNextResponse = WebAppCollection & { + /** + * The underlying HTTP response. + */ + _response: msRest.HttpResponse & { + /** + * The response body as text (string format) + */ + bodyAsText: string; + + /** + * The response body as parsed JSON or XML + */ + parsedBody: WebAppCollection; + }; +}; + +/** + * Contains response data for the listByResourceGroupNext operation. + */ +export type WebAppsListByResourceGroupNextResponse = WebAppCollection & { + /** + * The underlying HTTP response. + */ + _response: msRest.HttpResponse & { + /** + * The response body as text (string format) + */ + bodyAsText: string; + + /** + * The response body as parsed JSON or XML + */ + parsedBody: WebAppCollection; + }; +}; + +/** + * Contains response data for the listBackupsNext operation. + */ +export type WebAppsListBackupsNextResponse = BackupItemCollection & { + /** + * The underlying HTTP response. + */ + _response: msRest.HttpResponse & { + /** + * The response body as text (string format) + */ + bodyAsText: string; + + /** + * The response body as parsed JSON or XML + */ + parsedBody: BackupItemCollection; + }; +}; + +/** + * Contains response data for the listConfigurationsNext operation. + */ +export type WebAppsListConfigurationsNextResponse = SiteConfigResourceCollection & { + /** + * The underlying HTTP response. + */ + _response: msRest.HttpResponse & { + /** + * The response body as text (string format) + */ + bodyAsText: string; + + /** + * The response body as parsed JSON or XML + */ + parsedBody: SiteConfigResourceCollection; + }; +}; + +/** + * Contains response data for the listConfigurationSnapshotInfoNext operation. + */ +export type WebAppsListConfigurationSnapshotInfoNextResponse = SiteConfigurationSnapshotInfoCollection & { + /** + * The underlying HTTP response. + */ + _response: msRest.HttpResponse & { + /** + * The response body as text (string format) + */ + bodyAsText: string; + + /** + * The response body as parsed JSON or XML + */ + parsedBody: SiteConfigurationSnapshotInfoCollection; + }; +}; + +/** + * Contains response data for the listContinuousWebJobsNext operation. + */ +export type WebAppsListContinuousWebJobsNextResponse = ContinuousWebJobCollection & { + /** + * The underlying HTTP response. + */ + _response: msRest.HttpResponse & { + /** + * The response body as text (string format) + */ + bodyAsText: string; + + /** + * The response body as parsed JSON or XML + */ + parsedBody: ContinuousWebJobCollection; + }; +}; + +/** + * Contains response data for the listDeploymentsNext operation. + */ +export type WebAppsListDeploymentsNextResponse = DeploymentCollection & { + /** + * The underlying HTTP response. + */ + _response: msRest.HttpResponse & { + /** + * The response body as text (string format) + */ + bodyAsText: string; + + /** + * The response body as parsed JSON or XML + */ + parsedBody: DeploymentCollection; + }; +}; + +/** + * Contains response data for the listDomainOwnershipIdentifiersNext operation. + */ +export type WebAppsListDomainOwnershipIdentifiersNextResponse = IdentifierCollection & { + /** + * The underlying HTTP response. + */ + _response: msRest.HttpResponse & { + /** + * The response body as text (string format) + */ + bodyAsText: string; + + /** + * The response body as parsed JSON or XML + */ + parsedBody: IdentifierCollection; + }; +}; + +/** + * Contains response data for the listFunctionsNext operation. + */ +export type WebAppsListFunctionsNextResponse = FunctionEnvelopeCollection & { + /** + * The underlying HTTP response. + */ + _response: msRest.HttpResponse & { + /** + * The response body as text (string format) + */ + bodyAsText: string; + + /** + * The response body as parsed JSON or XML + */ + parsedBody: FunctionEnvelopeCollection; + }; +}; + +/** + * Contains response data for the listHostNameBindingsNext operation. + */ +export type WebAppsListHostNameBindingsNextResponse = HostNameBindingCollection & { + /** + * The underlying HTTP response. + */ + _response: msRest.HttpResponse & { + /** + * The response body as text (string format) + */ + bodyAsText: string; + + /** + * The response body as parsed JSON or XML + */ + parsedBody: HostNameBindingCollection; + }; +}; + +/** + * Contains response data for the listInstanceIdentifiersNext operation. + */ +export type WebAppsListInstanceIdentifiersNextResponse = WebAppInstanceCollection & { + /** + * The underlying HTTP response. + */ + _response: msRest.HttpResponse & { + /** + * The response body as text (string format) + */ + bodyAsText: string; + + /** + * The response body as parsed JSON or XML + */ + parsedBody: WebAppInstanceCollection; + }; +}; + +/** + * Contains response data for the listInstanceProcessesNext operation. + */ +export type WebAppsListInstanceProcessesNextResponse = ProcessInfoCollection & { + /** + * The underlying HTTP response. + */ + _response: msRest.HttpResponse & { + /** + * The response body as text (string format) + */ + bodyAsText: string; + + /** + * The response body as parsed JSON or XML + */ + parsedBody: ProcessInfoCollection; + }; +}; + +/** + * Contains response data for the listInstanceProcessModulesNext operation. + */ +export type WebAppsListInstanceProcessModulesNextResponse = ProcessModuleInfoCollection & { + /** + * The underlying HTTP response. + */ + _response: msRest.HttpResponse & { + /** + * The response body as text (string format) + */ + bodyAsText: string; + + /** + * The response body as parsed JSON or XML + */ + parsedBody: ProcessModuleInfoCollection; + }; +}; + +/** + * Contains response data for the listInstanceProcessThreadsNext operation. + */ +export type WebAppsListInstanceProcessThreadsNextResponse = ProcessThreadInfoCollection & { + /** + * The underlying HTTP response. + */ + _response: msRest.HttpResponse & { + /** + * The response body as text (string format) + */ + bodyAsText: string; + + /** + * The response body as parsed JSON or XML + */ + parsedBody: ProcessThreadInfoCollection; + }; +}; + +/** + * Contains response data for the listMetricDefinitionsNext operation. + */ +export type WebAppsListMetricDefinitionsNextResponse = ResourceMetricDefinitionCollection & { + /** + * The underlying HTTP response. + */ + _response: msRest.HttpResponse & { + /** + * The response body as text (string format) + */ + bodyAsText: string; + + /** + * The response body as parsed JSON or XML + */ + parsedBody: ResourceMetricDefinitionCollection; + }; +}; + +/** + * Contains response data for the listMetricsNext operation. + */ +export type WebAppsListMetricsNextResponse = ResourceMetricCollection & { + /** + * The underlying HTTP response. + */ + _response: msRest.HttpResponse & { + /** + * The response body as text (string format) + */ + bodyAsText: string; + + /** + * The response body as parsed JSON or XML + */ + parsedBody: ResourceMetricCollection; + }; +}; + +/** + * Contains response data for the listPerfMonCountersNext operation. + */ +export type WebAppsListPerfMonCountersNextResponse = PerfMonCounterCollection & { + /** + * The underlying HTTP response. + */ + _response: msRest.HttpResponse & { + /** + * The response body as text (string format) + */ + bodyAsText: string; + + /** + * The response body as parsed JSON or XML + */ + parsedBody: PerfMonCounterCollection; + }; +}; + +/** + * Contains response data for the listProcessesNext operation. + */ +export type WebAppsListProcessesNextResponse = ProcessInfoCollection & { + /** + * The underlying HTTP response. + */ + _response: msRest.HttpResponse & { + /** + * The response body as text (string format) + */ + bodyAsText: string; + + /** + * The response body as parsed JSON or XML + */ + parsedBody: ProcessInfoCollection; + }; +}; + +/** + * Contains response data for the listProcessModulesNext operation. + */ +export type WebAppsListProcessModulesNextResponse = ProcessModuleInfoCollection & { + /** + * The underlying HTTP response. + */ + _response: msRest.HttpResponse & { + /** + * The response body as text (string format) + */ + bodyAsText: string; + + /** + * The response body as parsed JSON or XML + */ + parsedBody: ProcessModuleInfoCollection; + }; +}; + +/** + * Contains response data for the listProcessThreadsNext operation. + */ +export type WebAppsListProcessThreadsNextResponse = ProcessThreadInfoCollection & { + /** + * The underlying HTTP response. + */ + _response: msRest.HttpResponse & { + /** + * The response body as text (string format) + */ + bodyAsText: string; + + /** + * The response body as parsed JSON or XML + */ + parsedBody: ProcessThreadInfoCollection; + }; +}; + +/** + * Contains response data for the listPublicCertificatesNext operation. + */ +export type WebAppsListPublicCertificatesNextResponse = PublicCertificateCollection & { + /** + * The underlying HTTP response. + */ + _response: msRest.HttpResponse & { + /** + * The response body as text (string format) + */ + bodyAsText: string; + + /** + * The response body as parsed JSON or XML + */ + parsedBody: PublicCertificateCollection; + }; +}; + +/** + * Contains response data for the listSiteExtensionsNext operation. + */ +export type WebAppsListSiteExtensionsNextResponse = SiteExtensionInfoCollection & { + /** + * The underlying HTTP response. + */ + _response: msRest.HttpResponse & { + /** + * The response body as text (string format) + */ + bodyAsText: string; + + /** + * The response body as parsed JSON or XML + */ + parsedBody: SiteExtensionInfoCollection; + }; +}; + +/** + * Contains response data for the listSlotsNext operation. + */ +export type WebAppsListSlotsNextResponse = WebAppCollection & { + /** + * The underlying HTTP response. + */ + _response: msRest.HttpResponse & { + /** + * The response body as text (string format) + */ + bodyAsText: string; + + /** + * The response body as parsed JSON or XML + */ + parsedBody: WebAppCollection; + }; +}; + +/** + * Contains response data for the listBackupsSlotNext operation. + */ +export type WebAppsListBackupsSlotNextResponse = BackupItemCollection & { + /** + * The underlying HTTP response. + */ + _response: msRest.HttpResponse & { + /** + * The response body as text (string format) + */ + bodyAsText: string; + + /** + * The response body as parsed JSON or XML + */ + parsedBody: BackupItemCollection; + }; +}; + +/** + * Contains response data for the listConfigurationsSlotNext operation. + */ +export type WebAppsListConfigurationsSlotNextResponse = SiteConfigResourceCollection & { + /** + * The underlying HTTP response. + */ + _response: msRest.HttpResponse & { + /** + * The response body as text (string format) + */ + bodyAsText: string; + + /** + * The response body as parsed JSON or XML + */ + parsedBody: SiteConfigResourceCollection; + }; +}; + +/** + * Contains response data for the listConfigurationSnapshotInfoSlotNext operation. + */ +export type WebAppsListConfigurationSnapshotInfoSlotNextResponse = SiteConfigurationSnapshotInfoCollection & { + /** + * The underlying HTTP response. + */ + _response: msRest.HttpResponse & { + /** + * The response body as text (string format) + */ + bodyAsText: string; + + /** + * The response body as parsed JSON or XML + */ + parsedBody: SiteConfigurationSnapshotInfoCollection; + }; +}; + +/** + * Contains response data for the listContinuousWebJobsSlotNext operation. + */ +export type WebAppsListContinuousWebJobsSlotNextResponse = ContinuousWebJobCollection & { + /** + * The underlying HTTP response. + */ + _response: msRest.HttpResponse & { + /** + * The response body as text (string format) + */ + bodyAsText: string; + + /** + * The response body as parsed JSON or XML + */ + parsedBody: ContinuousWebJobCollection; + }; +}; + +/** + * Contains response data for the listDeploymentsSlotNext operation. + */ +export type WebAppsListDeploymentsSlotNextResponse = DeploymentCollection & { + /** + * The underlying HTTP response. + */ + _response: msRest.HttpResponse & { + /** + * The response body as text (string format) + */ + bodyAsText: string; + + /** + * The response body as parsed JSON or XML + */ + parsedBody: DeploymentCollection; + }; +}; + +/** + * Contains response data for the listDomainOwnershipIdentifiersSlotNext operation. + */ +export type WebAppsListDomainOwnershipIdentifiersSlotNextResponse = IdentifierCollection & { + /** + * The underlying HTTP response. + */ + _response: msRest.HttpResponse & { + /** + * The response body as text (string format) + */ + bodyAsText: string; + + /** + * The response body as parsed JSON or XML + */ + parsedBody: IdentifierCollection; + }; +}; + +/** + * Contains response data for the listInstanceFunctionsSlotNext operation. + */ +export type WebAppsListInstanceFunctionsSlotNextResponse = FunctionEnvelopeCollection & { + /** + * The underlying HTTP response. + */ + _response: msRest.HttpResponse & { + /** + * The response body as text (string format) + */ + bodyAsText: string; + + /** + * The response body as parsed JSON or XML + */ + parsedBody: FunctionEnvelopeCollection; + }; +}; + +/** + * Contains response data for the listHostNameBindingsSlotNext operation. + */ +export type WebAppsListHostNameBindingsSlotNextResponse = HostNameBindingCollection & { + /** + * The underlying HTTP response. + */ + _response: msRest.HttpResponse & { + /** + * The response body as text (string format) + */ + bodyAsText: string; + + /** + * The response body as parsed JSON or XML + */ + parsedBody: HostNameBindingCollection; + }; +}; + +/** + * Contains response data for the listInstanceIdentifiersSlotNext operation. + */ +export type WebAppsListInstanceIdentifiersSlotNextResponse = WebAppInstanceCollection & { + /** + * The underlying HTTP response. + */ + _response: msRest.HttpResponse & { + /** + * The response body as text (string format) + */ + bodyAsText: string; + + /** + * The response body as parsed JSON or XML + */ + parsedBody: WebAppInstanceCollection; + }; +}; + +/** + * Contains response data for the listInstanceProcessesSlotNext operation. + */ +export type WebAppsListInstanceProcessesSlotNextResponse = ProcessInfoCollection & { + /** + * The underlying HTTP response. + */ + _response: msRest.HttpResponse & { + /** + * The response body as text (string format) + */ + bodyAsText: string; + + /** + * The response body as parsed JSON or XML + */ + parsedBody: ProcessInfoCollection; + }; +}; + +/** + * Contains response data for the listInstanceProcessModulesSlotNext operation. + */ +export type WebAppsListInstanceProcessModulesSlotNextResponse = ProcessModuleInfoCollection & { + /** + * The underlying HTTP response. + */ + _response: msRest.HttpResponse & { + /** + * The response body as text (string format) + */ + bodyAsText: string; + + /** + * The response body as parsed JSON or XML + */ + parsedBody: ProcessModuleInfoCollection; + }; +}; + +/** + * Contains response data for the listInstanceProcessThreadsSlotNext operation. + */ +export type WebAppsListInstanceProcessThreadsSlotNextResponse = ProcessThreadInfoCollection & { + /** + * The underlying HTTP response. + */ + _response: msRest.HttpResponse & { + /** + * The response body as text (string format) + */ + bodyAsText: string; + + /** + * The response body as parsed JSON or XML + */ + parsedBody: ProcessThreadInfoCollection; + }; +}; + +/** + * Contains response data for the listMetricDefinitionsSlotNext operation. + */ +export type WebAppsListMetricDefinitionsSlotNextResponse = ResourceMetricDefinitionCollection & { + /** + * The underlying HTTP response. + */ + _response: msRest.HttpResponse & { + /** + * The response body as text (string format) + */ + bodyAsText: string; + + /** + * The response body as parsed JSON or XML + */ + parsedBody: ResourceMetricDefinitionCollection; + }; +}; + +/** + * Contains response data for the listMetricsSlotNext operation. + */ +export type WebAppsListMetricsSlotNextResponse = ResourceMetricCollection & { + /** + * The underlying HTTP response. + */ + _response: msRest.HttpResponse & { + /** + * The response body as text (string format) + */ + bodyAsText: string; + + /** + * The response body as parsed JSON or XML + */ + parsedBody: ResourceMetricCollection; + }; +}; + +/** + * Contains response data for the listPerfMonCountersSlotNext operation. + */ +export type WebAppsListPerfMonCountersSlotNextResponse = PerfMonCounterCollection & { + /** + * The underlying HTTP response. + */ + _response: msRest.HttpResponse & { + /** + * The response body as text (string format) + */ + bodyAsText: string; + + /** + * The response body as parsed JSON or XML + */ + parsedBody: PerfMonCounterCollection; + }; +}; + +/** + * Contains response data for the listProcessesSlotNext operation. + */ +export type WebAppsListProcessesSlotNextResponse = ProcessInfoCollection & { + /** + * The underlying HTTP response. + */ + _response: msRest.HttpResponse & { + /** + * The response body as text (string format) + */ + bodyAsText: string; + + /** + * The response body as parsed JSON or XML + */ + parsedBody: ProcessInfoCollection; + }; +}; + +/** + * Contains response data for the listProcessModulesSlotNext operation. + */ +export type WebAppsListProcessModulesSlotNextResponse = ProcessModuleInfoCollection & { + /** + * The underlying HTTP response. + */ + _response: msRest.HttpResponse & { + /** + * The response body as text (string format) + */ + bodyAsText: string; + + /** + * The response body as parsed JSON or XML + */ + parsedBody: ProcessModuleInfoCollection; + }; +}; + +/** + * Contains response data for the listProcessThreadsSlotNext operation. + */ +export type WebAppsListProcessThreadsSlotNextResponse = ProcessThreadInfoCollection & { + /** + * The underlying HTTP response. + */ + _response: msRest.HttpResponse & { + /** + * The response body as text (string format) + */ + bodyAsText: string; + + /** + * The response body as parsed JSON or XML + */ + parsedBody: ProcessThreadInfoCollection; + }; +}; + +/** + * Contains response data for the listPublicCertificatesSlotNext operation. + */ +export type WebAppsListPublicCertificatesSlotNextResponse = PublicCertificateCollection & { + /** + * The underlying HTTP response. + */ + _response: msRest.HttpResponse & { + /** + * The response body as text (string format) + */ + bodyAsText: string; + + /** + * The response body as parsed JSON or XML + */ + parsedBody: PublicCertificateCollection; + }; +}; + +/** + * Contains response data for the listSiteExtensionsSlotNext operation. + */ +export type WebAppsListSiteExtensionsSlotNextResponse = SiteExtensionInfoCollection & { + /** + * The underlying HTTP response. + */ + _response: msRest.HttpResponse & { + /** + * The response body as text (string format) + */ + bodyAsText: string; + + /** + * The response body as parsed JSON or XML + */ + parsedBody: SiteExtensionInfoCollection; + }; +}; + +/** + * Contains response data for the listSlotDifferencesSlotNext operation. + */ +export type WebAppsListSlotDifferencesSlotNextResponse = SlotDifferenceCollection & { + /** + * The underlying HTTP response. + */ + _response: msRest.HttpResponse & { + /** + * The response body as text (string format) + */ + bodyAsText: string; + + /** + * The response body as parsed JSON or XML + */ + parsedBody: SlotDifferenceCollection; + }; +}; + +/** + * Contains response data for the listSnapshotsSlotNext operation. + */ +export type WebAppsListSnapshotsSlotNextResponse = SnapshotCollection & { + /** + * The underlying HTTP response. + */ + _response: msRest.HttpResponse & { + /** + * The response body as text (string format) + */ + bodyAsText: string; + + /** + * The response body as parsed JSON or XML + */ + parsedBody: SnapshotCollection; + }; +}; + +/** + * Contains response data for the listSnapshotsFromDRSecondarySlotNext operation. + */ +export type WebAppsListSnapshotsFromDRSecondarySlotNextResponse = SnapshotCollection & { + /** + * The underlying HTTP response. + */ + _response: msRest.HttpResponse & { + /** + * The response body as text (string format) + */ + bodyAsText: string; + + /** + * The response body as parsed JSON or XML + */ + parsedBody: SnapshotCollection; + }; +}; + +/** + * Contains response data for the listTriggeredWebJobsSlotNext operation. + */ +export type WebAppsListTriggeredWebJobsSlotNextResponse = TriggeredWebJobCollection & { + /** + * The underlying HTTP response. + */ + _response: msRest.HttpResponse & { + /** + * The response body as text (string format) + */ + bodyAsText: string; + + /** + * The response body as parsed JSON or XML + */ + parsedBody: TriggeredWebJobCollection; + }; +}; + +/** + * Contains response data for the listTriggeredWebJobHistorySlotNext operation. + */ +export type WebAppsListTriggeredWebJobHistorySlotNextResponse = TriggeredJobHistoryCollection & { + /** + * The underlying HTTP response. + */ + _response: msRest.HttpResponse & { + /** + * The response body as text (string format) + */ + bodyAsText: string; + + /** + * The response body as parsed JSON or XML + */ + parsedBody: TriggeredJobHistoryCollection; + }; +}; + +/** + * Contains response data for the listUsagesSlotNext operation. + */ +export type WebAppsListUsagesSlotNextResponse = CsmUsageQuotaCollection & { + /** + * The underlying HTTP response. + */ + _response: msRest.HttpResponse & { + /** + * The response body as text (string format) + */ + bodyAsText: string; + + /** + * The response body as parsed JSON or XML + */ + parsedBody: CsmUsageQuotaCollection; + }; +}; + +/** + * Contains response data for the listWebJobsSlotNext operation. + */ +export type WebAppsListWebJobsSlotNextResponse = WebJobCollection & { + /** + * The underlying HTTP response. + */ + _response: msRest.HttpResponse & { + /** + * The response body as text (string format) + */ + bodyAsText: string; + + /** + * The response body as parsed JSON or XML + */ + parsedBody: WebJobCollection; + }; +}; + +/** + * Contains response data for the listSlotDifferencesFromProductionNext operation. + */ +export type WebAppsListSlotDifferencesFromProductionNextResponse = SlotDifferenceCollection & { + /** + * The underlying HTTP response. + */ + _response: msRest.HttpResponse & { + /** + * The response body as text (string format) + */ + bodyAsText: string; + + /** + * The response body as parsed JSON or XML + */ + parsedBody: SlotDifferenceCollection; + }; +}; + +/** + * Contains response data for the listSnapshotsNext operation. + */ +export type WebAppsListSnapshotsNextResponse = SnapshotCollection & { + /** + * The underlying HTTP response. + */ + _response: msRest.HttpResponse & { + /** + * The response body as text (string format) + */ + bodyAsText: string; + + /** + * The response body as parsed JSON or XML + */ + parsedBody: SnapshotCollection; + }; +}; + +/** + * Contains response data for the listSnapshotsFromDRSecondaryNext operation. + */ +export type WebAppsListSnapshotsFromDRSecondaryNextResponse = SnapshotCollection & { + /** + * The underlying HTTP response. + */ + _response: msRest.HttpResponse & { + /** + * The response body as text (string format) + */ + bodyAsText: string; + + /** + * The response body as parsed JSON or XML + */ + parsedBody: SnapshotCollection; + }; +}; + +/** + * Contains response data for the listTriggeredWebJobsNext operation. + */ +export type WebAppsListTriggeredWebJobsNextResponse = TriggeredWebJobCollection & { + /** + * The underlying HTTP response. + */ + _response: msRest.HttpResponse & { + /** + * The response body as text (string format) + */ + bodyAsText: string; + + /** + * The response body as parsed JSON or XML + */ + parsedBody: TriggeredWebJobCollection; + }; +}; + +/** + * Contains response data for the listTriggeredWebJobHistoryNext operation. + */ +export type WebAppsListTriggeredWebJobHistoryNextResponse = TriggeredJobHistoryCollection & { + /** + * The underlying HTTP response. + */ + _response: msRest.HttpResponse & { + /** + * The response body as text (string format) + */ + bodyAsText: string; + + /** + * The response body as parsed JSON or XML + */ + parsedBody: TriggeredJobHistoryCollection; + }; +}; + +/** + * Contains response data for the listUsagesNext operation. + */ +export type WebAppsListUsagesNextResponse = CsmUsageQuotaCollection & { + /** + * The underlying HTTP response. + */ + _response: msRest.HttpResponse & { + /** + * The response body as text (string format) + */ + bodyAsText: string; + + /** + * The response body as parsed JSON or XML + */ + parsedBody: CsmUsageQuotaCollection; + }; +}; + +/** + * Contains response data for the listWebJobsNext operation. + */ +export type WebAppsListWebJobsNextResponse = WebJobCollection & { + /** + * The underlying HTTP response. + */ + _response: msRest.HttpResponse & { + /** + * The response body as text (string format) + */ + bodyAsText: string; + + /** + * The response body as parsed JSON or XML + */ + parsedBody: WebJobCollection; + }; +}; + +/** + * Contains response data for the getPublishingUser operation. + */ +export type GetPublishingUserResponse = User & { + /** + * The underlying HTTP response. + */ + _response: msRest.HttpResponse & { + /** + * The response body as text (string format) + */ + bodyAsText: string; + + /** + * The response body as parsed JSON or XML + */ + parsedBody: User; + }; +}; + +/** + * Contains response data for the updatePublishingUser operation. + */ +export type UpdatePublishingUserResponse = User & { + /** + * The underlying HTTP response. + */ + _response: msRest.HttpResponse & { + /** + * The response body as text (string format) + */ + bodyAsText: string; + + /** + * The response body as parsed JSON or XML + */ + parsedBody: User; + }; +}; + +/** + * Contains response data for the listSourceControls operation. + */ +export type ListSourceControlsResponse = SourceControlCollection & { + /** + * The underlying HTTP response. + */ + _response: msRest.HttpResponse & { + /** + * The response body as text (string format) + */ + bodyAsText: string; + + /** + * The response body as parsed JSON or XML + */ + parsedBody: SourceControlCollection; + }; +}; + +/** + * Contains response data for the getSourceControl operation. + */ +export type GetSourceControlResponse = SourceControl & { + /** + * The underlying HTTP response. + */ + _response: msRest.HttpResponse & { + /** + * The response body as text (string format) + */ + bodyAsText: string; + + /** + * The response body as parsed JSON or XML + */ + parsedBody: SourceControl; + }; +}; + +/** + * Contains response data for the updateSourceControl operation. + */ +export type UpdateSourceControlResponse = SourceControl & { + /** + * The underlying HTTP response. + */ + _response: msRest.HttpResponse & { + /** + * The response body as text (string format) + */ + bodyAsText: string; + + /** + * The response body as parsed JSON or XML + */ + parsedBody: SourceControl; + }; +}; + +/** + * Contains response data for the listBillingMeters operation. + */ +export type ListBillingMetersResponse = BillingMeterCollection & { + /** + * The underlying HTTP response. + */ + _response: msRest.HttpResponse & { + /** + * The response body as text (string format) + */ + bodyAsText: string; + + /** + * The response body as parsed JSON or XML + */ + parsedBody: BillingMeterCollection; + }; +}; + +/** + * Contains response data for the checkNameAvailability operation. + */ +export type CheckNameAvailabilityResponse = ResourceNameAvailability & { + /** + * The underlying HTTP response. + */ + _response: msRest.HttpResponse & { + /** + * The response body as text (string format) + */ + bodyAsText: string; + + /** + * The response body as parsed JSON or XML + */ + parsedBody: ResourceNameAvailability; + }; +}; + +/** + * Contains response data for the getSubscriptionDeploymentLocations operation. + */ +export type GetSubscriptionDeploymentLocationsResponse = DeploymentLocations & { + /** + * The underlying HTTP response. + */ + _response: msRest.HttpResponse & { + /** + * The response body as text (string format) + */ + bodyAsText: string; + + /** + * The response body as parsed JSON or XML + */ + parsedBody: DeploymentLocations; + }; +}; + +/** + * Contains response data for the listGeoRegions operation. + */ +export type ListGeoRegionsResponse = GeoRegionCollection & { + /** + * The underlying HTTP response. + */ + _response: msRest.HttpResponse & { + /** + * The response body as text (string format) + */ + bodyAsText: string; + + /** + * The response body as parsed JSON or XML + */ + parsedBody: GeoRegionCollection; + }; +}; + +/** + * Contains response data for the listSiteIdentifiersAssignedToHostName operation. + */ +export type ListSiteIdentifiersAssignedToHostNameResponse = IdentifierCollection & { + /** + * The underlying HTTP response. + */ + _response: msRest.HttpResponse & { + /** + * The response body as text (string format) + */ + bodyAsText: string; + + /** + * The response body as parsed JSON or XML + */ + parsedBody: IdentifierCollection; + }; +}; + +/** + * Contains response data for the listPremierAddOnOffers operation. + */ +export type ListPremierAddOnOffersResponse = PremierAddOnOfferCollection & { + /** + * The underlying HTTP response. + */ + _response: msRest.HttpResponse & { + /** + * The response body as text (string format) + */ + bodyAsText: string; + + /** + * The response body as parsed JSON or XML + */ + parsedBody: PremierAddOnOfferCollection; + }; +}; + +/** + * Contains response data for the listSkus operation. + */ +export type ListSkusResponse = SkuInfos & { + /** + * The underlying HTTP response. + */ + _response: msRest.HttpResponse & { + /** + * The response body as text (string format) + */ + bodyAsText: string; + + /** + * The response body as parsed JSON or XML + */ + parsedBody: SkuInfos; + }; +}; + +/** + * Contains response data for the verifyHostingEnvironmentVnet operation. + */ +export type VerifyHostingEnvironmentVnetResponse = VnetValidationFailureDetails & { + /** + * The underlying HTTP response. + */ + _response: msRest.HttpResponse & { + /** + * The response body as text (string format) + */ + bodyAsText: string; + + /** + * The response body as parsed JSON or XML + */ + parsedBody: VnetValidationFailureDetails; + }; +}; + +/** + * Contains response data for the validate operation. + */ +export type ValidateResponse2 = ValidateResponse & { + /** + * The underlying HTTP response. + */ + _response: msRest.HttpResponse & { + /** + * The response body as text (string format) + */ + bodyAsText: string; + + /** + * The response body as parsed JSON or XML + */ + parsedBody: ValidateResponse; + }; +}; + +/** + * Contains response data for the validateContainerSettings operation. + */ +export type ValidateContainerSettingsResponse = { + /** + * The parsed response body. + */ + body: any; + + /** + * The underlying HTTP response. + */ + _response: msRest.HttpResponse & { + /** + * The response body as text (string format) + */ + bodyAsText: string; + + /** + * The response body as parsed JSON or XML + */ + parsedBody: any; + }; +}; + +/** + * Contains response data for the listSourceControlsNext operation. + */ +export type ListSourceControlsNextResponse = SourceControlCollection & { + /** + * The underlying HTTP response. + */ + _response: msRest.HttpResponse & { + /** + * The response body as text (string format) + */ + bodyAsText: string; + + /** + * The response body as parsed JSON or XML + */ + parsedBody: SourceControlCollection; + }; +}; + +/** + * Contains response data for the listBillingMetersNext operation. + */ +export type ListBillingMetersNextResponse = BillingMeterCollection & { + /** + * The underlying HTTP response. + */ + _response: msRest.HttpResponse & { + /** + * The response body as text (string format) + */ + bodyAsText: string; + + /** + * The response body as parsed JSON or XML + */ + parsedBody: BillingMeterCollection; + }; +}; + +/** + * Contains response data for the listGeoRegionsNext operation. + */ +export type ListGeoRegionsNextResponse = GeoRegionCollection & { + /** + * The underlying HTTP response. + */ + _response: msRest.HttpResponse & { + /** + * The response body as text (string format) + */ + bodyAsText: string; + + /** + * The response body as parsed JSON or XML + */ + parsedBody: GeoRegionCollection; + }; +}; + +/** + * Contains response data for the listSiteIdentifiersAssignedToHostNameNext operation. + */ +export type ListSiteIdentifiersAssignedToHostNameNextResponse = IdentifierCollection & { + /** + * The underlying HTTP response. + */ + _response: msRest.HttpResponse & { + /** + * The response body as text (string format) + */ + bodyAsText: string; + + /** + * The response body as parsed JSON or XML + */ + parsedBody: IdentifierCollection; + }; +}; + +/** + * Contains response data for the listPremierAddOnOffersNext operation. + */ +export type ListPremierAddOnOffersNextResponse = PremierAddOnOfferCollection & { + /** + * The underlying HTTP response. + */ + _response: msRest.HttpResponse & { + /** + * The response body as text (string format) + */ + bodyAsText: string; + + /** + * The response body as parsed JSON or XML + */ + parsedBody: PremierAddOnOfferCollection; + }; +}; + +/** + * Contains response data for the list operation. + */ +export type AppServicePlansListResponse = AppServicePlanCollection & { + /** + * The underlying HTTP response. + */ + _response: msRest.HttpResponse & { + /** + * The response body as text (string format) + */ + bodyAsText: string; + + /** + * The response body as parsed JSON or XML + */ + parsedBody: AppServicePlanCollection; + }; +}; + +/** + * Contains response data for the listByResourceGroup operation. + */ +export type AppServicePlansListByResourceGroupResponse = AppServicePlanCollection & { + /** + * The underlying HTTP response. + */ + _response: msRest.HttpResponse & { + /** + * The response body as text (string format) + */ + bodyAsText: string; + + /** + * The response body as parsed JSON or XML + */ + parsedBody: AppServicePlanCollection; + }; +}; + +/** + * Contains response data for the get operation. + */ +export type AppServicePlansGetResponse = AppServicePlan & { + /** + * The underlying HTTP response. + */ + _response: msRest.HttpResponse & { + /** + * The response body as text (string format) + */ + bodyAsText: string; + + /** + * The response body as parsed JSON or XML + */ + parsedBody: AppServicePlan; + }; +}; + +/** + * Contains response data for the createOrUpdate operation. + */ +export type AppServicePlansCreateOrUpdateResponse = AppServicePlan & { + /** + * The underlying HTTP response. + */ + _response: msRest.HttpResponse & { + /** + * The response body as text (string format) + */ + bodyAsText: string; + + /** + * The response body as parsed JSON or XML + */ + parsedBody: AppServicePlan; + }; +}; + +/** + * Contains response data for the update operation. + */ +export type AppServicePlansUpdateResponse = AppServicePlan & { + /** + * The underlying HTTP response. + */ + _response: msRest.HttpResponse & { + /** + * The response body as text (string format) + */ + bodyAsText: string; + + /** + * The response body as parsed JSON or XML + */ + parsedBody: AppServicePlan; + }; +}; + +/** + * Contains response data for the listCapabilities operation. + */ +export type AppServicePlansListCapabilitiesResponse = Array & { + /** + * The underlying HTTP response. + */ + _response: msRest.HttpResponse & { + /** + * The response body as text (string format) + */ + bodyAsText: string; + + /** + * The response body as parsed JSON or XML + */ + parsedBody: Capability[]; + }; +}; + +/** + * Contains response data for the getHybridConnection operation. + */ +export type AppServicePlansGetHybridConnectionResponse = HybridConnection & { + /** + * The underlying HTTP response. + */ + _response: msRest.HttpResponse & { + /** + * The response body as text (string format) + */ + bodyAsText: string; + + /** + * The response body as parsed JSON or XML + */ + parsedBody: HybridConnection; + }; +}; + +/** + * Contains response data for the listHybridConnectionKeys operation. + */ +export type AppServicePlansListHybridConnectionKeysResponse = HybridConnectionKey & { + /** + * The underlying HTTP response. + */ + _response: msRest.HttpResponse & { + /** + * The response body as text (string format) + */ + bodyAsText: string; + + /** + * The response body as parsed JSON or XML + */ + parsedBody: HybridConnectionKey; + }; +}; + +/** + * Contains response data for the listWebAppsByHybridConnection operation. + */ +export type AppServicePlansListWebAppsByHybridConnectionResponse = ResourceCollection & { + /** + * The underlying HTTP response. + */ + _response: msRest.HttpResponse & { + /** + * The response body as text (string format) + */ + bodyAsText: string; + + /** + * The response body as parsed JSON or XML + */ + parsedBody: ResourceCollection; + }; +}; + +/** + * Contains response data for the getHybridConnectionPlanLimit operation. + */ +export type AppServicePlansGetHybridConnectionPlanLimitResponse = HybridConnectionLimits & { + /** + * The underlying HTTP response. + */ + _response: msRest.HttpResponse & { + /** + * The response body as text (string format) + */ + bodyAsText: string; + + /** + * The response body as parsed JSON or XML + */ + parsedBody: HybridConnectionLimits; + }; +}; + +/** + * Contains response data for the listHybridConnections operation. + */ +export type AppServicePlansListHybridConnectionsResponse = HybridConnectionCollection & { + /** + * The underlying HTTP response. + */ + _response: msRest.HttpResponse & { + /** + * The response body as text (string format) + */ + bodyAsText: string; + + /** + * The response body as parsed JSON or XML + */ + parsedBody: HybridConnectionCollection; + }; +}; + +/** + * Contains response data for the listMetricDefintions operation. + */ +export type AppServicePlansListMetricDefintionsResponse = ResourceMetricDefinitionCollection & { + /** + * The underlying HTTP response. + */ + _response: msRest.HttpResponse & { + /** + * The response body as text (string format) + */ + bodyAsText: string; + + /** + * The response body as parsed JSON or XML + */ + parsedBody: ResourceMetricDefinitionCollection; + }; +}; + +/** + * Contains response data for the listMetrics operation. + */ +export type AppServicePlansListMetricsResponse = ResourceMetricCollection & { + /** + * The underlying HTTP response. + */ + _response: msRest.HttpResponse & { + /** + * The response body as text (string format) + */ + bodyAsText: string; + + /** + * The response body as parsed JSON or XML + */ + parsedBody: ResourceMetricCollection; + }; +}; + +/** + * Contains response data for the listWebApps operation. + */ +export type AppServicePlansListWebAppsResponse = WebAppCollection & { + /** + * The underlying HTTP response. + */ + _response: msRest.HttpResponse & { + /** + * The response body as text (string format) + */ + bodyAsText: string; + + /** + * The response body as parsed JSON or XML + */ + parsedBody: WebAppCollection; + }; +}; + +/** + * Contains response data for the getServerFarmSkus operation. + */ +export type AppServicePlansGetServerFarmSkusResponse = { + /** + * The parsed response body. + */ + body: any; + + /** + * The underlying HTTP response. + */ + _response: msRest.HttpResponse & { + /** + * The response body as text (string format) + */ + bodyAsText: string; + + /** + * The response body as parsed JSON or XML + */ + parsedBody: any; + }; +}; + +/** + * Contains response data for the listUsages operation. + */ +export type AppServicePlansListUsagesResponse = CsmUsageQuotaCollection & { + /** + * The underlying HTTP response. + */ + _response: msRest.HttpResponse & { + /** + * The response body as text (string format) + */ + bodyAsText: string; + + /** + * The response body as parsed JSON or XML + */ + parsedBody: CsmUsageQuotaCollection; + }; +}; + +/** + * Contains response data for the listVnets operation. + */ +export type AppServicePlansListVnetsResponse = Array & { + /** + * The underlying HTTP response. + */ + _response: msRest.HttpResponse & { + /** + * The response body as text (string format) + */ + bodyAsText: string; + + /** + * The response body as parsed JSON or XML + */ + parsedBody: VnetInfo[]; + }; +}; + +/** + * Contains response data for the getVnetFromServerFarm operation. + */ +export type AppServicePlansGetVnetFromServerFarmResponse = VnetInfo & { + /** + * The underlying HTTP response. + */ + _response: msRest.HttpResponse & { + /** + * The response body as text (string format) + */ + bodyAsText: string; + + /** + * The response body as parsed JSON or XML + */ + parsedBody: VnetInfo; + }; +}; + +/** + * Contains response data for the getVnetGateway operation. + */ +export type AppServicePlansGetVnetGatewayResponse = VnetGateway & { + /** + * The underlying HTTP response. + */ + _response: msRest.HttpResponse & { + /** + * The response body as text (string format) + */ + bodyAsText: string; + + /** + * The response body as parsed JSON or XML + */ + parsedBody: VnetGateway; + }; +}; + +/** + * Contains response data for the updateVnetGateway operation. + */ +export type AppServicePlansUpdateVnetGatewayResponse = VnetGateway & { + /** + * The underlying HTTP response. + */ + _response: msRest.HttpResponse & { + /** + * The response body as text (string format) + */ + bodyAsText: string; + + /** + * The response body as parsed JSON or XML + */ + parsedBody: VnetGateway; + }; +}; + +/** + * Contains response data for the listRoutesForVnet operation. + */ +export type AppServicePlansListRoutesForVnetResponse = Array & { + /** + * The underlying HTTP response. + */ + _response: msRest.HttpResponse & { + /** + * The response body as text (string format) + */ + bodyAsText: string; + + /** + * The response body as parsed JSON or XML + */ + parsedBody: VnetRoute[]; + }; +}; + +/** + * Contains response data for the getRouteForVnet operation. + */ +export type AppServicePlansGetRouteForVnetResponse = Array & { + /** + * The underlying HTTP response. + */ + _response: msRest.HttpResponse & { + /** + * The response body as text (string format) + */ + bodyAsText: string; + + /** + * The response body as parsed JSON or XML + */ + parsedBody: VnetRoute[]; + }; +}; + +/** + * Contains response data for the createOrUpdateVnetRoute operation. + */ +export type AppServicePlansCreateOrUpdateVnetRouteResponse = VnetRoute & { + /** + * The underlying HTTP response. + */ + _response: msRest.HttpResponse & { + /** + * The response body as text (string format) + */ + bodyAsText: string; + + /** + * The response body as parsed JSON or XML + */ + parsedBody: VnetRoute; + }; +}; + +/** + * Contains response data for the updateVnetRoute operation. + */ +export type AppServicePlansUpdateVnetRouteResponse = VnetRoute & { + /** + * The underlying HTTP response. + */ + _response: msRest.HttpResponse & { + /** + * The response body as text (string format) + */ + bodyAsText: string; + + /** + * The response body as parsed JSON or XML + */ + parsedBody: VnetRoute; + }; +}; + +/** + * Contains response data for the beginCreateOrUpdate operation. + */ +export type AppServicePlansBeginCreateOrUpdateResponse = AppServicePlan & { + /** + * The underlying HTTP response. + */ + _response: msRest.HttpResponse & { + /** + * The response body as text (string format) + */ + bodyAsText: string; + + /** + * The response body as parsed JSON or XML + */ + parsedBody: AppServicePlan; + }; +}; + +/** + * Contains response data for the listNext operation. + */ +export type AppServicePlansListNextResponse = AppServicePlanCollection & { + /** + * The underlying HTTP response. + */ + _response: msRest.HttpResponse & { + /** + * The response body as text (string format) + */ + bodyAsText: string; + + /** + * The response body as parsed JSON or XML + */ + parsedBody: AppServicePlanCollection; + }; +}; + +/** + * Contains response data for the listByResourceGroupNext operation. + */ +export type AppServicePlansListByResourceGroupNextResponse = AppServicePlanCollection & { + /** + * The underlying HTTP response. + */ + _response: msRest.HttpResponse & { + /** + * The response body as text (string format) + */ + bodyAsText: string; + + /** + * The response body as parsed JSON or XML + */ + parsedBody: AppServicePlanCollection; + }; +}; + +/** + * Contains response data for the listWebAppsByHybridConnectionNext operation. + */ +export type AppServicePlansListWebAppsByHybridConnectionNextResponse = ResourceCollection & { + /** + * The underlying HTTP response. + */ + _response: msRest.HttpResponse & { + /** + * The response body as text (string format) + */ + bodyAsText: string; + + /** + * The response body as parsed JSON or XML + */ + parsedBody: ResourceCollection; + }; +}; + +/** + * Contains response data for the listHybridConnectionsNext operation. + */ +export type AppServicePlansListHybridConnectionsNextResponse = HybridConnectionCollection & { + /** + * The underlying HTTP response. + */ + _response: msRest.HttpResponse & { + /** + * The response body as text (string format) + */ + bodyAsText: string; + + /** + * The response body as parsed JSON or XML + */ + parsedBody: HybridConnectionCollection; + }; +}; + +/** + * Contains response data for the listMetricDefintionsNext operation. + */ +export type AppServicePlansListMetricDefintionsNextResponse = ResourceMetricDefinitionCollection & { + /** + * The underlying HTTP response. + */ + _response: msRest.HttpResponse & { + /** + * The response body as text (string format) + */ + bodyAsText: string; + + /** + * The response body as parsed JSON or XML + */ + parsedBody: ResourceMetricDefinitionCollection; + }; +}; + +/** + * Contains response data for the listMetricsNext operation. + */ +export type AppServicePlansListMetricsNextResponse = ResourceMetricCollection & { + /** + * The underlying HTTP response. + */ + _response: msRest.HttpResponse & { + /** + * The response body as text (string format) + */ + bodyAsText: string; + + /** + * The response body as parsed JSON or XML + */ + parsedBody: ResourceMetricCollection; + }; +}; + +/** + * Contains response data for the listWebAppsNext operation. + */ +export type AppServicePlansListWebAppsNextResponse = WebAppCollection & { + /** + * The underlying HTTP response. + */ + _response: msRest.HttpResponse & { + /** + * The response body as text (string format) + */ + bodyAsText: string; + + /** + * The response body as parsed JSON or XML + */ + parsedBody: WebAppCollection; + }; +}; + +/** + * Contains response data for the listUsagesNext operation. + */ +export type AppServicePlansListUsagesNextResponse = CsmUsageQuotaCollection & { + /** + * The underlying HTTP response. + */ + _response: msRest.HttpResponse & { + /** + * The response body as text (string format) + */ + bodyAsText: string; + + /** + * The response body as parsed JSON or XML + */ + parsedBody: CsmUsageQuotaCollection; + }; +}; + +/** + * Contains response data for the getAvailableStacks operation. + */ +export type ProviderGetAvailableStacksResponse = ApplicationStackCollection & { + /** + * The underlying HTTP response. + */ + _response: msRest.HttpResponse & { + /** + * The response body as text (string format) + */ + bodyAsText: string; + + /** + * The response body as parsed JSON or XML + */ + parsedBody: ApplicationStackCollection; + }; +}; + +/** + * Contains response data for the listOperations operation. + */ +export type ProviderListOperationsResponse = CsmOperationCollection & { + /** + * The underlying HTTP response. + */ + _response: msRest.HttpResponse & { + /** + * The response body as text (string format) + */ + bodyAsText: string; + + /** + * The response body as parsed JSON or XML + */ + parsedBody: CsmOperationCollection; + }; +}; + +/** + * Contains response data for the getAvailableStacksOnPrem operation. + */ +export type ProviderGetAvailableStacksOnPremResponse = ApplicationStackCollection & { + /** + * The underlying HTTP response. + */ + _response: msRest.HttpResponse & { + /** + * The response body as text (string format) + */ + bodyAsText: string; + + /** + * The response body as parsed JSON or XML + */ + parsedBody: ApplicationStackCollection; + }; +}; + +/** + * Contains response data for the getAvailableStacksNext operation. + */ +export type ProviderGetAvailableStacksNextResponse = ApplicationStackCollection & { + /** + * The underlying HTTP response. + */ + _response: msRest.HttpResponse & { + /** + * The response body as text (string format) + */ + bodyAsText: string; + + /** + * The response body as parsed JSON or XML + */ + parsedBody: ApplicationStackCollection; + }; +}; + +/** + * Contains response data for the listOperationsNext operation. + */ +export type ProviderListOperationsNextResponse = CsmOperationCollection & { + /** + * The underlying HTTP response. + */ + _response: msRest.HttpResponse & { + /** + * The response body as text (string format) + */ + bodyAsText: string; + + /** + * The response body as parsed JSON or XML + */ + parsedBody: CsmOperationCollection; + }; +}; + +/** + * Contains response data for the getAvailableStacksOnPremNext operation. + */ +export type ProviderGetAvailableStacksOnPremNextResponse = ApplicationStackCollection & { + /** + * The underlying HTTP response. + */ + _response: msRest.HttpResponse & { + /** + * The response body as text (string format) + */ + bodyAsText: string; + + /** + * The response body as parsed JSON or XML + */ + parsedBody: ApplicationStackCollection; + }; +}; + +/** + * Contains response data for the list operation. + */ +export type RecommendationsListResponse = RecommendationCollection & { + /** + * The underlying HTTP response. + */ + _response: msRest.HttpResponse & { + /** + * The response body as text (string format) + */ + bodyAsText: string; + + /** + * The response body as parsed JSON or XML + */ + parsedBody: RecommendationCollection; + }; +}; + +/** + * Contains response data for the listHistoryForHostingEnvironment operation. + */ +export type RecommendationsListHistoryForHostingEnvironmentResponse = RecommendationCollection & { + /** + * The underlying HTTP response. + */ + _response: msRest.HttpResponse & { + /** + * The response body as text (string format) + */ + bodyAsText: string; + + /** + * The response body as parsed JSON or XML + */ + parsedBody: RecommendationCollection; + }; +}; + +/** + * Contains response data for the listRecommendedRulesForHostingEnvironment operation. + */ +export type RecommendationsListRecommendedRulesForHostingEnvironmentResponse = RecommendationCollection & { + /** + * The underlying HTTP response. + */ + _response: msRest.HttpResponse & { + /** + * The response body as text (string format) + */ + bodyAsText: string; + + /** + * The response body as parsed JSON or XML + */ + parsedBody: RecommendationCollection; + }; +}; + +/** + * Contains response data for the getRuleDetailsByHostingEnvironment operation. + */ +export type RecommendationsGetRuleDetailsByHostingEnvironmentResponse = RecommendationRule & { + /** + * The underlying HTTP response. + */ + _response: msRest.HttpResponse & { + /** + * The response body as text (string format) + */ + bodyAsText: string; + + /** + * The response body as parsed JSON or XML + */ + parsedBody: RecommendationRule; + }; +}; + +/** + * Contains response data for the listHistoryForWebApp operation. + */ +export type RecommendationsListHistoryForWebAppResponse = RecommendationCollection & { + /** + * The underlying HTTP response. + */ + _response: msRest.HttpResponse & { + /** + * The response body as text (string format) + */ + bodyAsText: string; + + /** + * The response body as parsed JSON or XML + */ + parsedBody: RecommendationCollection; + }; +}; + +/** + * Contains response data for the listRecommendedRulesForWebApp operation. + */ +export type RecommendationsListRecommendedRulesForWebAppResponse = RecommendationCollection & { + /** + * The underlying HTTP response. + */ + _response: msRest.HttpResponse & { + /** + * The response body as text (string format) + */ + bodyAsText: string; + + /** + * The response body as parsed JSON or XML + */ + parsedBody: RecommendationCollection; + }; +}; + +/** + * Contains response data for the getRuleDetailsByWebApp operation. + */ +export type RecommendationsGetRuleDetailsByWebAppResponse = RecommendationRule & { + /** + * The underlying HTTP response. + */ + _response: msRest.HttpResponse & { + /** + * The response body as text (string format) + */ + bodyAsText: string; + + /** + * The response body as parsed JSON or XML + */ + parsedBody: RecommendationRule; + }; +}; + +/** + * Contains response data for the listNext operation. + */ +export type RecommendationsListNextResponse = RecommendationCollection & { + /** + * The underlying HTTP response. + */ + _response: msRest.HttpResponse & { + /** + * The response body as text (string format) + */ + bodyAsText: string; + + /** + * The response body as parsed JSON or XML + */ + parsedBody: RecommendationCollection; + }; +}; + +/** + * Contains response data for the listHistoryForHostingEnvironmentNext operation. + */ +export type RecommendationsListHistoryForHostingEnvironmentNextResponse = RecommendationCollection & { + /** + * The underlying HTTP response. + */ + _response: msRest.HttpResponse & { + /** + * The response body as text (string format) + */ + bodyAsText: string; + + /** + * The response body as parsed JSON or XML + */ + parsedBody: RecommendationCollection; + }; +}; + +/** + * Contains response data for the listRecommendedRulesForHostingEnvironmentNext operation. + */ +export type RecommendationsListRecommendedRulesForHostingEnvironmentNextResponse = RecommendationCollection & { + /** + * The underlying HTTP response. + */ + _response: msRest.HttpResponse & { + /** + * The response body as text (string format) + */ + bodyAsText: string; + + /** + * The response body as parsed JSON or XML + */ + parsedBody: RecommendationCollection; + }; +}; + +/** + * Contains response data for the listHistoryForWebAppNext operation. + */ +export type RecommendationsListHistoryForWebAppNextResponse = RecommendationCollection & { + /** + * The underlying HTTP response. + */ + _response: msRest.HttpResponse & { + /** + * The response body as text (string format) + */ + bodyAsText: string; + + /** + * The response body as parsed JSON or XML + */ + parsedBody: RecommendationCollection; + }; +}; + +/** + * Contains response data for the listRecommendedRulesForWebAppNext operation. + */ +export type RecommendationsListRecommendedRulesForWebAppNextResponse = RecommendationCollection & { + /** + * The underlying HTTP response. + */ + _response: msRest.HttpResponse & { + /** + * The response body as text (string format) + */ + bodyAsText: string; + + /** + * The response body as parsed JSON or XML + */ + parsedBody: RecommendationCollection; + }; +}; diff --git a/sdk/appservice/arm-appservice-profile-2019-03-01-hybrid/src/models/mappers.ts b/sdk/appservice/arm-appservice-profile-2019-03-01-hybrid/src/models/mappers.ts new file mode 100644 index 000000000000..aa3ad7938afa --- /dev/null +++ b/sdk/appservice/arm-appservice-profile-2019-03-01-hybrid/src/models/mappers.ts @@ -0,0 +1,10664 @@ +/* + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for 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 { CloudErrorMapper, BaseResourceMapper } from "@azure/ms-rest-azure-js"; +import * as msRest from "@azure/ms-rest-js"; + +export const CloudError = CloudErrorMapper; +export const BaseResource = BaseResourceMapper; + +export const HostingEnvironmentProfile: msRest.CompositeMapper = { + serializedName: "HostingEnvironmentProfile", + type: { + name: "Composite", + className: "HostingEnvironmentProfile", + modelProperties: { + id: { + serializedName: "id", + type: { + name: "String" + } + }, + name: { + readOnly: true, + serializedName: "name", + type: { + name: "String" + } + }, + type: { + readOnly: true, + serializedName: "type", + type: { + name: "String" + } + } + } + } +}; + +export const Resource: msRest.CompositeMapper = { + serializedName: "Resource", + type: { + name: "Composite", + className: "Resource", + modelProperties: { + id: { + readOnly: true, + serializedName: "id", + type: { + name: "String" + } + }, + name: { + readOnly: true, + serializedName: "name", + type: { + name: "String" + } + }, + kind: { + serializedName: "kind", + type: { + name: "String" + } + }, + location: { + required: true, + serializedName: "location", + type: { + name: "String" + } + }, + type: { + readOnly: true, + serializedName: "type", + type: { + name: "String" + } + }, + tags: { + serializedName: "tags", + type: { + name: "Dictionary", + value: { + type: { + name: "String" + } + } + } + } + } + } +}; + +export const Certificate: msRest.CompositeMapper = { + serializedName: "Certificate", + type: { + name: "Composite", + className: "Certificate", + modelProperties: { + ...Resource.type.modelProperties, + friendlyName: { + readOnly: true, + serializedName: "properties.friendlyName", + type: { + name: "String" + } + }, + subjectName: { + readOnly: true, + serializedName: "properties.subjectName", + type: { + name: "String" + } + }, + hostNames: { + serializedName: "properties.hostNames", + type: { + name: "Sequence", + element: { + type: { + name: "String" + } + } + } + }, + pfxBlob: { + serializedName: "properties.pfxBlob", + type: { + name: "ByteArray" + } + }, + siteName: { + readOnly: true, + serializedName: "properties.siteName", + type: { + name: "String" + } + }, + selfLink: { + readOnly: true, + serializedName: "properties.selfLink", + type: { + name: "String" + } + }, + issuer: { + readOnly: true, + serializedName: "properties.issuer", + type: { + name: "String" + } + }, + issueDate: { + readOnly: true, + serializedName: "properties.issueDate", + type: { + name: "DateTime" + } + }, + expirationDate: { + readOnly: true, + serializedName: "properties.expirationDate", + type: { + name: "DateTime" + } + }, + password: { + required: true, + serializedName: "properties.password", + type: { + name: "String" + } + }, + thumbprint: { + readOnly: true, + serializedName: "properties.thumbprint", + type: { + name: "String" + } + }, + valid: { + readOnly: true, + serializedName: "properties.valid", + type: { + name: "Boolean" + } + }, + cerBlob: { + readOnly: true, + serializedName: "properties.cerBlob", + type: { + name: "ByteArray" + } + }, + publicKeyHash: { + readOnly: true, + serializedName: "properties.publicKeyHash", + type: { + name: "String" + } + }, + hostingEnvironmentProfile: { + readOnly: true, + serializedName: "properties.hostingEnvironmentProfile", + type: { + name: "Composite", + className: "HostingEnvironmentProfile" + } + }, + keyVaultId: { + serializedName: "properties.keyVaultId", + type: { + name: "String" + } + }, + keyVaultSecretName: { + serializedName: "properties.keyVaultSecretName", + type: { + name: "String" + } + }, + keyVaultSecretStatus: { + readOnly: true, + serializedName: "properties.keyVaultSecretStatus", + type: { + name: "Enum", + allowedValues: [ + "Initialized", + "WaitingOnCertificateOrder", + "Succeeded", + "CertificateOrderFailed", + "OperationNotPermittedOnKeyVault", + "AzureServiceUnauthorizedToAccessKeyVault", + "KeyVaultDoesNotExist", + "KeyVaultSecretDoesNotExist", + "UnknownError", + "ExternalPrivateKey", + "Unknown" + ] + } + }, + serverFarmId: { + serializedName: "properties.serverFarmId", + type: { + name: "String" + } + } + } + } +}; + +export const ProxyOnlyResource: msRest.CompositeMapper = { + serializedName: "ProxyOnlyResource", + type: { + name: "Composite", + className: "ProxyOnlyResource", + modelProperties: { + id: { + readOnly: true, + serializedName: "id", + type: { + name: "String" + } + }, + name: { + readOnly: true, + serializedName: "name", + type: { + name: "String" + } + }, + kind: { + serializedName: "kind", + type: { + name: "String" + } + }, + type: { + readOnly: true, + serializedName: "type", + type: { + name: "String" + } + } + } + } +}; + +export const CertificatePatchResource: msRest.CompositeMapper = { + serializedName: "CertificatePatchResource", + type: { + name: "Composite", + className: "CertificatePatchResource", + modelProperties: { + ...ProxyOnlyResource.type.modelProperties, + friendlyName: { + readOnly: true, + serializedName: "properties.friendlyName", + type: { + name: "String" + } + }, + subjectName: { + readOnly: true, + serializedName: "properties.subjectName", + type: { + name: "String" + } + }, + hostNames: { + serializedName: "properties.hostNames", + type: { + name: "Sequence", + element: { + type: { + name: "String" + } + } + } + }, + pfxBlob: { + serializedName: "properties.pfxBlob", + type: { + name: "ByteArray" + } + }, + siteName: { + readOnly: true, + serializedName: "properties.siteName", + type: { + name: "String" + } + }, + selfLink: { + readOnly: true, + serializedName: "properties.selfLink", + type: { + name: "String" + } + }, + issuer: { + readOnly: true, + serializedName: "properties.issuer", + type: { + name: "String" + } + }, + issueDate: { + readOnly: true, + serializedName: "properties.issueDate", + type: { + name: "DateTime" + } + }, + expirationDate: { + readOnly: true, + serializedName: "properties.expirationDate", + type: { + name: "DateTime" + } + }, + password: { + required: true, + serializedName: "properties.password", + type: { + name: "String" + } + }, + thumbprint: { + readOnly: true, + serializedName: "properties.thumbprint", + type: { + name: "String" + } + }, + valid: { + readOnly: true, + serializedName: "properties.valid", + type: { + name: "Boolean" + } + }, + cerBlob: { + readOnly: true, + serializedName: "properties.cerBlob", + type: { + name: "ByteArray" + } + }, + publicKeyHash: { + readOnly: true, + serializedName: "properties.publicKeyHash", + type: { + name: "String" + } + }, + hostingEnvironmentProfile: { + readOnly: true, + serializedName: "properties.hostingEnvironmentProfile", + type: { + name: "Composite", + className: "HostingEnvironmentProfile" + } + }, + keyVaultId: { + serializedName: "properties.keyVaultId", + type: { + name: "String" + } + }, + keyVaultSecretName: { + serializedName: "properties.keyVaultSecretName", + type: { + name: "String" + } + }, + keyVaultSecretStatus: { + readOnly: true, + serializedName: "properties.keyVaultSecretStatus", + type: { + name: "Enum", + allowedValues: [ + "Initialized", + "WaitingOnCertificateOrder", + "Succeeded", + "CertificateOrderFailed", + "OperationNotPermittedOnKeyVault", + "AzureServiceUnauthorizedToAccessKeyVault", + "KeyVaultDoesNotExist", + "KeyVaultSecretDoesNotExist", + "UnknownError", + "ExternalPrivateKey", + "Unknown" + ] + } + }, + serverFarmId: { + serializedName: "properties.serverFarmId", + type: { + name: "String" + } + } + } + } +}; + +export const VnetRoute: msRest.CompositeMapper = { + serializedName: "VnetRoute", + type: { + name: "Composite", + className: "VnetRoute", + modelProperties: { + ...ProxyOnlyResource.type.modelProperties, + startAddress: { + serializedName: "properties.startAddress", + type: { + name: "String" + } + }, + endAddress: { + serializedName: "properties.endAddress", + type: { + name: "String" + } + }, + routeType: { + serializedName: "properties.routeType", + type: { + name: "String" + } + } + } + } +}; + +export const VnetInfo: msRest.CompositeMapper = { + serializedName: "VnetInfo", + type: { + name: "Composite", + className: "VnetInfo", + modelProperties: { + ...ProxyOnlyResource.type.modelProperties, + vnetResourceId: { + serializedName: "properties.vnetResourceId", + type: { + name: "String" + } + }, + certThumbprint: { + readOnly: true, + serializedName: "properties.certThumbprint", + type: { + name: "String" + } + }, + certBlob: { + serializedName: "properties.certBlob", + type: { + name: "String" + } + }, + routes: { + readOnly: true, + serializedName: "properties.routes", + type: { + name: "Sequence", + element: { + type: { + name: "Composite", + className: "VnetRoute" + } + } + } + }, + resyncRequired: { + readOnly: true, + serializedName: "properties.resyncRequired", + type: { + name: "Boolean" + } + }, + dnsServers: { + serializedName: "properties.dnsServers", + type: { + name: "String" + } + }, + isSwift: { + serializedName: "properties.isSwift", + type: { + name: "Boolean" + } + } + } + } +}; + +export const VnetGateway: msRest.CompositeMapper = { + serializedName: "VnetGateway", + type: { + name: "Composite", + className: "VnetGateway", + modelProperties: { + ...ProxyOnlyResource.type.modelProperties, + vnetName: { + serializedName: "properties.vnetName", + type: { + name: "String" + } + }, + vpnPackageUri: { + required: true, + serializedName: "properties.vpnPackageUri", + type: { + name: "String" + } + } + } + } +}; + +export const User: msRest.CompositeMapper = { + serializedName: "User", + type: { + name: "Composite", + className: "User", + modelProperties: { + ...ProxyOnlyResource.type.modelProperties, + publishingUserName: { + required: true, + serializedName: "properties.publishingUserName", + type: { + name: "String" + } + }, + publishingPassword: { + serializedName: "properties.publishingPassword", + type: { + name: "String" + } + }, + publishingPasswordHash: { + serializedName: "properties.publishingPasswordHash", + type: { + name: "String" + } + }, + publishingPasswordHashSalt: { + serializedName: "properties.publishingPasswordHashSalt", + type: { + name: "String" + } + }, + scmUri: { + serializedName: "properties.scmUri", + type: { + name: "String" + } + } + } + } +}; + +export const Snapshot: msRest.CompositeMapper = { + serializedName: "Snapshot", + type: { + name: "Composite", + className: "Snapshot", + modelProperties: { + ...ProxyOnlyResource.type.modelProperties, + time: { + readOnly: true, + serializedName: "properties.time", + type: { + name: "String" + } + } + } + } +}; + +export const ResourceMetricAvailability: msRest.CompositeMapper = { + serializedName: "ResourceMetricAvailability", + type: { + name: "Composite", + className: "ResourceMetricAvailability", + modelProperties: { + timeGrain: { + readOnly: true, + serializedName: "timeGrain", + type: { + name: "String" + } + }, + retention: { + readOnly: true, + serializedName: "retention", + type: { + name: "String" + } + } + } + } +}; + +export const ResourceMetricDefinition: msRest.CompositeMapper = { + serializedName: "ResourceMetricDefinition", + type: { + name: "Composite", + className: "ResourceMetricDefinition", + modelProperties: { + ...ProxyOnlyResource.type.modelProperties, + unit: { + readOnly: true, + serializedName: "properties.unit", + type: { + name: "String" + } + }, + primaryAggregationType: { + readOnly: true, + serializedName: "properties.primaryAggregationType", + type: { + name: "String" + } + }, + metricAvailabilities: { + readOnly: true, + serializedName: "properties.metricAvailabilities", + type: { + name: "Sequence", + element: { + type: { + name: "Composite", + className: "ResourceMetricAvailability" + } + } + } + }, + resourceUri: { + readOnly: true, + serializedName: "properties.resourceUri", + type: { + name: "String" + } + }, + properties: { + readOnly: true, + serializedName: "properties.properties", + type: { + name: "Dictionary", + value: { + type: { + name: "String" + } + } + } + } + } + } +}; + +export const PushSettings: msRest.CompositeMapper = { + serializedName: "PushSettings", + type: { + name: "Composite", + className: "PushSettings", + modelProperties: { + ...ProxyOnlyResource.type.modelProperties, + isPushEnabled: { + required: true, + serializedName: "properties.isPushEnabled", + type: { + name: "Boolean" + } + }, + tagWhitelistJson: { + serializedName: "properties.tagWhitelistJson", + type: { + name: "String" + } + }, + tagsRequiringAuth: { + serializedName: "properties.tagsRequiringAuth", + type: { + name: "String" + } + }, + dynamicTagsJson: { + serializedName: "properties.dynamicTagsJson", + type: { + name: "String" + } + } + } + } +}; + +export const Identifier: msRest.CompositeMapper = { + serializedName: "Identifier", + type: { + name: "Composite", + className: "Identifier", + modelProperties: { + ...ProxyOnlyResource.type.modelProperties, + identifierId: { + serializedName: "properties.id", + type: { + name: "String" + } + } + } + } +}; + +export const HybridConnectionKey: msRest.CompositeMapper = { + serializedName: "HybridConnectionKey", + type: { + name: "Composite", + className: "HybridConnectionKey", + modelProperties: { + ...ProxyOnlyResource.type.modelProperties, + sendKeyName: { + readOnly: true, + serializedName: "properties.sendKeyName", + type: { + name: "String" + } + }, + sendKeyValue: { + readOnly: true, + serializedName: "properties.sendKeyValue", + type: { + name: "String" + } + } + } + } +}; + +export const HybridConnection: msRest.CompositeMapper = { + serializedName: "HybridConnection", + type: { + name: "Composite", + className: "HybridConnection", + modelProperties: { + ...ProxyOnlyResource.type.modelProperties, + serviceBusNamespace: { + serializedName: "properties.serviceBusNamespace", + type: { + name: "String" + } + }, + relayName: { + serializedName: "properties.relayName", + type: { + name: "String" + } + }, + relayArmUri: { + serializedName: "properties.relayArmUri", + type: { + name: "String" + } + }, + hostname: { + serializedName: "properties.hostname", + type: { + name: "String" + } + }, + port: { + serializedName: "properties.port", + type: { + name: "Number" + } + }, + sendKeyName: { + serializedName: "properties.sendKeyName", + type: { + name: "String" + } + }, + sendKeyValue: { + serializedName: "properties.sendKeyValue", + type: { + name: "String" + } + }, + serviceBusSuffix: { + serializedName: "properties.serviceBusSuffix", + type: { + name: "String" + } + } + } + } +}; + +export const DeletedSite: msRest.CompositeMapper = { + serializedName: "DeletedSite", + type: { + name: "Composite", + className: "DeletedSite", + modelProperties: { + ...ProxyOnlyResource.type.modelProperties, + deletedSiteId: { + readOnly: true, + serializedName: "properties.deletedSiteId", + type: { + name: "Number" + } + }, + deletedTimestamp: { + readOnly: true, + serializedName: "properties.deletedTimestamp", + type: { + name: "String" + } + }, + subscription: { + readOnly: true, + serializedName: "properties.subscription", + type: { + name: "String" + } + }, + resourceGroup: { + readOnly: true, + serializedName: "properties.resourceGroup", + type: { + name: "String" + } + }, + deletedSiteName: { + readOnly: true, + serializedName: "properties.deletedSiteName", + type: { + name: "String" + } + }, + slot: { + readOnly: true, + serializedName: "properties.slot", + type: { + name: "String" + } + }, + deletedSiteKind: { + readOnly: true, + serializedName: "properties.kind", + type: { + name: "String" + } + }, + geoRegionName: { + readOnly: true, + serializedName: "properties.geoRegionName", + type: { + name: "String" + } + } + } + } +}; + +export const ManagedServiceIdentityUserAssignedIdentitiesValue: msRest.CompositeMapper = { + serializedName: "ManagedServiceIdentity_userAssignedIdentitiesValue", + type: { + name: "Composite", + className: "ManagedServiceIdentityUserAssignedIdentitiesValue", + modelProperties: { + principalId: { + readOnly: true, + serializedName: "principalId", + type: { + name: "String" + } + }, + clientId: { + readOnly: true, + serializedName: "clientId", + type: { + name: "String" + } + } + } + } +}; + +export const ManagedServiceIdentity: msRest.CompositeMapper = { + serializedName: "ManagedServiceIdentity", + type: { + name: "Composite", + className: "ManagedServiceIdentity", + modelProperties: { + type: { + serializedName: "type", + type: { + name: "String" + } + }, + tenantId: { + readOnly: true, + serializedName: "tenantId", + type: { + name: "String" + } + }, + principalId: { + readOnly: true, + serializedName: "principalId", + type: { + name: "String" + } + }, + userAssignedIdentities: { + serializedName: "userAssignedIdentities", + type: { + name: "Dictionary", + value: { + type: { + name: "Composite", + className: "ManagedServiceIdentityUserAssignedIdentitiesValue" + } + } + } + } + } + } +}; + +export const GeoDistribution: msRest.CompositeMapper = { + serializedName: "GeoDistribution", + type: { + name: "Composite", + className: "GeoDistribution", + modelProperties: { + location: { + serializedName: "location", + type: { + name: "String" + } + }, + numberOfWorkers: { + serializedName: "numberOfWorkers", + type: { + name: "Number" + } + } + } + } +}; + +export const SlotSwapStatus: msRest.CompositeMapper = { + serializedName: "SlotSwapStatus", + type: { + name: "Composite", + className: "SlotSwapStatus", + modelProperties: { + timestampUtc: { + readOnly: true, + serializedName: "timestampUtc", + type: { + name: "DateTime" + } + }, + sourceSlotName: { + readOnly: true, + serializedName: "sourceSlotName", + type: { + name: "String" + } + }, + destinationSlotName: { + readOnly: true, + serializedName: "destinationSlotName", + type: { + name: "String" + } + } + } + } +}; + +export const CloningInfo: msRest.CompositeMapper = { + serializedName: "CloningInfo", + type: { + name: "Composite", + className: "CloningInfo", + modelProperties: { + correlationId: { + serializedName: "correlationId", + type: { + name: "Uuid" + } + }, + overwrite: { + serializedName: "overwrite", + type: { + name: "Boolean" + } + }, + cloneCustomHostNames: { + serializedName: "cloneCustomHostNames", + type: { + name: "Boolean" + } + }, + cloneSourceControl: { + serializedName: "cloneSourceControl", + type: { + name: "Boolean" + } + }, + sourceWebAppId: { + required: true, + serializedName: "sourceWebAppId", + type: { + name: "String" + } + }, + sourceWebAppLocation: { + serializedName: "sourceWebAppLocation", + type: { + name: "String" + } + }, + hostingEnvironment: { + serializedName: "hostingEnvironment", + type: { + name: "String" + } + }, + appSettingsOverrides: { + serializedName: "appSettingsOverrides", + type: { + name: "Dictionary", + value: { + type: { + name: "String" + } + } + } + }, + configureLoadBalancing: { + serializedName: "configureLoadBalancing", + type: { + name: "Boolean" + } + }, + trafficManagerProfileId: { + serializedName: "trafficManagerProfileId", + type: { + name: "String" + } + }, + trafficManagerProfileName: { + serializedName: "trafficManagerProfileName", + type: { + name: "String" + } + } + } + } +}; + +export const IpSecurityRestriction: msRest.CompositeMapper = { + serializedName: "IpSecurityRestriction", + type: { + name: "Composite", + className: "IpSecurityRestriction", + modelProperties: { + ipAddress: { + serializedName: "ipAddress", + type: { + name: "String" + } + }, + subnetMask: { + serializedName: "subnetMask", + type: { + name: "String" + } + }, + vnetSubnetResourceId: { + serializedName: "vnetSubnetResourceId", + type: { + name: "String" + } + }, + vnetTrafficTag: { + serializedName: "vnetTrafficTag", + type: { + name: "Number" + } + }, + subnetTrafficTag: { + serializedName: "subnetTrafficTag", + type: { + name: "Number" + } + }, + action: { + serializedName: "action", + type: { + name: "String" + } + }, + tag: { + serializedName: "tag", + type: { + name: "Enum", + allowedValues: [ + "Default", + "XffProxy" + ] + } + }, + priority: { + serializedName: "priority", + type: { + name: "Number" + } + }, + name: { + serializedName: "name", + type: { + name: "String" + } + }, + description: { + serializedName: "description", + type: { + name: "String" + } + } + } + } +}; + +export const ApiDefinitionInfo: msRest.CompositeMapper = { + serializedName: "ApiDefinitionInfo", + type: { + name: "Composite", + className: "ApiDefinitionInfo", + modelProperties: { + url: { + serializedName: "url", + type: { + name: "String" + } + } + } + } +}; + +export const CorsSettings: msRest.CompositeMapper = { + serializedName: "CorsSettings", + type: { + name: "Composite", + className: "CorsSettings", + modelProperties: { + allowedOrigins: { + serializedName: "allowedOrigins", + type: { + name: "Sequence", + element: { + type: { + name: "String" + } + } + } + }, + supportCredentials: { + serializedName: "supportCredentials", + type: { + name: "Boolean" + } + } + } + } +}; + +export const AutoHealCustomAction: msRest.CompositeMapper = { + serializedName: "AutoHealCustomAction", + type: { + name: "Composite", + className: "AutoHealCustomAction", + modelProperties: { + exe: { + serializedName: "exe", + type: { + name: "String" + } + }, + parameters: { + serializedName: "parameters", + type: { + name: "String" + } + } + } + } +}; + +export const AutoHealActions: msRest.CompositeMapper = { + serializedName: "AutoHealActions", + type: { + name: "Composite", + className: "AutoHealActions", + modelProperties: { + actionType: { + serializedName: "actionType", + type: { + name: "Enum", + allowedValues: [ + "Recycle", + "LogEvent", + "CustomAction" + ] + } + }, + customAction: { + serializedName: "customAction", + type: { + name: "Composite", + className: "AutoHealCustomAction" + } + }, + minProcessExecutionTime: { + serializedName: "minProcessExecutionTime", + type: { + name: "String" + } + } + } + } +}; + +export const SlowRequestsBasedTrigger: msRest.CompositeMapper = { + serializedName: "SlowRequestsBasedTrigger", + type: { + name: "Composite", + className: "SlowRequestsBasedTrigger", + modelProperties: { + timeTaken: { + serializedName: "timeTaken", + type: { + name: "String" + } + }, + count: { + serializedName: "count", + type: { + name: "Number" + } + }, + timeInterval: { + serializedName: "timeInterval", + type: { + name: "String" + } + } + } + } +}; + +export const StatusCodesBasedTrigger: msRest.CompositeMapper = { + serializedName: "StatusCodesBasedTrigger", + type: { + name: "Composite", + className: "StatusCodesBasedTrigger", + modelProperties: { + status: { + serializedName: "status", + type: { + name: "Number" + } + }, + subStatus: { + serializedName: "subStatus", + type: { + name: "Number" + } + }, + win32Status: { + serializedName: "win32Status", + type: { + name: "Number" + } + }, + count: { + serializedName: "count", + type: { + name: "Number" + } + }, + timeInterval: { + serializedName: "timeInterval", + type: { + name: "String" + } + } + } + } +}; + +export const RequestsBasedTrigger: msRest.CompositeMapper = { + serializedName: "RequestsBasedTrigger", + type: { + name: "Composite", + className: "RequestsBasedTrigger", + modelProperties: { + count: { + serializedName: "count", + type: { + name: "Number" + } + }, + timeInterval: { + serializedName: "timeInterval", + type: { + name: "String" + } + } + } + } +}; + +export const AutoHealTriggers: msRest.CompositeMapper = { + serializedName: "AutoHealTriggers", + type: { + name: "Composite", + className: "AutoHealTriggers", + modelProperties: { + requests: { + serializedName: "requests", + type: { + name: "Composite", + className: "RequestsBasedTrigger" + } + }, + privateBytesInKB: { + serializedName: "privateBytesInKB", + type: { + name: "Number" + } + }, + statusCodes: { + serializedName: "statusCodes", + type: { + name: "Sequence", + element: { + type: { + name: "Composite", + className: "StatusCodesBasedTrigger" + } + } + } + }, + slowRequests: { + serializedName: "slowRequests", + type: { + name: "Composite", + className: "SlowRequestsBasedTrigger" + } + } + } + } +}; + +export const AutoHealRules: msRest.CompositeMapper = { + serializedName: "AutoHealRules", + type: { + name: "Composite", + className: "AutoHealRules", + modelProperties: { + triggers: { + serializedName: "triggers", + type: { + name: "Composite", + className: "AutoHealTriggers" + } + }, + actions: { + serializedName: "actions", + type: { + name: "Composite", + className: "AutoHealActions" + } + } + } + } +}; + +export const SiteLimits: msRest.CompositeMapper = { + serializedName: "SiteLimits", + type: { + name: "Composite", + className: "SiteLimits", + modelProperties: { + maxPercentageCpu: { + serializedName: "maxPercentageCpu", + type: { + name: "Number" + } + }, + maxMemoryInMb: { + serializedName: "maxMemoryInMb", + type: { + name: "Number" + } + }, + maxDiskSizeInMb: { + serializedName: "maxDiskSizeInMb", + type: { + name: "Number" + } + } + } + } +}; + +export const RampUpRule: msRest.CompositeMapper = { + serializedName: "RampUpRule", + type: { + name: "Composite", + className: "RampUpRule", + modelProperties: { + actionHostName: { + serializedName: "actionHostName", + type: { + name: "String" + } + }, + reroutePercentage: { + serializedName: "reroutePercentage", + type: { + name: "Number" + } + }, + changeStep: { + serializedName: "changeStep", + type: { + name: "Number" + } + }, + changeIntervalInMinutes: { + serializedName: "changeIntervalInMinutes", + type: { + name: "Number" + } + }, + minReroutePercentage: { + serializedName: "minReroutePercentage", + type: { + name: "Number" + } + }, + maxReroutePercentage: { + serializedName: "maxReroutePercentage", + type: { + name: "Number" + } + }, + changeDecisionCallbackUrl: { + serializedName: "changeDecisionCallbackUrl", + type: { + name: "String" + } + }, + name: { + serializedName: "name", + type: { + name: "String" + } + } + } + } +}; + +export const Experiments: msRest.CompositeMapper = { + serializedName: "Experiments", + type: { + name: "Composite", + className: "Experiments", + modelProperties: { + rampUpRules: { + serializedName: "rampUpRules", + type: { + name: "Sequence", + element: { + type: { + name: "Composite", + className: "RampUpRule" + } + } + } + } + } + } +}; + +export const VirtualDirectory: msRest.CompositeMapper = { + serializedName: "VirtualDirectory", + type: { + name: "Composite", + className: "VirtualDirectory", + modelProperties: { + virtualPath: { + serializedName: "virtualPath", + type: { + name: "String" + } + }, + physicalPath: { + serializedName: "physicalPath", + type: { + name: "String" + } + } + } + } +}; + +export const VirtualApplication: msRest.CompositeMapper = { + serializedName: "VirtualApplication", + type: { + name: "Composite", + className: "VirtualApplication", + modelProperties: { + virtualPath: { + serializedName: "virtualPath", + type: { + name: "String" + } + }, + physicalPath: { + serializedName: "physicalPath", + type: { + name: "String" + } + }, + preloadEnabled: { + serializedName: "preloadEnabled", + type: { + name: "Boolean" + } + }, + virtualDirectories: { + serializedName: "virtualDirectories", + type: { + name: "Sequence", + element: { + type: { + name: "Composite", + className: "VirtualDirectory" + } + } + } + } + } + } +}; + +export const HandlerMapping: msRest.CompositeMapper = { + serializedName: "HandlerMapping", + type: { + name: "Composite", + className: "HandlerMapping", + modelProperties: { + extension: { + serializedName: "extension", + type: { + name: "String" + } + }, + scriptProcessor: { + serializedName: "scriptProcessor", + type: { + name: "String" + } + }, + argumentsProperty: { + serializedName: "arguments", + type: { + name: "String" + } + } + } + } +}; + +export const SiteMachineKey: msRest.CompositeMapper = { + serializedName: "SiteMachineKey", + type: { + name: "Composite", + className: "SiteMachineKey", + modelProperties: { + validation: { + serializedName: "validation", + type: { + name: "String" + } + }, + validationKey: { + serializedName: "validationKey", + type: { + name: "String" + } + }, + decryption: { + serializedName: "decryption", + type: { + name: "String" + } + }, + decryptionKey: { + serializedName: "decryptionKey", + type: { + name: "String" + } + } + } + } +}; + +export const ConnStringInfo: msRest.CompositeMapper = { + serializedName: "ConnStringInfo", + type: { + name: "Composite", + className: "ConnStringInfo", + modelProperties: { + name: { + serializedName: "name", + type: { + name: "String" + } + }, + connectionString: { + serializedName: "connectionString", + type: { + name: "String" + } + }, + type: { + serializedName: "type", + type: { + name: "Enum", + allowedValues: [ + "MySql", + "SQLServer", + "SQLAzure", + "Custom", + "NotificationHub", + "ServiceBus", + "EventHub", + "ApiHub", + "DocDb", + "RedisCache", + "PostgreSQL" + ] + } + } + } + } +}; + +export const AzureStorageInfoValue: msRest.CompositeMapper = { + serializedName: "AzureStorageInfoValue", + type: { + name: "Composite", + className: "AzureStorageInfoValue", + modelProperties: { + type: { + serializedName: "type", + type: { + name: "Enum", + allowedValues: [ + "AzureFiles", + "AzureBlob" + ] + } + }, + accountName: { + serializedName: "accountName", + type: { + name: "String" + } + }, + shareName: { + serializedName: "shareName", + type: { + name: "String" + } + }, + accessKey: { + serializedName: "accessKey", + type: { + name: "String" + } + }, + mountPath: { + serializedName: "mountPath", + type: { + name: "String" + } + }, + state: { + readOnly: true, + serializedName: "state", + type: { + name: "Enum", + allowedValues: [ + "Ok", + "InvalidCredentials", + "InvalidShare" + ] + } + } + } + } +}; + +export const NameValuePair: msRest.CompositeMapper = { + serializedName: "NameValuePair", + type: { + name: "Composite", + className: "NameValuePair", + modelProperties: { + name: { + serializedName: "name", + type: { + name: "String" + } + }, + value: { + serializedName: "value", + type: { + name: "String" + } + } + } + } +}; + +export const SiteConfig: msRest.CompositeMapper = { + serializedName: "SiteConfig", + type: { + name: "Composite", + className: "SiteConfig", + modelProperties: { + numberOfWorkers: { + serializedName: "numberOfWorkers", + type: { + name: "Number" + } + }, + defaultDocuments: { + serializedName: "defaultDocuments", + type: { + name: "Sequence", + element: { + type: { + name: "String" + } + } + } + }, + netFrameworkVersion: { + serializedName: "netFrameworkVersion", + defaultValue: 'v4.6', + type: { + name: "String" + } + }, + phpVersion: { + serializedName: "phpVersion", + type: { + name: "String" + } + }, + pythonVersion: { + serializedName: "pythonVersion", + type: { + name: "String" + } + }, + nodeVersion: { + serializedName: "nodeVersion", + type: { + name: "String" + } + }, + linuxFxVersion: { + serializedName: "linuxFxVersion", + type: { + name: "String" + } + }, + windowsFxVersion: { + serializedName: "windowsFxVersion", + type: { + name: "String" + } + }, + requestTracingEnabled: { + serializedName: "requestTracingEnabled", + type: { + name: "Boolean" + } + }, + requestTracingExpirationTime: { + serializedName: "requestTracingExpirationTime", + type: { + name: "DateTime" + } + }, + remoteDebuggingEnabled: { + serializedName: "remoteDebuggingEnabled", + type: { + name: "Boolean" + } + }, + remoteDebuggingVersion: { + serializedName: "remoteDebuggingVersion", + type: { + name: "String" + } + }, + httpLoggingEnabled: { + serializedName: "httpLoggingEnabled", + type: { + name: "Boolean" + } + }, + logsDirectorySizeLimit: { + serializedName: "logsDirectorySizeLimit", + type: { + name: "Number" + } + }, + detailedErrorLoggingEnabled: { + serializedName: "detailedErrorLoggingEnabled", + type: { + name: "Boolean" + } + }, + publishingUsername: { + serializedName: "publishingUsername", + type: { + name: "String" + } + }, + appSettings: { + serializedName: "appSettings", + type: { + name: "Sequence", + element: { + type: { + name: "Composite", + className: "NameValuePair" + } + } + } + }, + azureStorageAccounts: { + serializedName: "azureStorageAccounts", + type: { + name: "Dictionary", + value: { + type: { + name: "Composite", + className: "AzureStorageInfoValue" + } + } + } + }, + connectionStrings: { + serializedName: "connectionStrings", + type: { + name: "Sequence", + element: { + type: { + name: "Composite", + className: "ConnStringInfo" + } + } + } + }, + machineKey: { + readOnly: true, + serializedName: "machineKey", + type: { + name: "Composite", + className: "SiteMachineKey" + } + }, + handlerMappings: { + serializedName: "handlerMappings", + type: { + name: "Sequence", + element: { + type: { + name: "Composite", + className: "HandlerMapping" + } + } + } + }, + documentRoot: { + serializedName: "documentRoot", + type: { + name: "String" + } + }, + scmType: { + serializedName: "scmType", + type: { + name: "String" + } + }, + use32BitWorkerProcess: { + serializedName: "use32BitWorkerProcess", + type: { + name: "Boolean" + } + }, + webSocketsEnabled: { + serializedName: "webSocketsEnabled", + type: { + name: "Boolean" + } + }, + alwaysOn: { + serializedName: "alwaysOn", + type: { + name: "Boolean" + } + }, + javaVersion: { + serializedName: "javaVersion", + type: { + name: "String" + } + }, + javaContainer: { + serializedName: "javaContainer", + type: { + name: "String" + } + }, + javaContainerVersion: { + serializedName: "javaContainerVersion", + type: { + name: "String" + } + }, + appCommandLine: { + serializedName: "appCommandLine", + type: { + name: "String" + } + }, + managedPipelineMode: { + serializedName: "managedPipelineMode", + type: { + name: "Enum", + allowedValues: [ + "Integrated", + "Classic" + ] + } + }, + virtualApplications: { + serializedName: "virtualApplications", + type: { + name: "Sequence", + element: { + type: { + name: "Composite", + className: "VirtualApplication" + } + } + } + }, + loadBalancing: { + serializedName: "loadBalancing", + type: { + name: "Enum", + allowedValues: [ + "WeightedRoundRobin", + "LeastRequests", + "LeastResponseTime", + "WeightedTotalTraffic", + "RequestHash" + ] + } + }, + experiments: { + serializedName: "experiments", + type: { + name: "Composite", + className: "Experiments" + } + }, + limits: { + serializedName: "limits", + type: { + name: "Composite", + className: "SiteLimits" + } + }, + autoHealEnabled: { + serializedName: "autoHealEnabled", + type: { + name: "Boolean" + } + }, + autoHealRules: { + serializedName: "autoHealRules", + type: { + name: "Composite", + className: "AutoHealRules" + } + }, + tracingOptions: { + serializedName: "tracingOptions", + type: { + name: "String" + } + }, + vnetName: { + serializedName: "vnetName", + type: { + name: "String" + } + }, + cors: { + serializedName: "cors", + type: { + name: "Composite", + className: "CorsSettings" + } + }, + push: { + serializedName: "push", + type: { + name: "Composite", + className: "PushSettings" + } + }, + apiDefinition: { + serializedName: "apiDefinition", + type: { + name: "Composite", + className: "ApiDefinitionInfo" + } + }, + autoSwapSlotName: { + serializedName: "autoSwapSlotName", + type: { + name: "String" + } + }, + localMySqlEnabled: { + serializedName: "localMySqlEnabled", + defaultValue: false, + type: { + name: "Boolean" + } + }, + managedServiceIdentityId: { + serializedName: "managedServiceIdentityId", + type: { + name: "Number" + } + }, + xManagedServiceIdentityId: { + serializedName: "xManagedServiceIdentityId", + type: { + name: "Number" + } + }, + ipSecurityRestrictions: { + serializedName: "ipSecurityRestrictions", + type: { + name: "Sequence", + element: { + type: { + name: "Composite", + className: "IpSecurityRestriction" + } + } + } + }, + scmIpSecurityRestrictions: { + serializedName: "scmIpSecurityRestrictions", + type: { + name: "Sequence", + element: { + type: { + name: "Composite", + className: "IpSecurityRestriction" + } + } + } + }, + scmIpSecurityRestrictionsUseMain: { + serializedName: "scmIpSecurityRestrictionsUseMain", + type: { + name: "Boolean" + } + }, + http20Enabled: { + serializedName: "http20Enabled", + defaultValue: true, + type: { + name: "Boolean" + } + }, + minTlsVersion: { + serializedName: "minTlsVersion", + type: { + name: "String" + } + }, + ftpsState: { + serializedName: "ftpsState", + type: { + name: "String" + } + }, + reservedInstanceCount: { + serializedName: "reservedInstanceCount", + constraints: { + InclusiveMaximum: 10, + InclusiveMinimum: 0 + }, + type: { + name: "Number" + } + } + } + } +}; + +export const HostNameSslState: msRest.CompositeMapper = { + serializedName: "HostNameSslState", + type: { + name: "Composite", + className: "HostNameSslState", + modelProperties: { + name: { + serializedName: "name", + type: { + name: "String" + } + }, + sslState: { + serializedName: "sslState", + type: { + name: "Enum", + allowedValues: [ + "Disabled", + "SniEnabled", + "IpBasedEnabled" + ] + } + }, + virtualIP: { + serializedName: "virtualIP", + type: { + name: "String" + } + }, + thumbprint: { + serializedName: "thumbprint", + type: { + name: "String" + } + }, + toUpdate: { + serializedName: "toUpdate", + type: { + name: "Boolean" + } + }, + hostType: { + serializedName: "hostType", + type: { + name: "Enum", + allowedValues: [ + "Standard", + "Repository" + ] + } + } + } + } +}; + +export const Site: msRest.CompositeMapper = { + serializedName: "Site", + type: { + name: "Composite", + className: "Site", + modelProperties: { + ...Resource.type.modelProperties, + state: { + readOnly: true, + serializedName: "properties.state", + type: { + name: "String" + } + }, + hostNames: { + readOnly: true, + serializedName: "properties.hostNames", + type: { + name: "Sequence", + element: { + type: { + name: "String" + } + } + } + }, + repositorySiteName: { + readOnly: true, + serializedName: "properties.repositorySiteName", + type: { + name: "String" + } + }, + usageState: { + readOnly: true, + serializedName: "properties.usageState", + type: { + name: "Enum", + allowedValues: [ + "Normal", + "Exceeded" + ] + } + }, + enabled: { + serializedName: "properties.enabled", + type: { + name: "Boolean" + } + }, + enabledHostNames: { + readOnly: true, + serializedName: "properties.enabledHostNames", + type: { + name: "Sequence", + element: { + type: { + name: "String" + } + } + } + }, + availabilityState: { + readOnly: true, + serializedName: "properties.availabilityState", + type: { + name: "Enum", + allowedValues: [ + "Normal", + "Limited", + "DisasterRecoveryMode" + ] + } + }, + hostNameSslStates: { + serializedName: "properties.hostNameSslStates", + type: { + name: "Sequence", + element: { + type: { + name: "Composite", + className: "HostNameSslState" + } + } + } + }, + serverFarmId: { + serializedName: "properties.serverFarmId", + type: { + name: "String" + } + }, + reserved: { + serializedName: "properties.reserved", + defaultValue: false, + type: { + name: "Boolean" + } + }, + isXenon: { + serializedName: "properties.isXenon", + defaultValue: false, + type: { + name: "Boolean" + } + }, + hyperV: { + serializedName: "properties.hyperV", + defaultValue: false, + type: { + name: "Boolean" + } + }, + lastModifiedTimeUtc: { + readOnly: true, + serializedName: "properties.lastModifiedTimeUtc", + type: { + name: "DateTime" + } + }, + siteConfig: { + serializedName: "properties.siteConfig", + type: { + name: "Composite", + className: "SiteConfig" + } + }, + trafficManagerHostNames: { + readOnly: true, + serializedName: "properties.trafficManagerHostNames", + type: { + name: "Sequence", + element: { + type: { + name: "String" + } + } + } + }, + scmSiteAlsoStopped: { + serializedName: "properties.scmSiteAlsoStopped", + defaultValue: false, + type: { + name: "Boolean" + } + }, + targetSwapSlot: { + readOnly: true, + serializedName: "properties.targetSwapSlot", + type: { + name: "String" + } + }, + hostingEnvironmentProfile: { + serializedName: "properties.hostingEnvironmentProfile", + type: { + name: "Composite", + className: "HostingEnvironmentProfile" + } + }, + clientAffinityEnabled: { + serializedName: "properties.clientAffinityEnabled", + type: { + name: "Boolean" + } + }, + clientCertEnabled: { + serializedName: "properties.clientCertEnabled", + type: { + name: "Boolean" + } + }, + clientCertExclusionPaths: { + serializedName: "properties.clientCertExclusionPaths", + type: { + name: "String" + } + }, + hostNamesDisabled: { + serializedName: "properties.hostNamesDisabled", + type: { + name: "Boolean" + } + }, + outboundIpAddresses: { + readOnly: true, + serializedName: "properties.outboundIpAddresses", + type: { + name: "String" + } + }, + possibleOutboundIpAddresses: { + readOnly: true, + serializedName: "properties.possibleOutboundIpAddresses", + type: { + name: "String" + } + }, + containerSize: { + serializedName: "properties.containerSize", + type: { + name: "Number" + } + }, + dailyMemoryTimeQuota: { + serializedName: "properties.dailyMemoryTimeQuota", + type: { + name: "Number" + } + }, + suspendedTill: { + readOnly: true, + serializedName: "properties.suspendedTill", + type: { + name: "DateTime" + } + }, + maxNumberOfWorkers: { + readOnly: true, + serializedName: "properties.maxNumberOfWorkers", + type: { + name: "Number" + } + }, + cloningInfo: { + serializedName: "properties.cloningInfo", + type: { + name: "Composite", + className: "CloningInfo" + } + }, + resourceGroup: { + readOnly: true, + serializedName: "properties.resourceGroup", + type: { + name: "String" + } + }, + isDefaultContainer: { + readOnly: true, + serializedName: "properties.isDefaultContainer", + type: { + name: "Boolean" + } + }, + defaultHostName: { + readOnly: true, + serializedName: "properties.defaultHostName", + type: { + name: "String" + } + }, + slotSwapStatus: { + readOnly: true, + serializedName: "properties.slotSwapStatus", + type: { + name: "Composite", + className: "SlotSwapStatus" + } + }, + httpsOnly: { + serializedName: "properties.httpsOnly", + type: { + name: "Boolean" + } + }, + redundancyMode: { + serializedName: "properties.redundancyMode", + type: { + name: "Enum", + allowedValues: [ + "None", + "Manual", + "Failover", + "ActiveActive", + "GeoRedundant" + ] + } + }, + inProgressOperationId: { + readOnly: true, + serializedName: "properties.inProgressOperationId", + type: { + name: "Uuid" + } + }, + geoDistributions: { + serializedName: "properties.geoDistributions", + type: { + name: "Sequence", + element: { + type: { + name: "Composite", + className: "GeoDistribution" + } + } + } + }, + identity: { + serializedName: "identity", + type: { + name: "Composite", + className: "ManagedServiceIdentity" + } + } + } + } +}; + +export const Capability: msRest.CompositeMapper = { + serializedName: "Capability", + type: { + name: "Composite", + className: "Capability", + modelProperties: { + name: { + serializedName: "name", + type: { + name: "String" + } + }, + value: { + serializedName: "value", + type: { + name: "String" + } + }, + reason: { + serializedName: "reason", + type: { + name: "String" + } + } + } + } +}; + +export const SkuCapacity: msRest.CompositeMapper = { + serializedName: "SkuCapacity", + type: { + name: "Composite", + className: "SkuCapacity", + modelProperties: { + minimum: { + serializedName: "minimum", + type: { + name: "Number" + } + }, + maximum: { + serializedName: "maximum", + type: { + name: "Number" + } + }, + default: { + serializedName: "default", + type: { + name: "Number" + } + }, + scaleType: { + serializedName: "scaleType", + type: { + name: "String" + } + } + } + } +}; + +export const SkuDescription: msRest.CompositeMapper = { + serializedName: "SkuDescription", + type: { + name: "Composite", + className: "SkuDescription", + modelProperties: { + name: { + serializedName: "name", + type: { + name: "String" + } + }, + tier: { + serializedName: "tier", + type: { + name: "String" + } + }, + size: { + serializedName: "size", + type: { + name: "String" + } + }, + family: { + serializedName: "family", + type: { + name: "String" + } + }, + capacity: { + serializedName: "capacity", + type: { + name: "Number" + } + }, + skuCapacity: { + serializedName: "skuCapacity", + type: { + name: "Composite", + className: "SkuCapacity" + } + }, + locations: { + serializedName: "locations", + type: { + name: "Sequence", + element: { + type: { + name: "String" + } + } + } + }, + capabilities: { + serializedName: "capabilities", + type: { + name: "Sequence", + element: { + type: { + name: "Composite", + className: "Capability" + } + } + } + } + } + } +}; + +export const AppServicePlan: msRest.CompositeMapper = { + serializedName: "AppServicePlan", + type: { + name: "Composite", + className: "AppServicePlan", + modelProperties: { + ...Resource.type.modelProperties, + workerTierName: { + serializedName: "properties.workerTierName", + type: { + name: "String" + } + }, + status: { + readOnly: true, + serializedName: "properties.status", + type: { + name: "Enum", + allowedValues: [ + "Ready", + "Pending", + "Creating" + ] + } + }, + subscription: { + readOnly: true, + serializedName: "properties.subscription", + type: { + name: "String" + } + }, + hostingEnvironmentProfile: { + serializedName: "properties.hostingEnvironmentProfile", + type: { + name: "Composite", + className: "HostingEnvironmentProfile" + } + }, + maximumNumberOfWorkers: { + readOnly: true, + serializedName: "properties.maximumNumberOfWorkers", + type: { + name: "Number" + } + }, + geoRegion: { + readOnly: true, + serializedName: "properties.geoRegion", + type: { + name: "String" + } + }, + perSiteScaling: { + serializedName: "properties.perSiteScaling", + defaultValue: false, + type: { + name: "Boolean" + } + }, + maximumElasticWorkerCount: { + serializedName: "properties.maximumElasticWorkerCount", + type: { + name: "Number" + } + }, + numberOfSites: { + readOnly: true, + serializedName: "properties.numberOfSites", + type: { + name: "Number" + } + }, + isSpot: { + serializedName: "properties.isSpot", + type: { + name: "Boolean" + } + }, + spotExpirationTime: { + serializedName: "properties.spotExpirationTime", + type: { + name: "DateTime" + } + }, + freeOfferExpirationTime: { + serializedName: "properties.freeOfferExpirationTime", + type: { + name: "DateTime" + } + }, + resourceGroup: { + readOnly: true, + serializedName: "properties.resourceGroup", + type: { + name: "String" + } + }, + reserved: { + serializedName: "properties.reserved", + defaultValue: false, + type: { + name: "Boolean" + } + }, + isXenon: { + serializedName: "properties.isXenon", + defaultValue: false, + type: { + name: "Boolean" + } + }, + hyperV: { + serializedName: "properties.hyperV", + defaultValue: false, + type: { + name: "Boolean" + } + }, + targetWorkerCount: { + serializedName: "properties.targetWorkerCount", + type: { + name: "Number" + } + }, + targetWorkerSizeId: { + serializedName: "properties.targetWorkerSizeId", + type: { + name: "Number" + } + }, + provisioningState: { + readOnly: true, + serializedName: "properties.provisioningState", + type: { + name: "Enum", + allowedValues: [ + "Succeeded", + "Failed", + "Canceled", + "InProgress", + "Deleting" + ] + } + }, + sku: { + serializedName: "sku", + type: { + name: "Composite", + className: "SkuDescription" + } + } + } + } +}; + +export const DefaultErrorResponseErrorDetailsItem: msRest.CompositeMapper = { + serializedName: "DefaultErrorResponse_error_detailsItem", + type: { + name: "Composite", + className: "DefaultErrorResponseErrorDetailsItem", + modelProperties: { + code: { + readOnly: true, + serializedName: "code", + type: { + name: "String" + } + }, + message: { + readOnly: true, + serializedName: "message", + type: { + name: "String" + } + }, + target: { + readOnly: true, + serializedName: "target", + type: { + name: "String" + } + } + } + } +}; + +export const DefaultErrorResponseError: msRest.CompositeMapper = { + serializedName: "DefaultErrorResponse_error", + type: { + name: "Composite", + className: "DefaultErrorResponseError", + modelProperties: { + code: { + readOnly: true, + serializedName: "code", + type: { + name: "String" + } + }, + message: { + readOnly: true, + serializedName: "message", + type: { + name: "String" + } + }, + target: { + readOnly: true, + serializedName: "target", + type: { + name: "String" + } + }, + details: { + serializedName: "details", + type: { + name: "Sequence", + element: { + type: { + name: "Composite", + className: "DefaultErrorResponseErrorDetailsItem" + } + } + } + }, + innererror: { + readOnly: true, + serializedName: "innererror", + type: { + name: "String" + } + } + } + } +}; + +export const DefaultErrorResponse: msRest.CompositeMapper = { + serializedName: "DefaultErrorResponse", + type: { + name: "Composite", + className: "DefaultErrorResponse", + modelProperties: { + error: { + readOnly: true, + serializedName: "error", + type: { + name: "Composite", + className: "DefaultErrorResponseError" + } + } + } + } +}; + +export const VirtualNetworkProfile: msRest.CompositeMapper = { + serializedName: "VirtualNetworkProfile", + type: { + name: "Composite", + className: "VirtualNetworkProfile", + modelProperties: { + id: { + serializedName: "id", + type: { + name: "String" + } + }, + name: { + readOnly: true, + serializedName: "name", + type: { + name: "String" + } + }, + type: { + readOnly: true, + serializedName: "type", + type: { + name: "String" + } + }, + subnet: { + serializedName: "subnet", + type: { + name: "String" + } + } + } + } +}; + +export const WorkerPool: msRest.CompositeMapper = { + serializedName: "WorkerPool", + type: { + name: "Composite", + className: "WorkerPool", + modelProperties: { + workerSizeId: { + serializedName: "workerSizeId", + type: { + name: "Number" + } + }, + computeMode: { + serializedName: "computeMode", + type: { + name: "Enum", + allowedValues: [ + "Shared", + "Dedicated", + "Dynamic" + ] + } + }, + workerSize: { + serializedName: "workerSize", + type: { + name: "String" + } + }, + workerCount: { + serializedName: "workerCount", + type: { + name: "Number" + } + }, + instanceNames: { + readOnly: true, + serializedName: "instanceNames", + type: { + name: "Sequence", + element: { + type: { + name: "String" + } + } + } + } + } + } +}; + +export const VirtualIPMapping: msRest.CompositeMapper = { + serializedName: "VirtualIPMapping", + type: { + name: "Composite", + className: "VirtualIPMapping", + modelProperties: { + virtualIP: { + serializedName: "virtualIP", + type: { + name: "String" + } + }, + internalHttpPort: { + serializedName: "internalHttpPort", + type: { + name: "Number" + } + }, + internalHttpsPort: { + serializedName: "internalHttpsPort", + type: { + name: "Number" + } + }, + inUse: { + serializedName: "inUse", + type: { + name: "Boolean" + } + } + } + } +}; + +export const StampCapacity: msRest.CompositeMapper = { + serializedName: "StampCapacity", + type: { + name: "Composite", + className: "StampCapacity", + modelProperties: { + name: { + serializedName: "name", + type: { + name: "String" + } + }, + availableCapacity: { + serializedName: "availableCapacity", + type: { + name: "Number" + } + }, + totalCapacity: { + serializedName: "totalCapacity", + type: { + name: "Number" + } + }, + unit: { + serializedName: "unit", + type: { + name: "String" + } + }, + computeMode: { + serializedName: "computeMode", + type: { + name: "Enum", + allowedValues: [ + "Shared", + "Dedicated", + "Dynamic" + ] + } + }, + workerSize: { + serializedName: "workerSize", + type: { + name: "Enum", + allowedValues: [ + "Small", + "Medium", + "Large", + "D1", + "D2", + "D3", + "Default" + ] + } + }, + workerSizeId: { + serializedName: "workerSizeId", + type: { + name: "Number" + } + }, + excludeFromCapacityAllocation: { + serializedName: "excludeFromCapacityAllocation", + type: { + name: "Boolean" + } + }, + isApplicableForAllComputeModes: { + serializedName: "isApplicableForAllComputeModes", + type: { + name: "Boolean" + } + }, + siteMode: { + serializedName: "siteMode", + type: { + name: "String" + } + }, + isLinux: { + serializedName: "isLinux", + type: { + name: "Boolean" + } + } + } + } +}; + +export const NetworkAccessControlEntry: msRest.CompositeMapper = { + serializedName: "NetworkAccessControlEntry", + type: { + name: "Composite", + className: "NetworkAccessControlEntry", + modelProperties: { + action: { + serializedName: "action", + type: { + name: "Enum", + allowedValues: [ + "Permit", + "Deny" + ] + } + }, + description: { + serializedName: "description", + type: { + name: "String" + } + }, + order: { + serializedName: "order", + type: { + name: "Number" + } + }, + remoteSubnet: { + serializedName: "remoteSubnet", + type: { + name: "String" + } + } + } + } +}; + +export const AppServiceEnvironment: msRest.CompositeMapper = { + 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: { + readOnly: true, + serializedName: "provisioningState", + type: { + name: "Enum", + allowedValues: [ + "Succeeded", + "Failed", + "Canceled", + "InProgress", + "Deleting" + ] + } + }, + status: { + readOnly: true, + serializedName: "status", + type: { + name: "Enum", + allowedValues: [ + "Preparing", + "Ready", + "Scaling", + "Deleting" + ] + } + }, + vnetName: { + serializedName: "vnetName", + type: { + name: "String" + } + }, + vnetResourceGroupName: { + serializedName: "vnetResourceGroupName", + type: { + name: "String" + } + }, + vnetSubnetName: { + serializedName: "vnetSubnetName", + type: { + name: "String" + } + }, + virtualNetwork: { + required: true, + serializedName: "virtualNetwork", + type: { + name: "Composite", + className: "VirtualNetworkProfile" + } + }, + internalLoadBalancingMode: { + serializedName: "internalLoadBalancingMode", + type: { + name: "Enum", + allowedValues: [ + "None", + "Web", + "Publishing" + ] + } + }, + multiSize: { + serializedName: "multiSize", + type: { + name: "String" + } + }, + multiRoleCount: { + serializedName: "multiRoleCount", + type: { + name: "Number" + } + }, + workerPools: { + required: true, + serializedName: "workerPools", + type: { + name: "Sequence", + element: { + type: { + name: "Composite", + className: "WorkerPool" + } + } + } + }, + ipsslAddressCount: { + serializedName: "ipsslAddressCount", + type: { + name: "Number" + } + }, + databaseEdition: { + readOnly: true, + serializedName: "databaseEdition", + type: { + name: "String" + } + }, + databaseServiceObjective: { + readOnly: true, + serializedName: "databaseServiceObjective", + type: { + name: "String" + } + }, + upgradeDomains: { + readOnly: true, + serializedName: "upgradeDomains", + type: { + name: "Number" + } + }, + subscriptionId: { + readOnly: true, + serializedName: "subscriptionId", + type: { + name: "String" + } + }, + dnsSuffix: { + serializedName: "dnsSuffix", + type: { + name: "String" + } + }, + lastAction: { + readOnly: true, + serializedName: "lastAction", + type: { + name: "String" + } + }, + lastActionResult: { + readOnly: true, + serializedName: "lastActionResult", + type: { + name: "String" + } + }, + allowedMultiSizes: { + readOnly: true, + serializedName: "allowedMultiSizes", + type: { + name: "String" + } + }, + allowedWorkerSizes: { + readOnly: true, + serializedName: "allowedWorkerSizes", + type: { + name: "String" + } + }, + maximumNumberOfMachines: { + readOnly: true, + serializedName: "maximumNumberOfMachines", + type: { + name: "Number" + } + }, + vipMappings: { + readOnly: true, + serializedName: "vipMappings", + type: { + name: "Sequence", + element: { + type: { + name: "Composite", + className: "VirtualIPMapping" + } + } + } + }, + environmentCapacities: { + readOnly: true, + serializedName: "environmentCapacities", + type: { + name: "Sequence", + element: { + type: { + name: "Composite", + className: "StampCapacity" + } + } + } + }, + networkAccessControlList: { + serializedName: "networkAccessControlList", + type: { + name: "Sequence", + element: { + type: { + name: "Composite", + className: "NetworkAccessControlEntry" + } + } + } + }, + environmentIsHealthy: { + readOnly: true, + serializedName: "environmentIsHealthy", + type: { + name: "Boolean" + } + }, + environmentStatus: { + readOnly: true, + serializedName: "environmentStatus", + type: { + name: "String" + } + }, + resourceGroup: { + readOnly: true, + serializedName: "resourceGroup", + type: { + name: "String" + } + }, + frontEndScaleFactor: { + serializedName: "frontEndScaleFactor", + type: { + name: "Number" + } + }, + defaultFrontEndScaleFactor: { + readOnly: true, + serializedName: "defaultFrontEndScaleFactor", + type: { + name: "Number" + } + }, + apiManagementAccountId: { + serializedName: "apiManagementAccountId", + type: { + name: "String" + } + }, + suspended: { + serializedName: "suspended", + type: { + name: "Boolean" + } + }, + dynamicCacheEnabled: { + serializedName: "dynamicCacheEnabled", + type: { + name: "Boolean" + } + }, + clusterSettings: { + serializedName: "clusterSettings", + type: { + name: "Sequence", + element: { + type: { + name: "Composite", + className: "NameValuePair" + } + } + } + }, + userWhitelistedIpRanges: { + serializedName: "userWhitelistedIpRanges", + type: { + name: "Sequence", + element: { + type: { + name: "String" + } + } + } + }, + hasLinuxWorkers: { + serializedName: "hasLinuxWorkers", + type: { + name: "Boolean" + } + }, + sslCertKeyVaultId: { + serializedName: "sslCertKeyVaultId", + type: { + name: "String" + } + }, + sslCertKeyVaultSecretName: { + serializedName: "sslCertKeyVaultSecretName", + type: { + name: "String" + } + } + } + } +}; + +export const CsmOperationDisplay: msRest.CompositeMapper = { + serializedName: "CsmOperationDisplay", + type: { + name: "Composite", + className: "CsmOperationDisplay", + modelProperties: { + provider: { + serializedName: "provider", + type: { + name: "String" + } + }, + resource: { + serializedName: "resource", + type: { + name: "String" + } + }, + operation: { + serializedName: "operation", + type: { + name: "String" + } + }, + description: { + serializedName: "description", + type: { + name: "String" + } + } + } + } +}; + +export const Dimension: msRest.CompositeMapper = { + serializedName: "Dimension", + type: { + name: "Composite", + className: "Dimension", + modelProperties: { + name: { + serializedName: "name", + type: { + name: "String" + } + }, + displayName: { + serializedName: "displayName", + type: { + name: "String" + } + }, + internalName: { + serializedName: "internalName", + type: { + name: "String" + } + }, + toBeExportedForShoebox: { + serializedName: "toBeExportedForShoebox", + type: { + name: "Boolean" + } + } + } + } +}; + +export const MetricAvailability: msRest.CompositeMapper = { + serializedName: "MetricAvailability", + type: { + name: "Composite", + className: "MetricAvailability", + modelProperties: { + timeGrain: { + serializedName: "timeGrain", + type: { + name: "String" + } + }, + blobDuration: { + serializedName: "blobDuration", + type: { + name: "String" + } + } + } + } +}; + +export const MetricSpecification: msRest.CompositeMapper = { + serializedName: "MetricSpecification", + type: { + name: "Composite", + className: "MetricSpecification", + modelProperties: { + name: { + serializedName: "name", + type: { + name: "String" + } + }, + displayName: { + serializedName: "displayName", + type: { + name: "String" + } + }, + displayDescription: { + serializedName: "displayDescription", + type: { + name: "String" + } + }, + unit: { + serializedName: "unit", + type: { + name: "String" + } + }, + aggregationType: { + serializedName: "aggregationType", + type: { + name: "String" + } + }, + supportsInstanceLevelAggregation: { + serializedName: "supportsInstanceLevelAggregation", + type: { + name: "Boolean" + } + }, + enableRegionalMdmAccount: { + serializedName: "enableRegionalMdmAccount", + type: { + name: "Boolean" + } + }, + sourceMdmAccount: { + serializedName: "sourceMdmAccount", + type: { + name: "String" + } + }, + sourceMdmNamespace: { + serializedName: "sourceMdmNamespace", + type: { + name: "String" + } + }, + metricFilterPattern: { + serializedName: "metricFilterPattern", + type: { + name: "String" + } + }, + fillGapWithZero: { + serializedName: "fillGapWithZero", + type: { + name: "Boolean" + } + }, + isInternal: { + serializedName: "isInternal", + type: { + name: "Boolean" + } + }, + dimensions: { + serializedName: "dimensions", + type: { + name: "Sequence", + element: { + type: { + name: "Composite", + className: "Dimension" + } + } + } + }, + category: { + serializedName: "category", + type: { + name: "String" + } + }, + availabilities: { + serializedName: "availabilities", + type: { + name: "Sequence", + element: { + type: { + name: "Composite", + className: "MetricAvailability" + } + } + } + } + } + } +}; + +export const LogSpecification: msRest.CompositeMapper = { + serializedName: "LogSpecification", + type: { + name: "Composite", + className: "LogSpecification", + modelProperties: { + name: { + serializedName: "name", + type: { + name: "String" + } + }, + displayName: { + serializedName: "displayName", + type: { + name: "String" + } + }, + blobDuration: { + serializedName: "blobDuration", + type: { + name: "String" + } + } + } + } +}; + +export const ServiceSpecification: msRest.CompositeMapper = { + serializedName: "ServiceSpecification", + type: { + name: "Composite", + className: "ServiceSpecification", + modelProperties: { + metricSpecifications: { + serializedName: "metricSpecifications", + type: { + name: "Sequence", + element: { + type: { + name: "Composite", + className: "MetricSpecification" + } + } + } + }, + logSpecifications: { + serializedName: "logSpecifications", + type: { + name: "Sequence", + element: { + type: { + name: "Composite", + className: "LogSpecification" + } + } + } + } + } + } +}; + +export const CsmOperationDescriptionProperties: msRest.CompositeMapper = { + serializedName: "CsmOperationDescriptionProperties", + type: { + name: "Composite", + className: "CsmOperationDescriptionProperties", + modelProperties: { + serviceSpecification: { + serializedName: "serviceSpecification", + type: { + name: "Composite", + className: "ServiceSpecification" + } + } + } + } +}; + +export const CsmOperationDescription: msRest.CompositeMapper = { + serializedName: "CsmOperationDescription", + type: { + name: "Composite", + className: "CsmOperationDescription", + modelProperties: { + name: { + serializedName: "name", + type: { + name: "String" + } + }, + display: { + serializedName: "display", + type: { + name: "Composite", + className: "CsmOperationDisplay" + } + }, + origin: { + serializedName: "origin", + type: { + name: "String" + } + }, + properties: { + serializedName: "properties", + type: { + name: "Composite", + className: "CsmOperationDescriptionProperties" + } + } + } + } +}; + +export const LocalizableString: msRest.CompositeMapper = { + serializedName: "LocalizableString", + type: { + name: "Composite", + className: "LocalizableString", + modelProperties: { + value: { + serializedName: "value", + type: { + name: "String" + } + }, + localizedValue: { + serializedName: "localizedValue", + type: { + name: "String" + } + } + } + } +}; + +export const CsmUsageQuota: msRest.CompositeMapper = { + serializedName: "CsmUsageQuota", + type: { + name: "Composite", + className: "CsmUsageQuota", + modelProperties: { + unit: { + serializedName: "unit", + type: { + name: "String" + } + }, + nextResetTime: { + serializedName: "nextResetTime", + type: { + name: "DateTime" + } + }, + currentValue: { + serializedName: "currentValue", + type: { + name: "Number" + } + }, + limit: { + serializedName: "limit", + type: { + name: "Number" + } + }, + name: { + serializedName: "name", + type: { + name: "Composite", + className: "LocalizableString" + } + } + } + } +}; + +export const ErrorEntity: msRest.CompositeMapper = { + serializedName: "ErrorEntity", + type: { + name: "Composite", + className: "ErrorEntity", + modelProperties: { + extendedCode: { + serializedName: "extendedCode", + type: { + name: "String" + } + }, + messageTemplate: { + serializedName: "messageTemplate", + type: { + name: "String" + } + }, + parameters: { + serializedName: "parameters", + type: { + name: "Sequence", + element: { + type: { + name: "String" + } + } + } + }, + innerErrors: { + serializedName: "innerErrors", + type: { + name: "Sequence", + element: { + type: { + name: "Composite", + className: "ErrorEntity" + } + } + } + }, + code: { + serializedName: "code", + type: { + name: "String" + } + }, + message: { + serializedName: "message", + type: { + name: "String" + } + } + } + } +}; + +export const NameIdentifier: msRest.CompositeMapper = { + serializedName: "NameIdentifier", + type: { + name: "Composite", + className: "NameIdentifier", + modelProperties: { + name: { + serializedName: "name", + type: { + name: "String" + } + } + } + } +}; + +export const Operation: msRest.CompositeMapper = { + serializedName: "Operation", + type: { + name: "Composite", + className: "Operation", + modelProperties: { + id: { + serializedName: "id", + type: { + name: "String" + } + }, + name: { + serializedName: "name", + type: { + name: "String" + } + }, + status: { + serializedName: "status", + type: { + name: "Enum", + allowedValues: [ + "InProgress", + "Failed", + "Succeeded", + "TimedOut", + "Created" + ] + } + }, + errors: { + serializedName: "errors", + type: { + name: "Sequence", + element: { + type: { + name: "Composite", + className: "ErrorEntity" + } + } + } + }, + createdTime: { + serializedName: "createdTime", + type: { + name: "DateTime" + } + }, + modifiedTime: { + serializedName: "modifiedTime", + type: { + name: "DateTime" + } + }, + expirationTime: { + serializedName: "expirationTime", + type: { + name: "DateTime" + } + }, + geoMasterOperationId: { + serializedName: "geoMasterOperationId", + type: { + name: "Uuid" + } + } + } + } +}; + +export const ResourceMetricName: msRest.CompositeMapper = { + serializedName: "ResourceMetricName", + type: { + name: "Composite", + className: "ResourceMetricName", + modelProperties: { + value: { + readOnly: true, + serializedName: "value", + type: { + name: "String" + } + }, + localizedValue: { + readOnly: true, + serializedName: "localizedValue", + type: { + name: "String" + } + } + } + } +}; + +export const ResourceMetricProperty: msRest.CompositeMapper = { + serializedName: "ResourceMetricProperty", + type: { + name: "Composite", + className: "ResourceMetricProperty", + modelProperties: { + key: { + serializedName: "key", + type: { + name: "String" + } + }, + value: { + serializedName: "value", + type: { + name: "String" + } + } + } + } +}; + +export const ResourceMetricValue: msRest.CompositeMapper = { + serializedName: "ResourceMetricValue", + type: { + name: "Composite", + className: "ResourceMetricValue", + modelProperties: { + timestamp: { + readOnly: true, + serializedName: "timestamp", + type: { + name: "String" + } + }, + average: { + readOnly: true, + serializedName: "average", + type: { + name: "Number" + } + }, + minimum: { + readOnly: true, + serializedName: "minimum", + type: { + name: "Number" + } + }, + maximum: { + readOnly: true, + serializedName: "maximum", + type: { + name: "Number" + } + }, + total: { + readOnly: true, + serializedName: "total", + type: { + name: "Number" + } + }, + count: { + readOnly: true, + serializedName: "count", + type: { + name: "Number" + } + }, + properties: { + readOnly: true, + serializedName: "properties", + type: { + name: "Sequence", + element: { + type: { + name: "Composite", + className: "ResourceMetricProperty" + } + } + } + } + } + } +}; + +export const ResourceMetric: msRest.CompositeMapper = { + serializedName: "ResourceMetric", + type: { + name: "Composite", + className: "ResourceMetric", + modelProperties: { + name: { + readOnly: true, + serializedName: "name", + type: { + name: "Composite", + className: "ResourceMetricName" + } + }, + unit: { + readOnly: true, + serializedName: "unit", + type: { + name: "String" + } + }, + timeGrain: { + readOnly: true, + serializedName: "timeGrain", + type: { + name: "String" + } + }, + startTime: { + readOnly: true, + serializedName: "startTime", + type: { + name: "DateTime" + } + }, + endTime: { + readOnly: true, + serializedName: "endTime", + type: { + name: "DateTime" + } + }, + resourceId: { + readOnly: true, + serializedName: "resourceId", + type: { + name: "String" + } + }, + id: { + readOnly: true, + serializedName: "id", + type: { + name: "String" + } + }, + metricValues: { + readOnly: true, + serializedName: "metricValues", + type: { + name: "Sequence", + element: { + type: { + name: "Composite", + className: "ResourceMetricValue" + } + } + } + }, + properties: { + readOnly: true, + serializedName: "properties", + type: { + name: "Sequence", + element: { + type: { + name: "Composite", + className: "ResourceMetricProperty" + } + } + } + } + } + } +}; + +export const FileSystemApplicationLogsConfig: msRest.CompositeMapper = { + serializedName: "FileSystemApplicationLogsConfig", + type: { + name: "Composite", + className: "FileSystemApplicationLogsConfig", + modelProperties: { + level: { + serializedName: "level", + defaultValue: 'Off', + type: { + name: "Enum", + allowedValues: [ + "Off", + "Verbose", + "Information", + "Warning", + "Error" + ] + } + } + } + } +}; + +export const AzureTableStorageApplicationLogsConfig: msRest.CompositeMapper = { + serializedName: "AzureTableStorageApplicationLogsConfig", + type: { + name: "Composite", + className: "AzureTableStorageApplicationLogsConfig", + modelProperties: { + level: { + serializedName: "level", + type: { + name: "Enum", + allowedValues: [ + "Off", + "Verbose", + "Information", + "Warning", + "Error" + ] + } + }, + sasUrl: { + required: true, + serializedName: "sasUrl", + type: { + name: "String" + } + } + } + } +}; + +export const AzureBlobStorageApplicationLogsConfig: msRest.CompositeMapper = { + serializedName: "AzureBlobStorageApplicationLogsConfig", + type: { + name: "Composite", + className: "AzureBlobStorageApplicationLogsConfig", + modelProperties: { + level: { + serializedName: "level", + type: { + name: "Enum", + allowedValues: [ + "Off", + "Verbose", + "Information", + "Warning", + "Error" + ] + } + }, + sasUrl: { + serializedName: "sasUrl", + type: { + name: "String" + } + }, + retentionInDays: { + serializedName: "retentionInDays", + type: { + name: "Number" + } + } + } + } +}; + +export const ApplicationLogsConfig: msRest.CompositeMapper = { + serializedName: "ApplicationLogsConfig", + type: { + name: "Composite", + className: "ApplicationLogsConfig", + modelProperties: { + fileSystem: { + serializedName: "fileSystem", + type: { + name: "Composite", + className: "FileSystemApplicationLogsConfig" + } + }, + azureTableStorage: { + serializedName: "azureTableStorage", + type: { + name: "Composite", + className: "AzureTableStorageApplicationLogsConfig" + } + }, + azureBlobStorage: { + serializedName: "azureBlobStorage", + type: { + name: "Composite", + className: "AzureBlobStorageApplicationLogsConfig" + } + } + } + } +}; + +export const AzureBlobStorageHttpLogsConfig: msRest.CompositeMapper = { + serializedName: "AzureBlobStorageHttpLogsConfig", + type: { + name: "Composite", + className: "AzureBlobStorageHttpLogsConfig", + modelProperties: { + sasUrl: { + serializedName: "sasUrl", + type: { + name: "String" + } + }, + retentionInDays: { + serializedName: "retentionInDays", + type: { + name: "Number" + } + }, + enabled: { + serializedName: "enabled", + type: { + name: "Boolean" + } + } + } + } +}; + +export const AzureStoragePropertyDictionaryResource: msRest.CompositeMapper = { + serializedName: "AzureStoragePropertyDictionaryResource", + type: { + name: "Composite", + className: "AzureStoragePropertyDictionaryResource", + modelProperties: { + ...ProxyOnlyResource.type.modelProperties, + properties: { + serializedName: "properties", + type: { + name: "Dictionary", + value: { + type: { + name: "Composite", + className: "AzureStorageInfoValue" + } + } + } + } + } + } +}; + +export const DatabaseBackupSetting: msRest.CompositeMapper = { + serializedName: "DatabaseBackupSetting", + type: { + name: "Composite", + className: "DatabaseBackupSetting", + modelProperties: { + databaseType: { + required: true, + serializedName: "databaseType", + type: { + name: "String" + } + }, + name: { + serializedName: "name", + type: { + name: "String" + } + }, + connectionStringName: { + serializedName: "connectionStringName", + type: { + name: "String" + } + }, + connectionString: { + serializedName: "connectionString", + type: { + name: "String" + } + } + } + } +}; + +export const BackupItem: msRest.CompositeMapper = { + serializedName: "BackupItem", + type: { + name: "Composite", + className: "BackupItem", + modelProperties: { + ...ProxyOnlyResource.type.modelProperties, + backupId: { + readOnly: true, + serializedName: "properties.id", + type: { + name: "Number" + } + }, + storageAccountUrl: { + readOnly: true, + serializedName: "properties.storageAccountUrl", + type: { + name: "String" + } + }, + blobName: { + readOnly: true, + serializedName: "properties.blobName", + type: { + name: "String" + } + }, + backupItemName: { + readOnly: true, + serializedName: "properties.name", + type: { + name: "String" + } + }, + status: { + readOnly: true, + serializedName: "properties.status", + type: { + name: "Enum", + allowedValues: [ + "InProgress", + "Failed", + "Succeeded", + "TimedOut", + "Created", + "Skipped", + "PartiallySucceeded", + "DeleteInProgress", + "DeleteFailed", + "Deleted" + ] + } + }, + sizeInBytes: { + readOnly: true, + serializedName: "properties.sizeInBytes", + type: { + name: "Number" + } + }, + created: { + readOnly: true, + serializedName: "properties.created", + type: { + name: "DateTime" + } + }, + log: { + readOnly: true, + serializedName: "properties.log", + type: { + name: "String" + } + }, + databases: { + readOnly: true, + serializedName: "properties.databases", + type: { + name: "Sequence", + element: { + type: { + name: "Composite", + className: "DatabaseBackupSetting" + } + } + } + }, + scheduled: { + readOnly: true, + serializedName: "properties.scheduled", + type: { + name: "Boolean" + } + }, + lastRestoreTimeStamp: { + readOnly: true, + serializedName: "properties.lastRestoreTimeStamp", + type: { + name: "DateTime" + } + }, + finishedTimeStamp: { + readOnly: true, + serializedName: "properties.finishedTimeStamp", + type: { + name: "DateTime" + } + }, + correlationId: { + readOnly: true, + serializedName: "properties.correlationId", + type: { + name: "String" + } + }, + websiteSizeInBytes: { + readOnly: true, + serializedName: "properties.websiteSizeInBytes", + type: { + name: "Number" + } + } + } + } +}; + +export const BackupSchedule: msRest.CompositeMapper = { + 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: { + serializedName: "startTime", + type: { + name: "DateTime" + } + }, + lastExecutionTime: { + readOnly: true, + serializedName: "lastExecutionTime", + type: { + name: "DateTime" + } + } + } + } +}; + +export const BackupRequest: msRest.CompositeMapper = { + serializedName: "BackupRequest", + type: { + name: "Composite", + className: "BackupRequest", + modelProperties: { + ...ProxyOnlyResource.type.modelProperties, + backupName: { + serializedName: "properties.backupName", + type: { + name: "String" + } + }, + enabled: { + serializedName: "properties.enabled", + type: { + name: "Boolean" + } + }, + storageAccountUrl: { + required: true, + serializedName: "properties.storageAccountUrl", + type: { + name: "String" + } + }, + backupSchedule: { + serializedName: "properties.backupSchedule", + type: { + name: "Composite", + className: "BackupSchedule" + } + }, + databases: { + serializedName: "properties.databases", + type: { + name: "Sequence", + element: { + type: { + name: "Composite", + className: "DatabaseBackupSetting" + } + } + } + } + } + } +}; + +export const ConnStringValueTypePair: msRest.CompositeMapper = { + 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" + ] + } + } + } + } +}; + +export const ConnectionStringDictionary: msRest.CompositeMapper = { + serializedName: "ConnectionStringDictionary", + type: { + name: "Composite", + className: "ConnectionStringDictionary", + modelProperties: { + ...ProxyOnlyResource.type.modelProperties, + properties: { + serializedName: "properties", + type: { + name: "Dictionary", + value: { + type: { + name: "Composite", + className: "ConnStringValueTypePair" + } + } + } + } + } + } +}; + +export const ContinuousWebJob: msRest.CompositeMapper = { + serializedName: "ContinuousWebJob", + type: { + name: "Composite", + className: "ContinuousWebJob", + modelProperties: { + ...ProxyOnlyResource.type.modelProperties, + status: { + serializedName: "properties.status", + type: { + name: "Enum", + allowedValues: [ + "Initializing", + "Starting", + "Running", + "PendingRestart", + "Stopped" + ] + } + }, + detailedStatus: { + serializedName: "properties.detailed_status", + type: { + name: "String" + } + }, + logUrl: { + serializedName: "properties.log_url", + type: { + name: "String" + } + }, + runCommand: { + serializedName: "properties.run_command", + type: { + name: "String" + } + }, + url: { + serializedName: "properties.url", + type: { + name: "String" + } + }, + extraInfoUrl: { + serializedName: "properties.extra_info_url", + type: { + name: "String" + } + }, + webJobType: { + serializedName: "properties.web_job_type", + type: { + name: "Enum", + allowedValues: [ + "Continuous", + "Triggered" + ] + } + }, + error: { + serializedName: "properties.error", + type: { + name: "String" + } + }, + usingSdk: { + serializedName: "properties.using_sdk", + type: { + name: "Boolean" + } + }, + settings: { + serializedName: "properties.settings", + type: { + name: "Dictionary", + value: { + type: { + name: "Object" + } + } + } + } + } + } +}; + +export const CsmPublishingProfileOptions: msRest.CompositeMapper = { + serializedName: "CsmPublishingProfileOptions", + type: { + name: "Composite", + className: "CsmPublishingProfileOptions", + modelProperties: { + format: { + serializedName: "format", + type: { + name: "String" + } + }, + includeDisasterRecoveryEndpoints: { + serializedName: "includeDisasterRecoveryEndpoints", + type: { + name: "Boolean" + } + } + } + } +}; + +export const CsmSlotEntity: msRest.CompositeMapper = { + serializedName: "CsmSlotEntity", + type: { + name: "Composite", + className: "CsmSlotEntity", + modelProperties: { + targetSlot: { + required: true, + serializedName: "targetSlot", + type: { + name: "String" + } + }, + preserveVnet: { + required: true, + serializedName: "preserveVnet", + type: { + name: "Boolean" + } + } + } + } +}; + +export const CustomHostnameAnalysisResult: msRest.CompositeMapper = { + serializedName: "CustomHostnameAnalysisResult", + type: { + name: "Composite", + className: "CustomHostnameAnalysisResult", + modelProperties: { + ...ProxyOnlyResource.type.modelProperties, + isHostnameAlreadyVerified: { + readOnly: true, + serializedName: "properties.isHostnameAlreadyVerified", + type: { + name: "Boolean" + } + }, + customDomainVerificationTest: { + readOnly: true, + serializedName: "properties.customDomainVerificationTest", + type: { + name: "Enum", + allowedValues: [ + "Passed", + "Failed", + "Skipped" + ] + } + }, + customDomainVerificationFailureInfo: { + readOnly: true, + serializedName: "properties.customDomainVerificationFailureInfo", + type: { + name: "Composite", + className: "ErrorEntity" + } + }, + hasConflictOnScaleUnit: { + readOnly: true, + serializedName: "properties.hasConflictOnScaleUnit", + type: { + name: "Boolean" + } + }, + hasConflictAcrossSubscription: { + readOnly: true, + serializedName: "properties.hasConflictAcrossSubscription", + type: { + name: "Boolean" + } + }, + conflictingAppResourceId: { + readOnly: true, + serializedName: "properties.conflictingAppResourceId", + type: { + name: "String" + } + }, + cNameRecords: { + serializedName: "properties.cNameRecords", + type: { + name: "Sequence", + element: { + type: { + name: "String" + } + } + } + }, + txtRecords: { + serializedName: "properties.txtRecords", + type: { + name: "Sequence", + element: { + type: { + name: "String" + } + } + } + }, + aRecords: { + serializedName: "properties.aRecords", + type: { + name: "Sequence", + element: { + type: { + name: "String" + } + } + } + }, + alternateCNameRecords: { + serializedName: "properties.alternateCNameRecords", + type: { + name: "Sequence", + element: { + type: { + name: "String" + } + } + } + }, + alternateTxtRecords: { + serializedName: "properties.alternateTxtRecords", + type: { + name: "Sequence", + element: { + type: { + name: "String" + } + } + } + } + } + } +}; + +export const DeletedAppRestoreRequest: msRest.CompositeMapper = { + serializedName: "DeletedAppRestoreRequest", + type: { + name: "Composite", + className: "DeletedAppRestoreRequest", + modelProperties: { + ...ProxyOnlyResource.type.modelProperties, + deletedSiteId: { + serializedName: "properties.deletedSiteId", + type: { + name: "String" + } + }, + recoverConfiguration: { + serializedName: "properties.recoverConfiguration", + type: { + name: "Boolean" + } + }, + snapshotTime: { + serializedName: "properties.snapshotTime", + type: { + name: "String" + } + }, + useDRSecondary: { + serializedName: "properties.useDRSecondary", + type: { + name: "Boolean" + } + } + } + } +}; + +export const Deployment: msRest.CompositeMapper = { + serializedName: "Deployment", + type: { + name: "Composite", + className: "Deployment", + modelProperties: { + ...ProxyOnlyResource.type.modelProperties, + status: { + serializedName: "properties.status", + type: { + name: "Number" + } + }, + message: { + serializedName: "properties.message", + type: { + name: "String" + } + }, + author: { + serializedName: "properties.author", + type: { + name: "String" + } + }, + deployer: { + serializedName: "properties.deployer", + type: { + name: "String" + } + }, + authorEmail: { + serializedName: "properties.author_email", + type: { + name: "String" + } + }, + startTime: { + serializedName: "properties.start_time", + type: { + name: "DateTime" + } + }, + endTime: { + serializedName: "properties.end_time", + type: { + name: "DateTime" + } + }, + active: { + serializedName: "properties.active", + type: { + name: "Boolean" + } + }, + details: { + serializedName: "properties.details", + type: { + name: "String" + } + } + } + } +}; + +export const EnabledConfig: msRest.CompositeMapper = { + serializedName: "EnabledConfig", + type: { + name: "Composite", + className: "EnabledConfig", + modelProperties: { + enabled: { + serializedName: "enabled", + type: { + name: "Boolean" + } + } + } + } +}; + +export const FileSystemHttpLogsConfig: msRest.CompositeMapper = { + serializedName: "FileSystemHttpLogsConfig", + type: { + name: "Composite", + className: "FileSystemHttpLogsConfig", + modelProperties: { + retentionInMb: { + serializedName: "retentionInMb", + constraints: { + InclusiveMaximum: 100, + InclusiveMinimum: 25 + }, + type: { + name: "Number" + } + }, + retentionInDays: { + serializedName: "retentionInDays", + type: { + name: "Number" + } + }, + enabled: { + serializedName: "enabled", + type: { + name: "Boolean" + } + } + } + } +}; + +export const FunctionEnvelope: msRest.CompositeMapper = { + serializedName: "FunctionEnvelope", + type: { + name: "Composite", + className: "FunctionEnvelope", + modelProperties: { + ...ProxyOnlyResource.type.modelProperties, + functionAppId: { + serializedName: "properties.function_app_id", + type: { + name: "String" + } + }, + scriptRootPathHref: { + serializedName: "properties.script_root_path_href", + type: { + name: "String" + } + }, + scriptHref: { + serializedName: "properties.script_href", + type: { + name: "String" + } + }, + configHref: { + serializedName: "properties.config_href", + type: { + name: "String" + } + }, + secretsFileHref: { + serializedName: "properties.secrets_file_href", + type: { + name: "String" + } + }, + href: { + serializedName: "properties.href", + type: { + name: "String" + } + }, + config: { + serializedName: "properties.config", + type: { + name: "Object" + } + }, + files: { + serializedName: "properties.files", + type: { + name: "Dictionary", + value: { + type: { + name: "String" + } + } + } + }, + testData: { + serializedName: "properties.test_data", + type: { + name: "String" + } + } + } + } +}; + +export const FunctionSecrets: msRest.CompositeMapper = { + serializedName: "FunctionSecrets", + type: { + name: "Composite", + className: "FunctionSecrets", + modelProperties: { + ...ProxyOnlyResource.type.modelProperties, + key: { + serializedName: "properties.key", + type: { + name: "String" + } + }, + triggerUrl: { + serializedName: "properties.trigger_url", + type: { + name: "String" + } + } + } + } +}; + +export const HostNameBinding: msRest.CompositeMapper = { + serializedName: "HostNameBinding", + type: { + name: "Composite", + className: "HostNameBinding", + modelProperties: { + ...ProxyOnlyResource.type.modelProperties, + siteName: { + serializedName: "properties.siteName", + type: { + name: "String" + } + }, + domainId: { + serializedName: "properties.domainId", + type: { + name: "String" + } + }, + azureResourceName: { + serializedName: "properties.azureResourceName", + type: { + name: "String" + } + }, + azureResourceType: { + serializedName: "properties.azureResourceType", + type: { + name: "Enum", + allowedValues: [ + "Website", + "TrafficManager" + ] + } + }, + customHostNameDnsRecordType: { + serializedName: "properties.customHostNameDnsRecordType", + type: { + name: "Enum", + allowedValues: [ + "CName", + "A" + ] + } + }, + hostNameType: { + serializedName: "properties.hostNameType", + type: { + name: "Enum", + allowedValues: [ + "Verified", + "Managed" + ] + } + }, + sslState: { + serializedName: "properties.sslState", + type: { + name: "Enum", + allowedValues: [ + "Disabled", + "SniEnabled", + "IpBasedEnabled" + ] + } + }, + thumbprint: { + serializedName: "properties.thumbprint", + type: { + name: "String" + } + }, + virtualIP: { + readOnly: true, + serializedName: "properties.virtualIP", + type: { + name: "String" + } + } + } + } +}; + +export const HttpLogsConfig: msRest.CompositeMapper = { + serializedName: "HttpLogsConfig", + type: { + name: "Composite", + className: "HttpLogsConfig", + modelProperties: { + fileSystem: { + serializedName: "fileSystem", + type: { + name: "Composite", + className: "FileSystemHttpLogsConfig" + } + }, + azureBlobStorage: { + serializedName: "azureBlobStorage", + type: { + name: "Composite", + className: "AzureBlobStorageHttpLogsConfig" + } + } + } + } +}; + +export const MSDeploy: msRest.CompositeMapper = { + serializedName: "MSDeploy", + type: { + name: "Composite", + className: "MSDeploy", + modelProperties: { + ...ProxyOnlyResource.type.modelProperties, + packageUri: { + serializedName: "properties.packageUri", + type: { + name: "String" + } + }, + connectionString: { + serializedName: "properties.connectionString", + type: { + name: "String" + } + }, + dbType: { + serializedName: "properties.dbType", + type: { + name: "String" + } + }, + setParametersXmlFileUri: { + serializedName: "properties.setParametersXmlFileUri", + type: { + name: "String" + } + }, + setParameters: { + serializedName: "properties.setParameters", + type: { + name: "Dictionary", + value: { + type: { + name: "String" + } + } + } + }, + skipAppData: { + serializedName: "properties.skipAppData", + type: { + name: "Boolean" + } + }, + appOffline: { + serializedName: "properties.appOffline", + type: { + name: "Boolean" + } + } + } + } +}; + +export const MSDeployLogEntry: msRest.CompositeMapper = { + serializedName: "MSDeployLogEntry", + type: { + name: "Composite", + className: "MSDeployLogEntry", + modelProperties: { + time: { + readOnly: true, + serializedName: "time", + type: { + name: "DateTime" + } + }, + type: { + readOnly: true, + serializedName: "type", + type: { + name: "Enum", + allowedValues: [ + "Message", + "Warning", + "Error" + ] + } + }, + message: { + readOnly: true, + serializedName: "message", + type: { + name: "String" + } + } + } + } +}; + +export const MSDeployLog: msRest.CompositeMapper = { + serializedName: "MSDeployLog", + type: { + name: "Composite", + className: "MSDeployLog", + modelProperties: { + ...ProxyOnlyResource.type.modelProperties, + entries: { + readOnly: true, + serializedName: "properties.entries", + type: { + name: "Sequence", + element: { + type: { + name: "Composite", + className: "MSDeployLogEntry" + } + } + } + } + } + } +}; + +export const MSDeployStatus: msRest.CompositeMapper = { + serializedName: "MSDeployStatus", + type: { + name: "Composite", + className: "MSDeployStatus", + modelProperties: { + ...ProxyOnlyResource.type.modelProperties, + deployer: { + readOnly: true, + serializedName: "properties.deployer", + type: { + name: "String" + } + }, + provisioningState: { + readOnly: true, + serializedName: "properties.provisioningState", + type: { + name: "Enum", + allowedValues: [ + "accepted", + "running", + "succeeded", + "failed", + "canceled" + ] + } + }, + startTime: { + readOnly: true, + serializedName: "properties.startTime", + type: { + name: "DateTime" + } + }, + endTime: { + readOnly: true, + serializedName: "properties.endTime", + type: { + name: "DateTime" + } + }, + complete: { + readOnly: true, + serializedName: "properties.complete", + type: { + name: "Boolean" + } + } + } + } +}; + +export const MigrateMySqlRequest: msRest.CompositeMapper = { + serializedName: "MigrateMySqlRequest", + type: { + name: "Composite", + className: "MigrateMySqlRequest", + modelProperties: { + ...ProxyOnlyResource.type.modelProperties, + connectionString: { + required: true, + serializedName: "properties.connectionString", + type: { + name: "String" + } + }, + migrationType: { + required: true, + serializedName: "properties.migrationType", + type: { + name: "Enum", + allowedValues: [ + "LocalToRemote", + "RemoteToLocal" + ] + } + } + } + } +}; + +export const MigrateMySqlStatus: msRest.CompositeMapper = { + serializedName: "MigrateMySqlStatus", + type: { + name: "Composite", + className: "MigrateMySqlStatus", + modelProperties: { + ...ProxyOnlyResource.type.modelProperties, + migrationOperationStatus: { + readOnly: true, + serializedName: "properties.migrationOperationStatus", + type: { + name: "Enum", + allowedValues: [ + "InProgress", + "Failed", + "Succeeded", + "TimedOut", + "Created" + ] + } + }, + operationId: { + readOnly: true, + serializedName: "properties.operationId", + type: { + name: "String" + } + }, + localMySqlEnabled: { + readOnly: true, + serializedName: "properties.localMySqlEnabled", + type: { + name: "Boolean" + } + } + } + } +}; + +export const RelayServiceConnectionEntity: msRest.CompositeMapper = { + serializedName: "RelayServiceConnectionEntity", + type: { + name: "Composite", + className: "RelayServiceConnectionEntity", + modelProperties: { + ...ProxyOnlyResource.type.modelProperties, + entityName: { + serializedName: "properties.entityName", + type: { + name: "String" + } + }, + entityConnectionString: { + serializedName: "properties.entityConnectionString", + type: { + name: "String" + } + }, + resourceType: { + serializedName: "properties.resourceType", + type: { + name: "String" + } + }, + resourceConnectionString: { + serializedName: "properties.resourceConnectionString", + type: { + name: "String" + } + }, + hostname: { + serializedName: "properties.hostname", + type: { + name: "String" + } + }, + port: { + serializedName: "properties.port", + type: { + name: "Number" + } + }, + biztalkUri: { + serializedName: "properties.biztalkUri", + type: { + name: "String" + } + } + } + } +}; + +export const NetworkFeatures: msRest.CompositeMapper = { + serializedName: "NetworkFeatures", + type: { + name: "Composite", + className: "NetworkFeatures", + modelProperties: { + ...ProxyOnlyResource.type.modelProperties, + virtualNetworkName: { + readOnly: true, + serializedName: "properties.virtualNetworkName", + type: { + name: "String" + } + }, + virtualNetworkConnection: { + readOnly: true, + serializedName: "properties.virtualNetworkConnection", + type: { + name: "Composite", + className: "VnetInfo" + } + }, + hybridConnections: { + readOnly: true, + serializedName: "properties.hybridConnections", + type: { + name: "Sequence", + element: { + type: { + name: "Composite", + className: "RelayServiceConnectionEntity" + } + } + } + }, + hybridConnectionsV2: { + readOnly: true, + serializedName: "properties.hybridConnectionsV2", + type: { + name: "Sequence", + element: { + type: { + name: "Composite", + className: "HybridConnection" + } + } + } + } + } + } +}; + +export const NetworkTrace: msRest.CompositeMapper = { + serializedName: "NetworkTrace", + type: { + name: "Composite", + className: "NetworkTrace", + modelProperties: { + path: { + serializedName: "path", + type: { + name: "String" + } + }, + status: { + serializedName: "status", + type: { + name: "String" + } + }, + message: { + serializedName: "message", + type: { + name: "String" + } + } + } + } +}; + +export const PerfMonSample: msRest.CompositeMapper = { + serializedName: "PerfMonSample", + type: { + name: "Composite", + className: "PerfMonSample", + modelProperties: { + time: { + serializedName: "time", + type: { + name: "DateTime" + } + }, + instanceName: { + serializedName: "instanceName", + type: { + name: "String" + } + }, + value: { + serializedName: "value", + type: { + name: "Number" + } + } + } + } +}; + +export const PerfMonSet: msRest.CompositeMapper = { + serializedName: "PerfMonSet", + type: { + name: "Composite", + className: "PerfMonSet", + modelProperties: { + name: { + serializedName: "name", + type: { + name: "String" + } + }, + startTime: { + serializedName: "startTime", + type: { + name: "DateTime" + } + }, + endTime: { + serializedName: "endTime", + type: { + name: "DateTime" + } + }, + timeGrain: { + serializedName: "timeGrain", + type: { + name: "String" + } + }, + values: { + serializedName: "values", + type: { + name: "Sequence", + element: { + type: { + name: "Composite", + className: "PerfMonSample" + } + } + } + } + } + } +}; + +export const PerfMonResponse: msRest.CompositeMapper = { + serializedName: "PerfMonResponse", + type: { + name: "Composite", + className: "PerfMonResponse", + modelProperties: { + code: { + serializedName: "code", + type: { + name: "String" + } + }, + message: { + serializedName: "message", + type: { + name: "String" + } + }, + data: { + serializedName: "data", + type: { + name: "Composite", + className: "PerfMonSet" + } + } + } + } +}; + +export const PremierAddOn: msRest.CompositeMapper = { + serializedName: "PremierAddOn", + type: { + name: "Composite", + className: "PremierAddOn", + modelProperties: { + ...Resource.type.modelProperties, + sku: { + serializedName: "properties.sku", + type: { + name: "String" + } + }, + product: { + serializedName: "properties.product", + type: { + name: "String" + } + }, + vendor: { + serializedName: "properties.vendor", + type: { + name: "String" + } + }, + marketplacePublisher: { + serializedName: "properties.marketplacePublisher", + type: { + name: "String" + } + }, + marketplaceOffer: { + serializedName: "properties.marketplaceOffer", + type: { + name: "String" + } + } + } + } +}; + +export const PremierAddOnPatchResource: msRest.CompositeMapper = { + serializedName: "PremierAddOnPatchResource", + type: { + name: "Composite", + className: "PremierAddOnPatchResource", + modelProperties: { + ...ProxyOnlyResource.type.modelProperties, + sku: { + serializedName: "properties.sku", + type: { + name: "String" + } + }, + product: { + serializedName: "properties.product", + type: { + name: "String" + } + }, + vendor: { + serializedName: "properties.vendor", + type: { + name: "String" + } + }, + marketplacePublisher: { + serializedName: "properties.marketplacePublisher", + type: { + name: "String" + } + }, + marketplaceOffer: { + serializedName: "properties.marketplaceOffer", + type: { + name: "String" + } + } + } + } +}; + +export const PrivateAccessSubnet: msRest.CompositeMapper = { + serializedName: "PrivateAccessSubnet", + type: { + name: "Composite", + className: "PrivateAccessSubnet", + modelProperties: { + name: { + serializedName: "name", + type: { + name: "String" + } + }, + key: { + serializedName: "key", + type: { + name: "Number" + } + } + } + } +}; + +export const PrivateAccessVirtualNetwork: msRest.CompositeMapper = { + serializedName: "PrivateAccessVirtualNetwork", + type: { + name: "Composite", + className: "PrivateAccessVirtualNetwork", + modelProperties: { + name: { + serializedName: "name", + type: { + name: "String" + } + }, + key: { + serializedName: "key", + type: { + name: "Number" + } + }, + resourceId: { + serializedName: "resourceId", + type: { + name: "String" + } + }, + subnets: { + serializedName: "subnets", + type: { + name: "Sequence", + element: { + type: { + name: "Composite", + className: "PrivateAccessSubnet" + } + } + } + } + } + } +}; + +export const PrivateAccess: msRest.CompositeMapper = { + serializedName: "PrivateAccess", + type: { + name: "Composite", + className: "PrivateAccess", + modelProperties: { + ...ProxyOnlyResource.type.modelProperties, + enabled: { + serializedName: "properties.enabled", + type: { + name: "Boolean" + } + }, + virtualNetworks: { + serializedName: "properties.virtualNetworks", + type: { + name: "Sequence", + element: { + type: { + name: "Composite", + className: "PrivateAccessVirtualNetwork" + } + } + } + } + } + } +}; + +export const ProcessThreadInfo: msRest.CompositeMapper = { + serializedName: "ProcessThreadInfo", + type: { + name: "Composite", + className: "ProcessThreadInfo", + modelProperties: { + ...ProxyOnlyResource.type.modelProperties, + identifier: { + readOnly: true, + serializedName: "properties.identifier", + type: { + name: "Number" + } + }, + href: { + serializedName: "properties.href", + type: { + name: "String" + } + }, + process: { + serializedName: "properties.process", + type: { + name: "String" + } + }, + startAddress: { + serializedName: "properties.start_address", + type: { + name: "String" + } + }, + currentPriority: { + serializedName: "properties.current_priority", + type: { + name: "Number" + } + }, + priorityLevel: { + serializedName: "properties.priority_level", + type: { + name: "String" + } + }, + basePriority: { + serializedName: "properties.base_priority", + type: { + name: "Number" + } + }, + startTime: { + serializedName: "properties.start_time", + type: { + name: "DateTime" + } + }, + totalProcessorTime: { + serializedName: "properties.total_processor_time", + type: { + name: "String" + } + }, + userProcessorTime: { + serializedName: "properties.user_processor_time", + type: { + name: "String" + } + }, + priviledgedProcessorTime: { + serializedName: "properties.priviledged_processor_time", + type: { + name: "String" + } + }, + state: { + serializedName: "properties.state", + type: { + name: "String" + } + }, + waitReason: { + serializedName: "properties.wait_reason", + type: { + name: "String" + } + } + } + } +}; + +export const ProcessModuleInfo: msRest.CompositeMapper = { + serializedName: "ProcessModuleInfo", + type: { + name: "Composite", + className: "ProcessModuleInfo", + modelProperties: { + ...ProxyOnlyResource.type.modelProperties, + baseAddress: { + serializedName: "properties.base_address", + type: { + name: "String" + } + }, + fileName: { + serializedName: "properties.file_name", + type: { + name: "String" + } + }, + href: { + serializedName: "properties.href", + type: { + name: "String" + } + }, + filePath: { + serializedName: "properties.file_path", + type: { + name: "String" + } + }, + moduleMemorySize: { + serializedName: "properties.module_memory_size", + type: { + name: "Number" + } + }, + fileVersion: { + serializedName: "properties.file_version", + type: { + name: "String" + } + }, + fileDescription: { + serializedName: "properties.file_description", + type: { + name: "String" + } + }, + product: { + serializedName: "properties.product", + type: { + name: "String" + } + }, + productVersion: { + serializedName: "properties.product_version", + type: { + name: "String" + } + }, + isDebug: { + serializedName: "properties.is_debug", + type: { + name: "Boolean" + } + }, + language: { + serializedName: "properties.language", + type: { + name: "String" + } + } + } + } +}; + +export const ProcessInfo: msRest.CompositeMapper = { + serializedName: "ProcessInfo", + type: { + name: "Composite", + className: "ProcessInfo", + modelProperties: { + ...ProxyOnlyResource.type.modelProperties, + identifier: { + readOnly: true, + serializedName: "properties.identifier", + type: { + name: "Number" + } + }, + deploymentName: { + serializedName: "properties.deployment_name", + type: { + name: "String" + } + }, + href: { + serializedName: "properties.href", + type: { + name: "String" + } + }, + minidump: { + serializedName: "properties.minidump", + type: { + name: "String" + } + }, + isProfileRunning: { + serializedName: "properties.is_profile_running", + type: { + name: "Boolean" + } + }, + isIisProfileRunning: { + serializedName: "properties.is_iis_profile_running", + type: { + name: "Boolean" + } + }, + iisProfileTimeoutInSeconds: { + serializedName: "properties.iis_profile_timeout_in_seconds", + type: { + name: "Number" + } + }, + parent: { + serializedName: "properties.parent", + type: { + name: "String" + } + }, + children: { + serializedName: "properties.children", + type: { + name: "Sequence", + element: { + type: { + name: "String" + } + } + } + }, + threads: { + serializedName: "properties.threads", + type: { + name: "Sequence", + element: { + type: { + name: "Composite", + className: "ProcessThreadInfo" + } + } + } + }, + openFileHandles: { + serializedName: "properties.open_file_handles", + type: { + name: "Sequence", + element: { + type: { + name: "String" + } + } + } + }, + modules: { + serializedName: "properties.modules", + type: { + name: "Sequence", + element: { + type: { + name: "Composite", + className: "ProcessModuleInfo" + } + } + } + }, + fileName: { + serializedName: "properties.file_name", + type: { + name: "String" + } + }, + commandLine: { + serializedName: "properties.command_line", + type: { + name: "String" + } + }, + userName: { + serializedName: "properties.user_name", + type: { + name: "String" + } + }, + handleCount: { + serializedName: "properties.handle_count", + type: { + name: "Number" + } + }, + moduleCount: { + serializedName: "properties.module_count", + type: { + name: "Number" + } + }, + threadCount: { + serializedName: "properties.thread_count", + type: { + name: "Number" + } + }, + startTime: { + serializedName: "properties.start_time", + type: { + name: "DateTime" + } + }, + totalCpuTime: { + serializedName: "properties.total_cpu_time", + type: { + name: "String" + } + }, + userCpuTime: { + serializedName: "properties.user_cpu_time", + type: { + name: "String" + } + }, + privilegedCpuTime: { + serializedName: "properties.privileged_cpu_time", + type: { + name: "String" + } + }, + workingSet: { + serializedName: "properties.working_set", + type: { + name: "Number" + } + }, + peakWorkingSet: { + serializedName: "properties.peak_working_set", + type: { + name: "Number" + } + }, + privateMemory: { + serializedName: "properties.private_memory", + type: { + name: "Number" + } + }, + virtualMemory: { + serializedName: "properties.virtual_memory", + type: { + name: "Number" + } + }, + peakVirtualMemory: { + serializedName: "properties.peak_virtual_memory", + type: { + name: "Number" + } + }, + pagedSystemMemory: { + serializedName: "properties.paged_system_memory", + type: { + name: "Number" + } + }, + nonPagedSystemMemory: { + serializedName: "properties.non_paged_system_memory", + type: { + name: "Number" + } + }, + pagedMemory: { + serializedName: "properties.paged_memory", + type: { + name: "Number" + } + }, + peakPagedMemory: { + serializedName: "properties.peak_paged_memory", + type: { + name: "Number" + } + }, + timeStamp: { + serializedName: "properties.time_stamp", + type: { + name: "DateTime" + } + }, + environmentVariables: { + serializedName: "properties.environment_variables", + type: { + name: "Dictionary", + value: { + type: { + name: "String" + } + } + } + }, + isScmSite: { + serializedName: "properties.is_scm_site", + type: { + name: "Boolean" + } + }, + isWebjob: { + serializedName: "properties.is_webjob", + type: { + name: "Boolean" + } + }, + description: { + serializedName: "properties.description", + type: { + name: "String" + } + } + } + } +}; + +export const PublicCertificate: msRest.CompositeMapper = { + serializedName: "PublicCertificate", + type: { + name: "Composite", + className: "PublicCertificate", + modelProperties: { + ...ProxyOnlyResource.type.modelProperties, + blob: { + serializedName: "properties.blob", + type: { + name: "ByteArray" + } + }, + publicCertificateLocation: { + serializedName: "properties.publicCertificateLocation", + type: { + name: "Enum", + allowedValues: [ + "CurrentUserMy", + "LocalMachineMy", + "Unknown" + ] + } + }, + thumbprint: { + readOnly: true, + serializedName: "properties.thumbprint", + type: { + name: "String" + } + } + } + } +}; + +export const RestoreRequest: msRest.CompositeMapper = { + serializedName: "RestoreRequest", + type: { + name: "Composite", + className: "RestoreRequest", + modelProperties: { + ...ProxyOnlyResource.type.modelProperties, + storageAccountUrl: { + required: true, + serializedName: "properties.storageAccountUrl", + type: { + name: "String" + } + }, + blobName: { + serializedName: "properties.blobName", + type: { + name: "String" + } + }, + overwrite: { + required: true, + serializedName: "properties.overwrite", + type: { + name: "Boolean" + } + }, + siteName: { + serializedName: "properties.siteName", + type: { + name: "String" + } + }, + databases: { + serializedName: "properties.databases", + type: { + name: "Sequence", + element: { + type: { + name: "Composite", + className: "DatabaseBackupSetting" + } + } + } + }, + ignoreConflictingHostNames: { + serializedName: "properties.ignoreConflictingHostNames", + defaultValue: false, + type: { + name: "Boolean" + } + }, + ignoreDatabases: { + serializedName: "properties.ignoreDatabases", + defaultValue: false, + type: { + name: "Boolean" + } + }, + appServicePlan: { + serializedName: "properties.appServicePlan", + type: { + name: "String" + } + }, + operationType: { + serializedName: "properties.operationType", + defaultValue: 'Default', + type: { + name: "Enum", + allowedValues: [ + "Default", + "Clone", + "Relocation", + "Snapshot", + "CloudFS" + ] + } + }, + adjustConnectionStrings: { + serializedName: "properties.adjustConnectionStrings", + type: { + name: "Boolean" + } + }, + hostingEnvironment: { + serializedName: "properties.hostingEnvironment", + type: { + name: "String" + } + } + } + } +}; + +export const SiteAuthSettings: msRest.CompositeMapper = { + serializedName: "SiteAuthSettings", + type: { + name: "Composite", + className: "SiteAuthSettings", + modelProperties: { + ...ProxyOnlyResource.type.modelProperties, + enabled: { + serializedName: "properties.enabled", + type: { + name: "Boolean" + } + }, + runtimeVersion: { + serializedName: "properties.runtimeVersion", + type: { + name: "String" + } + }, + unauthenticatedClientAction: { + serializedName: "properties.unauthenticatedClientAction", + type: { + name: "Enum", + allowedValues: [ + "RedirectToLoginPage", + "AllowAnonymous" + ] + } + }, + tokenStoreEnabled: { + serializedName: "properties.tokenStoreEnabled", + type: { + name: "Boolean" + } + }, + allowedExternalRedirectUrls: { + serializedName: "properties.allowedExternalRedirectUrls", + type: { + name: "Sequence", + element: { + type: { + name: "String" + } + } + } + }, + defaultProvider: { + serializedName: "properties.defaultProvider", + type: { + name: "Enum", + allowedValues: [ + "AzureActiveDirectory", + "Facebook", + "Google", + "MicrosoftAccount", + "Twitter" + ] + } + }, + tokenRefreshExtensionHours: { + serializedName: "properties.tokenRefreshExtensionHours", + type: { + name: "Number" + } + }, + clientId: { + serializedName: "properties.clientId", + type: { + name: "String" + } + }, + clientSecret: { + serializedName: "properties.clientSecret", + type: { + name: "String" + } + }, + clientSecretCertificateThumbprint: { + serializedName: "properties.clientSecretCertificateThumbprint", + type: { + name: "String" + } + }, + issuer: { + serializedName: "properties.issuer", + type: { + name: "String" + } + }, + validateIssuer: { + serializedName: "properties.validateIssuer", + type: { + name: "Boolean" + } + }, + allowedAudiences: { + serializedName: "properties.allowedAudiences", + type: { + name: "Sequence", + element: { + type: { + name: "String" + } + } + } + }, + additionalLoginParams: { + serializedName: "properties.additionalLoginParams", + type: { + name: "Sequence", + element: { + type: { + name: "String" + } + } + } + }, + googleClientId: { + serializedName: "properties.googleClientId", + type: { + name: "String" + } + }, + googleClientSecret: { + serializedName: "properties.googleClientSecret", + type: { + name: "String" + } + }, + googleOAuthScopes: { + serializedName: "properties.googleOAuthScopes", + type: { + name: "Sequence", + element: { + type: { + name: "String" + } + } + } + }, + facebookAppId: { + serializedName: "properties.facebookAppId", + type: { + name: "String" + } + }, + facebookAppSecret: { + serializedName: "properties.facebookAppSecret", + type: { + name: "String" + } + }, + facebookOAuthScopes: { + serializedName: "properties.facebookOAuthScopes", + type: { + name: "Sequence", + element: { + type: { + name: "String" + } + } + } + }, + twitterConsumerKey: { + serializedName: "properties.twitterConsumerKey", + type: { + name: "String" + } + }, + twitterConsumerSecret: { + serializedName: "properties.twitterConsumerSecret", + type: { + name: "String" + } + }, + microsoftAccountClientId: { + serializedName: "properties.microsoftAccountClientId", + type: { + name: "String" + } + }, + microsoftAccountClientSecret: { + serializedName: "properties.microsoftAccountClientSecret", + type: { + name: "String" + } + }, + microsoftAccountOAuthScopes: { + serializedName: "properties.microsoftAccountOAuthScopes", + type: { + name: "Sequence", + element: { + type: { + name: "String" + } + } + } + } + } + } +}; + +export const SiteCloneabilityCriterion: msRest.CompositeMapper = { + serializedName: "SiteCloneabilityCriterion", + type: { + name: "Composite", + className: "SiteCloneabilityCriterion", + modelProperties: { + name: { + serializedName: "name", + type: { + name: "String" + } + }, + description: { + serializedName: "description", + type: { + name: "String" + } + } + } + } +}; + +export const SiteCloneability: msRest.CompositeMapper = { + serializedName: "SiteCloneability", + type: { + name: "Composite", + className: "SiteCloneability", + modelProperties: { + result: { + serializedName: "result", + type: { + name: "Enum", + allowedValues: [ + "Cloneable", + "PartiallyCloneable", + "NotCloneable" + ] + } + }, + blockingFeatures: { + serializedName: "blockingFeatures", + type: { + name: "Sequence", + element: { + type: { + name: "Composite", + className: "SiteCloneabilityCriterion" + } + } + } + }, + unsupportedFeatures: { + serializedName: "unsupportedFeatures", + type: { + name: "Sequence", + element: { + type: { + name: "Composite", + className: "SiteCloneabilityCriterion" + } + } + } + }, + blockingCharacteristics: { + serializedName: "blockingCharacteristics", + type: { + name: "Sequence", + element: { + type: { + name: "Composite", + className: "SiteCloneabilityCriterion" + } + } + } + } + } + } +}; + +export const SiteConfigResource: msRest.CompositeMapper = { + serializedName: "SiteConfigResource", + type: { + name: "Composite", + className: "SiteConfigResource", + modelProperties: { + ...ProxyOnlyResource.type.modelProperties, + numberOfWorkers: { + serializedName: "properties.numberOfWorkers", + type: { + name: "Number" + } + }, + defaultDocuments: { + serializedName: "properties.defaultDocuments", + type: { + name: "Sequence", + element: { + type: { + name: "String" + } + } + } + }, + netFrameworkVersion: { + serializedName: "properties.netFrameworkVersion", + defaultValue: 'v4.6', + type: { + name: "String" + } + }, + phpVersion: { + serializedName: "properties.phpVersion", + type: { + name: "String" + } + }, + pythonVersion: { + serializedName: "properties.pythonVersion", + type: { + name: "String" + } + }, + nodeVersion: { + serializedName: "properties.nodeVersion", + type: { + name: "String" + } + }, + linuxFxVersion: { + serializedName: "properties.linuxFxVersion", + type: { + name: "String" + } + }, + windowsFxVersion: { + serializedName: "properties.windowsFxVersion", + type: { + name: "String" + } + }, + requestTracingEnabled: { + serializedName: "properties.requestTracingEnabled", + type: { + name: "Boolean" + } + }, + requestTracingExpirationTime: { + serializedName: "properties.requestTracingExpirationTime", + type: { + name: "DateTime" + } + }, + remoteDebuggingEnabled: { + serializedName: "properties.remoteDebuggingEnabled", + type: { + name: "Boolean" + } + }, + remoteDebuggingVersion: { + serializedName: "properties.remoteDebuggingVersion", + type: { + name: "String" + } + }, + httpLoggingEnabled: { + serializedName: "properties.httpLoggingEnabled", + type: { + name: "Boolean" + } + }, + logsDirectorySizeLimit: { + serializedName: "properties.logsDirectorySizeLimit", + type: { + name: "Number" + } + }, + detailedErrorLoggingEnabled: { + serializedName: "properties.detailedErrorLoggingEnabled", + type: { + name: "Boolean" + } + }, + publishingUsername: { + serializedName: "properties.publishingUsername", + type: { + name: "String" + } + }, + appSettings: { + serializedName: "properties.appSettings", + type: { + name: "Sequence", + element: { + type: { + name: "Composite", + className: "NameValuePair" + } + } + } + }, + azureStorageAccounts: { + serializedName: "properties.azureStorageAccounts", + type: { + name: "Dictionary", + value: { + type: { + name: "Composite", + className: "AzureStorageInfoValue" + } + } + } + }, + connectionStrings: { + serializedName: "properties.connectionStrings", + type: { + name: "Sequence", + element: { + type: { + name: "Composite", + className: "ConnStringInfo" + } + } + } + }, + machineKey: { + readOnly: true, + serializedName: "properties.machineKey", + type: { + name: "Composite", + className: "SiteMachineKey" + } + }, + handlerMappings: { + serializedName: "properties.handlerMappings", + type: { + name: "Sequence", + element: { + type: { + name: "Composite", + className: "HandlerMapping" + } + } + } + }, + documentRoot: { + serializedName: "properties.documentRoot", + type: { + name: "String" + } + }, + scmType: { + serializedName: "properties.scmType", + type: { + name: "String" + } + }, + use32BitWorkerProcess: { + serializedName: "properties.use32BitWorkerProcess", + type: { + name: "Boolean" + } + }, + webSocketsEnabled: { + serializedName: "properties.webSocketsEnabled", + type: { + name: "Boolean" + } + }, + alwaysOn: { + serializedName: "properties.alwaysOn", + type: { + name: "Boolean" + } + }, + javaVersion: { + serializedName: "properties.javaVersion", + type: { + name: "String" + } + }, + javaContainer: { + serializedName: "properties.javaContainer", + type: { + name: "String" + } + }, + javaContainerVersion: { + serializedName: "properties.javaContainerVersion", + type: { + name: "String" + } + }, + appCommandLine: { + serializedName: "properties.appCommandLine", + type: { + name: "String" + } + }, + managedPipelineMode: { + serializedName: "properties.managedPipelineMode", + type: { + name: "Enum", + allowedValues: [ + "Integrated", + "Classic" + ] + } + }, + virtualApplications: { + serializedName: "properties.virtualApplications", + type: { + name: "Sequence", + element: { + type: { + name: "Composite", + className: "VirtualApplication" + } + } + } + }, + loadBalancing: { + serializedName: "properties.loadBalancing", + type: { + name: "Enum", + allowedValues: [ + "WeightedRoundRobin", + "LeastRequests", + "LeastResponseTime", + "WeightedTotalTraffic", + "RequestHash" + ] + } + }, + experiments: { + serializedName: "properties.experiments", + type: { + name: "Composite", + className: "Experiments" + } + }, + limits: { + serializedName: "properties.limits", + type: { + name: "Composite", + className: "SiteLimits" + } + }, + autoHealEnabled: { + serializedName: "properties.autoHealEnabled", + type: { + name: "Boolean" + } + }, + autoHealRules: { + serializedName: "properties.autoHealRules", + type: { + name: "Composite", + className: "AutoHealRules" + } + }, + tracingOptions: { + serializedName: "properties.tracingOptions", + type: { + name: "String" + } + }, + vnetName: { + serializedName: "properties.vnetName", + type: { + name: "String" + } + }, + cors: { + serializedName: "properties.cors", + type: { + name: "Composite", + className: "CorsSettings" + } + }, + push: { + serializedName: "properties.push", + type: { + name: "Composite", + className: "PushSettings" + } + }, + apiDefinition: { + serializedName: "properties.apiDefinition", + type: { + name: "Composite", + className: "ApiDefinitionInfo" + } + }, + autoSwapSlotName: { + serializedName: "properties.autoSwapSlotName", + type: { + name: "String" + } + }, + localMySqlEnabled: { + serializedName: "properties.localMySqlEnabled", + defaultValue: false, + type: { + name: "Boolean" + } + }, + managedServiceIdentityId: { + serializedName: "properties.managedServiceIdentityId", + type: { + name: "Number" + } + }, + xManagedServiceIdentityId: { + serializedName: "properties.xManagedServiceIdentityId", + type: { + name: "Number" + } + }, + ipSecurityRestrictions: { + serializedName: "properties.ipSecurityRestrictions", + type: { + name: "Sequence", + element: { + type: { + name: "Composite", + className: "IpSecurityRestriction" + } + } + } + }, + scmIpSecurityRestrictions: { + serializedName: "properties.scmIpSecurityRestrictions", + type: { + name: "Sequence", + element: { + type: { + name: "Composite", + className: "IpSecurityRestriction" + } + } + } + }, + scmIpSecurityRestrictionsUseMain: { + serializedName: "properties.scmIpSecurityRestrictionsUseMain", + type: { + name: "Boolean" + } + }, + http20Enabled: { + serializedName: "properties.http20Enabled", + defaultValue: true, + type: { + name: "Boolean" + } + }, + minTlsVersion: { + serializedName: "properties.minTlsVersion", + type: { + name: "String" + } + }, + ftpsState: { + serializedName: "properties.ftpsState", + type: { + name: "String" + } + }, + reservedInstanceCount: { + serializedName: "properties.reservedInstanceCount", + constraints: { + InclusiveMaximum: 10, + InclusiveMinimum: 0 + }, + type: { + name: "Number" + } + } + } + } +}; + +export const SiteConfigurationSnapshotInfo: msRest.CompositeMapper = { + serializedName: "SiteConfigurationSnapshotInfo", + type: { + name: "Composite", + className: "SiteConfigurationSnapshotInfo", + modelProperties: { + ...ProxyOnlyResource.type.modelProperties, + time: { + readOnly: true, + serializedName: "properties.time", + type: { + name: "DateTime" + } + }, + snapshotId: { + readOnly: true, + serializedName: "properties.snapshotId", + type: { + name: "Number" + } + } + } + } +}; + +export const SiteExtensionInfo: msRest.CompositeMapper = { + serializedName: "SiteExtensionInfo", + type: { + name: "Composite", + className: "SiteExtensionInfo", + modelProperties: { + ...ProxyOnlyResource.type.modelProperties, + extensionId: { + serializedName: "properties.extension_id", + type: { + name: "String" + } + }, + title: { + serializedName: "properties.title", + type: { + name: "String" + } + }, + extensionType: { + serializedName: "properties.extension_type", + type: { + name: "Enum", + allowedValues: [ + "Gallery", + "WebRoot" + ] + } + }, + summary: { + serializedName: "properties.summary", + type: { + name: "String" + } + }, + description: { + serializedName: "properties.description", + type: { + name: "String" + } + }, + version: { + serializedName: "properties.version", + type: { + name: "String" + } + }, + extensionUrl: { + serializedName: "properties.extension_url", + type: { + name: "String" + } + }, + projectUrl: { + serializedName: "properties.project_url", + type: { + name: "String" + } + }, + iconUrl: { + serializedName: "properties.icon_url", + type: { + name: "String" + } + }, + licenseUrl: { + serializedName: "properties.license_url", + type: { + name: "String" + } + }, + feedUrl: { + serializedName: "properties.feed_url", + type: { + name: "String" + } + }, + authors: { + serializedName: "properties.authors", + type: { + name: "Sequence", + element: { + type: { + name: "String" + } + } + } + }, + installerCommandLineParams: { + serializedName: "properties.installer_command_line_params", + type: { + name: "String" + } + }, + publishedDateTime: { + serializedName: "properties.published_date_time", + type: { + name: "DateTime" + } + }, + downloadCount: { + serializedName: "properties.download_count", + type: { + name: "Number" + } + }, + localIsLatestVersion: { + serializedName: "properties.local_is_latest_version", + type: { + name: "Boolean" + } + }, + localPath: { + serializedName: "properties.local_path", + type: { + name: "String" + } + }, + installedDateTime: { + serializedName: "properties.installed_date_time", + type: { + name: "DateTime" + } + }, + provisioningState: { + serializedName: "properties.provisioningState", + type: { + name: "String" + } + }, + comment: { + serializedName: "properties.comment", + type: { + name: "String" + } + } + } + } +}; + +export const SiteInstance: msRest.CompositeMapper = { + serializedName: "SiteInstance", + type: { + name: "Composite", + className: "SiteInstance", + modelProperties: { + ...ProxyOnlyResource.type.modelProperties, + siteInstanceName: { + readOnly: true, + serializedName: "properties.siteInstanceName", + type: { + name: "String" + } + } + } + } +}; + +export const SiteLogsConfig: msRest.CompositeMapper = { + serializedName: "SiteLogsConfig", + type: { + name: "Composite", + className: "SiteLogsConfig", + modelProperties: { + ...ProxyOnlyResource.type.modelProperties, + applicationLogs: { + serializedName: "properties.applicationLogs", + type: { + name: "Composite", + className: "ApplicationLogsConfig" + } + }, + httpLogs: { + serializedName: "properties.httpLogs", + type: { + name: "Composite", + className: "HttpLogsConfig" + } + }, + failedRequestsTracing: { + serializedName: "properties.failedRequestsTracing", + type: { + name: "Composite", + className: "EnabledConfig" + } + }, + detailedErrorMessages: { + serializedName: "properties.detailedErrorMessages", + type: { + name: "Composite", + className: "EnabledConfig" + } + } + } + } +}; + +export const SitePatchResource: msRest.CompositeMapper = { + serializedName: "SitePatchResource", + type: { + name: "Composite", + className: "SitePatchResource", + modelProperties: { + ...ProxyOnlyResource.type.modelProperties, + state: { + readOnly: true, + serializedName: "properties.state", + type: { + name: "String" + } + }, + hostNames: { + readOnly: true, + serializedName: "properties.hostNames", + type: { + name: "Sequence", + element: { + type: { + name: "String" + } + } + } + }, + repositorySiteName: { + readOnly: true, + serializedName: "properties.repositorySiteName", + type: { + name: "String" + } + }, + usageState: { + readOnly: true, + serializedName: "properties.usageState", + type: { + name: "Enum", + allowedValues: [ + "Normal", + "Exceeded" + ] + } + }, + enabled: { + serializedName: "properties.enabled", + type: { + name: "Boolean" + } + }, + enabledHostNames: { + readOnly: true, + serializedName: "properties.enabledHostNames", + type: { + name: "Sequence", + element: { + type: { + name: "String" + } + } + } + }, + availabilityState: { + readOnly: true, + serializedName: "properties.availabilityState", + type: { + name: "Enum", + allowedValues: [ + "Normal", + "Limited", + "DisasterRecoveryMode" + ] + } + }, + hostNameSslStates: { + serializedName: "properties.hostNameSslStates", + type: { + name: "Sequence", + element: { + type: { + name: "Composite", + className: "HostNameSslState" + } + } + } + }, + serverFarmId: { + serializedName: "properties.serverFarmId", + type: { + name: "String" + } + }, + reserved: { + serializedName: "properties.reserved", + defaultValue: false, + type: { + name: "Boolean" + } + }, + isXenon: { + serializedName: "properties.isXenon", + defaultValue: false, + type: { + name: "Boolean" + } + }, + hyperV: { + serializedName: "properties.hyperV", + defaultValue: false, + type: { + name: "Boolean" + } + }, + lastModifiedTimeUtc: { + readOnly: true, + serializedName: "properties.lastModifiedTimeUtc", + type: { + name: "DateTime" + } + }, + siteConfig: { + serializedName: "properties.siteConfig", + type: { + name: "Composite", + className: "SiteConfig" + } + }, + trafficManagerHostNames: { + readOnly: true, + serializedName: "properties.trafficManagerHostNames", + type: { + name: "Sequence", + element: { + type: { + name: "String" + } + } + } + }, + scmSiteAlsoStopped: { + serializedName: "properties.scmSiteAlsoStopped", + defaultValue: false, + type: { + name: "Boolean" + } + }, + targetSwapSlot: { + readOnly: true, + serializedName: "properties.targetSwapSlot", + type: { + name: "String" + } + }, + hostingEnvironmentProfile: { + serializedName: "properties.hostingEnvironmentProfile", + type: { + name: "Composite", + className: "HostingEnvironmentProfile" + } + }, + clientAffinityEnabled: { + serializedName: "properties.clientAffinityEnabled", + type: { + name: "Boolean" + } + }, + clientCertEnabled: { + serializedName: "properties.clientCertEnabled", + type: { + name: "Boolean" + } + }, + clientCertExclusionPaths: { + serializedName: "properties.clientCertExclusionPaths", + type: { + name: "String" + } + }, + hostNamesDisabled: { + serializedName: "properties.hostNamesDisabled", + type: { + name: "Boolean" + } + }, + outboundIpAddresses: { + readOnly: true, + serializedName: "properties.outboundIpAddresses", + type: { + name: "String" + } + }, + possibleOutboundIpAddresses: { + readOnly: true, + serializedName: "properties.possibleOutboundIpAddresses", + type: { + name: "String" + } + }, + containerSize: { + serializedName: "properties.containerSize", + type: { + name: "Number" + } + }, + dailyMemoryTimeQuota: { + serializedName: "properties.dailyMemoryTimeQuota", + type: { + name: "Number" + } + }, + suspendedTill: { + readOnly: true, + serializedName: "properties.suspendedTill", + type: { + name: "DateTime" + } + }, + maxNumberOfWorkers: { + readOnly: true, + serializedName: "properties.maxNumberOfWorkers", + type: { + name: "Number" + } + }, + cloningInfo: { + serializedName: "properties.cloningInfo", + type: { + name: "Composite", + className: "CloningInfo" + } + }, + resourceGroup: { + readOnly: true, + serializedName: "properties.resourceGroup", + type: { + name: "String" + } + }, + isDefaultContainer: { + readOnly: true, + serializedName: "properties.isDefaultContainer", + type: { + name: "Boolean" + } + }, + defaultHostName: { + readOnly: true, + serializedName: "properties.defaultHostName", + type: { + name: "String" + } + }, + slotSwapStatus: { + readOnly: true, + serializedName: "properties.slotSwapStatus", + type: { + name: "Composite", + className: "SlotSwapStatus" + } + }, + httpsOnly: { + serializedName: "properties.httpsOnly", + type: { + name: "Boolean" + } + }, + redundancyMode: { + serializedName: "properties.redundancyMode", + type: { + name: "Enum", + allowedValues: [ + "None", + "Manual", + "Failover", + "ActiveActive", + "GeoRedundant" + ] + } + }, + inProgressOperationId: { + readOnly: true, + serializedName: "properties.inProgressOperationId", + type: { + name: "Uuid" + } + }, + geoDistributions: { + serializedName: "properties.geoDistributions", + type: { + name: "Sequence", + element: { + type: { + name: "Composite", + className: "GeoDistribution" + } + } + } + }, + identity: { + serializedName: "identity", + type: { + name: "Composite", + className: "ManagedServiceIdentity" + } + } + } + } +}; + +export const SitePhpErrorLogFlag: msRest.CompositeMapper = { + serializedName: "SitePhpErrorLogFlag", + type: { + name: "Composite", + className: "SitePhpErrorLogFlag", + modelProperties: { + ...ProxyOnlyResource.type.modelProperties, + localLogErrors: { + serializedName: "properties.localLogErrors", + type: { + name: "String" + } + }, + masterLogErrors: { + serializedName: "properties.masterLogErrors", + type: { + name: "String" + } + }, + localLogErrorsMaxLength: { + serializedName: "properties.localLogErrorsMaxLength", + type: { + name: "String" + } + }, + masterLogErrorsMaxLength: { + serializedName: "properties.masterLogErrorsMaxLength", + type: { + name: "String" + } + } + } + } +}; + +export const SiteSourceControl: msRest.CompositeMapper = { + serializedName: "SiteSourceControl", + type: { + name: "Composite", + className: "SiteSourceControl", + modelProperties: { + ...ProxyOnlyResource.type.modelProperties, + repoUrl: { + serializedName: "properties.repoUrl", + type: { + name: "String" + } + }, + branch: { + serializedName: "properties.branch", + type: { + name: "String" + } + }, + isManualIntegration: { + serializedName: "properties.isManualIntegration", + type: { + name: "Boolean" + } + }, + deploymentRollbackEnabled: { + serializedName: "properties.deploymentRollbackEnabled", + type: { + name: "Boolean" + } + }, + isMercurial: { + serializedName: "properties.isMercurial", + type: { + name: "Boolean" + } + } + } + } +}; + +export const SlotConfigNamesResource: msRest.CompositeMapper = { + serializedName: "SlotConfigNamesResource", + type: { + name: "Composite", + className: "SlotConfigNamesResource", + modelProperties: { + ...ProxyOnlyResource.type.modelProperties, + connectionStringNames: { + serializedName: "properties.connectionStringNames", + type: { + name: "Sequence", + element: { + type: { + name: "String" + } + } + } + }, + appSettingNames: { + serializedName: "properties.appSettingNames", + type: { + name: "Sequence", + element: { + type: { + name: "String" + } + } + } + }, + azureStorageConfigNames: { + serializedName: "properties.azureStorageConfigNames", + type: { + name: "Sequence", + element: { + type: { + name: "String" + } + } + } + } + } + } +}; + +export const SlotDifference: msRest.CompositeMapper = { + serializedName: "SlotDifference", + type: { + name: "Composite", + className: "SlotDifference", + modelProperties: { + ...ProxyOnlyResource.type.modelProperties, + level: { + readOnly: true, + serializedName: "properties.level", + type: { + name: "String" + } + }, + settingType: { + readOnly: true, + serializedName: "properties.settingType", + type: { + name: "String" + } + }, + diffRule: { + readOnly: true, + serializedName: "properties.diffRule", + type: { + name: "String" + } + }, + settingName: { + readOnly: true, + serializedName: "properties.settingName", + type: { + name: "String" + } + }, + valueInCurrentSlot: { + readOnly: true, + serializedName: "properties.valueInCurrentSlot", + type: { + name: "String" + } + }, + valueInTargetSlot: { + readOnly: true, + serializedName: "properties.valueInTargetSlot", + type: { + name: "String" + } + }, + description: { + readOnly: true, + serializedName: "properties.description", + type: { + name: "String" + } + } + } + } +}; + +export const SnapshotRecoverySource: msRest.CompositeMapper = { + serializedName: "SnapshotRecoverySource", + type: { + name: "Composite", + className: "SnapshotRecoverySource", + modelProperties: { + location: { + serializedName: "location", + type: { + name: "String" + } + }, + id: { + serializedName: "id", + type: { + name: "String" + } + } + } + } +}; + +export const SnapshotRestoreRequest: msRest.CompositeMapper = { + serializedName: "SnapshotRestoreRequest", + type: { + name: "Composite", + className: "SnapshotRestoreRequest", + modelProperties: { + ...ProxyOnlyResource.type.modelProperties, + snapshotTime: { + serializedName: "properties.snapshotTime", + type: { + name: "String" + } + }, + recoverySource: { + serializedName: "properties.recoverySource", + type: { + name: "Composite", + className: "SnapshotRecoverySource" + } + }, + overwrite: { + required: true, + serializedName: "properties.overwrite", + type: { + name: "Boolean" + } + }, + recoverConfiguration: { + serializedName: "properties.recoverConfiguration", + type: { + name: "Boolean" + } + }, + ignoreConflictingHostNames: { + serializedName: "properties.ignoreConflictingHostNames", + type: { + name: "Boolean" + } + }, + useDRSecondary: { + serializedName: "properties.useDRSecondary", + type: { + name: "Boolean" + } + } + } + } +}; + +export const StorageMigrationOptions: msRest.CompositeMapper = { + serializedName: "StorageMigrationOptions", + type: { + name: "Composite", + className: "StorageMigrationOptions", + modelProperties: { + ...ProxyOnlyResource.type.modelProperties, + azurefilesConnectionString: { + required: true, + serializedName: "properties.azurefilesConnectionString", + type: { + name: "String" + } + }, + azurefilesShare: { + required: true, + serializedName: "properties.azurefilesShare", + type: { + name: "String" + } + }, + switchSiteAfterMigration: { + serializedName: "properties.switchSiteAfterMigration", + defaultValue: false, + type: { + name: "Boolean" + } + }, + blockWriteAccessToSite: { + serializedName: "properties.blockWriteAccessToSite", + defaultValue: false, + type: { + name: "Boolean" + } + } + } + } +}; + +export const StorageMigrationResponse: msRest.CompositeMapper = { + serializedName: "StorageMigrationResponse", + type: { + name: "Composite", + className: "StorageMigrationResponse", + modelProperties: { + ...ProxyOnlyResource.type.modelProperties, + operationId: { + readOnly: true, + serializedName: "properties.operationId", + type: { + name: "String" + } + } + } + } +}; + +export const StringDictionary: msRest.CompositeMapper = { + serializedName: "StringDictionary", + type: { + name: "Composite", + className: "StringDictionary", + modelProperties: { + ...ProxyOnlyResource.type.modelProperties, + properties: { + serializedName: "properties", + type: { + name: "Dictionary", + value: { + type: { + name: "String" + } + } + } + } + } + } +}; + +export const SwiftVirtualNetwork: msRest.CompositeMapper = { + serializedName: "SwiftVirtualNetwork", + type: { + name: "Composite", + className: "SwiftVirtualNetwork", + modelProperties: { + ...ProxyOnlyResource.type.modelProperties, + subnetResourceId: { + serializedName: "properties.subnetResourceId", + type: { + name: "String" + } + }, + swiftSupported: { + serializedName: "properties.swiftSupported", + type: { + name: "Boolean" + } + } + } + } +}; + +export const TriggeredJobRun: msRest.CompositeMapper = { + serializedName: "TriggeredJobRun", + type: { + name: "Composite", + className: "TriggeredJobRun", + modelProperties: { + ...ProxyOnlyResource.type.modelProperties, + webJobId: { + serializedName: "properties.web_job_id", + type: { + name: "String" + } + }, + webJobName: { + serializedName: "properties.web_job_name", + type: { + name: "String" + } + }, + status: { + serializedName: "properties.status", + type: { + name: "Enum", + allowedValues: [ + "Success", + "Failed", + "Error" + ] + } + }, + startTime: { + serializedName: "properties.start_time", + type: { + name: "DateTime" + } + }, + endTime: { + serializedName: "properties.end_time", + type: { + name: "DateTime" + } + }, + duration: { + serializedName: "properties.duration", + type: { + name: "String" + } + }, + outputUrl: { + serializedName: "properties.output_url", + type: { + name: "String" + } + }, + errorUrl: { + serializedName: "properties.error_url", + type: { + name: "String" + } + }, + url: { + serializedName: "properties.url", + type: { + name: "String" + } + }, + jobName: { + serializedName: "properties.job_name", + type: { + name: "String" + } + }, + trigger: { + serializedName: "properties.trigger", + type: { + name: "String" + } + } + } + } +}; + +export const TriggeredJobHistory: msRest.CompositeMapper = { + serializedName: "TriggeredJobHistory", + type: { + name: "Composite", + className: "TriggeredJobHistory", + modelProperties: { + ...ProxyOnlyResource.type.modelProperties, + runs: { + serializedName: "properties.runs", + type: { + name: "Sequence", + element: { + type: { + name: "Composite", + className: "TriggeredJobRun" + } + } + } + } + } + } +}; + +export const TriggeredWebJob: msRest.CompositeMapper = { + serializedName: "TriggeredWebJob", + type: { + name: "Composite", + className: "TriggeredWebJob", + modelProperties: { + ...ProxyOnlyResource.type.modelProperties, + latestRun: { + serializedName: "properties.latest_run", + type: { + name: "Composite", + className: "TriggeredJobRun" + } + }, + historyUrl: { + serializedName: "properties.history_url", + type: { + name: "String" + } + }, + schedulerLogsUrl: { + serializedName: "properties.scheduler_logs_url", + type: { + name: "String" + } + }, + runCommand: { + serializedName: "properties.run_command", + type: { + name: "String" + } + }, + url: { + serializedName: "properties.url", + type: { + name: "String" + } + }, + extraInfoUrl: { + serializedName: "properties.extra_info_url", + type: { + name: "String" + } + }, + webJobType: { + serializedName: "properties.web_job_type", + type: { + name: "Enum", + allowedValues: [ + "Continuous", + "Triggered" + ] + } + }, + error: { + serializedName: "properties.error", + type: { + name: "String" + } + }, + usingSdk: { + serializedName: "properties.using_sdk", + type: { + name: "Boolean" + } + }, + settings: { + serializedName: "properties.settings", + type: { + name: "Dictionary", + value: { + type: { + name: "Object" + } + } + } + } + } + } +}; + +export const WebJob: msRest.CompositeMapper = { + serializedName: "WebJob", + type: { + name: "Composite", + className: "WebJob", + modelProperties: { + ...ProxyOnlyResource.type.modelProperties, + runCommand: { + serializedName: "properties.run_command", + type: { + name: "String" + } + }, + url: { + serializedName: "properties.url", + type: { + name: "String" + } + }, + extraInfoUrl: { + serializedName: "properties.extra_info_url", + type: { + name: "String" + } + }, + webJobType: { + serializedName: "properties.web_job_type", + type: { + name: "Enum", + allowedValues: [ + "Continuous", + "Triggered" + ] + } + }, + error: { + serializedName: "properties.error", + type: { + name: "String" + } + }, + usingSdk: { + serializedName: "properties.using_sdk", + type: { + name: "Boolean" + } + }, + settings: { + serializedName: "properties.settings", + type: { + name: "Dictionary", + value: { + type: { + name: "Object" + } + } + } + } + } + } +}; + +export const BillingMeter: msRest.CompositeMapper = { + serializedName: "BillingMeter", + type: { + name: "Composite", + className: "BillingMeter", + modelProperties: { + ...ProxyOnlyResource.type.modelProperties, + meterId: { + serializedName: "properties.meterId", + type: { + name: "String" + } + }, + billingLocation: { + serializedName: "properties.billingLocation", + type: { + name: "String" + } + }, + shortName: { + serializedName: "properties.shortName", + type: { + name: "String" + } + }, + friendlyName: { + serializedName: "properties.friendlyName", + type: { + name: "String" + } + }, + resourceType: { + serializedName: "properties.resourceType", + type: { + name: "String" + } + }, + osType: { + serializedName: "properties.osType", + type: { + name: "String" + } + } + } + } +}; + +export const CsmMoveResourceEnvelope: msRest.CompositeMapper = { + serializedName: "CsmMoveResourceEnvelope", + type: { + name: "Composite", + className: "CsmMoveResourceEnvelope", + modelProperties: { + targetResourceGroup: { + serializedName: "targetResourceGroup", + constraints: { + MaxLength: 90, + MinLength: 1, + Pattern: / ^[-\w\._\(\)]+[^\.]$/ + }, + type: { + name: "String" + } + }, + resources: { + serializedName: "resources", + type: { + name: "Sequence", + element: { + type: { + name: "String" + } + } + } + } + } + } +}; + +export const GeoRegion: msRest.CompositeMapper = { + serializedName: "GeoRegion", + type: { + name: "Composite", + className: "GeoRegion", + modelProperties: { + ...ProxyOnlyResource.type.modelProperties, + description: { + readOnly: true, + serializedName: "properties.description", + type: { + name: "String" + } + }, + displayName: { + readOnly: true, + serializedName: "properties.displayName", + type: { + name: "String" + } + } + } + } +}; + +export const HostingEnvironmentDeploymentInfo: msRest.CompositeMapper = { + serializedName: "HostingEnvironmentDeploymentInfo", + type: { + name: "Composite", + className: "HostingEnvironmentDeploymentInfo", + modelProperties: { + name: { + serializedName: "name", + type: { + name: "String" + } + }, + location: { + serializedName: "location", + type: { + name: "String" + } + } + } + } +}; + +export const DeploymentLocations: msRest.CompositeMapper = { + serializedName: "DeploymentLocations", + type: { + name: "Composite", + className: "DeploymentLocations", + modelProperties: { + locations: { + serializedName: "locations", + type: { + name: "Sequence", + element: { + type: { + name: "Composite", + className: "GeoRegion" + } + } + } + }, + hostingEnvironments: { + serializedName: "hostingEnvironments", + type: { + name: "Sequence", + element: { + type: { + name: "Composite", + className: "AppServiceEnvironment" + } + } + } + }, + hostingEnvironmentDeploymentInfos: { + serializedName: "hostingEnvironmentDeploymentInfos", + type: { + name: "Sequence", + element: { + type: { + name: "Composite", + className: "HostingEnvironmentDeploymentInfo" + } + } + } + } + } + } +}; + +export const GlobalCsmSkuDescription: msRest.CompositeMapper = { + serializedName: "GlobalCsmSkuDescription", + type: { + name: "Composite", + className: "GlobalCsmSkuDescription", + modelProperties: { + name: { + serializedName: "name", + type: { + name: "String" + } + }, + tier: { + serializedName: "tier", + type: { + name: "String" + } + }, + size: { + serializedName: "size", + type: { + name: "String" + } + }, + family: { + serializedName: "family", + type: { + name: "String" + } + }, + capacity: { + serializedName: "capacity", + type: { + name: "Composite", + className: "SkuCapacity" + } + }, + locations: { + serializedName: "locations", + type: { + name: "Sequence", + element: { + type: { + name: "String" + } + } + } + }, + capabilities: { + serializedName: "capabilities", + type: { + name: "Sequence", + element: { + type: { + name: "Composite", + className: "Capability" + } + } + } + } + } + } +}; + +export const PremierAddOnOffer: msRest.CompositeMapper = { + serializedName: "PremierAddOnOffer", + type: { + name: "Composite", + className: "PremierAddOnOffer", + modelProperties: { + ...ProxyOnlyResource.type.modelProperties, + sku: { + serializedName: "properties.sku", + type: { + name: "String" + } + }, + product: { + serializedName: "properties.product", + type: { + name: "String" + } + }, + vendor: { + serializedName: "properties.vendor", + type: { + name: "String" + } + }, + promoCodeRequired: { + serializedName: "properties.promoCodeRequired", + type: { + name: "Boolean" + } + }, + quota: { + serializedName: "properties.quota", + type: { + name: "Number" + } + }, + webHostingPlanRestrictions: { + serializedName: "properties.webHostingPlanRestrictions", + type: { + name: "Enum", + allowedValues: [ + "None", + "Free", + "Shared", + "Basic", + "Standard", + "Premium" + ] + } + }, + privacyPolicyUrl: { + serializedName: "properties.privacyPolicyUrl", + type: { + name: "String" + } + }, + legalTermsUrl: { + serializedName: "properties.legalTermsUrl", + type: { + name: "String" + } + }, + marketplacePublisher: { + serializedName: "properties.marketplacePublisher", + type: { + name: "String" + } + }, + marketplaceOffer: { + serializedName: "properties.marketplaceOffer", + type: { + name: "String" + } + } + } + } +}; + +export const ResourceNameAvailability: msRest.CompositeMapper = { + serializedName: "ResourceNameAvailability", + type: { + name: "Composite", + className: "ResourceNameAvailability", + modelProperties: { + nameAvailable: { + serializedName: "nameAvailable", + type: { + name: "Boolean" + } + }, + reason: { + serializedName: "reason", + type: { + name: "String" + } + }, + message: { + serializedName: "message", + type: { + name: "String" + } + } + } + } +}; + +export const ResourceNameAvailabilityRequest: msRest.CompositeMapper = { + 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: { + serializedName: "isFqdn", + type: { + name: "Boolean" + } + } + } + } +}; + +export const SkuInfos: msRest.CompositeMapper = { + serializedName: "SkuInfos", + type: { + name: "Composite", + className: "SkuInfos", + modelProperties: { + resourceType: { + serializedName: "resourceType", + type: { + name: "String" + } + }, + skus: { + serializedName: "skus", + type: { + name: "Sequence", + element: { + type: { + name: "Composite", + className: "GlobalCsmSkuDescription" + } + } + } + } + } + } +}; + +export const SourceControl: msRest.CompositeMapper = { + serializedName: "SourceControl", + type: { + name: "Composite", + className: "SourceControl", + modelProperties: { + ...ProxyOnlyResource.type.modelProperties, + token: { + serializedName: "properties.token", + type: { + name: "String" + } + }, + tokenSecret: { + serializedName: "properties.tokenSecret", + type: { + name: "String" + } + }, + refreshToken: { + serializedName: "properties.refreshToken", + type: { + name: "String" + } + }, + expirationTime: { + serializedName: "properties.expirationTime", + type: { + name: "DateTime" + } + } + } + } +}; + +export const ValidateContainerSettingsRequest: msRest.CompositeMapper = { + serializedName: "ValidateContainerSettingsRequest", + type: { + name: "Composite", + className: "ValidateContainerSettingsRequest", + modelProperties: { + baseUrl: { + serializedName: "baseUrl", + type: { + name: "String" + } + }, + username: { + serializedName: "username", + type: { + name: "String" + } + }, + password: { + serializedName: "password", + type: { + name: "String" + } + }, + repository: { + serializedName: "repository", + type: { + name: "String" + } + }, + tag: { + serializedName: "tag", + type: { + name: "String" + } + }, + platform: { + serializedName: "platform", + type: { + name: "String" + } + } + } + } +}; + +export const ValidateRequest: msRest.CompositeMapper = { + 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: { + serializedName: "properties.serverFarmId", + type: { + name: "String" + } + }, + skuName: { + serializedName: "properties.skuName", + type: { + name: "String" + } + }, + needLinuxWorkers: { + serializedName: "properties.needLinuxWorkers", + type: { + name: "Boolean" + } + }, + isSpot: { + serializedName: "properties.isSpot", + type: { + name: "Boolean" + } + }, + capacity: { + serializedName: "properties.capacity", + constraints: { + InclusiveMinimum: 1 + }, + type: { + name: "Number" + } + }, + hostingEnvironment: { + serializedName: "properties.hostingEnvironment", + type: { + name: "String" + } + }, + isXenon: { + serializedName: "properties.isXenon", + type: { + name: "Boolean" + } + } + } + } +}; + +export const ValidateResponseError: msRest.CompositeMapper = { + serializedName: "ValidateResponseError", + type: { + name: "Composite", + className: "ValidateResponseError", + modelProperties: { + code: { + serializedName: "code", + type: { + name: "String" + } + }, + message: { + serializedName: "message", + type: { + name: "String" + } + } + } + } +}; + +export const ValidateResponse: msRest.CompositeMapper = { + serializedName: "ValidateResponse", + type: { + name: "Composite", + className: "ValidateResponse", + modelProperties: { + status: { + serializedName: "status", + type: { + name: "String" + } + }, + error: { + serializedName: "error", + type: { + name: "Composite", + className: "ValidateResponseError" + } + } + } + } +}; + +export const VnetParameters: msRest.CompositeMapper = { + serializedName: "VnetParameters", + type: { + name: "Composite", + className: "VnetParameters", + modelProperties: { + ...ProxyOnlyResource.type.modelProperties, + vnetResourceGroup: { + serializedName: "properties.vnetResourceGroup", + type: { + name: "String" + } + }, + vnetName: { + serializedName: "properties.vnetName", + type: { + name: "String" + } + }, + vnetSubnetName: { + serializedName: "properties.vnetSubnetName", + type: { + name: "String" + } + } + } + } +}; + +export const VnetValidationTestFailure: msRest.CompositeMapper = { + serializedName: "VnetValidationTestFailure", + type: { + name: "Composite", + className: "VnetValidationTestFailure", + modelProperties: { + ...ProxyOnlyResource.type.modelProperties, + testName: { + serializedName: "properties.testName", + type: { + name: "String" + } + }, + details: { + serializedName: "properties.details", + type: { + name: "String" + } + } + } + } +}; + +export const VnetValidationFailureDetails: msRest.CompositeMapper = { + serializedName: "VnetValidationFailureDetails", + type: { + name: "Composite", + className: "VnetValidationFailureDetails", + modelProperties: { + ...ProxyOnlyResource.type.modelProperties, + failed: { + serializedName: "properties.failed", + type: { + name: "Boolean" + } + }, + failedTests: { + serializedName: "properties.failedTests", + type: { + name: "Sequence", + element: { + type: { + name: "Composite", + className: "VnetValidationTestFailure" + } + } + } + } + } + } +}; + +export const AppServicePlanPatchResource: msRest.CompositeMapper = { + serializedName: "AppServicePlanPatchResource", + type: { + name: "Composite", + className: "AppServicePlanPatchResource", + modelProperties: { + ...ProxyOnlyResource.type.modelProperties, + workerTierName: { + serializedName: "properties.workerTierName", + type: { + name: "String" + } + }, + status: { + readOnly: true, + serializedName: "properties.status", + type: { + name: "Enum", + allowedValues: [ + "Ready", + "Pending", + "Creating" + ] + } + }, + subscription: { + readOnly: true, + serializedName: "properties.subscription", + type: { + name: "String" + } + }, + hostingEnvironmentProfile: { + serializedName: "properties.hostingEnvironmentProfile", + type: { + name: "Composite", + className: "HostingEnvironmentProfile" + } + }, + maximumNumberOfWorkers: { + readOnly: true, + serializedName: "properties.maximumNumberOfWorkers", + type: { + name: "Number" + } + }, + geoRegion: { + readOnly: true, + serializedName: "properties.geoRegion", + type: { + name: "String" + } + }, + perSiteScaling: { + serializedName: "properties.perSiteScaling", + defaultValue: false, + type: { + name: "Boolean" + } + }, + maximumElasticWorkerCount: { + serializedName: "properties.maximumElasticWorkerCount", + type: { + name: "Number" + } + }, + numberOfSites: { + readOnly: true, + serializedName: "properties.numberOfSites", + type: { + name: "Number" + } + }, + isSpot: { + serializedName: "properties.isSpot", + type: { + name: "Boolean" + } + }, + spotExpirationTime: { + serializedName: "properties.spotExpirationTime", + type: { + name: "DateTime" + } + }, + freeOfferExpirationTime: { + serializedName: "properties.freeOfferExpirationTime", + type: { + name: "DateTime" + } + }, + resourceGroup: { + readOnly: true, + serializedName: "properties.resourceGroup", + type: { + name: "String" + } + }, + reserved: { + serializedName: "properties.reserved", + defaultValue: false, + type: { + name: "Boolean" + } + }, + isXenon: { + serializedName: "properties.isXenon", + defaultValue: false, + type: { + name: "Boolean" + } + }, + hyperV: { + serializedName: "properties.hyperV", + defaultValue: false, + type: { + name: "Boolean" + } + }, + targetWorkerCount: { + serializedName: "properties.targetWorkerCount", + type: { + name: "Number" + } + }, + targetWorkerSizeId: { + serializedName: "properties.targetWorkerSizeId", + type: { + name: "Number" + } + }, + provisioningState: { + readOnly: true, + serializedName: "properties.provisioningState", + type: { + name: "Enum", + allowedValues: [ + "Succeeded", + "Failed", + "Canceled", + "InProgress", + "Deleting" + ] + } + } + } + } +}; + +export const HybridConnectionLimits: msRest.CompositeMapper = { + serializedName: "HybridConnectionLimits", + type: { + name: "Composite", + className: "HybridConnectionLimits", + modelProperties: { + ...ProxyOnlyResource.type.modelProperties, + current: { + readOnly: true, + serializedName: "properties.current", + type: { + name: "Number" + } + }, + maximum: { + readOnly: true, + serializedName: "properties.maximum", + type: { + name: "Number" + } + } + } + } +}; + +export const StackMinorVersion: msRest.CompositeMapper = { + serializedName: "StackMinorVersion", + type: { + name: "Composite", + className: "StackMinorVersion", + modelProperties: { + displayVersion: { + serializedName: "displayVersion", + type: { + name: "String" + } + }, + runtimeVersion: { + serializedName: "runtimeVersion", + type: { + name: "String" + } + }, + isDefault: { + serializedName: "isDefault", + type: { + name: "Boolean" + } + }, + isRemoteDebuggingEnabled: { + serializedName: "isRemoteDebuggingEnabled", + type: { + name: "Boolean" + } + } + } + } +}; + +export const StackMajorVersion: msRest.CompositeMapper = { + serializedName: "StackMajorVersion", + type: { + name: "Composite", + className: "StackMajorVersion", + modelProperties: { + displayVersion: { + serializedName: "displayVersion", + type: { + name: "String" + } + }, + runtimeVersion: { + serializedName: "runtimeVersion", + type: { + name: "String" + } + }, + isDefault: { + serializedName: "isDefault", + type: { + name: "Boolean" + } + }, + minorVersions: { + serializedName: "minorVersions", + type: { + name: "Sequence", + element: { + type: { + name: "Composite", + className: "StackMinorVersion" + } + } + } + }, + applicationInsights: { + serializedName: "applicationInsights", + type: { + name: "Boolean" + } + } + } + } +}; + +export const ApplicationStack: msRest.CompositeMapper = { + serializedName: "ApplicationStack", + type: { + name: "Composite", + className: "ApplicationStack", + modelProperties: { + name: { + serializedName: "name", + type: { + name: "String" + } + }, + display: { + serializedName: "display", + type: { + name: "String" + } + }, + dependency: { + serializedName: "dependency", + type: { + name: "String" + } + }, + majorVersions: { + serializedName: "majorVersions", + type: { + name: "Sequence", + element: { + type: { + name: "Composite", + className: "StackMajorVersion" + } + } + } + }, + frameworks: { + serializedName: "frameworks", + type: { + name: "Sequence", + element: { + type: { + name: "Composite", + className: "ApplicationStack" + } + } + } + } + } + } +}; + +export const Recommendation: msRest.CompositeMapper = { + serializedName: "Recommendation", + type: { + name: "Composite", + className: "Recommendation", + modelProperties: { + ...ProxyOnlyResource.type.modelProperties, + creationTime: { + serializedName: "properties.creationTime", + type: { + name: "DateTime" + } + }, + recommendationId: { + serializedName: "properties.recommendationId", + type: { + name: "Uuid" + } + }, + resourceId: { + serializedName: "properties.resourceId", + type: { + name: "String" + } + }, + resourceScope: { + serializedName: "properties.resourceScope", + type: { + name: "String" + } + }, + ruleName: { + serializedName: "properties.ruleName", + type: { + name: "String" + } + }, + displayName: { + serializedName: "properties.displayName", + type: { + name: "String" + } + }, + message: { + serializedName: "properties.message", + type: { + name: "String" + } + }, + level: { + serializedName: "properties.level", + type: { + name: "Enum", + allowedValues: [ + "Critical", + "Warning", + "Information", + "NonUrgentSuggestion" + ] + } + }, + channels: { + serializedName: "properties.channels", + type: { + name: "Enum", + allowedValues: [ + "Notification", + "Api", + "Email", + "Webhook", + "All" + ] + } + }, + categoryTags: { + readOnly: true, + serializedName: "properties.categoryTags", + type: { + name: "Sequence", + element: { + type: { + name: "String" + } + } + } + }, + actionName: { + serializedName: "properties.actionName", + type: { + name: "String" + } + }, + enabled: { + serializedName: "properties.enabled", + type: { + name: "Number" + } + }, + states: { + serializedName: "properties.states", + type: { + name: "Sequence", + element: { + type: { + name: "String" + } + } + } + }, + startTime: { + serializedName: "properties.startTime", + type: { + name: "DateTime" + } + }, + endTime: { + serializedName: "properties.endTime", + type: { + name: "DateTime" + } + }, + nextNotificationTime: { + serializedName: "properties.nextNotificationTime", + type: { + name: "DateTime" + } + }, + notificationExpirationTime: { + serializedName: "properties.notificationExpirationTime", + type: { + name: "DateTime" + } + }, + notifiedTime: { + serializedName: "properties.notifiedTime", + type: { + name: "DateTime" + } + }, + score: { + serializedName: "properties.score", + type: { + name: "Number" + } + }, + isDynamic: { + serializedName: "properties.isDynamic", + type: { + name: "Boolean" + } + }, + extensionName: { + serializedName: "properties.extensionName", + type: { + name: "String" + } + }, + bladeName: { + serializedName: "properties.bladeName", + type: { + name: "String" + } + }, + forwardLink: { + serializedName: "properties.forwardLink", + type: { + name: "String" + } + } + } + } +}; + +export const RecommendationRule: msRest.CompositeMapper = { + serializedName: "RecommendationRule", + type: { + name: "Composite", + className: "RecommendationRule", + modelProperties: { + ...ProxyOnlyResource.type.modelProperties, + recommendationName: { + serializedName: "properties.recommendationName", + type: { + name: "String" + } + }, + displayName: { + serializedName: "properties.displayName", + type: { + name: "String" + } + }, + message: { + serializedName: "properties.message", + type: { + name: "String" + } + }, + recommendationId: { + serializedName: "properties.recommendationId", + type: { + name: "Uuid" + } + }, + description: { + serializedName: "properties.description", + type: { + name: "String" + } + }, + actionName: { + serializedName: "properties.actionName", + type: { + name: "String" + } + }, + level: { + serializedName: "properties.level", + type: { + name: "Enum", + allowedValues: [ + "Critical", + "Warning", + "Information", + "NonUrgentSuggestion" + ] + } + }, + channels: { + serializedName: "properties.channels", + type: { + name: "Enum", + allowedValues: [ + "Notification", + "Api", + "Email", + "Webhook", + "All" + ] + } + }, + categoryTags: { + readOnly: true, + serializedName: "properties.categoryTags", + type: { + name: "Sequence", + element: { + type: { + name: "String" + } + } + } + }, + isDynamic: { + serializedName: "properties.isDynamic", + type: { + name: "Boolean" + } + }, + extensionName: { + serializedName: "properties.extensionName", + type: { + name: "String" + } + }, + bladeName: { + serializedName: "properties.bladeName", + type: { + name: "String" + } + }, + forwardLink: { + serializedName: "properties.forwardLink", + type: { + name: "String" + } + } + } + } +}; + +export const CertificateCollection: msRest.CompositeMapper = { + serializedName: "CertificateCollection", + type: { + name: "Composite", + className: "CertificateCollection", + modelProperties: { + value: { + required: true, + serializedName: "", + type: { + name: "Sequence", + element: { + type: { + name: "Composite", + className: "Certificate" + } + } + } + }, + nextLink: { + readOnly: true, + serializedName: "nextLink", + type: { + name: "String" + } + } + } + } +}; + +export const WebAppCollection: msRest.CompositeMapper = { + serializedName: "WebAppCollection", + type: { + name: "Composite", + className: "WebAppCollection", + modelProperties: { + value: { + required: true, + serializedName: "", + type: { + name: "Sequence", + element: { + type: { + name: "Composite", + className: "Site" + } + } + } + }, + nextLink: { + readOnly: true, + serializedName: "nextLink", + type: { + name: "String" + } + } + } + } +}; + +export const BackupItemCollection: msRest.CompositeMapper = { + serializedName: "BackupItemCollection", + type: { + name: "Composite", + className: "BackupItemCollection", + modelProperties: { + value: { + required: true, + serializedName: "", + type: { + name: "Sequence", + element: { + type: { + name: "Composite", + className: "BackupItem" + } + } + } + }, + nextLink: { + readOnly: true, + serializedName: "nextLink", + type: { + name: "String" + } + } + } + } +}; + +export const SiteConfigResourceCollection: msRest.CompositeMapper = { + serializedName: "SiteConfigResourceCollection", + type: { + name: "Composite", + className: "SiteConfigResourceCollection", + modelProperties: { + value: { + required: true, + serializedName: "", + type: { + name: "Sequence", + element: { + type: { + name: "Composite", + className: "SiteConfigResource" + } + } + } + }, + nextLink: { + readOnly: true, + serializedName: "nextLink", + type: { + name: "String" + } + } + } + } +}; + +export const SiteConfigurationSnapshotInfoCollection: msRest.CompositeMapper = { + serializedName: "SiteConfigurationSnapshotInfoCollection", + type: { + name: "Composite", + className: "SiteConfigurationSnapshotInfoCollection", + modelProperties: { + value: { + required: true, + serializedName: "", + type: { + name: "Sequence", + element: { + type: { + name: "Composite", + className: "SiteConfigurationSnapshotInfo" + } + } + } + }, + nextLink: { + readOnly: true, + serializedName: "nextLink", + type: { + name: "String" + } + } + } + } +}; + +export const ContinuousWebJobCollection: msRest.CompositeMapper = { + serializedName: "ContinuousWebJobCollection", + type: { + name: "Composite", + className: "ContinuousWebJobCollection", + modelProperties: { + value: { + required: true, + serializedName: "", + type: { + name: "Sequence", + element: { + type: { + name: "Composite", + className: "ContinuousWebJob" + } + } + } + }, + nextLink: { + readOnly: true, + serializedName: "nextLink", + type: { + name: "String" + } + } + } + } +}; + +export const DeploymentCollection: msRest.CompositeMapper = { + serializedName: "DeploymentCollection", + type: { + name: "Composite", + className: "DeploymentCollection", + modelProperties: { + value: { + required: true, + serializedName: "", + type: { + name: "Sequence", + element: { + type: { + name: "Composite", + className: "Deployment" + } + } + } + }, + nextLink: { + readOnly: true, + serializedName: "nextLink", + type: { + name: "String" + } + } + } + } +}; + +export const IdentifierCollection: msRest.CompositeMapper = { + serializedName: "IdentifierCollection", + type: { + name: "Composite", + className: "IdentifierCollection", + modelProperties: { + value: { + required: true, + serializedName: "", + type: { + name: "Sequence", + element: { + type: { + name: "Composite", + className: "Identifier" + } + } + } + }, + nextLink: { + readOnly: true, + serializedName: "nextLink", + type: { + name: "String" + } + } + } + } +}; + +export const FunctionEnvelopeCollection: msRest.CompositeMapper = { + serializedName: "FunctionEnvelopeCollection", + type: { + name: "Composite", + className: "FunctionEnvelopeCollection", + modelProperties: { + value: { + required: true, + serializedName: "", + type: { + name: "Sequence", + element: { + type: { + name: "Composite", + className: "FunctionEnvelope" + } + } + } + }, + nextLink: { + readOnly: true, + serializedName: "nextLink", + type: { + name: "String" + } + } + } + } +}; + +export const HostNameBindingCollection: msRest.CompositeMapper = { + serializedName: "HostNameBindingCollection", + type: { + name: "Composite", + className: "HostNameBindingCollection", + modelProperties: { + value: { + required: true, + serializedName: "", + type: { + name: "Sequence", + element: { + type: { + name: "Composite", + className: "HostNameBinding" + } + } + } + }, + nextLink: { + readOnly: true, + serializedName: "nextLink", + type: { + name: "String" + } + } + } + } +}; + +export const WebAppInstanceCollection: msRest.CompositeMapper = { + serializedName: "WebAppInstanceCollection", + type: { + name: "Composite", + className: "WebAppInstanceCollection", + modelProperties: { + value: { + required: true, + serializedName: "", + type: { + name: "Sequence", + element: { + type: { + name: "Composite", + className: "SiteInstance" + } + } + } + }, + nextLink: { + readOnly: true, + serializedName: "nextLink", + type: { + name: "String" + } + } + } + } +}; + +export const ProcessInfoCollection: msRest.CompositeMapper = { + serializedName: "ProcessInfoCollection", + type: { + name: "Composite", + className: "ProcessInfoCollection", + modelProperties: { + value: { + required: true, + serializedName: "", + type: { + name: "Sequence", + element: { + type: { + name: "Composite", + className: "ProcessInfo" + } + } + } + }, + nextLink: { + readOnly: true, + serializedName: "nextLink", + type: { + name: "String" + } + } + } + } +}; + +export const ProcessModuleInfoCollection: msRest.CompositeMapper = { + serializedName: "ProcessModuleInfoCollection", + type: { + name: "Composite", + className: "ProcessModuleInfoCollection", + modelProperties: { + value: { + required: true, + serializedName: "", + type: { + name: "Sequence", + element: { + type: { + name: "Composite", + className: "ProcessModuleInfo" + } + } + } + }, + nextLink: { + readOnly: true, + serializedName: "nextLink", + type: { + name: "String" + } + } + } + } +}; + +export const ProcessThreadInfoCollection: msRest.CompositeMapper = { + serializedName: "ProcessThreadInfoCollection", + type: { + name: "Composite", + className: "ProcessThreadInfoCollection", + modelProperties: { + value: { + required: true, + serializedName: "", + type: { + name: "Sequence", + element: { + type: { + name: "Composite", + className: "ProcessThreadInfo" + } + } + } + }, + nextLink: { + readOnly: true, + serializedName: "nextLink", + type: { + name: "String" + } + } + } + } +}; + +export const ResourceMetricDefinitionCollection: msRest.CompositeMapper = { + serializedName: "ResourceMetricDefinitionCollection", + type: { + name: "Composite", + className: "ResourceMetricDefinitionCollection", + modelProperties: { + value: { + required: true, + serializedName: "", + type: { + name: "Sequence", + element: { + type: { + name: "Composite", + className: "ResourceMetricDefinition" + } + } + } + }, + nextLink: { + readOnly: true, + serializedName: "nextLink", + type: { + name: "String" + } + } + } + } +}; + +export const ResourceMetricCollection: msRest.CompositeMapper = { + serializedName: "ResourceMetricCollection", + type: { + name: "Composite", + className: "ResourceMetricCollection", + modelProperties: { + value: { + required: true, + serializedName: "", + type: { + name: "Sequence", + element: { + type: { + name: "Composite", + className: "ResourceMetric" + } + } + } + }, + nextLink: { + readOnly: true, + serializedName: "nextLink", + type: { + name: "String" + } + } + } + } +}; + +export const PerfMonCounterCollection: msRest.CompositeMapper = { + serializedName: "PerfMonCounterCollection", + type: { + name: "Composite", + className: "PerfMonCounterCollection", + modelProperties: { + value: { + required: true, + serializedName: "", + type: { + name: "Sequence", + element: { + type: { + name: "Composite", + className: "PerfMonResponse" + } + } + } + }, + nextLink: { + readOnly: true, + serializedName: "nextLink", + type: { + name: "String" + } + } + } + } +}; + +export const PublicCertificateCollection: msRest.CompositeMapper = { + serializedName: "PublicCertificateCollection", + type: { + name: "Composite", + className: "PublicCertificateCollection", + modelProperties: { + value: { + required: true, + serializedName: "", + type: { + name: "Sequence", + element: { + type: { + name: "Composite", + className: "PublicCertificate" + } + } + } + }, + nextLink: { + readOnly: true, + serializedName: "nextLink", + type: { + name: "String" + } + } + } + } +}; + +export const SiteExtensionInfoCollection: msRest.CompositeMapper = { + serializedName: "SiteExtensionInfoCollection", + type: { + name: "Composite", + className: "SiteExtensionInfoCollection", + modelProperties: { + value: { + required: true, + serializedName: "", + type: { + name: "Sequence", + element: { + type: { + name: "Composite", + className: "SiteExtensionInfo" + } + } + } + }, + nextLink: { + readOnly: true, + serializedName: "nextLink", + type: { + name: "String" + } + } + } + } +}; + +export const SlotDifferenceCollection: msRest.CompositeMapper = { + serializedName: "SlotDifferenceCollection", + type: { + name: "Composite", + className: "SlotDifferenceCollection", + modelProperties: { + value: { + required: true, + serializedName: "", + type: { + name: "Sequence", + element: { + type: { + name: "Composite", + className: "SlotDifference" + } + } + } + }, + nextLink: { + readOnly: true, + serializedName: "nextLink", + type: { + name: "String" + } + } + } + } +}; + +export const SnapshotCollection: msRest.CompositeMapper = { + serializedName: "SnapshotCollection", + type: { + name: "Composite", + className: "SnapshotCollection", + modelProperties: { + value: { + required: true, + serializedName: "", + type: { + name: "Sequence", + element: { + type: { + name: "Composite", + className: "Snapshot" + } + } + } + }, + nextLink: { + readOnly: true, + serializedName: "nextLink", + type: { + name: "String" + } + } + } + } +}; + +export const TriggeredWebJobCollection: msRest.CompositeMapper = { + serializedName: "TriggeredWebJobCollection", + type: { + name: "Composite", + className: "TriggeredWebJobCollection", + modelProperties: { + value: { + required: true, + serializedName: "", + type: { + name: "Sequence", + element: { + type: { + name: "Composite", + className: "TriggeredWebJob" + } + } + } + }, + nextLink: { + readOnly: true, + serializedName: "nextLink", + type: { + name: "String" + } + } + } + } +}; + +export const TriggeredJobHistoryCollection: msRest.CompositeMapper = { + serializedName: "TriggeredJobHistoryCollection", + type: { + name: "Composite", + className: "TriggeredJobHistoryCollection", + modelProperties: { + value: { + required: true, + serializedName: "", + type: { + name: "Sequence", + element: { + type: { + name: "Composite", + className: "TriggeredJobHistory" + } + } + } + }, + nextLink: { + readOnly: true, + serializedName: "nextLink", + type: { + name: "String" + } + } + } + } +}; + +export const CsmUsageQuotaCollection: msRest.CompositeMapper = { + serializedName: "CsmUsageQuotaCollection", + type: { + name: "Composite", + className: "CsmUsageQuotaCollection", + modelProperties: { + value: { + required: true, + serializedName: "", + type: { + name: "Sequence", + element: { + type: { + name: "Composite", + className: "CsmUsageQuota" + } + } + } + }, + nextLink: { + readOnly: true, + serializedName: "nextLink", + type: { + name: "String" + } + } + } + } +}; + +export const WebJobCollection: msRest.CompositeMapper = { + serializedName: "WebJobCollection", + type: { + name: "Composite", + className: "WebJobCollection", + modelProperties: { + value: { + required: true, + serializedName: "", + type: { + name: "Sequence", + element: { + type: { + name: "Composite", + className: "WebJob" + } + } + } + }, + nextLink: { + readOnly: true, + serializedName: "nextLink", + type: { + name: "String" + } + } + } + } +}; + +export const SourceControlCollection: msRest.CompositeMapper = { + serializedName: "SourceControlCollection", + type: { + name: "Composite", + className: "SourceControlCollection", + modelProperties: { + value: { + required: true, + serializedName: "", + type: { + name: "Sequence", + element: { + type: { + name: "Composite", + className: "SourceControl" + } + } + } + }, + nextLink: { + readOnly: true, + serializedName: "nextLink", + type: { + name: "String" + } + } + } + } +}; + +export const BillingMeterCollection: msRest.CompositeMapper = { + serializedName: "BillingMeterCollection", + type: { + name: "Composite", + className: "BillingMeterCollection", + modelProperties: { + value: { + required: true, + serializedName: "", + type: { + name: "Sequence", + element: { + type: { + name: "Composite", + className: "BillingMeter" + } + } + } + }, + nextLink: { + readOnly: true, + serializedName: "nextLink", + type: { + name: "String" + } + } + } + } +}; + +export const GeoRegionCollection: msRest.CompositeMapper = { + serializedName: "GeoRegionCollection", + type: { + name: "Composite", + className: "GeoRegionCollection", + modelProperties: { + value: { + required: true, + serializedName: "", + type: { + name: "Sequence", + element: { + type: { + name: "Composite", + className: "GeoRegion" + } + } + } + }, + nextLink: { + readOnly: true, + serializedName: "nextLink", + type: { + name: "String" + } + } + } + } +}; + +export const PremierAddOnOfferCollection: msRest.CompositeMapper = { + serializedName: "PremierAddOnOfferCollection", + type: { + name: "Composite", + className: "PremierAddOnOfferCollection", + modelProperties: { + value: { + required: true, + serializedName: "", + type: { + name: "Sequence", + element: { + type: { + name: "Composite", + className: "PremierAddOnOffer" + } + } + } + }, + nextLink: { + readOnly: true, + serializedName: "nextLink", + type: { + name: "String" + } + } + } + } +}; + +export const AppServicePlanCollection: msRest.CompositeMapper = { + serializedName: "AppServicePlanCollection", + type: { + name: "Composite", + className: "AppServicePlanCollection", + modelProperties: { + value: { + required: true, + serializedName: "", + type: { + name: "Sequence", + element: { + type: { + name: "Composite", + className: "AppServicePlan" + } + } + } + }, + nextLink: { + readOnly: true, + serializedName: "nextLink", + type: { + name: "String" + } + } + } + } +}; + +export const ResourceCollection: msRest.CompositeMapper = { + serializedName: "ResourceCollection", + type: { + name: "Composite", + className: "ResourceCollection", + modelProperties: { + value: { + required: true, + serializedName: "", + type: { + name: "Sequence", + element: { + type: { + name: "String" + } + } + } + }, + nextLink: { + readOnly: true, + serializedName: "nextLink", + type: { + name: "String" + } + } + } + } +}; + +export const HybridConnectionCollection: msRest.CompositeMapper = { + serializedName: "HybridConnectionCollection", + type: { + name: "Composite", + className: "HybridConnectionCollection", + modelProperties: { + value: { + required: true, + serializedName: "", + type: { + name: "Sequence", + element: { + type: { + name: "Composite", + className: "HybridConnection" + } + } + } + }, + nextLink: { + readOnly: true, + serializedName: "nextLink", + type: { + name: "String" + } + } + } + } +}; + +export const ApplicationStackCollection: msRest.CompositeMapper = { + serializedName: "ApplicationStackCollection", + type: { + name: "Composite", + className: "ApplicationStackCollection", + modelProperties: { + value: { + required: true, + serializedName: "", + type: { + name: "Sequence", + element: { + type: { + name: "Composite", + className: "ApplicationStack" + } + } + } + }, + nextLink: { + readOnly: true, + serializedName: "nextLink", + type: { + name: "String" + } + } + } + } +}; + +export const CsmOperationCollection: msRest.CompositeMapper = { + serializedName: "CsmOperationCollection", + type: { + name: "Composite", + className: "CsmOperationCollection", + modelProperties: { + value: { + required: true, + serializedName: "", + type: { + name: "Sequence", + element: { + type: { + name: "Composite", + className: "CsmOperationDescription" + } + } + } + }, + nextLink: { + readOnly: true, + serializedName: "nextLink", + type: { + name: "String" + } + } + } + } +}; + +export const RecommendationCollection: msRest.CompositeMapper = { + serializedName: "RecommendationCollection", + type: { + name: "Composite", + className: "RecommendationCollection", + modelProperties: { + value: { + required: true, + serializedName: "", + type: { + name: "Sequence", + element: { + type: { + name: "Composite", + className: "Recommendation" + } + } + } + }, + nextLink: { + readOnly: true, + serializedName: "nextLink", + type: { + name: "String" + } + } + } + } +}; diff --git a/sdk/appservice/arm-appservice-profile-2019-03-01-hybrid/src/models/parameters.ts b/sdk/appservice/arm-appservice-profile-2019-03-01-hybrid/src/models/parameters.ts new file mode 100644 index 000000000000..b3ce9881d828 --- /dev/null +++ b/sdk/appservice/arm-appservice-profile-2019-03-01-hybrid/src/models/parameters.ts @@ -0,0 +1,669 @@ +/* + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * 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 * as msRest from "@azure/ms-rest-js"; + +export const acceptLanguage: msRest.OperationParameter = { + parameterPath: "acceptLanguage", + mapper: { + serializedName: "accept-language", + defaultValue: 'en-US', + type: { + name: "String" + } + } +}; +export const apiVersion: msRest.OperationQueryParameter = { + parameterPath: "apiVersion", + mapper: { + required: true, + serializedName: "api-version", + type: { + name: "String" + } + } +}; +export const backupId: msRest.OperationURLParameter = { + parameterPath: "backupId", + mapper: { + required: true, + serializedName: "backupId", + type: { + name: "String" + } + } +}; +export const baseAddress: msRest.OperationURLParameter = { + parameterPath: "baseAddress", + mapper: { + required: true, + serializedName: "baseAddress", + type: { + name: "String" + } + } +}; +export const billingLocation: msRest.OperationQueryParameter = { + parameterPath: [ + "options", + "billingLocation" + ], + mapper: { + serializedName: "billingLocation", + type: { + name: "String" + } + } +}; +export const deleteEmptyServerFarm: msRest.OperationQueryParameter = { + parameterPath: [ + "options", + "deleteEmptyServerFarm" + ], + mapper: { + serializedName: "deleteEmptyServerFarm", + type: { + name: "Boolean" + } + } +}; +export const deleteMetrics: msRest.OperationQueryParameter = { + parameterPath: [ + "options", + "deleteMetrics" + ], + mapper: { + serializedName: "deleteMetrics", + type: { + name: "Boolean" + } + } +}; +export const detailed: msRest.OperationQueryParameter = { + parameterPath: [ + "options", + "detailed" + ], + mapper: { + serializedName: "detailed", + type: { + name: "Boolean" + } + } +}; +export const details: msRest.OperationQueryParameter = { + parameterPath: [ + "options", + "details" + ], + mapper: { + serializedName: "details", + type: { + name: "Boolean" + } + } +}; +export const domainOwnershipIdentifierName: msRest.OperationURLParameter = { + parameterPath: "domainOwnershipIdentifierName", + mapper: { + required: true, + serializedName: "domainOwnershipIdentifierName", + type: { + name: "String" + } + } +}; +export const durationInSeconds: msRest.OperationQueryParameter = { + parameterPath: [ + "options", + "durationInSeconds" + ], + mapper: { + serializedName: "durationInSeconds", + type: { + name: "Number" + } + } +}; +export const entityName: msRest.OperationURLParameter = { + parameterPath: "entityName", + mapper: { + required: true, + serializedName: "entityName", + type: { + name: "String" + } + } +}; +export const environmentName: msRest.OperationQueryParameter = { + parameterPath: "environmentName", + mapper: { + required: true, + serializedName: "environmentName", + type: { + name: "String" + } + } +}; +export const expiredOnly: msRest.OperationQueryParameter = { + parameterPath: [ + "options", + "expiredOnly" + ], + mapper: { + serializedName: "expiredOnly", + type: { + name: "Boolean" + } + } +}; +export const featured: msRest.OperationQueryParameter = { + parameterPath: [ + "options", + "featured" + ], + mapper: { + serializedName: "featured", + type: { + name: "Boolean" + } + } +}; +export const filter: msRest.OperationQueryParameter = { + parameterPath: [ + "options", + "filter" + ], + mapper: { + serializedName: "$filter", + type: { + name: "String" + } + }, + skipEncoding: true +}; +export const functionName: msRest.OperationURLParameter = { + parameterPath: "functionName", + mapper: { + required: true, + serializedName: "functionName", + type: { + name: "String" + } + } +}; +export const gatewayName: msRest.OperationURLParameter = { + parameterPath: "gatewayName", + mapper: { + required: true, + serializedName: "gatewayName", + type: { + name: "String" + } + } +}; +export const hostingEnvironmentName: msRest.OperationURLParameter = { + parameterPath: "hostingEnvironmentName", + mapper: { + required: true, + serializedName: "hostingEnvironmentName", + type: { + name: "String" + } + } +}; +export const hostName0: msRest.OperationQueryParameter = { + parameterPath: [ + "options", + "hostName" + ], + mapper: { + serializedName: "hostName", + type: { + name: "String" + } + } +}; +export const hostName1: msRest.OperationURLParameter = { + parameterPath: "hostName", + mapper: { + required: true, + serializedName: "hostName", + type: { + name: "String" + } + } +}; +export const id: msRest.OperationURLParameter = { + parameterPath: "id", + mapper: { + required: true, + serializedName: "id", + type: { + name: "String" + } + } +}; +export const includeSlots: msRest.OperationQueryParameter = { + parameterPath: [ + "options", + "includeSlots" + ], + mapper: { + serializedName: "includeSlots", + type: { + name: "Boolean" + } + } +}; +export const instanceId: msRest.OperationURLParameter = { + parameterPath: "instanceId", + mapper: { + required: true, + serializedName: "instanceId", + type: { + name: "String" + } + } +}; +export const linuxDynamicWorkersEnabled: msRest.OperationQueryParameter = { + parameterPath: [ + "options", + "linuxDynamicWorkersEnabled" + ], + mapper: { + serializedName: "linuxDynamicWorkersEnabled", + type: { + name: "Boolean" + } + } +}; +export const linuxWorkersEnabled: msRest.OperationQueryParameter = { + parameterPath: [ + "options", + "linuxWorkersEnabled" + ], + mapper: { + serializedName: "linuxWorkersEnabled", + type: { + name: "Boolean" + } + } +}; +export const maxFrameLength: msRest.OperationQueryParameter = { + parameterPath: [ + "options", + "maxFrameLength" + ], + mapper: { + serializedName: "maxFrameLength", + type: { + name: "Number" + } + } +}; +export const name: msRest.OperationURLParameter = { + parameterPath: "name", + mapper: { + required: true, + serializedName: "name", + type: { + name: "String" + } + } +}; +export const namespaceName: msRest.OperationURLParameter = { + parameterPath: "namespaceName", + mapper: { + required: true, + serializedName: "namespaceName", + type: { + name: "String" + } + } +}; +export const nextPageLink: msRest.OperationURLParameter = { + parameterPath: "nextPageLink", + mapper: { + required: true, + serializedName: "nextLink", + type: { + name: "String" + } + }, + skipEncoding: true +}; +export const operationId: msRest.OperationURLParameter = { + parameterPath: "operationId", + mapper: { + required: true, + serializedName: "operationId", + type: { + name: "String" + } + } +}; +export const osType: msRest.OperationQueryParameter = { + parameterPath: [ + "options", + "osType" + ], + mapper: { + serializedName: "osType", + type: { + name: "String" + } + } +}; +export const osTypeSelected: msRest.OperationQueryParameter = { + parameterPath: [ + "options", + "osTypeSelected" + ], + mapper: { + serializedName: "osTypeSelected", + type: { + name: "String" + } + } +}; +export const premierAddOnName: msRest.OperationURLParameter = { + parameterPath: "premierAddOnName", + mapper: { + required: true, + serializedName: "premierAddOnName", + type: { + name: "String" + } + } +}; +export const processId: msRest.OperationURLParameter = { + parameterPath: "processId", + mapper: { + required: true, + serializedName: "processId", + type: { + name: "String" + } + } +}; +export const publicCertificateName: msRest.OperationURLParameter = { + parameterPath: "publicCertificateName", + mapper: { + required: true, + serializedName: "publicCertificateName", + type: { + name: "String" + } + } +}; +export const recommendationId: msRest.OperationQueryParameter = { + parameterPath: [ + "options", + "recommendationId" + ], + mapper: { + serializedName: "recommendationId", + type: { + name: "String" + } + } +}; +export const relayName: msRest.OperationURLParameter = { + parameterPath: "relayName", + mapper: { + required: true, + serializedName: "relayName", + type: { + name: "String" + } + } +}; +export const resourceGroupName: msRest.OperationURLParameter = { + parameterPath: "resourceGroupName", + mapper: { + required: true, + serializedName: "resourceGroupName", + constraints: { + MaxLength: 90, + MinLength: 1, + Pattern: /^[-\w\._\(\)]+[^\.]$/ + }, + type: { + name: "String" + } + } +}; +export const routeName: msRest.OperationURLParameter = { + parameterPath: "routeName", + mapper: { + required: true, + serializedName: "routeName", + type: { + name: "String" + } + } +}; +export const sasUrl: msRest.OperationQueryParameter = { + parameterPath: [ + "options", + "sasUrl" + ], + mapper: { + serializedName: "sasUrl", + type: { + name: "String" + } + } +}; +export const siteExtensionId: msRest.OperationURLParameter = { + parameterPath: "siteExtensionId", + mapper: { + required: true, + serializedName: "siteExtensionId", + type: { + name: "String" + } + } +}; +export const siteName: msRest.OperationURLParameter = { + parameterPath: "siteName", + mapper: { + required: true, + serializedName: "siteName", + type: { + name: "String" + } + } +}; +export const skipToken: msRest.OperationQueryParameter = { + parameterPath: [ + "options", + "skipToken" + ], + mapper: { + serializedName: "$skipToken", + type: { + name: "String" + } + } +}; +export const sku: msRest.OperationQueryParameter = { + parameterPath: [ + "options", + "sku" + ], + mapper: { + serializedName: "sku", + type: { + name: "String" + } + } +}; +export const slot: msRest.OperationURLParameter = { + parameterPath: "slot", + mapper: { + required: true, + serializedName: "slot", + type: { + name: "String" + } + } +}; +export const snapshotId: msRest.OperationURLParameter = { + parameterPath: "snapshotId", + mapper: { + required: true, + serializedName: "snapshotId", + type: { + name: "String" + } + } +}; +export const softRestart: msRest.OperationQueryParameter = { + parameterPath: [ + "options", + "softRestart" + ], + mapper: { + serializedName: "softRestart", + type: { + name: "Boolean" + } + } +}; +export const sourceControlType: msRest.OperationURLParameter = { + parameterPath: "sourceControlType", + mapper: { + required: true, + serializedName: "sourceControlType", + type: { + name: "String" + } + } +}; +export const subscriptionId: msRest.OperationURLParameter = { + parameterPath: "subscriptionId", + mapper: { + required: true, + serializedName: "subscriptionId", + type: { + name: "String" + } + } +}; +export const subscriptionName: msRest.OperationQueryParameter = { + parameterPath: "subscriptionName", + mapper: { + required: true, + serializedName: "subscriptionName", + type: { + name: "String" + } + } +}; +export const synchronous: msRest.OperationQueryParameter = { + parameterPath: [ + "options", + "synchronous" + ], + mapper: { + serializedName: "synchronous", + type: { + name: "Boolean" + } + } +}; +export const threadId: msRest.OperationURLParameter = { + parameterPath: "threadId", + mapper: { + required: true, + serializedName: "threadId", + type: { + name: "String" + } + } +}; +export const top: msRest.OperationQueryParameter = { + parameterPath: [ + "options", + "top" + ], + mapper: { + serializedName: "$top", + type: { + name: "String" + } + } +}; +export const updateSeen: msRest.OperationQueryParameter = { + parameterPath: [ + "options", + "updateSeen" + ], + mapper: { + serializedName: "updateSeen", + type: { + name: "Boolean" + } + } +}; +export const view: msRest.OperationURLParameter = { + parameterPath: "view", + mapper: { + required: true, + serializedName: "view", + type: { + name: "String" + } + } +}; +export const vnetName: msRest.OperationURLParameter = { + parameterPath: "vnetName", + mapper: { + required: true, + serializedName: "vnetName", + type: { + name: "String" + } + } +}; +export const webJobName: msRest.OperationURLParameter = { + parameterPath: "webJobName", + mapper: { + required: true, + serializedName: "webJobName", + type: { + name: "String" + } + } +}; +export const workerName: msRest.OperationURLParameter = { + parameterPath: "workerName", + mapper: { + required: true, + serializedName: "workerName", + type: { + name: "String" + } + } +}; +export const xenonWorkersEnabled: msRest.OperationQueryParameter = { + parameterPath: [ + "options", + "xenonWorkersEnabled" + ], + mapper: { + serializedName: "xenonWorkersEnabled", + type: { + name: "Boolean" + } + } +}; diff --git a/sdk/appservice/arm-appservice-profile-2019-03-01-hybrid/src/models/providerMappers.ts b/sdk/appservice/arm-appservice-profile-2019-03-01-hybrid/src/models/providerMappers.ts new file mode 100644 index 000000000000..df3c3c5e4191 --- /dev/null +++ b/sdk/appservice/arm-appservice-profile-2019-03-01-hybrid/src/models/providerMappers.ts @@ -0,0 +1,26 @@ +/* + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +export { + ApplicationStack, + ApplicationStackCollection, + CsmOperationCollection, + CsmOperationDescription, + CsmOperationDescriptionProperties, + CsmOperationDisplay, + DefaultErrorResponse, + DefaultErrorResponseError, + DefaultErrorResponseErrorDetailsItem, + Dimension, + LogSpecification, + MetricAvailability, + MetricSpecification, + ServiceSpecification, + StackMajorVersion, + StackMinorVersion +} from "../models/mappers"; diff --git a/sdk/appservice/arm-appservice-profile-2019-03-01-hybrid/src/models/recommendationsMappers.ts b/sdk/appservice/arm-appservice-profile-2019-03-01-hybrid/src/models/recommendationsMappers.ts new file mode 100644 index 000000000000..7c6ff21c6cec --- /dev/null +++ b/sdk/appservice/arm-appservice-profile-2019-03-01-hybrid/src/models/recommendationsMappers.ts @@ -0,0 +1,138 @@ +/* + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +export { + ApiDefinitionInfo, + ApplicationLogsConfig, + AppServicePlan, + AppServicePlanPatchResource, + AutoHealActions, + AutoHealCustomAction, + AutoHealRules, + AutoHealTriggers, + AzureBlobStorageApplicationLogsConfig, + AzureBlobStorageHttpLogsConfig, + AzureStorageInfoValue, + AzureStoragePropertyDictionaryResource, + AzureTableStorageApplicationLogsConfig, + BackupItem, + BackupRequest, + BackupSchedule, + BaseResource, + BillingMeter, + Capability, + Certificate, + CertificatePatchResource, + CloningInfo, + CloudError, + ConnectionStringDictionary, + ConnStringInfo, + ConnStringValueTypePair, + ContinuousWebJob, + CorsSettings, + CustomHostnameAnalysisResult, + DatabaseBackupSetting, + DefaultErrorResponse, + DefaultErrorResponseError, + DefaultErrorResponseErrorDetailsItem, + DeletedAppRestoreRequest, + DeletedSite, + Deployment, + EnabledConfig, + ErrorEntity, + Experiments, + FileSystemApplicationLogsConfig, + FileSystemHttpLogsConfig, + FunctionEnvelope, + FunctionSecrets, + GeoDistribution, + GeoRegion, + HandlerMapping, + HostingEnvironmentProfile, + HostNameBinding, + HostNameSslState, + HttpLogsConfig, + HybridConnection, + HybridConnectionKey, + HybridConnectionLimits, + Identifier, + IpSecurityRestriction, + ManagedServiceIdentity, + ManagedServiceIdentityUserAssignedIdentitiesValue, + MigrateMySqlRequest, + MigrateMySqlStatus, + MSDeploy, + MSDeployLog, + MSDeployLogEntry, + MSDeployStatus, + NameValuePair, + NetworkFeatures, + PremierAddOn, + PremierAddOnOffer, + PremierAddOnPatchResource, + PrivateAccess, + PrivateAccessSubnet, + PrivateAccessVirtualNetwork, + ProcessInfo, + ProcessModuleInfo, + ProcessThreadInfo, + ProxyOnlyResource, + PublicCertificate, + PushSettings, + RampUpRule, + Recommendation, + RecommendationCollection, + RecommendationRule, + RelayServiceConnectionEntity, + RequestsBasedTrigger, + Resource, + ResourceMetricAvailability, + ResourceMetricDefinition, + RestoreRequest, + Site, + SiteAuthSettings, + SiteConfig, + SiteConfigResource, + SiteConfigurationSnapshotInfo, + SiteExtensionInfo, + SiteInstance, + SiteLimits, + SiteLogsConfig, + SiteMachineKey, + SitePatchResource, + SitePhpErrorLogFlag, + SiteSourceControl, + SkuCapacity, + SkuDescription, + SlotConfigNamesResource, + SlotDifference, + SlotSwapStatus, + SlowRequestsBasedTrigger, + Snapshot, + SnapshotRecoverySource, + SnapshotRestoreRequest, + SourceControl, + StatusCodesBasedTrigger, + StorageMigrationOptions, + StorageMigrationResponse, + StringDictionary, + SwiftVirtualNetwork, + TriggeredJobHistory, + TriggeredJobRun, + TriggeredWebJob, + User, + VirtualApplication, + VirtualDirectory, + VnetGateway, + VnetInfo, + VnetParameters, + VnetRoute, + VnetValidationFailureDetails, + VnetValidationTestFailure, + WebJob +} from "../models/mappers"; diff --git a/sdk/appservice/arm-appservice-profile-2019-03-01-hybrid/src/models/webAppsMappers.ts b/sdk/appservice/arm-appservice-profile-2019-03-01-hybrid/src/models/webAppsMappers.ts new file mode 100644 index 000000000000..adb06669a3d3 --- /dev/null +++ b/sdk/appservice/arm-appservice-profile-2019-03-01-hybrid/src/models/webAppsMappers.ts @@ -0,0 +1,176 @@ +/* + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +export { + ApiDefinitionInfo, + ApplicationLogsConfig, + AppServicePlan, + AppServicePlanPatchResource, + AutoHealActions, + AutoHealCustomAction, + AutoHealRules, + AutoHealTriggers, + AzureBlobStorageApplicationLogsConfig, + AzureBlobStorageHttpLogsConfig, + AzureStorageInfoValue, + AzureStoragePropertyDictionaryResource, + AzureTableStorageApplicationLogsConfig, + BackupItem, + BackupItemCollection, + BackupRequest, + BackupSchedule, + BaseResource, + BillingMeter, + Capability, + Certificate, + CertificatePatchResource, + CloningInfo, + CloudError, + ConnectionStringDictionary, + ConnStringInfo, + ConnStringValueTypePair, + ContinuousWebJob, + ContinuousWebJobCollection, + CorsSettings, + CsmPublishingProfileOptions, + CsmSlotEntity, + CsmUsageQuota, + CsmUsageQuotaCollection, + CustomHostnameAnalysisResult, + DatabaseBackupSetting, + DefaultErrorResponse, + DefaultErrorResponseError, + DefaultErrorResponseErrorDetailsItem, + DeletedAppRestoreRequest, + DeletedSite, + Deployment, + DeploymentCollection, + EnabledConfig, + ErrorEntity, + Experiments, + FileSystemApplicationLogsConfig, + FileSystemHttpLogsConfig, + FunctionEnvelope, + FunctionEnvelopeCollection, + FunctionSecrets, + GeoDistribution, + GeoRegion, + HandlerMapping, + HostingEnvironmentProfile, + HostNameBinding, + HostNameBindingCollection, + HostNameSslState, + HttpLogsConfig, + HybridConnection, + HybridConnectionKey, + HybridConnectionLimits, + Identifier, + IdentifierCollection, + IpSecurityRestriction, + LocalizableString, + ManagedServiceIdentity, + ManagedServiceIdentityUserAssignedIdentitiesValue, + MigrateMySqlRequest, + MigrateMySqlStatus, + MSDeploy, + MSDeployLog, + MSDeployLogEntry, + MSDeployStatus, + NameValuePair, + NetworkFeatures, + NetworkTrace, + Operation, + PerfMonCounterCollection, + PerfMonResponse, + PerfMonSample, + PerfMonSet, + PremierAddOn, + PremierAddOnOffer, + PremierAddOnPatchResource, + PrivateAccess, + PrivateAccessSubnet, + PrivateAccessVirtualNetwork, + ProcessInfo, + ProcessInfoCollection, + ProcessModuleInfo, + ProcessModuleInfoCollection, + ProcessThreadInfo, + ProcessThreadInfoCollection, + ProxyOnlyResource, + PublicCertificate, + PublicCertificateCollection, + PushSettings, + RampUpRule, + Recommendation, + RecommendationRule, + RelayServiceConnectionEntity, + RequestsBasedTrigger, + Resource, + ResourceMetric, + ResourceMetricAvailability, + ResourceMetricCollection, + ResourceMetricDefinition, + ResourceMetricDefinitionCollection, + ResourceMetricName, + ResourceMetricProperty, + ResourceMetricValue, + RestoreRequest, + Site, + SiteAuthSettings, + SiteCloneability, + SiteCloneabilityCriterion, + SiteConfig, + SiteConfigResource, + SiteConfigResourceCollection, + SiteConfigurationSnapshotInfo, + SiteConfigurationSnapshotInfoCollection, + SiteExtensionInfo, + SiteExtensionInfoCollection, + SiteInstance, + SiteLimits, + SiteLogsConfig, + SiteMachineKey, + SitePatchResource, + SitePhpErrorLogFlag, + SiteSourceControl, + SkuCapacity, + SkuDescription, + SlotConfigNamesResource, + SlotDifference, + SlotDifferenceCollection, + SlotSwapStatus, + SlowRequestsBasedTrigger, + Snapshot, + SnapshotCollection, + SnapshotRecoverySource, + SnapshotRestoreRequest, + SourceControl, + StatusCodesBasedTrigger, + StorageMigrationOptions, + StorageMigrationResponse, + StringDictionary, + SwiftVirtualNetwork, + TriggeredJobHistory, + TriggeredJobHistoryCollection, + TriggeredJobRun, + TriggeredWebJob, + TriggeredWebJobCollection, + User, + VirtualApplication, + VirtualDirectory, + VnetGateway, + VnetInfo, + VnetParameters, + VnetRoute, + VnetValidationFailureDetails, + VnetValidationTestFailure, + WebAppCollection, + WebAppInstanceCollection, + WebJob, + WebJobCollection +} from "../models/mappers"; diff --git a/sdk/appservice/arm-appservice-profile-2019-03-01-hybrid/src/operations/appServicePlans.ts b/sdk/appservice/arm-appservice-profile-2019-03-01-hybrid/src/operations/appServicePlans.ts new file mode 100644 index 000000000000..f8f8499c5033 --- /dev/null +++ b/sdk/appservice/arm-appservice-profile-2019-03-01-hybrid/src/operations/appServicePlans.ts @@ -0,0 +1,2332 @@ +/* + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * 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 * as msRest from "@azure/ms-rest-js"; +import * as msRestAzure from "@azure/ms-rest-azure-js"; +import * as Models from "../models"; +import * as Mappers from "../models/appServicePlansMappers"; +import * as Parameters from "../models/parameters"; +import { WebSiteManagementClientContext } from "../webSiteManagementClientContext"; + +/** Class representing a AppServicePlans. */ +export class AppServicePlans { + private readonly client: WebSiteManagementClientContext; + + /** + * Create a AppServicePlans. + * @param {WebSiteManagementClientContext} client Reference to the service client. + */ + constructor(client: WebSiteManagementClientContext) { + this.client = client; + } + + /** + * Get all App Service plans for a subscription. + * @summary Get all App Service plans for a subscription. + * @param [options] The optional parameters + * @returns Promise + */ + list(options?: Models.AppServicePlansListOptionalParams): Promise; + /** + * @param callback The callback + */ + list(callback: msRest.ServiceCallback): void; + /** + * @param options The optional parameters + * @param callback The callback + */ + list(options: Models.AppServicePlansListOptionalParams, callback: msRest.ServiceCallback): void; + list(options?: Models.AppServicePlansListOptionalParams | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { + return this.client.sendOperationRequest( + { + options + }, + listOperationSpec, + callback) as Promise; + } + + /** + * Get all App Service plans in a resource group. + * @summary Get all App Service plans in a resource group. + * @param resourceGroupName Name of the resource group to which the resource belongs. + * @param [options] The optional parameters + * @returns Promise + */ + listByResourceGroup(resourceGroupName: string, options?: msRest.RequestOptionsBase): Promise; + /** + * @param resourceGroupName Name of the resource group to which the resource belongs. + * @param callback The callback + */ + listByResourceGroup(resourceGroupName: string, callback: msRest.ServiceCallback): void; + /** + * @param resourceGroupName Name of the resource group to which the resource belongs. + * @param options The optional parameters + * @param callback The callback + */ + listByResourceGroup(resourceGroupName: string, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; + listByResourceGroup(resourceGroupName: string, options?: msRest.RequestOptionsBase | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { + return this.client.sendOperationRequest( + { + resourceGroupName, + options + }, + listByResourceGroupOperationSpec, + callback) as Promise; + } + + /** + * Get an App Service plan. + * @summary Get an App Service plan. + * @param resourceGroupName Name of the resource group to which the resource belongs. + * @param name Name of the App Service plan. + * @param [options] The optional parameters + * @returns Promise + */ + get(resourceGroupName: string, name: string, options?: msRest.RequestOptionsBase): Promise; + /** + * @param resourceGroupName Name of the resource group to which the resource belongs. + * @param name Name of the App Service plan. + * @param callback The callback + */ + get(resourceGroupName: string, name: string, callback: msRest.ServiceCallback): void; + /** + * @param resourceGroupName Name of the resource group to which the resource belongs. + * @param name Name of the App Service plan. + * @param options The optional parameters + * @param callback The callback + */ + get(resourceGroupName: string, name: string, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; + get(resourceGroupName: string, name: string, options?: msRest.RequestOptionsBase | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { + return this.client.sendOperationRequest( + { + resourceGroupName, + name, + options + }, + getOperationSpec, + callback) as Promise; + } + + /** + * Creates or updates an App Service Plan. + * @summary Creates or updates an App Service Plan. + * @param resourceGroupName Name of the resource group to which the resource belongs. + * @param name Name of the App Service plan. + * @param appServicePlan Details of the App Service plan. + * @param [options] The optional parameters + * @returns Promise + */ + createOrUpdate(resourceGroupName: string, name: string, appServicePlan: Models.AppServicePlan, options?: msRest.RequestOptionsBase): Promise { + return this.beginCreateOrUpdate(resourceGroupName,name,appServicePlan,options) + .then(lroPoller => lroPoller.pollUntilFinished()) as Promise; + } + + /** + * Delete an App Service plan. + * @summary Delete an App Service plan. + * @param resourceGroupName Name of the resource group to which the resource belongs. + * @param name Name of the App Service plan. + * @param [options] The optional parameters + * @returns Promise + */ + deleteMethod(resourceGroupName: string, name: string, options?: msRest.RequestOptionsBase): Promise; + /** + * @param resourceGroupName Name of the resource group to which the resource belongs. + * @param name Name of the App Service plan. + * @param callback The callback + */ + deleteMethod(resourceGroupName: string, name: string, callback: msRest.ServiceCallback): void; + /** + * @param resourceGroupName Name of the resource group to which the resource belongs. + * @param name Name of the App Service plan. + * @param options The optional parameters + * @param callback The callback + */ + deleteMethod(resourceGroupName: string, name: string, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; + deleteMethod(resourceGroupName: string, name: string, options?: msRest.RequestOptionsBase | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { + return this.client.sendOperationRequest( + { + resourceGroupName, + name, + options + }, + deleteMethodOperationSpec, + callback); + } + + /** + * Creates or updates an App Service Plan. + * @summary Creates or updates an App Service Plan. + * @param resourceGroupName Name of the resource group to which the resource belongs. + * @param name Name of the App Service plan. + * @param appServicePlan Details of the App Service plan. + * @param [options] The optional parameters + * @returns Promise + */ + update(resourceGroupName: string, name: string, appServicePlan: Models.AppServicePlanPatchResource, options?: msRest.RequestOptionsBase): Promise; + /** + * @param resourceGroupName Name of the resource group to which the resource belongs. + * @param name Name of the App Service plan. + * @param appServicePlan Details of the App Service plan. + * @param callback The callback + */ + update(resourceGroupName: string, name: string, appServicePlan: Models.AppServicePlanPatchResource, callback: msRest.ServiceCallback): void; + /** + * @param resourceGroupName Name of the resource group to which the resource belongs. + * @param name Name of the App Service plan. + * @param appServicePlan Details of the App Service plan. + * @param options The optional parameters + * @param callback The callback + */ + update(resourceGroupName: string, name: string, appServicePlan: Models.AppServicePlanPatchResource, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; + update(resourceGroupName: string, name: string, appServicePlan: Models.AppServicePlanPatchResource, options?: msRest.RequestOptionsBase | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { + return this.client.sendOperationRequest( + { + resourceGroupName, + name, + appServicePlan, + options + }, + updateOperationSpec, + callback) as Promise; + } + + /** + * List all capabilities of an App Service plan. + * @summary List all capabilities of an App Service plan. + * @param resourceGroupName Name of the resource group to which the resource belongs. + * @param name Name of the App Service plan. + * @param [options] The optional parameters + * @returns Promise + */ + listCapabilities(resourceGroupName: string, name: string, options?: msRest.RequestOptionsBase): Promise; + /** + * @param resourceGroupName Name of the resource group to which the resource belongs. + * @param name Name of the App Service plan. + * @param callback The callback + */ + listCapabilities(resourceGroupName: string, name: string, callback: msRest.ServiceCallback): void; + /** + * @param resourceGroupName Name of the resource group to which the resource belongs. + * @param name Name of the App Service plan. + * @param options The optional parameters + * @param callback The callback + */ + listCapabilities(resourceGroupName: string, name: string, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; + listCapabilities(resourceGroupName: string, name: string, options?: msRest.RequestOptionsBase | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { + return this.client.sendOperationRequest( + { + resourceGroupName, + name, + options + }, + listCapabilitiesOperationSpec, + callback) as Promise; + } + + /** + * Retrieve a Hybrid Connection in use in an App Service plan. + * @summary Retrieve a Hybrid Connection in use in an App Service plan. + * @param resourceGroupName Name of the resource group to which the resource belongs. + * @param name Name of the App Service plan. + * @param namespaceName Name of the Service Bus namespace. + * @param relayName Name of the Service Bus relay. + * @param [options] The optional parameters + * @returns Promise + */ + getHybridConnection(resourceGroupName: string, name: string, namespaceName: string, relayName: string, options?: msRest.RequestOptionsBase): Promise; + /** + * @param resourceGroupName Name of the resource group to which the resource belongs. + * @param name Name of the App Service plan. + * @param namespaceName Name of the Service Bus namespace. + * @param relayName Name of the Service Bus relay. + * @param callback The callback + */ + getHybridConnection(resourceGroupName: string, name: string, namespaceName: string, relayName: string, callback: msRest.ServiceCallback): void; + /** + * @param resourceGroupName Name of the resource group to which the resource belongs. + * @param name Name of the App Service plan. + * @param namespaceName Name of the Service Bus namespace. + * @param relayName Name of the Service Bus relay. + * @param options The optional parameters + * @param callback The callback + */ + getHybridConnection(resourceGroupName: string, name: string, namespaceName: string, relayName: string, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; + getHybridConnection(resourceGroupName: string, name: string, namespaceName: string, relayName: string, options?: msRest.RequestOptionsBase | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { + return this.client.sendOperationRequest( + { + resourceGroupName, + name, + namespaceName, + relayName, + options + }, + getHybridConnectionOperationSpec, + callback) as Promise; + } + + /** + * Delete a Hybrid Connection in use in an App Service plan. + * @summary Delete a Hybrid Connection in use in an App Service plan. + * @param resourceGroupName Name of the resource group to which the resource belongs. + * @param name Name of the App Service plan. + * @param namespaceName Name of the Service Bus namespace. + * @param relayName Name of the Service Bus relay. + * @param [options] The optional parameters + * @returns Promise + */ + deleteHybridConnection(resourceGroupName: string, name: string, namespaceName: string, relayName: string, options?: msRest.RequestOptionsBase): Promise; + /** + * @param resourceGroupName Name of the resource group to which the resource belongs. + * @param name Name of the App Service plan. + * @param namespaceName Name of the Service Bus namespace. + * @param relayName Name of the Service Bus relay. + * @param callback The callback + */ + deleteHybridConnection(resourceGroupName: string, name: string, namespaceName: string, relayName: string, callback: msRest.ServiceCallback): void; + /** + * @param resourceGroupName Name of the resource group to which the resource belongs. + * @param name Name of the App Service plan. + * @param namespaceName Name of the Service Bus namespace. + * @param relayName Name of the Service Bus relay. + * @param options The optional parameters + * @param callback The callback + */ + deleteHybridConnection(resourceGroupName: string, name: string, namespaceName: string, relayName: string, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; + deleteHybridConnection(resourceGroupName: string, name: string, namespaceName: string, relayName: string, options?: msRest.RequestOptionsBase | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { + return this.client.sendOperationRequest( + { + resourceGroupName, + name, + namespaceName, + relayName, + options + }, + deleteHybridConnectionOperationSpec, + callback); + } + + /** + * Get the send key name and value of a Hybrid Connection. + * @summary Get the send key name and value of a Hybrid Connection. + * @param resourceGroupName Name of the resource group to which the resource belongs. + * @param name Name of the App Service plan. + * @param namespaceName The name of the Service Bus namespace. + * @param relayName The name of the Service Bus relay. + * @param [options] The optional parameters + * @returns Promise + */ + listHybridConnectionKeys(resourceGroupName: string, name: string, namespaceName: string, relayName: string, options?: msRest.RequestOptionsBase): Promise; + /** + * @param resourceGroupName Name of the resource group to which the resource belongs. + * @param name Name of the App Service plan. + * @param namespaceName The name of the Service Bus namespace. + * @param relayName The name of the Service Bus relay. + * @param callback The callback + */ + listHybridConnectionKeys(resourceGroupName: string, name: string, namespaceName: string, relayName: string, callback: msRest.ServiceCallback): void; + /** + * @param resourceGroupName Name of the resource group to which the resource belongs. + * @param name Name of the App Service plan. + * @param namespaceName The name of the Service Bus namespace. + * @param relayName The name of the Service Bus relay. + * @param options The optional parameters + * @param callback The callback + */ + listHybridConnectionKeys(resourceGroupName: string, name: string, namespaceName: string, relayName: string, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; + listHybridConnectionKeys(resourceGroupName: string, name: string, namespaceName: string, relayName: string, options?: msRest.RequestOptionsBase | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { + return this.client.sendOperationRequest( + { + resourceGroupName, + name, + namespaceName, + relayName, + options + }, + listHybridConnectionKeysOperationSpec, + callback) as Promise; + } + + /** + * Get all apps that use a Hybrid Connection in an App Service Plan. + * @summary Get all apps that use a Hybrid Connection in an App Service Plan. + * @param resourceGroupName Name of the resource group to which the resource belongs. + * @param name Name of the App Service plan. + * @param namespaceName Name of the Hybrid Connection namespace. + * @param relayName Name of the Hybrid Connection relay. + * @param [options] The optional parameters + * @returns Promise + */ + listWebAppsByHybridConnection(resourceGroupName: string, name: string, namespaceName: string, relayName: string, options?: msRest.RequestOptionsBase): Promise; + /** + * @param resourceGroupName Name of the resource group to which the resource belongs. + * @param name Name of the App Service plan. + * @param namespaceName Name of the Hybrid Connection namespace. + * @param relayName Name of the Hybrid Connection relay. + * @param callback The callback + */ + listWebAppsByHybridConnection(resourceGroupName: string, name: string, namespaceName: string, relayName: string, callback: msRest.ServiceCallback): void; + /** + * @param resourceGroupName Name of the resource group to which the resource belongs. + * @param name Name of the App Service plan. + * @param namespaceName Name of the Hybrid Connection namespace. + * @param relayName Name of the Hybrid Connection relay. + * @param options The optional parameters + * @param callback The callback + */ + listWebAppsByHybridConnection(resourceGroupName: string, name: string, namespaceName: string, relayName: string, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; + listWebAppsByHybridConnection(resourceGroupName: string, name: string, namespaceName: string, relayName: string, options?: msRest.RequestOptionsBase | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { + return this.client.sendOperationRequest( + { + resourceGroupName, + name, + namespaceName, + relayName, + options + }, + listWebAppsByHybridConnectionOperationSpec, + callback) as Promise; + } + + /** + * Get the maximum number of Hybrid Connections allowed in an App Service plan. + * @summary Get the maximum number of Hybrid Connections allowed in an App Service plan. + * @param resourceGroupName Name of the resource group to which the resource belongs. + * @param name Name of the App Service plan. + * @param [options] The optional parameters + * @returns Promise + */ + getHybridConnectionPlanLimit(resourceGroupName: string, name: string, options?: msRest.RequestOptionsBase): Promise; + /** + * @param resourceGroupName Name of the resource group to which the resource belongs. + * @param name Name of the App Service plan. + * @param callback The callback + */ + getHybridConnectionPlanLimit(resourceGroupName: string, name: string, callback: msRest.ServiceCallback): void; + /** + * @param resourceGroupName Name of the resource group to which the resource belongs. + * @param name Name of the App Service plan. + * @param options The optional parameters + * @param callback The callback + */ + getHybridConnectionPlanLimit(resourceGroupName: string, name: string, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; + getHybridConnectionPlanLimit(resourceGroupName: string, name: string, options?: msRest.RequestOptionsBase | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { + return this.client.sendOperationRequest( + { + resourceGroupName, + name, + options + }, + getHybridConnectionPlanLimitOperationSpec, + callback) as Promise; + } + + /** + * Retrieve all Hybrid Connections in use in an App Service plan. + * @summary Retrieve all Hybrid Connections in use in an App Service plan. + * @param resourceGroupName Name of the resource group to which the resource belongs. + * @param name Name of the App Service plan. + * @param [options] The optional parameters + * @returns Promise + */ + listHybridConnections(resourceGroupName: string, name: string, options?: msRest.RequestOptionsBase): Promise; + /** + * @param resourceGroupName Name of the resource group to which the resource belongs. + * @param name Name of the App Service plan. + * @param callback The callback + */ + listHybridConnections(resourceGroupName: string, name: string, callback: msRest.ServiceCallback): void; + /** + * @param resourceGroupName Name of the resource group to which the resource belongs. + * @param name Name of the App Service plan. + * @param options The optional parameters + * @param callback The callback + */ + listHybridConnections(resourceGroupName: string, name: string, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; + listHybridConnections(resourceGroupName: string, name: string, options?: msRest.RequestOptionsBase | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { + return this.client.sendOperationRequest( + { + resourceGroupName, + name, + options + }, + listHybridConnectionsOperationSpec, + callback) as Promise; + } + + /** + * Get metrics that can be queried for an App Service plan, and their definitions. + * @summary Get metrics that can be queried for an App Service plan, and their definitions. + * @param resourceGroupName Name of the resource group to which the resource belongs. + * @param name Name of the App Service plan. + * @param [options] The optional parameters + * @returns Promise + */ + listMetricDefintions(resourceGroupName: string, name: string, options?: msRest.RequestOptionsBase): Promise; + /** + * @param resourceGroupName Name of the resource group to which the resource belongs. + * @param name Name of the App Service plan. + * @param callback The callback + */ + listMetricDefintions(resourceGroupName: string, name: string, callback: msRest.ServiceCallback): void; + /** + * @param resourceGroupName Name of the resource group to which the resource belongs. + * @param name Name of the App Service plan. + * @param options The optional parameters + * @param callback The callback + */ + listMetricDefintions(resourceGroupName: string, name: string, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; + listMetricDefintions(resourceGroupName: string, name: string, options?: msRest.RequestOptionsBase | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { + return this.client.sendOperationRequest( + { + resourceGroupName, + name, + options + }, + listMetricDefintionsOperationSpec, + callback) as Promise; + } + + /** + * Get metrics for an App Service plan. + * @summary Get metrics for an App Service plan. + * @param resourceGroupName Name of the resource group to which the resource belongs. + * @param name Name of the App Service plan. + * @param [options] The optional parameters + * @returns Promise + */ + listMetrics(resourceGroupName: string, name: string, options?: Models.AppServicePlansListMetricsOptionalParams): Promise; + /** + * @param resourceGroupName Name of the resource group to which the resource belongs. + * @param name Name of the App Service plan. + * @param callback The callback + */ + listMetrics(resourceGroupName: string, name: string, callback: msRest.ServiceCallback): void; + /** + * @param resourceGroupName Name of the resource group to which the resource belongs. + * @param name Name of the App Service plan. + * @param options The optional parameters + * @param callback The callback + */ + listMetrics(resourceGroupName: string, name: string, options: Models.AppServicePlansListMetricsOptionalParams, callback: msRest.ServiceCallback): void; + listMetrics(resourceGroupName: string, name: string, options?: Models.AppServicePlansListMetricsOptionalParams | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { + return this.client.sendOperationRequest( + { + resourceGroupName, + name, + options + }, + listMetricsOperationSpec, + callback) as Promise; + } + + /** + * Restart all apps in an App Service plan. + * @summary Restart all apps in an App Service plan. + * @param resourceGroupName Name of the resource group to which the resource belongs. + * @param name Name of the App Service plan. + * @param [options] The optional parameters + * @returns Promise + */ + restartWebApps(resourceGroupName: string, name: string, options?: Models.AppServicePlansRestartWebAppsOptionalParams): Promise; + /** + * @param resourceGroupName Name of the resource group to which the resource belongs. + * @param name Name of the App Service plan. + * @param callback The callback + */ + restartWebApps(resourceGroupName: string, name: string, callback: msRest.ServiceCallback): void; + /** + * @param resourceGroupName Name of the resource group to which the resource belongs. + * @param name Name of the App Service plan. + * @param options The optional parameters + * @param callback The callback + */ + restartWebApps(resourceGroupName: string, name: string, options: Models.AppServicePlansRestartWebAppsOptionalParams, callback: msRest.ServiceCallback): void; + restartWebApps(resourceGroupName: string, name: string, options?: Models.AppServicePlansRestartWebAppsOptionalParams | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { + return this.client.sendOperationRequest( + { + resourceGroupName, + name, + options + }, + restartWebAppsOperationSpec, + callback); + } + + /** + * Get all apps associated with an App Service plan. + * @summary Get all apps associated with an App Service plan. + * @param resourceGroupName Name of the resource group to which the resource belongs. + * @param name Name of the App Service plan. + * @param [options] The optional parameters + * @returns Promise + */ + listWebApps(resourceGroupName: string, name: string, options?: Models.AppServicePlansListWebAppsOptionalParams): Promise; + /** + * @param resourceGroupName Name of the resource group to which the resource belongs. + * @param name Name of the App Service plan. + * @param callback The callback + */ + listWebApps(resourceGroupName: string, name: string, callback: msRest.ServiceCallback): void; + /** + * @param resourceGroupName Name of the resource group to which the resource belongs. + * @param name Name of the App Service plan. + * @param options The optional parameters + * @param callback The callback + */ + listWebApps(resourceGroupName: string, name: string, options: Models.AppServicePlansListWebAppsOptionalParams, callback: msRest.ServiceCallback): void; + listWebApps(resourceGroupName: string, name: string, options?: Models.AppServicePlansListWebAppsOptionalParams | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { + return this.client.sendOperationRequest( + { + resourceGroupName, + name, + options + }, + listWebAppsOperationSpec, + callback) as Promise; + } + + /** + * Gets all selectable SKUs for a given App Service Plan + * @summary Gets all selectable SKUs for a given App Service Plan + * @param resourceGroupName Name of the resource group to which the resource belongs. + * @param name Name of App Service Plan + * @param [options] The optional parameters + * @returns Promise + */ + getServerFarmSkus(resourceGroupName: string, name: string, options?: msRest.RequestOptionsBase): Promise; + /** + * @param resourceGroupName Name of the resource group to which the resource belongs. + * @param name Name of App Service Plan + * @param callback The callback + */ + getServerFarmSkus(resourceGroupName: string, name: string, callback: msRest.ServiceCallback): void; + /** + * @param resourceGroupName Name of the resource group to which the resource belongs. + * @param name Name of App Service Plan + * @param options The optional parameters + * @param callback The callback + */ + getServerFarmSkus(resourceGroupName: string, name: string, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; + getServerFarmSkus(resourceGroupName: string, name: string, options?: msRest.RequestOptionsBase | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { + return this.client.sendOperationRequest( + { + resourceGroupName, + name, + options + }, + getServerFarmSkusOperationSpec, + callback) as Promise; + } + + /** + * Gets server farm usage information + * @summary Gets server farm usage information + * @param resourceGroupName Name of the resource group to which the resource belongs. + * @param name Name of App Service Plan + * @param [options] The optional parameters + * @returns Promise + */ + listUsages(resourceGroupName: string, name: string, options?: Models.AppServicePlansListUsagesOptionalParams): Promise; + /** + * @param resourceGroupName Name of the resource group to which the resource belongs. + * @param name Name of App Service Plan + * @param callback The callback + */ + listUsages(resourceGroupName: string, name: string, callback: msRest.ServiceCallback): void; + /** + * @param resourceGroupName Name of the resource group to which the resource belongs. + * @param name Name of App Service Plan + * @param options The optional parameters + * @param callback The callback + */ + listUsages(resourceGroupName: string, name: string, options: Models.AppServicePlansListUsagesOptionalParams, callback: msRest.ServiceCallback): void; + listUsages(resourceGroupName: string, name: string, options?: Models.AppServicePlansListUsagesOptionalParams | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { + return this.client.sendOperationRequest( + { + resourceGroupName, + name, + options + }, + listUsagesOperationSpec, + callback) as Promise; + } + + /** + * Get all Virtual Networks associated with an App Service plan. + * @summary Get all Virtual Networks associated with an App Service plan. + * @param resourceGroupName Name of the resource group to which the resource belongs. + * @param name Name of the App Service plan. + * @param [options] The optional parameters + * @returns Promise + */ + listVnets(resourceGroupName: string, name: string, options?: msRest.RequestOptionsBase): Promise; + /** + * @param resourceGroupName Name of the resource group to which the resource belongs. + * @param name Name of the App Service plan. + * @param callback The callback + */ + listVnets(resourceGroupName: string, name: string, callback: msRest.ServiceCallback): void; + /** + * @param resourceGroupName Name of the resource group to which the resource belongs. + * @param name Name of the App Service plan. + * @param options The optional parameters + * @param callback The callback + */ + listVnets(resourceGroupName: string, name: string, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; + listVnets(resourceGroupName: string, name: string, options?: msRest.RequestOptionsBase | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { + return this.client.sendOperationRequest( + { + resourceGroupName, + name, + options + }, + listVnetsOperationSpec, + callback) as Promise; + } + + /** + * Get a Virtual Network associated with an App Service plan. + * @summary Get a Virtual Network associated with an App Service plan. + * @param resourceGroupName Name of the resource group to which the resource belongs. + * @param name Name of the App Service plan. + * @param vnetName Name of the Virtual Network. + * @param [options] The optional parameters + * @returns Promise + */ + getVnetFromServerFarm(resourceGroupName: string, name: string, vnetName: string, options?: msRest.RequestOptionsBase): Promise; + /** + * @param resourceGroupName Name of the resource group to which the resource belongs. + * @param name Name of the App Service plan. + * @param vnetName Name of the Virtual Network. + * @param callback The callback + */ + getVnetFromServerFarm(resourceGroupName: string, name: string, vnetName: string, callback: msRest.ServiceCallback): void; + /** + * @param resourceGroupName Name of the resource group to which the resource belongs. + * @param name Name of the App Service plan. + * @param vnetName Name of the Virtual Network. + * @param options The optional parameters + * @param callback The callback + */ + getVnetFromServerFarm(resourceGroupName: string, name: string, vnetName: string, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; + getVnetFromServerFarm(resourceGroupName: string, name: string, vnetName: string, options?: msRest.RequestOptionsBase | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { + return this.client.sendOperationRequest( + { + resourceGroupName, + name, + vnetName, + options + }, + getVnetFromServerFarmOperationSpec, + callback) as Promise; + } + + /** + * Get a Virtual Network gateway. + * @summary Get a Virtual Network gateway. + * @param resourceGroupName Name of the resource group to which the resource belongs. + * @param name Name of the App Service plan. + * @param vnetName Name of the Virtual Network. + * @param gatewayName Name of the gateway. Only the 'primary' gateway is supported. + * @param [options] The optional parameters + * @returns Promise + */ + getVnetGateway(resourceGroupName: string, name: string, vnetName: string, gatewayName: string, options?: msRest.RequestOptionsBase): Promise; + /** + * @param resourceGroupName Name of the resource group to which the resource belongs. + * @param name Name of the App Service plan. + * @param vnetName Name of the Virtual Network. + * @param gatewayName Name of the gateway. Only the 'primary' gateway is supported. + * @param callback The callback + */ + getVnetGateway(resourceGroupName: string, name: string, vnetName: string, gatewayName: string, callback: msRest.ServiceCallback): void; + /** + * @param resourceGroupName Name of the resource group to which the resource belongs. + * @param name Name of the App Service plan. + * @param vnetName Name of the Virtual Network. + * @param gatewayName Name of the gateway. Only the 'primary' gateway is supported. + * @param options The optional parameters + * @param callback The callback + */ + getVnetGateway(resourceGroupName: string, name: string, vnetName: string, gatewayName: string, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; + getVnetGateway(resourceGroupName: string, name: string, vnetName: string, gatewayName: string, options?: msRest.RequestOptionsBase | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { + return this.client.sendOperationRequest( + { + resourceGroupName, + name, + vnetName, + gatewayName, + options + }, + getVnetGatewayOperationSpec, + callback) as Promise; + } + + /** + * Update a Virtual Network gateway. + * @summary Update a Virtual Network gateway. + * @param resourceGroupName Name of the resource group to which the resource belongs. + * @param name Name of the App Service plan. + * @param vnetName Name of the Virtual Network. + * @param gatewayName Name of the gateway. Only the 'primary' gateway is supported. + * @param connectionEnvelope Definition of the gateway. + * @param [options] The optional parameters + * @returns Promise + */ + updateVnetGateway(resourceGroupName: string, name: string, vnetName: string, gatewayName: string, connectionEnvelope: Models.VnetGateway, options?: msRest.RequestOptionsBase): Promise; + /** + * @param resourceGroupName Name of the resource group to which the resource belongs. + * @param name Name of the App Service plan. + * @param vnetName Name of the Virtual Network. + * @param gatewayName Name of the gateway. Only the 'primary' gateway is supported. + * @param connectionEnvelope Definition of the gateway. + * @param callback The callback + */ + updateVnetGateway(resourceGroupName: string, name: string, vnetName: string, gatewayName: string, connectionEnvelope: Models.VnetGateway, callback: msRest.ServiceCallback): void; + /** + * @param resourceGroupName Name of the resource group to which the resource belongs. + * @param name Name of the App Service plan. + * @param vnetName Name of the Virtual Network. + * @param gatewayName Name of the gateway. Only the 'primary' gateway is supported. + * @param connectionEnvelope Definition of the gateway. + * @param options The optional parameters + * @param callback The callback + */ + updateVnetGateway(resourceGroupName: string, name: string, vnetName: string, gatewayName: string, connectionEnvelope: Models.VnetGateway, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; + updateVnetGateway(resourceGroupName: string, name: string, vnetName: string, gatewayName: string, connectionEnvelope: Models.VnetGateway, options?: msRest.RequestOptionsBase | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { + return this.client.sendOperationRequest( + { + resourceGroupName, + name, + vnetName, + gatewayName, + connectionEnvelope, + options + }, + updateVnetGatewayOperationSpec, + callback) as Promise; + } + + /** + * Get all routes that are associated with a Virtual Network in an App Service plan. + * @summary Get all routes that are associated with a Virtual Network in an App Service plan. + * @param resourceGroupName Name of the resource group to which the resource belongs. + * @param name Name of the App Service plan. + * @param vnetName Name of the Virtual Network. + * @param [options] The optional parameters + * @returns Promise + */ + listRoutesForVnet(resourceGroupName: string, name: string, vnetName: string, options?: msRest.RequestOptionsBase): Promise; + /** + * @param resourceGroupName Name of the resource group to which the resource belongs. + * @param name Name of the App Service plan. + * @param vnetName Name of the Virtual Network. + * @param callback The callback + */ + listRoutesForVnet(resourceGroupName: string, name: string, vnetName: string, callback: msRest.ServiceCallback): void; + /** + * @param resourceGroupName Name of the resource group to which the resource belongs. + * @param name Name of the App Service plan. + * @param vnetName Name of the Virtual Network. + * @param options The optional parameters + * @param callback The callback + */ + listRoutesForVnet(resourceGroupName: string, name: string, vnetName: string, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; + listRoutesForVnet(resourceGroupName: string, name: string, vnetName: string, options?: msRest.RequestOptionsBase | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { + return this.client.sendOperationRequest( + { + resourceGroupName, + name, + vnetName, + options + }, + listRoutesForVnetOperationSpec, + callback) as Promise; + } + + /** + * Get a Virtual Network route in an App Service plan. + * @summary Get a Virtual Network route in an App Service plan. + * @param resourceGroupName Name of the resource group to which the resource belongs. + * @param name Name of the App Service plan. + * @param vnetName Name of the Virtual Network. + * @param routeName Name of the Virtual Network route. + * @param [options] The optional parameters + * @returns Promise + */ + getRouteForVnet(resourceGroupName: string, name: string, vnetName: string, routeName: string, options?: msRest.RequestOptionsBase): Promise; + /** + * @param resourceGroupName Name of the resource group to which the resource belongs. + * @param name Name of the App Service plan. + * @param vnetName Name of the Virtual Network. + * @param routeName Name of the Virtual Network route. + * @param callback The callback + */ + getRouteForVnet(resourceGroupName: string, name: string, vnetName: string, routeName: string, callback: msRest.ServiceCallback): void; + /** + * @param resourceGroupName Name of the resource group to which the resource belongs. + * @param name Name of the App Service plan. + * @param vnetName Name of the Virtual Network. + * @param routeName Name of the Virtual Network route. + * @param options The optional parameters + * @param callback The callback + */ + getRouteForVnet(resourceGroupName: string, name: string, vnetName: string, routeName: string, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; + getRouteForVnet(resourceGroupName: string, name: string, vnetName: string, routeName: string, options?: msRest.RequestOptionsBase | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { + return this.client.sendOperationRequest( + { + resourceGroupName, + name, + vnetName, + routeName, + options + }, + getRouteForVnetOperationSpec, + callback) as Promise; + } + + /** + * Create or update a Virtual Network route in an App Service plan. + * @summary Create or update a Virtual Network route in an App Service plan. + * @param resourceGroupName Name of the resource group to which the resource belongs. + * @param name Name of the App Service plan. + * @param vnetName Name of the Virtual Network. + * @param routeName Name of the Virtual Network route. + * @param route Definition of the Virtual Network route. + * @param [options] The optional parameters + * @returns Promise + */ + createOrUpdateVnetRoute(resourceGroupName: string, name: string, vnetName: string, routeName: string, route: Models.VnetRoute, options?: msRest.RequestOptionsBase): Promise; + /** + * @param resourceGroupName Name of the resource group to which the resource belongs. + * @param name Name of the App Service plan. + * @param vnetName Name of the Virtual Network. + * @param routeName Name of the Virtual Network route. + * @param route Definition of the Virtual Network route. + * @param callback The callback + */ + createOrUpdateVnetRoute(resourceGroupName: string, name: string, vnetName: string, routeName: string, route: Models.VnetRoute, callback: msRest.ServiceCallback): void; + /** + * @param resourceGroupName Name of the resource group to which the resource belongs. + * @param name Name of the App Service plan. + * @param vnetName Name of the Virtual Network. + * @param routeName Name of the Virtual Network route. + * @param route Definition of the Virtual Network route. + * @param options The optional parameters + * @param callback The callback + */ + createOrUpdateVnetRoute(resourceGroupName: string, name: string, vnetName: string, routeName: string, route: Models.VnetRoute, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; + createOrUpdateVnetRoute(resourceGroupName: string, name: string, vnetName: string, routeName: string, route: Models.VnetRoute, options?: msRest.RequestOptionsBase | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { + return this.client.sendOperationRequest( + { + resourceGroupName, + name, + vnetName, + routeName, + route, + options + }, + createOrUpdateVnetRouteOperationSpec, + callback) as Promise; + } + + /** + * Delete a Virtual Network route in an App Service plan. + * @summary Delete a Virtual Network route in an App Service plan. + * @param resourceGroupName Name of the resource group to which the resource belongs. + * @param name Name of the App Service plan. + * @param vnetName Name of the Virtual Network. + * @param routeName Name of the Virtual Network route. + * @param [options] The optional parameters + * @returns Promise + */ + deleteVnetRoute(resourceGroupName: string, name: string, vnetName: string, routeName: string, options?: msRest.RequestOptionsBase): Promise; + /** + * @param resourceGroupName Name of the resource group to which the resource belongs. + * @param name Name of the App Service plan. + * @param vnetName Name of the Virtual Network. + * @param routeName Name of the Virtual Network route. + * @param callback The callback + */ + deleteVnetRoute(resourceGroupName: string, name: string, vnetName: string, routeName: string, callback: msRest.ServiceCallback): void; + /** + * @param resourceGroupName Name of the resource group to which the resource belongs. + * @param name Name of the App Service plan. + * @param vnetName Name of the Virtual Network. + * @param routeName Name of the Virtual Network route. + * @param options The optional parameters + * @param callback The callback + */ + deleteVnetRoute(resourceGroupName: string, name: string, vnetName: string, routeName: string, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; + deleteVnetRoute(resourceGroupName: string, name: string, vnetName: string, routeName: string, options?: msRest.RequestOptionsBase | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { + return this.client.sendOperationRequest( + { + resourceGroupName, + name, + vnetName, + routeName, + options + }, + deleteVnetRouteOperationSpec, + callback); + } + + /** + * Create or update a Virtual Network route in an App Service plan. + * @summary Create or update a Virtual Network route in an App Service plan. + * @param resourceGroupName Name of the resource group to which the resource belongs. + * @param name Name of the App Service plan. + * @param vnetName Name of the Virtual Network. + * @param routeName Name of the Virtual Network route. + * @param route Definition of the Virtual Network route. + * @param [options] The optional parameters + * @returns Promise + */ + updateVnetRoute(resourceGroupName: string, name: string, vnetName: string, routeName: string, route: Models.VnetRoute, options?: msRest.RequestOptionsBase): Promise; + /** + * @param resourceGroupName Name of the resource group to which the resource belongs. + * @param name Name of the App Service plan. + * @param vnetName Name of the Virtual Network. + * @param routeName Name of the Virtual Network route. + * @param route Definition of the Virtual Network route. + * @param callback The callback + */ + updateVnetRoute(resourceGroupName: string, name: string, vnetName: string, routeName: string, route: Models.VnetRoute, callback: msRest.ServiceCallback): void; + /** + * @param resourceGroupName Name of the resource group to which the resource belongs. + * @param name Name of the App Service plan. + * @param vnetName Name of the Virtual Network. + * @param routeName Name of the Virtual Network route. + * @param route Definition of the Virtual Network route. + * @param options The optional parameters + * @param callback The callback + */ + updateVnetRoute(resourceGroupName: string, name: string, vnetName: string, routeName: string, route: Models.VnetRoute, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; + updateVnetRoute(resourceGroupName: string, name: string, vnetName: string, routeName: string, route: Models.VnetRoute, options?: msRest.RequestOptionsBase | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { + return this.client.sendOperationRequest( + { + resourceGroupName, + name, + vnetName, + routeName, + route, + options + }, + updateVnetRouteOperationSpec, + callback) as Promise; + } + + /** + * Reboot a worker machine in an App Service plan. + * @summary Reboot a worker machine in an App Service plan. + * @param resourceGroupName Name of the resource group to which the resource belongs. + * @param name Name of the App Service plan. + * @param workerName Name of worker machine, which typically starts with RD. + * @param [options] The optional parameters + * @returns Promise + */ + rebootWorker(resourceGroupName: string, name: string, workerName: string, options?: msRest.RequestOptionsBase): Promise; + /** + * @param resourceGroupName Name of the resource group to which the resource belongs. + * @param name Name of the App Service plan. + * @param workerName Name of worker machine, which typically starts with RD. + * @param callback The callback + */ + rebootWorker(resourceGroupName: string, name: string, workerName: string, callback: msRest.ServiceCallback): void; + /** + * @param resourceGroupName Name of the resource group to which the resource belongs. + * @param name Name of the App Service plan. + * @param workerName Name of worker machine, which typically starts with RD. + * @param options The optional parameters + * @param callback The callback + */ + rebootWorker(resourceGroupName: string, name: string, workerName: string, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; + rebootWorker(resourceGroupName: string, name: string, workerName: string, options?: msRest.RequestOptionsBase | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { + return this.client.sendOperationRequest( + { + resourceGroupName, + name, + workerName, + options + }, + rebootWorkerOperationSpec, + callback); + } + + /** + * Creates or updates an App Service Plan. + * @summary Creates or updates an App Service Plan. + * @param resourceGroupName Name of the resource group to which the resource belongs. + * @param name Name of the App Service plan. + * @param appServicePlan Details of the App Service plan. + * @param [options] The optional parameters + * @returns Promise + */ + beginCreateOrUpdate(resourceGroupName: string, name: string, appServicePlan: Models.AppServicePlan, options?: msRest.RequestOptionsBase): Promise { + return this.client.sendLRORequest( + { + resourceGroupName, + name, + appServicePlan, + options + }, + beginCreateOrUpdateOperationSpec, + options); + } + + /** + * Get all App Service plans for a subscription. + * @summary Get all App Service plans for a subscription. + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @param [options] The optional parameters + * @returns Promise + */ + listNext(nextPageLink: string, options?: msRest.RequestOptionsBase): Promise; + /** + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @param callback The callback + */ + listNext(nextPageLink: string, callback: msRest.ServiceCallback): void; + /** + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @param options The optional parameters + * @param callback The callback + */ + listNext(nextPageLink: string, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; + listNext(nextPageLink: string, options?: msRest.RequestOptionsBase | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { + return this.client.sendOperationRequest( + { + nextPageLink, + options + }, + listNextOperationSpec, + callback) as Promise; + } + + /** + * Get all App Service plans in a resource group. + * @summary Get all App Service plans in a resource group. + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @param [options] The optional parameters + * @returns Promise + */ + listByResourceGroupNext(nextPageLink: string, options?: msRest.RequestOptionsBase): Promise; + /** + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @param callback The callback + */ + listByResourceGroupNext(nextPageLink: string, callback: msRest.ServiceCallback): void; + /** + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @param options The optional parameters + * @param callback The callback + */ + listByResourceGroupNext(nextPageLink: string, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; + listByResourceGroupNext(nextPageLink: string, options?: msRest.RequestOptionsBase | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { + return this.client.sendOperationRequest( + { + nextPageLink, + options + }, + listByResourceGroupNextOperationSpec, + callback) as Promise; + } + + /** + * Get all apps that use a Hybrid Connection in an App Service Plan. + * @summary Get all apps that use a Hybrid Connection in an App Service Plan. + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @param [options] The optional parameters + * @returns Promise + */ + listWebAppsByHybridConnectionNext(nextPageLink: string, options?: msRest.RequestOptionsBase): Promise; + /** + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @param callback The callback + */ + listWebAppsByHybridConnectionNext(nextPageLink: string, callback: msRest.ServiceCallback): void; + /** + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @param options The optional parameters + * @param callback The callback + */ + listWebAppsByHybridConnectionNext(nextPageLink: string, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; + listWebAppsByHybridConnectionNext(nextPageLink: string, options?: msRest.RequestOptionsBase | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { + return this.client.sendOperationRequest( + { + nextPageLink, + options + }, + listWebAppsByHybridConnectionNextOperationSpec, + callback) as Promise; + } + + /** + * Retrieve all Hybrid Connections in use in an App Service plan. + * @summary Retrieve all Hybrid Connections in use in an App Service plan. + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @param [options] The optional parameters + * @returns Promise + */ + listHybridConnectionsNext(nextPageLink: string, options?: msRest.RequestOptionsBase): Promise; + /** + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @param callback The callback + */ + listHybridConnectionsNext(nextPageLink: string, callback: msRest.ServiceCallback): void; + /** + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @param options The optional parameters + * @param callback The callback + */ + listHybridConnectionsNext(nextPageLink: string, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; + listHybridConnectionsNext(nextPageLink: string, options?: msRest.RequestOptionsBase | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { + return this.client.sendOperationRequest( + { + nextPageLink, + options + }, + listHybridConnectionsNextOperationSpec, + callback) as Promise; + } + + /** + * Get metrics that can be queried for an App Service plan, and their definitions. + * @summary Get metrics that can be queried for an App Service plan, and their definitions. + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @param [options] The optional parameters + * @returns Promise + */ + listMetricDefintionsNext(nextPageLink: string, options?: msRest.RequestOptionsBase): Promise; + /** + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @param callback The callback + */ + listMetricDefintionsNext(nextPageLink: string, callback: msRest.ServiceCallback): void; + /** + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @param options The optional parameters + * @param callback The callback + */ + listMetricDefintionsNext(nextPageLink: string, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; + listMetricDefintionsNext(nextPageLink: string, options?: msRest.RequestOptionsBase | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { + return this.client.sendOperationRequest( + { + nextPageLink, + options + }, + listMetricDefintionsNextOperationSpec, + callback) as Promise; + } + + /** + * Get metrics for an App Service plan. + * @summary Get metrics for an App Service plan. + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @param [options] The optional parameters + * @returns Promise + */ + listMetricsNext(nextPageLink: string, options?: msRest.RequestOptionsBase): Promise; + /** + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @param callback The callback + */ + listMetricsNext(nextPageLink: string, callback: msRest.ServiceCallback): void; + /** + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @param options The optional parameters + * @param callback The callback + */ + listMetricsNext(nextPageLink: string, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; + listMetricsNext(nextPageLink: string, options?: msRest.RequestOptionsBase | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { + return this.client.sendOperationRequest( + { + nextPageLink, + options + }, + listMetricsNextOperationSpec, + callback) as Promise; + } + + /** + * Get all apps associated with an App Service plan. + * @summary Get all apps associated with an App Service plan. + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @param [options] The optional parameters + * @returns Promise + */ + listWebAppsNext(nextPageLink: string, options?: msRest.RequestOptionsBase): Promise; + /** + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @param callback The callback + */ + listWebAppsNext(nextPageLink: string, callback: msRest.ServiceCallback): void; + /** + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @param options The optional parameters + * @param callback The callback + */ + listWebAppsNext(nextPageLink: string, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; + listWebAppsNext(nextPageLink: string, options?: msRest.RequestOptionsBase | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { + return this.client.sendOperationRequest( + { + nextPageLink, + options + }, + listWebAppsNextOperationSpec, + callback) as Promise; + } + + /** + * Gets server farm usage information + * @summary Gets server farm usage information + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @param [options] The optional parameters + * @returns Promise + */ + listUsagesNext(nextPageLink: string, options?: msRest.RequestOptionsBase): Promise; + /** + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @param callback The callback + */ + listUsagesNext(nextPageLink: string, callback: msRest.ServiceCallback): void; + /** + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @param options The optional parameters + * @param callback The callback + */ + listUsagesNext(nextPageLink: string, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; + listUsagesNext(nextPageLink: string, options?: msRest.RequestOptionsBase | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { + return this.client.sendOperationRequest( + { + nextPageLink, + options + }, + listUsagesNextOperationSpec, + callback) as Promise; + } +} + +// Operation Specifications +const serializer = new msRest.Serializer(Mappers); +const listOperationSpec: msRest.OperationSpec = { + httpMethod: "GET", + path: "subscriptions/{subscriptionId}/providers/Microsoft.Web/serverfarms", + urlParameters: [ + Parameters.subscriptionId + ], + queryParameters: [ + Parameters.detailed, + Parameters.apiVersion + ], + headerParameters: [ + Parameters.acceptLanguage + ], + responses: { + 200: { + bodyMapper: Mappers.AppServicePlanCollection + }, + default: { + bodyMapper: Mappers.DefaultErrorResponse + } + }, + serializer +}; + +const listByResourceGroupOperationSpec: msRest.OperationSpec = { + httpMethod: "GET", + path: "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/serverfarms", + urlParameters: [ + Parameters.resourceGroupName, + Parameters.subscriptionId + ], + queryParameters: [ + Parameters.apiVersion + ], + headerParameters: [ + Parameters.acceptLanguage + ], + responses: { + 200: { + bodyMapper: Mappers.AppServicePlanCollection + }, + default: { + bodyMapper: Mappers.DefaultErrorResponse + } + }, + serializer +}; + +const getOperationSpec: msRest.OperationSpec = { + httpMethod: "GET", + path: "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/serverfarms/{name}", + urlParameters: [ + Parameters.resourceGroupName, + Parameters.name, + Parameters.subscriptionId + ], + queryParameters: [ + Parameters.apiVersion + ], + headerParameters: [ + Parameters.acceptLanguage + ], + responses: { + 200: { + bodyMapper: Mappers.AppServicePlan + }, + 404: {}, + default: { + bodyMapper: Mappers.CloudError + } + }, + serializer +}; + +const deleteMethodOperationSpec: msRest.OperationSpec = { + httpMethod: "DELETE", + path: "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/serverfarms/{name}", + urlParameters: [ + Parameters.resourceGroupName, + Parameters.name, + Parameters.subscriptionId + ], + queryParameters: [ + Parameters.apiVersion + ], + headerParameters: [ + Parameters.acceptLanguage + ], + responses: { + 200: {}, + 204: {}, + default: { + bodyMapper: Mappers.CloudError + } + }, + serializer +}; + +const updateOperationSpec: msRest.OperationSpec = { + httpMethod: "PATCH", + path: "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/serverfarms/{name}", + urlParameters: [ + Parameters.resourceGroupName, + Parameters.name, + Parameters.subscriptionId + ], + queryParameters: [ + Parameters.apiVersion + ], + headerParameters: [ + Parameters.acceptLanguage + ], + requestBody: { + parameterPath: "appServicePlan", + mapper: { + ...Mappers.AppServicePlanPatchResource, + required: true + } + }, + responses: { + 200: { + bodyMapper: Mappers.AppServicePlan + }, + 202: { + bodyMapper: Mappers.AppServicePlan + }, + default: { + bodyMapper: Mappers.DefaultErrorResponse + } + }, + serializer +}; + +const listCapabilitiesOperationSpec: msRest.OperationSpec = { + httpMethod: "GET", + path: "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/serverfarms/{name}/capabilities", + urlParameters: [ + Parameters.resourceGroupName, + Parameters.name, + Parameters.subscriptionId + ], + queryParameters: [ + Parameters.apiVersion + ], + headerParameters: [ + Parameters.acceptLanguage + ], + responses: { + 200: { + bodyMapper: { + serializedName: "parsedResponse", + type: { + name: "Sequence", + element: { + type: { + name: "Composite", + className: "Capability" + } + } + } + } + }, + default: { + bodyMapper: Mappers.DefaultErrorResponse + } + }, + serializer +}; + +const getHybridConnectionOperationSpec: msRest.OperationSpec = { + httpMethod: "GET", + path: "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/serverfarms/{name}/hybridConnectionNamespaces/{namespaceName}/relays/{relayName}", + urlParameters: [ + Parameters.resourceGroupName, + Parameters.name, + Parameters.namespaceName, + Parameters.relayName, + Parameters.subscriptionId + ], + queryParameters: [ + Parameters.apiVersion + ], + headerParameters: [ + Parameters.acceptLanguage + ], + responses: { + 200: { + bodyMapper: Mappers.HybridConnection + }, + default: { + bodyMapper: Mappers.DefaultErrorResponse + } + }, + serializer +}; + +const deleteHybridConnectionOperationSpec: msRest.OperationSpec = { + httpMethod: "DELETE", + path: "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/serverfarms/{name}/hybridConnectionNamespaces/{namespaceName}/relays/{relayName}", + urlParameters: [ + Parameters.resourceGroupName, + Parameters.name, + Parameters.namespaceName, + Parameters.relayName, + Parameters.subscriptionId + ], + queryParameters: [ + Parameters.apiVersion + ], + headerParameters: [ + Parameters.acceptLanguage + ], + responses: { + 200: {}, + 204: {}, + default: { + bodyMapper: Mappers.CloudError + } + }, + serializer +}; + +const listHybridConnectionKeysOperationSpec: msRest.OperationSpec = { + httpMethod: "POST", + path: "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/serverfarms/{name}/hybridConnectionNamespaces/{namespaceName}/relays/{relayName}/listKeys", + urlParameters: [ + Parameters.resourceGroupName, + Parameters.name, + Parameters.namespaceName, + Parameters.relayName, + Parameters.subscriptionId + ], + queryParameters: [ + Parameters.apiVersion + ], + headerParameters: [ + Parameters.acceptLanguage + ], + responses: { + 200: { + bodyMapper: Mappers.HybridConnectionKey + }, + default: { + bodyMapper: Mappers.DefaultErrorResponse + } + }, + serializer +}; + +const listWebAppsByHybridConnectionOperationSpec: msRest.OperationSpec = { + httpMethod: "GET", + path: "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/serverfarms/{name}/hybridConnectionNamespaces/{namespaceName}/relays/{relayName}/sites", + urlParameters: [ + Parameters.resourceGroupName, + Parameters.name, + Parameters.namespaceName, + Parameters.relayName, + Parameters.subscriptionId + ], + queryParameters: [ + Parameters.apiVersion + ], + headerParameters: [ + Parameters.acceptLanguage + ], + responses: { + 200: { + bodyMapper: Mappers.ResourceCollection + }, + default: { + bodyMapper: Mappers.DefaultErrorResponse + } + }, + serializer +}; + +const getHybridConnectionPlanLimitOperationSpec: msRest.OperationSpec = { + httpMethod: "GET", + path: "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/serverfarms/{name}/hybridConnectionPlanLimits/limit", + urlParameters: [ + Parameters.resourceGroupName, + Parameters.name, + Parameters.subscriptionId + ], + queryParameters: [ + Parameters.apiVersion + ], + headerParameters: [ + Parameters.acceptLanguage + ], + responses: { + 200: { + bodyMapper: Mappers.HybridConnectionLimits + }, + default: { + bodyMapper: Mappers.DefaultErrorResponse + } + }, + serializer +}; + +const listHybridConnectionsOperationSpec: msRest.OperationSpec = { + httpMethod: "GET", + path: "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/serverfarms/{name}/hybridConnectionRelays", + urlParameters: [ + Parameters.resourceGroupName, + Parameters.name, + Parameters.subscriptionId + ], + queryParameters: [ + Parameters.apiVersion + ], + headerParameters: [ + Parameters.acceptLanguage + ], + responses: { + 200: { + bodyMapper: Mappers.HybridConnectionCollection + }, + default: { + bodyMapper: Mappers.DefaultErrorResponse + } + }, + serializer +}; + +const listMetricDefintionsOperationSpec: msRest.OperationSpec = { + httpMethod: "GET", + path: "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/serverfarms/{name}/metricdefinitions", + urlParameters: [ + Parameters.resourceGroupName, + Parameters.name, + Parameters.subscriptionId + ], + queryParameters: [ + Parameters.apiVersion + ], + headerParameters: [ + Parameters.acceptLanguage + ], + responses: { + 200: { + bodyMapper: Mappers.ResourceMetricDefinitionCollection + }, + default: { + bodyMapper: Mappers.DefaultErrorResponse + } + }, + serializer +}; + +const listMetricsOperationSpec: msRest.OperationSpec = { + httpMethod: "GET", + path: "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/serverfarms/{name}/metrics", + urlParameters: [ + Parameters.resourceGroupName, + Parameters.name, + Parameters.subscriptionId + ], + queryParameters: [ + Parameters.details, + Parameters.filter, + Parameters.apiVersion + ], + headerParameters: [ + Parameters.acceptLanguage + ], + responses: { + 200: { + bodyMapper: Mappers.ResourceMetricCollection + }, + default: { + bodyMapper: Mappers.DefaultErrorResponse + } + }, + serializer +}; + +const restartWebAppsOperationSpec: msRest.OperationSpec = { + httpMethod: "POST", + path: "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/serverfarms/{name}/restartSites", + urlParameters: [ + Parameters.resourceGroupName, + Parameters.name, + Parameters.subscriptionId + ], + queryParameters: [ + Parameters.softRestart, + Parameters.apiVersion + ], + headerParameters: [ + Parameters.acceptLanguage + ], + responses: { + 204: {}, + default: { + bodyMapper: Mappers.CloudError + } + }, + serializer +}; + +const listWebAppsOperationSpec: msRest.OperationSpec = { + httpMethod: "GET", + path: "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/serverfarms/{name}/sites", + urlParameters: [ + Parameters.resourceGroupName, + Parameters.name, + Parameters.subscriptionId + ], + queryParameters: [ + Parameters.skipToken, + Parameters.filter, + Parameters.top, + Parameters.apiVersion + ], + headerParameters: [ + Parameters.acceptLanguage + ], + responses: { + 200: { + bodyMapper: Mappers.WebAppCollection + }, + default: { + bodyMapper: Mappers.DefaultErrorResponse + } + }, + serializer +}; + +const getServerFarmSkusOperationSpec: msRest.OperationSpec = { + httpMethod: "GET", + path: "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/serverfarms/{name}/skus", + urlParameters: [ + Parameters.resourceGroupName, + Parameters.name, + Parameters.subscriptionId + ], + queryParameters: [ + Parameters.apiVersion + ], + headerParameters: [ + Parameters.acceptLanguage + ], + responses: { + 200: { + bodyMapper: { + serializedName: "parsedResponse", + type: { + name: "Object" + } + } + }, + default: { + bodyMapper: Mappers.DefaultErrorResponse + } + }, + serializer +}; + +const listUsagesOperationSpec: msRest.OperationSpec = { + httpMethod: "GET", + path: "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/serverfarms/{name}/usages", + urlParameters: [ + Parameters.resourceGroupName, + Parameters.name, + Parameters.subscriptionId + ], + queryParameters: [ + Parameters.filter, + Parameters.apiVersion + ], + headerParameters: [ + Parameters.acceptLanguage + ], + responses: { + 200: { + bodyMapper: Mappers.CsmUsageQuotaCollection + }, + default: { + bodyMapper: Mappers.DefaultErrorResponse + } + }, + serializer +}; + +const listVnetsOperationSpec: msRest.OperationSpec = { + httpMethod: "GET", + path: "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/serverfarms/{name}/virtualNetworkConnections", + urlParameters: [ + Parameters.resourceGroupName, + Parameters.name, + Parameters.subscriptionId + ], + queryParameters: [ + Parameters.apiVersion + ], + headerParameters: [ + Parameters.acceptLanguage + ], + responses: { + 200: { + bodyMapper: { + serializedName: "parsedResponse", + type: { + name: "Sequence", + element: { + type: { + name: "Composite", + className: "VnetInfo" + } + } + } + } + }, + default: { + bodyMapper: Mappers.DefaultErrorResponse + } + }, + serializer +}; + +const getVnetFromServerFarmOperationSpec: msRest.OperationSpec = { + httpMethod: "GET", + path: "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/serverfarms/{name}/virtualNetworkConnections/{vnetName}", + urlParameters: [ + Parameters.resourceGroupName, + Parameters.name, + Parameters.vnetName, + Parameters.subscriptionId + ], + queryParameters: [ + Parameters.apiVersion + ], + headerParameters: [ + Parameters.acceptLanguage + ], + responses: { + 200: { + bodyMapper: Mappers.VnetInfo + }, + 404: {}, + default: { + bodyMapper: Mappers.CloudError + } + }, + serializer +}; + +const getVnetGatewayOperationSpec: msRest.OperationSpec = { + httpMethod: "GET", + path: "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/serverfarms/{name}/virtualNetworkConnections/{vnetName}/gateways/{gatewayName}", + urlParameters: [ + Parameters.resourceGroupName, + Parameters.name, + Parameters.vnetName, + Parameters.gatewayName, + Parameters.subscriptionId + ], + queryParameters: [ + Parameters.apiVersion + ], + headerParameters: [ + Parameters.acceptLanguage + ], + responses: { + 200: { + bodyMapper: Mappers.VnetGateway + }, + default: { + bodyMapper: Mappers.DefaultErrorResponse + } + }, + serializer +}; + +const updateVnetGatewayOperationSpec: msRest.OperationSpec = { + httpMethod: "PUT", + path: "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/serverfarms/{name}/virtualNetworkConnections/{vnetName}/gateways/{gatewayName}", + urlParameters: [ + Parameters.resourceGroupName, + Parameters.name, + Parameters.vnetName, + Parameters.gatewayName, + Parameters.subscriptionId + ], + queryParameters: [ + Parameters.apiVersion + ], + headerParameters: [ + Parameters.acceptLanguage + ], + requestBody: { + parameterPath: "connectionEnvelope", + mapper: { + ...Mappers.VnetGateway, + required: true + } + }, + responses: { + 200: { + bodyMapper: Mappers.VnetGateway + }, + default: { + bodyMapper: Mappers.DefaultErrorResponse + } + }, + serializer +}; + +const listRoutesForVnetOperationSpec: msRest.OperationSpec = { + httpMethod: "GET", + path: "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/serverfarms/{name}/virtualNetworkConnections/{vnetName}/routes", + urlParameters: [ + Parameters.resourceGroupName, + Parameters.name, + Parameters.vnetName, + Parameters.subscriptionId + ], + queryParameters: [ + Parameters.apiVersion + ], + headerParameters: [ + Parameters.acceptLanguage + ], + responses: { + 200: { + bodyMapper: { + serializedName: "parsedResponse", + type: { + name: "Sequence", + element: { + type: { + name: "Composite", + className: "VnetRoute" + } + } + } + } + }, + default: { + bodyMapper: Mappers.DefaultErrorResponse + } + }, + serializer +}; + +const getRouteForVnetOperationSpec: msRest.OperationSpec = { + httpMethod: "GET", + path: "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/serverfarms/{name}/virtualNetworkConnections/{vnetName}/routes/{routeName}", + urlParameters: [ + Parameters.resourceGroupName, + Parameters.name, + Parameters.vnetName, + Parameters.routeName, + Parameters.subscriptionId + ], + queryParameters: [ + Parameters.apiVersion + ], + headerParameters: [ + Parameters.acceptLanguage + ], + responses: { + 200: { + bodyMapper: { + serializedName: "parsedResponse", + type: { + name: "Sequence", + element: { + type: { + name: "Composite", + className: "VnetRoute" + } + } + } + } + }, + 404: {}, + default: { + bodyMapper: Mappers.CloudError + } + }, + serializer +}; + +const createOrUpdateVnetRouteOperationSpec: msRest.OperationSpec = { + httpMethod: "PUT", + path: "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/serverfarms/{name}/virtualNetworkConnections/{vnetName}/routes/{routeName}", + urlParameters: [ + Parameters.resourceGroupName, + Parameters.name, + Parameters.vnetName, + Parameters.routeName, + Parameters.subscriptionId + ], + queryParameters: [ + Parameters.apiVersion + ], + headerParameters: [ + Parameters.acceptLanguage + ], + requestBody: { + parameterPath: "route", + mapper: { + ...Mappers.VnetRoute, + required: true + } + }, + responses: { + 200: { + bodyMapper: Mappers.VnetRoute + }, + 400: {}, + 404: {}, + default: { + bodyMapper: Mappers.CloudError + } + }, + serializer +}; + +const deleteVnetRouteOperationSpec: msRest.OperationSpec = { + httpMethod: "DELETE", + path: "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/serverfarms/{name}/virtualNetworkConnections/{vnetName}/routes/{routeName}", + urlParameters: [ + Parameters.resourceGroupName, + Parameters.name, + Parameters.vnetName, + Parameters.routeName, + Parameters.subscriptionId + ], + queryParameters: [ + Parameters.apiVersion + ], + headerParameters: [ + Parameters.acceptLanguage + ], + responses: { + 200: {}, + 404: {}, + default: { + bodyMapper: Mappers.CloudError + } + }, + serializer +}; + +const updateVnetRouteOperationSpec: msRest.OperationSpec = { + httpMethod: "PATCH", + path: "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/serverfarms/{name}/virtualNetworkConnections/{vnetName}/routes/{routeName}", + urlParameters: [ + Parameters.resourceGroupName, + Parameters.name, + Parameters.vnetName, + Parameters.routeName, + Parameters.subscriptionId + ], + queryParameters: [ + Parameters.apiVersion + ], + headerParameters: [ + Parameters.acceptLanguage + ], + requestBody: { + parameterPath: "route", + mapper: { + ...Mappers.VnetRoute, + required: true + } + }, + responses: { + 200: { + bodyMapper: Mappers.VnetRoute + }, + 400: {}, + 404: {}, + default: { + bodyMapper: Mappers.CloudError + } + }, + serializer +}; + +const rebootWorkerOperationSpec: msRest.OperationSpec = { + httpMethod: "POST", + path: "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/serverfarms/{name}/workers/{workerName}/reboot", + urlParameters: [ + Parameters.resourceGroupName, + Parameters.name, + Parameters.workerName, + Parameters.subscriptionId + ], + queryParameters: [ + Parameters.apiVersion + ], + headerParameters: [ + Parameters.acceptLanguage + ], + responses: { + 204: {}, + default: { + bodyMapper: Mappers.CloudError + } + }, + serializer +}; + +const beginCreateOrUpdateOperationSpec: msRest.OperationSpec = { + httpMethod: "PUT", + path: "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/serverfarms/{name}", + urlParameters: [ + Parameters.resourceGroupName, + Parameters.name, + Parameters.subscriptionId + ], + queryParameters: [ + Parameters.apiVersion + ], + headerParameters: [ + Parameters.acceptLanguage + ], + requestBody: { + parameterPath: "appServicePlan", + mapper: { + ...Mappers.AppServicePlan, + required: true + } + }, + responses: { + 200: { + bodyMapper: Mappers.AppServicePlan + }, + 201: { + bodyMapper: Mappers.AppServicePlan + }, + 202: { + bodyMapper: Mappers.AppServicePlan + }, + default: { + bodyMapper: Mappers.DefaultErrorResponse + } + }, + serializer +}; + +const listNextOperationSpec: msRest.OperationSpec = { + httpMethod: "GET", + baseUrl: "https://management.azure.com", + path: "{nextLink}", + urlParameters: [ + Parameters.nextPageLink + ], + headerParameters: [ + Parameters.acceptLanguage + ], + responses: { + 200: { + bodyMapper: Mappers.AppServicePlanCollection + }, + default: { + bodyMapper: Mappers.DefaultErrorResponse + } + }, + serializer +}; + +const listByResourceGroupNextOperationSpec: msRest.OperationSpec = { + httpMethod: "GET", + baseUrl: "https://management.azure.com", + path: "{nextLink}", + urlParameters: [ + Parameters.nextPageLink + ], + headerParameters: [ + Parameters.acceptLanguage + ], + responses: { + 200: { + bodyMapper: Mappers.AppServicePlanCollection + }, + default: { + bodyMapper: Mappers.DefaultErrorResponse + } + }, + serializer +}; + +const listWebAppsByHybridConnectionNextOperationSpec: msRest.OperationSpec = { + httpMethod: "GET", + baseUrl: "https://management.azure.com", + path: "{nextLink}", + urlParameters: [ + Parameters.nextPageLink + ], + headerParameters: [ + Parameters.acceptLanguage + ], + responses: { + 200: { + bodyMapper: Mappers.ResourceCollection + }, + default: { + bodyMapper: Mappers.DefaultErrorResponse + } + }, + serializer +}; + +const listHybridConnectionsNextOperationSpec: msRest.OperationSpec = { + httpMethod: "GET", + baseUrl: "https://management.azure.com", + path: "{nextLink}", + urlParameters: [ + Parameters.nextPageLink + ], + headerParameters: [ + Parameters.acceptLanguage + ], + responses: { + 200: { + bodyMapper: Mappers.HybridConnectionCollection + }, + default: { + bodyMapper: Mappers.DefaultErrorResponse + } + }, + serializer +}; + +const listMetricDefintionsNextOperationSpec: msRest.OperationSpec = { + httpMethod: "GET", + baseUrl: "https://management.azure.com", + path: "{nextLink}", + urlParameters: [ + Parameters.nextPageLink + ], + headerParameters: [ + Parameters.acceptLanguage + ], + responses: { + 200: { + bodyMapper: Mappers.ResourceMetricDefinitionCollection + }, + default: { + bodyMapper: Mappers.DefaultErrorResponse + } + }, + serializer +}; + +const listMetricsNextOperationSpec: msRest.OperationSpec = { + httpMethod: "GET", + baseUrl: "https://management.azure.com", + path: "{nextLink}", + urlParameters: [ + Parameters.nextPageLink + ], + headerParameters: [ + Parameters.acceptLanguage + ], + responses: { + 200: { + bodyMapper: Mappers.ResourceMetricCollection + }, + default: { + bodyMapper: Mappers.DefaultErrorResponse + } + }, + serializer +}; + +const listWebAppsNextOperationSpec: msRest.OperationSpec = { + httpMethod: "GET", + baseUrl: "https://management.azure.com", + path: "{nextLink}", + urlParameters: [ + Parameters.nextPageLink + ], + headerParameters: [ + Parameters.acceptLanguage + ], + responses: { + 200: { + bodyMapper: Mappers.WebAppCollection + }, + default: { + bodyMapper: Mappers.DefaultErrorResponse + } + }, + serializer +}; + +const listUsagesNextOperationSpec: msRest.OperationSpec = { + httpMethod: "GET", + baseUrl: "https://management.azure.com", + path: "{nextLink}", + urlParameters: [ + Parameters.nextPageLink + ], + headerParameters: [ + Parameters.acceptLanguage + ], + responses: { + 200: { + bodyMapper: Mappers.CsmUsageQuotaCollection + }, + default: { + bodyMapper: Mappers.DefaultErrorResponse + } + }, + serializer +}; diff --git a/sdk/appservice/arm-appservice-profile-2019-03-01-hybrid/src/operations/certificates.ts b/sdk/appservice/arm-appservice-profile-2019-03-01-hybrid/src/operations/certificates.ts new file mode 100644 index 000000000000..91bf1c0b54c5 --- /dev/null +++ b/sdk/appservice/arm-appservice-profile-2019-03-01-hybrid/src/operations/certificates.ts @@ -0,0 +1,484 @@ +/* + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * 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 * as msRest from "@azure/ms-rest-js"; +import * as Models from "../models"; +import * as Mappers from "../models/certificatesMappers"; +import * as Parameters from "../models/parameters"; +import { WebSiteManagementClientContext } from "../webSiteManagementClientContext"; + +/** Class representing a Certificates. */ +export class Certificates { + private readonly client: WebSiteManagementClientContext; + + /** + * Create a Certificates. + * @param {WebSiteManagementClientContext} client Reference to the service client. + */ + constructor(client: WebSiteManagementClientContext) { + this.client = client; + } + + /** + * Get all certificates for a subscription. + * @summary Get all certificates for a subscription. + * @param [options] The optional parameters + * @returns Promise + */ + list(options?: msRest.RequestOptionsBase): Promise; + /** + * @param callback The callback + */ + list(callback: msRest.ServiceCallback): void; + /** + * @param options The optional parameters + * @param callback The callback + */ + list(options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; + list(options?: msRest.RequestOptionsBase | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { + return this.client.sendOperationRequest( + { + options + }, + listOperationSpec, + callback) as Promise; + } + + /** + * Get all certificates in a resource group. + * @summary Get all certificates in a resource group. + * @param resourceGroupName Name of the resource group to which the resource belongs. + * @param [options] The optional parameters + * @returns Promise + */ + listByResourceGroup(resourceGroupName: string, options?: msRest.RequestOptionsBase): Promise; + /** + * @param resourceGroupName Name of the resource group to which the resource belongs. + * @param callback The callback + */ + listByResourceGroup(resourceGroupName: string, callback: msRest.ServiceCallback): void; + /** + * @param resourceGroupName Name of the resource group to which the resource belongs. + * @param options The optional parameters + * @param callback The callback + */ + listByResourceGroup(resourceGroupName: string, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; + listByResourceGroup(resourceGroupName: string, options?: msRest.RequestOptionsBase | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { + return this.client.sendOperationRequest( + { + resourceGroupName, + options + }, + listByResourceGroupOperationSpec, + callback) as Promise; + } + + /** + * Get a certificate. + * @summary Get a certificate. + * @param resourceGroupName Name of the resource group to which the resource belongs. + * @param name Name of the certificate. + * @param [options] The optional parameters + * @returns Promise + */ + get(resourceGroupName: string, name: string, options?: msRest.RequestOptionsBase): Promise; + /** + * @param resourceGroupName Name of the resource group to which the resource belongs. + * @param name Name of the certificate. + * @param callback The callback + */ + get(resourceGroupName: string, name: string, callback: msRest.ServiceCallback): void; + /** + * @param resourceGroupName Name of the resource group to which the resource belongs. + * @param name Name of the certificate. + * @param options The optional parameters + * @param callback The callback + */ + get(resourceGroupName: string, name: string, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; + get(resourceGroupName: string, name: string, options?: msRest.RequestOptionsBase | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { + return this.client.sendOperationRequest( + { + resourceGroupName, + name, + options + }, + getOperationSpec, + callback) as Promise; + } + + /** + * Create or update a certificate. + * @summary Create or update a certificate. + * @param resourceGroupName Name of the resource group to which the resource belongs. + * @param name Name of the certificate. + * @param certificateEnvelope Details of certificate, if it exists already. + * @param [options] The optional parameters + * @returns Promise + */ + createOrUpdate(resourceGroupName: string, name: string, certificateEnvelope: Models.Certificate, options?: msRest.RequestOptionsBase): Promise; + /** + * @param resourceGroupName Name of the resource group to which the resource belongs. + * @param name Name of the certificate. + * @param certificateEnvelope Details of certificate, if it exists already. + * @param callback The callback + */ + createOrUpdate(resourceGroupName: string, name: string, certificateEnvelope: Models.Certificate, callback: msRest.ServiceCallback): void; + /** + * @param resourceGroupName Name of the resource group to which the resource belongs. + * @param name Name of the certificate. + * @param certificateEnvelope Details of certificate, if it exists already. + * @param options The optional parameters + * @param callback The callback + */ + createOrUpdate(resourceGroupName: string, name: string, certificateEnvelope: Models.Certificate, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; + createOrUpdate(resourceGroupName: string, name: string, certificateEnvelope: Models.Certificate, options?: msRest.RequestOptionsBase | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { + return this.client.sendOperationRequest( + { + resourceGroupName, + name, + certificateEnvelope, + options + }, + createOrUpdateOperationSpec, + callback) as Promise; + } + + /** + * Delete a certificate. + * @summary Delete a certificate. + * @param resourceGroupName Name of the resource group to which the resource belongs. + * @param name Name of the certificate. + * @param [options] The optional parameters + * @returns Promise + */ + deleteMethod(resourceGroupName: string, name: string, options?: msRest.RequestOptionsBase): Promise; + /** + * @param resourceGroupName Name of the resource group to which the resource belongs. + * @param name Name of the certificate. + * @param callback The callback + */ + deleteMethod(resourceGroupName: string, name: string, callback: msRest.ServiceCallback): void; + /** + * @param resourceGroupName Name of the resource group to which the resource belongs. + * @param name Name of the certificate. + * @param options The optional parameters + * @param callback The callback + */ + deleteMethod(resourceGroupName: string, name: string, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; + deleteMethod(resourceGroupName: string, name: string, options?: msRest.RequestOptionsBase | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { + return this.client.sendOperationRequest( + { + resourceGroupName, + name, + options + }, + deleteMethodOperationSpec, + callback); + } + + /** + * Create or update a certificate. + * @summary Create or update a certificate. + * @param resourceGroupName Name of the resource group to which the resource belongs. + * @param name Name of the certificate. + * @param certificateEnvelope Details of certificate, if it exists already. + * @param [options] The optional parameters + * @returns Promise + */ + update(resourceGroupName: string, name: string, certificateEnvelope: Models.CertificatePatchResource, options?: msRest.RequestOptionsBase): Promise; + /** + * @param resourceGroupName Name of the resource group to which the resource belongs. + * @param name Name of the certificate. + * @param certificateEnvelope Details of certificate, if it exists already. + * @param callback The callback + */ + update(resourceGroupName: string, name: string, certificateEnvelope: Models.CertificatePatchResource, callback: msRest.ServiceCallback): void; + /** + * @param resourceGroupName Name of the resource group to which the resource belongs. + * @param name Name of the certificate. + * @param certificateEnvelope Details of certificate, if it exists already. + * @param options The optional parameters + * @param callback The callback + */ + update(resourceGroupName: string, name: string, certificateEnvelope: Models.CertificatePatchResource, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; + update(resourceGroupName: string, name: string, certificateEnvelope: Models.CertificatePatchResource, options?: msRest.RequestOptionsBase | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { + return this.client.sendOperationRequest( + { + resourceGroupName, + name, + certificateEnvelope, + options + }, + updateOperationSpec, + callback) as Promise; + } + + /** + * Get all certificates for a subscription. + * @summary Get all certificates for a subscription. + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @param [options] The optional parameters + * @returns Promise + */ + listNext(nextPageLink: string, options?: msRest.RequestOptionsBase): Promise; + /** + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @param callback The callback + */ + listNext(nextPageLink: string, callback: msRest.ServiceCallback): void; + /** + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @param options The optional parameters + * @param callback The callback + */ + listNext(nextPageLink: string, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; + listNext(nextPageLink: string, options?: msRest.RequestOptionsBase | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { + return this.client.sendOperationRequest( + { + nextPageLink, + options + }, + listNextOperationSpec, + callback) as Promise; + } + + /** + * Get all certificates in a resource group. + * @summary Get all certificates in a resource group. + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @param [options] The optional parameters + * @returns Promise + */ + listByResourceGroupNext(nextPageLink: string, options?: msRest.RequestOptionsBase): Promise; + /** + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @param callback The callback + */ + listByResourceGroupNext(nextPageLink: string, callback: msRest.ServiceCallback): void; + /** + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @param options The optional parameters + * @param callback The callback + */ + listByResourceGroupNext(nextPageLink: string, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; + listByResourceGroupNext(nextPageLink: string, options?: msRest.RequestOptionsBase | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { + return this.client.sendOperationRequest( + { + nextPageLink, + options + }, + listByResourceGroupNextOperationSpec, + callback) as Promise; + } +} + +// Operation Specifications +const serializer = new msRest.Serializer(Mappers); +const listOperationSpec: msRest.OperationSpec = { + httpMethod: "GET", + path: "subscriptions/{subscriptionId}/providers/Microsoft.Web/certificates", + urlParameters: [ + Parameters.subscriptionId + ], + queryParameters: [ + Parameters.apiVersion + ], + headerParameters: [ + Parameters.acceptLanguage + ], + responses: { + 200: { + bodyMapper: Mappers.CertificateCollection + }, + default: { + bodyMapper: Mappers.DefaultErrorResponse + } + }, + serializer +}; + +const listByResourceGroupOperationSpec: msRest.OperationSpec = { + httpMethod: "GET", + path: "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/certificates", + urlParameters: [ + Parameters.resourceGroupName, + Parameters.subscriptionId + ], + queryParameters: [ + Parameters.apiVersion + ], + headerParameters: [ + Parameters.acceptLanguage + ], + responses: { + 200: { + bodyMapper: Mappers.CertificateCollection + }, + default: { + bodyMapper: Mappers.DefaultErrorResponse + } + }, + serializer +}; + +const getOperationSpec: msRest.OperationSpec = { + httpMethod: "GET", + path: "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/certificates/{name}", + urlParameters: [ + Parameters.resourceGroupName, + Parameters.name, + Parameters.subscriptionId + ], + queryParameters: [ + Parameters.apiVersion + ], + headerParameters: [ + Parameters.acceptLanguage + ], + responses: { + 200: { + bodyMapper: Mappers.Certificate + }, + default: { + bodyMapper: Mappers.DefaultErrorResponse + } + }, + serializer +}; + +const createOrUpdateOperationSpec: msRest.OperationSpec = { + httpMethod: "PUT", + path: "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/certificates/{name}", + urlParameters: [ + Parameters.resourceGroupName, + Parameters.name, + Parameters.subscriptionId + ], + queryParameters: [ + Parameters.apiVersion + ], + headerParameters: [ + Parameters.acceptLanguage + ], + requestBody: { + parameterPath: "certificateEnvelope", + mapper: { + ...Mappers.Certificate, + required: true + } + }, + responses: { + 200: { + bodyMapper: Mappers.Certificate + }, + default: { + bodyMapper: Mappers.DefaultErrorResponse + } + }, + serializer +}; + +const deleteMethodOperationSpec: msRest.OperationSpec = { + httpMethod: "DELETE", + path: "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/certificates/{name}", + urlParameters: [ + Parameters.resourceGroupName, + Parameters.name, + Parameters.subscriptionId + ], + queryParameters: [ + Parameters.apiVersion + ], + headerParameters: [ + Parameters.acceptLanguage + ], + responses: { + 200: {}, + 204: {}, + default: { + bodyMapper: Mappers.CloudError + } + }, + serializer +}; + +const updateOperationSpec: msRest.OperationSpec = { + httpMethod: "PATCH", + path: "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/certificates/{name}", + urlParameters: [ + Parameters.resourceGroupName, + Parameters.name, + Parameters.subscriptionId + ], + queryParameters: [ + Parameters.apiVersion + ], + headerParameters: [ + Parameters.acceptLanguage + ], + requestBody: { + parameterPath: "certificateEnvelope", + mapper: { + ...Mappers.CertificatePatchResource, + required: true + } + }, + responses: { + 200: { + bodyMapper: Mappers.Certificate + }, + default: { + bodyMapper: Mappers.DefaultErrorResponse + } + }, + serializer +}; + +const listNextOperationSpec: msRest.OperationSpec = { + httpMethod: "GET", + baseUrl: "https://management.azure.com", + path: "{nextLink}", + urlParameters: [ + Parameters.nextPageLink + ], + headerParameters: [ + Parameters.acceptLanguage + ], + responses: { + 200: { + bodyMapper: Mappers.CertificateCollection + }, + default: { + bodyMapper: Mappers.DefaultErrorResponse + } + }, + serializer +}; + +const listByResourceGroupNextOperationSpec: msRest.OperationSpec = { + httpMethod: "GET", + baseUrl: "https://management.azure.com", + path: "{nextLink}", + urlParameters: [ + Parameters.nextPageLink + ], + headerParameters: [ + Parameters.acceptLanguage + ], + responses: { + 200: { + bodyMapper: Mappers.CertificateCollection + }, + default: { + bodyMapper: Mappers.DefaultErrorResponse + } + }, + serializer +}; diff --git a/sdk/appservice/arm-appservice-profile-2019-03-01-hybrid/src/operations/index.ts b/sdk/appservice/arm-appservice-profile-2019-03-01-hybrid/src/operations/index.ts new file mode 100644 index 000000000000..47516158b8d8 --- /dev/null +++ b/sdk/appservice/arm-appservice-profile-2019-03-01-hybrid/src/operations/index.ts @@ -0,0 +1,15 @@ +/* + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +export * from "./certificates"; +export * from "./webApps"; +export * from "./appServicePlans"; +export * from "./provider"; +export * from "./recommendations"; diff --git a/sdk/appservice/arm-appservice-profile-2019-03-01-hybrid/src/operations/provider.ts b/sdk/appservice/arm-appservice-profile-2019-03-01-hybrid/src/operations/provider.ts new file mode 100644 index 000000000000..9d215720c1b2 --- /dev/null +++ b/sdk/appservice/arm-appservice-profile-2019-03-01-hybrid/src/operations/provider.ts @@ -0,0 +1,324 @@ +/* + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * 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 * as msRest from "@azure/ms-rest-js"; +import * as Models from "../models"; +import * as Mappers from "../models/providerMappers"; +import * as Parameters from "../models/parameters"; +import { WebSiteManagementClientContext } from "../webSiteManagementClientContext"; + +/** Class representing a Provider. */ +export class Provider { + private readonly client: WebSiteManagementClientContext; + + /** + * Create a Provider. + * @param {WebSiteManagementClientContext} client Reference to the service client. + */ + constructor(client: WebSiteManagementClientContext) { + this.client = client; + } + + /** + * Get available application frameworks and their versions + * @summary Get available application frameworks and their versions + * @param [options] The optional parameters + * @returns Promise + */ + getAvailableStacks(options?: Models.ProviderGetAvailableStacksOptionalParams): Promise; + /** + * @param callback The callback + */ + getAvailableStacks(callback: msRest.ServiceCallback): void; + /** + * @param options The optional parameters + * @param callback The callback + */ + getAvailableStacks(options: Models.ProviderGetAvailableStacksOptionalParams, callback: msRest.ServiceCallback): void; + getAvailableStacks(options?: Models.ProviderGetAvailableStacksOptionalParams | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { + return this.client.sendOperationRequest( + { + options + }, + getAvailableStacksOperationSpec, + callback) as Promise; + } + + /** + * Gets all available operations for the Microsoft.Web resource provider. Also exposes resource + * metric definitions + * @summary Gets all available operations for the Microsoft.Web resource provider. Also exposes + * resource metric definitions + * @param [options] The optional parameters + * @returns Promise + */ + listOperations(options?: msRest.RequestOptionsBase): Promise; + /** + * @param callback The callback + */ + listOperations(callback: msRest.ServiceCallback): void; + /** + * @param options The optional parameters + * @param callback The callback + */ + listOperations(options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; + listOperations(options?: msRest.RequestOptionsBase | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { + return this.client.sendOperationRequest( + { + options + }, + listOperationsOperationSpec, + callback) as Promise; + } + + /** + * Get available application frameworks and their versions + * @summary Get available application frameworks and their versions + * @param [options] The optional parameters + * @returns Promise + */ + getAvailableStacksOnPrem(options?: Models.ProviderGetAvailableStacksOnPremOptionalParams): Promise; + /** + * @param callback The callback + */ + getAvailableStacksOnPrem(callback: msRest.ServiceCallback): void; + /** + * @param options The optional parameters + * @param callback The callback + */ + getAvailableStacksOnPrem(options: Models.ProviderGetAvailableStacksOnPremOptionalParams, callback: msRest.ServiceCallback): void; + getAvailableStacksOnPrem(options?: Models.ProviderGetAvailableStacksOnPremOptionalParams | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { + return this.client.sendOperationRequest( + { + options + }, + getAvailableStacksOnPremOperationSpec, + callback) as Promise; + } + + /** + * Get available application frameworks and their versions + * @summary Get available application frameworks and their versions + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @param [options] The optional parameters + * @returns Promise + */ + getAvailableStacksNext(nextPageLink: string, options?: msRest.RequestOptionsBase): Promise; + /** + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @param callback The callback + */ + getAvailableStacksNext(nextPageLink: string, callback: msRest.ServiceCallback): void; + /** + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @param options The optional parameters + * @param callback The callback + */ + getAvailableStacksNext(nextPageLink: string, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; + getAvailableStacksNext(nextPageLink: string, options?: msRest.RequestOptionsBase | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { + return this.client.sendOperationRequest( + { + nextPageLink, + options + }, + getAvailableStacksNextOperationSpec, + callback) as Promise; + } + + /** + * Gets all available operations for the Microsoft.Web resource provider. Also exposes resource + * metric definitions + * @summary Gets all available operations for the Microsoft.Web resource provider. Also exposes + * resource metric definitions + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @param [options] The optional parameters + * @returns Promise + */ + listOperationsNext(nextPageLink: string, options?: msRest.RequestOptionsBase): Promise; + /** + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @param callback The callback + */ + listOperationsNext(nextPageLink: string, callback: msRest.ServiceCallback): void; + /** + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @param options The optional parameters + * @param callback The callback + */ + listOperationsNext(nextPageLink: string, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; + listOperationsNext(nextPageLink: string, options?: msRest.RequestOptionsBase | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { + return this.client.sendOperationRequest( + { + nextPageLink, + options + }, + listOperationsNextOperationSpec, + callback) as Promise; + } + + /** + * Get available application frameworks and their versions + * @summary Get available application frameworks and their versions + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @param [options] The optional parameters + * @returns Promise + */ + getAvailableStacksOnPremNext(nextPageLink: string, options?: msRest.RequestOptionsBase): Promise; + /** + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @param callback The callback + */ + getAvailableStacksOnPremNext(nextPageLink: string, callback: msRest.ServiceCallback): void; + /** + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @param options The optional parameters + * @param callback The callback + */ + getAvailableStacksOnPremNext(nextPageLink: string, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; + getAvailableStacksOnPremNext(nextPageLink: string, options?: msRest.RequestOptionsBase | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { + return this.client.sendOperationRequest( + { + nextPageLink, + options + }, + getAvailableStacksOnPremNextOperationSpec, + callback) as Promise; + } +} + +// Operation Specifications +const serializer = new msRest.Serializer(Mappers); +const getAvailableStacksOperationSpec: msRest.OperationSpec = { + httpMethod: "GET", + path: "providers/Microsoft.Web/availableStacks", + queryParameters: [ + Parameters.osTypeSelected, + Parameters.apiVersion + ], + headerParameters: [ + Parameters.acceptLanguage + ], + responses: { + 200: { + bodyMapper: Mappers.ApplicationStackCollection + }, + default: { + bodyMapper: Mappers.DefaultErrorResponse + } + }, + serializer +}; + +const listOperationsOperationSpec: msRest.OperationSpec = { + httpMethod: "GET", + path: "providers/Microsoft.Web/operations", + queryParameters: [ + Parameters.apiVersion + ], + headerParameters: [ + Parameters.acceptLanguage + ], + responses: { + 200: { + bodyMapper: Mappers.CsmOperationCollection + }, + default: { + bodyMapper: Mappers.DefaultErrorResponse + } + }, + serializer +}; + +const getAvailableStacksOnPremOperationSpec: msRest.OperationSpec = { + httpMethod: "GET", + path: "subscriptions/{subscriptionId}/providers/Microsoft.Web/availableStacks", + urlParameters: [ + Parameters.subscriptionId + ], + queryParameters: [ + Parameters.osTypeSelected, + Parameters.apiVersion + ], + headerParameters: [ + Parameters.acceptLanguage + ], + responses: { + 200: { + bodyMapper: Mappers.ApplicationStackCollection + }, + default: { + bodyMapper: Mappers.DefaultErrorResponse + } + }, + serializer +}; + +const getAvailableStacksNextOperationSpec: msRest.OperationSpec = { + httpMethod: "GET", + baseUrl: "https://management.azure.com", + path: "{nextLink}", + urlParameters: [ + Parameters.nextPageLink + ], + headerParameters: [ + Parameters.acceptLanguage + ], + responses: { + 200: { + bodyMapper: Mappers.ApplicationStackCollection + }, + default: { + bodyMapper: Mappers.DefaultErrorResponse + } + }, + serializer +}; + +const listOperationsNextOperationSpec: msRest.OperationSpec = { + httpMethod: "GET", + baseUrl: "https://management.azure.com", + path: "{nextLink}", + urlParameters: [ + Parameters.nextPageLink + ], + headerParameters: [ + Parameters.acceptLanguage + ], + responses: { + 200: { + bodyMapper: Mappers.CsmOperationCollection + }, + default: { + bodyMapper: Mappers.DefaultErrorResponse + } + }, + serializer +}; + +const getAvailableStacksOnPremNextOperationSpec: msRest.OperationSpec = { + httpMethod: "GET", + baseUrl: "https://management.azure.com", + path: "{nextLink}", + urlParameters: [ + Parameters.nextPageLink + ], + headerParameters: [ + Parameters.acceptLanguage + ], + responses: { + 200: { + bodyMapper: Mappers.ApplicationStackCollection + }, + default: { + bodyMapper: Mappers.DefaultErrorResponse + } + }, + serializer +}; diff --git a/sdk/appservice/arm-appservice-profile-2019-03-01-hybrid/src/operations/recommendations.ts b/sdk/appservice/arm-appservice-profile-2019-03-01-hybrid/src/operations/recommendations.ts new file mode 100644 index 000000000000..80273155c223 --- /dev/null +++ b/sdk/appservice/arm-appservice-profile-2019-03-01-hybrid/src/operations/recommendations.ts @@ -0,0 +1,1158 @@ +/* + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * 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 * as msRest from "@azure/ms-rest-js"; +import * as Models from "../models"; +import * as Mappers from "../models/recommendationsMappers"; +import * as Parameters from "../models/parameters"; +import { WebSiteManagementClientContext } from "../webSiteManagementClientContext"; + +/** Class representing a Recommendations. */ +export class Recommendations { + private readonly client: WebSiteManagementClientContext; + + /** + * Create a Recommendations. + * @param {WebSiteManagementClientContext} client Reference to the service client. + */ + constructor(client: WebSiteManagementClientContext) { + this.client = client; + } + + /** + * List all recommendations for a subscription. + * @summary List all recommendations for a subscription. + * @param [options] The optional parameters + * @returns Promise + */ + list(options?: Models.RecommendationsListOptionalParams): Promise; + /** + * @param callback The callback + */ + list(callback: msRest.ServiceCallback): void; + /** + * @param options The optional parameters + * @param callback The callback + */ + list(options: Models.RecommendationsListOptionalParams, callback: msRest.ServiceCallback): void; + list(options?: Models.RecommendationsListOptionalParams | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { + return this.client.sendOperationRequest( + { + options + }, + listOperationSpec, + callback) as Promise; + } + + /** + * Reset all recommendation opt-out settings for a subscription. + * @summary Reset all recommendation opt-out settings for a subscription. + * @param [options] The optional parameters + * @returns Promise + */ + resetAllFilters(options?: msRest.RequestOptionsBase): Promise; + /** + * @param callback The callback + */ + resetAllFilters(callback: msRest.ServiceCallback): void; + /** + * @param options The optional parameters + * @param callback The callback + */ + resetAllFilters(options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; + resetAllFilters(options?: msRest.RequestOptionsBase | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { + return this.client.sendOperationRequest( + { + options + }, + resetAllFiltersOperationSpec, + callback); + } + + /** + * Disables the specified rule so it will not apply to a subscription in the future. + * @summary Disables the specified rule so it will not apply to a subscription in the future. + * @param name Rule name + * @param [options] The optional parameters + * @returns Promise + */ + disableRecommendationForSubscription(name: string, options?: msRest.RequestOptionsBase): Promise; + /** + * @param name Rule name + * @param callback The callback + */ + disableRecommendationForSubscription(name: string, callback: msRest.ServiceCallback): void; + /** + * @param name Rule name + * @param options The optional parameters + * @param callback The callback + */ + disableRecommendationForSubscription(name: string, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; + disableRecommendationForSubscription(name: string, options?: msRest.RequestOptionsBase | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { + return this.client.sendOperationRequest( + { + name, + options + }, + disableRecommendationForSubscriptionOperationSpec, + callback); + } + + /** + * Get past recommendations for an app, optionally specified by the time range. + * @summary Get past recommendations for an app, optionally specified by the time range. + * @param resourceGroupName Name of the resource group to which the resource belongs. + * @param hostingEnvironmentName Name of the hosting environment. + * @param [options] The optional parameters + * @returns Promise + */ + listHistoryForHostingEnvironment(resourceGroupName: string, hostingEnvironmentName: string, options?: Models.RecommendationsListHistoryForHostingEnvironmentOptionalParams): Promise; + /** + * @param resourceGroupName Name of the resource group to which the resource belongs. + * @param hostingEnvironmentName Name of the hosting environment. + * @param callback The callback + */ + listHistoryForHostingEnvironment(resourceGroupName: string, hostingEnvironmentName: string, callback: msRest.ServiceCallback): void; + /** + * @param resourceGroupName Name of the resource group to which the resource belongs. + * @param hostingEnvironmentName Name of the hosting environment. + * @param options The optional parameters + * @param callback The callback + */ + listHistoryForHostingEnvironment(resourceGroupName: string, hostingEnvironmentName: string, options: Models.RecommendationsListHistoryForHostingEnvironmentOptionalParams, callback: msRest.ServiceCallback): void; + listHistoryForHostingEnvironment(resourceGroupName: string, hostingEnvironmentName: string, options?: Models.RecommendationsListHistoryForHostingEnvironmentOptionalParams | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { + return this.client.sendOperationRequest( + { + resourceGroupName, + hostingEnvironmentName, + options + }, + listHistoryForHostingEnvironmentOperationSpec, + callback) as Promise; + } + + /** + * Get all recommendations for an app. + * @summary Get all recommendations for an app. + * @param resourceGroupName Name of the resource group to which the resource belongs. + * @param hostingEnvironmentName Name of the app. + * @param [options] The optional parameters + * @returns Promise + */ + listRecommendedRulesForHostingEnvironment(resourceGroupName: string, hostingEnvironmentName: string, options?: Models.RecommendationsListRecommendedRulesForHostingEnvironmentOptionalParams): Promise; + /** + * @param resourceGroupName Name of the resource group to which the resource belongs. + * @param hostingEnvironmentName Name of the app. + * @param callback The callback + */ + listRecommendedRulesForHostingEnvironment(resourceGroupName: string, hostingEnvironmentName: string, callback: msRest.ServiceCallback): void; + /** + * @param resourceGroupName Name of the resource group to which the resource belongs. + * @param hostingEnvironmentName Name of the app. + * @param options The optional parameters + * @param callback The callback + */ + listRecommendedRulesForHostingEnvironment(resourceGroupName: string, hostingEnvironmentName: string, options: Models.RecommendationsListRecommendedRulesForHostingEnvironmentOptionalParams, callback: msRest.ServiceCallback): void; + listRecommendedRulesForHostingEnvironment(resourceGroupName: string, hostingEnvironmentName: string, options?: Models.RecommendationsListRecommendedRulesForHostingEnvironmentOptionalParams | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { + return this.client.sendOperationRequest( + { + resourceGroupName, + hostingEnvironmentName, + options + }, + listRecommendedRulesForHostingEnvironmentOperationSpec, + callback) as Promise; + } + + /** + * Disable all recommendations for an app. + * @summary Disable all recommendations for an app. + * @param resourceGroupName Name of the resource group to which the resource belongs. + * @param environmentName Name of the app. + * @param hostingEnvironmentName + * @param [options] The optional parameters + * @returns Promise + */ + disableAllForHostingEnvironment(resourceGroupName: string, environmentName: string, hostingEnvironmentName: string, options?: msRest.RequestOptionsBase): Promise; + /** + * @param resourceGroupName Name of the resource group to which the resource belongs. + * @param environmentName Name of the app. + * @param hostingEnvironmentName + * @param callback The callback + */ + disableAllForHostingEnvironment(resourceGroupName: string, environmentName: string, hostingEnvironmentName: string, callback: msRest.ServiceCallback): void; + /** + * @param resourceGroupName Name of the resource group to which the resource belongs. + * @param environmentName Name of the app. + * @param hostingEnvironmentName + * @param options The optional parameters + * @param callback The callback + */ + disableAllForHostingEnvironment(resourceGroupName: string, environmentName: string, hostingEnvironmentName: string, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; + disableAllForHostingEnvironment(resourceGroupName: string, environmentName: string, hostingEnvironmentName: string, options?: msRest.RequestOptionsBase | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { + return this.client.sendOperationRequest( + { + resourceGroupName, + environmentName, + hostingEnvironmentName, + options + }, + disableAllForHostingEnvironmentOperationSpec, + callback); + } + + /** + * Reset all recommendation opt-out settings for an app. + * @summary Reset all recommendation opt-out settings for an app. + * @param resourceGroupName Name of the resource group to which the resource belongs. + * @param environmentName Name of the app. + * @param hostingEnvironmentName + * @param [options] The optional parameters + * @returns Promise + */ + resetAllFiltersForHostingEnvironment(resourceGroupName: string, environmentName: string, hostingEnvironmentName: string, options?: msRest.RequestOptionsBase): Promise; + /** + * @param resourceGroupName Name of the resource group to which the resource belongs. + * @param environmentName Name of the app. + * @param hostingEnvironmentName + * @param callback The callback + */ + resetAllFiltersForHostingEnvironment(resourceGroupName: string, environmentName: string, hostingEnvironmentName: string, callback: msRest.ServiceCallback): void; + /** + * @param resourceGroupName Name of the resource group to which the resource belongs. + * @param environmentName Name of the app. + * @param hostingEnvironmentName + * @param options The optional parameters + * @param callback The callback + */ + resetAllFiltersForHostingEnvironment(resourceGroupName: string, environmentName: string, hostingEnvironmentName: string, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; + resetAllFiltersForHostingEnvironment(resourceGroupName: string, environmentName: string, hostingEnvironmentName: string, options?: msRest.RequestOptionsBase | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { + return this.client.sendOperationRequest( + { + resourceGroupName, + environmentName, + hostingEnvironmentName, + options + }, + resetAllFiltersForHostingEnvironmentOperationSpec, + callback); + } + + /** + * Get a recommendation rule for an app. + * @summary Get a recommendation rule for an app. + * @param resourceGroupName Name of the resource group to which the resource belongs. + * @param hostingEnvironmentName Name of the hosting environment. + * @param name Name of the recommendation. + * @param [options] The optional parameters + * @returns Promise + */ + getRuleDetailsByHostingEnvironment(resourceGroupName: string, hostingEnvironmentName: string, name: string, options?: Models.RecommendationsGetRuleDetailsByHostingEnvironmentOptionalParams): Promise; + /** + * @param resourceGroupName Name of the resource group to which the resource belongs. + * @param hostingEnvironmentName Name of the hosting environment. + * @param name Name of the recommendation. + * @param callback The callback + */ + getRuleDetailsByHostingEnvironment(resourceGroupName: string, hostingEnvironmentName: string, name: string, callback: msRest.ServiceCallback): void; + /** + * @param resourceGroupName Name of the resource group to which the resource belongs. + * @param hostingEnvironmentName Name of the hosting environment. + * @param name Name of the recommendation. + * @param options The optional parameters + * @param callback The callback + */ + getRuleDetailsByHostingEnvironment(resourceGroupName: string, hostingEnvironmentName: string, name: string, options: Models.RecommendationsGetRuleDetailsByHostingEnvironmentOptionalParams, callback: msRest.ServiceCallback): void; + getRuleDetailsByHostingEnvironment(resourceGroupName: string, hostingEnvironmentName: string, name: string, options?: Models.RecommendationsGetRuleDetailsByHostingEnvironmentOptionalParams | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { + return this.client.sendOperationRequest( + { + resourceGroupName, + hostingEnvironmentName, + name, + options + }, + getRuleDetailsByHostingEnvironmentOperationSpec, + callback) as Promise; + } + + /** + * Disables the specific rule for a web site permanently. + * @summary Disables the specific rule for a web site permanently. + * @param resourceGroupName Name of the resource group to which the resource belongs. + * @param environmentName Site name + * @param name Rule name + * @param hostingEnvironmentName + * @param [options] The optional parameters + * @returns Promise + */ + disableRecommendationForHostingEnvironment(resourceGroupName: string, environmentName: string, name: string, hostingEnvironmentName: string, options?: msRest.RequestOptionsBase): Promise; + /** + * @param resourceGroupName Name of the resource group to which the resource belongs. + * @param environmentName Site name + * @param name Rule name + * @param hostingEnvironmentName + * @param callback The callback + */ + disableRecommendationForHostingEnvironment(resourceGroupName: string, environmentName: string, name: string, hostingEnvironmentName: string, callback: msRest.ServiceCallback): void; + /** + * @param resourceGroupName Name of the resource group to which the resource belongs. + * @param environmentName Site name + * @param name Rule name + * @param hostingEnvironmentName + * @param options The optional parameters + * @param callback The callback + */ + disableRecommendationForHostingEnvironment(resourceGroupName: string, environmentName: string, name: string, hostingEnvironmentName: string, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; + disableRecommendationForHostingEnvironment(resourceGroupName: string, environmentName: string, name: string, hostingEnvironmentName: string, options?: msRest.RequestOptionsBase | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { + return this.client.sendOperationRequest( + { + resourceGroupName, + environmentName, + name, + hostingEnvironmentName, + options + }, + disableRecommendationForHostingEnvironmentOperationSpec, + callback); + } + + /** + * Get past recommendations for an app, optionally specified by the time range. + * @summary Get past recommendations for an app, optionally specified by the time range. + * @param resourceGroupName Name of the resource group to which the resource belongs. + * @param siteName Name of the app. + * @param [options] The optional parameters + * @returns Promise + */ + listHistoryForWebApp(resourceGroupName: string, siteName: string, options?: Models.RecommendationsListHistoryForWebAppOptionalParams): Promise; + /** + * @param resourceGroupName Name of the resource group to which the resource belongs. + * @param siteName Name of the app. + * @param callback The callback + */ + listHistoryForWebApp(resourceGroupName: string, siteName: string, callback: msRest.ServiceCallback): void; + /** + * @param resourceGroupName Name of the resource group to which the resource belongs. + * @param siteName Name of the app. + * @param options The optional parameters + * @param callback The callback + */ + listHistoryForWebApp(resourceGroupName: string, siteName: string, options: Models.RecommendationsListHistoryForWebAppOptionalParams, callback: msRest.ServiceCallback): void; + listHistoryForWebApp(resourceGroupName: string, siteName: string, options?: Models.RecommendationsListHistoryForWebAppOptionalParams | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { + return this.client.sendOperationRequest( + { + resourceGroupName, + siteName, + options + }, + listHistoryForWebAppOperationSpec, + callback) as Promise; + } + + /** + * Get all recommendations for an app. + * @summary Get all recommendations for an app. + * @param resourceGroupName Name of the resource group to which the resource belongs. + * @param siteName Name of the app. + * @param [options] The optional parameters + * @returns Promise + */ + listRecommendedRulesForWebApp(resourceGroupName: string, siteName: string, options?: Models.RecommendationsListRecommendedRulesForWebAppOptionalParams): Promise; + /** + * @param resourceGroupName Name of the resource group to which the resource belongs. + * @param siteName Name of the app. + * @param callback The callback + */ + listRecommendedRulesForWebApp(resourceGroupName: string, siteName: string, callback: msRest.ServiceCallback): void; + /** + * @param resourceGroupName Name of the resource group to which the resource belongs. + * @param siteName Name of the app. + * @param options The optional parameters + * @param callback The callback + */ + listRecommendedRulesForWebApp(resourceGroupName: string, siteName: string, options: Models.RecommendationsListRecommendedRulesForWebAppOptionalParams, callback: msRest.ServiceCallback): void; + listRecommendedRulesForWebApp(resourceGroupName: string, siteName: string, options?: Models.RecommendationsListRecommendedRulesForWebAppOptionalParams | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { + return this.client.sendOperationRequest( + { + resourceGroupName, + siteName, + options + }, + listRecommendedRulesForWebAppOperationSpec, + callback) as Promise; + } + + /** + * Disable all recommendations for an app. + * @summary Disable all recommendations for an app. + * @param resourceGroupName Name of the resource group to which the resource belongs. + * @param siteName Name of the app. + * @param [options] The optional parameters + * @returns Promise + */ + disableAllForWebApp(resourceGroupName: string, siteName: string, options?: msRest.RequestOptionsBase): Promise; + /** + * @param resourceGroupName Name of the resource group to which the resource belongs. + * @param siteName Name of the app. + * @param callback The callback + */ + disableAllForWebApp(resourceGroupName: string, siteName: string, callback: msRest.ServiceCallback): void; + /** + * @param resourceGroupName Name of the resource group to which the resource belongs. + * @param siteName Name of the app. + * @param options The optional parameters + * @param callback The callback + */ + disableAllForWebApp(resourceGroupName: string, siteName: string, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; + disableAllForWebApp(resourceGroupName: string, siteName: string, options?: msRest.RequestOptionsBase | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { + return this.client.sendOperationRequest( + { + resourceGroupName, + siteName, + options + }, + disableAllForWebAppOperationSpec, + callback); + } + + /** + * Reset all recommendation opt-out settings for an app. + * @summary Reset all recommendation opt-out settings for an app. + * @param resourceGroupName Name of the resource group to which the resource belongs. + * @param siteName Name of the app. + * @param [options] The optional parameters + * @returns Promise + */ + resetAllFiltersForWebApp(resourceGroupName: string, siteName: string, options?: msRest.RequestOptionsBase): Promise; + /** + * @param resourceGroupName Name of the resource group to which the resource belongs. + * @param siteName Name of the app. + * @param callback The callback + */ + resetAllFiltersForWebApp(resourceGroupName: string, siteName: string, callback: msRest.ServiceCallback): void; + /** + * @param resourceGroupName Name of the resource group to which the resource belongs. + * @param siteName Name of the app. + * @param options The optional parameters + * @param callback The callback + */ + resetAllFiltersForWebApp(resourceGroupName: string, siteName: string, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; + resetAllFiltersForWebApp(resourceGroupName: string, siteName: string, options?: msRest.RequestOptionsBase | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { + return this.client.sendOperationRequest( + { + resourceGroupName, + siteName, + options + }, + resetAllFiltersForWebAppOperationSpec, + callback); + } + + /** + * Get a recommendation rule for an app. + * @summary Get a recommendation rule for an app. + * @param resourceGroupName Name of the resource group to which the resource belongs. + * @param siteName Name of the app. + * @param name Name of the recommendation. + * @param [options] The optional parameters + * @returns Promise + */ + getRuleDetailsByWebApp(resourceGroupName: string, siteName: string, name: string, options?: Models.RecommendationsGetRuleDetailsByWebAppOptionalParams): Promise; + /** + * @param resourceGroupName Name of the resource group to which the resource belongs. + * @param siteName Name of the app. + * @param name Name of the recommendation. + * @param callback The callback + */ + getRuleDetailsByWebApp(resourceGroupName: string, siteName: string, name: string, callback: msRest.ServiceCallback): void; + /** + * @param resourceGroupName Name of the resource group to which the resource belongs. + * @param siteName Name of the app. + * @param name Name of the recommendation. + * @param options The optional parameters + * @param callback The callback + */ + getRuleDetailsByWebApp(resourceGroupName: string, siteName: string, name: string, options: Models.RecommendationsGetRuleDetailsByWebAppOptionalParams, callback: msRest.ServiceCallback): void; + getRuleDetailsByWebApp(resourceGroupName: string, siteName: string, name: string, options?: Models.RecommendationsGetRuleDetailsByWebAppOptionalParams | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { + return this.client.sendOperationRequest( + { + resourceGroupName, + siteName, + name, + options + }, + getRuleDetailsByWebAppOperationSpec, + callback) as Promise; + } + + /** + * Disables the specific rule for a web site permanently. + * @summary Disables the specific rule for a web site permanently. + * @param resourceGroupName Name of the resource group to which the resource belongs. + * @param siteName Site name + * @param name Rule name + * @param [options] The optional parameters + * @returns Promise + */ + disableRecommendationForSite(resourceGroupName: string, siteName: string, name: string, options?: msRest.RequestOptionsBase): Promise; + /** + * @param resourceGroupName Name of the resource group to which the resource belongs. + * @param siteName Site name + * @param name Rule name + * @param callback The callback + */ + disableRecommendationForSite(resourceGroupName: string, siteName: string, name: string, callback: msRest.ServiceCallback): void; + /** + * @param resourceGroupName Name of the resource group to which the resource belongs. + * @param siteName Site name + * @param name Rule name + * @param options The optional parameters + * @param callback The callback + */ + disableRecommendationForSite(resourceGroupName: string, siteName: string, name: string, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; + disableRecommendationForSite(resourceGroupName: string, siteName: string, name: string, options?: msRest.RequestOptionsBase | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { + return this.client.sendOperationRequest( + { + resourceGroupName, + siteName, + name, + options + }, + disableRecommendationForSiteOperationSpec, + callback); + } + + /** + * List all recommendations for a subscription. + * @summary List all recommendations for a subscription. + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @param [options] The optional parameters + * @returns Promise + */ + listNext(nextPageLink: string, options?: msRest.RequestOptionsBase): Promise; + /** + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @param callback The callback + */ + listNext(nextPageLink: string, callback: msRest.ServiceCallback): void; + /** + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @param options The optional parameters + * @param callback The callback + */ + listNext(nextPageLink: string, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; + listNext(nextPageLink: string, options?: msRest.RequestOptionsBase | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { + return this.client.sendOperationRequest( + { + nextPageLink, + options + }, + listNextOperationSpec, + callback) as Promise; + } + + /** + * Get past recommendations for an app, optionally specified by the time range. + * @summary Get past recommendations for an app, optionally specified by the time range. + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @param [options] The optional parameters + * @returns Promise + */ + listHistoryForHostingEnvironmentNext(nextPageLink: string, options?: msRest.RequestOptionsBase): Promise; + /** + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @param callback The callback + */ + listHistoryForHostingEnvironmentNext(nextPageLink: string, callback: msRest.ServiceCallback): void; + /** + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @param options The optional parameters + * @param callback The callback + */ + listHistoryForHostingEnvironmentNext(nextPageLink: string, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; + listHistoryForHostingEnvironmentNext(nextPageLink: string, options?: msRest.RequestOptionsBase | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { + return this.client.sendOperationRequest( + { + nextPageLink, + options + }, + listHistoryForHostingEnvironmentNextOperationSpec, + callback) as Promise; + } + + /** + * Get all recommendations for an app. + * @summary Get all recommendations for an app. + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @param [options] The optional parameters + * @returns Promise + */ + listRecommendedRulesForHostingEnvironmentNext(nextPageLink: string, options?: msRest.RequestOptionsBase): Promise; + /** + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @param callback The callback + */ + listRecommendedRulesForHostingEnvironmentNext(nextPageLink: string, callback: msRest.ServiceCallback): void; + /** + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @param options The optional parameters + * @param callback The callback + */ + listRecommendedRulesForHostingEnvironmentNext(nextPageLink: string, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; + listRecommendedRulesForHostingEnvironmentNext(nextPageLink: string, options?: msRest.RequestOptionsBase | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { + return this.client.sendOperationRequest( + { + nextPageLink, + options + }, + listRecommendedRulesForHostingEnvironmentNextOperationSpec, + callback) as Promise; + } + + /** + * Get past recommendations for an app, optionally specified by the time range. + * @summary Get past recommendations for an app, optionally specified by the time range. + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @param [options] The optional parameters + * @returns Promise + */ + listHistoryForWebAppNext(nextPageLink: string, options?: msRest.RequestOptionsBase): Promise; + /** + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @param callback The callback + */ + listHistoryForWebAppNext(nextPageLink: string, callback: msRest.ServiceCallback): void; + /** + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @param options The optional parameters + * @param callback The callback + */ + listHistoryForWebAppNext(nextPageLink: string, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; + listHistoryForWebAppNext(nextPageLink: string, options?: msRest.RequestOptionsBase | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { + return this.client.sendOperationRequest( + { + nextPageLink, + options + }, + listHistoryForWebAppNextOperationSpec, + callback) as Promise; + } + + /** + * Get all recommendations for an app. + * @summary Get all recommendations for an app. + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @param [options] The optional parameters + * @returns Promise + */ + listRecommendedRulesForWebAppNext(nextPageLink: string, options?: msRest.RequestOptionsBase): Promise; + /** + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @param callback The callback + */ + listRecommendedRulesForWebAppNext(nextPageLink: string, callback: msRest.ServiceCallback): void; + /** + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @param options The optional parameters + * @param callback The callback + */ + listRecommendedRulesForWebAppNext(nextPageLink: string, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; + listRecommendedRulesForWebAppNext(nextPageLink: string, options?: msRest.RequestOptionsBase | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { + return this.client.sendOperationRequest( + { + nextPageLink, + options + }, + listRecommendedRulesForWebAppNextOperationSpec, + callback) as Promise; + } +} + +// Operation Specifications +const serializer = new msRest.Serializer(Mappers); +const listOperationSpec: msRest.OperationSpec = { + httpMethod: "GET", + path: "subscriptions/{subscriptionId}/providers/Microsoft.Web/recommendations", + urlParameters: [ + Parameters.subscriptionId + ], + queryParameters: [ + Parameters.featured, + Parameters.filter, + Parameters.apiVersion + ], + headerParameters: [ + Parameters.acceptLanguage + ], + responses: { + 200: { + bodyMapper: Mappers.RecommendationCollection + }, + default: { + bodyMapper: Mappers.DefaultErrorResponse + } + }, + serializer +}; + +const resetAllFiltersOperationSpec: msRest.OperationSpec = { + httpMethod: "POST", + path: "subscriptions/{subscriptionId}/providers/Microsoft.Web/recommendations/reset", + urlParameters: [ + Parameters.subscriptionId + ], + queryParameters: [ + Parameters.apiVersion + ], + headerParameters: [ + Parameters.acceptLanguage + ], + responses: { + 204: {}, + default: { + bodyMapper: Mappers.CloudError + } + }, + serializer +}; + +const disableRecommendationForSubscriptionOperationSpec: msRest.OperationSpec = { + httpMethod: "POST", + path: "subscriptions/{subscriptionId}/providers/Microsoft.Web/recommendations/{name}/disable", + urlParameters: [ + Parameters.name, + Parameters.subscriptionId + ], + queryParameters: [ + Parameters.apiVersion + ], + headerParameters: [ + Parameters.acceptLanguage + ], + responses: { + 200: {}, + default: { + bodyMapper: Mappers.CloudError + } + }, + serializer +}; + +const listHistoryForHostingEnvironmentOperationSpec: msRest.OperationSpec = { + httpMethod: "GET", + path: "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/hostingEnvironments/{hostingEnvironmentName}/recommendationHistory", + urlParameters: [ + Parameters.resourceGroupName, + Parameters.hostingEnvironmentName, + Parameters.subscriptionId + ], + queryParameters: [ + Parameters.expiredOnly, + Parameters.filter, + Parameters.apiVersion + ], + headerParameters: [ + Parameters.acceptLanguage + ], + responses: { + 200: { + bodyMapper: Mappers.RecommendationCollection + }, + default: { + bodyMapper: Mappers.DefaultErrorResponse + } + }, + serializer +}; + +const listRecommendedRulesForHostingEnvironmentOperationSpec: msRest.OperationSpec = { + httpMethod: "GET", + path: "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/hostingEnvironments/{hostingEnvironmentName}/recommendations", + urlParameters: [ + Parameters.resourceGroupName, + Parameters.hostingEnvironmentName, + Parameters.subscriptionId + ], + queryParameters: [ + Parameters.featured, + Parameters.filter, + Parameters.apiVersion + ], + headerParameters: [ + Parameters.acceptLanguage + ], + responses: { + 200: { + bodyMapper: Mappers.RecommendationCollection + }, + default: { + bodyMapper: Mappers.DefaultErrorResponse + } + }, + serializer +}; + +const disableAllForHostingEnvironmentOperationSpec: msRest.OperationSpec = { + httpMethod: "POST", + path: "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/hostingEnvironments/{hostingEnvironmentName}/recommendations/disable", + urlParameters: [ + Parameters.resourceGroupName, + Parameters.hostingEnvironmentName, + Parameters.subscriptionId + ], + queryParameters: [ + Parameters.environmentName, + Parameters.apiVersion + ], + headerParameters: [ + Parameters.acceptLanguage + ], + responses: { + 204: {}, + default: { + bodyMapper: Mappers.CloudError + } + }, + serializer +}; + +const resetAllFiltersForHostingEnvironmentOperationSpec: msRest.OperationSpec = { + httpMethod: "POST", + path: "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/hostingEnvironments/{hostingEnvironmentName}/recommendations/reset", + urlParameters: [ + Parameters.resourceGroupName, + Parameters.hostingEnvironmentName, + Parameters.subscriptionId + ], + queryParameters: [ + Parameters.environmentName, + Parameters.apiVersion + ], + headerParameters: [ + Parameters.acceptLanguage + ], + responses: { + 204: {}, + default: { + bodyMapper: Mappers.CloudError + } + }, + serializer +}; + +const getRuleDetailsByHostingEnvironmentOperationSpec: msRest.OperationSpec = { + httpMethod: "GET", + path: "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/hostingEnvironments/{hostingEnvironmentName}/recommendations/{name}", + urlParameters: [ + Parameters.resourceGroupName, + Parameters.hostingEnvironmentName, + Parameters.name, + Parameters.subscriptionId + ], + queryParameters: [ + Parameters.updateSeen, + Parameters.recommendationId, + Parameters.apiVersion + ], + headerParameters: [ + Parameters.acceptLanguage + ], + responses: { + 200: { + bodyMapper: Mappers.RecommendationRule + }, + default: { + bodyMapper: Mappers.DefaultErrorResponse + } + }, + serializer +}; + +const disableRecommendationForHostingEnvironmentOperationSpec: msRest.OperationSpec = { + httpMethod: "POST", + path: "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/hostingEnvironments/{hostingEnvironmentName}/recommendations/{name}/disable", + urlParameters: [ + Parameters.resourceGroupName, + Parameters.name, + Parameters.hostingEnvironmentName, + Parameters.subscriptionId + ], + queryParameters: [ + Parameters.environmentName, + Parameters.apiVersion + ], + headerParameters: [ + Parameters.acceptLanguage + ], + responses: { + 200: {}, + default: { + bodyMapper: Mappers.CloudError + } + }, + serializer +}; + +const listHistoryForWebAppOperationSpec: msRest.OperationSpec = { + httpMethod: "GET", + path: "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{siteName}/recommendationHistory", + urlParameters: [ + Parameters.resourceGroupName, + Parameters.siteName, + Parameters.subscriptionId + ], + queryParameters: [ + Parameters.expiredOnly, + Parameters.filter, + Parameters.apiVersion + ], + headerParameters: [ + Parameters.acceptLanguage + ], + responses: { + 200: { + bodyMapper: Mappers.RecommendationCollection + }, + default: { + bodyMapper: Mappers.DefaultErrorResponse + } + }, + serializer +}; + +const listRecommendedRulesForWebAppOperationSpec: msRest.OperationSpec = { + httpMethod: "GET", + path: "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{siteName}/recommendations", + urlParameters: [ + Parameters.resourceGroupName, + Parameters.siteName, + Parameters.subscriptionId + ], + queryParameters: [ + Parameters.featured, + Parameters.filter, + Parameters.apiVersion + ], + headerParameters: [ + Parameters.acceptLanguage + ], + responses: { + 200: { + bodyMapper: Mappers.RecommendationCollection + }, + default: { + bodyMapper: Mappers.DefaultErrorResponse + } + }, + serializer +}; + +const disableAllForWebAppOperationSpec: msRest.OperationSpec = { + httpMethod: "POST", + path: "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{siteName}/recommendations/disable", + urlParameters: [ + Parameters.resourceGroupName, + Parameters.siteName, + Parameters.subscriptionId + ], + queryParameters: [ + Parameters.apiVersion + ], + headerParameters: [ + Parameters.acceptLanguage + ], + responses: { + 204: {}, + default: { + bodyMapper: Mappers.CloudError + } + }, + serializer +}; + +const resetAllFiltersForWebAppOperationSpec: msRest.OperationSpec = { + httpMethod: "POST", + path: "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{siteName}/recommendations/reset", + urlParameters: [ + Parameters.resourceGroupName, + Parameters.siteName, + Parameters.subscriptionId + ], + queryParameters: [ + Parameters.apiVersion + ], + headerParameters: [ + Parameters.acceptLanguage + ], + responses: { + 204: {}, + default: { + bodyMapper: Mappers.CloudError + } + }, + serializer +}; + +const getRuleDetailsByWebAppOperationSpec: msRest.OperationSpec = { + httpMethod: "GET", + path: "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{siteName}/recommendations/{name}", + urlParameters: [ + Parameters.resourceGroupName, + Parameters.siteName, + Parameters.name, + Parameters.subscriptionId + ], + queryParameters: [ + Parameters.updateSeen, + Parameters.recommendationId, + Parameters.apiVersion + ], + headerParameters: [ + Parameters.acceptLanguage + ], + responses: { + 200: { + bodyMapper: Mappers.RecommendationRule + }, + default: { + bodyMapper: Mappers.DefaultErrorResponse + } + }, + serializer +}; + +const disableRecommendationForSiteOperationSpec: msRest.OperationSpec = { + httpMethod: "POST", + path: "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{siteName}/recommendations/{name}/disable", + urlParameters: [ + Parameters.resourceGroupName, + Parameters.siteName, + Parameters.name, + Parameters.subscriptionId + ], + queryParameters: [ + Parameters.apiVersion + ], + headerParameters: [ + Parameters.acceptLanguage + ], + responses: { + 200: {}, + default: { + bodyMapper: Mappers.CloudError + } + }, + serializer +}; + +const listNextOperationSpec: msRest.OperationSpec = { + httpMethod: "GET", + baseUrl: "https://management.azure.com", + path: "{nextLink}", + urlParameters: [ + Parameters.nextPageLink + ], + headerParameters: [ + Parameters.acceptLanguage + ], + responses: { + 200: { + bodyMapper: Mappers.RecommendationCollection + }, + default: { + bodyMapper: Mappers.DefaultErrorResponse + } + }, + serializer +}; + +const listHistoryForHostingEnvironmentNextOperationSpec: msRest.OperationSpec = { + httpMethod: "GET", + baseUrl: "https://management.azure.com", + path: "{nextLink}", + urlParameters: [ + Parameters.nextPageLink + ], + headerParameters: [ + Parameters.acceptLanguage + ], + responses: { + 200: { + bodyMapper: Mappers.RecommendationCollection + }, + default: { + bodyMapper: Mappers.DefaultErrorResponse + } + }, + serializer +}; + +const listRecommendedRulesForHostingEnvironmentNextOperationSpec: msRest.OperationSpec = { + httpMethod: "GET", + baseUrl: "https://management.azure.com", + path: "{nextLink}", + urlParameters: [ + Parameters.nextPageLink + ], + headerParameters: [ + Parameters.acceptLanguage + ], + responses: { + 200: { + bodyMapper: Mappers.RecommendationCollection + }, + default: { + bodyMapper: Mappers.DefaultErrorResponse + } + }, + serializer +}; + +const listHistoryForWebAppNextOperationSpec: msRest.OperationSpec = { + httpMethod: "GET", + baseUrl: "https://management.azure.com", + path: "{nextLink}", + urlParameters: [ + Parameters.nextPageLink + ], + headerParameters: [ + Parameters.acceptLanguage + ], + responses: { + 200: { + bodyMapper: Mappers.RecommendationCollection + }, + default: { + bodyMapper: Mappers.DefaultErrorResponse + } + }, + serializer +}; + +const listRecommendedRulesForWebAppNextOperationSpec: msRest.OperationSpec = { + httpMethod: "GET", + baseUrl: "https://management.azure.com", + path: "{nextLink}", + urlParameters: [ + Parameters.nextPageLink + ], + headerParameters: [ + Parameters.acceptLanguage + ], + responses: { + 200: { + bodyMapper: Mappers.RecommendationCollection + }, + default: { + bodyMapper: Mappers.DefaultErrorResponse + } + }, + serializer +}; diff --git a/sdk/appservice/arm-appservice-profile-2019-03-01-hybrid/src/operations/webApps.ts b/sdk/appservice/arm-appservice-profile-2019-03-01-hybrid/src/operations/webApps.ts new file mode 100644 index 000000000000..6a5187e8cca2 --- /dev/null +++ b/sdk/appservice/arm-appservice-profile-2019-03-01-hybrid/src/operations/webApps.ts @@ -0,0 +1,27013 @@ +/* + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * 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 * as msRest from "@azure/ms-rest-js"; +import * as msRestAzure from "@azure/ms-rest-azure-js"; +import * as Models from "../models"; +import * as Mappers from "../models/webAppsMappers"; +import * as Parameters from "../models/parameters"; +import { WebSiteManagementClientContext } from "../webSiteManagementClientContext"; + +/** Class representing a WebApps. */ +export class WebApps { + private readonly client: WebSiteManagementClientContext; + + /** + * Create a WebApps. + * @param {WebSiteManagementClientContext} client Reference to the service client. + */ + constructor(client: WebSiteManagementClientContext) { + this.client = client; + } + + /** + * Get all apps for a subscription. + * @summary Get all apps for a subscription. + * @param [options] The optional parameters + * @returns Promise + */ + list(options?: msRest.RequestOptionsBase): Promise; + /** + * @param callback The callback + */ + list(callback: msRest.ServiceCallback): void; + /** + * @param options The optional parameters + * @param callback The callback + */ + list(options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; + list(options?: msRest.RequestOptionsBase | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { + return this.client.sendOperationRequest( + { + options + }, + listOperationSpec, + callback) as Promise; + } + + /** + * Gets all web, mobile, and API apps in the specified resource group. + * @summary Gets all web, mobile, and API apps in the specified resource group. + * @param resourceGroupName Name of the resource group to which the resource belongs. + * @param [options] The optional parameters + * @returns Promise + */ + listByResourceGroup(resourceGroupName: string, options?: Models.WebAppsListByResourceGroupOptionalParams): Promise; + /** + * @param resourceGroupName Name of the resource group to which the resource belongs. + * @param callback The callback + */ + listByResourceGroup(resourceGroupName: string, callback: msRest.ServiceCallback): void; + /** + * @param resourceGroupName Name of the resource group to which the resource belongs. + * @param options The optional parameters + * @param callback The callback + */ + listByResourceGroup(resourceGroupName: string, options: Models.WebAppsListByResourceGroupOptionalParams, callback: msRest.ServiceCallback): void; + listByResourceGroup(resourceGroupName: string, options?: Models.WebAppsListByResourceGroupOptionalParams | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { + return this.client.sendOperationRequest( + { + resourceGroupName, + options + }, + listByResourceGroupOperationSpec, + callback) as Promise; + } + + /** + * Gets the details of a web, mobile, or API app. + * @summary Gets the details of a web, mobile, or API app. + * @param resourceGroupName Name of the resource group to which the resource belongs. + * @param name Name of the app. + * @param [options] The optional parameters + * @returns Promise + */ + get(resourceGroupName: string, name: string, options?: msRest.RequestOptionsBase): Promise; + /** + * @param resourceGroupName Name of the resource group to which the resource belongs. + * @param name Name of the app. + * @param callback The callback + */ + get(resourceGroupName: string, name: string, callback: msRest.ServiceCallback): void; + /** + * @param resourceGroupName Name of the resource group to which the resource belongs. + * @param name Name of the app. + * @param options The optional parameters + * @param callback The callback + */ + get(resourceGroupName: string, name: string, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; + get(resourceGroupName: string, name: string, options?: msRest.RequestOptionsBase | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { + return this.client.sendOperationRequest( + { + resourceGroupName, + name, + options + }, + getOperationSpec, + callback) as Promise; + } + + /** + * Creates a new web, mobile, or API app in an existing resource group, or updates an existing app. + * @summary Creates a new web, mobile, or API app in an existing resource group, or updates an + * existing app. + * @param resourceGroupName Name of the resource group to which the resource belongs. + * @param name Unique name of the app to create or update. To create or update a deployment slot, + * use the {slot} parameter. + * @param siteEnvelope A JSON representation of the app properties. See example. + * @param [options] The optional parameters + * @returns Promise + */ + createOrUpdate(resourceGroupName: string, name: string, siteEnvelope: Models.Site, options?: msRest.RequestOptionsBase): Promise { + return this.beginCreateOrUpdate(resourceGroupName,name,siteEnvelope,options) + .then(lroPoller => lroPoller.pollUntilFinished()) as Promise; + } + + /** + * Deletes a web, mobile, or API app, or one of the deployment slots. + * @summary Deletes a web, mobile, or API app, or one of the deployment slots. + * @param resourceGroupName Name of the resource group to which the resource belongs. + * @param name Name of the app to delete. + * @param [options] The optional parameters + * @returns Promise + */ + deleteMethod(resourceGroupName: string, name: string, options?: Models.WebAppsDeleteMethodOptionalParams): Promise; + /** + * @param resourceGroupName Name of the resource group to which the resource belongs. + * @param name Name of the app to delete. + * @param callback The callback + */ + deleteMethod(resourceGroupName: string, name: string, callback: msRest.ServiceCallback): void; + /** + * @param resourceGroupName Name of the resource group to which the resource belongs. + * @param name Name of the app to delete. + * @param options The optional parameters + * @param callback The callback + */ + deleteMethod(resourceGroupName: string, name: string, options: Models.WebAppsDeleteMethodOptionalParams, callback: msRest.ServiceCallback): void; + deleteMethod(resourceGroupName: string, name: string, options?: Models.WebAppsDeleteMethodOptionalParams | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { + return this.client.sendOperationRequest( + { + resourceGroupName, + name, + options + }, + deleteMethodOperationSpec, + callback); + } + + /** + * Creates a new web, mobile, or API app in an existing resource group, or updates an existing app. + * @summary Creates a new web, mobile, or API app in an existing resource group, or updates an + * existing app. + * @param resourceGroupName Name of the resource group to which the resource belongs. + * @param name Unique name of the app to create or update. To create or update a deployment slot, + * use the {slot} parameter. + * @param siteEnvelope A JSON representation of the app properties. See example. + * @param [options] The optional parameters + * @returns Promise + */ + update(resourceGroupName: string, name: string, siteEnvelope: Models.SitePatchResource, options?: msRest.RequestOptionsBase): Promise; + /** + * @param resourceGroupName Name of the resource group to which the resource belongs. + * @param name Unique name of the app to create or update. To create or update a deployment slot, + * use the {slot} parameter. + * @param siteEnvelope A JSON representation of the app properties. See example. + * @param callback The callback + */ + update(resourceGroupName: string, name: string, siteEnvelope: Models.SitePatchResource, callback: msRest.ServiceCallback): void; + /** + * @param resourceGroupName Name of the resource group to which the resource belongs. + * @param name Unique name of the app to create or update. To create or update a deployment slot, + * use the {slot} parameter. + * @param siteEnvelope A JSON representation of the app properties. See example. + * @param options The optional parameters + * @param callback The callback + */ + update(resourceGroupName: string, name: string, siteEnvelope: Models.SitePatchResource, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; + update(resourceGroupName: string, name: string, siteEnvelope: Models.SitePatchResource, options?: msRest.RequestOptionsBase | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { + return this.client.sendOperationRequest( + { + resourceGroupName, + name, + siteEnvelope, + options + }, + updateOperationSpec, + callback) as Promise; + } + + /** + * Analyze a custom hostname. + * @summary Analyze a custom hostname. + * @param resourceGroupName Name of the resource group to which the resource belongs. + * @param name Name of web app. + * @param [options] The optional parameters + * @returns Promise + */ + analyzeCustomHostname(resourceGroupName: string, name: string, options?: Models.WebAppsAnalyzeCustomHostnameOptionalParams): Promise; + /** + * @param resourceGroupName Name of the resource group to which the resource belongs. + * @param name Name of web app. + * @param callback The callback + */ + analyzeCustomHostname(resourceGroupName: string, name: string, callback: msRest.ServiceCallback): void; + /** + * @param resourceGroupName Name of the resource group to which the resource belongs. + * @param name Name of web app. + * @param options The optional parameters + * @param callback The callback + */ + analyzeCustomHostname(resourceGroupName: string, name: string, options: Models.WebAppsAnalyzeCustomHostnameOptionalParams, callback: msRest.ServiceCallback): void; + analyzeCustomHostname(resourceGroupName: string, name: string, options?: Models.WebAppsAnalyzeCustomHostnameOptionalParams | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { + return this.client.sendOperationRequest( + { + resourceGroupName, + name, + options + }, + analyzeCustomHostnameOperationSpec, + callback) as Promise; + } + + /** + * Applies the configuration settings from the target slot onto the current slot. + * @summary Applies the configuration settings from the target slot onto the current slot. + * @param resourceGroupName Name of the resource group to which the resource belongs. + * @param name Name of the app. + * @param slotSwapEntity JSON object that contains the target slot name. See example. + * @param [options] The optional parameters + * @returns Promise + */ + applySlotConfigToProduction(resourceGroupName: string, name: string, slotSwapEntity: Models.CsmSlotEntity, options?: msRest.RequestOptionsBase): Promise; + /** + * @param resourceGroupName Name of the resource group to which the resource belongs. + * @param name Name of the app. + * @param slotSwapEntity JSON object that contains the target slot name. See example. + * @param callback The callback + */ + applySlotConfigToProduction(resourceGroupName: string, name: string, slotSwapEntity: Models.CsmSlotEntity, callback: msRest.ServiceCallback): void; + /** + * @param resourceGroupName Name of the resource group to which the resource belongs. + * @param name Name of the app. + * @param slotSwapEntity JSON object that contains the target slot name. See example. + * @param options The optional parameters + * @param callback The callback + */ + applySlotConfigToProduction(resourceGroupName: string, name: string, slotSwapEntity: Models.CsmSlotEntity, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; + applySlotConfigToProduction(resourceGroupName: string, name: string, slotSwapEntity: Models.CsmSlotEntity, options?: msRest.RequestOptionsBase | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { + return this.client.sendOperationRequest( + { + resourceGroupName, + name, + slotSwapEntity, + options + }, + applySlotConfigToProductionOperationSpec, + callback); + } + + /** + * Creates a backup of an app. + * @summary Creates a backup of an app. + * @param resourceGroupName Name of the resource group to which the resource belongs. + * @param name Name of the app. + * @param request Backup configuration. You can use the JSON response from the POST action as input + * here. + * @param [options] The optional parameters + * @returns Promise + */ + backup(resourceGroupName: string, name: string, request: Models.BackupRequest, options?: msRest.RequestOptionsBase): Promise; + /** + * @param resourceGroupName Name of the resource group to which the resource belongs. + * @param name Name of the app. + * @param request Backup configuration. You can use the JSON response from the POST action as input + * here. + * @param callback The callback + */ + backup(resourceGroupName: string, name: string, request: Models.BackupRequest, callback: msRest.ServiceCallback): void; + /** + * @param resourceGroupName Name of the resource group to which the resource belongs. + * @param name Name of the app. + * @param request Backup configuration. You can use the JSON response from the POST action as input + * here. + * @param options The optional parameters + * @param callback The callback + */ + backup(resourceGroupName: string, name: string, request: Models.BackupRequest, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; + backup(resourceGroupName: string, name: string, request: Models.BackupRequest, options?: msRest.RequestOptionsBase | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { + return this.client.sendOperationRequest( + { + resourceGroupName, + name, + request, + options + }, + backupOperationSpec, + callback) as Promise; + } + + /** + * Gets existing backups of an app. + * @summary Gets existing backups of an app. + * @param resourceGroupName Name of the resource group to which the resource belongs. + * @param name Name of the app. + * @param [options] The optional parameters + * @returns Promise + */ + listBackups(resourceGroupName: string, name: string, options?: msRest.RequestOptionsBase): Promise; + /** + * @param resourceGroupName Name of the resource group to which the resource belongs. + * @param name Name of the app. + * @param callback The callback + */ + listBackups(resourceGroupName: string, name: string, callback: msRest.ServiceCallback): void; + /** + * @param resourceGroupName Name of the resource group to which the resource belongs. + * @param name Name of the app. + * @param options The optional parameters + * @param callback The callback + */ + listBackups(resourceGroupName: string, name: string, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; + listBackups(resourceGroupName: string, name: string, options?: msRest.RequestOptionsBase | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { + return this.client.sendOperationRequest( + { + resourceGroupName, + name, + options + }, + listBackupsOperationSpec, + callback) as Promise; + } + + /** + * Gets a backup of an app by its ID. + * @summary Gets a backup of an app by its ID. + * @param resourceGroupName Name of the resource group to which the resource belongs. + * @param name Name of the app. + * @param backupId ID of the backup. + * @param [options] The optional parameters + * @returns Promise + */ + getBackupStatus(resourceGroupName: string, name: string, backupId: string, options?: msRest.RequestOptionsBase): Promise; + /** + * @param resourceGroupName Name of the resource group to which the resource belongs. + * @param name Name of the app. + * @param backupId ID of the backup. + * @param callback The callback + */ + getBackupStatus(resourceGroupName: string, name: string, backupId: string, callback: msRest.ServiceCallback): void; + /** + * @param resourceGroupName Name of the resource group to which the resource belongs. + * @param name Name of the app. + * @param backupId ID of the backup. + * @param options The optional parameters + * @param callback The callback + */ + getBackupStatus(resourceGroupName: string, name: string, backupId: string, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; + getBackupStatus(resourceGroupName: string, name: string, backupId: string, options?: msRest.RequestOptionsBase | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { + return this.client.sendOperationRequest( + { + resourceGroupName, + name, + backupId, + options + }, + getBackupStatusOperationSpec, + callback) as Promise; + } + + /** + * Deletes a backup of an app by its ID. + * @summary Deletes a backup of an app by its ID. + * @param resourceGroupName Name of the resource group to which the resource belongs. + * @param name Name of the app. + * @param backupId ID of the backup. + * @param [options] The optional parameters + * @returns Promise + */ + deleteBackup(resourceGroupName: string, name: string, backupId: string, options?: msRest.RequestOptionsBase): Promise; + /** + * @param resourceGroupName Name of the resource group to which the resource belongs. + * @param name Name of the app. + * @param backupId ID of the backup. + * @param callback The callback + */ + deleteBackup(resourceGroupName: string, name: string, backupId: string, callback: msRest.ServiceCallback): void; + /** + * @param resourceGroupName Name of the resource group to which the resource belongs. + * @param name Name of the app. + * @param backupId ID of the backup. + * @param options The optional parameters + * @param callback The callback + */ + deleteBackup(resourceGroupName: string, name: string, backupId: string, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; + deleteBackup(resourceGroupName: string, name: string, backupId: string, options?: msRest.RequestOptionsBase | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { + return this.client.sendOperationRequest( + { + resourceGroupName, + name, + backupId, + options + }, + deleteBackupOperationSpec, + callback); + } + + /** + * 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 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 resourceGroupName Name of the resource group to which the resource belongs. + * @param name Name of web app. + * @param backupId ID of backup. + * @param request Information on backup request. + * @param [options] The optional parameters + * @returns Promise + */ + listBackupStatusSecrets(resourceGroupName: string, name: string, backupId: string, request: Models.BackupRequest, options?: msRest.RequestOptionsBase): Promise; + /** + * @param resourceGroupName Name of the resource group to which the resource belongs. + * @param name Name of web app. + * @param backupId ID of backup. + * @param request Information on backup request. + * @param callback The callback + */ + listBackupStatusSecrets(resourceGroupName: string, name: string, backupId: string, request: Models.BackupRequest, callback: msRest.ServiceCallback): void; + /** + * @param resourceGroupName Name of the resource group to which the resource belongs. + * @param name Name of web app. + * @param backupId ID of backup. + * @param request Information on backup request. + * @param options The optional parameters + * @param callback The callback + */ + listBackupStatusSecrets(resourceGroupName: string, name: string, backupId: string, request: Models.BackupRequest, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; + listBackupStatusSecrets(resourceGroupName: string, name: string, backupId: string, request: Models.BackupRequest, options?: msRest.RequestOptionsBase | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { + return this.client.sendOperationRequest( + { + resourceGroupName, + name, + backupId, + request, + options + }, + listBackupStatusSecretsOperationSpec, + callback) as Promise; + } + + /** + * Restores a specific backup to another app (or deployment slot, if specified). + * @summary Restores a specific backup to another app (or deployment slot, if specified). + * @param resourceGroupName Name of the resource group to which the resource belongs. + * @param name Name of the app. + * @param backupId ID of the backup. + * @param request Information on restore request . + * @param [options] The optional parameters + * @returns Promise + */ + restore(resourceGroupName: string, name: string, backupId: string, request: Models.RestoreRequest, options?: msRest.RequestOptionsBase): Promise { + return this.beginRestore(resourceGroupName,name,backupId,request,options) + .then(lroPoller => lroPoller.pollUntilFinished()); + } + + /** + * List the configurations of an app + * @summary List the configurations of an app + * @param resourceGroupName Name of the resource group to which the resource belongs. + * @param name Name of the app. + * @param [options] The optional parameters + * @returns Promise + */ + listConfigurations(resourceGroupName: string, name: string, options?: msRest.RequestOptionsBase): Promise; + /** + * @param resourceGroupName Name of the resource group to which the resource belongs. + * @param name Name of the app. + * @param callback The callback + */ + listConfigurations(resourceGroupName: string, name: string, callback: msRest.ServiceCallback): void; + /** + * @param resourceGroupName Name of the resource group to which the resource belongs. + * @param name Name of the app. + * @param options The optional parameters + * @param callback The callback + */ + listConfigurations(resourceGroupName: string, name: string, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; + listConfigurations(resourceGroupName: string, name: string, options?: msRest.RequestOptionsBase | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { + return this.client.sendOperationRequest( + { + resourceGroupName, + name, + options + }, + listConfigurationsOperationSpec, + callback) as Promise; + } + + /** + * Replaces the application settings of an app. + * @summary Replaces the application settings of an app. + * @param resourceGroupName Name of the resource group to which the resource belongs. + * @param name Name of the app. + * @param appSettings Application settings of the app. + * @param [options] The optional parameters + * @returns Promise + */ + updateApplicationSettings(resourceGroupName: string, name: string, appSettings: Models.StringDictionary, options?: msRest.RequestOptionsBase): Promise; + /** + * @param resourceGroupName Name of the resource group to which the resource belongs. + * @param name Name of the app. + * @param appSettings Application settings of the app. + * @param callback The callback + */ + updateApplicationSettings(resourceGroupName: string, name: string, appSettings: Models.StringDictionary, callback: msRest.ServiceCallback): void; + /** + * @param resourceGroupName Name of the resource group to which the resource belongs. + * @param name Name of the app. + * @param appSettings Application settings of the app. + * @param options The optional parameters + * @param callback The callback + */ + updateApplicationSettings(resourceGroupName: string, name: string, appSettings: Models.StringDictionary, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; + updateApplicationSettings(resourceGroupName: string, name: string, appSettings: Models.StringDictionary, options?: msRest.RequestOptionsBase | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { + return this.client.sendOperationRequest( + { + resourceGroupName, + name, + appSettings, + options + }, + updateApplicationSettingsOperationSpec, + callback) as Promise; + } + + /** + * Gets the application settings of an app. + * @summary Gets the application settings of an app. + * @param resourceGroupName Name of the resource group to which the resource belongs. + * @param name Name of the app. + * @param [options] The optional parameters + * @returns Promise + */ + listApplicationSettings(resourceGroupName: string, name: string, options?: msRest.RequestOptionsBase): Promise; + /** + * @param resourceGroupName Name of the resource group to which the resource belongs. + * @param name Name of the app. + * @param callback The callback + */ + listApplicationSettings(resourceGroupName: string, name: string, callback: msRest.ServiceCallback): void; + /** + * @param resourceGroupName Name of the resource group to which the resource belongs. + * @param name Name of the app. + * @param options The optional parameters + * @param callback The callback + */ + listApplicationSettings(resourceGroupName: string, name: string, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; + listApplicationSettings(resourceGroupName: string, name: string, options?: msRest.RequestOptionsBase | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { + return this.client.sendOperationRequest( + { + resourceGroupName, + name, + options + }, + listApplicationSettingsOperationSpec, + callback) as Promise; + } + + /** + * Updates the Authentication / Authorization settings associated with web app. + * @summary Updates the Authentication / Authorization settings associated with web app. + * @param resourceGroupName Name of the resource group to which the resource belongs. + * @param name Name of web app. + * @param siteAuthSettings Auth settings associated with web app. + * @param [options] The optional parameters + * @returns Promise + */ + updateAuthSettings(resourceGroupName: string, name: string, siteAuthSettings: Models.SiteAuthSettings, options?: msRest.RequestOptionsBase): Promise; + /** + * @param resourceGroupName Name of the resource group to which the resource belongs. + * @param name Name of web app. + * @param siteAuthSettings Auth settings associated with web app. + * @param callback The callback + */ + updateAuthSettings(resourceGroupName: string, name: string, siteAuthSettings: Models.SiteAuthSettings, callback: msRest.ServiceCallback): void; + /** + * @param resourceGroupName Name of the resource group to which the resource belongs. + * @param name Name of web app. + * @param siteAuthSettings Auth settings associated with web app. + * @param options The optional parameters + * @param callback The callback + */ + updateAuthSettings(resourceGroupName: string, name: string, siteAuthSettings: Models.SiteAuthSettings, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; + updateAuthSettings(resourceGroupName: string, name: string, siteAuthSettings: Models.SiteAuthSettings, options?: msRest.RequestOptionsBase | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { + return this.client.sendOperationRequest( + { + resourceGroupName, + name, + siteAuthSettings, + options + }, + updateAuthSettingsOperationSpec, + callback) as Promise; + } + + /** + * Gets the Authentication/Authorization settings of an app. + * @summary Gets the Authentication/Authorization settings of an app. + * @param resourceGroupName Name of the resource group to which the resource belongs. + * @param name Name of the app. + * @param [options] The optional parameters + * @returns Promise + */ + getAuthSettings(resourceGroupName: string, name: string, options?: msRest.RequestOptionsBase): Promise; + /** + * @param resourceGroupName Name of the resource group to which the resource belongs. + * @param name Name of the app. + * @param callback The callback + */ + getAuthSettings(resourceGroupName: string, name: string, callback: msRest.ServiceCallback): void; + /** + * @param resourceGroupName Name of the resource group to which the resource belongs. + * @param name Name of the app. + * @param options The optional parameters + * @param callback The callback + */ + getAuthSettings(resourceGroupName: string, name: string, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; + getAuthSettings(resourceGroupName: string, name: string, options?: msRest.RequestOptionsBase | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { + return this.client.sendOperationRequest( + { + resourceGroupName, + name, + options + }, + getAuthSettingsOperationSpec, + callback) as Promise; + } + + /** + * Updates the Azure storage account configurations of an app. + * @summary Updates the Azure storage account configurations of an app. + * @param resourceGroupName Name of the resource group to which the resource belongs. + * @param name Name of the app. + * @param azureStorageAccounts Azure storage accounts of the app. + * @param [options] The optional parameters + * @returns Promise + */ + updateAzureStorageAccounts(resourceGroupName: string, name: string, azureStorageAccounts: Models.AzureStoragePropertyDictionaryResource, options?: msRest.RequestOptionsBase): Promise; + /** + * @param resourceGroupName Name of the resource group to which the resource belongs. + * @param name Name of the app. + * @param azureStorageAccounts Azure storage accounts of the app. + * @param callback The callback + */ + updateAzureStorageAccounts(resourceGroupName: string, name: string, azureStorageAccounts: Models.AzureStoragePropertyDictionaryResource, callback: msRest.ServiceCallback): void; + /** + * @param resourceGroupName Name of the resource group to which the resource belongs. + * @param name Name of the app. + * @param azureStorageAccounts Azure storage accounts of the app. + * @param options The optional parameters + * @param callback The callback + */ + updateAzureStorageAccounts(resourceGroupName: string, name: string, azureStorageAccounts: Models.AzureStoragePropertyDictionaryResource, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; + updateAzureStorageAccounts(resourceGroupName: string, name: string, azureStorageAccounts: Models.AzureStoragePropertyDictionaryResource, options?: msRest.RequestOptionsBase | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { + return this.client.sendOperationRequest( + { + resourceGroupName, + name, + azureStorageAccounts, + options + }, + updateAzureStorageAccountsOperationSpec, + callback) as Promise; + } + + /** + * Gets the Azure storage account configurations of an app. + * @summary Gets the Azure storage account configurations of an app. + * @param resourceGroupName Name of the resource group to which the resource belongs. + * @param name Name of the app. + * @param [options] The optional parameters + * @returns Promise + */ + listAzureStorageAccounts(resourceGroupName: string, name: string, options?: msRest.RequestOptionsBase): Promise; + /** + * @param resourceGroupName Name of the resource group to which the resource belongs. + * @param name Name of the app. + * @param callback The callback + */ + listAzureStorageAccounts(resourceGroupName: string, name: string, callback: msRest.ServiceCallback): void; + /** + * @param resourceGroupName Name of the resource group to which the resource belongs. + * @param name Name of the app. + * @param options The optional parameters + * @param callback The callback + */ + listAzureStorageAccounts(resourceGroupName: string, name: string, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; + listAzureStorageAccounts(resourceGroupName: string, name: string, options?: msRest.RequestOptionsBase | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { + return this.client.sendOperationRequest( + { + resourceGroupName, + name, + options + }, + listAzureStorageAccountsOperationSpec, + callback) as Promise; + } + + /** + * Updates the backup configuration of an app. + * @summary Updates the backup configuration of an app. + * @param resourceGroupName Name of the resource group to which the resource belongs. + * @param name Name of the app. + * @param request Edited backup configuration. + * @param [options] The optional parameters + * @returns Promise + */ + updateBackupConfiguration(resourceGroupName: string, name: string, request: Models.BackupRequest, options?: msRest.RequestOptionsBase): Promise; + /** + * @param resourceGroupName Name of the resource group to which the resource belongs. + * @param name Name of the app. + * @param request Edited backup configuration. + * @param callback The callback + */ + updateBackupConfiguration(resourceGroupName: string, name: string, request: Models.BackupRequest, callback: msRest.ServiceCallback): void; + /** + * @param resourceGroupName Name of the resource group to which the resource belongs. + * @param name Name of the app. + * @param request Edited backup configuration. + * @param options The optional parameters + * @param callback The callback + */ + updateBackupConfiguration(resourceGroupName: string, name: string, request: Models.BackupRequest, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; + updateBackupConfiguration(resourceGroupName: string, name: string, request: Models.BackupRequest, options?: msRest.RequestOptionsBase | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { + return this.client.sendOperationRequest( + { + resourceGroupName, + name, + request, + options + }, + updateBackupConfigurationOperationSpec, + callback) as Promise; + } + + /** + * Deletes the backup configuration of an app. + * @summary Deletes the backup configuration of an app. + * @param resourceGroupName Name of the resource group to which the resource belongs. + * @param name Name of the app. + * @param [options] The optional parameters + * @returns Promise + */ + deleteBackupConfiguration(resourceGroupName: string, name: string, options?: msRest.RequestOptionsBase): Promise; + /** + * @param resourceGroupName Name of the resource group to which the resource belongs. + * @param name Name of the app. + * @param callback The callback + */ + deleteBackupConfiguration(resourceGroupName: string, name: string, callback: msRest.ServiceCallback): void; + /** + * @param resourceGroupName Name of the resource group to which the resource belongs. + * @param name Name of the app. + * @param options The optional parameters + * @param callback The callback + */ + deleteBackupConfiguration(resourceGroupName: string, name: string, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; + deleteBackupConfiguration(resourceGroupName: string, name: string, options?: msRest.RequestOptionsBase | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { + return this.client.sendOperationRequest( + { + resourceGroupName, + name, + options + }, + deleteBackupConfigurationOperationSpec, + callback); + } + + /** + * Gets the backup configuration of an app. + * @summary Gets the backup configuration of an app. + * @param resourceGroupName Name of the resource group to which the resource belongs. + * @param name Name of the app. + * @param [options] The optional parameters + * @returns Promise + */ + getBackupConfiguration(resourceGroupName: string, name: string, options?: msRest.RequestOptionsBase): Promise; + /** + * @param resourceGroupName Name of the resource group to which the resource belongs. + * @param name Name of the app. + * @param callback The callback + */ + getBackupConfiguration(resourceGroupName: string, name: string, callback: msRest.ServiceCallback): void; + /** + * @param resourceGroupName Name of the resource group to which the resource belongs. + * @param name Name of the app. + * @param options The optional parameters + * @param callback The callback + */ + getBackupConfiguration(resourceGroupName: string, name: string, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; + getBackupConfiguration(resourceGroupName: string, name: string, options?: msRest.RequestOptionsBase | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { + return this.client.sendOperationRequest( + { + resourceGroupName, + name, + options + }, + getBackupConfigurationOperationSpec, + callback) as Promise; + } + + /** + * Replaces the connection strings of an app. + * @summary Replaces the connection strings of an app. + * @param resourceGroupName Name of the resource group to which the resource belongs. + * @param name Name of the app. + * @param connectionStrings Connection strings of the app or deployment slot. See example. + * @param [options] The optional parameters + * @returns Promise + */ + updateConnectionStrings(resourceGroupName: string, name: string, connectionStrings: Models.ConnectionStringDictionary, options?: msRest.RequestOptionsBase): Promise; + /** + * @param resourceGroupName Name of the resource group to which the resource belongs. + * @param name Name of the app. + * @param connectionStrings Connection strings of the app or deployment slot. See example. + * @param callback The callback + */ + updateConnectionStrings(resourceGroupName: string, name: string, connectionStrings: Models.ConnectionStringDictionary, callback: msRest.ServiceCallback): void; + /** + * @param resourceGroupName Name of the resource group to which the resource belongs. + * @param name Name of the app. + * @param connectionStrings Connection strings of the app or deployment slot. See example. + * @param options The optional parameters + * @param callback The callback + */ + updateConnectionStrings(resourceGroupName: string, name: string, connectionStrings: Models.ConnectionStringDictionary, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; + updateConnectionStrings(resourceGroupName: string, name: string, connectionStrings: Models.ConnectionStringDictionary, options?: msRest.RequestOptionsBase | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { + return this.client.sendOperationRequest( + { + resourceGroupName, + name, + connectionStrings, + options + }, + updateConnectionStringsOperationSpec, + callback) as Promise; + } + + /** + * Gets the connection strings of an app. + * @summary Gets the connection strings of an app. + * @param resourceGroupName Name of the resource group to which the resource belongs. + * @param name Name of the app. + * @param [options] The optional parameters + * @returns Promise + */ + listConnectionStrings(resourceGroupName: string, name: string, options?: msRest.RequestOptionsBase): Promise; + /** + * @param resourceGroupName Name of the resource group to which the resource belongs. + * @param name Name of the app. + * @param callback The callback + */ + listConnectionStrings(resourceGroupName: string, name: string, callback: msRest.ServiceCallback): void; + /** + * @param resourceGroupName Name of the resource group to which the resource belongs. + * @param name Name of the app. + * @param options The optional parameters + * @param callback The callback + */ + listConnectionStrings(resourceGroupName: string, name: string, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; + listConnectionStrings(resourceGroupName: string, name: string, options?: msRest.RequestOptionsBase | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { + return this.client.sendOperationRequest( + { + resourceGroupName, + name, + options + }, + listConnectionStringsOperationSpec, + callback) as Promise; + } + + /** + * Gets the logging configuration of an app. + * @summary Gets the logging configuration of an app. + * @param resourceGroupName Name of the resource group to which the resource belongs. + * @param name Name of the app. + * @param [options] The optional parameters + * @returns Promise + */ + getDiagnosticLogsConfiguration(resourceGroupName: string, name: string, options?: msRest.RequestOptionsBase): Promise; + /** + * @param resourceGroupName Name of the resource group to which the resource belongs. + * @param name Name of the app. + * @param callback The callback + */ + getDiagnosticLogsConfiguration(resourceGroupName: string, name: string, callback: msRest.ServiceCallback): void; + /** + * @param resourceGroupName Name of the resource group to which the resource belongs. + * @param name Name of the app. + * @param options The optional parameters + * @param callback The callback + */ + getDiagnosticLogsConfiguration(resourceGroupName: string, name: string, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; + getDiagnosticLogsConfiguration(resourceGroupName: string, name: string, options?: msRest.RequestOptionsBase | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { + return this.client.sendOperationRequest( + { + resourceGroupName, + name, + options + }, + getDiagnosticLogsConfigurationOperationSpec, + callback) as Promise; + } + + /** + * Updates the logging configuration of an app. + * @summary Updates the logging configuration of an app. + * @param resourceGroupName Name of the resource group to which the resource belongs. + * @param name Name of the app. + * @param siteLogsConfig A SiteLogsConfig JSON object that contains the logging configuration to + * change in the "properties" property. + * @param [options] The optional parameters + * @returns Promise + */ + updateDiagnosticLogsConfig(resourceGroupName: string, name: string, siteLogsConfig: Models.SiteLogsConfig, options?: msRest.RequestOptionsBase): Promise; + /** + * @param resourceGroupName Name of the resource group to which the resource belongs. + * @param name Name of the app. + * @param siteLogsConfig A SiteLogsConfig JSON object that contains the logging configuration to + * change in the "properties" property. + * @param callback The callback + */ + updateDiagnosticLogsConfig(resourceGroupName: string, name: string, siteLogsConfig: Models.SiteLogsConfig, callback: msRest.ServiceCallback): void; + /** + * @param resourceGroupName Name of the resource group to which the resource belongs. + * @param name Name of the app. + * @param siteLogsConfig A SiteLogsConfig JSON object that contains the logging configuration to + * change in the "properties" property. + * @param options The optional parameters + * @param callback The callback + */ + updateDiagnosticLogsConfig(resourceGroupName: string, name: string, siteLogsConfig: Models.SiteLogsConfig, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; + updateDiagnosticLogsConfig(resourceGroupName: string, name: string, siteLogsConfig: Models.SiteLogsConfig, options?: msRest.RequestOptionsBase | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { + return this.client.sendOperationRequest( + { + resourceGroupName, + name, + siteLogsConfig, + options + }, + updateDiagnosticLogsConfigOperationSpec, + callback) as Promise; + } + + /** + * Replaces the metadata of an app. + * @summary Replaces the metadata of an app. + * @param resourceGroupName Name of the resource group to which the resource belongs. + * @param name Name of the app. + * @param metadata Edited metadata of the app or deployment slot. See example. + * @param [options] The optional parameters + * @returns Promise + */ + updateMetadata(resourceGroupName: string, name: string, metadata: Models.StringDictionary, options?: msRest.RequestOptionsBase): Promise; + /** + * @param resourceGroupName Name of the resource group to which the resource belongs. + * @param name Name of the app. + * @param metadata Edited metadata of the app or deployment slot. See example. + * @param callback The callback + */ + updateMetadata(resourceGroupName: string, name: string, metadata: Models.StringDictionary, callback: msRest.ServiceCallback): void; + /** + * @param resourceGroupName Name of the resource group to which the resource belongs. + * @param name Name of the app. + * @param metadata Edited metadata of the app or deployment slot. See example. + * @param options The optional parameters + * @param callback The callback + */ + updateMetadata(resourceGroupName: string, name: string, metadata: Models.StringDictionary, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; + updateMetadata(resourceGroupName: string, name: string, metadata: Models.StringDictionary, options?: msRest.RequestOptionsBase | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { + return this.client.sendOperationRequest( + { + resourceGroupName, + name, + metadata, + options + }, + updateMetadataOperationSpec, + callback) as Promise; + } + + /** + * Gets the metadata of an app. + * @summary Gets the metadata of an app. + * @param resourceGroupName Name of the resource group to which the resource belongs. + * @param name Name of the app. + * @param [options] The optional parameters + * @returns Promise + */ + listMetadata(resourceGroupName: string, name: string, options?: msRest.RequestOptionsBase): Promise; + /** + * @param resourceGroupName Name of the resource group to which the resource belongs. + * @param name Name of the app. + * @param callback The callback + */ + listMetadata(resourceGroupName: string, name: string, callback: msRest.ServiceCallback): void; + /** + * @param resourceGroupName Name of the resource group to which the resource belongs. + * @param name Name of the app. + * @param options The optional parameters + * @param callback The callback + */ + listMetadata(resourceGroupName: string, name: string, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; + listMetadata(resourceGroupName: string, name: string, options?: msRest.RequestOptionsBase | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { + return this.client.sendOperationRequest( + { + resourceGroupName, + name, + options + }, + listMetadataOperationSpec, + callback) as Promise; + } + + /** + * Gets the Git/FTP publishing credentials of an app. + * @summary Gets the Git/FTP publishing credentials of an app. + * @param resourceGroupName Name of the resource group to which the resource belongs. + * @param name Name of the app. + * @param [options] The optional parameters + * @returns Promise + */ + listPublishingCredentials(resourceGroupName: string, name: string, options?: msRest.RequestOptionsBase): Promise { + return this.beginListPublishingCredentials(resourceGroupName,name,options) + .then(lroPoller => lroPoller.pollUntilFinished()) as Promise; + } + + /** + * Updates the Push settings associated with web app. + * @summary Updates the Push settings associated with web app. + * @param resourceGroupName Name of the resource group to which the resource belongs. + * @param name Name of web app. + * @param pushSettings Push settings associated with web app. + * @param [options] The optional parameters + * @returns Promise + */ + updateSitePushSettings(resourceGroupName: string, name: string, pushSettings: Models.PushSettings, options?: msRest.RequestOptionsBase): Promise; + /** + * @param resourceGroupName Name of the resource group to which the resource belongs. + * @param name Name of web app. + * @param pushSettings Push settings associated with web app. + * @param callback The callback + */ + updateSitePushSettings(resourceGroupName: string, name: string, pushSettings: Models.PushSettings, callback: msRest.ServiceCallback): void; + /** + * @param resourceGroupName Name of the resource group to which the resource belongs. + * @param name Name of web app. + * @param pushSettings Push settings associated with web app. + * @param options The optional parameters + * @param callback The callback + */ + updateSitePushSettings(resourceGroupName: string, name: string, pushSettings: Models.PushSettings, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; + updateSitePushSettings(resourceGroupName: string, name: string, pushSettings: Models.PushSettings, options?: msRest.RequestOptionsBase | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { + return this.client.sendOperationRequest( + { + resourceGroupName, + name, + pushSettings, + options + }, + updateSitePushSettingsOperationSpec, + callback) as Promise; + } + + /** + * Gets the Push settings associated with web app. + * @summary Gets the Push settings associated with web app. + * @param resourceGroupName Name of the resource group to which the resource belongs. + * @param name Name of web app. + * @param [options] The optional parameters + * @returns Promise + */ + listSitePushSettings(resourceGroupName: string, name: string, options?: msRest.RequestOptionsBase): Promise; + /** + * @param resourceGroupName Name of the resource group to which the resource belongs. + * @param name Name of web app. + * @param callback The callback + */ + listSitePushSettings(resourceGroupName: string, name: string, callback: msRest.ServiceCallback): void; + /** + * @param resourceGroupName Name of the resource group to which the resource belongs. + * @param name Name of web app. + * @param options The optional parameters + * @param callback The callback + */ + listSitePushSettings(resourceGroupName: string, name: string, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; + listSitePushSettings(resourceGroupName: string, name: string, options?: msRest.RequestOptionsBase | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { + return this.client.sendOperationRequest( + { + resourceGroupName, + name, + options + }, + listSitePushSettingsOperationSpec, + callback) as Promise; + } + + /** + * Gets the names of app settings and connection strings that stick to the slot (not swapped). + * @summary Gets the names of app settings and connection strings that stick to the slot (not + * swapped). + * @param resourceGroupName Name of the resource group to which the resource belongs. + * @param name Name of the app. + * @param [options] The optional parameters + * @returns Promise + */ + listSlotConfigurationNames(resourceGroupName: string, name: string, options?: msRest.RequestOptionsBase): Promise; + /** + * @param resourceGroupName Name of the resource group to which the resource belongs. + * @param name Name of the app. + * @param callback The callback + */ + listSlotConfigurationNames(resourceGroupName: string, name: string, callback: msRest.ServiceCallback): void; + /** + * @param resourceGroupName Name of the resource group to which the resource belongs. + * @param name Name of the app. + * @param options The optional parameters + * @param callback The callback + */ + listSlotConfigurationNames(resourceGroupName: string, name: string, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; + listSlotConfigurationNames(resourceGroupName: string, name: string, options?: msRest.RequestOptionsBase | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { + return this.client.sendOperationRequest( + { + resourceGroupName, + name, + options + }, + listSlotConfigurationNamesOperationSpec, + callback) as Promise; + } + + /** + * Updates the names of application settings and connection string that remain with the slot during + * swap operation. + * @summary Updates the names of application settings and connection string that remain with the + * slot during swap operation. + * @param resourceGroupName Name of the resource group to which the resource belongs. + * @param name Name of the app. + * @param slotConfigNames Names of application settings and connection strings. See example. + * @param [options] The optional parameters + * @returns Promise + */ + updateSlotConfigurationNames(resourceGroupName: string, name: string, slotConfigNames: Models.SlotConfigNamesResource, options?: msRest.RequestOptionsBase): Promise; + /** + * @param resourceGroupName Name of the resource group to which the resource belongs. + * @param name Name of the app. + * @param slotConfigNames Names of application settings and connection strings. See example. + * @param callback The callback + */ + updateSlotConfigurationNames(resourceGroupName: string, name: string, slotConfigNames: Models.SlotConfigNamesResource, callback: msRest.ServiceCallback): void; + /** + * @param resourceGroupName Name of the resource group to which the resource belongs. + * @param name Name of the app. + * @param slotConfigNames Names of application settings and connection strings. See example. + * @param options The optional parameters + * @param callback The callback + */ + updateSlotConfigurationNames(resourceGroupName: string, name: string, slotConfigNames: Models.SlotConfigNamesResource, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; + updateSlotConfigurationNames(resourceGroupName: string, name: string, slotConfigNames: Models.SlotConfigNamesResource, options?: msRest.RequestOptionsBase | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { + return this.client.sendOperationRequest( + { + resourceGroupName, + name, + slotConfigNames, + options + }, + updateSlotConfigurationNamesOperationSpec, + callback) as Promise; + } + + /** + * Gets the configuration of an app, such as platform version and bitness, default documents, + * virtual applications, Always On, etc. + * @summary Gets the configuration of an app, such as platform version and bitness, default + * documents, virtual applications, Always On, etc. + * @param resourceGroupName Name of the resource group to which the resource belongs. + * @param name Name of the app. + * @param [options] The optional parameters + * @returns Promise + */ + getConfiguration(resourceGroupName: string, name: string, options?: msRest.RequestOptionsBase): Promise; + /** + * @param resourceGroupName Name of the resource group to which the resource belongs. + * @param name Name of the app. + * @param callback The callback + */ + getConfiguration(resourceGroupName: string, name: string, callback: msRest.ServiceCallback): void; + /** + * @param resourceGroupName Name of the resource group to which the resource belongs. + * @param name Name of the app. + * @param options The optional parameters + * @param callback The callback + */ + getConfiguration(resourceGroupName: string, name: string, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; + getConfiguration(resourceGroupName: string, name: string, options?: msRest.RequestOptionsBase | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { + return this.client.sendOperationRequest( + { + resourceGroupName, + name, + options + }, + getConfigurationOperationSpec, + callback) as Promise; + } + + /** + * Updates the configuration of an app. + * @summary Updates the configuration of an app. + * @param resourceGroupName Name of the resource group to which the resource belongs. + * @param name Name of the app. + * @param siteConfig JSON representation of a SiteConfig object. See example. + * @param [options] The optional parameters + * @returns Promise + */ + createOrUpdateConfiguration(resourceGroupName: string, name: string, siteConfig: Models.SiteConfigResource, options?: msRest.RequestOptionsBase): Promise; + /** + * @param resourceGroupName Name of the resource group to which the resource belongs. + * @param name Name of the app. + * @param siteConfig JSON representation of a SiteConfig object. See example. + * @param callback The callback + */ + createOrUpdateConfiguration(resourceGroupName: string, name: string, siteConfig: Models.SiteConfigResource, callback: msRest.ServiceCallback): void; + /** + * @param resourceGroupName Name of the resource group to which the resource belongs. + * @param name Name of the app. + * @param siteConfig JSON representation of a SiteConfig object. See example. + * @param options The optional parameters + * @param callback The callback + */ + createOrUpdateConfiguration(resourceGroupName: string, name: string, siteConfig: Models.SiteConfigResource, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; + createOrUpdateConfiguration(resourceGroupName: string, name: string, siteConfig: Models.SiteConfigResource, options?: msRest.RequestOptionsBase | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { + return this.client.sendOperationRequest( + { + resourceGroupName, + name, + siteConfig, + options + }, + createOrUpdateConfigurationOperationSpec, + callback) as Promise; + } + + /** + * Updates the configuration of an app. + * @summary Updates the configuration of an app. + * @param resourceGroupName Name of the resource group to which the resource belongs. + * @param name Name of the app. + * @param siteConfig JSON representation of a SiteConfig object. See example. + * @param [options] The optional parameters + * @returns Promise + */ + updateConfiguration(resourceGroupName: string, name: string, siteConfig: Models.SiteConfigResource, options?: msRest.RequestOptionsBase): Promise; + /** + * @param resourceGroupName Name of the resource group to which the resource belongs. + * @param name Name of the app. + * @param siteConfig JSON representation of a SiteConfig object. See example. + * @param callback The callback + */ + updateConfiguration(resourceGroupName: string, name: string, siteConfig: Models.SiteConfigResource, callback: msRest.ServiceCallback): void; + /** + * @param resourceGroupName Name of the resource group to which the resource belongs. + * @param name Name of the app. + * @param siteConfig JSON representation of a SiteConfig object. See example. + * @param options The optional parameters + * @param callback The callback + */ + updateConfiguration(resourceGroupName: string, name: string, siteConfig: Models.SiteConfigResource, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; + updateConfiguration(resourceGroupName: string, name: string, siteConfig: Models.SiteConfigResource, options?: msRest.RequestOptionsBase | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { + return this.client.sendOperationRequest( + { + resourceGroupName, + name, + siteConfig, + options + }, + updateConfigurationOperationSpec, + callback) as Promise; + } + + /** + * 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 list of web app configuration snapshots identifiers. Each element of the list + * contains a timestamp and the ID of the snapshot. + * @param resourceGroupName Name of the resource group to which the resource belongs. + * @param name Name of the app. + * @param [options] The optional parameters + * @returns Promise + */ + listConfigurationSnapshotInfo(resourceGroupName: string, name: string, options?: msRest.RequestOptionsBase): Promise; + /** + * @param resourceGroupName Name of the resource group to which the resource belongs. + * @param name Name of the app. + * @param callback The callback + */ + listConfigurationSnapshotInfo(resourceGroupName: string, name: string, callback: msRest.ServiceCallback): void; + /** + * @param resourceGroupName Name of the resource group to which the resource belongs. + * @param name Name of the app. + * @param options The optional parameters + * @param callback The callback + */ + listConfigurationSnapshotInfo(resourceGroupName: string, name: string, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; + listConfigurationSnapshotInfo(resourceGroupName: string, name: string, options?: msRest.RequestOptionsBase | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { + return this.client.sendOperationRequest( + { + resourceGroupName, + name, + options + }, + listConfigurationSnapshotInfoOperationSpec, + callback) as Promise; + } + + /** + * Gets a snapshot of the configuration of an app at a previous point in time. + * @summary Gets a snapshot of the configuration of an app at a previous point in time. + * @param resourceGroupName Name of the resource group to which the resource belongs. + * @param name Name of the app. + * @param snapshotId The ID of the snapshot to read. + * @param [options] The optional parameters + * @returns Promise + */ + getConfigurationSnapshot(resourceGroupName: string, name: string, snapshotId: string, options?: msRest.RequestOptionsBase): Promise; + /** + * @param resourceGroupName Name of the resource group to which the resource belongs. + * @param name Name of the app. + * @param snapshotId The ID of the snapshot to read. + * @param callback The callback + */ + getConfigurationSnapshot(resourceGroupName: string, name: string, snapshotId: string, callback: msRest.ServiceCallback): void; + /** + * @param resourceGroupName Name of the resource group to which the resource belongs. + * @param name Name of the app. + * @param snapshotId The ID of the snapshot to read. + * @param options The optional parameters + * @param callback The callback + */ + getConfigurationSnapshot(resourceGroupName: string, name: string, snapshotId: string, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; + getConfigurationSnapshot(resourceGroupName: string, name: string, snapshotId: string, options?: msRest.RequestOptionsBase | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { + return this.client.sendOperationRequest( + { + resourceGroupName, + name, + snapshotId, + options + }, + getConfigurationSnapshotOperationSpec, + callback) as Promise; + } + + /** + * Reverts the configuration of an app to a previous snapshot. + * @summary Reverts the configuration of an app to a previous snapshot. + * @param resourceGroupName Name of the resource group to which the resource belongs. + * @param name Name of the app. + * @param snapshotId The ID of the snapshot to read. + * @param [options] The optional parameters + * @returns Promise + */ + recoverSiteConfigurationSnapshot(resourceGroupName: string, name: string, snapshotId: string, options?: msRest.RequestOptionsBase): Promise; + /** + * @param resourceGroupName Name of the resource group to which the resource belongs. + * @param name Name of the app. + * @param snapshotId The ID of the snapshot to read. + * @param callback The callback + */ + recoverSiteConfigurationSnapshot(resourceGroupName: string, name: string, snapshotId: string, callback: msRest.ServiceCallback): void; + /** + * @param resourceGroupName Name of the resource group to which the resource belongs. + * @param name Name of the app. + * @param snapshotId The ID of the snapshot to read. + * @param options The optional parameters + * @param callback The callback + */ + recoverSiteConfigurationSnapshot(resourceGroupName: string, name: string, snapshotId: string, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; + recoverSiteConfigurationSnapshot(resourceGroupName: string, name: string, snapshotId: string, options?: msRest.RequestOptionsBase | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { + return this.client.sendOperationRequest( + { + resourceGroupName, + name, + snapshotId, + options + }, + recoverSiteConfigurationSnapshotOperationSpec, + callback); + } + + /** + * Gets the last lines of docker logs for the given site + * @summary Gets the last lines of docker logs for the given site + * @param resourceGroupName Name of the resource group to which the resource belongs. + * @param name Name of web app. + * @param [options] The optional parameters + * @returns Promise + */ + getWebSiteContainerLogs(resourceGroupName: string, name: string, options?: msRest.RequestOptionsBase): Promise; + /** + * @param resourceGroupName Name of the resource group to which the resource belongs. + * @param name Name of web app. + * @param callback The callback + */ + getWebSiteContainerLogs(resourceGroupName: string, name: string, callback: msRest.ServiceCallback): void; + /** + * @param resourceGroupName Name of the resource group to which the resource belongs. + * @param name Name of web app. + * @param options The optional parameters + * @param callback The callback + */ + getWebSiteContainerLogs(resourceGroupName: string, name: string, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; + getWebSiteContainerLogs(resourceGroupName: string, name: string, options?: msRest.RequestOptionsBase | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { + return this.client.sendOperationRequest( + { + resourceGroupName, + name, + options + }, + getWebSiteContainerLogsOperationSpec, + callback) as Promise; + } + + /** + * Gets the ZIP archived docker log files for the given site + * @summary Gets the ZIP archived docker log files for the given site + * @param resourceGroupName Name of the resource group to which the resource belongs. + * @param name Name of web app. + * @param [options] The optional parameters + * @returns Promise + */ + getContainerLogsZip(resourceGroupName: string, name: string, options?: msRest.RequestOptionsBase): Promise; + /** + * @param resourceGroupName Name of the resource group to which the resource belongs. + * @param name Name of web app. + * @param callback The callback + */ + getContainerLogsZip(resourceGroupName: string, name: string, callback: msRest.ServiceCallback): void; + /** + * @param resourceGroupName Name of the resource group to which the resource belongs. + * @param name Name of web app. + * @param options The optional parameters + * @param callback The callback + */ + getContainerLogsZip(resourceGroupName: string, name: string, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; + getContainerLogsZip(resourceGroupName: string, name: string, options?: msRest.RequestOptionsBase | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { + return this.client.sendOperationRequest( + { + resourceGroupName, + name, + options + }, + getContainerLogsZipOperationSpec, + callback) as Promise; + } + + /** + * List continuous web jobs for an app, or a deployment slot. + * @summary List continuous web jobs for an app, or a deployment slot. + * @param resourceGroupName Name of the resource group to which the resource belongs. + * @param name Site name. + * @param [options] The optional parameters + * @returns Promise + */ + listContinuousWebJobs(resourceGroupName: string, name: string, options?: msRest.RequestOptionsBase): Promise; + /** + * @param resourceGroupName Name of the resource group to which the resource belongs. + * @param name Site name. + * @param callback The callback + */ + listContinuousWebJobs(resourceGroupName: string, name: string, callback: msRest.ServiceCallback): void; + /** + * @param resourceGroupName Name of the resource group to which the resource belongs. + * @param name Site name. + * @param options The optional parameters + * @param callback The callback + */ + listContinuousWebJobs(resourceGroupName: string, name: string, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; + listContinuousWebJobs(resourceGroupName: string, name: string, options?: msRest.RequestOptionsBase | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { + return this.client.sendOperationRequest( + { + resourceGroupName, + name, + options + }, + listContinuousWebJobsOperationSpec, + callback) as Promise; + } + + /** + * Gets a continuous web job by its ID for an app, or a deployment slot. + * @summary Gets a continuous web job by its ID for an app, or a deployment slot. + * @param resourceGroupName Name of the resource group to which the resource belongs. + * @param name Site name. + * @param webJobName Name of Web Job. + * @param [options] The optional parameters + * @returns Promise + */ + getContinuousWebJob(resourceGroupName: string, name: string, webJobName: string, options?: msRest.RequestOptionsBase): Promise; + /** + * @param resourceGroupName Name of the resource group to which the resource belongs. + * @param name Site name. + * @param webJobName Name of Web Job. + * @param callback The callback + */ + getContinuousWebJob(resourceGroupName: string, name: string, webJobName: string, callback: msRest.ServiceCallback): void; + /** + * @param resourceGroupName Name of the resource group to which the resource belongs. + * @param name Site name. + * @param webJobName Name of Web Job. + * @param options The optional parameters + * @param callback The callback + */ + getContinuousWebJob(resourceGroupName: string, name: string, webJobName: string, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; + getContinuousWebJob(resourceGroupName: string, name: string, webJobName: string, options?: msRest.RequestOptionsBase | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { + return this.client.sendOperationRequest( + { + resourceGroupName, + name, + webJobName, + options + }, + getContinuousWebJobOperationSpec, + callback) as Promise; + } + + /** + * Delete a continuous web job 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. + * @param resourceGroupName Name of the resource group to which the resource belongs. + * @param name Site name. + * @param webJobName Name of Web Job. + * @param [options] The optional parameters + * @returns Promise + */ + deleteContinuousWebJob(resourceGroupName: string, name: string, webJobName: string, options?: msRest.RequestOptionsBase): Promise; + /** + * @param resourceGroupName Name of the resource group to which the resource belongs. + * @param name Site name. + * @param webJobName Name of Web Job. + * @param callback The callback + */ + deleteContinuousWebJob(resourceGroupName: string, name: string, webJobName: string, callback: msRest.ServiceCallback): void; + /** + * @param resourceGroupName Name of the resource group to which the resource belongs. + * @param name Site name. + * @param webJobName Name of Web Job. + * @param options The optional parameters + * @param callback The callback + */ + deleteContinuousWebJob(resourceGroupName: string, name: string, webJobName: string, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; + deleteContinuousWebJob(resourceGroupName: string, name: string, webJobName: string, options?: msRest.RequestOptionsBase | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { + return this.client.sendOperationRequest( + { + resourceGroupName, + name, + webJobName, + options + }, + deleteContinuousWebJobOperationSpec, + callback); + } + + /** + * Start a continuous web job for an app, or a deployment slot. + * @summary Start a continuous web job for an app, or a deployment slot. + * @param resourceGroupName Name of the resource group to which the resource belongs. + * @param name Site name. + * @param webJobName Name of Web Job. + * @param [options] The optional parameters + * @returns Promise + */ + startContinuousWebJob(resourceGroupName: string, name: string, webJobName: string, options?: msRest.RequestOptionsBase): Promise; + /** + * @param resourceGroupName Name of the resource group to which the resource belongs. + * @param name Site name. + * @param webJobName Name of Web Job. + * @param callback The callback + */ + startContinuousWebJob(resourceGroupName: string, name: string, webJobName: string, callback: msRest.ServiceCallback): void; + /** + * @param resourceGroupName Name of the resource group to which the resource belongs. + * @param name Site name. + * @param webJobName Name of Web Job. + * @param options The optional parameters + * @param callback The callback + */ + startContinuousWebJob(resourceGroupName: string, name: string, webJobName: string, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; + startContinuousWebJob(resourceGroupName: string, name: string, webJobName: string, options?: msRest.RequestOptionsBase | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { + return this.client.sendOperationRequest( + { + resourceGroupName, + name, + webJobName, + options + }, + startContinuousWebJobOperationSpec, + callback); + } + + /** + * Stop a continuous web job for an app, or a deployment slot. + * @summary Stop a continuous web job for an app, or a deployment slot. + * @param resourceGroupName Name of the resource group to which the resource belongs. + * @param name Site name. + * @param webJobName Name of Web Job. + * @param [options] The optional parameters + * @returns Promise + */ + stopContinuousWebJob(resourceGroupName: string, name: string, webJobName: string, options?: msRest.RequestOptionsBase): Promise; + /** + * @param resourceGroupName Name of the resource group to which the resource belongs. + * @param name Site name. + * @param webJobName Name of Web Job. + * @param callback The callback + */ + stopContinuousWebJob(resourceGroupName: string, name: string, webJobName: string, callback: msRest.ServiceCallback): void; + /** + * @param resourceGroupName Name of the resource group to which the resource belongs. + * @param name Site name. + * @param webJobName Name of Web Job. + * @param options The optional parameters + * @param callback The callback + */ + stopContinuousWebJob(resourceGroupName: string, name: string, webJobName: string, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; + stopContinuousWebJob(resourceGroupName: string, name: string, webJobName: string, options?: msRest.RequestOptionsBase | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { + return this.client.sendOperationRequest( + { + resourceGroupName, + name, + webJobName, + options + }, + stopContinuousWebJobOperationSpec, + callback); + } + + /** + * List deployments for an app, or a deployment slot. + * @summary List deployments for an app, or a deployment slot. + * @param resourceGroupName Name of the resource group to which the resource belongs. + * @param name Name of the app. + * @param [options] The optional parameters + * @returns Promise + */ + listDeployments(resourceGroupName: string, name: string, options?: msRest.RequestOptionsBase): Promise; + /** + * @param resourceGroupName Name of the resource group to which the resource belongs. + * @param name Name of the app. + * @param callback The callback + */ + listDeployments(resourceGroupName: string, name: string, callback: msRest.ServiceCallback): void; + /** + * @param resourceGroupName Name of the resource group to which the resource belongs. + * @param name Name of the app. + * @param options The optional parameters + * @param callback The callback + */ + listDeployments(resourceGroupName: string, name: string, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; + listDeployments(resourceGroupName: string, name: string, options?: msRest.RequestOptionsBase | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { + return this.client.sendOperationRequest( + { + resourceGroupName, + name, + options + }, + listDeploymentsOperationSpec, + callback) as Promise; + } + + /** + * Get a deployment by its ID for an app, or a deployment slot. + * @summary Get a deployment by its ID for an app, or a deployment slot. + * @param resourceGroupName Name of the resource group to which the resource belongs. + * @param name Name of the app. + * @param id Deployment ID. + * @param [options] The optional parameters + * @returns Promise + */ + getDeployment(resourceGroupName: string, name: string, id: string, options?: msRest.RequestOptionsBase): Promise; + /** + * @param resourceGroupName Name of the resource group to which the resource belongs. + * @param name Name of the app. + * @param id Deployment ID. + * @param callback The callback + */ + getDeployment(resourceGroupName: string, name: string, id: string, callback: msRest.ServiceCallback): void; + /** + * @param resourceGroupName Name of the resource group to which the resource belongs. + * @param name Name of the app. + * @param id Deployment ID. + * @param options The optional parameters + * @param callback The callback + */ + getDeployment(resourceGroupName: string, name: string, id: string, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; + getDeployment(resourceGroupName: string, name: string, id: string, options?: msRest.RequestOptionsBase | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { + return this.client.sendOperationRequest( + { + resourceGroupName, + name, + id, + options + }, + getDeploymentOperationSpec, + callback) as Promise; + } + + /** + * Create a deployment for an app, or a deployment slot. + * @summary Create a deployment for an app, or a deployment slot. + * @param resourceGroupName Name of the resource group to which the resource belongs. + * @param name Name of the app. + * @param id ID of an existing deployment. + * @param deployment Deployment details. + * @param [options] The optional parameters + * @returns Promise + */ + createDeployment(resourceGroupName: string, name: string, id: string, deployment: Models.Deployment, options?: msRest.RequestOptionsBase): Promise; + /** + * @param resourceGroupName Name of the resource group to which the resource belongs. + * @param name Name of the app. + * @param id ID of an existing deployment. + * @param deployment Deployment details. + * @param callback The callback + */ + createDeployment(resourceGroupName: string, name: string, id: string, deployment: Models.Deployment, callback: msRest.ServiceCallback): void; + /** + * @param resourceGroupName Name of the resource group to which the resource belongs. + * @param name Name of the app. + * @param id ID of an existing deployment. + * @param deployment Deployment details. + * @param options The optional parameters + * @param callback The callback + */ + createDeployment(resourceGroupName: string, name: string, id: string, deployment: Models.Deployment, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; + createDeployment(resourceGroupName: string, name: string, id: string, deployment: Models.Deployment, options?: msRest.RequestOptionsBase | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { + return this.client.sendOperationRequest( + { + resourceGroupName, + name, + id, + deployment, + options + }, + createDeploymentOperationSpec, + callback) as Promise; + } + + /** + * Delete a deployment by its ID for an app, or a deployment slot. + * @summary Delete a deployment by its ID for an app, or a deployment slot. + * @param resourceGroupName Name of the resource group to which the resource belongs. + * @param name Name of the app. + * @param id Deployment ID. + * @param [options] The optional parameters + * @returns Promise + */ + deleteDeployment(resourceGroupName: string, name: string, id: string, options?: msRest.RequestOptionsBase): Promise; + /** + * @param resourceGroupName Name of the resource group to which the resource belongs. + * @param name Name of the app. + * @param id Deployment ID. + * @param callback The callback + */ + deleteDeployment(resourceGroupName: string, name: string, id: string, callback: msRest.ServiceCallback): void; + /** + * @param resourceGroupName Name of the resource group to which the resource belongs. + * @param name Name of the app. + * @param id Deployment ID. + * @param options The optional parameters + * @param callback The callback + */ + deleteDeployment(resourceGroupName: string, name: string, id: string, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; + deleteDeployment(resourceGroupName: string, name: string, id: string, options?: msRest.RequestOptionsBase | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { + return this.client.sendOperationRequest( + { + resourceGroupName, + name, + id, + options + }, + deleteDeploymentOperationSpec, + callback); + } + + /** + * List deployment log for specific deployment for an app, or a deployment slot. + * @summary List deployment log for specific deployment for an app, or a deployment slot. + * @param resourceGroupName Name of the resource group to which the resource belongs. + * @param name Name of the app. + * @param 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 [options] The optional parameters + * @returns Promise + */ + listDeploymentLog(resourceGroupName: string, name: string, id: string, options?: msRest.RequestOptionsBase): Promise; + /** + * @param resourceGroupName Name of the resource group to which the resource belongs. + * @param name Name of the app. + * @param 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 callback The callback + */ + listDeploymentLog(resourceGroupName: string, name: string, id: string, callback: msRest.ServiceCallback): void; + /** + * @param resourceGroupName Name of the resource group to which the resource belongs. + * @param name Name of the app. + * @param 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 options The optional parameters + * @param callback The callback + */ + listDeploymentLog(resourceGroupName: string, name: string, id: string, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; + listDeploymentLog(resourceGroupName: string, name: string, id: string, options?: msRest.RequestOptionsBase | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { + return this.client.sendOperationRequest( + { + resourceGroupName, + name, + id, + options + }, + listDeploymentLogOperationSpec, + callback) as Promise; + } + + /** + * 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. + * @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. + * @param resourceGroupName Name of the resource group to which the resource belongs. + * @param name Name of the app. + * @param request A RestoreRequest object that includes Azure storage URL and blog name for + * discovery of backup. + * @param [options] The optional parameters + * @returns Promise + */ + discoverBackup(resourceGroupName: string, name: string, request: Models.RestoreRequest, options?: msRest.RequestOptionsBase): Promise; + /** + * @param resourceGroupName Name of the resource group to which the resource belongs. + * @param name Name of the app. + * @param request A RestoreRequest object that includes Azure storage URL and blog name for + * discovery of backup. + * @param callback The callback + */ + discoverBackup(resourceGroupName: string, name: string, request: Models.RestoreRequest, callback: msRest.ServiceCallback): void; + /** + * @param resourceGroupName Name of the resource group to which the resource belongs. + * @param name Name of the app. + * @param request A RestoreRequest object that includes Azure storage URL and blog name for + * discovery of backup. + * @param options The optional parameters + * @param callback The callback + */ + discoverBackup(resourceGroupName: string, name: string, request: Models.RestoreRequest, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; + discoverBackup(resourceGroupName: string, name: string, request: Models.RestoreRequest, options?: msRest.RequestOptionsBase | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { + return this.client.sendOperationRequest( + { + resourceGroupName, + name, + request, + options + }, + discoverBackupOperationSpec, + callback) as Promise; + } + + /** + * Lists ownership identifiers for domain associated with web app. + * @summary Lists ownership identifiers for domain associated with web app. + * @param resourceGroupName Name of the resource group to which the resource belongs. + * @param name Name of the app. + * @param [options] The optional parameters + * @returns Promise + */ + listDomainOwnershipIdentifiers(resourceGroupName: string, name: string, options?: msRest.RequestOptionsBase): Promise; + /** + * @param resourceGroupName Name of the resource group to which the resource belongs. + * @param name Name of the app. + * @param callback The callback + */ + listDomainOwnershipIdentifiers(resourceGroupName: string, name: string, callback: msRest.ServiceCallback): void; + /** + * @param resourceGroupName Name of the resource group to which the resource belongs. + * @param name Name of the app. + * @param options The optional parameters + * @param callback The callback + */ + listDomainOwnershipIdentifiers(resourceGroupName: string, name: string, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; + listDomainOwnershipIdentifiers(resourceGroupName: string, name: string, options?: msRest.RequestOptionsBase | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { + return this.client.sendOperationRequest( + { + resourceGroupName, + name, + options + }, + listDomainOwnershipIdentifiersOperationSpec, + callback) as Promise; + } + + /** + * Get domain ownership identifier for web app. + * @summary Get domain ownership identifier for web app. + * @param resourceGroupName Name of the resource group to which the resource belongs. + * @param name Name of the app. + * @param domainOwnershipIdentifierName Name of domain ownership identifier. + * @param [options] The optional parameters + * @returns Promise + */ + getDomainOwnershipIdentifier(resourceGroupName: string, name: string, domainOwnershipIdentifierName: string, options?: msRest.RequestOptionsBase): Promise; + /** + * @param resourceGroupName Name of the resource group to which the resource belongs. + * @param name Name of the app. + * @param domainOwnershipIdentifierName Name of domain ownership identifier. + * @param callback The callback + */ + getDomainOwnershipIdentifier(resourceGroupName: string, name: string, domainOwnershipIdentifierName: string, callback: msRest.ServiceCallback): void; + /** + * @param resourceGroupName Name of the resource group to which the resource belongs. + * @param name Name of the app. + * @param domainOwnershipIdentifierName Name of domain ownership identifier. + * @param options The optional parameters + * @param callback The callback + */ + getDomainOwnershipIdentifier(resourceGroupName: string, name: string, domainOwnershipIdentifierName: string, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; + getDomainOwnershipIdentifier(resourceGroupName: string, name: string, domainOwnershipIdentifierName: string, options?: msRest.RequestOptionsBase | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { + return this.client.sendOperationRequest( + { + resourceGroupName, + name, + domainOwnershipIdentifierName, + options + }, + getDomainOwnershipIdentifierOperationSpec, + callback) as Promise; + } + + /** + * Creates a domain ownership identifier for web app, or updates an existing ownership identifier. + * @summary Creates a domain ownership identifier for web app, or updates an existing ownership + * identifier. + * @param resourceGroupName Name of the resource group to which the resource belongs. + * @param name Name of the app. + * @param domainOwnershipIdentifierName Name of domain ownership identifier. + * @param domainOwnershipIdentifier A JSON representation of the domain ownership properties. + * @param [options] The optional parameters + * @returns Promise + */ + createOrUpdateDomainOwnershipIdentifier(resourceGroupName: string, name: string, domainOwnershipIdentifierName: string, domainOwnershipIdentifier: Models.Identifier, options?: msRest.RequestOptionsBase): Promise; + /** + * @param resourceGroupName Name of the resource group to which the resource belongs. + * @param name Name of the app. + * @param domainOwnershipIdentifierName Name of domain ownership identifier. + * @param domainOwnershipIdentifier A JSON representation of the domain ownership properties. + * @param callback The callback + */ + createOrUpdateDomainOwnershipIdentifier(resourceGroupName: string, name: string, domainOwnershipIdentifierName: string, domainOwnershipIdentifier: Models.Identifier, callback: msRest.ServiceCallback): void; + /** + * @param resourceGroupName Name of the resource group to which the resource belongs. + * @param name Name of the app. + * @param domainOwnershipIdentifierName Name of domain ownership identifier. + * @param domainOwnershipIdentifier A JSON representation of the domain ownership properties. + * @param options The optional parameters + * @param callback The callback + */ + createOrUpdateDomainOwnershipIdentifier(resourceGroupName: string, name: string, domainOwnershipIdentifierName: string, domainOwnershipIdentifier: Models.Identifier, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; + createOrUpdateDomainOwnershipIdentifier(resourceGroupName: string, name: string, domainOwnershipIdentifierName: string, domainOwnershipIdentifier: Models.Identifier, options?: msRest.RequestOptionsBase | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { + return this.client.sendOperationRequest( + { + resourceGroupName, + name, + domainOwnershipIdentifierName, + domainOwnershipIdentifier, + options + }, + createOrUpdateDomainOwnershipIdentifierOperationSpec, + callback) as Promise; + } + + /** + * Deletes a domain ownership identifier for a web app. + * @summary Deletes a domain ownership identifier for a web app. + * @param resourceGroupName Name of the resource group to which the resource belongs. + * @param name Name of the app. + * @param domainOwnershipIdentifierName Name of domain ownership identifier. + * @param [options] The optional parameters + * @returns Promise + */ + deleteDomainOwnershipIdentifier(resourceGroupName: string, name: string, domainOwnershipIdentifierName: string, options?: msRest.RequestOptionsBase): Promise; + /** + * @param resourceGroupName Name of the resource group to which the resource belongs. + * @param name Name of the app. + * @param domainOwnershipIdentifierName Name of domain ownership identifier. + * @param callback The callback + */ + deleteDomainOwnershipIdentifier(resourceGroupName: string, name: string, domainOwnershipIdentifierName: string, callback: msRest.ServiceCallback): void; + /** + * @param resourceGroupName Name of the resource group to which the resource belongs. + * @param name Name of the app. + * @param domainOwnershipIdentifierName Name of domain ownership identifier. + * @param options The optional parameters + * @param callback The callback + */ + deleteDomainOwnershipIdentifier(resourceGroupName: string, name: string, domainOwnershipIdentifierName: string, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; + deleteDomainOwnershipIdentifier(resourceGroupName: string, name: string, domainOwnershipIdentifierName: string, options?: msRest.RequestOptionsBase | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { + return this.client.sendOperationRequest( + { + resourceGroupName, + name, + domainOwnershipIdentifierName, + options + }, + deleteDomainOwnershipIdentifierOperationSpec, + callback); + } + + /** + * Creates a domain ownership identifier for web app, or updates an existing ownership identifier. + * @summary Creates a domain ownership identifier for web app, or updates an existing ownership + * identifier. + * @param resourceGroupName Name of the resource group to which the resource belongs. + * @param name Name of the app. + * @param domainOwnershipIdentifierName Name of domain ownership identifier. + * @param domainOwnershipIdentifier A JSON representation of the domain ownership properties. + * @param [options] The optional parameters + * @returns Promise + */ + updateDomainOwnershipIdentifier(resourceGroupName: string, name: string, domainOwnershipIdentifierName: string, domainOwnershipIdentifier: Models.Identifier, options?: msRest.RequestOptionsBase): Promise; + /** + * @param resourceGroupName Name of the resource group to which the resource belongs. + * @param name Name of the app. + * @param domainOwnershipIdentifierName Name of domain ownership identifier. + * @param domainOwnershipIdentifier A JSON representation of the domain ownership properties. + * @param callback The callback + */ + updateDomainOwnershipIdentifier(resourceGroupName: string, name: string, domainOwnershipIdentifierName: string, domainOwnershipIdentifier: Models.Identifier, callback: msRest.ServiceCallback): void; + /** + * @param resourceGroupName Name of the resource group to which the resource belongs. + * @param name Name of the app. + * @param domainOwnershipIdentifierName Name of domain ownership identifier. + * @param domainOwnershipIdentifier A JSON representation of the domain ownership properties. + * @param options The optional parameters + * @param callback The callback + */ + updateDomainOwnershipIdentifier(resourceGroupName: string, name: string, domainOwnershipIdentifierName: string, domainOwnershipIdentifier: Models.Identifier, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; + updateDomainOwnershipIdentifier(resourceGroupName: string, name: string, domainOwnershipIdentifierName: string, domainOwnershipIdentifier: Models.Identifier, options?: msRest.RequestOptionsBase | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { + return this.client.sendOperationRequest( + { + resourceGroupName, + name, + domainOwnershipIdentifierName, + domainOwnershipIdentifier, + options + }, + updateDomainOwnershipIdentifierOperationSpec, + callback) as Promise; + } + + /** + * Get the status of the last MSDeploy operation. + * @summary Get the status of the last MSDeploy operation. + * @param resourceGroupName Name of the resource group to which the resource belongs. + * @param name Name of web app. + * @param [options] The optional parameters + * @returns Promise + */ + getMSDeployStatus(resourceGroupName: string, name: string, options?: msRest.RequestOptionsBase): Promise; + /** + * @param resourceGroupName Name of the resource group to which the resource belongs. + * @param name Name of web app. + * @param callback The callback + */ + getMSDeployStatus(resourceGroupName: string, name: string, callback: msRest.ServiceCallback): void; + /** + * @param resourceGroupName Name of the resource group to which the resource belongs. + * @param name Name of web app. + * @param options The optional parameters + * @param callback The callback + */ + getMSDeployStatus(resourceGroupName: string, name: string, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; + getMSDeployStatus(resourceGroupName: string, name: string, options?: msRest.RequestOptionsBase | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { + return this.client.sendOperationRequest( + { + resourceGroupName, + name, + options + }, + getMSDeployStatusOperationSpec, + callback) as Promise; + } + + /** + * Invoke the MSDeploy web app extension. + * @summary Invoke the MSDeploy web app extension. + * @param resourceGroupName Name of the resource group to which the resource belongs. + * @param name Name of web app. + * @param mSDeploy Details of MSDeploy operation + * @param [options] The optional parameters + * @returns Promise + */ + createMSDeployOperation(resourceGroupName: string, name: string, mSDeploy: Models.MSDeploy, options?: msRest.RequestOptionsBase): Promise { + return this.beginCreateMSDeployOperation(resourceGroupName,name,mSDeploy,options) + .then(lroPoller => lroPoller.pollUntilFinished()) as Promise; + } + + /** + * Get the MSDeploy Log for the last MSDeploy operation. + * @summary Get the MSDeploy Log for the last MSDeploy operation. + * @param resourceGroupName Name of the resource group to which the resource belongs. + * @param name Name of web app. + * @param [options] The optional parameters + * @returns Promise + */ + getMSDeployLog(resourceGroupName: string, name: string, options?: msRest.RequestOptionsBase): Promise; + /** + * @param resourceGroupName Name of the resource group to which the resource belongs. + * @param name Name of web app. + * @param callback The callback + */ + getMSDeployLog(resourceGroupName: string, name: string, callback: msRest.ServiceCallback): void; + /** + * @param resourceGroupName Name of the resource group to which the resource belongs. + * @param name Name of web app. + * @param options The optional parameters + * @param callback The callback + */ + getMSDeployLog(resourceGroupName: string, name: string, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; + getMSDeployLog(resourceGroupName: string, name: string, options?: msRest.RequestOptionsBase | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { + return this.client.sendOperationRequest( + { + resourceGroupName, + name, + options + }, + getMSDeployLogOperationSpec, + callback) as Promise; + } + + /** + * List the functions for a web site, or a deployment slot. + * @summary List the functions for a web site, or a deployment slot. + * @param resourceGroupName Name of the resource group to which the resource belongs. + * @param name Site name. + * @param [options] The optional parameters + * @returns Promise + */ + listFunctions(resourceGroupName: string, name: string, options?: msRest.RequestOptionsBase): Promise; + /** + * @param resourceGroupName Name of the resource group to which the resource belongs. + * @param name Site name. + * @param callback The callback + */ + listFunctions(resourceGroupName: string, name: string, callback: msRest.ServiceCallback): void; + /** + * @param resourceGroupName Name of the resource group to which the resource belongs. + * @param name Site name. + * @param options The optional parameters + * @param callback The callback + */ + listFunctions(resourceGroupName: string, name: string, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; + listFunctions(resourceGroupName: string, name: string, options?: msRest.RequestOptionsBase | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { + return this.client.sendOperationRequest( + { + resourceGroupName, + name, + options + }, + listFunctionsOperationSpec, + callback) as Promise; + } + + /** + * Fetch a short lived token that can be exchanged for a master key. + * @summary Fetch a short lived token that can be exchanged for a master key. + * @param resourceGroupName Name of the resource group to which the resource belongs. + * @param name Name of web app. + * @param [options] The optional parameters + * @returns Promise + */ + getFunctionsAdminToken(resourceGroupName: string, name: string, options?: msRest.RequestOptionsBase): Promise; + /** + * @param resourceGroupName Name of the resource group to which the resource belongs. + * @param name Name of web app. + * @param callback The callback + */ + getFunctionsAdminToken(resourceGroupName: string, name: string, callback: msRest.ServiceCallback): void; + /** + * @param resourceGroupName Name of the resource group to which the resource belongs. + * @param name Name of web app. + * @param options The optional parameters + * @param callback The callback + */ + getFunctionsAdminToken(resourceGroupName: string, name: string, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; + getFunctionsAdminToken(resourceGroupName: string, name: string, options?: msRest.RequestOptionsBase | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { + return this.client.sendOperationRequest( + { + resourceGroupName, + name, + options + }, + getFunctionsAdminTokenOperationSpec, + callback) as Promise; + } + + /** + * Get function information by its ID for web site, or a deployment slot. + * @summary Get function information by its ID for web site, or a deployment slot. + * @param resourceGroupName Name of the resource group to which the resource belongs. + * @param name Site name. + * @param functionName Function name. + * @param [options] The optional parameters + * @returns Promise + */ + getFunction(resourceGroupName: string, name: string, functionName: string, options?: msRest.RequestOptionsBase): Promise; + /** + * @param resourceGroupName Name of the resource group to which the resource belongs. + * @param name Site name. + * @param functionName Function name. + * @param callback The callback + */ + getFunction(resourceGroupName: string, name: string, functionName: string, callback: msRest.ServiceCallback): void; + /** + * @param resourceGroupName Name of the resource group to which the resource belongs. + * @param name Site name. + * @param functionName Function name. + * @param options The optional parameters + * @param callback The callback + */ + getFunction(resourceGroupName: string, name: string, functionName: string, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; + getFunction(resourceGroupName: string, name: string, functionName: string, options?: msRest.RequestOptionsBase | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { + return this.client.sendOperationRequest( + { + resourceGroupName, + name, + functionName, + options + }, + getFunctionOperationSpec, + callback) as Promise; + } + + /** + * Create function for web site, or a deployment slot. + * @summary Create function for web site, or a deployment slot. + * @param resourceGroupName Name of the resource group to which the resource belongs. + * @param name Site name. + * @param functionName Function name. + * @param functionEnvelope Function details. + * @param [options] The optional parameters + * @returns Promise + */ + createFunction(resourceGroupName: string, name: string, functionName: string, functionEnvelope: Models.FunctionEnvelope, options?: msRest.RequestOptionsBase): Promise { + return this.beginCreateFunction(resourceGroupName,name,functionName,functionEnvelope,options) + .then(lroPoller => lroPoller.pollUntilFinished()) as Promise; + } + + /** + * Delete a function for web site, or a deployment slot. + * @summary Delete a function for web site, or a deployment slot. + * @param resourceGroupName Name of the resource group to which the resource belongs. + * @param name Site name. + * @param functionName Function name. + * @param [options] The optional parameters + * @returns Promise + */ + deleteFunction(resourceGroupName: string, name: string, functionName: string, options?: msRest.RequestOptionsBase): Promise; + /** + * @param resourceGroupName Name of the resource group to which the resource belongs. + * @param name Site name. + * @param functionName Function name. + * @param callback The callback + */ + deleteFunction(resourceGroupName: string, name: string, functionName: string, callback: msRest.ServiceCallback): void; + /** + * @param resourceGroupName Name of the resource group to which the resource belongs. + * @param name Site name. + * @param functionName Function name. + * @param options The optional parameters + * @param callback The callback + */ + deleteFunction(resourceGroupName: string, name: string, functionName: string, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; + deleteFunction(resourceGroupName: string, name: string, functionName: string, options?: msRest.RequestOptionsBase | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { + return this.client.sendOperationRequest( + { + resourceGroupName, + name, + functionName, + options + }, + deleteFunctionOperationSpec, + callback); + } + + /** + * Get function secrets for a function in a web site, or a deployment slot. + * @summary Get function secrets for a function in a web site, or a deployment slot. + * @param resourceGroupName Name of the resource group to which the resource belongs. + * @param name Site name. + * @param functionName Function name. + * @param [options] The optional parameters + * @returns Promise + */ + listFunctionSecrets(resourceGroupName: string, name: string, functionName: string, options?: msRest.RequestOptionsBase): Promise; + /** + * @param resourceGroupName Name of the resource group to which the resource belongs. + * @param name Site name. + * @param functionName Function name. + * @param callback The callback + */ + listFunctionSecrets(resourceGroupName: string, name: string, functionName: string, callback: msRest.ServiceCallback): void; + /** + * @param resourceGroupName Name of the resource group to which the resource belongs. + * @param name Site name. + * @param functionName Function name. + * @param options The optional parameters + * @param callback The callback + */ + listFunctionSecrets(resourceGroupName: string, name: string, functionName: string, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; + listFunctionSecrets(resourceGroupName: string, name: string, functionName: string, options?: msRest.RequestOptionsBase | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { + return this.client.sendOperationRequest( + { + resourceGroupName, + name, + functionName, + options + }, + listFunctionSecretsOperationSpec, + callback) as Promise; + } + + /** + * Get hostname bindings for an app or a deployment slot. + * @summary Get hostname bindings for an app or a deployment slot. + * @param resourceGroupName Name of the resource group to which the resource belongs. + * @param name Name of the app. + * @param [options] The optional parameters + * @returns Promise + */ + listHostNameBindings(resourceGroupName: string, name: string, options?: msRest.RequestOptionsBase): Promise; + /** + * @param resourceGroupName Name of the resource group to which the resource belongs. + * @param name Name of the app. + * @param callback The callback + */ + listHostNameBindings(resourceGroupName: string, name: string, callback: msRest.ServiceCallback): void; + /** + * @param resourceGroupName Name of the resource group to which the resource belongs. + * @param name Name of the app. + * @param options The optional parameters + * @param callback The callback + */ + listHostNameBindings(resourceGroupName: string, name: string, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; + listHostNameBindings(resourceGroupName: string, name: string, options?: msRest.RequestOptionsBase | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { + return this.client.sendOperationRequest( + { + resourceGroupName, + name, + options + }, + listHostNameBindingsOperationSpec, + callback) as Promise; + } + + /** + * Get the named hostname binding for an app (or deployment slot, if specified). + * @summary Get the named hostname binding for an app (or deployment slot, if specified). + * @param resourceGroupName Name of the resource group to which the resource belongs. + * @param name Name of the app. + * @param hostName Hostname in the hostname binding. + * @param [options] The optional parameters + * @returns Promise + */ + getHostNameBinding(resourceGroupName: string, name: string, hostName: string, options?: msRest.RequestOptionsBase): Promise; + /** + * @param resourceGroupName Name of the resource group to which the resource belongs. + * @param name Name of the app. + * @param hostName Hostname in the hostname binding. + * @param callback The callback + */ + getHostNameBinding(resourceGroupName: string, name: string, hostName: string, callback: msRest.ServiceCallback): void; + /** + * @param resourceGroupName Name of the resource group to which the resource belongs. + * @param name Name of the app. + * @param hostName Hostname in the hostname binding. + * @param options The optional parameters + * @param callback The callback + */ + getHostNameBinding(resourceGroupName: string, name: string, hostName: string, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; + getHostNameBinding(resourceGroupName: string, name: string, hostName: string, options?: msRest.RequestOptionsBase | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { + return this.client.sendOperationRequest( + { + resourceGroupName, + name, + hostName, + options + }, + getHostNameBindingOperationSpec, + callback) as Promise; + } + + /** + * Creates a hostname binding for an app. + * @summary Creates a hostname binding for an app. + * @param resourceGroupName Name of the resource group to which the resource belongs. + * @param name Name of the app. + * @param hostName Hostname in the hostname binding. + * @param hostNameBinding Binding details. This is the JSON representation of a HostNameBinding + * object. + * @param [options] The optional parameters + * @returns Promise + */ + createOrUpdateHostNameBinding(resourceGroupName: string, name: string, hostName: string, hostNameBinding: Models.HostNameBinding, options?: msRest.RequestOptionsBase): Promise; + /** + * @param resourceGroupName Name of the resource group to which the resource belongs. + * @param name Name of the app. + * @param hostName Hostname in the hostname binding. + * @param hostNameBinding Binding details. This is the JSON representation of a HostNameBinding + * object. + * @param callback The callback + */ + createOrUpdateHostNameBinding(resourceGroupName: string, name: string, hostName: string, hostNameBinding: Models.HostNameBinding, callback: msRest.ServiceCallback): void; + /** + * @param resourceGroupName Name of the resource group to which the resource belongs. + * @param name Name of the app. + * @param hostName Hostname in the hostname binding. + * @param hostNameBinding Binding details. This is the JSON representation of a HostNameBinding + * object. + * @param options The optional parameters + * @param callback The callback + */ + createOrUpdateHostNameBinding(resourceGroupName: string, name: string, hostName: string, hostNameBinding: Models.HostNameBinding, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; + createOrUpdateHostNameBinding(resourceGroupName: string, name: string, hostName: string, hostNameBinding: Models.HostNameBinding, options?: msRest.RequestOptionsBase | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { + return this.client.sendOperationRequest( + { + resourceGroupName, + name, + hostName, + hostNameBinding, + options + }, + createOrUpdateHostNameBindingOperationSpec, + callback) as Promise; + } + + /** + * Deletes a hostname binding for an app. + * @summary Deletes a hostname binding for an app. + * @param resourceGroupName Name of the resource group to which the resource belongs. + * @param name Name of the app. + * @param hostName Hostname in the hostname binding. + * @param [options] The optional parameters + * @returns Promise + */ + deleteHostNameBinding(resourceGroupName: string, name: string, hostName: string, options?: msRest.RequestOptionsBase): Promise; + /** + * @param resourceGroupName Name of the resource group to which the resource belongs. + * @param name Name of the app. + * @param hostName Hostname in the hostname binding. + * @param callback The callback + */ + deleteHostNameBinding(resourceGroupName: string, name: string, hostName: string, callback: msRest.ServiceCallback): void; + /** + * @param resourceGroupName Name of the resource group to which the resource belongs. + * @param name Name of the app. + * @param hostName Hostname in the hostname binding. + * @param options The optional parameters + * @param callback The callback + */ + deleteHostNameBinding(resourceGroupName: string, name: string, hostName: string, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; + deleteHostNameBinding(resourceGroupName: string, name: string, hostName: string, options?: msRest.RequestOptionsBase | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { + return this.client.sendOperationRequest( + { + resourceGroupName, + name, + hostName, + options + }, + deleteHostNameBindingOperationSpec, + callback); + } + + /** + * Retrieves a specific Service Bus Hybrid Connection used by this Web App. + * @summary Retrieves a specific Service Bus Hybrid Connection used by this Web App. + * @param resourceGroupName Name of the resource group to which the resource belongs. + * @param name The name of the web app. + * @param namespaceName The namespace for this hybrid connection. + * @param relayName The relay name for this hybrid connection. + * @param [options] The optional parameters + * @returns Promise + */ + getHybridConnection(resourceGroupName: string, name: string, namespaceName: string, relayName: string, options?: msRest.RequestOptionsBase): Promise; + /** + * @param resourceGroupName Name of the resource group to which the resource belongs. + * @param name The name of the web app. + * @param namespaceName The namespace for this hybrid connection. + * @param relayName The relay name for this hybrid connection. + * @param callback The callback + */ + getHybridConnection(resourceGroupName: string, name: string, namespaceName: string, relayName: string, callback: msRest.ServiceCallback): void; + /** + * @param resourceGroupName Name of the resource group to which the resource belongs. + * @param name The name of the web app. + * @param namespaceName The namespace for this hybrid connection. + * @param relayName The relay name for this hybrid connection. + * @param options The optional parameters + * @param callback The callback + */ + getHybridConnection(resourceGroupName: string, name: string, namespaceName: string, relayName: string, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; + getHybridConnection(resourceGroupName: string, name: string, namespaceName: string, relayName: string, options?: msRest.RequestOptionsBase | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { + return this.client.sendOperationRequest( + { + resourceGroupName, + name, + namespaceName, + relayName, + options + }, + getHybridConnectionOperationSpec, + callback) as Promise; + } + + /** + * Creates a new Hybrid Connection using a Service Bus relay. + * @summary Creates a new Hybrid Connection using a Service Bus relay. + * @param resourceGroupName Name of the resource group to which the resource belongs. + * @param name The name of the web app. + * @param namespaceName The namespace for this hybrid connection. + * @param relayName The relay name for this hybrid connection. + * @param connectionEnvelope The details of the hybrid connection. + * @param [options] The optional parameters + * @returns Promise + */ + createOrUpdateHybridConnection(resourceGroupName: string, name: string, namespaceName: string, relayName: string, connectionEnvelope: Models.HybridConnection, options?: msRest.RequestOptionsBase): Promise; + /** + * @param resourceGroupName Name of the resource group to which the resource belongs. + * @param name The name of the web app. + * @param namespaceName The namespace for this hybrid connection. + * @param relayName The relay name for this hybrid connection. + * @param connectionEnvelope The details of the hybrid connection. + * @param callback The callback + */ + createOrUpdateHybridConnection(resourceGroupName: string, name: string, namespaceName: string, relayName: string, connectionEnvelope: Models.HybridConnection, callback: msRest.ServiceCallback): void; + /** + * @param resourceGroupName Name of the resource group to which the resource belongs. + * @param name The name of the web app. + * @param namespaceName The namespace for this hybrid connection. + * @param relayName The relay name for this hybrid connection. + * @param connectionEnvelope The details of the hybrid connection. + * @param options The optional parameters + * @param callback The callback + */ + createOrUpdateHybridConnection(resourceGroupName: string, name: string, namespaceName: string, relayName: string, connectionEnvelope: Models.HybridConnection, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; + createOrUpdateHybridConnection(resourceGroupName: string, name: string, namespaceName: string, relayName: string, connectionEnvelope: Models.HybridConnection, options?: msRest.RequestOptionsBase | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { + return this.client.sendOperationRequest( + { + resourceGroupName, + name, + namespaceName, + relayName, + connectionEnvelope, + options + }, + createOrUpdateHybridConnectionOperationSpec, + callback) as Promise; + } + + /** + * Removes a Hybrid Connection from this site. + * @summary Removes a Hybrid Connection from this site. + * @param resourceGroupName Name of the resource group to which the resource belongs. + * @param name The name of the web app. + * @param namespaceName The namespace for this hybrid connection. + * @param relayName The relay name for this hybrid connection. + * @param [options] The optional parameters + * @returns Promise + */ + deleteHybridConnection(resourceGroupName: string, name: string, namespaceName: string, relayName: string, options?: msRest.RequestOptionsBase): Promise; + /** + * @param resourceGroupName Name of the resource group to which the resource belongs. + * @param name The name of the web app. + * @param namespaceName The namespace for this hybrid connection. + * @param relayName The relay name for this hybrid connection. + * @param callback The callback + */ + deleteHybridConnection(resourceGroupName: string, name: string, namespaceName: string, relayName: string, callback: msRest.ServiceCallback): void; + /** + * @param resourceGroupName Name of the resource group to which the resource belongs. + * @param name The name of the web app. + * @param namespaceName The namespace for this hybrid connection. + * @param relayName The relay name for this hybrid connection. + * @param options The optional parameters + * @param callback The callback + */ + deleteHybridConnection(resourceGroupName: string, name: string, namespaceName: string, relayName: string, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; + deleteHybridConnection(resourceGroupName: string, name: string, namespaceName: string, relayName: string, options?: msRest.RequestOptionsBase | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { + return this.client.sendOperationRequest( + { + resourceGroupName, + name, + namespaceName, + relayName, + options + }, + deleteHybridConnectionOperationSpec, + callback); + } + + /** + * Creates a new Hybrid Connection using a Service Bus relay. + * @summary Creates a new Hybrid Connection using a Service Bus relay. + * @param resourceGroupName Name of the resource group to which the resource belongs. + * @param name The name of the web app. + * @param namespaceName The namespace for this hybrid connection. + * @param relayName The relay name for this hybrid connection. + * @param connectionEnvelope The details of the hybrid connection. + * @param [options] The optional parameters + * @returns Promise + */ + updateHybridConnection(resourceGroupName: string, name: string, namespaceName: string, relayName: string, connectionEnvelope: Models.HybridConnection, options?: msRest.RequestOptionsBase): Promise; + /** + * @param resourceGroupName Name of the resource group to which the resource belongs. + * @param name The name of the web app. + * @param namespaceName The namespace for this hybrid connection. + * @param relayName The relay name for this hybrid connection. + * @param connectionEnvelope The details of the hybrid connection. + * @param callback The callback + */ + updateHybridConnection(resourceGroupName: string, name: string, namespaceName: string, relayName: string, connectionEnvelope: Models.HybridConnection, callback: msRest.ServiceCallback): void; + /** + * @param resourceGroupName Name of the resource group to which the resource belongs. + * @param name The name of the web app. + * @param namespaceName The namespace for this hybrid connection. + * @param relayName The relay name for this hybrid connection. + * @param connectionEnvelope The details of the hybrid connection. + * @param options The optional parameters + * @param callback The callback + */ + updateHybridConnection(resourceGroupName: string, name: string, namespaceName: string, relayName: string, connectionEnvelope: Models.HybridConnection, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; + updateHybridConnection(resourceGroupName: string, name: string, namespaceName: string, relayName: string, connectionEnvelope: Models.HybridConnection, options?: msRest.RequestOptionsBase | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { + return this.client.sendOperationRequest( + { + resourceGroupName, + name, + namespaceName, + relayName, + connectionEnvelope, + options + }, + updateHybridConnectionOperationSpec, + callback) as Promise; + } + + /** + * Gets the send key name and value for a Hybrid Connection. + * @summary Gets the send key name and value for a Hybrid Connection. + * @param resourceGroupName Name of the resource group to which the resource belongs. + * @param name The name of the web app. + * @param namespaceName The namespace for this hybrid connection. + * @param relayName The relay name for this hybrid connection. + * @param [options] The optional parameters + * @returns Promise + */ + listHybridConnectionKeys(resourceGroupName: string, name: string, namespaceName: string, relayName: string, options?: msRest.RequestOptionsBase): Promise; + /** + * @param resourceGroupName Name of the resource group to which the resource belongs. + * @param name The name of the web app. + * @param namespaceName The namespace for this hybrid connection. + * @param relayName The relay name for this hybrid connection. + * @param callback The callback + */ + listHybridConnectionKeys(resourceGroupName: string, name: string, namespaceName: string, relayName: string, callback: msRest.ServiceCallback): void; + /** + * @param resourceGroupName Name of the resource group to which the resource belongs. + * @param name The name of the web app. + * @param namespaceName The namespace for this hybrid connection. + * @param relayName The relay name for this hybrid connection. + * @param options The optional parameters + * @param callback The callback + */ + listHybridConnectionKeys(resourceGroupName: string, name: string, namespaceName: string, relayName: string, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; + listHybridConnectionKeys(resourceGroupName: string, name: string, namespaceName: string, relayName: string, options?: msRest.RequestOptionsBase | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { + return this.client.sendOperationRequest( + { + resourceGroupName, + name, + namespaceName, + relayName, + options + }, + listHybridConnectionKeysOperationSpec, + callback) as Promise; + } + + /** + * Retrieves all Service Bus Hybrid Connections used by this Web App. + * @summary Retrieves all Service Bus Hybrid Connections used by this Web App. + * @param resourceGroupName Name of the resource group to which the resource belongs. + * @param name The name of the web app. + * @param [options] The optional parameters + * @returns Promise + */ + listHybridConnections(resourceGroupName: string, name: string, options?: msRest.RequestOptionsBase): Promise; + /** + * @param resourceGroupName Name of the resource group to which the resource belongs. + * @param name The name of the web app. + * @param callback The callback + */ + listHybridConnections(resourceGroupName: string, name: string, callback: msRest.ServiceCallback): void; + /** + * @param resourceGroupName Name of the resource group to which the resource belongs. + * @param name The name of the web app. + * @param options The optional parameters + * @param callback The callback + */ + listHybridConnections(resourceGroupName: string, name: string, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; + listHybridConnections(resourceGroupName: string, name: string, options?: msRest.RequestOptionsBase | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { + return this.client.sendOperationRequest( + { + resourceGroupName, + name, + options + }, + listHybridConnectionsOperationSpec, + callback) as Promise; + } + + /** + * Gets hybrid connections configured for an app (or deployment slot, if specified). + * @summary Gets hybrid connections configured for an app (or deployment slot, if specified). + * @param resourceGroupName Name of the resource group to which the resource belongs. + * @param name Name of the app. + * @param [options] The optional parameters + * @returns Promise + */ + listRelayServiceConnections(resourceGroupName: string, name: string, options?: msRest.RequestOptionsBase): Promise; + /** + * @param resourceGroupName Name of the resource group to which the resource belongs. + * @param name Name of the app. + * @param callback The callback + */ + listRelayServiceConnections(resourceGroupName: string, name: string, callback: msRest.ServiceCallback): void; + /** + * @param resourceGroupName Name of the resource group to which the resource belongs. + * @param name Name of the app. + * @param options The optional parameters + * @param callback The callback + */ + listRelayServiceConnections(resourceGroupName: string, name: string, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; + listRelayServiceConnections(resourceGroupName: string, name: string, options?: msRest.RequestOptionsBase | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { + return this.client.sendOperationRequest( + { + resourceGroupName, + name, + options + }, + listRelayServiceConnectionsOperationSpec, + callback) as Promise; + } + + /** + * Gets a hybrid connection configuration by its name. + * @summary Gets a hybrid connection configuration by its name. + * @param resourceGroupName Name of the resource group to which the resource belongs. + * @param name Name of the app. + * @param entityName Name of the hybrid connection. + * @param [options] The optional parameters + * @returns Promise + */ + getRelayServiceConnection(resourceGroupName: string, name: string, entityName: string, options?: msRest.RequestOptionsBase): Promise; + /** + * @param resourceGroupName Name of the resource group to which the resource belongs. + * @param name Name of the app. + * @param entityName Name of the hybrid connection. + * @param callback The callback + */ + getRelayServiceConnection(resourceGroupName: string, name: string, entityName: string, callback: msRest.ServiceCallback): void; + /** + * @param resourceGroupName Name of the resource group to which the resource belongs. + * @param name Name of the app. + * @param entityName Name of the hybrid connection. + * @param options The optional parameters + * @param callback The callback + */ + getRelayServiceConnection(resourceGroupName: string, name: string, entityName: string, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; + getRelayServiceConnection(resourceGroupName: string, name: string, entityName: string, options?: msRest.RequestOptionsBase | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { + return this.client.sendOperationRequest( + { + resourceGroupName, + name, + entityName, + options + }, + getRelayServiceConnectionOperationSpec, + callback) as Promise; + } + + /** + * Creates a new hybrid connection configuration (PUT), or updates an existing one (PATCH). + * @summary Creates a new hybrid connection configuration (PUT), or updates an existing one + * (PATCH). + * @param resourceGroupName Name of the resource group to which the resource belongs. + * @param name Name of the app. + * @param entityName Name of the hybrid connection configuration. + * @param connectionEnvelope Details of the hybrid connection configuration. + * @param [options] The optional parameters + * @returns Promise + */ + createOrUpdateRelayServiceConnection(resourceGroupName: string, name: string, entityName: string, connectionEnvelope: Models.RelayServiceConnectionEntity, options?: msRest.RequestOptionsBase): Promise; + /** + * @param resourceGroupName Name of the resource group to which the resource belongs. + * @param name Name of the app. + * @param entityName Name of the hybrid connection configuration. + * @param connectionEnvelope Details of the hybrid connection configuration. + * @param callback The callback + */ + createOrUpdateRelayServiceConnection(resourceGroupName: string, name: string, entityName: string, connectionEnvelope: Models.RelayServiceConnectionEntity, callback: msRest.ServiceCallback): void; + /** + * @param resourceGroupName Name of the resource group to which the resource belongs. + * @param name Name of the app. + * @param entityName Name of the hybrid connection configuration. + * @param connectionEnvelope Details of the hybrid connection configuration. + * @param options The optional parameters + * @param callback The callback + */ + createOrUpdateRelayServiceConnection(resourceGroupName: string, name: string, entityName: string, connectionEnvelope: Models.RelayServiceConnectionEntity, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; + createOrUpdateRelayServiceConnection(resourceGroupName: string, name: string, entityName: string, connectionEnvelope: Models.RelayServiceConnectionEntity, options?: msRest.RequestOptionsBase | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { + return this.client.sendOperationRequest( + { + resourceGroupName, + name, + entityName, + connectionEnvelope, + options + }, + createOrUpdateRelayServiceConnectionOperationSpec, + callback) as Promise; + } + + /** + * Deletes a relay service connection by its name. + * @summary Deletes a relay service connection by its name. + * @param resourceGroupName Name of the resource group to which the resource belongs. + * @param name Name of the app. + * @param entityName Name of the hybrid connection configuration. + * @param [options] The optional parameters + * @returns Promise + */ + deleteRelayServiceConnection(resourceGroupName: string, name: string, entityName: string, options?: msRest.RequestOptionsBase): Promise; + /** + * @param resourceGroupName Name of the resource group to which the resource belongs. + * @param name Name of the app. + * @param entityName Name of the hybrid connection configuration. + * @param callback The callback + */ + deleteRelayServiceConnection(resourceGroupName: string, name: string, entityName: string, callback: msRest.ServiceCallback): void; + /** + * @param resourceGroupName Name of the resource group to which the resource belongs. + * @param name Name of the app. + * @param entityName Name of the hybrid connection configuration. + * @param options The optional parameters + * @param callback The callback + */ + deleteRelayServiceConnection(resourceGroupName: string, name: string, entityName: string, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; + deleteRelayServiceConnection(resourceGroupName: string, name: string, entityName: string, options?: msRest.RequestOptionsBase | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { + return this.client.sendOperationRequest( + { + resourceGroupName, + name, + entityName, + options + }, + deleteRelayServiceConnectionOperationSpec, + callback); + } + + /** + * Creates a new hybrid connection configuration (PUT), or updates an existing one (PATCH). + * @summary Creates a new hybrid connection configuration (PUT), or updates an existing one + * (PATCH). + * @param resourceGroupName Name of the resource group to which the resource belongs. + * @param name Name of the app. + * @param entityName Name of the hybrid connection configuration. + * @param connectionEnvelope Details of the hybrid connection configuration. + * @param [options] The optional parameters + * @returns Promise + */ + updateRelayServiceConnection(resourceGroupName: string, name: string, entityName: string, connectionEnvelope: Models.RelayServiceConnectionEntity, options?: msRest.RequestOptionsBase): Promise; + /** + * @param resourceGroupName Name of the resource group to which the resource belongs. + * @param name Name of the app. + * @param entityName Name of the hybrid connection configuration. + * @param connectionEnvelope Details of the hybrid connection configuration. + * @param callback The callback + */ + updateRelayServiceConnection(resourceGroupName: string, name: string, entityName: string, connectionEnvelope: Models.RelayServiceConnectionEntity, callback: msRest.ServiceCallback): void; + /** + * @param resourceGroupName Name of the resource group to which the resource belongs. + * @param name Name of the app. + * @param entityName Name of the hybrid connection configuration. + * @param connectionEnvelope Details of the hybrid connection configuration. + * @param options The optional parameters + * @param callback The callback + */ + updateRelayServiceConnection(resourceGroupName: string, name: string, entityName: string, connectionEnvelope: Models.RelayServiceConnectionEntity, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; + updateRelayServiceConnection(resourceGroupName: string, name: string, entityName: string, connectionEnvelope: Models.RelayServiceConnectionEntity, options?: msRest.RequestOptionsBase | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { + return this.client.sendOperationRequest( + { + resourceGroupName, + name, + entityName, + connectionEnvelope, + options + }, + updateRelayServiceConnectionOperationSpec, + callback) as Promise; + } + + /** + * Gets all scale-out instances of an app. + * @summary Gets all scale-out instances of an app. + * @param resourceGroupName Name of the resource group to which the resource belongs. + * @param name Name of the app. + * @param [options] The optional parameters + * @returns Promise + */ + listInstanceIdentifiers(resourceGroupName: string, name: string, options?: msRest.RequestOptionsBase): Promise; + /** + * @param resourceGroupName Name of the resource group to which the resource belongs. + * @param name Name of the app. + * @param callback The callback + */ + listInstanceIdentifiers(resourceGroupName: string, name: string, callback: msRest.ServiceCallback): void; + /** + * @param resourceGroupName Name of the resource group to which the resource belongs. + * @param name Name of the app. + * @param options The optional parameters + * @param callback The callback + */ + listInstanceIdentifiers(resourceGroupName: string, name: string, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; + listInstanceIdentifiers(resourceGroupName: string, name: string, options?: msRest.RequestOptionsBase | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { + return this.client.sendOperationRequest( + { + resourceGroupName, + name, + options + }, + listInstanceIdentifiersOperationSpec, + callback) as Promise; + } + + /** + * Get the status of the last MSDeploy operation. + * @summary Get the status of the last MSDeploy operation. + * @param resourceGroupName Name of the resource group to which the resource belongs. + * @param name Name of web app. + * @param instanceId ID of web app instance. + * @param [options] The optional parameters + * @returns Promise + */ + getInstanceMsDeployStatus(resourceGroupName: string, name: string, instanceId: string, options?: msRest.RequestOptionsBase): Promise; + /** + * @param resourceGroupName Name of the resource group to which the resource belongs. + * @param name Name of web app. + * @param instanceId ID of web app instance. + * @param callback The callback + */ + getInstanceMsDeployStatus(resourceGroupName: string, name: string, instanceId: string, callback: msRest.ServiceCallback): void; + /** + * @param resourceGroupName Name of the resource group to which the resource belongs. + * @param name Name of web app. + * @param instanceId ID of web app instance. + * @param options The optional parameters + * @param callback The callback + */ + getInstanceMsDeployStatus(resourceGroupName: string, name: string, instanceId: string, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; + getInstanceMsDeployStatus(resourceGroupName: string, name: string, instanceId: string, options?: msRest.RequestOptionsBase | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { + return this.client.sendOperationRequest( + { + resourceGroupName, + name, + instanceId, + options + }, + getInstanceMsDeployStatusOperationSpec, + callback) as Promise; + } + + /** + * Invoke the MSDeploy web app extension. + * @summary Invoke the MSDeploy web app extension. + * @param resourceGroupName Name of the resource group to which the resource belongs. + * @param name Name of web app. + * @param instanceId ID of web app instance. + * @param mSDeploy Details of MSDeploy operation + * @param [options] The optional parameters + * @returns Promise + */ + createInstanceMSDeployOperation(resourceGroupName: string, name: string, instanceId: string, mSDeploy: Models.MSDeploy, options?: msRest.RequestOptionsBase): Promise { + return this.beginCreateInstanceMSDeployOperation(resourceGroupName,name,instanceId,mSDeploy,options) + .then(lroPoller => lroPoller.pollUntilFinished()) as Promise; + } + + /** + * Get the MSDeploy Log for the last MSDeploy operation. + * @summary Get the MSDeploy Log for the last MSDeploy operation. + * @param resourceGroupName Name of the resource group to which the resource belongs. + * @param name Name of web app. + * @param instanceId ID of web app instance. + * @param [options] The optional parameters + * @returns Promise + */ + getInstanceMSDeployLog(resourceGroupName: string, name: string, instanceId: string, options?: msRest.RequestOptionsBase): Promise; + /** + * @param resourceGroupName Name of the resource group to which the resource belongs. + * @param name Name of web app. + * @param instanceId ID of web app instance. + * @param callback The callback + */ + getInstanceMSDeployLog(resourceGroupName: string, name: string, instanceId: string, callback: msRest.ServiceCallback): void; + /** + * @param resourceGroupName Name of the resource group to which the resource belongs. + * @param name Name of web app. + * @param instanceId ID of web app instance. + * @param options The optional parameters + * @param callback The callback + */ + getInstanceMSDeployLog(resourceGroupName: string, name: string, instanceId: string, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; + getInstanceMSDeployLog(resourceGroupName: string, name: string, instanceId: string, options?: msRest.RequestOptionsBase | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { + return this.client.sendOperationRequest( + { + resourceGroupName, + name, + instanceId, + options + }, + getInstanceMSDeployLogOperationSpec, + callback) as Promise; + } + + /** + * 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 list of processes for a web site, or a deployment slot, or for a specific + * scaled-out instance in a web site. + * @param resourceGroupName Name of the resource group to which the resource belongs. + * @param name Site name. + * @param instanceId ID of a specific scaled-out instance. This is the value of the name property + * in the JSON response from "GET api/sites/{siteName}/instances". + * @param [options] The optional parameters + * @returns Promise + */ + listInstanceProcesses(resourceGroupName: string, name: string, instanceId: string, options?: msRest.RequestOptionsBase): Promise; + /** + * @param resourceGroupName Name of the resource group to which the resource belongs. + * @param name Site name. + * @param instanceId ID of a specific scaled-out instance. This is the value of the name property + * in the JSON response from "GET api/sites/{siteName}/instances". + * @param callback The callback + */ + listInstanceProcesses(resourceGroupName: string, name: string, instanceId: string, callback: msRest.ServiceCallback): void; + /** + * @param resourceGroupName Name of the resource group to which the resource belongs. + * @param name Site name. + * @param instanceId ID of a specific scaled-out instance. This is the value of the name property + * in the JSON response from "GET api/sites/{siteName}/instances". + * @param options The optional parameters + * @param callback The callback + */ + listInstanceProcesses(resourceGroupName: string, name: string, instanceId: string, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; + listInstanceProcesses(resourceGroupName: string, name: string, instanceId: string, options?: msRest.RequestOptionsBase | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { + return this.client.sendOperationRequest( + { + resourceGroupName, + name, + instanceId, + options + }, + listInstanceProcessesOperationSpec, + callback) as Promise; + } + + /** + * Get process information by its ID 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. + * @param resourceGroupName Name of the resource group to which the resource belongs. + * @param name Site name. + * @param processId PID. + * @param instanceId ID of a specific scaled-out instance. This is the value of the name property + * in the JSON response from "GET api/sites/{siteName}/instances". + * @param [options] The optional parameters + * @returns Promise + */ + getInstanceProcess(resourceGroupName: string, name: string, processId: string, instanceId: string, options?: msRest.RequestOptionsBase): Promise; + /** + * @param resourceGroupName Name of the resource group to which the resource belongs. + * @param name Site name. + * @param processId PID. + * @param instanceId ID of a specific scaled-out instance. This is the value of the name property + * in the JSON response from "GET api/sites/{siteName}/instances". + * @param callback The callback + */ + getInstanceProcess(resourceGroupName: string, name: string, processId: string, instanceId: string, callback: msRest.ServiceCallback): void; + /** + * @param resourceGroupName Name of the resource group to which the resource belongs. + * @param name Site name. + * @param processId PID. + * @param instanceId ID of a specific scaled-out instance. This is the value of the name property + * in the JSON response from "GET api/sites/{siteName}/instances". + * @param options The optional parameters + * @param callback The callback + */ + getInstanceProcess(resourceGroupName: string, name: string, processId: string, instanceId: string, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; + getInstanceProcess(resourceGroupName: string, name: string, processId: string, instanceId: string, options?: msRest.RequestOptionsBase | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { + return this.client.sendOperationRequest( + { + resourceGroupName, + name, + processId, + instanceId, + options + }, + getInstanceProcessOperationSpec, + callback) as Promise; + } + + /** + * Terminate a process by its ID for a web site, or a deployment slot, or 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. + * @param resourceGroupName Name of the resource group to which the resource belongs. + * @param name Site name. + * @param processId PID. + * @param instanceId ID of a specific scaled-out instance. This is the value of the name property + * in the JSON response from "GET api/sites/{siteName}/instances". + * @param [options] The optional parameters + * @returns Promise + */ + deleteInstanceProcess(resourceGroupName: string, name: string, processId: string, instanceId: string, options?: msRest.RequestOptionsBase): Promise; + /** + * @param resourceGroupName Name of the resource group to which the resource belongs. + * @param name Site name. + * @param processId PID. + * @param instanceId ID of a specific scaled-out instance. This is the value of the name property + * in the JSON response from "GET api/sites/{siteName}/instances". + * @param callback The callback + */ + deleteInstanceProcess(resourceGroupName: string, name: string, processId: string, instanceId: string, callback: msRest.ServiceCallback): void; + /** + * @param resourceGroupName Name of the resource group to which the resource belongs. + * @param name Site name. + * @param processId PID. + * @param instanceId ID of a specific scaled-out instance. This is the value of the name property + * in the JSON response from "GET api/sites/{siteName}/instances". + * @param options The optional parameters + * @param callback The callback + */ + deleteInstanceProcess(resourceGroupName: string, name: string, processId: string, instanceId: string, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; + deleteInstanceProcess(resourceGroupName: string, name: string, processId: string, instanceId: string, options?: msRest.RequestOptionsBase | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { + return this.client.sendOperationRequest( + { + resourceGroupName, + name, + processId, + instanceId, + options + }, + deleteInstanceProcessOperationSpec, + callback); + } + + /** + * Get a memory dump of a process by its ID 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. + * @param resourceGroupName Name of the resource group to which the resource belongs. + * @param name Site name. + * @param processId PID. + * @param instanceId ID of a specific scaled-out instance. This is the value of the name property + * in the JSON response from "GET api/sites/{siteName}/instances". + * @param [options] The optional parameters + * @returns Promise + */ + getInstanceProcessDump(resourceGroupName: string, name: string, processId: string, instanceId: string, options?: msRest.RequestOptionsBase): Promise; + /** + * @param resourceGroupName Name of the resource group to which the resource belongs. + * @param name Site name. + * @param processId PID. + * @param instanceId ID of a specific scaled-out instance. This is the value of the name property + * in the JSON response from "GET api/sites/{siteName}/instances". + * @param callback The callback + */ + getInstanceProcessDump(resourceGroupName: string, name: string, processId: string, instanceId: string, callback: msRest.ServiceCallback): void; + /** + * @param resourceGroupName Name of the resource group to which the resource belongs. + * @param name Site name. + * @param processId PID. + * @param instanceId ID of a specific scaled-out instance. This is the value of the name property + * in the JSON response from "GET api/sites/{siteName}/instances". + * @param options The optional parameters + * @param callback The callback + */ + getInstanceProcessDump(resourceGroupName: string, name: string, processId: string, instanceId: string, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; + getInstanceProcessDump(resourceGroupName: string, name: string, processId: string, instanceId: string, options?: msRest.RequestOptionsBase | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { + return this.client.sendOperationRequest( + { + resourceGroupName, + name, + processId, + instanceId, + options + }, + getInstanceProcessDumpOperationSpec, + callback) as Promise; + } + + /** + * List module information for a process 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. + * @param resourceGroupName Name of the resource group to which the resource belongs. + * @param name Site name. + * @param processId PID. + * @param instanceId ID of a specific scaled-out instance. This is the value of the name property + * in the JSON response from "GET api/sites/{siteName}/instances". + * @param [options] The optional parameters + * @returns Promise + */ + listInstanceProcessModules(resourceGroupName: string, name: string, processId: string, instanceId: string, options?: msRest.RequestOptionsBase): Promise; + /** + * @param resourceGroupName Name of the resource group to which the resource belongs. + * @param name Site name. + * @param processId PID. + * @param instanceId ID of a specific scaled-out instance. This is the value of the name property + * in the JSON response from "GET api/sites/{siteName}/instances". + * @param callback The callback + */ + listInstanceProcessModules(resourceGroupName: string, name: string, processId: string, instanceId: string, callback: msRest.ServiceCallback): void; + /** + * @param resourceGroupName Name of the resource group to which the resource belongs. + * @param name Site name. + * @param processId PID. + * @param instanceId ID of a specific scaled-out instance. This is the value of the name property + * in the JSON response from "GET api/sites/{siteName}/instances". + * @param options The optional parameters + * @param callback The callback + */ + listInstanceProcessModules(resourceGroupName: string, name: string, processId: string, instanceId: string, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; + listInstanceProcessModules(resourceGroupName: string, name: string, processId: string, instanceId: string, options?: msRest.RequestOptionsBase | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { + return this.client.sendOperationRequest( + { + resourceGroupName, + name, + processId, + instanceId, + options + }, + listInstanceProcessModulesOperationSpec, + callback) as Promise; + } + + /** + * Get process information by its ID 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. + * @param resourceGroupName Name of the resource group to which the resource belongs. + * @param name Site name. + * @param processId PID. + * @param baseAddress Module base address. + * @param instanceId ID of a specific scaled-out instance. This is the value of the name property + * in the JSON response from "GET api/sites/{siteName}/instances". + * @param [options] The optional parameters + * @returns Promise + */ + getInstanceProcessModule(resourceGroupName: string, name: string, processId: string, baseAddress: string, instanceId: string, options?: msRest.RequestOptionsBase): Promise; + /** + * @param resourceGroupName Name of the resource group to which the resource belongs. + * @param name Site name. + * @param processId PID. + * @param baseAddress Module base address. + * @param instanceId ID of a specific scaled-out instance. This is the value of the name property + * in the JSON response from "GET api/sites/{siteName}/instances". + * @param callback The callback + */ + getInstanceProcessModule(resourceGroupName: string, name: string, processId: string, baseAddress: string, instanceId: string, callback: msRest.ServiceCallback): void; + /** + * @param resourceGroupName Name of the resource group to which the resource belongs. + * @param name Site name. + * @param processId PID. + * @param baseAddress Module base address. + * @param instanceId ID of a specific scaled-out instance. This is the value of the name property + * in the JSON response from "GET api/sites/{siteName}/instances". + * @param options The optional parameters + * @param callback The callback + */ + getInstanceProcessModule(resourceGroupName: string, name: string, processId: string, baseAddress: string, instanceId: string, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; + getInstanceProcessModule(resourceGroupName: string, name: string, processId: string, baseAddress: string, instanceId: string, options?: msRest.RequestOptionsBase | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { + return this.client.sendOperationRequest( + { + resourceGroupName, + name, + processId, + baseAddress, + instanceId, + options + }, + getInstanceProcessModuleOperationSpec, + callback) as Promise; + } + + /** + * List the threads in a process by its ID 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. + * @param resourceGroupName Name of the resource group to which the resource belongs. + * @param name Site name. + * @param processId PID. + * @param instanceId ID of a specific scaled-out instance. This is the value of the name property + * in the JSON response from "GET api/sites/{siteName}/instances". + * @param [options] The optional parameters + * @returns Promise + */ + listInstanceProcessThreads(resourceGroupName: string, name: string, processId: string, instanceId: string, options?: msRest.RequestOptionsBase): Promise; + /** + * @param resourceGroupName Name of the resource group to which the resource belongs. + * @param name Site name. + * @param processId PID. + * @param instanceId ID of a specific scaled-out instance. This is the value of the name property + * in the JSON response from "GET api/sites/{siteName}/instances". + * @param callback The callback + */ + listInstanceProcessThreads(resourceGroupName: string, name: string, processId: string, instanceId: string, callback: msRest.ServiceCallback): void; + /** + * @param resourceGroupName Name of the resource group to which the resource belongs. + * @param name Site name. + * @param processId PID. + * @param instanceId ID of a specific scaled-out instance. This is the value of the name property + * in the JSON response from "GET api/sites/{siteName}/instances". + * @param options The optional parameters + * @param callback The callback + */ + listInstanceProcessThreads(resourceGroupName: string, name: string, processId: string, instanceId: string, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; + listInstanceProcessThreads(resourceGroupName: string, name: string, processId: string, instanceId: string, options?: msRest.RequestOptionsBase | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { + return this.client.sendOperationRequest( + { + resourceGroupName, + name, + processId, + instanceId, + options + }, + listInstanceProcessThreadsOperationSpec, + callback) as Promise; + } + + /** + * Get thread information by Thread ID for a specific process, in 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. + * @param resourceGroupName Name of the resource group to which the resource belongs. + * @param name Site name. + * @param processId PID. + * @param threadId TID. + * @param instanceId ID of a specific scaled-out instance. This is the value of the name property + * in the JSON response from "GET api/sites/{siteName}/instances". + * @param [options] The optional parameters + * @returns Promise + */ + getInstanceProcessThread(resourceGroupName: string, name: string, processId: string, threadId: string, instanceId: string, options?: msRest.RequestOptionsBase): Promise; + /** + * @param resourceGroupName Name of the resource group to which the resource belongs. + * @param name Site name. + * @param processId PID. + * @param threadId TID. + * @param instanceId ID of a specific scaled-out instance. This is the value of the name property + * in the JSON response from "GET api/sites/{siteName}/instances". + * @param callback The callback + */ + getInstanceProcessThread(resourceGroupName: string, name: string, processId: string, threadId: string, instanceId: string, callback: msRest.ServiceCallback): void; + /** + * @param resourceGroupName Name of the resource group to which the resource belongs. + * @param name Site name. + * @param processId PID. + * @param threadId TID. + * @param instanceId ID of a specific scaled-out instance. This is the value of the name property + * in the JSON response from "GET api/sites/{siteName}/instances". + * @param options The optional parameters + * @param callback The callback + */ + getInstanceProcessThread(resourceGroupName: string, name: string, processId: string, threadId: string, instanceId: string, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; + getInstanceProcessThread(resourceGroupName: string, name: string, processId: string, threadId: string, instanceId: string, options?: msRest.RequestOptionsBase | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { + return this.client.sendOperationRequest( + { + resourceGroupName, + name, + processId, + threadId, + instanceId, + options + }, + getInstanceProcessThreadOperationSpec, + callback) as Promise; + } + + /** + * Shows whether an app can be cloned to another resource group or subscription. + * @summary Shows whether an app can be cloned to another resource group or subscription. + * @param resourceGroupName Name of the resource group to which the resource belongs. + * @param name Name of the app. + * @param [options] The optional parameters + * @returns Promise + */ + isCloneable(resourceGroupName: string, name: string, options?: msRest.RequestOptionsBase): Promise; + /** + * @param resourceGroupName Name of the resource group to which the resource belongs. + * @param name Name of the app. + * @param callback The callback + */ + isCloneable(resourceGroupName: string, name: string, callback: msRest.ServiceCallback): void; + /** + * @param resourceGroupName Name of the resource group to which the resource belongs. + * @param name Name of the app. + * @param options The optional parameters + * @param callback The callback + */ + isCloneable(resourceGroupName: string, name: string, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; + isCloneable(resourceGroupName: string, name: string, options?: msRest.RequestOptionsBase | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { + return this.client.sendOperationRequest( + { + resourceGroupName, + name, + options + }, + isCloneableOperationSpec, + callback) as Promise; + } + + /** + * This is to allow calling via powershell and ARM template. + * @summary This is to allow calling via powershell and ARM template. + * @param resourceGroupName Name of the resource group to which the resource belongs. + * @param name Name of the app. + * @param [options] The optional parameters + * @returns Promise + */ + listSyncFunctionTriggers(resourceGroupName: string, name: string, options?: msRest.RequestOptionsBase): Promise; + /** + * @param resourceGroupName Name of the resource group to which the resource belongs. + * @param name Name of the app. + * @param callback The callback + */ + listSyncFunctionTriggers(resourceGroupName: string, name: string, callback: msRest.ServiceCallback): void; + /** + * @param resourceGroupName Name of the resource group to which the resource belongs. + * @param name Name of the app. + * @param options The optional parameters + * @param callback The callback + */ + listSyncFunctionTriggers(resourceGroupName: string, name: string, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; + listSyncFunctionTriggers(resourceGroupName: string, name: string, options?: msRest.RequestOptionsBase | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { + return this.client.sendOperationRequest( + { + resourceGroupName, + name, + options + }, + listSyncFunctionTriggersOperationSpec, + callback) as Promise; + } + + /** + * Gets all metric definitions of an app (or deployment slot, if specified). + * @summary Gets all metric definitions of an app (or deployment slot, if specified). + * @param resourceGroupName Name of the resource group to which the resource belongs. + * @param name Name of the app. + * @param [options] The optional parameters + * @returns Promise + */ + listMetricDefinitions(resourceGroupName: string, name: string, options?: msRest.RequestOptionsBase): Promise; + /** + * @param resourceGroupName Name of the resource group to which the resource belongs. + * @param name Name of the app. + * @param callback The callback + */ + listMetricDefinitions(resourceGroupName: string, name: string, callback: msRest.ServiceCallback): void; + /** + * @param resourceGroupName Name of the resource group to which the resource belongs. + * @param name Name of the app. + * @param options The optional parameters + * @param callback The callback + */ + listMetricDefinitions(resourceGroupName: string, name: string, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; + listMetricDefinitions(resourceGroupName: string, name: string, options?: msRest.RequestOptionsBase | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { + return this.client.sendOperationRequest( + { + resourceGroupName, + name, + options + }, + listMetricDefinitionsOperationSpec, + callback) as Promise; + } + + /** + * Gets performance metrics of an app (or deployment slot, if specified). + * @summary Gets performance metrics of an app (or deployment slot, if specified). + * @param resourceGroupName Name of the resource group to which the resource belongs. + * @param name Name of the app. + * @param [options] The optional parameters + * @returns Promise + */ + listMetrics(resourceGroupName: string, name: string, options?: Models.WebAppsListMetricsOptionalParams): Promise; + /** + * @param resourceGroupName Name of the resource group to which the resource belongs. + * @param name Name of the app. + * @param callback The callback + */ + listMetrics(resourceGroupName: string, name: string, callback: msRest.ServiceCallback): void; + /** + * @param resourceGroupName Name of the resource group to which the resource belongs. + * @param name Name of the app. + * @param options The optional parameters + * @param callback The callback + */ + listMetrics(resourceGroupName: string, name: string, options: Models.WebAppsListMetricsOptionalParams, callback: msRest.ServiceCallback): void; + listMetrics(resourceGroupName: string, name: string, options?: Models.WebAppsListMetricsOptionalParams | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { + return this.client.sendOperationRequest( + { + resourceGroupName, + name, + options + }, + listMetricsOperationSpec, + callback) as Promise; + } + + /** + * Restores a web app. + * @summary Restores a web app. + * @param subscriptionName Azure subscription. + * @param resourceGroupName Name of the resource group to which the resource belongs. + * @param name Name of web app. + * @param migrationOptions Migration migrationOptions. + * @param [options] The optional parameters + * @returns Promise + */ + migrateStorage(subscriptionName: string, resourceGroupName: string, name: string, migrationOptions: Models.StorageMigrationOptions, options?: msRest.RequestOptionsBase): Promise { + return this.beginMigrateStorage(subscriptionName,resourceGroupName,name,migrationOptions,options) + .then(lroPoller => lroPoller.pollUntilFinished()) as Promise; + } + + /** + * Migrates a local (in-app) MySql database to a remote MySql database. + * @summary Migrates a local (in-app) MySql database to a remote MySql database. + * @param resourceGroupName Name of the resource group to which the resource belongs. + * @param name Name of web app. + * @param migrationRequestEnvelope MySql migration options. + * @param [options] The optional parameters + * @returns Promise + */ + migrateMySql(resourceGroupName: string, name: string, migrationRequestEnvelope: Models.MigrateMySqlRequest, options?: msRest.RequestOptionsBase): Promise { + return this.beginMigrateMySql(resourceGroupName,name,migrationRequestEnvelope,options) + .then(lroPoller => lroPoller.pollUntilFinished()) as Promise; + } + + /** + * Returns the status of MySql in app migration, if one is active, and whether or not MySql in app + * is enabled + * @summary Returns the status of MySql in app migration, if one is active, and whether or not + * MySql in app is enabled + * @param resourceGroupName Name of the resource group to which the resource belongs. + * @param name Name of web app. + * @param [options] The optional parameters + * @returns Promise + */ + getMigrateMySqlStatus(resourceGroupName: string, name: string, options?: msRest.RequestOptionsBase): Promise; + /** + * @param resourceGroupName Name of the resource group to which the resource belongs. + * @param name Name of web app. + * @param callback The callback + */ + getMigrateMySqlStatus(resourceGroupName: string, name: string, callback: msRest.ServiceCallback): void; + /** + * @param resourceGroupName Name of the resource group to which the resource belongs. + * @param name Name of web app. + * @param options The optional parameters + * @param callback The callback + */ + getMigrateMySqlStatus(resourceGroupName: string, name: string, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; + getMigrateMySqlStatus(resourceGroupName: string, name: string, options?: msRest.RequestOptionsBase | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { + return this.client.sendOperationRequest( + { + resourceGroupName, + name, + options + }, + getMigrateMySqlStatusOperationSpec, + callback) as Promise; + } + + /** + * Gets a Swift Virtual Network connection. + * @summary Gets a Swift Virtual Network connection. + * @param resourceGroupName Name of the resource group to which the resource belongs. + * @param name Name of the app. + * @param [options] The optional parameters + * @returns Promise + */ + getSwiftVirtualNetworkConnection(resourceGroupName: string, name: string, options?: msRest.RequestOptionsBase): Promise; + /** + * @param resourceGroupName Name of the resource group to which the resource belongs. + * @param name Name of the app. + * @param callback The callback + */ + getSwiftVirtualNetworkConnection(resourceGroupName: string, name: string, callback: msRest.ServiceCallback): void; + /** + * @param resourceGroupName Name of the resource group to which the resource belongs. + * @param name Name of the app. + * @param options The optional parameters + * @param callback The callback + */ + getSwiftVirtualNetworkConnection(resourceGroupName: string, name: string, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; + getSwiftVirtualNetworkConnection(resourceGroupName: string, name: string, options?: msRest.RequestOptionsBase | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { + return this.client.sendOperationRequest( + { + resourceGroupName, + name, + options + }, + getSwiftVirtualNetworkConnectionOperationSpec, + callback) as Promise; + } + + /** + * 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. + * @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. + * @param resourceGroupName Name of the resource group to which the resource belongs. + * @param name Name of the app. + * @param connectionEnvelope Properties of the Virtual Network connection. See example. + * @param [options] The optional parameters + * @returns Promise + */ + createOrUpdateSwiftVirtualNetworkConnection(resourceGroupName: string, name: string, connectionEnvelope: Models.SwiftVirtualNetwork, options?: msRest.RequestOptionsBase): Promise; + /** + * @param resourceGroupName Name of the resource group to which the resource belongs. + * @param name Name of the app. + * @param connectionEnvelope Properties of the Virtual Network connection. See example. + * @param callback The callback + */ + createOrUpdateSwiftVirtualNetworkConnection(resourceGroupName: string, name: string, connectionEnvelope: Models.SwiftVirtualNetwork, callback: msRest.ServiceCallback): void; + /** + * @param resourceGroupName Name of the resource group to which the resource belongs. + * @param name Name of the app. + * @param connectionEnvelope Properties of the Virtual Network connection. See example. + * @param options The optional parameters + * @param callback The callback + */ + createOrUpdateSwiftVirtualNetworkConnection(resourceGroupName: string, name: string, connectionEnvelope: Models.SwiftVirtualNetwork, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; + createOrUpdateSwiftVirtualNetworkConnection(resourceGroupName: string, name: string, connectionEnvelope: Models.SwiftVirtualNetwork, options?: msRest.RequestOptionsBase | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { + return this.client.sendOperationRequest( + { + resourceGroupName, + name, + connectionEnvelope, + options + }, + createOrUpdateSwiftVirtualNetworkConnectionOperationSpec, + callback) as Promise; + } + + /** + * Deletes a Swift Virtual Network connection from an app (or deployment slot). + * @summary Deletes a Swift Virtual Network connection from an app (or deployment slot). + * @param resourceGroupName Name of the resource group to which the resource belongs. + * @param name Name of the app. + * @param [options] The optional parameters + * @returns Promise + */ + deleteSwiftVirtualNetwork(resourceGroupName: string, name: string, options?: msRest.RequestOptionsBase): Promise; + /** + * @param resourceGroupName Name of the resource group to which the resource belongs. + * @param name Name of the app. + * @param callback The callback + */ + deleteSwiftVirtualNetwork(resourceGroupName: string, name: string, callback: msRest.ServiceCallback): void; + /** + * @param resourceGroupName Name of the resource group to which the resource belongs. + * @param name Name of the app. + * @param options The optional parameters + * @param callback The callback + */ + deleteSwiftVirtualNetwork(resourceGroupName: string, name: string, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; + deleteSwiftVirtualNetwork(resourceGroupName: string, name: string, options?: msRest.RequestOptionsBase | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { + return this.client.sendOperationRequest( + { + resourceGroupName, + name, + options + }, + deleteSwiftVirtualNetworkOperationSpec, + callback); + } + + /** + * 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. + * @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. + * @param resourceGroupName Name of the resource group to which the resource belongs. + * @param name Name of the app. + * @param connectionEnvelope Properties of the Virtual Network connection. See example. + * @param [options] The optional parameters + * @returns Promise + */ + updateSwiftVirtualNetworkConnection(resourceGroupName: string, name: string, connectionEnvelope: Models.SwiftVirtualNetwork, options?: msRest.RequestOptionsBase): Promise; + /** + * @param resourceGroupName Name of the resource group to which the resource belongs. + * @param name Name of the app. + * @param connectionEnvelope Properties of the Virtual Network connection. See example. + * @param callback The callback + */ + updateSwiftVirtualNetworkConnection(resourceGroupName: string, name: string, connectionEnvelope: Models.SwiftVirtualNetwork, callback: msRest.ServiceCallback): void; + /** + * @param resourceGroupName Name of the resource group to which the resource belongs. + * @param name Name of the app. + * @param connectionEnvelope Properties of the Virtual Network connection. See example. + * @param options The optional parameters + * @param callback The callback + */ + updateSwiftVirtualNetworkConnection(resourceGroupName: string, name: string, connectionEnvelope: Models.SwiftVirtualNetwork, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; + updateSwiftVirtualNetworkConnection(resourceGroupName: string, name: string, connectionEnvelope: Models.SwiftVirtualNetwork, options?: msRest.RequestOptionsBase | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { + return this.client.sendOperationRequest( + { + resourceGroupName, + name, + connectionEnvelope, + options + }, + updateSwiftVirtualNetworkConnectionOperationSpec, + callback) as Promise; + } + + /** + * Gets all network features used by the app (or deployment slot, if specified). + * @summary Gets all network features used by the app (or deployment slot, if specified). + * @param resourceGroupName Name of the resource group to which the resource belongs. + * @param name Name of the app. + * @param view The type of view. This can either be "summary" or "detailed". + * @param [options] The optional parameters + * @returns Promise + */ + listNetworkFeatures(resourceGroupName: string, name: string, view: string, options?: msRest.RequestOptionsBase): Promise; + /** + * @param resourceGroupName Name of the resource group to which the resource belongs. + * @param name Name of the app. + * @param view The type of view. This can either be "summary" or "detailed". + * @param callback The callback + */ + listNetworkFeatures(resourceGroupName: string, name: string, view: string, callback: msRest.ServiceCallback): void; + /** + * @param resourceGroupName Name of the resource group to which the resource belongs. + * @param name Name of the app. + * @param view The type of view. This can either be "summary" or "detailed". + * @param options The optional parameters + * @param callback The callback + */ + listNetworkFeatures(resourceGroupName: string, name: string, view: string, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; + listNetworkFeatures(resourceGroupName: string, name: string, view: string, options?: msRest.RequestOptionsBase | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { + return this.client.sendOperationRequest( + { + resourceGroupName, + name, + view, + options + }, + listNetworkFeaturesOperationSpec, + callback) as Promise; + } + + /** + * Gets a named operation for a network trace capturing (or deployment slot, if specified). + * @summary Gets a named operation for a network trace capturing (or deployment slot, if + * specified). + * @param resourceGroupName Name of the resource group to which the resource belongs. + * @param name Name of the app. + * @param operationId GUID of the operation. + * @param [options] The optional parameters + * @returns Promise + */ + getNetworkTraceOperation(resourceGroupName: string, name: string, operationId: string, options?: msRest.RequestOptionsBase): Promise; + /** + * @param resourceGroupName Name of the resource group to which the resource belongs. + * @param name Name of the app. + * @param operationId GUID of the operation. + * @param callback The callback + */ + getNetworkTraceOperation(resourceGroupName: string, name: string, operationId: string, callback: msRest.ServiceCallback): void; + /** + * @param resourceGroupName Name of the resource group to which the resource belongs. + * @param name Name of the app. + * @param operationId GUID of the operation. + * @param options The optional parameters + * @param callback The callback + */ + getNetworkTraceOperation(resourceGroupName: string, name: string, operationId: string, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; + getNetworkTraceOperation(resourceGroupName: string, name: string, operationId: string, options?: msRest.RequestOptionsBase | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { + return this.client.sendOperationRequest( + { + resourceGroupName, + name, + operationId, + options + }, + getNetworkTraceOperationOperationSpec, + callback) as Promise; + } + + /** + * Start capturing network packets for the site (To be deprecated). + * @summary Start capturing network packets for the site (To be deprecated). + * @param resourceGroupName Name of the resource group to which the resource belongs. + * @param name The name of the web app. + * @param [options] The optional parameters + * @returns Promise + */ + startWebSiteNetworkTrace(resourceGroupName: string, name: string, options?: Models.WebAppsStartWebSiteNetworkTraceOptionalParams): Promise; + /** + * @param resourceGroupName Name of the resource group to which the resource belongs. + * @param name The name of the web app. + * @param callback The callback + */ + startWebSiteNetworkTrace(resourceGroupName: string, name: string, callback: msRest.ServiceCallback): void; + /** + * @param resourceGroupName Name of the resource group to which the resource belongs. + * @param name The name of the web app. + * @param options The optional parameters + * @param callback The callback + */ + startWebSiteNetworkTrace(resourceGroupName: string, name: string, options: Models.WebAppsStartWebSiteNetworkTraceOptionalParams, callback: msRest.ServiceCallback): void; + startWebSiteNetworkTrace(resourceGroupName: string, name: string, options?: Models.WebAppsStartWebSiteNetworkTraceOptionalParams | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { + return this.client.sendOperationRequest( + { + resourceGroupName, + name, + options + }, + startWebSiteNetworkTraceOperationSpec, + callback) as Promise; + } + + /** + * Start capturing network packets for the site. + * @summary Start capturing network packets for the site. + * @param resourceGroupName Name of the resource group to which the resource belongs. + * @param name The name of the web app. + * @param [options] The optional parameters + * @returns Promise + */ + startWebSiteNetworkTraceOperation(resourceGroupName: string, name: string, options?: Models.WebAppsStartWebSiteNetworkTraceOperationOptionalParams): Promise { + return this.beginStartWebSiteNetworkTraceOperation(resourceGroupName,name,options) + .then(lroPoller => lroPoller.pollUntilFinished()) as Promise; + } + + /** + * Stop ongoing capturing network packets for the site. + * @summary Stop ongoing capturing network packets for the site. + * @param resourceGroupName Name of the resource group to which the resource belongs. + * @param name The name of the web app. + * @param [options] The optional parameters + * @returns Promise + */ + stopWebSiteNetworkTrace(resourceGroupName: string, name: string, options?: msRest.RequestOptionsBase): Promise; + /** + * @param resourceGroupName Name of the resource group to which the resource belongs. + * @param name The name of the web app. + * @param callback The callback + */ + stopWebSiteNetworkTrace(resourceGroupName: string, name: string, callback: msRest.ServiceCallback): void; + /** + * @param resourceGroupName Name of the resource group to which the resource belongs. + * @param name The name of the web app. + * @param options The optional parameters + * @param callback The callback + */ + stopWebSiteNetworkTrace(resourceGroupName: string, name: string, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; + stopWebSiteNetworkTrace(resourceGroupName: string, name: string, options?: msRest.RequestOptionsBase | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { + return this.client.sendOperationRequest( + { + resourceGroupName, + name, + options + }, + stopWebSiteNetworkTraceOperationSpec, + callback); + } + + /** + * Gets a named operation for a network trace capturing (or deployment slot, if specified). + * @summary Gets a named operation for a network trace capturing (or deployment slot, if + * specified). + * @param resourceGroupName Name of the resource group to which the resource belongs. + * @param name Name of the app. + * @param operationId GUID of the operation. + * @param [options] The optional parameters + * @returns Promise + */ + getNetworkTraces(resourceGroupName: string, name: string, operationId: string, options?: msRest.RequestOptionsBase): Promise; + /** + * @param resourceGroupName Name of the resource group to which the resource belongs. + * @param name Name of the app. + * @param operationId GUID of the operation. + * @param callback The callback + */ + getNetworkTraces(resourceGroupName: string, name: string, operationId: string, callback: msRest.ServiceCallback): void; + /** + * @param resourceGroupName Name of the resource group to which the resource belongs. + * @param name Name of the app. + * @param operationId GUID of the operation. + * @param options The optional parameters + * @param callback The callback + */ + getNetworkTraces(resourceGroupName: string, name: string, operationId: string, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; + getNetworkTraces(resourceGroupName: string, name: string, operationId: string, options?: msRest.RequestOptionsBase | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { + return this.client.sendOperationRequest( + { + resourceGroupName, + name, + operationId, + options + }, + getNetworkTracesOperationSpec, + callback) as Promise; + } + + /** + * Gets a named operation for a network trace capturing (or deployment slot, if specified). + * @summary Gets a named operation for a network trace capturing (or deployment slot, if + * specified). + * @param resourceGroupName Name of the resource group to which the resource belongs. + * @param name Name of the app. + * @param operationId GUID of the operation. + * @param [options] The optional parameters + * @returns Promise + */ + getNetworkTraceOperationV2(resourceGroupName: string, name: string, operationId: string, options?: msRest.RequestOptionsBase): Promise; + /** + * @param resourceGroupName Name of the resource group to which the resource belongs. + * @param name Name of the app. + * @param operationId GUID of the operation. + * @param callback The callback + */ + getNetworkTraceOperationV2(resourceGroupName: string, name: string, operationId: string, callback: msRest.ServiceCallback): void; + /** + * @param resourceGroupName Name of the resource group to which the resource belongs. + * @param name Name of the app. + * @param operationId GUID of the operation. + * @param options The optional parameters + * @param callback The callback + */ + getNetworkTraceOperationV2(resourceGroupName: string, name: string, operationId: string, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; + getNetworkTraceOperationV2(resourceGroupName: string, name: string, operationId: string, options?: msRest.RequestOptionsBase | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { + return this.client.sendOperationRequest( + { + resourceGroupName, + name, + operationId, + options + }, + getNetworkTraceOperationV2OperationSpec, + callback) as Promise; + } + + /** + * Gets a named operation for a network trace capturing (or deployment slot, if specified). + * @summary Gets a named operation for a network trace capturing (or deployment slot, if + * specified). + * @param resourceGroupName Name of the resource group to which the resource belongs. + * @param name Name of the app. + * @param operationId GUID of the operation. + * @param [options] The optional parameters + * @returns Promise + */ + getNetworkTracesV2(resourceGroupName: string, name: string, operationId: string, options?: msRest.RequestOptionsBase): Promise; + /** + * @param resourceGroupName Name of the resource group to which the resource belongs. + * @param name Name of the app. + * @param operationId GUID of the operation. + * @param callback The callback + */ + getNetworkTracesV2(resourceGroupName: string, name: string, operationId: string, callback: msRest.ServiceCallback): void; + /** + * @param resourceGroupName Name of the resource group to which the resource belongs. + * @param name Name of the app. + * @param operationId GUID of the operation. + * @param options The optional parameters + * @param callback The callback + */ + getNetworkTracesV2(resourceGroupName: string, name: string, operationId: string, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; + getNetworkTracesV2(resourceGroupName: string, name: string, operationId: string, options?: msRest.RequestOptionsBase | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { + return this.client.sendOperationRequest( + { + resourceGroupName, + name, + operationId, + options + }, + getNetworkTracesV2OperationSpec, + callback) as Promise; + } + + /** + * Generates a new publishing password for an app (or deployment slot, if specified). + * @summary Generates a new publishing password for an app (or deployment slot, if specified). + * @param resourceGroupName Name of the resource group to which the resource belongs. + * @param name Name of the app. + * @param [options] The optional parameters + * @returns Promise + */ + generateNewSitePublishingPassword(resourceGroupName: string, name: string, options?: msRest.RequestOptionsBase): Promise; + /** + * @param resourceGroupName Name of the resource group to which the resource belongs. + * @param name Name of the app. + * @param callback The callback + */ + generateNewSitePublishingPassword(resourceGroupName: string, name: string, callback: msRest.ServiceCallback): void; + /** + * @param resourceGroupName Name of the resource group to which the resource belongs. + * @param name Name of the app. + * @param options The optional parameters + * @param callback The callback + */ + generateNewSitePublishingPassword(resourceGroupName: string, name: string, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; + generateNewSitePublishingPassword(resourceGroupName: string, name: string, options?: msRest.RequestOptionsBase | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { + return this.client.sendOperationRequest( + { + resourceGroupName, + name, + options + }, + generateNewSitePublishingPasswordOperationSpec, + callback); + } + + /** + * Gets perfmon counters for web app. + * @summary Gets perfmon counters for web app. + * @param resourceGroupName Name of the resource group to which the resource belongs. + * @param name Name of web app. + * @param [options] The optional parameters + * @returns Promise + */ + listPerfMonCounters(resourceGroupName: string, name: string, options?: Models.WebAppsListPerfMonCountersOptionalParams): Promise; + /** + * @param resourceGroupName Name of the resource group to which the resource belongs. + * @param name Name of web app. + * @param callback The callback + */ + listPerfMonCounters(resourceGroupName: string, name: string, callback: msRest.ServiceCallback): void; + /** + * @param resourceGroupName Name of the resource group to which the resource belongs. + * @param name Name of web app. + * @param options The optional parameters + * @param callback The callback + */ + listPerfMonCounters(resourceGroupName: string, name: string, options: Models.WebAppsListPerfMonCountersOptionalParams, callback: msRest.ServiceCallback): void; + listPerfMonCounters(resourceGroupName: string, name: string, options?: Models.WebAppsListPerfMonCountersOptionalParams | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { + return this.client.sendOperationRequest( + { + resourceGroupName, + name, + options + }, + listPerfMonCountersOperationSpec, + callback) as Promise; + } + + /** + * Gets web app's event logs. + * @summary Gets web app's event logs. + * @param resourceGroupName Name of the resource group to which the resource belongs. + * @param name Name of web app. + * @param [options] The optional parameters + * @returns Promise + */ + getSitePhpErrorLogFlag(resourceGroupName: string, name: string, options?: msRest.RequestOptionsBase): Promise; + /** + * @param resourceGroupName Name of the resource group to which the resource belongs. + * @param name Name of web app. + * @param callback The callback + */ + getSitePhpErrorLogFlag(resourceGroupName: string, name: string, callback: msRest.ServiceCallback): void; + /** + * @param resourceGroupName Name of the resource group to which the resource belongs. + * @param name Name of web app. + * @param options The optional parameters + * @param callback The callback + */ + getSitePhpErrorLogFlag(resourceGroupName: string, name: string, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; + getSitePhpErrorLogFlag(resourceGroupName: string, name: string, options?: msRest.RequestOptionsBase | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { + return this.client.sendOperationRequest( + { + resourceGroupName, + name, + options + }, + getSitePhpErrorLogFlagOperationSpec, + callback) as Promise; + } + + /** + * Gets the premier add-ons of an app. + * @summary Gets the premier add-ons of an app. + * @param resourceGroupName Name of the resource group to which the resource belongs. + * @param name Name of the app. + * @param [options] The optional parameters + * @returns Promise + */ + listPremierAddOns(resourceGroupName: string, name: string, options?: msRest.RequestOptionsBase): Promise; + /** + * @param resourceGroupName Name of the resource group to which the resource belongs. + * @param name Name of the app. + * @param callback The callback + */ + listPremierAddOns(resourceGroupName: string, name: string, callback: msRest.ServiceCallback): void; + /** + * @param resourceGroupName Name of the resource group to which the resource belongs. + * @param name Name of the app. + * @param options The optional parameters + * @param callback The callback + */ + listPremierAddOns(resourceGroupName: string, name: string, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; + listPremierAddOns(resourceGroupName: string, name: string, options?: msRest.RequestOptionsBase | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { + return this.client.sendOperationRequest( + { + resourceGroupName, + name, + options + }, + listPremierAddOnsOperationSpec, + callback) as Promise; + } + + /** + * Gets a named add-on of an app. + * @summary Gets a named add-on of an app. + * @param resourceGroupName Name of the resource group to which the resource belongs. + * @param name Name of the app. + * @param premierAddOnName Add-on name. + * @param [options] The optional parameters + * @returns Promise + */ + getPremierAddOn(resourceGroupName: string, name: string, premierAddOnName: string, options?: msRest.RequestOptionsBase): Promise; + /** + * @param resourceGroupName Name of the resource group to which the resource belongs. + * @param name Name of the app. + * @param premierAddOnName Add-on name. + * @param callback The callback + */ + getPremierAddOn(resourceGroupName: string, name: string, premierAddOnName: string, callback: msRest.ServiceCallback): void; + /** + * @param resourceGroupName Name of the resource group to which the resource belongs. + * @param name Name of the app. + * @param premierAddOnName Add-on name. + * @param options The optional parameters + * @param callback The callback + */ + getPremierAddOn(resourceGroupName: string, name: string, premierAddOnName: string, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; + getPremierAddOn(resourceGroupName: string, name: string, premierAddOnName: string, options?: msRest.RequestOptionsBase | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { + return this.client.sendOperationRequest( + { + resourceGroupName, + name, + premierAddOnName, + options + }, + getPremierAddOnOperationSpec, + callback) as Promise; + } + + /** + * Updates a named add-on of an app. + * @summary Updates a named add-on of an app. + * @param resourceGroupName Name of the resource group to which the resource belongs. + * @param name Name of the app. + * @param premierAddOnName Add-on name. + * @param premierAddOn A JSON representation of the edited premier add-on. + * @param [options] The optional parameters + * @returns Promise + */ + addPremierAddOn(resourceGroupName: string, name: string, premierAddOnName: string, premierAddOn: Models.PremierAddOn, options?: msRest.RequestOptionsBase): Promise; + /** + * @param resourceGroupName Name of the resource group to which the resource belongs. + * @param name Name of the app. + * @param premierAddOnName Add-on name. + * @param premierAddOn A JSON representation of the edited premier add-on. + * @param callback The callback + */ + addPremierAddOn(resourceGroupName: string, name: string, premierAddOnName: string, premierAddOn: Models.PremierAddOn, callback: msRest.ServiceCallback): void; + /** + * @param resourceGroupName Name of the resource group to which the resource belongs. + * @param name Name of the app. + * @param premierAddOnName Add-on name. + * @param premierAddOn A JSON representation of the edited premier add-on. + * @param options The optional parameters + * @param callback The callback + */ + addPremierAddOn(resourceGroupName: string, name: string, premierAddOnName: string, premierAddOn: Models.PremierAddOn, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; + addPremierAddOn(resourceGroupName: string, name: string, premierAddOnName: string, premierAddOn: Models.PremierAddOn, options?: msRest.RequestOptionsBase | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { + return this.client.sendOperationRequest( + { + resourceGroupName, + name, + premierAddOnName, + premierAddOn, + options + }, + addPremierAddOnOperationSpec, + callback) as Promise; + } + + /** + * Delete a premier add-on from an app. + * @summary Delete a premier add-on from an app. + * @param resourceGroupName Name of the resource group to which the resource belongs. + * @param name Name of the app. + * @param premierAddOnName Add-on name. + * @param [options] The optional parameters + * @returns Promise + */ + deletePremierAddOn(resourceGroupName: string, name: string, premierAddOnName: string, options?: msRest.RequestOptionsBase): Promise; + /** + * @param resourceGroupName Name of the resource group to which the resource belongs. + * @param name Name of the app. + * @param premierAddOnName Add-on name. + * @param callback The callback + */ + deletePremierAddOn(resourceGroupName: string, name: string, premierAddOnName: string, callback: msRest.ServiceCallback): void; + /** + * @param resourceGroupName Name of the resource group to which the resource belongs. + * @param name Name of the app. + * @param premierAddOnName Add-on name. + * @param options The optional parameters + * @param callback The callback + */ + deletePremierAddOn(resourceGroupName: string, name: string, premierAddOnName: string, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; + deletePremierAddOn(resourceGroupName: string, name: string, premierAddOnName: string, options?: msRest.RequestOptionsBase | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { + return this.client.sendOperationRequest( + { + resourceGroupName, + name, + premierAddOnName, + options + }, + deletePremierAddOnOperationSpec, + callback); + } + + /** + * Updates a named add-on of an app. + * @summary Updates a named add-on of an app. + * @param resourceGroupName Name of the resource group to which the resource belongs. + * @param name Name of the app. + * @param premierAddOnName Add-on name. + * @param premierAddOn A JSON representation of the edited premier add-on. + * @param [options] The optional parameters + * @returns Promise + */ + updatePremierAddOn(resourceGroupName: string, name: string, premierAddOnName: string, premierAddOn: Models.PremierAddOnPatchResource, options?: msRest.RequestOptionsBase): Promise; + /** + * @param resourceGroupName Name of the resource group to which the resource belongs. + * @param name Name of the app. + * @param premierAddOnName Add-on name. + * @param premierAddOn A JSON representation of the edited premier add-on. + * @param callback The callback + */ + updatePremierAddOn(resourceGroupName: string, name: string, premierAddOnName: string, premierAddOn: Models.PremierAddOnPatchResource, callback: msRest.ServiceCallback): void; + /** + * @param resourceGroupName Name of the resource group to which the resource belongs. + * @param name Name of the app. + * @param premierAddOnName Add-on name. + * @param premierAddOn A JSON representation of the edited premier add-on. + * @param options The optional parameters + * @param callback The callback + */ + updatePremierAddOn(resourceGroupName: string, name: string, premierAddOnName: string, premierAddOn: Models.PremierAddOnPatchResource, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; + updatePremierAddOn(resourceGroupName: string, name: string, premierAddOnName: string, premierAddOn: Models.PremierAddOnPatchResource, options?: msRest.RequestOptionsBase | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { + return this.client.sendOperationRequest( + { + resourceGroupName, + name, + premierAddOnName, + premierAddOn, + options + }, + updatePremierAddOnOperationSpec, + callback) as Promise; + } + + /** + * Gets data around private site access enablement and authorized Virtual Networks that can access + * the site. + * @summary Gets data around private site access enablement and authorized Virtual Networks that + * can access the site. + * @param resourceGroupName Name of the resource group to which the resource belongs. + * @param name The name of the web app. + * @param [options] The optional parameters + * @returns Promise + */ + getPrivateAccess(resourceGroupName: string, name: string, options?: msRest.RequestOptionsBase): Promise; + /** + * @param resourceGroupName Name of the resource group to which the resource belongs. + * @param name The name of the web app. + * @param callback The callback + */ + getPrivateAccess(resourceGroupName: string, name: string, callback: msRest.ServiceCallback): void; + /** + * @param resourceGroupName Name of the resource group to which the resource belongs. + * @param name The name of the web app. + * @param options The optional parameters + * @param callback The callback + */ + getPrivateAccess(resourceGroupName: string, name: string, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; + getPrivateAccess(resourceGroupName: string, name: string, options?: msRest.RequestOptionsBase | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { + return this.client.sendOperationRequest( + { + resourceGroupName, + name, + options + }, + getPrivateAccessOperationSpec, + callback) as Promise; + } + + /** + * Sets data around private site access enablement and authorized Virtual Networks that can access + * the site. + * @summary Sets data around private site access enablement and authorized Virtual Networks that + * can access the site. + * @param resourceGroupName Name of the resource group to which the resource belongs. + * @param name The name of the web app. + * @param access The information for the private access + * @param [options] The optional parameters + * @returns Promise + */ + putPrivateAccessVnet(resourceGroupName: string, name: string, access: Models.PrivateAccess, options?: msRest.RequestOptionsBase): Promise; + /** + * @param resourceGroupName Name of the resource group to which the resource belongs. + * @param name The name of the web app. + * @param access The information for the private access + * @param callback The callback + */ + putPrivateAccessVnet(resourceGroupName: string, name: string, access: Models.PrivateAccess, callback: msRest.ServiceCallback): void; + /** + * @param resourceGroupName Name of the resource group to which the resource belongs. + * @param name The name of the web app. + * @param access The information for the private access + * @param options The optional parameters + * @param callback The callback + */ + putPrivateAccessVnet(resourceGroupName: string, name: string, access: Models.PrivateAccess, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; + putPrivateAccessVnet(resourceGroupName: string, name: string, access: Models.PrivateAccess, options?: msRest.RequestOptionsBase | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { + return this.client.sendOperationRequest( + { + resourceGroupName, + name, + access, + options + }, + putPrivateAccessVnetOperationSpec, + callback) as Promise; + } + + /** + * 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 list of processes for a web site, or a deployment slot, or for a specific + * scaled-out instance in a web site. + * @param resourceGroupName Name of the resource group to which the resource belongs. + * @param name Site name. + * @param [options] The optional parameters + * @returns Promise + */ + listProcesses(resourceGroupName: string, name: string, options?: msRest.RequestOptionsBase): Promise; + /** + * @param resourceGroupName Name of the resource group to which the resource belongs. + * @param name Site name. + * @param callback The callback + */ + listProcesses(resourceGroupName: string, name: string, callback: msRest.ServiceCallback): void; + /** + * @param resourceGroupName Name of the resource group to which the resource belongs. + * @param name Site name. + * @param options The optional parameters + * @param callback The callback + */ + listProcesses(resourceGroupName: string, name: string, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; + listProcesses(resourceGroupName: string, name: string, options?: msRest.RequestOptionsBase | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { + return this.client.sendOperationRequest( + { + resourceGroupName, + name, + options + }, + listProcessesOperationSpec, + callback) as Promise; + } + + /** + * Get process information by its ID 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. + * @param resourceGroupName Name of the resource group to which the resource belongs. + * @param name Site name. + * @param processId PID. + * @param [options] The optional parameters + * @returns Promise + */ + getProcess(resourceGroupName: string, name: string, processId: string, options?: msRest.RequestOptionsBase): Promise; + /** + * @param resourceGroupName Name of the resource group to which the resource belongs. + * @param name Site name. + * @param processId PID. + * @param callback The callback + */ + getProcess(resourceGroupName: string, name: string, processId: string, callback: msRest.ServiceCallback): void; + /** + * @param resourceGroupName Name of the resource group to which the resource belongs. + * @param name Site name. + * @param processId PID. + * @param options The optional parameters + * @param callback The callback + */ + getProcess(resourceGroupName: string, name: string, processId: string, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; + getProcess(resourceGroupName: string, name: string, processId: string, options?: msRest.RequestOptionsBase | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { + return this.client.sendOperationRequest( + { + resourceGroupName, + name, + processId, + options + }, + getProcessOperationSpec, + callback) as Promise; + } + + /** + * Terminate a process by its ID for a web site, or a deployment slot, or 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. + * @param resourceGroupName Name of the resource group to which the resource belongs. + * @param name Site name. + * @param processId PID. + * @param [options] The optional parameters + * @returns Promise + */ + deleteProcess(resourceGroupName: string, name: string, processId: string, options?: msRest.RequestOptionsBase): Promise; + /** + * @param resourceGroupName Name of the resource group to which the resource belongs. + * @param name Site name. + * @param processId PID. + * @param callback The callback + */ + deleteProcess(resourceGroupName: string, name: string, processId: string, callback: msRest.ServiceCallback): void; + /** + * @param resourceGroupName Name of the resource group to which the resource belongs. + * @param name Site name. + * @param processId PID. + * @param options The optional parameters + * @param callback The callback + */ + deleteProcess(resourceGroupName: string, name: string, processId: string, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; + deleteProcess(resourceGroupName: string, name: string, processId: string, options?: msRest.RequestOptionsBase | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { + return this.client.sendOperationRequest( + { + resourceGroupName, + name, + processId, + options + }, + deleteProcessOperationSpec, + callback); + } + + /** + * Get a memory dump of a process by its ID 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. + * @param resourceGroupName Name of the resource group to which the resource belongs. + * @param name Site name. + * @param processId PID. + * @param [options] The optional parameters + * @returns Promise + */ + getProcessDump(resourceGroupName: string, name: string, processId: string, options?: msRest.RequestOptionsBase): Promise; + /** + * @param resourceGroupName Name of the resource group to which the resource belongs. + * @param name Site name. + * @param processId PID. + * @param callback The callback + */ + getProcessDump(resourceGroupName: string, name: string, processId: string, callback: msRest.ServiceCallback): void; + /** + * @param resourceGroupName Name of the resource group to which the resource belongs. + * @param name Site name. + * @param processId PID. + * @param options The optional parameters + * @param callback The callback + */ + getProcessDump(resourceGroupName: string, name: string, processId: string, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; + getProcessDump(resourceGroupName: string, name: string, processId: string, options?: msRest.RequestOptionsBase | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { + return this.client.sendOperationRequest( + { + resourceGroupName, + name, + processId, + options + }, + getProcessDumpOperationSpec, + callback) as Promise; + } + + /** + * List module information for a process 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. + * @param resourceGroupName Name of the resource group to which the resource belongs. + * @param name Site name. + * @param processId PID. + * @param [options] The optional parameters + * @returns Promise + */ + listProcessModules(resourceGroupName: string, name: string, processId: string, options?: msRest.RequestOptionsBase): Promise; + /** + * @param resourceGroupName Name of the resource group to which the resource belongs. + * @param name Site name. + * @param processId PID. + * @param callback The callback + */ + listProcessModules(resourceGroupName: string, name: string, processId: string, callback: msRest.ServiceCallback): void; + /** + * @param resourceGroupName Name of the resource group to which the resource belongs. + * @param name Site name. + * @param processId PID. + * @param options The optional parameters + * @param callback The callback + */ + listProcessModules(resourceGroupName: string, name: string, processId: string, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; + listProcessModules(resourceGroupName: string, name: string, processId: string, options?: msRest.RequestOptionsBase | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { + return this.client.sendOperationRequest( + { + resourceGroupName, + name, + processId, + options + }, + listProcessModulesOperationSpec, + callback) as Promise; + } + + /** + * Get process information by its ID 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. + * @param resourceGroupName Name of the resource group to which the resource belongs. + * @param name Site name. + * @param processId PID. + * @param baseAddress Module base address. + * @param [options] The optional parameters + * @returns Promise + */ + getProcessModule(resourceGroupName: string, name: string, processId: string, baseAddress: string, options?: msRest.RequestOptionsBase): Promise; + /** + * @param resourceGroupName Name of the resource group to which the resource belongs. + * @param name Site name. + * @param processId PID. + * @param baseAddress Module base address. + * @param callback The callback + */ + getProcessModule(resourceGroupName: string, name: string, processId: string, baseAddress: string, callback: msRest.ServiceCallback): void; + /** + * @param resourceGroupName Name of the resource group to which the resource belongs. + * @param name Site name. + * @param processId PID. + * @param baseAddress Module base address. + * @param options The optional parameters + * @param callback The callback + */ + getProcessModule(resourceGroupName: string, name: string, processId: string, baseAddress: string, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; + getProcessModule(resourceGroupName: string, name: string, processId: string, baseAddress: string, options?: msRest.RequestOptionsBase | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { + return this.client.sendOperationRequest( + { + resourceGroupName, + name, + processId, + baseAddress, + options + }, + getProcessModuleOperationSpec, + callback) as Promise; + } + + /** + * List the threads in a process by its ID 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. + * @param resourceGroupName Name of the resource group to which the resource belongs. + * @param name Site name. + * @param processId PID. + * @param [options] The optional parameters + * @returns Promise + */ + listProcessThreads(resourceGroupName: string, name: string, processId: string, options?: msRest.RequestOptionsBase): Promise; + /** + * @param resourceGroupName Name of the resource group to which the resource belongs. + * @param name Site name. + * @param processId PID. + * @param callback The callback + */ + listProcessThreads(resourceGroupName: string, name: string, processId: string, callback: msRest.ServiceCallback): void; + /** + * @param resourceGroupName Name of the resource group to which the resource belongs. + * @param name Site name. + * @param processId PID. + * @param options The optional parameters + * @param callback The callback + */ + listProcessThreads(resourceGroupName: string, name: string, processId: string, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; + listProcessThreads(resourceGroupName: string, name: string, processId: string, options?: msRest.RequestOptionsBase | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { + return this.client.sendOperationRequest( + { + resourceGroupName, + name, + processId, + options + }, + listProcessThreadsOperationSpec, + callback) as Promise; + } + + /** + * Get thread information by Thread ID for a specific process, in 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. + * @param resourceGroupName Name of the resource group to which the resource belongs. + * @param name Site name. + * @param processId PID. + * @param threadId TID. + * @param [options] The optional parameters + * @returns Promise + */ + getProcessThread(resourceGroupName: string, name: string, processId: string, threadId: string, options?: msRest.RequestOptionsBase): Promise; + /** + * @param resourceGroupName Name of the resource group to which the resource belongs. + * @param name Site name. + * @param processId PID. + * @param threadId TID. + * @param callback The callback + */ + getProcessThread(resourceGroupName: string, name: string, processId: string, threadId: string, callback: msRest.ServiceCallback): void; + /** + * @param resourceGroupName Name of the resource group to which the resource belongs. + * @param name Site name. + * @param processId PID. + * @param threadId TID. + * @param options The optional parameters + * @param callback The callback + */ + getProcessThread(resourceGroupName: string, name: string, processId: string, threadId: string, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; + getProcessThread(resourceGroupName: string, name: string, processId: string, threadId: string, options?: msRest.RequestOptionsBase | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { + return this.client.sendOperationRequest( + { + resourceGroupName, + name, + processId, + threadId, + options + }, + getProcessThreadOperationSpec, + callback) as Promise; + } + + /** + * Get public certificates for an app or a deployment slot. + * @summary Get public certificates for an app or a deployment slot. + * @param resourceGroupName Name of the resource group to which the resource belongs. + * @param name Name of the app. + * @param [options] The optional parameters + * @returns Promise + */ + listPublicCertificates(resourceGroupName: string, name: string, options?: msRest.RequestOptionsBase): Promise; + /** + * @param resourceGroupName Name of the resource group to which the resource belongs. + * @param name Name of the app. + * @param callback The callback + */ + listPublicCertificates(resourceGroupName: string, name: string, callback: msRest.ServiceCallback): void; + /** + * @param resourceGroupName Name of the resource group to which the resource belongs. + * @param name Name of the app. + * @param options The optional parameters + * @param callback The callback + */ + listPublicCertificates(resourceGroupName: string, name: string, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; + listPublicCertificates(resourceGroupName: string, name: string, options?: msRest.RequestOptionsBase | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { + return this.client.sendOperationRequest( + { + resourceGroupName, + name, + options + }, + listPublicCertificatesOperationSpec, + callback) as Promise; + } + + /** + * Get the named public certificate for an app (or deployment slot, if specified). + * @summary Get the named public certificate for an app (or deployment slot, if specified). + * @param resourceGroupName Name of the resource group to which the resource belongs. + * @param name Name of the app. + * @param publicCertificateName Public certificate name. + * @param [options] The optional parameters + * @returns Promise + */ + getPublicCertificate(resourceGroupName: string, name: string, publicCertificateName: string, options?: msRest.RequestOptionsBase): Promise; + /** + * @param resourceGroupName Name of the resource group to which the resource belongs. + * @param name Name of the app. + * @param publicCertificateName Public certificate name. + * @param callback The callback + */ + getPublicCertificate(resourceGroupName: string, name: string, publicCertificateName: string, callback: msRest.ServiceCallback): void; + /** + * @param resourceGroupName Name of the resource group to which the resource belongs. + * @param name Name of the app. + * @param publicCertificateName Public certificate name. + * @param options The optional parameters + * @param callback The callback + */ + getPublicCertificate(resourceGroupName: string, name: string, publicCertificateName: string, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; + getPublicCertificate(resourceGroupName: string, name: string, publicCertificateName: string, options?: msRest.RequestOptionsBase | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { + return this.client.sendOperationRequest( + { + resourceGroupName, + name, + publicCertificateName, + options + }, + getPublicCertificateOperationSpec, + callback) as Promise; + } + + /** + * Creates a hostname binding for an app. + * @summary Creates a hostname binding for an app. + * @param resourceGroupName Name of the resource group to which the resource belongs. + * @param name Name of the app. + * @param publicCertificateName Public certificate name. + * @param publicCertificate Public certificate details. This is the JSON representation of a + * PublicCertificate object. + * @param [options] The optional parameters + * @returns Promise + */ + createOrUpdatePublicCertificate(resourceGroupName: string, name: string, publicCertificateName: string, publicCertificate: Models.PublicCertificate, options?: msRest.RequestOptionsBase): Promise; + /** + * @param resourceGroupName Name of the resource group to which the resource belongs. + * @param name Name of the app. + * @param publicCertificateName Public certificate name. + * @param publicCertificate Public certificate details. This is the JSON representation of a + * PublicCertificate object. + * @param callback The callback + */ + createOrUpdatePublicCertificate(resourceGroupName: string, name: string, publicCertificateName: string, publicCertificate: Models.PublicCertificate, callback: msRest.ServiceCallback): void; + /** + * @param resourceGroupName Name of the resource group to which the resource belongs. + * @param name Name of the app. + * @param publicCertificateName Public certificate name. + * @param publicCertificate Public certificate details. This is the JSON representation of a + * PublicCertificate object. + * @param options The optional parameters + * @param callback The callback + */ + createOrUpdatePublicCertificate(resourceGroupName: string, name: string, publicCertificateName: string, publicCertificate: Models.PublicCertificate, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; + createOrUpdatePublicCertificate(resourceGroupName: string, name: string, publicCertificateName: string, publicCertificate: Models.PublicCertificate, options?: msRest.RequestOptionsBase | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { + return this.client.sendOperationRequest( + { + resourceGroupName, + name, + publicCertificateName, + publicCertificate, + options + }, + createOrUpdatePublicCertificateOperationSpec, + callback) as Promise; + } + + /** + * Deletes a hostname binding for an app. + * @summary Deletes a hostname binding for an app. + * @param resourceGroupName Name of the resource group to which the resource belongs. + * @param name Name of the app. + * @param publicCertificateName Public certificate name. + * @param [options] The optional parameters + * @returns Promise + */ + deletePublicCertificate(resourceGroupName: string, name: string, publicCertificateName: string, options?: msRest.RequestOptionsBase): Promise; + /** + * @param resourceGroupName Name of the resource group to which the resource belongs. + * @param name Name of the app. + * @param publicCertificateName Public certificate name. + * @param callback The callback + */ + deletePublicCertificate(resourceGroupName: string, name: string, publicCertificateName: string, callback: msRest.ServiceCallback): void; + /** + * @param resourceGroupName Name of the resource group to which the resource belongs. + * @param name Name of the app. + * @param publicCertificateName Public certificate name. + * @param options The optional parameters + * @param callback The callback + */ + deletePublicCertificate(resourceGroupName: string, name: string, publicCertificateName: string, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; + deletePublicCertificate(resourceGroupName: string, name: string, publicCertificateName: string, options?: msRest.RequestOptionsBase | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { + return this.client.sendOperationRequest( + { + resourceGroupName, + name, + publicCertificateName, + options + }, + deletePublicCertificateOperationSpec, + callback); + } + + /** + * Gets the publishing profile for an app (or deployment slot, if specified). + * @summary Gets the publishing profile for an app (or deployment slot, if specified). + * @param resourceGroupName Name of the resource group to which the resource belongs. + * @param name Name of the app. + * @param publishingProfileOptions Specifies publishingProfileOptions for publishing profile. For + * example, use {"format": "FileZilla3"} to get a FileZilla publishing profile. + * @param [options] The optional parameters + * @returns Promise + */ + listPublishingProfileXmlWithSecrets(resourceGroupName: string, name: string, publishingProfileOptions: Models.CsmPublishingProfileOptions, options?: msRest.RequestOptionsBase): Promise; + /** + * @param resourceGroupName Name of the resource group to which the resource belongs. + * @param name Name of the app. + * @param publishingProfileOptions Specifies publishingProfileOptions for publishing profile. For + * example, use {"format": "FileZilla3"} to get a FileZilla publishing profile. + * @param callback The callback + */ + listPublishingProfileXmlWithSecrets(resourceGroupName: string, name: string, publishingProfileOptions: Models.CsmPublishingProfileOptions, callback: msRest.ServiceCallback): void; + /** + * @param resourceGroupName Name of the resource group to which the resource belongs. + * @param name Name of the app. + * @param publishingProfileOptions Specifies publishingProfileOptions for publishing profile. For + * example, use {"format": "FileZilla3"} to get a FileZilla publishing profile. + * @param options The optional parameters + * @param callback The callback + */ + listPublishingProfileXmlWithSecrets(resourceGroupName: string, name: string, publishingProfileOptions: Models.CsmPublishingProfileOptions, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; + listPublishingProfileXmlWithSecrets(resourceGroupName: string, name: string, publishingProfileOptions: Models.CsmPublishingProfileOptions, options?: msRest.RequestOptionsBase | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { + return this.client.sendOperationRequest( + { + resourceGroupName, + name, + publishingProfileOptions, + options + }, + listPublishingProfileXmlWithSecretsOperationSpec, + callback) as Promise; + } + + /** + * Resets the configuration settings of the current slot if they were previously modified by + * calling the API with POST. + * @summary Resets the configuration settings of the current slot if they were previously modified + * by calling the API with POST. + * @param resourceGroupName Name of the resource group to which the resource belongs. + * @param name Name of the app. + * @param [options] The optional parameters + * @returns Promise + */ + resetProductionSlotConfig(resourceGroupName: string, name: string, options?: msRest.RequestOptionsBase): Promise; + /** + * @param resourceGroupName Name of the resource group to which the resource belongs. + * @param name Name of the app. + * @param callback The callback + */ + resetProductionSlotConfig(resourceGroupName: string, name: string, callback: msRest.ServiceCallback): void; + /** + * @param resourceGroupName Name of the resource group to which the resource belongs. + * @param name Name of the app. + * @param options The optional parameters + * @param callback The callback + */ + resetProductionSlotConfig(resourceGroupName: string, name: string, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; + resetProductionSlotConfig(resourceGroupName: string, name: string, options?: msRest.RequestOptionsBase | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { + return this.client.sendOperationRequest( + { + resourceGroupName, + name, + options + }, + resetProductionSlotConfigOperationSpec, + callback); + } + + /** + * Restarts an app (or deployment slot, if specified). + * @summary Restarts an app (or deployment slot, if specified). + * @param resourceGroupName Name of the resource group to which the resource belongs. + * @param name Name of the app. + * @param [options] The optional parameters + * @returns Promise + */ + restart(resourceGroupName: string, name: string, options?: Models.WebAppsRestartOptionalParams): Promise; + /** + * @param resourceGroupName Name of the resource group to which the resource belongs. + * @param name Name of the app. + * @param callback The callback + */ + restart(resourceGroupName: string, name: string, callback: msRest.ServiceCallback): void; + /** + * @param resourceGroupName Name of the resource group to which the resource belongs. + * @param name Name of the app. + * @param options The optional parameters + * @param callback The callback + */ + restart(resourceGroupName: string, name: string, options: Models.WebAppsRestartOptionalParams, callback: msRest.ServiceCallback): void; + restart(resourceGroupName: string, name: string, options?: Models.WebAppsRestartOptionalParams | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { + return this.client.sendOperationRequest( + { + resourceGroupName, + name, + options + }, + restartOperationSpec, + callback); + } + + /** + * Restores an app from a backup blob in Azure Storage. + * @summary Restores an app from a backup blob in Azure Storage. + * @param resourceGroupName Name of the resource group to which the resource belongs. + * @param name Name of the app. + * @param request Information on restore request . + * @param [options] The optional parameters + * @returns Promise + */ + restoreFromBackupBlob(resourceGroupName: string, name: string, request: Models.RestoreRequest, options?: msRest.RequestOptionsBase): Promise { + return this.beginRestoreFromBackupBlob(resourceGroupName,name,request,options) + .then(lroPoller => lroPoller.pollUntilFinished()); + } + + /** + * Restores a deleted web app to this web app. + * @summary Restores a deleted web app to this web app. + * @param resourceGroupName Name of the resource group to which the resource belongs. + * @param name Name of web app. + * @param restoreRequest Deleted web app restore information. + * @param [options] The optional parameters + * @returns Promise + */ + restoreFromDeletedApp(resourceGroupName: string, name: string, restoreRequest: Models.DeletedAppRestoreRequest, options?: msRest.RequestOptionsBase): Promise { + return this.beginRestoreFromDeletedApp(resourceGroupName,name,restoreRequest,options) + .then(lroPoller => lroPoller.pollUntilFinished()); + } + + /** + * Restores a web app from a snapshot. + * @summary Restores a web app from a snapshot. + * @param resourceGroupName Name of the resource group to which the resource belongs. + * @param name Name of web app. + * @param restoreRequest Snapshot restore settings. Snapshot information can be obtained by calling + * GetDeletedSites or GetSiteSnapshots API. + * @param [options] The optional parameters + * @returns Promise + */ + restoreSnapshot(resourceGroupName: string, name: string, restoreRequest: Models.SnapshotRestoreRequest, options?: msRest.RequestOptionsBase): Promise { + return this.beginRestoreSnapshot(resourceGroupName,name,restoreRequest,options) + .then(lroPoller => lroPoller.pollUntilFinished()); + } + + /** + * Get list of siteextensions for a web site, or a deployment slot. + * @summary Get list of siteextensions for a web site, or a deployment slot. + * @param resourceGroupName Name of the resource group to which the resource belongs. + * @param name Site name. + * @param [options] The optional parameters + * @returns Promise + */ + listSiteExtensions(resourceGroupName: string, name: string, options?: msRest.RequestOptionsBase): Promise; + /** + * @param resourceGroupName Name of the resource group to which the resource belongs. + * @param name Site name. + * @param callback The callback + */ + listSiteExtensions(resourceGroupName: string, name: string, callback: msRest.ServiceCallback): void; + /** + * @param resourceGroupName Name of the resource group to which the resource belongs. + * @param name Site name. + * @param options The optional parameters + * @param callback The callback + */ + listSiteExtensions(resourceGroupName: string, name: string, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; + listSiteExtensions(resourceGroupName: string, name: string, options?: msRest.RequestOptionsBase | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { + return this.client.sendOperationRequest( + { + resourceGroupName, + name, + options + }, + listSiteExtensionsOperationSpec, + callback) as Promise; + } + + /** + * Get site extension information by its ID for a web site, or a deployment slot. + * @summary Get site extension information by its ID for a web site, or a deployment slot. + * @param resourceGroupName Name of the resource group to which the resource belongs. + * @param name Site name. + * @param siteExtensionId Site extension name. + * @param [options] The optional parameters + * @returns Promise + */ + getSiteExtension(resourceGroupName: string, name: string, siteExtensionId: string, options?: msRest.RequestOptionsBase): Promise; + /** + * @param resourceGroupName Name of the resource group to which the resource belongs. + * @param name Site name. + * @param siteExtensionId Site extension name. + * @param callback The callback + */ + getSiteExtension(resourceGroupName: string, name: string, siteExtensionId: string, callback: msRest.ServiceCallback): void; + /** + * @param resourceGroupName Name of the resource group to which the resource belongs. + * @param name Site name. + * @param siteExtensionId Site extension name. + * @param options The optional parameters + * @param callback The callback + */ + getSiteExtension(resourceGroupName: string, name: string, siteExtensionId: string, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; + getSiteExtension(resourceGroupName: string, name: string, siteExtensionId: string, options?: msRest.RequestOptionsBase | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { + return this.client.sendOperationRequest( + { + resourceGroupName, + name, + siteExtensionId, + options + }, + getSiteExtensionOperationSpec, + callback) as Promise; + } + + /** + * Install site extension on a web site, or a deployment slot. + * @summary Install site extension on a web site, or a deployment slot. + * @param resourceGroupName Name of the resource group to which the resource belongs. + * @param name Site name. + * @param siteExtensionId Site extension name. + * @param [options] The optional parameters + * @returns Promise + */ + installSiteExtension(resourceGroupName: string, name: string, siteExtensionId: string, options?: msRest.RequestOptionsBase): Promise { + return this.beginInstallSiteExtension(resourceGroupName,name,siteExtensionId,options) + .then(lroPoller => lroPoller.pollUntilFinished()) as Promise; + } + + /** + * Remove a site extension from a web site, or a deployment slot. + * @summary Remove a site extension from a web site, or a deployment slot. + * @param resourceGroupName Name of the resource group to which the resource belongs. + * @param name Site name. + * @param siteExtensionId Site extension name. + * @param [options] The optional parameters + * @returns Promise + */ + deleteSiteExtension(resourceGroupName: string, name: string, siteExtensionId: string, options?: msRest.RequestOptionsBase): Promise; + /** + * @param resourceGroupName Name of the resource group to which the resource belongs. + * @param name Site name. + * @param siteExtensionId Site extension name. + * @param callback The callback + */ + deleteSiteExtension(resourceGroupName: string, name: string, siteExtensionId: string, callback: msRest.ServiceCallback): void; + /** + * @param resourceGroupName Name of the resource group to which the resource belongs. + * @param name Site name. + * @param siteExtensionId Site extension name. + * @param options The optional parameters + * @param callback The callback + */ + deleteSiteExtension(resourceGroupName: string, name: string, siteExtensionId: string, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; + deleteSiteExtension(resourceGroupName: string, name: string, siteExtensionId: string, options?: msRest.RequestOptionsBase | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { + return this.client.sendOperationRequest( + { + resourceGroupName, + name, + siteExtensionId, + options + }, + deleteSiteExtensionOperationSpec, + callback); + } + + /** + * Gets an app's deployment slots. + * @summary Gets an app's deployment slots. + * @param resourceGroupName Name of the resource group to which the resource belongs. + * @param name Name of the app. + * @param [options] The optional parameters + * @returns Promise + */ + listSlots(resourceGroupName: string, name: string, options?: msRest.RequestOptionsBase): Promise; + /** + * @param resourceGroupName Name of the resource group to which the resource belongs. + * @param name Name of the app. + * @param callback The callback + */ + listSlots(resourceGroupName: string, name: string, callback: msRest.ServiceCallback): void; + /** + * @param resourceGroupName Name of the resource group to which the resource belongs. + * @param name Name of the app. + * @param options The optional parameters + * @param callback The callback + */ + listSlots(resourceGroupName: string, name: string, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; + listSlots(resourceGroupName: string, name: string, options?: msRest.RequestOptionsBase | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { + return this.client.sendOperationRequest( + { + resourceGroupName, + name, + options + }, + listSlotsOperationSpec, + callback) as Promise; + } + + /** + * Gets the details of a web, mobile, or API app. + * @summary Gets the details of a web, mobile, or API app. + * @param resourceGroupName Name of the resource group to which the resource belongs. + * @param name Name of the app. + * @param slot Name of the deployment slot. By default, this API returns the production slot. + * @param [options] The optional parameters + * @returns Promise + */ + getSlot(resourceGroupName: string, name: string, slot: string, options?: msRest.RequestOptionsBase): Promise; + /** + * @param resourceGroupName Name of the resource group to which the resource belongs. + * @param name Name of the app. + * @param slot Name of the deployment slot. By default, this API returns the production slot. + * @param callback The callback + */ + getSlot(resourceGroupName: string, name: string, slot: string, callback: msRest.ServiceCallback): void; + /** + * @param resourceGroupName Name of the resource group to which the resource belongs. + * @param name Name of the app. + * @param slot Name of the deployment slot. By default, this API returns the production slot. + * @param options The optional parameters + * @param callback The callback + */ + getSlot(resourceGroupName: string, name: string, slot: string, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; + getSlot(resourceGroupName: string, name: string, slot: string, options?: msRest.RequestOptionsBase | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { + return this.client.sendOperationRequest( + { + resourceGroupName, + name, + slot, + options + }, + getSlotOperationSpec, + callback) as Promise; + } + + /** + * Creates a new web, mobile, or API app in an existing resource group, or updates an existing app. + * @summary Creates a new web, mobile, or API app in an existing resource group, or updates an + * existing app. + * @param resourceGroupName Name of the resource group to which the resource belongs. + * @param name Unique name of the app to create or update. To create or update a deployment slot, + * use the {slot} parameter. + * @param siteEnvelope A JSON representation of the app properties. See example. + * @param slot Name of the deployment slot to create or update. By default, this API attempts to + * create or modify the production slot. + * @param [options] The optional parameters + * @returns Promise + */ + createOrUpdateSlot(resourceGroupName: string, name: string, siteEnvelope: Models.Site, slot: string, options?: msRest.RequestOptionsBase): Promise { + return this.beginCreateOrUpdateSlot(resourceGroupName,name,siteEnvelope,slot,options) + .then(lroPoller => lroPoller.pollUntilFinished()) as Promise; + } + + /** + * Deletes a web, mobile, or API app, or one of the deployment slots. + * @summary Deletes a web, mobile, or API app, or one of the deployment slots. + * @param resourceGroupName Name of the resource group to which the resource belongs. + * @param name Name of the app to delete. + * @param slot Name of the deployment slot to delete. By default, the API deletes the production + * slot. + * @param [options] The optional parameters + * @returns Promise + */ + deleteSlot(resourceGroupName: string, name: string, slot: string, options?: Models.WebAppsDeleteSlotOptionalParams): Promise; + /** + * @param resourceGroupName Name of the resource group to which the resource belongs. + * @param name Name of the app to delete. + * @param slot Name of the deployment slot to delete. By default, the API deletes the production + * slot. + * @param callback The callback + */ + deleteSlot(resourceGroupName: string, name: string, slot: string, callback: msRest.ServiceCallback): void; + /** + * @param resourceGroupName Name of the resource group to which the resource belongs. + * @param name Name of the app to delete. + * @param slot Name of the deployment slot to delete. By default, the API deletes the production + * slot. + * @param options The optional parameters + * @param callback The callback + */ + deleteSlot(resourceGroupName: string, name: string, slot: string, options: Models.WebAppsDeleteSlotOptionalParams, callback: msRest.ServiceCallback): void; + deleteSlot(resourceGroupName: string, name: string, slot: string, options?: Models.WebAppsDeleteSlotOptionalParams | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { + return this.client.sendOperationRequest( + { + resourceGroupName, + name, + slot, + options + }, + deleteSlotOperationSpec, + callback); + } + + /** + * Creates a new web, mobile, or API app in an existing resource group, or updates an existing app. + * @summary Creates a new web, mobile, or API app in an existing resource group, or updates an + * existing app. + * @param resourceGroupName Name of the resource group to which the resource belongs. + * @param name Unique name of the app to create or update. To create or update a deployment slot, + * use the {slot} parameter. + * @param siteEnvelope A JSON representation of the app properties. See example. + * @param slot Name of the deployment slot to create or update. By default, this API attempts to + * create or modify the production slot. + * @param [options] The optional parameters + * @returns Promise + */ + updateSlot(resourceGroupName: string, name: string, siteEnvelope: Models.SitePatchResource, slot: string, options?: msRest.RequestOptionsBase): Promise; + /** + * @param resourceGroupName Name of the resource group to which the resource belongs. + * @param name Unique name of the app to create or update. To create or update a deployment slot, + * use the {slot} parameter. + * @param siteEnvelope A JSON representation of the app properties. See example. + * @param slot Name of the deployment slot to create or update. By default, this API attempts to + * create or modify the production slot. + * @param callback The callback + */ + updateSlot(resourceGroupName: string, name: string, siteEnvelope: Models.SitePatchResource, slot: string, callback: msRest.ServiceCallback): void; + /** + * @param resourceGroupName Name of the resource group to which the resource belongs. + * @param name Unique name of the app to create or update. To create or update a deployment slot, + * use the {slot} parameter. + * @param siteEnvelope A JSON representation of the app properties. See example. + * @param slot Name of the deployment slot to create or update. By default, this API attempts to + * create or modify the production slot. + * @param options The optional parameters + * @param callback The callback + */ + updateSlot(resourceGroupName: string, name: string, siteEnvelope: Models.SitePatchResource, slot: string, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; + updateSlot(resourceGroupName: string, name: string, siteEnvelope: Models.SitePatchResource, slot: string, options?: msRest.RequestOptionsBase | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { + return this.client.sendOperationRequest( + { + resourceGroupName, + name, + siteEnvelope, + slot, + options + }, + updateSlotOperationSpec, + callback) as Promise; + } + + /** + * Analyze a custom hostname. + * @summary Analyze a custom hostname. + * @param resourceGroupName Name of the resource group to which the resource belongs. + * @param name Name of web app. + * @param slot Name of web app slot. If not specified then will default to production slot. + * @param [options] The optional parameters + * @returns Promise + */ + analyzeCustomHostnameSlot(resourceGroupName: string, name: string, slot: string, options?: Models.WebAppsAnalyzeCustomHostnameSlotOptionalParams): Promise; + /** + * @param resourceGroupName Name of the resource group to which the resource belongs. + * @param name Name of web app. + * @param slot Name of web app slot. If not specified then will default to production slot. + * @param callback The callback + */ + analyzeCustomHostnameSlot(resourceGroupName: string, name: string, slot: string, callback: msRest.ServiceCallback): void; + /** + * @param resourceGroupName Name of the resource group to which the resource belongs. + * @param name Name of web app. + * @param slot Name of web app slot. If not specified then will default to production slot. + * @param options The optional parameters + * @param callback The callback + */ + analyzeCustomHostnameSlot(resourceGroupName: string, name: string, slot: string, options: Models.WebAppsAnalyzeCustomHostnameSlotOptionalParams, callback: msRest.ServiceCallback): void; + analyzeCustomHostnameSlot(resourceGroupName: string, name: string, slot: string, options?: Models.WebAppsAnalyzeCustomHostnameSlotOptionalParams | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { + return this.client.sendOperationRequest( + { + resourceGroupName, + name, + slot, + options + }, + analyzeCustomHostnameSlotOperationSpec, + callback) as Promise; + } + + /** + * Applies the configuration settings from the target slot onto the current slot. + * @summary Applies the configuration settings from the target slot onto the current slot. + * @param resourceGroupName Name of the resource group to which the resource belongs. + * @param name Name of the app. + * @param slotSwapEntity JSON object that contains the target slot name. See example. + * @param slot Name of the source slot. If a slot is not specified, the production slot is used as + * the source slot. + * @param [options] The optional parameters + * @returns Promise + */ + applySlotConfigurationSlot(resourceGroupName: string, name: string, slotSwapEntity: Models.CsmSlotEntity, slot: string, options?: msRest.RequestOptionsBase): Promise; + /** + * @param resourceGroupName Name of the resource group to which the resource belongs. + * @param name Name of the app. + * @param slotSwapEntity JSON object that contains the target slot name. See example. + * @param slot Name of the source slot. If a slot is not specified, the production slot is used as + * the source slot. + * @param callback The callback + */ + applySlotConfigurationSlot(resourceGroupName: string, name: string, slotSwapEntity: Models.CsmSlotEntity, slot: string, callback: msRest.ServiceCallback): void; + /** + * @param resourceGroupName Name of the resource group to which the resource belongs. + * @param name Name of the app. + * @param slotSwapEntity JSON object that contains the target slot name. See example. + * @param slot Name of the source slot. If a slot is not specified, the production slot is used as + * the source slot. + * @param options The optional parameters + * @param callback The callback + */ + applySlotConfigurationSlot(resourceGroupName: string, name: string, slotSwapEntity: Models.CsmSlotEntity, slot: string, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; + applySlotConfigurationSlot(resourceGroupName: string, name: string, slotSwapEntity: Models.CsmSlotEntity, slot: string, options?: msRest.RequestOptionsBase | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { + return this.client.sendOperationRequest( + { + resourceGroupName, + name, + slotSwapEntity, + slot, + options + }, + applySlotConfigurationSlotOperationSpec, + callback); + } + + /** + * Creates a backup of an app. + * @summary Creates a backup of an app. + * @param resourceGroupName Name of the resource group to which the resource belongs. + * @param name Name of the app. + * @param request Backup configuration. You can use the JSON response from the POST action as input + * here. + * @param slot Name of the deployment slot. If a slot is not specified, the API will create a + * backup for the production slot. + * @param [options] The optional parameters + * @returns Promise + */ + backupSlot(resourceGroupName: string, name: string, request: Models.BackupRequest, slot: string, options?: msRest.RequestOptionsBase): Promise; + /** + * @param resourceGroupName Name of the resource group to which the resource belongs. + * @param name Name of the app. + * @param request Backup configuration. You can use the JSON response from the POST action as input + * here. + * @param slot Name of the deployment slot. If a slot is not specified, the API will create a + * backup for the production slot. + * @param callback The callback + */ + backupSlot(resourceGroupName: string, name: string, request: Models.BackupRequest, slot: string, callback: msRest.ServiceCallback): void; + /** + * @param resourceGroupName Name of the resource group to which the resource belongs. + * @param name Name of the app. + * @param request Backup configuration. You can use the JSON response from the POST action as input + * here. + * @param slot Name of the deployment slot. If a slot is not specified, the API will create a + * backup for the production slot. + * @param options The optional parameters + * @param callback The callback + */ + backupSlot(resourceGroupName: string, name: string, request: Models.BackupRequest, slot: string, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; + backupSlot(resourceGroupName: string, name: string, request: Models.BackupRequest, slot: string, options?: msRest.RequestOptionsBase | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { + return this.client.sendOperationRequest( + { + resourceGroupName, + name, + request, + slot, + options + }, + backupSlotOperationSpec, + callback) as Promise; + } + + /** + * Gets existing backups of an app. + * @summary Gets existing backups of an app. + * @param resourceGroupName Name of the resource group to which the resource belongs. + * @param name Name of the app. + * @param slot Name of the deployment slot. If a slot is not specified, the API will get backups of + * the production slot. + * @param [options] The optional parameters + * @returns Promise + */ + listBackupsSlot(resourceGroupName: string, name: string, slot: string, options?: msRest.RequestOptionsBase): Promise; + /** + * @param resourceGroupName Name of the resource group to which the resource belongs. + * @param name Name of the app. + * @param slot Name of the deployment slot. If a slot is not specified, the API will get backups of + * the production slot. + * @param callback The callback + */ + listBackupsSlot(resourceGroupName: string, name: string, slot: string, callback: msRest.ServiceCallback): void; + /** + * @param resourceGroupName Name of the resource group to which the resource belongs. + * @param name Name of the app. + * @param slot Name of the deployment slot. If a slot is not specified, the API will get backups of + * the production slot. + * @param options The optional parameters + * @param callback The callback + */ + listBackupsSlot(resourceGroupName: string, name: string, slot: string, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; + listBackupsSlot(resourceGroupName: string, name: string, slot: string, options?: msRest.RequestOptionsBase | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { + return this.client.sendOperationRequest( + { + resourceGroupName, + name, + slot, + options + }, + listBackupsSlotOperationSpec, + callback) as Promise; + } + + /** + * Gets a backup of an app by its ID. + * @summary Gets a backup of an app by its ID. + * @param resourceGroupName Name of the resource group to which the resource belongs. + * @param name Name of the app. + * @param backupId ID of the backup. + * @param slot Name of the deployment slot. If a slot is not specified, the API will get a backup + * of the production slot. + * @param [options] The optional parameters + * @returns Promise + */ + getBackupStatusSlot(resourceGroupName: string, name: string, backupId: string, slot: string, options?: msRest.RequestOptionsBase): Promise; + /** + * @param resourceGroupName Name of the resource group to which the resource belongs. + * @param name Name of the app. + * @param backupId ID of the backup. + * @param slot Name of the deployment slot. If a slot is not specified, the API will get a backup + * of the production slot. + * @param callback The callback + */ + getBackupStatusSlot(resourceGroupName: string, name: string, backupId: string, slot: string, callback: msRest.ServiceCallback): void; + /** + * @param resourceGroupName Name of the resource group to which the resource belongs. + * @param name Name of the app. + * @param backupId ID of the backup. + * @param slot Name of the deployment slot. If a slot is not specified, the API will get a backup + * of the production slot. + * @param options The optional parameters + * @param callback The callback + */ + getBackupStatusSlot(resourceGroupName: string, name: string, backupId: string, slot: string, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; + getBackupStatusSlot(resourceGroupName: string, name: string, backupId: string, slot: string, options?: msRest.RequestOptionsBase | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { + return this.client.sendOperationRequest( + { + resourceGroupName, + name, + backupId, + slot, + options + }, + getBackupStatusSlotOperationSpec, + callback) as Promise; + } + + /** + * Deletes a backup of an app by its ID. + * @summary Deletes a backup of an app by its ID. + * @param resourceGroupName Name of the resource group to which the resource belongs. + * @param name Name of the app. + * @param backupId ID of the backup. + * @param slot Name of the deployment slot. If a slot is not specified, the API will delete a + * backup of the production slot. + * @param [options] The optional parameters + * @returns Promise + */ + deleteBackupSlot(resourceGroupName: string, name: string, backupId: string, slot: string, options?: msRest.RequestOptionsBase): Promise; + /** + * @param resourceGroupName Name of the resource group to which the resource belongs. + * @param name Name of the app. + * @param backupId ID of the backup. + * @param slot Name of the deployment slot. If a slot is not specified, the API will delete a + * backup of the production slot. + * @param callback The callback + */ + deleteBackupSlot(resourceGroupName: string, name: string, backupId: string, slot: string, callback: msRest.ServiceCallback): void; + /** + * @param resourceGroupName Name of the resource group to which the resource belongs. + * @param name Name of the app. + * @param backupId ID of the backup. + * @param slot Name of the deployment slot. If a slot is not specified, the API will delete a + * backup of the production slot. + * @param options The optional parameters + * @param callback The callback + */ + deleteBackupSlot(resourceGroupName: string, name: string, backupId: string, slot: string, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; + deleteBackupSlot(resourceGroupName: string, name: string, backupId: string, slot: string, options?: msRest.RequestOptionsBase | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { + return this.client.sendOperationRequest( + { + resourceGroupName, + name, + backupId, + slot, + options + }, + deleteBackupSlotOperationSpec, + callback); + } + + /** + * 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 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 resourceGroupName Name of the resource group to which the resource belongs. + * @param name Name of web app. + * @param backupId ID of backup. + * @param request Information on backup request. + * @param slot Name of web app slot. If not specified then will default to production slot. + * @param [options] The optional parameters + * @returns Promise + */ + listBackupStatusSecretsSlot(resourceGroupName: string, name: string, backupId: string, request: Models.BackupRequest, slot: string, options?: msRest.RequestOptionsBase): Promise; + /** + * @param resourceGroupName Name of the resource group to which the resource belongs. + * @param name Name of web app. + * @param backupId ID of backup. + * @param request Information on backup request. + * @param slot Name of web app slot. If not specified then will default to production slot. + * @param callback The callback + */ + listBackupStatusSecretsSlot(resourceGroupName: string, name: string, backupId: string, request: Models.BackupRequest, slot: string, callback: msRest.ServiceCallback): void; + /** + * @param resourceGroupName Name of the resource group to which the resource belongs. + * @param name Name of web app. + * @param backupId ID of backup. + * @param request Information on backup request. + * @param slot Name of web app slot. If not specified then will default to production slot. + * @param options The optional parameters + * @param callback The callback + */ + listBackupStatusSecretsSlot(resourceGroupName: string, name: string, backupId: string, request: Models.BackupRequest, slot: string, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; + listBackupStatusSecretsSlot(resourceGroupName: string, name: string, backupId: string, request: Models.BackupRequest, slot: string, options?: msRest.RequestOptionsBase | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { + return this.client.sendOperationRequest( + { + resourceGroupName, + name, + backupId, + request, + slot, + options + }, + listBackupStatusSecretsSlotOperationSpec, + callback) as Promise; + } + + /** + * Restores a specific backup to another app (or deployment slot, if specified). + * @summary Restores a specific backup to another app (or deployment slot, if specified). + * @param resourceGroupName Name of the resource group to which the resource belongs. + * @param name Name of the app. + * @param backupId ID of the backup. + * @param request Information on restore request . + * @param slot Name of the deployment slot. If a slot is not specified, the API will restore a + * backup of the production slot. + * @param [options] The optional parameters + * @returns Promise + */ + restoreSlot(resourceGroupName: string, name: string, backupId: string, request: Models.RestoreRequest, slot: string, options?: msRest.RequestOptionsBase): Promise { + return this.beginRestoreSlot(resourceGroupName,name,backupId,request,slot,options) + .then(lroPoller => lroPoller.pollUntilFinished()); + } + + /** + * List the configurations of an app + * @summary List the configurations of an app + * @param resourceGroupName Name of the resource group to which the resource belongs. + * @param name Name of the app. + * @param slot Name of the deployment slot. If a slot is not specified, the API will return + * configuration for the production slot. + * @param [options] The optional parameters + * @returns Promise + */ + listConfigurationsSlot(resourceGroupName: string, name: string, slot: string, options?: msRest.RequestOptionsBase): Promise; + /** + * @param resourceGroupName Name of the resource group to which the resource belongs. + * @param name Name of the app. + * @param slot Name of the deployment slot. If a slot is not specified, the API will return + * configuration for the production slot. + * @param callback The callback + */ + listConfigurationsSlot(resourceGroupName: string, name: string, slot: string, callback: msRest.ServiceCallback): void; + /** + * @param resourceGroupName Name of the resource group to which the resource belongs. + * @param name Name of the app. + * @param slot Name of the deployment slot. If a slot is not specified, the API will return + * configuration for the production slot. + * @param options The optional parameters + * @param callback The callback + */ + listConfigurationsSlot(resourceGroupName: string, name: string, slot: string, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; + listConfigurationsSlot(resourceGroupName: string, name: string, slot: string, options?: msRest.RequestOptionsBase | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { + return this.client.sendOperationRequest( + { + resourceGroupName, + name, + slot, + options + }, + listConfigurationsSlotOperationSpec, + callback) as Promise; + } + + /** + * Replaces the application settings of an app. + * @summary Replaces the application settings of an app. + * @param resourceGroupName Name of the resource group to which the resource belongs. + * @param name Name of the app. + * @param appSettings Application settings of the app. + * @param slot Name of the deployment slot. If a slot is not specified, the API will update the + * application settings for the production slot. + * @param [options] The optional parameters + * @returns Promise + */ + updateApplicationSettingsSlot(resourceGroupName: string, name: string, appSettings: Models.StringDictionary, slot: string, options?: msRest.RequestOptionsBase): Promise; + /** + * @param resourceGroupName Name of the resource group to which the resource belongs. + * @param name Name of the app. + * @param appSettings Application settings of the app. + * @param slot Name of the deployment slot. If a slot is not specified, the API will update the + * application settings for the production slot. + * @param callback The callback + */ + updateApplicationSettingsSlot(resourceGroupName: string, name: string, appSettings: Models.StringDictionary, slot: string, callback: msRest.ServiceCallback): void; + /** + * @param resourceGroupName Name of the resource group to which the resource belongs. + * @param name Name of the app. + * @param appSettings Application settings of the app. + * @param slot Name of the deployment slot. If a slot is not specified, the API will update the + * application settings for the production slot. + * @param options The optional parameters + * @param callback The callback + */ + updateApplicationSettingsSlot(resourceGroupName: string, name: string, appSettings: Models.StringDictionary, slot: string, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; + updateApplicationSettingsSlot(resourceGroupName: string, name: string, appSettings: Models.StringDictionary, slot: string, options?: msRest.RequestOptionsBase | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { + return this.client.sendOperationRequest( + { + resourceGroupName, + name, + appSettings, + slot, + options + }, + updateApplicationSettingsSlotOperationSpec, + callback) as Promise; + } + + /** + * Gets the application settings of an app. + * @summary Gets the application settings of an app. + * @param resourceGroupName Name of the resource group to which the resource belongs. + * @param name Name of the app. + * @param slot Name of the deployment slot. If a slot is not specified, the API will get the + * application settings for the production slot. + * @param [options] The optional parameters + * @returns Promise + */ + listApplicationSettingsSlot(resourceGroupName: string, name: string, slot: string, options?: msRest.RequestOptionsBase): Promise; + /** + * @param resourceGroupName Name of the resource group to which the resource belongs. + * @param name Name of the app. + * @param slot Name of the deployment slot. If a slot is not specified, the API will get the + * application settings for the production slot. + * @param callback The callback + */ + listApplicationSettingsSlot(resourceGroupName: string, name: string, slot: string, callback: msRest.ServiceCallback): void; + /** + * @param resourceGroupName Name of the resource group to which the resource belongs. + * @param name Name of the app. + * @param slot Name of the deployment slot. If a slot is not specified, the API will get the + * application settings for the production slot. + * @param options The optional parameters + * @param callback The callback + */ + listApplicationSettingsSlot(resourceGroupName: string, name: string, slot: string, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; + listApplicationSettingsSlot(resourceGroupName: string, name: string, slot: string, options?: msRest.RequestOptionsBase | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { + return this.client.sendOperationRequest( + { + resourceGroupName, + name, + slot, + options + }, + listApplicationSettingsSlotOperationSpec, + callback) as Promise; + } + + /** + * Updates the Authentication / Authorization settings associated with web app. + * @summary Updates the Authentication / Authorization settings associated with web app. + * @param resourceGroupName Name of the resource group to which the resource belongs. + * @param name Name of web app. + * @param siteAuthSettings Auth settings associated with web app. + * @param slot Name of web app slot. If not specified then will default to production slot. + * @param [options] The optional parameters + * @returns Promise + */ + updateAuthSettingsSlot(resourceGroupName: string, name: string, siteAuthSettings: Models.SiteAuthSettings, slot: string, options?: msRest.RequestOptionsBase): Promise; + /** + * @param resourceGroupName Name of the resource group to which the resource belongs. + * @param name Name of web app. + * @param siteAuthSettings Auth settings associated with web app. + * @param slot Name of web app slot. If not specified then will default to production slot. + * @param callback The callback + */ + updateAuthSettingsSlot(resourceGroupName: string, name: string, siteAuthSettings: Models.SiteAuthSettings, slot: string, callback: msRest.ServiceCallback): void; + /** + * @param resourceGroupName Name of the resource group to which the resource belongs. + * @param name Name of web app. + * @param siteAuthSettings Auth settings associated with web app. + * @param slot Name of web app slot. If not specified then will default to production slot. + * @param options The optional parameters + * @param callback The callback + */ + updateAuthSettingsSlot(resourceGroupName: string, name: string, siteAuthSettings: Models.SiteAuthSettings, slot: string, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; + updateAuthSettingsSlot(resourceGroupName: string, name: string, siteAuthSettings: Models.SiteAuthSettings, slot: string, options?: msRest.RequestOptionsBase | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { + return this.client.sendOperationRequest( + { + resourceGroupName, + name, + siteAuthSettings, + slot, + options + }, + updateAuthSettingsSlotOperationSpec, + callback) as Promise; + } + + /** + * Gets the Authentication/Authorization settings of an app. + * @summary Gets the Authentication/Authorization settings of an app. + * @param resourceGroupName Name of the resource group to which the resource belongs. + * @param name Name of the app. + * @param slot Name of the deployment slot. If a slot is not specified, the API will get the + * settings for the production slot. + * @param [options] The optional parameters + * @returns Promise + */ + getAuthSettingsSlot(resourceGroupName: string, name: string, slot: string, options?: msRest.RequestOptionsBase): Promise; + /** + * @param resourceGroupName Name of the resource group to which the resource belongs. + * @param name Name of the app. + * @param slot Name of the deployment slot. If a slot is not specified, the API will get the + * settings for the production slot. + * @param callback The callback + */ + getAuthSettingsSlot(resourceGroupName: string, name: string, slot: string, callback: msRest.ServiceCallback): void; + /** + * @param resourceGroupName Name of the resource group to which the resource belongs. + * @param name Name of the app. + * @param slot Name of the deployment slot. If a slot is not specified, the API will get the + * settings for the production slot. + * @param options The optional parameters + * @param callback The callback + */ + getAuthSettingsSlot(resourceGroupName: string, name: string, slot: string, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; + getAuthSettingsSlot(resourceGroupName: string, name: string, slot: string, options?: msRest.RequestOptionsBase | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { + return this.client.sendOperationRequest( + { + resourceGroupName, + name, + slot, + options + }, + getAuthSettingsSlotOperationSpec, + callback) as Promise; + } + + /** + * Updates the Azure storage account configurations of an app. + * @summary Updates the Azure storage account configurations of an app. + * @param resourceGroupName Name of the resource group to which the resource belongs. + * @param name Name of the app. + * @param azureStorageAccounts Azure storage accounts of the app. + * @param slot Name of the deployment slot. If a slot is not specified, the API will update the + * Azure storage account configurations for the production slot. + * @param [options] The optional parameters + * @returns Promise + */ + updateAzureStorageAccountsSlot(resourceGroupName: string, name: string, azureStorageAccounts: Models.AzureStoragePropertyDictionaryResource, slot: string, options?: msRest.RequestOptionsBase): Promise; + /** + * @param resourceGroupName Name of the resource group to which the resource belongs. + * @param name Name of the app. + * @param azureStorageAccounts Azure storage accounts of the app. + * @param slot Name of the deployment slot. If a slot is not specified, the API will update the + * Azure storage account configurations for the production slot. + * @param callback The callback + */ + updateAzureStorageAccountsSlot(resourceGroupName: string, name: string, azureStorageAccounts: Models.AzureStoragePropertyDictionaryResource, slot: string, callback: msRest.ServiceCallback): void; + /** + * @param resourceGroupName Name of the resource group to which the resource belongs. + * @param name Name of the app. + * @param azureStorageAccounts Azure storage accounts of the app. + * @param slot Name of the deployment slot. If a slot is not specified, the API will update the + * Azure storage account configurations for the production slot. + * @param options The optional parameters + * @param callback The callback + */ + updateAzureStorageAccountsSlot(resourceGroupName: string, name: string, azureStorageAccounts: Models.AzureStoragePropertyDictionaryResource, slot: string, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; + updateAzureStorageAccountsSlot(resourceGroupName: string, name: string, azureStorageAccounts: Models.AzureStoragePropertyDictionaryResource, slot: string, options?: msRest.RequestOptionsBase | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { + return this.client.sendOperationRequest( + { + resourceGroupName, + name, + azureStorageAccounts, + slot, + options + }, + updateAzureStorageAccountsSlotOperationSpec, + callback) as Promise; + } + + /** + * Gets the Azure storage account configurations of an app. + * @summary Gets the Azure storage account configurations of an app. + * @param resourceGroupName Name of the resource group to which the resource belongs. + * @param name Name of the app. + * @param slot Name of the deployment slot. If a slot is not specified, the API will update the + * Azure storage account configurations for the production slot. + * @param [options] The optional parameters + * @returns Promise + */ + listAzureStorageAccountsSlot(resourceGroupName: string, name: string, slot: string, options?: msRest.RequestOptionsBase): Promise; + /** + * @param resourceGroupName Name of the resource group to which the resource belongs. + * @param name Name of the app. + * @param slot Name of the deployment slot. If a slot is not specified, the API will update the + * Azure storage account configurations for the production slot. + * @param callback The callback + */ + listAzureStorageAccountsSlot(resourceGroupName: string, name: string, slot: string, callback: msRest.ServiceCallback): void; + /** + * @param resourceGroupName Name of the resource group to which the resource belongs. + * @param name Name of the app. + * @param slot Name of the deployment slot. If a slot is not specified, the API will update the + * Azure storage account configurations for the production slot. + * @param options The optional parameters + * @param callback The callback + */ + listAzureStorageAccountsSlot(resourceGroupName: string, name: string, slot: string, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; + listAzureStorageAccountsSlot(resourceGroupName: string, name: string, slot: string, options?: msRest.RequestOptionsBase | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { + return this.client.sendOperationRequest( + { + resourceGroupName, + name, + slot, + options + }, + listAzureStorageAccountsSlotOperationSpec, + callback) as Promise; + } + + /** + * Updates the backup configuration of an app. + * @summary Updates the backup configuration of an app. + * @param resourceGroupName Name of the resource group to which the resource belongs. + * @param name Name of the app. + * @param request Edited backup configuration. + * @param slot Name of the deployment slot. If a slot is not specified, the API will update the + * backup configuration for the production slot. + * @param [options] The optional parameters + * @returns Promise + */ + updateBackupConfigurationSlot(resourceGroupName: string, name: string, request: Models.BackupRequest, slot: string, options?: msRest.RequestOptionsBase): Promise; + /** + * @param resourceGroupName Name of the resource group to which the resource belongs. + * @param name Name of the app. + * @param request Edited backup configuration. + * @param slot Name of the deployment slot. If a slot is not specified, the API will update the + * backup configuration for the production slot. + * @param callback The callback + */ + updateBackupConfigurationSlot(resourceGroupName: string, name: string, request: Models.BackupRequest, slot: string, callback: msRest.ServiceCallback): void; + /** + * @param resourceGroupName Name of the resource group to which the resource belongs. + * @param name Name of the app. + * @param request Edited backup configuration. + * @param slot Name of the deployment slot. If a slot is not specified, the API will update the + * backup configuration for the production slot. + * @param options The optional parameters + * @param callback The callback + */ + updateBackupConfigurationSlot(resourceGroupName: string, name: string, request: Models.BackupRequest, slot: string, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; + updateBackupConfigurationSlot(resourceGroupName: string, name: string, request: Models.BackupRequest, slot: string, options?: msRest.RequestOptionsBase | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { + return this.client.sendOperationRequest( + { + resourceGroupName, + name, + request, + slot, + options + }, + updateBackupConfigurationSlotOperationSpec, + callback) as Promise; + } + + /** + * Deletes the backup configuration of an app. + * @summary Deletes the backup configuration of an app. + * @param resourceGroupName Name of the resource group to which the resource belongs. + * @param name Name of the app. + * @param slot Name of the deployment slot. If a slot is not specified, the API will delete the + * backup configuration for the production slot. + * @param [options] The optional parameters + * @returns Promise + */ + deleteBackupConfigurationSlot(resourceGroupName: string, name: string, slot: string, options?: msRest.RequestOptionsBase): Promise; + /** + * @param resourceGroupName Name of the resource group to which the resource belongs. + * @param name Name of the app. + * @param slot Name of the deployment slot. If a slot is not specified, the API will delete the + * backup configuration for the production slot. + * @param callback The callback + */ + deleteBackupConfigurationSlot(resourceGroupName: string, name: string, slot: string, callback: msRest.ServiceCallback): void; + /** + * @param resourceGroupName Name of the resource group to which the resource belongs. + * @param name Name of the app. + * @param slot Name of the deployment slot. If a slot is not specified, the API will delete the + * backup configuration for the production slot. + * @param options The optional parameters + * @param callback The callback + */ + deleteBackupConfigurationSlot(resourceGroupName: string, name: string, slot: string, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; + deleteBackupConfigurationSlot(resourceGroupName: string, name: string, slot: string, options?: msRest.RequestOptionsBase | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { + return this.client.sendOperationRequest( + { + resourceGroupName, + name, + slot, + options + }, + deleteBackupConfigurationSlotOperationSpec, + callback); + } + + /** + * Gets the backup configuration of an app. + * @summary Gets the backup configuration of an app. + * @param resourceGroupName Name of the resource group to which the resource belongs. + * @param name Name of the app. + * @param slot Name of the deployment slot. If a slot is not specified, the API will get the backup + * configuration for the production slot. + * @param [options] The optional parameters + * @returns Promise + */ + getBackupConfigurationSlot(resourceGroupName: string, name: string, slot: string, options?: msRest.RequestOptionsBase): Promise; + /** + * @param resourceGroupName Name of the resource group to which the resource belongs. + * @param name Name of the app. + * @param slot Name of the deployment slot. If a slot is not specified, the API will get the backup + * configuration for the production slot. + * @param callback The callback + */ + getBackupConfigurationSlot(resourceGroupName: string, name: string, slot: string, callback: msRest.ServiceCallback): void; + /** + * @param resourceGroupName Name of the resource group to which the resource belongs. + * @param name Name of the app. + * @param slot Name of the deployment slot. If a slot is not specified, the API will get the backup + * configuration for the production slot. + * @param options The optional parameters + * @param callback The callback + */ + getBackupConfigurationSlot(resourceGroupName: string, name: string, slot: string, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; + getBackupConfigurationSlot(resourceGroupName: string, name: string, slot: string, options?: msRest.RequestOptionsBase | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { + return this.client.sendOperationRequest( + { + resourceGroupName, + name, + slot, + options + }, + getBackupConfigurationSlotOperationSpec, + callback) as Promise; + } + + /** + * Replaces the connection strings of an app. + * @summary Replaces the connection strings of an app. + * @param resourceGroupName Name of the resource group to which the resource belongs. + * @param name Name of the app. + * @param connectionStrings Connection strings of the app or deployment slot. See example. + * @param slot Name of the deployment slot. If a slot is not specified, the API will update the + * connection settings for the production slot. + * @param [options] The optional parameters + * @returns Promise + */ + updateConnectionStringsSlot(resourceGroupName: string, name: string, connectionStrings: Models.ConnectionStringDictionary, slot: string, options?: msRest.RequestOptionsBase): Promise; + /** + * @param resourceGroupName Name of the resource group to which the resource belongs. + * @param name Name of the app. + * @param connectionStrings Connection strings of the app or deployment slot. See example. + * @param slot Name of the deployment slot. If a slot is not specified, the API will update the + * connection settings for the production slot. + * @param callback The callback + */ + updateConnectionStringsSlot(resourceGroupName: string, name: string, connectionStrings: Models.ConnectionStringDictionary, slot: string, callback: msRest.ServiceCallback): void; + /** + * @param resourceGroupName Name of the resource group to which the resource belongs. + * @param name Name of the app. + * @param connectionStrings Connection strings of the app or deployment slot. See example. + * @param slot Name of the deployment slot. If a slot is not specified, the API will update the + * connection settings for the production slot. + * @param options The optional parameters + * @param callback The callback + */ + updateConnectionStringsSlot(resourceGroupName: string, name: string, connectionStrings: Models.ConnectionStringDictionary, slot: string, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; + updateConnectionStringsSlot(resourceGroupName: string, name: string, connectionStrings: Models.ConnectionStringDictionary, slot: string, options?: msRest.RequestOptionsBase | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { + return this.client.sendOperationRequest( + { + resourceGroupName, + name, + connectionStrings, + slot, + options + }, + updateConnectionStringsSlotOperationSpec, + callback) as Promise; + } + + /** + * Gets the connection strings of an app. + * @summary Gets the connection strings of an app. + * @param resourceGroupName Name of the resource group to which the resource belongs. + * @param name Name of the app. + * @param slot Name of the deployment slot. If a slot is not specified, the API will get the + * connection settings for the production slot. + * @param [options] The optional parameters + * @returns Promise + */ + listConnectionStringsSlot(resourceGroupName: string, name: string, slot: string, options?: msRest.RequestOptionsBase): Promise; + /** + * @param resourceGroupName Name of the resource group to which the resource belongs. + * @param name Name of the app. + * @param slot Name of the deployment slot. If a slot is not specified, the API will get the + * connection settings for the production slot. + * @param callback The callback + */ + listConnectionStringsSlot(resourceGroupName: string, name: string, slot: string, callback: msRest.ServiceCallback): void; + /** + * @param resourceGroupName Name of the resource group to which the resource belongs. + * @param name Name of the app. + * @param slot Name of the deployment slot. If a slot is not specified, the API will get the + * connection settings for the production slot. + * @param options The optional parameters + * @param callback The callback + */ + listConnectionStringsSlot(resourceGroupName: string, name: string, slot: string, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; + listConnectionStringsSlot(resourceGroupName: string, name: string, slot: string, options?: msRest.RequestOptionsBase | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { + return this.client.sendOperationRequest( + { + resourceGroupName, + name, + slot, + options + }, + listConnectionStringsSlotOperationSpec, + callback) as Promise; + } + + /** + * Gets the logging configuration of an app. + * @summary Gets the logging configuration of an app. + * @param resourceGroupName Name of the resource group to which the resource belongs. + * @param name Name of the app. + * @param slot Name of the deployment slot. If a slot is not specified, the API will get the + * logging configuration for the production slot. + * @param [options] The optional parameters + * @returns Promise + */ + getDiagnosticLogsConfigurationSlot(resourceGroupName: string, name: string, slot: string, options?: msRest.RequestOptionsBase): Promise; + /** + * @param resourceGroupName Name of the resource group to which the resource belongs. + * @param name Name of the app. + * @param slot Name of the deployment slot. If a slot is not specified, the API will get the + * logging configuration for the production slot. + * @param callback The callback + */ + getDiagnosticLogsConfigurationSlot(resourceGroupName: string, name: string, slot: string, callback: msRest.ServiceCallback): void; + /** + * @param resourceGroupName Name of the resource group to which the resource belongs. + * @param name Name of the app. + * @param slot Name of the deployment slot. If a slot is not specified, the API will get the + * logging configuration for the production slot. + * @param options The optional parameters + * @param callback The callback + */ + getDiagnosticLogsConfigurationSlot(resourceGroupName: string, name: string, slot: string, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; + getDiagnosticLogsConfigurationSlot(resourceGroupName: string, name: string, slot: string, options?: msRest.RequestOptionsBase | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { + return this.client.sendOperationRequest( + { + resourceGroupName, + name, + slot, + options + }, + getDiagnosticLogsConfigurationSlotOperationSpec, + callback) as Promise; + } + + /** + * Updates the logging configuration of an app. + * @summary Updates the logging configuration of an app. + * @param resourceGroupName Name of the resource group to which the resource belongs. + * @param name Name of the app. + * @param siteLogsConfig A SiteLogsConfig JSON object that contains the logging configuration to + * change in the "properties" property. + * @param slot Name of the deployment slot. If a slot is not specified, the API will update the + * logging configuration for the production slot. + * @param [options] The optional parameters + * @returns Promise + */ + updateDiagnosticLogsConfigSlot(resourceGroupName: string, name: string, siteLogsConfig: Models.SiteLogsConfig, slot: string, options?: msRest.RequestOptionsBase): Promise; + /** + * @param resourceGroupName Name of the resource group to which the resource belongs. + * @param name Name of the app. + * @param siteLogsConfig A SiteLogsConfig JSON object that contains the logging configuration to + * change in the "properties" property. + * @param slot Name of the deployment slot. If a slot is not specified, the API will update the + * logging configuration for the production slot. + * @param callback The callback + */ + updateDiagnosticLogsConfigSlot(resourceGroupName: string, name: string, siteLogsConfig: Models.SiteLogsConfig, slot: string, callback: msRest.ServiceCallback): void; + /** + * @param resourceGroupName Name of the resource group to which the resource belongs. + * @param name Name of the app. + * @param siteLogsConfig A SiteLogsConfig JSON object that contains the logging configuration to + * change in the "properties" property. + * @param slot Name of the deployment slot. If a slot is not specified, the API will update the + * logging configuration for the production slot. + * @param options The optional parameters + * @param callback The callback + */ + updateDiagnosticLogsConfigSlot(resourceGroupName: string, name: string, siteLogsConfig: Models.SiteLogsConfig, slot: string, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; + updateDiagnosticLogsConfigSlot(resourceGroupName: string, name: string, siteLogsConfig: Models.SiteLogsConfig, slot: string, options?: msRest.RequestOptionsBase | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { + return this.client.sendOperationRequest( + { + resourceGroupName, + name, + siteLogsConfig, + slot, + options + }, + updateDiagnosticLogsConfigSlotOperationSpec, + callback) as Promise; + } + + /** + * Replaces the metadata of an app. + * @summary Replaces the metadata of an app. + * @param resourceGroupName Name of the resource group to which the resource belongs. + * @param name Name of the app. + * @param metadata Edited metadata of the app or deployment slot. See example. + * @param slot Name of the deployment slot. If a slot is not specified, the API will update the + * metadata for the production slot. + * @param [options] The optional parameters + * @returns Promise + */ + updateMetadataSlot(resourceGroupName: string, name: string, metadata: Models.StringDictionary, slot: string, options?: msRest.RequestOptionsBase): Promise; + /** + * @param resourceGroupName Name of the resource group to which the resource belongs. + * @param name Name of the app. + * @param metadata Edited metadata of the app or deployment slot. See example. + * @param slot Name of the deployment slot. If a slot is not specified, the API will update the + * metadata for the production slot. + * @param callback The callback + */ + updateMetadataSlot(resourceGroupName: string, name: string, metadata: Models.StringDictionary, slot: string, callback: msRest.ServiceCallback): void; + /** + * @param resourceGroupName Name of the resource group to which the resource belongs. + * @param name Name of the app. + * @param metadata Edited metadata of the app or deployment slot. See example. + * @param slot Name of the deployment slot. If a slot is not specified, the API will update the + * metadata for the production slot. + * @param options The optional parameters + * @param callback The callback + */ + updateMetadataSlot(resourceGroupName: string, name: string, metadata: Models.StringDictionary, slot: string, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; + updateMetadataSlot(resourceGroupName: string, name: string, metadata: Models.StringDictionary, slot: string, options?: msRest.RequestOptionsBase | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { + return this.client.sendOperationRequest( + { + resourceGroupName, + name, + metadata, + slot, + options + }, + updateMetadataSlotOperationSpec, + callback) as Promise; + } + + /** + * Gets the metadata of an app. + * @summary Gets the metadata of an app. + * @param resourceGroupName Name of the resource group to which the resource belongs. + * @param name Name of the app. + * @param slot Name of the deployment slot. If a slot is not specified, the API will get the + * metadata for the production slot. + * @param [options] The optional parameters + * @returns Promise + */ + listMetadataSlot(resourceGroupName: string, name: string, slot: string, options?: msRest.RequestOptionsBase): Promise; + /** + * @param resourceGroupName Name of the resource group to which the resource belongs. + * @param name Name of the app. + * @param slot Name of the deployment slot. If a slot is not specified, the API will get the + * metadata for the production slot. + * @param callback The callback + */ + listMetadataSlot(resourceGroupName: string, name: string, slot: string, callback: msRest.ServiceCallback): void; + /** + * @param resourceGroupName Name of the resource group to which the resource belongs. + * @param name Name of the app. + * @param slot Name of the deployment slot. If a slot is not specified, the API will get the + * metadata for the production slot. + * @param options The optional parameters + * @param callback The callback + */ + listMetadataSlot(resourceGroupName: string, name: string, slot: string, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; + listMetadataSlot(resourceGroupName: string, name: string, slot: string, options?: msRest.RequestOptionsBase | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { + return this.client.sendOperationRequest( + { + resourceGroupName, + name, + slot, + options + }, + listMetadataSlotOperationSpec, + callback) as Promise; + } + + /** + * Gets the Git/FTP publishing credentials of an app. + * @summary Gets the Git/FTP publishing credentials of an app. + * @param resourceGroupName Name of the resource group to which the resource belongs. + * @param name Name of the app. + * @param slot Name of the deployment slot. If a slot is not specified, the API will get the + * publishing credentials for the production slot. + * @param [options] The optional parameters + * @returns Promise + */ + listPublishingCredentialsSlot(resourceGroupName: string, name: string, slot: string, options?: msRest.RequestOptionsBase): Promise { + return this.beginListPublishingCredentialsSlot(resourceGroupName,name,slot,options) + .then(lroPoller => lroPoller.pollUntilFinished()) as Promise; + } + + /** + * Updates the Push settings associated with web app. + * @summary Updates the Push settings associated with web app. + * @param resourceGroupName Name of the resource group to which the resource belongs. + * @param name Name of web app. + * @param pushSettings Push settings associated with web app. + * @param slot Name of web app slot. If not specified then will default to production slot. + * @param [options] The optional parameters + * @returns Promise + */ + updateSitePushSettingsSlot(resourceGroupName: string, name: string, pushSettings: Models.PushSettings, slot: string, options?: msRest.RequestOptionsBase): Promise; + /** + * @param resourceGroupName Name of the resource group to which the resource belongs. + * @param name Name of web app. + * @param pushSettings Push settings associated with web app. + * @param slot Name of web app slot. If not specified then will default to production slot. + * @param callback The callback + */ + updateSitePushSettingsSlot(resourceGroupName: string, name: string, pushSettings: Models.PushSettings, slot: string, callback: msRest.ServiceCallback): void; + /** + * @param resourceGroupName Name of the resource group to which the resource belongs. + * @param name Name of web app. + * @param pushSettings Push settings associated with web app. + * @param slot Name of web app slot. If not specified then will default to production slot. + * @param options The optional parameters + * @param callback The callback + */ + updateSitePushSettingsSlot(resourceGroupName: string, name: string, pushSettings: Models.PushSettings, slot: string, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; + updateSitePushSettingsSlot(resourceGroupName: string, name: string, pushSettings: Models.PushSettings, slot: string, options?: msRest.RequestOptionsBase | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { + return this.client.sendOperationRequest( + { + resourceGroupName, + name, + pushSettings, + slot, + options + }, + updateSitePushSettingsSlotOperationSpec, + callback) as Promise; + } + + /** + * Gets the Push settings associated with web app. + * @summary Gets the Push settings associated with web app. + * @param resourceGroupName Name of the resource group to which the resource belongs. + * @param name Name of web app. + * @param slot Name of web app slot. If not specified then will default to production slot. + * @param [options] The optional parameters + * @returns Promise + */ + listSitePushSettingsSlot(resourceGroupName: string, name: string, slot: string, options?: msRest.RequestOptionsBase): Promise; + /** + * @param resourceGroupName Name of the resource group to which the resource belongs. + * @param name Name of web app. + * @param slot Name of web app slot. If not specified then will default to production slot. + * @param callback The callback + */ + listSitePushSettingsSlot(resourceGroupName: string, name: string, slot: string, callback: msRest.ServiceCallback): void; + /** + * @param resourceGroupName Name of the resource group to which the resource belongs. + * @param name Name of web app. + * @param slot Name of web app slot. If not specified then will default to production slot. + * @param options The optional parameters + * @param callback The callback + */ + listSitePushSettingsSlot(resourceGroupName: string, name: string, slot: string, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; + listSitePushSettingsSlot(resourceGroupName: string, name: string, slot: string, options?: msRest.RequestOptionsBase | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { + return this.client.sendOperationRequest( + { + resourceGroupName, + name, + slot, + options + }, + listSitePushSettingsSlotOperationSpec, + callback) as Promise; + } + + /** + * Gets the configuration of an app, such as platform version and bitness, default documents, + * virtual applications, Always On, etc. + * @summary Gets the configuration of an app, such as platform version and bitness, default + * documents, virtual applications, Always On, etc. + * @param resourceGroupName Name of the resource group to which the resource belongs. + * @param name Name of the app. + * @param slot Name of the deployment slot. If a slot is not specified, the API will return + * configuration for the production slot. + * @param [options] The optional parameters + * @returns Promise + */ + getConfigurationSlot(resourceGroupName: string, name: string, slot: string, options?: msRest.RequestOptionsBase): Promise; + /** + * @param resourceGroupName Name of the resource group to which the resource belongs. + * @param name Name of the app. + * @param slot Name of the deployment slot. If a slot is not specified, the API will return + * configuration for the production slot. + * @param callback The callback + */ + getConfigurationSlot(resourceGroupName: string, name: string, slot: string, callback: msRest.ServiceCallback): void; + /** + * @param resourceGroupName Name of the resource group to which the resource belongs. + * @param name Name of the app. + * @param slot Name of the deployment slot. If a slot is not specified, the API will return + * configuration for the production slot. + * @param options The optional parameters + * @param callback The callback + */ + getConfigurationSlot(resourceGroupName: string, name: string, slot: string, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; + getConfigurationSlot(resourceGroupName: string, name: string, slot: string, options?: msRest.RequestOptionsBase | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { + return this.client.sendOperationRequest( + { + resourceGroupName, + name, + slot, + options + }, + getConfigurationSlotOperationSpec, + callback) as Promise; + } + + /** + * Updates the configuration of an app. + * @summary Updates the configuration of an app. + * @param resourceGroupName Name of the resource group to which the resource belongs. + * @param name Name of the app. + * @param siteConfig JSON representation of a SiteConfig object. See example. + * @param slot Name of the deployment slot. If a slot is not specified, the API will update + * configuration for the production slot. + * @param [options] The optional parameters + * @returns Promise + */ + createOrUpdateConfigurationSlot(resourceGroupName: string, name: string, siteConfig: Models.SiteConfigResource, slot: string, options?: msRest.RequestOptionsBase): Promise; + /** + * @param resourceGroupName Name of the resource group to which the resource belongs. + * @param name Name of the app. + * @param siteConfig JSON representation of a SiteConfig object. See example. + * @param slot Name of the deployment slot. If a slot is not specified, the API will update + * configuration for the production slot. + * @param callback The callback + */ + createOrUpdateConfigurationSlot(resourceGroupName: string, name: string, siteConfig: Models.SiteConfigResource, slot: string, callback: msRest.ServiceCallback): void; + /** + * @param resourceGroupName Name of the resource group to which the resource belongs. + * @param name Name of the app. + * @param siteConfig JSON representation of a SiteConfig object. See example. + * @param slot Name of the deployment slot. If a slot is not specified, the API will update + * configuration for the production slot. + * @param options The optional parameters + * @param callback The callback + */ + createOrUpdateConfigurationSlot(resourceGroupName: string, name: string, siteConfig: Models.SiteConfigResource, slot: string, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; + createOrUpdateConfigurationSlot(resourceGroupName: string, name: string, siteConfig: Models.SiteConfigResource, slot: string, options?: msRest.RequestOptionsBase | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { + return this.client.sendOperationRequest( + { + resourceGroupName, + name, + siteConfig, + slot, + options + }, + createOrUpdateConfigurationSlotOperationSpec, + callback) as Promise; + } + + /** + * Updates the configuration of an app. + * @summary Updates the configuration of an app. + * @param resourceGroupName Name of the resource group to which the resource belongs. + * @param name Name of the app. + * @param siteConfig JSON representation of a SiteConfig object. See example. + * @param slot Name of the deployment slot. If a slot is not specified, the API will update + * configuration for the production slot. + * @param [options] The optional parameters + * @returns Promise + */ + updateConfigurationSlot(resourceGroupName: string, name: string, siteConfig: Models.SiteConfigResource, slot: string, options?: msRest.RequestOptionsBase): Promise; + /** + * @param resourceGroupName Name of the resource group to which the resource belongs. + * @param name Name of the app. + * @param siteConfig JSON representation of a SiteConfig object. See example. + * @param slot Name of the deployment slot. If a slot is not specified, the API will update + * configuration for the production slot. + * @param callback The callback + */ + updateConfigurationSlot(resourceGroupName: string, name: string, siteConfig: Models.SiteConfigResource, slot: string, callback: msRest.ServiceCallback): void; + /** + * @param resourceGroupName Name of the resource group to which the resource belongs. + * @param name Name of the app. + * @param siteConfig JSON representation of a SiteConfig object. See example. + * @param slot Name of the deployment slot. If a slot is not specified, the API will update + * configuration for the production slot. + * @param options The optional parameters + * @param callback The callback + */ + updateConfigurationSlot(resourceGroupName: string, name: string, siteConfig: Models.SiteConfigResource, slot: string, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; + updateConfigurationSlot(resourceGroupName: string, name: string, siteConfig: Models.SiteConfigResource, slot: string, options?: msRest.RequestOptionsBase | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { + return this.client.sendOperationRequest( + { + resourceGroupName, + name, + siteConfig, + slot, + options + }, + updateConfigurationSlotOperationSpec, + callback) as Promise; + } + + /** + * 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 list of web app configuration snapshots identifiers. Each element of the list + * contains a timestamp and the ID of the snapshot. + * @param resourceGroupName Name of the resource group to which the resource belongs. + * @param name Name of the app. + * @param slot Name of the deployment slot. If a slot is not specified, the API will return + * configuration for the production slot. + * @param [options] The optional parameters + * @returns Promise + */ + listConfigurationSnapshotInfoSlot(resourceGroupName: string, name: string, slot: string, options?: msRest.RequestOptionsBase): Promise; + /** + * @param resourceGroupName Name of the resource group to which the resource belongs. + * @param name Name of the app. + * @param slot Name of the deployment slot. If a slot is not specified, the API will return + * configuration for the production slot. + * @param callback The callback + */ + listConfigurationSnapshotInfoSlot(resourceGroupName: string, name: string, slot: string, callback: msRest.ServiceCallback): void; + /** + * @param resourceGroupName Name of the resource group to which the resource belongs. + * @param name Name of the app. + * @param slot Name of the deployment slot. If a slot is not specified, the API will return + * configuration for the production slot. + * @param options The optional parameters + * @param callback The callback + */ + listConfigurationSnapshotInfoSlot(resourceGroupName: string, name: string, slot: string, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; + listConfigurationSnapshotInfoSlot(resourceGroupName: string, name: string, slot: string, options?: msRest.RequestOptionsBase | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { + return this.client.sendOperationRequest( + { + resourceGroupName, + name, + slot, + options + }, + listConfigurationSnapshotInfoSlotOperationSpec, + callback) as Promise; + } + + /** + * Gets a snapshot of the configuration of an app at a previous point in time. + * @summary Gets a snapshot of the configuration of an app at a previous point in time. + * @param resourceGroupName Name of the resource group to which the resource belongs. + * @param name Name of the app. + * @param snapshotId The ID of the snapshot to read. + * @param slot Name of the deployment slot. If a slot is not specified, the API will return + * configuration for the production slot. + * @param [options] The optional parameters + * @returns Promise + */ + getConfigurationSnapshotSlot(resourceGroupName: string, name: string, snapshotId: string, slot: string, options?: msRest.RequestOptionsBase): Promise; + /** + * @param resourceGroupName Name of the resource group to which the resource belongs. + * @param name Name of the app. + * @param snapshotId The ID of the snapshot to read. + * @param slot Name of the deployment slot. If a slot is not specified, the API will return + * configuration for the production slot. + * @param callback The callback + */ + getConfigurationSnapshotSlot(resourceGroupName: string, name: string, snapshotId: string, slot: string, callback: msRest.ServiceCallback): void; + /** + * @param resourceGroupName Name of the resource group to which the resource belongs. + * @param name Name of the app. + * @param snapshotId The ID of the snapshot to read. + * @param slot Name of the deployment slot. If a slot is not specified, the API will return + * configuration for the production slot. + * @param options The optional parameters + * @param callback The callback + */ + getConfigurationSnapshotSlot(resourceGroupName: string, name: string, snapshotId: string, slot: string, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; + getConfigurationSnapshotSlot(resourceGroupName: string, name: string, snapshotId: string, slot: string, options?: msRest.RequestOptionsBase | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { + return this.client.sendOperationRequest( + { + resourceGroupName, + name, + snapshotId, + slot, + options + }, + getConfigurationSnapshotSlotOperationSpec, + callback) as Promise; + } + + /** + * Reverts the configuration of an app to a previous snapshot. + * @summary Reverts the configuration of an app to a previous snapshot. + * @param resourceGroupName Name of the resource group to which the resource belongs. + * @param name Name of the app. + * @param snapshotId The ID of the snapshot to read. + * @param slot Name of the deployment slot. If a slot is not specified, the API will return + * configuration for the production slot. + * @param [options] The optional parameters + * @returns Promise + */ + recoverSiteConfigurationSnapshotSlot(resourceGroupName: string, name: string, snapshotId: string, slot: string, options?: msRest.RequestOptionsBase): Promise; + /** + * @param resourceGroupName Name of the resource group to which the resource belongs. + * @param name Name of the app. + * @param snapshotId The ID of the snapshot to read. + * @param slot Name of the deployment slot. If a slot is not specified, the API will return + * configuration for the production slot. + * @param callback The callback + */ + recoverSiteConfigurationSnapshotSlot(resourceGroupName: string, name: string, snapshotId: string, slot: string, callback: msRest.ServiceCallback): void; + /** + * @param resourceGroupName Name of the resource group to which the resource belongs. + * @param name Name of the app. + * @param snapshotId The ID of the snapshot to read. + * @param slot Name of the deployment slot. If a slot is not specified, the API will return + * configuration for the production slot. + * @param options The optional parameters + * @param callback The callback + */ + recoverSiteConfigurationSnapshotSlot(resourceGroupName: string, name: string, snapshotId: string, slot: string, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; + recoverSiteConfigurationSnapshotSlot(resourceGroupName: string, name: string, snapshotId: string, slot: string, options?: msRest.RequestOptionsBase | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { + return this.client.sendOperationRequest( + { + resourceGroupName, + name, + snapshotId, + slot, + options + }, + recoverSiteConfigurationSnapshotSlotOperationSpec, + callback); + } + + /** + * Gets the last lines of docker logs for the given site + * @summary Gets the last lines of docker logs for the given site + * @param resourceGroupName Name of the resource group to which the resource belongs. + * @param name Name of web app. + * @param slot Name of web app slot. If not specified then will default to production slot. + * @param [options] The optional parameters + * @returns Promise + */ + getWebSiteContainerLogsSlot(resourceGroupName: string, name: string, slot: string, options?: msRest.RequestOptionsBase): Promise; + /** + * @param resourceGroupName Name of the resource group to which the resource belongs. + * @param name Name of web app. + * @param slot Name of web app slot. If not specified then will default to production slot. + * @param callback The callback + */ + getWebSiteContainerLogsSlot(resourceGroupName: string, name: string, slot: string, callback: msRest.ServiceCallback): void; + /** + * @param resourceGroupName Name of the resource group to which the resource belongs. + * @param name Name of web app. + * @param slot Name of web app slot. If not specified then will default to production slot. + * @param options The optional parameters + * @param callback The callback + */ + getWebSiteContainerLogsSlot(resourceGroupName: string, name: string, slot: string, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; + getWebSiteContainerLogsSlot(resourceGroupName: string, name: string, slot: string, options?: msRest.RequestOptionsBase | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { + return this.client.sendOperationRequest( + { + resourceGroupName, + name, + slot, + options + }, + getWebSiteContainerLogsSlotOperationSpec, + callback) as Promise; + } + + /** + * Gets the ZIP archived docker log files for the given site + * @summary Gets the ZIP archived docker log files for the given site + * @param resourceGroupName Name of the resource group to which the resource belongs. + * @param name Name of web app. + * @param slot Name of web app slot. If not specified then will default to production slot. + * @param [options] The optional parameters + * @returns Promise + */ + getContainerLogsZipSlot(resourceGroupName: string, name: string, slot: string, options?: msRest.RequestOptionsBase): Promise; + /** + * @param resourceGroupName Name of the resource group to which the resource belongs. + * @param name Name of web app. + * @param slot Name of web app slot. If not specified then will default to production slot. + * @param callback The callback + */ + getContainerLogsZipSlot(resourceGroupName: string, name: string, slot: string, callback: msRest.ServiceCallback): void; + /** + * @param resourceGroupName Name of the resource group to which the resource belongs. + * @param name Name of web app. + * @param slot Name of web app slot. If not specified then will default to production slot. + * @param options The optional parameters + * @param callback The callback + */ + getContainerLogsZipSlot(resourceGroupName: string, name: string, slot: string, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; + getContainerLogsZipSlot(resourceGroupName: string, name: string, slot: string, options?: msRest.RequestOptionsBase | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { + return this.client.sendOperationRequest( + { + resourceGroupName, + name, + slot, + options + }, + getContainerLogsZipSlotOperationSpec, + callback) as Promise; + } + + /** + * List continuous web jobs for an app, or a deployment slot. + * @summary List continuous web jobs for an app, or a deployment slot. + * @param resourceGroupName Name of the resource group to which the resource belongs. + * @param name Site name. + * @param slot Name of the deployment slot. If a slot is not specified, the API deletes a + * deployment for the production slot. + * @param [options] The optional parameters + * @returns Promise + */ + listContinuousWebJobsSlot(resourceGroupName: string, name: string, slot: string, options?: msRest.RequestOptionsBase): Promise; + /** + * @param resourceGroupName Name of the resource group to which the resource belongs. + * @param name Site name. + * @param slot Name of the deployment slot. If a slot is not specified, the API deletes a + * deployment for the production slot. + * @param callback The callback + */ + listContinuousWebJobsSlot(resourceGroupName: string, name: string, slot: string, callback: msRest.ServiceCallback): void; + /** + * @param resourceGroupName Name of the resource group to which the resource belongs. + * @param name Site name. + * @param slot Name of the deployment slot. If a slot is not specified, the API deletes a + * deployment for the production slot. + * @param options The optional parameters + * @param callback The callback + */ + listContinuousWebJobsSlot(resourceGroupName: string, name: string, slot: string, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; + listContinuousWebJobsSlot(resourceGroupName: string, name: string, slot: string, options?: msRest.RequestOptionsBase | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { + return this.client.sendOperationRequest( + { + resourceGroupName, + name, + slot, + options + }, + listContinuousWebJobsSlotOperationSpec, + callback) as Promise; + } + + /** + * Gets a continuous web job by its ID for an app, or a deployment slot. + * @summary Gets a continuous web job by its ID for an app, or a deployment slot. + * @param resourceGroupName Name of the resource group to which the resource belongs. + * @param name Site name. + * @param webJobName Name of Web Job. + * @param slot Name of the deployment slot. If a slot is not specified, the API deletes a + * deployment for the production slot. + * @param [options] The optional parameters + * @returns Promise + */ + getContinuousWebJobSlot(resourceGroupName: string, name: string, webJobName: string, slot: string, options?: msRest.RequestOptionsBase): Promise; + /** + * @param resourceGroupName Name of the resource group to which the resource belongs. + * @param name Site name. + * @param webJobName Name of Web Job. + * @param slot Name of the deployment slot. If a slot is not specified, the API deletes a + * deployment for the production slot. + * @param callback The callback + */ + getContinuousWebJobSlot(resourceGroupName: string, name: string, webJobName: string, slot: string, callback: msRest.ServiceCallback): void; + /** + * @param resourceGroupName Name of the resource group to which the resource belongs. + * @param name Site name. + * @param webJobName Name of Web Job. + * @param slot Name of the deployment slot. If a slot is not specified, the API deletes a + * deployment for the production slot. + * @param options The optional parameters + * @param callback The callback + */ + getContinuousWebJobSlot(resourceGroupName: string, name: string, webJobName: string, slot: string, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; + getContinuousWebJobSlot(resourceGroupName: string, name: string, webJobName: string, slot: string, options?: msRest.RequestOptionsBase | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { + return this.client.sendOperationRequest( + { + resourceGroupName, + name, + webJobName, + slot, + options + }, + getContinuousWebJobSlotOperationSpec, + callback) as Promise; + } + + /** + * Delete a continuous web job 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. + * @param resourceGroupName Name of the resource group to which the resource belongs. + * @param name Site name. + * @param webJobName Name of Web Job. + * @param slot Name of the deployment slot. If a slot is not specified, the API deletes a + * deployment for the production slot. + * @param [options] The optional parameters + * @returns Promise + */ + deleteContinuousWebJobSlot(resourceGroupName: string, name: string, webJobName: string, slot: string, options?: msRest.RequestOptionsBase): Promise; + /** + * @param resourceGroupName Name of the resource group to which the resource belongs. + * @param name Site name. + * @param webJobName Name of Web Job. + * @param slot Name of the deployment slot. If a slot is not specified, the API deletes a + * deployment for the production slot. + * @param callback The callback + */ + deleteContinuousWebJobSlot(resourceGroupName: string, name: string, webJobName: string, slot: string, callback: msRest.ServiceCallback): void; + /** + * @param resourceGroupName Name of the resource group to which the resource belongs. + * @param name Site name. + * @param webJobName Name of Web Job. + * @param slot Name of the deployment slot. If a slot is not specified, the API deletes a + * deployment for the production slot. + * @param options The optional parameters + * @param callback The callback + */ + deleteContinuousWebJobSlot(resourceGroupName: string, name: string, webJobName: string, slot: string, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; + deleteContinuousWebJobSlot(resourceGroupName: string, name: string, webJobName: string, slot: string, options?: msRest.RequestOptionsBase | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { + return this.client.sendOperationRequest( + { + resourceGroupName, + name, + webJobName, + slot, + options + }, + deleteContinuousWebJobSlotOperationSpec, + callback); + } + + /** + * Start a continuous web job for an app, or a deployment slot. + * @summary Start a continuous web job for an app, or a deployment slot. + * @param resourceGroupName Name of the resource group to which the resource belongs. + * @param name Site name. + * @param webJobName Name of Web Job. + * @param slot Name of the deployment slot. If a slot is not specified, the API deletes a + * deployment for the production slot. + * @param [options] The optional parameters + * @returns Promise + */ + startContinuousWebJobSlot(resourceGroupName: string, name: string, webJobName: string, slot: string, options?: msRest.RequestOptionsBase): Promise; + /** + * @param resourceGroupName Name of the resource group to which the resource belongs. + * @param name Site name. + * @param webJobName Name of Web Job. + * @param slot Name of the deployment slot. If a slot is not specified, the API deletes a + * deployment for the production slot. + * @param callback The callback + */ + startContinuousWebJobSlot(resourceGroupName: string, name: string, webJobName: string, slot: string, callback: msRest.ServiceCallback): void; + /** + * @param resourceGroupName Name of the resource group to which the resource belongs. + * @param name Site name. + * @param webJobName Name of Web Job. + * @param slot Name of the deployment slot. If a slot is not specified, the API deletes a + * deployment for the production slot. + * @param options The optional parameters + * @param callback The callback + */ + startContinuousWebJobSlot(resourceGroupName: string, name: string, webJobName: string, slot: string, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; + startContinuousWebJobSlot(resourceGroupName: string, name: string, webJobName: string, slot: string, options?: msRest.RequestOptionsBase | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { + return this.client.sendOperationRequest( + { + resourceGroupName, + name, + webJobName, + slot, + options + }, + startContinuousWebJobSlotOperationSpec, + callback); + } + + /** + * Stop a continuous web job for an app, or a deployment slot. + * @summary Stop a continuous web job for an app, or a deployment slot. + * @param resourceGroupName Name of the resource group to which the resource belongs. + * @param name Site name. + * @param webJobName Name of Web Job. + * @param slot Name of the deployment slot. If a slot is not specified, the API deletes a + * deployment for the production slot. + * @param [options] The optional parameters + * @returns Promise + */ + stopContinuousWebJobSlot(resourceGroupName: string, name: string, webJobName: string, slot: string, options?: msRest.RequestOptionsBase): Promise; + /** + * @param resourceGroupName Name of the resource group to which the resource belongs. + * @param name Site name. + * @param webJobName Name of Web Job. + * @param slot Name of the deployment slot. If a slot is not specified, the API deletes a + * deployment for the production slot. + * @param callback The callback + */ + stopContinuousWebJobSlot(resourceGroupName: string, name: string, webJobName: string, slot: string, callback: msRest.ServiceCallback): void; + /** + * @param resourceGroupName Name of the resource group to which the resource belongs. + * @param name Site name. + * @param webJobName Name of Web Job. + * @param slot Name of the deployment slot. If a slot is not specified, the API deletes a + * deployment for the production slot. + * @param options The optional parameters + * @param callback The callback + */ + stopContinuousWebJobSlot(resourceGroupName: string, name: string, webJobName: string, slot: string, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; + stopContinuousWebJobSlot(resourceGroupName: string, name: string, webJobName: string, slot: string, options?: msRest.RequestOptionsBase | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { + return this.client.sendOperationRequest( + { + resourceGroupName, + name, + webJobName, + slot, + options + }, + stopContinuousWebJobSlotOperationSpec, + callback); + } + + /** + * List deployments for an app, or a deployment slot. + * @summary List deployments for an app, or a deployment slot. + * @param resourceGroupName Name of the resource group to which the resource belongs. + * @param name Name of the app. + * @param slot Name of the deployment slot. If a slot is not specified, the API returns deployments + * for the production slot. + * @param [options] The optional parameters + * @returns Promise + */ + listDeploymentsSlot(resourceGroupName: string, name: string, slot: string, options?: msRest.RequestOptionsBase): Promise; + /** + * @param resourceGroupName Name of the resource group to which the resource belongs. + * @param name Name of the app. + * @param slot Name of the deployment slot. If a slot is not specified, the API returns deployments + * for the production slot. + * @param callback The callback + */ + listDeploymentsSlot(resourceGroupName: string, name: string, slot: string, callback: msRest.ServiceCallback): void; + /** + * @param resourceGroupName Name of the resource group to which the resource belongs. + * @param name Name of the app. + * @param slot Name of the deployment slot. If a slot is not specified, the API returns deployments + * for the production slot. + * @param options The optional parameters + * @param callback The callback + */ + listDeploymentsSlot(resourceGroupName: string, name: string, slot: string, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; + listDeploymentsSlot(resourceGroupName: string, name: string, slot: string, options?: msRest.RequestOptionsBase | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { + return this.client.sendOperationRequest( + { + resourceGroupName, + name, + slot, + options + }, + listDeploymentsSlotOperationSpec, + callback) as Promise; + } + + /** + * Get a deployment by its ID for an app, or a deployment slot. + * @summary Get a deployment by its ID for an app, or a deployment slot. + * @param resourceGroupName Name of the resource group to which the resource belongs. + * @param name Name of the app. + * @param id Deployment ID. + * @param slot Name of the deployment slot. If a slot is not specified, the API gets a deployment + * for the production slot. + * @param [options] The optional parameters + * @returns Promise + */ + getDeploymentSlot(resourceGroupName: string, name: string, id: string, slot: string, options?: msRest.RequestOptionsBase): Promise; + /** + * @param resourceGroupName Name of the resource group to which the resource belongs. + * @param name Name of the app. + * @param id Deployment ID. + * @param slot Name of the deployment slot. If a slot is not specified, the API gets a deployment + * for the production slot. + * @param callback The callback + */ + getDeploymentSlot(resourceGroupName: string, name: string, id: string, slot: string, callback: msRest.ServiceCallback): void; + /** + * @param resourceGroupName Name of the resource group to which the resource belongs. + * @param name Name of the app. + * @param id Deployment ID. + * @param slot Name of the deployment slot. If a slot is not specified, the API gets a deployment + * for the production slot. + * @param options The optional parameters + * @param callback The callback + */ + getDeploymentSlot(resourceGroupName: string, name: string, id: string, slot: string, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; + getDeploymentSlot(resourceGroupName: string, name: string, id: string, slot: string, options?: msRest.RequestOptionsBase | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { + return this.client.sendOperationRequest( + { + resourceGroupName, + name, + id, + slot, + options + }, + getDeploymentSlotOperationSpec, + callback) as Promise; + } + + /** + * Create a deployment for an app, or a deployment slot. + * @summary Create a deployment for an app, or a deployment slot. + * @param resourceGroupName Name of the resource group to which the resource belongs. + * @param name Name of the app. + * @param id ID of an existing deployment. + * @param slot Name of the deployment slot. If a slot is not specified, the API creates a + * deployment for the production slot. + * @param deployment Deployment details. + * @param [options] The optional parameters + * @returns Promise + */ + createDeploymentSlot(resourceGroupName: string, name: string, id: string, slot: string, deployment: Models.Deployment, options?: msRest.RequestOptionsBase): Promise; + /** + * @param resourceGroupName Name of the resource group to which the resource belongs. + * @param name Name of the app. + * @param id ID of an existing deployment. + * @param slot Name of the deployment slot. If a slot is not specified, the API creates a + * deployment for the production slot. + * @param deployment Deployment details. + * @param callback The callback + */ + createDeploymentSlot(resourceGroupName: string, name: string, id: string, slot: string, deployment: Models.Deployment, callback: msRest.ServiceCallback): void; + /** + * @param resourceGroupName Name of the resource group to which the resource belongs. + * @param name Name of the app. + * @param id ID of an existing deployment. + * @param slot Name of the deployment slot. If a slot is not specified, the API creates a + * deployment for the production slot. + * @param deployment Deployment details. + * @param options The optional parameters + * @param callback The callback + */ + createDeploymentSlot(resourceGroupName: string, name: string, id: string, slot: string, deployment: Models.Deployment, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; + createDeploymentSlot(resourceGroupName: string, name: string, id: string, slot: string, deployment: Models.Deployment, options?: msRest.RequestOptionsBase | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { + return this.client.sendOperationRequest( + { + resourceGroupName, + name, + id, + slot, + deployment, + options + }, + createDeploymentSlotOperationSpec, + callback) as Promise; + } + + /** + * Delete a deployment by its ID for an app, or a deployment slot. + * @summary Delete a deployment by its ID for an app, or a deployment slot. + * @param resourceGroupName Name of the resource group to which the resource belongs. + * @param name Name of the app. + * @param id Deployment ID. + * @param slot Name of the deployment slot. If a slot is not specified, the API deletes a + * deployment for the production slot. + * @param [options] The optional parameters + * @returns Promise + */ + deleteDeploymentSlot(resourceGroupName: string, name: string, id: string, slot: string, options?: msRest.RequestOptionsBase): Promise; + /** + * @param resourceGroupName Name of the resource group to which the resource belongs. + * @param name Name of the app. + * @param id Deployment ID. + * @param slot Name of the deployment slot. If a slot is not specified, the API deletes a + * deployment for the production slot. + * @param callback The callback + */ + deleteDeploymentSlot(resourceGroupName: string, name: string, id: string, slot: string, callback: msRest.ServiceCallback): void; + /** + * @param resourceGroupName Name of the resource group to which the resource belongs. + * @param name Name of the app. + * @param id Deployment ID. + * @param slot Name of the deployment slot. If a slot is not specified, the API deletes a + * deployment for the production slot. + * @param options The optional parameters + * @param callback The callback + */ + deleteDeploymentSlot(resourceGroupName: string, name: string, id: string, slot: string, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; + deleteDeploymentSlot(resourceGroupName: string, name: string, id: string, slot: string, options?: msRest.RequestOptionsBase | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { + return this.client.sendOperationRequest( + { + resourceGroupName, + name, + id, + slot, + options + }, + deleteDeploymentSlotOperationSpec, + callback); + } + + /** + * List deployment log for specific deployment for an app, or a deployment slot. + * @summary List deployment log for specific deployment for an app, or a deployment slot. + * @param resourceGroupName Name of the resource group to which the resource belongs. + * @param name Name of the app. + * @param 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 slot Name of the deployment slot. If a slot is not specified, the API returns deployments + * for the production slot. + * @param [options] The optional parameters + * @returns Promise + */ + listDeploymentLogSlot(resourceGroupName: string, name: string, id: string, slot: string, options?: msRest.RequestOptionsBase): Promise; + /** + * @param resourceGroupName Name of the resource group to which the resource belongs. + * @param name Name of the app. + * @param 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 slot Name of the deployment slot. If a slot is not specified, the API returns deployments + * for the production slot. + * @param callback The callback + */ + listDeploymentLogSlot(resourceGroupName: string, name: string, id: string, slot: string, callback: msRest.ServiceCallback): void; + /** + * @param resourceGroupName Name of the resource group to which the resource belongs. + * @param name Name of the app. + * @param 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 slot Name of the deployment slot. If a slot is not specified, the API returns deployments + * for the production slot. + * @param options The optional parameters + * @param callback The callback + */ + listDeploymentLogSlot(resourceGroupName: string, name: string, id: string, slot: string, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; + listDeploymentLogSlot(resourceGroupName: string, name: string, id: string, slot: string, options?: msRest.RequestOptionsBase | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { + return this.client.sendOperationRequest( + { + resourceGroupName, + name, + id, + slot, + options + }, + listDeploymentLogSlotOperationSpec, + callback) as Promise; + } + + /** + * 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. + * @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. + * @param resourceGroupName Name of the resource group to which the resource belongs. + * @param name Name of the app. + * @param request A RestoreRequest object that includes Azure storage URL and blog name for + * discovery of backup. + * @param slot Name of the deployment slot. If a slot is not specified, the API will perform + * discovery for the production slot. + * @param [options] The optional parameters + * @returns Promise + */ + discoverBackupSlot(resourceGroupName: string, name: string, request: Models.RestoreRequest, slot: string, options?: msRest.RequestOptionsBase): Promise; + /** + * @param resourceGroupName Name of the resource group to which the resource belongs. + * @param name Name of the app. + * @param request A RestoreRequest object that includes Azure storage URL and blog name for + * discovery of backup. + * @param slot Name of the deployment slot. If a slot is not specified, the API will perform + * discovery for the production slot. + * @param callback The callback + */ + discoverBackupSlot(resourceGroupName: string, name: string, request: Models.RestoreRequest, slot: string, callback: msRest.ServiceCallback): void; + /** + * @param resourceGroupName Name of the resource group to which the resource belongs. + * @param name Name of the app. + * @param request A RestoreRequest object that includes Azure storage URL and blog name for + * discovery of backup. + * @param slot Name of the deployment slot. If a slot is not specified, the API will perform + * discovery for the production slot. + * @param options The optional parameters + * @param callback The callback + */ + discoverBackupSlot(resourceGroupName: string, name: string, request: Models.RestoreRequest, slot: string, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; + discoverBackupSlot(resourceGroupName: string, name: string, request: Models.RestoreRequest, slot: string, options?: msRest.RequestOptionsBase | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { + return this.client.sendOperationRequest( + { + resourceGroupName, + name, + request, + slot, + options + }, + discoverBackupSlotOperationSpec, + callback) as Promise; + } + + /** + * Lists ownership identifiers for domain associated with web app. + * @summary Lists ownership identifiers for domain associated with web app. + * @param resourceGroupName Name of the resource group to which the resource belongs. + * @param name Name of the app. + * @param slot Name of the deployment slot. If a slot is not specified, the API will delete the + * binding for the production slot. + * @param [options] The optional parameters + * @returns Promise + */ + listDomainOwnershipIdentifiersSlot(resourceGroupName: string, name: string, slot: string, options?: msRest.RequestOptionsBase): Promise; + /** + * @param resourceGroupName Name of the resource group to which the resource belongs. + * @param name Name of the app. + * @param slot Name of the deployment slot. If a slot is not specified, the API will delete the + * binding for the production slot. + * @param callback The callback + */ + listDomainOwnershipIdentifiersSlot(resourceGroupName: string, name: string, slot: string, callback: msRest.ServiceCallback): void; + /** + * @param resourceGroupName Name of the resource group to which the resource belongs. + * @param name Name of the app. + * @param slot Name of the deployment slot. If a slot is not specified, the API will delete the + * binding for the production slot. + * @param options The optional parameters + * @param callback The callback + */ + listDomainOwnershipIdentifiersSlot(resourceGroupName: string, name: string, slot: string, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; + listDomainOwnershipIdentifiersSlot(resourceGroupName: string, name: string, slot: string, options?: msRest.RequestOptionsBase | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { + return this.client.sendOperationRequest( + { + resourceGroupName, + name, + slot, + options + }, + listDomainOwnershipIdentifiersSlotOperationSpec, + callback) as Promise; + } + + /** + * Get domain ownership identifier for web app. + * @summary Get domain ownership identifier for web app. + * @param resourceGroupName Name of the resource group to which the resource belongs. + * @param name Name of the app. + * @param domainOwnershipIdentifierName Name of domain ownership identifier. + * @param slot Name of the deployment slot. If a slot is not specified, the API will delete the + * binding for the production slot. + * @param [options] The optional parameters + * @returns Promise + */ + getDomainOwnershipIdentifierSlot(resourceGroupName: string, name: string, domainOwnershipIdentifierName: string, slot: string, options?: msRest.RequestOptionsBase): Promise; + /** + * @param resourceGroupName Name of the resource group to which the resource belongs. + * @param name Name of the app. + * @param domainOwnershipIdentifierName Name of domain ownership identifier. + * @param slot Name of the deployment slot. If a slot is not specified, the API will delete the + * binding for the production slot. + * @param callback The callback + */ + getDomainOwnershipIdentifierSlot(resourceGroupName: string, name: string, domainOwnershipIdentifierName: string, slot: string, callback: msRest.ServiceCallback): void; + /** + * @param resourceGroupName Name of the resource group to which the resource belongs. + * @param name Name of the app. + * @param domainOwnershipIdentifierName Name of domain ownership identifier. + * @param slot Name of the deployment slot. If a slot is not specified, the API will delete the + * binding for the production slot. + * @param options The optional parameters + * @param callback The callback + */ + getDomainOwnershipIdentifierSlot(resourceGroupName: string, name: string, domainOwnershipIdentifierName: string, slot: string, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; + getDomainOwnershipIdentifierSlot(resourceGroupName: string, name: string, domainOwnershipIdentifierName: string, slot: string, options?: msRest.RequestOptionsBase | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { + return this.client.sendOperationRequest( + { + resourceGroupName, + name, + domainOwnershipIdentifierName, + slot, + options + }, + getDomainOwnershipIdentifierSlotOperationSpec, + callback) as Promise; + } + + /** + * Creates a domain ownership identifier for web app, or updates an existing ownership identifier. + * @summary Creates a domain ownership identifier for web app, or updates an existing ownership + * identifier. + * @param resourceGroupName Name of the resource group to which the resource belongs. + * @param name Name of the app. + * @param domainOwnershipIdentifierName Name of domain ownership identifier. + * @param domainOwnershipIdentifier A JSON representation of the domain ownership properties. + * @param slot Name of the deployment slot. If a slot is not specified, the API will delete the + * binding for the production slot. + * @param [options] The optional parameters + * @returns Promise + */ + createOrUpdateDomainOwnershipIdentifierSlot(resourceGroupName: string, name: string, domainOwnershipIdentifierName: string, domainOwnershipIdentifier: Models.Identifier, slot: string, options?: msRest.RequestOptionsBase): Promise; + /** + * @param resourceGroupName Name of the resource group to which the resource belongs. + * @param name Name of the app. + * @param domainOwnershipIdentifierName Name of domain ownership identifier. + * @param domainOwnershipIdentifier A JSON representation of the domain ownership properties. + * @param slot Name of the deployment slot. If a slot is not specified, the API will delete the + * binding for the production slot. + * @param callback The callback + */ + createOrUpdateDomainOwnershipIdentifierSlot(resourceGroupName: string, name: string, domainOwnershipIdentifierName: string, domainOwnershipIdentifier: Models.Identifier, slot: string, callback: msRest.ServiceCallback): void; + /** + * @param resourceGroupName Name of the resource group to which the resource belongs. + * @param name Name of the app. + * @param domainOwnershipIdentifierName Name of domain ownership identifier. + * @param domainOwnershipIdentifier A JSON representation of the domain ownership properties. + * @param slot Name of the deployment slot. If a slot is not specified, the API will delete the + * binding for the production slot. + * @param options The optional parameters + * @param callback The callback + */ + createOrUpdateDomainOwnershipIdentifierSlot(resourceGroupName: string, name: string, domainOwnershipIdentifierName: string, domainOwnershipIdentifier: Models.Identifier, slot: string, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; + createOrUpdateDomainOwnershipIdentifierSlot(resourceGroupName: string, name: string, domainOwnershipIdentifierName: string, domainOwnershipIdentifier: Models.Identifier, slot: string, options?: msRest.RequestOptionsBase | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { + return this.client.sendOperationRequest( + { + resourceGroupName, + name, + domainOwnershipIdentifierName, + domainOwnershipIdentifier, + slot, + options + }, + createOrUpdateDomainOwnershipIdentifierSlotOperationSpec, + callback) as Promise; + } + + /** + * Deletes a domain ownership identifier for a web app. + * @summary Deletes a domain ownership identifier for a web app. + * @param resourceGroupName Name of the resource group to which the resource belongs. + * @param name Name of the app. + * @param domainOwnershipIdentifierName Name of domain ownership identifier. + * @param slot Name of the deployment slot. If a slot is not specified, the API will delete the + * binding for the production slot. + * @param [options] The optional parameters + * @returns Promise + */ + deleteDomainOwnershipIdentifierSlot(resourceGroupName: string, name: string, domainOwnershipIdentifierName: string, slot: string, options?: msRest.RequestOptionsBase): Promise; + /** + * @param resourceGroupName Name of the resource group to which the resource belongs. + * @param name Name of the app. + * @param domainOwnershipIdentifierName Name of domain ownership identifier. + * @param slot Name of the deployment slot. If a slot is not specified, the API will delete the + * binding for the production slot. + * @param callback The callback + */ + deleteDomainOwnershipIdentifierSlot(resourceGroupName: string, name: string, domainOwnershipIdentifierName: string, slot: string, callback: msRest.ServiceCallback): void; + /** + * @param resourceGroupName Name of the resource group to which the resource belongs. + * @param name Name of the app. + * @param domainOwnershipIdentifierName Name of domain ownership identifier. + * @param slot Name of the deployment slot. If a slot is not specified, the API will delete the + * binding for the production slot. + * @param options The optional parameters + * @param callback The callback + */ + deleteDomainOwnershipIdentifierSlot(resourceGroupName: string, name: string, domainOwnershipIdentifierName: string, slot: string, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; + deleteDomainOwnershipIdentifierSlot(resourceGroupName: string, name: string, domainOwnershipIdentifierName: string, slot: string, options?: msRest.RequestOptionsBase | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { + return this.client.sendOperationRequest( + { + resourceGroupName, + name, + domainOwnershipIdentifierName, + slot, + options + }, + deleteDomainOwnershipIdentifierSlotOperationSpec, + callback); + } + + /** + * Creates a domain ownership identifier for web app, or updates an existing ownership identifier. + * @summary Creates a domain ownership identifier for web app, or updates an existing ownership + * identifier. + * @param resourceGroupName Name of the resource group to which the resource belongs. + * @param name Name of the app. + * @param domainOwnershipIdentifierName Name of domain ownership identifier. + * @param domainOwnershipIdentifier A JSON representation of the domain ownership properties. + * @param slot Name of the deployment slot. If a slot is not specified, the API will delete the + * binding for the production slot. + * @param [options] The optional parameters + * @returns Promise + */ + updateDomainOwnershipIdentifierSlot(resourceGroupName: string, name: string, domainOwnershipIdentifierName: string, domainOwnershipIdentifier: Models.Identifier, slot: string, options?: msRest.RequestOptionsBase): Promise; + /** + * @param resourceGroupName Name of the resource group to which the resource belongs. + * @param name Name of the app. + * @param domainOwnershipIdentifierName Name of domain ownership identifier. + * @param domainOwnershipIdentifier A JSON representation of the domain ownership properties. + * @param slot Name of the deployment slot. If a slot is not specified, the API will delete the + * binding for the production slot. + * @param callback The callback + */ + updateDomainOwnershipIdentifierSlot(resourceGroupName: string, name: string, domainOwnershipIdentifierName: string, domainOwnershipIdentifier: Models.Identifier, slot: string, callback: msRest.ServiceCallback): void; + /** + * @param resourceGroupName Name of the resource group to which the resource belongs. + * @param name Name of the app. + * @param domainOwnershipIdentifierName Name of domain ownership identifier. + * @param domainOwnershipIdentifier A JSON representation of the domain ownership properties. + * @param slot Name of the deployment slot. If a slot is not specified, the API will delete the + * binding for the production slot. + * @param options The optional parameters + * @param callback The callback + */ + updateDomainOwnershipIdentifierSlot(resourceGroupName: string, name: string, domainOwnershipIdentifierName: string, domainOwnershipIdentifier: Models.Identifier, slot: string, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; + updateDomainOwnershipIdentifierSlot(resourceGroupName: string, name: string, domainOwnershipIdentifierName: string, domainOwnershipIdentifier: Models.Identifier, slot: string, options?: msRest.RequestOptionsBase | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { + return this.client.sendOperationRequest( + { + resourceGroupName, + name, + domainOwnershipIdentifierName, + domainOwnershipIdentifier, + slot, + options + }, + updateDomainOwnershipIdentifierSlotOperationSpec, + callback) as Promise; + } + + /** + * Get the status of the last MSDeploy operation. + * @summary Get the status of the last MSDeploy operation. + * @param resourceGroupName Name of the resource group to which the resource belongs. + * @param name Name of web app. + * @param slot Name of web app slot. If not specified then will default to production slot. + * @param [options] The optional parameters + * @returns Promise + */ + getMSDeployStatusSlot(resourceGroupName: string, name: string, slot: string, options?: msRest.RequestOptionsBase): Promise; + /** + * @param resourceGroupName Name of the resource group to which the resource belongs. + * @param name Name of web app. + * @param slot Name of web app slot. If not specified then will default to production slot. + * @param callback The callback + */ + getMSDeployStatusSlot(resourceGroupName: string, name: string, slot: string, callback: msRest.ServiceCallback): void; + /** + * @param resourceGroupName Name of the resource group to which the resource belongs. + * @param name Name of web app. + * @param slot Name of web app slot. If not specified then will default to production slot. + * @param options The optional parameters + * @param callback The callback + */ + getMSDeployStatusSlot(resourceGroupName: string, name: string, slot: string, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; + getMSDeployStatusSlot(resourceGroupName: string, name: string, slot: string, options?: msRest.RequestOptionsBase | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { + return this.client.sendOperationRequest( + { + resourceGroupName, + name, + slot, + options + }, + getMSDeployStatusSlotOperationSpec, + callback) as Promise; + } + + /** + * Invoke the MSDeploy web app extension. + * @summary Invoke the MSDeploy web app extension. + * @param resourceGroupName Name of the resource group to which the resource belongs. + * @param name Name of web app. + * @param slot Name of web app slot. If not specified then will default to production slot. + * @param mSDeploy Details of MSDeploy operation + * @param [options] The optional parameters + * @returns Promise + */ + createMSDeployOperationSlot(resourceGroupName: string, name: string, slot: string, mSDeploy: Models.MSDeploy, options?: msRest.RequestOptionsBase): Promise { + return this.beginCreateMSDeployOperationSlot(resourceGroupName,name,slot,mSDeploy,options) + .then(lroPoller => lroPoller.pollUntilFinished()) as Promise; + } + + /** + * Get the MSDeploy Log for the last MSDeploy operation. + * @summary Get the MSDeploy Log for the last MSDeploy operation. + * @param resourceGroupName Name of the resource group to which the resource belongs. + * @param name Name of web app. + * @param slot Name of web app slot. If not specified then will default to production slot. + * @param [options] The optional parameters + * @returns Promise + */ + getMSDeployLogSlot(resourceGroupName: string, name: string, slot: string, options?: msRest.RequestOptionsBase): Promise; + /** + * @param resourceGroupName Name of the resource group to which the resource belongs. + * @param name Name of web app. + * @param slot Name of web app slot. If not specified then will default to production slot. + * @param callback The callback + */ + getMSDeployLogSlot(resourceGroupName: string, name: string, slot: string, callback: msRest.ServiceCallback): void; + /** + * @param resourceGroupName Name of the resource group to which the resource belongs. + * @param name Name of web app. + * @param slot Name of web app slot. If not specified then will default to production slot. + * @param options The optional parameters + * @param callback The callback + */ + getMSDeployLogSlot(resourceGroupName: string, name: string, slot: string, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; + getMSDeployLogSlot(resourceGroupName: string, name: string, slot: string, options?: msRest.RequestOptionsBase | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { + return this.client.sendOperationRequest( + { + resourceGroupName, + name, + slot, + options + }, + getMSDeployLogSlotOperationSpec, + callback) as Promise; + } + + /** + * List the functions for a web site, or a deployment slot. + * @summary List the functions for a web site, or a deployment slot. + * @param resourceGroupName Name of the resource group to which the resource belongs. + * @param name Site name. + * @param slot Name of the deployment slot. If a slot is not specified, the API deletes a + * deployment for the production slot. + * @param [options] The optional parameters + * @returns Promise + */ + listInstanceFunctionsSlot(resourceGroupName: string, name: string, slot: string, options?: msRest.RequestOptionsBase): Promise; + /** + * @param resourceGroupName Name of the resource group to which the resource belongs. + * @param name Site name. + * @param slot Name of the deployment slot. If a slot is not specified, the API deletes a + * deployment for the production slot. + * @param callback The callback + */ + listInstanceFunctionsSlot(resourceGroupName: string, name: string, slot: string, callback: msRest.ServiceCallback): void; + /** + * @param resourceGroupName Name of the resource group to which the resource belongs. + * @param name Site name. + * @param slot Name of the deployment slot. If a slot is not specified, the API deletes a + * deployment for the production slot. + * @param options The optional parameters + * @param callback The callback + */ + listInstanceFunctionsSlot(resourceGroupName: string, name: string, slot: string, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; + listInstanceFunctionsSlot(resourceGroupName: string, name: string, slot: string, options?: msRest.RequestOptionsBase | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { + return this.client.sendOperationRequest( + { + resourceGroupName, + name, + slot, + options + }, + listInstanceFunctionsSlotOperationSpec, + callback) as Promise; + } + + /** + * Fetch a short lived token that can be exchanged for a master key. + * @summary Fetch a short lived token that can be exchanged for a master key. + * @param resourceGroupName Name of the resource group to which the resource belongs. + * @param name Name of web app. + * @param slot Name of web app slot. If not specified then will default to production slot. + * @param [options] The optional parameters + * @returns Promise + */ + getFunctionsAdminTokenSlot(resourceGroupName: string, name: string, slot: string, options?: msRest.RequestOptionsBase): Promise; + /** + * @param resourceGroupName Name of the resource group to which the resource belongs. + * @param name Name of web app. + * @param slot Name of web app slot. If not specified then will default to production slot. + * @param callback The callback + */ + getFunctionsAdminTokenSlot(resourceGroupName: string, name: string, slot: string, callback: msRest.ServiceCallback): void; + /** + * @param resourceGroupName Name of the resource group to which the resource belongs. + * @param name Name of web app. + * @param slot Name of web app slot. If not specified then will default to production slot. + * @param options The optional parameters + * @param callback The callback + */ + getFunctionsAdminTokenSlot(resourceGroupName: string, name: string, slot: string, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; + getFunctionsAdminTokenSlot(resourceGroupName: string, name: string, slot: string, options?: msRest.RequestOptionsBase | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { + return this.client.sendOperationRequest( + { + resourceGroupName, + name, + slot, + options + }, + getFunctionsAdminTokenSlotOperationSpec, + callback) as Promise; + } + + /** + * Get function information by its ID for web site, or a deployment slot. + * @summary Get function information by its ID for web site, or a deployment slot. + * @param resourceGroupName Name of the resource group to which the resource belongs. + * @param name Site name. + * @param functionName Function name. + * @param slot Name of the deployment slot. If a slot is not specified, the API deletes a + * deployment for the production slot. + * @param [options] The optional parameters + * @returns Promise + */ + getInstanceFunctionSlot(resourceGroupName: string, name: string, functionName: string, slot: string, options?: msRest.RequestOptionsBase): Promise; + /** + * @param resourceGroupName Name of the resource group to which the resource belongs. + * @param name Site name. + * @param functionName Function name. + * @param slot Name of the deployment slot. If a slot is not specified, the API deletes a + * deployment for the production slot. + * @param callback The callback + */ + getInstanceFunctionSlot(resourceGroupName: string, name: string, functionName: string, slot: string, callback: msRest.ServiceCallback): void; + /** + * @param resourceGroupName Name of the resource group to which the resource belongs. + * @param name Site name. + * @param functionName Function name. + * @param slot Name of the deployment slot. If a slot is not specified, the API deletes a + * deployment for the production slot. + * @param options The optional parameters + * @param callback The callback + */ + getInstanceFunctionSlot(resourceGroupName: string, name: string, functionName: string, slot: string, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; + getInstanceFunctionSlot(resourceGroupName: string, name: string, functionName: string, slot: string, options?: msRest.RequestOptionsBase | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { + return this.client.sendOperationRequest( + { + resourceGroupName, + name, + functionName, + slot, + options + }, + getInstanceFunctionSlotOperationSpec, + callback) as Promise; + } + + /** + * Create function for web site, or a deployment slot. + * @summary Create function for web site, or a deployment slot. + * @param resourceGroupName Name of the resource group to which the resource belongs. + * @param name Site name. + * @param functionName Function name. + * @param slot Name of the deployment slot. If a slot is not specified, the API deletes a + * deployment for the production slot. + * @param functionEnvelope Function details. + * @param [options] The optional parameters + * @returns Promise + */ + createInstanceFunctionSlot(resourceGroupName: string, name: string, functionName: string, slot: string, functionEnvelope: Models.FunctionEnvelope, options?: msRest.RequestOptionsBase): Promise { + return this.beginCreateInstanceFunctionSlot(resourceGroupName,name,functionName,slot,functionEnvelope,options) + .then(lroPoller => lroPoller.pollUntilFinished()) as Promise; + } + + /** + * Delete a function for web site, or a deployment slot. + * @summary Delete a function for web site, or a deployment slot. + * @param resourceGroupName Name of the resource group to which the resource belongs. + * @param name Site name. + * @param functionName Function name. + * @param slot Name of the deployment slot. If a slot is not specified, the API deletes a + * deployment for the production slot. + * @param [options] The optional parameters + * @returns Promise + */ + deleteInstanceFunctionSlot(resourceGroupName: string, name: string, functionName: string, slot: string, options?: msRest.RequestOptionsBase): Promise; + /** + * @param resourceGroupName Name of the resource group to which the resource belongs. + * @param name Site name. + * @param functionName Function name. + * @param slot Name of the deployment slot. If a slot is not specified, the API deletes a + * deployment for the production slot. + * @param callback The callback + */ + deleteInstanceFunctionSlot(resourceGroupName: string, name: string, functionName: string, slot: string, callback: msRest.ServiceCallback): void; + /** + * @param resourceGroupName Name of the resource group to which the resource belongs. + * @param name Site name. + * @param functionName Function name. + * @param slot Name of the deployment slot. If a slot is not specified, the API deletes a + * deployment for the production slot. + * @param options The optional parameters + * @param callback The callback + */ + deleteInstanceFunctionSlot(resourceGroupName: string, name: string, functionName: string, slot: string, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; + deleteInstanceFunctionSlot(resourceGroupName: string, name: string, functionName: string, slot: string, options?: msRest.RequestOptionsBase | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { + return this.client.sendOperationRequest( + { + resourceGroupName, + name, + functionName, + slot, + options + }, + deleteInstanceFunctionSlotOperationSpec, + callback); + } + + /** + * Get function secrets for a function in a web site, or a deployment slot. + * @summary Get function secrets for a function in a web site, or a deployment slot. + * @param resourceGroupName Name of the resource group to which the resource belongs. + * @param name Site name. + * @param functionName Function name. + * @param slot Name of the deployment slot. If a slot is not specified, the API deletes a + * deployment for the production slot. + * @param [options] The optional parameters + * @returns Promise + */ + listFunctionSecretsSlot(resourceGroupName: string, name: string, functionName: string, slot: string, options?: msRest.RequestOptionsBase): Promise; + /** + * @param resourceGroupName Name of the resource group to which the resource belongs. + * @param name Site name. + * @param functionName Function name. + * @param slot Name of the deployment slot. If a slot is not specified, the API deletes a + * deployment for the production slot. + * @param callback The callback + */ + listFunctionSecretsSlot(resourceGroupName: string, name: string, functionName: string, slot: string, callback: msRest.ServiceCallback): void; + /** + * @param resourceGroupName Name of the resource group to which the resource belongs. + * @param name Site name. + * @param functionName Function name. + * @param slot Name of the deployment slot. If a slot is not specified, the API deletes a + * deployment for the production slot. + * @param options The optional parameters + * @param callback The callback + */ + listFunctionSecretsSlot(resourceGroupName: string, name: string, functionName: string, slot: string, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; + listFunctionSecretsSlot(resourceGroupName: string, name: string, functionName: string, slot: string, options?: msRest.RequestOptionsBase | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { + return this.client.sendOperationRequest( + { + resourceGroupName, + name, + functionName, + slot, + options + }, + listFunctionSecretsSlotOperationSpec, + callback) as Promise; + } + + /** + * Get hostname bindings for an app or a deployment slot. + * @summary Get hostname bindings for an app or a deployment slot. + * @param resourceGroupName Name of the resource group to which the resource belongs. + * @param name Name of the app. + * @param slot Name of the deployment slot. If a slot is not specified, the API gets hostname + * bindings for the production slot. + * @param [options] The optional parameters + * @returns Promise + */ + listHostNameBindingsSlot(resourceGroupName: string, name: string, slot: string, options?: msRest.RequestOptionsBase): Promise; + /** + * @param resourceGroupName Name of the resource group to which the resource belongs. + * @param name Name of the app. + * @param slot Name of the deployment slot. If a slot is not specified, the API gets hostname + * bindings for the production slot. + * @param callback The callback + */ + listHostNameBindingsSlot(resourceGroupName: string, name: string, slot: string, callback: msRest.ServiceCallback): void; + /** + * @param resourceGroupName Name of the resource group to which the resource belongs. + * @param name Name of the app. + * @param slot Name of the deployment slot. If a slot is not specified, the API gets hostname + * bindings for the production slot. + * @param options The optional parameters + * @param callback The callback + */ + listHostNameBindingsSlot(resourceGroupName: string, name: string, slot: string, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; + listHostNameBindingsSlot(resourceGroupName: string, name: string, slot: string, options?: msRest.RequestOptionsBase | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { + return this.client.sendOperationRequest( + { + resourceGroupName, + name, + slot, + options + }, + listHostNameBindingsSlotOperationSpec, + callback) as Promise; + } + + /** + * Get the named hostname binding for an app (or deployment slot, if specified). + * @summary Get the named hostname binding for an app (or deployment slot, if specified). + * @param resourceGroupName Name of the resource group to which the resource belongs. + * @param name Name of the app. + * @param slot Name of the deployment slot. If a slot is not specified, the API the named binding + * for the production slot. + * @param hostName Hostname in the hostname binding. + * @param [options] The optional parameters + * @returns Promise + */ + getHostNameBindingSlot(resourceGroupName: string, name: string, slot: string, hostName: string, options?: msRest.RequestOptionsBase): Promise; + /** + * @param resourceGroupName Name of the resource group to which the resource belongs. + * @param name Name of the app. + * @param slot Name of the deployment slot. If a slot is not specified, the API the named binding + * for the production slot. + * @param hostName Hostname in the hostname binding. + * @param callback The callback + */ + getHostNameBindingSlot(resourceGroupName: string, name: string, slot: string, hostName: string, callback: msRest.ServiceCallback): void; + /** + * @param resourceGroupName Name of the resource group to which the resource belongs. + * @param name Name of the app. + * @param slot Name of the deployment slot. If a slot is not specified, the API the named binding + * for the production slot. + * @param hostName Hostname in the hostname binding. + * @param options The optional parameters + * @param callback The callback + */ + getHostNameBindingSlot(resourceGroupName: string, name: string, slot: string, hostName: string, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; + getHostNameBindingSlot(resourceGroupName: string, name: string, slot: string, hostName: string, options?: msRest.RequestOptionsBase | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { + return this.client.sendOperationRequest( + { + resourceGroupName, + name, + slot, + hostName, + options + }, + getHostNameBindingSlotOperationSpec, + callback) as Promise; + } + + /** + * Creates a hostname binding for an app. + * @summary Creates a hostname binding for an app. + * @param resourceGroupName Name of the resource group to which the resource belongs. + * @param name Name of the app. + * @param hostName Hostname in the hostname binding. + * @param hostNameBinding Binding details. This is the JSON representation of a HostNameBinding + * object. + * @param slot Name of the deployment slot. If a slot is not specified, the API will create a + * binding for the production slot. + * @param [options] The optional parameters + * @returns Promise + */ + createOrUpdateHostNameBindingSlot(resourceGroupName: string, name: string, hostName: string, hostNameBinding: Models.HostNameBinding, slot: string, options?: msRest.RequestOptionsBase): Promise; + /** + * @param resourceGroupName Name of the resource group to which the resource belongs. + * @param name Name of the app. + * @param hostName Hostname in the hostname binding. + * @param hostNameBinding Binding details. This is the JSON representation of a HostNameBinding + * object. + * @param slot Name of the deployment slot. If a slot is not specified, the API will create a + * binding for the production slot. + * @param callback The callback + */ + createOrUpdateHostNameBindingSlot(resourceGroupName: string, name: string, hostName: string, hostNameBinding: Models.HostNameBinding, slot: string, callback: msRest.ServiceCallback): void; + /** + * @param resourceGroupName Name of the resource group to which the resource belongs. + * @param name Name of the app. + * @param hostName Hostname in the hostname binding. + * @param hostNameBinding Binding details. This is the JSON representation of a HostNameBinding + * object. + * @param slot Name of the deployment slot. If a slot is not specified, the API will create a + * binding for the production slot. + * @param options The optional parameters + * @param callback The callback + */ + createOrUpdateHostNameBindingSlot(resourceGroupName: string, name: string, hostName: string, hostNameBinding: Models.HostNameBinding, slot: string, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; + createOrUpdateHostNameBindingSlot(resourceGroupName: string, name: string, hostName: string, hostNameBinding: Models.HostNameBinding, slot: string, options?: msRest.RequestOptionsBase | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { + return this.client.sendOperationRequest( + { + resourceGroupName, + name, + hostName, + hostNameBinding, + slot, + options + }, + createOrUpdateHostNameBindingSlotOperationSpec, + callback) as Promise; + } + + /** + * Deletes a hostname binding for an app. + * @summary Deletes a hostname binding for an app. + * @param resourceGroupName Name of the resource group to which the resource belongs. + * @param name Name of the app. + * @param slot Name of the deployment slot. If a slot is not specified, the API will delete the + * binding for the production slot. + * @param hostName Hostname in the hostname binding. + * @param [options] The optional parameters + * @returns Promise + */ + deleteHostNameBindingSlot(resourceGroupName: string, name: string, slot: string, hostName: string, options?: msRest.RequestOptionsBase): Promise; + /** + * @param resourceGroupName Name of the resource group to which the resource belongs. + * @param name Name of the app. + * @param slot Name of the deployment slot. If a slot is not specified, the API will delete the + * binding for the production slot. + * @param hostName Hostname in the hostname binding. + * @param callback The callback + */ + deleteHostNameBindingSlot(resourceGroupName: string, name: string, slot: string, hostName: string, callback: msRest.ServiceCallback): void; + /** + * @param resourceGroupName Name of the resource group to which the resource belongs. + * @param name Name of the app. + * @param slot Name of the deployment slot. If a slot is not specified, the API will delete the + * binding for the production slot. + * @param hostName Hostname in the hostname binding. + * @param options The optional parameters + * @param callback The callback + */ + deleteHostNameBindingSlot(resourceGroupName: string, name: string, slot: string, hostName: string, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; + deleteHostNameBindingSlot(resourceGroupName: string, name: string, slot: string, hostName: string, options?: msRest.RequestOptionsBase | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { + return this.client.sendOperationRequest( + { + resourceGroupName, + name, + slot, + hostName, + options + }, + deleteHostNameBindingSlotOperationSpec, + callback); + } + + /** + * Retrieves a specific Service Bus Hybrid Connection used by this Web App. + * @summary Retrieves a specific Service Bus Hybrid Connection used by this Web App. + * @param resourceGroupName Name of the resource group to which the resource belongs. + * @param name The name of the web app. + * @param namespaceName The namespace for this hybrid connection. + * @param relayName The relay name for this hybrid connection. + * @param slot The name of the slot for the web app. + * @param [options] The optional parameters + * @returns Promise + */ + getHybridConnectionSlot(resourceGroupName: string, name: string, namespaceName: string, relayName: string, slot: string, options?: msRest.RequestOptionsBase): Promise; + /** + * @param resourceGroupName Name of the resource group to which the resource belongs. + * @param name The name of the web app. + * @param namespaceName The namespace for this hybrid connection. + * @param relayName The relay name for this hybrid connection. + * @param slot The name of the slot for the web app. + * @param callback The callback + */ + getHybridConnectionSlot(resourceGroupName: string, name: string, namespaceName: string, relayName: string, slot: string, callback: msRest.ServiceCallback): void; + /** + * @param resourceGroupName Name of the resource group to which the resource belongs. + * @param name The name of the web app. + * @param namespaceName The namespace for this hybrid connection. + * @param relayName The relay name for this hybrid connection. + * @param slot The name of the slot for the web app. + * @param options The optional parameters + * @param callback The callback + */ + getHybridConnectionSlot(resourceGroupName: string, name: string, namespaceName: string, relayName: string, slot: string, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; + getHybridConnectionSlot(resourceGroupName: string, name: string, namespaceName: string, relayName: string, slot: string, options?: msRest.RequestOptionsBase | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { + return this.client.sendOperationRequest( + { + resourceGroupName, + name, + namespaceName, + relayName, + slot, + options + }, + getHybridConnectionSlotOperationSpec, + callback) as Promise; + } + + /** + * Creates a new Hybrid Connection using a Service Bus relay. + * @summary Creates a new Hybrid Connection using a Service Bus relay. + * @param resourceGroupName Name of the resource group to which the resource belongs. + * @param name The name of the web app. + * @param namespaceName The namespace for this hybrid connection. + * @param relayName The relay name for this hybrid connection. + * @param connectionEnvelope The details of the hybrid connection. + * @param slot The name of the slot for the web app. + * @param [options] The optional parameters + * @returns Promise + */ + createOrUpdateHybridConnectionSlot(resourceGroupName: string, name: string, namespaceName: string, relayName: string, connectionEnvelope: Models.HybridConnection, slot: string, options?: msRest.RequestOptionsBase): Promise; + /** + * @param resourceGroupName Name of the resource group to which the resource belongs. + * @param name The name of the web app. + * @param namespaceName The namespace for this hybrid connection. + * @param relayName The relay name for this hybrid connection. + * @param connectionEnvelope The details of the hybrid connection. + * @param slot The name of the slot for the web app. + * @param callback The callback + */ + createOrUpdateHybridConnectionSlot(resourceGroupName: string, name: string, namespaceName: string, relayName: string, connectionEnvelope: Models.HybridConnection, slot: string, callback: msRest.ServiceCallback): void; + /** + * @param resourceGroupName Name of the resource group to which the resource belongs. + * @param name The name of the web app. + * @param namespaceName The namespace for this hybrid connection. + * @param relayName The relay name for this hybrid connection. + * @param connectionEnvelope The details of the hybrid connection. + * @param slot The name of the slot for the web app. + * @param options The optional parameters + * @param callback The callback + */ + createOrUpdateHybridConnectionSlot(resourceGroupName: string, name: string, namespaceName: string, relayName: string, connectionEnvelope: Models.HybridConnection, slot: string, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; + createOrUpdateHybridConnectionSlot(resourceGroupName: string, name: string, namespaceName: string, relayName: string, connectionEnvelope: Models.HybridConnection, slot: string, options?: msRest.RequestOptionsBase | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { + return this.client.sendOperationRequest( + { + resourceGroupName, + name, + namespaceName, + relayName, + connectionEnvelope, + slot, + options + }, + createOrUpdateHybridConnectionSlotOperationSpec, + callback) as Promise; + } + + /** + * Removes a Hybrid Connection from this site. + * @summary Removes a Hybrid Connection from this site. + * @param resourceGroupName Name of the resource group to which the resource belongs. + * @param name The name of the web app. + * @param namespaceName The namespace for this hybrid connection. + * @param relayName The relay name for this hybrid connection. + * @param slot The name of the slot for the web app. + * @param [options] The optional parameters + * @returns Promise + */ + deleteHybridConnectionSlot(resourceGroupName: string, name: string, namespaceName: string, relayName: string, slot: string, options?: msRest.RequestOptionsBase): Promise; + /** + * @param resourceGroupName Name of the resource group to which the resource belongs. + * @param name The name of the web app. + * @param namespaceName The namespace for this hybrid connection. + * @param relayName The relay name for this hybrid connection. + * @param slot The name of the slot for the web app. + * @param callback The callback + */ + deleteHybridConnectionSlot(resourceGroupName: string, name: string, namespaceName: string, relayName: string, slot: string, callback: msRest.ServiceCallback): void; + /** + * @param resourceGroupName Name of the resource group to which the resource belongs. + * @param name The name of the web app. + * @param namespaceName The namespace for this hybrid connection. + * @param relayName The relay name for this hybrid connection. + * @param slot The name of the slot for the web app. + * @param options The optional parameters + * @param callback The callback + */ + deleteHybridConnectionSlot(resourceGroupName: string, name: string, namespaceName: string, relayName: string, slot: string, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; + deleteHybridConnectionSlot(resourceGroupName: string, name: string, namespaceName: string, relayName: string, slot: string, options?: msRest.RequestOptionsBase | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { + return this.client.sendOperationRequest( + { + resourceGroupName, + name, + namespaceName, + relayName, + slot, + options + }, + deleteHybridConnectionSlotOperationSpec, + callback); + } + + /** + * Creates a new Hybrid Connection using a Service Bus relay. + * @summary Creates a new Hybrid Connection using a Service Bus relay. + * @param resourceGroupName Name of the resource group to which the resource belongs. + * @param name The name of the web app. + * @param namespaceName The namespace for this hybrid connection. + * @param relayName The relay name for this hybrid connection. + * @param connectionEnvelope The details of the hybrid connection. + * @param slot The name of the slot for the web app. + * @param [options] The optional parameters + * @returns Promise + */ + updateHybridConnectionSlot(resourceGroupName: string, name: string, namespaceName: string, relayName: string, connectionEnvelope: Models.HybridConnection, slot: string, options?: msRest.RequestOptionsBase): Promise; + /** + * @param resourceGroupName Name of the resource group to which the resource belongs. + * @param name The name of the web app. + * @param namespaceName The namespace for this hybrid connection. + * @param relayName The relay name for this hybrid connection. + * @param connectionEnvelope The details of the hybrid connection. + * @param slot The name of the slot for the web app. + * @param callback The callback + */ + updateHybridConnectionSlot(resourceGroupName: string, name: string, namespaceName: string, relayName: string, connectionEnvelope: Models.HybridConnection, slot: string, callback: msRest.ServiceCallback): void; + /** + * @param resourceGroupName Name of the resource group to which the resource belongs. + * @param name The name of the web app. + * @param namespaceName The namespace for this hybrid connection. + * @param relayName The relay name for this hybrid connection. + * @param connectionEnvelope The details of the hybrid connection. + * @param slot The name of the slot for the web app. + * @param options The optional parameters + * @param callback The callback + */ + updateHybridConnectionSlot(resourceGroupName: string, name: string, namespaceName: string, relayName: string, connectionEnvelope: Models.HybridConnection, slot: string, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; + updateHybridConnectionSlot(resourceGroupName: string, name: string, namespaceName: string, relayName: string, connectionEnvelope: Models.HybridConnection, slot: string, options?: msRest.RequestOptionsBase | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { + return this.client.sendOperationRequest( + { + resourceGroupName, + name, + namespaceName, + relayName, + connectionEnvelope, + slot, + options + }, + updateHybridConnectionSlotOperationSpec, + callback) as Promise; + } + + /** + * Gets the send key name and value for a Hybrid Connection. + * @summary Gets the send key name and value for a Hybrid Connection. + * @param resourceGroupName Name of the resource group to which the resource belongs. + * @param name The name of the web app. + * @param namespaceName The namespace for this hybrid connection. + * @param relayName The relay name for this hybrid connection. + * @param slot The name of the slot for the web app. + * @param [options] The optional parameters + * @returns Promise + */ + listHybridConnectionKeysSlot(resourceGroupName: string, name: string, namespaceName: string, relayName: string, slot: string, options?: msRest.RequestOptionsBase): Promise; + /** + * @param resourceGroupName Name of the resource group to which the resource belongs. + * @param name The name of the web app. + * @param namespaceName The namespace for this hybrid connection. + * @param relayName The relay name for this hybrid connection. + * @param slot The name of the slot for the web app. + * @param callback The callback + */ + listHybridConnectionKeysSlot(resourceGroupName: string, name: string, namespaceName: string, relayName: string, slot: string, callback: msRest.ServiceCallback): void; + /** + * @param resourceGroupName Name of the resource group to which the resource belongs. + * @param name The name of the web app. + * @param namespaceName The namespace for this hybrid connection. + * @param relayName The relay name for this hybrid connection. + * @param slot The name of the slot for the web app. + * @param options The optional parameters + * @param callback The callback + */ + listHybridConnectionKeysSlot(resourceGroupName: string, name: string, namespaceName: string, relayName: string, slot: string, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; + listHybridConnectionKeysSlot(resourceGroupName: string, name: string, namespaceName: string, relayName: string, slot: string, options?: msRest.RequestOptionsBase | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { + return this.client.sendOperationRequest( + { + resourceGroupName, + name, + namespaceName, + relayName, + slot, + options + }, + listHybridConnectionKeysSlotOperationSpec, + callback) as Promise; + } + + /** + * Retrieves all Service Bus Hybrid Connections used by this Web App. + * @summary Retrieves all Service Bus Hybrid Connections used by this Web App. + * @param resourceGroupName Name of the resource group to which the resource belongs. + * @param name The name of the web app. + * @param slot The name of the slot for the web app. + * @param [options] The optional parameters + * @returns Promise + */ + listHybridConnectionsSlot(resourceGroupName: string, name: string, slot: string, options?: msRest.RequestOptionsBase): Promise; + /** + * @param resourceGroupName Name of the resource group to which the resource belongs. + * @param name The name of the web app. + * @param slot The name of the slot for the web app. + * @param callback The callback + */ + listHybridConnectionsSlot(resourceGroupName: string, name: string, slot: string, callback: msRest.ServiceCallback): void; + /** + * @param resourceGroupName Name of the resource group to which the resource belongs. + * @param name The name of the web app. + * @param slot The name of the slot for the web app. + * @param options The optional parameters + * @param callback The callback + */ + listHybridConnectionsSlot(resourceGroupName: string, name: string, slot: string, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; + listHybridConnectionsSlot(resourceGroupName: string, name: string, slot: string, options?: msRest.RequestOptionsBase | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { + return this.client.sendOperationRequest( + { + resourceGroupName, + name, + slot, + options + }, + listHybridConnectionsSlotOperationSpec, + callback) as Promise; + } + + /** + * Gets hybrid connections configured for an app (or deployment slot, if specified). + * @summary Gets hybrid connections configured for an app (or deployment slot, if specified). + * @param resourceGroupName Name of the resource group to which the resource belongs. + * @param name Name of the app. + * @param slot Name of the deployment slot. If a slot is not specified, the API will get hybrid + * connections for the production slot. + * @param [options] The optional parameters + * @returns Promise + */ + listRelayServiceConnectionsSlot(resourceGroupName: string, name: string, slot: string, options?: msRest.RequestOptionsBase): Promise; + /** + * @param resourceGroupName Name of the resource group to which the resource belongs. + * @param name Name of the app. + * @param slot Name of the deployment slot. If a slot is not specified, the API will get hybrid + * connections for the production slot. + * @param callback The callback + */ + listRelayServiceConnectionsSlot(resourceGroupName: string, name: string, slot: string, callback: msRest.ServiceCallback): void; + /** + * @param resourceGroupName Name of the resource group to which the resource belongs. + * @param name Name of the app. + * @param slot Name of the deployment slot. If a slot is not specified, the API will get hybrid + * connections for the production slot. + * @param options The optional parameters + * @param callback The callback + */ + listRelayServiceConnectionsSlot(resourceGroupName: string, name: string, slot: string, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; + listRelayServiceConnectionsSlot(resourceGroupName: string, name: string, slot: string, options?: msRest.RequestOptionsBase | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { + return this.client.sendOperationRequest( + { + resourceGroupName, + name, + slot, + options + }, + listRelayServiceConnectionsSlotOperationSpec, + callback) as Promise; + } + + /** + * Gets a hybrid connection configuration by its name. + * @summary Gets a hybrid connection configuration by its name. + * @param resourceGroupName Name of the resource group to which the resource belongs. + * @param name Name of the app. + * @param entityName Name of the hybrid connection. + * @param slot Name of the deployment slot. If a slot is not specified, the API will get a hybrid + * connection for the production slot. + * @param [options] The optional parameters + * @returns Promise + */ + getRelayServiceConnectionSlot(resourceGroupName: string, name: string, entityName: string, slot: string, options?: msRest.RequestOptionsBase): Promise; + /** + * @param resourceGroupName Name of the resource group to which the resource belongs. + * @param name Name of the app. + * @param entityName Name of the hybrid connection. + * @param slot Name of the deployment slot. If a slot is not specified, the API will get a hybrid + * connection for the production slot. + * @param callback The callback + */ + getRelayServiceConnectionSlot(resourceGroupName: string, name: string, entityName: string, slot: string, callback: msRest.ServiceCallback): void; + /** + * @param resourceGroupName Name of the resource group to which the resource belongs. + * @param name Name of the app. + * @param entityName Name of the hybrid connection. + * @param slot Name of the deployment slot. If a slot is not specified, the API will get a hybrid + * connection for the production slot. + * @param options The optional parameters + * @param callback The callback + */ + getRelayServiceConnectionSlot(resourceGroupName: string, name: string, entityName: string, slot: string, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; + getRelayServiceConnectionSlot(resourceGroupName: string, name: string, entityName: string, slot: string, options?: msRest.RequestOptionsBase | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { + return this.client.sendOperationRequest( + { + resourceGroupName, + name, + entityName, + slot, + options + }, + getRelayServiceConnectionSlotOperationSpec, + callback) as Promise; + } + + /** + * Creates a new hybrid connection configuration (PUT), or updates an existing one (PATCH). + * @summary Creates a new hybrid connection configuration (PUT), or updates an existing one + * (PATCH). + * @param resourceGroupName Name of the resource group to which the resource belongs. + * @param name Name of the app. + * @param entityName Name of the hybrid connection configuration. + * @param connectionEnvelope Details of the hybrid connection configuration. + * @param 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 [options] The optional parameters + * @returns Promise + */ + createOrUpdateRelayServiceConnectionSlot(resourceGroupName: string, name: string, entityName: string, connectionEnvelope: Models.RelayServiceConnectionEntity, slot: string, options?: msRest.RequestOptionsBase): Promise; + /** + * @param resourceGroupName Name of the resource group to which the resource belongs. + * @param name Name of the app. + * @param entityName Name of the hybrid connection configuration. + * @param connectionEnvelope Details of the hybrid connection configuration. + * @param 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 callback The callback + */ + createOrUpdateRelayServiceConnectionSlot(resourceGroupName: string, name: string, entityName: string, connectionEnvelope: Models.RelayServiceConnectionEntity, slot: string, callback: msRest.ServiceCallback): void; + /** + * @param resourceGroupName Name of the resource group to which the resource belongs. + * @param name Name of the app. + * @param entityName Name of the hybrid connection configuration. + * @param connectionEnvelope Details of the hybrid connection configuration. + * @param 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 options The optional parameters + * @param callback The callback + */ + createOrUpdateRelayServiceConnectionSlot(resourceGroupName: string, name: string, entityName: string, connectionEnvelope: Models.RelayServiceConnectionEntity, slot: string, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; + createOrUpdateRelayServiceConnectionSlot(resourceGroupName: string, name: string, entityName: string, connectionEnvelope: Models.RelayServiceConnectionEntity, slot: string, options?: msRest.RequestOptionsBase | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { + return this.client.sendOperationRequest( + { + resourceGroupName, + name, + entityName, + connectionEnvelope, + slot, + options + }, + createOrUpdateRelayServiceConnectionSlotOperationSpec, + callback) as Promise; + } + + /** + * Deletes a relay service connection by its name. + * @summary Deletes a relay service connection by its name. + * @param resourceGroupName Name of the resource group to which the resource belongs. + * @param name Name of the app. + * @param entityName Name of the hybrid connection configuration. + * @param slot Name of the deployment slot. If a slot is not specified, the API will delete a + * hybrid connection for the production slot. + * @param [options] The optional parameters + * @returns Promise + */ + deleteRelayServiceConnectionSlot(resourceGroupName: string, name: string, entityName: string, slot: string, options?: msRest.RequestOptionsBase): Promise; + /** + * @param resourceGroupName Name of the resource group to which the resource belongs. + * @param name Name of the app. + * @param entityName Name of the hybrid connection configuration. + * @param slot Name of the deployment slot. If a slot is not specified, the API will delete a + * hybrid connection for the production slot. + * @param callback The callback + */ + deleteRelayServiceConnectionSlot(resourceGroupName: string, name: string, entityName: string, slot: string, callback: msRest.ServiceCallback): void; + /** + * @param resourceGroupName Name of the resource group to which the resource belongs. + * @param name Name of the app. + * @param entityName Name of the hybrid connection configuration. + * @param slot Name of the deployment slot. If a slot is not specified, the API will delete a + * hybrid connection for the production slot. + * @param options The optional parameters + * @param callback The callback + */ + deleteRelayServiceConnectionSlot(resourceGroupName: string, name: string, entityName: string, slot: string, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; + deleteRelayServiceConnectionSlot(resourceGroupName: string, name: string, entityName: string, slot: string, options?: msRest.RequestOptionsBase | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { + return this.client.sendOperationRequest( + { + resourceGroupName, + name, + entityName, + slot, + options + }, + deleteRelayServiceConnectionSlotOperationSpec, + callback); + } + + /** + * Creates a new hybrid connection configuration (PUT), or updates an existing one (PATCH). + * @summary Creates a new hybrid connection configuration (PUT), or updates an existing one + * (PATCH). + * @param resourceGroupName Name of the resource group to which the resource belongs. + * @param name Name of the app. + * @param entityName Name of the hybrid connection configuration. + * @param connectionEnvelope Details of the hybrid connection configuration. + * @param 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 [options] The optional parameters + * @returns Promise + */ + updateRelayServiceConnectionSlot(resourceGroupName: string, name: string, entityName: string, connectionEnvelope: Models.RelayServiceConnectionEntity, slot: string, options?: msRest.RequestOptionsBase): Promise; + /** + * @param resourceGroupName Name of the resource group to which the resource belongs. + * @param name Name of the app. + * @param entityName Name of the hybrid connection configuration. + * @param connectionEnvelope Details of the hybrid connection configuration. + * @param 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 callback The callback + */ + updateRelayServiceConnectionSlot(resourceGroupName: string, name: string, entityName: string, connectionEnvelope: Models.RelayServiceConnectionEntity, slot: string, callback: msRest.ServiceCallback): void; + /** + * @param resourceGroupName Name of the resource group to which the resource belongs. + * @param name Name of the app. + * @param entityName Name of the hybrid connection configuration. + * @param connectionEnvelope Details of the hybrid connection configuration. + * @param 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 options The optional parameters + * @param callback The callback + */ + updateRelayServiceConnectionSlot(resourceGroupName: string, name: string, entityName: string, connectionEnvelope: Models.RelayServiceConnectionEntity, slot: string, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; + updateRelayServiceConnectionSlot(resourceGroupName: string, name: string, entityName: string, connectionEnvelope: Models.RelayServiceConnectionEntity, slot: string, options?: msRest.RequestOptionsBase | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { + return this.client.sendOperationRequest( + { + resourceGroupName, + name, + entityName, + connectionEnvelope, + slot, + options + }, + updateRelayServiceConnectionSlotOperationSpec, + callback) as Promise; + } + + /** + * Gets all scale-out instances of an app. + * @summary Gets all scale-out instances of an app. + * @param resourceGroupName Name of the resource group to which the resource belongs. + * @param name Name of the app. + * @param slot Name of the deployment slot. If a slot is not specified, the API gets the production + * slot instances. + * @param [options] The optional parameters + * @returns Promise + */ + listInstanceIdentifiersSlot(resourceGroupName: string, name: string, slot: string, options?: msRest.RequestOptionsBase): Promise; + /** + * @param resourceGroupName Name of the resource group to which the resource belongs. + * @param name Name of the app. + * @param slot Name of the deployment slot. If a slot is not specified, the API gets the production + * slot instances. + * @param callback The callback + */ + listInstanceIdentifiersSlot(resourceGroupName: string, name: string, slot: string, callback: msRest.ServiceCallback): void; + /** + * @param resourceGroupName Name of the resource group to which the resource belongs. + * @param name Name of the app. + * @param slot Name of the deployment slot. If a slot is not specified, the API gets the production + * slot instances. + * @param options The optional parameters + * @param callback The callback + */ + listInstanceIdentifiersSlot(resourceGroupName: string, name: string, slot: string, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; + listInstanceIdentifiersSlot(resourceGroupName: string, name: string, slot: string, options?: msRest.RequestOptionsBase | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { + return this.client.sendOperationRequest( + { + resourceGroupName, + name, + slot, + options + }, + listInstanceIdentifiersSlotOperationSpec, + callback) as Promise; + } + + /** + * Get the status of the last MSDeploy operation. + * @summary Get the status of the last MSDeploy operation. + * @param resourceGroupName Name of the resource group to which the resource belongs. + * @param name Name of web app. + * @param slot Name of web app slot. If not specified then will default to production slot. + * @param instanceId ID of web app instance. + * @param [options] The optional parameters + * @returns Promise + */ + getInstanceMsDeployStatusSlot(resourceGroupName: string, name: string, slot: string, instanceId: string, options?: msRest.RequestOptionsBase): Promise; + /** + * @param resourceGroupName Name of the resource group to which the resource belongs. + * @param name Name of web app. + * @param slot Name of web app slot. If not specified then will default to production slot. + * @param instanceId ID of web app instance. + * @param callback The callback + */ + getInstanceMsDeployStatusSlot(resourceGroupName: string, name: string, slot: string, instanceId: string, callback: msRest.ServiceCallback): void; + /** + * @param resourceGroupName Name of the resource group to which the resource belongs. + * @param name Name of web app. + * @param slot Name of web app slot. If not specified then will default to production slot. + * @param instanceId ID of web app instance. + * @param options The optional parameters + * @param callback The callback + */ + getInstanceMsDeployStatusSlot(resourceGroupName: string, name: string, slot: string, instanceId: string, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; + getInstanceMsDeployStatusSlot(resourceGroupName: string, name: string, slot: string, instanceId: string, options?: msRest.RequestOptionsBase | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { + return this.client.sendOperationRequest( + { + resourceGroupName, + name, + slot, + instanceId, + options + }, + getInstanceMsDeployStatusSlotOperationSpec, + callback) as Promise; + } + + /** + * Invoke the MSDeploy web app extension. + * @summary Invoke the MSDeploy web app extension. + * @param resourceGroupName Name of the resource group to which the resource belongs. + * @param name Name of web app. + * @param slot Name of web app slot. If not specified then will default to production slot. + * @param instanceId ID of web app instance. + * @param mSDeploy Details of MSDeploy operation + * @param [options] The optional parameters + * @returns Promise + */ + createInstanceMSDeployOperationSlot(resourceGroupName: string, name: string, slot: string, instanceId: string, mSDeploy: Models.MSDeploy, options?: msRest.RequestOptionsBase): Promise { + return this.beginCreateInstanceMSDeployOperationSlot(resourceGroupName,name,slot,instanceId,mSDeploy,options) + .then(lroPoller => lroPoller.pollUntilFinished()) as Promise; + } + + /** + * Get the MSDeploy Log for the last MSDeploy operation. + * @summary Get the MSDeploy Log for the last MSDeploy operation. + * @param resourceGroupName Name of the resource group to which the resource belongs. + * @param name Name of web app. + * @param slot Name of web app slot. If not specified then will default to production slot. + * @param instanceId ID of web app instance. + * @param [options] The optional parameters + * @returns Promise + */ + getInstanceMSDeployLogSlot(resourceGroupName: string, name: string, slot: string, instanceId: string, options?: msRest.RequestOptionsBase): Promise; + /** + * @param resourceGroupName Name of the resource group to which the resource belongs. + * @param name Name of web app. + * @param slot Name of web app slot. If not specified then will default to production slot. + * @param instanceId ID of web app instance. + * @param callback The callback + */ + getInstanceMSDeployLogSlot(resourceGroupName: string, name: string, slot: string, instanceId: string, callback: msRest.ServiceCallback): void; + /** + * @param resourceGroupName Name of the resource group to which the resource belongs. + * @param name Name of web app. + * @param slot Name of web app slot. If not specified then will default to production slot. + * @param instanceId ID of web app instance. + * @param options The optional parameters + * @param callback The callback + */ + getInstanceMSDeployLogSlot(resourceGroupName: string, name: string, slot: string, instanceId: string, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; + getInstanceMSDeployLogSlot(resourceGroupName: string, name: string, slot: string, instanceId: string, options?: msRest.RequestOptionsBase | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { + return this.client.sendOperationRequest( + { + resourceGroupName, + name, + slot, + instanceId, + options + }, + getInstanceMSDeployLogSlotOperationSpec, + callback) as Promise; + } + + /** + * 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 list of processes for a web site, or a deployment slot, or for a specific + * scaled-out instance in a web site. + * @param resourceGroupName Name of the resource group to which the resource belongs. + * @param name Site name. + * @param slot Name of the deployment slot. If a slot is not specified, the API returns deployments + * for the production slot. + * @param instanceId ID of a specific scaled-out instance. This is the value of the name property + * in the JSON response from "GET api/sites/{siteName}/instances". + * @param [options] The optional parameters + * @returns Promise + */ + listInstanceProcessesSlot(resourceGroupName: string, name: string, slot: string, instanceId: string, options?: msRest.RequestOptionsBase): Promise; + /** + * @param resourceGroupName Name of the resource group to which the resource belongs. + * @param name Site name. + * @param slot Name of the deployment slot. If a slot is not specified, the API returns deployments + * for the production slot. + * @param instanceId ID of a specific scaled-out instance. This is the value of the name property + * in the JSON response from "GET api/sites/{siteName}/instances". + * @param callback The callback + */ + listInstanceProcessesSlot(resourceGroupName: string, name: string, slot: string, instanceId: string, callback: msRest.ServiceCallback): void; + /** + * @param resourceGroupName Name of the resource group to which the resource belongs. + * @param name Site name. + * @param slot Name of the deployment slot. If a slot is not specified, the API returns deployments + * for the production slot. + * @param instanceId ID of a specific scaled-out instance. This is the value of the name property + * in the JSON response from "GET api/sites/{siteName}/instances". + * @param options The optional parameters + * @param callback The callback + */ + listInstanceProcessesSlot(resourceGroupName: string, name: string, slot: string, instanceId: string, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; + listInstanceProcessesSlot(resourceGroupName: string, name: string, slot: string, instanceId: string, options?: msRest.RequestOptionsBase | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { + return this.client.sendOperationRequest( + { + resourceGroupName, + name, + slot, + instanceId, + options + }, + listInstanceProcessesSlotOperationSpec, + callback) as Promise; + } + + /** + * Get process information by its ID 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. + * @param resourceGroupName Name of the resource group to which the resource belongs. + * @param name Site name. + * @param processId PID. + * @param slot Name of the deployment slot. If a slot is not specified, the API returns deployments + * for the production slot. + * @param instanceId ID of a specific scaled-out instance. This is the value of the name property + * in the JSON response from "GET api/sites/{siteName}/instances". + * @param [options] The optional parameters + * @returns Promise + */ + getInstanceProcessSlot(resourceGroupName: string, name: string, processId: string, slot: string, instanceId: string, options?: msRest.RequestOptionsBase): Promise; + /** + * @param resourceGroupName Name of the resource group to which the resource belongs. + * @param name Site name. + * @param processId PID. + * @param slot Name of the deployment slot. If a slot is not specified, the API returns deployments + * for the production slot. + * @param instanceId ID of a specific scaled-out instance. This is the value of the name property + * in the JSON response from "GET api/sites/{siteName}/instances". + * @param callback The callback + */ + getInstanceProcessSlot(resourceGroupName: string, name: string, processId: string, slot: string, instanceId: string, callback: msRest.ServiceCallback): void; + /** + * @param resourceGroupName Name of the resource group to which the resource belongs. + * @param name Site name. + * @param processId PID. + * @param slot Name of the deployment slot. If a slot is not specified, the API returns deployments + * for the production slot. + * @param instanceId ID of a specific scaled-out instance. This is the value of the name property + * in the JSON response from "GET api/sites/{siteName}/instances". + * @param options The optional parameters + * @param callback The callback + */ + getInstanceProcessSlot(resourceGroupName: string, name: string, processId: string, slot: string, instanceId: string, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; + getInstanceProcessSlot(resourceGroupName: string, name: string, processId: string, slot: string, instanceId: string, options?: msRest.RequestOptionsBase | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { + return this.client.sendOperationRequest( + { + resourceGroupName, + name, + processId, + slot, + instanceId, + options + }, + getInstanceProcessSlotOperationSpec, + callback) as Promise; + } + + /** + * Terminate a process by its ID for a web site, or a deployment slot, or 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. + * @param resourceGroupName Name of the resource group to which the resource belongs. + * @param name Site name. + * @param processId PID. + * @param slot Name of the deployment slot. If a slot is not specified, the API returns deployments + * for the production slot. + * @param instanceId ID of a specific scaled-out instance. This is the value of the name property + * in the JSON response from "GET api/sites/{siteName}/instances". + * @param [options] The optional parameters + * @returns Promise + */ + deleteInstanceProcessSlot(resourceGroupName: string, name: string, processId: string, slot: string, instanceId: string, options?: msRest.RequestOptionsBase): Promise; + /** + * @param resourceGroupName Name of the resource group to which the resource belongs. + * @param name Site name. + * @param processId PID. + * @param slot Name of the deployment slot. If a slot is not specified, the API returns deployments + * for the production slot. + * @param instanceId ID of a specific scaled-out instance. This is the value of the name property + * in the JSON response from "GET api/sites/{siteName}/instances". + * @param callback The callback + */ + deleteInstanceProcessSlot(resourceGroupName: string, name: string, processId: string, slot: string, instanceId: string, callback: msRest.ServiceCallback): void; + /** + * @param resourceGroupName Name of the resource group to which the resource belongs. + * @param name Site name. + * @param processId PID. + * @param slot Name of the deployment slot. If a slot is not specified, the API returns deployments + * for the production slot. + * @param instanceId ID of a specific scaled-out instance. This is the value of the name property + * in the JSON response from "GET api/sites/{siteName}/instances". + * @param options The optional parameters + * @param callback The callback + */ + deleteInstanceProcessSlot(resourceGroupName: string, name: string, processId: string, slot: string, instanceId: string, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; + deleteInstanceProcessSlot(resourceGroupName: string, name: string, processId: string, slot: string, instanceId: string, options?: msRest.RequestOptionsBase | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { + return this.client.sendOperationRequest( + { + resourceGroupName, + name, + processId, + slot, + instanceId, + options + }, + deleteInstanceProcessSlotOperationSpec, + callback); + } + + /** + * Get a memory dump of a process by its ID 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. + * @param resourceGroupName Name of the resource group to which the resource belongs. + * @param name Site name. + * @param processId PID. + * @param slot Name of the deployment slot. If a slot is not specified, the API returns deployments + * for the production slot. + * @param instanceId ID of a specific scaled-out instance. This is the value of the name property + * in the JSON response from "GET api/sites/{siteName}/instances". + * @param [options] The optional parameters + * @returns Promise + */ + getInstanceProcessDumpSlot(resourceGroupName: string, name: string, processId: string, slot: string, instanceId: string, options?: msRest.RequestOptionsBase): Promise; + /** + * @param resourceGroupName Name of the resource group to which the resource belongs. + * @param name Site name. + * @param processId PID. + * @param slot Name of the deployment slot. If a slot is not specified, the API returns deployments + * for the production slot. + * @param instanceId ID of a specific scaled-out instance. This is the value of the name property + * in the JSON response from "GET api/sites/{siteName}/instances". + * @param callback The callback + */ + getInstanceProcessDumpSlot(resourceGroupName: string, name: string, processId: string, slot: string, instanceId: string, callback: msRest.ServiceCallback): void; + /** + * @param resourceGroupName Name of the resource group to which the resource belongs. + * @param name Site name. + * @param processId PID. + * @param slot Name of the deployment slot. If a slot is not specified, the API returns deployments + * for the production slot. + * @param instanceId ID of a specific scaled-out instance. This is the value of the name property + * in the JSON response from "GET api/sites/{siteName}/instances". + * @param options The optional parameters + * @param callback The callback + */ + getInstanceProcessDumpSlot(resourceGroupName: string, name: string, processId: string, slot: string, instanceId: string, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; + getInstanceProcessDumpSlot(resourceGroupName: string, name: string, processId: string, slot: string, instanceId: string, options?: msRest.RequestOptionsBase | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { + return this.client.sendOperationRequest( + { + resourceGroupName, + name, + processId, + slot, + instanceId, + options + }, + getInstanceProcessDumpSlotOperationSpec, + callback) as Promise; + } + + /** + * List module information for a process 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. + * @param resourceGroupName Name of the resource group to which the resource belongs. + * @param name Site name. + * @param processId PID. + * @param slot Name of the deployment slot. If a slot is not specified, the API returns deployments + * for the production slot. + * @param instanceId ID of a specific scaled-out instance. This is the value of the name property + * in the JSON response from "GET api/sites/{siteName}/instances". + * @param [options] The optional parameters + * @returns Promise + */ + listInstanceProcessModulesSlot(resourceGroupName: string, name: string, processId: string, slot: string, instanceId: string, options?: msRest.RequestOptionsBase): Promise; + /** + * @param resourceGroupName Name of the resource group to which the resource belongs. + * @param name Site name. + * @param processId PID. + * @param slot Name of the deployment slot. If a slot is not specified, the API returns deployments + * for the production slot. + * @param instanceId ID of a specific scaled-out instance. This is the value of the name property + * in the JSON response from "GET api/sites/{siteName}/instances". + * @param callback The callback + */ + listInstanceProcessModulesSlot(resourceGroupName: string, name: string, processId: string, slot: string, instanceId: string, callback: msRest.ServiceCallback): void; + /** + * @param resourceGroupName Name of the resource group to which the resource belongs. + * @param name Site name. + * @param processId PID. + * @param slot Name of the deployment slot. If a slot is not specified, the API returns deployments + * for the production slot. + * @param instanceId ID of a specific scaled-out instance. This is the value of the name property + * in the JSON response from "GET api/sites/{siteName}/instances". + * @param options The optional parameters + * @param callback The callback + */ + listInstanceProcessModulesSlot(resourceGroupName: string, name: string, processId: string, slot: string, instanceId: string, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; + listInstanceProcessModulesSlot(resourceGroupName: string, name: string, processId: string, slot: string, instanceId: string, options?: msRest.RequestOptionsBase | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { + return this.client.sendOperationRequest( + { + resourceGroupName, + name, + processId, + slot, + instanceId, + options + }, + listInstanceProcessModulesSlotOperationSpec, + callback) as Promise; + } + + /** + * Get process information by its ID 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. + * @param resourceGroupName Name of the resource group to which the resource belongs. + * @param name Site name. + * @param processId PID. + * @param baseAddress Module base address. + * @param slot Name of the deployment slot. If a slot is not specified, the API returns deployments + * for the production slot. + * @param instanceId ID of a specific scaled-out instance. This is the value of the name property + * in the JSON response from "GET api/sites/{siteName}/instances". + * @param [options] The optional parameters + * @returns Promise + */ + getInstanceProcessModuleSlot(resourceGroupName: string, name: string, processId: string, baseAddress: string, slot: string, instanceId: string, options?: msRest.RequestOptionsBase): Promise; + /** + * @param resourceGroupName Name of the resource group to which the resource belongs. + * @param name Site name. + * @param processId PID. + * @param baseAddress Module base address. + * @param slot Name of the deployment slot. If a slot is not specified, the API returns deployments + * for the production slot. + * @param instanceId ID of a specific scaled-out instance. This is the value of the name property + * in the JSON response from "GET api/sites/{siteName}/instances". + * @param callback The callback + */ + getInstanceProcessModuleSlot(resourceGroupName: string, name: string, processId: string, baseAddress: string, slot: string, instanceId: string, callback: msRest.ServiceCallback): void; + /** + * @param resourceGroupName Name of the resource group to which the resource belongs. + * @param name Site name. + * @param processId PID. + * @param baseAddress Module base address. + * @param slot Name of the deployment slot. If a slot is not specified, the API returns deployments + * for the production slot. + * @param instanceId ID of a specific scaled-out instance. This is the value of the name property + * in the JSON response from "GET api/sites/{siteName}/instances". + * @param options The optional parameters + * @param callback The callback + */ + getInstanceProcessModuleSlot(resourceGroupName: string, name: string, processId: string, baseAddress: string, slot: string, instanceId: string, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; + getInstanceProcessModuleSlot(resourceGroupName: string, name: string, processId: string, baseAddress: string, slot: string, instanceId: string, options?: msRest.RequestOptionsBase | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { + return this.client.sendOperationRequest( + { + resourceGroupName, + name, + processId, + baseAddress, + slot, + instanceId, + options + }, + getInstanceProcessModuleSlotOperationSpec, + callback) as Promise; + } + + /** + * List the threads in a process by its ID 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. + * @param resourceGroupName Name of the resource group to which the resource belongs. + * @param name Site name. + * @param processId PID. + * @param slot Name of the deployment slot. If a slot is not specified, the API returns deployments + * for the production slot. + * @param instanceId ID of a specific scaled-out instance. This is the value of the name property + * in the JSON response from "GET api/sites/{siteName}/instances". + * @param [options] The optional parameters + * @returns Promise + */ + listInstanceProcessThreadsSlot(resourceGroupName: string, name: string, processId: string, slot: string, instanceId: string, options?: msRest.RequestOptionsBase): Promise; + /** + * @param resourceGroupName Name of the resource group to which the resource belongs. + * @param name Site name. + * @param processId PID. + * @param slot Name of the deployment slot. If a slot is not specified, the API returns deployments + * for the production slot. + * @param instanceId ID of a specific scaled-out instance. This is the value of the name property + * in the JSON response from "GET api/sites/{siteName}/instances". + * @param callback The callback + */ + listInstanceProcessThreadsSlot(resourceGroupName: string, name: string, processId: string, slot: string, instanceId: string, callback: msRest.ServiceCallback): void; + /** + * @param resourceGroupName Name of the resource group to which the resource belongs. + * @param name Site name. + * @param processId PID. + * @param slot Name of the deployment slot. If a slot is not specified, the API returns deployments + * for the production slot. + * @param instanceId ID of a specific scaled-out instance. This is the value of the name property + * in the JSON response from "GET api/sites/{siteName}/instances". + * @param options The optional parameters + * @param callback The callback + */ + listInstanceProcessThreadsSlot(resourceGroupName: string, name: string, processId: string, slot: string, instanceId: string, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; + listInstanceProcessThreadsSlot(resourceGroupName: string, name: string, processId: string, slot: string, instanceId: string, options?: msRest.RequestOptionsBase | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { + return this.client.sendOperationRequest( + { + resourceGroupName, + name, + processId, + slot, + instanceId, + options + }, + listInstanceProcessThreadsSlotOperationSpec, + callback) as Promise; + } + + /** + * Get thread information by Thread ID for a specific process, in 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. + * @param resourceGroupName Name of the resource group to which the resource belongs. + * @param name Site name. + * @param processId PID. + * @param threadId TID. + * @param slot Name of the deployment slot. If a slot is not specified, the API returns deployments + * for the production slot. + * @param instanceId ID of a specific scaled-out instance. This is the value of the name property + * in the JSON response from "GET api/sites/{siteName}/instances". + * @param [options] The optional parameters + * @returns Promise + */ + getInstanceProcessThreadSlot(resourceGroupName: string, name: string, processId: string, threadId: string, slot: string, instanceId: string, options?: msRest.RequestOptionsBase): Promise; + /** + * @param resourceGroupName Name of the resource group to which the resource belongs. + * @param name Site name. + * @param processId PID. + * @param threadId TID. + * @param slot Name of the deployment slot. If a slot is not specified, the API returns deployments + * for the production slot. + * @param instanceId ID of a specific scaled-out instance. This is the value of the name property + * in the JSON response from "GET api/sites/{siteName}/instances". + * @param callback The callback + */ + getInstanceProcessThreadSlot(resourceGroupName: string, name: string, processId: string, threadId: string, slot: string, instanceId: string, callback: msRest.ServiceCallback): void; + /** + * @param resourceGroupName Name of the resource group to which the resource belongs. + * @param name Site name. + * @param processId PID. + * @param threadId TID. + * @param slot Name of the deployment slot. If a slot is not specified, the API returns deployments + * for the production slot. + * @param instanceId ID of a specific scaled-out instance. This is the value of the name property + * in the JSON response from "GET api/sites/{siteName}/instances". + * @param options The optional parameters + * @param callback The callback + */ + getInstanceProcessThreadSlot(resourceGroupName: string, name: string, processId: string, threadId: string, slot: string, instanceId: string, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; + getInstanceProcessThreadSlot(resourceGroupName: string, name: string, processId: string, threadId: string, slot: string, instanceId: string, options?: msRest.RequestOptionsBase | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { + return this.client.sendOperationRequest( + { + resourceGroupName, + name, + processId, + threadId, + slot, + instanceId, + options + }, + getInstanceProcessThreadSlotOperationSpec, + callback) as Promise; + } + + /** + * Shows whether an app can be cloned to another resource group or subscription. + * @summary Shows whether an app can be cloned to another resource group or subscription. + * @param resourceGroupName Name of the resource group to which the resource belongs. + * @param name Name of the app. + * @param slot Name of the deployment slot. By default, this API returns information on the + * production slot. + * @param [options] The optional parameters + * @returns Promise + */ + isCloneableSlot(resourceGroupName: string, name: string, slot: string, options?: msRest.RequestOptionsBase): Promise; + /** + * @param resourceGroupName Name of the resource group to which the resource belongs. + * @param name Name of the app. + * @param slot Name of the deployment slot. By default, this API returns information on the + * production slot. + * @param callback The callback + */ + isCloneableSlot(resourceGroupName: string, name: string, slot: string, callback: msRest.ServiceCallback): void; + /** + * @param resourceGroupName Name of the resource group to which the resource belongs. + * @param name Name of the app. + * @param slot Name of the deployment slot. By default, this API returns information on the + * production slot. + * @param options The optional parameters + * @param callback The callback + */ + isCloneableSlot(resourceGroupName: string, name: string, slot: string, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; + isCloneableSlot(resourceGroupName: string, name: string, slot: string, options?: msRest.RequestOptionsBase | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { + return this.client.sendOperationRequest( + { + resourceGroupName, + name, + slot, + options + }, + isCloneableSlotOperationSpec, + callback) as Promise; + } + + /** + * This is to allow calling via powershell and ARM template. + * @summary This is to allow calling via powershell and ARM template. + * @param resourceGroupName Name of the resource group to which the resource belongs. + * @param name Name of the app. + * @param slot Name of the deployment slot. If a slot is not specified, the API will restore a + * backup of the production slot. + * @param [options] The optional parameters + * @returns Promise + */ + listSyncFunctionTriggersSlot(resourceGroupName: string, name: string, slot: string, options?: msRest.RequestOptionsBase): Promise; + /** + * @param resourceGroupName Name of the resource group to which the resource belongs. + * @param name Name of the app. + * @param slot Name of the deployment slot. If a slot is not specified, the API will restore a + * backup of the production slot. + * @param callback The callback + */ + listSyncFunctionTriggersSlot(resourceGroupName: string, name: string, slot: string, callback: msRest.ServiceCallback): void; + /** + * @param resourceGroupName Name of the resource group to which the resource belongs. + * @param name Name of the app. + * @param slot Name of the deployment slot. If a slot is not specified, the API will restore a + * backup of the production slot. + * @param options The optional parameters + * @param callback The callback + */ + listSyncFunctionTriggersSlot(resourceGroupName: string, name: string, slot: string, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; + listSyncFunctionTriggersSlot(resourceGroupName: string, name: string, slot: string, options?: msRest.RequestOptionsBase | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { + return this.client.sendOperationRequest( + { + resourceGroupName, + name, + slot, + options + }, + listSyncFunctionTriggersSlotOperationSpec, + callback) as Promise; + } + + /** + * Gets all metric definitions of an app (or deployment slot, if specified). + * @summary Gets all metric definitions of an app (or deployment slot, if specified). + * @param resourceGroupName Name of the resource group to which the resource belongs. + * @param name Name of the app. + * @param slot Name of the deployment slot. If a slot is not specified, the API will get metric + * definitions of the production slot. + * @param [options] The optional parameters + * @returns Promise + */ + listMetricDefinitionsSlot(resourceGroupName: string, name: string, slot: string, options?: msRest.RequestOptionsBase): Promise; + /** + * @param resourceGroupName Name of the resource group to which the resource belongs. + * @param name Name of the app. + * @param slot Name of the deployment slot. If a slot is not specified, the API will get metric + * definitions of the production slot. + * @param callback The callback + */ + listMetricDefinitionsSlot(resourceGroupName: string, name: string, slot: string, callback: msRest.ServiceCallback): void; + /** + * @param resourceGroupName Name of the resource group to which the resource belongs. + * @param name Name of the app. + * @param slot Name of the deployment slot. If a slot is not specified, the API will get metric + * definitions of the production slot. + * @param options The optional parameters + * @param callback The callback + */ + listMetricDefinitionsSlot(resourceGroupName: string, name: string, slot: string, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; + listMetricDefinitionsSlot(resourceGroupName: string, name: string, slot: string, options?: msRest.RequestOptionsBase | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { + return this.client.sendOperationRequest( + { + resourceGroupName, + name, + slot, + options + }, + listMetricDefinitionsSlotOperationSpec, + callback) as Promise; + } + + /** + * Gets performance metrics of an app (or deployment slot, if specified). + * @summary Gets performance metrics of an app (or deployment slot, if specified). + * @param resourceGroupName Name of the resource group to which the resource belongs. + * @param name Name of the app. + * @param slot Name of the deployment slot. If a slot is not specified, the API will get metrics of + * the production slot. + * @param [options] The optional parameters + * @returns Promise + */ + listMetricsSlot(resourceGroupName: string, name: string, slot: string, options?: Models.WebAppsListMetricsSlotOptionalParams): Promise; + /** + * @param resourceGroupName Name of the resource group to which the resource belongs. + * @param name Name of the app. + * @param slot Name of the deployment slot. If a slot is not specified, the API will get metrics of + * the production slot. + * @param callback The callback + */ + listMetricsSlot(resourceGroupName: string, name: string, slot: string, callback: msRest.ServiceCallback): void; + /** + * @param resourceGroupName Name of the resource group to which the resource belongs. + * @param name Name of the app. + * @param slot Name of the deployment slot. If a slot is not specified, the API will get metrics of + * the production slot. + * @param options The optional parameters + * @param callback The callback + */ + listMetricsSlot(resourceGroupName: string, name: string, slot: string, options: Models.WebAppsListMetricsSlotOptionalParams, callback: msRest.ServiceCallback): void; + listMetricsSlot(resourceGroupName: string, name: string, slot: string, options?: Models.WebAppsListMetricsSlotOptionalParams | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { + return this.client.sendOperationRequest( + { + resourceGroupName, + name, + slot, + options + }, + listMetricsSlotOperationSpec, + callback) as Promise; + } + + /** + * Returns the status of MySql in app migration, if one is active, and whether or not MySql in app + * is enabled + * @summary Returns the status of MySql in app migration, if one is active, and whether or not + * MySql in app is enabled + * @param resourceGroupName Name of the resource group to which the resource belongs. + * @param name Name of web app. + * @param slot Name of the deployment slot. + * @param [options] The optional parameters + * @returns Promise + */ + getMigrateMySqlStatusSlot(resourceGroupName: string, name: string, slot: string, options?: msRest.RequestOptionsBase): Promise; + /** + * @param resourceGroupName Name of the resource group to which the resource belongs. + * @param name Name of web app. + * @param slot Name of the deployment slot. + * @param callback The callback + */ + getMigrateMySqlStatusSlot(resourceGroupName: string, name: string, slot: string, callback: msRest.ServiceCallback): void; + /** + * @param resourceGroupName Name of the resource group to which the resource belongs. + * @param name Name of web app. + * @param slot Name of the deployment slot. + * @param options The optional parameters + * @param callback The callback + */ + getMigrateMySqlStatusSlot(resourceGroupName: string, name: string, slot: string, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; + getMigrateMySqlStatusSlot(resourceGroupName: string, name: string, slot: string, options?: msRest.RequestOptionsBase | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { + return this.client.sendOperationRequest( + { + resourceGroupName, + name, + slot, + options + }, + getMigrateMySqlStatusSlotOperationSpec, + callback) as Promise; + } + + /** + * Gets a Swift Virtual Network connection. + * @summary Gets a Swift Virtual Network connection. + * @param resourceGroupName Name of the resource group to which the resource belongs. + * @param name Name of the app. + * @param 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 [options] The optional parameters + * @returns Promise + */ + getSwiftVirtualNetworkConnectionSlot(resourceGroupName: string, name: string, slot: string, options?: msRest.RequestOptionsBase): Promise; + /** + * @param resourceGroupName Name of the resource group to which the resource belongs. + * @param name Name of the app. + * @param 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 callback The callback + */ + getSwiftVirtualNetworkConnectionSlot(resourceGroupName: string, name: string, slot: string, callback: msRest.ServiceCallback): void; + /** + * @param resourceGroupName Name of the resource group to which the resource belongs. + * @param name Name of the app. + * @param 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 options The optional parameters + * @param callback The callback + */ + getSwiftVirtualNetworkConnectionSlot(resourceGroupName: string, name: string, slot: string, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; + getSwiftVirtualNetworkConnectionSlot(resourceGroupName: string, name: string, slot: string, options?: msRest.RequestOptionsBase | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { + return this.client.sendOperationRequest( + { + resourceGroupName, + name, + slot, + options + }, + getSwiftVirtualNetworkConnectionSlotOperationSpec, + callback) as Promise; + } + + /** + * 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. + * @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. + * @param resourceGroupName Name of the resource group to which the resource belongs. + * @param name Name of the app. + * @param connectionEnvelope Properties of the Virtual Network connection. See example. + * @param slot Name of the deployment slot. If a slot is not specified, the API will add or update + * connections for the production slot. + * @param [options] The optional parameters + * @returns Promise + */ + createOrUpdateSwiftVirtualNetworkConnectionSlot(resourceGroupName: string, name: string, connectionEnvelope: Models.SwiftVirtualNetwork, slot: string, options?: msRest.RequestOptionsBase): Promise; + /** + * @param resourceGroupName Name of the resource group to which the resource belongs. + * @param name Name of the app. + * @param connectionEnvelope Properties of the Virtual Network connection. See example. + * @param slot Name of the deployment slot. If a slot is not specified, the API will add or update + * connections for the production slot. + * @param callback The callback + */ + createOrUpdateSwiftVirtualNetworkConnectionSlot(resourceGroupName: string, name: string, connectionEnvelope: Models.SwiftVirtualNetwork, slot: string, callback: msRest.ServiceCallback): void; + /** + * @param resourceGroupName Name of the resource group to which the resource belongs. + * @param name Name of the app. + * @param connectionEnvelope Properties of the Virtual Network connection. See example. + * @param slot Name of the deployment slot. If a slot is not specified, the API will add or update + * connections for the production slot. + * @param options The optional parameters + * @param callback The callback + */ + createOrUpdateSwiftVirtualNetworkConnectionSlot(resourceGroupName: string, name: string, connectionEnvelope: Models.SwiftVirtualNetwork, slot: string, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; + createOrUpdateSwiftVirtualNetworkConnectionSlot(resourceGroupName: string, name: string, connectionEnvelope: Models.SwiftVirtualNetwork, slot: string, options?: msRest.RequestOptionsBase | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { + return this.client.sendOperationRequest( + { + resourceGroupName, + name, + connectionEnvelope, + slot, + options + }, + createOrUpdateSwiftVirtualNetworkConnectionSlotOperationSpec, + callback) as Promise; + } + + /** + * Deletes a Swift Virtual Network connection from an app (or deployment slot). + * @summary Deletes a Swift Virtual Network connection from an app (or deployment slot). + * @param resourceGroupName Name of the resource group to which the resource belongs. + * @param name Name of the app. + * @param slot Name of the deployment slot. If a slot is not specified, the API will delete the + * connection for the production slot. + * @param [options] The optional parameters + * @returns Promise + */ + deleteSwiftVirtualNetworkSlot(resourceGroupName: string, name: string, slot: string, options?: msRest.RequestOptionsBase): Promise; + /** + * @param resourceGroupName Name of the resource group to which the resource belongs. + * @param name Name of the app. + * @param slot Name of the deployment slot. If a slot is not specified, the API will delete the + * connection for the production slot. + * @param callback The callback + */ + deleteSwiftVirtualNetworkSlot(resourceGroupName: string, name: string, slot: string, callback: msRest.ServiceCallback): void; + /** + * @param resourceGroupName Name of the resource group to which the resource belongs. + * @param name Name of the app. + * @param slot Name of the deployment slot. If a slot is not specified, the API will delete the + * connection for the production slot. + * @param options The optional parameters + * @param callback The callback + */ + deleteSwiftVirtualNetworkSlot(resourceGroupName: string, name: string, slot: string, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; + deleteSwiftVirtualNetworkSlot(resourceGroupName: string, name: string, slot: string, options?: msRest.RequestOptionsBase | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { + return this.client.sendOperationRequest( + { + resourceGroupName, + name, + slot, + options + }, + deleteSwiftVirtualNetworkSlotOperationSpec, + callback); + } + + /** + * 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. + * @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. + * @param resourceGroupName Name of the resource group to which the resource belongs. + * @param name Name of the app. + * @param connectionEnvelope Properties of the Virtual Network connection. See example. + * @param slot Name of the deployment slot. If a slot is not specified, the API will add or update + * connections for the production slot. + * @param [options] The optional parameters + * @returns Promise + */ + updateSwiftVirtualNetworkConnectionSlot(resourceGroupName: string, name: string, connectionEnvelope: Models.SwiftVirtualNetwork, slot: string, options?: msRest.RequestOptionsBase): Promise; + /** + * @param resourceGroupName Name of the resource group to which the resource belongs. + * @param name Name of the app. + * @param connectionEnvelope Properties of the Virtual Network connection. See example. + * @param slot Name of the deployment slot. If a slot is not specified, the API will add or update + * connections for the production slot. + * @param callback The callback + */ + updateSwiftVirtualNetworkConnectionSlot(resourceGroupName: string, name: string, connectionEnvelope: Models.SwiftVirtualNetwork, slot: string, callback: msRest.ServiceCallback): void; + /** + * @param resourceGroupName Name of the resource group to which the resource belongs. + * @param name Name of the app. + * @param connectionEnvelope Properties of the Virtual Network connection. See example. + * @param slot Name of the deployment slot. If a slot is not specified, the API will add or update + * connections for the production slot. + * @param options The optional parameters + * @param callback The callback + */ + updateSwiftVirtualNetworkConnectionSlot(resourceGroupName: string, name: string, connectionEnvelope: Models.SwiftVirtualNetwork, slot: string, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; + updateSwiftVirtualNetworkConnectionSlot(resourceGroupName: string, name: string, connectionEnvelope: Models.SwiftVirtualNetwork, slot: string, options?: msRest.RequestOptionsBase | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { + return this.client.sendOperationRequest( + { + resourceGroupName, + name, + connectionEnvelope, + slot, + options + }, + updateSwiftVirtualNetworkConnectionSlotOperationSpec, + callback) as Promise; + } + + /** + * Gets all network features used by the app (or deployment slot, if specified). + * @summary Gets all network features used by the app (or deployment slot, if specified). + * @param resourceGroupName Name of the resource group to which the resource belongs. + * @param name Name of the app. + * @param view The type of view. This can either be "summary" or "detailed". + * @param slot Name of the deployment slot. If a slot is not specified, the API will get network + * features for the production slot. + * @param [options] The optional parameters + * @returns Promise + */ + listNetworkFeaturesSlot(resourceGroupName: string, name: string, view: string, slot: string, options?: msRest.RequestOptionsBase): Promise; + /** + * @param resourceGroupName Name of the resource group to which the resource belongs. + * @param name Name of the app. + * @param view The type of view. This can either be "summary" or "detailed". + * @param slot Name of the deployment slot. If a slot is not specified, the API will get network + * features for the production slot. + * @param callback The callback + */ + listNetworkFeaturesSlot(resourceGroupName: string, name: string, view: string, slot: string, callback: msRest.ServiceCallback): void; + /** + * @param resourceGroupName Name of the resource group to which the resource belongs. + * @param name Name of the app. + * @param view The type of view. This can either be "summary" or "detailed". + * @param slot Name of the deployment slot. If a slot is not specified, the API will get network + * features for the production slot. + * @param options The optional parameters + * @param callback The callback + */ + listNetworkFeaturesSlot(resourceGroupName: string, name: string, view: string, slot: string, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; + listNetworkFeaturesSlot(resourceGroupName: string, name: string, view: string, slot: string, options?: msRest.RequestOptionsBase | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { + return this.client.sendOperationRequest( + { + resourceGroupName, + name, + view, + slot, + options + }, + listNetworkFeaturesSlotOperationSpec, + callback) as Promise; + } + + /** + * Gets a named operation for a network trace capturing (or deployment slot, if specified). + * @summary Gets a named operation for a network trace capturing (or deployment slot, if + * specified). + * @param resourceGroupName Name of the resource group to which the resource belongs. + * @param name Name of the app. + * @param operationId GUID of the operation. + * @param slot Name of the deployment slot. If a slot is not specified, the API will get an + * operation for the production slot. + * @param [options] The optional parameters + * @returns Promise + */ + getNetworkTraceOperationSlot(resourceGroupName: string, name: string, operationId: string, slot: string, options?: msRest.RequestOptionsBase): Promise; + /** + * @param resourceGroupName Name of the resource group to which the resource belongs. + * @param name Name of the app. + * @param operationId GUID of the operation. + * @param slot Name of the deployment slot. If a slot is not specified, the API will get an + * operation for the production slot. + * @param callback The callback + */ + getNetworkTraceOperationSlot(resourceGroupName: string, name: string, operationId: string, slot: string, callback: msRest.ServiceCallback): void; + /** + * @param resourceGroupName Name of the resource group to which the resource belongs. + * @param name Name of the app. + * @param operationId GUID of the operation. + * @param slot Name of the deployment slot. If a slot is not specified, the API will get an + * operation for the production slot. + * @param options The optional parameters + * @param callback The callback + */ + getNetworkTraceOperationSlot(resourceGroupName: string, name: string, operationId: string, slot: string, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; + getNetworkTraceOperationSlot(resourceGroupName: string, name: string, operationId: string, slot: string, options?: msRest.RequestOptionsBase | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { + return this.client.sendOperationRequest( + { + resourceGroupName, + name, + operationId, + slot, + options + }, + getNetworkTraceOperationSlotOperationSpec, + callback) as Promise; + } + + /** + * Start capturing network packets for the site (To be deprecated). + * @summary Start capturing network packets for the site (To be deprecated). + * @param resourceGroupName Name of the resource group to which the resource belongs. + * @param name The name of the web app. + * @param slot The name of the slot for this web app. + * @param [options] The optional parameters + * @returns Promise + */ + startWebSiteNetworkTraceSlot(resourceGroupName: string, name: string, slot: string, options?: Models.WebAppsStartWebSiteNetworkTraceSlotOptionalParams): Promise; + /** + * @param resourceGroupName Name of the resource group to which the resource belongs. + * @param name The name of the web app. + * @param slot The name of the slot for this web app. + * @param callback The callback + */ + startWebSiteNetworkTraceSlot(resourceGroupName: string, name: string, slot: string, callback: msRest.ServiceCallback): void; + /** + * @param resourceGroupName Name of the resource group to which the resource belongs. + * @param name The name of the web app. + * @param slot The name of the slot for this web app. + * @param options The optional parameters + * @param callback The callback + */ + startWebSiteNetworkTraceSlot(resourceGroupName: string, name: string, slot: string, options: Models.WebAppsStartWebSiteNetworkTraceSlotOptionalParams, callback: msRest.ServiceCallback): void; + startWebSiteNetworkTraceSlot(resourceGroupName: string, name: string, slot: string, options?: Models.WebAppsStartWebSiteNetworkTraceSlotOptionalParams | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { + return this.client.sendOperationRequest( + { + resourceGroupName, + name, + slot, + options + }, + startWebSiteNetworkTraceSlotOperationSpec, + callback) as Promise; + } + + /** + * Start capturing network packets for the site. + * @summary Start capturing network packets for the site. + * @param resourceGroupName Name of the resource group to which the resource belongs. + * @param name The name of the web app. + * @param slot The name of the slot for this web app. + * @param [options] The optional parameters + * @returns Promise + */ + startWebSiteNetworkTraceOperationSlot(resourceGroupName: string, name: string, slot: string, options?: Models.WebAppsStartWebSiteNetworkTraceOperationSlotOptionalParams): Promise { + return this.beginStartWebSiteNetworkTraceOperationSlot(resourceGroupName,name,slot,options) + .then(lroPoller => lroPoller.pollUntilFinished()) as Promise; + } + + /** + * Stop ongoing capturing network packets for the site. + * @summary Stop ongoing capturing network packets for the site. + * @param resourceGroupName Name of the resource group to which the resource belongs. + * @param name The name of the web app. + * @param slot The name of the slot for this web app. + * @param [options] The optional parameters + * @returns Promise + */ + stopWebSiteNetworkTraceSlot(resourceGroupName: string, name: string, slot: string, options?: msRest.RequestOptionsBase): Promise; + /** + * @param resourceGroupName Name of the resource group to which the resource belongs. + * @param name The name of the web app. + * @param slot The name of the slot for this web app. + * @param callback The callback + */ + stopWebSiteNetworkTraceSlot(resourceGroupName: string, name: string, slot: string, callback: msRest.ServiceCallback): void; + /** + * @param resourceGroupName Name of the resource group to which the resource belongs. + * @param name The name of the web app. + * @param slot The name of the slot for this web app. + * @param options The optional parameters + * @param callback The callback + */ + stopWebSiteNetworkTraceSlot(resourceGroupName: string, name: string, slot: string, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; + stopWebSiteNetworkTraceSlot(resourceGroupName: string, name: string, slot: string, options?: msRest.RequestOptionsBase | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { + return this.client.sendOperationRequest( + { + resourceGroupName, + name, + slot, + options + }, + stopWebSiteNetworkTraceSlotOperationSpec, + callback); + } + + /** + * Gets a named operation for a network trace capturing (or deployment slot, if specified). + * @summary Gets a named operation for a network trace capturing (or deployment slot, if + * specified). + * @param resourceGroupName Name of the resource group to which the resource belongs. + * @param name Name of the app. + * @param operationId GUID of the operation. + * @param slot Name of the deployment slot. If a slot is not specified, the API will get an + * operation for the production slot. + * @param [options] The optional parameters + * @returns Promise + */ + getNetworkTracesSlot(resourceGroupName: string, name: string, operationId: string, slot: string, options?: msRest.RequestOptionsBase): Promise; + /** + * @param resourceGroupName Name of the resource group to which the resource belongs. + * @param name Name of the app. + * @param operationId GUID of the operation. + * @param slot Name of the deployment slot. If a slot is not specified, the API will get an + * operation for the production slot. + * @param callback The callback + */ + getNetworkTracesSlot(resourceGroupName: string, name: string, operationId: string, slot: string, callback: msRest.ServiceCallback): void; + /** + * @param resourceGroupName Name of the resource group to which the resource belongs. + * @param name Name of the app. + * @param operationId GUID of the operation. + * @param slot Name of the deployment slot. If a slot is not specified, the API will get an + * operation for the production slot. + * @param options The optional parameters + * @param callback The callback + */ + getNetworkTracesSlot(resourceGroupName: string, name: string, operationId: string, slot: string, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; + getNetworkTracesSlot(resourceGroupName: string, name: string, operationId: string, slot: string, options?: msRest.RequestOptionsBase | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { + return this.client.sendOperationRequest( + { + resourceGroupName, + name, + operationId, + slot, + options + }, + getNetworkTracesSlotOperationSpec, + callback) as Promise; + } + + /** + * Gets a named operation for a network trace capturing (or deployment slot, if specified). + * @summary Gets a named operation for a network trace capturing (or deployment slot, if + * specified). + * @param resourceGroupName Name of the resource group to which the resource belongs. + * @param name Name of the app. + * @param operationId GUID of the operation. + * @param slot Name of the deployment slot. If a slot is not specified, the API will get an + * operation for the production slot. + * @param [options] The optional parameters + * @returns Promise + */ + getNetworkTraceOperationSlotV2(resourceGroupName: string, name: string, operationId: string, slot: string, options?: msRest.RequestOptionsBase): Promise; + /** + * @param resourceGroupName Name of the resource group to which the resource belongs. + * @param name Name of the app. + * @param operationId GUID of the operation. + * @param slot Name of the deployment slot. If a slot is not specified, the API will get an + * operation for the production slot. + * @param callback The callback + */ + getNetworkTraceOperationSlotV2(resourceGroupName: string, name: string, operationId: string, slot: string, callback: msRest.ServiceCallback): void; + /** + * @param resourceGroupName Name of the resource group to which the resource belongs. + * @param name Name of the app. + * @param operationId GUID of the operation. + * @param slot Name of the deployment slot. If a slot is not specified, the API will get an + * operation for the production slot. + * @param options The optional parameters + * @param callback The callback + */ + getNetworkTraceOperationSlotV2(resourceGroupName: string, name: string, operationId: string, slot: string, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; + getNetworkTraceOperationSlotV2(resourceGroupName: string, name: string, operationId: string, slot: string, options?: msRest.RequestOptionsBase | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { + return this.client.sendOperationRequest( + { + resourceGroupName, + name, + operationId, + slot, + options + }, + getNetworkTraceOperationSlotV2OperationSpec, + callback) as Promise; + } + + /** + * Gets a named operation for a network trace capturing (or deployment slot, if specified). + * @summary Gets a named operation for a network trace capturing (or deployment slot, if + * specified). + * @param resourceGroupName Name of the resource group to which the resource belongs. + * @param name Name of the app. + * @param operationId GUID of the operation. + * @param slot Name of the deployment slot. If a slot is not specified, the API will get an + * operation for the production slot. + * @param [options] The optional parameters + * @returns Promise + */ + getNetworkTracesSlotV2(resourceGroupName: string, name: string, operationId: string, slot: string, options?: msRest.RequestOptionsBase): Promise; + /** + * @param resourceGroupName Name of the resource group to which the resource belongs. + * @param name Name of the app. + * @param operationId GUID of the operation. + * @param slot Name of the deployment slot. If a slot is not specified, the API will get an + * operation for the production slot. + * @param callback The callback + */ + getNetworkTracesSlotV2(resourceGroupName: string, name: string, operationId: string, slot: string, callback: msRest.ServiceCallback): void; + /** + * @param resourceGroupName Name of the resource group to which the resource belongs. + * @param name Name of the app. + * @param operationId GUID of the operation. + * @param slot Name of the deployment slot. If a slot is not specified, the API will get an + * operation for the production slot. + * @param options The optional parameters + * @param callback The callback + */ + getNetworkTracesSlotV2(resourceGroupName: string, name: string, operationId: string, slot: string, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; + getNetworkTracesSlotV2(resourceGroupName: string, name: string, operationId: string, slot: string, options?: msRest.RequestOptionsBase | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { + return this.client.sendOperationRequest( + { + resourceGroupName, + name, + operationId, + slot, + options + }, + getNetworkTracesSlotV2OperationSpec, + callback) as Promise; + } + + /** + * Generates a new publishing password for an app (or deployment slot, if specified). + * @summary Generates a new publishing password for an app (or deployment slot, if specified). + * @param resourceGroupName Name of the resource group to which the resource belongs. + * @param name Name of the app. + * @param slot Name of the deployment slot. If a slot is not specified, the API generate a new + * publishing password for the production slot. + * @param [options] The optional parameters + * @returns Promise + */ + generateNewSitePublishingPasswordSlot(resourceGroupName: string, name: string, slot: string, options?: msRest.RequestOptionsBase): Promise; + /** + * @param resourceGroupName Name of the resource group to which the resource belongs. + * @param name Name of the app. + * @param slot Name of the deployment slot. If a slot is not specified, the API generate a new + * publishing password for the production slot. + * @param callback The callback + */ + generateNewSitePublishingPasswordSlot(resourceGroupName: string, name: string, slot: string, callback: msRest.ServiceCallback): void; + /** + * @param resourceGroupName Name of the resource group to which the resource belongs. + * @param name Name of the app. + * @param slot Name of the deployment slot. If a slot is not specified, the API generate a new + * publishing password for the production slot. + * @param options The optional parameters + * @param callback The callback + */ + generateNewSitePublishingPasswordSlot(resourceGroupName: string, name: string, slot: string, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; + generateNewSitePublishingPasswordSlot(resourceGroupName: string, name: string, slot: string, options?: msRest.RequestOptionsBase | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { + return this.client.sendOperationRequest( + { + resourceGroupName, + name, + slot, + options + }, + generateNewSitePublishingPasswordSlotOperationSpec, + callback); + } + + /** + * Gets perfmon counters for web app. + * @summary Gets perfmon counters for web app. + * @param resourceGroupName Name of the resource group to which the resource belongs. + * @param name Name of web app. + * @param slot Name of web app slot. If not specified then will default to production slot. + * @param [options] The optional parameters + * @returns Promise + */ + listPerfMonCountersSlot(resourceGroupName: string, name: string, slot: string, options?: Models.WebAppsListPerfMonCountersSlotOptionalParams): Promise; + /** + * @param resourceGroupName Name of the resource group to which the resource belongs. + * @param name Name of web app. + * @param slot Name of web app slot. If not specified then will default to production slot. + * @param callback The callback + */ + listPerfMonCountersSlot(resourceGroupName: string, name: string, slot: string, callback: msRest.ServiceCallback): void; + /** + * @param resourceGroupName Name of the resource group to which the resource belongs. + * @param name Name of web app. + * @param slot Name of web app slot. If not specified then will default to production slot. + * @param options The optional parameters + * @param callback The callback + */ + listPerfMonCountersSlot(resourceGroupName: string, name: string, slot: string, options: Models.WebAppsListPerfMonCountersSlotOptionalParams, callback: msRest.ServiceCallback): void; + listPerfMonCountersSlot(resourceGroupName: string, name: string, slot: string, options?: Models.WebAppsListPerfMonCountersSlotOptionalParams | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { + return this.client.sendOperationRequest( + { + resourceGroupName, + name, + slot, + options + }, + listPerfMonCountersSlotOperationSpec, + callback) as Promise; + } + + /** + * Gets web app's event logs. + * @summary Gets web app's event logs. + * @param resourceGroupName Name of the resource group to which the resource belongs. + * @param name Name of web app. + * @param slot Name of web app slot. If not specified then will default to production slot. + * @param [options] The optional parameters + * @returns Promise + */ + getSitePhpErrorLogFlagSlot(resourceGroupName: string, name: string, slot: string, options?: msRest.RequestOptionsBase): Promise; + /** + * @param resourceGroupName Name of the resource group to which the resource belongs. + * @param name Name of web app. + * @param slot Name of web app slot. If not specified then will default to production slot. + * @param callback The callback + */ + getSitePhpErrorLogFlagSlot(resourceGroupName: string, name: string, slot: string, callback: msRest.ServiceCallback): void; + /** + * @param resourceGroupName Name of the resource group to which the resource belongs. + * @param name Name of web app. + * @param slot Name of web app slot. If not specified then will default to production slot. + * @param options The optional parameters + * @param callback The callback + */ + getSitePhpErrorLogFlagSlot(resourceGroupName: string, name: string, slot: string, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; + getSitePhpErrorLogFlagSlot(resourceGroupName: string, name: string, slot: string, options?: msRest.RequestOptionsBase | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { + return this.client.sendOperationRequest( + { + resourceGroupName, + name, + slot, + options + }, + getSitePhpErrorLogFlagSlotOperationSpec, + callback) as Promise; + } + + /** + * Gets the premier add-ons of an app. + * @summary Gets the premier add-ons of an app. + * @param resourceGroupName Name of the resource group to which the resource belongs. + * @param name Name of the app. + * @param 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 [options] The optional parameters + * @returns Promise + */ + listPremierAddOnsSlot(resourceGroupName: string, name: string, slot: string, options?: msRest.RequestOptionsBase): Promise; + /** + * @param resourceGroupName Name of the resource group to which the resource belongs. + * @param name Name of the app. + * @param 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 callback The callback + */ + listPremierAddOnsSlot(resourceGroupName: string, name: string, slot: string, callback: msRest.ServiceCallback): void; + /** + * @param resourceGroupName Name of the resource group to which the resource belongs. + * @param name Name of the app. + * @param 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 options The optional parameters + * @param callback The callback + */ + listPremierAddOnsSlot(resourceGroupName: string, name: string, slot: string, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; + listPremierAddOnsSlot(resourceGroupName: string, name: string, slot: string, options?: msRest.RequestOptionsBase | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { + return this.client.sendOperationRequest( + { + resourceGroupName, + name, + slot, + options + }, + listPremierAddOnsSlotOperationSpec, + callback) as Promise; + } + + /** + * Gets a named add-on of an app. + * @summary Gets a named add-on of an app. + * @param resourceGroupName Name of the resource group to which the resource belongs. + * @param name Name of the app. + * @param premierAddOnName Add-on name. + * @param 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 [options] The optional parameters + * @returns Promise + */ + getPremierAddOnSlot(resourceGroupName: string, name: string, premierAddOnName: string, slot: string, options?: msRest.RequestOptionsBase): Promise; + /** + * @param resourceGroupName Name of the resource group to which the resource belongs. + * @param name Name of the app. + * @param premierAddOnName Add-on name. + * @param 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 callback The callback + */ + getPremierAddOnSlot(resourceGroupName: string, name: string, premierAddOnName: string, slot: string, callback: msRest.ServiceCallback): void; + /** + * @param resourceGroupName Name of the resource group to which the resource belongs. + * @param name Name of the app. + * @param premierAddOnName Add-on name. + * @param 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 options The optional parameters + * @param callback The callback + */ + getPremierAddOnSlot(resourceGroupName: string, name: string, premierAddOnName: string, slot: string, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; + getPremierAddOnSlot(resourceGroupName: string, name: string, premierAddOnName: string, slot: string, options?: msRest.RequestOptionsBase | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { + return this.client.sendOperationRequest( + { + resourceGroupName, + name, + premierAddOnName, + slot, + options + }, + getPremierAddOnSlotOperationSpec, + callback) as Promise; + } + + /** + * Updates a named add-on of an app. + * @summary Updates a named add-on of an app. + * @param resourceGroupName Name of the resource group to which the resource belongs. + * @param name Name of the app. + * @param premierAddOnName Add-on name. + * @param premierAddOn A JSON representation of the edited premier add-on. + * @param 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 [options] The optional parameters + * @returns Promise + */ + addPremierAddOnSlot(resourceGroupName: string, name: string, premierAddOnName: string, premierAddOn: Models.PremierAddOn, slot: string, options?: msRest.RequestOptionsBase): Promise; + /** + * @param resourceGroupName Name of the resource group to which the resource belongs. + * @param name Name of the app. + * @param premierAddOnName Add-on name. + * @param premierAddOn A JSON representation of the edited premier add-on. + * @param 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 callback The callback + */ + addPremierAddOnSlot(resourceGroupName: string, name: string, premierAddOnName: string, premierAddOn: Models.PremierAddOn, slot: string, callback: msRest.ServiceCallback): void; + /** + * @param resourceGroupName Name of the resource group to which the resource belongs. + * @param name Name of the app. + * @param premierAddOnName Add-on name. + * @param premierAddOn A JSON representation of the edited premier add-on. + * @param 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 options The optional parameters + * @param callback The callback + */ + addPremierAddOnSlot(resourceGroupName: string, name: string, premierAddOnName: string, premierAddOn: Models.PremierAddOn, slot: string, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; + addPremierAddOnSlot(resourceGroupName: string, name: string, premierAddOnName: string, premierAddOn: Models.PremierAddOn, slot: string, options?: msRest.RequestOptionsBase | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { + return this.client.sendOperationRequest( + { + resourceGroupName, + name, + premierAddOnName, + premierAddOn, + slot, + options + }, + addPremierAddOnSlotOperationSpec, + callback) as Promise; + } + + /** + * Delete a premier add-on from an app. + * @summary Delete a premier add-on from an app. + * @param resourceGroupName Name of the resource group to which the resource belongs. + * @param name Name of the app. + * @param premierAddOnName Add-on name. + * @param 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 [options] The optional parameters + * @returns Promise + */ + deletePremierAddOnSlot(resourceGroupName: string, name: string, premierAddOnName: string, slot: string, options?: msRest.RequestOptionsBase): Promise; + /** + * @param resourceGroupName Name of the resource group to which the resource belongs. + * @param name Name of the app. + * @param premierAddOnName Add-on name. + * @param 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 callback The callback + */ + deletePremierAddOnSlot(resourceGroupName: string, name: string, premierAddOnName: string, slot: string, callback: msRest.ServiceCallback): void; + /** + * @param resourceGroupName Name of the resource group to which the resource belongs. + * @param name Name of the app. + * @param premierAddOnName Add-on name. + * @param 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 options The optional parameters + * @param callback The callback + */ + deletePremierAddOnSlot(resourceGroupName: string, name: string, premierAddOnName: string, slot: string, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; + deletePremierAddOnSlot(resourceGroupName: string, name: string, premierAddOnName: string, slot: string, options?: msRest.RequestOptionsBase | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { + return this.client.sendOperationRequest( + { + resourceGroupName, + name, + premierAddOnName, + slot, + options + }, + deletePremierAddOnSlotOperationSpec, + callback); + } + + /** + * Updates a named add-on of an app. + * @summary Updates a named add-on of an app. + * @param resourceGroupName Name of the resource group to which the resource belongs. + * @param name Name of the app. + * @param premierAddOnName Add-on name. + * @param premierAddOn A JSON representation of the edited premier add-on. + * @param 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 [options] The optional parameters + * @returns Promise + */ + updatePremierAddOnSlot(resourceGroupName: string, name: string, premierAddOnName: string, premierAddOn: Models.PremierAddOnPatchResource, slot: string, options?: msRest.RequestOptionsBase): Promise; + /** + * @param resourceGroupName Name of the resource group to which the resource belongs. + * @param name Name of the app. + * @param premierAddOnName Add-on name. + * @param premierAddOn A JSON representation of the edited premier add-on. + * @param 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 callback The callback + */ + updatePremierAddOnSlot(resourceGroupName: string, name: string, premierAddOnName: string, premierAddOn: Models.PremierAddOnPatchResource, slot: string, callback: msRest.ServiceCallback): void; + /** + * @param resourceGroupName Name of the resource group to which the resource belongs. + * @param name Name of the app. + * @param premierAddOnName Add-on name. + * @param premierAddOn A JSON representation of the edited premier add-on. + * @param 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 options The optional parameters + * @param callback The callback + */ + updatePremierAddOnSlot(resourceGroupName: string, name: string, premierAddOnName: string, premierAddOn: Models.PremierAddOnPatchResource, slot: string, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; + updatePremierAddOnSlot(resourceGroupName: string, name: string, premierAddOnName: string, premierAddOn: Models.PremierAddOnPatchResource, slot: string, options?: msRest.RequestOptionsBase | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { + return this.client.sendOperationRequest( + { + resourceGroupName, + name, + premierAddOnName, + premierAddOn, + slot, + options + }, + updatePremierAddOnSlotOperationSpec, + callback) as Promise; + } + + /** + * Gets data around private site access enablement and authorized Virtual Networks that can access + * the site. + * @summary Gets data around private site access enablement and authorized Virtual Networks that + * can access the site. + * @param resourceGroupName Name of the resource group to which the resource belongs. + * @param name The name of the web app. + * @param slot The name of the slot for the web app. + * @param [options] The optional parameters + * @returns Promise + */ + getPrivateAccessSlot(resourceGroupName: string, name: string, slot: string, options?: msRest.RequestOptionsBase): Promise; + /** + * @param resourceGroupName Name of the resource group to which the resource belongs. + * @param name The name of the web app. + * @param slot The name of the slot for the web app. + * @param callback The callback + */ + getPrivateAccessSlot(resourceGroupName: string, name: string, slot: string, callback: msRest.ServiceCallback): void; + /** + * @param resourceGroupName Name of the resource group to which the resource belongs. + * @param name The name of the web app. + * @param slot The name of the slot for the web app. + * @param options The optional parameters + * @param callback The callback + */ + getPrivateAccessSlot(resourceGroupName: string, name: string, slot: string, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; + getPrivateAccessSlot(resourceGroupName: string, name: string, slot: string, options?: msRest.RequestOptionsBase | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { + return this.client.sendOperationRequest( + { + resourceGroupName, + name, + slot, + options + }, + getPrivateAccessSlotOperationSpec, + callback) as Promise; + } + + /** + * Sets data around private site access enablement and authorized Virtual Networks that can access + * the site. + * @summary Sets data around private site access enablement and authorized Virtual Networks that + * can access the site. + * @param resourceGroupName Name of the resource group to which the resource belongs. + * @param name The name of the web app. + * @param access The information for the private access + * @param slot The name of the slot for the web app. + * @param [options] The optional parameters + * @returns Promise + */ + putPrivateAccessVnetSlot(resourceGroupName: string, name: string, access: Models.PrivateAccess, slot: string, options?: msRest.RequestOptionsBase): Promise; + /** + * @param resourceGroupName Name of the resource group to which the resource belongs. + * @param name The name of the web app. + * @param access The information for the private access + * @param slot The name of the slot for the web app. + * @param callback The callback + */ + putPrivateAccessVnetSlot(resourceGroupName: string, name: string, access: Models.PrivateAccess, slot: string, callback: msRest.ServiceCallback): void; + /** + * @param resourceGroupName Name of the resource group to which the resource belongs. + * @param name The name of the web app. + * @param access The information for the private access + * @param slot The name of the slot for the web app. + * @param options The optional parameters + * @param callback The callback + */ + putPrivateAccessVnetSlot(resourceGroupName: string, name: string, access: Models.PrivateAccess, slot: string, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; + putPrivateAccessVnetSlot(resourceGroupName: string, name: string, access: Models.PrivateAccess, slot: string, options?: msRest.RequestOptionsBase | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { + return this.client.sendOperationRequest( + { + resourceGroupName, + name, + access, + slot, + options + }, + putPrivateAccessVnetSlotOperationSpec, + callback) as Promise; + } + + /** + * 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 list of processes for a web site, or a deployment slot, or for a specific + * scaled-out instance in a web site. + * @param resourceGroupName Name of the resource group to which the resource belongs. + * @param name Site name. + * @param slot Name of the deployment slot. If a slot is not specified, the API returns deployments + * for the production slot. + * @param [options] The optional parameters + * @returns Promise + */ + listProcessesSlot(resourceGroupName: string, name: string, slot: string, options?: msRest.RequestOptionsBase): Promise; + /** + * @param resourceGroupName Name of the resource group to which the resource belongs. + * @param name Site name. + * @param slot Name of the deployment slot. If a slot is not specified, the API returns deployments + * for the production slot. + * @param callback The callback + */ + listProcessesSlot(resourceGroupName: string, name: string, slot: string, callback: msRest.ServiceCallback): void; + /** + * @param resourceGroupName Name of the resource group to which the resource belongs. + * @param name Site name. + * @param slot Name of the deployment slot. If a slot is not specified, the API returns deployments + * for the production slot. + * @param options The optional parameters + * @param callback The callback + */ + listProcessesSlot(resourceGroupName: string, name: string, slot: string, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; + listProcessesSlot(resourceGroupName: string, name: string, slot: string, options?: msRest.RequestOptionsBase | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { + return this.client.sendOperationRequest( + { + resourceGroupName, + name, + slot, + options + }, + listProcessesSlotOperationSpec, + callback) as Promise; + } + + /** + * Get process information by its ID 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. + * @param resourceGroupName Name of the resource group to which the resource belongs. + * @param name Site name. + * @param processId PID. + * @param slot Name of the deployment slot. If a slot is not specified, the API returns deployments + * for the production slot. + * @param [options] The optional parameters + * @returns Promise + */ + getProcessSlot(resourceGroupName: string, name: string, processId: string, slot: string, options?: msRest.RequestOptionsBase): Promise; + /** + * @param resourceGroupName Name of the resource group to which the resource belongs. + * @param name Site name. + * @param processId PID. + * @param slot Name of the deployment slot. If a slot is not specified, the API returns deployments + * for the production slot. + * @param callback The callback + */ + getProcessSlot(resourceGroupName: string, name: string, processId: string, slot: string, callback: msRest.ServiceCallback): void; + /** + * @param resourceGroupName Name of the resource group to which the resource belongs. + * @param name Site name. + * @param processId PID. + * @param slot Name of the deployment slot. If a slot is not specified, the API returns deployments + * for the production slot. + * @param options The optional parameters + * @param callback The callback + */ + getProcessSlot(resourceGroupName: string, name: string, processId: string, slot: string, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; + getProcessSlot(resourceGroupName: string, name: string, processId: string, slot: string, options?: msRest.RequestOptionsBase | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { + return this.client.sendOperationRequest( + { + resourceGroupName, + name, + processId, + slot, + options + }, + getProcessSlotOperationSpec, + callback) as Promise; + } + + /** + * Terminate a process by its ID for a web site, or a deployment slot, or 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. + * @param resourceGroupName Name of the resource group to which the resource belongs. + * @param name Site name. + * @param processId PID. + * @param slot Name of the deployment slot. If a slot is not specified, the API returns deployments + * for the production slot. + * @param [options] The optional parameters + * @returns Promise + */ + deleteProcessSlot(resourceGroupName: string, name: string, processId: string, slot: string, options?: msRest.RequestOptionsBase): Promise; + /** + * @param resourceGroupName Name of the resource group to which the resource belongs. + * @param name Site name. + * @param processId PID. + * @param slot Name of the deployment slot. If a slot is not specified, the API returns deployments + * for the production slot. + * @param callback The callback + */ + deleteProcessSlot(resourceGroupName: string, name: string, processId: string, slot: string, callback: msRest.ServiceCallback): void; + /** + * @param resourceGroupName Name of the resource group to which the resource belongs. + * @param name Site name. + * @param processId PID. + * @param slot Name of the deployment slot. If a slot is not specified, the API returns deployments + * for the production slot. + * @param options The optional parameters + * @param callback The callback + */ + deleteProcessSlot(resourceGroupName: string, name: string, processId: string, slot: string, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; + deleteProcessSlot(resourceGroupName: string, name: string, processId: string, slot: string, options?: msRest.RequestOptionsBase | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { + return this.client.sendOperationRequest( + { + resourceGroupName, + name, + processId, + slot, + options + }, + deleteProcessSlotOperationSpec, + callback); + } + + /** + * Get a memory dump of a process by its ID 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. + * @param resourceGroupName Name of the resource group to which the resource belongs. + * @param name Site name. + * @param processId PID. + * @param slot Name of the deployment slot. If a slot is not specified, the API returns deployments + * for the production slot. + * @param [options] The optional parameters + * @returns Promise + */ + getProcessDumpSlot(resourceGroupName: string, name: string, processId: string, slot: string, options?: msRest.RequestOptionsBase): Promise; + /** + * @param resourceGroupName Name of the resource group to which the resource belongs. + * @param name Site name. + * @param processId PID. + * @param slot Name of the deployment slot. If a slot is not specified, the API returns deployments + * for the production slot. + * @param callback The callback + */ + getProcessDumpSlot(resourceGroupName: string, name: string, processId: string, slot: string, callback: msRest.ServiceCallback): void; + /** + * @param resourceGroupName Name of the resource group to which the resource belongs. + * @param name Site name. + * @param processId PID. + * @param slot Name of the deployment slot. If a slot is not specified, the API returns deployments + * for the production slot. + * @param options The optional parameters + * @param callback The callback + */ + getProcessDumpSlot(resourceGroupName: string, name: string, processId: string, slot: string, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; + getProcessDumpSlot(resourceGroupName: string, name: string, processId: string, slot: string, options?: msRest.RequestOptionsBase | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { + return this.client.sendOperationRequest( + { + resourceGroupName, + name, + processId, + slot, + options + }, + getProcessDumpSlotOperationSpec, + callback) as Promise; + } + + /** + * List module information for a process 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. + * @param resourceGroupName Name of the resource group to which the resource belongs. + * @param name Site name. + * @param processId PID. + * @param slot Name of the deployment slot. If a slot is not specified, the API returns deployments + * for the production slot. + * @param [options] The optional parameters + * @returns Promise + */ + listProcessModulesSlot(resourceGroupName: string, name: string, processId: string, slot: string, options?: msRest.RequestOptionsBase): Promise; + /** + * @param resourceGroupName Name of the resource group to which the resource belongs. + * @param name Site name. + * @param processId PID. + * @param slot Name of the deployment slot. If a slot is not specified, the API returns deployments + * for the production slot. + * @param callback The callback + */ + listProcessModulesSlot(resourceGroupName: string, name: string, processId: string, slot: string, callback: msRest.ServiceCallback): void; + /** + * @param resourceGroupName Name of the resource group to which the resource belongs. + * @param name Site name. + * @param processId PID. + * @param slot Name of the deployment slot. If a slot is not specified, the API returns deployments + * for the production slot. + * @param options The optional parameters + * @param callback The callback + */ + listProcessModulesSlot(resourceGroupName: string, name: string, processId: string, slot: string, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; + listProcessModulesSlot(resourceGroupName: string, name: string, processId: string, slot: string, options?: msRest.RequestOptionsBase | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { + return this.client.sendOperationRequest( + { + resourceGroupName, + name, + processId, + slot, + options + }, + listProcessModulesSlotOperationSpec, + callback) as Promise; + } + + /** + * Get process information by its ID 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. + * @param resourceGroupName Name of the resource group to which the resource belongs. + * @param name Site name. + * @param processId PID. + * @param baseAddress Module base address. + * @param slot Name of the deployment slot. If a slot is not specified, the API returns deployments + * for the production slot. + * @param [options] The optional parameters + * @returns Promise + */ + getProcessModuleSlot(resourceGroupName: string, name: string, processId: string, baseAddress: string, slot: string, options?: msRest.RequestOptionsBase): Promise; + /** + * @param resourceGroupName Name of the resource group to which the resource belongs. + * @param name Site name. + * @param processId PID. + * @param baseAddress Module base address. + * @param slot Name of the deployment slot. If a slot is not specified, the API returns deployments + * for the production slot. + * @param callback The callback + */ + getProcessModuleSlot(resourceGroupName: string, name: string, processId: string, baseAddress: string, slot: string, callback: msRest.ServiceCallback): void; + /** + * @param resourceGroupName Name of the resource group to which the resource belongs. + * @param name Site name. + * @param processId PID. + * @param baseAddress Module base address. + * @param slot Name of the deployment slot. If a slot is not specified, the API returns deployments + * for the production slot. + * @param options The optional parameters + * @param callback The callback + */ + getProcessModuleSlot(resourceGroupName: string, name: string, processId: string, baseAddress: string, slot: string, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; + getProcessModuleSlot(resourceGroupName: string, name: string, processId: string, baseAddress: string, slot: string, options?: msRest.RequestOptionsBase | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { + return this.client.sendOperationRequest( + { + resourceGroupName, + name, + processId, + baseAddress, + slot, + options + }, + getProcessModuleSlotOperationSpec, + callback) as Promise; + } + + /** + * List the threads in a process by its ID 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. + * @param resourceGroupName Name of the resource group to which the resource belongs. + * @param name Site name. + * @param processId PID. + * @param slot Name of the deployment slot. If a slot is not specified, the API returns deployments + * for the production slot. + * @param [options] The optional parameters + * @returns Promise + */ + listProcessThreadsSlot(resourceGroupName: string, name: string, processId: string, slot: string, options?: msRest.RequestOptionsBase): Promise; + /** + * @param resourceGroupName Name of the resource group to which the resource belongs. + * @param name Site name. + * @param processId PID. + * @param slot Name of the deployment slot. If a slot is not specified, the API returns deployments + * for the production slot. + * @param callback The callback + */ + listProcessThreadsSlot(resourceGroupName: string, name: string, processId: string, slot: string, callback: msRest.ServiceCallback): void; + /** + * @param resourceGroupName Name of the resource group to which the resource belongs. + * @param name Site name. + * @param processId PID. + * @param slot Name of the deployment slot. If a slot is not specified, the API returns deployments + * for the production slot. + * @param options The optional parameters + * @param callback The callback + */ + listProcessThreadsSlot(resourceGroupName: string, name: string, processId: string, slot: string, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; + listProcessThreadsSlot(resourceGroupName: string, name: string, processId: string, slot: string, options?: msRest.RequestOptionsBase | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { + return this.client.sendOperationRequest( + { + resourceGroupName, + name, + processId, + slot, + options + }, + listProcessThreadsSlotOperationSpec, + callback) as Promise; + } + + /** + * Get thread information by Thread ID for a specific process, in 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. + * @param resourceGroupName Name of the resource group to which the resource belongs. + * @param name Site name. + * @param processId PID. + * @param threadId TID. + * @param slot Name of the deployment slot. If a slot is not specified, the API returns deployments + * for the production slot. + * @param [options] The optional parameters + * @returns Promise + */ + getProcessThreadSlot(resourceGroupName: string, name: string, processId: string, threadId: string, slot: string, options?: msRest.RequestOptionsBase): Promise; + /** + * @param resourceGroupName Name of the resource group to which the resource belongs. + * @param name Site name. + * @param processId PID. + * @param threadId TID. + * @param slot Name of the deployment slot. If a slot is not specified, the API returns deployments + * for the production slot. + * @param callback The callback + */ + getProcessThreadSlot(resourceGroupName: string, name: string, processId: string, threadId: string, slot: string, callback: msRest.ServiceCallback): void; + /** + * @param resourceGroupName Name of the resource group to which the resource belongs. + * @param name Site name. + * @param processId PID. + * @param threadId TID. + * @param slot Name of the deployment slot. If a slot is not specified, the API returns deployments + * for the production slot. + * @param options The optional parameters + * @param callback The callback + */ + getProcessThreadSlot(resourceGroupName: string, name: string, processId: string, threadId: string, slot: string, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; + getProcessThreadSlot(resourceGroupName: string, name: string, processId: string, threadId: string, slot: string, options?: msRest.RequestOptionsBase | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { + return this.client.sendOperationRequest( + { + resourceGroupName, + name, + processId, + threadId, + slot, + options + }, + getProcessThreadSlotOperationSpec, + callback) as Promise; + } + + /** + * Get public certificates for an app or a deployment slot. + * @summary Get public certificates for an app or a deployment slot. + * @param resourceGroupName Name of the resource group to which the resource belongs. + * @param name Name of the app. + * @param slot Name of the deployment slot. If a slot is not specified, the API gets hostname + * bindings for the production slot. + * @param [options] The optional parameters + * @returns Promise + */ + listPublicCertificatesSlot(resourceGroupName: string, name: string, slot: string, options?: msRest.RequestOptionsBase): Promise; + /** + * @param resourceGroupName Name of the resource group to which the resource belongs. + * @param name Name of the app. + * @param slot Name of the deployment slot. If a slot is not specified, the API gets hostname + * bindings for the production slot. + * @param callback The callback + */ + listPublicCertificatesSlot(resourceGroupName: string, name: string, slot: string, callback: msRest.ServiceCallback): void; + /** + * @param resourceGroupName Name of the resource group to which the resource belongs. + * @param name Name of the app. + * @param slot Name of the deployment slot. If a slot is not specified, the API gets hostname + * bindings for the production slot. + * @param options The optional parameters + * @param callback The callback + */ + listPublicCertificatesSlot(resourceGroupName: string, name: string, slot: string, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; + listPublicCertificatesSlot(resourceGroupName: string, name: string, slot: string, options?: msRest.RequestOptionsBase | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { + return this.client.sendOperationRequest( + { + resourceGroupName, + name, + slot, + options + }, + listPublicCertificatesSlotOperationSpec, + callback) as Promise; + } + + /** + * Get the named public certificate for an app (or deployment slot, if specified). + * @summary Get the named public certificate for an app (or deployment slot, if specified). + * @param resourceGroupName Name of the resource group to which the resource belongs. + * @param name Name of the app. + * @param slot Name of the deployment slot. If a slot is not specified, the API the named binding + * for the production slot. + * @param publicCertificateName Public certificate name. + * @param [options] The optional parameters + * @returns Promise + */ + getPublicCertificateSlot(resourceGroupName: string, name: string, slot: string, publicCertificateName: string, options?: msRest.RequestOptionsBase): Promise; + /** + * @param resourceGroupName Name of the resource group to which the resource belongs. + * @param name Name of the app. + * @param slot Name of the deployment slot. If a slot is not specified, the API the named binding + * for the production slot. + * @param publicCertificateName Public certificate name. + * @param callback The callback + */ + getPublicCertificateSlot(resourceGroupName: string, name: string, slot: string, publicCertificateName: string, callback: msRest.ServiceCallback): void; + /** + * @param resourceGroupName Name of the resource group to which the resource belongs. + * @param name Name of the app. + * @param slot Name of the deployment slot. If a slot is not specified, the API the named binding + * for the production slot. + * @param publicCertificateName Public certificate name. + * @param options The optional parameters + * @param callback The callback + */ + getPublicCertificateSlot(resourceGroupName: string, name: string, slot: string, publicCertificateName: string, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; + getPublicCertificateSlot(resourceGroupName: string, name: string, slot: string, publicCertificateName: string, options?: msRest.RequestOptionsBase | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { + return this.client.sendOperationRequest( + { + resourceGroupName, + name, + slot, + publicCertificateName, + options + }, + getPublicCertificateSlotOperationSpec, + callback) as Promise; + } + + /** + * Creates a hostname binding for an app. + * @summary Creates a hostname binding for an app. + * @param resourceGroupName Name of the resource group to which the resource belongs. + * @param name Name of the app. + * @param publicCertificateName Public certificate name. + * @param publicCertificate Public certificate details. This is the JSON representation of a + * PublicCertificate object. + * @param slot Name of the deployment slot. If a slot is not specified, the API will create a + * binding for the production slot. + * @param [options] The optional parameters + * @returns Promise + */ + createOrUpdatePublicCertificateSlot(resourceGroupName: string, name: string, publicCertificateName: string, publicCertificate: Models.PublicCertificate, slot: string, options?: msRest.RequestOptionsBase): Promise; + /** + * @param resourceGroupName Name of the resource group to which the resource belongs. + * @param name Name of the app. + * @param publicCertificateName Public certificate name. + * @param publicCertificate Public certificate details. This is the JSON representation of a + * PublicCertificate object. + * @param slot Name of the deployment slot. If a slot is not specified, the API will create a + * binding for the production slot. + * @param callback The callback + */ + createOrUpdatePublicCertificateSlot(resourceGroupName: string, name: string, publicCertificateName: string, publicCertificate: Models.PublicCertificate, slot: string, callback: msRest.ServiceCallback): void; + /** + * @param resourceGroupName Name of the resource group to which the resource belongs. + * @param name Name of the app. + * @param publicCertificateName Public certificate name. + * @param publicCertificate Public certificate details. This is the JSON representation of a + * PublicCertificate object. + * @param slot Name of the deployment slot. If a slot is not specified, the API will create a + * binding for the production slot. + * @param options The optional parameters + * @param callback The callback + */ + createOrUpdatePublicCertificateSlot(resourceGroupName: string, name: string, publicCertificateName: string, publicCertificate: Models.PublicCertificate, slot: string, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; + createOrUpdatePublicCertificateSlot(resourceGroupName: string, name: string, publicCertificateName: string, publicCertificate: Models.PublicCertificate, slot: string, options?: msRest.RequestOptionsBase | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { + return this.client.sendOperationRequest( + { + resourceGroupName, + name, + publicCertificateName, + publicCertificate, + slot, + options + }, + createOrUpdatePublicCertificateSlotOperationSpec, + callback) as Promise; + } + + /** + * Deletes a hostname binding for an app. + * @summary Deletes a hostname binding for an app. + * @param resourceGroupName Name of the resource group to which the resource belongs. + * @param name Name of the app. + * @param slot Name of the deployment slot. If a slot is not specified, the API will delete the + * binding for the production slot. + * @param publicCertificateName Public certificate name. + * @param [options] The optional parameters + * @returns Promise + */ + deletePublicCertificateSlot(resourceGroupName: string, name: string, slot: string, publicCertificateName: string, options?: msRest.RequestOptionsBase): Promise; + /** + * @param resourceGroupName Name of the resource group to which the resource belongs. + * @param name Name of the app. + * @param slot Name of the deployment slot. If a slot is not specified, the API will delete the + * binding for the production slot. + * @param publicCertificateName Public certificate name. + * @param callback The callback + */ + deletePublicCertificateSlot(resourceGroupName: string, name: string, slot: string, publicCertificateName: string, callback: msRest.ServiceCallback): void; + /** + * @param resourceGroupName Name of the resource group to which the resource belongs. + * @param name Name of the app. + * @param slot Name of the deployment slot. If a slot is not specified, the API will delete the + * binding for the production slot. + * @param publicCertificateName Public certificate name. + * @param options The optional parameters + * @param callback The callback + */ + deletePublicCertificateSlot(resourceGroupName: string, name: string, slot: string, publicCertificateName: string, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; + deletePublicCertificateSlot(resourceGroupName: string, name: string, slot: string, publicCertificateName: string, options?: msRest.RequestOptionsBase | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { + return this.client.sendOperationRequest( + { + resourceGroupName, + name, + slot, + publicCertificateName, + options + }, + deletePublicCertificateSlotOperationSpec, + callback); + } + + /** + * Gets the publishing profile for an app (or deployment slot, if specified). + * @summary Gets the publishing profile for an app (or deployment slot, if specified). + * @param resourceGroupName Name of the resource group to which the resource belongs. + * @param name Name of the app. + * @param publishingProfileOptions Specifies publishingProfileOptions for publishing profile. For + * example, use {"format": "FileZilla3"} to get a FileZilla publishing profile. + * @param slot Name of the deployment slot. If a slot is not specified, the API will get the + * publishing profile for the production slot. + * @param [options] The optional parameters + * @returns Promise + */ + listPublishingProfileXmlWithSecretsSlot(resourceGroupName: string, name: string, publishingProfileOptions: Models.CsmPublishingProfileOptions, slot: string, options?: msRest.RequestOptionsBase): Promise; + /** + * @param resourceGroupName Name of the resource group to which the resource belongs. + * @param name Name of the app. + * @param publishingProfileOptions Specifies publishingProfileOptions for publishing profile. For + * example, use {"format": "FileZilla3"} to get a FileZilla publishing profile. + * @param slot Name of the deployment slot. If a slot is not specified, the API will get the + * publishing profile for the production slot. + * @param callback The callback + */ + listPublishingProfileXmlWithSecretsSlot(resourceGroupName: string, name: string, publishingProfileOptions: Models.CsmPublishingProfileOptions, slot: string, callback: msRest.ServiceCallback): void; + /** + * @param resourceGroupName Name of the resource group to which the resource belongs. + * @param name Name of the app. + * @param publishingProfileOptions Specifies publishingProfileOptions for publishing profile. For + * example, use {"format": "FileZilla3"} to get a FileZilla publishing profile. + * @param slot Name of the deployment slot. If a slot is not specified, the API will get the + * publishing profile for the production slot. + * @param options The optional parameters + * @param callback The callback + */ + listPublishingProfileXmlWithSecretsSlot(resourceGroupName: string, name: string, publishingProfileOptions: Models.CsmPublishingProfileOptions, slot: string, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; + listPublishingProfileXmlWithSecretsSlot(resourceGroupName: string, name: string, publishingProfileOptions: Models.CsmPublishingProfileOptions, slot: string, options?: msRest.RequestOptionsBase | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { + return this.client.sendOperationRequest( + { + resourceGroupName, + name, + publishingProfileOptions, + slot, + options + }, + listPublishingProfileXmlWithSecretsSlotOperationSpec, + callback) as Promise; + } + + /** + * Resets the configuration settings of the current slot if they were previously modified by + * calling the API with POST. + * @summary Resets the configuration settings of the current slot if they were previously modified + * by calling the API with POST. + * @param resourceGroupName Name of the resource group to which the resource belongs. + * @param name Name of the app. + * @param slot Name of the deployment slot. If a slot is not specified, the API resets + * configuration settings for the production slot. + * @param [options] The optional parameters + * @returns Promise + */ + resetSlotConfigurationSlot(resourceGroupName: string, name: string, slot: string, options?: msRest.RequestOptionsBase): Promise; + /** + * @param resourceGroupName Name of the resource group to which the resource belongs. + * @param name Name of the app. + * @param slot Name of the deployment slot. If a slot is not specified, the API resets + * configuration settings for the production slot. + * @param callback The callback + */ + resetSlotConfigurationSlot(resourceGroupName: string, name: string, slot: string, callback: msRest.ServiceCallback): void; + /** + * @param resourceGroupName Name of the resource group to which the resource belongs. + * @param name Name of the app. + * @param slot Name of the deployment slot. If a slot is not specified, the API resets + * configuration settings for the production slot. + * @param options The optional parameters + * @param callback The callback + */ + resetSlotConfigurationSlot(resourceGroupName: string, name: string, slot: string, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; + resetSlotConfigurationSlot(resourceGroupName: string, name: string, slot: string, options?: msRest.RequestOptionsBase | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { + return this.client.sendOperationRequest( + { + resourceGroupName, + name, + slot, + options + }, + resetSlotConfigurationSlotOperationSpec, + callback); + } + + /** + * Restarts an app (or deployment slot, if specified). + * @summary Restarts an app (or deployment slot, if specified). + * @param resourceGroupName Name of the resource group to which the resource belongs. + * @param name Name of the app. + * @param slot Name of the deployment slot. If a slot is not specified, the API will restart the + * production slot. + * @param [options] The optional parameters + * @returns Promise + */ + restartSlot(resourceGroupName: string, name: string, slot: string, options?: Models.WebAppsRestartSlotOptionalParams): Promise; + /** + * @param resourceGroupName Name of the resource group to which the resource belongs. + * @param name Name of the app. + * @param slot Name of the deployment slot. If a slot is not specified, the API will restart the + * production slot. + * @param callback The callback + */ + restartSlot(resourceGroupName: string, name: string, slot: string, callback: msRest.ServiceCallback): void; + /** + * @param resourceGroupName Name of the resource group to which the resource belongs. + * @param name Name of the app. + * @param slot Name of the deployment slot. If a slot is not specified, the API will restart the + * production slot. + * @param options The optional parameters + * @param callback The callback + */ + restartSlot(resourceGroupName: string, name: string, slot: string, options: Models.WebAppsRestartSlotOptionalParams, callback: msRest.ServiceCallback): void; + restartSlot(resourceGroupName: string, name: string, slot: string, options?: Models.WebAppsRestartSlotOptionalParams | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { + return this.client.sendOperationRequest( + { + resourceGroupName, + name, + slot, + options + }, + restartSlotOperationSpec, + callback); + } + + /** + * Restores an app from a backup blob in Azure Storage. + * @summary Restores an app from a backup blob in Azure Storage. + * @param resourceGroupName Name of the resource group to which the resource belongs. + * @param name Name of the app. + * @param request Information on restore request . + * @param slot Name of the deployment slot. If a slot is not specified, the API will restore a + * backup of the production slot. + * @param [options] The optional parameters + * @returns Promise + */ + restoreFromBackupBlobSlot(resourceGroupName: string, name: string, request: Models.RestoreRequest, slot: string, options?: msRest.RequestOptionsBase): Promise { + return this.beginRestoreFromBackupBlobSlot(resourceGroupName,name,request,slot,options) + .then(lroPoller => lroPoller.pollUntilFinished()); + } + + /** + * Restores a deleted web app to this web app. + * @summary Restores a deleted web app to this web app. + * @param resourceGroupName Name of the resource group to which the resource belongs. + * @param name Name of web app. + * @param restoreRequest Deleted web app restore information. + * @param slot Name of web app slot. If not specified then will default to production slot. + * @param [options] The optional parameters + * @returns Promise + */ + restoreFromDeletedAppSlot(resourceGroupName: string, name: string, restoreRequest: Models.DeletedAppRestoreRequest, slot: string, options?: msRest.RequestOptionsBase): Promise { + return this.beginRestoreFromDeletedAppSlot(resourceGroupName,name,restoreRequest,slot,options) + .then(lroPoller => lroPoller.pollUntilFinished()); + } + + /** + * Restores a web app from a snapshot. + * @summary Restores a web app from a snapshot. + * @param resourceGroupName Name of the resource group to which the resource belongs. + * @param name Name of web app. + * @param restoreRequest Snapshot restore settings. Snapshot information can be obtained by calling + * GetDeletedSites or GetSiteSnapshots API. + * @param slot Name of web app slot. If not specified then will default to production slot. + * @param [options] The optional parameters + * @returns Promise + */ + restoreSnapshotSlot(resourceGroupName: string, name: string, restoreRequest: Models.SnapshotRestoreRequest, slot: string, options?: msRest.RequestOptionsBase): Promise { + return this.beginRestoreSnapshotSlot(resourceGroupName,name,restoreRequest,slot,options) + .then(lroPoller => lroPoller.pollUntilFinished()); + } + + /** + * Get list of siteextensions for a web site, or a deployment slot. + * @summary Get list of siteextensions for a web site, or a deployment slot. + * @param resourceGroupName Name of the resource group to which the resource belongs. + * @param name Site name. + * @param slot Name of the deployment slot. If a slot is not specified, the API deletes a + * deployment for the production slot. + * @param [options] The optional parameters + * @returns Promise + */ + listSiteExtensionsSlot(resourceGroupName: string, name: string, slot: string, options?: msRest.RequestOptionsBase): Promise; + /** + * @param resourceGroupName Name of the resource group to which the resource belongs. + * @param name Site name. + * @param slot Name of the deployment slot. If a slot is not specified, the API deletes a + * deployment for the production slot. + * @param callback The callback + */ + listSiteExtensionsSlot(resourceGroupName: string, name: string, slot: string, callback: msRest.ServiceCallback): void; + /** + * @param resourceGroupName Name of the resource group to which the resource belongs. + * @param name Site name. + * @param slot Name of the deployment slot. If a slot is not specified, the API deletes a + * deployment for the production slot. + * @param options The optional parameters + * @param callback The callback + */ + listSiteExtensionsSlot(resourceGroupName: string, name: string, slot: string, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; + listSiteExtensionsSlot(resourceGroupName: string, name: string, slot: string, options?: msRest.RequestOptionsBase | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { + return this.client.sendOperationRequest( + { + resourceGroupName, + name, + slot, + options + }, + listSiteExtensionsSlotOperationSpec, + callback) as Promise; + } + + /** + * Get site extension information by its ID for a web site, or a deployment slot. + * @summary Get site extension information by its ID for a web site, or a deployment slot. + * @param resourceGroupName Name of the resource group to which the resource belongs. + * @param name Site name. + * @param siteExtensionId Site extension name. + * @param slot Name of the deployment slot. If a slot is not specified, the API deletes a + * deployment for the production slot. + * @param [options] The optional parameters + * @returns Promise + */ + getSiteExtensionSlot(resourceGroupName: string, name: string, siteExtensionId: string, slot: string, options?: msRest.RequestOptionsBase): Promise; + /** + * @param resourceGroupName Name of the resource group to which the resource belongs. + * @param name Site name. + * @param siteExtensionId Site extension name. + * @param slot Name of the deployment slot. If a slot is not specified, the API deletes a + * deployment for the production slot. + * @param callback The callback + */ + getSiteExtensionSlot(resourceGroupName: string, name: string, siteExtensionId: string, slot: string, callback: msRest.ServiceCallback): void; + /** + * @param resourceGroupName Name of the resource group to which the resource belongs. + * @param name Site name. + * @param siteExtensionId Site extension name. + * @param slot Name of the deployment slot. If a slot is not specified, the API deletes a + * deployment for the production slot. + * @param options The optional parameters + * @param callback The callback + */ + getSiteExtensionSlot(resourceGroupName: string, name: string, siteExtensionId: string, slot: string, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; + getSiteExtensionSlot(resourceGroupName: string, name: string, siteExtensionId: string, slot: string, options?: msRest.RequestOptionsBase | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { + return this.client.sendOperationRequest( + { + resourceGroupName, + name, + siteExtensionId, + slot, + options + }, + getSiteExtensionSlotOperationSpec, + callback) as Promise; + } + + /** + * Install site extension on a web site, or a deployment slot. + * @summary Install site extension on a web site, or a deployment slot. + * @param resourceGroupName Name of the resource group to which the resource belongs. + * @param name Site name. + * @param siteExtensionId Site extension name. + * @param slot Name of the deployment slot. If a slot is not specified, the API deletes a + * deployment for the production slot. + * @param [options] The optional parameters + * @returns Promise + */ + installSiteExtensionSlot(resourceGroupName: string, name: string, siteExtensionId: string, slot: string, options?: msRest.RequestOptionsBase): Promise { + return this.beginInstallSiteExtensionSlot(resourceGroupName,name,siteExtensionId,slot,options) + .then(lroPoller => lroPoller.pollUntilFinished()) as Promise; + } + + /** + * Remove a site extension from a web site, or a deployment slot. + * @summary Remove a site extension from a web site, or a deployment slot. + * @param resourceGroupName Name of the resource group to which the resource belongs. + * @param name Site name. + * @param siteExtensionId Site extension name. + * @param slot Name of the deployment slot. If a slot is not specified, the API deletes a + * deployment for the production slot. + * @param [options] The optional parameters + * @returns Promise + */ + deleteSiteExtensionSlot(resourceGroupName: string, name: string, siteExtensionId: string, slot: string, options?: msRest.RequestOptionsBase): Promise; + /** + * @param resourceGroupName Name of the resource group to which the resource belongs. + * @param name Site name. + * @param siteExtensionId Site extension name. + * @param slot Name of the deployment slot. If a slot is not specified, the API deletes a + * deployment for the production slot. + * @param callback The callback + */ + deleteSiteExtensionSlot(resourceGroupName: string, name: string, siteExtensionId: string, slot: string, callback: msRest.ServiceCallback): void; + /** + * @param resourceGroupName Name of the resource group to which the resource belongs. + * @param name Site name. + * @param siteExtensionId Site extension name. + * @param slot Name of the deployment slot. If a slot is not specified, the API deletes a + * deployment for the production slot. + * @param options The optional parameters + * @param callback The callback + */ + deleteSiteExtensionSlot(resourceGroupName: string, name: string, siteExtensionId: string, slot: string, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; + deleteSiteExtensionSlot(resourceGroupName: string, name: string, siteExtensionId: string, slot: string, options?: msRest.RequestOptionsBase | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { + return this.client.sendOperationRequest( + { + resourceGroupName, + name, + siteExtensionId, + slot, + options + }, + deleteSiteExtensionSlotOperationSpec, + callback); + } + + /** + * Get the difference in configuration settings between two web app slots. + * @summary Get the difference in configuration settings between two web app slots. + * @param resourceGroupName Name of the resource group to which the resource belongs. + * @param name Name of the app. + * @param slotSwapEntity JSON object that contains the target slot name. See example. + * @param slot Name of the source slot. If a slot is not specified, the production slot is used as + * the source slot. + * @param [options] The optional parameters + * @returns Promise + */ + listSlotDifferencesSlot(resourceGroupName: string, name: string, slotSwapEntity: Models.CsmSlotEntity, slot: string, options?: msRest.RequestOptionsBase): Promise; + /** + * @param resourceGroupName Name of the resource group to which the resource belongs. + * @param name Name of the app. + * @param slotSwapEntity JSON object that contains the target slot name. See example. + * @param slot Name of the source slot. If a slot is not specified, the production slot is used as + * the source slot. + * @param callback The callback + */ + listSlotDifferencesSlot(resourceGroupName: string, name: string, slotSwapEntity: Models.CsmSlotEntity, slot: string, callback: msRest.ServiceCallback): void; + /** + * @param resourceGroupName Name of the resource group to which the resource belongs. + * @param name Name of the app. + * @param slotSwapEntity JSON object that contains the target slot name. See example. + * @param slot Name of the source slot. If a slot is not specified, the production slot is used as + * the source slot. + * @param options The optional parameters + * @param callback The callback + */ + listSlotDifferencesSlot(resourceGroupName: string, name: string, slotSwapEntity: Models.CsmSlotEntity, slot: string, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; + listSlotDifferencesSlot(resourceGroupName: string, name: string, slotSwapEntity: Models.CsmSlotEntity, slot: string, options?: msRest.RequestOptionsBase | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { + return this.client.sendOperationRequest( + { + resourceGroupName, + name, + slotSwapEntity, + slot, + options + }, + listSlotDifferencesSlotOperationSpec, + callback) as Promise; + } + + /** + * Swaps two deployment slots of an app. + * @summary Swaps two deployment slots of an app. + * @param resourceGroupName Name of the resource group to which the resource belongs. + * @param name Name of the app. + * @param slotSwapEntity JSON object that contains the target slot name. See example. + * @param slot Name of the source slot. If a slot is not specified, the production slot is used as + * the source slot. + * @param [options] The optional parameters + * @returns Promise + */ + swapSlotSlot(resourceGroupName: string, name: string, slotSwapEntity: Models.CsmSlotEntity, slot: string, options?: msRest.RequestOptionsBase): Promise { + return this.beginSwapSlotSlot(resourceGroupName,name,slotSwapEntity,slot,options) + .then(lroPoller => lroPoller.pollUntilFinished()); + } + + /** + * Returns all Snapshots to the user. + * @summary Returns all Snapshots to the user. + * @param resourceGroupName Name of the resource group to which the resource belongs. + * @param name Website Name. + * @param slot Website Slot. + * @param [options] The optional parameters + * @returns Promise + */ + listSnapshotsSlot(resourceGroupName: string, name: string, slot: string, options?: msRest.RequestOptionsBase): Promise; + /** + * @param resourceGroupName Name of the resource group to which the resource belongs. + * @param name Website Name. + * @param slot Website Slot. + * @param callback The callback + */ + listSnapshotsSlot(resourceGroupName: string, name: string, slot: string, callback: msRest.ServiceCallback): void; + /** + * @param resourceGroupName Name of the resource group to which the resource belongs. + * @param name Website Name. + * @param slot Website Slot. + * @param options The optional parameters + * @param callback The callback + */ + listSnapshotsSlot(resourceGroupName: string, name: string, slot: string, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; + listSnapshotsSlot(resourceGroupName: string, name: string, slot: string, options?: msRest.RequestOptionsBase | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { + return this.client.sendOperationRequest( + { + resourceGroupName, + name, + slot, + options + }, + listSnapshotsSlotOperationSpec, + callback) as Promise; + } + + /** + * Returns all Snapshots to the user from DRSecondary endpoint. + * @summary Returns all Snapshots to the user from DRSecondary endpoint. + * @param resourceGroupName Name of the resource group to which the resource belongs. + * @param name Website Name. + * @param slot Website Slot. + * @param [options] The optional parameters + * @returns Promise + */ + listSnapshotsFromDRSecondarySlot(resourceGroupName: string, name: string, slot: string, options?: msRest.RequestOptionsBase): Promise; + /** + * @param resourceGroupName Name of the resource group to which the resource belongs. + * @param name Website Name. + * @param slot Website Slot. + * @param callback The callback + */ + listSnapshotsFromDRSecondarySlot(resourceGroupName: string, name: string, slot: string, callback: msRest.ServiceCallback): void; + /** + * @param resourceGroupName Name of the resource group to which the resource belongs. + * @param name Website Name. + * @param slot Website Slot. + * @param options The optional parameters + * @param callback The callback + */ + listSnapshotsFromDRSecondarySlot(resourceGroupName: string, name: string, slot: string, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; + listSnapshotsFromDRSecondarySlot(resourceGroupName: string, name: string, slot: string, options?: msRest.RequestOptionsBase | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { + return this.client.sendOperationRequest( + { + resourceGroupName, + name, + slot, + options + }, + listSnapshotsFromDRSecondarySlotOperationSpec, + callback) as Promise; + } + + /** + * Gets the source control configuration of an app. + * @summary Gets the source control configuration of an app. + * @param resourceGroupName Name of the resource group to which the resource belongs. + * @param name Name of the app. + * @param 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 [options] The optional parameters + * @returns Promise + */ + getSourceControlSlot(resourceGroupName: string, name: string, slot: string, options?: msRest.RequestOptionsBase): Promise; + /** + * @param resourceGroupName Name of the resource group to which the resource belongs. + * @param name Name of the app. + * @param 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 callback The callback + */ + getSourceControlSlot(resourceGroupName: string, name: string, slot: string, callback: msRest.ServiceCallback): void; + /** + * @param resourceGroupName Name of the resource group to which the resource belongs. + * @param name Name of the app. + * @param 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 options The optional parameters + * @param callback The callback + */ + getSourceControlSlot(resourceGroupName: string, name: string, slot: string, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; + getSourceControlSlot(resourceGroupName: string, name: string, slot: string, options?: msRest.RequestOptionsBase | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { + return this.client.sendOperationRequest( + { + resourceGroupName, + name, + slot, + options + }, + getSourceControlSlotOperationSpec, + callback) as Promise; + } + + /** + * Updates the source control configuration of an app. + * @summary Updates the source control configuration of an app. + * @param resourceGroupName Name of the resource group to which the resource belongs. + * @param name Name of the app. + * @param siteSourceControl JSON representation of a SiteSourceControl object. See example. + * @param 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 [options] The optional parameters + * @returns Promise + */ + createOrUpdateSourceControlSlot(resourceGroupName: string, name: string, siteSourceControl: Models.SiteSourceControl, slot: string, options?: msRest.RequestOptionsBase): Promise { + return this.beginCreateOrUpdateSourceControlSlot(resourceGroupName,name,siteSourceControl,slot,options) + .then(lroPoller => lroPoller.pollUntilFinished()) as Promise; + } + + /** + * Deletes the source control configuration of an app. + * @summary Deletes the source control configuration of an app. + * @param resourceGroupName Name of the resource group to which the resource belongs. + * @param name Name of the app. + * @param 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 [options] The optional parameters + * @returns Promise + */ + deleteSourceControlSlot(resourceGroupName: string, name: string, slot: string, options?: msRest.RequestOptionsBase): Promise; + /** + * @param resourceGroupName Name of the resource group to which the resource belongs. + * @param name Name of the app. + * @param 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 callback The callback + */ + deleteSourceControlSlot(resourceGroupName: string, name: string, slot: string, callback: msRest.ServiceCallback): void; + /** + * @param resourceGroupName Name of the resource group to which the resource belongs. + * @param name Name of the app. + * @param 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 options The optional parameters + * @param callback The callback + */ + deleteSourceControlSlot(resourceGroupName: string, name: string, slot: string, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; + deleteSourceControlSlot(resourceGroupName: string, name: string, slot: string, options?: msRest.RequestOptionsBase | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { + return this.client.sendOperationRequest( + { + resourceGroupName, + name, + slot, + options + }, + deleteSourceControlSlotOperationSpec, + callback); + } + + /** + * Updates the source control configuration of an app. + * @summary Updates the source control configuration of an app. + * @param resourceGroupName Name of the resource group to which the resource belongs. + * @param name Name of the app. + * @param siteSourceControl JSON representation of a SiteSourceControl object. See example. + * @param 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 [options] The optional parameters + * @returns Promise + */ + updateSourceControlSlot(resourceGroupName: string, name: string, siteSourceControl: Models.SiteSourceControl, slot: string, options?: msRest.RequestOptionsBase): Promise; + /** + * @param resourceGroupName Name of the resource group to which the resource belongs. + * @param name Name of the app. + * @param siteSourceControl JSON representation of a SiteSourceControl object. See example. + * @param 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 callback The callback + */ + updateSourceControlSlot(resourceGroupName: string, name: string, siteSourceControl: Models.SiteSourceControl, slot: string, callback: msRest.ServiceCallback): void; + /** + * @param resourceGroupName Name of the resource group to which the resource belongs. + * @param name Name of the app. + * @param siteSourceControl JSON representation of a SiteSourceControl object. See example. + * @param 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 options The optional parameters + * @param callback The callback + */ + updateSourceControlSlot(resourceGroupName: string, name: string, siteSourceControl: Models.SiteSourceControl, slot: string, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; + updateSourceControlSlot(resourceGroupName: string, name: string, siteSourceControl: Models.SiteSourceControl, slot: string, options?: msRest.RequestOptionsBase | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { + return this.client.sendOperationRequest( + { + resourceGroupName, + name, + siteSourceControl, + slot, + options + }, + updateSourceControlSlotOperationSpec, + callback) as Promise; + } + + /** + * Starts an app (or deployment slot, if specified). + * @summary Starts an app (or deployment slot, if specified). + * @param resourceGroupName Name of the resource group to which the resource belongs. + * @param name Name of the app. + * @param slot Name of the deployment slot. If a slot is not specified, the API will start the + * production slot. + * @param [options] The optional parameters + * @returns Promise + */ + startSlot(resourceGroupName: string, name: string, slot: string, options?: msRest.RequestOptionsBase): Promise; + /** + * @param resourceGroupName Name of the resource group to which the resource belongs. + * @param name Name of the app. + * @param slot Name of the deployment slot. If a slot is not specified, the API will start the + * production slot. + * @param callback The callback + */ + startSlot(resourceGroupName: string, name: string, slot: string, callback: msRest.ServiceCallback): void; + /** + * @param resourceGroupName Name of the resource group to which the resource belongs. + * @param name Name of the app. + * @param slot Name of the deployment slot. If a slot is not specified, the API will start the + * production slot. + * @param options The optional parameters + * @param callback The callback + */ + startSlot(resourceGroupName: string, name: string, slot: string, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; + startSlot(resourceGroupName: string, name: string, slot: string, options?: msRest.RequestOptionsBase | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { + return this.client.sendOperationRequest( + { + resourceGroupName, + name, + slot, + options + }, + startSlotOperationSpec, + callback); + } + + /** + * Start capturing network packets for the site. + * @summary Start capturing network packets for the site. + * @param resourceGroupName Name of the resource group to which the resource belongs. + * @param name The name of the web app. + * @param slot The name of the slot for this web app. + * @param [options] The optional parameters + * @returns Promise + */ + startNetworkTraceSlot(resourceGroupName: string, name: string, slot: string, options?: Models.WebAppsStartNetworkTraceSlotOptionalParams): Promise { + return this.beginStartNetworkTraceSlot(resourceGroupName,name,slot,options) + .then(lroPoller => lroPoller.pollUntilFinished()) as Promise; + } + + /** + * Stops an app (or deployment slot, if specified). + * @summary Stops an app (or deployment slot, if specified). + * @param resourceGroupName Name of the resource group to which the resource belongs. + * @param name Name of the app. + * @param slot Name of the deployment slot. If a slot is not specified, the API will stop the + * production slot. + * @param [options] The optional parameters + * @returns Promise + */ + stopSlot(resourceGroupName: string, name: string, slot: string, options?: msRest.RequestOptionsBase): Promise; + /** + * @param resourceGroupName Name of the resource group to which the resource belongs. + * @param name Name of the app. + * @param slot Name of the deployment slot. If a slot is not specified, the API will stop the + * production slot. + * @param callback The callback + */ + stopSlot(resourceGroupName: string, name: string, slot: string, callback: msRest.ServiceCallback): void; + /** + * @param resourceGroupName Name of the resource group to which the resource belongs. + * @param name Name of the app. + * @param slot Name of the deployment slot. If a slot is not specified, the API will stop the + * production slot. + * @param options The optional parameters + * @param callback The callback + */ + stopSlot(resourceGroupName: string, name: string, slot: string, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; + stopSlot(resourceGroupName: string, name: string, slot: string, options?: msRest.RequestOptionsBase | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { + return this.client.sendOperationRequest( + { + resourceGroupName, + name, + slot, + options + }, + stopSlotOperationSpec, + callback); + } + + /** + * Stop ongoing capturing network packets for the site. + * @summary Stop ongoing capturing network packets for the site. + * @param resourceGroupName Name of the resource group to which the resource belongs. + * @param name The name of the web app. + * @param slot The name of the slot for this web app. + * @param [options] The optional parameters + * @returns Promise + */ + stopNetworkTraceSlot(resourceGroupName: string, name: string, slot: string, options?: msRest.RequestOptionsBase): Promise; + /** + * @param resourceGroupName Name of the resource group to which the resource belongs. + * @param name The name of the web app. + * @param slot The name of the slot for this web app. + * @param callback The callback + */ + stopNetworkTraceSlot(resourceGroupName: string, name: string, slot: string, callback: msRest.ServiceCallback): void; + /** + * @param resourceGroupName Name of the resource group to which the resource belongs. + * @param name The name of the web app. + * @param slot The name of the slot for this web app. + * @param options The optional parameters + * @param callback The callback + */ + stopNetworkTraceSlot(resourceGroupName: string, name: string, slot: string, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; + stopNetworkTraceSlot(resourceGroupName: string, name: string, slot: string, options?: msRest.RequestOptionsBase | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { + return this.client.sendOperationRequest( + { + resourceGroupName, + name, + slot, + options + }, + stopNetworkTraceSlotOperationSpec, + callback); + } + + /** + * Sync web app repository. + * @summary Sync web app repository. + * @param resourceGroupName Name of the resource group to which the resource belongs. + * @param name Name of web app. + * @param slot Name of web app slot. If not specified then will default to production slot. + * @param [options] The optional parameters + * @returns Promise + */ + syncRepositorySlot(resourceGroupName: string, name: string, slot: string, options?: msRest.RequestOptionsBase): Promise; + /** + * @param resourceGroupName Name of the resource group to which the resource belongs. + * @param name Name of web app. + * @param slot Name of web app slot. If not specified then will default to production slot. + * @param callback The callback + */ + syncRepositorySlot(resourceGroupName: string, name: string, slot: string, callback: msRest.ServiceCallback): void; + /** + * @param resourceGroupName Name of the resource group to which the resource belongs. + * @param name Name of web app. + * @param slot Name of web app slot. If not specified then will default to production slot. + * @param options The optional parameters + * @param callback The callback + */ + syncRepositorySlot(resourceGroupName: string, name: string, slot: string, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; + syncRepositorySlot(resourceGroupName: string, name: string, slot: string, options?: msRest.RequestOptionsBase | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { + return this.client.sendOperationRequest( + { + resourceGroupName, + name, + slot, + options + }, + syncRepositorySlotOperationSpec, + callback); + } + + /** + * Syncs function trigger metadata to the scale controller + * @summary Syncs function trigger metadata to the scale controller + * @param resourceGroupName Name of the resource group to which the resource belongs. + * @param name Name of the app. + * @param slot Name of the deployment slot. If a slot is not specified, the API will restore a + * backup of the production slot. + * @param [options] The optional parameters + * @returns Promise + */ + syncFunctionTriggersSlot(resourceGroupName: string, name: string, slot: string, options?: msRest.RequestOptionsBase): Promise; + /** + * @param resourceGroupName Name of the resource group to which the resource belongs. + * @param name Name of the app. + * @param slot Name of the deployment slot. If a slot is not specified, the API will restore a + * backup of the production slot. + * @param callback The callback + */ + syncFunctionTriggersSlot(resourceGroupName: string, name: string, slot: string, callback: msRest.ServiceCallback): void; + /** + * @param resourceGroupName Name of the resource group to which the resource belongs. + * @param name Name of the app. + * @param slot Name of the deployment slot. If a slot is not specified, the API will restore a + * backup of the production slot. + * @param options The optional parameters + * @param callback The callback + */ + syncFunctionTriggersSlot(resourceGroupName: string, name: string, slot: string, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; + syncFunctionTriggersSlot(resourceGroupName: string, name: string, slot: string, options?: msRest.RequestOptionsBase | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { + return this.client.sendOperationRequest( + { + resourceGroupName, + name, + slot, + options + }, + syncFunctionTriggersSlotOperationSpec, + callback); + } + + /** + * List triggered web jobs for an app, or a deployment slot. + * @summary List triggered web jobs for an app, or a deployment slot. + * @param resourceGroupName Name of the resource group to which the resource belongs. + * @param name Site name. + * @param slot Name of the deployment slot. If a slot is not specified, the API deletes a + * deployment for the production slot. + * @param [options] The optional parameters + * @returns Promise + */ + listTriggeredWebJobsSlot(resourceGroupName: string, name: string, slot: string, options?: msRest.RequestOptionsBase): Promise; + /** + * @param resourceGroupName Name of the resource group to which the resource belongs. + * @param name Site name. + * @param slot Name of the deployment slot. If a slot is not specified, the API deletes a + * deployment for the production slot. + * @param callback The callback + */ + listTriggeredWebJobsSlot(resourceGroupName: string, name: string, slot: string, callback: msRest.ServiceCallback): void; + /** + * @param resourceGroupName Name of the resource group to which the resource belongs. + * @param name Site name. + * @param slot Name of the deployment slot. If a slot is not specified, the API deletes a + * deployment for the production slot. + * @param options The optional parameters + * @param callback The callback + */ + listTriggeredWebJobsSlot(resourceGroupName: string, name: string, slot: string, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; + listTriggeredWebJobsSlot(resourceGroupName: string, name: string, slot: string, options?: msRest.RequestOptionsBase | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { + return this.client.sendOperationRequest( + { + resourceGroupName, + name, + slot, + options + }, + listTriggeredWebJobsSlotOperationSpec, + callback) as Promise; + } + + /** + * Gets a triggered web job by its ID for an app, or a deployment slot. + * @summary Gets a triggered web job by its ID for an app, or a deployment slot. + * @param resourceGroupName Name of the resource group to which the resource belongs. + * @param name Site name. + * @param webJobName Name of Web Job. + * @param slot Name of the deployment slot. If a slot is not specified, the API deletes a + * deployment for the production slot. + * @param [options] The optional parameters + * @returns Promise + */ + getTriggeredWebJobSlot(resourceGroupName: string, name: string, webJobName: string, slot: string, options?: msRest.RequestOptionsBase): Promise; + /** + * @param resourceGroupName Name of the resource group to which the resource belongs. + * @param name Site name. + * @param webJobName Name of Web Job. + * @param slot Name of the deployment slot. If a slot is not specified, the API deletes a + * deployment for the production slot. + * @param callback The callback + */ + getTriggeredWebJobSlot(resourceGroupName: string, name: string, webJobName: string, slot: string, callback: msRest.ServiceCallback): void; + /** + * @param resourceGroupName Name of the resource group to which the resource belongs. + * @param name Site name. + * @param webJobName Name of Web Job. + * @param slot Name of the deployment slot. If a slot is not specified, the API deletes a + * deployment for the production slot. + * @param options The optional parameters + * @param callback The callback + */ + getTriggeredWebJobSlot(resourceGroupName: string, name: string, webJobName: string, slot: string, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; + getTriggeredWebJobSlot(resourceGroupName: string, name: string, webJobName: string, slot: string, options?: msRest.RequestOptionsBase | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { + return this.client.sendOperationRequest( + { + resourceGroupName, + name, + webJobName, + slot, + options + }, + getTriggeredWebJobSlotOperationSpec, + callback) as Promise; + } + + /** + * Delete a triggered web job by its ID for an app, or a deployment slot. + * @summary Delete a triggered web job by its ID for an app, or a deployment slot. + * @param resourceGroupName Name of the resource group to which the resource belongs. + * @param name Site name. + * @param webJobName Name of Web Job. + * @param slot Name of the deployment slot. If a slot is not specified, the API deletes a + * deployment for the production slot. + * @param [options] The optional parameters + * @returns Promise + */ + deleteTriggeredWebJobSlot(resourceGroupName: string, name: string, webJobName: string, slot: string, options?: msRest.RequestOptionsBase): Promise; + /** + * @param resourceGroupName Name of the resource group to which the resource belongs. + * @param name Site name. + * @param webJobName Name of Web Job. + * @param slot Name of the deployment slot. If a slot is not specified, the API deletes a + * deployment for the production slot. + * @param callback The callback + */ + deleteTriggeredWebJobSlot(resourceGroupName: string, name: string, webJobName: string, slot: string, callback: msRest.ServiceCallback): void; + /** + * @param resourceGroupName Name of the resource group to which the resource belongs. + * @param name Site name. + * @param webJobName Name of Web Job. + * @param slot Name of the deployment slot. If a slot is not specified, the API deletes a + * deployment for the production slot. + * @param options The optional parameters + * @param callback The callback + */ + deleteTriggeredWebJobSlot(resourceGroupName: string, name: string, webJobName: string, slot: string, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; + deleteTriggeredWebJobSlot(resourceGroupName: string, name: string, webJobName: string, slot: string, options?: msRest.RequestOptionsBase | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { + return this.client.sendOperationRequest( + { + resourceGroupName, + name, + webJobName, + slot, + options + }, + deleteTriggeredWebJobSlotOperationSpec, + callback); + } + + /** + * List a triggered web job's history for an app, or a deployment slot. + * @summary List a triggered web job's history for an app, or a deployment slot. + * @param resourceGroupName Name of the resource group to which the resource belongs. + * @param name Site name. + * @param webJobName Name of Web Job. + * @param slot Name of the deployment slot. If a slot is not specified, the API deletes a + * deployment for the production slot. + * @param [options] The optional parameters + * @returns Promise + */ + listTriggeredWebJobHistorySlot(resourceGroupName: string, name: string, webJobName: string, slot: string, options?: msRest.RequestOptionsBase): Promise; + /** + * @param resourceGroupName Name of the resource group to which the resource belongs. + * @param name Site name. + * @param webJobName Name of Web Job. + * @param slot Name of the deployment slot. If a slot is not specified, the API deletes a + * deployment for the production slot. + * @param callback The callback + */ + listTriggeredWebJobHistorySlot(resourceGroupName: string, name: string, webJobName: string, slot: string, callback: msRest.ServiceCallback): void; + /** + * @param resourceGroupName Name of the resource group to which the resource belongs. + * @param name Site name. + * @param webJobName Name of Web Job. + * @param slot Name of the deployment slot. If a slot is not specified, the API deletes a + * deployment for the production slot. + * @param options The optional parameters + * @param callback The callback + */ + listTriggeredWebJobHistorySlot(resourceGroupName: string, name: string, webJobName: string, slot: string, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; + listTriggeredWebJobHistorySlot(resourceGroupName: string, name: string, webJobName: string, slot: string, options?: msRest.RequestOptionsBase | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { + return this.client.sendOperationRequest( + { + resourceGroupName, + name, + webJobName, + slot, + options + }, + listTriggeredWebJobHistorySlotOperationSpec, + callback) as Promise; + } + + /** + * Gets a triggered web job's history by its ID 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. + * @param resourceGroupName Name of the resource group to which the resource belongs. + * @param name Site name. + * @param webJobName Name of Web Job. + * @param id History ID. + * @param slot Name of the deployment slot. If a slot is not specified, the API deletes a + * deployment for the production slot. + * @param [options] The optional parameters + * @returns Promise + */ + getTriggeredWebJobHistorySlot(resourceGroupName: string, name: string, webJobName: string, id: string, slot: string, options?: msRest.RequestOptionsBase): Promise; + /** + * @param resourceGroupName Name of the resource group to which the resource belongs. + * @param name Site name. + * @param webJobName Name of Web Job. + * @param id History ID. + * @param slot Name of the deployment slot. If a slot is not specified, the API deletes a + * deployment for the production slot. + * @param callback The callback + */ + getTriggeredWebJobHistorySlot(resourceGroupName: string, name: string, webJobName: string, id: string, slot: string, callback: msRest.ServiceCallback): void; + /** + * @param resourceGroupName Name of the resource group to which the resource belongs. + * @param name Site name. + * @param webJobName Name of Web Job. + * @param id History ID. + * @param slot Name of the deployment slot. If a slot is not specified, the API deletes a + * deployment for the production slot. + * @param options The optional parameters + * @param callback The callback + */ + getTriggeredWebJobHistorySlot(resourceGroupName: string, name: string, webJobName: string, id: string, slot: string, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; + getTriggeredWebJobHistorySlot(resourceGroupName: string, name: string, webJobName: string, id: string, slot: string, options?: msRest.RequestOptionsBase | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { + return this.client.sendOperationRequest( + { + resourceGroupName, + name, + webJobName, + id, + slot, + options + }, + getTriggeredWebJobHistorySlotOperationSpec, + callback) as Promise; + } + + /** + * Run a triggered web job for an app, or a deployment slot. + * @summary Run a triggered web job for an app, or a deployment slot. + * @param resourceGroupName Name of the resource group to which the resource belongs. + * @param name Site name. + * @param webJobName Name of Web Job. + * @param slot Name of the deployment slot. If a slot is not specified, the API deletes a + * deployment for the production slot. + * @param [options] The optional parameters + * @returns Promise + */ + runTriggeredWebJobSlot(resourceGroupName: string, name: string, webJobName: string, slot: string, options?: msRest.RequestOptionsBase): Promise; + /** + * @param resourceGroupName Name of the resource group to which the resource belongs. + * @param name Site name. + * @param webJobName Name of Web Job. + * @param slot Name of the deployment slot. If a slot is not specified, the API deletes a + * deployment for the production slot. + * @param callback The callback + */ + runTriggeredWebJobSlot(resourceGroupName: string, name: string, webJobName: string, slot: string, callback: msRest.ServiceCallback): void; + /** + * @param resourceGroupName Name of the resource group to which the resource belongs. + * @param name Site name. + * @param webJobName Name of Web Job. + * @param slot Name of the deployment slot. If a slot is not specified, the API deletes a + * deployment for the production slot. + * @param options The optional parameters + * @param callback The callback + */ + runTriggeredWebJobSlot(resourceGroupName: string, name: string, webJobName: string, slot: string, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; + runTriggeredWebJobSlot(resourceGroupName: string, name: string, webJobName: string, slot: string, options?: msRest.RequestOptionsBase | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { + return this.client.sendOperationRequest( + { + resourceGroupName, + name, + webJobName, + slot, + options + }, + runTriggeredWebJobSlotOperationSpec, + callback); + } + + /** + * Gets the quota usage information of an app (or deployment slot, if specified). + * @summary Gets the quota usage information of an app (or deployment slot, if specified). + * @param resourceGroupName Name of the resource group to which the resource belongs. + * @param name Name of the app. + * @param slot Name of the deployment slot. If a slot is not specified, the API will get quota + * information of the production slot. + * @param [options] The optional parameters + * @returns Promise + */ + listUsagesSlot(resourceGroupName: string, name: string, slot: string, options?: Models.WebAppsListUsagesSlotOptionalParams): Promise; + /** + * @param resourceGroupName Name of the resource group to which the resource belongs. + * @param name Name of the app. + * @param slot Name of the deployment slot. If a slot is not specified, the API will get quota + * information of the production slot. + * @param callback The callback + */ + listUsagesSlot(resourceGroupName: string, name: string, slot: string, callback: msRest.ServiceCallback): void; + /** + * @param resourceGroupName Name of the resource group to which the resource belongs. + * @param name Name of the app. + * @param slot Name of the deployment slot. If a slot is not specified, the API will get quota + * information of the production slot. + * @param options The optional parameters + * @param callback The callback + */ + listUsagesSlot(resourceGroupName: string, name: string, slot: string, options: Models.WebAppsListUsagesSlotOptionalParams, callback: msRest.ServiceCallback): void; + listUsagesSlot(resourceGroupName: string, name: string, slot: string, options?: Models.WebAppsListUsagesSlotOptionalParams | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { + return this.client.sendOperationRequest( + { + resourceGroupName, + name, + slot, + options + }, + listUsagesSlotOperationSpec, + callback) as Promise; + } + + /** + * Gets the virtual networks the app (or deployment slot) is connected to. + * @summary Gets the virtual networks the app (or deployment slot) is connected to. + * @param resourceGroupName Name of the resource group to which the resource belongs. + * @param name Name of the app. + * @param slot Name of the deployment slot. If a slot is not specified, the API will get virtual + * network connections for the production slot. + * @param [options] The optional parameters + * @returns Promise + */ + listVnetConnectionsSlot(resourceGroupName: string, name: string, slot: string, options?: msRest.RequestOptionsBase): Promise; + /** + * @param resourceGroupName Name of the resource group to which the resource belongs. + * @param name Name of the app. + * @param slot Name of the deployment slot. If a slot is not specified, the API will get virtual + * network connections for the production slot. + * @param callback The callback + */ + listVnetConnectionsSlot(resourceGroupName: string, name: string, slot: string, callback: msRest.ServiceCallback): void; + /** + * @param resourceGroupName Name of the resource group to which the resource belongs. + * @param name Name of the app. + * @param slot Name of the deployment slot. If a slot is not specified, the API will get virtual + * network connections for the production slot. + * @param options The optional parameters + * @param callback The callback + */ + listVnetConnectionsSlot(resourceGroupName: string, name: string, slot: string, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; + listVnetConnectionsSlot(resourceGroupName: string, name: string, slot: string, options?: msRest.RequestOptionsBase | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { + return this.client.sendOperationRequest( + { + resourceGroupName, + name, + slot, + options + }, + listVnetConnectionsSlotOperationSpec, + callback) as Promise; + } + + /** + * Gets a virtual network the app (or deployment slot) is connected to by name. + * @summary Gets a virtual network the app (or deployment slot) is connected to by name. + * @param resourceGroupName Name of the resource group to which the resource belongs. + * @param name Name of the app. + * @param vnetName Name of the virtual network. + * @param 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 [options] The optional parameters + * @returns Promise + */ + getVnetConnectionSlot(resourceGroupName: string, name: string, vnetName: string, slot: string, options?: msRest.RequestOptionsBase): Promise; + /** + * @param resourceGroupName Name of the resource group to which the resource belongs. + * @param name Name of the app. + * @param vnetName Name of the virtual network. + * @param 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 callback The callback + */ + getVnetConnectionSlot(resourceGroupName: string, name: string, vnetName: string, slot: string, callback: msRest.ServiceCallback): void; + /** + * @param resourceGroupName Name of the resource group to which the resource belongs. + * @param name Name of the app. + * @param vnetName Name of the virtual network. + * @param 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 options The optional parameters + * @param callback The callback + */ + getVnetConnectionSlot(resourceGroupName: string, name: string, vnetName: string, slot: string, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; + getVnetConnectionSlot(resourceGroupName: string, name: string, vnetName: string, slot: string, options?: msRest.RequestOptionsBase | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { + return this.client.sendOperationRequest( + { + resourceGroupName, + name, + vnetName, + slot, + options + }, + getVnetConnectionSlotOperationSpec, + callback) as Promise; + } + + /** + * Adds a Virtual Network connection to an app or slot (PUT) or updates the connection properties + * (PATCH). + * @summary Adds a Virtual Network connection to an app or slot (PUT) or updates the connection + * properties (PATCH). + * @param resourceGroupName Name of the resource group to which the resource belongs. + * @param name Name of the app. + * @param vnetName Name of an existing Virtual Network. + * @param connectionEnvelope Properties of the Virtual Network connection. See example. + * @param slot Name of the deployment slot. If a slot is not specified, the API will add or update + * connections for the production slot. + * @param [options] The optional parameters + * @returns Promise + */ + createOrUpdateVnetConnectionSlot(resourceGroupName: string, name: string, vnetName: string, connectionEnvelope: Models.VnetInfo, slot: string, options?: msRest.RequestOptionsBase): Promise; + /** + * @param resourceGroupName Name of the resource group to which the resource belongs. + * @param name Name of the app. + * @param vnetName Name of an existing Virtual Network. + * @param connectionEnvelope Properties of the Virtual Network connection. See example. + * @param slot Name of the deployment slot. If a slot is not specified, the API will add or update + * connections for the production slot. + * @param callback The callback + */ + createOrUpdateVnetConnectionSlot(resourceGroupName: string, name: string, vnetName: string, connectionEnvelope: Models.VnetInfo, slot: string, callback: msRest.ServiceCallback): void; + /** + * @param resourceGroupName Name of the resource group to which the resource belongs. + * @param name Name of the app. + * @param vnetName Name of an existing Virtual Network. + * @param connectionEnvelope Properties of the Virtual Network connection. See example. + * @param slot Name of the deployment slot. If a slot is not specified, the API will add or update + * connections for the production slot. + * @param options The optional parameters + * @param callback The callback + */ + createOrUpdateVnetConnectionSlot(resourceGroupName: string, name: string, vnetName: string, connectionEnvelope: Models.VnetInfo, slot: string, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; + createOrUpdateVnetConnectionSlot(resourceGroupName: string, name: string, vnetName: string, connectionEnvelope: Models.VnetInfo, slot: string, options?: msRest.RequestOptionsBase | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { + return this.client.sendOperationRequest( + { + resourceGroupName, + name, + vnetName, + connectionEnvelope, + slot, + options + }, + createOrUpdateVnetConnectionSlotOperationSpec, + callback) as Promise; + } + + /** + * Deletes a connection from an app (or deployment slot to a named virtual network. + * @summary Deletes a connection from an app (or deployment slot to a named virtual network. + * @param resourceGroupName Name of the resource group to which the resource belongs. + * @param name Name of the app. + * @param vnetName Name of the virtual network. + * @param slot Name of the deployment slot. If a slot is not specified, the API will delete the + * connection for the production slot. + * @param [options] The optional parameters + * @returns Promise + */ + deleteVnetConnectionSlot(resourceGroupName: string, name: string, vnetName: string, slot: string, options?: msRest.RequestOptionsBase): Promise; + /** + * @param resourceGroupName Name of the resource group to which the resource belongs. + * @param name Name of the app. + * @param vnetName Name of the virtual network. + * @param slot Name of the deployment slot. If a slot is not specified, the API will delete the + * connection for the production slot. + * @param callback The callback + */ + deleteVnetConnectionSlot(resourceGroupName: string, name: string, vnetName: string, slot: string, callback: msRest.ServiceCallback): void; + /** + * @param resourceGroupName Name of the resource group to which the resource belongs. + * @param name Name of the app. + * @param vnetName Name of the virtual network. + * @param slot Name of the deployment slot. If a slot is not specified, the API will delete the + * connection for the production slot. + * @param options The optional parameters + * @param callback The callback + */ + deleteVnetConnectionSlot(resourceGroupName: string, name: string, vnetName: string, slot: string, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; + deleteVnetConnectionSlot(resourceGroupName: string, name: string, vnetName: string, slot: string, options?: msRest.RequestOptionsBase | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { + return this.client.sendOperationRequest( + { + resourceGroupName, + name, + vnetName, + slot, + options + }, + deleteVnetConnectionSlotOperationSpec, + callback); + } + + /** + * Adds a Virtual Network connection to an app or slot (PUT) or updates the connection properties + * (PATCH). + * @summary Adds a Virtual Network connection to an app or slot (PUT) or updates the connection + * properties (PATCH). + * @param resourceGroupName Name of the resource group to which the resource belongs. + * @param name Name of the app. + * @param vnetName Name of an existing Virtual Network. + * @param connectionEnvelope Properties of the Virtual Network connection. See example. + * @param slot Name of the deployment slot. If a slot is not specified, the API will add or update + * connections for the production slot. + * @param [options] The optional parameters + * @returns Promise + */ + updateVnetConnectionSlot(resourceGroupName: string, name: string, vnetName: string, connectionEnvelope: Models.VnetInfo, slot: string, options?: msRest.RequestOptionsBase): Promise; + /** + * @param resourceGroupName Name of the resource group to which the resource belongs. + * @param name Name of the app. + * @param vnetName Name of an existing Virtual Network. + * @param connectionEnvelope Properties of the Virtual Network connection. See example. + * @param slot Name of the deployment slot. If a slot is not specified, the API will add or update + * connections for the production slot. + * @param callback The callback + */ + updateVnetConnectionSlot(resourceGroupName: string, name: string, vnetName: string, connectionEnvelope: Models.VnetInfo, slot: string, callback: msRest.ServiceCallback): void; + /** + * @param resourceGroupName Name of the resource group to which the resource belongs. + * @param name Name of the app. + * @param vnetName Name of an existing Virtual Network. + * @param connectionEnvelope Properties of the Virtual Network connection. See example. + * @param slot Name of the deployment slot. If a slot is not specified, the API will add or update + * connections for the production slot. + * @param options The optional parameters + * @param callback The callback + */ + updateVnetConnectionSlot(resourceGroupName: string, name: string, vnetName: string, connectionEnvelope: Models.VnetInfo, slot: string, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; + updateVnetConnectionSlot(resourceGroupName: string, name: string, vnetName: string, connectionEnvelope: Models.VnetInfo, slot: string, options?: msRest.RequestOptionsBase | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { + return this.client.sendOperationRequest( + { + resourceGroupName, + name, + vnetName, + connectionEnvelope, + slot, + options + }, + updateVnetConnectionSlotOperationSpec, + callback) as Promise; + } + + /** + * Gets an app's Virtual Network gateway. + * @summary Gets an app's Virtual Network gateway. + * @param resourceGroupName Name of the resource group to which the resource belongs. + * @param name Name of the app. + * @param vnetName Name of the Virtual Network. + * @param gatewayName Name of the gateway. Currently, the only supported string is "primary". + * @param 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 [options] The optional parameters + * @returns Promise + */ + getVnetConnectionGatewaySlot(resourceGroupName: string, name: string, vnetName: string, gatewayName: string, slot: string, options?: msRest.RequestOptionsBase): Promise; + /** + * @param resourceGroupName Name of the resource group to which the resource belongs. + * @param name Name of the app. + * @param vnetName Name of the Virtual Network. + * @param gatewayName Name of the gateway. Currently, the only supported string is "primary". + * @param 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 callback The callback + */ + getVnetConnectionGatewaySlot(resourceGroupName: string, name: string, vnetName: string, gatewayName: string, slot: string, callback: msRest.ServiceCallback): void; + /** + * @param resourceGroupName Name of the resource group to which the resource belongs. + * @param name Name of the app. + * @param vnetName Name of the Virtual Network. + * @param gatewayName Name of the gateway. Currently, the only supported string is "primary". + * @param 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 options The optional parameters + * @param callback The callback + */ + getVnetConnectionGatewaySlot(resourceGroupName: string, name: string, vnetName: string, gatewayName: string, slot: string, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; + getVnetConnectionGatewaySlot(resourceGroupName: string, name: string, vnetName: string, gatewayName: string, slot: string, options?: msRest.RequestOptionsBase | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { + return this.client.sendOperationRequest( + { + resourceGroupName, + name, + vnetName, + gatewayName, + slot, + options + }, + getVnetConnectionGatewaySlotOperationSpec, + callback) as Promise; + } + + /** + * Adds a gateway to a connected Virtual Network (PUT) or updates it (PATCH). + * @summary Adds a gateway to a connected Virtual Network (PUT) or updates it (PATCH). + * @param resourceGroupName Name of the resource group to which the resource belongs. + * @param name Name of the app. + * @param vnetName Name of the Virtual Network. + * @param gatewayName Name of the gateway. Currently, the only supported string is "primary". + * @param connectionEnvelope The properties to update this gateway with. + * @param 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 [options] The optional parameters + * @returns Promise + */ + createOrUpdateVnetConnectionGatewaySlot(resourceGroupName: string, name: string, vnetName: string, gatewayName: string, connectionEnvelope: Models.VnetGateway, slot: string, options?: msRest.RequestOptionsBase): Promise; + /** + * @param resourceGroupName Name of the resource group to which the resource belongs. + * @param name Name of the app. + * @param vnetName Name of the Virtual Network. + * @param gatewayName Name of the gateway. Currently, the only supported string is "primary". + * @param connectionEnvelope The properties to update this gateway with. + * @param 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 callback The callback + */ + createOrUpdateVnetConnectionGatewaySlot(resourceGroupName: string, name: string, vnetName: string, gatewayName: string, connectionEnvelope: Models.VnetGateway, slot: string, callback: msRest.ServiceCallback): void; + /** + * @param resourceGroupName Name of the resource group to which the resource belongs. + * @param name Name of the app. + * @param vnetName Name of the Virtual Network. + * @param gatewayName Name of the gateway. Currently, the only supported string is "primary". + * @param connectionEnvelope The properties to update this gateway with. + * @param 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 options The optional parameters + * @param callback The callback + */ + createOrUpdateVnetConnectionGatewaySlot(resourceGroupName: string, name: string, vnetName: string, gatewayName: string, connectionEnvelope: Models.VnetGateway, slot: string, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; + createOrUpdateVnetConnectionGatewaySlot(resourceGroupName: string, name: string, vnetName: string, gatewayName: string, connectionEnvelope: Models.VnetGateway, slot: string, options?: msRest.RequestOptionsBase | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { + return this.client.sendOperationRequest( + { + resourceGroupName, + name, + vnetName, + gatewayName, + connectionEnvelope, + slot, + options + }, + createOrUpdateVnetConnectionGatewaySlotOperationSpec, + callback) as Promise; + } + + /** + * Adds a gateway to a connected Virtual Network (PUT) or updates it (PATCH). + * @summary Adds a gateway to a connected Virtual Network (PUT) or updates it (PATCH). + * @param resourceGroupName Name of the resource group to which the resource belongs. + * @param name Name of the app. + * @param vnetName Name of the Virtual Network. + * @param gatewayName Name of the gateway. Currently, the only supported string is "primary". + * @param connectionEnvelope The properties to update this gateway with. + * @param 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 [options] The optional parameters + * @returns Promise + */ + updateVnetConnectionGatewaySlot(resourceGroupName: string, name: string, vnetName: string, gatewayName: string, connectionEnvelope: Models.VnetGateway, slot: string, options?: msRest.RequestOptionsBase): Promise; + /** + * @param resourceGroupName Name of the resource group to which the resource belongs. + * @param name Name of the app. + * @param vnetName Name of the Virtual Network. + * @param gatewayName Name of the gateway. Currently, the only supported string is "primary". + * @param connectionEnvelope The properties to update this gateway with. + * @param 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 callback The callback + */ + updateVnetConnectionGatewaySlot(resourceGroupName: string, name: string, vnetName: string, gatewayName: string, connectionEnvelope: Models.VnetGateway, slot: string, callback: msRest.ServiceCallback): void; + /** + * @param resourceGroupName Name of the resource group to which the resource belongs. + * @param name Name of the app. + * @param vnetName Name of the Virtual Network. + * @param gatewayName Name of the gateway. Currently, the only supported string is "primary". + * @param connectionEnvelope The properties to update this gateway with. + * @param 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 options The optional parameters + * @param callback The callback + */ + updateVnetConnectionGatewaySlot(resourceGroupName: string, name: string, vnetName: string, gatewayName: string, connectionEnvelope: Models.VnetGateway, slot: string, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; + updateVnetConnectionGatewaySlot(resourceGroupName: string, name: string, vnetName: string, gatewayName: string, connectionEnvelope: Models.VnetGateway, slot: string, options?: msRest.RequestOptionsBase | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { + return this.client.sendOperationRequest( + { + resourceGroupName, + name, + vnetName, + gatewayName, + connectionEnvelope, + slot, + options + }, + updateVnetConnectionGatewaySlotOperationSpec, + callback) as Promise; + } + + /** + * List webjobs for an app, or a deployment slot. + * @summary List webjobs for an app, or a deployment slot. + * @param resourceGroupName Name of the resource group to which the resource belongs. + * @param name Site name. + * @param slot Name of the deployment slot. If a slot is not specified, the API returns deployments + * for the production slot. + * @param [options] The optional parameters + * @returns Promise + */ + listWebJobsSlot(resourceGroupName: string, name: string, slot: string, options?: msRest.RequestOptionsBase): Promise; + /** + * @param resourceGroupName Name of the resource group to which the resource belongs. + * @param name Site name. + * @param slot Name of the deployment slot. If a slot is not specified, the API returns deployments + * for the production slot. + * @param callback The callback + */ + listWebJobsSlot(resourceGroupName: string, name: string, slot: string, callback: msRest.ServiceCallback): void; + /** + * @param resourceGroupName Name of the resource group to which the resource belongs. + * @param name Site name. + * @param slot Name of the deployment slot. If a slot is not specified, the API returns deployments + * for the production slot. + * @param options The optional parameters + * @param callback The callback + */ + listWebJobsSlot(resourceGroupName: string, name: string, slot: string, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; + listWebJobsSlot(resourceGroupName: string, name: string, slot: string, options?: msRest.RequestOptionsBase | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { + return this.client.sendOperationRequest( + { + resourceGroupName, + name, + slot, + options + }, + listWebJobsSlotOperationSpec, + callback) as Promise; + } + + /** + * Get webjob information for an app, or a deployment slot. + * @summary Get webjob information for an app, or a deployment slot. + * @param resourceGroupName Name of the resource group to which the resource belongs. + * @param name Site name. + * @param webJobName Name of the web job. + * @param slot Name of the deployment slot. If a slot is not specified, the API returns deployments + * for the production slot. + * @param [options] The optional parameters + * @returns Promise + */ + getWebJobSlot(resourceGroupName: string, name: string, webJobName: string, slot: string, options?: msRest.RequestOptionsBase): Promise; + /** + * @param resourceGroupName Name of the resource group to which the resource belongs. + * @param name Site name. + * @param webJobName Name of the web job. + * @param slot Name of the deployment slot. If a slot is not specified, the API returns deployments + * for the production slot. + * @param callback The callback + */ + getWebJobSlot(resourceGroupName: string, name: string, webJobName: string, slot: string, callback: msRest.ServiceCallback): void; + /** + * @param resourceGroupName Name of the resource group to which the resource belongs. + * @param name Site name. + * @param webJobName Name of the web job. + * @param slot Name of the deployment slot. If a slot is not specified, the API returns deployments + * for the production slot. + * @param options The optional parameters + * @param callback The callback + */ + getWebJobSlot(resourceGroupName: string, name: string, webJobName: string, slot: string, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; + getWebJobSlot(resourceGroupName: string, name: string, webJobName: string, slot: string, options?: msRest.RequestOptionsBase | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { + return this.client.sendOperationRequest( + { + resourceGroupName, + name, + webJobName, + slot, + options + }, + getWebJobSlotOperationSpec, + callback) as Promise; + } + + /** + * Get the difference in configuration settings between two web app slots. + * @summary Get the difference in configuration settings between two web app slots. + * @param resourceGroupName Name of the resource group to which the resource belongs. + * @param name Name of the app. + * @param slotSwapEntity JSON object that contains the target slot name. See example. + * @param [options] The optional parameters + * @returns Promise + */ + listSlotDifferencesFromProduction(resourceGroupName: string, name: string, slotSwapEntity: Models.CsmSlotEntity, options?: msRest.RequestOptionsBase): Promise; + /** + * @param resourceGroupName Name of the resource group to which the resource belongs. + * @param name Name of the app. + * @param slotSwapEntity JSON object that contains the target slot name. See example. + * @param callback The callback + */ + listSlotDifferencesFromProduction(resourceGroupName: string, name: string, slotSwapEntity: Models.CsmSlotEntity, callback: msRest.ServiceCallback): void; + /** + * @param resourceGroupName Name of the resource group to which the resource belongs. + * @param name Name of the app. + * @param slotSwapEntity JSON object that contains the target slot name. See example. + * @param options The optional parameters + * @param callback The callback + */ + listSlotDifferencesFromProduction(resourceGroupName: string, name: string, slotSwapEntity: Models.CsmSlotEntity, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; + listSlotDifferencesFromProduction(resourceGroupName: string, name: string, slotSwapEntity: Models.CsmSlotEntity, options?: msRest.RequestOptionsBase | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { + return this.client.sendOperationRequest( + { + resourceGroupName, + name, + slotSwapEntity, + options + }, + listSlotDifferencesFromProductionOperationSpec, + callback) as Promise; + } + + /** + * Swaps two deployment slots of an app. + * @summary Swaps two deployment slots of an app. + * @param resourceGroupName Name of the resource group to which the resource belongs. + * @param name Name of the app. + * @param slotSwapEntity JSON object that contains the target slot name. See example. + * @param [options] The optional parameters + * @returns Promise + */ + swapSlotWithProduction(resourceGroupName: string, name: string, slotSwapEntity: Models.CsmSlotEntity, options?: msRest.RequestOptionsBase): Promise { + return this.beginSwapSlotWithProduction(resourceGroupName,name,slotSwapEntity,options) + .then(lroPoller => lroPoller.pollUntilFinished()); + } + + /** + * Returns all Snapshots to the user. + * @summary Returns all Snapshots to the user. + * @param resourceGroupName Name of the resource group to which the resource belongs. + * @param name Website Name. + * @param [options] The optional parameters + * @returns Promise + */ + listSnapshots(resourceGroupName: string, name: string, options?: msRest.RequestOptionsBase): Promise; + /** + * @param resourceGroupName Name of the resource group to which the resource belongs. + * @param name Website Name. + * @param callback The callback + */ + listSnapshots(resourceGroupName: string, name: string, callback: msRest.ServiceCallback): void; + /** + * @param resourceGroupName Name of the resource group to which the resource belongs. + * @param name Website Name. + * @param options The optional parameters + * @param callback The callback + */ + listSnapshots(resourceGroupName: string, name: string, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; + listSnapshots(resourceGroupName: string, name: string, options?: msRest.RequestOptionsBase | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { + return this.client.sendOperationRequest( + { + resourceGroupName, + name, + options + }, + listSnapshotsOperationSpec, + callback) as Promise; + } + + /** + * Returns all Snapshots to the user from DRSecondary endpoint. + * @summary Returns all Snapshots to the user from DRSecondary endpoint. + * @param resourceGroupName Name of the resource group to which the resource belongs. + * @param name Website Name. + * @param [options] The optional parameters + * @returns Promise + */ + listSnapshotsFromDRSecondary(resourceGroupName: string, name: string, options?: msRest.RequestOptionsBase): Promise; + /** + * @param resourceGroupName Name of the resource group to which the resource belongs. + * @param name Website Name. + * @param callback The callback + */ + listSnapshotsFromDRSecondary(resourceGroupName: string, name: string, callback: msRest.ServiceCallback): void; + /** + * @param resourceGroupName Name of the resource group to which the resource belongs. + * @param name Website Name. + * @param options The optional parameters + * @param callback The callback + */ + listSnapshotsFromDRSecondary(resourceGroupName: string, name: string, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; + listSnapshotsFromDRSecondary(resourceGroupName: string, name: string, options?: msRest.RequestOptionsBase | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { + return this.client.sendOperationRequest( + { + resourceGroupName, + name, + options + }, + listSnapshotsFromDRSecondaryOperationSpec, + callback) as Promise; + } + + /** + * Gets the source control configuration of an app. + * @summary Gets the source control configuration of an app. + * @param resourceGroupName Name of the resource group to which the resource belongs. + * @param name Name of the app. + * @param [options] The optional parameters + * @returns Promise + */ + getSourceControl(resourceGroupName: string, name: string, options?: msRest.RequestOptionsBase): Promise; + /** + * @param resourceGroupName Name of the resource group to which the resource belongs. + * @param name Name of the app. + * @param callback The callback + */ + getSourceControl(resourceGroupName: string, name: string, callback: msRest.ServiceCallback): void; + /** + * @param resourceGroupName Name of the resource group to which the resource belongs. + * @param name Name of the app. + * @param options The optional parameters + * @param callback The callback + */ + getSourceControl(resourceGroupName: string, name: string, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; + getSourceControl(resourceGroupName: string, name: string, options?: msRest.RequestOptionsBase | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { + return this.client.sendOperationRequest( + { + resourceGroupName, + name, + options + }, + getSourceControlOperationSpec, + callback) as Promise; + } + + /** + * Updates the source control configuration of an app. + * @summary Updates the source control configuration of an app. + * @param resourceGroupName Name of the resource group to which the resource belongs. + * @param name Name of the app. + * @param siteSourceControl JSON representation of a SiteSourceControl object. See example. + * @param [options] The optional parameters + * @returns Promise + */ + createOrUpdateSourceControl(resourceGroupName: string, name: string, siteSourceControl: Models.SiteSourceControl, options?: msRest.RequestOptionsBase): Promise { + return this.beginCreateOrUpdateSourceControl(resourceGroupName,name,siteSourceControl,options) + .then(lroPoller => lroPoller.pollUntilFinished()) as Promise; + } + + /** + * Deletes the source control configuration of an app. + * @summary Deletes the source control configuration of an app. + * @param resourceGroupName Name of the resource group to which the resource belongs. + * @param name Name of the app. + * @param [options] The optional parameters + * @returns Promise + */ + deleteSourceControl(resourceGroupName: string, name: string, options?: msRest.RequestOptionsBase): Promise; + /** + * @param resourceGroupName Name of the resource group to which the resource belongs. + * @param name Name of the app. + * @param callback The callback + */ + deleteSourceControl(resourceGroupName: string, name: string, callback: msRest.ServiceCallback): void; + /** + * @param resourceGroupName Name of the resource group to which the resource belongs. + * @param name Name of the app. + * @param options The optional parameters + * @param callback The callback + */ + deleteSourceControl(resourceGroupName: string, name: string, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; + deleteSourceControl(resourceGroupName: string, name: string, options?: msRest.RequestOptionsBase | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { + return this.client.sendOperationRequest( + { + resourceGroupName, + name, + options + }, + deleteSourceControlOperationSpec, + callback); + } + + /** + * Updates the source control configuration of an app. + * @summary Updates the source control configuration of an app. + * @param resourceGroupName Name of the resource group to which the resource belongs. + * @param name Name of the app. + * @param siteSourceControl JSON representation of a SiteSourceControl object. See example. + * @param [options] The optional parameters + * @returns Promise + */ + updateSourceControl(resourceGroupName: string, name: string, siteSourceControl: Models.SiteSourceControl, options?: msRest.RequestOptionsBase): Promise; + /** + * @param resourceGroupName Name of the resource group to which the resource belongs. + * @param name Name of the app. + * @param siteSourceControl JSON representation of a SiteSourceControl object. See example. + * @param callback The callback + */ + updateSourceControl(resourceGroupName: string, name: string, siteSourceControl: Models.SiteSourceControl, callback: msRest.ServiceCallback): void; + /** + * @param resourceGroupName Name of the resource group to which the resource belongs. + * @param name Name of the app. + * @param siteSourceControl JSON representation of a SiteSourceControl object. See example. + * @param options The optional parameters + * @param callback The callback + */ + updateSourceControl(resourceGroupName: string, name: string, siteSourceControl: Models.SiteSourceControl, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; + updateSourceControl(resourceGroupName: string, name: string, siteSourceControl: Models.SiteSourceControl, options?: msRest.RequestOptionsBase | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { + return this.client.sendOperationRequest( + { + resourceGroupName, + name, + siteSourceControl, + options + }, + updateSourceControlOperationSpec, + callback) as Promise; + } + + /** + * Starts an app (or deployment slot, if specified). + * @summary Starts an app (or deployment slot, if specified). + * @param resourceGroupName Name of the resource group to which the resource belongs. + * @param name Name of the app. + * @param [options] The optional parameters + * @returns Promise + */ + start(resourceGroupName: string, name: string, options?: msRest.RequestOptionsBase): Promise; + /** + * @param resourceGroupName Name of the resource group to which the resource belongs. + * @param name Name of the app. + * @param callback The callback + */ + start(resourceGroupName: string, name: string, callback: msRest.ServiceCallback): void; + /** + * @param resourceGroupName Name of the resource group to which the resource belongs. + * @param name Name of the app. + * @param options The optional parameters + * @param callback The callback + */ + start(resourceGroupName: string, name: string, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; + start(resourceGroupName: string, name: string, options?: msRest.RequestOptionsBase | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { + return this.client.sendOperationRequest( + { + resourceGroupName, + name, + options + }, + startOperationSpec, + callback); + } + + /** + * Start capturing network packets for the site. + * @summary Start capturing network packets for the site. + * @param resourceGroupName Name of the resource group to which the resource belongs. + * @param name The name of the web app. + * @param [options] The optional parameters + * @returns Promise + */ + startNetworkTrace(resourceGroupName: string, name: string, options?: Models.WebAppsStartNetworkTraceOptionalParams): Promise { + return this.beginStartNetworkTrace(resourceGroupName,name,options) + .then(lroPoller => lroPoller.pollUntilFinished()) as Promise; + } + + /** + * Stops an app (or deployment slot, if specified). + * @summary Stops an app (or deployment slot, if specified). + * @param resourceGroupName Name of the resource group to which the resource belongs. + * @param name Name of the app. + * @param [options] The optional parameters + * @returns Promise + */ + stop(resourceGroupName: string, name: string, options?: msRest.RequestOptionsBase): Promise; + /** + * @param resourceGroupName Name of the resource group to which the resource belongs. + * @param name Name of the app. + * @param callback The callback + */ + stop(resourceGroupName: string, name: string, callback: msRest.ServiceCallback): void; + /** + * @param resourceGroupName Name of the resource group to which the resource belongs. + * @param name Name of the app. + * @param options The optional parameters + * @param callback The callback + */ + stop(resourceGroupName: string, name: string, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; + stop(resourceGroupName: string, name: string, options?: msRest.RequestOptionsBase | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { + return this.client.sendOperationRequest( + { + resourceGroupName, + name, + options + }, + stopOperationSpec, + callback); + } + + /** + * Stop ongoing capturing network packets for the site. + * @summary Stop ongoing capturing network packets for the site. + * @param resourceGroupName Name of the resource group to which the resource belongs. + * @param name The name of the web app. + * @param [options] The optional parameters + * @returns Promise + */ + stopNetworkTrace(resourceGroupName: string, name: string, options?: msRest.RequestOptionsBase): Promise; + /** + * @param resourceGroupName Name of the resource group to which the resource belongs. + * @param name The name of the web app. + * @param callback The callback + */ + stopNetworkTrace(resourceGroupName: string, name: string, callback: msRest.ServiceCallback): void; + /** + * @param resourceGroupName Name of the resource group to which the resource belongs. + * @param name The name of the web app. + * @param options The optional parameters + * @param callback The callback + */ + stopNetworkTrace(resourceGroupName: string, name: string, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; + stopNetworkTrace(resourceGroupName: string, name: string, options?: msRest.RequestOptionsBase | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { + return this.client.sendOperationRequest( + { + resourceGroupName, + name, + options + }, + stopNetworkTraceOperationSpec, + callback); + } + + /** + * Sync web app repository. + * @summary Sync web app repository. + * @param resourceGroupName Name of the resource group to which the resource belongs. + * @param name Name of web app. + * @param [options] The optional parameters + * @returns Promise + */ + syncRepository(resourceGroupName: string, name: string, options?: msRest.RequestOptionsBase): Promise; + /** + * @param resourceGroupName Name of the resource group to which the resource belongs. + * @param name Name of web app. + * @param callback The callback + */ + syncRepository(resourceGroupName: string, name: string, callback: msRest.ServiceCallback): void; + /** + * @param resourceGroupName Name of the resource group to which the resource belongs. + * @param name Name of web app. + * @param options The optional parameters + * @param callback The callback + */ + syncRepository(resourceGroupName: string, name: string, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; + syncRepository(resourceGroupName: string, name: string, options?: msRest.RequestOptionsBase | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { + return this.client.sendOperationRequest( + { + resourceGroupName, + name, + options + }, + syncRepositoryOperationSpec, + callback); + } + + /** + * Syncs function trigger metadata to the scale controller + * @summary Syncs function trigger metadata to the scale controller + * @param resourceGroupName Name of the resource group to which the resource belongs. + * @param name Name of the app. + * @param [options] The optional parameters + * @returns Promise + */ + syncFunctionTriggers(resourceGroupName: string, name: string, options?: msRest.RequestOptionsBase): Promise; + /** + * @param resourceGroupName Name of the resource group to which the resource belongs. + * @param name Name of the app. + * @param callback The callback + */ + syncFunctionTriggers(resourceGroupName: string, name: string, callback: msRest.ServiceCallback): void; + /** + * @param resourceGroupName Name of the resource group to which the resource belongs. + * @param name Name of the app. + * @param options The optional parameters + * @param callback The callback + */ + syncFunctionTriggers(resourceGroupName: string, name: string, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; + syncFunctionTriggers(resourceGroupName: string, name: string, options?: msRest.RequestOptionsBase | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { + return this.client.sendOperationRequest( + { + resourceGroupName, + name, + options + }, + syncFunctionTriggersOperationSpec, + callback); + } + + /** + * List triggered web jobs for an app, or a deployment slot. + * @summary List triggered web jobs for an app, or a deployment slot. + * @param resourceGroupName Name of the resource group to which the resource belongs. + * @param name Site name. + * @param [options] The optional parameters + * @returns Promise + */ + listTriggeredWebJobs(resourceGroupName: string, name: string, options?: msRest.RequestOptionsBase): Promise; + /** + * @param resourceGroupName Name of the resource group to which the resource belongs. + * @param name Site name. + * @param callback The callback + */ + listTriggeredWebJobs(resourceGroupName: string, name: string, callback: msRest.ServiceCallback): void; + /** + * @param resourceGroupName Name of the resource group to which the resource belongs. + * @param name Site name. + * @param options The optional parameters + * @param callback The callback + */ + listTriggeredWebJobs(resourceGroupName: string, name: string, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; + listTriggeredWebJobs(resourceGroupName: string, name: string, options?: msRest.RequestOptionsBase | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { + return this.client.sendOperationRequest( + { + resourceGroupName, + name, + options + }, + listTriggeredWebJobsOperationSpec, + callback) as Promise; + } + + /** + * Gets a triggered web job by its ID for an app, or a deployment slot. + * @summary Gets a triggered web job by its ID for an app, or a deployment slot. + * @param resourceGroupName Name of the resource group to which the resource belongs. + * @param name Site name. + * @param webJobName Name of Web Job. + * @param [options] The optional parameters + * @returns Promise + */ + getTriggeredWebJob(resourceGroupName: string, name: string, webJobName: string, options?: msRest.RequestOptionsBase): Promise; + /** + * @param resourceGroupName Name of the resource group to which the resource belongs. + * @param name Site name. + * @param webJobName Name of Web Job. + * @param callback The callback + */ + getTriggeredWebJob(resourceGroupName: string, name: string, webJobName: string, callback: msRest.ServiceCallback): void; + /** + * @param resourceGroupName Name of the resource group to which the resource belongs. + * @param name Site name. + * @param webJobName Name of Web Job. + * @param options The optional parameters + * @param callback The callback + */ + getTriggeredWebJob(resourceGroupName: string, name: string, webJobName: string, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; + getTriggeredWebJob(resourceGroupName: string, name: string, webJobName: string, options?: msRest.RequestOptionsBase | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { + return this.client.sendOperationRequest( + { + resourceGroupName, + name, + webJobName, + options + }, + getTriggeredWebJobOperationSpec, + callback) as Promise; + } + + /** + * Delete a triggered web job by its ID for an app, or a deployment slot. + * @summary Delete a triggered web job by its ID for an app, or a deployment slot. + * @param resourceGroupName Name of the resource group to which the resource belongs. + * @param name Site name. + * @param webJobName Name of Web Job. + * @param [options] The optional parameters + * @returns Promise + */ + deleteTriggeredWebJob(resourceGroupName: string, name: string, webJobName: string, options?: msRest.RequestOptionsBase): Promise; + /** + * @param resourceGroupName Name of the resource group to which the resource belongs. + * @param name Site name. + * @param webJobName Name of Web Job. + * @param callback The callback + */ + deleteTriggeredWebJob(resourceGroupName: string, name: string, webJobName: string, callback: msRest.ServiceCallback): void; + /** + * @param resourceGroupName Name of the resource group to which the resource belongs. + * @param name Site name. + * @param webJobName Name of Web Job. + * @param options The optional parameters + * @param callback The callback + */ + deleteTriggeredWebJob(resourceGroupName: string, name: string, webJobName: string, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; + deleteTriggeredWebJob(resourceGroupName: string, name: string, webJobName: string, options?: msRest.RequestOptionsBase | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { + return this.client.sendOperationRequest( + { + resourceGroupName, + name, + webJobName, + options + }, + deleteTriggeredWebJobOperationSpec, + callback); + } + + /** + * List a triggered web job's history for an app, or a deployment slot. + * @summary List a triggered web job's history for an app, or a deployment slot. + * @param resourceGroupName Name of the resource group to which the resource belongs. + * @param name Site name. + * @param webJobName Name of Web Job. + * @param [options] The optional parameters + * @returns Promise + */ + listTriggeredWebJobHistory(resourceGroupName: string, name: string, webJobName: string, options?: msRest.RequestOptionsBase): Promise; + /** + * @param resourceGroupName Name of the resource group to which the resource belongs. + * @param name Site name. + * @param webJobName Name of Web Job. + * @param callback The callback + */ + listTriggeredWebJobHistory(resourceGroupName: string, name: string, webJobName: string, callback: msRest.ServiceCallback): void; + /** + * @param resourceGroupName Name of the resource group to which the resource belongs. + * @param name Site name. + * @param webJobName Name of Web Job. + * @param options The optional parameters + * @param callback The callback + */ + listTriggeredWebJobHistory(resourceGroupName: string, name: string, webJobName: string, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; + listTriggeredWebJobHistory(resourceGroupName: string, name: string, webJobName: string, options?: msRest.RequestOptionsBase | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { + return this.client.sendOperationRequest( + { + resourceGroupName, + name, + webJobName, + options + }, + listTriggeredWebJobHistoryOperationSpec, + callback) as Promise; + } + + /** + * Gets a triggered web job's history by its ID 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. + * @param resourceGroupName Name of the resource group to which the resource belongs. + * @param name Site name. + * @param webJobName Name of Web Job. + * @param id History ID. + * @param [options] The optional parameters + * @returns Promise + */ + getTriggeredWebJobHistory(resourceGroupName: string, name: string, webJobName: string, id: string, options?: msRest.RequestOptionsBase): Promise; + /** + * @param resourceGroupName Name of the resource group to which the resource belongs. + * @param name Site name. + * @param webJobName Name of Web Job. + * @param id History ID. + * @param callback The callback + */ + getTriggeredWebJobHistory(resourceGroupName: string, name: string, webJobName: string, id: string, callback: msRest.ServiceCallback): void; + /** + * @param resourceGroupName Name of the resource group to which the resource belongs. + * @param name Site name. + * @param webJobName Name of Web Job. + * @param id History ID. + * @param options The optional parameters + * @param callback The callback + */ + getTriggeredWebJobHistory(resourceGroupName: string, name: string, webJobName: string, id: string, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; + getTriggeredWebJobHistory(resourceGroupName: string, name: string, webJobName: string, id: string, options?: msRest.RequestOptionsBase | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { + return this.client.sendOperationRequest( + { + resourceGroupName, + name, + webJobName, + id, + options + }, + getTriggeredWebJobHistoryOperationSpec, + callback) as Promise; + } + + /** + * Run a triggered web job for an app, or a deployment slot. + * @summary Run a triggered web job for an app, or a deployment slot. + * @param resourceGroupName Name of the resource group to which the resource belongs. + * @param name Site name. + * @param webJobName Name of Web Job. + * @param [options] The optional parameters + * @returns Promise + */ + runTriggeredWebJob(resourceGroupName: string, name: string, webJobName: string, options?: msRest.RequestOptionsBase): Promise; + /** + * @param resourceGroupName Name of the resource group to which the resource belongs. + * @param name Site name. + * @param webJobName Name of Web Job. + * @param callback The callback + */ + runTriggeredWebJob(resourceGroupName: string, name: string, webJobName: string, callback: msRest.ServiceCallback): void; + /** + * @param resourceGroupName Name of the resource group to which the resource belongs. + * @param name Site name. + * @param webJobName Name of Web Job. + * @param options The optional parameters + * @param callback The callback + */ + runTriggeredWebJob(resourceGroupName: string, name: string, webJobName: string, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; + runTriggeredWebJob(resourceGroupName: string, name: string, webJobName: string, options?: msRest.RequestOptionsBase | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { + return this.client.sendOperationRequest( + { + resourceGroupName, + name, + webJobName, + options + }, + runTriggeredWebJobOperationSpec, + callback); + } + + /** + * Gets the quota usage information of an app (or deployment slot, if specified). + * @summary Gets the quota usage information of an app (or deployment slot, if specified). + * @param resourceGroupName Name of the resource group to which the resource belongs. + * @param name Name of the app. + * @param [options] The optional parameters + * @returns Promise + */ + listUsages(resourceGroupName: string, name: string, options?: Models.WebAppsListUsagesOptionalParams): Promise; + /** + * @param resourceGroupName Name of the resource group to which the resource belongs. + * @param name Name of the app. + * @param callback The callback + */ + listUsages(resourceGroupName: string, name: string, callback: msRest.ServiceCallback): void; + /** + * @param resourceGroupName Name of the resource group to which the resource belongs. + * @param name Name of the app. + * @param options The optional parameters + * @param callback The callback + */ + listUsages(resourceGroupName: string, name: string, options: Models.WebAppsListUsagesOptionalParams, callback: msRest.ServiceCallback): void; + listUsages(resourceGroupName: string, name: string, options?: Models.WebAppsListUsagesOptionalParams | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { + return this.client.sendOperationRequest( + { + resourceGroupName, + name, + options + }, + listUsagesOperationSpec, + callback) as Promise; + } + + /** + * Gets the virtual networks the app (or deployment slot) is connected to. + * @summary Gets the virtual networks the app (or deployment slot) is connected to. + * @param resourceGroupName Name of the resource group to which the resource belongs. + * @param name Name of the app. + * @param [options] The optional parameters + * @returns Promise + */ + listVnetConnections(resourceGroupName: string, name: string, options?: msRest.RequestOptionsBase): Promise; + /** + * @param resourceGroupName Name of the resource group to which the resource belongs. + * @param name Name of the app. + * @param callback The callback + */ + listVnetConnections(resourceGroupName: string, name: string, callback: msRest.ServiceCallback): void; + /** + * @param resourceGroupName Name of the resource group to which the resource belongs. + * @param name Name of the app. + * @param options The optional parameters + * @param callback The callback + */ + listVnetConnections(resourceGroupName: string, name: string, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; + listVnetConnections(resourceGroupName: string, name: string, options?: msRest.RequestOptionsBase | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { + return this.client.sendOperationRequest( + { + resourceGroupName, + name, + options + }, + listVnetConnectionsOperationSpec, + callback) as Promise; + } + + /** + * Gets a virtual network the app (or deployment slot) is connected to by name. + * @summary Gets a virtual network the app (or deployment slot) is connected to by name. + * @param resourceGroupName Name of the resource group to which the resource belongs. + * @param name Name of the app. + * @param vnetName Name of the virtual network. + * @param [options] The optional parameters + * @returns Promise + */ + getVnetConnection(resourceGroupName: string, name: string, vnetName: string, options?: msRest.RequestOptionsBase): Promise; + /** + * @param resourceGroupName Name of the resource group to which the resource belongs. + * @param name Name of the app. + * @param vnetName Name of the virtual network. + * @param callback The callback + */ + getVnetConnection(resourceGroupName: string, name: string, vnetName: string, callback: msRest.ServiceCallback): void; + /** + * @param resourceGroupName Name of the resource group to which the resource belongs. + * @param name Name of the app. + * @param vnetName Name of the virtual network. + * @param options The optional parameters + * @param callback The callback + */ + getVnetConnection(resourceGroupName: string, name: string, vnetName: string, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; + getVnetConnection(resourceGroupName: string, name: string, vnetName: string, options?: msRest.RequestOptionsBase | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { + return this.client.sendOperationRequest( + { + resourceGroupName, + name, + vnetName, + options + }, + getVnetConnectionOperationSpec, + callback) as Promise; + } + + /** + * Adds a Virtual Network connection to an app or slot (PUT) or updates the connection properties + * (PATCH). + * @summary Adds a Virtual Network connection to an app or slot (PUT) or updates the connection + * properties (PATCH). + * @param resourceGroupName Name of the resource group to which the resource belongs. + * @param name Name of the app. + * @param vnetName Name of an existing Virtual Network. + * @param connectionEnvelope Properties of the Virtual Network connection. See example. + * @param [options] The optional parameters + * @returns Promise + */ + createOrUpdateVnetConnection(resourceGroupName: string, name: string, vnetName: string, connectionEnvelope: Models.VnetInfo, options?: msRest.RequestOptionsBase): Promise; + /** + * @param resourceGroupName Name of the resource group to which the resource belongs. + * @param name Name of the app. + * @param vnetName Name of an existing Virtual Network. + * @param connectionEnvelope Properties of the Virtual Network connection. See example. + * @param callback The callback + */ + createOrUpdateVnetConnection(resourceGroupName: string, name: string, vnetName: string, connectionEnvelope: Models.VnetInfo, callback: msRest.ServiceCallback): void; + /** + * @param resourceGroupName Name of the resource group to which the resource belongs. + * @param name Name of the app. + * @param vnetName Name of an existing Virtual Network. + * @param connectionEnvelope Properties of the Virtual Network connection. See example. + * @param options The optional parameters + * @param callback The callback + */ + createOrUpdateVnetConnection(resourceGroupName: string, name: string, vnetName: string, connectionEnvelope: Models.VnetInfo, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; + createOrUpdateVnetConnection(resourceGroupName: string, name: string, vnetName: string, connectionEnvelope: Models.VnetInfo, options?: msRest.RequestOptionsBase | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { + return this.client.sendOperationRequest( + { + resourceGroupName, + name, + vnetName, + connectionEnvelope, + options + }, + createOrUpdateVnetConnectionOperationSpec, + callback) as Promise; + } + + /** + * Deletes a connection from an app (or deployment slot to a named virtual network. + * @summary Deletes a connection from an app (or deployment slot to a named virtual network. + * @param resourceGroupName Name of the resource group to which the resource belongs. + * @param name Name of the app. + * @param vnetName Name of the virtual network. + * @param [options] The optional parameters + * @returns Promise + */ + deleteVnetConnection(resourceGroupName: string, name: string, vnetName: string, options?: msRest.RequestOptionsBase): Promise; + /** + * @param resourceGroupName Name of the resource group to which the resource belongs. + * @param name Name of the app. + * @param vnetName Name of the virtual network. + * @param callback The callback + */ + deleteVnetConnection(resourceGroupName: string, name: string, vnetName: string, callback: msRest.ServiceCallback): void; + /** + * @param resourceGroupName Name of the resource group to which the resource belongs. + * @param name Name of the app. + * @param vnetName Name of the virtual network. + * @param options The optional parameters + * @param callback The callback + */ + deleteVnetConnection(resourceGroupName: string, name: string, vnetName: string, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; + deleteVnetConnection(resourceGroupName: string, name: string, vnetName: string, options?: msRest.RequestOptionsBase | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { + return this.client.sendOperationRequest( + { + resourceGroupName, + name, + vnetName, + options + }, + deleteVnetConnectionOperationSpec, + callback); + } + + /** + * Adds a Virtual Network connection to an app or slot (PUT) or updates the connection properties + * (PATCH). + * @summary Adds a Virtual Network connection to an app or slot (PUT) or updates the connection + * properties (PATCH). + * @param resourceGroupName Name of the resource group to which the resource belongs. + * @param name Name of the app. + * @param vnetName Name of an existing Virtual Network. + * @param connectionEnvelope Properties of the Virtual Network connection. See example. + * @param [options] The optional parameters + * @returns Promise + */ + updateVnetConnection(resourceGroupName: string, name: string, vnetName: string, connectionEnvelope: Models.VnetInfo, options?: msRest.RequestOptionsBase): Promise; + /** + * @param resourceGroupName Name of the resource group to which the resource belongs. + * @param name Name of the app. + * @param vnetName Name of an existing Virtual Network. + * @param connectionEnvelope Properties of the Virtual Network connection. See example. + * @param callback The callback + */ + updateVnetConnection(resourceGroupName: string, name: string, vnetName: string, connectionEnvelope: Models.VnetInfo, callback: msRest.ServiceCallback): void; + /** + * @param resourceGroupName Name of the resource group to which the resource belongs. + * @param name Name of the app. + * @param vnetName Name of an existing Virtual Network. + * @param connectionEnvelope Properties of the Virtual Network connection. See example. + * @param options The optional parameters + * @param callback The callback + */ + updateVnetConnection(resourceGroupName: string, name: string, vnetName: string, connectionEnvelope: Models.VnetInfo, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; + updateVnetConnection(resourceGroupName: string, name: string, vnetName: string, connectionEnvelope: Models.VnetInfo, options?: msRest.RequestOptionsBase | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { + return this.client.sendOperationRequest( + { + resourceGroupName, + name, + vnetName, + connectionEnvelope, + options + }, + updateVnetConnectionOperationSpec, + callback) as Promise; + } + + /** + * Gets an app's Virtual Network gateway. + * @summary Gets an app's Virtual Network gateway. + * @param resourceGroupName Name of the resource group to which the resource belongs. + * @param name Name of the app. + * @param vnetName Name of the Virtual Network. + * @param gatewayName Name of the gateway. Currently, the only supported string is "primary". + * @param [options] The optional parameters + * @returns Promise + */ + getVnetConnectionGateway(resourceGroupName: string, name: string, vnetName: string, gatewayName: string, options?: msRest.RequestOptionsBase): Promise; + /** + * @param resourceGroupName Name of the resource group to which the resource belongs. + * @param name Name of the app. + * @param vnetName Name of the Virtual Network. + * @param gatewayName Name of the gateway. Currently, the only supported string is "primary". + * @param callback The callback + */ + getVnetConnectionGateway(resourceGroupName: string, name: string, vnetName: string, gatewayName: string, callback: msRest.ServiceCallback): void; + /** + * @param resourceGroupName Name of the resource group to which the resource belongs. + * @param name Name of the app. + * @param vnetName Name of the Virtual Network. + * @param gatewayName Name of the gateway. Currently, the only supported string is "primary". + * @param options The optional parameters + * @param callback The callback + */ + getVnetConnectionGateway(resourceGroupName: string, name: string, vnetName: string, gatewayName: string, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; + getVnetConnectionGateway(resourceGroupName: string, name: string, vnetName: string, gatewayName: string, options?: msRest.RequestOptionsBase | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { + return this.client.sendOperationRequest( + { + resourceGroupName, + name, + vnetName, + gatewayName, + options + }, + getVnetConnectionGatewayOperationSpec, + callback) as Promise; + } + + /** + * Adds a gateway to a connected Virtual Network (PUT) or updates it (PATCH). + * @summary Adds a gateway to a connected Virtual Network (PUT) or updates it (PATCH). + * @param resourceGroupName Name of the resource group to which the resource belongs. + * @param name Name of the app. + * @param vnetName Name of the Virtual Network. + * @param gatewayName Name of the gateway. Currently, the only supported string is "primary". + * @param connectionEnvelope The properties to update this gateway with. + * @param [options] The optional parameters + * @returns Promise + */ + createOrUpdateVnetConnectionGateway(resourceGroupName: string, name: string, vnetName: string, gatewayName: string, connectionEnvelope: Models.VnetGateway, options?: msRest.RequestOptionsBase): Promise; + /** + * @param resourceGroupName Name of the resource group to which the resource belongs. + * @param name Name of the app. + * @param vnetName Name of the Virtual Network. + * @param gatewayName Name of the gateway. Currently, the only supported string is "primary". + * @param connectionEnvelope The properties to update this gateway with. + * @param callback The callback + */ + createOrUpdateVnetConnectionGateway(resourceGroupName: string, name: string, vnetName: string, gatewayName: string, connectionEnvelope: Models.VnetGateway, callback: msRest.ServiceCallback): void; + /** + * @param resourceGroupName Name of the resource group to which the resource belongs. + * @param name Name of the app. + * @param vnetName Name of the Virtual Network. + * @param gatewayName Name of the gateway. Currently, the only supported string is "primary". + * @param connectionEnvelope The properties to update this gateway with. + * @param options The optional parameters + * @param callback The callback + */ + createOrUpdateVnetConnectionGateway(resourceGroupName: string, name: string, vnetName: string, gatewayName: string, connectionEnvelope: Models.VnetGateway, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; + createOrUpdateVnetConnectionGateway(resourceGroupName: string, name: string, vnetName: string, gatewayName: string, connectionEnvelope: Models.VnetGateway, options?: msRest.RequestOptionsBase | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { + return this.client.sendOperationRequest( + { + resourceGroupName, + name, + vnetName, + gatewayName, + connectionEnvelope, + options + }, + createOrUpdateVnetConnectionGatewayOperationSpec, + callback) as Promise; + } + + /** + * Adds a gateway to a connected Virtual Network (PUT) or updates it (PATCH). + * @summary Adds a gateway to a connected Virtual Network (PUT) or updates it (PATCH). + * @param resourceGroupName Name of the resource group to which the resource belongs. + * @param name Name of the app. + * @param vnetName Name of the Virtual Network. + * @param gatewayName Name of the gateway. Currently, the only supported string is "primary". + * @param connectionEnvelope The properties to update this gateway with. + * @param [options] The optional parameters + * @returns Promise + */ + updateVnetConnectionGateway(resourceGroupName: string, name: string, vnetName: string, gatewayName: string, connectionEnvelope: Models.VnetGateway, options?: msRest.RequestOptionsBase): Promise; + /** + * @param resourceGroupName Name of the resource group to which the resource belongs. + * @param name Name of the app. + * @param vnetName Name of the Virtual Network. + * @param gatewayName Name of the gateway. Currently, the only supported string is "primary". + * @param connectionEnvelope The properties to update this gateway with. + * @param callback The callback + */ + updateVnetConnectionGateway(resourceGroupName: string, name: string, vnetName: string, gatewayName: string, connectionEnvelope: Models.VnetGateway, callback: msRest.ServiceCallback): void; + /** + * @param resourceGroupName Name of the resource group to which the resource belongs. + * @param name Name of the app. + * @param vnetName Name of the Virtual Network. + * @param gatewayName Name of the gateway. Currently, the only supported string is "primary". + * @param connectionEnvelope The properties to update this gateway with. + * @param options The optional parameters + * @param callback The callback + */ + updateVnetConnectionGateway(resourceGroupName: string, name: string, vnetName: string, gatewayName: string, connectionEnvelope: Models.VnetGateway, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; + updateVnetConnectionGateway(resourceGroupName: string, name: string, vnetName: string, gatewayName: string, connectionEnvelope: Models.VnetGateway, options?: msRest.RequestOptionsBase | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { + return this.client.sendOperationRequest( + { + resourceGroupName, + name, + vnetName, + gatewayName, + connectionEnvelope, + options + }, + updateVnetConnectionGatewayOperationSpec, + callback) as Promise; + } + + /** + * List webjobs for an app, or a deployment slot. + * @summary List webjobs for an app, or a deployment slot. + * @param resourceGroupName Name of the resource group to which the resource belongs. + * @param name Site name. + * @param [options] The optional parameters + * @returns Promise + */ + listWebJobs(resourceGroupName: string, name: string, options?: msRest.RequestOptionsBase): Promise; + /** + * @param resourceGroupName Name of the resource group to which the resource belongs. + * @param name Site name. + * @param callback The callback + */ + listWebJobs(resourceGroupName: string, name: string, callback: msRest.ServiceCallback): void; + /** + * @param resourceGroupName Name of the resource group to which the resource belongs. + * @param name Site name. + * @param options The optional parameters + * @param callback The callback + */ + listWebJobs(resourceGroupName: string, name: string, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; + listWebJobs(resourceGroupName: string, name: string, options?: msRest.RequestOptionsBase | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { + return this.client.sendOperationRequest( + { + resourceGroupName, + name, + options + }, + listWebJobsOperationSpec, + callback) as Promise; + } + + /** + * Get webjob information for an app, or a deployment slot. + * @summary Get webjob information for an app, or a deployment slot. + * @param resourceGroupName Name of the resource group to which the resource belongs. + * @param name Site name. + * @param webJobName Name of the web job. + * @param [options] The optional parameters + * @returns Promise + */ + getWebJob(resourceGroupName: string, name: string, webJobName: string, options?: msRest.RequestOptionsBase): Promise; + /** + * @param resourceGroupName Name of the resource group to which the resource belongs. + * @param name Site name. + * @param webJobName Name of the web job. + * @param callback The callback + */ + getWebJob(resourceGroupName: string, name: string, webJobName: string, callback: msRest.ServiceCallback): void; + /** + * @param resourceGroupName Name of the resource group to which the resource belongs. + * @param name Site name. + * @param webJobName Name of the web job. + * @param options The optional parameters + * @param callback The callback + */ + getWebJob(resourceGroupName: string, name: string, webJobName: string, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; + getWebJob(resourceGroupName: string, name: string, webJobName: string, options?: msRest.RequestOptionsBase | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { + return this.client.sendOperationRequest( + { + resourceGroupName, + name, + webJobName, + options + }, + getWebJobOperationSpec, + callback) as Promise; + } + + /** + * Creates a new web, mobile, or API app in an existing resource group, or updates an existing app. + * @summary Creates a new web, mobile, or API app in an existing resource group, or updates an + * existing app. + * @param resourceGroupName Name of the resource group to which the resource belongs. + * @param name Unique name of the app to create or update. To create or update a deployment slot, + * use the {slot} parameter. + * @param siteEnvelope A JSON representation of the app properties. See example. + * @param [options] The optional parameters + * @returns Promise + */ + beginCreateOrUpdate(resourceGroupName: string, name: string, siteEnvelope: Models.Site, options?: msRest.RequestOptionsBase): Promise { + return this.client.sendLRORequest( + { + resourceGroupName, + name, + siteEnvelope, + options + }, + beginCreateOrUpdateOperationSpec, + options); + } + + /** + * Restores a specific backup to another app (or deployment slot, if specified). + * @summary Restores a specific backup to another app (or deployment slot, if specified). + * @param resourceGroupName Name of the resource group to which the resource belongs. + * @param name Name of the app. + * @param backupId ID of the backup. + * @param request Information on restore request . + * @param [options] The optional parameters + * @returns Promise + */ + beginRestore(resourceGroupName: string, name: string, backupId: string, request: Models.RestoreRequest, options?: msRest.RequestOptionsBase): Promise { + return this.client.sendLRORequest( + { + resourceGroupName, + name, + backupId, + request, + options + }, + beginRestoreOperationSpec, + options); + } + + /** + * Gets the Git/FTP publishing credentials of an app. + * @summary Gets the Git/FTP publishing credentials of an app. + * @param resourceGroupName Name of the resource group to which the resource belongs. + * @param name Name of the app. + * @param [options] The optional parameters + * @returns Promise + */ + beginListPublishingCredentials(resourceGroupName: string, name: string, options?: msRest.RequestOptionsBase): Promise { + return this.client.sendLRORequest( + { + resourceGroupName, + name, + options + }, + beginListPublishingCredentialsOperationSpec, + options); + } + + /** + * Invoke the MSDeploy web app extension. + * @summary Invoke the MSDeploy web app extension. + * @param resourceGroupName Name of the resource group to which the resource belongs. + * @param name Name of web app. + * @param mSDeploy Details of MSDeploy operation + * @param [options] The optional parameters + * @returns Promise + */ + beginCreateMSDeployOperation(resourceGroupName: string, name: string, mSDeploy: Models.MSDeploy, options?: msRest.RequestOptionsBase): Promise { + return this.client.sendLRORequest( + { + resourceGroupName, + name, + mSDeploy, + options + }, + beginCreateMSDeployOperationOperationSpec, + options); + } + + /** + * Create function for web site, or a deployment slot. + * @summary Create function for web site, or a deployment slot. + * @param resourceGroupName Name of the resource group to which the resource belongs. + * @param name Site name. + * @param functionName Function name. + * @param functionEnvelope Function details. + * @param [options] The optional parameters + * @returns Promise + */ + beginCreateFunction(resourceGroupName: string, name: string, functionName: string, functionEnvelope: Models.FunctionEnvelope, options?: msRest.RequestOptionsBase): Promise { + return this.client.sendLRORequest( + { + resourceGroupName, + name, + functionName, + functionEnvelope, + options + }, + beginCreateFunctionOperationSpec, + options); + } + + /** + * Invoke the MSDeploy web app extension. + * @summary Invoke the MSDeploy web app extension. + * @param resourceGroupName Name of the resource group to which the resource belongs. + * @param name Name of web app. + * @param instanceId ID of web app instance. + * @param mSDeploy Details of MSDeploy operation + * @param [options] The optional parameters + * @returns Promise + */ + beginCreateInstanceMSDeployOperation(resourceGroupName: string, name: string, instanceId: string, mSDeploy: Models.MSDeploy, options?: msRest.RequestOptionsBase): Promise { + return this.client.sendLRORequest( + { + resourceGroupName, + name, + instanceId, + mSDeploy, + options + }, + beginCreateInstanceMSDeployOperationOperationSpec, + options); + } + + /** + * Restores a web app. + * @summary Restores a web app. + * @param subscriptionName Azure subscription. + * @param resourceGroupName Name of the resource group to which the resource belongs. + * @param name Name of web app. + * @param migrationOptions Migration migrationOptions. + * @param [options] The optional parameters + * @returns Promise + */ + beginMigrateStorage(subscriptionName: string, resourceGroupName: string, name: string, migrationOptions: Models.StorageMigrationOptions, options?: msRest.RequestOptionsBase): Promise { + return this.client.sendLRORequest( + { + subscriptionName, + resourceGroupName, + name, + migrationOptions, + options + }, + beginMigrateStorageOperationSpec, + options); + } + + /** + * Migrates a local (in-app) MySql database to a remote MySql database. + * @summary Migrates a local (in-app) MySql database to a remote MySql database. + * @param resourceGroupName Name of the resource group to which the resource belongs. + * @param name Name of web app. + * @param migrationRequestEnvelope MySql migration options. + * @param [options] The optional parameters + * @returns Promise + */ + beginMigrateMySql(resourceGroupName: string, name: string, migrationRequestEnvelope: Models.MigrateMySqlRequest, options?: msRest.RequestOptionsBase): Promise { + return this.client.sendLRORequest( + { + resourceGroupName, + name, + migrationRequestEnvelope, + options + }, + beginMigrateMySqlOperationSpec, + options); + } + + /** + * Start capturing network packets for the site. + * @summary Start capturing network packets for the site. + * @param resourceGroupName Name of the resource group to which the resource belongs. + * @param name The name of the web app. + * @param [options] The optional parameters + * @returns Promise + */ + beginStartWebSiteNetworkTraceOperation(resourceGroupName: string, name: string, options?: Models.WebAppsBeginStartWebSiteNetworkTraceOperationOptionalParams): Promise { + return this.client.sendLRORequest( + { + resourceGroupName, + name, + options + }, + beginStartWebSiteNetworkTraceOperationOperationSpec, + options); + } + + /** + * Restores an app from a backup blob in Azure Storage. + * @summary Restores an app from a backup blob in Azure Storage. + * @param resourceGroupName Name of the resource group to which the resource belongs. + * @param name Name of the app. + * @param request Information on restore request . + * @param [options] The optional parameters + * @returns Promise + */ + beginRestoreFromBackupBlob(resourceGroupName: string, name: string, request: Models.RestoreRequest, options?: msRest.RequestOptionsBase): Promise { + return this.client.sendLRORequest( + { + resourceGroupName, + name, + request, + options + }, + beginRestoreFromBackupBlobOperationSpec, + options); + } + + /** + * Restores a deleted web app to this web app. + * @summary Restores a deleted web app to this web app. + * @param resourceGroupName Name of the resource group to which the resource belongs. + * @param name Name of web app. + * @param restoreRequest Deleted web app restore information. + * @param [options] The optional parameters + * @returns Promise + */ + beginRestoreFromDeletedApp(resourceGroupName: string, name: string, restoreRequest: Models.DeletedAppRestoreRequest, options?: msRest.RequestOptionsBase): Promise { + return this.client.sendLRORequest( + { + resourceGroupName, + name, + restoreRequest, + options + }, + beginRestoreFromDeletedAppOperationSpec, + options); + } + + /** + * Restores a web app from a snapshot. + * @summary Restores a web app from a snapshot. + * @param resourceGroupName Name of the resource group to which the resource belongs. + * @param name Name of web app. + * @param restoreRequest Snapshot restore settings. Snapshot information can be obtained by calling + * GetDeletedSites or GetSiteSnapshots API. + * @param [options] The optional parameters + * @returns Promise + */ + beginRestoreSnapshot(resourceGroupName: string, name: string, restoreRequest: Models.SnapshotRestoreRequest, options?: msRest.RequestOptionsBase): Promise { + return this.client.sendLRORequest( + { + resourceGroupName, + name, + restoreRequest, + options + }, + beginRestoreSnapshotOperationSpec, + options); + } + + /** + * Install site extension on a web site, or a deployment slot. + * @summary Install site extension on a web site, or a deployment slot. + * @param resourceGroupName Name of the resource group to which the resource belongs. + * @param name Site name. + * @param siteExtensionId Site extension name. + * @param [options] The optional parameters + * @returns Promise + */ + beginInstallSiteExtension(resourceGroupName: string, name: string, siteExtensionId: string, options?: msRest.RequestOptionsBase): Promise { + return this.client.sendLRORequest( + { + resourceGroupName, + name, + siteExtensionId, + options + }, + beginInstallSiteExtensionOperationSpec, + options); + } + + /** + * Creates a new web, mobile, or API app in an existing resource group, or updates an existing app. + * @summary Creates a new web, mobile, or API app in an existing resource group, or updates an + * existing app. + * @param resourceGroupName Name of the resource group to which the resource belongs. + * @param name Unique name of the app to create or update. To create or update a deployment slot, + * use the {slot} parameter. + * @param siteEnvelope A JSON representation of the app properties. See example. + * @param slot Name of the deployment slot to create or update. By default, this API attempts to + * create or modify the production slot. + * @param [options] The optional parameters + * @returns Promise + */ + beginCreateOrUpdateSlot(resourceGroupName: string, name: string, siteEnvelope: Models.Site, slot: string, options?: msRest.RequestOptionsBase): Promise { + return this.client.sendLRORequest( + { + resourceGroupName, + name, + siteEnvelope, + slot, + options + }, + beginCreateOrUpdateSlotOperationSpec, + options); + } + + /** + * Restores a specific backup to another app (or deployment slot, if specified). + * @summary Restores a specific backup to another app (or deployment slot, if specified). + * @param resourceGroupName Name of the resource group to which the resource belongs. + * @param name Name of the app. + * @param backupId ID of the backup. + * @param request Information on restore request . + * @param slot Name of the deployment slot. If a slot is not specified, the API will restore a + * backup of the production slot. + * @param [options] The optional parameters + * @returns Promise + */ + beginRestoreSlot(resourceGroupName: string, name: string, backupId: string, request: Models.RestoreRequest, slot: string, options?: msRest.RequestOptionsBase): Promise { + return this.client.sendLRORequest( + { + resourceGroupName, + name, + backupId, + request, + slot, + options + }, + beginRestoreSlotOperationSpec, + options); + } + + /** + * Gets the Git/FTP publishing credentials of an app. + * @summary Gets the Git/FTP publishing credentials of an app. + * @param resourceGroupName Name of the resource group to which the resource belongs. + * @param name Name of the app. + * @param slot Name of the deployment slot. If a slot is not specified, the API will get the + * publishing credentials for the production slot. + * @param [options] The optional parameters + * @returns Promise + */ + beginListPublishingCredentialsSlot(resourceGroupName: string, name: string, slot: string, options?: msRest.RequestOptionsBase): Promise { + return this.client.sendLRORequest( + { + resourceGroupName, + name, + slot, + options + }, + beginListPublishingCredentialsSlotOperationSpec, + options); + } + + /** + * Invoke the MSDeploy web app extension. + * @summary Invoke the MSDeploy web app extension. + * @param resourceGroupName Name of the resource group to which the resource belongs. + * @param name Name of web app. + * @param slot Name of web app slot. If not specified then will default to production slot. + * @param mSDeploy Details of MSDeploy operation + * @param [options] The optional parameters + * @returns Promise + */ + beginCreateMSDeployOperationSlot(resourceGroupName: string, name: string, slot: string, mSDeploy: Models.MSDeploy, options?: msRest.RequestOptionsBase): Promise { + return this.client.sendLRORequest( + { + resourceGroupName, + name, + slot, + mSDeploy, + options + }, + beginCreateMSDeployOperationSlotOperationSpec, + options); + } + + /** + * Create function for web site, or a deployment slot. + * @summary Create function for web site, or a deployment slot. + * @param resourceGroupName Name of the resource group to which the resource belongs. + * @param name Site name. + * @param functionName Function name. + * @param slot Name of the deployment slot. If a slot is not specified, the API deletes a + * deployment for the production slot. + * @param functionEnvelope Function details. + * @param [options] The optional parameters + * @returns Promise + */ + beginCreateInstanceFunctionSlot(resourceGroupName: string, name: string, functionName: string, slot: string, functionEnvelope: Models.FunctionEnvelope, options?: msRest.RequestOptionsBase): Promise { + return this.client.sendLRORequest( + { + resourceGroupName, + name, + functionName, + slot, + functionEnvelope, + options + }, + beginCreateInstanceFunctionSlotOperationSpec, + options); + } + + /** + * Invoke the MSDeploy web app extension. + * @summary Invoke the MSDeploy web app extension. + * @param resourceGroupName Name of the resource group to which the resource belongs. + * @param name Name of web app. + * @param slot Name of web app slot. If not specified then will default to production slot. + * @param instanceId ID of web app instance. + * @param mSDeploy Details of MSDeploy operation + * @param [options] The optional parameters + * @returns Promise + */ + beginCreateInstanceMSDeployOperationSlot(resourceGroupName: string, name: string, slot: string, instanceId: string, mSDeploy: Models.MSDeploy, options?: msRest.RequestOptionsBase): Promise { + return this.client.sendLRORequest( + { + resourceGroupName, + name, + slot, + instanceId, + mSDeploy, + options + }, + beginCreateInstanceMSDeployOperationSlotOperationSpec, + options); + } + + /** + * Start capturing network packets for the site. + * @summary Start capturing network packets for the site. + * @param resourceGroupName Name of the resource group to which the resource belongs. + * @param name The name of the web app. + * @param slot The name of the slot for this web app. + * @param [options] The optional parameters + * @returns Promise + */ + beginStartWebSiteNetworkTraceOperationSlot(resourceGroupName: string, name: string, slot: string, options?: Models.WebAppsBeginStartWebSiteNetworkTraceOperationSlotOptionalParams): Promise { + return this.client.sendLRORequest( + { + resourceGroupName, + name, + slot, + options + }, + beginStartWebSiteNetworkTraceOperationSlotOperationSpec, + options); + } + + /** + * Restores an app from a backup blob in Azure Storage. + * @summary Restores an app from a backup blob in Azure Storage. + * @param resourceGroupName Name of the resource group to which the resource belongs. + * @param name Name of the app. + * @param request Information on restore request . + * @param slot Name of the deployment slot. If a slot is not specified, the API will restore a + * backup of the production slot. + * @param [options] The optional parameters + * @returns Promise + */ + beginRestoreFromBackupBlobSlot(resourceGroupName: string, name: string, request: Models.RestoreRequest, slot: string, options?: msRest.RequestOptionsBase): Promise { + return this.client.sendLRORequest( + { + resourceGroupName, + name, + request, + slot, + options + }, + beginRestoreFromBackupBlobSlotOperationSpec, + options); + } + + /** + * Restores a deleted web app to this web app. + * @summary Restores a deleted web app to this web app. + * @param resourceGroupName Name of the resource group to which the resource belongs. + * @param name Name of web app. + * @param restoreRequest Deleted web app restore information. + * @param slot Name of web app slot. If not specified then will default to production slot. + * @param [options] The optional parameters + * @returns Promise + */ + beginRestoreFromDeletedAppSlot(resourceGroupName: string, name: string, restoreRequest: Models.DeletedAppRestoreRequest, slot: string, options?: msRest.RequestOptionsBase): Promise { + return this.client.sendLRORequest( + { + resourceGroupName, + name, + restoreRequest, + slot, + options + }, + beginRestoreFromDeletedAppSlotOperationSpec, + options); + } + + /** + * Restores a web app from a snapshot. + * @summary Restores a web app from a snapshot. + * @param resourceGroupName Name of the resource group to which the resource belongs. + * @param name Name of web app. + * @param restoreRequest Snapshot restore settings. Snapshot information can be obtained by calling + * GetDeletedSites or GetSiteSnapshots API. + * @param slot Name of web app slot. If not specified then will default to production slot. + * @param [options] The optional parameters + * @returns Promise + */ + beginRestoreSnapshotSlot(resourceGroupName: string, name: string, restoreRequest: Models.SnapshotRestoreRequest, slot: string, options?: msRest.RequestOptionsBase): Promise { + return this.client.sendLRORequest( + { + resourceGroupName, + name, + restoreRequest, + slot, + options + }, + beginRestoreSnapshotSlotOperationSpec, + options); + } + + /** + * Install site extension on a web site, or a deployment slot. + * @summary Install site extension on a web site, or a deployment slot. + * @param resourceGroupName Name of the resource group to which the resource belongs. + * @param name Site name. + * @param siteExtensionId Site extension name. + * @param slot Name of the deployment slot. If a slot is not specified, the API deletes a + * deployment for the production slot. + * @param [options] The optional parameters + * @returns Promise + */ + beginInstallSiteExtensionSlot(resourceGroupName: string, name: string, siteExtensionId: string, slot: string, options?: msRest.RequestOptionsBase): Promise { + return this.client.sendLRORequest( + { + resourceGroupName, + name, + siteExtensionId, + slot, + options + }, + beginInstallSiteExtensionSlotOperationSpec, + options); + } + + /** + * Swaps two deployment slots of an app. + * @summary Swaps two deployment slots of an app. + * @param resourceGroupName Name of the resource group to which the resource belongs. + * @param name Name of the app. + * @param slotSwapEntity JSON object that contains the target slot name. See example. + * @param slot Name of the source slot. If a slot is not specified, the production slot is used as + * the source slot. + * @param [options] The optional parameters + * @returns Promise + */ + beginSwapSlotSlot(resourceGroupName: string, name: string, slotSwapEntity: Models.CsmSlotEntity, slot: string, options?: msRest.RequestOptionsBase): Promise { + return this.client.sendLRORequest( + { + resourceGroupName, + name, + slotSwapEntity, + slot, + options + }, + beginSwapSlotSlotOperationSpec, + options); + } + + /** + * Updates the source control configuration of an app. + * @summary Updates the source control configuration of an app. + * @param resourceGroupName Name of the resource group to which the resource belongs. + * @param name Name of the app. + * @param siteSourceControl JSON representation of a SiteSourceControl object. See example. + * @param 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 [options] The optional parameters + * @returns Promise + */ + beginCreateOrUpdateSourceControlSlot(resourceGroupName: string, name: string, siteSourceControl: Models.SiteSourceControl, slot: string, options?: msRest.RequestOptionsBase): Promise { + return this.client.sendLRORequest( + { + resourceGroupName, + name, + siteSourceControl, + slot, + options + }, + beginCreateOrUpdateSourceControlSlotOperationSpec, + options); + } + + /** + * Start capturing network packets for the site. + * @summary Start capturing network packets for the site. + * @param resourceGroupName Name of the resource group to which the resource belongs. + * @param name The name of the web app. + * @param slot The name of the slot for this web app. + * @param [options] The optional parameters + * @returns Promise + */ + beginStartNetworkTraceSlot(resourceGroupName: string, name: string, slot: string, options?: Models.WebAppsBeginStartNetworkTraceSlotOptionalParams): Promise { + return this.client.sendLRORequest( + { + resourceGroupName, + name, + slot, + options + }, + beginStartNetworkTraceSlotOperationSpec, + options); + } + + /** + * Swaps two deployment slots of an app. + * @summary Swaps two deployment slots of an app. + * @param resourceGroupName Name of the resource group to which the resource belongs. + * @param name Name of the app. + * @param slotSwapEntity JSON object that contains the target slot name. See example. + * @param [options] The optional parameters + * @returns Promise + */ + beginSwapSlotWithProduction(resourceGroupName: string, name: string, slotSwapEntity: Models.CsmSlotEntity, options?: msRest.RequestOptionsBase): Promise { + return this.client.sendLRORequest( + { + resourceGroupName, + name, + slotSwapEntity, + options + }, + beginSwapSlotWithProductionOperationSpec, + options); + } + + /** + * Updates the source control configuration of an app. + * @summary Updates the source control configuration of an app. + * @param resourceGroupName Name of the resource group to which the resource belongs. + * @param name Name of the app. + * @param siteSourceControl JSON representation of a SiteSourceControl object. See example. + * @param [options] The optional parameters + * @returns Promise + */ + beginCreateOrUpdateSourceControl(resourceGroupName: string, name: string, siteSourceControl: Models.SiteSourceControl, options?: msRest.RequestOptionsBase): Promise { + return this.client.sendLRORequest( + { + resourceGroupName, + name, + siteSourceControl, + options + }, + beginCreateOrUpdateSourceControlOperationSpec, + options); + } + + /** + * Start capturing network packets for the site. + * @summary Start capturing network packets for the site. + * @param resourceGroupName Name of the resource group to which the resource belongs. + * @param name The name of the web app. + * @param [options] The optional parameters + * @returns Promise + */ + beginStartNetworkTrace(resourceGroupName: string, name: string, options?: Models.WebAppsBeginStartNetworkTraceOptionalParams): Promise { + return this.client.sendLRORequest( + { + resourceGroupName, + name, + options + }, + beginStartNetworkTraceOperationSpec, + options); + } + + /** + * Get all apps for a subscription. + * @summary Get all apps for a subscription. + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @param [options] The optional parameters + * @returns Promise + */ + listNext(nextPageLink: string, options?: msRest.RequestOptionsBase): Promise; + /** + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @param callback The callback + */ + listNext(nextPageLink: string, callback: msRest.ServiceCallback): void; + /** + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @param options The optional parameters + * @param callback The callback + */ + listNext(nextPageLink: string, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; + listNext(nextPageLink: string, options?: msRest.RequestOptionsBase | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { + return this.client.sendOperationRequest( + { + nextPageLink, + options + }, + listNextOperationSpec, + callback) as Promise; + } + + /** + * Gets all web, mobile, and API apps in the specified resource group. + * @summary Gets all web, mobile, and API apps in the specified resource group. + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @param [options] The optional parameters + * @returns Promise + */ + listByResourceGroupNext(nextPageLink: string, options?: msRest.RequestOptionsBase): Promise; + /** + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @param callback The callback + */ + listByResourceGroupNext(nextPageLink: string, callback: msRest.ServiceCallback): void; + /** + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @param options The optional parameters + * @param callback The callback + */ + listByResourceGroupNext(nextPageLink: string, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; + listByResourceGroupNext(nextPageLink: string, options?: msRest.RequestOptionsBase | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { + return this.client.sendOperationRequest( + { + nextPageLink, + options + }, + listByResourceGroupNextOperationSpec, + callback) as Promise; + } + + /** + * Gets existing backups of an app. + * @summary Gets existing backups of an app. + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @param [options] The optional parameters + * @returns Promise + */ + listBackupsNext(nextPageLink: string, options?: msRest.RequestOptionsBase): Promise; + /** + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @param callback The callback + */ + listBackupsNext(nextPageLink: string, callback: msRest.ServiceCallback): void; + /** + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @param options The optional parameters + * @param callback The callback + */ + listBackupsNext(nextPageLink: string, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; + listBackupsNext(nextPageLink: string, options?: msRest.RequestOptionsBase | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { + return this.client.sendOperationRequest( + { + nextPageLink, + options + }, + listBackupsNextOperationSpec, + callback) as Promise; + } + + /** + * List the configurations of an app + * @summary List the configurations of an app + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @param [options] The optional parameters + * @returns Promise + */ + listConfigurationsNext(nextPageLink: string, options?: msRest.RequestOptionsBase): Promise; + /** + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @param callback The callback + */ + listConfigurationsNext(nextPageLink: string, callback: msRest.ServiceCallback): void; + /** + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @param options The optional parameters + * @param callback The callback + */ + listConfigurationsNext(nextPageLink: string, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; + listConfigurationsNext(nextPageLink: string, options?: msRest.RequestOptionsBase | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { + return this.client.sendOperationRequest( + { + nextPageLink, + options + }, + listConfigurationsNextOperationSpec, + callback) as Promise; + } + + /** + * 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 list of web app configuration snapshots identifiers. Each element of the list + * contains a timestamp and the ID of the snapshot. + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @param [options] The optional parameters + * @returns Promise + */ + listConfigurationSnapshotInfoNext(nextPageLink: string, options?: msRest.RequestOptionsBase): Promise; + /** + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @param callback The callback + */ + listConfigurationSnapshotInfoNext(nextPageLink: string, callback: msRest.ServiceCallback): void; + /** + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @param options The optional parameters + * @param callback The callback + */ + listConfigurationSnapshotInfoNext(nextPageLink: string, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; + listConfigurationSnapshotInfoNext(nextPageLink: string, options?: msRest.RequestOptionsBase | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { + return this.client.sendOperationRequest( + { + nextPageLink, + options + }, + listConfigurationSnapshotInfoNextOperationSpec, + callback) as Promise; + } + + /** + * List continuous web jobs for an app, or a deployment slot. + * @summary List continuous web jobs for an app, or a deployment slot. + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @param [options] The optional parameters + * @returns Promise + */ + listContinuousWebJobsNext(nextPageLink: string, options?: msRest.RequestOptionsBase): Promise; + /** + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @param callback The callback + */ + listContinuousWebJobsNext(nextPageLink: string, callback: msRest.ServiceCallback): void; + /** + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @param options The optional parameters + * @param callback The callback + */ + listContinuousWebJobsNext(nextPageLink: string, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; + listContinuousWebJobsNext(nextPageLink: string, options?: msRest.RequestOptionsBase | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { + return this.client.sendOperationRequest( + { + nextPageLink, + options + }, + listContinuousWebJobsNextOperationSpec, + callback) as Promise; + } + + /** + * List deployments for an app, or a deployment slot. + * @summary List deployments for an app, or a deployment slot. + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @param [options] The optional parameters + * @returns Promise + */ + listDeploymentsNext(nextPageLink: string, options?: msRest.RequestOptionsBase): Promise; + /** + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @param callback The callback + */ + listDeploymentsNext(nextPageLink: string, callback: msRest.ServiceCallback): void; + /** + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @param options The optional parameters + * @param callback The callback + */ + listDeploymentsNext(nextPageLink: string, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; + listDeploymentsNext(nextPageLink: string, options?: msRest.RequestOptionsBase | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { + return this.client.sendOperationRequest( + { + nextPageLink, + options + }, + listDeploymentsNextOperationSpec, + callback) as Promise; + } + + /** + * Lists ownership identifiers for domain associated with web app. + * @summary Lists ownership identifiers for domain associated with web app. + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @param [options] The optional parameters + * @returns Promise + */ + listDomainOwnershipIdentifiersNext(nextPageLink: string, options?: msRest.RequestOptionsBase): Promise; + /** + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @param callback The callback + */ + listDomainOwnershipIdentifiersNext(nextPageLink: string, callback: msRest.ServiceCallback): void; + /** + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @param options The optional parameters + * @param callback The callback + */ + listDomainOwnershipIdentifiersNext(nextPageLink: string, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; + listDomainOwnershipIdentifiersNext(nextPageLink: string, options?: msRest.RequestOptionsBase | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { + return this.client.sendOperationRequest( + { + nextPageLink, + options + }, + listDomainOwnershipIdentifiersNextOperationSpec, + callback) as Promise; + } + + /** + * List the functions for a web site, or a deployment slot. + * @summary List the functions for a web site, or a deployment slot. + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @param [options] The optional parameters + * @returns Promise + */ + listFunctionsNext(nextPageLink: string, options?: msRest.RequestOptionsBase): Promise; + /** + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @param callback The callback + */ + listFunctionsNext(nextPageLink: string, callback: msRest.ServiceCallback): void; + /** + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @param options The optional parameters + * @param callback The callback + */ + listFunctionsNext(nextPageLink: string, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; + listFunctionsNext(nextPageLink: string, options?: msRest.RequestOptionsBase | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { + return this.client.sendOperationRequest( + { + nextPageLink, + options + }, + listFunctionsNextOperationSpec, + callback) as Promise; + } + + /** + * Get hostname bindings for an app or a deployment slot. + * @summary Get hostname bindings for an app or a deployment slot. + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @param [options] The optional parameters + * @returns Promise + */ + listHostNameBindingsNext(nextPageLink: string, options?: msRest.RequestOptionsBase): Promise; + /** + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @param callback The callback + */ + listHostNameBindingsNext(nextPageLink: string, callback: msRest.ServiceCallback): void; + /** + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @param options The optional parameters + * @param callback The callback + */ + listHostNameBindingsNext(nextPageLink: string, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; + listHostNameBindingsNext(nextPageLink: string, options?: msRest.RequestOptionsBase | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { + return this.client.sendOperationRequest( + { + nextPageLink, + options + }, + listHostNameBindingsNextOperationSpec, + callback) as Promise; + } + + /** + * Gets all scale-out instances of an app. + * @summary Gets all scale-out instances of an app. + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @param [options] The optional parameters + * @returns Promise + */ + listInstanceIdentifiersNext(nextPageLink: string, options?: msRest.RequestOptionsBase): Promise; + /** + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @param callback The callback + */ + listInstanceIdentifiersNext(nextPageLink: string, callback: msRest.ServiceCallback): void; + /** + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @param options The optional parameters + * @param callback The callback + */ + listInstanceIdentifiersNext(nextPageLink: string, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; + listInstanceIdentifiersNext(nextPageLink: string, options?: msRest.RequestOptionsBase | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { + return this.client.sendOperationRequest( + { + nextPageLink, + options + }, + listInstanceIdentifiersNextOperationSpec, + callback) as Promise; + } + + /** + * 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 list of processes for a web site, or a deployment slot, or for a specific + * scaled-out instance in a web site. + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @param [options] The optional parameters + * @returns Promise + */ + listInstanceProcessesNext(nextPageLink: string, options?: msRest.RequestOptionsBase): Promise; + /** + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @param callback The callback + */ + listInstanceProcessesNext(nextPageLink: string, callback: msRest.ServiceCallback): void; + /** + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @param options The optional parameters + * @param callback The callback + */ + listInstanceProcessesNext(nextPageLink: string, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; + listInstanceProcessesNext(nextPageLink: string, options?: msRest.RequestOptionsBase | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { + return this.client.sendOperationRequest( + { + nextPageLink, + options + }, + listInstanceProcessesNextOperationSpec, + callback) as Promise; + } + + /** + * List module information for a process 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. + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @param [options] The optional parameters + * @returns Promise + */ + listInstanceProcessModulesNext(nextPageLink: string, options?: msRest.RequestOptionsBase): Promise; + /** + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @param callback The callback + */ + listInstanceProcessModulesNext(nextPageLink: string, callback: msRest.ServiceCallback): void; + /** + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @param options The optional parameters + * @param callback The callback + */ + listInstanceProcessModulesNext(nextPageLink: string, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; + listInstanceProcessModulesNext(nextPageLink: string, options?: msRest.RequestOptionsBase | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { + return this.client.sendOperationRequest( + { + nextPageLink, + options + }, + listInstanceProcessModulesNextOperationSpec, + callback) as Promise; + } + + /** + * List the threads in a process by its ID 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. + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @param [options] The optional parameters + * @returns Promise + */ + listInstanceProcessThreadsNext(nextPageLink: string, options?: msRest.RequestOptionsBase): Promise; + /** + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @param callback The callback + */ + listInstanceProcessThreadsNext(nextPageLink: string, callback: msRest.ServiceCallback): void; + /** + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @param options The optional parameters + * @param callback The callback + */ + listInstanceProcessThreadsNext(nextPageLink: string, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; + listInstanceProcessThreadsNext(nextPageLink: string, options?: msRest.RequestOptionsBase | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { + return this.client.sendOperationRequest( + { + nextPageLink, + options + }, + listInstanceProcessThreadsNextOperationSpec, + callback) as Promise; + } + + /** + * Gets all metric definitions of an app (or deployment slot, if specified). + * @summary Gets all metric definitions of an app (or deployment slot, if specified). + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @param [options] The optional parameters + * @returns Promise + */ + listMetricDefinitionsNext(nextPageLink: string, options?: msRest.RequestOptionsBase): Promise; + /** + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @param callback The callback + */ + listMetricDefinitionsNext(nextPageLink: string, callback: msRest.ServiceCallback): void; + /** + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @param options The optional parameters + * @param callback The callback + */ + listMetricDefinitionsNext(nextPageLink: string, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; + listMetricDefinitionsNext(nextPageLink: string, options?: msRest.RequestOptionsBase | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { + return this.client.sendOperationRequest( + { + nextPageLink, + options + }, + listMetricDefinitionsNextOperationSpec, + callback) as Promise; + } + + /** + * Gets performance metrics of an app (or deployment slot, if specified). + * @summary Gets performance metrics of an app (or deployment slot, if specified). + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @param [options] The optional parameters + * @returns Promise + */ + listMetricsNext(nextPageLink: string, options?: msRest.RequestOptionsBase): Promise; + /** + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @param callback The callback + */ + listMetricsNext(nextPageLink: string, callback: msRest.ServiceCallback): void; + /** + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @param options The optional parameters + * @param callback The callback + */ + listMetricsNext(nextPageLink: string, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; + listMetricsNext(nextPageLink: string, options?: msRest.RequestOptionsBase | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { + return this.client.sendOperationRequest( + { + nextPageLink, + options + }, + listMetricsNextOperationSpec, + callback) as Promise; + } + + /** + * Gets perfmon counters for web app. + * @summary Gets perfmon counters for web app. + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @param [options] The optional parameters + * @returns Promise + */ + listPerfMonCountersNext(nextPageLink: string, options?: msRest.RequestOptionsBase): Promise; + /** + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @param callback The callback + */ + listPerfMonCountersNext(nextPageLink: string, callback: msRest.ServiceCallback): void; + /** + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @param options The optional parameters + * @param callback The callback + */ + listPerfMonCountersNext(nextPageLink: string, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; + listPerfMonCountersNext(nextPageLink: string, options?: msRest.RequestOptionsBase | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { + return this.client.sendOperationRequest( + { + nextPageLink, + options + }, + listPerfMonCountersNextOperationSpec, + callback) as Promise; + } + + /** + * 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 list of processes for a web site, or a deployment slot, or for a specific + * scaled-out instance in a web site. + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @param [options] The optional parameters + * @returns Promise + */ + listProcessesNext(nextPageLink: string, options?: msRest.RequestOptionsBase): Promise; + /** + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @param callback The callback + */ + listProcessesNext(nextPageLink: string, callback: msRest.ServiceCallback): void; + /** + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @param options The optional parameters + * @param callback The callback + */ + listProcessesNext(nextPageLink: string, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; + listProcessesNext(nextPageLink: string, options?: msRest.RequestOptionsBase | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { + return this.client.sendOperationRequest( + { + nextPageLink, + options + }, + listProcessesNextOperationSpec, + callback) as Promise; + } + + /** + * List module information for a process 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. + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @param [options] The optional parameters + * @returns Promise + */ + listProcessModulesNext(nextPageLink: string, options?: msRest.RequestOptionsBase): Promise; + /** + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @param callback The callback + */ + listProcessModulesNext(nextPageLink: string, callback: msRest.ServiceCallback): void; + /** + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @param options The optional parameters + * @param callback The callback + */ + listProcessModulesNext(nextPageLink: string, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; + listProcessModulesNext(nextPageLink: string, options?: msRest.RequestOptionsBase | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { + return this.client.sendOperationRequest( + { + nextPageLink, + options + }, + listProcessModulesNextOperationSpec, + callback) as Promise; + } + + /** + * List the threads in a process by its ID 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. + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @param [options] The optional parameters + * @returns Promise + */ + listProcessThreadsNext(nextPageLink: string, options?: msRest.RequestOptionsBase): Promise; + /** + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @param callback The callback + */ + listProcessThreadsNext(nextPageLink: string, callback: msRest.ServiceCallback): void; + /** + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @param options The optional parameters + * @param callback The callback + */ + listProcessThreadsNext(nextPageLink: string, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; + listProcessThreadsNext(nextPageLink: string, options?: msRest.RequestOptionsBase | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { + return this.client.sendOperationRequest( + { + nextPageLink, + options + }, + listProcessThreadsNextOperationSpec, + callback) as Promise; + } + + /** + * Get public certificates for an app or a deployment slot. + * @summary Get public certificates for an app or a deployment slot. + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @param [options] The optional parameters + * @returns Promise + */ + listPublicCertificatesNext(nextPageLink: string, options?: msRest.RequestOptionsBase): Promise; + /** + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @param callback The callback + */ + listPublicCertificatesNext(nextPageLink: string, callback: msRest.ServiceCallback): void; + /** + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @param options The optional parameters + * @param callback The callback + */ + listPublicCertificatesNext(nextPageLink: string, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; + listPublicCertificatesNext(nextPageLink: string, options?: msRest.RequestOptionsBase | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { + return this.client.sendOperationRequest( + { + nextPageLink, + options + }, + listPublicCertificatesNextOperationSpec, + callback) as Promise; + } + + /** + * Get list of siteextensions for a web site, or a deployment slot. + * @summary Get list of siteextensions for a web site, or a deployment slot. + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @param [options] The optional parameters + * @returns Promise + */ + listSiteExtensionsNext(nextPageLink: string, options?: msRest.RequestOptionsBase): Promise; + /** + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @param callback The callback + */ + listSiteExtensionsNext(nextPageLink: string, callback: msRest.ServiceCallback): void; + /** + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @param options The optional parameters + * @param callback The callback + */ + listSiteExtensionsNext(nextPageLink: string, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; + listSiteExtensionsNext(nextPageLink: string, options?: msRest.RequestOptionsBase | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { + return this.client.sendOperationRequest( + { + nextPageLink, + options + }, + listSiteExtensionsNextOperationSpec, + callback) as Promise; + } + + /** + * Gets an app's deployment slots. + * @summary Gets an app's deployment slots. + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @param [options] The optional parameters + * @returns Promise + */ + listSlotsNext(nextPageLink: string, options?: msRest.RequestOptionsBase): Promise; + /** + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @param callback The callback + */ + listSlotsNext(nextPageLink: string, callback: msRest.ServiceCallback): void; + /** + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @param options The optional parameters + * @param callback The callback + */ + listSlotsNext(nextPageLink: string, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; + listSlotsNext(nextPageLink: string, options?: msRest.RequestOptionsBase | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { + return this.client.sendOperationRequest( + { + nextPageLink, + options + }, + listSlotsNextOperationSpec, + callback) as Promise; + } + + /** + * Gets existing backups of an app. + * @summary Gets existing backups of an app. + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @param [options] The optional parameters + * @returns Promise + */ + listBackupsSlotNext(nextPageLink: string, options?: msRest.RequestOptionsBase): Promise; + /** + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @param callback The callback + */ + listBackupsSlotNext(nextPageLink: string, callback: msRest.ServiceCallback): void; + /** + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @param options The optional parameters + * @param callback The callback + */ + listBackupsSlotNext(nextPageLink: string, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; + listBackupsSlotNext(nextPageLink: string, options?: msRest.RequestOptionsBase | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { + return this.client.sendOperationRequest( + { + nextPageLink, + options + }, + listBackupsSlotNextOperationSpec, + callback) as Promise; + } + + /** + * List the configurations of an app + * @summary List the configurations of an app + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @param [options] The optional parameters + * @returns Promise + */ + listConfigurationsSlotNext(nextPageLink: string, options?: msRest.RequestOptionsBase): Promise; + /** + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @param callback The callback + */ + listConfigurationsSlotNext(nextPageLink: string, callback: msRest.ServiceCallback): void; + /** + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @param options The optional parameters + * @param callback The callback + */ + listConfigurationsSlotNext(nextPageLink: string, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; + listConfigurationsSlotNext(nextPageLink: string, options?: msRest.RequestOptionsBase | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { + return this.client.sendOperationRequest( + { + nextPageLink, + options + }, + listConfigurationsSlotNextOperationSpec, + callback) as Promise; + } + + /** + * 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 list of web app configuration snapshots identifiers. Each element of the list + * contains a timestamp and the ID of the snapshot. + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @param [options] The optional parameters + * @returns Promise + */ + listConfigurationSnapshotInfoSlotNext(nextPageLink: string, options?: msRest.RequestOptionsBase): Promise; + /** + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @param callback The callback + */ + listConfigurationSnapshotInfoSlotNext(nextPageLink: string, callback: msRest.ServiceCallback): void; + /** + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @param options The optional parameters + * @param callback The callback + */ + listConfigurationSnapshotInfoSlotNext(nextPageLink: string, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; + listConfigurationSnapshotInfoSlotNext(nextPageLink: string, options?: msRest.RequestOptionsBase | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { + return this.client.sendOperationRequest( + { + nextPageLink, + options + }, + listConfigurationSnapshotInfoSlotNextOperationSpec, + callback) as Promise; + } + + /** + * List continuous web jobs for an app, or a deployment slot. + * @summary List continuous web jobs for an app, or a deployment slot. + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @param [options] The optional parameters + * @returns Promise + */ + listContinuousWebJobsSlotNext(nextPageLink: string, options?: msRest.RequestOptionsBase): Promise; + /** + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @param callback The callback + */ + listContinuousWebJobsSlotNext(nextPageLink: string, callback: msRest.ServiceCallback): void; + /** + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @param options The optional parameters + * @param callback The callback + */ + listContinuousWebJobsSlotNext(nextPageLink: string, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; + listContinuousWebJobsSlotNext(nextPageLink: string, options?: msRest.RequestOptionsBase | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { + return this.client.sendOperationRequest( + { + nextPageLink, + options + }, + listContinuousWebJobsSlotNextOperationSpec, + callback) as Promise; + } + + /** + * List deployments for an app, or a deployment slot. + * @summary List deployments for an app, or a deployment slot. + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @param [options] The optional parameters + * @returns Promise + */ + listDeploymentsSlotNext(nextPageLink: string, options?: msRest.RequestOptionsBase): Promise; + /** + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @param callback The callback + */ + listDeploymentsSlotNext(nextPageLink: string, callback: msRest.ServiceCallback): void; + /** + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @param options The optional parameters + * @param callback The callback + */ + listDeploymentsSlotNext(nextPageLink: string, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; + listDeploymentsSlotNext(nextPageLink: string, options?: msRest.RequestOptionsBase | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { + return this.client.sendOperationRequest( + { + nextPageLink, + options + }, + listDeploymentsSlotNextOperationSpec, + callback) as Promise; + } + + /** + * Lists ownership identifiers for domain associated with web app. + * @summary Lists ownership identifiers for domain associated with web app. + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @param [options] The optional parameters + * @returns Promise + */ + listDomainOwnershipIdentifiersSlotNext(nextPageLink: string, options?: msRest.RequestOptionsBase): Promise; + /** + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @param callback The callback + */ + listDomainOwnershipIdentifiersSlotNext(nextPageLink: string, callback: msRest.ServiceCallback): void; + /** + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @param options The optional parameters + * @param callback The callback + */ + listDomainOwnershipIdentifiersSlotNext(nextPageLink: string, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; + listDomainOwnershipIdentifiersSlotNext(nextPageLink: string, options?: msRest.RequestOptionsBase | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { + return this.client.sendOperationRequest( + { + nextPageLink, + options + }, + listDomainOwnershipIdentifiersSlotNextOperationSpec, + callback) as Promise; + } + + /** + * List the functions for a web site, or a deployment slot. + * @summary List the functions for a web site, or a deployment slot. + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @param [options] The optional parameters + * @returns Promise + */ + listInstanceFunctionsSlotNext(nextPageLink: string, options?: msRest.RequestOptionsBase): Promise; + /** + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @param callback The callback + */ + listInstanceFunctionsSlotNext(nextPageLink: string, callback: msRest.ServiceCallback): void; + /** + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @param options The optional parameters + * @param callback The callback + */ + listInstanceFunctionsSlotNext(nextPageLink: string, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; + listInstanceFunctionsSlotNext(nextPageLink: string, options?: msRest.RequestOptionsBase | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { + return this.client.sendOperationRequest( + { + nextPageLink, + options + }, + listInstanceFunctionsSlotNextOperationSpec, + callback) as Promise; + } + + /** + * Get hostname bindings for an app or a deployment slot. + * @summary Get hostname bindings for an app or a deployment slot. + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @param [options] The optional parameters + * @returns Promise + */ + listHostNameBindingsSlotNext(nextPageLink: string, options?: msRest.RequestOptionsBase): Promise; + /** + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @param callback The callback + */ + listHostNameBindingsSlotNext(nextPageLink: string, callback: msRest.ServiceCallback): void; + /** + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @param options The optional parameters + * @param callback The callback + */ + listHostNameBindingsSlotNext(nextPageLink: string, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; + listHostNameBindingsSlotNext(nextPageLink: string, options?: msRest.RequestOptionsBase | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { + return this.client.sendOperationRequest( + { + nextPageLink, + options + }, + listHostNameBindingsSlotNextOperationSpec, + callback) as Promise; + } + + /** + * Gets all scale-out instances of an app. + * @summary Gets all scale-out instances of an app. + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @param [options] The optional parameters + * @returns Promise + */ + listInstanceIdentifiersSlotNext(nextPageLink: string, options?: msRest.RequestOptionsBase): Promise; + /** + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @param callback The callback + */ + listInstanceIdentifiersSlotNext(nextPageLink: string, callback: msRest.ServiceCallback): void; + /** + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @param options The optional parameters + * @param callback The callback + */ + listInstanceIdentifiersSlotNext(nextPageLink: string, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; + listInstanceIdentifiersSlotNext(nextPageLink: string, options?: msRest.RequestOptionsBase | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { + return this.client.sendOperationRequest( + { + nextPageLink, + options + }, + listInstanceIdentifiersSlotNextOperationSpec, + callback) as Promise; + } + + /** + * 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 list of processes for a web site, or a deployment slot, or for a specific + * scaled-out instance in a web site. + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @param [options] The optional parameters + * @returns Promise + */ + listInstanceProcessesSlotNext(nextPageLink: string, options?: msRest.RequestOptionsBase): Promise; + /** + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @param callback The callback + */ + listInstanceProcessesSlotNext(nextPageLink: string, callback: msRest.ServiceCallback): void; + /** + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @param options The optional parameters + * @param callback The callback + */ + listInstanceProcessesSlotNext(nextPageLink: string, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; + listInstanceProcessesSlotNext(nextPageLink: string, options?: msRest.RequestOptionsBase | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { + return this.client.sendOperationRequest( + { + nextPageLink, + options + }, + listInstanceProcessesSlotNextOperationSpec, + callback) as Promise; + } + + /** + * List module information for a process 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. + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @param [options] The optional parameters + * @returns Promise + */ + listInstanceProcessModulesSlotNext(nextPageLink: string, options?: msRest.RequestOptionsBase): Promise; + /** + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @param callback The callback + */ + listInstanceProcessModulesSlotNext(nextPageLink: string, callback: msRest.ServiceCallback): void; + /** + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @param options The optional parameters + * @param callback The callback + */ + listInstanceProcessModulesSlotNext(nextPageLink: string, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; + listInstanceProcessModulesSlotNext(nextPageLink: string, options?: msRest.RequestOptionsBase | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { + return this.client.sendOperationRequest( + { + nextPageLink, + options + }, + listInstanceProcessModulesSlotNextOperationSpec, + callback) as Promise; + } + + /** + * List the threads in a process by its ID 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. + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @param [options] The optional parameters + * @returns Promise + */ + listInstanceProcessThreadsSlotNext(nextPageLink: string, options?: msRest.RequestOptionsBase): Promise; + /** + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @param callback The callback + */ + listInstanceProcessThreadsSlotNext(nextPageLink: string, callback: msRest.ServiceCallback): void; + /** + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @param options The optional parameters + * @param callback The callback + */ + listInstanceProcessThreadsSlotNext(nextPageLink: string, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; + listInstanceProcessThreadsSlotNext(nextPageLink: string, options?: msRest.RequestOptionsBase | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { + return this.client.sendOperationRequest( + { + nextPageLink, + options + }, + listInstanceProcessThreadsSlotNextOperationSpec, + callback) as Promise; + } + + /** + * Gets all metric definitions of an app (or deployment slot, if specified). + * @summary Gets all metric definitions of an app (or deployment slot, if specified). + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @param [options] The optional parameters + * @returns Promise + */ + listMetricDefinitionsSlotNext(nextPageLink: string, options?: msRest.RequestOptionsBase): Promise; + /** + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @param callback The callback + */ + listMetricDefinitionsSlotNext(nextPageLink: string, callback: msRest.ServiceCallback): void; + /** + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @param options The optional parameters + * @param callback The callback + */ + listMetricDefinitionsSlotNext(nextPageLink: string, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; + listMetricDefinitionsSlotNext(nextPageLink: string, options?: msRest.RequestOptionsBase | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { + return this.client.sendOperationRequest( + { + nextPageLink, + options + }, + listMetricDefinitionsSlotNextOperationSpec, + callback) as Promise; + } + + /** + * Gets performance metrics of an app (or deployment slot, if specified). + * @summary Gets performance metrics of an app (or deployment slot, if specified). + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @param [options] The optional parameters + * @returns Promise + */ + listMetricsSlotNext(nextPageLink: string, options?: msRest.RequestOptionsBase): Promise; + /** + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @param callback The callback + */ + listMetricsSlotNext(nextPageLink: string, callback: msRest.ServiceCallback): void; + /** + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @param options The optional parameters + * @param callback The callback + */ + listMetricsSlotNext(nextPageLink: string, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; + listMetricsSlotNext(nextPageLink: string, options?: msRest.RequestOptionsBase | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { + return this.client.sendOperationRequest( + { + nextPageLink, + options + }, + listMetricsSlotNextOperationSpec, + callback) as Promise; + } + + /** + * Gets perfmon counters for web app. + * @summary Gets perfmon counters for web app. + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @param [options] The optional parameters + * @returns Promise + */ + listPerfMonCountersSlotNext(nextPageLink: string, options?: msRest.RequestOptionsBase): Promise; + /** + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @param callback The callback + */ + listPerfMonCountersSlotNext(nextPageLink: string, callback: msRest.ServiceCallback): void; + /** + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @param options The optional parameters + * @param callback The callback + */ + listPerfMonCountersSlotNext(nextPageLink: string, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; + listPerfMonCountersSlotNext(nextPageLink: string, options?: msRest.RequestOptionsBase | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { + return this.client.sendOperationRequest( + { + nextPageLink, + options + }, + listPerfMonCountersSlotNextOperationSpec, + callback) as Promise; + } + + /** + * 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 list of processes for a web site, or a deployment slot, or for a specific + * scaled-out instance in a web site. + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @param [options] The optional parameters + * @returns Promise + */ + listProcessesSlotNext(nextPageLink: string, options?: msRest.RequestOptionsBase): Promise; + /** + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @param callback The callback + */ + listProcessesSlotNext(nextPageLink: string, callback: msRest.ServiceCallback): void; + /** + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @param options The optional parameters + * @param callback The callback + */ + listProcessesSlotNext(nextPageLink: string, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; + listProcessesSlotNext(nextPageLink: string, options?: msRest.RequestOptionsBase | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { + return this.client.sendOperationRequest( + { + nextPageLink, + options + }, + listProcessesSlotNextOperationSpec, + callback) as Promise; + } + + /** + * List module information for a process 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. + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @param [options] The optional parameters + * @returns Promise + */ + listProcessModulesSlotNext(nextPageLink: string, options?: msRest.RequestOptionsBase): Promise; + /** + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @param callback The callback + */ + listProcessModulesSlotNext(nextPageLink: string, callback: msRest.ServiceCallback): void; + /** + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @param options The optional parameters + * @param callback The callback + */ + listProcessModulesSlotNext(nextPageLink: string, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; + listProcessModulesSlotNext(nextPageLink: string, options?: msRest.RequestOptionsBase | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { + return this.client.sendOperationRequest( + { + nextPageLink, + options + }, + listProcessModulesSlotNextOperationSpec, + callback) as Promise; + } + + /** + * List the threads in a process by its ID 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. + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @param [options] The optional parameters + * @returns Promise + */ + listProcessThreadsSlotNext(nextPageLink: string, options?: msRest.RequestOptionsBase): Promise; + /** + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @param callback The callback + */ + listProcessThreadsSlotNext(nextPageLink: string, callback: msRest.ServiceCallback): void; + /** + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @param options The optional parameters + * @param callback The callback + */ + listProcessThreadsSlotNext(nextPageLink: string, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; + listProcessThreadsSlotNext(nextPageLink: string, options?: msRest.RequestOptionsBase | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { + return this.client.sendOperationRequest( + { + nextPageLink, + options + }, + listProcessThreadsSlotNextOperationSpec, + callback) as Promise; + } + + /** + * Get public certificates for an app or a deployment slot. + * @summary Get public certificates for an app or a deployment slot. + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @param [options] The optional parameters + * @returns Promise + */ + listPublicCertificatesSlotNext(nextPageLink: string, options?: msRest.RequestOptionsBase): Promise; + /** + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @param callback The callback + */ + listPublicCertificatesSlotNext(nextPageLink: string, callback: msRest.ServiceCallback): void; + /** + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @param options The optional parameters + * @param callback The callback + */ + listPublicCertificatesSlotNext(nextPageLink: string, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; + listPublicCertificatesSlotNext(nextPageLink: string, options?: msRest.RequestOptionsBase | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { + return this.client.sendOperationRequest( + { + nextPageLink, + options + }, + listPublicCertificatesSlotNextOperationSpec, + callback) as Promise; + } + + /** + * Get list of siteextensions for a web site, or a deployment slot. + * @summary Get list of siteextensions for a web site, or a deployment slot. + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @param [options] The optional parameters + * @returns Promise + */ + listSiteExtensionsSlotNext(nextPageLink: string, options?: msRest.RequestOptionsBase): Promise; + /** + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @param callback The callback + */ + listSiteExtensionsSlotNext(nextPageLink: string, callback: msRest.ServiceCallback): void; + /** + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @param options The optional parameters + * @param callback The callback + */ + listSiteExtensionsSlotNext(nextPageLink: string, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; + listSiteExtensionsSlotNext(nextPageLink: string, options?: msRest.RequestOptionsBase | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { + return this.client.sendOperationRequest( + { + nextPageLink, + options + }, + listSiteExtensionsSlotNextOperationSpec, + callback) as Promise; + } + + /** + * Get the difference in configuration settings between two web app slots. + * @summary Get the difference in configuration settings between two web app slots. + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @param [options] The optional parameters + * @returns Promise + */ + listSlotDifferencesSlotNext(nextPageLink: string, options?: msRest.RequestOptionsBase): Promise; + /** + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @param callback The callback + */ + listSlotDifferencesSlotNext(nextPageLink: string, callback: msRest.ServiceCallback): void; + /** + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @param options The optional parameters + * @param callback The callback + */ + listSlotDifferencesSlotNext(nextPageLink: string, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; + listSlotDifferencesSlotNext(nextPageLink: string, options?: msRest.RequestOptionsBase | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { + return this.client.sendOperationRequest( + { + nextPageLink, + options + }, + listSlotDifferencesSlotNextOperationSpec, + callback) as Promise; + } + + /** + * Returns all Snapshots to the user. + * @summary Returns all Snapshots to the user. + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @param [options] The optional parameters + * @returns Promise + */ + listSnapshotsSlotNext(nextPageLink: string, options?: msRest.RequestOptionsBase): Promise; + /** + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @param callback The callback + */ + listSnapshotsSlotNext(nextPageLink: string, callback: msRest.ServiceCallback): void; + /** + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @param options The optional parameters + * @param callback The callback + */ + listSnapshotsSlotNext(nextPageLink: string, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; + listSnapshotsSlotNext(nextPageLink: string, options?: msRest.RequestOptionsBase | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { + return this.client.sendOperationRequest( + { + nextPageLink, + options + }, + listSnapshotsSlotNextOperationSpec, + callback) as Promise; + } + + /** + * Returns all Snapshots to the user from DRSecondary endpoint. + * @summary Returns all Snapshots to the user from DRSecondary endpoint. + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @param [options] The optional parameters + * @returns Promise + */ + listSnapshotsFromDRSecondarySlotNext(nextPageLink: string, options?: msRest.RequestOptionsBase): Promise; + /** + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @param callback The callback + */ + listSnapshotsFromDRSecondarySlotNext(nextPageLink: string, callback: msRest.ServiceCallback): void; + /** + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @param options The optional parameters + * @param callback The callback + */ + listSnapshotsFromDRSecondarySlotNext(nextPageLink: string, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; + listSnapshotsFromDRSecondarySlotNext(nextPageLink: string, options?: msRest.RequestOptionsBase | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { + return this.client.sendOperationRequest( + { + nextPageLink, + options + }, + listSnapshotsFromDRSecondarySlotNextOperationSpec, + callback) as Promise; + } + + /** + * List triggered web jobs for an app, or a deployment slot. + * @summary List triggered web jobs for an app, or a deployment slot. + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @param [options] The optional parameters + * @returns Promise + */ + listTriggeredWebJobsSlotNext(nextPageLink: string, options?: msRest.RequestOptionsBase): Promise; + /** + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @param callback The callback + */ + listTriggeredWebJobsSlotNext(nextPageLink: string, callback: msRest.ServiceCallback): void; + /** + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @param options The optional parameters + * @param callback The callback + */ + listTriggeredWebJobsSlotNext(nextPageLink: string, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; + listTriggeredWebJobsSlotNext(nextPageLink: string, options?: msRest.RequestOptionsBase | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { + return this.client.sendOperationRequest( + { + nextPageLink, + options + }, + listTriggeredWebJobsSlotNextOperationSpec, + callback) as Promise; + } + + /** + * List a triggered web job's history for an app, or a deployment slot. + * @summary List a triggered web job's history for an app, or a deployment slot. + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @param [options] The optional parameters + * @returns Promise + */ + listTriggeredWebJobHistorySlotNext(nextPageLink: string, options?: msRest.RequestOptionsBase): Promise; + /** + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @param callback The callback + */ + listTriggeredWebJobHistorySlotNext(nextPageLink: string, callback: msRest.ServiceCallback): void; + /** + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @param options The optional parameters + * @param callback The callback + */ + listTriggeredWebJobHistorySlotNext(nextPageLink: string, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; + listTriggeredWebJobHistorySlotNext(nextPageLink: string, options?: msRest.RequestOptionsBase | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { + return this.client.sendOperationRequest( + { + nextPageLink, + options + }, + listTriggeredWebJobHistorySlotNextOperationSpec, + callback) as Promise; + } + + /** + * Gets the quota usage information of an app (or deployment slot, if specified). + * @summary Gets the quota usage information of an app (or deployment slot, if specified). + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @param [options] The optional parameters + * @returns Promise + */ + listUsagesSlotNext(nextPageLink: string, options?: msRest.RequestOptionsBase): Promise; + /** + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @param callback The callback + */ + listUsagesSlotNext(nextPageLink: string, callback: msRest.ServiceCallback): void; + /** + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @param options The optional parameters + * @param callback The callback + */ + listUsagesSlotNext(nextPageLink: string, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; + listUsagesSlotNext(nextPageLink: string, options?: msRest.RequestOptionsBase | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { + return this.client.sendOperationRequest( + { + nextPageLink, + options + }, + listUsagesSlotNextOperationSpec, + callback) as Promise; + } + + /** + * List webjobs for an app, or a deployment slot. + * @summary List webjobs for an app, or a deployment slot. + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @param [options] The optional parameters + * @returns Promise + */ + listWebJobsSlotNext(nextPageLink: string, options?: msRest.RequestOptionsBase): Promise; + /** + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @param callback The callback + */ + listWebJobsSlotNext(nextPageLink: string, callback: msRest.ServiceCallback): void; + /** + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @param options The optional parameters + * @param callback The callback + */ + listWebJobsSlotNext(nextPageLink: string, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; + listWebJobsSlotNext(nextPageLink: string, options?: msRest.RequestOptionsBase | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { + return this.client.sendOperationRequest( + { + nextPageLink, + options + }, + listWebJobsSlotNextOperationSpec, + callback) as Promise; + } + + /** + * Get the difference in configuration settings between two web app slots. + * @summary Get the difference in configuration settings between two web app slots. + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @param [options] The optional parameters + * @returns Promise + */ + listSlotDifferencesFromProductionNext(nextPageLink: string, options?: msRest.RequestOptionsBase): Promise; + /** + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @param callback The callback + */ + listSlotDifferencesFromProductionNext(nextPageLink: string, callback: msRest.ServiceCallback): void; + /** + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @param options The optional parameters + * @param callback The callback + */ + listSlotDifferencesFromProductionNext(nextPageLink: string, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; + listSlotDifferencesFromProductionNext(nextPageLink: string, options?: msRest.RequestOptionsBase | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { + return this.client.sendOperationRequest( + { + nextPageLink, + options + }, + listSlotDifferencesFromProductionNextOperationSpec, + callback) as Promise; + } + + /** + * Returns all Snapshots to the user. + * @summary Returns all Snapshots to the user. + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @param [options] The optional parameters + * @returns Promise + */ + listSnapshotsNext(nextPageLink: string, options?: msRest.RequestOptionsBase): Promise; + /** + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @param callback The callback + */ + listSnapshotsNext(nextPageLink: string, callback: msRest.ServiceCallback): void; + /** + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @param options The optional parameters + * @param callback The callback + */ + listSnapshotsNext(nextPageLink: string, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; + listSnapshotsNext(nextPageLink: string, options?: msRest.RequestOptionsBase | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { + return this.client.sendOperationRequest( + { + nextPageLink, + options + }, + listSnapshotsNextOperationSpec, + callback) as Promise; + } + + /** + * Returns all Snapshots to the user from DRSecondary endpoint. + * @summary Returns all Snapshots to the user from DRSecondary endpoint. + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @param [options] The optional parameters + * @returns Promise + */ + listSnapshotsFromDRSecondaryNext(nextPageLink: string, options?: msRest.RequestOptionsBase): Promise; + /** + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @param callback The callback + */ + listSnapshotsFromDRSecondaryNext(nextPageLink: string, callback: msRest.ServiceCallback): void; + /** + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @param options The optional parameters + * @param callback The callback + */ + listSnapshotsFromDRSecondaryNext(nextPageLink: string, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; + listSnapshotsFromDRSecondaryNext(nextPageLink: string, options?: msRest.RequestOptionsBase | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { + return this.client.sendOperationRequest( + { + nextPageLink, + options + }, + listSnapshotsFromDRSecondaryNextOperationSpec, + callback) as Promise; + } + + /** + * List triggered web jobs for an app, or a deployment slot. + * @summary List triggered web jobs for an app, or a deployment slot. + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @param [options] The optional parameters + * @returns Promise + */ + listTriggeredWebJobsNext(nextPageLink: string, options?: msRest.RequestOptionsBase): Promise; + /** + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @param callback The callback + */ + listTriggeredWebJobsNext(nextPageLink: string, callback: msRest.ServiceCallback): void; + /** + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @param options The optional parameters + * @param callback The callback + */ + listTriggeredWebJobsNext(nextPageLink: string, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; + listTriggeredWebJobsNext(nextPageLink: string, options?: msRest.RequestOptionsBase | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { + return this.client.sendOperationRequest( + { + nextPageLink, + options + }, + listTriggeredWebJobsNextOperationSpec, + callback) as Promise; + } + + /** + * List a triggered web job's history for an app, or a deployment slot. + * @summary List a triggered web job's history for an app, or a deployment slot. + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @param [options] The optional parameters + * @returns Promise + */ + listTriggeredWebJobHistoryNext(nextPageLink: string, options?: msRest.RequestOptionsBase): Promise; + /** + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @param callback The callback + */ + listTriggeredWebJobHistoryNext(nextPageLink: string, callback: msRest.ServiceCallback): void; + /** + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @param options The optional parameters + * @param callback The callback + */ + listTriggeredWebJobHistoryNext(nextPageLink: string, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; + listTriggeredWebJobHistoryNext(nextPageLink: string, options?: msRest.RequestOptionsBase | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { + return this.client.sendOperationRequest( + { + nextPageLink, + options + }, + listTriggeredWebJobHistoryNextOperationSpec, + callback) as Promise; + } + + /** + * Gets the quota usage information of an app (or deployment slot, if specified). + * @summary Gets the quota usage information of an app (or deployment slot, if specified). + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @param [options] The optional parameters + * @returns Promise + */ + listUsagesNext(nextPageLink: string, options?: msRest.RequestOptionsBase): Promise; + /** + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @param callback The callback + */ + listUsagesNext(nextPageLink: string, callback: msRest.ServiceCallback): void; + /** + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @param options The optional parameters + * @param callback The callback + */ + listUsagesNext(nextPageLink: string, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; + listUsagesNext(nextPageLink: string, options?: msRest.RequestOptionsBase | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { + return this.client.sendOperationRequest( + { + nextPageLink, + options + }, + listUsagesNextOperationSpec, + callback) as Promise; + } + + /** + * List webjobs for an app, or a deployment slot. + * @summary List webjobs for an app, or a deployment slot. + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @param [options] The optional parameters + * @returns Promise + */ + listWebJobsNext(nextPageLink: string, options?: msRest.RequestOptionsBase): Promise; + /** + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @param callback The callback + */ + listWebJobsNext(nextPageLink: string, callback: msRest.ServiceCallback): void; + /** + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @param options The optional parameters + * @param callback The callback + */ + listWebJobsNext(nextPageLink: string, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; + listWebJobsNext(nextPageLink: string, options?: msRest.RequestOptionsBase | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { + return this.client.sendOperationRequest( + { + nextPageLink, + options + }, + listWebJobsNextOperationSpec, + callback) as Promise; + } +} + +// Operation Specifications +const serializer = new msRest.Serializer(Mappers); +const listOperationSpec: msRest.OperationSpec = { + httpMethod: "GET", + path: "subscriptions/{subscriptionId}/providers/Microsoft.Web/sites", + urlParameters: [ + Parameters.subscriptionId + ], + queryParameters: [ + Parameters.apiVersion + ], + headerParameters: [ + Parameters.acceptLanguage + ], + responses: { + 200: { + bodyMapper: Mappers.WebAppCollection + }, + default: { + bodyMapper: Mappers.DefaultErrorResponse + } + }, + serializer +}; + +const listByResourceGroupOperationSpec: msRest.OperationSpec = { + httpMethod: "GET", + path: "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites", + urlParameters: [ + Parameters.resourceGroupName, + Parameters.subscriptionId + ], + queryParameters: [ + Parameters.includeSlots, + Parameters.apiVersion + ], + headerParameters: [ + Parameters.acceptLanguage + ], + responses: { + 200: { + bodyMapper: Mappers.WebAppCollection + }, + default: { + bodyMapper: Mappers.DefaultErrorResponse + } + }, + serializer +}; + +const getOperationSpec: msRest.OperationSpec = { + httpMethod: "GET", + path: "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}", + urlParameters: [ + Parameters.resourceGroupName, + Parameters.name, + Parameters.subscriptionId + ], + queryParameters: [ + Parameters.apiVersion + ], + headerParameters: [ + Parameters.acceptLanguage + ], + responses: { + 200: { + bodyMapper: Mappers.Site + }, + 404: {}, + default: { + bodyMapper: Mappers.CloudError + } + }, + serializer +}; + +const deleteMethodOperationSpec: msRest.OperationSpec = { + httpMethod: "DELETE", + path: "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}", + urlParameters: [ + Parameters.resourceGroupName, + Parameters.name, + Parameters.subscriptionId + ], + queryParameters: [ + Parameters.deleteMetrics, + Parameters.deleteEmptyServerFarm, + Parameters.apiVersion + ], + headerParameters: [ + Parameters.acceptLanguage + ], + responses: { + 200: {}, + 204: {}, + 404: {}, + default: { + bodyMapper: Mappers.CloudError + } + }, + serializer +}; + +const updateOperationSpec: msRest.OperationSpec = { + httpMethod: "PATCH", + path: "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}", + urlParameters: [ + Parameters.resourceGroupName, + Parameters.name, + Parameters.subscriptionId + ], + queryParameters: [ + Parameters.apiVersion + ], + headerParameters: [ + Parameters.acceptLanguage + ], + requestBody: { + parameterPath: "siteEnvelope", + mapper: { + ...Mappers.SitePatchResource, + required: true + } + }, + responses: { + 200: { + bodyMapper: Mappers.Site + }, + 202: { + bodyMapper: Mappers.Site + }, + default: { + bodyMapper: Mappers.DefaultErrorResponse + } + }, + serializer +}; + +const analyzeCustomHostnameOperationSpec: msRest.OperationSpec = { + httpMethod: "GET", + path: "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/analyzeCustomHostname", + urlParameters: [ + Parameters.resourceGroupName, + Parameters.name, + Parameters.subscriptionId + ], + queryParameters: [ + Parameters.hostName0, + Parameters.apiVersion + ], + headerParameters: [ + Parameters.acceptLanguage + ], + responses: { + 200: { + bodyMapper: Mappers.CustomHostnameAnalysisResult + }, + default: { + bodyMapper: Mappers.DefaultErrorResponse + } + }, + serializer +}; + +const applySlotConfigToProductionOperationSpec: msRest.OperationSpec = { + httpMethod: "POST", + path: "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/applySlotConfig", + urlParameters: [ + Parameters.resourceGroupName, + Parameters.name, + Parameters.subscriptionId + ], + queryParameters: [ + Parameters.apiVersion + ], + headerParameters: [ + Parameters.acceptLanguage + ], + requestBody: { + parameterPath: "slotSwapEntity", + mapper: { + ...Mappers.CsmSlotEntity, + required: true + } + }, + responses: { + 200: {}, + default: { + bodyMapper: Mappers.CloudError + } + }, + serializer +}; + +const backupOperationSpec: msRest.OperationSpec = { + httpMethod: "POST", + path: "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/backup", + urlParameters: [ + Parameters.resourceGroupName, + Parameters.name, + Parameters.subscriptionId + ], + queryParameters: [ + Parameters.apiVersion + ], + headerParameters: [ + Parameters.acceptLanguage + ], + requestBody: { + parameterPath: "request", + mapper: { + ...Mappers.BackupRequest, + required: true + } + }, + responses: { + 200: { + bodyMapper: Mappers.BackupItem + }, + default: { + bodyMapper: Mappers.DefaultErrorResponse + } + }, + serializer +}; + +const listBackupsOperationSpec: msRest.OperationSpec = { + httpMethod: "GET", + path: "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/backups", + urlParameters: [ + Parameters.resourceGroupName, + Parameters.name, + Parameters.subscriptionId + ], + queryParameters: [ + Parameters.apiVersion + ], + headerParameters: [ + Parameters.acceptLanguage + ], + responses: { + 200: { + bodyMapper: Mappers.BackupItemCollection + }, + default: { + bodyMapper: Mappers.DefaultErrorResponse + } + }, + serializer +}; + +const getBackupStatusOperationSpec: msRest.OperationSpec = { + httpMethod: "GET", + path: "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/backups/{backupId}", + urlParameters: [ + Parameters.resourceGroupName, + Parameters.name, + Parameters.backupId, + Parameters.subscriptionId + ], + queryParameters: [ + Parameters.apiVersion + ], + headerParameters: [ + Parameters.acceptLanguage + ], + responses: { + 200: { + bodyMapper: Mappers.BackupItem + }, + default: { + bodyMapper: Mappers.DefaultErrorResponse + } + }, + serializer +}; + +const deleteBackupOperationSpec: msRest.OperationSpec = { + httpMethod: "DELETE", + path: "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/backups/{backupId}", + urlParameters: [ + Parameters.resourceGroupName, + Parameters.name, + Parameters.backupId, + Parameters.subscriptionId + ], + queryParameters: [ + Parameters.apiVersion + ], + headerParameters: [ + Parameters.acceptLanguage + ], + responses: { + 200: {}, + 404: {}, + default: { + bodyMapper: Mappers.CloudError + } + }, + serializer +}; + +const listBackupStatusSecretsOperationSpec: msRest.OperationSpec = { + httpMethod: "POST", + path: "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/backups/{backupId}/list", + urlParameters: [ + Parameters.resourceGroupName, + Parameters.name, + Parameters.backupId, + Parameters.subscriptionId + ], + queryParameters: [ + Parameters.apiVersion + ], + headerParameters: [ + Parameters.acceptLanguage + ], + requestBody: { + parameterPath: "request", + mapper: { + ...Mappers.BackupRequest, + required: true + } + }, + responses: { + 200: { + bodyMapper: Mappers.BackupItem + }, + default: { + bodyMapper: Mappers.DefaultErrorResponse + } + }, + serializer +}; + +const listConfigurationsOperationSpec: msRest.OperationSpec = { + httpMethod: "GET", + path: "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/config", + urlParameters: [ + Parameters.resourceGroupName, + Parameters.name, + Parameters.subscriptionId + ], + queryParameters: [ + Parameters.apiVersion + ], + headerParameters: [ + Parameters.acceptLanguage + ], + responses: { + 200: { + bodyMapper: Mappers.SiteConfigResourceCollection + }, + default: { + bodyMapper: Mappers.DefaultErrorResponse + } + }, + serializer +}; + +const updateApplicationSettingsOperationSpec: msRest.OperationSpec = { + httpMethod: "PUT", + path: "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/config/appsettings", + urlParameters: [ + Parameters.resourceGroupName, + Parameters.name, + Parameters.subscriptionId + ], + queryParameters: [ + Parameters.apiVersion + ], + headerParameters: [ + Parameters.acceptLanguage + ], + requestBody: { + parameterPath: "appSettings", + mapper: { + ...Mappers.StringDictionary, + required: true + } + }, + responses: { + 200: { + bodyMapper: Mappers.StringDictionary + }, + default: { + bodyMapper: Mappers.DefaultErrorResponse + } + }, + serializer +}; + +const listApplicationSettingsOperationSpec: msRest.OperationSpec = { + httpMethod: "POST", + path: "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/config/appsettings/list", + urlParameters: [ + Parameters.resourceGroupName, + Parameters.name, + Parameters.subscriptionId + ], + queryParameters: [ + Parameters.apiVersion + ], + headerParameters: [ + Parameters.acceptLanguage + ], + responses: { + 200: { + bodyMapper: Mappers.StringDictionary + }, + default: { + bodyMapper: Mappers.DefaultErrorResponse + } + }, + serializer +}; + +const updateAuthSettingsOperationSpec: msRest.OperationSpec = { + httpMethod: "PUT", + path: "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/config/authsettings", + urlParameters: [ + Parameters.resourceGroupName, + Parameters.name, + Parameters.subscriptionId + ], + queryParameters: [ + Parameters.apiVersion + ], + headerParameters: [ + Parameters.acceptLanguage + ], + requestBody: { + parameterPath: "siteAuthSettings", + mapper: { + ...Mappers.SiteAuthSettings, + required: true + } + }, + responses: { + 200: { + bodyMapper: Mappers.SiteAuthSettings + }, + default: { + bodyMapper: Mappers.DefaultErrorResponse + } + }, + serializer +}; + +const getAuthSettingsOperationSpec: msRest.OperationSpec = { + httpMethod: "POST", + path: "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/config/authsettings/list", + urlParameters: [ + Parameters.resourceGroupName, + Parameters.name, + Parameters.subscriptionId + ], + queryParameters: [ + Parameters.apiVersion + ], + headerParameters: [ + Parameters.acceptLanguage + ], + responses: { + 200: { + bodyMapper: Mappers.SiteAuthSettings + }, + default: { + bodyMapper: Mappers.DefaultErrorResponse + } + }, + serializer +}; + +const updateAzureStorageAccountsOperationSpec: msRest.OperationSpec = { + httpMethod: "PUT", + path: "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/config/azurestorageaccounts", + urlParameters: [ + Parameters.resourceGroupName, + Parameters.name, + Parameters.subscriptionId + ], + queryParameters: [ + Parameters.apiVersion + ], + headerParameters: [ + Parameters.acceptLanguage + ], + requestBody: { + parameterPath: "azureStorageAccounts", + mapper: { + ...Mappers.AzureStoragePropertyDictionaryResource, + required: true + } + }, + responses: { + 200: { + bodyMapper: Mappers.AzureStoragePropertyDictionaryResource + }, + default: { + bodyMapper: Mappers.DefaultErrorResponse + } + }, + serializer +}; + +const listAzureStorageAccountsOperationSpec: msRest.OperationSpec = { + httpMethod: "POST", + path: "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/config/azurestorageaccounts/list", + urlParameters: [ + Parameters.resourceGroupName, + Parameters.name, + Parameters.subscriptionId + ], + queryParameters: [ + Parameters.apiVersion + ], + headerParameters: [ + Parameters.acceptLanguage + ], + responses: { + 200: { + bodyMapper: Mappers.AzureStoragePropertyDictionaryResource + }, + default: { + bodyMapper: Mappers.DefaultErrorResponse + } + }, + serializer +}; + +const updateBackupConfigurationOperationSpec: msRest.OperationSpec = { + httpMethod: "PUT", + path: "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/config/backup", + urlParameters: [ + Parameters.resourceGroupName, + Parameters.name, + Parameters.subscriptionId + ], + queryParameters: [ + Parameters.apiVersion + ], + headerParameters: [ + Parameters.acceptLanguage + ], + requestBody: { + parameterPath: "request", + mapper: { + ...Mappers.BackupRequest, + required: true + } + }, + responses: { + 200: { + bodyMapper: Mappers.BackupRequest + }, + default: { + bodyMapper: Mappers.DefaultErrorResponse + } + }, + serializer +}; + +const deleteBackupConfigurationOperationSpec: msRest.OperationSpec = { + httpMethod: "DELETE", + path: "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/config/backup", + urlParameters: [ + Parameters.resourceGroupName, + Parameters.name, + Parameters.subscriptionId + ], + queryParameters: [ + Parameters.apiVersion + ], + headerParameters: [ + Parameters.acceptLanguage + ], + responses: { + 200: {}, + default: { + bodyMapper: Mappers.CloudError + } + }, + serializer +}; + +const getBackupConfigurationOperationSpec: msRest.OperationSpec = { + httpMethod: "POST", + path: "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/config/backup/list", + urlParameters: [ + Parameters.resourceGroupName, + Parameters.name, + Parameters.subscriptionId + ], + queryParameters: [ + Parameters.apiVersion + ], + headerParameters: [ + Parameters.acceptLanguage + ], + responses: { + 200: { + bodyMapper: Mappers.BackupRequest + }, + default: { + bodyMapper: Mappers.DefaultErrorResponse + } + }, + serializer +}; + +const updateConnectionStringsOperationSpec: msRest.OperationSpec = { + httpMethod: "PUT", + path: "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/config/connectionstrings", + urlParameters: [ + Parameters.resourceGroupName, + Parameters.name, + Parameters.subscriptionId + ], + queryParameters: [ + Parameters.apiVersion + ], + headerParameters: [ + Parameters.acceptLanguage + ], + requestBody: { + parameterPath: "connectionStrings", + mapper: { + ...Mappers.ConnectionStringDictionary, + required: true + } + }, + responses: { + 200: { + bodyMapper: Mappers.ConnectionStringDictionary + }, + default: { + bodyMapper: Mappers.DefaultErrorResponse + } + }, + serializer +}; + +const listConnectionStringsOperationSpec: msRest.OperationSpec = { + httpMethod: "POST", + path: "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/config/connectionstrings/list", + urlParameters: [ + Parameters.resourceGroupName, + Parameters.name, + Parameters.subscriptionId + ], + queryParameters: [ + Parameters.apiVersion + ], + headerParameters: [ + Parameters.acceptLanguage + ], + responses: { + 200: { + bodyMapper: Mappers.ConnectionStringDictionary + }, + default: { + bodyMapper: Mappers.DefaultErrorResponse + } + }, + serializer +}; + +const getDiagnosticLogsConfigurationOperationSpec: msRest.OperationSpec = { + httpMethod: "GET", + path: "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/config/logs", + urlParameters: [ + Parameters.resourceGroupName, + Parameters.name, + Parameters.subscriptionId + ], + queryParameters: [ + Parameters.apiVersion + ], + headerParameters: [ + Parameters.acceptLanguage + ], + responses: { + 200: { + bodyMapper: Mappers.SiteLogsConfig + }, + default: { + bodyMapper: Mappers.DefaultErrorResponse + } + }, + serializer +}; + +const updateDiagnosticLogsConfigOperationSpec: msRest.OperationSpec = { + httpMethod: "PUT", + path: "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/config/logs", + urlParameters: [ + Parameters.resourceGroupName, + Parameters.name, + Parameters.subscriptionId + ], + queryParameters: [ + Parameters.apiVersion + ], + headerParameters: [ + Parameters.acceptLanguage + ], + requestBody: { + parameterPath: "siteLogsConfig", + mapper: { + ...Mappers.SiteLogsConfig, + required: true + } + }, + responses: { + 200: { + bodyMapper: Mappers.SiteLogsConfig + }, + default: { + bodyMapper: Mappers.DefaultErrorResponse + } + }, + serializer +}; + +const updateMetadataOperationSpec: msRest.OperationSpec = { + httpMethod: "PUT", + path: "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/config/metadata", + urlParameters: [ + Parameters.resourceGroupName, + Parameters.name, + Parameters.subscriptionId + ], + queryParameters: [ + Parameters.apiVersion + ], + headerParameters: [ + Parameters.acceptLanguage + ], + requestBody: { + parameterPath: "metadata", + mapper: { + ...Mappers.StringDictionary, + required: true + } + }, + responses: { + 200: { + bodyMapper: Mappers.StringDictionary + }, + default: { + bodyMapper: Mappers.DefaultErrorResponse + } + }, + serializer +}; + +const listMetadataOperationSpec: msRest.OperationSpec = { + httpMethod: "POST", + path: "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/config/metadata/list", + urlParameters: [ + Parameters.resourceGroupName, + Parameters.name, + Parameters.subscriptionId + ], + queryParameters: [ + Parameters.apiVersion + ], + headerParameters: [ + Parameters.acceptLanguage + ], + responses: { + 200: { + bodyMapper: Mappers.StringDictionary + }, + default: { + bodyMapper: Mappers.DefaultErrorResponse + } + }, + serializer +}; + +const updateSitePushSettingsOperationSpec: msRest.OperationSpec = { + httpMethod: "PUT", + path: "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/config/pushsettings", + urlParameters: [ + Parameters.resourceGroupName, + Parameters.name, + Parameters.subscriptionId + ], + queryParameters: [ + Parameters.apiVersion + ], + headerParameters: [ + Parameters.acceptLanguage + ], + requestBody: { + parameterPath: "pushSettings", + mapper: { + ...Mappers.PushSettings, + required: true + } + }, + responses: { + 200: { + bodyMapper: Mappers.PushSettings + }, + default: { + bodyMapper: Mappers.DefaultErrorResponse + } + }, + serializer +}; + +const listSitePushSettingsOperationSpec: msRest.OperationSpec = { + httpMethod: "POST", + path: "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/config/pushsettings/list", + urlParameters: [ + Parameters.resourceGroupName, + Parameters.name, + Parameters.subscriptionId + ], + queryParameters: [ + Parameters.apiVersion + ], + headerParameters: [ + Parameters.acceptLanguage + ], + responses: { + 200: { + bodyMapper: Mappers.PushSettings + }, + default: { + bodyMapper: Mappers.DefaultErrorResponse + } + }, + serializer +}; + +const listSlotConfigurationNamesOperationSpec: msRest.OperationSpec = { + httpMethod: "GET", + path: "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/config/slotConfigNames", + urlParameters: [ + Parameters.resourceGroupName, + Parameters.name, + Parameters.subscriptionId + ], + queryParameters: [ + Parameters.apiVersion + ], + headerParameters: [ + Parameters.acceptLanguage + ], + responses: { + 200: { + bodyMapper: Mappers.SlotConfigNamesResource + }, + default: { + bodyMapper: Mappers.DefaultErrorResponse + } + }, + serializer +}; + +const updateSlotConfigurationNamesOperationSpec: msRest.OperationSpec = { + httpMethod: "PUT", + path: "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/config/slotConfigNames", + urlParameters: [ + Parameters.resourceGroupName, + Parameters.name, + Parameters.subscriptionId + ], + queryParameters: [ + Parameters.apiVersion + ], + headerParameters: [ + Parameters.acceptLanguage + ], + requestBody: { + parameterPath: "slotConfigNames", + mapper: { + ...Mappers.SlotConfigNamesResource, + required: true + } + }, + responses: { + 200: { + bodyMapper: Mappers.SlotConfigNamesResource + }, + default: { + bodyMapper: Mappers.DefaultErrorResponse + } + }, + serializer +}; + +const getConfigurationOperationSpec: msRest.OperationSpec = { + httpMethod: "GET", + path: "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/config/web", + urlParameters: [ + Parameters.resourceGroupName, + Parameters.name, + Parameters.subscriptionId + ], + queryParameters: [ + Parameters.apiVersion + ], + headerParameters: [ + Parameters.acceptLanguage + ], + responses: { + 200: { + bodyMapper: Mappers.SiteConfigResource + }, + default: { + bodyMapper: Mappers.DefaultErrorResponse + } + }, + serializer +}; + +const createOrUpdateConfigurationOperationSpec: msRest.OperationSpec = { + httpMethod: "PUT", + path: "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/config/web", + urlParameters: [ + Parameters.resourceGroupName, + Parameters.name, + Parameters.subscriptionId + ], + queryParameters: [ + Parameters.apiVersion + ], + headerParameters: [ + Parameters.acceptLanguage + ], + requestBody: { + parameterPath: "siteConfig", + mapper: { + ...Mappers.SiteConfigResource, + required: true + } + }, + responses: { + 200: { + bodyMapper: Mappers.SiteConfigResource + }, + default: { + bodyMapper: Mappers.DefaultErrorResponse + } + }, + serializer +}; + +const updateConfigurationOperationSpec: msRest.OperationSpec = { + httpMethod: "PATCH", + path: "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/config/web", + urlParameters: [ + Parameters.resourceGroupName, + Parameters.name, + Parameters.subscriptionId + ], + queryParameters: [ + Parameters.apiVersion + ], + headerParameters: [ + Parameters.acceptLanguage + ], + requestBody: { + parameterPath: "siteConfig", + mapper: { + ...Mappers.SiteConfigResource, + required: true + } + }, + responses: { + 200: { + bodyMapper: Mappers.SiteConfigResource + }, + default: { + bodyMapper: Mappers.DefaultErrorResponse + } + }, + serializer +}; + +const listConfigurationSnapshotInfoOperationSpec: msRest.OperationSpec = { + httpMethod: "GET", + path: "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/config/web/snapshots", + urlParameters: [ + Parameters.resourceGroupName, + Parameters.name, + Parameters.subscriptionId + ], + queryParameters: [ + Parameters.apiVersion + ], + headerParameters: [ + Parameters.acceptLanguage + ], + responses: { + 200: { + bodyMapper: Mappers.SiteConfigurationSnapshotInfoCollection + }, + default: { + bodyMapper: Mappers.DefaultErrorResponse + } + }, + serializer +}; + +const getConfigurationSnapshotOperationSpec: msRest.OperationSpec = { + httpMethod: "GET", + path: "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/config/web/snapshots/{snapshotId}", + urlParameters: [ + Parameters.resourceGroupName, + Parameters.name, + Parameters.snapshotId, + Parameters.subscriptionId + ], + queryParameters: [ + Parameters.apiVersion + ], + headerParameters: [ + Parameters.acceptLanguage + ], + responses: { + 200: { + bodyMapper: Mappers.SiteConfigResource + }, + default: { + bodyMapper: Mappers.DefaultErrorResponse + } + }, + serializer +}; + +const recoverSiteConfigurationSnapshotOperationSpec: msRest.OperationSpec = { + httpMethod: "POST", + path: "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/config/web/snapshots/{snapshotId}/recover", + urlParameters: [ + Parameters.resourceGroupName, + Parameters.name, + Parameters.snapshotId, + Parameters.subscriptionId + ], + queryParameters: [ + Parameters.apiVersion + ], + headerParameters: [ + Parameters.acceptLanguage + ], + responses: { + 204: {}, + default: { + bodyMapper: Mappers.CloudError + } + }, + serializer +}; + +const getWebSiteContainerLogsOperationSpec: msRest.OperationSpec = { + httpMethod: "POST", + path: "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/containerlogs", + urlParameters: [ + Parameters.resourceGroupName, + Parameters.name, + Parameters.subscriptionId + ], + queryParameters: [ + Parameters.apiVersion + ], + headerParameters: [ + Parameters.acceptLanguage + ], + responses: { + 200: { + bodyMapper: { + serializedName: "parsedResponse", + type: { + name: "Stream" + } + } + }, + 204: {}, + default: { + bodyMapper: Mappers.CloudError + } + }, + serializer +}; + +const getContainerLogsZipOperationSpec: msRest.OperationSpec = { + httpMethod: "POST", + path: "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/containerlogs/zip/download", + urlParameters: [ + Parameters.resourceGroupName, + Parameters.name, + Parameters.subscriptionId + ], + queryParameters: [ + Parameters.apiVersion + ], + headerParameters: [ + Parameters.acceptLanguage + ], + responses: { + 200: { + bodyMapper: { + serializedName: "parsedResponse", + type: { + name: "Stream" + } + } + }, + 204: {}, + default: { + bodyMapper: Mappers.CloudError + } + }, + serializer +}; + +const listContinuousWebJobsOperationSpec: msRest.OperationSpec = { + httpMethod: "GET", + path: "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/continuouswebjobs", + urlParameters: [ + Parameters.resourceGroupName, + Parameters.name, + Parameters.subscriptionId + ], + queryParameters: [ + Parameters.apiVersion + ], + headerParameters: [ + Parameters.acceptLanguage + ], + responses: { + 200: { + bodyMapper: Mappers.ContinuousWebJobCollection + }, + default: { + bodyMapper: Mappers.DefaultErrorResponse + } + }, + serializer +}; + +const getContinuousWebJobOperationSpec: msRest.OperationSpec = { + httpMethod: "GET", + path: "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/continuouswebjobs/{webJobName}", + urlParameters: [ + Parameters.resourceGroupName, + Parameters.name, + Parameters.webJobName, + Parameters.subscriptionId + ], + queryParameters: [ + Parameters.apiVersion + ], + headerParameters: [ + Parameters.acceptLanguage + ], + responses: { + 200: { + bodyMapper: Mappers.ContinuousWebJob + }, + 404: {}, + default: { + bodyMapper: Mappers.CloudError + } + }, + serializer +}; + +const deleteContinuousWebJobOperationSpec: msRest.OperationSpec = { + httpMethod: "DELETE", + path: "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/continuouswebjobs/{webJobName}", + urlParameters: [ + Parameters.resourceGroupName, + Parameters.name, + Parameters.webJobName, + Parameters.subscriptionId + ], + queryParameters: [ + Parameters.apiVersion + ], + headerParameters: [ + Parameters.acceptLanguage + ], + responses: { + 200: {}, + 204: {}, + default: { + bodyMapper: Mappers.CloudError + } + }, + serializer +}; + +const startContinuousWebJobOperationSpec: msRest.OperationSpec = { + httpMethod: "POST", + path: "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/continuouswebjobs/{webJobName}/start", + urlParameters: [ + Parameters.resourceGroupName, + Parameters.name, + Parameters.webJobName, + Parameters.subscriptionId + ], + queryParameters: [ + Parameters.apiVersion + ], + headerParameters: [ + Parameters.acceptLanguage + ], + responses: { + 200: {}, + 404: {}, + default: { + bodyMapper: Mappers.CloudError + } + }, + serializer +}; + +const stopContinuousWebJobOperationSpec: msRest.OperationSpec = { + httpMethod: "POST", + path: "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/continuouswebjobs/{webJobName}/stop", + urlParameters: [ + Parameters.resourceGroupName, + Parameters.name, + Parameters.webJobName, + Parameters.subscriptionId + ], + queryParameters: [ + Parameters.apiVersion + ], + headerParameters: [ + Parameters.acceptLanguage + ], + responses: { + 200: {}, + 404: {}, + default: { + bodyMapper: Mappers.CloudError + } + }, + serializer +}; + +const listDeploymentsOperationSpec: msRest.OperationSpec = { + httpMethod: "GET", + path: "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/deployments", + urlParameters: [ + Parameters.resourceGroupName, + Parameters.name, + Parameters.subscriptionId + ], + queryParameters: [ + Parameters.apiVersion + ], + headerParameters: [ + Parameters.acceptLanguage + ], + responses: { + 200: { + bodyMapper: Mappers.DeploymentCollection + }, + default: { + bodyMapper: Mappers.DefaultErrorResponse + } + }, + serializer +}; + +const getDeploymentOperationSpec: msRest.OperationSpec = { + httpMethod: "GET", + path: "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/deployments/{id}", + urlParameters: [ + Parameters.resourceGroupName, + Parameters.name, + Parameters.id, + Parameters.subscriptionId + ], + queryParameters: [ + Parameters.apiVersion + ], + headerParameters: [ + Parameters.acceptLanguage + ], + responses: { + 200: { + bodyMapper: Mappers.Deployment + }, + default: { + bodyMapper: Mappers.DefaultErrorResponse + } + }, + serializer +}; + +const createDeploymentOperationSpec: msRest.OperationSpec = { + httpMethod: "PUT", + path: "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/deployments/{id}", + urlParameters: [ + Parameters.resourceGroupName, + Parameters.name, + Parameters.id, + Parameters.subscriptionId + ], + queryParameters: [ + Parameters.apiVersion + ], + headerParameters: [ + Parameters.acceptLanguage + ], + requestBody: { + parameterPath: "deployment", + mapper: { + ...Mappers.Deployment, + required: true + } + }, + responses: { + 200: { + bodyMapper: Mappers.Deployment + }, + default: { + bodyMapper: Mappers.DefaultErrorResponse + } + }, + serializer +}; + +const deleteDeploymentOperationSpec: msRest.OperationSpec = { + httpMethod: "DELETE", + path: "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/deployments/{id}", + urlParameters: [ + Parameters.resourceGroupName, + Parameters.name, + Parameters.id, + Parameters.subscriptionId + ], + queryParameters: [ + Parameters.apiVersion + ], + headerParameters: [ + Parameters.acceptLanguage + ], + responses: { + 200: {}, + 204: {}, + default: { + bodyMapper: Mappers.CloudError + } + }, + serializer +}; + +const listDeploymentLogOperationSpec: msRest.OperationSpec = { + httpMethod: "GET", + path: "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/deployments/{id}/log", + urlParameters: [ + Parameters.resourceGroupName, + Parameters.name, + Parameters.id, + Parameters.subscriptionId + ], + queryParameters: [ + Parameters.apiVersion + ], + headerParameters: [ + Parameters.acceptLanguage + ], + responses: { + 200: { + bodyMapper: Mappers.Deployment + }, + default: { + bodyMapper: Mappers.DefaultErrorResponse + } + }, + serializer +}; + +const discoverBackupOperationSpec: msRest.OperationSpec = { + httpMethod: "POST", + path: "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/discoverbackup", + urlParameters: [ + Parameters.resourceGroupName, + Parameters.name, + Parameters.subscriptionId + ], + queryParameters: [ + Parameters.apiVersion + ], + headerParameters: [ + Parameters.acceptLanguage + ], + requestBody: { + parameterPath: "request", + mapper: { + ...Mappers.RestoreRequest, + required: true + } + }, + responses: { + 200: { + bodyMapper: Mappers.RestoreRequest + }, + default: { + bodyMapper: Mappers.DefaultErrorResponse + } + }, + serializer +}; + +const listDomainOwnershipIdentifiersOperationSpec: msRest.OperationSpec = { + httpMethod: "GET", + path: "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/domainOwnershipIdentifiers", + urlParameters: [ + Parameters.resourceGroupName, + Parameters.name, + Parameters.subscriptionId + ], + queryParameters: [ + Parameters.apiVersion + ], + headerParameters: [ + Parameters.acceptLanguage + ], + responses: { + 200: { + bodyMapper: Mappers.IdentifierCollection + }, + default: { + bodyMapper: Mappers.DefaultErrorResponse + } + }, + serializer +}; + +const getDomainOwnershipIdentifierOperationSpec: msRest.OperationSpec = { + httpMethod: "GET", + path: "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/domainOwnershipIdentifiers/{domainOwnershipIdentifierName}", + urlParameters: [ + Parameters.resourceGroupName, + Parameters.name, + Parameters.domainOwnershipIdentifierName, + Parameters.subscriptionId + ], + queryParameters: [ + Parameters.apiVersion + ], + headerParameters: [ + Parameters.acceptLanguage + ], + responses: { + 200: { + bodyMapper: Mappers.Identifier + }, + default: { + bodyMapper: Mappers.DefaultErrorResponse + } + }, + serializer +}; + +const createOrUpdateDomainOwnershipIdentifierOperationSpec: msRest.OperationSpec = { + httpMethod: "PUT", + path: "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/domainOwnershipIdentifiers/{domainOwnershipIdentifierName}", + urlParameters: [ + Parameters.resourceGroupName, + Parameters.name, + Parameters.domainOwnershipIdentifierName, + Parameters.subscriptionId + ], + queryParameters: [ + Parameters.apiVersion + ], + headerParameters: [ + Parameters.acceptLanguage + ], + requestBody: { + parameterPath: "domainOwnershipIdentifier", + mapper: { + ...Mappers.Identifier, + required: true + } + }, + responses: { + 200: { + bodyMapper: Mappers.Identifier + }, + default: { + bodyMapper: Mappers.DefaultErrorResponse + } + }, + serializer +}; + +const deleteDomainOwnershipIdentifierOperationSpec: msRest.OperationSpec = { + httpMethod: "DELETE", + path: "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/domainOwnershipIdentifiers/{domainOwnershipIdentifierName}", + urlParameters: [ + Parameters.resourceGroupName, + Parameters.name, + Parameters.domainOwnershipIdentifierName, + Parameters.subscriptionId + ], + queryParameters: [ + Parameters.apiVersion + ], + headerParameters: [ + Parameters.acceptLanguage + ], + responses: { + 200: {}, + 204: {}, + default: { + bodyMapper: Mappers.CloudError + } + }, + serializer +}; + +const updateDomainOwnershipIdentifierOperationSpec: msRest.OperationSpec = { + httpMethod: "PATCH", + path: "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/domainOwnershipIdentifiers/{domainOwnershipIdentifierName}", + urlParameters: [ + Parameters.resourceGroupName, + Parameters.name, + Parameters.domainOwnershipIdentifierName, + Parameters.subscriptionId + ], + queryParameters: [ + Parameters.apiVersion + ], + headerParameters: [ + Parameters.acceptLanguage + ], + requestBody: { + parameterPath: "domainOwnershipIdentifier", + mapper: { + ...Mappers.Identifier, + required: true + } + }, + responses: { + 200: { + bodyMapper: Mappers.Identifier + }, + default: { + bodyMapper: Mappers.DefaultErrorResponse + } + }, + serializer +}; + +const getMSDeployStatusOperationSpec: msRest.OperationSpec = { + httpMethod: "GET", + path: "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/extensions/MSDeploy", + urlParameters: [ + Parameters.resourceGroupName, + Parameters.name, + Parameters.subscriptionId + ], + queryParameters: [ + Parameters.apiVersion + ], + headerParameters: [ + Parameters.acceptLanguage + ], + responses: { + 200: { + bodyMapper: Mappers.MSDeployStatus + }, + default: { + bodyMapper: Mappers.DefaultErrorResponse + } + }, + serializer +}; + +const getMSDeployLogOperationSpec: msRest.OperationSpec = { + httpMethod: "GET", + path: "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/extensions/MSDeploy/log", + urlParameters: [ + Parameters.resourceGroupName, + Parameters.name, + Parameters.subscriptionId + ], + queryParameters: [ + Parameters.apiVersion + ], + headerParameters: [ + Parameters.acceptLanguage + ], + responses: { + 200: { + bodyMapper: Mappers.MSDeployLog + }, + 404: {}, + default: { + bodyMapper: Mappers.CloudError + } + }, + serializer +}; + +const listFunctionsOperationSpec: msRest.OperationSpec = { + httpMethod: "GET", + path: "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/functions", + urlParameters: [ + Parameters.resourceGroupName, + Parameters.name, + Parameters.subscriptionId + ], + queryParameters: [ + Parameters.apiVersion + ], + headerParameters: [ + Parameters.acceptLanguage + ], + responses: { + 200: { + bodyMapper: Mappers.FunctionEnvelopeCollection + }, + 404: {}, + default: { + bodyMapper: Mappers.CloudError + } + }, + serializer +}; + +const getFunctionsAdminTokenOperationSpec: msRest.OperationSpec = { + httpMethod: "GET", + path: "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/functions/admin/token", + urlParameters: [ + Parameters.resourceGroupName, + Parameters.name, + Parameters.subscriptionId + ], + queryParameters: [ + Parameters.apiVersion + ], + headerParameters: [ + Parameters.acceptLanguage + ], + responses: { + 200: { + bodyMapper: { + serializedName: "parsedResponse", + type: { + name: "String" + } + } + }, + default: { + bodyMapper: Mappers.DefaultErrorResponse + } + }, + serializer +}; + +const getFunctionOperationSpec: msRest.OperationSpec = { + httpMethod: "GET", + path: "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/functions/{functionName}", + urlParameters: [ + Parameters.resourceGroupName, + Parameters.name, + Parameters.functionName, + Parameters.subscriptionId + ], + queryParameters: [ + Parameters.apiVersion + ], + headerParameters: [ + Parameters.acceptLanguage + ], + responses: { + 200: { + bodyMapper: Mappers.FunctionEnvelope + }, + 404: {}, + default: { + bodyMapper: Mappers.CloudError + } + }, + serializer +}; + +const deleteFunctionOperationSpec: msRest.OperationSpec = { + httpMethod: "DELETE", + path: "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/functions/{functionName}", + urlParameters: [ + Parameters.resourceGroupName, + Parameters.name, + Parameters.functionName, + Parameters.subscriptionId + ], + queryParameters: [ + Parameters.apiVersion + ], + headerParameters: [ + Parameters.acceptLanguage + ], + responses: { + 204: {}, + 404: {}, + default: { + bodyMapper: Mappers.CloudError + } + }, + serializer +}; + +const listFunctionSecretsOperationSpec: msRest.OperationSpec = { + httpMethod: "POST", + path: "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/functions/{functionName}/listsecrets", + urlParameters: [ + Parameters.resourceGroupName, + Parameters.name, + Parameters.functionName, + Parameters.subscriptionId + ], + queryParameters: [ + Parameters.apiVersion + ], + headerParameters: [ + Parameters.acceptLanguage + ], + responses: { + 200: { + bodyMapper: Mappers.FunctionSecrets + }, + default: { + bodyMapper: Mappers.DefaultErrorResponse + } + }, + serializer +}; + +const listHostNameBindingsOperationSpec: msRest.OperationSpec = { + httpMethod: "GET", + path: "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/hostNameBindings", + urlParameters: [ + Parameters.resourceGroupName, + Parameters.name, + Parameters.subscriptionId + ], + queryParameters: [ + Parameters.apiVersion + ], + headerParameters: [ + Parameters.acceptLanguage + ], + responses: { + 200: { + bodyMapper: Mappers.HostNameBindingCollection + }, + default: { + bodyMapper: Mappers.DefaultErrorResponse + } + }, + serializer +}; + +const getHostNameBindingOperationSpec: msRest.OperationSpec = { + httpMethod: "GET", + path: "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/hostNameBindings/{hostName}", + urlParameters: [ + Parameters.resourceGroupName, + Parameters.name, + Parameters.hostName1, + Parameters.subscriptionId + ], + queryParameters: [ + Parameters.apiVersion + ], + headerParameters: [ + Parameters.acceptLanguage + ], + responses: { + 200: { + bodyMapper: Mappers.HostNameBinding + }, + default: { + bodyMapper: Mappers.DefaultErrorResponse + } + }, + serializer +}; + +const createOrUpdateHostNameBindingOperationSpec: msRest.OperationSpec = { + httpMethod: "PUT", + path: "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/hostNameBindings/{hostName}", + urlParameters: [ + Parameters.resourceGroupName, + Parameters.name, + Parameters.hostName1, + Parameters.subscriptionId + ], + queryParameters: [ + Parameters.apiVersion + ], + headerParameters: [ + Parameters.acceptLanguage + ], + requestBody: { + parameterPath: "hostNameBinding", + mapper: { + ...Mappers.HostNameBinding, + required: true + } + }, + responses: { + 200: { + bodyMapper: Mappers.HostNameBinding + }, + default: { + bodyMapper: Mappers.DefaultErrorResponse + } + }, + serializer +}; + +const deleteHostNameBindingOperationSpec: msRest.OperationSpec = { + httpMethod: "DELETE", + path: "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/hostNameBindings/{hostName}", + urlParameters: [ + Parameters.resourceGroupName, + Parameters.name, + Parameters.hostName1, + Parameters.subscriptionId + ], + queryParameters: [ + Parameters.apiVersion + ], + headerParameters: [ + Parameters.acceptLanguage + ], + responses: { + 200: {}, + 204: {}, + default: { + bodyMapper: Mappers.CloudError + } + }, + serializer +}; + +const getHybridConnectionOperationSpec: msRest.OperationSpec = { + httpMethod: "GET", + path: "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/hybridConnectionNamespaces/{namespaceName}/relays/{relayName}", + urlParameters: [ + Parameters.resourceGroupName, + Parameters.name, + Parameters.namespaceName, + Parameters.relayName, + Parameters.subscriptionId + ], + queryParameters: [ + Parameters.apiVersion + ], + headerParameters: [ + Parameters.acceptLanguage + ], + responses: { + 200: { + bodyMapper: Mappers.HybridConnection + }, + default: { + bodyMapper: Mappers.DefaultErrorResponse + } + }, + serializer +}; + +const createOrUpdateHybridConnectionOperationSpec: msRest.OperationSpec = { + httpMethod: "PUT", + path: "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/hybridConnectionNamespaces/{namespaceName}/relays/{relayName}", + urlParameters: [ + Parameters.resourceGroupName, + Parameters.name, + Parameters.namespaceName, + Parameters.relayName, + Parameters.subscriptionId + ], + queryParameters: [ + Parameters.apiVersion + ], + headerParameters: [ + Parameters.acceptLanguage + ], + requestBody: { + parameterPath: "connectionEnvelope", + mapper: { + ...Mappers.HybridConnection, + required: true + } + }, + responses: { + 200: { + bodyMapper: Mappers.HybridConnection + }, + default: { + bodyMapper: Mappers.DefaultErrorResponse + } + }, + serializer +}; + +const deleteHybridConnectionOperationSpec: msRest.OperationSpec = { + httpMethod: "DELETE", + path: "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/hybridConnectionNamespaces/{namespaceName}/relays/{relayName}", + urlParameters: [ + Parameters.resourceGroupName, + Parameters.name, + Parameters.namespaceName, + Parameters.relayName, + Parameters.subscriptionId + ], + queryParameters: [ + Parameters.apiVersion + ], + headerParameters: [ + Parameters.acceptLanguage + ], + responses: { + 200: {}, + 404: {}, + default: { + bodyMapper: Mappers.CloudError + } + }, + serializer +}; + +const updateHybridConnectionOperationSpec: msRest.OperationSpec = { + httpMethod: "PATCH", + path: "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/hybridConnectionNamespaces/{namespaceName}/relays/{relayName}", + urlParameters: [ + Parameters.resourceGroupName, + Parameters.name, + Parameters.namespaceName, + Parameters.relayName, + Parameters.subscriptionId + ], + queryParameters: [ + Parameters.apiVersion + ], + headerParameters: [ + Parameters.acceptLanguage + ], + requestBody: { + parameterPath: "connectionEnvelope", + mapper: { + ...Mappers.HybridConnection, + required: true + } + }, + responses: { + 200: { + bodyMapper: Mappers.HybridConnection + }, + default: { + bodyMapper: Mappers.DefaultErrorResponse + } + }, + serializer +}; + +const listHybridConnectionKeysOperationSpec: msRest.OperationSpec = { + httpMethod: "POST", + path: "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/hybridConnectionNamespaces/{namespaceName}/relays/{relayName}/listKeys", + urlParameters: [ + Parameters.resourceGroupName, + Parameters.name, + Parameters.namespaceName, + Parameters.relayName, + Parameters.subscriptionId + ], + queryParameters: [ + Parameters.apiVersion + ], + headerParameters: [ + Parameters.acceptLanguage + ], + responses: { + 200: { + bodyMapper: Mappers.HybridConnectionKey + }, + default: { + bodyMapper: Mappers.DefaultErrorResponse + } + }, + serializer +}; + +const listHybridConnectionsOperationSpec: msRest.OperationSpec = { + httpMethod: "GET", + path: "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/hybridConnectionRelays", + urlParameters: [ + Parameters.resourceGroupName, + Parameters.name, + Parameters.subscriptionId + ], + queryParameters: [ + Parameters.apiVersion + ], + headerParameters: [ + Parameters.acceptLanguage + ], + responses: { + 200: { + bodyMapper: Mappers.HybridConnection + }, + default: { + bodyMapper: Mappers.DefaultErrorResponse + } + }, + serializer +}; + +const listRelayServiceConnectionsOperationSpec: msRest.OperationSpec = { + httpMethod: "GET", + path: "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/hybridconnection", + urlParameters: [ + Parameters.resourceGroupName, + Parameters.name, + Parameters.subscriptionId + ], + queryParameters: [ + Parameters.apiVersion + ], + headerParameters: [ + Parameters.acceptLanguage + ], + responses: { + 200: { + bodyMapper: Mappers.RelayServiceConnectionEntity + }, + default: { + bodyMapper: Mappers.DefaultErrorResponse + } + }, + serializer +}; + +const getRelayServiceConnectionOperationSpec: msRest.OperationSpec = { + httpMethod: "GET", + path: "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/hybridconnection/{entityName}", + urlParameters: [ + Parameters.resourceGroupName, + Parameters.name, + Parameters.entityName, + Parameters.subscriptionId + ], + queryParameters: [ + Parameters.apiVersion + ], + headerParameters: [ + Parameters.acceptLanguage + ], + responses: { + 200: { + bodyMapper: Mappers.RelayServiceConnectionEntity + }, + default: { + bodyMapper: Mappers.DefaultErrorResponse + } + }, + serializer +}; + +const createOrUpdateRelayServiceConnectionOperationSpec: msRest.OperationSpec = { + httpMethod: "PUT", + path: "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/hybridconnection/{entityName}", + urlParameters: [ + Parameters.resourceGroupName, + Parameters.name, + Parameters.entityName, + Parameters.subscriptionId + ], + queryParameters: [ + Parameters.apiVersion + ], + headerParameters: [ + Parameters.acceptLanguage + ], + requestBody: { + parameterPath: "connectionEnvelope", + mapper: { + ...Mappers.RelayServiceConnectionEntity, + required: true + } + }, + responses: { + 200: { + bodyMapper: Mappers.RelayServiceConnectionEntity + }, + default: { + bodyMapper: Mappers.DefaultErrorResponse + } + }, + serializer +}; + +const deleteRelayServiceConnectionOperationSpec: msRest.OperationSpec = { + httpMethod: "DELETE", + path: "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/hybridconnection/{entityName}", + urlParameters: [ + Parameters.resourceGroupName, + Parameters.name, + Parameters.entityName, + Parameters.subscriptionId + ], + queryParameters: [ + Parameters.apiVersion + ], + headerParameters: [ + Parameters.acceptLanguage + ], + responses: { + 200: {}, + 404: {}, + default: { + bodyMapper: Mappers.CloudError + } + }, + serializer +}; + +const updateRelayServiceConnectionOperationSpec: msRest.OperationSpec = { + httpMethod: "PATCH", + path: "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/hybridconnection/{entityName}", + urlParameters: [ + Parameters.resourceGroupName, + Parameters.name, + Parameters.entityName, + Parameters.subscriptionId + ], + queryParameters: [ + Parameters.apiVersion + ], + headerParameters: [ + Parameters.acceptLanguage + ], + requestBody: { + parameterPath: "connectionEnvelope", + mapper: { + ...Mappers.RelayServiceConnectionEntity, + required: true + } + }, + responses: { + 200: { + bodyMapper: Mappers.RelayServiceConnectionEntity + }, + default: { + bodyMapper: Mappers.DefaultErrorResponse + } + }, + serializer +}; + +const listInstanceIdentifiersOperationSpec: msRest.OperationSpec = { + httpMethod: "GET", + path: "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/instances", + urlParameters: [ + Parameters.resourceGroupName, + Parameters.name, + Parameters.subscriptionId + ], + queryParameters: [ + Parameters.apiVersion + ], + headerParameters: [ + Parameters.acceptLanguage + ], + responses: { + 200: { + bodyMapper: Mappers.WebAppInstanceCollection + }, + default: { + bodyMapper: Mappers.DefaultErrorResponse + } + }, + serializer +}; + +const getInstanceMsDeployStatusOperationSpec: msRest.OperationSpec = { + httpMethod: "GET", + path: "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/instances/{instanceId}/extensions/MSDeploy", + urlParameters: [ + Parameters.resourceGroupName, + Parameters.name, + Parameters.instanceId, + Parameters.subscriptionId + ], + queryParameters: [ + Parameters.apiVersion + ], + headerParameters: [ + Parameters.acceptLanguage + ], + responses: { + 200: { + bodyMapper: Mappers.MSDeployStatus + }, + default: { + bodyMapper: Mappers.DefaultErrorResponse + } + }, + serializer +}; + +const getInstanceMSDeployLogOperationSpec: msRest.OperationSpec = { + httpMethod: "GET", + path: "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/instances/{instanceId}/extensions/MSDeploy/log", + urlParameters: [ + Parameters.resourceGroupName, + Parameters.name, + Parameters.instanceId, + Parameters.subscriptionId + ], + queryParameters: [ + Parameters.apiVersion + ], + headerParameters: [ + Parameters.acceptLanguage + ], + responses: { + 200: { + bodyMapper: Mappers.MSDeployLog + }, + 404: {}, + default: { + bodyMapper: Mappers.CloudError + } + }, + serializer +}; + +const listInstanceProcessesOperationSpec: msRest.OperationSpec = { + httpMethod: "GET", + path: "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/instances/{instanceId}/processes", + urlParameters: [ + Parameters.resourceGroupName, + Parameters.name, + Parameters.instanceId, + Parameters.subscriptionId + ], + queryParameters: [ + Parameters.apiVersion + ], + headerParameters: [ + Parameters.acceptLanguage + ], + responses: { + 200: { + bodyMapper: Mappers.ProcessInfoCollection + }, + 404: {}, + default: { + bodyMapper: Mappers.CloudError + } + }, + serializer +}; + +const getInstanceProcessOperationSpec: msRest.OperationSpec = { + httpMethod: "GET", + path: "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/instances/{instanceId}/processes/{processId}", + urlParameters: [ + Parameters.resourceGroupName, + Parameters.name, + Parameters.processId, + Parameters.instanceId, + Parameters.subscriptionId + ], + queryParameters: [ + Parameters.apiVersion + ], + headerParameters: [ + Parameters.acceptLanguage + ], + responses: { + 200: { + bodyMapper: Mappers.ProcessInfo + }, + 404: {}, + default: { + bodyMapper: Mappers.CloudError + } + }, + serializer +}; + +const deleteInstanceProcessOperationSpec: msRest.OperationSpec = { + httpMethod: "DELETE", + path: "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/instances/{instanceId}/processes/{processId}", + urlParameters: [ + Parameters.resourceGroupName, + Parameters.name, + Parameters.processId, + Parameters.instanceId, + Parameters.subscriptionId + ], + queryParameters: [ + Parameters.apiVersion + ], + headerParameters: [ + Parameters.acceptLanguage + ], + responses: { + 204: {}, + 404: {}, + default: { + bodyMapper: Mappers.CloudError + } + }, + serializer +}; + +const getInstanceProcessDumpOperationSpec: msRest.OperationSpec = { + httpMethod: "GET", + path: "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/instances/{instanceId}/processes/{processId}/dump", + urlParameters: [ + Parameters.resourceGroupName, + Parameters.name, + Parameters.processId, + Parameters.instanceId, + Parameters.subscriptionId + ], + queryParameters: [ + Parameters.apiVersion + ], + headerParameters: [ + Parameters.acceptLanguage + ], + responses: { + 200: { + bodyMapper: { + serializedName: "parsedResponse", + type: { + name: "Stream" + } + } + }, + 404: {}, + default: { + bodyMapper: Mappers.CloudError + } + }, + serializer +}; + +const listInstanceProcessModulesOperationSpec: msRest.OperationSpec = { + httpMethod: "GET", + path: "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/instances/{instanceId}/processes/{processId}/modules", + urlParameters: [ + Parameters.resourceGroupName, + Parameters.name, + Parameters.processId, + Parameters.instanceId, + Parameters.subscriptionId + ], + queryParameters: [ + Parameters.apiVersion + ], + headerParameters: [ + Parameters.acceptLanguage + ], + responses: { + 200: { + bodyMapper: Mappers.ProcessModuleInfoCollection + }, + 404: {}, + default: { + bodyMapper: Mappers.CloudError + } + }, + serializer +}; + +const getInstanceProcessModuleOperationSpec: msRest.OperationSpec = { + httpMethod: "GET", + path: "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/instances/{instanceId}/processes/{processId}/modules/{baseAddress}", + urlParameters: [ + Parameters.resourceGroupName, + Parameters.name, + Parameters.processId, + Parameters.baseAddress, + Parameters.instanceId, + Parameters.subscriptionId + ], + queryParameters: [ + Parameters.apiVersion + ], + headerParameters: [ + Parameters.acceptLanguage + ], + responses: { + 200: { + bodyMapper: Mappers.ProcessModuleInfo + }, + 404: {}, + default: { + bodyMapper: Mappers.CloudError + } + }, + serializer +}; + +const listInstanceProcessThreadsOperationSpec: msRest.OperationSpec = { + httpMethod: "GET", + path: "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/instances/{instanceId}/processes/{processId}/threads", + urlParameters: [ + Parameters.resourceGroupName, + Parameters.name, + Parameters.processId, + Parameters.instanceId, + Parameters.subscriptionId + ], + queryParameters: [ + Parameters.apiVersion + ], + headerParameters: [ + Parameters.acceptLanguage + ], + responses: { + 200: { + bodyMapper: Mappers.ProcessThreadInfoCollection + }, + 404: {}, + default: { + bodyMapper: Mappers.CloudError + } + }, + serializer +}; + +const getInstanceProcessThreadOperationSpec: msRest.OperationSpec = { + httpMethod: "GET", + path: "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/instances/{instanceId}/processes/{processId}/threads/{threadId}", + urlParameters: [ + Parameters.resourceGroupName, + Parameters.name, + Parameters.processId, + Parameters.threadId, + Parameters.instanceId, + Parameters.subscriptionId + ], + queryParameters: [ + Parameters.apiVersion + ], + headerParameters: [ + Parameters.acceptLanguage + ], + responses: { + 200: { + bodyMapper: Mappers.ProcessThreadInfo + }, + 404: {}, + default: { + bodyMapper: Mappers.CloudError + } + }, + serializer +}; + +const isCloneableOperationSpec: msRest.OperationSpec = { + httpMethod: "POST", + path: "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/iscloneable", + urlParameters: [ + Parameters.resourceGroupName, + Parameters.name, + Parameters.subscriptionId + ], + queryParameters: [ + Parameters.apiVersion + ], + headerParameters: [ + Parameters.acceptLanguage + ], + responses: { + 200: { + bodyMapper: Mappers.SiteCloneability + }, + default: { + bodyMapper: Mappers.DefaultErrorResponse + } + }, + serializer +}; + +const listSyncFunctionTriggersOperationSpec: msRest.OperationSpec = { + httpMethod: "POST", + path: "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/listsyncfunctiontriggerstatus", + urlParameters: [ + Parameters.resourceGroupName, + Parameters.name, + Parameters.subscriptionId + ], + queryParameters: [ + Parameters.apiVersion + ], + headerParameters: [ + Parameters.acceptLanguage + ], + responses: { + 200: { + bodyMapper: Mappers.FunctionSecrets + }, + default: { + bodyMapper: Mappers.DefaultErrorResponse + } + }, + serializer +}; + +const listMetricDefinitionsOperationSpec: msRest.OperationSpec = { + httpMethod: "GET", + path: "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/metricdefinitions", + urlParameters: [ + Parameters.resourceGroupName, + Parameters.name, + Parameters.subscriptionId + ], + queryParameters: [ + Parameters.apiVersion + ], + headerParameters: [ + Parameters.acceptLanguage + ], + responses: { + 200: { + bodyMapper: Mappers.ResourceMetricDefinitionCollection + }, + default: { + bodyMapper: Mappers.DefaultErrorResponse + } + }, + serializer +}; + +const listMetricsOperationSpec: msRest.OperationSpec = { + httpMethod: "GET", + path: "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/metrics", + urlParameters: [ + Parameters.resourceGroupName, + Parameters.name, + Parameters.subscriptionId + ], + queryParameters: [ + Parameters.details, + Parameters.filter, + Parameters.apiVersion + ], + headerParameters: [ + Parameters.acceptLanguage + ], + responses: { + 200: { + bodyMapper: Mappers.ResourceMetricCollection + }, + default: { + bodyMapper: Mappers.DefaultErrorResponse + } + }, + serializer +}; + +const getMigrateMySqlStatusOperationSpec: msRest.OperationSpec = { + httpMethod: "GET", + path: "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/migratemysql/status", + urlParameters: [ + Parameters.resourceGroupName, + Parameters.name, + Parameters.subscriptionId + ], + queryParameters: [ + Parameters.apiVersion + ], + headerParameters: [ + Parameters.acceptLanguage + ], + responses: { + 200: { + bodyMapper: Mappers.MigrateMySqlStatus + }, + default: { + bodyMapper: Mappers.DefaultErrorResponse + } + }, + serializer +}; + +const getSwiftVirtualNetworkConnectionOperationSpec: msRest.OperationSpec = { + httpMethod: "GET", + path: "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/networkConfig/virtualNetwork", + urlParameters: [ + Parameters.resourceGroupName, + Parameters.name, + Parameters.subscriptionId + ], + queryParameters: [ + Parameters.apiVersion + ], + headerParameters: [ + Parameters.acceptLanguage + ], + responses: { + 200: { + bodyMapper: Mappers.SwiftVirtualNetwork + }, + default: { + bodyMapper: Mappers.DefaultErrorResponse + } + }, + serializer +}; + +const createOrUpdateSwiftVirtualNetworkConnectionOperationSpec: msRest.OperationSpec = { + httpMethod: "PUT", + path: "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/networkConfig/virtualNetwork", + urlParameters: [ + Parameters.resourceGroupName, + Parameters.name, + Parameters.subscriptionId + ], + queryParameters: [ + Parameters.apiVersion + ], + headerParameters: [ + Parameters.acceptLanguage + ], + requestBody: { + parameterPath: "connectionEnvelope", + mapper: { + ...Mappers.SwiftVirtualNetwork, + required: true + } + }, + responses: { + 200: { + bodyMapper: Mappers.SwiftVirtualNetwork + }, + default: { + bodyMapper: Mappers.DefaultErrorResponse + } + }, + serializer +}; + +const deleteSwiftVirtualNetworkOperationSpec: msRest.OperationSpec = { + httpMethod: "DELETE", + path: "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/networkConfig/virtualNetwork", + urlParameters: [ + Parameters.resourceGroupName, + Parameters.name, + Parameters.subscriptionId + ], + queryParameters: [ + Parameters.apiVersion + ], + headerParameters: [ + Parameters.acceptLanguage + ], + responses: { + 200: {}, + 404: {}, + default: { + bodyMapper: Mappers.CloudError + } + }, + serializer +}; + +const updateSwiftVirtualNetworkConnectionOperationSpec: msRest.OperationSpec = { + httpMethod: "PATCH", + path: "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/networkConfig/virtualNetwork", + urlParameters: [ + Parameters.resourceGroupName, + Parameters.name, + Parameters.subscriptionId + ], + queryParameters: [ + Parameters.apiVersion + ], + headerParameters: [ + Parameters.acceptLanguage + ], + requestBody: { + parameterPath: "connectionEnvelope", + mapper: { + ...Mappers.SwiftVirtualNetwork, + required: true + } + }, + responses: { + 200: { + bodyMapper: Mappers.SwiftVirtualNetwork + }, + default: { + bodyMapper: Mappers.DefaultErrorResponse + } + }, + serializer +}; + +const listNetworkFeaturesOperationSpec: msRest.OperationSpec = { + httpMethod: "GET", + path: "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/networkFeatures/{view}", + urlParameters: [ + Parameters.resourceGroupName, + Parameters.name, + Parameters.view, + Parameters.subscriptionId + ], + queryParameters: [ + Parameters.apiVersion + ], + headerParameters: [ + Parameters.acceptLanguage + ], + responses: { + 200: { + bodyMapper: Mappers.NetworkFeatures + }, + 404: {}, + default: { + bodyMapper: Mappers.CloudError + } + }, + serializer +}; + +const getNetworkTraceOperationOperationSpec: msRest.OperationSpec = { + httpMethod: "GET", + path: "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/networkTrace/operationresults/{operationId}", + urlParameters: [ + Parameters.resourceGroupName, + Parameters.name, + Parameters.operationId, + Parameters.subscriptionId + ], + queryParameters: [ + Parameters.apiVersion + ], + headerParameters: [ + Parameters.acceptLanguage + ], + responses: { + 200: { + bodyMapper: { + serializedName: "parsedResponse", + type: { + name: "Sequence", + element: { + type: { + name: "Composite", + className: "NetworkTrace" + } + } + } + } + }, + 202: { + bodyMapper: { + serializedName: "parsedResponse", + type: { + name: "Sequence", + element: { + type: { + name: "Composite", + className: "NetworkTrace" + } + } + } + } + }, + default: { + bodyMapper: Mappers.DefaultErrorResponse + } + }, + serializer +}; + +const startWebSiteNetworkTraceOperationSpec: msRest.OperationSpec = { + httpMethod: "POST", + path: "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/networkTrace/start", + urlParameters: [ + Parameters.resourceGroupName, + Parameters.name, + Parameters.subscriptionId + ], + queryParameters: [ + Parameters.durationInSeconds, + Parameters.maxFrameLength, + Parameters.sasUrl, + Parameters.apiVersion + ], + headerParameters: [ + Parameters.acceptLanguage + ], + responses: { + 200: { + bodyMapper: { + serializedName: "parsedResponse", + type: { + name: "String" + } + } + }, + default: { + bodyMapper: Mappers.DefaultErrorResponse + } + }, + serializer +}; + +const stopWebSiteNetworkTraceOperationSpec: msRest.OperationSpec = { + httpMethod: "POST", + path: "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/networkTrace/stop", + urlParameters: [ + Parameters.resourceGroupName, + Parameters.name, + Parameters.subscriptionId + ], + queryParameters: [ + Parameters.apiVersion + ], + headerParameters: [ + Parameters.acceptLanguage + ], + responses: { + 200: {}, + 204: {}, + default: { + bodyMapper: Mappers.CloudError + } + }, + serializer +}; + +const getNetworkTracesOperationSpec: msRest.OperationSpec = { + httpMethod: "GET", + path: "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/networkTrace/{operationId}", + urlParameters: [ + Parameters.resourceGroupName, + Parameters.name, + Parameters.operationId, + Parameters.subscriptionId + ], + queryParameters: [ + Parameters.apiVersion + ], + headerParameters: [ + Parameters.acceptLanguage + ], + responses: { + 200: { + bodyMapper: { + serializedName: "parsedResponse", + type: { + name: "Sequence", + element: { + type: { + name: "Composite", + className: "NetworkTrace" + } + } + } + } + }, + default: { + bodyMapper: Mappers.DefaultErrorResponse + } + }, + serializer +}; + +const getNetworkTraceOperationV2OperationSpec: msRest.OperationSpec = { + httpMethod: "GET", + path: "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/networkTraces/current/operationresults/{operationId}", + urlParameters: [ + Parameters.resourceGroupName, + Parameters.name, + Parameters.operationId, + Parameters.subscriptionId + ], + queryParameters: [ + Parameters.apiVersion + ], + headerParameters: [ + Parameters.acceptLanguage + ], + responses: { + 200: { + bodyMapper: { + serializedName: "parsedResponse", + type: { + name: "Sequence", + element: { + type: { + name: "Composite", + className: "NetworkTrace" + } + } + } + } + }, + 202: { + bodyMapper: { + serializedName: "parsedResponse", + type: { + name: "Sequence", + element: { + type: { + name: "Composite", + className: "NetworkTrace" + } + } + } + } + }, + default: { + bodyMapper: Mappers.DefaultErrorResponse + } + }, + serializer +}; + +const getNetworkTracesV2OperationSpec: msRest.OperationSpec = { + httpMethod: "GET", + path: "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/networkTraces/{operationId}", + urlParameters: [ + Parameters.resourceGroupName, + Parameters.name, + Parameters.operationId, + Parameters.subscriptionId + ], + queryParameters: [ + Parameters.apiVersion + ], + headerParameters: [ + Parameters.acceptLanguage + ], + responses: { + 200: { + bodyMapper: { + serializedName: "parsedResponse", + type: { + name: "Sequence", + element: { + type: { + name: "Composite", + className: "NetworkTrace" + } + } + } + } + }, + default: { + bodyMapper: Mappers.DefaultErrorResponse + } + }, + serializer +}; + +const generateNewSitePublishingPasswordOperationSpec: msRest.OperationSpec = { + httpMethod: "POST", + path: "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/newpassword", + urlParameters: [ + Parameters.resourceGroupName, + Parameters.name, + Parameters.subscriptionId + ], + queryParameters: [ + Parameters.apiVersion + ], + headerParameters: [ + Parameters.acceptLanguage + ], + responses: { + 200: {}, + 204: {}, + default: { + bodyMapper: Mappers.CloudError + } + }, + serializer +}; + +const listPerfMonCountersOperationSpec: msRest.OperationSpec = { + httpMethod: "GET", + path: "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/perfcounters", + urlParameters: [ + Parameters.resourceGroupName, + Parameters.name, + Parameters.subscriptionId + ], + queryParameters: [ + Parameters.filter, + Parameters.apiVersion + ], + headerParameters: [ + Parameters.acceptLanguage + ], + responses: { + 200: { + bodyMapper: Mappers.PerfMonCounterCollection + }, + default: { + bodyMapper: Mappers.DefaultErrorResponse + } + }, + serializer +}; + +const getSitePhpErrorLogFlagOperationSpec: msRest.OperationSpec = { + httpMethod: "GET", + path: "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/phplogging", + urlParameters: [ + Parameters.resourceGroupName, + Parameters.name, + Parameters.subscriptionId + ], + queryParameters: [ + Parameters.apiVersion + ], + headerParameters: [ + Parameters.acceptLanguage + ], + responses: { + 200: { + bodyMapper: Mappers.SitePhpErrorLogFlag + }, + default: { + bodyMapper: Mappers.DefaultErrorResponse + } + }, + serializer +}; + +const listPremierAddOnsOperationSpec: msRest.OperationSpec = { + httpMethod: "GET", + path: "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/premieraddons", + urlParameters: [ + Parameters.resourceGroupName, + Parameters.name, + Parameters.subscriptionId + ], + queryParameters: [ + Parameters.apiVersion + ], + headerParameters: [ + Parameters.acceptLanguage + ], + responses: { + 200: { + bodyMapper: Mappers.PremierAddOn + }, + default: { + bodyMapper: Mappers.DefaultErrorResponse + } + }, + serializer +}; + +const getPremierAddOnOperationSpec: msRest.OperationSpec = { + httpMethod: "GET", + path: "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/premieraddons/{premierAddOnName}", + urlParameters: [ + Parameters.resourceGroupName, + Parameters.name, + Parameters.premierAddOnName, + Parameters.subscriptionId + ], + queryParameters: [ + Parameters.apiVersion + ], + headerParameters: [ + Parameters.acceptLanguage + ], + responses: { + 200: { + bodyMapper: Mappers.PremierAddOn + }, + default: { + bodyMapper: Mappers.DefaultErrorResponse + } + }, + serializer +}; + +const addPremierAddOnOperationSpec: msRest.OperationSpec = { + httpMethod: "PUT", + path: "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/premieraddons/{premierAddOnName}", + urlParameters: [ + Parameters.resourceGroupName, + Parameters.name, + Parameters.premierAddOnName, + Parameters.subscriptionId + ], + queryParameters: [ + Parameters.apiVersion + ], + headerParameters: [ + Parameters.acceptLanguage + ], + requestBody: { + parameterPath: "premierAddOn", + mapper: { + ...Mappers.PremierAddOn, + required: true + } + }, + responses: { + 200: { + bodyMapper: Mappers.PremierAddOn + }, + default: { + bodyMapper: Mappers.DefaultErrorResponse + } + }, + serializer +}; + +const deletePremierAddOnOperationSpec: msRest.OperationSpec = { + httpMethod: "DELETE", + path: "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/premieraddons/{premierAddOnName}", + urlParameters: [ + Parameters.resourceGroupName, + Parameters.name, + Parameters.premierAddOnName, + Parameters.subscriptionId + ], + queryParameters: [ + Parameters.apiVersion + ], + headerParameters: [ + Parameters.acceptLanguage + ], + responses: { + 200: {}, + default: { + bodyMapper: Mappers.CloudError + } + }, + serializer +}; + +const updatePremierAddOnOperationSpec: msRest.OperationSpec = { + httpMethod: "PATCH", + path: "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/premieraddons/{premierAddOnName}", + urlParameters: [ + Parameters.resourceGroupName, + Parameters.name, + Parameters.premierAddOnName, + Parameters.subscriptionId + ], + queryParameters: [ + Parameters.apiVersion + ], + headerParameters: [ + Parameters.acceptLanguage + ], + requestBody: { + parameterPath: "premierAddOn", + mapper: { + ...Mappers.PremierAddOnPatchResource, + required: true + } + }, + responses: { + 200: { + bodyMapper: Mappers.PremierAddOn + }, + default: { + bodyMapper: Mappers.DefaultErrorResponse + } + }, + serializer +}; + +const getPrivateAccessOperationSpec: msRest.OperationSpec = { + httpMethod: "GET", + path: "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/privateAccess/virtualNetworks", + urlParameters: [ + Parameters.resourceGroupName, + Parameters.name, + Parameters.subscriptionId + ], + queryParameters: [ + Parameters.apiVersion + ], + headerParameters: [ + Parameters.acceptLanguage + ], + responses: { + 200: { + bodyMapper: Mappers.PrivateAccess + }, + default: { + bodyMapper: Mappers.DefaultErrorResponse + } + }, + serializer +}; + +const putPrivateAccessVnetOperationSpec: msRest.OperationSpec = { + httpMethod: "PUT", + path: "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/privateAccess/virtualNetworks", + urlParameters: [ + Parameters.resourceGroupName, + Parameters.name, + Parameters.subscriptionId + ], + queryParameters: [ + Parameters.apiVersion + ], + headerParameters: [ + Parameters.acceptLanguage + ], + requestBody: { + parameterPath: "access", + mapper: { + ...Mappers.PrivateAccess, + required: true + } + }, + responses: { + 200: { + bodyMapper: Mappers.PrivateAccess + }, + default: { + bodyMapper: Mappers.DefaultErrorResponse + } + }, + serializer +}; + +const listProcessesOperationSpec: msRest.OperationSpec = { + httpMethod: "GET", + path: "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/processes", + urlParameters: [ + Parameters.resourceGroupName, + Parameters.name, + Parameters.subscriptionId + ], + queryParameters: [ + Parameters.apiVersion + ], + headerParameters: [ + Parameters.acceptLanguage + ], + responses: { + 200: { + bodyMapper: Mappers.ProcessInfoCollection + }, + 404: {}, + default: { + bodyMapper: Mappers.CloudError + } + }, + serializer +}; + +const getProcessOperationSpec: msRest.OperationSpec = { + httpMethod: "GET", + path: "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/processes/{processId}", + urlParameters: [ + Parameters.resourceGroupName, + Parameters.name, + Parameters.processId, + Parameters.subscriptionId + ], + queryParameters: [ + Parameters.apiVersion + ], + headerParameters: [ + Parameters.acceptLanguage + ], + responses: { + 200: { + bodyMapper: Mappers.ProcessInfo + }, + 404: {}, + default: { + bodyMapper: Mappers.CloudError + } + }, + serializer +}; + +const deleteProcessOperationSpec: msRest.OperationSpec = { + httpMethod: "DELETE", + path: "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/processes/{processId}", + urlParameters: [ + Parameters.resourceGroupName, + Parameters.name, + Parameters.processId, + Parameters.subscriptionId + ], + queryParameters: [ + Parameters.apiVersion + ], + headerParameters: [ + Parameters.acceptLanguage + ], + responses: { + 204: {}, + 404: {}, + default: { + bodyMapper: Mappers.CloudError + } + }, + serializer +}; + +const getProcessDumpOperationSpec: msRest.OperationSpec = { + httpMethod: "GET", + path: "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/processes/{processId}/dump", + urlParameters: [ + Parameters.resourceGroupName, + Parameters.name, + Parameters.processId, + Parameters.subscriptionId + ], + queryParameters: [ + Parameters.apiVersion + ], + headerParameters: [ + Parameters.acceptLanguage + ], + responses: { + 200: { + bodyMapper: { + serializedName: "parsedResponse", + type: { + name: "Stream" + } + } + }, + 404: {}, + default: { + bodyMapper: Mappers.CloudError + } + }, + serializer +}; + +const listProcessModulesOperationSpec: msRest.OperationSpec = { + httpMethod: "GET", + path: "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/processes/{processId}/modules", + urlParameters: [ + Parameters.resourceGroupName, + Parameters.name, + Parameters.processId, + Parameters.subscriptionId + ], + queryParameters: [ + Parameters.apiVersion + ], + headerParameters: [ + Parameters.acceptLanguage + ], + responses: { + 200: { + bodyMapper: Mappers.ProcessModuleInfoCollection + }, + 404: {}, + default: { + bodyMapper: Mappers.CloudError + } + }, + serializer +}; + +const getProcessModuleOperationSpec: msRest.OperationSpec = { + httpMethod: "GET", + path: "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/processes/{processId}/modules/{baseAddress}", + urlParameters: [ + Parameters.resourceGroupName, + Parameters.name, + Parameters.processId, + Parameters.baseAddress, + Parameters.subscriptionId + ], + queryParameters: [ + Parameters.apiVersion + ], + headerParameters: [ + Parameters.acceptLanguage + ], + responses: { + 200: { + bodyMapper: Mappers.ProcessModuleInfo + }, + 404: {}, + default: { + bodyMapper: Mappers.CloudError + } + }, + serializer +}; + +const listProcessThreadsOperationSpec: msRest.OperationSpec = { + httpMethod: "GET", + path: "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/processes/{processId}/threads", + urlParameters: [ + Parameters.resourceGroupName, + Parameters.name, + Parameters.processId, + Parameters.subscriptionId + ], + queryParameters: [ + Parameters.apiVersion + ], + headerParameters: [ + Parameters.acceptLanguage + ], + responses: { + 200: { + bodyMapper: Mappers.ProcessThreadInfoCollection + }, + 404: {}, + default: { + bodyMapper: Mappers.CloudError + } + }, + serializer +}; + +const getProcessThreadOperationSpec: msRest.OperationSpec = { + httpMethod: "GET", + path: "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/processes/{processId}/threads/{threadId}", + urlParameters: [ + Parameters.resourceGroupName, + Parameters.name, + Parameters.processId, + Parameters.threadId, + Parameters.subscriptionId + ], + queryParameters: [ + Parameters.apiVersion + ], + headerParameters: [ + Parameters.acceptLanguage + ], + responses: { + 200: { + bodyMapper: Mappers.ProcessThreadInfo + }, + 404: {}, + default: { + bodyMapper: Mappers.CloudError + } + }, + serializer +}; + +const listPublicCertificatesOperationSpec: msRest.OperationSpec = { + httpMethod: "GET", + path: "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/publicCertificates", + urlParameters: [ + Parameters.resourceGroupName, + Parameters.name, + Parameters.subscriptionId + ], + queryParameters: [ + Parameters.apiVersion + ], + headerParameters: [ + Parameters.acceptLanguage + ], + responses: { + 200: { + bodyMapper: Mappers.PublicCertificateCollection + }, + default: { + bodyMapper: Mappers.DefaultErrorResponse + } + }, + serializer +}; + +const getPublicCertificateOperationSpec: msRest.OperationSpec = { + httpMethod: "GET", + path: "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/publicCertificates/{publicCertificateName}", + urlParameters: [ + Parameters.resourceGroupName, + Parameters.name, + Parameters.publicCertificateName, + Parameters.subscriptionId + ], + queryParameters: [ + Parameters.apiVersion + ], + headerParameters: [ + Parameters.acceptLanguage + ], + responses: { + 200: { + bodyMapper: Mappers.PublicCertificate + }, + default: { + bodyMapper: Mappers.DefaultErrorResponse + } + }, + serializer +}; + +const createOrUpdatePublicCertificateOperationSpec: msRest.OperationSpec = { + httpMethod: "PUT", + path: "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/publicCertificates/{publicCertificateName}", + urlParameters: [ + Parameters.resourceGroupName, + Parameters.name, + Parameters.publicCertificateName, + Parameters.subscriptionId + ], + queryParameters: [ + Parameters.apiVersion + ], + headerParameters: [ + Parameters.acceptLanguage + ], + requestBody: { + parameterPath: "publicCertificate", + mapper: { + ...Mappers.PublicCertificate, + required: true + } + }, + responses: { + 200: { + bodyMapper: Mappers.PublicCertificate + }, + default: { + bodyMapper: Mappers.DefaultErrorResponse + } + }, + serializer +}; + +const deletePublicCertificateOperationSpec: msRest.OperationSpec = { + httpMethod: "DELETE", + path: "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/publicCertificates/{publicCertificateName}", + urlParameters: [ + Parameters.resourceGroupName, + Parameters.name, + Parameters.publicCertificateName, + Parameters.subscriptionId + ], + queryParameters: [ + Parameters.apiVersion + ], + headerParameters: [ + Parameters.acceptLanguage + ], + responses: { + 200: {}, + 204: {}, + default: { + bodyMapper: Mappers.CloudError + } + }, + serializer +}; + +const listPublishingProfileXmlWithSecretsOperationSpec: msRest.OperationSpec = { + httpMethod: "POST", + path: "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/publishxml", + urlParameters: [ + Parameters.resourceGroupName, + Parameters.name, + Parameters.subscriptionId + ], + queryParameters: [ + Parameters.apiVersion + ], + headerParameters: [ + Parameters.acceptLanguage + ], + requestBody: { + parameterPath: "publishingProfileOptions", + mapper: { + ...Mappers.CsmPublishingProfileOptions, + required: true + } + }, + responses: { + 200: { + bodyMapper: { + serializedName: "parsedResponse", + type: { + name: "Stream" + } + } + }, + default: { + bodyMapper: Mappers.DefaultErrorResponse + } + }, + serializer +}; + +const resetProductionSlotConfigOperationSpec: msRest.OperationSpec = { + httpMethod: "POST", + path: "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/resetSlotConfig", + urlParameters: [ + Parameters.resourceGroupName, + Parameters.name, + Parameters.subscriptionId + ], + queryParameters: [ + Parameters.apiVersion + ], + headerParameters: [ + Parameters.acceptLanguage + ], + responses: { + 200: {}, + default: { + bodyMapper: Mappers.CloudError + } + }, + serializer +}; + +const restartOperationSpec: msRest.OperationSpec = { + httpMethod: "POST", + path: "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/restart", + urlParameters: [ + Parameters.resourceGroupName, + Parameters.name, + Parameters.subscriptionId + ], + queryParameters: [ + Parameters.softRestart, + Parameters.synchronous, + Parameters.apiVersion + ], + headerParameters: [ + Parameters.acceptLanguage + ], + responses: { + 200: {}, + default: { + bodyMapper: Mappers.CloudError + } + }, + serializer +}; + +const listSiteExtensionsOperationSpec: msRest.OperationSpec = { + httpMethod: "GET", + path: "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/siteextensions", + urlParameters: [ + Parameters.resourceGroupName, + Parameters.name, + Parameters.subscriptionId + ], + queryParameters: [ + Parameters.apiVersion + ], + headerParameters: [ + Parameters.acceptLanguage + ], + responses: { + 200: { + bodyMapper: Mappers.SiteExtensionInfoCollection + }, + 404: {}, + default: { + bodyMapper: Mappers.CloudError + } + }, + serializer +}; + +const getSiteExtensionOperationSpec: msRest.OperationSpec = { + httpMethod: "GET", + path: "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/siteextensions/{siteExtensionId}", + urlParameters: [ + Parameters.resourceGroupName, + Parameters.name, + Parameters.siteExtensionId, + Parameters.subscriptionId + ], + queryParameters: [ + Parameters.apiVersion + ], + headerParameters: [ + Parameters.acceptLanguage + ], + responses: { + 200: { + bodyMapper: Mappers.SiteExtensionInfo + }, + 404: {}, + default: { + bodyMapper: Mappers.CloudError + } + }, + serializer +}; + +const deleteSiteExtensionOperationSpec: msRest.OperationSpec = { + httpMethod: "DELETE", + path: "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/siteextensions/{siteExtensionId}", + urlParameters: [ + Parameters.resourceGroupName, + Parameters.name, + Parameters.siteExtensionId, + Parameters.subscriptionId + ], + queryParameters: [ + Parameters.apiVersion + ], + headerParameters: [ + Parameters.acceptLanguage + ], + responses: { + 204: {}, + 404: {}, + default: { + bodyMapper: Mappers.CloudError + } + }, + serializer +}; + +const listSlotsOperationSpec: msRest.OperationSpec = { + httpMethod: "GET", + path: "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots", + urlParameters: [ + Parameters.resourceGroupName, + Parameters.name, + Parameters.subscriptionId + ], + queryParameters: [ + Parameters.apiVersion + ], + headerParameters: [ + Parameters.acceptLanguage + ], + responses: { + 200: { + bodyMapper: Mappers.WebAppCollection + }, + default: { + bodyMapper: Mappers.DefaultErrorResponse + } + }, + serializer +}; + +const getSlotOperationSpec: msRest.OperationSpec = { + httpMethod: "GET", + path: "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}", + urlParameters: [ + Parameters.resourceGroupName, + Parameters.name, + Parameters.slot, + Parameters.subscriptionId + ], + queryParameters: [ + Parameters.apiVersion + ], + headerParameters: [ + Parameters.acceptLanguage + ], + responses: { + 200: { + bodyMapper: Mappers.Site + }, + 404: {}, + default: { + bodyMapper: Mappers.CloudError + } + }, + serializer +}; + +const deleteSlotOperationSpec: msRest.OperationSpec = { + httpMethod: "DELETE", + path: "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}", + urlParameters: [ + Parameters.resourceGroupName, + Parameters.name, + Parameters.slot, + Parameters.subscriptionId + ], + queryParameters: [ + Parameters.deleteMetrics, + Parameters.deleteEmptyServerFarm, + Parameters.apiVersion + ], + headerParameters: [ + Parameters.acceptLanguage + ], + responses: { + 200: {}, + 204: {}, + 404: {}, + default: { + bodyMapper: Mappers.CloudError + } + }, + serializer +}; + +const updateSlotOperationSpec: msRest.OperationSpec = { + httpMethod: "PATCH", + path: "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}", + urlParameters: [ + Parameters.resourceGroupName, + Parameters.name, + Parameters.slot, + Parameters.subscriptionId + ], + queryParameters: [ + Parameters.apiVersion + ], + headerParameters: [ + Parameters.acceptLanguage + ], + requestBody: { + parameterPath: "siteEnvelope", + mapper: { + ...Mappers.SitePatchResource, + required: true + } + }, + responses: { + 200: { + bodyMapper: Mappers.Site + }, + 202: { + bodyMapper: Mappers.Site + }, + default: { + bodyMapper: Mappers.DefaultErrorResponse + } + }, + serializer +}; + +const analyzeCustomHostnameSlotOperationSpec: msRest.OperationSpec = { + httpMethod: "GET", + path: "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/analyzeCustomHostname", + urlParameters: [ + Parameters.resourceGroupName, + Parameters.name, + Parameters.slot, + Parameters.subscriptionId + ], + queryParameters: [ + Parameters.hostName0, + Parameters.apiVersion + ], + headerParameters: [ + Parameters.acceptLanguage + ], + responses: { + 200: { + bodyMapper: Mappers.CustomHostnameAnalysisResult + }, + default: { + bodyMapper: Mappers.DefaultErrorResponse + } + }, + serializer +}; + +const applySlotConfigurationSlotOperationSpec: msRest.OperationSpec = { + httpMethod: "POST", + path: "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/applySlotConfig", + urlParameters: [ + Parameters.resourceGroupName, + Parameters.name, + Parameters.slot, + Parameters.subscriptionId + ], + queryParameters: [ + Parameters.apiVersion + ], + headerParameters: [ + Parameters.acceptLanguage + ], + requestBody: { + parameterPath: "slotSwapEntity", + mapper: { + ...Mappers.CsmSlotEntity, + required: true + } + }, + responses: { + 200: {}, + default: { + bodyMapper: Mappers.CloudError + } + }, + serializer +}; + +const backupSlotOperationSpec: msRest.OperationSpec = { + httpMethod: "POST", + path: "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/backup", + urlParameters: [ + Parameters.resourceGroupName, + Parameters.name, + Parameters.slot, + Parameters.subscriptionId + ], + queryParameters: [ + Parameters.apiVersion + ], + headerParameters: [ + Parameters.acceptLanguage + ], + requestBody: { + parameterPath: "request", + mapper: { + ...Mappers.BackupRequest, + required: true + } + }, + responses: { + 200: { + bodyMapper: Mappers.BackupItem + }, + default: { + bodyMapper: Mappers.DefaultErrorResponse + } + }, + serializer +}; + +const listBackupsSlotOperationSpec: msRest.OperationSpec = { + httpMethod: "GET", + path: "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/backups", + urlParameters: [ + Parameters.resourceGroupName, + Parameters.name, + Parameters.slot, + Parameters.subscriptionId + ], + queryParameters: [ + Parameters.apiVersion + ], + headerParameters: [ + Parameters.acceptLanguage + ], + responses: { + 200: { + bodyMapper: Mappers.BackupItemCollection + }, + default: { + bodyMapper: Mappers.DefaultErrorResponse + } + }, + serializer +}; + +const getBackupStatusSlotOperationSpec: msRest.OperationSpec = { + httpMethod: "GET", + path: "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/backups/{backupId}", + urlParameters: [ + Parameters.resourceGroupName, + Parameters.name, + Parameters.backupId, + Parameters.slot, + Parameters.subscriptionId + ], + queryParameters: [ + Parameters.apiVersion + ], + headerParameters: [ + Parameters.acceptLanguage + ], + responses: { + 200: { + bodyMapper: Mappers.BackupItem + }, + default: { + bodyMapper: Mappers.DefaultErrorResponse + } + }, + serializer +}; + +const deleteBackupSlotOperationSpec: msRest.OperationSpec = { + httpMethod: "DELETE", + path: "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/backups/{backupId}", + urlParameters: [ + Parameters.resourceGroupName, + Parameters.name, + Parameters.backupId, + Parameters.slot, + Parameters.subscriptionId + ], + queryParameters: [ + Parameters.apiVersion + ], + headerParameters: [ + Parameters.acceptLanguage + ], + responses: { + 200: {}, + 404: {}, + default: { + bodyMapper: Mappers.CloudError + } + }, + serializer +}; + +const listBackupStatusSecretsSlotOperationSpec: msRest.OperationSpec = { + httpMethod: "POST", + path: "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/backups/{backupId}/list", + urlParameters: [ + Parameters.resourceGroupName, + Parameters.name, + Parameters.backupId, + Parameters.slot, + Parameters.subscriptionId + ], + queryParameters: [ + Parameters.apiVersion + ], + headerParameters: [ + Parameters.acceptLanguage + ], + requestBody: { + parameterPath: "request", + mapper: { + ...Mappers.BackupRequest, + required: true + } + }, + responses: { + 200: { + bodyMapper: Mappers.BackupItem + }, + default: { + bodyMapper: Mappers.DefaultErrorResponse + } + }, + serializer +}; + +const listConfigurationsSlotOperationSpec: msRest.OperationSpec = { + httpMethod: "GET", + path: "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/config", + urlParameters: [ + Parameters.resourceGroupName, + Parameters.name, + Parameters.slot, + Parameters.subscriptionId + ], + queryParameters: [ + Parameters.apiVersion + ], + headerParameters: [ + Parameters.acceptLanguage + ], + responses: { + 200: { + bodyMapper: Mappers.SiteConfigResourceCollection + }, + default: { + bodyMapper: Mappers.DefaultErrorResponse + } + }, + serializer +}; + +const updateApplicationSettingsSlotOperationSpec: msRest.OperationSpec = { + httpMethod: "PUT", + path: "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/config/appsettings", + urlParameters: [ + Parameters.resourceGroupName, + Parameters.name, + Parameters.slot, + Parameters.subscriptionId + ], + queryParameters: [ + Parameters.apiVersion + ], + headerParameters: [ + Parameters.acceptLanguage + ], + requestBody: { + parameterPath: "appSettings", + mapper: { + ...Mappers.StringDictionary, + required: true + } + }, + responses: { + 200: { + bodyMapper: Mappers.StringDictionary + }, + default: { + bodyMapper: Mappers.DefaultErrorResponse + } + }, + serializer +}; + +const listApplicationSettingsSlotOperationSpec: msRest.OperationSpec = { + httpMethod: "POST", + path: "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/config/appsettings/list", + urlParameters: [ + Parameters.resourceGroupName, + Parameters.name, + Parameters.slot, + Parameters.subscriptionId + ], + queryParameters: [ + Parameters.apiVersion + ], + headerParameters: [ + Parameters.acceptLanguage + ], + responses: { + 200: { + bodyMapper: Mappers.StringDictionary + }, + default: { + bodyMapper: Mappers.DefaultErrorResponse + } + }, + serializer +}; + +const updateAuthSettingsSlotOperationSpec: msRest.OperationSpec = { + httpMethod: "PUT", + path: "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/config/authsettings", + urlParameters: [ + Parameters.resourceGroupName, + Parameters.name, + Parameters.slot, + Parameters.subscriptionId + ], + queryParameters: [ + Parameters.apiVersion + ], + headerParameters: [ + Parameters.acceptLanguage + ], + requestBody: { + parameterPath: "siteAuthSettings", + mapper: { + ...Mappers.SiteAuthSettings, + required: true + } + }, + responses: { + 200: { + bodyMapper: Mappers.SiteAuthSettings + }, + default: { + bodyMapper: Mappers.DefaultErrorResponse + } + }, + serializer +}; + +const getAuthSettingsSlotOperationSpec: msRest.OperationSpec = { + httpMethod: "POST", + path: "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/config/authsettings/list", + urlParameters: [ + Parameters.resourceGroupName, + Parameters.name, + Parameters.slot, + Parameters.subscriptionId + ], + queryParameters: [ + Parameters.apiVersion + ], + headerParameters: [ + Parameters.acceptLanguage + ], + responses: { + 200: { + bodyMapper: Mappers.SiteAuthSettings + }, + default: { + bodyMapper: Mappers.DefaultErrorResponse + } + }, + serializer +}; + +const updateAzureStorageAccountsSlotOperationSpec: msRest.OperationSpec = { + httpMethod: "PUT", + path: "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/config/azurestorageaccounts", + urlParameters: [ + Parameters.resourceGroupName, + Parameters.name, + Parameters.slot, + Parameters.subscriptionId + ], + queryParameters: [ + Parameters.apiVersion + ], + headerParameters: [ + Parameters.acceptLanguage + ], + requestBody: { + parameterPath: "azureStorageAccounts", + mapper: { + ...Mappers.AzureStoragePropertyDictionaryResource, + required: true + } + }, + responses: { + 200: { + bodyMapper: Mappers.AzureStoragePropertyDictionaryResource + }, + default: { + bodyMapper: Mappers.DefaultErrorResponse + } + }, + serializer +}; + +const listAzureStorageAccountsSlotOperationSpec: msRest.OperationSpec = { + httpMethod: "POST", + path: "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/config/azurestorageaccounts/list", + urlParameters: [ + Parameters.resourceGroupName, + Parameters.name, + Parameters.slot, + Parameters.subscriptionId + ], + queryParameters: [ + Parameters.apiVersion + ], + headerParameters: [ + Parameters.acceptLanguage + ], + responses: { + 200: { + bodyMapper: Mappers.AzureStoragePropertyDictionaryResource + }, + default: { + bodyMapper: Mappers.DefaultErrorResponse + } + }, + serializer +}; + +const updateBackupConfigurationSlotOperationSpec: msRest.OperationSpec = { + httpMethod: "PUT", + path: "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/config/backup", + urlParameters: [ + Parameters.resourceGroupName, + Parameters.name, + Parameters.slot, + Parameters.subscriptionId + ], + queryParameters: [ + Parameters.apiVersion + ], + headerParameters: [ + Parameters.acceptLanguage + ], + requestBody: { + parameterPath: "request", + mapper: { + ...Mappers.BackupRequest, + required: true + } + }, + responses: { + 200: { + bodyMapper: Mappers.BackupRequest + }, + default: { + bodyMapper: Mappers.DefaultErrorResponse + } + }, + serializer +}; + +const deleteBackupConfigurationSlotOperationSpec: msRest.OperationSpec = { + httpMethod: "DELETE", + path: "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/config/backup", + urlParameters: [ + Parameters.resourceGroupName, + Parameters.name, + Parameters.slot, + Parameters.subscriptionId + ], + queryParameters: [ + Parameters.apiVersion + ], + headerParameters: [ + Parameters.acceptLanguage + ], + responses: { + 200: {}, + default: { + bodyMapper: Mappers.CloudError + } + }, + serializer +}; + +const getBackupConfigurationSlotOperationSpec: msRest.OperationSpec = { + httpMethod: "POST", + path: "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/config/backup/list", + urlParameters: [ + Parameters.resourceGroupName, + Parameters.name, + Parameters.slot, + Parameters.subscriptionId + ], + queryParameters: [ + Parameters.apiVersion + ], + headerParameters: [ + Parameters.acceptLanguage + ], + responses: { + 200: { + bodyMapper: Mappers.BackupRequest + }, + default: { + bodyMapper: Mappers.DefaultErrorResponse + } + }, + serializer +}; + +const updateConnectionStringsSlotOperationSpec: msRest.OperationSpec = { + httpMethod: "PUT", + path: "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/config/connectionstrings", + urlParameters: [ + Parameters.resourceGroupName, + Parameters.name, + Parameters.slot, + Parameters.subscriptionId + ], + queryParameters: [ + Parameters.apiVersion + ], + headerParameters: [ + Parameters.acceptLanguage + ], + requestBody: { + parameterPath: "connectionStrings", + mapper: { + ...Mappers.ConnectionStringDictionary, + required: true + } + }, + responses: { + 200: { + bodyMapper: Mappers.ConnectionStringDictionary + }, + default: { + bodyMapper: Mappers.DefaultErrorResponse + } + }, + serializer +}; + +const listConnectionStringsSlotOperationSpec: msRest.OperationSpec = { + httpMethod: "POST", + path: "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/config/connectionstrings/list", + urlParameters: [ + Parameters.resourceGroupName, + Parameters.name, + Parameters.slot, + Parameters.subscriptionId + ], + queryParameters: [ + Parameters.apiVersion + ], + headerParameters: [ + Parameters.acceptLanguage + ], + responses: { + 200: { + bodyMapper: Mappers.ConnectionStringDictionary + }, + default: { + bodyMapper: Mappers.DefaultErrorResponse + } + }, + serializer +}; + +const getDiagnosticLogsConfigurationSlotOperationSpec: msRest.OperationSpec = { + httpMethod: "GET", + path: "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/config/logs", + urlParameters: [ + Parameters.resourceGroupName, + Parameters.name, + Parameters.slot, + Parameters.subscriptionId + ], + queryParameters: [ + Parameters.apiVersion + ], + headerParameters: [ + Parameters.acceptLanguage + ], + responses: { + 200: { + bodyMapper: Mappers.SiteLogsConfig + }, + default: { + bodyMapper: Mappers.DefaultErrorResponse + } + }, + serializer +}; + +const updateDiagnosticLogsConfigSlotOperationSpec: msRest.OperationSpec = { + httpMethod: "PUT", + path: "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/config/logs", + urlParameters: [ + Parameters.resourceGroupName, + Parameters.name, + Parameters.slot, + Parameters.subscriptionId + ], + queryParameters: [ + Parameters.apiVersion + ], + headerParameters: [ + Parameters.acceptLanguage + ], + requestBody: { + parameterPath: "siteLogsConfig", + mapper: { + ...Mappers.SiteLogsConfig, + required: true + } + }, + responses: { + 200: { + bodyMapper: Mappers.SiteLogsConfig + }, + default: { + bodyMapper: Mappers.DefaultErrorResponse + } + }, + serializer +}; + +const updateMetadataSlotOperationSpec: msRest.OperationSpec = { + httpMethod: "PUT", + path: "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/config/metadata", + urlParameters: [ + Parameters.resourceGroupName, + Parameters.name, + Parameters.slot, + Parameters.subscriptionId + ], + queryParameters: [ + Parameters.apiVersion + ], + headerParameters: [ + Parameters.acceptLanguage + ], + requestBody: { + parameterPath: "metadata", + mapper: { + ...Mappers.StringDictionary, + required: true + } + }, + responses: { + 200: { + bodyMapper: Mappers.StringDictionary + }, + default: { + bodyMapper: Mappers.DefaultErrorResponse + } + }, + serializer +}; + +const listMetadataSlotOperationSpec: msRest.OperationSpec = { + httpMethod: "POST", + path: "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/config/metadata/list", + urlParameters: [ + Parameters.resourceGroupName, + Parameters.name, + Parameters.slot, + Parameters.subscriptionId + ], + queryParameters: [ + Parameters.apiVersion + ], + headerParameters: [ + Parameters.acceptLanguage + ], + responses: { + 200: { + bodyMapper: Mappers.StringDictionary + }, + default: { + bodyMapper: Mappers.DefaultErrorResponse + } + }, + serializer +}; + +const updateSitePushSettingsSlotOperationSpec: msRest.OperationSpec = { + httpMethod: "PUT", + path: "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/config/pushsettings", + urlParameters: [ + Parameters.resourceGroupName, + Parameters.name, + Parameters.slot, + Parameters.subscriptionId + ], + queryParameters: [ + Parameters.apiVersion + ], + headerParameters: [ + Parameters.acceptLanguage + ], + requestBody: { + parameterPath: "pushSettings", + mapper: { + ...Mappers.PushSettings, + required: true + } + }, + responses: { + 200: { + bodyMapper: Mappers.PushSettings + }, + default: { + bodyMapper: Mappers.DefaultErrorResponse + } + }, + serializer +}; + +const listSitePushSettingsSlotOperationSpec: msRest.OperationSpec = { + httpMethod: "POST", + path: "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/config/pushsettings/list", + urlParameters: [ + Parameters.resourceGroupName, + Parameters.name, + Parameters.slot, + Parameters.subscriptionId + ], + queryParameters: [ + Parameters.apiVersion + ], + headerParameters: [ + Parameters.acceptLanguage + ], + responses: { + 200: { + bodyMapper: Mappers.PushSettings + }, + default: { + bodyMapper: Mappers.DefaultErrorResponse + } + }, + serializer +}; + +const getConfigurationSlotOperationSpec: msRest.OperationSpec = { + httpMethod: "GET", + path: "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/config/web", + urlParameters: [ + Parameters.resourceGroupName, + Parameters.name, + Parameters.slot, + Parameters.subscriptionId + ], + queryParameters: [ + Parameters.apiVersion + ], + headerParameters: [ + Parameters.acceptLanguage + ], + responses: { + 200: { + bodyMapper: Mappers.SiteConfigResource + }, + default: { + bodyMapper: Mappers.DefaultErrorResponse + } + }, + serializer +}; + +const createOrUpdateConfigurationSlotOperationSpec: msRest.OperationSpec = { + httpMethod: "PUT", + path: "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/config/web", + urlParameters: [ + Parameters.resourceGroupName, + Parameters.name, + Parameters.slot, + Parameters.subscriptionId + ], + queryParameters: [ + Parameters.apiVersion + ], + headerParameters: [ + Parameters.acceptLanguage + ], + requestBody: { + parameterPath: "siteConfig", + mapper: { + ...Mappers.SiteConfigResource, + required: true + } + }, + responses: { + 200: { + bodyMapper: Mappers.SiteConfigResource + }, + default: { + bodyMapper: Mappers.DefaultErrorResponse + } + }, + serializer +}; + +const updateConfigurationSlotOperationSpec: msRest.OperationSpec = { + httpMethod: "PATCH", + path: "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/config/web", + urlParameters: [ + Parameters.resourceGroupName, + Parameters.name, + Parameters.slot, + Parameters.subscriptionId + ], + queryParameters: [ + Parameters.apiVersion + ], + headerParameters: [ + Parameters.acceptLanguage + ], + requestBody: { + parameterPath: "siteConfig", + mapper: { + ...Mappers.SiteConfigResource, + required: true + } + }, + responses: { + 200: { + bodyMapper: Mappers.SiteConfigResource + }, + default: { + bodyMapper: Mappers.DefaultErrorResponse + } + }, + serializer +}; + +const listConfigurationSnapshotInfoSlotOperationSpec: msRest.OperationSpec = { + httpMethod: "GET", + path: "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/config/web/snapshots", + urlParameters: [ + Parameters.resourceGroupName, + Parameters.name, + Parameters.slot, + Parameters.subscriptionId + ], + queryParameters: [ + Parameters.apiVersion + ], + headerParameters: [ + Parameters.acceptLanguage + ], + responses: { + 200: { + bodyMapper: Mappers.SiteConfigurationSnapshotInfoCollection + }, + default: { + bodyMapper: Mappers.DefaultErrorResponse + } + }, + serializer +}; + +const getConfigurationSnapshotSlotOperationSpec: msRest.OperationSpec = { + httpMethod: "GET", + path: "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/config/web/snapshots/{snapshotId}", + urlParameters: [ + Parameters.resourceGroupName, + Parameters.name, + Parameters.snapshotId, + Parameters.slot, + Parameters.subscriptionId + ], + queryParameters: [ + Parameters.apiVersion + ], + headerParameters: [ + Parameters.acceptLanguage + ], + responses: { + 200: { + bodyMapper: Mappers.SiteConfigResource + }, + default: { + bodyMapper: Mappers.DefaultErrorResponse + } + }, + serializer +}; + +const recoverSiteConfigurationSnapshotSlotOperationSpec: msRest.OperationSpec = { + httpMethod: "POST", + path: "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/config/web/snapshots/{snapshotId}/recover", + urlParameters: [ + Parameters.resourceGroupName, + Parameters.name, + Parameters.snapshotId, + Parameters.slot, + Parameters.subscriptionId + ], + queryParameters: [ + Parameters.apiVersion + ], + headerParameters: [ + Parameters.acceptLanguage + ], + responses: { + 204: {}, + default: { + bodyMapper: Mappers.CloudError + } + }, + serializer +}; + +const getWebSiteContainerLogsSlotOperationSpec: msRest.OperationSpec = { + httpMethod: "POST", + path: "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/containerlogs", + urlParameters: [ + Parameters.resourceGroupName, + Parameters.name, + Parameters.slot, + Parameters.subscriptionId + ], + queryParameters: [ + Parameters.apiVersion + ], + headerParameters: [ + Parameters.acceptLanguage + ], + responses: { + 200: { + bodyMapper: { + serializedName: "parsedResponse", + type: { + name: "Stream" + } + } + }, + 204: {}, + default: { + bodyMapper: Mappers.CloudError + } + }, + serializer +}; + +const getContainerLogsZipSlotOperationSpec: msRest.OperationSpec = { + httpMethod: "POST", + path: "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/containerlogs/zip/download", + urlParameters: [ + Parameters.resourceGroupName, + Parameters.name, + Parameters.slot, + Parameters.subscriptionId + ], + queryParameters: [ + Parameters.apiVersion + ], + headerParameters: [ + Parameters.acceptLanguage + ], + responses: { + 200: { + bodyMapper: { + serializedName: "parsedResponse", + type: { + name: "Stream" + } + } + }, + 204: {}, + default: { + bodyMapper: Mappers.CloudError + } + }, + serializer +}; + +const listContinuousWebJobsSlotOperationSpec: msRest.OperationSpec = { + httpMethod: "GET", + path: "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/continuouswebjobs", + urlParameters: [ + Parameters.resourceGroupName, + Parameters.name, + Parameters.slot, + Parameters.subscriptionId + ], + queryParameters: [ + Parameters.apiVersion + ], + headerParameters: [ + Parameters.acceptLanguage + ], + responses: { + 200: { + bodyMapper: Mappers.ContinuousWebJobCollection + }, + default: { + bodyMapper: Mappers.DefaultErrorResponse + } + }, + serializer +}; + +const getContinuousWebJobSlotOperationSpec: msRest.OperationSpec = { + httpMethod: "GET", + path: "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/continuouswebjobs/{webJobName}", + urlParameters: [ + Parameters.resourceGroupName, + Parameters.name, + Parameters.webJobName, + Parameters.slot, + Parameters.subscriptionId + ], + queryParameters: [ + Parameters.apiVersion + ], + headerParameters: [ + Parameters.acceptLanguage + ], + responses: { + 200: { + bodyMapper: Mappers.ContinuousWebJob + }, + 404: {}, + default: { + bodyMapper: Mappers.CloudError + } + }, + serializer +}; + +const deleteContinuousWebJobSlotOperationSpec: msRest.OperationSpec = { + httpMethod: "DELETE", + path: "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/continuouswebjobs/{webJobName}", + urlParameters: [ + Parameters.resourceGroupName, + Parameters.name, + Parameters.webJobName, + Parameters.slot, + Parameters.subscriptionId + ], + queryParameters: [ + Parameters.apiVersion + ], + headerParameters: [ + Parameters.acceptLanguage + ], + responses: { + 200: {}, + 204: {}, + default: { + bodyMapper: Mappers.CloudError + } + }, + serializer +}; + +const startContinuousWebJobSlotOperationSpec: msRest.OperationSpec = { + httpMethod: "POST", + path: "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/continuouswebjobs/{webJobName}/start", + urlParameters: [ + Parameters.resourceGroupName, + Parameters.name, + Parameters.webJobName, + Parameters.slot, + Parameters.subscriptionId + ], + queryParameters: [ + Parameters.apiVersion + ], + headerParameters: [ + Parameters.acceptLanguage + ], + responses: { + 200: {}, + 404: {}, + default: { + bodyMapper: Mappers.CloudError + } + }, + serializer +}; + +const stopContinuousWebJobSlotOperationSpec: msRest.OperationSpec = { + httpMethod: "POST", + path: "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/continuouswebjobs/{webJobName}/stop", + urlParameters: [ + Parameters.resourceGroupName, + Parameters.name, + Parameters.webJobName, + Parameters.slot, + Parameters.subscriptionId + ], + queryParameters: [ + Parameters.apiVersion + ], + headerParameters: [ + Parameters.acceptLanguage + ], + responses: { + 200: {}, + 404: {}, + default: { + bodyMapper: Mappers.CloudError + } + }, + serializer +}; + +const listDeploymentsSlotOperationSpec: msRest.OperationSpec = { + httpMethod: "GET", + path: "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/deployments", + urlParameters: [ + Parameters.resourceGroupName, + Parameters.name, + Parameters.slot, + Parameters.subscriptionId + ], + queryParameters: [ + Parameters.apiVersion + ], + headerParameters: [ + Parameters.acceptLanguage + ], + responses: { + 200: { + bodyMapper: Mappers.DeploymentCollection + }, + default: { + bodyMapper: Mappers.DefaultErrorResponse + } + }, + serializer +}; + +const getDeploymentSlotOperationSpec: msRest.OperationSpec = { + httpMethod: "GET", + path: "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/deployments/{id}", + urlParameters: [ + Parameters.resourceGroupName, + Parameters.name, + Parameters.id, + Parameters.slot, + Parameters.subscriptionId + ], + queryParameters: [ + Parameters.apiVersion + ], + headerParameters: [ + Parameters.acceptLanguage + ], + responses: { + 200: { + bodyMapper: Mappers.Deployment + }, + default: { + bodyMapper: Mappers.DefaultErrorResponse + } + }, + serializer +}; + +const createDeploymentSlotOperationSpec: msRest.OperationSpec = { + httpMethod: "PUT", + path: "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/deployments/{id}", + urlParameters: [ + Parameters.resourceGroupName, + Parameters.name, + Parameters.id, + Parameters.slot, + Parameters.subscriptionId + ], + queryParameters: [ + Parameters.apiVersion + ], + headerParameters: [ + Parameters.acceptLanguage + ], + requestBody: { + parameterPath: "deployment", + mapper: { + ...Mappers.Deployment, + required: true + } + }, + responses: { + 200: { + bodyMapper: Mappers.Deployment + }, + default: { + bodyMapper: Mappers.DefaultErrorResponse + } + }, + serializer +}; + +const deleteDeploymentSlotOperationSpec: msRest.OperationSpec = { + httpMethod: "DELETE", + path: "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/deployments/{id}", + urlParameters: [ + Parameters.resourceGroupName, + Parameters.name, + Parameters.id, + Parameters.slot, + Parameters.subscriptionId + ], + queryParameters: [ + Parameters.apiVersion + ], + headerParameters: [ + Parameters.acceptLanguage + ], + responses: { + 200: {}, + 204: {}, + default: { + bodyMapper: Mappers.CloudError + } + }, + serializer +}; + +const listDeploymentLogSlotOperationSpec: msRest.OperationSpec = { + httpMethod: "GET", + path: "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/deployments/{id}/log", + urlParameters: [ + Parameters.resourceGroupName, + Parameters.name, + Parameters.id, + Parameters.slot, + Parameters.subscriptionId + ], + queryParameters: [ + Parameters.apiVersion + ], + headerParameters: [ + Parameters.acceptLanguage + ], + responses: { + 200: { + bodyMapper: Mappers.Deployment + }, + default: { + bodyMapper: Mappers.DefaultErrorResponse + } + }, + serializer +}; + +const discoverBackupSlotOperationSpec: msRest.OperationSpec = { + httpMethod: "POST", + path: "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/discoverbackup", + urlParameters: [ + Parameters.resourceGroupName, + Parameters.name, + Parameters.slot, + Parameters.subscriptionId + ], + queryParameters: [ + Parameters.apiVersion + ], + headerParameters: [ + Parameters.acceptLanguage + ], + requestBody: { + parameterPath: "request", + mapper: { + ...Mappers.RestoreRequest, + required: true + } + }, + responses: { + 200: { + bodyMapper: Mappers.RestoreRequest + }, + default: { + bodyMapper: Mappers.DefaultErrorResponse + } + }, + serializer +}; + +const listDomainOwnershipIdentifiersSlotOperationSpec: msRest.OperationSpec = { + httpMethod: "GET", + path: "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/domainOwnershipIdentifiers", + urlParameters: [ + Parameters.resourceGroupName, + Parameters.name, + Parameters.slot, + Parameters.subscriptionId + ], + queryParameters: [ + Parameters.apiVersion + ], + headerParameters: [ + Parameters.acceptLanguage + ], + responses: { + 200: { + bodyMapper: Mappers.IdentifierCollection + }, + default: { + bodyMapper: Mappers.DefaultErrorResponse + } + }, + serializer +}; + +const getDomainOwnershipIdentifierSlotOperationSpec: msRest.OperationSpec = { + httpMethod: "GET", + path: "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/domainOwnershipIdentifiers/{domainOwnershipIdentifierName}", + urlParameters: [ + Parameters.resourceGroupName, + Parameters.name, + Parameters.domainOwnershipIdentifierName, + Parameters.slot, + Parameters.subscriptionId + ], + queryParameters: [ + Parameters.apiVersion + ], + headerParameters: [ + Parameters.acceptLanguage + ], + responses: { + 200: { + bodyMapper: Mappers.Identifier + }, + default: { + bodyMapper: Mappers.DefaultErrorResponse + } + }, + serializer +}; + +const createOrUpdateDomainOwnershipIdentifierSlotOperationSpec: msRest.OperationSpec = { + httpMethod: "PUT", + path: "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/domainOwnershipIdentifiers/{domainOwnershipIdentifierName}", + urlParameters: [ + Parameters.resourceGroupName, + Parameters.name, + Parameters.domainOwnershipIdentifierName, + Parameters.slot, + Parameters.subscriptionId + ], + queryParameters: [ + Parameters.apiVersion + ], + headerParameters: [ + Parameters.acceptLanguage + ], + requestBody: { + parameterPath: "domainOwnershipIdentifier", + mapper: { + ...Mappers.Identifier, + required: true + } + }, + responses: { + 200: { + bodyMapper: Mappers.Identifier + }, + default: { + bodyMapper: Mappers.DefaultErrorResponse + } + }, + serializer +}; + +const deleteDomainOwnershipIdentifierSlotOperationSpec: msRest.OperationSpec = { + httpMethod: "DELETE", + path: "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/domainOwnershipIdentifiers/{domainOwnershipIdentifierName}", + urlParameters: [ + Parameters.resourceGroupName, + Parameters.name, + Parameters.domainOwnershipIdentifierName, + Parameters.slot, + Parameters.subscriptionId + ], + queryParameters: [ + Parameters.apiVersion + ], + headerParameters: [ + Parameters.acceptLanguage + ], + responses: { + 200: {}, + 204: {}, + default: { + bodyMapper: Mappers.CloudError + } + }, + serializer +}; + +const updateDomainOwnershipIdentifierSlotOperationSpec: msRest.OperationSpec = { + httpMethod: "PATCH", + path: "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/domainOwnershipIdentifiers/{domainOwnershipIdentifierName}", + urlParameters: [ + Parameters.resourceGroupName, + Parameters.name, + Parameters.domainOwnershipIdentifierName, + Parameters.slot, + Parameters.subscriptionId + ], + queryParameters: [ + Parameters.apiVersion + ], + headerParameters: [ + Parameters.acceptLanguage + ], + requestBody: { + parameterPath: "domainOwnershipIdentifier", + mapper: { + ...Mappers.Identifier, + required: true + } + }, + responses: { + 200: { + bodyMapper: Mappers.Identifier + }, + default: { + bodyMapper: Mappers.DefaultErrorResponse + } + }, + serializer +}; + +const getMSDeployStatusSlotOperationSpec: msRest.OperationSpec = { + httpMethod: "GET", + path: "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/extensions/MSDeploy", + urlParameters: [ + Parameters.resourceGroupName, + Parameters.name, + Parameters.slot, + Parameters.subscriptionId + ], + queryParameters: [ + Parameters.apiVersion + ], + headerParameters: [ + Parameters.acceptLanguage + ], + responses: { + 200: { + bodyMapper: Mappers.MSDeployStatus + }, + default: { + bodyMapper: Mappers.DefaultErrorResponse + } + }, + serializer +}; + +const getMSDeployLogSlotOperationSpec: msRest.OperationSpec = { + httpMethod: "GET", + path: "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/extensions/MSDeploy/log", + urlParameters: [ + Parameters.resourceGroupName, + Parameters.name, + Parameters.slot, + Parameters.subscriptionId + ], + queryParameters: [ + Parameters.apiVersion + ], + headerParameters: [ + Parameters.acceptLanguage + ], + responses: { + 200: { + bodyMapper: Mappers.MSDeployLog + }, + 404: {}, + default: { + bodyMapper: Mappers.CloudError + } + }, + serializer +}; + +const listInstanceFunctionsSlotOperationSpec: msRest.OperationSpec = { + httpMethod: "GET", + path: "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/functions", + urlParameters: [ + Parameters.resourceGroupName, + Parameters.name, + Parameters.slot, + Parameters.subscriptionId + ], + queryParameters: [ + Parameters.apiVersion + ], + headerParameters: [ + Parameters.acceptLanguage + ], + responses: { + 200: { + bodyMapper: Mappers.FunctionEnvelopeCollection + }, + 404: {}, + default: { + bodyMapper: Mappers.CloudError + } + }, + serializer +}; + +const getFunctionsAdminTokenSlotOperationSpec: msRest.OperationSpec = { + httpMethod: "GET", + path: "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/functions/admin/token", + urlParameters: [ + Parameters.resourceGroupName, + Parameters.name, + Parameters.slot, + Parameters.subscriptionId + ], + queryParameters: [ + Parameters.apiVersion + ], + headerParameters: [ + Parameters.acceptLanguage + ], + responses: { + 200: { + bodyMapper: { + serializedName: "parsedResponse", + type: { + name: "String" + } + } + }, + default: { + bodyMapper: Mappers.DefaultErrorResponse + } + }, + serializer +}; + +const getInstanceFunctionSlotOperationSpec: msRest.OperationSpec = { + httpMethod: "GET", + path: "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/functions/{functionName}", + urlParameters: [ + Parameters.resourceGroupName, + Parameters.name, + Parameters.functionName, + Parameters.slot, + Parameters.subscriptionId + ], + queryParameters: [ + Parameters.apiVersion + ], + headerParameters: [ + Parameters.acceptLanguage + ], + responses: { + 200: { + bodyMapper: Mappers.FunctionEnvelope + }, + 404: {}, + default: { + bodyMapper: Mappers.CloudError + } + }, + serializer +}; + +const deleteInstanceFunctionSlotOperationSpec: msRest.OperationSpec = { + httpMethod: "DELETE", + path: "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/functions/{functionName}", + urlParameters: [ + Parameters.resourceGroupName, + Parameters.name, + Parameters.functionName, + Parameters.slot, + Parameters.subscriptionId + ], + queryParameters: [ + Parameters.apiVersion + ], + headerParameters: [ + Parameters.acceptLanguage + ], + responses: { + 204: {}, + 404: {}, + default: { + bodyMapper: Mappers.CloudError + } + }, + serializer +}; + +const listFunctionSecretsSlotOperationSpec: msRest.OperationSpec = { + httpMethod: "POST", + path: "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/functions/{functionName}/listsecrets", + urlParameters: [ + Parameters.resourceGroupName, + Parameters.name, + Parameters.functionName, + Parameters.slot, + Parameters.subscriptionId + ], + queryParameters: [ + Parameters.apiVersion + ], + headerParameters: [ + Parameters.acceptLanguage + ], + responses: { + 200: { + bodyMapper: Mappers.FunctionSecrets + }, + default: { + bodyMapper: Mappers.DefaultErrorResponse + } + }, + serializer +}; + +const listHostNameBindingsSlotOperationSpec: msRest.OperationSpec = { + httpMethod: "GET", + path: "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/hostNameBindings", + urlParameters: [ + Parameters.resourceGroupName, + Parameters.name, + Parameters.slot, + Parameters.subscriptionId + ], + queryParameters: [ + Parameters.apiVersion + ], + headerParameters: [ + Parameters.acceptLanguage + ], + responses: { + 200: { + bodyMapper: Mappers.HostNameBindingCollection + }, + default: { + bodyMapper: Mappers.DefaultErrorResponse + } + }, + serializer +}; + +const getHostNameBindingSlotOperationSpec: msRest.OperationSpec = { + httpMethod: "GET", + path: "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/hostNameBindings/{hostName}", + urlParameters: [ + Parameters.resourceGroupName, + Parameters.name, + Parameters.slot, + Parameters.hostName1, + Parameters.subscriptionId + ], + queryParameters: [ + Parameters.apiVersion + ], + headerParameters: [ + Parameters.acceptLanguage + ], + responses: { + 200: { + bodyMapper: Mappers.HostNameBinding + }, + default: { + bodyMapper: Mappers.DefaultErrorResponse + } + }, + serializer +}; + +const createOrUpdateHostNameBindingSlotOperationSpec: msRest.OperationSpec = { + httpMethod: "PUT", + path: "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/hostNameBindings/{hostName}", + urlParameters: [ + Parameters.resourceGroupName, + Parameters.name, + Parameters.hostName1, + Parameters.slot, + Parameters.subscriptionId + ], + queryParameters: [ + Parameters.apiVersion + ], + headerParameters: [ + Parameters.acceptLanguage + ], + requestBody: { + parameterPath: "hostNameBinding", + mapper: { + ...Mappers.HostNameBinding, + required: true + } + }, + responses: { + 200: { + bodyMapper: Mappers.HostNameBinding + }, + default: { + bodyMapper: Mappers.DefaultErrorResponse + } + }, + serializer +}; + +const deleteHostNameBindingSlotOperationSpec: msRest.OperationSpec = { + httpMethod: "DELETE", + path: "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/hostNameBindings/{hostName}", + urlParameters: [ + Parameters.resourceGroupName, + Parameters.name, + Parameters.slot, + Parameters.hostName1, + Parameters.subscriptionId + ], + queryParameters: [ + Parameters.apiVersion + ], + headerParameters: [ + Parameters.acceptLanguage + ], + responses: { + 200: {}, + 204: {}, + default: { + bodyMapper: Mappers.CloudError + } + }, + serializer +}; + +const getHybridConnectionSlotOperationSpec: msRest.OperationSpec = { + httpMethod: "GET", + path: "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/hybridConnectionNamespaces/{namespaceName}/relays/{relayName}", + urlParameters: [ + Parameters.resourceGroupName, + Parameters.name, + Parameters.namespaceName, + Parameters.relayName, + Parameters.slot, + Parameters.subscriptionId + ], + queryParameters: [ + Parameters.apiVersion + ], + headerParameters: [ + Parameters.acceptLanguage + ], + responses: { + 200: { + bodyMapper: Mappers.HybridConnection + }, + default: { + bodyMapper: Mappers.DefaultErrorResponse + } + }, + serializer +}; + +const createOrUpdateHybridConnectionSlotOperationSpec: msRest.OperationSpec = { + httpMethod: "PUT", + path: "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/hybridConnectionNamespaces/{namespaceName}/relays/{relayName}", + urlParameters: [ + Parameters.resourceGroupName, + Parameters.name, + Parameters.namespaceName, + Parameters.relayName, + Parameters.slot, + Parameters.subscriptionId + ], + queryParameters: [ + Parameters.apiVersion + ], + headerParameters: [ + Parameters.acceptLanguage + ], + requestBody: { + parameterPath: "connectionEnvelope", + mapper: { + ...Mappers.HybridConnection, + required: true + } + }, + responses: { + 200: { + bodyMapper: Mappers.HybridConnection + }, + default: { + bodyMapper: Mappers.DefaultErrorResponse + } + }, + serializer +}; + +const deleteHybridConnectionSlotOperationSpec: msRest.OperationSpec = { + httpMethod: "DELETE", + path: "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/hybridConnectionNamespaces/{namespaceName}/relays/{relayName}", + urlParameters: [ + Parameters.resourceGroupName, + Parameters.name, + Parameters.namespaceName, + Parameters.relayName, + Parameters.slot, + Parameters.subscriptionId + ], + queryParameters: [ + Parameters.apiVersion + ], + headerParameters: [ + Parameters.acceptLanguage + ], + responses: { + 200: {}, + 404: {}, + default: { + bodyMapper: Mappers.CloudError + } + }, + serializer +}; + +const updateHybridConnectionSlotOperationSpec: msRest.OperationSpec = { + httpMethod: "PATCH", + path: "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/hybridConnectionNamespaces/{namespaceName}/relays/{relayName}", + urlParameters: [ + Parameters.resourceGroupName, + Parameters.name, + Parameters.namespaceName, + Parameters.relayName, + Parameters.slot, + Parameters.subscriptionId + ], + queryParameters: [ + Parameters.apiVersion + ], + headerParameters: [ + Parameters.acceptLanguage + ], + requestBody: { + parameterPath: "connectionEnvelope", + mapper: { + ...Mappers.HybridConnection, + required: true + } + }, + responses: { + 200: { + bodyMapper: Mappers.HybridConnection + }, + default: { + bodyMapper: Mappers.DefaultErrorResponse + } + }, + serializer +}; + +const listHybridConnectionKeysSlotOperationSpec: msRest.OperationSpec = { + httpMethod: "POST", + path: "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/hybridConnectionNamespaces/{namespaceName}/relays/{relayName}/listKeys", + urlParameters: [ + Parameters.resourceGroupName, + Parameters.name, + Parameters.namespaceName, + Parameters.relayName, + Parameters.slot, + Parameters.subscriptionId + ], + queryParameters: [ + Parameters.apiVersion + ], + headerParameters: [ + Parameters.acceptLanguage + ], + responses: { + 200: { + bodyMapper: Mappers.HybridConnectionKey + }, + default: { + bodyMapper: Mappers.DefaultErrorResponse + } + }, + serializer +}; + +const listHybridConnectionsSlotOperationSpec: msRest.OperationSpec = { + httpMethod: "GET", + path: "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/hybridConnectionRelays", + urlParameters: [ + Parameters.resourceGroupName, + Parameters.name, + Parameters.slot, + Parameters.subscriptionId + ], + queryParameters: [ + Parameters.apiVersion + ], + headerParameters: [ + Parameters.acceptLanguage + ], + responses: { + 200: { + bodyMapper: Mappers.HybridConnection + }, + default: { + bodyMapper: Mappers.DefaultErrorResponse + } + }, + serializer +}; + +const listRelayServiceConnectionsSlotOperationSpec: msRest.OperationSpec = { + httpMethod: "GET", + path: "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/hybridconnection", + urlParameters: [ + Parameters.resourceGroupName, + Parameters.name, + Parameters.slot, + Parameters.subscriptionId + ], + queryParameters: [ + Parameters.apiVersion + ], + headerParameters: [ + Parameters.acceptLanguage + ], + responses: { + 200: { + bodyMapper: Mappers.RelayServiceConnectionEntity + }, + default: { + bodyMapper: Mappers.DefaultErrorResponse + } + }, + serializer +}; + +const getRelayServiceConnectionSlotOperationSpec: msRest.OperationSpec = { + httpMethod: "GET", + path: "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/hybridconnection/{entityName}", + urlParameters: [ + Parameters.resourceGroupName, + Parameters.name, + Parameters.entityName, + Parameters.slot, + Parameters.subscriptionId + ], + queryParameters: [ + Parameters.apiVersion + ], + headerParameters: [ + Parameters.acceptLanguage + ], + responses: { + 200: { + bodyMapper: Mappers.RelayServiceConnectionEntity + }, + default: { + bodyMapper: Mappers.DefaultErrorResponse + } + }, + serializer +}; + +const createOrUpdateRelayServiceConnectionSlotOperationSpec: msRest.OperationSpec = { + httpMethod: "PUT", + path: "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/hybridconnection/{entityName}", + urlParameters: [ + Parameters.resourceGroupName, + Parameters.name, + Parameters.entityName, + Parameters.slot, + Parameters.subscriptionId + ], + queryParameters: [ + Parameters.apiVersion + ], + headerParameters: [ + Parameters.acceptLanguage + ], + requestBody: { + parameterPath: "connectionEnvelope", + mapper: { + ...Mappers.RelayServiceConnectionEntity, + required: true + } + }, + responses: { + 200: { + bodyMapper: Mappers.RelayServiceConnectionEntity + }, + default: { + bodyMapper: Mappers.DefaultErrorResponse + } + }, + serializer +}; + +const deleteRelayServiceConnectionSlotOperationSpec: msRest.OperationSpec = { + httpMethod: "DELETE", + path: "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/hybridconnection/{entityName}", + urlParameters: [ + Parameters.resourceGroupName, + Parameters.name, + Parameters.entityName, + Parameters.slot, + Parameters.subscriptionId + ], + queryParameters: [ + Parameters.apiVersion + ], + headerParameters: [ + Parameters.acceptLanguage + ], + responses: { + 200: {}, + 404: {}, + default: { + bodyMapper: Mappers.CloudError + } + }, + serializer +}; + +const updateRelayServiceConnectionSlotOperationSpec: msRest.OperationSpec = { + httpMethod: "PATCH", + path: "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/hybridconnection/{entityName}", + urlParameters: [ + Parameters.resourceGroupName, + Parameters.name, + Parameters.entityName, + Parameters.slot, + Parameters.subscriptionId + ], + queryParameters: [ + Parameters.apiVersion + ], + headerParameters: [ + Parameters.acceptLanguage + ], + requestBody: { + parameterPath: "connectionEnvelope", + mapper: { + ...Mappers.RelayServiceConnectionEntity, + required: true + } + }, + responses: { + 200: { + bodyMapper: Mappers.RelayServiceConnectionEntity + }, + default: { + bodyMapper: Mappers.DefaultErrorResponse + } + }, + serializer +}; + +const listInstanceIdentifiersSlotOperationSpec: msRest.OperationSpec = { + httpMethod: "GET", + path: "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/instances", + urlParameters: [ + Parameters.resourceGroupName, + Parameters.name, + Parameters.slot, + Parameters.subscriptionId + ], + queryParameters: [ + Parameters.apiVersion + ], + headerParameters: [ + Parameters.acceptLanguage + ], + responses: { + 200: { + bodyMapper: Mappers.WebAppInstanceCollection + }, + default: { + bodyMapper: Mappers.DefaultErrorResponse + } + }, + serializer +}; + +const getInstanceMsDeployStatusSlotOperationSpec: msRest.OperationSpec = { + httpMethod: "GET", + path: "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/instances/{instanceId}/extensions/MSDeploy", + urlParameters: [ + Parameters.resourceGroupName, + Parameters.name, + Parameters.slot, + Parameters.instanceId, + Parameters.subscriptionId + ], + queryParameters: [ + Parameters.apiVersion + ], + headerParameters: [ + Parameters.acceptLanguage + ], + responses: { + 200: { + bodyMapper: Mappers.MSDeployStatus + }, + default: { + bodyMapper: Mappers.DefaultErrorResponse + } + }, + serializer +}; + +const getInstanceMSDeployLogSlotOperationSpec: msRest.OperationSpec = { + httpMethod: "GET", + path: "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/instances/{instanceId}/extensions/MSDeploy/log", + urlParameters: [ + Parameters.resourceGroupName, + Parameters.name, + Parameters.slot, + Parameters.instanceId, + Parameters.subscriptionId + ], + queryParameters: [ + Parameters.apiVersion + ], + headerParameters: [ + Parameters.acceptLanguage + ], + responses: { + 200: { + bodyMapper: Mappers.MSDeployLog + }, + 404: {}, + default: { + bodyMapper: Mappers.CloudError + } + }, + serializer +}; + +const listInstanceProcessesSlotOperationSpec: msRest.OperationSpec = { + httpMethod: "GET", + path: "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/instances/{instanceId}/processes", + urlParameters: [ + Parameters.resourceGroupName, + Parameters.name, + Parameters.slot, + Parameters.instanceId, + Parameters.subscriptionId + ], + queryParameters: [ + Parameters.apiVersion + ], + headerParameters: [ + Parameters.acceptLanguage + ], + responses: { + 200: { + bodyMapper: Mappers.ProcessInfoCollection + }, + 404: {}, + default: { + bodyMapper: Mappers.CloudError + } + }, + serializer +}; + +const getInstanceProcessSlotOperationSpec: msRest.OperationSpec = { + httpMethod: "GET", + path: "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/instances/{instanceId}/processes/{processId}", + urlParameters: [ + Parameters.resourceGroupName, + Parameters.name, + Parameters.processId, + Parameters.slot, + Parameters.instanceId, + Parameters.subscriptionId + ], + queryParameters: [ + Parameters.apiVersion + ], + headerParameters: [ + Parameters.acceptLanguage + ], + responses: { + 200: { + bodyMapper: Mappers.ProcessInfo + }, + 404: {}, + default: { + bodyMapper: Mappers.CloudError + } + }, + serializer +}; + +const deleteInstanceProcessSlotOperationSpec: msRest.OperationSpec = { + httpMethod: "DELETE", + path: "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/instances/{instanceId}/processes/{processId}", + urlParameters: [ + Parameters.resourceGroupName, + Parameters.name, + Parameters.processId, + Parameters.slot, + Parameters.instanceId, + Parameters.subscriptionId + ], + queryParameters: [ + Parameters.apiVersion + ], + headerParameters: [ + Parameters.acceptLanguage + ], + responses: { + 204: {}, + 404: {}, + default: { + bodyMapper: Mappers.CloudError + } + }, + serializer +}; + +const getInstanceProcessDumpSlotOperationSpec: msRest.OperationSpec = { + httpMethod: "GET", + path: "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/instances/{instanceId}/processes/{processId}/dump", + urlParameters: [ + Parameters.resourceGroupName, + Parameters.name, + Parameters.processId, + Parameters.slot, + Parameters.instanceId, + Parameters.subscriptionId + ], + queryParameters: [ + Parameters.apiVersion + ], + headerParameters: [ + Parameters.acceptLanguage + ], + responses: { + 200: { + bodyMapper: { + serializedName: "parsedResponse", + type: { + name: "Stream" + } + } + }, + 404: {}, + default: { + bodyMapper: Mappers.CloudError + } + }, + serializer +}; + +const listInstanceProcessModulesSlotOperationSpec: msRest.OperationSpec = { + httpMethod: "GET", + path: "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/instances/{instanceId}/processes/{processId}/modules", + urlParameters: [ + Parameters.resourceGroupName, + Parameters.name, + Parameters.processId, + Parameters.slot, + Parameters.instanceId, + Parameters.subscriptionId + ], + queryParameters: [ + Parameters.apiVersion + ], + headerParameters: [ + Parameters.acceptLanguage + ], + responses: { + 200: { + bodyMapper: Mappers.ProcessModuleInfoCollection + }, + 404: {}, + default: { + bodyMapper: Mappers.CloudError + } + }, + serializer +}; + +const getInstanceProcessModuleSlotOperationSpec: msRest.OperationSpec = { + httpMethod: "GET", + path: "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/instances/{instanceId}/processes/{processId}/modules/{baseAddress}", + urlParameters: [ + Parameters.resourceGroupName, + Parameters.name, + Parameters.processId, + Parameters.baseAddress, + Parameters.slot, + Parameters.instanceId, + Parameters.subscriptionId + ], + queryParameters: [ + Parameters.apiVersion + ], + headerParameters: [ + Parameters.acceptLanguage + ], + responses: { + 200: { + bodyMapper: Mappers.ProcessModuleInfo + }, + 404: {}, + default: { + bodyMapper: Mappers.CloudError + } + }, + serializer +}; + +const listInstanceProcessThreadsSlotOperationSpec: msRest.OperationSpec = { + httpMethod: "GET", + path: "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/instances/{instanceId}/processes/{processId}/threads", + urlParameters: [ + Parameters.resourceGroupName, + Parameters.name, + Parameters.processId, + Parameters.slot, + Parameters.instanceId, + Parameters.subscriptionId + ], + queryParameters: [ + Parameters.apiVersion + ], + headerParameters: [ + Parameters.acceptLanguage + ], + responses: { + 200: { + bodyMapper: Mappers.ProcessThreadInfoCollection + }, + 404: {}, + default: { + bodyMapper: Mappers.CloudError + } + }, + serializer +}; + +const getInstanceProcessThreadSlotOperationSpec: msRest.OperationSpec = { + httpMethod: "GET", + path: "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/instances/{instanceId}/processes/{processId}/threads/{threadId}", + urlParameters: [ + Parameters.resourceGroupName, + Parameters.name, + Parameters.processId, + Parameters.threadId, + Parameters.slot, + Parameters.instanceId, + Parameters.subscriptionId + ], + queryParameters: [ + Parameters.apiVersion + ], + headerParameters: [ + Parameters.acceptLanguage + ], + responses: { + 200: { + bodyMapper: Mappers.ProcessThreadInfo + }, + 404: {}, + default: { + bodyMapper: Mappers.CloudError + } + }, + serializer +}; + +const isCloneableSlotOperationSpec: msRest.OperationSpec = { + httpMethod: "POST", + path: "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/iscloneable", + urlParameters: [ + Parameters.resourceGroupName, + Parameters.name, + Parameters.slot, + Parameters.subscriptionId + ], + queryParameters: [ + Parameters.apiVersion + ], + headerParameters: [ + Parameters.acceptLanguage + ], + responses: { + 200: { + bodyMapper: Mappers.SiteCloneability + }, + default: { + bodyMapper: Mappers.DefaultErrorResponse + } + }, + serializer +}; + +const listSyncFunctionTriggersSlotOperationSpec: msRest.OperationSpec = { + httpMethod: "POST", + path: "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/listsyncfunctiontriggerstatus", + urlParameters: [ + Parameters.resourceGroupName, + Parameters.name, + Parameters.slot, + Parameters.subscriptionId + ], + queryParameters: [ + Parameters.apiVersion + ], + headerParameters: [ + Parameters.acceptLanguage + ], + responses: { + 200: { + bodyMapper: Mappers.FunctionSecrets + }, + default: { + bodyMapper: Mappers.DefaultErrorResponse + } + }, + serializer +}; + +const listMetricDefinitionsSlotOperationSpec: msRest.OperationSpec = { + httpMethod: "GET", + path: "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/metricdefinitions", + urlParameters: [ + Parameters.resourceGroupName, + Parameters.name, + Parameters.slot, + Parameters.subscriptionId + ], + queryParameters: [ + Parameters.apiVersion + ], + headerParameters: [ + Parameters.acceptLanguage + ], + responses: { + 200: { + bodyMapper: Mappers.ResourceMetricDefinitionCollection + }, + default: { + bodyMapper: Mappers.DefaultErrorResponse + } + }, + serializer +}; + +const listMetricsSlotOperationSpec: msRest.OperationSpec = { + httpMethod: "GET", + path: "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/metrics", + urlParameters: [ + Parameters.resourceGroupName, + Parameters.name, + Parameters.slot, + Parameters.subscriptionId + ], + queryParameters: [ + Parameters.details, + Parameters.filter, + Parameters.apiVersion + ], + headerParameters: [ + Parameters.acceptLanguage + ], + responses: { + 200: { + bodyMapper: Mappers.ResourceMetricCollection + }, + default: { + bodyMapper: Mappers.DefaultErrorResponse + } + }, + serializer +}; + +const getMigrateMySqlStatusSlotOperationSpec: msRest.OperationSpec = { + httpMethod: "GET", + path: "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/migratemysql/status", + urlParameters: [ + Parameters.resourceGroupName, + Parameters.name, + Parameters.slot, + Parameters.subscriptionId + ], + queryParameters: [ + Parameters.apiVersion + ], + headerParameters: [ + Parameters.acceptLanguage + ], + responses: { + 200: { + bodyMapper: Mappers.MigrateMySqlStatus + }, + default: { + bodyMapper: Mappers.DefaultErrorResponse + } + }, + serializer +}; + +const getSwiftVirtualNetworkConnectionSlotOperationSpec: msRest.OperationSpec = { + httpMethod: "GET", + path: "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/networkConfig/virtualNetwork", + urlParameters: [ + Parameters.resourceGroupName, + Parameters.name, + Parameters.slot, + Parameters.subscriptionId + ], + queryParameters: [ + Parameters.apiVersion + ], + headerParameters: [ + Parameters.acceptLanguage + ], + responses: { + 200: { + bodyMapper: Mappers.SwiftVirtualNetwork + }, + default: { + bodyMapper: Mappers.DefaultErrorResponse + } + }, + serializer +}; + +const createOrUpdateSwiftVirtualNetworkConnectionSlotOperationSpec: msRest.OperationSpec = { + httpMethod: "PUT", + path: "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/networkConfig/virtualNetwork", + urlParameters: [ + Parameters.resourceGroupName, + Parameters.name, + Parameters.slot, + Parameters.subscriptionId + ], + queryParameters: [ + Parameters.apiVersion + ], + headerParameters: [ + Parameters.acceptLanguage + ], + requestBody: { + parameterPath: "connectionEnvelope", + mapper: { + ...Mappers.SwiftVirtualNetwork, + required: true + } + }, + responses: { + 200: { + bodyMapper: Mappers.SwiftVirtualNetwork + }, + default: { + bodyMapper: Mappers.DefaultErrorResponse + } + }, + serializer +}; + +const deleteSwiftVirtualNetworkSlotOperationSpec: msRest.OperationSpec = { + httpMethod: "DELETE", + path: "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/networkConfig/virtualNetwork", + urlParameters: [ + Parameters.resourceGroupName, + Parameters.name, + Parameters.slot, + Parameters.subscriptionId + ], + queryParameters: [ + Parameters.apiVersion + ], + headerParameters: [ + Parameters.acceptLanguage + ], + responses: { + 200: {}, + 404: {}, + default: { + bodyMapper: Mappers.CloudError + } + }, + serializer +}; + +const updateSwiftVirtualNetworkConnectionSlotOperationSpec: msRest.OperationSpec = { + httpMethod: "PATCH", + path: "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/networkConfig/virtualNetwork", + urlParameters: [ + Parameters.resourceGroupName, + Parameters.name, + Parameters.slot, + Parameters.subscriptionId + ], + queryParameters: [ + Parameters.apiVersion + ], + headerParameters: [ + Parameters.acceptLanguage + ], + requestBody: { + parameterPath: "connectionEnvelope", + mapper: { + ...Mappers.SwiftVirtualNetwork, + required: true + } + }, + responses: { + 200: { + bodyMapper: Mappers.SwiftVirtualNetwork + }, + default: { + bodyMapper: Mappers.DefaultErrorResponse + } + }, + serializer +}; + +const listNetworkFeaturesSlotOperationSpec: msRest.OperationSpec = { + httpMethod: "GET", + path: "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/networkFeatures/{view}", + urlParameters: [ + Parameters.resourceGroupName, + Parameters.name, + Parameters.view, + Parameters.slot, + Parameters.subscriptionId + ], + queryParameters: [ + Parameters.apiVersion + ], + headerParameters: [ + Parameters.acceptLanguage + ], + responses: { + 200: { + bodyMapper: Mappers.NetworkFeatures + }, + 404: {}, + default: { + bodyMapper: Mappers.CloudError + } + }, + serializer +}; + +const getNetworkTraceOperationSlotOperationSpec: msRest.OperationSpec = { + httpMethod: "GET", + path: "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/networkTrace/operationresults/{operationId}", + urlParameters: [ + Parameters.resourceGroupName, + Parameters.name, + Parameters.operationId, + Parameters.slot, + Parameters.subscriptionId + ], + queryParameters: [ + Parameters.apiVersion + ], + headerParameters: [ + Parameters.acceptLanguage + ], + responses: { + 200: { + bodyMapper: { + serializedName: "parsedResponse", + type: { + name: "Sequence", + element: { + type: { + name: "Composite", + className: "NetworkTrace" + } + } + } + } + }, + 202: { + bodyMapper: { + serializedName: "parsedResponse", + type: { + name: "Sequence", + element: { + type: { + name: "Composite", + className: "NetworkTrace" + } + } + } + } + }, + default: { + bodyMapper: Mappers.DefaultErrorResponse + } + }, + serializer +}; + +const startWebSiteNetworkTraceSlotOperationSpec: msRest.OperationSpec = { + httpMethod: "POST", + path: "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/networkTrace/start", + urlParameters: [ + Parameters.resourceGroupName, + Parameters.name, + Parameters.slot, + Parameters.subscriptionId + ], + queryParameters: [ + Parameters.durationInSeconds, + Parameters.maxFrameLength, + Parameters.sasUrl, + Parameters.apiVersion + ], + headerParameters: [ + Parameters.acceptLanguage + ], + responses: { + 200: { + bodyMapper: { + serializedName: "parsedResponse", + type: { + name: "String" + } + } + }, + default: { + bodyMapper: Mappers.DefaultErrorResponse + } + }, + serializer +}; + +const stopWebSiteNetworkTraceSlotOperationSpec: msRest.OperationSpec = { + httpMethod: "POST", + path: "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/networkTrace/stop", + urlParameters: [ + Parameters.resourceGroupName, + Parameters.name, + Parameters.slot, + Parameters.subscriptionId + ], + queryParameters: [ + Parameters.apiVersion + ], + headerParameters: [ + Parameters.acceptLanguage + ], + responses: { + 200: {}, + 204: {}, + default: { + bodyMapper: Mappers.CloudError + } + }, + serializer +}; + +const getNetworkTracesSlotOperationSpec: msRest.OperationSpec = { + httpMethod: "GET", + path: "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/networkTrace/{operationId}", + urlParameters: [ + Parameters.resourceGroupName, + Parameters.name, + Parameters.operationId, + Parameters.slot, + Parameters.subscriptionId + ], + queryParameters: [ + Parameters.apiVersion + ], + headerParameters: [ + Parameters.acceptLanguage + ], + responses: { + 200: { + bodyMapper: { + serializedName: "parsedResponse", + type: { + name: "Sequence", + element: { + type: { + name: "Composite", + className: "NetworkTrace" + } + } + } + } + }, + default: { + bodyMapper: Mappers.DefaultErrorResponse + } + }, + serializer +}; + +const getNetworkTraceOperationSlotV2OperationSpec: msRest.OperationSpec = { + httpMethod: "GET", + path: "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/networkTraces/current/operationresults/{operationId}", + urlParameters: [ + Parameters.resourceGroupName, + Parameters.name, + Parameters.operationId, + Parameters.slot, + Parameters.subscriptionId + ], + queryParameters: [ + Parameters.apiVersion + ], + headerParameters: [ + Parameters.acceptLanguage + ], + responses: { + 200: { + bodyMapper: { + serializedName: "parsedResponse", + type: { + name: "Sequence", + element: { + type: { + name: "Composite", + className: "NetworkTrace" + } + } + } + } + }, + 202: { + bodyMapper: { + serializedName: "parsedResponse", + type: { + name: "Sequence", + element: { + type: { + name: "Composite", + className: "NetworkTrace" + } + } + } + } + }, + default: { + bodyMapper: Mappers.DefaultErrorResponse + } + }, + serializer +}; + +const getNetworkTracesSlotV2OperationSpec: msRest.OperationSpec = { + httpMethod: "GET", + path: "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/networkTraces/{operationId}", + urlParameters: [ + Parameters.resourceGroupName, + Parameters.name, + Parameters.operationId, + Parameters.slot, + Parameters.subscriptionId + ], + queryParameters: [ + Parameters.apiVersion + ], + headerParameters: [ + Parameters.acceptLanguage + ], + responses: { + 200: { + bodyMapper: { + serializedName: "parsedResponse", + type: { + name: "Sequence", + element: { + type: { + name: "Composite", + className: "NetworkTrace" + } + } + } + } + }, + default: { + bodyMapper: Mappers.DefaultErrorResponse + } + }, + serializer +}; + +const generateNewSitePublishingPasswordSlotOperationSpec: msRest.OperationSpec = { + httpMethod: "POST", + path: "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/newpassword", + urlParameters: [ + Parameters.resourceGroupName, + Parameters.name, + Parameters.slot, + Parameters.subscriptionId + ], + queryParameters: [ + Parameters.apiVersion + ], + headerParameters: [ + Parameters.acceptLanguage + ], + responses: { + 200: {}, + 204: {}, + default: { + bodyMapper: Mappers.CloudError + } + }, + serializer +}; + +const listPerfMonCountersSlotOperationSpec: msRest.OperationSpec = { + httpMethod: "GET", + path: "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/perfcounters", + urlParameters: [ + Parameters.resourceGroupName, + Parameters.name, + Parameters.slot, + Parameters.subscriptionId + ], + queryParameters: [ + Parameters.filter, + Parameters.apiVersion + ], + headerParameters: [ + Parameters.acceptLanguage + ], + responses: { + 200: { + bodyMapper: Mappers.PerfMonCounterCollection + }, + default: { + bodyMapper: Mappers.DefaultErrorResponse + } + }, + serializer +}; + +const getSitePhpErrorLogFlagSlotOperationSpec: msRest.OperationSpec = { + httpMethod: "GET", + path: "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/phplogging", + urlParameters: [ + Parameters.resourceGroupName, + Parameters.name, + Parameters.slot, + Parameters.subscriptionId + ], + queryParameters: [ + Parameters.apiVersion + ], + headerParameters: [ + Parameters.acceptLanguage + ], + responses: { + 200: { + bodyMapper: Mappers.SitePhpErrorLogFlag + }, + default: { + bodyMapper: Mappers.DefaultErrorResponse + } + }, + serializer +}; + +const listPremierAddOnsSlotOperationSpec: msRest.OperationSpec = { + httpMethod: "GET", + path: "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/premieraddons", + urlParameters: [ + Parameters.resourceGroupName, + Parameters.name, + Parameters.slot, + Parameters.subscriptionId + ], + queryParameters: [ + Parameters.apiVersion + ], + headerParameters: [ + Parameters.acceptLanguage + ], + responses: { + 200: { + bodyMapper: Mappers.PremierAddOn + }, + default: { + bodyMapper: Mappers.DefaultErrorResponse + } + }, + serializer +}; + +const getPremierAddOnSlotOperationSpec: msRest.OperationSpec = { + httpMethod: "GET", + path: "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/premieraddons/{premierAddOnName}", + urlParameters: [ + Parameters.resourceGroupName, + Parameters.name, + Parameters.premierAddOnName, + Parameters.slot, + Parameters.subscriptionId + ], + queryParameters: [ + Parameters.apiVersion + ], + headerParameters: [ + Parameters.acceptLanguage + ], + responses: { + 200: { + bodyMapper: Mappers.PremierAddOn + }, + default: { + bodyMapper: Mappers.DefaultErrorResponse + } + }, + serializer +}; + +const addPremierAddOnSlotOperationSpec: msRest.OperationSpec = { + httpMethod: "PUT", + path: "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/premieraddons/{premierAddOnName}", + urlParameters: [ + Parameters.resourceGroupName, + Parameters.name, + Parameters.premierAddOnName, + Parameters.slot, + Parameters.subscriptionId + ], + queryParameters: [ + Parameters.apiVersion + ], + headerParameters: [ + Parameters.acceptLanguage + ], + requestBody: { + parameterPath: "premierAddOn", + mapper: { + ...Mappers.PremierAddOn, + required: true + } + }, + responses: { + 200: { + bodyMapper: Mappers.PremierAddOn + }, + default: { + bodyMapper: Mappers.DefaultErrorResponse + } + }, + serializer +}; + +const deletePremierAddOnSlotOperationSpec: msRest.OperationSpec = { + httpMethod: "DELETE", + path: "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/premieraddons/{premierAddOnName}", + urlParameters: [ + Parameters.resourceGroupName, + Parameters.name, + Parameters.premierAddOnName, + Parameters.slot, + Parameters.subscriptionId + ], + queryParameters: [ + Parameters.apiVersion + ], + headerParameters: [ + Parameters.acceptLanguage + ], + responses: { + 200: {}, + default: { + bodyMapper: Mappers.CloudError + } + }, + serializer +}; + +const updatePremierAddOnSlotOperationSpec: msRest.OperationSpec = { + httpMethod: "PATCH", + path: "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/premieraddons/{premierAddOnName}", + urlParameters: [ + Parameters.resourceGroupName, + Parameters.name, + Parameters.premierAddOnName, + Parameters.slot, + Parameters.subscriptionId + ], + queryParameters: [ + Parameters.apiVersion + ], + headerParameters: [ + Parameters.acceptLanguage + ], + requestBody: { + parameterPath: "premierAddOn", + mapper: { + ...Mappers.PremierAddOnPatchResource, + required: true + } + }, + responses: { + 200: { + bodyMapper: Mappers.PremierAddOn + }, + default: { + bodyMapper: Mappers.DefaultErrorResponse + } + }, + serializer +}; + +const getPrivateAccessSlotOperationSpec: msRest.OperationSpec = { + httpMethod: "GET", + path: "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/privateAccess/virtualNetworks", + urlParameters: [ + Parameters.resourceGroupName, + Parameters.name, + Parameters.slot, + Parameters.subscriptionId + ], + queryParameters: [ + Parameters.apiVersion + ], + headerParameters: [ + Parameters.acceptLanguage + ], + responses: { + 200: { + bodyMapper: Mappers.PrivateAccess + }, + default: { + bodyMapper: Mappers.DefaultErrorResponse + } + }, + serializer +}; + +const putPrivateAccessVnetSlotOperationSpec: msRest.OperationSpec = { + httpMethod: "PUT", + path: "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/privateAccess/virtualNetworks", + urlParameters: [ + Parameters.resourceGroupName, + Parameters.name, + Parameters.slot, + Parameters.subscriptionId + ], + queryParameters: [ + Parameters.apiVersion + ], + headerParameters: [ + Parameters.acceptLanguage + ], + requestBody: { + parameterPath: "access", + mapper: { + ...Mappers.PrivateAccess, + required: true + } + }, + responses: { + 200: { + bodyMapper: Mappers.PrivateAccess + }, + default: { + bodyMapper: Mappers.DefaultErrorResponse + } + }, + serializer +}; + +const listProcessesSlotOperationSpec: msRest.OperationSpec = { + httpMethod: "GET", + path: "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/processes", + urlParameters: [ + Parameters.resourceGroupName, + Parameters.name, + Parameters.slot, + Parameters.subscriptionId + ], + queryParameters: [ + Parameters.apiVersion + ], + headerParameters: [ + Parameters.acceptLanguage + ], + responses: { + 200: { + bodyMapper: Mappers.ProcessInfoCollection + }, + 404: {}, + default: { + bodyMapper: Mappers.CloudError + } + }, + serializer +}; + +const getProcessSlotOperationSpec: msRest.OperationSpec = { + httpMethod: "GET", + path: "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/processes/{processId}", + urlParameters: [ + Parameters.resourceGroupName, + Parameters.name, + Parameters.processId, + Parameters.slot, + Parameters.subscriptionId + ], + queryParameters: [ + Parameters.apiVersion + ], + headerParameters: [ + Parameters.acceptLanguage + ], + responses: { + 200: { + bodyMapper: Mappers.ProcessInfo + }, + 404: {}, + default: { + bodyMapper: Mappers.CloudError + } + }, + serializer +}; + +const deleteProcessSlotOperationSpec: msRest.OperationSpec = { + httpMethod: "DELETE", + path: "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/processes/{processId}", + urlParameters: [ + Parameters.resourceGroupName, + Parameters.name, + Parameters.processId, + Parameters.slot, + Parameters.subscriptionId + ], + queryParameters: [ + Parameters.apiVersion + ], + headerParameters: [ + Parameters.acceptLanguage + ], + responses: { + 204: {}, + 404: {}, + default: { + bodyMapper: Mappers.CloudError + } + }, + serializer +}; + +const getProcessDumpSlotOperationSpec: msRest.OperationSpec = { + httpMethod: "GET", + path: "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/processes/{processId}/dump", + urlParameters: [ + Parameters.resourceGroupName, + Parameters.name, + Parameters.processId, + Parameters.slot, + Parameters.subscriptionId + ], + queryParameters: [ + Parameters.apiVersion + ], + headerParameters: [ + Parameters.acceptLanguage + ], + responses: { + 200: { + bodyMapper: { + serializedName: "parsedResponse", + type: { + name: "Stream" + } + } + }, + 404: {}, + default: { + bodyMapper: Mappers.CloudError + } + }, + serializer +}; + +const listProcessModulesSlotOperationSpec: msRest.OperationSpec = { + httpMethod: "GET", + path: "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/processes/{processId}/modules", + urlParameters: [ + Parameters.resourceGroupName, + Parameters.name, + Parameters.processId, + Parameters.slot, + Parameters.subscriptionId + ], + queryParameters: [ + Parameters.apiVersion + ], + headerParameters: [ + Parameters.acceptLanguage + ], + responses: { + 200: { + bodyMapper: Mappers.ProcessModuleInfoCollection + }, + 404: {}, + default: { + bodyMapper: Mappers.CloudError + } + }, + serializer +}; + +const getProcessModuleSlotOperationSpec: msRest.OperationSpec = { + httpMethod: "GET", + path: "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/processes/{processId}/modules/{baseAddress}", + urlParameters: [ + Parameters.resourceGroupName, + Parameters.name, + Parameters.processId, + Parameters.baseAddress, + Parameters.slot, + Parameters.subscriptionId + ], + queryParameters: [ + Parameters.apiVersion + ], + headerParameters: [ + Parameters.acceptLanguage + ], + responses: { + 200: { + bodyMapper: Mappers.ProcessModuleInfo + }, + 404: {}, + default: { + bodyMapper: Mappers.CloudError + } + }, + serializer +}; + +const listProcessThreadsSlotOperationSpec: msRest.OperationSpec = { + httpMethod: "GET", + path: "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/processes/{processId}/threads", + urlParameters: [ + Parameters.resourceGroupName, + Parameters.name, + Parameters.processId, + Parameters.slot, + Parameters.subscriptionId + ], + queryParameters: [ + Parameters.apiVersion + ], + headerParameters: [ + Parameters.acceptLanguage + ], + responses: { + 200: { + bodyMapper: Mappers.ProcessThreadInfoCollection + }, + 404: {}, + default: { + bodyMapper: Mappers.CloudError + } + }, + serializer +}; + +const getProcessThreadSlotOperationSpec: msRest.OperationSpec = { + httpMethod: "GET", + path: "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/processes/{processId}/threads/{threadId}", + urlParameters: [ + Parameters.resourceGroupName, + Parameters.name, + Parameters.processId, + Parameters.threadId, + Parameters.slot, + Parameters.subscriptionId + ], + queryParameters: [ + Parameters.apiVersion + ], + headerParameters: [ + Parameters.acceptLanguage + ], + responses: { + 200: { + bodyMapper: Mappers.ProcessThreadInfo + }, + 404: {}, + default: { + bodyMapper: Mappers.CloudError + } + }, + serializer +}; + +const listPublicCertificatesSlotOperationSpec: msRest.OperationSpec = { + httpMethod: "GET", + path: "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/publicCertificates", + urlParameters: [ + Parameters.resourceGroupName, + Parameters.name, + Parameters.slot, + Parameters.subscriptionId + ], + queryParameters: [ + Parameters.apiVersion + ], + headerParameters: [ + Parameters.acceptLanguage + ], + responses: { + 200: { + bodyMapper: Mappers.PublicCertificateCollection + }, + default: { + bodyMapper: Mappers.DefaultErrorResponse + } + }, + serializer +}; + +const getPublicCertificateSlotOperationSpec: msRest.OperationSpec = { + httpMethod: "GET", + path: "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/publicCertificates/{publicCertificateName}", + urlParameters: [ + Parameters.resourceGroupName, + Parameters.name, + Parameters.slot, + Parameters.publicCertificateName, + Parameters.subscriptionId + ], + queryParameters: [ + Parameters.apiVersion + ], + headerParameters: [ + Parameters.acceptLanguage + ], + responses: { + 200: { + bodyMapper: Mappers.PublicCertificate + }, + default: { + bodyMapper: Mappers.DefaultErrorResponse + } + }, + serializer +}; + +const createOrUpdatePublicCertificateSlotOperationSpec: msRest.OperationSpec = { + httpMethod: "PUT", + path: "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/publicCertificates/{publicCertificateName}", + urlParameters: [ + Parameters.resourceGroupName, + Parameters.name, + Parameters.publicCertificateName, + Parameters.slot, + Parameters.subscriptionId + ], + queryParameters: [ + Parameters.apiVersion + ], + headerParameters: [ + Parameters.acceptLanguage + ], + requestBody: { + parameterPath: "publicCertificate", + mapper: { + ...Mappers.PublicCertificate, + required: true + } + }, + responses: { + 200: { + bodyMapper: Mappers.PublicCertificate + }, + default: { + bodyMapper: Mappers.DefaultErrorResponse + } + }, + serializer +}; + +const deletePublicCertificateSlotOperationSpec: msRest.OperationSpec = { + httpMethod: "DELETE", + path: "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/publicCertificates/{publicCertificateName}", + urlParameters: [ + Parameters.resourceGroupName, + Parameters.name, + Parameters.slot, + Parameters.publicCertificateName, + Parameters.subscriptionId + ], + queryParameters: [ + Parameters.apiVersion + ], + headerParameters: [ + Parameters.acceptLanguage + ], + responses: { + 200: {}, + 204: {}, + default: { + bodyMapper: Mappers.CloudError + } + }, + serializer +}; + +const listPublishingProfileXmlWithSecretsSlotOperationSpec: msRest.OperationSpec = { + httpMethod: "POST", + path: "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/publishxml", + urlParameters: [ + Parameters.resourceGroupName, + Parameters.name, + Parameters.slot, + Parameters.subscriptionId + ], + queryParameters: [ + Parameters.apiVersion + ], + headerParameters: [ + Parameters.acceptLanguage + ], + requestBody: { + parameterPath: "publishingProfileOptions", + mapper: { + ...Mappers.CsmPublishingProfileOptions, + required: true + } + }, + responses: { + 200: { + bodyMapper: { + serializedName: "parsedResponse", + type: { + name: "Stream" + } + } + }, + default: { + bodyMapper: Mappers.DefaultErrorResponse + } + }, + serializer +}; + +const resetSlotConfigurationSlotOperationSpec: msRest.OperationSpec = { + httpMethod: "POST", + path: "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/resetSlotConfig", + urlParameters: [ + Parameters.resourceGroupName, + Parameters.name, + Parameters.slot, + Parameters.subscriptionId + ], + queryParameters: [ + Parameters.apiVersion + ], + headerParameters: [ + Parameters.acceptLanguage + ], + responses: { + 200: {}, + default: { + bodyMapper: Mappers.CloudError + } + }, + serializer +}; + +const restartSlotOperationSpec: msRest.OperationSpec = { + httpMethod: "POST", + path: "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/restart", + urlParameters: [ + Parameters.resourceGroupName, + Parameters.name, + Parameters.slot, + Parameters.subscriptionId + ], + queryParameters: [ + Parameters.softRestart, + Parameters.synchronous, + Parameters.apiVersion + ], + headerParameters: [ + Parameters.acceptLanguage + ], + responses: { + 200: {}, + default: { + bodyMapper: Mappers.CloudError + } + }, + serializer +}; + +const listSiteExtensionsSlotOperationSpec: msRest.OperationSpec = { + httpMethod: "GET", + path: "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/siteextensions", + urlParameters: [ + Parameters.resourceGroupName, + Parameters.name, + Parameters.slot, + Parameters.subscriptionId + ], + queryParameters: [ + Parameters.apiVersion + ], + headerParameters: [ + Parameters.acceptLanguage + ], + responses: { + 200: { + bodyMapper: Mappers.SiteExtensionInfoCollection + }, + 404: {}, + default: { + bodyMapper: Mappers.CloudError + } + }, + serializer +}; + +const getSiteExtensionSlotOperationSpec: msRest.OperationSpec = { + httpMethod: "GET", + path: "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/siteextensions/{siteExtensionId}", + urlParameters: [ + Parameters.resourceGroupName, + Parameters.name, + Parameters.siteExtensionId, + Parameters.slot, + Parameters.subscriptionId + ], + queryParameters: [ + Parameters.apiVersion + ], + headerParameters: [ + Parameters.acceptLanguage + ], + responses: { + 200: { + bodyMapper: Mappers.SiteExtensionInfo + }, + 404: {}, + default: { + bodyMapper: Mappers.CloudError + } + }, + serializer +}; + +const deleteSiteExtensionSlotOperationSpec: msRest.OperationSpec = { + httpMethod: "DELETE", + path: "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/siteextensions/{siteExtensionId}", + urlParameters: [ + Parameters.resourceGroupName, + Parameters.name, + Parameters.siteExtensionId, + Parameters.slot, + Parameters.subscriptionId + ], + queryParameters: [ + Parameters.apiVersion + ], + headerParameters: [ + Parameters.acceptLanguage + ], + responses: { + 204: {}, + 404: {}, + default: { + bodyMapper: Mappers.CloudError + } + }, + serializer +}; + +const listSlotDifferencesSlotOperationSpec: msRest.OperationSpec = { + httpMethod: "POST", + path: "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/slotsdiffs", + urlParameters: [ + Parameters.resourceGroupName, + Parameters.name, + Parameters.slot, + Parameters.subscriptionId + ], + queryParameters: [ + Parameters.apiVersion + ], + headerParameters: [ + Parameters.acceptLanguage + ], + requestBody: { + parameterPath: "slotSwapEntity", + mapper: { + ...Mappers.CsmSlotEntity, + required: true + } + }, + responses: { + 200: { + bodyMapper: Mappers.SlotDifferenceCollection + }, + default: { + bodyMapper: Mappers.DefaultErrorResponse + } + }, + serializer +}; + +const listSnapshotsSlotOperationSpec: msRest.OperationSpec = { + httpMethod: "GET", + path: "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/snapshots", + urlParameters: [ + Parameters.resourceGroupName, + Parameters.name, + Parameters.slot, + Parameters.subscriptionId + ], + queryParameters: [ + Parameters.apiVersion + ], + headerParameters: [ + Parameters.acceptLanguage + ], + responses: { + 200: { + bodyMapper: Mappers.SnapshotCollection + }, + default: { + bodyMapper: Mappers.DefaultErrorResponse + } + }, + serializer +}; + +const listSnapshotsFromDRSecondarySlotOperationSpec: msRest.OperationSpec = { + httpMethod: "GET", + path: "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/snapshotsdr", + urlParameters: [ + Parameters.resourceGroupName, + Parameters.name, + Parameters.slot, + Parameters.subscriptionId + ], + queryParameters: [ + Parameters.apiVersion + ], + headerParameters: [ + Parameters.acceptLanguage + ], + responses: { + 200: { + bodyMapper: Mappers.SnapshotCollection + }, + default: { + bodyMapper: Mappers.DefaultErrorResponse + } + }, + serializer +}; + +const getSourceControlSlotOperationSpec: msRest.OperationSpec = { + httpMethod: "GET", + path: "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/sourcecontrols/web", + urlParameters: [ + Parameters.resourceGroupName, + Parameters.name, + Parameters.slot, + Parameters.subscriptionId + ], + queryParameters: [ + Parameters.apiVersion + ], + headerParameters: [ + Parameters.acceptLanguage + ], + responses: { + 200: { + bodyMapper: Mappers.SiteSourceControl + }, + 201: { + bodyMapper: Mappers.SiteSourceControl + }, + 202: { + bodyMapper: Mappers.SiteSourceControl + }, + default: { + bodyMapper: Mappers.DefaultErrorResponse + } + }, + serializer +}; + +const deleteSourceControlSlotOperationSpec: msRest.OperationSpec = { + httpMethod: "DELETE", + path: "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/sourcecontrols/web", + urlParameters: [ + Parameters.resourceGroupName, + Parameters.name, + Parameters.slot, + Parameters.subscriptionId + ], + queryParameters: [ + Parameters.apiVersion + ], + headerParameters: [ + Parameters.acceptLanguage + ], + responses: { + 200: {}, + 202: {}, + 404: {}, + default: { + bodyMapper: Mappers.CloudError + } + }, + serializer +}; + +const updateSourceControlSlotOperationSpec: msRest.OperationSpec = { + httpMethod: "PATCH", + path: "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/sourcecontrols/web", + urlParameters: [ + Parameters.resourceGroupName, + Parameters.name, + Parameters.slot, + Parameters.subscriptionId + ], + queryParameters: [ + Parameters.apiVersion + ], + headerParameters: [ + Parameters.acceptLanguage + ], + requestBody: { + parameterPath: "siteSourceControl", + mapper: { + ...Mappers.SiteSourceControl, + required: true + } + }, + responses: { + 200: { + bodyMapper: Mappers.SiteSourceControl + }, + 201: { + bodyMapper: Mappers.SiteSourceControl + }, + 202: { + bodyMapper: Mappers.SiteSourceControl + }, + default: { + bodyMapper: Mappers.DefaultErrorResponse + } + }, + serializer +}; + +const startSlotOperationSpec: msRest.OperationSpec = { + httpMethod: "POST", + path: "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/start", + urlParameters: [ + Parameters.resourceGroupName, + Parameters.name, + Parameters.slot, + Parameters.subscriptionId + ], + queryParameters: [ + Parameters.apiVersion + ], + headerParameters: [ + Parameters.acceptLanguage + ], + responses: { + 200: {}, + default: { + bodyMapper: Mappers.CloudError + } + }, + serializer +}; + +const stopSlotOperationSpec: msRest.OperationSpec = { + httpMethod: "POST", + path: "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/stop", + urlParameters: [ + Parameters.resourceGroupName, + Parameters.name, + Parameters.slot, + Parameters.subscriptionId + ], + queryParameters: [ + Parameters.apiVersion + ], + headerParameters: [ + Parameters.acceptLanguage + ], + responses: { + 200: {}, + default: { + bodyMapper: Mappers.CloudError + } + }, + serializer +}; + +const stopNetworkTraceSlotOperationSpec: msRest.OperationSpec = { + httpMethod: "POST", + path: "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/stopNetworkTrace", + urlParameters: [ + Parameters.resourceGroupName, + Parameters.name, + Parameters.slot, + Parameters.subscriptionId + ], + queryParameters: [ + Parameters.apiVersion + ], + headerParameters: [ + Parameters.acceptLanguage + ], + responses: { + 200: {}, + 204: {}, + default: { + bodyMapper: Mappers.CloudError + } + }, + serializer +}; + +const syncRepositorySlotOperationSpec: msRest.OperationSpec = { + httpMethod: "POST", + path: "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/sync", + urlParameters: [ + Parameters.resourceGroupName, + Parameters.name, + Parameters.slot, + Parameters.subscriptionId + ], + queryParameters: [ + Parameters.apiVersion + ], + headerParameters: [ + Parameters.acceptLanguage + ], + responses: { + 200: {}, + default: { + bodyMapper: Mappers.CloudError + } + }, + serializer +}; + +const syncFunctionTriggersSlotOperationSpec: msRest.OperationSpec = { + httpMethod: "POST", + path: "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/syncfunctiontriggers", + urlParameters: [ + Parameters.resourceGroupName, + Parameters.name, + Parameters.slot, + Parameters.subscriptionId + ], + queryParameters: [ + Parameters.apiVersion + ], + headerParameters: [ + Parameters.acceptLanguage + ], + responses: { + 204: {}, + default: { + bodyMapper: Mappers.CloudError + } + }, + serializer +}; + +const listTriggeredWebJobsSlotOperationSpec: msRest.OperationSpec = { + httpMethod: "GET", + path: "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/triggeredwebjobs", + urlParameters: [ + Parameters.resourceGroupName, + Parameters.name, + Parameters.slot, + Parameters.subscriptionId + ], + queryParameters: [ + Parameters.apiVersion + ], + headerParameters: [ + Parameters.acceptLanguage + ], + responses: { + 200: { + bodyMapper: Mappers.TriggeredWebJobCollection + }, + default: { + bodyMapper: Mappers.DefaultErrorResponse + } + }, + serializer +}; + +const getTriggeredWebJobSlotOperationSpec: msRest.OperationSpec = { + httpMethod: "GET", + path: "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/triggeredwebjobs/{webJobName}", + urlParameters: [ + Parameters.resourceGroupName, + Parameters.name, + Parameters.webJobName, + Parameters.slot, + Parameters.subscriptionId + ], + queryParameters: [ + Parameters.apiVersion + ], + headerParameters: [ + Parameters.acceptLanguage + ], + responses: { + 200: { + bodyMapper: Mappers.TriggeredWebJob + }, + 404: {}, + default: { + bodyMapper: Mappers.CloudError + } + }, + serializer +}; + +const deleteTriggeredWebJobSlotOperationSpec: msRest.OperationSpec = { + httpMethod: "DELETE", + path: "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/triggeredwebjobs/{webJobName}", + urlParameters: [ + Parameters.resourceGroupName, + Parameters.name, + Parameters.webJobName, + Parameters.slot, + Parameters.subscriptionId + ], + queryParameters: [ + Parameters.apiVersion + ], + headerParameters: [ + Parameters.acceptLanguage + ], + responses: { + 200: {}, + 204: {}, + default: { + bodyMapper: Mappers.CloudError + } + }, + serializer +}; + +const listTriggeredWebJobHistorySlotOperationSpec: msRest.OperationSpec = { + httpMethod: "GET", + path: "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/triggeredwebjobs/{webJobName}/history", + urlParameters: [ + Parameters.resourceGroupName, + Parameters.name, + Parameters.webJobName, + Parameters.slot, + Parameters.subscriptionId + ], + queryParameters: [ + Parameters.apiVersion + ], + headerParameters: [ + Parameters.acceptLanguage + ], + responses: { + 200: { + bodyMapper: Mappers.TriggeredJobHistoryCollection + }, + 404: {}, + default: { + bodyMapper: Mappers.CloudError + } + }, + serializer +}; + +const getTriggeredWebJobHistorySlotOperationSpec: msRest.OperationSpec = { + httpMethod: "GET", + path: "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/triggeredwebjobs/{webJobName}/history/{id}", + urlParameters: [ + Parameters.resourceGroupName, + Parameters.name, + Parameters.webJobName, + Parameters.id, + Parameters.slot, + Parameters.subscriptionId + ], + queryParameters: [ + Parameters.apiVersion + ], + headerParameters: [ + Parameters.acceptLanguage + ], + responses: { + 200: { + bodyMapper: Mappers.TriggeredJobHistory + }, + 404: {}, + default: { + bodyMapper: Mappers.CloudError + } + }, + serializer +}; + +const runTriggeredWebJobSlotOperationSpec: msRest.OperationSpec = { + httpMethod: "POST", + path: "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/triggeredwebjobs/{webJobName}/run", + urlParameters: [ + Parameters.resourceGroupName, + Parameters.name, + Parameters.webJobName, + Parameters.slot, + Parameters.subscriptionId + ], + queryParameters: [ + Parameters.apiVersion + ], + headerParameters: [ + Parameters.acceptLanguage + ], + responses: { + 200: {}, + 404: {}, + default: { + bodyMapper: Mappers.CloudError + } + }, + serializer +}; + +const listUsagesSlotOperationSpec: msRest.OperationSpec = { + httpMethod: "GET", + path: "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/usages", + urlParameters: [ + Parameters.resourceGroupName, + Parameters.name, + Parameters.slot, + Parameters.subscriptionId + ], + queryParameters: [ + Parameters.filter, + Parameters.apiVersion + ], + headerParameters: [ + Parameters.acceptLanguage + ], + responses: { + 200: { + bodyMapper: Mappers.CsmUsageQuotaCollection + }, + default: { + bodyMapper: Mappers.DefaultErrorResponse + } + }, + serializer +}; + +const listVnetConnectionsSlotOperationSpec: msRest.OperationSpec = { + httpMethod: "GET", + path: "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/virtualNetworkConnections", + urlParameters: [ + Parameters.resourceGroupName, + Parameters.name, + Parameters.slot, + Parameters.subscriptionId + ], + queryParameters: [ + Parameters.apiVersion + ], + headerParameters: [ + Parameters.acceptLanguage + ], + responses: { + 200: { + bodyMapper: { + serializedName: "parsedResponse", + type: { + name: "Sequence", + element: { + type: { + name: "Composite", + className: "VnetInfo" + } + } + } + } + }, + default: { + bodyMapper: Mappers.DefaultErrorResponse + } + }, + serializer +}; + +const getVnetConnectionSlotOperationSpec: msRest.OperationSpec = { + httpMethod: "GET", + path: "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/virtualNetworkConnections/{vnetName}", + urlParameters: [ + Parameters.resourceGroupName, + Parameters.name, + Parameters.vnetName, + Parameters.slot, + Parameters.subscriptionId + ], + queryParameters: [ + Parameters.apiVersion + ], + headerParameters: [ + Parameters.acceptLanguage + ], + responses: { + 200: { + bodyMapper: Mappers.VnetInfo + }, + default: { + bodyMapper: Mappers.DefaultErrorResponse + } + }, + serializer +}; + +const createOrUpdateVnetConnectionSlotOperationSpec: msRest.OperationSpec = { + httpMethod: "PUT", + path: "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/virtualNetworkConnections/{vnetName}", + urlParameters: [ + Parameters.resourceGroupName, + Parameters.name, + Parameters.vnetName, + Parameters.slot, + Parameters.subscriptionId + ], + queryParameters: [ + Parameters.apiVersion + ], + headerParameters: [ + Parameters.acceptLanguage + ], + requestBody: { + parameterPath: "connectionEnvelope", + mapper: { + ...Mappers.VnetInfo, + required: true + } + }, + responses: { + 200: { + bodyMapper: Mappers.VnetInfo + }, + default: { + bodyMapper: Mappers.DefaultErrorResponse + } + }, + serializer +}; + +const deleteVnetConnectionSlotOperationSpec: msRest.OperationSpec = { + httpMethod: "DELETE", + path: "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/virtualNetworkConnections/{vnetName}", + urlParameters: [ + Parameters.resourceGroupName, + Parameters.name, + Parameters.vnetName, + Parameters.slot, + Parameters.subscriptionId + ], + queryParameters: [ + Parameters.apiVersion + ], + headerParameters: [ + Parameters.acceptLanguage + ], + responses: { + 200: {}, + 404: {}, + default: { + bodyMapper: Mappers.CloudError + } + }, + serializer +}; + +const updateVnetConnectionSlotOperationSpec: msRest.OperationSpec = { + httpMethod: "PATCH", + path: "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/virtualNetworkConnections/{vnetName}", + urlParameters: [ + Parameters.resourceGroupName, + Parameters.name, + Parameters.vnetName, + Parameters.slot, + Parameters.subscriptionId + ], + queryParameters: [ + Parameters.apiVersion + ], + headerParameters: [ + Parameters.acceptLanguage + ], + requestBody: { + parameterPath: "connectionEnvelope", + mapper: { + ...Mappers.VnetInfo, + required: true + } + }, + responses: { + 200: { + bodyMapper: Mappers.VnetInfo + }, + default: { + bodyMapper: Mappers.DefaultErrorResponse + } + }, + serializer +}; + +const getVnetConnectionGatewaySlotOperationSpec: msRest.OperationSpec = { + httpMethod: "GET", + path: "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/virtualNetworkConnections/{vnetName}/gateways/{gatewayName}", + urlParameters: [ + Parameters.resourceGroupName, + Parameters.name, + Parameters.vnetName, + Parameters.gatewayName, + Parameters.slot, + Parameters.subscriptionId + ], + queryParameters: [ + Parameters.apiVersion + ], + headerParameters: [ + Parameters.acceptLanguage + ], + responses: { + 200: { + bodyMapper: Mappers.VnetGateway + }, + 404: {}, + default: { + bodyMapper: Mappers.CloudError + } + }, + serializer +}; + +const createOrUpdateVnetConnectionGatewaySlotOperationSpec: msRest.OperationSpec = { + httpMethod: "PUT", + path: "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/virtualNetworkConnections/{vnetName}/gateways/{gatewayName}", + urlParameters: [ + Parameters.resourceGroupName, + Parameters.name, + Parameters.vnetName, + Parameters.gatewayName, + Parameters.slot, + Parameters.subscriptionId + ], + queryParameters: [ + Parameters.apiVersion + ], + headerParameters: [ + Parameters.acceptLanguage + ], + requestBody: { + parameterPath: "connectionEnvelope", + mapper: { + ...Mappers.VnetGateway, + required: true + } + }, + responses: { + 200: { + bodyMapper: Mappers.VnetGateway + }, + default: { + bodyMapper: Mappers.DefaultErrorResponse + } + }, + serializer +}; + +const updateVnetConnectionGatewaySlotOperationSpec: msRest.OperationSpec = { + httpMethod: "PATCH", + path: "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/virtualNetworkConnections/{vnetName}/gateways/{gatewayName}", + urlParameters: [ + Parameters.resourceGroupName, + Parameters.name, + Parameters.vnetName, + Parameters.gatewayName, + Parameters.slot, + Parameters.subscriptionId + ], + queryParameters: [ + Parameters.apiVersion + ], + headerParameters: [ + Parameters.acceptLanguage + ], + requestBody: { + parameterPath: "connectionEnvelope", + mapper: { + ...Mappers.VnetGateway, + required: true + } + }, + responses: { + 200: { + bodyMapper: Mappers.VnetGateway + }, + default: { + bodyMapper: Mappers.DefaultErrorResponse + } + }, + serializer +}; + +const listWebJobsSlotOperationSpec: msRest.OperationSpec = { + httpMethod: "GET", + path: "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/webjobs", + urlParameters: [ + Parameters.resourceGroupName, + Parameters.name, + Parameters.slot, + Parameters.subscriptionId + ], + queryParameters: [ + Parameters.apiVersion + ], + headerParameters: [ + Parameters.acceptLanguage + ], + responses: { + 200: { + bodyMapper: Mappers.WebJobCollection + }, + default: { + bodyMapper: Mappers.DefaultErrorResponse + } + }, + serializer +}; + +const getWebJobSlotOperationSpec: msRest.OperationSpec = { + httpMethod: "GET", + path: "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/webjobs/{webJobName}", + urlParameters: [ + Parameters.resourceGroupName, + Parameters.name, + Parameters.webJobName, + Parameters.slot, + Parameters.subscriptionId + ], + queryParameters: [ + Parameters.apiVersion + ], + headerParameters: [ + Parameters.acceptLanguage + ], + responses: { + 200: { + bodyMapper: Mappers.WebJob + }, + default: { + bodyMapper: Mappers.DefaultErrorResponse + } + }, + serializer +}; + +const listSlotDifferencesFromProductionOperationSpec: msRest.OperationSpec = { + httpMethod: "POST", + path: "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slotsdiffs", + urlParameters: [ + Parameters.resourceGroupName, + Parameters.name, + Parameters.subscriptionId + ], + queryParameters: [ + Parameters.apiVersion + ], + headerParameters: [ + Parameters.acceptLanguage + ], + requestBody: { + parameterPath: "slotSwapEntity", + mapper: { + ...Mappers.CsmSlotEntity, + required: true + } + }, + responses: { + 200: { + bodyMapper: Mappers.SlotDifferenceCollection + }, + default: { + bodyMapper: Mappers.DefaultErrorResponse + } + }, + serializer +}; + +const listSnapshotsOperationSpec: msRest.OperationSpec = { + httpMethod: "GET", + path: "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/snapshots", + urlParameters: [ + Parameters.resourceGroupName, + Parameters.name, + Parameters.subscriptionId + ], + queryParameters: [ + Parameters.apiVersion + ], + headerParameters: [ + Parameters.acceptLanguage + ], + responses: { + 200: { + bodyMapper: Mappers.SnapshotCollection + }, + default: { + bodyMapper: Mappers.DefaultErrorResponse + } + }, + serializer +}; + +const listSnapshotsFromDRSecondaryOperationSpec: msRest.OperationSpec = { + httpMethod: "GET", + path: "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/snapshotsdr", + urlParameters: [ + Parameters.resourceGroupName, + Parameters.name, + Parameters.subscriptionId + ], + queryParameters: [ + Parameters.apiVersion + ], + headerParameters: [ + Parameters.acceptLanguage + ], + responses: { + 200: { + bodyMapper: Mappers.SnapshotCollection + }, + default: { + bodyMapper: Mappers.DefaultErrorResponse + } + }, + serializer +}; + +const getSourceControlOperationSpec: msRest.OperationSpec = { + httpMethod: "GET", + path: "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/sourcecontrols/web", + urlParameters: [ + Parameters.resourceGroupName, + Parameters.name, + Parameters.subscriptionId + ], + queryParameters: [ + Parameters.apiVersion + ], + headerParameters: [ + Parameters.acceptLanguage + ], + responses: { + 200: { + bodyMapper: Mappers.SiteSourceControl + }, + 201: { + bodyMapper: Mappers.SiteSourceControl + }, + 202: { + bodyMapper: Mappers.SiteSourceControl + }, + default: { + bodyMapper: Mappers.DefaultErrorResponse + } + }, + serializer +}; + +const deleteSourceControlOperationSpec: msRest.OperationSpec = { + httpMethod: "DELETE", + path: "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/sourcecontrols/web", + urlParameters: [ + Parameters.resourceGroupName, + Parameters.name, + Parameters.subscriptionId + ], + queryParameters: [ + Parameters.apiVersion + ], + headerParameters: [ + Parameters.acceptLanguage + ], + responses: { + 200: {}, + 202: {}, + 404: {}, + default: { + bodyMapper: Mappers.CloudError + } + }, + serializer +}; + +const updateSourceControlOperationSpec: msRest.OperationSpec = { + httpMethod: "PATCH", + path: "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/sourcecontrols/web", + urlParameters: [ + Parameters.resourceGroupName, + Parameters.name, + Parameters.subscriptionId + ], + queryParameters: [ + Parameters.apiVersion + ], + headerParameters: [ + Parameters.acceptLanguage + ], + requestBody: { + parameterPath: "siteSourceControl", + mapper: { + ...Mappers.SiteSourceControl, + required: true + } + }, + responses: { + 200: { + bodyMapper: Mappers.SiteSourceControl + }, + 201: { + bodyMapper: Mappers.SiteSourceControl + }, + 202: { + bodyMapper: Mappers.SiteSourceControl + }, + default: { + bodyMapper: Mappers.DefaultErrorResponse + } + }, + serializer +}; + +const startOperationSpec: msRest.OperationSpec = { + httpMethod: "POST", + path: "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/start", + urlParameters: [ + Parameters.resourceGroupName, + Parameters.name, + Parameters.subscriptionId + ], + queryParameters: [ + Parameters.apiVersion + ], + headerParameters: [ + Parameters.acceptLanguage + ], + responses: { + 200: {}, + default: { + bodyMapper: Mappers.CloudError + } + }, + serializer +}; + +const stopOperationSpec: msRest.OperationSpec = { + httpMethod: "POST", + path: "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/stop", + urlParameters: [ + Parameters.resourceGroupName, + Parameters.name, + Parameters.subscriptionId + ], + queryParameters: [ + Parameters.apiVersion + ], + headerParameters: [ + Parameters.acceptLanguage + ], + responses: { + 200: {}, + default: { + bodyMapper: Mappers.CloudError + } + }, + serializer +}; + +const stopNetworkTraceOperationSpec: msRest.OperationSpec = { + httpMethod: "POST", + path: "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/stopNetworkTrace", + urlParameters: [ + Parameters.resourceGroupName, + Parameters.name, + Parameters.subscriptionId + ], + queryParameters: [ + Parameters.apiVersion + ], + headerParameters: [ + Parameters.acceptLanguage + ], + responses: { + 200: {}, + 204: {}, + default: { + bodyMapper: Mappers.CloudError + } + }, + serializer +}; + +const syncRepositoryOperationSpec: msRest.OperationSpec = { + httpMethod: "POST", + path: "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/sync", + urlParameters: [ + Parameters.resourceGroupName, + Parameters.name, + Parameters.subscriptionId + ], + queryParameters: [ + Parameters.apiVersion + ], + headerParameters: [ + Parameters.acceptLanguage + ], + responses: { + 200: {}, + default: { + bodyMapper: Mappers.CloudError + } + }, + serializer +}; + +const syncFunctionTriggersOperationSpec: msRest.OperationSpec = { + httpMethod: "POST", + path: "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/syncfunctiontriggers", + urlParameters: [ + Parameters.resourceGroupName, + Parameters.name, + Parameters.subscriptionId + ], + queryParameters: [ + Parameters.apiVersion + ], + headerParameters: [ + Parameters.acceptLanguage + ], + responses: { + 204: {}, + default: { + bodyMapper: Mappers.CloudError + } + }, + serializer +}; + +const listTriggeredWebJobsOperationSpec: msRest.OperationSpec = { + httpMethod: "GET", + path: "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/triggeredwebjobs", + urlParameters: [ + Parameters.resourceGroupName, + Parameters.name, + Parameters.subscriptionId + ], + queryParameters: [ + Parameters.apiVersion + ], + headerParameters: [ + Parameters.acceptLanguage + ], + responses: { + 200: { + bodyMapper: Mappers.TriggeredWebJobCollection + }, + default: { + bodyMapper: Mappers.DefaultErrorResponse + } + }, + serializer +}; + +const getTriggeredWebJobOperationSpec: msRest.OperationSpec = { + httpMethod: "GET", + path: "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/triggeredwebjobs/{webJobName}", + urlParameters: [ + Parameters.resourceGroupName, + Parameters.name, + Parameters.webJobName, + Parameters.subscriptionId + ], + queryParameters: [ + Parameters.apiVersion + ], + headerParameters: [ + Parameters.acceptLanguage + ], + responses: { + 200: { + bodyMapper: Mappers.TriggeredWebJob + }, + 404: {}, + default: { + bodyMapper: Mappers.CloudError + } + }, + serializer +}; + +const deleteTriggeredWebJobOperationSpec: msRest.OperationSpec = { + httpMethod: "DELETE", + path: "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/triggeredwebjobs/{webJobName}", + urlParameters: [ + Parameters.resourceGroupName, + Parameters.name, + Parameters.webJobName, + Parameters.subscriptionId + ], + queryParameters: [ + Parameters.apiVersion + ], + headerParameters: [ + Parameters.acceptLanguage + ], + responses: { + 200: {}, + 204: {}, + default: { + bodyMapper: Mappers.CloudError + } + }, + serializer +}; + +const listTriggeredWebJobHistoryOperationSpec: msRest.OperationSpec = { + httpMethod: "GET", + path: "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/triggeredwebjobs/{webJobName}/history", + urlParameters: [ + Parameters.resourceGroupName, + Parameters.name, + Parameters.webJobName, + Parameters.subscriptionId + ], + queryParameters: [ + Parameters.apiVersion + ], + headerParameters: [ + Parameters.acceptLanguage + ], + responses: { + 200: { + bodyMapper: Mappers.TriggeredJobHistoryCollection + }, + 404: {}, + default: { + bodyMapper: Mappers.CloudError + } + }, + serializer +}; + +const getTriggeredWebJobHistoryOperationSpec: msRest.OperationSpec = { + httpMethod: "GET", + path: "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/triggeredwebjobs/{webJobName}/history/{id}", + urlParameters: [ + Parameters.resourceGroupName, + Parameters.name, + Parameters.webJobName, + Parameters.id, + Parameters.subscriptionId + ], + queryParameters: [ + Parameters.apiVersion + ], + headerParameters: [ + Parameters.acceptLanguage + ], + responses: { + 200: { + bodyMapper: Mappers.TriggeredJobHistory + }, + 404: {}, + default: { + bodyMapper: Mappers.CloudError + } + }, + serializer +}; + +const runTriggeredWebJobOperationSpec: msRest.OperationSpec = { + httpMethod: "POST", + path: "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/triggeredwebjobs/{webJobName}/run", + urlParameters: [ + Parameters.resourceGroupName, + Parameters.name, + Parameters.webJobName, + Parameters.subscriptionId + ], + queryParameters: [ + Parameters.apiVersion + ], + headerParameters: [ + Parameters.acceptLanguage + ], + responses: { + 200: {}, + 404: {}, + default: { + bodyMapper: Mappers.CloudError + } + }, + serializer +}; + +const listUsagesOperationSpec: msRest.OperationSpec = { + httpMethod: "GET", + path: "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/usages", + urlParameters: [ + Parameters.resourceGroupName, + Parameters.name, + Parameters.subscriptionId + ], + queryParameters: [ + Parameters.filter, + Parameters.apiVersion + ], + headerParameters: [ + Parameters.acceptLanguage + ], + responses: { + 200: { + bodyMapper: Mappers.CsmUsageQuotaCollection + }, + default: { + bodyMapper: Mappers.DefaultErrorResponse + } + }, + serializer +}; + +const listVnetConnectionsOperationSpec: msRest.OperationSpec = { + httpMethod: "GET", + path: "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/virtualNetworkConnections", + urlParameters: [ + Parameters.resourceGroupName, + Parameters.name, + Parameters.subscriptionId + ], + queryParameters: [ + Parameters.apiVersion + ], + headerParameters: [ + Parameters.acceptLanguage + ], + responses: { + 200: { + bodyMapper: { + serializedName: "parsedResponse", + type: { + name: "Sequence", + element: { + type: { + name: "Composite", + className: "VnetInfo" + } + } + } + } + }, + default: { + bodyMapper: Mappers.DefaultErrorResponse + } + }, + serializer +}; + +const getVnetConnectionOperationSpec: msRest.OperationSpec = { + httpMethod: "GET", + path: "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/virtualNetworkConnections/{vnetName}", + urlParameters: [ + Parameters.resourceGroupName, + Parameters.name, + Parameters.vnetName, + Parameters.subscriptionId + ], + queryParameters: [ + Parameters.apiVersion + ], + headerParameters: [ + Parameters.acceptLanguage + ], + responses: { + 200: { + bodyMapper: Mappers.VnetInfo + }, + default: { + bodyMapper: Mappers.DefaultErrorResponse + } + }, + serializer +}; + +const createOrUpdateVnetConnectionOperationSpec: msRest.OperationSpec = { + httpMethod: "PUT", + path: "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/virtualNetworkConnections/{vnetName}", + urlParameters: [ + Parameters.resourceGroupName, + Parameters.name, + Parameters.vnetName, + Parameters.subscriptionId + ], + queryParameters: [ + Parameters.apiVersion + ], + headerParameters: [ + Parameters.acceptLanguage + ], + requestBody: { + parameterPath: "connectionEnvelope", + mapper: { + ...Mappers.VnetInfo, + required: true + } + }, + responses: { + 200: { + bodyMapper: Mappers.VnetInfo + }, + default: { + bodyMapper: Mappers.DefaultErrorResponse + } + }, + serializer +}; + +const deleteVnetConnectionOperationSpec: msRest.OperationSpec = { + httpMethod: "DELETE", + path: "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/virtualNetworkConnections/{vnetName}", + urlParameters: [ + Parameters.resourceGroupName, + Parameters.name, + Parameters.vnetName, + Parameters.subscriptionId + ], + queryParameters: [ + Parameters.apiVersion + ], + headerParameters: [ + Parameters.acceptLanguage + ], + responses: { + 200: {}, + 404: {}, + default: { + bodyMapper: Mappers.CloudError + } + }, + serializer +}; + +const updateVnetConnectionOperationSpec: msRest.OperationSpec = { + httpMethod: "PATCH", + path: "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/virtualNetworkConnections/{vnetName}", + urlParameters: [ + Parameters.resourceGroupName, + Parameters.name, + Parameters.vnetName, + Parameters.subscriptionId + ], + queryParameters: [ + Parameters.apiVersion + ], + headerParameters: [ + Parameters.acceptLanguage + ], + requestBody: { + parameterPath: "connectionEnvelope", + mapper: { + ...Mappers.VnetInfo, + required: true + } + }, + responses: { + 200: { + bodyMapper: Mappers.VnetInfo + }, + default: { + bodyMapper: Mappers.DefaultErrorResponse + } + }, + serializer +}; + +const getVnetConnectionGatewayOperationSpec: msRest.OperationSpec = { + httpMethod: "GET", + path: "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/virtualNetworkConnections/{vnetName}/gateways/{gatewayName}", + urlParameters: [ + Parameters.resourceGroupName, + Parameters.name, + Parameters.vnetName, + Parameters.gatewayName, + Parameters.subscriptionId + ], + queryParameters: [ + Parameters.apiVersion + ], + headerParameters: [ + Parameters.acceptLanguage + ], + responses: { + 200: { + bodyMapper: Mappers.VnetGateway + }, + 404: {}, + default: { + bodyMapper: Mappers.CloudError + } + }, + serializer +}; + +const createOrUpdateVnetConnectionGatewayOperationSpec: msRest.OperationSpec = { + httpMethod: "PUT", + path: "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/virtualNetworkConnections/{vnetName}/gateways/{gatewayName}", + urlParameters: [ + Parameters.resourceGroupName, + Parameters.name, + Parameters.vnetName, + Parameters.gatewayName, + Parameters.subscriptionId + ], + queryParameters: [ + Parameters.apiVersion + ], + headerParameters: [ + Parameters.acceptLanguage + ], + requestBody: { + parameterPath: "connectionEnvelope", + mapper: { + ...Mappers.VnetGateway, + required: true + } + }, + responses: { + 200: { + bodyMapper: Mappers.VnetGateway + }, + default: { + bodyMapper: Mappers.DefaultErrorResponse + } + }, + serializer +}; + +const updateVnetConnectionGatewayOperationSpec: msRest.OperationSpec = { + httpMethod: "PATCH", + path: "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/virtualNetworkConnections/{vnetName}/gateways/{gatewayName}", + urlParameters: [ + Parameters.resourceGroupName, + Parameters.name, + Parameters.vnetName, + Parameters.gatewayName, + Parameters.subscriptionId + ], + queryParameters: [ + Parameters.apiVersion + ], + headerParameters: [ + Parameters.acceptLanguage + ], + requestBody: { + parameterPath: "connectionEnvelope", + mapper: { + ...Mappers.VnetGateway, + required: true + } + }, + responses: { + 200: { + bodyMapper: Mappers.VnetGateway + }, + default: { + bodyMapper: Mappers.DefaultErrorResponse + } + }, + serializer +}; + +const listWebJobsOperationSpec: msRest.OperationSpec = { + httpMethod: "GET", + path: "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/webjobs", + urlParameters: [ + Parameters.resourceGroupName, + Parameters.name, + Parameters.subscriptionId + ], + queryParameters: [ + Parameters.apiVersion + ], + headerParameters: [ + Parameters.acceptLanguage + ], + responses: { + 200: { + bodyMapper: Mappers.WebJobCollection + }, + default: { + bodyMapper: Mappers.DefaultErrorResponse + } + }, + serializer +}; + +const getWebJobOperationSpec: msRest.OperationSpec = { + httpMethod: "GET", + path: "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/webjobs/{webJobName}", + urlParameters: [ + Parameters.resourceGroupName, + Parameters.name, + Parameters.webJobName, + Parameters.subscriptionId + ], + queryParameters: [ + Parameters.apiVersion + ], + headerParameters: [ + Parameters.acceptLanguage + ], + responses: { + 200: { + bodyMapper: Mappers.WebJob + }, + default: { + bodyMapper: Mappers.DefaultErrorResponse + } + }, + serializer +}; + +const beginCreateOrUpdateOperationSpec: msRest.OperationSpec = { + httpMethod: "PUT", + path: "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}", + urlParameters: [ + Parameters.resourceGroupName, + Parameters.name, + Parameters.subscriptionId + ], + queryParameters: [ + Parameters.apiVersion + ], + headerParameters: [ + Parameters.acceptLanguage + ], + requestBody: { + parameterPath: "siteEnvelope", + mapper: { + ...Mappers.Site, + required: true + } + }, + responses: { + 200: { + bodyMapper: Mappers.Site + }, + 202: { + bodyMapper: Mappers.Site + }, + default: { + bodyMapper: Mappers.DefaultErrorResponse + } + }, + serializer +}; + +const beginRestoreOperationSpec: msRest.OperationSpec = { + httpMethod: "POST", + path: "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/backups/{backupId}/restore", + urlParameters: [ + Parameters.resourceGroupName, + Parameters.name, + Parameters.backupId, + Parameters.subscriptionId + ], + queryParameters: [ + Parameters.apiVersion + ], + headerParameters: [ + Parameters.acceptLanguage + ], + requestBody: { + parameterPath: "request", + mapper: { + ...Mappers.RestoreRequest, + required: true + } + }, + responses: { + 200: {}, + 202: {}, + default: { + bodyMapper: Mappers.CloudError + } + }, + serializer +}; + +const beginListPublishingCredentialsOperationSpec: msRest.OperationSpec = { + httpMethod: "POST", + path: "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/config/publishingcredentials/list", + urlParameters: [ + Parameters.resourceGroupName, + Parameters.name, + Parameters.subscriptionId + ], + queryParameters: [ + Parameters.apiVersion + ], + headerParameters: [ + Parameters.acceptLanguage + ], + responses: { + 200: { + bodyMapper: Mappers.User + }, + default: { + bodyMapper: Mappers.DefaultErrorResponse + } + }, + serializer +}; + +const beginCreateMSDeployOperationOperationSpec: msRest.OperationSpec = { + httpMethod: "PUT", + path: "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/extensions/MSDeploy", + urlParameters: [ + Parameters.resourceGroupName, + Parameters.name, + Parameters.subscriptionId + ], + queryParameters: [ + Parameters.apiVersion + ], + headerParameters: [ + Parameters.acceptLanguage + ], + requestBody: { + parameterPath: "mSDeploy", + mapper: { + ...Mappers.MSDeploy, + required: true + } + }, + responses: { + 201: { + bodyMapper: Mappers.MSDeployStatus + }, + 409: {}, + default: { + bodyMapper: Mappers.CloudError + } + }, + serializer +}; + +const beginCreateFunctionOperationSpec: msRest.OperationSpec = { + httpMethod: "PUT", + path: "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/functions/{functionName}", + urlParameters: [ + Parameters.resourceGroupName, + Parameters.name, + Parameters.functionName, + Parameters.subscriptionId + ], + queryParameters: [ + Parameters.apiVersion + ], + headerParameters: [ + Parameters.acceptLanguage + ], + requestBody: { + parameterPath: "functionEnvelope", + mapper: { + ...Mappers.FunctionEnvelope, + required: true + } + }, + responses: { + 201: { + bodyMapper: Mappers.FunctionEnvelope + }, + default: { + bodyMapper: Mappers.DefaultErrorResponse + } + }, + serializer +}; + +const beginCreateInstanceMSDeployOperationOperationSpec: msRest.OperationSpec = { + httpMethod: "PUT", + path: "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/instances/{instanceId}/extensions/MSDeploy", + urlParameters: [ + Parameters.resourceGroupName, + Parameters.name, + Parameters.instanceId, + Parameters.subscriptionId + ], + queryParameters: [ + Parameters.apiVersion + ], + headerParameters: [ + Parameters.acceptLanguage + ], + requestBody: { + parameterPath: "mSDeploy", + mapper: { + ...Mappers.MSDeploy, + required: true + } + }, + responses: { + 201: { + bodyMapper: Mappers.MSDeployStatus + }, + 409: {}, + default: { + bodyMapper: Mappers.CloudError + } + }, + serializer +}; + +const beginMigrateStorageOperationSpec: msRest.OperationSpec = { + httpMethod: "PUT", + path: "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/migrate", + urlParameters: [ + Parameters.resourceGroupName, + Parameters.name, + Parameters.subscriptionId + ], + queryParameters: [ + Parameters.subscriptionName, + Parameters.apiVersion + ], + headerParameters: [ + Parameters.acceptLanguage + ], + requestBody: { + parameterPath: "migrationOptions", + mapper: { + ...Mappers.StorageMigrationOptions, + required: true + } + }, + responses: { + 200: { + bodyMapper: Mappers.StorageMigrationResponse + }, + default: { + bodyMapper: Mappers.DefaultErrorResponse + } + }, + serializer +}; + +const beginMigrateMySqlOperationSpec: msRest.OperationSpec = { + httpMethod: "POST", + path: "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/migratemysql", + urlParameters: [ + Parameters.resourceGroupName, + Parameters.name, + Parameters.subscriptionId + ], + queryParameters: [ + Parameters.apiVersion + ], + headerParameters: [ + Parameters.acceptLanguage + ], + requestBody: { + parameterPath: "migrationRequestEnvelope", + mapper: { + ...Mappers.MigrateMySqlRequest, + required: true + } + }, + responses: { + 200: { + bodyMapper: Mappers.Operation + }, + default: { + bodyMapper: Mappers.DefaultErrorResponse + } + }, + serializer +}; + +const beginStartWebSiteNetworkTraceOperationOperationSpec: msRest.OperationSpec = { + httpMethod: "POST", + path: "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/networkTrace/startOperation", + urlParameters: [ + Parameters.resourceGroupName, + Parameters.name, + Parameters.subscriptionId + ], + queryParameters: [ + Parameters.durationInSeconds, + Parameters.maxFrameLength, + Parameters.sasUrl, + Parameters.apiVersion + ], + headerParameters: [ + Parameters.acceptLanguage + ], + responses: { + 200: { + bodyMapper: { + serializedName: "parsedResponse", + type: { + name: "Sequence", + element: { + type: { + name: "Composite", + className: "NetworkTrace" + } + } + } + } + }, + 202: { + bodyMapper: { + serializedName: "parsedResponse", + type: { + name: "Sequence", + element: { + type: { + name: "Composite", + className: "NetworkTrace" + } + } + } + } + }, + default: { + bodyMapper: Mappers.DefaultErrorResponse + } + }, + serializer +}; + +const beginRestoreFromBackupBlobOperationSpec: msRest.OperationSpec = { + httpMethod: "POST", + path: "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/restoreFromBackupBlob", + urlParameters: [ + Parameters.resourceGroupName, + Parameters.name, + Parameters.subscriptionId + ], + queryParameters: [ + Parameters.apiVersion + ], + headerParameters: [ + Parameters.acceptLanguage + ], + requestBody: { + parameterPath: "request", + mapper: { + ...Mappers.RestoreRequest, + required: true + } + }, + responses: { + 200: {}, + 202: {}, + default: { + bodyMapper: Mappers.CloudError + } + }, + serializer +}; + +const beginRestoreFromDeletedAppOperationSpec: msRest.OperationSpec = { + httpMethod: "POST", + path: "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/restoreFromDeletedApp", + urlParameters: [ + Parameters.resourceGroupName, + Parameters.name, + Parameters.subscriptionId + ], + queryParameters: [ + Parameters.apiVersion + ], + headerParameters: [ + Parameters.acceptLanguage + ], + requestBody: { + parameterPath: "restoreRequest", + mapper: { + ...Mappers.DeletedAppRestoreRequest, + required: true + } + }, + responses: { + 200: {}, + 202: {}, + default: { + bodyMapper: Mappers.CloudError + } + }, + serializer +}; + +const beginRestoreSnapshotOperationSpec: msRest.OperationSpec = { + httpMethod: "POST", + path: "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/restoreSnapshot", + urlParameters: [ + Parameters.resourceGroupName, + Parameters.name, + Parameters.subscriptionId + ], + queryParameters: [ + Parameters.apiVersion + ], + headerParameters: [ + Parameters.acceptLanguage + ], + requestBody: { + parameterPath: "restoreRequest", + mapper: { + ...Mappers.SnapshotRestoreRequest, + required: true + } + }, + responses: { + 200: {}, + 202: {}, + default: { + bodyMapper: Mappers.CloudError + } + }, + serializer +}; + +const beginInstallSiteExtensionOperationSpec: msRest.OperationSpec = { + httpMethod: "PUT", + path: "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/siteextensions/{siteExtensionId}", + urlParameters: [ + Parameters.resourceGroupName, + Parameters.name, + Parameters.siteExtensionId, + Parameters.subscriptionId + ], + queryParameters: [ + Parameters.apiVersion + ], + headerParameters: [ + Parameters.acceptLanguage + ], + responses: { + 200: { + bodyMapper: Mappers.SiteExtensionInfo + }, + 201: { + bodyMapper: Mappers.SiteExtensionInfo + }, + 429: {}, + default: { + bodyMapper: Mappers.CloudError + } + }, + serializer +}; + +const beginCreateOrUpdateSlotOperationSpec: msRest.OperationSpec = { + httpMethod: "PUT", + path: "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}", + urlParameters: [ + Parameters.resourceGroupName, + Parameters.name, + Parameters.slot, + Parameters.subscriptionId + ], + queryParameters: [ + Parameters.apiVersion + ], + headerParameters: [ + Parameters.acceptLanguage + ], + requestBody: { + parameterPath: "siteEnvelope", + mapper: { + ...Mappers.Site, + required: true + } + }, + responses: { + 200: { + bodyMapper: Mappers.Site + }, + 202: { + bodyMapper: Mappers.Site + }, + default: { + bodyMapper: Mappers.DefaultErrorResponse + } + }, + serializer +}; + +const beginRestoreSlotOperationSpec: msRest.OperationSpec = { + httpMethod: "POST", + path: "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/backups/{backupId}/restore", + urlParameters: [ + Parameters.resourceGroupName, + Parameters.name, + Parameters.backupId, + Parameters.slot, + Parameters.subscriptionId + ], + queryParameters: [ + Parameters.apiVersion + ], + headerParameters: [ + Parameters.acceptLanguage + ], + requestBody: { + parameterPath: "request", + mapper: { + ...Mappers.RestoreRequest, + required: true + } + }, + responses: { + 200: {}, + 202: {}, + default: { + bodyMapper: Mappers.CloudError + } + }, + serializer +}; + +const beginListPublishingCredentialsSlotOperationSpec: msRest.OperationSpec = { + httpMethod: "POST", + path: "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/config/publishingcredentials/list", + urlParameters: [ + Parameters.resourceGroupName, + Parameters.name, + Parameters.slot, + Parameters.subscriptionId + ], + queryParameters: [ + Parameters.apiVersion + ], + headerParameters: [ + Parameters.acceptLanguage + ], + responses: { + 200: { + bodyMapper: Mappers.User + }, + default: { + bodyMapper: Mappers.DefaultErrorResponse + } + }, + serializer +}; + +const beginCreateMSDeployOperationSlotOperationSpec: msRest.OperationSpec = { + httpMethod: "PUT", + path: "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/extensions/MSDeploy", + urlParameters: [ + Parameters.resourceGroupName, + Parameters.name, + Parameters.slot, + Parameters.subscriptionId + ], + queryParameters: [ + Parameters.apiVersion + ], + headerParameters: [ + Parameters.acceptLanguage + ], + requestBody: { + parameterPath: "mSDeploy", + mapper: { + ...Mappers.MSDeploy, + required: true + } + }, + responses: { + 201: { + bodyMapper: Mappers.MSDeployStatus + }, + 409: {}, + default: { + bodyMapper: Mappers.CloudError + } + }, + serializer +}; + +const beginCreateInstanceFunctionSlotOperationSpec: msRest.OperationSpec = { + httpMethod: "PUT", + path: "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/functions/{functionName}", + urlParameters: [ + Parameters.resourceGroupName, + Parameters.name, + Parameters.functionName, + Parameters.slot, + Parameters.subscriptionId + ], + queryParameters: [ + Parameters.apiVersion + ], + headerParameters: [ + Parameters.acceptLanguage + ], + requestBody: { + parameterPath: "functionEnvelope", + mapper: { + ...Mappers.FunctionEnvelope, + required: true + } + }, + responses: { + 201: { + bodyMapper: Mappers.FunctionEnvelope + }, + default: { + bodyMapper: Mappers.DefaultErrorResponse + } + }, + serializer +}; + +const beginCreateInstanceMSDeployOperationSlotOperationSpec: msRest.OperationSpec = { + httpMethod: "PUT", + path: "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/instances/{instanceId}/extensions/MSDeploy", + urlParameters: [ + Parameters.resourceGroupName, + Parameters.name, + Parameters.slot, + Parameters.instanceId, + Parameters.subscriptionId + ], + queryParameters: [ + Parameters.apiVersion + ], + headerParameters: [ + Parameters.acceptLanguage + ], + requestBody: { + parameterPath: "mSDeploy", + mapper: { + ...Mappers.MSDeploy, + required: true + } + }, + responses: { + 201: { + bodyMapper: Mappers.MSDeployStatus + }, + 409: {}, + default: { + bodyMapper: Mappers.CloudError + } + }, + serializer +}; + +const beginStartWebSiteNetworkTraceOperationSlotOperationSpec: msRest.OperationSpec = { + httpMethod: "POST", + path: "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/networkTrace/startOperation", + urlParameters: [ + Parameters.resourceGroupName, + Parameters.name, + Parameters.slot, + Parameters.subscriptionId + ], + queryParameters: [ + Parameters.durationInSeconds, + Parameters.maxFrameLength, + Parameters.sasUrl, + Parameters.apiVersion + ], + headerParameters: [ + Parameters.acceptLanguage + ], + responses: { + 200: { + bodyMapper: { + serializedName: "parsedResponse", + type: { + name: "Sequence", + element: { + type: { + name: "Composite", + className: "NetworkTrace" + } + } + } + } + }, + 202: { + bodyMapper: { + serializedName: "parsedResponse", + type: { + name: "Sequence", + element: { + type: { + name: "Composite", + className: "NetworkTrace" + } + } + } + } + }, + default: { + bodyMapper: Mappers.DefaultErrorResponse + } + }, + serializer +}; + +const beginRestoreFromBackupBlobSlotOperationSpec: msRest.OperationSpec = { + httpMethod: "POST", + path: "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/restoreFromBackupBlob", + urlParameters: [ + Parameters.resourceGroupName, + Parameters.name, + Parameters.slot, + Parameters.subscriptionId + ], + queryParameters: [ + Parameters.apiVersion + ], + headerParameters: [ + Parameters.acceptLanguage + ], + requestBody: { + parameterPath: "request", + mapper: { + ...Mappers.RestoreRequest, + required: true + } + }, + responses: { + 200: {}, + 202: {}, + default: { + bodyMapper: Mappers.CloudError + } + }, + serializer +}; + +const beginRestoreFromDeletedAppSlotOperationSpec: msRest.OperationSpec = { + httpMethod: "POST", + path: "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/restoreFromDeletedApp", + urlParameters: [ + Parameters.resourceGroupName, + Parameters.name, + Parameters.slot, + Parameters.subscriptionId + ], + queryParameters: [ + Parameters.apiVersion + ], + headerParameters: [ + Parameters.acceptLanguage + ], + requestBody: { + parameterPath: "restoreRequest", + mapper: { + ...Mappers.DeletedAppRestoreRequest, + required: true + } + }, + responses: { + 200: {}, + 202: {}, + default: { + bodyMapper: Mappers.CloudError + } + }, + serializer +}; + +const beginRestoreSnapshotSlotOperationSpec: msRest.OperationSpec = { + httpMethod: "POST", + path: "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/restoreSnapshot", + urlParameters: [ + Parameters.resourceGroupName, + Parameters.name, + Parameters.slot, + Parameters.subscriptionId + ], + queryParameters: [ + Parameters.apiVersion + ], + headerParameters: [ + Parameters.acceptLanguage + ], + requestBody: { + parameterPath: "restoreRequest", + mapper: { + ...Mappers.SnapshotRestoreRequest, + required: true + } + }, + responses: { + 200: {}, + 202: {}, + default: { + bodyMapper: Mappers.CloudError + } + }, + serializer +}; + +const beginInstallSiteExtensionSlotOperationSpec: msRest.OperationSpec = { + httpMethod: "PUT", + path: "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/siteextensions/{siteExtensionId}", + urlParameters: [ + Parameters.resourceGroupName, + Parameters.name, + Parameters.siteExtensionId, + Parameters.slot, + Parameters.subscriptionId + ], + queryParameters: [ + Parameters.apiVersion + ], + headerParameters: [ + Parameters.acceptLanguage + ], + responses: { + 200: { + bodyMapper: Mappers.SiteExtensionInfo + }, + 201: { + bodyMapper: Mappers.SiteExtensionInfo + }, + 429: {}, + default: { + bodyMapper: Mappers.CloudError + } + }, + serializer +}; + +const beginSwapSlotSlotOperationSpec: msRest.OperationSpec = { + httpMethod: "POST", + path: "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/slotsswap", + urlParameters: [ + Parameters.resourceGroupName, + Parameters.name, + Parameters.slot, + Parameters.subscriptionId + ], + queryParameters: [ + Parameters.apiVersion + ], + headerParameters: [ + Parameters.acceptLanguage + ], + requestBody: { + parameterPath: "slotSwapEntity", + mapper: { + ...Mappers.CsmSlotEntity, + required: true + } + }, + responses: { + 200: {}, + 202: {}, + default: { + bodyMapper: Mappers.CloudError + } + }, + serializer +}; + +const beginCreateOrUpdateSourceControlSlotOperationSpec: msRest.OperationSpec = { + httpMethod: "PUT", + path: "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/sourcecontrols/web", + urlParameters: [ + Parameters.resourceGroupName, + Parameters.name, + Parameters.slot, + Parameters.subscriptionId + ], + queryParameters: [ + Parameters.apiVersion + ], + headerParameters: [ + Parameters.acceptLanguage + ], + requestBody: { + parameterPath: "siteSourceControl", + mapper: { + ...Mappers.SiteSourceControl, + required: true + } + }, + responses: { + 200: { + bodyMapper: Mappers.SiteSourceControl + }, + 201: { + bodyMapper: Mappers.SiteSourceControl + }, + 202: { + bodyMapper: Mappers.SiteSourceControl + }, + default: { + bodyMapper: Mappers.DefaultErrorResponse + } + }, + serializer +}; + +const beginStartNetworkTraceSlotOperationSpec: msRest.OperationSpec = { + httpMethod: "POST", + path: "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/startNetworkTrace", + urlParameters: [ + Parameters.resourceGroupName, + Parameters.name, + Parameters.slot, + Parameters.subscriptionId + ], + queryParameters: [ + Parameters.durationInSeconds, + Parameters.maxFrameLength, + Parameters.sasUrl, + Parameters.apiVersion + ], + headerParameters: [ + Parameters.acceptLanguage + ], + responses: { + 200: { + bodyMapper: { + serializedName: "parsedResponse", + type: { + name: "Sequence", + element: { + type: { + name: "Composite", + className: "NetworkTrace" + } + } + } + } + }, + 202: { + bodyMapper: { + serializedName: "parsedResponse", + type: { + name: "Sequence", + element: { + type: { + name: "Composite", + className: "NetworkTrace" + } + } + } + } + }, + default: { + bodyMapper: Mappers.DefaultErrorResponse + } + }, + serializer +}; + +const beginSwapSlotWithProductionOperationSpec: msRest.OperationSpec = { + httpMethod: "POST", + path: "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slotsswap", + urlParameters: [ + Parameters.resourceGroupName, + Parameters.name, + Parameters.subscriptionId + ], + queryParameters: [ + Parameters.apiVersion + ], + headerParameters: [ + Parameters.acceptLanguage + ], + requestBody: { + parameterPath: "slotSwapEntity", + mapper: { + ...Mappers.CsmSlotEntity, + required: true + } + }, + responses: { + 200: {}, + 202: {}, + default: { + bodyMapper: Mappers.CloudError + } + }, + serializer +}; + +const beginCreateOrUpdateSourceControlOperationSpec: msRest.OperationSpec = { + httpMethod: "PUT", + path: "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/sourcecontrols/web", + urlParameters: [ + Parameters.resourceGroupName, + Parameters.name, + Parameters.subscriptionId + ], + queryParameters: [ + Parameters.apiVersion + ], + headerParameters: [ + Parameters.acceptLanguage + ], + requestBody: { + parameterPath: "siteSourceControl", + mapper: { + ...Mappers.SiteSourceControl, + required: true + } + }, + responses: { + 200: { + bodyMapper: Mappers.SiteSourceControl + }, + 201: { + bodyMapper: Mappers.SiteSourceControl + }, + 202: { + bodyMapper: Mappers.SiteSourceControl + }, + default: { + bodyMapper: Mappers.DefaultErrorResponse + } + }, + serializer +}; + +const beginStartNetworkTraceOperationSpec: msRest.OperationSpec = { + httpMethod: "POST", + path: "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/startNetworkTrace", + urlParameters: [ + Parameters.resourceGroupName, + Parameters.name, + Parameters.subscriptionId + ], + queryParameters: [ + Parameters.durationInSeconds, + Parameters.maxFrameLength, + Parameters.sasUrl, + Parameters.apiVersion + ], + headerParameters: [ + Parameters.acceptLanguage + ], + responses: { + 200: { + bodyMapper: { + serializedName: "parsedResponse", + type: { + name: "Sequence", + element: { + type: { + name: "Composite", + className: "NetworkTrace" + } + } + } + } + }, + 202: { + bodyMapper: { + serializedName: "parsedResponse", + type: { + name: "Sequence", + element: { + type: { + name: "Composite", + className: "NetworkTrace" + } + } + } + } + }, + default: { + bodyMapper: Mappers.DefaultErrorResponse + } + }, + serializer +}; + +const listNextOperationSpec: msRest.OperationSpec = { + httpMethod: "GET", + baseUrl: "https://management.azure.com", + path: "{nextLink}", + urlParameters: [ + Parameters.nextPageLink + ], + headerParameters: [ + Parameters.acceptLanguage + ], + responses: { + 200: { + bodyMapper: Mappers.WebAppCollection + }, + default: { + bodyMapper: Mappers.DefaultErrorResponse + } + }, + serializer +}; + +const listByResourceGroupNextOperationSpec: msRest.OperationSpec = { + httpMethod: "GET", + baseUrl: "https://management.azure.com", + path: "{nextLink}", + urlParameters: [ + Parameters.nextPageLink + ], + headerParameters: [ + Parameters.acceptLanguage + ], + responses: { + 200: { + bodyMapper: Mappers.WebAppCollection + }, + default: { + bodyMapper: Mappers.DefaultErrorResponse + } + }, + serializer +}; + +const listBackupsNextOperationSpec: msRest.OperationSpec = { + httpMethod: "GET", + baseUrl: "https://management.azure.com", + path: "{nextLink}", + urlParameters: [ + Parameters.nextPageLink + ], + headerParameters: [ + Parameters.acceptLanguage + ], + responses: { + 200: { + bodyMapper: Mappers.BackupItemCollection + }, + default: { + bodyMapper: Mappers.DefaultErrorResponse + } + }, + serializer +}; + +const listConfigurationsNextOperationSpec: msRest.OperationSpec = { + httpMethod: "GET", + baseUrl: "https://management.azure.com", + path: "{nextLink}", + urlParameters: [ + Parameters.nextPageLink + ], + headerParameters: [ + Parameters.acceptLanguage + ], + responses: { + 200: { + bodyMapper: Mappers.SiteConfigResourceCollection + }, + default: { + bodyMapper: Mappers.DefaultErrorResponse + } + }, + serializer +}; + +const listConfigurationSnapshotInfoNextOperationSpec: msRest.OperationSpec = { + httpMethod: "GET", + baseUrl: "https://management.azure.com", + path: "{nextLink}", + urlParameters: [ + Parameters.nextPageLink + ], + headerParameters: [ + Parameters.acceptLanguage + ], + responses: { + 200: { + bodyMapper: Mappers.SiteConfigurationSnapshotInfoCollection + }, + default: { + bodyMapper: Mappers.DefaultErrorResponse + } + }, + serializer +}; + +const listContinuousWebJobsNextOperationSpec: msRest.OperationSpec = { + httpMethod: "GET", + baseUrl: "https://management.azure.com", + path: "{nextLink}", + urlParameters: [ + Parameters.nextPageLink + ], + headerParameters: [ + Parameters.acceptLanguage + ], + responses: { + 200: { + bodyMapper: Mappers.ContinuousWebJobCollection + }, + default: { + bodyMapper: Mappers.DefaultErrorResponse + } + }, + serializer +}; + +const listDeploymentsNextOperationSpec: msRest.OperationSpec = { + httpMethod: "GET", + baseUrl: "https://management.azure.com", + path: "{nextLink}", + urlParameters: [ + Parameters.nextPageLink + ], + headerParameters: [ + Parameters.acceptLanguage + ], + responses: { + 200: { + bodyMapper: Mappers.DeploymentCollection + }, + default: { + bodyMapper: Mappers.DefaultErrorResponse + } + }, + serializer +}; + +const listDomainOwnershipIdentifiersNextOperationSpec: msRest.OperationSpec = { + httpMethod: "GET", + baseUrl: "https://management.azure.com", + path: "{nextLink}", + urlParameters: [ + Parameters.nextPageLink + ], + headerParameters: [ + Parameters.acceptLanguage + ], + responses: { + 200: { + bodyMapper: Mappers.IdentifierCollection + }, + default: { + bodyMapper: Mappers.DefaultErrorResponse + } + }, + serializer +}; + +const listFunctionsNextOperationSpec: msRest.OperationSpec = { + httpMethod: "GET", + baseUrl: "https://management.azure.com", + path: "{nextLink}", + urlParameters: [ + Parameters.nextPageLink + ], + headerParameters: [ + Parameters.acceptLanguage + ], + responses: { + 200: { + bodyMapper: Mappers.FunctionEnvelopeCollection + }, + 404: {}, + default: { + bodyMapper: Mappers.CloudError + } + }, + serializer +}; + +const listHostNameBindingsNextOperationSpec: msRest.OperationSpec = { + httpMethod: "GET", + baseUrl: "https://management.azure.com", + path: "{nextLink}", + urlParameters: [ + Parameters.nextPageLink + ], + headerParameters: [ + Parameters.acceptLanguage + ], + responses: { + 200: { + bodyMapper: Mappers.HostNameBindingCollection + }, + default: { + bodyMapper: Mappers.DefaultErrorResponse + } + }, + serializer +}; + +const listInstanceIdentifiersNextOperationSpec: msRest.OperationSpec = { + httpMethod: "GET", + baseUrl: "https://management.azure.com", + path: "{nextLink}", + urlParameters: [ + Parameters.nextPageLink + ], + headerParameters: [ + Parameters.acceptLanguage + ], + responses: { + 200: { + bodyMapper: Mappers.WebAppInstanceCollection + }, + default: { + bodyMapper: Mappers.DefaultErrorResponse + } + }, + serializer +}; + +const listInstanceProcessesNextOperationSpec: msRest.OperationSpec = { + httpMethod: "GET", + baseUrl: "https://management.azure.com", + path: "{nextLink}", + urlParameters: [ + Parameters.nextPageLink + ], + headerParameters: [ + Parameters.acceptLanguage + ], + responses: { + 200: { + bodyMapper: Mappers.ProcessInfoCollection + }, + 404: {}, + default: { + bodyMapper: Mappers.CloudError + } + }, + serializer +}; + +const listInstanceProcessModulesNextOperationSpec: msRest.OperationSpec = { + httpMethod: "GET", + baseUrl: "https://management.azure.com", + path: "{nextLink}", + urlParameters: [ + Parameters.nextPageLink + ], + headerParameters: [ + Parameters.acceptLanguage + ], + responses: { + 200: { + bodyMapper: Mappers.ProcessModuleInfoCollection + }, + 404: {}, + default: { + bodyMapper: Mappers.CloudError + } + }, + serializer +}; + +const listInstanceProcessThreadsNextOperationSpec: msRest.OperationSpec = { + httpMethod: "GET", + baseUrl: "https://management.azure.com", + path: "{nextLink}", + urlParameters: [ + Parameters.nextPageLink + ], + headerParameters: [ + Parameters.acceptLanguage + ], + responses: { + 200: { + bodyMapper: Mappers.ProcessThreadInfoCollection + }, + 404: {}, + default: { + bodyMapper: Mappers.CloudError + } + }, + serializer +}; + +const listMetricDefinitionsNextOperationSpec: msRest.OperationSpec = { + httpMethod: "GET", + baseUrl: "https://management.azure.com", + path: "{nextLink}", + urlParameters: [ + Parameters.nextPageLink + ], + headerParameters: [ + Parameters.acceptLanguage + ], + responses: { + 200: { + bodyMapper: Mappers.ResourceMetricDefinitionCollection + }, + default: { + bodyMapper: Mappers.DefaultErrorResponse + } + }, + serializer +}; + +const listMetricsNextOperationSpec: msRest.OperationSpec = { + httpMethod: "GET", + baseUrl: "https://management.azure.com", + path: "{nextLink}", + urlParameters: [ + Parameters.nextPageLink + ], + headerParameters: [ + Parameters.acceptLanguage + ], + responses: { + 200: { + bodyMapper: Mappers.ResourceMetricCollection + }, + default: { + bodyMapper: Mappers.DefaultErrorResponse + } + }, + serializer +}; + +const listPerfMonCountersNextOperationSpec: msRest.OperationSpec = { + httpMethod: "GET", + baseUrl: "https://management.azure.com", + path: "{nextLink}", + urlParameters: [ + Parameters.nextPageLink + ], + headerParameters: [ + Parameters.acceptLanguage + ], + responses: { + 200: { + bodyMapper: Mappers.PerfMonCounterCollection + }, + default: { + bodyMapper: Mappers.DefaultErrorResponse + } + }, + serializer +}; + +const listProcessesNextOperationSpec: msRest.OperationSpec = { + httpMethod: "GET", + baseUrl: "https://management.azure.com", + path: "{nextLink}", + urlParameters: [ + Parameters.nextPageLink + ], + headerParameters: [ + Parameters.acceptLanguage + ], + responses: { + 200: { + bodyMapper: Mappers.ProcessInfoCollection + }, + 404: {}, + default: { + bodyMapper: Mappers.CloudError + } + }, + serializer +}; + +const listProcessModulesNextOperationSpec: msRest.OperationSpec = { + httpMethod: "GET", + baseUrl: "https://management.azure.com", + path: "{nextLink}", + urlParameters: [ + Parameters.nextPageLink + ], + headerParameters: [ + Parameters.acceptLanguage + ], + responses: { + 200: { + bodyMapper: Mappers.ProcessModuleInfoCollection + }, + 404: {}, + default: { + bodyMapper: Mappers.CloudError + } + }, + serializer +}; + +const listProcessThreadsNextOperationSpec: msRest.OperationSpec = { + httpMethod: "GET", + baseUrl: "https://management.azure.com", + path: "{nextLink}", + urlParameters: [ + Parameters.nextPageLink + ], + headerParameters: [ + Parameters.acceptLanguage + ], + responses: { + 200: { + bodyMapper: Mappers.ProcessThreadInfoCollection + }, + 404: {}, + default: { + bodyMapper: Mappers.CloudError + } + }, + serializer +}; + +const listPublicCertificatesNextOperationSpec: msRest.OperationSpec = { + httpMethod: "GET", + baseUrl: "https://management.azure.com", + path: "{nextLink}", + urlParameters: [ + Parameters.nextPageLink + ], + headerParameters: [ + Parameters.acceptLanguage + ], + responses: { + 200: { + bodyMapper: Mappers.PublicCertificateCollection + }, + default: { + bodyMapper: Mappers.DefaultErrorResponse + } + }, + serializer +}; + +const listSiteExtensionsNextOperationSpec: msRest.OperationSpec = { + httpMethod: "GET", + baseUrl: "https://management.azure.com", + path: "{nextLink}", + urlParameters: [ + Parameters.nextPageLink + ], + headerParameters: [ + Parameters.acceptLanguage + ], + responses: { + 200: { + bodyMapper: Mappers.SiteExtensionInfoCollection + }, + 404: {}, + default: { + bodyMapper: Mappers.CloudError + } + }, + serializer +}; + +const listSlotsNextOperationSpec: msRest.OperationSpec = { + httpMethod: "GET", + baseUrl: "https://management.azure.com", + path: "{nextLink}", + urlParameters: [ + Parameters.nextPageLink + ], + headerParameters: [ + Parameters.acceptLanguage + ], + responses: { + 200: { + bodyMapper: Mappers.WebAppCollection + }, + default: { + bodyMapper: Mappers.DefaultErrorResponse + } + }, + serializer +}; + +const listBackupsSlotNextOperationSpec: msRest.OperationSpec = { + httpMethod: "GET", + baseUrl: "https://management.azure.com", + path: "{nextLink}", + urlParameters: [ + Parameters.nextPageLink + ], + headerParameters: [ + Parameters.acceptLanguage + ], + responses: { + 200: { + bodyMapper: Mappers.BackupItemCollection + }, + default: { + bodyMapper: Mappers.DefaultErrorResponse + } + }, + serializer +}; + +const listConfigurationsSlotNextOperationSpec: msRest.OperationSpec = { + httpMethod: "GET", + baseUrl: "https://management.azure.com", + path: "{nextLink}", + urlParameters: [ + Parameters.nextPageLink + ], + headerParameters: [ + Parameters.acceptLanguage + ], + responses: { + 200: { + bodyMapper: Mappers.SiteConfigResourceCollection + }, + default: { + bodyMapper: Mappers.DefaultErrorResponse + } + }, + serializer +}; + +const listConfigurationSnapshotInfoSlotNextOperationSpec: msRest.OperationSpec = { + httpMethod: "GET", + baseUrl: "https://management.azure.com", + path: "{nextLink}", + urlParameters: [ + Parameters.nextPageLink + ], + headerParameters: [ + Parameters.acceptLanguage + ], + responses: { + 200: { + bodyMapper: Mappers.SiteConfigurationSnapshotInfoCollection + }, + default: { + bodyMapper: Mappers.DefaultErrorResponse + } + }, + serializer +}; + +const listContinuousWebJobsSlotNextOperationSpec: msRest.OperationSpec = { + httpMethod: "GET", + baseUrl: "https://management.azure.com", + path: "{nextLink}", + urlParameters: [ + Parameters.nextPageLink + ], + headerParameters: [ + Parameters.acceptLanguage + ], + responses: { + 200: { + bodyMapper: Mappers.ContinuousWebJobCollection + }, + default: { + bodyMapper: Mappers.DefaultErrorResponse + } + }, + serializer +}; + +const listDeploymentsSlotNextOperationSpec: msRest.OperationSpec = { + httpMethod: "GET", + baseUrl: "https://management.azure.com", + path: "{nextLink}", + urlParameters: [ + Parameters.nextPageLink + ], + headerParameters: [ + Parameters.acceptLanguage + ], + responses: { + 200: { + bodyMapper: Mappers.DeploymentCollection + }, + default: { + bodyMapper: Mappers.DefaultErrorResponse + } + }, + serializer +}; + +const listDomainOwnershipIdentifiersSlotNextOperationSpec: msRest.OperationSpec = { + httpMethod: "GET", + baseUrl: "https://management.azure.com", + path: "{nextLink}", + urlParameters: [ + Parameters.nextPageLink + ], + headerParameters: [ + Parameters.acceptLanguage + ], + responses: { + 200: { + bodyMapper: Mappers.IdentifierCollection + }, + default: { + bodyMapper: Mappers.DefaultErrorResponse + } + }, + serializer +}; + +const listInstanceFunctionsSlotNextOperationSpec: msRest.OperationSpec = { + httpMethod: "GET", + baseUrl: "https://management.azure.com", + path: "{nextLink}", + urlParameters: [ + Parameters.nextPageLink + ], + headerParameters: [ + Parameters.acceptLanguage + ], + responses: { + 200: { + bodyMapper: Mappers.FunctionEnvelopeCollection + }, + 404: {}, + default: { + bodyMapper: Mappers.CloudError + } + }, + serializer +}; + +const listHostNameBindingsSlotNextOperationSpec: msRest.OperationSpec = { + httpMethod: "GET", + baseUrl: "https://management.azure.com", + path: "{nextLink}", + urlParameters: [ + Parameters.nextPageLink + ], + headerParameters: [ + Parameters.acceptLanguage + ], + responses: { + 200: { + bodyMapper: Mappers.HostNameBindingCollection + }, + default: { + bodyMapper: Mappers.DefaultErrorResponse + } + }, + serializer +}; + +const listInstanceIdentifiersSlotNextOperationSpec: msRest.OperationSpec = { + httpMethod: "GET", + baseUrl: "https://management.azure.com", + path: "{nextLink}", + urlParameters: [ + Parameters.nextPageLink + ], + headerParameters: [ + Parameters.acceptLanguage + ], + responses: { + 200: { + bodyMapper: Mappers.WebAppInstanceCollection + }, + default: { + bodyMapper: Mappers.DefaultErrorResponse + } + }, + serializer +}; + +const listInstanceProcessesSlotNextOperationSpec: msRest.OperationSpec = { + httpMethod: "GET", + baseUrl: "https://management.azure.com", + path: "{nextLink}", + urlParameters: [ + Parameters.nextPageLink + ], + headerParameters: [ + Parameters.acceptLanguage + ], + responses: { + 200: { + bodyMapper: Mappers.ProcessInfoCollection + }, + 404: {}, + default: { + bodyMapper: Mappers.CloudError + } + }, + serializer +}; + +const listInstanceProcessModulesSlotNextOperationSpec: msRest.OperationSpec = { + httpMethod: "GET", + baseUrl: "https://management.azure.com", + path: "{nextLink}", + urlParameters: [ + Parameters.nextPageLink + ], + headerParameters: [ + Parameters.acceptLanguage + ], + responses: { + 200: { + bodyMapper: Mappers.ProcessModuleInfoCollection + }, + 404: {}, + default: { + bodyMapper: Mappers.CloudError + } + }, + serializer +}; + +const listInstanceProcessThreadsSlotNextOperationSpec: msRest.OperationSpec = { + httpMethod: "GET", + baseUrl: "https://management.azure.com", + path: "{nextLink}", + urlParameters: [ + Parameters.nextPageLink + ], + headerParameters: [ + Parameters.acceptLanguage + ], + responses: { + 200: { + bodyMapper: Mappers.ProcessThreadInfoCollection + }, + 404: {}, + default: { + bodyMapper: Mappers.CloudError + } + }, + serializer +}; + +const listMetricDefinitionsSlotNextOperationSpec: msRest.OperationSpec = { + httpMethod: "GET", + baseUrl: "https://management.azure.com", + path: "{nextLink}", + urlParameters: [ + Parameters.nextPageLink + ], + headerParameters: [ + Parameters.acceptLanguage + ], + responses: { + 200: { + bodyMapper: Mappers.ResourceMetricDefinitionCollection + }, + default: { + bodyMapper: Mappers.DefaultErrorResponse + } + }, + serializer +}; + +const listMetricsSlotNextOperationSpec: msRest.OperationSpec = { + httpMethod: "GET", + baseUrl: "https://management.azure.com", + path: "{nextLink}", + urlParameters: [ + Parameters.nextPageLink + ], + headerParameters: [ + Parameters.acceptLanguage + ], + responses: { + 200: { + bodyMapper: Mappers.ResourceMetricCollection + }, + default: { + bodyMapper: Mappers.DefaultErrorResponse + } + }, + serializer +}; + +const listPerfMonCountersSlotNextOperationSpec: msRest.OperationSpec = { + httpMethod: "GET", + baseUrl: "https://management.azure.com", + path: "{nextLink}", + urlParameters: [ + Parameters.nextPageLink + ], + headerParameters: [ + Parameters.acceptLanguage + ], + responses: { + 200: { + bodyMapper: Mappers.PerfMonCounterCollection + }, + default: { + bodyMapper: Mappers.DefaultErrorResponse + } + }, + serializer +}; + +const listProcessesSlotNextOperationSpec: msRest.OperationSpec = { + httpMethod: "GET", + baseUrl: "https://management.azure.com", + path: "{nextLink}", + urlParameters: [ + Parameters.nextPageLink + ], + headerParameters: [ + Parameters.acceptLanguage + ], + responses: { + 200: { + bodyMapper: Mappers.ProcessInfoCollection + }, + 404: {}, + default: { + bodyMapper: Mappers.CloudError + } + }, + serializer +}; + +const listProcessModulesSlotNextOperationSpec: msRest.OperationSpec = { + httpMethod: "GET", + baseUrl: "https://management.azure.com", + path: "{nextLink}", + urlParameters: [ + Parameters.nextPageLink + ], + headerParameters: [ + Parameters.acceptLanguage + ], + responses: { + 200: { + bodyMapper: Mappers.ProcessModuleInfoCollection + }, + 404: {}, + default: { + bodyMapper: Mappers.CloudError + } + }, + serializer +}; + +const listProcessThreadsSlotNextOperationSpec: msRest.OperationSpec = { + httpMethod: "GET", + baseUrl: "https://management.azure.com", + path: "{nextLink}", + urlParameters: [ + Parameters.nextPageLink + ], + headerParameters: [ + Parameters.acceptLanguage + ], + responses: { + 200: { + bodyMapper: Mappers.ProcessThreadInfoCollection + }, + 404: {}, + default: { + bodyMapper: Mappers.CloudError + } + }, + serializer +}; + +const listPublicCertificatesSlotNextOperationSpec: msRest.OperationSpec = { + httpMethod: "GET", + baseUrl: "https://management.azure.com", + path: "{nextLink}", + urlParameters: [ + Parameters.nextPageLink + ], + headerParameters: [ + Parameters.acceptLanguage + ], + responses: { + 200: { + bodyMapper: Mappers.PublicCertificateCollection + }, + default: { + bodyMapper: Mappers.DefaultErrorResponse + } + }, + serializer +}; + +const listSiteExtensionsSlotNextOperationSpec: msRest.OperationSpec = { + httpMethod: "GET", + baseUrl: "https://management.azure.com", + path: "{nextLink}", + urlParameters: [ + Parameters.nextPageLink + ], + headerParameters: [ + Parameters.acceptLanguage + ], + responses: { + 200: { + bodyMapper: Mappers.SiteExtensionInfoCollection + }, + 404: {}, + default: { + bodyMapper: Mappers.CloudError + } + }, + serializer +}; + +const listSlotDifferencesSlotNextOperationSpec: msRest.OperationSpec = { + httpMethod: "POST", + baseUrl: "https://management.azure.com", + path: "{nextLink}", + urlParameters: [ + Parameters.nextPageLink + ], + headerParameters: [ + Parameters.acceptLanguage + ], + responses: { + 200: { + bodyMapper: Mappers.SlotDifferenceCollection + }, + default: { + bodyMapper: Mappers.DefaultErrorResponse + } + }, + serializer +}; + +const listSnapshotsSlotNextOperationSpec: msRest.OperationSpec = { + httpMethod: "GET", + baseUrl: "https://management.azure.com", + path: "{nextLink}", + urlParameters: [ + Parameters.nextPageLink + ], + headerParameters: [ + Parameters.acceptLanguage + ], + responses: { + 200: { + bodyMapper: Mappers.SnapshotCollection + }, + default: { + bodyMapper: Mappers.DefaultErrorResponse + } + }, + serializer +}; + +const listSnapshotsFromDRSecondarySlotNextOperationSpec: msRest.OperationSpec = { + httpMethod: "GET", + baseUrl: "https://management.azure.com", + path: "{nextLink}", + urlParameters: [ + Parameters.nextPageLink + ], + headerParameters: [ + Parameters.acceptLanguage + ], + responses: { + 200: { + bodyMapper: Mappers.SnapshotCollection + }, + default: { + bodyMapper: Mappers.DefaultErrorResponse + } + }, + serializer +}; + +const listTriggeredWebJobsSlotNextOperationSpec: msRest.OperationSpec = { + httpMethod: "GET", + baseUrl: "https://management.azure.com", + path: "{nextLink}", + urlParameters: [ + Parameters.nextPageLink + ], + headerParameters: [ + Parameters.acceptLanguage + ], + responses: { + 200: { + bodyMapper: Mappers.TriggeredWebJobCollection + }, + default: { + bodyMapper: Mappers.DefaultErrorResponse + } + }, + serializer +}; + +const listTriggeredWebJobHistorySlotNextOperationSpec: msRest.OperationSpec = { + httpMethod: "GET", + baseUrl: "https://management.azure.com", + path: "{nextLink}", + urlParameters: [ + Parameters.nextPageLink + ], + headerParameters: [ + Parameters.acceptLanguage + ], + responses: { + 200: { + bodyMapper: Mappers.TriggeredJobHistoryCollection + }, + 404: {}, + default: { + bodyMapper: Mappers.CloudError + } + }, + serializer +}; + +const listUsagesSlotNextOperationSpec: msRest.OperationSpec = { + httpMethod: "GET", + baseUrl: "https://management.azure.com", + path: "{nextLink}", + urlParameters: [ + Parameters.nextPageLink + ], + headerParameters: [ + Parameters.acceptLanguage + ], + responses: { + 200: { + bodyMapper: Mappers.CsmUsageQuotaCollection + }, + default: { + bodyMapper: Mappers.DefaultErrorResponse + } + }, + serializer +}; + +const listWebJobsSlotNextOperationSpec: msRest.OperationSpec = { + httpMethod: "GET", + baseUrl: "https://management.azure.com", + path: "{nextLink}", + urlParameters: [ + Parameters.nextPageLink + ], + headerParameters: [ + Parameters.acceptLanguage + ], + responses: { + 200: { + bodyMapper: Mappers.WebJobCollection + }, + default: { + bodyMapper: Mappers.DefaultErrorResponse + } + }, + serializer +}; + +const listSlotDifferencesFromProductionNextOperationSpec: msRest.OperationSpec = { + httpMethod: "POST", + baseUrl: "https://management.azure.com", + path: "{nextLink}", + urlParameters: [ + Parameters.nextPageLink + ], + headerParameters: [ + Parameters.acceptLanguage + ], + responses: { + 200: { + bodyMapper: Mappers.SlotDifferenceCollection + }, + default: { + bodyMapper: Mappers.DefaultErrorResponse + } + }, + serializer +}; + +const listSnapshotsNextOperationSpec: msRest.OperationSpec = { + httpMethod: "GET", + baseUrl: "https://management.azure.com", + path: "{nextLink}", + urlParameters: [ + Parameters.nextPageLink + ], + headerParameters: [ + Parameters.acceptLanguage + ], + responses: { + 200: { + bodyMapper: Mappers.SnapshotCollection + }, + default: { + bodyMapper: Mappers.DefaultErrorResponse + } + }, + serializer +}; + +const listSnapshotsFromDRSecondaryNextOperationSpec: msRest.OperationSpec = { + httpMethod: "GET", + baseUrl: "https://management.azure.com", + path: "{nextLink}", + urlParameters: [ + Parameters.nextPageLink + ], + headerParameters: [ + Parameters.acceptLanguage + ], + responses: { + 200: { + bodyMapper: Mappers.SnapshotCollection + }, + default: { + bodyMapper: Mappers.DefaultErrorResponse + } + }, + serializer +}; + +const listTriggeredWebJobsNextOperationSpec: msRest.OperationSpec = { + httpMethod: "GET", + baseUrl: "https://management.azure.com", + path: "{nextLink}", + urlParameters: [ + Parameters.nextPageLink + ], + headerParameters: [ + Parameters.acceptLanguage + ], + responses: { + 200: { + bodyMapper: Mappers.TriggeredWebJobCollection + }, + default: { + bodyMapper: Mappers.DefaultErrorResponse + } + }, + serializer +}; + +const listTriggeredWebJobHistoryNextOperationSpec: msRest.OperationSpec = { + httpMethod: "GET", + baseUrl: "https://management.azure.com", + path: "{nextLink}", + urlParameters: [ + Parameters.nextPageLink + ], + headerParameters: [ + Parameters.acceptLanguage + ], + responses: { + 200: { + bodyMapper: Mappers.TriggeredJobHistoryCollection + }, + 404: {}, + default: { + bodyMapper: Mappers.CloudError + } + }, + serializer +}; + +const listUsagesNextOperationSpec: msRest.OperationSpec = { + httpMethod: "GET", + baseUrl: "https://management.azure.com", + path: "{nextLink}", + urlParameters: [ + Parameters.nextPageLink + ], + headerParameters: [ + Parameters.acceptLanguage + ], + responses: { + 200: { + bodyMapper: Mappers.CsmUsageQuotaCollection + }, + default: { + bodyMapper: Mappers.DefaultErrorResponse + } + }, + serializer +}; + +const listWebJobsNextOperationSpec: msRest.OperationSpec = { + httpMethod: "GET", + baseUrl: "https://management.azure.com", + path: "{nextLink}", + urlParameters: [ + Parameters.nextPageLink + ], + headerParameters: [ + Parameters.acceptLanguage + ], + responses: { + 200: { + bodyMapper: Mappers.WebJobCollection + }, + default: { + bodyMapper: Mappers.DefaultErrorResponse + } + }, + serializer +}; diff --git a/sdk/appservice/arm-appservice-profile-2019-03-01-hybrid/src/webSiteManagementClient.ts b/sdk/appservice/arm-appservice-profile-2019-03-01-hybrid/src/webSiteManagementClient.ts new file mode 100644 index 000000000000..0d35a9177b82 --- /dev/null +++ b/sdk/appservice/arm-appservice-profile-2019-03-01-hybrid/src/webSiteManagementClient.ts @@ -0,0 +1,1263 @@ +/* + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * 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 * as msRest from "@azure/ms-rest-js"; +import * as Models from "./models"; +import * as Mappers from "./models/mappers"; +import * as Parameters from "./models/parameters"; +import * as operations from "./operations"; +import { WebSiteManagementClientContext } from "./webSiteManagementClientContext"; + + +class WebSiteManagementClient extends WebSiteManagementClientContext { + // Operation groups + certificates: operations.Certificates; + webApps: operations.WebApps; + appServicePlans: operations.AppServicePlans; + provider: operations.Provider; + recommendations: operations.Recommendations; + + /** + * Initializes a new instance of the WebSiteManagementClient class. + * @param credentials Credentials needed for the client to connect to Azure. + * @param subscriptionId Your Azure subscription ID. This is a GUID-formatted string (e.g. + * 00000000-0000-0000-0000-000000000000). + * @param [options] The parameter options + */ + constructor(credentials: msRest.ServiceClientCredentials, subscriptionId: string, options?: Models.WebSiteManagementClientOptions) { + super(credentials, subscriptionId, options); + this.certificates = new operations.Certificates(this); + this.webApps = new operations.WebApps(this); + this.appServicePlans = new operations.AppServicePlans(this); + this.provider = new operations.Provider(this); + this.recommendations = new operations.Recommendations(this); + } + + /** + * Gets publishing user + * @summary Gets publishing user + * @param [options] The optional parameters + * @returns Promise + */ + getPublishingUser(options?: msRest.RequestOptionsBase): Promise; + /** + * @param callback The callback + */ + getPublishingUser(callback: msRest.ServiceCallback): void; + /** + * @param options The optional parameters + * @param callback The callback + */ + getPublishingUser(options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; + getPublishingUser(options?: msRest.RequestOptionsBase | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { + return this.sendOperationRequest( + { + options + }, + getPublishingUserOperationSpec, + callback) as Promise; + } + + /** + * Updates publishing user + * @summary Updates publishing user + * @param userDetails Details of publishing user + * @param [options] The optional parameters + * @returns Promise + */ + updatePublishingUser(userDetails: Models.User, options?: msRest.RequestOptionsBase): Promise; + /** + * @param userDetails Details of publishing user + * @param callback The callback + */ + updatePublishingUser(userDetails: Models.User, callback: msRest.ServiceCallback): void; + /** + * @param userDetails Details of publishing user + * @param options The optional parameters + * @param callback The callback + */ + updatePublishingUser(userDetails: Models.User, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; + updatePublishingUser(userDetails: Models.User, options?: msRest.RequestOptionsBase | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { + return this.sendOperationRequest( + { + userDetails, + options + }, + updatePublishingUserOperationSpec, + callback) as Promise; + } + + /** + * Gets the source controls available for Azure websites. + * @summary Gets the source controls available for Azure websites. + * @param [options] The optional parameters + * @returns Promise + */ + listSourceControls(options?: msRest.RequestOptionsBase): Promise; + /** + * @param callback The callback + */ + listSourceControls(callback: msRest.ServiceCallback): void; + /** + * @param options The optional parameters + * @param callback The callback + */ + listSourceControls(options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; + listSourceControls(options?: msRest.RequestOptionsBase | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { + return this.sendOperationRequest( + { + options + }, + listSourceControlsOperationSpec, + callback) as Promise; + } + + /** + * Gets source control token + * @summary Gets source control token + * @param sourceControlType Type of source control + * @param [options] The optional parameters + * @returns Promise + */ + getSourceControl(sourceControlType: string, options?: msRest.RequestOptionsBase): Promise; + /** + * @param sourceControlType Type of source control + * @param callback The callback + */ + getSourceControl(sourceControlType: string, callback: msRest.ServiceCallback): void; + /** + * @param sourceControlType Type of source control + * @param options The optional parameters + * @param callback The callback + */ + getSourceControl(sourceControlType: string, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; + getSourceControl(sourceControlType: string, options?: msRest.RequestOptionsBase | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { + return this.sendOperationRequest( + { + sourceControlType, + options + }, + getSourceControlOperationSpec, + callback) as Promise; + } + + /** + * Updates source control token + * @summary Updates source control token + * @param sourceControlType Type of source control + * @param requestMessage Source control token information + * @param [options] The optional parameters + * @returns Promise + */ + updateSourceControl(sourceControlType: string, requestMessage: Models.SourceControl, options?: msRest.RequestOptionsBase): Promise; + /** + * @param sourceControlType Type of source control + * @param requestMessage Source control token information + * @param callback The callback + */ + updateSourceControl(sourceControlType: string, requestMessage: Models.SourceControl, callback: msRest.ServiceCallback): void; + /** + * @param sourceControlType Type of source control + * @param requestMessage Source control token information + * @param options The optional parameters + * @param callback The callback + */ + updateSourceControl(sourceControlType: string, requestMessage: Models.SourceControl, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; + updateSourceControl(sourceControlType: string, requestMessage: Models.SourceControl, options?: msRest.RequestOptionsBase | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { + return this.sendOperationRequest( + { + sourceControlType, + requestMessage, + options + }, + updateSourceControlOperationSpec, + callback) as Promise; + } + + /** + * Gets a list of meters for a given location. + * @summary Gets a list of meters for a given location. + * @param [options] The optional parameters + * @returns Promise + */ + listBillingMeters(options?: Models.WebSiteManagementClientListBillingMetersOptionalParams): Promise; + /** + * @param callback The callback + */ + listBillingMeters(callback: msRest.ServiceCallback): void; + /** + * @param options The optional parameters + * @param callback The callback + */ + listBillingMeters(options: Models.WebSiteManagementClientListBillingMetersOptionalParams, callback: msRest.ServiceCallback): void; + listBillingMeters(options?: Models.WebSiteManagementClientListBillingMetersOptionalParams | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { + return this.sendOperationRequest( + { + options + }, + listBillingMetersOperationSpec, + callback) as Promise; + } + + /** + * Check if a resource name is available. + * @summary Check if a resource name is available. + * @param name Resource name to verify. + * @param 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 [options] The optional parameters + * @returns Promise + */ + checkNameAvailability(name: string, type: Models.CheckNameResourceTypes, options?: Models.WebSiteManagementClientCheckNameAvailabilityOptionalParams): Promise; + /** + * @param name Resource name to verify. + * @param 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 callback The callback + */ + checkNameAvailability(name: string, type: Models.CheckNameResourceTypes, callback: msRest.ServiceCallback): void; + /** + * @param name Resource name to verify. + * @param 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 options The optional parameters + * @param callback The callback + */ + checkNameAvailability(name: string, type: Models.CheckNameResourceTypes, options: Models.WebSiteManagementClientCheckNameAvailabilityOptionalParams, callback: msRest.ServiceCallback): void; + checkNameAvailability(name: string, type: Models.CheckNameResourceTypes, options?: Models.WebSiteManagementClientCheckNameAvailabilityOptionalParams | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { + return this.sendOperationRequest( + { + name, + type, + options + }, + checkNameAvailabilityOperationSpec, + callback) as Promise; + } + + /** + * Gets list of available geo regions plus ministamps + * @summary Gets list of available geo regions plus ministamps + * @param [options] The optional parameters + * @returns Promise + */ + getSubscriptionDeploymentLocations(options?: msRest.RequestOptionsBase): Promise; + /** + * @param callback The callback + */ + getSubscriptionDeploymentLocations(callback: msRest.ServiceCallback): void; + /** + * @param options The optional parameters + * @param callback The callback + */ + getSubscriptionDeploymentLocations(options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; + getSubscriptionDeploymentLocations(options?: msRest.RequestOptionsBase | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { + return this.sendOperationRequest( + { + options + }, + getSubscriptionDeploymentLocationsOperationSpec, + callback) as Promise; + } + + /** + * Get a list of available geographical regions. + * @summary Get a list of available geographical regions. + * @param [options] The optional parameters + * @returns Promise + */ + listGeoRegions(options?: Models.WebSiteManagementClientListGeoRegionsOptionalParams): Promise; + /** + * @param callback The callback + */ + listGeoRegions(callback: msRest.ServiceCallback): void; + /** + * @param options The optional parameters + * @param callback The callback + */ + listGeoRegions(options: Models.WebSiteManagementClientListGeoRegionsOptionalParams, callback: msRest.ServiceCallback): void; + listGeoRegions(options?: Models.WebSiteManagementClientListGeoRegionsOptionalParams | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { + return this.sendOperationRequest( + { + options + }, + listGeoRegionsOperationSpec, + callback) as Promise; + } + + /** + * List all apps that are assigned to a hostname. + * @summary List all apps that are assigned to a hostname. + * @param [options] The optional parameters + * @returns Promise + */ + listSiteIdentifiersAssignedToHostName(options?: Models.WebSiteManagementClientListSiteIdentifiersAssignedToHostNameOptionalParams): Promise; + /** + * @param callback The callback + */ + listSiteIdentifiersAssignedToHostName(callback: msRest.ServiceCallback): void; + /** + * @param options The optional parameters + * @param callback The callback + */ + listSiteIdentifiersAssignedToHostName(options: Models.WebSiteManagementClientListSiteIdentifiersAssignedToHostNameOptionalParams, callback: msRest.ServiceCallback): void; + listSiteIdentifiersAssignedToHostName(options?: Models.WebSiteManagementClientListSiteIdentifiersAssignedToHostNameOptionalParams | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { + return this.sendOperationRequest( + { + options + }, + listSiteIdentifiersAssignedToHostNameOperationSpec, + callback) as Promise; + } + + /** + * List all premier add-on offers. + * @summary List all premier add-on offers. + * @param [options] The optional parameters + * @returns Promise + */ + listPremierAddOnOffers(options?: msRest.RequestOptionsBase): Promise; + /** + * @param callback The callback + */ + listPremierAddOnOffers(callback: msRest.ServiceCallback): void; + /** + * @param options The optional parameters + * @param callback The callback + */ + listPremierAddOnOffers(options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; + listPremierAddOnOffers(options?: msRest.RequestOptionsBase | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { + return this.sendOperationRequest( + { + options + }, + listPremierAddOnOffersOperationSpec, + callback) as Promise; + } + + /** + * List all SKUs. + * @summary List all SKUs. + * @param [options] The optional parameters + * @returns Promise + */ + listSkus(options?: msRest.RequestOptionsBase): Promise; + /** + * @param callback The callback + */ + listSkus(callback: msRest.ServiceCallback): void; + /** + * @param options The optional parameters + * @param callback The callback + */ + listSkus(options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; + listSkus(options?: msRest.RequestOptionsBase | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { + return this.sendOperationRequest( + { + options + }, + listSkusOperationSpec, + callback) as Promise; + } + + /** + * Verifies if this VNET is compatible with an App Service Environment by analyzing the Network + * Security Group rules. + * @summary Verifies if this VNET is compatible with an App Service Environment by analyzing the + * Network Security Group rules. + * @param parameters VNET information + * @param [options] The optional parameters + * @returns Promise + */ + verifyHostingEnvironmentVnet(parameters: Models.VnetParameters, options?: msRest.RequestOptionsBase): Promise; + /** + * @param parameters VNET information + * @param callback The callback + */ + verifyHostingEnvironmentVnet(parameters: Models.VnetParameters, callback: msRest.ServiceCallback): void; + /** + * @param parameters VNET information + * @param options The optional parameters + * @param callback The callback + */ + verifyHostingEnvironmentVnet(parameters: Models.VnetParameters, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; + verifyHostingEnvironmentVnet(parameters: Models.VnetParameters, options?: msRest.RequestOptionsBase | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { + return this.sendOperationRequest( + { + parameters, + options + }, + verifyHostingEnvironmentVnetOperationSpec, + callback) as Promise; + } + + /** + * Move resources between resource groups. + * @summary Move resources between resource groups. + * @param resourceGroupName Name of the resource group to which the resource belongs. + * @param moveResourceEnvelope Object that represents the resource to move. + * @param [options] The optional parameters + * @returns Promise + */ + move(resourceGroupName: string, moveResourceEnvelope: Models.CsmMoveResourceEnvelope, options?: msRest.RequestOptionsBase): Promise; + /** + * @param resourceGroupName Name of the resource group to which the resource belongs. + * @param moveResourceEnvelope Object that represents the resource to move. + * @param callback The callback + */ + move(resourceGroupName: string, moveResourceEnvelope: Models.CsmMoveResourceEnvelope, callback: msRest.ServiceCallback): void; + /** + * @param resourceGroupName Name of the resource group to which the resource belongs. + * @param moveResourceEnvelope Object that represents the resource to move. + * @param options The optional parameters + * @param callback The callback + */ + move(resourceGroupName: string, moveResourceEnvelope: Models.CsmMoveResourceEnvelope, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; + move(resourceGroupName: string, moveResourceEnvelope: Models.CsmMoveResourceEnvelope, options?: msRest.RequestOptionsBase | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { + return this.sendOperationRequest( + { + resourceGroupName, + moveResourceEnvelope, + options + }, + moveOperationSpec, + callback); + } + + /** + * Validate if a resource can be created. + * @summary Validate if a resource can be created. + * @param resourceGroupName Name of the resource group to which the resource belongs. + * @param validateRequest Request with the resources to validate. + * @param [options] The optional parameters + * @returns Promise + */ + validate(resourceGroupName: string, validateRequest: Models.ValidateRequest, options?: msRest.RequestOptionsBase): Promise; + /** + * @param resourceGroupName Name of the resource group to which the resource belongs. + * @param validateRequest Request with the resources to validate. + * @param callback The callback + */ + validate(resourceGroupName: string, validateRequest: Models.ValidateRequest, callback: msRest.ServiceCallback): void; + /** + * @param resourceGroupName Name of the resource group to which the resource belongs. + * @param validateRequest Request with the resources to validate. + * @param options The optional parameters + * @param callback The callback + */ + validate(resourceGroupName: string, validateRequest: Models.ValidateRequest, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; + validate(resourceGroupName: string, validateRequest: Models.ValidateRequest, options?: msRest.RequestOptionsBase | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { + return this.sendOperationRequest( + { + resourceGroupName, + validateRequest, + options + }, + validateOperationSpec, + callback) as Promise; + } + + /** + * Validate if the container settings are correct. + * @summary Validate if the container settings are correct. + * @param validateContainerSettingsRequest + * @param resourceGroupName Name of the resource group to which the resource belongs. + * @param [options] The optional parameters + * @returns Promise + */ + validateContainerSettings(validateContainerSettingsRequest: Models.ValidateContainerSettingsRequest, resourceGroupName: string, options?: msRest.RequestOptionsBase): Promise; + /** + * @param validateContainerSettingsRequest + * @param resourceGroupName Name of the resource group to which the resource belongs. + * @param callback The callback + */ + validateContainerSettings(validateContainerSettingsRequest: Models.ValidateContainerSettingsRequest, resourceGroupName: string, callback: msRest.ServiceCallback): void; + /** + * @param validateContainerSettingsRequest + * @param resourceGroupName Name of the resource group to which the resource belongs. + * @param options The optional parameters + * @param callback The callback + */ + validateContainerSettings(validateContainerSettingsRequest: Models.ValidateContainerSettingsRequest, resourceGroupName: string, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; + validateContainerSettings(validateContainerSettingsRequest: Models.ValidateContainerSettingsRequest, resourceGroupName: string, options?: msRest.RequestOptionsBase | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { + return this.sendOperationRequest( + { + validateContainerSettingsRequest, + resourceGroupName, + options + }, + validateContainerSettingsOperationSpec, + callback) as Promise; + } + + /** + * Validate whether a resource can be moved. + * @summary Validate whether a resource can be moved. + * @param resourceGroupName Name of the resource group to which the resource belongs. + * @param moveResourceEnvelope Object that represents the resource to move. + * @param [options] The optional parameters + * @returns Promise + */ + validateMove(resourceGroupName: string, moveResourceEnvelope: Models.CsmMoveResourceEnvelope, options?: msRest.RequestOptionsBase): Promise; + /** + * @param resourceGroupName Name of the resource group to which the resource belongs. + * @param moveResourceEnvelope Object that represents the resource to move. + * @param callback The callback + */ + validateMove(resourceGroupName: string, moveResourceEnvelope: Models.CsmMoveResourceEnvelope, callback: msRest.ServiceCallback): void; + /** + * @param resourceGroupName Name of the resource group to which the resource belongs. + * @param moveResourceEnvelope Object that represents the resource to move. + * @param options The optional parameters + * @param callback The callback + */ + validateMove(resourceGroupName: string, moveResourceEnvelope: Models.CsmMoveResourceEnvelope, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; + validateMove(resourceGroupName: string, moveResourceEnvelope: Models.CsmMoveResourceEnvelope, options?: msRest.RequestOptionsBase | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { + return this.sendOperationRequest( + { + resourceGroupName, + moveResourceEnvelope, + options + }, + validateMoveOperationSpec, + callback); + } + + /** + * Gets the source controls available for Azure websites. + * @summary Gets the source controls available for Azure websites. + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @param [options] The optional parameters + * @returns Promise + */ + listSourceControlsNext(nextPageLink: string, options?: msRest.RequestOptionsBase): Promise; + /** + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @param callback The callback + */ + listSourceControlsNext(nextPageLink: string, callback: msRest.ServiceCallback): void; + /** + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @param options The optional parameters + * @param callback The callback + */ + listSourceControlsNext(nextPageLink: string, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; + listSourceControlsNext(nextPageLink: string, options?: msRest.RequestOptionsBase | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { + return this.sendOperationRequest( + { + nextPageLink, + options + }, + listSourceControlsNextOperationSpec, + callback) as Promise; + } + + /** + * Gets a list of meters for a given location. + * @summary Gets a list of meters for a given location. + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @param [options] The optional parameters + * @returns Promise + */ + listBillingMetersNext(nextPageLink: string, options?: msRest.RequestOptionsBase): Promise; + /** + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @param callback The callback + */ + listBillingMetersNext(nextPageLink: string, callback: msRest.ServiceCallback): void; + /** + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @param options The optional parameters + * @param callback The callback + */ + listBillingMetersNext(nextPageLink: string, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; + listBillingMetersNext(nextPageLink: string, options?: msRest.RequestOptionsBase | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { + return this.sendOperationRequest( + { + nextPageLink, + options + }, + listBillingMetersNextOperationSpec, + callback) as Promise; + } + + /** + * Get a list of available geographical regions. + * @summary Get a list of available geographical regions. + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @param [options] The optional parameters + * @returns Promise + */ + listGeoRegionsNext(nextPageLink: string, options?: msRest.RequestOptionsBase): Promise; + /** + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @param callback The callback + */ + listGeoRegionsNext(nextPageLink: string, callback: msRest.ServiceCallback): void; + /** + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @param options The optional parameters + * @param callback The callback + */ + listGeoRegionsNext(nextPageLink: string, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; + listGeoRegionsNext(nextPageLink: string, options?: msRest.RequestOptionsBase | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { + return this.sendOperationRequest( + { + nextPageLink, + options + }, + listGeoRegionsNextOperationSpec, + callback) as Promise; + } + + /** + * List all apps that are assigned to a hostname. + * @summary List all apps that are assigned to a hostname. + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @param [options] The optional parameters + * @returns Promise + */ + listSiteIdentifiersAssignedToHostNameNext(nextPageLink: string, options?: msRest.RequestOptionsBase): Promise; + /** + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @param callback The callback + */ + listSiteIdentifiersAssignedToHostNameNext(nextPageLink: string, callback: msRest.ServiceCallback): void; + /** + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @param options The optional parameters + * @param callback The callback + */ + listSiteIdentifiersAssignedToHostNameNext(nextPageLink: string, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; + listSiteIdentifiersAssignedToHostNameNext(nextPageLink: string, options?: msRest.RequestOptionsBase | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { + return this.sendOperationRequest( + { + nextPageLink, + options + }, + listSiteIdentifiersAssignedToHostNameNextOperationSpec, + callback) as Promise; + } + + /** + * List all premier add-on offers. + * @summary List all premier add-on offers. + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @param [options] The optional parameters + * @returns Promise + */ + listPremierAddOnOffersNext(nextPageLink: string, options?: msRest.RequestOptionsBase): Promise; + /** + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @param callback The callback + */ + listPremierAddOnOffersNext(nextPageLink: string, callback: msRest.ServiceCallback): void; + /** + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @param options The optional parameters + * @param callback The callback + */ + listPremierAddOnOffersNext(nextPageLink: string, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; + listPremierAddOnOffersNext(nextPageLink: string, options?: msRest.RequestOptionsBase | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { + return this.sendOperationRequest( + { + nextPageLink, + options + }, + listPremierAddOnOffersNextOperationSpec, + callback) as Promise; + } +} + +// Operation Specifications +const serializer = new msRest.Serializer(Mappers); +const getPublishingUserOperationSpec: msRest.OperationSpec = { + httpMethod: "GET", + path: "providers/Microsoft.Web/publishingUsers/web", + queryParameters: [ + Parameters.apiVersion + ], + headerParameters: [ + Parameters.acceptLanguage + ], + responses: { + 200: { + bodyMapper: Mappers.User + }, + default: { + bodyMapper: Mappers.DefaultErrorResponse + } + }, + serializer +}; + +const updatePublishingUserOperationSpec: msRest.OperationSpec = { + httpMethod: "PUT", + path: "providers/Microsoft.Web/publishingUsers/web", + queryParameters: [ + Parameters.apiVersion + ], + headerParameters: [ + Parameters.acceptLanguage + ], + requestBody: { + parameterPath: "userDetails", + mapper: { + ...Mappers.User, + required: true + } + }, + responses: { + 200: { + bodyMapper: Mappers.User + }, + default: { + bodyMapper: Mappers.DefaultErrorResponse + } + }, + serializer +}; + +const listSourceControlsOperationSpec: msRest.OperationSpec = { + httpMethod: "GET", + path: "providers/Microsoft.Web/sourcecontrols", + queryParameters: [ + Parameters.apiVersion + ], + headerParameters: [ + Parameters.acceptLanguage + ], + responses: { + 200: { + bodyMapper: Mappers.SourceControlCollection + }, + default: { + bodyMapper: Mappers.DefaultErrorResponse + } + }, + serializer +}; + +const getSourceControlOperationSpec: msRest.OperationSpec = { + httpMethod: "GET", + path: "providers/Microsoft.Web/sourcecontrols/{sourceControlType}", + urlParameters: [ + Parameters.sourceControlType + ], + queryParameters: [ + Parameters.apiVersion + ], + headerParameters: [ + Parameters.acceptLanguage + ], + responses: { + 200: { + bodyMapper: Mappers.SourceControl + }, + default: { + bodyMapper: Mappers.DefaultErrorResponse + } + }, + serializer +}; + +const updateSourceControlOperationSpec: msRest.OperationSpec = { + httpMethod: "PUT", + path: "providers/Microsoft.Web/sourcecontrols/{sourceControlType}", + urlParameters: [ + Parameters.sourceControlType + ], + queryParameters: [ + Parameters.apiVersion + ], + headerParameters: [ + Parameters.acceptLanguage + ], + requestBody: { + parameterPath: "requestMessage", + mapper: { + ...Mappers.SourceControl, + required: true + } + }, + responses: { + 200: { + bodyMapper: Mappers.SourceControl + }, + default: { + bodyMapper: Mappers.DefaultErrorResponse + } + }, + serializer +}; + +const listBillingMetersOperationSpec: msRest.OperationSpec = { + httpMethod: "GET", + path: "subscriptions/{subscriptionId}/providers/Microsoft.Web/billingMeters", + urlParameters: [ + Parameters.subscriptionId + ], + queryParameters: [ + Parameters.billingLocation, + Parameters.osType, + Parameters.apiVersion + ], + headerParameters: [ + Parameters.acceptLanguage + ], + responses: { + 200: { + bodyMapper: Mappers.BillingMeterCollection + }, + default: { + bodyMapper: Mappers.DefaultErrorResponse + } + }, + serializer +}; + +const checkNameAvailabilityOperationSpec: msRest.OperationSpec = { + httpMethod: "POST", + path: "subscriptions/{subscriptionId}/providers/Microsoft.Web/checknameavailability", + urlParameters: [ + Parameters.subscriptionId + ], + queryParameters: [ + Parameters.apiVersion + ], + headerParameters: [ + Parameters.acceptLanguage + ], + requestBody: { + parameterPath: { + name: "name", + type: "type", + isFqdn: [ + "options", + "isFqdn" + ] + }, + mapper: { + ...Mappers.ResourceNameAvailabilityRequest, + required: true + } + }, + responses: { + 200: { + bodyMapper: Mappers.ResourceNameAvailability + }, + default: { + bodyMapper: Mappers.DefaultErrorResponse + } + }, + serializer +}; + +const getSubscriptionDeploymentLocationsOperationSpec: msRest.OperationSpec = { + httpMethod: "GET", + path: "subscriptions/{subscriptionId}/providers/Microsoft.Web/deploymentLocations", + urlParameters: [ + Parameters.subscriptionId + ], + queryParameters: [ + Parameters.apiVersion + ], + headerParameters: [ + Parameters.acceptLanguage + ], + responses: { + 200: { + bodyMapper: Mappers.DeploymentLocations + }, + default: { + bodyMapper: Mappers.DefaultErrorResponse + } + }, + serializer +}; + +const listGeoRegionsOperationSpec: msRest.OperationSpec = { + httpMethod: "GET", + path: "subscriptions/{subscriptionId}/providers/Microsoft.Web/geoRegions", + urlParameters: [ + Parameters.subscriptionId + ], + queryParameters: [ + Parameters.sku, + Parameters.linuxWorkersEnabled, + Parameters.xenonWorkersEnabled, + Parameters.linuxDynamicWorkersEnabled, + Parameters.apiVersion + ], + headerParameters: [ + Parameters.acceptLanguage + ], + responses: { + 200: { + bodyMapper: Mappers.GeoRegionCollection + }, + default: { + bodyMapper: Mappers.DefaultErrorResponse + } + }, + serializer +}; + +const listSiteIdentifiersAssignedToHostNameOperationSpec: msRest.OperationSpec = { + httpMethod: "POST", + path: "subscriptions/{subscriptionId}/providers/Microsoft.Web/listSitesAssignedToHostName", + urlParameters: [ + Parameters.subscriptionId + ], + queryParameters: [ + Parameters.apiVersion + ], + headerParameters: [ + Parameters.acceptLanguage + ], + requestBody: { + parameterPath: { + name: [ + "options", + "name" + ] + }, + mapper: { + ...Mappers.NameIdentifier, + required: true + } + }, + responses: { + 200: { + bodyMapper: Mappers.IdentifierCollection + }, + default: { + bodyMapper: Mappers.DefaultErrorResponse + } + }, + serializer +}; + +const listPremierAddOnOffersOperationSpec: msRest.OperationSpec = { + httpMethod: "GET", + path: "subscriptions/{subscriptionId}/providers/Microsoft.Web/premieraddonoffers", + urlParameters: [ + Parameters.subscriptionId + ], + queryParameters: [ + Parameters.apiVersion + ], + headerParameters: [ + Parameters.acceptLanguage + ], + responses: { + 200: { + bodyMapper: Mappers.PremierAddOnOfferCollection + }, + default: { + bodyMapper: Mappers.DefaultErrorResponse + } + }, + serializer +}; + +const listSkusOperationSpec: msRest.OperationSpec = { + httpMethod: "GET", + path: "subscriptions/{subscriptionId}/providers/Microsoft.Web/skus", + urlParameters: [ + Parameters.subscriptionId + ], + queryParameters: [ + Parameters.apiVersion + ], + headerParameters: [ + Parameters.acceptLanguage + ], + responses: { + 200: { + bodyMapper: Mappers.SkuInfos + }, + default: { + bodyMapper: Mappers.DefaultErrorResponse + } + }, + serializer +}; + +const verifyHostingEnvironmentVnetOperationSpec: msRest.OperationSpec = { + httpMethod: "POST", + path: "subscriptions/{subscriptionId}/providers/Microsoft.Web/verifyHostingEnvironmentVnet", + urlParameters: [ + Parameters.subscriptionId + ], + queryParameters: [ + Parameters.apiVersion + ], + headerParameters: [ + Parameters.acceptLanguage + ], + requestBody: { + parameterPath: "parameters", + mapper: { + ...Mappers.VnetParameters, + required: true + } + }, + responses: { + 200: { + bodyMapper: Mappers.VnetValidationFailureDetails + }, + default: { + bodyMapper: Mappers.DefaultErrorResponse + } + }, + serializer +}; + +const moveOperationSpec: msRest.OperationSpec = { + httpMethod: "POST", + path: "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/moveResources", + urlParameters: [ + Parameters.resourceGroupName, + Parameters.subscriptionId + ], + queryParameters: [ + Parameters.apiVersion + ], + headerParameters: [ + Parameters.acceptLanguage + ], + requestBody: { + parameterPath: "moveResourceEnvelope", + mapper: { + ...Mappers.CsmMoveResourceEnvelope, + required: true + } + }, + responses: { + 204: {}, + default: { + bodyMapper: Mappers.CloudError + } + }, + serializer +}; + +const validateOperationSpec: msRest.OperationSpec = { + httpMethod: "POST", + path: "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/validate", + urlParameters: [ + Parameters.resourceGroupName, + Parameters.subscriptionId + ], + queryParameters: [ + Parameters.apiVersion + ], + headerParameters: [ + Parameters.acceptLanguage + ], + requestBody: { + parameterPath: "validateRequest", + mapper: { + ...Mappers.ValidateRequest, + required: true + } + }, + responses: { + 200: { + bodyMapper: Mappers.ValidateResponse + }, + default: { + bodyMapper: Mappers.DefaultErrorResponse + } + }, + serializer +}; + +const validateContainerSettingsOperationSpec: msRest.OperationSpec = { + httpMethod: "POST", + path: "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/validateContainerSettings", + urlParameters: [ + Parameters.resourceGroupName, + Parameters.subscriptionId + ], + queryParameters: [ + Parameters.apiVersion + ], + headerParameters: [ + Parameters.acceptLanguage + ], + requestBody: { + parameterPath: "validateContainerSettingsRequest", + mapper: { + ...Mappers.ValidateContainerSettingsRequest, + required: true + } + }, + responses: { + 200: { + bodyMapper: { + serializedName: "parsedResponse", + type: { + name: "Object" + } + } + }, + default: { + bodyMapper: Mappers.DefaultErrorResponse + } + }, + serializer +}; + +const validateMoveOperationSpec: msRest.OperationSpec = { + httpMethod: "POST", + path: "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/validateMoveResources", + urlParameters: [ + Parameters.resourceGroupName, + Parameters.subscriptionId + ], + queryParameters: [ + Parameters.apiVersion + ], + headerParameters: [ + Parameters.acceptLanguage + ], + requestBody: { + parameterPath: "moveResourceEnvelope", + mapper: { + ...Mappers.CsmMoveResourceEnvelope, + required: true + } + }, + responses: { + 204: {}, + default: { + bodyMapper: Mappers.CloudError + } + }, + serializer +}; + +const listSourceControlsNextOperationSpec: msRest.OperationSpec = { + httpMethod: "GET", + baseUrl: "https://management.azure.com", + path: "{nextLink}", + urlParameters: [ + Parameters.nextPageLink + ], + headerParameters: [ + Parameters.acceptLanguage + ], + responses: { + 200: { + bodyMapper: Mappers.SourceControlCollection + }, + default: { + bodyMapper: Mappers.DefaultErrorResponse + } + }, + serializer +}; + +const listBillingMetersNextOperationSpec: msRest.OperationSpec = { + httpMethod: "GET", + baseUrl: "https://management.azure.com", + path: "{nextLink}", + urlParameters: [ + Parameters.nextPageLink + ], + headerParameters: [ + Parameters.acceptLanguage + ], + responses: { + 200: { + bodyMapper: Mappers.BillingMeterCollection + }, + default: { + bodyMapper: Mappers.DefaultErrorResponse + } + }, + serializer +}; + +const listGeoRegionsNextOperationSpec: msRest.OperationSpec = { + httpMethod: "GET", + baseUrl: "https://management.azure.com", + path: "{nextLink}", + urlParameters: [ + Parameters.nextPageLink + ], + headerParameters: [ + Parameters.acceptLanguage + ], + responses: { + 200: { + bodyMapper: Mappers.GeoRegionCollection + }, + default: { + bodyMapper: Mappers.DefaultErrorResponse + } + }, + serializer +}; + +const listSiteIdentifiersAssignedToHostNameNextOperationSpec: msRest.OperationSpec = { + httpMethod: "POST", + baseUrl: "https://management.azure.com", + path: "{nextLink}", + urlParameters: [ + Parameters.nextPageLink + ], + headerParameters: [ + Parameters.acceptLanguage + ], + responses: { + 200: { + bodyMapper: Mappers.IdentifierCollection + }, + default: { + bodyMapper: Mappers.DefaultErrorResponse + } + }, + serializer +}; + +const listPremierAddOnOffersNextOperationSpec: msRest.OperationSpec = { + httpMethod: "GET", + baseUrl: "https://management.azure.com", + path: "{nextLink}", + urlParameters: [ + Parameters.nextPageLink + ], + headerParameters: [ + Parameters.acceptLanguage + ], + responses: { + 200: { + bodyMapper: Mappers.PremierAddOnOfferCollection + }, + default: { + bodyMapper: Mappers.DefaultErrorResponse + } + }, + serializer +}; + +export { + WebSiteManagementClient, + WebSiteManagementClientContext, + Models as WebSiteManagementModels, + Mappers as WebSiteManagementMappers +}; +export * from "./operations"; diff --git a/sdk/appservice/arm-appservice-profile-2019-03-01-hybrid/src/webSiteManagementClientContext.ts b/sdk/appservice/arm-appservice-profile-2019-03-01-hybrid/src/webSiteManagementClientContext.ts new file mode 100644 index 000000000000..009c37bd2c6b --- /dev/null +++ b/sdk/appservice/arm-appservice-profile-2019-03-01-hybrid/src/webSiteManagementClientContext.ts @@ -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. + */ + +import * as Models from "./models"; +import * as msRest from "@azure/ms-rest-js"; +import * as msRestAzure from "@azure/ms-rest-azure-js"; + +const packageName = "@azure/arm-appservice-profile-2019-03-01-hybrid"; +const packageVersion = "1.0.0"; + +export class WebSiteManagementClientContext extends msRestAzure.AzureServiceClient { + credentials: msRest.ServiceClientCredentials; + subscriptionId: string; + apiVersion?: string; + + /** + * Initializes a new instance of the WebSiteManagementClient class. + * @param credentials Credentials needed for the client to connect to Azure. + * @param subscriptionId Your Azure subscription ID. This is a GUID-formatted string (e.g. + * 00000000-0000-0000-0000-000000000000). + * @param [options] The parameter options + */ + constructor(credentials: msRest.ServiceClientCredentials, subscriptionId: string, options?: Models.WebSiteManagementClientOptions) { + if (credentials == undefined) { + throw new Error('\'credentials\' cannot be null.'); + } + if (subscriptionId == undefined) { + throw new Error('\'subscriptionId\' cannot be null.'); + } + + if (!options) { + options = {}; + } + if(!options.userAgent) { + const defaultUserAgent = msRestAzure.getDefaultUserAgentValue(); + options.userAgent = `${packageName}/${packageVersion} ${defaultUserAgent}`; + } + + super(credentials, options); + + this.apiVersion = '2018-02-01'; + this.acceptLanguage = 'en-US'; + this.longRunningOperationRetryTimeout = 30; + this.baseUri = options.baseUri || this.baseUri || "https://management.azure.com"; + this.requestContentType = "application/json; charset=utf-8"; + this.credentials = credentials; + this.subscriptionId = subscriptionId; + + if(options.acceptLanguage !== null && options.acceptLanguage !== undefined) { + this.acceptLanguage = options.acceptLanguage; + } + if(options.longRunningOperationRetryTimeout !== null && options.longRunningOperationRetryTimeout !== undefined) { + this.longRunningOperationRetryTimeout = options.longRunningOperationRetryTimeout; + } + } +} diff --git a/sdk/appservice/arm-appservice-profile-2019-03-01-hybrid/tsconfig.json b/sdk/appservice/arm-appservice-profile-2019-03-01-hybrid/tsconfig.json new file mode 100644 index 000000000000..87bbf5b5fa49 --- /dev/null +++ b/sdk/appservice/arm-appservice-profile-2019-03-01-hybrid/tsconfig.json @@ -0,0 +1,19 @@ +{ + "compilerOptions": { + "module": "es6", + "moduleResolution": "node", + "strict": true, + "target": "es5", + "sourceMap": true, + "declarationMap": true, + "esModuleInterop": true, + "allowSyntheticDefaultImports": true, + "forceConsistentCasingInFileNames": true, + "lib": ["es6"], + "declaration": true, + "outDir": "./esm", + "importHelpers": true + }, + "include": ["./src/**/*.ts"], + "exclude": ["node_modules"] +} diff --git a/sdk/core/amqp-common/ci.yml b/sdk/core/amqp-common/ci.yml new file mode 100644 index 000000000000..cb46058e468d --- /dev/null +++ b/sdk/core/amqp-common/ci.yml @@ -0,0 +1,17 @@ +# DO NOT EDIT THIS FILE +# This file is generated automatically and any changes will be lost. + +trigger: none + +pr: + branches: + include: + - master + paths: + include: + - sdk/core/amqp-common/ + +jobs: + - template: ../../../eng/pipelines/templates/jobs/archetype-sdk-client.yml + parameters: + PackageName: "@azure/amqp-common" diff --git a/sdk/cosmosdb/arm-cosmosdb/LICENSE.txt b/sdk/cosmosdb/arm-cosmosdb/LICENSE.txt index a70e8cf66038..b73b4a1293c3 100644 --- a/sdk/cosmosdb/arm-cosmosdb/LICENSE.txt +++ b/sdk/cosmosdb/arm-cosmosdb/LICENSE.txt @@ -1,6 +1,6 @@ The MIT License (MIT) -Copyright (c) 2018 Microsoft +Copyright (c) 2019 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 diff --git a/sdk/cosmosdb/arm-cosmosdb/README.md b/sdk/cosmosdb/arm-cosmosdb/README.md index 21e88ef5a4a7..34d35f6daecc 100644 --- a/sdk/cosmosdb/arm-cosmosdb/README.md +++ b/sdk/cosmosdb/arm-cosmosdb/README.md @@ -9,7 +9,7 @@ This package contains an isomorphic SDK for CosmosDBManagementClient. ### How to Install -``` +```bash npm install @azure/arm-cosmosdb ``` @@ -19,13 +19,13 @@ npm install @azure/arm-cosmosdb ##### Install @azure/ms-rest-nodeauth -``` +```bash npm install @azure/ms-rest-nodeauth ``` ##### Sample code -```ts +```typescript import * as msRest from "@azure/ms-rest-js"; import * as msRestAzure from "@azure/ms-rest-azure-js"; import * as msRestNodeAuth from "@azure/ms-rest-nodeauth"; @@ -49,7 +49,7 @@ msRestNodeAuth.interactiveLogin().then((creds) => { ##### Install @azure/ms-rest-browserauth -``` +```bash npm install @azure/ms-rest-browserauth ``` @@ -98,6 +98,3 @@ See https://github.com/Azure/ms-rest-browserauth to learn how to authenticate to ## Related projects - [Microsoft Azure SDK for Javascript](https://github.com/Azure/azure-sdk-for-js) - - -![Impressions](https://azure-sdk-impressions.azurewebsites.net/api/impressions/azure-sdk-for-js/sdk/cosmosdb/arm-cosmosdb/README.png) diff --git a/sdk/cosmosdb/arm-cosmosdb/package.json b/sdk/cosmosdb/arm-cosmosdb/package.json index 361c6fc2575f..73e48f8f06cf 100644 --- a/sdk/cosmosdb/arm-cosmosdb/package.json +++ b/sdk/cosmosdb/arm-cosmosdb/package.json @@ -2,10 +2,10 @@ "name": "@azure/arm-cosmosdb", "author": "Microsoft Corporation", "description": "CosmosDBManagementClient Library with typescript type definitions for node.js and browser.", - "version": "2.3.0", + "version": "3.0.0", "dependencies": { - "@azure/ms-rest-azure-js": "^1.1.0", - "@azure/ms-rest-js": "^1.1.0", + "@azure/ms-rest-azure-js": "^1.3.2", + "@azure/ms-rest-js": "^1.8.1", "tslib": "^1.9.3" }, "keywords": [ @@ -23,9 +23,10 @@ "typescript": "^3.1.1", "rollup": "^0.66.2", "rollup-plugin-node-resolve": "^3.4.0", + "rollup-plugin-sourcemaps": "^0.4.2", "uglify-js": "^3.4.9" }, - "homepage": "https://github.com/azure/azure-sdk-for-js/tree/master/sdk/cosmos-db/arm-cosmosdb", + "homepage": "https://github.com/azure/azure-sdk-for-js", "repository": { "type": "git", "url": "https://github.com/azure/azure-sdk-for-js.git" @@ -43,6 +44,7 @@ "esm/**/*.d.ts", "esm/**/*.d.ts.map", "src/**/*.ts", + "README.md", "rollup.config.js", "tsconfig.json" ], @@ -52,5 +54,5 @@ "prepack": "npm install && npm run build" }, "sideEffects": false, - "authPublish": true + "autoPublish": true } diff --git a/sdk/cosmosdb/arm-cosmosdb/rollup.config.js b/sdk/cosmosdb/arm-cosmosdb/rollup.config.js index 45bce80ed12e..7a75345fce0c 100644 --- a/sdk/cosmosdb/arm-cosmosdb/rollup.config.js +++ b/sdk/cosmosdb/arm-cosmosdb/rollup.config.js @@ -1,10 +1,16 @@ +import rollup from "rollup"; import nodeResolve from "rollup-plugin-node-resolve"; +import sourcemaps from "rollup-plugin-sourcemaps"; + /** - * @type {import('rollup').RollupFileOptions} + * @type {rollup.RollupFileOptions} */ const config = { - input: './esm/cosmosDBManagementClient.js', - external: ["@azure/ms-rest-js", "@azure/ms-rest-azure-js"], + input: "./esm/cosmosDBManagementClient.js", + external: [ + "@azure/ms-rest-js", + "@azure/ms-rest-azure-js" + ], output: { file: "./dist/arm-cosmosdb.js", format: "umd", @@ -16,16 +22,16 @@ const config = { }, banner: `/* * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for - * license information. + * Licensed under the MIT License. See License.txt in the project root for license information. * * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is - * regenerated. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. */` }, plugins: [ - nodeResolve({ module: true }) + nodeResolve({ module: true }), + sourcemaps() ] }; + export default config; diff --git a/sdk/cosmosdb/arm-cosmosdb/src/cosmosDBManagementClientContext.ts b/sdk/cosmosdb/arm-cosmosdb/src/cosmosDBManagementClientContext.ts index 651fd8a59271..f5a79ad9dd2b 100644 --- a/sdk/cosmosdb/arm-cosmosdb/src/cosmosDBManagementClientContext.ts +++ b/sdk/cosmosdb/arm-cosmosdb/src/cosmosDBManagementClientContext.ts @@ -13,7 +13,7 @@ import * as msRest from "@azure/ms-rest-js"; import * as msRestAzure from "@azure/ms-rest-azure-js"; const packageName = "@azure/arm-cosmosdb"; -const packageVersion = "0.1.0"; +const packageVersion = "3.0.0"; export class CosmosDBManagementClientContext extends msRestAzure.AzureServiceClient { credentials: msRest.ServiceClientCredentials; diff --git a/sdk/cosmosdb/arm-cosmosdb/src/models/collectionMappers.ts b/sdk/cosmosdb/arm-cosmosdb/src/models/collectionMappers.ts index 4b2934f1b237..944586670c79 100644 --- a/sdk/cosmosdb/arm-cosmosdb/src/models/collectionMappers.ts +++ b/sdk/cosmosdb/arm-cosmosdb/src/models/collectionMappers.ts @@ -1,26 +1,23 @@ /* * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for - * license information. + * Licensed under the MIT License. See License.txt in the project root for license information. * * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is - * regenerated. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. */ export { - MetricListResult, + CloudError, Metric, + MetricAvailability, + MetricDefinition, + MetricDefinitionsListResult, + MetricListResult, MetricName, MetricValue, - CloudError, - UsagesResult, - Usage, - MetricDefinitionsListResult, - MetricDefinition, - MetricAvailability, + PartitionMetric, PartitionUsage, PercentileMetricValue, - PartitionMetric + Usage, + UsagesResult } from "../models/mappers"; - diff --git a/sdk/cosmosdb/arm-cosmosdb/src/models/collectionPartitionMappers.ts b/sdk/cosmosdb/arm-cosmosdb/src/models/collectionPartitionMappers.ts index 35b2d6172947..8a50f863252d 100644 --- a/sdk/cosmosdb/arm-cosmosdb/src/models/collectionPartitionMappers.ts +++ b/sdk/cosmosdb/arm-cosmosdb/src/models/collectionPartitionMappers.ts @@ -1,23 +1,20 @@ /* * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for - * license information. + * Licensed under the MIT License. See License.txt in the project root for license information. * * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is - * regenerated. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. */ export { - PartitionMetricListResult, - PartitionMetric, + CloudError, Metric, MetricName, MetricValue, - CloudError, - PartitionUsagesResult, + PartitionMetric, + PartitionMetricListResult, PartitionUsage, - Usage, - PercentileMetricValue + PartitionUsagesResult, + PercentileMetricValue, + Usage } from "../models/mappers"; - diff --git a/sdk/cosmosdb/arm-cosmosdb/src/models/collectionPartitionRegionMappers.ts b/sdk/cosmosdb/arm-cosmosdb/src/models/collectionPartitionRegionMappers.ts index a0b31db71d0f..c901f39fec5e 100644 --- a/sdk/cosmosdb/arm-cosmosdb/src/models/collectionPartitionRegionMappers.ts +++ b/sdk/cosmosdb/arm-cosmosdb/src/models/collectionPartitionRegionMappers.ts @@ -1,20 +1,17 @@ /* * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for - * license information. + * Licensed under the MIT License. See License.txt in the project root for license information. * * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is - * regenerated. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. */ export { - PartitionMetricListResult, - PartitionMetric, + CloudError, Metric, MetricName, MetricValue, - CloudError, + PartitionMetric, + PartitionMetricListResult, PercentileMetricValue } from "../models/mappers"; - diff --git a/sdk/cosmosdb/arm-cosmosdb/src/models/collectionRegionMappers.ts b/sdk/cosmosdb/arm-cosmosdb/src/models/collectionRegionMappers.ts index 7fa443e0fd5a..357a24d97955 100644 --- a/sdk/cosmosdb/arm-cosmosdb/src/models/collectionRegionMappers.ts +++ b/sdk/cosmosdb/arm-cosmosdb/src/models/collectionRegionMappers.ts @@ -1,20 +1,17 @@ /* * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for - * license information. + * Licensed under the MIT License. See License.txt in the project root for license information. * * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is - * regenerated. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. */ export { - MetricListResult, + CloudError, Metric, + MetricListResult, MetricName, MetricValue, - CloudError, - PercentileMetricValue, - PartitionMetric + PartitionMetric, + PercentileMetricValue } from "../models/mappers"; - diff --git a/sdk/cosmosdb/arm-cosmosdb/src/models/databaseAccountRegionMappers.ts b/sdk/cosmosdb/arm-cosmosdb/src/models/databaseAccountRegionMappers.ts index 7fa443e0fd5a..357a24d97955 100644 --- a/sdk/cosmosdb/arm-cosmosdb/src/models/databaseAccountRegionMappers.ts +++ b/sdk/cosmosdb/arm-cosmosdb/src/models/databaseAccountRegionMappers.ts @@ -1,20 +1,17 @@ /* * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for - * license information. + * Licensed under the MIT License. See License.txt in the project root for license information. * * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is - * regenerated. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. */ export { - MetricListResult, + CloudError, Metric, + MetricListResult, MetricName, MetricValue, - CloudError, - PercentileMetricValue, - PartitionMetric + PartitionMetric, + PercentileMetricValue } from "../models/mappers"; - diff --git a/sdk/cosmosdb/arm-cosmosdb/src/models/databaseAccountsMappers.ts b/sdk/cosmosdb/arm-cosmosdb/src/models/databaseAccountsMappers.ts index db0fe95e4262..ade496e51c50 100644 --- a/sdk/cosmosdb/arm-cosmosdb/src/models/databaseAccountsMappers.ts +++ b/sdk/cosmosdb/arm-cosmosdb/src/models/databaseAccountsMappers.ts @@ -1,45 +1,93 @@ /* * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for - * license information. + * Licensed under the MIT License. See License.txt in the project root for license information. * * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is - * regenerated. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. */ export { - DatabaseAccount, - Resource, BaseResource, - ConsistencyPolicy, Capability, - Location, - FailoverPolicy, - VirtualNetworkRule, + CassandraKeyspace, + CassandraKeyspaceCreateUpdateParameters, + CassandraKeyspaceListResult, + CassandraKeyspaceResource, + CassandraPartitionKey, + CassandraSchema, + CassandraTable, + CassandraTableCreateUpdateParameters, + CassandraTableListResult, + CassandraTableResource, CloudError, - DatabaseAccountPatchParameters, + ClusterKey, + Column, + ConflictResolutionPolicy, + ConsistencyPolicy, + ContainerPartitionKey, + DatabaseAccount, + DatabaseAccountConnectionString, DatabaseAccountCreateUpdateParameters, - FailoverPolicies, - DatabaseAccountsListResult, - DatabaseAccountListKeysResult, DatabaseAccountListConnectionStringsResult, - DatabaseAccountConnectionString, - RegionForOnlineOffline, - ErrorResponse, + DatabaseAccountListKeysResult, DatabaseAccountListReadOnlyKeysResult, + DatabaseAccountPatchParameters, DatabaseAccountRegenerateKeyParameters, - MetricListResult, + DatabaseAccountsListResult, + ErrorResponse, + ExcludedPath, + FailoverPolicies, + FailoverPolicy, + GremlinDatabase, + GremlinDatabaseCreateUpdateParameters, + GremlinDatabaseListResult, + GremlinDatabaseResource, + GremlinGraph, + GremlinGraphCreateUpdateParameters, + GremlinGraphListResult, + GremlinGraphResource, + IncludedPath, + Indexes, + IndexingPolicy, + Location, Metric, + MetricAvailability, + MetricDefinition, + MetricDefinitionsListResult, + MetricListResult, MetricName, MetricValue, - UsagesResult, - Usage, - MetricDefinitionsListResult, - MetricDefinition, - MetricAvailability, + MongoDBCollection, + MongoDBCollectionCreateUpdateParameters, + MongoDBCollectionListResult, + MongoDBCollectionResource, + MongoDBDatabase, + MongoDBDatabaseCreateUpdateParameters, + MongoDBDatabaseListResult, + MongoDBDatabaseResource, + MongoIndex, + MongoIndexKeys, + MongoIndexOptions, + PartitionMetric, PartitionUsage, PercentileMetricValue, - PartitionMetric + RegionForOnlineOffline, + Resource, + SqlContainer, + SqlContainerCreateUpdateParameters, + SqlContainerListResult, + SqlContainerResource, + SqlDatabase, + SqlDatabaseCreateUpdateParameters, + SqlDatabaseListResult, + SqlDatabaseResource, + Table, + TableCreateUpdateParameters, + TableListResult, + TableResource, + UniqueKey, + UniqueKeyPolicy, + Usage, + UsagesResult, + VirtualNetworkRule } from "../models/mappers"; - diff --git a/sdk/cosmosdb/arm-cosmosdb/src/models/databaseMappers.ts b/sdk/cosmosdb/arm-cosmosdb/src/models/databaseMappers.ts index 4b2934f1b237..944586670c79 100644 --- a/sdk/cosmosdb/arm-cosmosdb/src/models/databaseMappers.ts +++ b/sdk/cosmosdb/arm-cosmosdb/src/models/databaseMappers.ts @@ -1,26 +1,23 @@ /* * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for - * license information. + * Licensed under the MIT License. See License.txt in the project root for license information. * * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is - * regenerated. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. */ export { - MetricListResult, + CloudError, Metric, + MetricAvailability, + MetricDefinition, + MetricDefinitionsListResult, + MetricListResult, MetricName, MetricValue, - CloudError, - UsagesResult, - Usage, - MetricDefinitionsListResult, - MetricDefinition, - MetricAvailability, + PartitionMetric, PartitionUsage, PercentileMetricValue, - PartitionMetric + Usage, + UsagesResult } from "../models/mappers"; - diff --git a/sdk/cosmosdb/arm-cosmosdb/src/models/index.ts b/sdk/cosmosdb/arm-cosmosdb/src/models/index.ts index 5e2aff757a9b..5660472f8adf 100644 --- a/sdk/cosmosdb/arm-cosmosdb/src/models/index.ts +++ b/sdk/cosmosdb/arm-cosmosdb/src/models/index.ts @@ -1,11 +1,9 @@ /* * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for - * license information. + * Licensed under the MIT License. See License.txt in the project root for license information. * * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is - * regenerated. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. */ import { BaseResource, CloudError, AzureServiceClientOptions } from "@azure/ms-rest-azure-js"; @@ -13,1140 +11,2415 @@ import * as msRest from "@azure/ms-rest-js"; export { BaseResource, CloudError }; - /** - * @interface - * An interface representing ConsistencyPolicy. * The consistency policy for the Cosmos DB database account. - * */ export interface ConsistencyPolicy { /** - * @member {DefaultConsistencyLevel} defaultConsistencyLevel The default - * consistency level and configuration settings of the Cosmos DB account. - * Possible values include: 'Eventual', 'Session', 'BoundedStaleness', - * 'Strong', 'ConsistentPrefix' + * The default consistency level and configuration settings of the Cosmos DB account. Possible + * values include: 'Eventual', 'Session', 'BoundedStaleness', 'Strong', 'ConsistentPrefix' */ defaultConsistencyLevel: DefaultConsistencyLevel; /** - * @member {number} [maxStalenessPrefix] When used with the Bounded Staleness - * consistency level, this value represents the number of stale requests - * tolerated. Accepted range for this value is 1 – 2,147,483,647. Required - * when defaultConsistencyPolicy is set to 'BoundedStaleness'. + * When used with the Bounded Staleness consistency level, this value represents the number of + * stale requests tolerated. Accepted range for this value is 1 – 2,147,483,647. Required when + * defaultConsistencyPolicy is set to 'BoundedStaleness'. */ maxStalenessPrefix?: number; /** - * @member {number} [maxIntervalInSeconds] When used with the Bounded - * Staleness consistency level, this value represents the time amount of - * staleness (in seconds) tolerated. Accepted range for this value is 5 - - * 86400. Required when defaultConsistencyPolicy is set to - * 'BoundedStaleness'. + * When used with the Bounded Staleness consistency level, this value represents the time amount + * of staleness (in seconds) tolerated. Accepted range for this value is 5 - 86400. Required when + * defaultConsistencyPolicy is set to 'BoundedStaleness'. */ maxIntervalInSeconds?: number; } /** - * @interface - * An interface representing Capability. * Cosmos DB capability object - * */ export interface Capability { /** - * @member {string} [name] Name of the Cosmos DB capability. For example, - * "name": "EnableCassandra". Current values also include "EnableTable" and - * "EnableGremlin". + * Name of the Cosmos DB capability. For example, "name": "EnableCassandra". Current values also + * include "EnableTable" and "EnableGremlin". */ name?: string; } /** - * @interface - * An interface representing Location. * A region in which the Azure Cosmos DB database account is deployed. - * */ export interface Location { /** - * @member {string} [id] The unique identifier of the region within the - * database account. Example: <accountName>-<locationName>. - * **NOTE: This property will not be serialized. It can only be populated by - * the server.** + * The unique identifier of the region within the database account. Example: + * <accountName>-<locationName>. + * **NOTE: This property will not be serialized. It can only be populated by the server.** */ readonly id?: string; /** - * @member {string} [locationName] The name of the region. + * The name of the region. */ locationName?: string; /** - * @member {string} [documentEndpoint] The connection endpoint for the - * specific region. Example: + * The connection endpoint for the specific region. Example: * https://<accountName>-<locationName>.documents.azure.com:443/ - * **NOTE: This property will not be serialized. It can only be populated by - * the server.** + * **NOTE: This property will not be serialized. It can only be populated by the server.** */ readonly documentEndpoint?: string; - /** - * @member {string} [provisioningState] - */ provisioningState?: string; /** - * @member {number} [failoverPriority] The failover priority of the region. A - * failover priority of 0 indicates a write region. The maximum value for a - * failover priority = (total number of regions - 1). Failover priority - * values must be unique for each of the regions in which the database - * account exists. + * The failover priority of the region. A failover priority of 0 indicates a write region. The + * maximum value for a failover priority = (total number of regions - 1). Failover priority + * values must be unique for each of the regions in which the database account exists. */ failoverPriority?: number; } /** - * @interface - * An interface representing FailoverPolicy. * The failover policy for a given region of a database account. - * */ export interface FailoverPolicy { /** - * @member {string} [id] The unique identifier of the region in which the - * database account replicates to. Example: + * The unique identifier of the region in which the database account replicates to. Example: * <accountName>-<locationName>. - * **NOTE: This property will not be serialized. It can only be populated by - * the server.** + * **NOTE: This property will not be serialized. It can only be populated by the server.** */ readonly id?: string; /** - * @member {string} [locationName] The name of the region in which the - * database account exists. + * The name of the region in which the database account exists. */ locationName?: string; /** - * @member {number} [failoverPriority] The failover priority of the region. A - * failover priority of 0 indicates a write region. The maximum value for a - * failover priority = (total number of regions - 1). Failover priority - * values must be unique for each of the regions in which the database - * account exists. + * The failover priority of the region. A failover priority of 0 indicates a write region. The + * maximum value for a failover priority = (total number of regions - 1). Failover priority + * values must be unique for each of the regions in which the database account exists. */ failoverPriority?: number; } /** - * @interface - * An interface representing VirtualNetworkRule. * Virtual Network ACL Rule object - * */ export interface VirtualNetworkRule { /** - * @member {string} [id] Resource ID of a subnet, for example: + * Resource ID of a subnet, for example: * /subscriptions/{subscriptionId}/resourceGroups/{groupName}/providers/Microsoft.Network/virtualNetworks/{virtualNetworkName}/subnets/{subnetName}. */ id?: string; /** - * @member {boolean} [ignoreMissingVNetServiceEndpoint] Create firewall rule - * before the virtual network has vnet service endpoint enabled. + * Create firewall rule before the virtual network has vnet service endpoint enabled. */ ignoreMissingVNetServiceEndpoint?: boolean; } /** - * @interface - * An interface representing Resource. - * A database account resource. - * - * @extends BaseResource + * The core properties of ARM resources. */ export interface Resource extends BaseResource { /** - * @member {string} [id] The unique resource identifier of the database - * account. - * **NOTE: This property will not be serialized. It can only be populated by - * the server.** + * The unique resource identifier of the database account. + * **NOTE: This property will not be serialized. It can only be populated by the server.** */ readonly id?: string; /** - * @member {string} [name] The name of the database account. - * **NOTE: This property will not be serialized. It can only be populated by - * the server.** + * The name of the database account. + * **NOTE: This property will not be serialized. It can only be populated by the server.** */ readonly name?: string; /** - * @member {string} [type] The type of Azure resource. - * **NOTE: This property will not be serialized. It can only be populated by - * the server.** + * The type of Azure resource. + * **NOTE: This property will not be serialized. It can only be populated by the server.** */ readonly type?: string; /** - * @member {string} location The location of the resource group to which the - * resource belongs. - */ - location: string; - /** - * @member {{ [propertyName: string]: string }} [tags] + * The location of the resource group to which the resource belongs. */ + location?: string; tags?: { [propertyName: string]: string }; } /** - * @interface - * An interface representing DatabaseAccount. * An Azure Cosmos DB database account. - * - * @extends Resource */ export interface DatabaseAccount extends Resource { /** - * @member {DatabaseAccountKind} [kind] Indicates the type of database - * account. This can only be set at database account creation. Possible - * values include: 'GlobalDocumentDB', 'MongoDB', 'Parse'. Default value: - * 'GlobalDocumentDB' . + * Indicates the type of database account. This can only be set at database account creation. + * Possible values include: 'GlobalDocumentDB', 'MongoDB', 'Parse'. Default value: + * 'GlobalDocumentDB'. */ kind?: DatabaseAccountKind; - /** - * @member {string} [provisioningState] - */ provisioningState?: string; /** - * @member {string} [documentEndpoint] The connection endpoint for the Cosmos - * DB database account. - * **NOTE: This property will not be serialized. It can only be populated by - * the server.** + * The connection endpoint for the Cosmos DB database account. + * **NOTE: This property will not be serialized. It can only be populated by the server.** */ readonly documentEndpoint?: string; /** - * @member {DatabaseAccountOfferType} [databaseAccountOfferType] The offer - * type for the Cosmos DB database account. Default value: Standard. Possible - * values include: 'Standard' - * **NOTE: This property will not be serialized. It can only be populated by - * the server.** + * The offer type for the Cosmos DB database account. Default value: Standard. Possible values + * include: 'Standard' + * **NOTE: This property will not be serialized. It can only be populated by the server.** */ readonly databaseAccountOfferType?: DatabaseAccountOfferType; /** - * @member {string} [ipRangeFilter] Cosmos DB Firewall Support: This value - * specifies the set of IP addresses or IP address ranges in CIDR form to be - * included as the allowed list of client IPs for a given database account. - * IP addresses/ranges must be comma separated and must not contain any - * spaces. + * Cosmos DB Firewall Support: This value specifies the set of IP addresses or IP address ranges + * in CIDR form to be included as the allowed list of client IPs for a given database account. IP + * addresses/ranges must be comma separated and must not contain any spaces. */ ipRangeFilter?: string; /** - * @member {boolean} [isVirtualNetworkFilterEnabled] Flag to indicate whether - * to enable/disable Virtual Network ACL rules. + * Flag to indicate whether to enable/disable Virtual Network ACL rules. */ isVirtualNetworkFilterEnabled?: boolean; /** - * @member {boolean} [enableAutomaticFailover] Enables automatic failover of - * the write region in the rare event that the region is unavailable due to - * an outage. Automatic failover will result in a new write region for the - * account and is chosen based on the failover priorities configured for the - * account. + * Enables automatic failover of the write region in the rare event that the region is + * unavailable due to an outage. Automatic failover will result in a new write region for the + * account and is chosen based on the failover priorities configured for the account. */ enableAutomaticFailover?: boolean; /** - * @member {ConsistencyPolicy} [consistencyPolicy] The consistency policy for - * the Cosmos DB database account. + * The consistency policy for the Cosmos DB database account. */ consistencyPolicy?: ConsistencyPolicy; /** - * @member {Capability[]} [capabilities] List of Cosmos DB capabilities for - * the account + * List of Cosmos DB capabilities for the account */ capabilities?: Capability[]; /** - * @member {Location[]} [writeLocations] An array that contains the write - * location for the Cosmos DB account. - * **NOTE: This property will not be serialized. It can only be populated by - * the server.** + * An array that contains the write location for the Cosmos DB account. + * **NOTE: This property will not be serialized. It can only be populated by the server.** */ readonly writeLocations?: Location[]; /** - * @member {Location[]} [readLocations] An array that contains of the read - * locations enabled for the Cosmos DB account. - * **NOTE: This property will not be serialized. It can only be populated by - * the server.** + * An array that contains of the read locations enabled for the Cosmos DB account. + * **NOTE: This property will not be serialized. It can only be populated by the server.** */ readonly readLocations?: Location[]; /** - * @member {FailoverPolicy[]} [failoverPolicies] An array that contains the - * regions ordered by their failover priorities. - * **NOTE: This property will not be serialized. It can only be populated by - * the server.** + * An array that contains the regions ordered by their failover priorities. + * **NOTE: This property will not be serialized. It can only be populated by the server.** */ readonly failoverPolicies?: FailoverPolicy[]; /** - * @member {VirtualNetworkRule[]} [virtualNetworkRules] List of Virtual - * Network ACL rules configured for the Cosmos DB account. + * List of Virtual Network ACL rules configured for the Cosmos DB account. */ virtualNetworkRules?: VirtualNetworkRule[]; /** - * @member {boolean} [enableMultipleWriteLocations] Enables the account to - * write in multiple locations + * Enables the account to write in multiple locations */ enableMultipleWriteLocations?: boolean; } /** - * @interface - * An interface representing ErrorResponse. - * Error Response. - * - */ -export interface ErrorResponse { - /** - * @member {string} [code] Error code. - */ - code?: string; - /** - * @member {string} [message] Error message indicating why the operation - * failed. - */ - message?: string; -} - -/** - * @interface - * An interface representing FailoverPolicies. - * The list of new failover policies for the failover priority change. - * - */ -export interface FailoverPolicies { - /** - * @member {FailoverPolicy[]} failoverPolicies List of failover policies. - */ - failoverPolicies: FailoverPolicy[]; -} - -/** - * @interface - * An interface representing RegionForOnlineOffline. - * Cosmos DB region to online or offline. - * - */ -export interface RegionForOnlineOffline { - /** - * @member {string} region Cosmos DB region, with spaces between words and - * each word capitalized. - */ - region: string; -} - -/** - * @interface - * An interface representing DatabaseAccountCreateUpdateParameters. - * Parameters to create and update Cosmos DB database accounts. - * - * @extends Resource + * An Azure Cosmos DB SQL database. */ -export interface DatabaseAccountCreateUpdateParameters extends Resource { +export interface SqlDatabase extends Resource { /** - * @member {DatabaseAccountKind} [kind] Indicates the type of database - * account. This can only be set at database account creation. Possible - * values include: 'GlobalDocumentDB', 'MongoDB', 'Parse'. Default value: - * 'GlobalDocumentDB' . + * Name of the Cosmos DB SQL database */ - kind?: DatabaseAccountKind; + sqlDatabaseId: string; /** - * @member {ConsistencyPolicy} [consistencyPolicy] The consistency policy for - * the Cosmos DB account. + * A system generated property. A unique identifier. */ - consistencyPolicy?: ConsistencyPolicy; + _rid?: string; /** - * @member {Location[]} locations An array that contains the georeplication - * locations enabled for the Cosmos DB account. + * A system generated property that denotes the last updated timestamp of the resource. */ - locations: Location[]; + _ts?: any; /** - * @member {string} [ipRangeFilter] Cosmos DB Firewall Support: This value - * specifies the set of IP addresses or IP address ranges in CIDR form to be - * included as the allowed list of client IPs for a given database account. - * IP addresses/ranges must be comma separated and must not contain any - * spaces. + * A system generated property representing the resource etag required for optimistic concurrency + * control. */ - ipRangeFilter?: string; + _etag?: string; /** - * @member {boolean} [isVirtualNetworkFilterEnabled] Flag to indicate whether - * to enable/disable Virtual Network ACL rules. + * A system generated property that specified the addressable path of the collections resource. */ - isVirtualNetworkFilterEnabled?: boolean; + _colls?: string; /** - * @member {boolean} [enableAutomaticFailover] Enables automatic failover of - * the write region in the rare event that the region is unavailable due to - * an outage. Automatic failover will result in a new write region for the - * account and is chosen based on the failover priorities configured for the - * account. + * A system generated property that specifies the addressable path of the users resource. */ - enableAutomaticFailover?: boolean; + _users?: string; +} + +/** + * The indexes for the path. + */ +export interface Indexes { /** - * @member {Capability[]} [capabilities] List of Cosmos DB capabilities for - * the account + * The datatype for which the indexing behavior is applied to. Possible values include: 'String', + * 'Number', 'Point', 'Polygon', 'LineString', 'MultiPolygon'. Default value: 'String'. */ - capabilities?: Capability[]; + dataType?: DataType; /** - * @member {VirtualNetworkRule[]} [virtualNetworkRules] List of Virtual - * Network ACL rules configured for the Cosmos DB account. + * The precision of the index. -1 is maximum precision. */ - virtualNetworkRules?: VirtualNetworkRule[]; + precision?: number; /** - * @member {boolean} [enableMultipleWriteLocations] Enables the account to - * write in multiple locations + * Indicates the type of index. Possible values include: 'Hash', 'Range', 'Spatial'. Default + * value: 'Hash'. */ - enableMultipleWriteLocations?: boolean; + kind?: IndexKind; } /** - * @interface - * An interface representing DatabaseAccountPatchParameters. - * Parameters for patching Azure Cosmos DB database account properties. - * + * The paths that are included in indexing */ -export interface DatabaseAccountPatchParameters { +export interface IncludedPath { /** - * @member {{ [propertyName: string]: string }} [tags] + * The path for which the indexing behavior applies to. Index paths typically start with root and + * end with wildcard (/path/*) */ - tags?: { [propertyName: string]: string }; + path?: string; /** - * @member {Capability[]} [capabilities] List of Cosmos DB capabilities for - * the account + * List of indexes for this path */ - capabilities?: Capability[]; + indexes?: Indexes[]; } /** - * @interface - * An interface representing DatabaseAccountListReadOnlyKeysResult. - * The read-only access keys for the given database account. - * + * An interface representing ExcludedPath. */ -export interface DatabaseAccountListReadOnlyKeysResult { - /** - * @member {string} [primaryReadonlyMasterKey] Base 64 encoded value of the - * primary read-only key. - * **NOTE: This property will not be serialized. It can only be populated by - * the server.** - */ - readonly primaryReadonlyMasterKey?: string; +export interface ExcludedPath { /** - * @member {string} [secondaryReadonlyMasterKey] Base 64 encoded value of the - * secondary read-only key. - * **NOTE: This property will not be serialized. It can only be populated by - * the server.** + * The path for which the indexing behavior applies to. Index paths typically start with root and + * end with wildcard (/path/*) */ - readonly secondaryReadonlyMasterKey?: string; + path?: string; } /** - * @interface - * An interface representing DatabaseAccountListKeysResult. - * The access keys for the given database account. - * + * Cosmos DB indexing policy */ -export interface DatabaseAccountListKeysResult { +export interface IndexingPolicy { /** - * @member {string} [primaryMasterKey] Base 64 encoded value of the primary - * read-write key. - * **NOTE: This property will not be serialized. It can only be populated by - * the server.** + * Indicates if the indexing policy is automatic */ - readonly primaryMasterKey?: string; + automatic?: boolean; /** - * @member {string} [secondaryMasterKey] Base 64 encoded value of the - * secondary read-write key. - * **NOTE: This property will not be serialized. It can only be populated by - * the server.** + * Indicates the indexing mode. Possible values include: 'Consistent', 'Lazy', 'None'. Default + * value: 'Consistent'. */ - readonly secondaryMasterKey?: string; + indexingMode?: IndexingMode; /** - * @member {string} [primaryReadonlyMasterKey] Base 64 encoded value of the - * primary read-only key. - * **NOTE: This property will not be serialized. It can only be populated by - * the server.** + * List of paths to include in the indexing */ - readonly primaryReadonlyMasterKey?: string; + includedPaths?: IncludedPath[]; /** - * @member {string} [secondaryReadonlyMasterKey] Base 64 encoded value of the - * secondary read-only key. - * **NOTE: This property will not be serialized. It can only be populated by - * the server.** + * List of paths to exclude from indexing */ - readonly secondaryReadonlyMasterKey?: string; + excludedPaths?: ExcludedPath[]; } /** - * @interface - * An interface representing DatabaseAccountConnectionString. - * Connection string for the Cosmos DB account - * + * The configuration of the partition key to be used for partitioning data into multiple partitions */ -export interface DatabaseAccountConnectionString { +export interface ContainerPartitionKey { /** - * @member {string} [connectionString] Value of the connection string - * **NOTE: This property will not be serialized. It can only be populated by - * the server.** + * List of paths using which data within the container can be partitioned */ - readonly connectionString?: string; + paths?: string[]; /** - * @member {string} [description] Description of the connection string - * **NOTE: This property will not be serialized. It can only be populated by - * the server.** + * Indicates the kind of algorithm used for partitioning. Possible values include: 'Hash', + * 'Range'. Default value: 'Hash'. */ - readonly description?: string; + kind?: PartitionKind; } /** - * @interface - * An interface representing DatabaseAccountListConnectionStringsResult. - * The connection strings for the given database account. - * + * The unique key on that enforces uniqueness constraint on documents in the collection in the + * Azure Cosmos DB service. */ -export interface DatabaseAccountListConnectionStringsResult { +export interface UniqueKey { /** - * @member {DatabaseAccountConnectionString[]} [connectionStrings] An array - * that contains the connection strings for the Cosmos DB account. + * List of paths must be unique for each document in the Azure Cosmos DB service */ - connectionStrings?: DatabaseAccountConnectionString[]; + paths?: string[]; } /** - * @interface - * An interface representing DatabaseAccountRegenerateKeyParameters. - * Parameters to regenerate the keys within the database account. - * + * The unique key policy configuration for specifying uniqueness constraints on documents in the + * collection in the Azure Cosmos DB service. */ -export interface DatabaseAccountRegenerateKeyParameters { +export interface UniqueKeyPolicy { /** - * @member {KeyKind} keyKind The access key to regenerate. Possible values - * include: 'primary', 'secondary', 'primaryReadonly', 'secondaryReadonly' + * List of unique keys on that enforces uniqueness constraint on documents in the collection in + * the Azure Cosmos DB service. */ - keyKind: KeyKind; + uniqueKeys?: UniqueKey[]; } /** - * @interface - * An interface representing OperationDisplay. - * The object that represents the operation. - * + * The conflict resolution policy for the container. */ -export interface OperationDisplay { - /** - * @member {string} [provider] Service provider: Microsoft.ResourceProvider - */ - provider?: string; +export interface ConflictResolutionPolicy { /** - * @member {string} [resource] Resource on which the operation is performed: - * Profile, endpoint, etc. + * Indicates the conflict resolution mode. Possible values include: 'LastWriterWins', 'Custom'. + * Default value: 'LastWriterWins'. */ - resource?: string; + mode?: ConflictResolutionMode; /** - * @member {string} [operation] Operation type: Read, write, delete, etc. + * The conflict resolution path in the case of LastWriterWins mode. */ - operation?: string; + conflictResolutionPath?: string; /** - * @member {string} [description] Description of operation + * The procedure to resolve conflicts in the case of custom mode. */ - description?: string; + conflictResolutionProcedure?: string; } /** - * @interface - * An interface representing Operation. - * REST API operation - * + * An Azure Cosmos DB container. */ -export interface Operation { +export interface SqlContainer extends Resource { /** - * @member {string} [name] Operation name: {provider}/{resource}/{operation} + * Name of the Cosmos DB SQL container */ - name?: string; + sqlContainerId: string; /** - * @member {OperationDisplay} [display] The object that represents the - * operation. + * The configuration of the indexing policy. By default, the indexing is automatic for all + * document paths within the container */ - display?: OperationDisplay; -} - -/** - * @interface - * An interface representing MetricName. - * A metric name. - * - */ -export interface MetricName { + indexingPolicy?: IndexingPolicy; /** - * @member {string} [value] The name of the metric. - * **NOTE: This property will not be serialized. It can only be populated by - * the server.** + * The configuration of the partition key to be used for partitioning data into multiple + * partitions */ - readonly value?: string; + partitionKey?: ContainerPartitionKey; /** - * @member {string} [localizedValue] The friendly name of the metric. - * **NOTE: This property will not be serialized. It can only be populated by - * the server.** + * Default time to live */ - readonly localizedValue?: string; -} - -/** - * @interface - * An interface representing Usage. - * The usage data for a usage request. - * - */ -export interface Usage { + defaultTtl?: number; /** - * @member {UnitType} [unit] The unit of the metric. Possible values include: - * 'Count', 'Bytes', 'Seconds', 'Percent', 'CountPerSecond', - * 'BytesPerSecond', 'Milliseconds' + * The unique key policy configuration for specifying uniqueness constraints on documents in the + * collection in the Azure Cosmos DB service. */ - unit?: UnitType; + uniqueKeyPolicy?: UniqueKeyPolicy; /** - * @member {MetricName} [name] The name information for the metric. - * **NOTE: This property will not be serialized. It can only be populated by - * the server.** + * The conflict resolution policy for the container. */ - readonly name?: MetricName; + conflictResolutionPolicy?: ConflictResolutionPolicy; /** - * @member {string} [quotaPeriod] The quota period used to summarize the - * usage values. - * **NOTE: This property will not be serialized. It can only be populated by - * the server.** + * A system generated property. A unique identifier. */ - readonly quotaPeriod?: string; + _rid?: string; /** - * @member {number} [limit] Maximum value for this metric - * **NOTE: This property will not be serialized. It can only be populated by - * the server.** + * A system generated property that denotes the last updated timestamp of the resource. */ - readonly limit?: number; + _ts?: any; /** - * @member {number} [currentValue] Current value for this metric - * **NOTE: This property will not be serialized. It can only be populated by - * the server.** + * A system generated property representing the resource etag required for optimistic concurrency + * control. */ - readonly currentValue?: number; + _etag?: string; } /** - * @interface - * An interface representing PartitionUsage. - * The partition level usage data for a usage request. - * - * @extends Usage + * An Azure Cosmos DB MongoDB database. */ -export interface PartitionUsage extends Usage { +export interface MongoDBDatabase extends Resource { /** - * @member {string} [partitionId] The parition id (GUID identifier) of the - * usages. - * **NOTE: This property will not be serialized. It can only be populated by - * the server.** + * Name of the Cosmos DB MongoDB database */ - readonly partitionId?: string; - /** - * @member {string} [partitionKeyRangeId] The partition key range id (integer - * identifier) of the usages. - * **NOTE: This property will not be serialized. It can only be populated by - * the server.** - */ - readonly partitionKeyRangeId?: string; + mongoDBDatabaseId: string; } /** - * @interface - * An interface representing MetricAvailability. - * The availability of the metric. - * + * An Azure Cosmos DB MongoDB collection. */ -export interface MetricAvailability { +export interface MongoDBCollection extends Resource { /** - * @member {string} [timeGrain] The time grain to be used to summarize the - * metric values. - * **NOTE: This property will not be serialized. It can only be populated by - * the server.** + * Name of the Cosmos DB MongoDB collection */ - readonly timeGrain?: string; + mongoDBCollectionId: string; /** - * @member {string} [retention] The retention for the metric values. - * **NOTE: This property will not be serialized. It can only be populated by - * the server.** + * A key-value pair of shard keys to be applied for the request. */ - readonly retention?: string; + shardKey?: { [propertyName: string]: string }; + /** + * List of index keys + */ + indexes?: MongoIndex[]; } /** - * @interface - * An interface representing MetricDefinition. - * The definition of a metric. - * + * An Azure Cosmos DB Table. */ -export interface MetricDefinition { +export interface Table extends Resource { /** - * @member {MetricAvailability[]} [metricAvailabilities] The list of metric - * availabilities for the account. - * **NOTE: This property will not be serialized. It can only be populated by - * the server.** + * Name of the Cosmos DB table */ - readonly metricAvailabilities?: MetricAvailability[]; + tableId: string; +} + +/** + * An Azure Cosmos DB Cassandra keyspace. + */ +export interface CassandraKeyspace extends Resource { /** - * @member {PrimaryAggregationType} [primaryAggregationType] The primary - * aggregation type of the metric. Possible values include: 'None', - * 'Average', 'Total', 'Minimimum', 'Maximum', 'Last' - * **NOTE: This property will not be serialized. It can only be populated by - * the server.** + * Name of the Cosmos DB Cassandra keyspace */ - readonly primaryAggregationType?: PrimaryAggregationType; + cassandraKeyspaceId: string; +} + +/** + * An Azure Cosmos DB Cassandra table. + */ +export interface CassandraTable extends Resource { /** - * @member {UnitType} [unit] The unit of the metric. Possible values include: - * 'Count', 'Bytes', 'Seconds', 'Percent', 'CountPerSecond', - * 'BytesPerSecond', 'Milliseconds' + * Name of the Cosmos DB Cassandra table */ - unit?: UnitType; + cassandraTableId: string; /** - * @member {string} [resourceUri] The resource uri of the database. - * **NOTE: This property will not be serialized. It can only be populated by - * the server.** + * Time to live of the Cosmos DB Cassandra table */ - readonly resourceUri?: string; + defaultTtl?: number; /** - * @member {MetricName} [name] The name information for the metric. - * **NOTE: This property will not be serialized. It can only be populated by - * the server.** + * Schema of the Cosmos DB Cassandra table */ - readonly name?: MetricName; + schema?: CassandraSchema; } /** - * @interface - * An interface representing MetricValue. - * Represents metrics values. - * + * An Azure Cosmos DB Gremlin database. */ -export interface MetricValue { - /** - * @member {number} [_count] The number of values for the metric. - * **NOTE: This property will not be serialized. It can only be populated by - * the server.** - */ - readonly _count?: number; +export interface GremlinDatabase extends Resource { /** - * @member {number} [average] The average value of the metric. - * **NOTE: This property will not be serialized. It can only be populated by - * the server.** + * Name of the Cosmos DB Gremlin database */ - readonly average?: number; - /** - * @member {number} [maximum] The max value of the metric. - * **NOTE: This property will not be serialized. It can only be populated by - * the server.** - */ - readonly maximum?: number; + gremlinDatabaseId: string; /** - * @member {number} [minimum] The min value of the metric. - * **NOTE: This property will not be serialized. It can only be populated by - * the server.** + * A system generated property. A unique identifier. */ - readonly minimum?: number; + _rid?: string; /** - * @member {Date} [timestamp] The metric timestamp (ISO-8601 format). - * **NOTE: This property will not be serialized. It can only be populated by - * the server.** + * A system generated property that denotes the last updated timestamp of the resource. */ - readonly timestamp?: Date; + _ts?: any; /** - * @member {number} [total] The total value of the metric. - * **NOTE: This property will not be serialized. It can only be populated by - * the server.** + * A system generated property representing the resource etag required for optimistic concurrency + * control. */ - readonly total?: number; + _etag?: string; } /** - * @interface - * An interface representing Metric. - * Metric data - * + * An Azure Cosmos DB Gremlin graph. */ -export interface Metric { +export interface GremlinGraph extends Resource { /** - * @member {Date} [startTime] The start time for the metric (ISO-8601 - * format). - * **NOTE: This property will not be serialized. It can only be populated by - * the server.** + * Name of the Cosmos DB Gremlin graph */ - readonly startTime?: Date; + gremlinGraphId: string; /** - * @member {Date} [endTime] The end time for the metric (ISO-8601 format). - * **NOTE: This property will not be serialized. It can only be populated by - * the server.** + * The configuration of the indexing policy. By default, the indexing is automatic for all + * document paths within the graph */ - readonly endTime?: Date; + indexingPolicy?: IndexingPolicy; /** - * @member {string} [timeGrain] The time grain to be used to summarize the - * metric values. - * **NOTE: This property will not be serialized. It can only be populated by - * the server.** + * The configuration of the partition key to be used for partitioning data into multiple + * partitions */ - readonly timeGrain?: string; + partitionKey?: ContainerPartitionKey; /** - * @member {UnitType} [unit] The unit of the metric. Possible values include: - * 'Count', 'Bytes', 'Seconds', 'Percent', 'CountPerSecond', - * 'BytesPerSecond', 'Milliseconds' + * Default time to live */ - unit?: UnitType; + defaultTtl?: number; /** - * @member {MetricName} [name] The name information for the metric. - * **NOTE: This property will not be serialized. It can only be populated by - * the server.** + * The unique key policy configuration for specifying uniqueness constraints on documents in the + * collection in the Azure Cosmos DB service. */ - readonly name?: MetricName; + uniqueKeyPolicy?: UniqueKeyPolicy; /** - * @member {MetricValue[]} [metricValues] The metric values for the specified - * time window and timestep. - * **NOTE: This property will not be serialized. It can only be populated by - * the server.** + * The conflict resolution policy for the graph. */ - readonly metricValues?: MetricValue[]; + conflictResolutionPolicy?: ConflictResolutionPolicy; + /** + * A system generated property. A unique identifier. + */ + _rid?: string; + /** + * A system generated property that denotes the last updated timestamp of the resource. + */ + _ts?: any; + /** + * A system generated property representing the resource etag required for optimistic concurrency + * control. + */ + _etag?: string; } /** - * @interface - * An interface representing PercentileMetricValue. - * Represents percentile metrics values. - * - * @extends MetricValue + * Error Response. */ -export interface PercentileMetricValue extends MetricValue { +export interface ErrorResponse { /** - * @member {number} [p10] The 10th percentile value for the metric. - * **NOTE: This property will not be serialized. It can only be populated by - * the server.** + * Error code. */ - readonly p10?: number; + code?: string; /** - * @member {number} [p25] The 25th percentile value for the metric. - * **NOTE: This property will not be serialized. It can only be populated by - * the server.** + * Error message indicating why the operation failed. */ - readonly p25?: number; + message?: string; +} + +/** + * The list of new failover policies for the failover priority change. + */ +export interface FailoverPolicies { /** - * @member {number} [p50] The 50th percentile value for the metric. - * **NOTE: This property will not be serialized. It can only be populated by - * the server.** + * List of failover policies. */ - readonly p50?: number; + failoverPolicies: FailoverPolicy[]; +} + +/** + * Cosmos DB region to online or offline. + */ +export interface RegionForOnlineOffline { /** - * @member {number} [p75] The 75th percentile value for the metric. - * **NOTE: This property will not be serialized. It can only be populated by - * the server.** + * Cosmos DB region, with spaces between words and each word capitalized. */ - readonly p75?: number; + region: string; +} + +/** + * The system generated resource properties associated with SQL databases and SQL containers. + */ +export interface ExtendedResourceProperties { /** - * @member {number} [p90] The 90th percentile value for the metric. - * **NOTE: This property will not be serialized. It can only be populated by - * the server.** + * A system generated property. A unique identifier. */ - readonly p90?: number; + _rid?: string; /** - * @member {number} [p95] The 95th percentile value for the metric. - * **NOTE: This property will not be serialized. It can only be populated by - * the server.** + * A system generated property that denotes the last updated timestamp of the resource. */ - readonly p95?: number; + _ts?: any; /** - * @member {number} [p99] The 99th percentile value for the metric. - * **NOTE: This property will not be serialized. It can only be populated by - * the server.** + * A system generated property representing the resource etag required for optimistic concurrency + * control. */ - readonly p99?: number; + _etag?: string; } /** - * @interface - * An interface representing PercentileMetric. - * Percentile Metric data - * + * Parameters to create and update Cosmos DB database accounts. */ -export interface PercentileMetric { +export interface DatabaseAccountCreateUpdateParameters extends Resource { /** - * @member {Date} [startTime] The start time for the metric (ISO-8601 - * format). - * **NOTE: This property will not be serialized. It can only be populated by - * the server.** + * Indicates the type of database account. This can only be set at database account creation. + * Possible values include: 'GlobalDocumentDB', 'MongoDB', 'Parse'. Default value: + * 'GlobalDocumentDB'. */ - readonly startTime?: Date; + kind?: DatabaseAccountKind; /** - * @member {Date} [endTime] The end time for the metric (ISO-8601 format). - * **NOTE: This property will not be serialized. It can only be populated by - * the server.** + * The consistency policy for the Cosmos DB account. */ - readonly endTime?: Date; + consistencyPolicy?: ConsistencyPolicy; /** - * @member {string} [timeGrain] The time grain to be used to summarize the - * metric values. - * **NOTE: This property will not be serialized. It can only be populated by - * the server.** + * An array that contains the georeplication locations enabled for the Cosmos DB account. */ - readonly timeGrain?: string; + locations: Location[]; /** - * @member {UnitType} [unit] The unit of the metric. Possible values include: - * 'Count', 'Bytes', 'Seconds', 'Percent', 'CountPerSecond', - * 'BytesPerSecond', 'Milliseconds' + * Cosmos DB Firewall Support: This value specifies the set of IP addresses or IP address ranges + * in CIDR form to be included as the allowed list of client IPs for a given database account. IP + * addresses/ranges must be comma separated and must not contain any spaces. */ - unit?: UnitType; + ipRangeFilter?: string; /** - * @member {MetricName} [name] The name information for the metric. - * **NOTE: This property will not be serialized. It can only be populated by - * the server.** + * Flag to indicate whether to enable/disable Virtual Network ACL rules. */ - readonly name?: MetricName; + isVirtualNetworkFilterEnabled?: boolean; /** - * @member {PercentileMetricValue[]} [metricValues] The percentile metric - * values for the specified time window and timestep. - * **NOTE: This property will not be serialized. It can only be populated by - * the server.** + * Enables automatic failover of the write region in the rare event that the region is + * unavailable due to an outage. Automatic failover will result in a new write region for the + * account and is chosen based on the failover priorities configured for the account. */ - readonly metricValues?: PercentileMetricValue[]; + enableAutomaticFailover?: boolean; + /** + * List of Cosmos DB capabilities for the account + */ + capabilities?: Capability[]; + /** + * List of Virtual Network ACL rules configured for the Cosmos DB account. + */ + virtualNetworkRules?: VirtualNetworkRule[]; + /** + * Enables the account to write in multiple locations + */ + enableMultipleWriteLocations?: boolean; } /** - * @interface - * An interface representing PartitionMetric. - * The metric values for a single partition. - * - * @extends Metric + * Parameters for patching Azure Cosmos DB database account properties. */ -export interface PartitionMetric extends Metric { +export interface DatabaseAccountPatchParameters { + tags?: { [propertyName: string]: string }; /** - * @member {string} [partitionId] The parition id (GUID identifier) of the - * metric values. - * **NOTE: This property will not be serialized. It can only be populated by - * the server.** + * List of Cosmos DB capabilities for the account */ - readonly partitionId?: string; + capabilities?: Capability[]; +} + +/** + * The read-only access keys for the given database account. + */ +export interface DatabaseAccountListReadOnlyKeysResult { /** - * @member {string} [partitionKeyRangeId] The partition key range id (integer - * identifier) of the metric values. - * **NOTE: This property will not be serialized. It can only be populated by - * the server.** + * Base 64 encoded value of the primary read-only key. + * **NOTE: This property will not be serialized. It can only be populated by the server.** */ - readonly partitionKeyRangeId?: string; + readonly primaryReadonlyMasterKey?: string; + /** + * Base 64 encoded value of the secondary read-only key. + * **NOTE: This property will not be serialized. It can only be populated by the server.** + */ + readonly secondaryReadonlyMasterKey?: string; } /** - * @interface - * An interface representing DatabaseAccountsListUsagesOptionalParams. - * Optional Parameters. - * - * @extends RequestOptionsBase + * The access keys for the given database account. */ -export interface DatabaseAccountsListUsagesOptionalParams extends msRest.RequestOptionsBase { +export interface DatabaseAccountListKeysResult { /** - * @member {string} [filter] An OData filter expression that describes a - * subset of usages to return. The supported parameter is name.value (name of - * the metric, can have an or of multiple names). + * Base 64 encoded value of the primary read-write key. + * **NOTE: This property will not be serialized. It can only be populated by the server.** */ - filter?: string; + readonly primaryMasterKey?: string; + /** + * Base 64 encoded value of the secondary read-write key. + * **NOTE: This property will not be serialized. It can only be populated by the server.** + */ + readonly secondaryMasterKey?: string; + /** + * Base 64 encoded value of the primary read-only key. + * **NOTE: This property will not be serialized. It can only be populated by the server.** + */ + readonly primaryReadonlyMasterKey?: string; + /** + * Base 64 encoded value of the secondary read-only key. + * **NOTE: This property will not be serialized. It can only be populated by the server.** + */ + readonly secondaryReadonlyMasterKey?: string; } /** - * @interface - * An interface representing DatabaseListUsagesOptionalParams. - * Optional Parameters. - * - * @extends RequestOptionsBase + * Connection string for the Cosmos DB account */ -export interface DatabaseListUsagesOptionalParams extends msRest.RequestOptionsBase { +export interface DatabaseAccountConnectionString { /** - * @member {string} [filter] An OData filter expression that describes a - * subset of usages to return. The supported parameter is name.value (name of - * the metric, can have an or of multiple names). + * Value of the connection string + * **NOTE: This property will not be serialized. It can only be populated by the server.** */ - filter?: string; + readonly connectionString?: string; + /** + * Description of the connection string + * **NOTE: This property will not be serialized. It can only be populated by the server.** + */ + readonly description?: string; } /** - * @interface - * An interface representing CollectionListUsagesOptionalParams. - * Optional Parameters. - * - * @extends RequestOptionsBase + * The connection strings for the given database account. */ -export interface CollectionListUsagesOptionalParams extends msRest.RequestOptionsBase { +export interface DatabaseAccountListConnectionStringsResult { /** - * @member {string} [filter] An OData filter expression that describes a - * subset of usages to return. The supported parameter is name.value (name of - * the metric, can have an or of multiple names). + * An array that contains the connection strings for the Cosmos DB account. */ - filter?: string; + connectionStrings?: DatabaseAccountConnectionString[]; } /** - * @interface - * An interface representing CollectionPartitionListUsagesOptionalParams. - * Optional Parameters. - * - * @extends RequestOptionsBase + * Parameters to regenerate the keys within the database account. */ -export interface CollectionPartitionListUsagesOptionalParams extends msRest.RequestOptionsBase { +export interface DatabaseAccountRegenerateKeyParameters { /** - * @member {string} [filter] An OData filter expression that describes a - * subset of usages to return. The supported parameter is name.value (name of - * the metric, can have an or of multiple names). + * The access key to regenerate. Possible values include: 'primary', 'secondary', + * 'primaryReadonly', 'secondaryReadonly' */ - filter?: string; + keyKind: KeyKind; } /** - * @interface - * An interface representing CosmosDBManagementClientOptions. - * @extends AzureServiceClientOptions + * Cosmos DB SQL database id object */ -export interface CosmosDBManagementClientOptions extends AzureServiceClientOptions { +export interface SqlDatabaseResource { /** - * @member {string} [baseUri] + * Name of the Cosmos DB SQL database */ - baseUri?: string; + id: string; } +/** + * Parameters to create and update Cosmos DB SQL database. + */ +export interface SqlDatabaseCreateUpdateParameters { + /** + * The standard JSON format of a SQL database + */ + resource: SqlDatabaseResource; + /** + * A key-value pair of options to be applied for the request. This corresponds to the headers + * sent with the request. + */ + options: { [propertyName: string]: string }; +} /** - * @interface - * An interface representing the DatabaseAccountsListResult. - * The List operation response, that contains the database accounts and their - * properties. - * - * @extends Array + * Cosmos DB SQL container resource object */ -export interface DatabaseAccountsListResult extends Array { +export interface SqlContainerResource { + /** + * Name of the Cosmos DB SQL container + */ + id: string; + /** + * The configuration of the indexing policy. By default, the indexing is automatic for all + * document paths within the container + */ + indexingPolicy?: IndexingPolicy; + /** + * The configuration of the partition key to be used for partitioning data into multiple + * partitions + */ + partitionKey?: ContainerPartitionKey; + /** + * Default time to live + */ + defaultTtl?: number; + /** + * The unique key policy configuration for specifying uniqueness constraints on documents in the + * collection in the Azure Cosmos DB service. + */ + uniqueKeyPolicy?: UniqueKeyPolicy; + /** + * The conflict resolution policy for the container. + */ + conflictResolutionPolicy?: ConflictResolutionPolicy; } /** - * @interface - * An interface representing the MetricListResult. - * The response to a list metrics request. - * - * @extends Array + * Parameters to create and update Cosmos DB container. */ -export interface MetricListResult extends Array { +export interface SqlContainerCreateUpdateParameters { + /** + * The standard JSON format of a container + */ + resource: SqlContainerResource; + /** + * A key-value pair of options to be applied for the request. This corresponds to the headers + * sent with the request. + */ + options: { [propertyName: string]: string }; } /** - * @interface - * An interface representing the UsagesResult. - * The response to a list usage request. - * - * @extends Array + * Cosmos DB MongoDB database id object */ -export interface UsagesResult extends Array { +export interface MongoDBDatabaseResource { + /** + * Name of the Cosmos DB MongoDB database + */ + id: string; } /** - * @interface - * An interface representing the MetricDefinitionsListResult. - * The response to a list metric definitions request. - * - * @extends Array + * Parameters to create and update Cosmos DB MongoDB database. */ -export interface MetricDefinitionsListResult extends Array { +export interface MongoDBDatabaseCreateUpdateParameters { + /** + * The standard JSON format of a MongoDB database + */ + resource: MongoDBDatabaseResource; + /** + * A key-value pair of options to be applied for the request. This corresponds to the headers + * sent with the request. + */ + options: { [propertyName: string]: string }; +} + +/** + * Cosmos DB MongoDB collection resource object + */ +export interface MongoIndexKeys { + /** + * List of keys for each MongoDB collection in the Azure Cosmos DB service + */ + keys?: string[]; +} + +/** + * Cosmos DB MongoDB collection index options + */ +export interface MongoIndexOptions { + /** + * Expire after seconds + */ + expireAfterSeconds?: number; + /** + * Is unique or not + */ + unique?: boolean; +} + +/** + * Cosmos DB MongoDB collection index key + */ +export interface MongoIndex { + /** + * Cosmos DB MongoDB collection index keys + */ + key?: MongoIndexKeys; + /** + * Cosmos DB MongoDB collection index key options + */ + options?: MongoIndexOptions; +} + +/** + * Cosmos DB MongoDB collection resource object + */ +export interface MongoDBCollectionResource { + /** + * Name of the Cosmos DB MongoDB collection + */ + id: string; + /** + * A key-value pair of shard keys to be applied for the request. + */ + shardKey?: { [propertyName: string]: string }; + /** + * List of index keys + */ + indexes?: MongoIndex[]; +} + +/** + * Parameters to create and update Cosmos DB MongoDB collection. + */ +export interface MongoDBCollectionCreateUpdateParameters { + /** + * The standard JSON format of a MongoDB collection + */ + resource: MongoDBCollectionResource; + /** + * A key-value pair of options to be applied for the request. This corresponds to the headers + * sent with the request. + */ + options: { [propertyName: string]: string }; +} + +/** + * Cosmos DB table id object + */ +export interface TableResource { + /** + * Name of the Cosmos DB table + */ + id: string; +} + +/** + * Parameters to create and update Cosmos DB Table. + */ +export interface TableCreateUpdateParameters { + /** + * The standard JSON format of a Table + */ + resource: TableResource; + /** + * A key-value pair of options to be applied for the request. This corresponds to the headers + * sent with the request. + */ + options: { [propertyName: string]: string }; +} + +/** + * Cosmos DB Cassandra keyspace id object + */ +export interface CassandraKeyspaceResource { + /** + * Name of the Cosmos DB Cassandra keyspace + */ + id: string; +} + +/** + * Parameters to create and update Cosmos DB Cassandra keyspace. + */ +export interface CassandraKeyspaceCreateUpdateParameters { + /** + * The standard JSON format of a Cassandra keyspace + */ + resource: CassandraKeyspaceResource; + /** + * A key-value pair of options to be applied for the request. This corresponds to the headers + * sent with the request. + */ + options: { [propertyName: string]: string }; +} + +/** + * Cosmos DB Cassandra table column + */ +export interface Column { + /** + * Name of the Cosmos DB Cassandra table column + */ + name?: string; + /** + * Type of the Cosmos DB Cassandra table column + */ + type?: string; +} + +/** + * Cosmos DB Cassandra table partition key + */ +export interface CassandraPartitionKey { + /** + * Name of the Cosmos DB Cassandra table partition key + */ + name?: string; +} + +/** + * Cosmos DB Cassandra table cluster key + */ +export interface ClusterKey { + /** + * Name of the Cosmos DB Cassandra table cluster key + */ + name?: string; + /** + * Order of the Cosmos DB Cassandra table cluster key, only support "Asc" and "Desc" + */ + orderBy?: string; +} + +/** + * Cosmos DB Cassandra table schema + */ +export interface CassandraSchema { + /** + * List of Cassandra table columns. + */ + columns?: Column[]; + /** + * List of partition key. + */ + partitionKeys?: CassandraPartitionKey[]; + /** + * List of cluster key. + */ + clusterKeys?: ClusterKey[]; +} + +/** + * Cosmos DB Cassandra table id object + */ +export interface CassandraTableResource { + /** + * Name of the Cosmos DB Cassandra table + */ + id: string; + /** + * Time to live of the Cosmos DB Cassandra table + */ + defaultTtl?: number; + /** + * Schema of the Cosmos DB Cassandra table + */ + schema?: CassandraSchema; +} + +/** + * Parameters to create and update Cosmos DB Cassandra table. + */ +export interface CassandraTableCreateUpdateParameters { + /** + * The standard JSON format of a Cassandra table + */ + resource: CassandraTableResource; + /** + * A key-value pair of options to be applied for the request. This corresponds to the headers + * sent with the request. + */ + options: { [propertyName: string]: string }; } /** - * @interface - * An interface representing the OperationListResult. - * Result of the request to list Resource Provider operations. It contains a - * list of operations and a URL link to get the next set of results. - * - * @extends Array + * Cosmos DB Gremlin database id object + */ +export interface GremlinDatabaseResource { + /** + * Name of the Cosmos DB Gremlin database + */ + id: string; +} + +/** + * Parameters to create and update Cosmos DB Gremlin database. + */ +export interface GremlinDatabaseCreateUpdateParameters { + /** + * The standard JSON format of a Gremlin database + */ + resource: GremlinDatabaseResource; + /** + * A key-value pair of options to be applied for the request. This corresponds to the headers + * sent with the request. + */ + options: { [propertyName: string]: string }; +} + +/** + * Cosmos DB Gremlin graph resource object + */ +export interface GremlinGraphResource { + /** + * Name of the Cosmos DB Gremlin graph + */ + id: string; + /** + * The configuration of the indexing policy. By default, the indexing is automatic for all + * document paths within the graph + */ + indexingPolicy?: IndexingPolicy; + /** + * The configuration of the partition key to be used for partitioning data into multiple + * partitions + */ + partitionKey?: ContainerPartitionKey; + /** + * Default time to live + */ + defaultTtl?: number; + /** + * The unique key policy configuration for specifying uniqueness constraints on documents in the + * collection in the Azure Cosmos DB service. + */ + uniqueKeyPolicy?: UniqueKeyPolicy; + /** + * The conflict resolution policy for the graph. + */ + conflictResolutionPolicy?: ConflictResolutionPolicy; +} + +/** + * Parameters to create and update Cosmos DB Gremlin graph. + */ +export interface GremlinGraphCreateUpdateParameters { + /** + * The standard JSON format of a Gremlin graph + */ + resource: GremlinGraphResource; + /** + * A key-value pair of options to be applied for the request. This corresponds to the headers + * sent with the request. + */ + options: { [propertyName: string]: string }; +} + +/** + * The object that represents the operation. + */ +export interface OperationDisplay { + /** + * Service provider: Microsoft.ResourceProvider + */ + provider?: string; + /** + * Resource on which the operation is performed: Profile, endpoint, etc. + */ + resource?: string; + /** + * Operation type: Read, write, delete, etc. + */ + operation?: string; + /** + * Description of operation + */ + description?: string; +} + +/** + * REST API operation + */ +export interface Operation { + /** + * Operation name: {provider}/{resource}/{operation} + */ + name?: string; + /** + * The object that represents the operation. + */ + display?: OperationDisplay; +} + +/** + * A metric name. + */ +export interface MetricName { + /** + * The name of the metric. + * **NOTE: This property will not be serialized. It can only be populated by the server.** + */ + readonly value?: string; + /** + * The friendly name of the metric. + * **NOTE: This property will not be serialized. It can only be populated by the server.** + */ + readonly localizedValue?: string; +} + +/** + * The usage data for a usage request. + */ +export interface Usage { + /** + * The unit of the metric. Possible values include: 'Count', 'Bytes', 'Seconds', 'Percent', + * 'CountPerSecond', 'BytesPerSecond', 'Milliseconds' + */ + unit?: UnitType; + /** + * The name information for the metric. + * **NOTE: This property will not be serialized. It can only be populated by the server.** + */ + readonly name?: MetricName; + /** + * The quota period used to summarize the usage values. + * **NOTE: This property will not be serialized. It can only be populated by the server.** + */ + readonly quotaPeriod?: string; + /** + * Maximum value for this metric + * **NOTE: This property will not be serialized. It can only be populated by the server.** + */ + readonly limit?: number; + /** + * Current value for this metric + * **NOTE: This property will not be serialized. It can only be populated by the server.** + */ + readonly currentValue?: number; +} + +/** + * The partition level usage data for a usage request. + */ +export interface PartitionUsage extends Usage { + /** + * The partition id (GUID identifier) of the usages. + * **NOTE: This property will not be serialized. It can only be populated by the server.** + */ + readonly partitionId?: string; + /** + * The partition key range id (integer identifier) of the usages. + * **NOTE: This property will not be serialized. It can only be populated by the server.** + */ + readonly partitionKeyRangeId?: string; +} + +/** + * The availability of the metric. + */ +export interface MetricAvailability { + /** + * The time grain to be used to summarize the metric values. + * **NOTE: This property will not be serialized. It can only be populated by the server.** + */ + readonly timeGrain?: string; + /** + * The retention for the metric values. + * **NOTE: This property will not be serialized. It can only be populated by the server.** + */ + readonly retention?: string; +} + +/** + * The definition of a metric. + */ +export interface MetricDefinition { + /** + * The list of metric availabilities for the account. + * **NOTE: This property will not be serialized. It can only be populated by the server.** + */ + readonly metricAvailabilities?: MetricAvailability[]; + /** + * The primary aggregation type of the metric. Possible values include: 'None', 'Average', + * 'Total', 'Minimimum', 'Maximum', 'Last' + * **NOTE: This property will not be serialized. It can only be populated by the server.** + */ + readonly primaryAggregationType?: PrimaryAggregationType; + /** + * The unit of the metric. Possible values include: 'Count', 'Bytes', 'Seconds', 'Percent', + * 'CountPerSecond', 'BytesPerSecond', 'Milliseconds' + */ + unit?: UnitType; + /** + * The resource uri of the database. + * **NOTE: This property will not be serialized. It can only be populated by the server.** + */ + readonly resourceUri?: string; + /** + * The name information for the metric. + * **NOTE: This property will not be serialized. It can only be populated by the server.** + */ + readonly name?: MetricName; +} + +/** + * Represents metrics values. + */ +export interface MetricValue { + /** + * The number of values for the metric. + * **NOTE: This property will not be serialized. It can only be populated by the server.** + */ + readonly _count?: number; + /** + * The average value of the metric. + * **NOTE: This property will not be serialized. It can only be populated by the server.** + */ + readonly average?: number; + /** + * The max value of the metric. + * **NOTE: This property will not be serialized. It can only be populated by the server.** + */ + readonly maximum?: number; + /** + * The min value of the metric. + * **NOTE: This property will not be serialized. It can only be populated by the server.** + */ + readonly minimum?: number; + /** + * The metric timestamp (ISO-8601 format). + * **NOTE: This property will not be serialized. It can only be populated by the server.** + */ + readonly timestamp?: Date; + /** + * The total value of the metric. + * **NOTE: This property will not be serialized. It can only be populated by the server.** + */ + readonly total?: number; +} + +/** + * Metric data + */ +export interface Metric { + /** + * The start time for the metric (ISO-8601 format). + * **NOTE: This property will not be serialized. It can only be populated by the server.** + */ + readonly startTime?: Date; + /** + * The end time for the metric (ISO-8601 format). + * **NOTE: This property will not be serialized. It can only be populated by the server.** + */ + readonly endTime?: Date; + /** + * The time grain to be used to summarize the metric values. + * **NOTE: This property will not be serialized. It can only be populated by the server.** + */ + readonly timeGrain?: string; + /** + * The unit of the metric. Possible values include: 'Count', 'Bytes', 'Seconds', 'Percent', + * 'CountPerSecond', 'BytesPerSecond', 'Milliseconds' + */ + unit?: UnitType; + /** + * The name information for the metric. + * **NOTE: This property will not be serialized. It can only be populated by the server.** + */ + readonly name?: MetricName; + /** + * The metric values for the specified time window and timestep. + * **NOTE: This property will not be serialized. It can only be populated by the server.** + */ + readonly metricValues?: MetricValue[]; +} + +/** + * Represents percentile metrics values. + */ +export interface PercentileMetricValue extends MetricValue { + /** + * The 10th percentile value for the metric. + * **NOTE: This property will not be serialized. It can only be populated by the server.** + */ + readonly p10?: number; + /** + * The 25th percentile value for the metric. + * **NOTE: This property will not be serialized. It can only be populated by the server.** + */ + readonly p25?: number; + /** + * The 50th percentile value for the metric. + * **NOTE: This property will not be serialized. It can only be populated by the server.** + */ + readonly p50?: number; + /** + * The 75th percentile value for the metric. + * **NOTE: This property will not be serialized. It can only be populated by the server.** + */ + readonly p75?: number; + /** + * The 90th percentile value for the metric. + * **NOTE: This property will not be serialized. It can only be populated by the server.** + */ + readonly p90?: number; + /** + * The 95th percentile value for the metric. + * **NOTE: This property will not be serialized. It can only be populated by the server.** + */ + readonly p95?: number; + /** + * The 99th percentile value for the metric. + * **NOTE: This property will not be serialized. It can only be populated by the server.** + */ + readonly p99?: number; +} + +/** + * Percentile Metric data + */ +export interface PercentileMetric { + /** + * The start time for the metric (ISO-8601 format). + * **NOTE: This property will not be serialized. It can only be populated by the server.** + */ + readonly startTime?: Date; + /** + * The end time for the metric (ISO-8601 format). + * **NOTE: This property will not be serialized. It can only be populated by the server.** + */ + readonly endTime?: Date; + /** + * The time grain to be used to summarize the metric values. + * **NOTE: This property will not be serialized. It can only be populated by the server.** + */ + readonly timeGrain?: string; + /** + * The unit of the metric. Possible values include: 'Count', 'Bytes', 'Seconds', 'Percent', + * 'CountPerSecond', 'BytesPerSecond', 'Milliseconds' + */ + unit?: UnitType; + /** + * The name information for the metric. + * **NOTE: This property will not be serialized. It can only be populated by the server.** + */ + readonly name?: MetricName; + /** + * The percentile metric values for the specified time window and timestep. + * **NOTE: This property will not be serialized. It can only be populated by the server.** + */ + readonly metricValues?: PercentileMetricValue[]; +} + +/** + * The metric values for a single partition. + */ +export interface PartitionMetric extends Metric { + /** + * The partition id (GUID identifier) of the metric values. + * **NOTE: This property will not be serialized. It can only be populated by the server.** + */ + readonly partitionId?: string; + /** + * The partition key range id (integer identifier) of the metric values. + * **NOTE: This property will not be serialized. It can only be populated by the server.** + */ + readonly partitionKeyRangeId?: string; +} + +/** + * Optional Parameters. + */ +export interface DatabaseAccountsListUsagesOptionalParams extends msRest.RequestOptionsBase { + /** + * An OData filter expression that describes a subset of usages to return. The supported + * parameter is name.value (name of the metric, can have an or of multiple names). + */ + filter?: string; +} + +/** + * Optional Parameters. + */ +export interface DatabaseListUsagesOptionalParams extends msRest.RequestOptionsBase { + /** + * An OData filter expression that describes a subset of usages to return. The supported + * parameter is name.value (name of the metric, can have an or of multiple names). + */ + filter?: string; +} + +/** + * Optional Parameters. + */ +export interface CollectionListUsagesOptionalParams extends msRest.RequestOptionsBase { + /** + * An OData filter expression that describes a subset of usages to return. The supported + * parameter is name.value (name of the metric, can have an or of multiple names). + */ + filter?: string; +} + +/** + * Optional Parameters. + */ +export interface CollectionPartitionListUsagesOptionalParams extends msRest.RequestOptionsBase { + /** + * An OData filter expression that describes a subset of usages to return. The supported + * parameter is name.value (name of the metric, can have an or of multiple names). + */ + filter?: string; +} + +/** + * An interface representing CosmosDBManagementClientOptions. + */ +export interface CosmosDBManagementClientOptions extends AzureServiceClientOptions { + baseUri?: string; +} + +/** + * @interface + * The List operation response, that contains the database accounts and their properties. + * @extends Array + */ +export interface DatabaseAccountsListResult extends Array { +} + +/** + * @interface + * The response to a list metrics request. + * @extends Array + */ +export interface MetricListResult extends Array { +} + +/** + * @interface + * The response to a list usage request. + * @extends Array + */ +export interface UsagesResult extends Array { +} + +/** + * @interface + * The response to a list metric definitions request. + * @extends Array + */ +export interface MetricDefinitionsListResult extends Array { +} + +/** + * @interface + * The List operation response, that contains the SQL databases and their properties. + * @extends Array + */ +export interface SqlDatabaseListResult extends Array { +} + +/** + * @interface + * The List operation response, that contains the containers and their properties. + * @extends Array + */ +export interface SqlContainerListResult extends Array { +} + +/** + * @interface + * The List operation response, that contains the MongoDB databases and their properties. + * @extends Array + */ +export interface MongoDBDatabaseListResult extends Array { +} + +/** + * @interface + * The List operation response, that contains the MongoDB collections and their properties. + * @extends Array + */ +export interface MongoDBCollectionListResult extends Array { +} + +/** + * @interface + * The List operation response, that contains the Table and their properties. + * @extends Array + */ +export interface TableListResult extends Array
{ +} + +/** + * @interface + * The List operation response, that contains the Cassandra keyspaces and their properties. + * @extends Array + */ +export interface CassandraKeyspaceListResult extends Array { +} + +/** + * @interface + * The List operation response, that contains the Cassandra tables and their properties. + * @extends Array + */ +export interface CassandraTableListResult extends Array { +} + +/** + * @interface + * The List operation response, that contains the Gremlin databases and their properties. + * @extends Array + */ +export interface GremlinDatabaseListResult extends Array { +} + +/** + * @interface + * The List operation response, that contains the graphs and their properties. + * @extends Array + */ +export interface GremlinGraphListResult extends Array { +} + +/** + * @interface + * Result of the request to list Resource Provider operations. It contains a list of operations and + * a URL link to get the next set of results. + * @extends Array + */ +export interface OperationListResult extends Array { + /** + * URL to get the next set of operation list results if there are any. + */ + nextLink?: string; +} + +/** + * @interface + * The response to a list percentile metrics request. + * @extends Array + */ +export interface PercentileMetricListResult extends Array { +} + +/** + * @interface + * The response to a list partition metrics request. + * @extends Array + */ +export interface PartitionMetricListResult extends Array { +} + +/** + * @interface + * The response to a list partition level usage request. + * @extends Array + */ +export interface PartitionUsagesResult extends Array { +} + +/** + * Defines values for DatabaseAccountKind. + * Possible values include: 'GlobalDocumentDB', 'MongoDB', 'Parse' + * @readonly + * @enum {string} + */ +export type DatabaseAccountKind = 'GlobalDocumentDB' | 'MongoDB' | 'Parse'; + +/** + * Defines values for DatabaseAccountOfferType. + * Possible values include: 'Standard' + * @readonly + * @enum {string} + */ +export type DatabaseAccountOfferType = 'Standard'; + +/** + * Defines values for DefaultConsistencyLevel. + * Possible values include: 'Eventual', 'Session', 'BoundedStaleness', 'Strong', 'ConsistentPrefix' + * @readonly + * @enum {string} + */ +export type DefaultConsistencyLevel = 'Eventual' | 'Session' | 'BoundedStaleness' | 'Strong' | 'ConsistentPrefix'; + +/** + * Defines values for IndexingMode. + * Possible values include: 'Consistent', 'Lazy', 'None' + * @readonly + * @enum {string} + */ +export type IndexingMode = 'Consistent' | 'Lazy' | 'None'; + +/** + * Defines values for DataType. + * Possible values include: 'String', 'Number', 'Point', 'Polygon', 'LineString', 'MultiPolygon' + * @readonly + * @enum {string} + */ +export type DataType = 'String' | 'Number' | 'Point' | 'Polygon' | 'LineString' | 'MultiPolygon'; + +/** + * Defines values for IndexKind. + * Possible values include: 'Hash', 'Range', 'Spatial' + * @readonly + * @enum {string} + */ +export type IndexKind = 'Hash' | 'Range' | 'Spatial'; + +/** + * Defines values for PartitionKind. + * Possible values include: 'Hash', 'Range' + * @readonly + * @enum {string} + */ +export type PartitionKind = 'Hash' | 'Range'; + +/** + * Defines values for ConflictResolutionMode. + * Possible values include: 'LastWriterWins', 'Custom' + * @readonly + * @enum {string} + */ +export type ConflictResolutionMode = 'LastWriterWins' | 'Custom'; + +/** + * Defines values for KeyKind. + * Possible values include: 'primary', 'secondary', 'primaryReadonly', 'secondaryReadonly' + * @readonly + * @enum {string} + */ +export type KeyKind = 'primary' | 'secondary' | 'primaryReadonly' | 'secondaryReadonly'; + +/** + * Defines values for UnitType. + * Possible values include: 'Count', 'Bytes', 'Seconds', 'Percent', 'CountPerSecond', + * 'BytesPerSecond', 'Milliseconds' + * @readonly + * @enum {string} + */ +export type UnitType = 'Count' | 'Bytes' | 'Seconds' | 'Percent' | 'CountPerSecond' | 'BytesPerSecond' | 'Milliseconds'; + +/** + * Defines values for PrimaryAggregationType. + * Possible values include: 'None', 'Average', 'Total', 'Minimimum', 'Maximum', 'Last' + * @readonly + * @enum {string} + */ +export type PrimaryAggregationType = 'None' | 'Average' | 'Total' | 'Minimimum' | 'Maximum' | 'Last'; + +/** + * Contains response data for the get operation. + */ +export type DatabaseAccountsGetResponse = DatabaseAccount & { + /** + * The underlying HTTP response. + */ + _response: msRest.HttpResponse & { + /** + * The response body as text (string format) + */ + bodyAsText: string; + + /** + * The response body as parsed JSON or XML + */ + parsedBody: DatabaseAccount; + }; +}; + +/** + * Contains response data for the patch operation. + */ +export type DatabaseAccountsPatchResponse = DatabaseAccount & { + /** + * The underlying HTTP response. + */ + _response: msRest.HttpResponse & { + /** + * The response body as text (string format) + */ + bodyAsText: string; + + /** + * The response body as parsed JSON or XML + */ + parsedBody: DatabaseAccount; + }; +}; + +/** + * Contains response data for the createOrUpdate operation. + */ +export type DatabaseAccountsCreateOrUpdateResponse = DatabaseAccount & { + /** + * The underlying HTTP response. + */ + _response: msRest.HttpResponse & { + /** + * The response body as text (string format) + */ + bodyAsText: string; + + /** + * The response body as parsed JSON or XML + */ + parsedBody: DatabaseAccount; + }; +}; + +/** + * Contains response data for the list operation. + */ +export type DatabaseAccountsListResponse = DatabaseAccountsListResult & { + /** + * The underlying HTTP response. + */ + _response: msRest.HttpResponse & { + /** + * The response body as text (string format) + */ + bodyAsText: string; + + /** + * The response body as parsed JSON or XML + */ + parsedBody: DatabaseAccountsListResult; + }; +}; + +/** + * Contains response data for the listByResourceGroup operation. + */ +export type DatabaseAccountsListByResourceGroupResponse = DatabaseAccountsListResult & { + /** + * The underlying HTTP response. + */ + _response: msRest.HttpResponse & { + /** + * The response body as text (string format) + */ + bodyAsText: string; + + /** + * The response body as parsed JSON or XML + */ + parsedBody: DatabaseAccountsListResult; + }; +}; + +/** + * Contains response data for the listKeys operation. + */ +export type DatabaseAccountsListKeysResponse = DatabaseAccountListKeysResult & { + /** + * The underlying HTTP response. + */ + _response: msRest.HttpResponse & { + /** + * The response body as text (string format) + */ + bodyAsText: string; + + /** + * The response body as parsed JSON or XML + */ + parsedBody: DatabaseAccountListKeysResult; + }; +}; + +/** + * Contains response data for the listConnectionStrings operation. + */ +export type DatabaseAccountsListConnectionStringsResponse = DatabaseAccountListConnectionStringsResult & { + /** + * The underlying HTTP response. + */ + _response: msRest.HttpResponse & { + /** + * The response body as text (string format) + */ + bodyAsText: string; + + /** + * The response body as parsed JSON or XML + */ + parsedBody: DatabaseAccountListConnectionStringsResult; + }; +}; + +/** + * Contains response data for the getReadOnlyKeys operation. + */ +export type DatabaseAccountsGetReadOnlyKeysResponse = DatabaseAccountListReadOnlyKeysResult & { + /** + * The underlying HTTP response. + */ + _response: msRest.HttpResponse & { + /** + * The response body as text (string format) + */ + bodyAsText: string; + + /** + * The response body as parsed JSON or XML + */ + parsedBody: DatabaseAccountListReadOnlyKeysResult; + }; +}; + +/** + * Contains response data for the listReadOnlyKeys operation. + */ +export type DatabaseAccountsListReadOnlyKeysResponse = DatabaseAccountListReadOnlyKeysResult & { + /** + * The underlying HTTP response. + */ + _response: msRest.HttpResponse & { + /** + * The response body as text (string format) + */ + bodyAsText: string; + + /** + * The response body as parsed JSON or XML + */ + parsedBody: DatabaseAccountListReadOnlyKeysResult; + }; +}; + +/** + * Contains response data for the checkNameExists operation. + */ +export type DatabaseAccountsCheckNameExistsResponse = { + /** + * The parsed response body. + */ + body: boolean; + + /** + * The underlying HTTP response. + */ + _response: msRest.HttpResponse & { + /** + * The response body as text (string format) + */ + bodyAsText: string; + + /** + * The response body as parsed JSON or XML + */ + parsedBody: boolean; + }; +}; + +/** + * Contains response data for the listMetrics operation. + */ +export type DatabaseAccountsListMetricsResponse = MetricListResult & { + /** + * The underlying HTTP response. + */ + _response: msRest.HttpResponse & { + /** + * The response body as text (string format) + */ + bodyAsText: string; + + /** + * The response body as parsed JSON or XML + */ + parsedBody: MetricListResult; + }; +}; + +/** + * Contains response data for the listUsages operation. + */ +export type DatabaseAccountsListUsagesResponse = UsagesResult & { + /** + * The underlying HTTP response. + */ + _response: msRest.HttpResponse & { + /** + * The response body as text (string format) + */ + bodyAsText: string; + + /** + * The response body as parsed JSON or XML + */ + parsedBody: UsagesResult; + }; +}; + +/** + * Contains response data for the listMetricDefinitions operation. + */ +export type DatabaseAccountsListMetricDefinitionsResponse = MetricDefinitionsListResult & { + /** + * The underlying HTTP response. + */ + _response: msRest.HttpResponse & { + /** + * The response body as text (string format) + */ + bodyAsText: string; + + /** + * The response body as parsed JSON or XML + */ + parsedBody: MetricDefinitionsListResult; + }; +}; + +/** + * Contains response data for the listSqlDatabases operation. + */ +export type DatabaseAccountsListSqlDatabasesResponse = SqlDatabaseListResult & { + /** + * The underlying HTTP response. + */ + _response: msRest.HttpResponse & { + /** + * The response body as text (string format) + */ + bodyAsText: string; + + /** + * The response body as parsed JSON or XML + */ + parsedBody: SqlDatabaseListResult; + }; +}; + +/** + * Contains response data for the getSqlDatabase operation. + */ +export type DatabaseAccountsGetSqlDatabaseResponse = SqlDatabase & { + /** + * The underlying HTTP response. + */ + _response: msRest.HttpResponse & { + /** + * The response body as text (string format) + */ + bodyAsText: string; + + /** + * The response body as parsed JSON or XML + */ + parsedBody: SqlDatabase; + }; +}; + +/** + * Contains response data for the createUpdateSqlDatabase operation. + */ +export type DatabaseAccountsCreateUpdateSqlDatabaseResponse = SqlDatabase & { + /** + * The underlying HTTP response. + */ + _response: msRest.HttpResponse & { + /** + * The response body as text (string format) + */ + bodyAsText: string; + + /** + * The response body as parsed JSON or XML + */ + parsedBody: SqlDatabase; + }; +}; + +/** + * Contains response data for the listSqlContainers operation. + */ +export type DatabaseAccountsListSqlContainersResponse = SqlContainerListResult & { + /** + * The underlying HTTP response. + */ + _response: msRest.HttpResponse & { + /** + * The response body as text (string format) + */ + bodyAsText: string; + + /** + * The response body as parsed JSON or XML + */ + parsedBody: SqlContainerListResult; + }; +}; + +/** + * Contains response data for the getSqlContainer operation. + */ +export type DatabaseAccountsGetSqlContainerResponse = SqlContainer & { + /** + * The underlying HTTP response. + */ + _response: msRest.HttpResponse & { + /** + * The response body as text (string format) + */ + bodyAsText: string; + + /** + * The response body as parsed JSON or XML + */ + parsedBody: SqlContainer; + }; +}; + +/** + * Contains response data for the createUpdateSqlContainer operation. + */ +export type DatabaseAccountsCreateUpdateSqlContainerResponse = SqlContainer & { + /** + * The underlying HTTP response. + */ + _response: msRest.HttpResponse & { + /** + * The response body as text (string format) + */ + bodyAsText: string; + + /** + * The response body as parsed JSON or XML + */ + parsedBody: SqlContainer; + }; +}; + +/** + * Contains response data for the listMongoDBDatabases operation. + */ +export type DatabaseAccountsListMongoDBDatabasesResponse = MongoDBDatabaseListResult & { + /** + * The underlying HTTP response. + */ + _response: msRest.HttpResponse & { + /** + * The response body as text (string format) + */ + bodyAsText: string; + + /** + * The response body as parsed JSON or XML + */ + parsedBody: MongoDBDatabaseListResult; + }; +}; + +/** + * Contains response data for the getMongoDBDatabase operation. + */ +export type DatabaseAccountsGetMongoDBDatabaseResponse = MongoDBDatabase & { + /** + * The underlying HTTP response. + */ + _response: msRest.HttpResponse & { + /** + * The response body as text (string format) + */ + bodyAsText: string; + + /** + * The response body as parsed JSON or XML + */ + parsedBody: MongoDBDatabase; + }; +}; + +/** + * Contains response data for the createUpdateMongoDBDatabase operation. + */ +export type DatabaseAccountsCreateUpdateMongoDBDatabaseResponse = MongoDBDatabase & { + /** + * The underlying HTTP response. + */ + _response: msRest.HttpResponse & { + /** + * The response body as text (string format) + */ + bodyAsText: string; + + /** + * The response body as parsed JSON or XML + */ + parsedBody: MongoDBDatabase; + }; +}; + +/** + * Contains response data for the listMongoDBCollections operation. + */ +export type DatabaseAccountsListMongoDBCollectionsResponse = MongoDBCollectionListResult & { + /** + * The underlying HTTP response. + */ + _response: msRest.HttpResponse & { + /** + * The response body as text (string format) + */ + bodyAsText: string; + + /** + * The response body as parsed JSON or XML + */ + parsedBody: MongoDBCollectionListResult; + }; +}; + +/** + * Contains response data for the getMongoDBCollection operation. + */ +export type DatabaseAccountsGetMongoDBCollectionResponse = MongoDBCollection & { + /** + * The underlying HTTP response. + */ + _response: msRest.HttpResponse & { + /** + * The response body as text (string format) + */ + bodyAsText: string; + + /** + * The response body as parsed JSON or XML + */ + parsedBody: MongoDBCollection; + }; +}; + +/** + * Contains response data for the createUpdateMongoDBCollection operation. + */ +export type DatabaseAccountsCreateUpdateMongoDBCollectionResponse = MongoDBCollection & { + /** + * The underlying HTTP response. + */ + _response: msRest.HttpResponse & { + /** + * The response body as text (string format) + */ + bodyAsText: string; + + /** + * The response body as parsed JSON or XML + */ + parsedBody: MongoDBCollection; + }; +}; + +/** + * Contains response data for the listTables operation. + */ +export type DatabaseAccountsListTablesResponse = TableListResult & { + /** + * The underlying HTTP response. + */ + _response: msRest.HttpResponse & { + /** + * The response body as text (string format) + */ + bodyAsText: string; + + /** + * The response body as parsed JSON or XML + */ + parsedBody: TableListResult; + }; +}; + +/** + * Contains response data for the getTable operation. + */ +export type DatabaseAccountsGetTableResponse = Table & { + /** + * The underlying HTTP response. + */ + _response: msRest.HttpResponse & { + /** + * The response body as text (string format) + */ + bodyAsText: string; + + /** + * The response body as parsed JSON or XML + */ + parsedBody: Table; + }; +}; + +/** + * Contains response data for the createUpdateTable operation. + */ +export type DatabaseAccountsCreateUpdateTableResponse = Table & { + /** + * The underlying HTTP response. + */ + _response: msRest.HttpResponse & { + /** + * The response body as text (string format) + */ + bodyAsText: string; + + /** + * The response body as parsed JSON or XML + */ + parsedBody: Table; + }; +}; + +/** + * Contains response data for the listCassandraKeyspaces operation. */ -export interface OperationListResult extends Array { +export type DatabaseAccountsListCassandraKeyspacesResponse = CassandraKeyspaceListResult & { /** - * @member {string} [nextLink] URL to get the next set of operation list - * results if there are any. + * The underlying HTTP response. */ - nextLink?: string; -} + _response: msRest.HttpResponse & { + /** + * The response body as text (string format) + */ + bodyAsText: string; -/** - * @interface - * An interface representing the PercentileMetricListResult. - * The response to a list percentile metrics request. - * - * @extends Array - */ -export interface PercentileMetricListResult extends Array { -} + /** + * The response body as parsed JSON or XML + */ + parsedBody: CassandraKeyspaceListResult; + }; +}; /** - * @interface - * An interface representing the PartitionMetricListResult. - * The response to a list partition metrics request. - * - * @extends Array + * Contains response data for the getCassandraKeyspace operation. */ -export interface PartitionMetricListResult extends Array { -} +export type DatabaseAccountsGetCassandraKeyspaceResponse = CassandraKeyspace & { + /** + * The underlying HTTP response. + */ + _response: msRest.HttpResponse & { + /** + * The response body as text (string format) + */ + bodyAsText: string; -/** - * @interface - * An interface representing the PartitionUsagesResult. - * The response to a list partition level usage request. - * - * @extends Array - */ -export interface PartitionUsagesResult extends Array { -} + /** + * The response body as parsed JSON or XML + */ + parsedBody: CassandraKeyspace; + }; +}; /** - * Defines values for DatabaseAccountKind. - * Possible values include: 'GlobalDocumentDB', 'MongoDB', 'Parse' - * @readonly - * @enum {string} + * Contains response data for the createUpdateCassandraKeyspace operation. */ -export type DatabaseAccountKind = 'GlobalDocumentDB' | 'MongoDB' | 'Parse'; +export type DatabaseAccountsCreateUpdateCassandraKeyspaceResponse = CassandraKeyspace & { + /** + * The underlying HTTP response. + */ + _response: msRest.HttpResponse & { + /** + * The response body as text (string format) + */ + bodyAsText: string; -/** - * Defines values for DatabaseAccountOfferType. - * Possible values include: 'Standard' - * @readonly - * @enum {string} - */ -export type DatabaseAccountOfferType = 'Standard'; + /** + * The response body as parsed JSON or XML + */ + parsedBody: CassandraKeyspace; + }; +}; /** - * Defines values for DefaultConsistencyLevel. - * Possible values include: 'Eventual', 'Session', 'BoundedStaleness', 'Strong', 'ConsistentPrefix' - * @readonly - * @enum {string} + * Contains response data for the listCassandraTables operation. */ -export type DefaultConsistencyLevel = 'Eventual' | 'Session' | 'BoundedStaleness' | 'Strong' | 'ConsistentPrefix'; +export type DatabaseAccountsListCassandraTablesResponse = CassandraTableListResult & { + /** + * The underlying HTTP response. + */ + _response: msRest.HttpResponse & { + /** + * The response body as text (string format) + */ + bodyAsText: string; + + /** + * The response body as parsed JSON or XML + */ + parsedBody: CassandraTableListResult; + }; +}; /** - * Defines values for KeyKind. - * Possible values include: 'primary', 'secondary', 'primaryReadonly', 'secondaryReadonly' - * @readonly - * @enum {string} + * Contains response data for the getCassandraTable operation. */ -export type KeyKind = 'primary' | 'secondary' | 'primaryReadonly' | 'secondaryReadonly'; +export type DatabaseAccountsGetCassandraTableResponse = CassandraTable & { + /** + * The underlying HTTP response. + */ + _response: msRest.HttpResponse & { + /** + * The response body as text (string format) + */ + bodyAsText: string; + + /** + * The response body as parsed JSON or XML + */ + parsedBody: CassandraTable; + }; +}; /** - * Defines values for UnitType. - * Possible values include: 'Count', 'Bytes', 'Seconds', 'Percent', 'CountPerSecond', - * 'BytesPerSecond', 'Milliseconds' - * @readonly - * @enum {string} + * Contains response data for the createUpdateCassandraTable operation. */ -export type UnitType = 'Count' | 'Bytes' | 'Seconds' | 'Percent' | 'CountPerSecond' | 'BytesPerSecond' | 'Milliseconds'; +export type DatabaseAccountsCreateUpdateCassandraTableResponse = CassandraTable & { + /** + * The underlying HTTP response. + */ + _response: msRest.HttpResponse & { + /** + * The response body as text (string format) + */ + bodyAsText: string; + + /** + * The response body as parsed JSON or XML + */ + parsedBody: CassandraTable; + }; +}; /** - * Defines values for PrimaryAggregationType. - * Possible values include: 'None', 'Average', 'Total', 'Minimimum', 'Maximum', 'Last' - * @readonly - * @enum {string} + * Contains response data for the listGremlinDatabases operation. */ -export type PrimaryAggregationType = 'None' | 'Average' | 'Total' | 'Minimimum' | 'Maximum' | 'Last'; +export type DatabaseAccountsListGremlinDatabasesResponse = GremlinDatabaseListResult & { + /** + * The underlying HTTP response. + */ + _response: msRest.HttpResponse & { + /** + * The response body as text (string format) + */ + bodyAsText: string; + + /** + * The response body as parsed JSON or XML + */ + parsedBody: GremlinDatabaseListResult; + }; +}; /** - * Contains response data for the get operation. + * Contains response data for the getGremlinDatabase operation. */ -export type DatabaseAccountsGetResponse = DatabaseAccount & { +export type DatabaseAccountsGetGremlinDatabaseResponse = GremlinDatabase & { /** * The underlying HTTP response. */ @@ -1155,17 +2428,18 @@ export type DatabaseAccountsGetResponse = DatabaseAccount & { * The response body as text (string format) */ bodyAsText: string; + /** * The response body as parsed JSON or XML */ - parsedBody: DatabaseAccount; + parsedBody: GremlinDatabase; }; }; /** - * Contains response data for the patch operation. + * Contains response data for the createUpdateGremlinDatabase operation. */ -export type DatabaseAccountsPatchResponse = DatabaseAccount & { +export type DatabaseAccountsCreateUpdateGremlinDatabaseResponse = GremlinDatabase & { /** * The underlying HTTP response. */ @@ -1174,17 +2448,18 @@ export type DatabaseAccountsPatchResponse = DatabaseAccount & { * The response body as text (string format) */ bodyAsText: string; + /** * The response body as parsed JSON or XML */ - parsedBody: DatabaseAccount; + parsedBody: GremlinDatabase; }; }; /** - * Contains response data for the createOrUpdate operation. + * Contains response data for the listGremlinGraphs operation. */ -export type DatabaseAccountsCreateOrUpdateResponse = DatabaseAccount & { +export type DatabaseAccountsListGremlinGraphsResponse = GremlinGraphListResult & { /** * The underlying HTTP response. */ @@ -1193,17 +2468,18 @@ export type DatabaseAccountsCreateOrUpdateResponse = DatabaseAccount & { * The response body as text (string format) */ bodyAsText: string; + /** * The response body as parsed JSON or XML */ - parsedBody: DatabaseAccount; + parsedBody: GremlinGraphListResult; }; }; /** - * Contains response data for the list operation. + * Contains response data for the getGremlinGraph operation. */ -export type DatabaseAccountsListResponse = DatabaseAccountsListResult & { +export type DatabaseAccountsGetGremlinGraphResponse = GremlinGraph & { /** * The underlying HTTP response. */ @@ -1212,17 +2488,18 @@ export type DatabaseAccountsListResponse = DatabaseAccountsListResult & { * The response body as text (string format) */ bodyAsText: string; + /** * The response body as parsed JSON or XML */ - parsedBody: DatabaseAccountsListResult; + parsedBody: GremlinGraph; }; }; /** - * Contains response data for the listByResourceGroup operation. + * Contains response data for the createUpdateGremlinGraph operation. */ -export type DatabaseAccountsListByResourceGroupResponse = DatabaseAccountsListResult & { +export type DatabaseAccountsCreateUpdateGremlinGraphResponse = GremlinGraph & { /** * The underlying HTTP response. */ @@ -1231,17 +2508,18 @@ export type DatabaseAccountsListByResourceGroupResponse = DatabaseAccountsListRe * The response body as text (string format) */ bodyAsText: string; + /** * The response body as parsed JSON or XML */ - parsedBody: DatabaseAccountsListResult; + parsedBody: GremlinGraph; }; }; /** - * Contains response data for the listKeys operation. + * Contains response data for the beginPatch operation. */ -export type DatabaseAccountsListKeysResponse = DatabaseAccountListKeysResult & { +export type DatabaseAccountsBeginPatchResponse = DatabaseAccount & { /** * The underlying HTTP response. */ @@ -1250,17 +2528,18 @@ export type DatabaseAccountsListKeysResponse = DatabaseAccountListKeysResult & { * The response body as text (string format) */ bodyAsText: string; + /** * The response body as parsed JSON or XML */ - parsedBody: DatabaseAccountListKeysResult; + parsedBody: DatabaseAccount; }; }; /** - * Contains response data for the listConnectionStrings operation. + * Contains response data for the beginCreateOrUpdate operation. */ -export type DatabaseAccountsListConnectionStringsResponse = DatabaseAccountListConnectionStringsResult & { +export type DatabaseAccountsBeginCreateOrUpdateResponse = DatabaseAccount & { /** * The underlying HTTP response. */ @@ -1269,17 +2548,18 @@ export type DatabaseAccountsListConnectionStringsResponse = DatabaseAccountListC * The response body as text (string format) */ bodyAsText: string; + /** * The response body as parsed JSON or XML */ - parsedBody: DatabaseAccountListConnectionStringsResult; + parsedBody: DatabaseAccount; }; }; /** - * Contains response data for the getReadOnlyKeys operation. + * Contains response data for the beginCreateUpdateSqlDatabase operation. */ -export type DatabaseAccountsGetReadOnlyKeysResponse = DatabaseAccountListReadOnlyKeysResult & { +export type DatabaseAccountsBeginCreateUpdateSqlDatabaseResponse = SqlDatabase & { /** * The underlying HTTP response. */ @@ -1288,17 +2568,18 @@ export type DatabaseAccountsGetReadOnlyKeysResponse = DatabaseAccountListReadOnl * The response body as text (string format) */ bodyAsText: string; + /** * The response body as parsed JSON or XML */ - parsedBody: DatabaseAccountListReadOnlyKeysResult; + parsedBody: SqlDatabase; }; }; /** - * Contains response data for the listReadOnlyKeys operation. + * Contains response data for the beginCreateUpdateSqlContainer operation. */ -export type DatabaseAccountsListReadOnlyKeysResponse = DatabaseAccountListReadOnlyKeysResult & { +export type DatabaseAccountsBeginCreateUpdateSqlContainerResponse = SqlContainer & { /** * The underlying HTTP response. */ @@ -1307,21 +2588,38 @@ export type DatabaseAccountsListReadOnlyKeysResponse = DatabaseAccountListReadOn * The response body as text (string format) */ bodyAsText: string; + /** * The response body as parsed JSON or XML */ - parsedBody: DatabaseAccountListReadOnlyKeysResult; + parsedBody: SqlContainer; }; }; /** - * Contains response data for the checkNameExists operation. + * Contains response data for the beginCreateUpdateMongoDBDatabase operation. */ -export type DatabaseAccountsCheckNameExistsResponse = { +export type DatabaseAccountsBeginCreateUpdateMongoDBDatabaseResponse = MongoDBDatabase & { /** - * The parsed response body. + * The underlying HTTP response. */ - body: boolean; + _response: msRest.HttpResponse & { + /** + * The response body as text (string format) + */ + bodyAsText: string; + + /** + * The response body as parsed JSON or XML + */ + parsedBody: MongoDBDatabase; + }; +}; + +/** + * Contains response data for the beginCreateUpdateMongoDBCollection operation. + */ +export type DatabaseAccountsBeginCreateUpdateMongoDBCollectionResponse = MongoDBCollection & { /** * The underlying HTTP response. */ @@ -1330,17 +2628,18 @@ export type DatabaseAccountsCheckNameExistsResponse = { * The response body as text (string format) */ bodyAsText: string; + /** * The response body as parsed JSON or XML */ - parsedBody: boolean; + parsedBody: MongoDBCollection; }; }; /** - * Contains response data for the listMetrics operation. + * Contains response data for the beginCreateUpdateTable operation. */ -export type DatabaseAccountsListMetricsResponse = MetricListResult & { +export type DatabaseAccountsBeginCreateUpdateTableResponse = Table & { /** * The underlying HTTP response. */ @@ -1349,17 +2648,18 @@ export type DatabaseAccountsListMetricsResponse = MetricListResult & { * The response body as text (string format) */ bodyAsText: string; + /** * The response body as parsed JSON or XML */ - parsedBody: MetricListResult; + parsedBody: Table; }; }; /** - * Contains response data for the listUsages operation. + * Contains response data for the beginCreateUpdateCassandraKeyspace operation. */ -export type DatabaseAccountsListUsagesResponse = UsagesResult & { +export type DatabaseAccountsBeginCreateUpdateCassandraKeyspaceResponse = CassandraKeyspace & { /** * The underlying HTTP response. */ @@ -1368,17 +2668,18 @@ export type DatabaseAccountsListUsagesResponse = UsagesResult & { * The response body as text (string format) */ bodyAsText: string; + /** * The response body as parsed JSON or XML */ - parsedBody: UsagesResult; + parsedBody: CassandraKeyspace; }; }; /** - * Contains response data for the listMetricDefinitions operation. + * Contains response data for the beginCreateUpdateCassandraTable operation. */ -export type DatabaseAccountsListMetricDefinitionsResponse = MetricDefinitionsListResult & { +export type DatabaseAccountsBeginCreateUpdateCassandraTableResponse = CassandraTable & { /** * The underlying HTTP response. */ @@ -1387,17 +2688,18 @@ export type DatabaseAccountsListMetricDefinitionsResponse = MetricDefinitionsLis * The response body as text (string format) */ bodyAsText: string; + /** * The response body as parsed JSON or XML */ - parsedBody: MetricDefinitionsListResult; + parsedBody: CassandraTable; }; }; /** - * Contains response data for the beginPatch operation. + * Contains response data for the beginCreateUpdateGremlinDatabase operation. */ -export type DatabaseAccountsBeginPatchResponse = DatabaseAccount & { +export type DatabaseAccountsBeginCreateUpdateGremlinDatabaseResponse = GremlinDatabase & { /** * The underlying HTTP response. */ @@ -1406,17 +2708,18 @@ export type DatabaseAccountsBeginPatchResponse = DatabaseAccount & { * The response body as text (string format) */ bodyAsText: string; + /** * The response body as parsed JSON or XML */ - parsedBody: DatabaseAccount; + parsedBody: GremlinDatabase; }; }; /** - * Contains response data for the beginCreateOrUpdate operation. + * Contains response data for the beginCreateUpdateGremlinGraph operation. */ -export type DatabaseAccountsBeginCreateOrUpdateResponse = DatabaseAccount & { +export type DatabaseAccountsBeginCreateUpdateGremlinGraphResponse = GremlinGraph & { /** * The underlying HTTP response. */ @@ -1425,10 +2728,11 @@ export type DatabaseAccountsBeginCreateOrUpdateResponse = DatabaseAccount & { * The response body as text (string format) */ bodyAsText: string; + /** * The response body as parsed JSON or XML */ - parsedBody: DatabaseAccount; + parsedBody: GremlinGraph; }; }; @@ -1444,6 +2748,7 @@ export type OperationsListResponse = OperationListResult & { * The response body as text (string format) */ bodyAsText: string; + /** * The response body as parsed JSON or XML */ @@ -1463,6 +2768,7 @@ export type OperationsListNextResponse = OperationListResult & { * The response body as text (string format) */ bodyAsText: string; + /** * The response body as parsed JSON or XML */ @@ -1482,6 +2788,7 @@ export type DatabaseListMetricsResponse = MetricListResult & { * The response body as text (string format) */ bodyAsText: string; + /** * The response body as parsed JSON or XML */ @@ -1501,6 +2808,7 @@ export type DatabaseListUsagesResponse = UsagesResult & { * The response body as text (string format) */ bodyAsText: string; + /** * The response body as parsed JSON or XML */ @@ -1520,6 +2828,7 @@ export type DatabaseListMetricDefinitionsResponse = MetricDefinitionsListResult * The response body as text (string format) */ bodyAsText: string; + /** * The response body as parsed JSON or XML */ @@ -1539,6 +2848,7 @@ export type CollectionListMetricsResponse = MetricListResult & { * The response body as text (string format) */ bodyAsText: string; + /** * The response body as parsed JSON or XML */ @@ -1558,6 +2868,7 @@ export type CollectionListUsagesResponse = UsagesResult & { * The response body as text (string format) */ bodyAsText: string; + /** * The response body as parsed JSON or XML */ @@ -1577,6 +2888,7 @@ export type CollectionListMetricDefinitionsResponse = MetricDefinitionsListResul * The response body as text (string format) */ bodyAsText: string; + /** * The response body as parsed JSON or XML */ @@ -1596,6 +2908,7 @@ export type CollectionRegionListMetricsResponse = MetricListResult & { * The response body as text (string format) */ bodyAsText: string; + /** * The response body as parsed JSON or XML */ @@ -1615,6 +2928,7 @@ export type DatabaseAccountRegionListMetricsResponse = MetricListResult & { * The response body as text (string format) */ bodyAsText: string; + /** * The response body as parsed JSON or XML */ @@ -1634,6 +2948,7 @@ export type PercentileSourceTargetListMetricsResponse = PercentileMetricListResu * The response body as text (string format) */ bodyAsText: string; + /** * The response body as parsed JSON or XML */ @@ -1653,6 +2968,7 @@ export type PercentileTargetListMetricsResponse = PercentileMetricListResult & { * The response body as text (string format) */ bodyAsText: string; + /** * The response body as parsed JSON or XML */ @@ -1672,6 +2988,7 @@ export type PercentileListMetricsResponse = PercentileMetricListResult & { * The response body as text (string format) */ bodyAsText: string; + /** * The response body as parsed JSON or XML */ @@ -1691,6 +3008,7 @@ export type CollectionPartitionRegionListMetricsResponse = PartitionMetricListRe * The response body as text (string format) */ bodyAsText: string; + /** * The response body as parsed JSON or XML */ @@ -1710,6 +3028,7 @@ export type CollectionPartitionListMetricsResponse = PartitionMetricListResult & * The response body as text (string format) */ bodyAsText: string; + /** * The response body as parsed JSON or XML */ @@ -1729,6 +3048,7 @@ export type CollectionPartitionListUsagesResponse = PartitionUsagesResult & { * The response body as text (string format) */ bodyAsText: string; + /** * The response body as parsed JSON or XML */ @@ -1748,6 +3068,7 @@ export type PartitionKeyRangeIdListMetricsResponse = PartitionMetricListResult & * The response body as text (string format) */ bodyAsText: string; + /** * The response body as parsed JSON or XML */ @@ -1767,6 +3088,7 @@ export type PartitionKeyRangeIdRegionListMetricsResponse = PartitionMetricListRe * The response body as text (string format) */ bodyAsText: string; + /** * The response body as parsed JSON or XML */ diff --git a/sdk/cosmosdb/arm-cosmosdb/src/models/mappers.ts b/sdk/cosmosdb/arm-cosmosdb/src/models/mappers.ts index be398210e186..9ae39d547034 100644 --- a/sdk/cosmosdb/arm-cosmosdb/src/models/mappers.ts +++ b/sdk/cosmosdb/arm-cosmosdb/src/models/mappers.ts @@ -1,11 +1,9 @@ /* * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for - * license information. + * Licensed under the MIT License. See License.txt in the project root for license information. * * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is - * regenerated. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. */ import { CloudErrorMapper, BaseResourceMapper } from "@azure/ms-rest-azure-js"; @@ -201,7 +199,6 @@ export const Resource: msRest.CompositeMapper = { } }, location: { - required: true, serializedName: "location", type: { name: "String" @@ -357,20 +354,46 @@ export const DatabaseAccount: msRest.CompositeMapper = { } }; -export const ErrorResponse: msRest.CompositeMapper = { - serializedName: "ErrorResponse", +export const SqlDatabase: msRest.CompositeMapper = { + serializedName: "SqlDatabase", type: { name: "Composite", - className: "ErrorResponse", + className: "SqlDatabase", modelProperties: { - code: { - serializedName: "code", + ...Resource.type.modelProperties, + sqlDatabaseId: { + required: true, + serializedName: "properties.id", type: { name: "String" } }, - message: { - serializedName: "message", + _rid: { + serializedName: "properties._rid", + type: { + name: "String" + } + }, + _ts: { + serializedName: "properties._ts", + type: { + name: "Object" + } + }, + _etag: { + serializedName: "properties._etag", + type: { + name: "String" + } + }, + _colls: { + serializedName: "properties._colls", + type: { + name: "String" + } + }, + _users: { + serializedName: "properties._users", type: { name: "String" } @@ -379,21 +402,56 @@ export const ErrorResponse: msRest.CompositeMapper = { } }; -export const FailoverPolicies: msRest.CompositeMapper = { - serializedName: "FailoverPolicies", +export const Indexes: msRest.CompositeMapper = { + serializedName: "Indexes", type: { name: "Composite", - className: "FailoverPolicies", + className: "Indexes", modelProperties: { - failoverPolicies: { - required: true, - serializedName: "failoverPolicies", + dataType: { + serializedName: "dataType", + defaultValue: 'String', + type: { + name: "String" + } + }, + precision: { + serializedName: "precision", + type: { + name: "Number" + } + }, + kind: { + serializedName: "kind", + defaultValue: 'Hash', + type: { + name: "String" + } + } + } + } +}; + +export const IncludedPath: msRest.CompositeMapper = { + serializedName: "IncludedPath", + type: { + name: "Composite", + className: "IncludedPath", + modelProperties: { + path: { + serializedName: "path", + type: { + name: "String" + } + }, + indexes: { + serializedName: "indexes", type: { name: "Sequence", element: { type: { name: "Composite", - className: "FailoverPolicy" + className: "Indexes" } } } @@ -402,15 +460,14 @@ export const FailoverPolicies: msRest.CompositeMapper = { } }; -export const RegionForOnlineOffline: msRest.CompositeMapper = { - serializedName: "RegionForOnlineOffline", +export const ExcludedPath: msRest.CompositeMapper = { + serializedName: "ExcludedPath", type: { name: "Composite", - className: "RegionForOnlineOffline", + className: "ExcludedPath", modelProperties: { - region: { - required: true, - serializedName: "region", + path: { + serializedName: "path", type: { name: "String" } @@ -419,109 +476,257 @@ export const RegionForOnlineOffline: msRest.CompositeMapper = { } }; -export const DatabaseAccountCreateUpdateParameters: msRest.CompositeMapper = { - serializedName: "DatabaseAccountCreateUpdateParameters", +export const IndexingPolicy: msRest.CompositeMapper = { + serializedName: "IndexingPolicy", type: { name: "Composite", - className: "DatabaseAccountCreateUpdateParameters", + className: "IndexingPolicy", modelProperties: { - ...Resource.type.modelProperties, - kind: { - serializedName: "kind", - defaultValue: 'GlobalDocumentDB', + automatic: { + serializedName: "automatic", type: { - name: "String" + name: "Boolean" } }, - consistencyPolicy: { - serializedName: "properties.consistencyPolicy", + indexingMode: { + serializedName: "indexingMode", + defaultValue: 'Consistent', type: { - name: "Composite", - className: "ConsistencyPolicy" + name: "String" } }, - locations: { - required: true, - serializedName: "properties.locations", + includedPaths: { + serializedName: "includedPaths", type: { name: "Sequence", element: { type: { name: "Composite", - className: "Location" + className: "IncludedPath" } } } }, - databaseAccountOfferType: { - required: true, - isConstant: true, - serializedName: "properties.databaseAccountOfferType", - defaultValue: 'Standard', - type: { - name: "String" - } - }, - ipRangeFilter: { - serializedName: "properties.ipRangeFilter", + excludedPaths: { + serializedName: "excludedPaths", type: { - name: "String" + name: "Sequence", + element: { + type: { + name: "Composite", + className: "ExcludedPath" + } + } } - }, - isVirtualNetworkFilterEnabled: { - serializedName: "properties.isVirtualNetworkFilterEnabled", + } + } + } +}; + +export const ContainerPartitionKey: msRest.CompositeMapper = { + serializedName: "ContainerPartitionKey", + type: { + name: "Composite", + className: "ContainerPartitionKey", + modelProperties: { + paths: { + serializedName: "paths", type: { - name: "Boolean" + name: "Sequence", + element: { + type: { + name: "String" + } + } } }, - enableAutomaticFailover: { - serializedName: "properties.enableAutomaticFailover", + kind: { + serializedName: "kind", + defaultValue: 'Hash', type: { - name: "Boolean" + name: "String" } - }, - capabilities: { - serializedName: "properties.capabilities", + } + } + } +}; + +export const UniqueKey: msRest.CompositeMapper = { + serializedName: "UniqueKey", + type: { + name: "Composite", + className: "UniqueKey", + modelProperties: { + paths: { + serializedName: "paths", type: { name: "Sequence", element: { type: { - name: "Composite", - className: "Capability" + name: "String" } } } - }, - virtualNetworkRules: { - serializedName: "properties.virtualNetworkRules", + } + } + } +}; + +export const UniqueKeyPolicy: msRest.CompositeMapper = { + serializedName: "UniqueKeyPolicy", + type: { + name: "Composite", + className: "UniqueKeyPolicy", + modelProperties: { + uniqueKeys: { + serializedName: "uniqueKeys", type: { name: "Sequence", element: { type: { name: "Composite", - className: "VirtualNetworkRule" + className: "UniqueKey" } } } + } + } + } +}; + +export const ConflictResolutionPolicy: msRest.CompositeMapper = { + serializedName: "ConflictResolutionPolicy", + type: { + name: "Composite", + className: "ConflictResolutionPolicy", + modelProperties: { + mode: { + serializedName: "mode", + defaultValue: 'LastWriterWins', + type: { + name: "String" + } }, - enableMultipleWriteLocations: { - serializedName: "properties.enableMultipleWriteLocations", + conflictResolutionPath: { + serializedName: "conflictResolutionPath", type: { - name: "Boolean" + name: "String" + } + }, + conflictResolutionProcedure: { + serializedName: "conflictResolutionProcedure", + type: { + name: "String" } } } } }; -export const DatabaseAccountPatchParameters: msRest.CompositeMapper = { - serializedName: "DatabaseAccountPatchParameters", +export const SqlContainer: msRest.CompositeMapper = { + serializedName: "SqlContainer", type: { name: "Composite", - className: "DatabaseAccountPatchParameters", + className: "SqlContainer", modelProperties: { - tags: { - serializedName: "tags", + ...Resource.type.modelProperties, + sqlContainerId: { + required: true, + serializedName: "properties.id", + type: { + name: "String" + } + }, + indexingPolicy: { + serializedName: "properties.indexingPolicy", + type: { + name: "Composite", + className: "IndexingPolicy" + } + }, + partitionKey: { + serializedName: "properties.partitionKey", + type: { + name: "Composite", + className: "ContainerPartitionKey" + } + }, + defaultTtl: { + serializedName: "properties.defaultTtl", + type: { + name: "Number" + } + }, + uniqueKeyPolicy: { + serializedName: "properties.uniqueKeyPolicy", + type: { + name: "Composite", + className: "UniqueKeyPolicy" + } + }, + conflictResolutionPolicy: { + serializedName: "properties.conflictResolutionPolicy", + type: { + name: "Composite", + className: "ConflictResolutionPolicy" + } + }, + _rid: { + serializedName: "properties._rid", + type: { + name: "String" + } + }, + _ts: { + serializedName: "properties._ts", + type: { + name: "Object" + } + }, + _etag: { + serializedName: "properties._etag", + type: { + name: "String" + } + } + } + } +}; + +export const MongoDBDatabase: msRest.CompositeMapper = { + serializedName: "MongoDBDatabase", + type: { + name: "Composite", + className: "MongoDBDatabase", + modelProperties: { + ...Resource.type.modelProperties, + mongoDBDatabaseId: { + required: true, + serializedName: "properties.id", + type: { + name: "String" + } + } + } + } +}; + +export const MongoDBCollection: msRest.CompositeMapper = { + serializedName: "MongoDBCollection", + type: { + name: "Composite", + className: "MongoDBCollection", + modelProperties: { + ...Resource.type.modelProperties, + mongoDBCollectionId: { + required: true, + serializedName: "properties.id", + type: { + name: "String" + } + }, + shardKey: { + serializedName: "properties.shardKey", type: { name: "Dictionary", value: { @@ -531,14 +736,14 @@ export const DatabaseAccountPatchParameters: msRest.CompositeMapper = { } } }, - capabilities: { - serializedName: "properties.capabilities", + indexes: { + serializedName: "properties.indexes", type: { name: "Sequence", element: { type: { name: "Composite", - className: "Capability" + className: "MongoIndex" } } } @@ -547,125 +752,1216 @@ export const DatabaseAccountPatchParameters: msRest.CompositeMapper = { } }; -export const DatabaseAccountListReadOnlyKeysResult: msRest.CompositeMapper = { - serializedName: "DatabaseAccountListReadOnlyKeysResult", +export const Table: msRest.CompositeMapper = { + serializedName: "Table", type: { name: "Composite", - className: "DatabaseAccountListReadOnlyKeysResult", + className: "Table", modelProperties: { - primaryReadonlyMasterKey: { - readOnly: true, - serializedName: "primaryReadonlyMasterKey", + ...Resource.type.modelProperties, + tableId: { + required: true, + serializedName: "properties.id", type: { name: "String" } - }, - secondaryReadonlyMasterKey: { - readOnly: true, - serializedName: "secondaryReadonlyMasterKey", - type: { - name: "String" + } + } + } +}; + +export const CassandraKeyspace: msRest.CompositeMapper = { + serializedName: "CassandraKeyspace", + type: { + name: "Composite", + className: "CassandraKeyspace", + modelProperties: { + ...Resource.type.modelProperties, + cassandraKeyspaceId: { + required: true, + serializedName: "properties.id", + type: { + name: "String" + } + } + } + } +}; + +export const CassandraTable: msRest.CompositeMapper = { + serializedName: "CassandraTable", + type: { + name: "Composite", + className: "CassandraTable", + modelProperties: { + ...Resource.type.modelProperties, + cassandraTableId: { + required: true, + serializedName: "properties.id", + type: { + name: "String" + } + }, + defaultTtl: { + serializedName: "properties.defaultTtl", + type: { + name: "Number" + } + }, + schema: { + serializedName: "properties.schema", + type: { + name: "Composite", + className: "CassandraSchema" + } + } + } + } +}; + +export const GremlinDatabase: msRest.CompositeMapper = { + serializedName: "GremlinDatabase", + type: { + name: "Composite", + className: "GremlinDatabase", + modelProperties: { + ...Resource.type.modelProperties, + gremlinDatabaseId: { + required: true, + serializedName: "properties.id", + type: { + name: "String" + } + }, + _rid: { + serializedName: "properties._rid", + type: { + name: "String" + } + }, + _ts: { + serializedName: "properties._ts", + type: { + name: "Object" + } + }, + _etag: { + serializedName: "properties._etag", + type: { + name: "String" + } + } + } + } +}; + +export const GremlinGraph: msRest.CompositeMapper = { + serializedName: "GremlinGraph", + type: { + name: "Composite", + className: "GremlinGraph", + modelProperties: { + ...Resource.type.modelProperties, + gremlinGraphId: { + required: true, + serializedName: "properties.id", + type: { + name: "String" + } + }, + indexingPolicy: { + serializedName: "properties.indexingPolicy", + type: { + name: "Composite", + className: "IndexingPolicy" + } + }, + partitionKey: { + serializedName: "properties.partitionKey", + type: { + name: "Composite", + className: "ContainerPartitionKey" + } + }, + defaultTtl: { + serializedName: "properties.defaultTtl", + type: { + name: "Number" + } + }, + uniqueKeyPolicy: { + serializedName: "properties.uniqueKeyPolicy", + type: { + name: "Composite", + className: "UniqueKeyPolicy" + } + }, + conflictResolutionPolicy: { + serializedName: "properties.conflictResolutionPolicy", + type: { + name: "Composite", + className: "ConflictResolutionPolicy" + } + }, + _rid: { + serializedName: "properties._rid", + type: { + name: "String" + } + }, + _ts: { + serializedName: "properties._ts", + type: { + name: "Object" + } + }, + _etag: { + serializedName: "properties._etag", + type: { + name: "String" + } + } + } + } +}; + +export const ErrorResponse: msRest.CompositeMapper = { + serializedName: "ErrorResponse", + type: { + name: "Composite", + className: "ErrorResponse", + modelProperties: { + code: { + serializedName: "code", + type: { + name: "String" + } + }, + message: { + serializedName: "message", + type: { + name: "String" + } + } + } + } +}; + +export const FailoverPolicies: msRest.CompositeMapper = { + serializedName: "FailoverPolicies", + type: { + name: "Composite", + className: "FailoverPolicies", + modelProperties: { + failoverPolicies: { + required: true, + serializedName: "failoverPolicies", + type: { + name: "Sequence", + element: { + type: { + name: "Composite", + className: "FailoverPolicy" + } + } + } + } + } + } +}; + +export const RegionForOnlineOffline: msRest.CompositeMapper = { + serializedName: "RegionForOnlineOffline", + type: { + name: "Composite", + className: "RegionForOnlineOffline", + modelProperties: { + region: { + required: true, + serializedName: "region", + type: { + name: "String" + } + } + } + } +}; + +export const ExtendedResourceProperties: msRest.CompositeMapper = { + serializedName: "ExtendedResourceProperties", + type: { + name: "Composite", + className: "ExtendedResourceProperties", + modelProperties: { + _rid: { + serializedName: "_rid", + type: { + name: "String" + } + }, + _ts: { + serializedName: "_ts", + type: { + name: "Object" + } + }, + _etag: { + serializedName: "_etag", + type: { + name: "String" + } + } + } + } +}; + +export const DatabaseAccountCreateUpdateParameters: msRest.CompositeMapper = { + serializedName: "DatabaseAccountCreateUpdateParameters", + type: { + name: "Composite", + className: "DatabaseAccountCreateUpdateParameters", + modelProperties: { + ...Resource.type.modelProperties, + kind: { + serializedName: "kind", + defaultValue: 'GlobalDocumentDB', + type: { + name: "String" + } + }, + consistencyPolicy: { + serializedName: "properties.consistencyPolicy", + type: { + name: "Composite", + className: "ConsistencyPolicy" + } + }, + locations: { + required: true, + serializedName: "properties.locations", + type: { + name: "Sequence", + element: { + type: { + name: "Composite", + className: "Location" + } + } + } + }, + databaseAccountOfferType: { + required: true, + isConstant: true, + serializedName: "properties.databaseAccountOfferType", + defaultValue: 'Standard', + type: { + name: "String" + } + }, + ipRangeFilter: { + serializedName: "properties.ipRangeFilter", + type: { + name: "String" + } + }, + isVirtualNetworkFilterEnabled: { + serializedName: "properties.isVirtualNetworkFilterEnabled", + type: { + name: "Boolean" + } + }, + enableAutomaticFailover: { + serializedName: "properties.enableAutomaticFailover", + type: { + name: "Boolean" + } + }, + capabilities: { + serializedName: "properties.capabilities", + type: { + name: "Sequence", + element: { + type: { + name: "Composite", + className: "Capability" + } + } + } + }, + virtualNetworkRules: { + serializedName: "properties.virtualNetworkRules", + type: { + name: "Sequence", + element: { + type: { + name: "Composite", + className: "VirtualNetworkRule" + } + } + } + }, + enableMultipleWriteLocations: { + serializedName: "properties.enableMultipleWriteLocations", + type: { + name: "Boolean" + } + } + } + } +}; + +export const DatabaseAccountPatchParameters: msRest.CompositeMapper = { + serializedName: "DatabaseAccountPatchParameters", + type: { + name: "Composite", + className: "DatabaseAccountPatchParameters", + modelProperties: { + tags: { + serializedName: "tags", + type: { + name: "Dictionary", + value: { + type: { + name: "String" + } + } + } + }, + capabilities: { + serializedName: "properties.capabilities", + type: { + name: "Sequence", + element: { + type: { + name: "Composite", + className: "Capability" + } + } + } + } + } + } +}; + +export const DatabaseAccountListReadOnlyKeysResult: msRest.CompositeMapper = { + serializedName: "DatabaseAccountListReadOnlyKeysResult", + type: { + name: "Composite", + className: "DatabaseAccountListReadOnlyKeysResult", + modelProperties: { + primaryReadonlyMasterKey: { + readOnly: true, + serializedName: "primaryReadonlyMasterKey", + type: { + name: "String" + } + }, + secondaryReadonlyMasterKey: { + readOnly: true, + serializedName: "secondaryReadonlyMasterKey", + type: { + name: "String" + } + } + } + } +}; + +export const DatabaseAccountListKeysResult: msRest.CompositeMapper = { + serializedName: "DatabaseAccountListKeysResult", + type: { + name: "Composite", + className: "DatabaseAccountListKeysResult", + modelProperties: { + primaryMasterKey: { + readOnly: true, + serializedName: "primaryMasterKey", + type: { + name: "String" + } + }, + secondaryMasterKey: { + readOnly: true, + serializedName: "secondaryMasterKey", + type: { + name: "String" + } + }, + primaryReadonlyMasterKey: { + readOnly: true, + serializedName: "properties.primaryReadonlyMasterKey", + type: { + name: "String" + } + }, + secondaryReadonlyMasterKey: { + readOnly: true, + serializedName: "properties.secondaryReadonlyMasterKey", + type: { + name: "String" + } + } + } + } +}; + +export const DatabaseAccountConnectionString: msRest.CompositeMapper = { + serializedName: "DatabaseAccountConnectionString", + type: { + name: "Composite", + className: "DatabaseAccountConnectionString", + modelProperties: { + connectionString: { + readOnly: true, + serializedName: "connectionString", + type: { + name: "String" + } + }, + description: { + readOnly: true, + serializedName: "description", + type: { + name: "String" + } + } + } + } +}; + +export const DatabaseAccountListConnectionStringsResult: msRest.CompositeMapper = { + serializedName: "DatabaseAccountListConnectionStringsResult", + type: { + name: "Composite", + className: "DatabaseAccountListConnectionStringsResult", + modelProperties: { + connectionStrings: { + serializedName: "connectionStrings", + type: { + name: "Sequence", + element: { + type: { + name: "Composite", + className: "DatabaseAccountConnectionString" + } + } + } + } + } + } +}; + +export const DatabaseAccountRegenerateKeyParameters: msRest.CompositeMapper = { + serializedName: "DatabaseAccountRegenerateKeyParameters", + type: { + name: "Composite", + className: "DatabaseAccountRegenerateKeyParameters", + modelProperties: { + keyKind: { + required: true, + serializedName: "keyKind", + type: { + name: "String" + } + } + } + } +}; + +export const SqlDatabaseResource: msRest.CompositeMapper = { + serializedName: "SqlDatabaseResource", + type: { + name: "Composite", + className: "SqlDatabaseResource", + modelProperties: { + id: { + required: true, + serializedName: "id", + type: { + name: "String" + } + } + } + } +}; + +export const SqlDatabaseCreateUpdateParameters: msRest.CompositeMapper = { + serializedName: "SqlDatabaseCreateUpdateParameters", + type: { + name: "Composite", + className: "SqlDatabaseCreateUpdateParameters", + modelProperties: { + resource: { + required: true, + serializedName: "properties.resource", + type: { + name: "Composite", + className: "SqlDatabaseResource" + } + }, + options: { + required: true, + serializedName: "properties.options", + type: { + name: "Dictionary", + value: { + type: { + name: "String" + } + } + } + } + } + } +}; + +export const SqlContainerResource: msRest.CompositeMapper = { + serializedName: "SqlContainerResource", + type: { + name: "Composite", + className: "SqlContainerResource", + modelProperties: { + id: { + required: true, + serializedName: "id", + type: { + name: "String" + } + }, + indexingPolicy: { + serializedName: "indexingPolicy", + type: { + name: "Composite", + className: "IndexingPolicy" + } + }, + partitionKey: { + serializedName: "partitionKey", + type: { + name: "Composite", + className: "ContainerPartitionKey" + } + }, + defaultTtl: { + serializedName: "defaultTtl", + type: { + name: "Number" + } + }, + uniqueKeyPolicy: { + serializedName: "uniqueKeyPolicy", + type: { + name: "Composite", + className: "UniqueKeyPolicy" + } + }, + conflictResolutionPolicy: { + serializedName: "conflictResolutionPolicy", + type: { + name: "Composite", + className: "ConflictResolutionPolicy" + } + } + } + } +}; + +export const SqlContainerCreateUpdateParameters: msRest.CompositeMapper = { + serializedName: "SqlContainerCreateUpdateParameters", + type: { + name: "Composite", + className: "SqlContainerCreateUpdateParameters", + modelProperties: { + resource: { + required: true, + serializedName: "properties.resource", + type: { + name: "Composite", + className: "SqlContainerResource" + } + }, + options: { + required: true, + serializedName: "properties.options", + type: { + name: "Dictionary", + value: { + type: { + name: "String" + } + } + } + } + } + } +}; + +export const MongoDBDatabaseResource: msRest.CompositeMapper = { + serializedName: "MongoDBDatabaseResource", + type: { + name: "Composite", + className: "MongoDBDatabaseResource", + modelProperties: { + id: { + required: true, + serializedName: "id", + type: { + name: "String" + } + } + } + } +}; + +export const MongoDBDatabaseCreateUpdateParameters: msRest.CompositeMapper = { + serializedName: "MongoDBDatabaseCreateUpdateParameters", + type: { + name: "Composite", + className: "MongoDBDatabaseCreateUpdateParameters", + modelProperties: { + resource: { + required: true, + serializedName: "properties.resource", + type: { + name: "Composite", + className: "MongoDBDatabaseResource" + } + }, + options: { + required: true, + serializedName: "properties.options", + type: { + name: "Dictionary", + value: { + type: { + name: "String" + } + } + } + } + } + } +}; + +export const MongoIndexKeys: msRest.CompositeMapper = { + serializedName: "MongoIndexKeys", + type: { + name: "Composite", + className: "MongoIndexKeys", + modelProperties: { + keys: { + serializedName: "keys", + type: { + name: "Sequence", + element: { + type: { + name: "String" + } + } + } + } + } + } +}; + +export const MongoIndexOptions: msRest.CompositeMapper = { + serializedName: "MongoIndexOptions", + type: { + name: "Composite", + className: "MongoIndexOptions", + modelProperties: { + expireAfterSeconds: { + serializedName: "expireAfterSeconds", + type: { + name: "Number" + } + }, + unique: { + serializedName: "unique", + type: { + name: "Boolean" + } + } + } + } +}; + +export const MongoIndex: msRest.CompositeMapper = { + serializedName: "MongoIndex", + type: { + name: "Composite", + className: "MongoIndex", + modelProperties: { + key: { + serializedName: "key", + type: { + name: "Composite", + className: "MongoIndexKeys" + } + }, + options: { + serializedName: "options", + type: { + name: "Composite", + className: "MongoIndexOptions" + } + } + } + } +}; + +export const MongoDBCollectionResource: msRest.CompositeMapper = { + serializedName: "MongoDBCollectionResource", + type: { + name: "Composite", + className: "MongoDBCollectionResource", + modelProperties: { + id: { + required: true, + serializedName: "id", + type: { + name: "String" + } + }, + shardKey: { + serializedName: "shardKey", + type: { + name: "Dictionary", + value: { + type: { + name: "String" + } + } + } + }, + indexes: { + serializedName: "indexes", + type: { + name: "Sequence", + element: { + type: { + name: "Composite", + className: "MongoIndex" + } + } + } + } + } + } +}; + +export const MongoDBCollectionCreateUpdateParameters: msRest.CompositeMapper = { + serializedName: "MongoDBCollectionCreateUpdateParameters", + type: { + name: "Composite", + className: "MongoDBCollectionCreateUpdateParameters", + modelProperties: { + resource: { + required: true, + serializedName: "properties.resource", + type: { + name: "Composite", + className: "MongoDBCollectionResource" + } + }, + options: { + required: true, + serializedName: "properties.options", + type: { + name: "Dictionary", + value: { + type: { + name: "String" + } + } + } + } + } + } +}; + +export const TableResource: msRest.CompositeMapper = { + serializedName: "TableResource", + type: { + name: "Composite", + className: "TableResource", + modelProperties: { + id: { + required: true, + serializedName: "id", + type: { + name: "String" + } + } + } + } +}; + +export const TableCreateUpdateParameters: msRest.CompositeMapper = { + serializedName: "TableCreateUpdateParameters", + type: { + name: "Composite", + className: "TableCreateUpdateParameters", + modelProperties: { + resource: { + required: true, + serializedName: "properties.resource", + type: { + name: "Composite", + className: "TableResource" + } + }, + options: { + required: true, + serializedName: "properties.options", + type: { + name: "Dictionary", + value: { + type: { + name: "String" + } + } + } + } + } + } +}; + +export const CassandraKeyspaceResource: msRest.CompositeMapper = { + serializedName: "CassandraKeyspaceResource", + type: { + name: "Composite", + className: "CassandraKeyspaceResource", + modelProperties: { + id: { + required: true, + serializedName: "id", + type: { + name: "String" + } + } + } + } +}; + +export const CassandraKeyspaceCreateUpdateParameters: msRest.CompositeMapper = { + serializedName: "CassandraKeyspaceCreateUpdateParameters", + type: { + name: "Composite", + className: "CassandraKeyspaceCreateUpdateParameters", + modelProperties: { + resource: { + required: true, + serializedName: "properties.resource", + type: { + name: "Composite", + className: "CassandraKeyspaceResource" + } + }, + options: { + required: true, + serializedName: "properties.options", + type: { + name: "Dictionary", + value: { + type: { + name: "String" + } + } + } + } + } + } +}; + +export const Column: msRest.CompositeMapper = { + serializedName: "Column", + type: { + name: "Composite", + className: "Column", + modelProperties: { + name: { + serializedName: "name", + type: { + name: "String" + } + }, + type: { + serializedName: "type", + type: { + name: "String" + } + } + } + } +}; + +export const CassandraPartitionKey: msRest.CompositeMapper = { + serializedName: "CassandraPartitionKey", + type: { + name: "Composite", + className: "CassandraPartitionKey", + modelProperties: { + name: { + serializedName: "name", + type: { + name: "String" + } + } + } + } +}; + +export const ClusterKey: msRest.CompositeMapper = { + serializedName: "ClusterKey", + type: { + name: "Composite", + className: "ClusterKey", + modelProperties: { + name: { + serializedName: "name", + type: { + name: "String" + } + }, + orderBy: { + serializedName: "orderBy", + type: { + name: "String" + } + } + } + } +}; + +export const CassandraSchema: msRest.CompositeMapper = { + serializedName: "CassandraSchema", + type: { + name: "Composite", + className: "CassandraSchema", + modelProperties: { + columns: { + serializedName: "columns", + type: { + name: "Sequence", + element: { + type: { + name: "Composite", + className: "Column" + } + } + } + }, + partitionKeys: { + serializedName: "partitionKeys", + type: { + name: "Sequence", + element: { + type: { + name: "Composite", + className: "CassandraPartitionKey" + } + } + } + }, + clusterKeys: { + serializedName: "clusterKeys", + type: { + name: "Sequence", + element: { + type: { + name: "Composite", + className: "ClusterKey" + } + } + } + } + } + } +}; + +export const CassandraTableResource: msRest.CompositeMapper = { + serializedName: "CassandraTableResource", + type: { + name: "Composite", + className: "CassandraTableResource", + modelProperties: { + id: { + required: true, + serializedName: "id", + type: { + name: "String" + } + }, + defaultTtl: { + serializedName: "defaultTtl", + type: { + name: "Number" + } + }, + schema: { + serializedName: "schema", + type: { + name: "Composite", + className: "CassandraSchema" + } + } + } + } +}; + +export const CassandraTableCreateUpdateParameters: msRest.CompositeMapper = { + serializedName: "CassandraTableCreateUpdateParameters", + type: { + name: "Composite", + className: "CassandraTableCreateUpdateParameters", + modelProperties: { + resource: { + required: true, + serializedName: "properties.resource", + type: { + name: "Composite", + className: "CassandraTableResource" + } + }, + options: { + required: true, + serializedName: "properties.options", + type: { + name: "Dictionary", + value: { + type: { + name: "String" + } + } + } + } + } + } +}; + +export const GremlinDatabaseResource: msRest.CompositeMapper = { + serializedName: "GremlinDatabaseResource", + type: { + name: "Composite", + className: "GremlinDatabaseResource", + modelProperties: { + id: { + required: true, + serializedName: "id", + type: { + name: "String" + } + } + } + } +}; + +export const GremlinDatabaseCreateUpdateParameters: msRest.CompositeMapper = { + serializedName: "GremlinDatabaseCreateUpdateParameters", + type: { + name: "Composite", + className: "GremlinDatabaseCreateUpdateParameters", + modelProperties: { + resource: { + required: true, + serializedName: "properties.resource", + type: { + name: "Composite", + className: "GremlinDatabaseResource" + } + }, + options: { + required: true, + serializedName: "properties.options", + type: { + name: "Dictionary", + value: { + type: { + name: "String" + } + } } } } } }; -export const DatabaseAccountListKeysResult: msRest.CompositeMapper = { - serializedName: "DatabaseAccountListKeysResult", +export const GremlinGraphResource: msRest.CompositeMapper = { + serializedName: "GremlinGraphResource", type: { name: "Composite", - className: "DatabaseAccountListKeysResult", + className: "GremlinGraphResource", modelProperties: { - primaryMasterKey: { - readOnly: true, - serializedName: "primaryMasterKey", + id: { + required: true, + serializedName: "id", type: { name: "String" } }, - secondaryMasterKey: { - readOnly: true, - serializedName: "secondaryMasterKey", + indexingPolicy: { + serializedName: "indexingPolicy", type: { - name: "String" + name: "Composite", + className: "IndexingPolicy" } }, - primaryReadonlyMasterKey: { - readOnly: true, - serializedName: "properties.primaryReadonlyMasterKey", + partitionKey: { + serializedName: "partitionKey", type: { - name: "String" + name: "Composite", + className: "ContainerPartitionKey" } }, - secondaryReadonlyMasterKey: { - readOnly: true, - serializedName: "properties.secondaryReadonlyMasterKey", + defaultTtl: { + serializedName: "defaultTtl", type: { - name: "String" + name: "Number" } - } - } - } -}; - -export const DatabaseAccountConnectionString: msRest.CompositeMapper = { - serializedName: "DatabaseAccountConnectionString", - type: { - name: "Composite", - className: "DatabaseAccountConnectionString", - modelProperties: { - connectionString: { - readOnly: true, - serializedName: "connectionString", + }, + uniqueKeyPolicy: { + serializedName: "uniqueKeyPolicy", type: { - name: "String" + name: "Composite", + className: "UniqueKeyPolicy" } }, - description: { - readOnly: true, - serializedName: "description", + conflictResolutionPolicy: { + serializedName: "conflictResolutionPolicy", type: { - name: "String" + name: "Composite", + className: "ConflictResolutionPolicy" } } } } }; -export const DatabaseAccountListConnectionStringsResult: msRest.CompositeMapper = { - serializedName: "DatabaseAccountListConnectionStringsResult", +export const GremlinGraphCreateUpdateParameters: msRest.CompositeMapper = { + serializedName: "GremlinGraphCreateUpdateParameters", type: { name: "Composite", - className: "DatabaseAccountListConnectionStringsResult", + className: "GremlinGraphCreateUpdateParameters", modelProperties: { - connectionStrings: { - serializedName: "connectionStrings", + resource: { + required: true, + serializedName: "properties.resource", type: { - name: "Sequence", - element: { - type: { - name: "Composite", - className: "DatabaseAccountConnectionString" - } - } + name: "Composite", + className: "GremlinGraphResource" } - } - } - } -}; - -export const DatabaseAccountRegenerateKeyParameters: msRest.CompositeMapper = { - serializedName: "DatabaseAccountRegenerateKeyParameters", - type: { - name: "Composite", - className: "DatabaseAccountRegenerateKeyParameters", - modelProperties: { - keyKind: { + }, + options: { required: true, - serializedName: "keyKind", + serializedName: "properties.options", type: { - name: "String" + name: "Dictionary", + value: { + type: { + name: "String" + } + } } } } @@ -1243,6 +2539,213 @@ export const MetricDefinitionsListResult: msRest.CompositeMapper = { } }; +export const SqlDatabaseListResult: msRest.CompositeMapper = { + serializedName: "SqlDatabaseListResult", + type: { + name: "Composite", + className: "SqlDatabaseListResult", + modelProperties: { + value: { + readOnly: true, + serializedName: "", + type: { + name: "Sequence", + element: { + type: { + name: "Composite", + className: "SqlDatabase" + } + } + } + } + } + } +}; + +export const SqlContainerListResult: msRest.CompositeMapper = { + serializedName: "SqlContainerListResult", + type: { + name: "Composite", + className: "SqlContainerListResult", + modelProperties: { + value: { + readOnly: true, + serializedName: "", + type: { + name: "Sequence", + element: { + type: { + name: "Composite", + className: "SqlContainer" + } + } + } + } + } + } +}; + +export const MongoDBDatabaseListResult: msRest.CompositeMapper = { + serializedName: "MongoDBDatabaseListResult", + type: { + name: "Composite", + className: "MongoDBDatabaseListResult", + modelProperties: { + value: { + readOnly: true, + serializedName: "", + type: { + name: "Sequence", + element: { + type: { + name: "Composite", + className: "MongoDBDatabase" + } + } + } + } + } + } +}; + +export const MongoDBCollectionListResult: msRest.CompositeMapper = { + serializedName: "MongoDBCollectionListResult", + type: { + name: "Composite", + className: "MongoDBCollectionListResult", + modelProperties: { + value: { + readOnly: true, + serializedName: "", + type: { + name: "Sequence", + element: { + type: { + name: "Composite", + className: "MongoDBCollection" + } + } + } + } + } + } +}; + +export const TableListResult: msRest.CompositeMapper = { + serializedName: "TableListResult", + type: { + name: "Composite", + className: "TableListResult", + modelProperties: { + value: { + readOnly: true, + serializedName: "", + type: { + name: "Sequence", + element: { + type: { + name: "Composite", + className: "Table" + } + } + } + } + } + } +}; + +export const CassandraKeyspaceListResult: msRest.CompositeMapper = { + serializedName: "CassandraKeyspaceListResult", + type: { + name: "Composite", + className: "CassandraKeyspaceListResult", + modelProperties: { + value: { + readOnly: true, + serializedName: "", + type: { + name: "Sequence", + element: { + type: { + name: "Composite", + className: "CassandraKeyspace" + } + } + } + } + } + } +}; + +export const CassandraTableListResult: msRest.CompositeMapper = { + serializedName: "CassandraTableListResult", + type: { + name: "Composite", + className: "CassandraTableListResult", + modelProperties: { + value: { + readOnly: true, + serializedName: "", + type: { + name: "Sequence", + element: { + type: { + name: "Composite", + className: "CassandraTable" + } + } + } + } + } + } +}; + +export const GremlinDatabaseListResult: msRest.CompositeMapper = { + serializedName: "GremlinDatabaseListResult", + type: { + name: "Composite", + className: "GremlinDatabaseListResult", + modelProperties: { + value: { + readOnly: true, + serializedName: "", + type: { + name: "Sequence", + element: { + type: { + name: "Composite", + className: "GremlinDatabase" + } + } + } + } + } + } +}; + +export const GremlinGraphListResult: msRest.CompositeMapper = { + serializedName: "GremlinGraphListResult", + type: { + name: "Composite", + className: "GremlinGraphListResult", + modelProperties: { + value: { + readOnly: true, + serializedName: "", + type: { + name: "Sequence", + element: { + type: { + name: "Composite", + className: "GremlinGraph" + } + } + } + } + } + } +}; + export const OperationListResult: msRest.CompositeMapper = { serializedName: "OperationListResult", type: { diff --git a/sdk/cosmosdb/arm-cosmosdb/src/models/operationsMappers.ts b/sdk/cosmosdb/arm-cosmosdb/src/models/operationsMappers.ts index 2edcc577920e..689688180be7 100644 --- a/sdk/cosmosdb/arm-cosmosdb/src/models/operationsMappers.ts +++ b/sdk/cosmosdb/arm-cosmosdb/src/models/operationsMappers.ts @@ -1,17 +1,14 @@ /* * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for - * license information. + * Licensed under the MIT License. See License.txt in the project root for license information. * * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is - * regenerated. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. */ export { - OperationListResult, + CloudError, Operation, OperationDisplay, - CloudError + OperationListResult } from "../models/mappers"; - diff --git a/sdk/cosmosdb/arm-cosmosdb/src/models/parameters.ts b/sdk/cosmosdb/arm-cosmosdb/src/models/parameters.ts index 43bb72b48f40..178e0ec47263 100644 --- a/sdk/cosmosdb/arm-cosmosdb/src/models/parameters.ts +++ b/sdk/cosmosdb/arm-cosmosdb/src/models/parameters.ts @@ -44,6 +44,16 @@ export const apiVersion: msRest.OperationQueryParameter = { } } }; +export const collectionName: msRest.OperationURLParameter = { + parameterPath: "collectionName", + mapper: { + required: true, + serializedName: "collectionName", + type: { + name: "String" + } + } +}; export const collectionRid: msRest.OperationURLParameter = { parameterPath: "collectionRid", mapper: { @@ -54,6 +64,26 @@ export const collectionRid: msRest.OperationURLParameter = { } } }; +export const containerName: msRest.OperationURLParameter = { + parameterPath: "containerName", + mapper: { + required: true, + serializedName: "containerName", + type: { + name: "String" + } + } +}; +export const databaseName: msRest.OperationURLParameter = { + parameterPath: "databaseName", + mapper: { + required: true, + serializedName: "databaseName", + type: { + name: "String" + } + } +}; export const databaseRid: msRest.OperationURLParameter = { parameterPath: "databaseRid", mapper: { @@ -86,6 +116,26 @@ export const filter1: msRest.OperationQueryParameter = { } } }; +export const graphName: msRest.OperationURLParameter = { + parameterPath: "graphName", + mapper: { + required: true, + serializedName: "graphName", + type: { + name: "String" + } + } +}; +export const keyspaceName: msRest.OperationURLParameter = { + parameterPath: "keyspaceName", + mapper: { + required: true, + serializedName: "keyspaceName", + type: { + name: "String" + } + } +}; export const nextPageLink: msRest.OperationURLParameter = { parameterPath: "nextPageLink", mapper: { @@ -152,6 +202,16 @@ export const subscriptionId: msRest.OperationURLParameter = { } } }; +export const tableName: msRest.OperationURLParameter = { + parameterPath: "tableName", + mapper: { + required: true, + serializedName: "tableName", + type: { + name: "String" + } + } +}; export const targetRegion: msRest.OperationURLParameter = { parameterPath: "targetRegion", mapper: { diff --git a/sdk/cosmosdb/arm-cosmosdb/src/models/partitionKeyRangeIdMappers.ts b/sdk/cosmosdb/arm-cosmosdb/src/models/partitionKeyRangeIdMappers.ts index a0b31db71d0f..c901f39fec5e 100644 --- a/sdk/cosmosdb/arm-cosmosdb/src/models/partitionKeyRangeIdMappers.ts +++ b/sdk/cosmosdb/arm-cosmosdb/src/models/partitionKeyRangeIdMappers.ts @@ -1,20 +1,17 @@ /* * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for - * license information. + * Licensed under the MIT License. See License.txt in the project root for license information. * * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is - * regenerated. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. */ export { - PartitionMetricListResult, - PartitionMetric, + CloudError, Metric, MetricName, MetricValue, - CloudError, + PartitionMetric, + PartitionMetricListResult, PercentileMetricValue } from "../models/mappers"; - diff --git a/sdk/cosmosdb/arm-cosmosdb/src/models/partitionKeyRangeIdRegionMappers.ts b/sdk/cosmosdb/arm-cosmosdb/src/models/partitionKeyRangeIdRegionMappers.ts index a0b31db71d0f..c901f39fec5e 100644 --- a/sdk/cosmosdb/arm-cosmosdb/src/models/partitionKeyRangeIdRegionMappers.ts +++ b/sdk/cosmosdb/arm-cosmosdb/src/models/partitionKeyRangeIdRegionMappers.ts @@ -1,20 +1,17 @@ /* * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for - * license information. + * Licensed under the MIT License. See License.txt in the project root for license information. * * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is - * regenerated. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. */ export { - PartitionMetricListResult, - PartitionMetric, + CloudError, Metric, MetricName, MetricValue, - CloudError, + PartitionMetric, + PartitionMetricListResult, PercentileMetricValue } from "../models/mappers"; - diff --git a/sdk/cosmosdb/arm-cosmosdb/src/models/percentileMappers.ts b/sdk/cosmosdb/arm-cosmosdb/src/models/percentileMappers.ts index 9399a370caff..969936d1541a 100644 --- a/sdk/cosmosdb/arm-cosmosdb/src/models/percentileMappers.ts +++ b/sdk/cosmosdb/arm-cosmosdb/src/models/percentileMappers.ts @@ -1,19 +1,16 @@ /* * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for - * license information. + * Licensed under the MIT License. See License.txt in the project root for license information. * * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is - * regenerated. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. */ export { - PercentileMetricListResult, - PercentileMetric, + CloudError, MetricName, - PercentileMetricValue, MetricValue, - CloudError + PercentileMetric, + PercentileMetricListResult, + PercentileMetricValue } from "../models/mappers"; - diff --git a/sdk/cosmosdb/arm-cosmosdb/src/models/percentileSourceTargetMappers.ts b/sdk/cosmosdb/arm-cosmosdb/src/models/percentileSourceTargetMappers.ts index 9399a370caff..969936d1541a 100644 --- a/sdk/cosmosdb/arm-cosmosdb/src/models/percentileSourceTargetMappers.ts +++ b/sdk/cosmosdb/arm-cosmosdb/src/models/percentileSourceTargetMappers.ts @@ -1,19 +1,16 @@ /* * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for - * license information. + * Licensed under the MIT License. See License.txt in the project root for license information. * * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is - * regenerated. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. */ export { - PercentileMetricListResult, - PercentileMetric, + CloudError, MetricName, - PercentileMetricValue, MetricValue, - CloudError + PercentileMetric, + PercentileMetricListResult, + PercentileMetricValue } from "../models/mappers"; - diff --git a/sdk/cosmosdb/arm-cosmosdb/src/models/percentileTargetMappers.ts b/sdk/cosmosdb/arm-cosmosdb/src/models/percentileTargetMappers.ts index 9399a370caff..969936d1541a 100644 --- a/sdk/cosmosdb/arm-cosmosdb/src/models/percentileTargetMappers.ts +++ b/sdk/cosmosdb/arm-cosmosdb/src/models/percentileTargetMappers.ts @@ -1,19 +1,16 @@ /* * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for - * license information. + * Licensed under the MIT License. See License.txt in the project root for license information. * * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is - * regenerated. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. */ export { - PercentileMetricListResult, - PercentileMetric, + CloudError, MetricName, - PercentileMetricValue, MetricValue, - CloudError + PercentileMetric, + PercentileMetricListResult, + PercentileMetricValue } from "../models/mappers"; - diff --git a/sdk/cosmosdb/arm-cosmosdb/src/operations/collection.ts b/sdk/cosmosdb/arm-cosmosdb/src/operations/collection.ts index 0422c89def77..1171fd01e545 100644 --- a/sdk/cosmosdb/arm-cosmosdb/src/operations/collection.ts +++ b/sdk/cosmosdb/arm-cosmosdb/src/operations/collection.ts @@ -118,7 +118,7 @@ export class Collection { } /** - * Retrieves metric defintions for the given collection. + * Retrieves metric definitions for the given collection. * @param resourceGroupName Name of an Azure resource group. * @param accountName Cosmos DB database account name. * @param databaseRid Cosmos DB database rid. diff --git a/sdk/cosmosdb/arm-cosmosdb/src/operations/database.ts b/sdk/cosmosdb/arm-cosmosdb/src/operations/database.ts index 72e78748a348..067e391c72cd 100644 --- a/sdk/cosmosdb/arm-cosmosdb/src/operations/database.ts +++ b/sdk/cosmosdb/arm-cosmosdb/src/operations/database.ts @@ -110,7 +110,7 @@ export class Database { } /** - * Retrieves metric defintions for the given database. + * Retrieves metric definitions for the given database. * @param resourceGroupName Name of an Azure resource group. * @param accountName Cosmos DB database account name. * @param databaseRid Cosmos DB database rid. diff --git a/sdk/cosmosdb/arm-cosmosdb/src/operations/databaseAccounts.ts b/sdk/cosmosdb/arm-cosmosdb/src/operations/databaseAccounts.ts index 50b579fdd470..910cf42e9fc9 100644 --- a/sdk/cosmosdb/arm-cosmosdb/src/operations/databaseAccounts.ts +++ b/sdk/cosmosdb/arm-cosmosdb/src/operations/databaseAccounts.ts @@ -436,7 +436,7 @@ export class DatabaseAccounts { } /** - * Retrieves metric defintions for the given database account. + * Retrieves metric definitions for the given database account. * @param resourceGroupName Name of an Azure resource group. * @param accountName Cosmos DB database account name. * @param [options] The optional parameters @@ -468,152 +468,2378 @@ export class DatabaseAccounts { } /** - * Patches the properties of an existing Azure Cosmos DB database account. + * Lists the SQL databases under an existing Azure Cosmos DB database account. * @param resourceGroupName Name of an Azure resource group. * @param accountName Cosmos DB database account name. - * @param updateParameters The tags parameter to patch for the current database account. * @param [options] The optional parameters - * @returns Promise + * @returns Promise */ - beginPatch(resourceGroupName: string, accountName: string, updateParameters: Models.DatabaseAccountPatchParameters, options?: msRest.RequestOptionsBase): Promise { - return this.client.sendLRORequest( + listSqlDatabases(resourceGroupName: string, accountName: string, options?: msRest.RequestOptionsBase): Promise; + /** + * @param resourceGroupName Name of an Azure resource group. + * @param accountName Cosmos DB database account name. + * @param callback The callback + */ + listSqlDatabases(resourceGroupName: string, accountName: string, callback: msRest.ServiceCallback): void; + /** + * @param resourceGroupName Name of an Azure resource group. + * @param accountName Cosmos DB database account name. + * @param options The optional parameters + * @param callback The callback + */ + listSqlDatabases(resourceGroupName: string, accountName: string, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; + listSqlDatabases(resourceGroupName: string, accountName: string, options?: msRest.RequestOptionsBase | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { + return this.client.sendOperationRequest( { resourceGroupName, accountName, - updateParameters, options }, - beginPatchOperationSpec, - options); + listSqlDatabasesOperationSpec, + callback) as Promise; } /** - * Creates or updates an Azure Cosmos DB database account. + * Gets the SQL databases under an existing Azure Cosmos DB database account with the provided + * name. * @param resourceGroupName Name of an Azure resource group. * @param accountName Cosmos DB database account name. - * @param createUpdateParameters The parameters to provide for the current database account. + * @param databaseName Cosmos DB database name. * @param [options] The optional parameters - * @returns Promise + * @returns Promise */ - beginCreateOrUpdate(resourceGroupName: string, accountName: string, createUpdateParameters: Models.DatabaseAccountCreateUpdateParameters, options?: msRest.RequestOptionsBase): Promise { - return this.client.sendLRORequest( + getSqlDatabase(resourceGroupName: string, accountName: string, databaseName: string, options?: msRest.RequestOptionsBase): Promise; + /** + * @param resourceGroupName Name of an Azure resource group. + * @param accountName Cosmos DB database account name. + * @param databaseName Cosmos DB database name. + * @param callback The callback + */ + getSqlDatabase(resourceGroupName: string, accountName: string, databaseName: string, callback: msRest.ServiceCallback): void; + /** + * @param resourceGroupName Name of an Azure resource group. + * @param accountName Cosmos DB database account name. + * @param databaseName Cosmos DB database name. + * @param options The optional parameters + * @param callback The callback + */ + getSqlDatabase(resourceGroupName: string, accountName: string, databaseName: string, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; + getSqlDatabase(resourceGroupName: string, accountName: string, databaseName: string, options?: msRest.RequestOptionsBase | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { + return this.client.sendOperationRequest( { resourceGroupName, accountName, - createUpdateParameters, + databaseName, options }, - beginCreateOrUpdateOperationSpec, - options); + getSqlDatabaseOperationSpec, + callback) as Promise; } /** - * Deletes an existing Azure Cosmos DB database account. + * Create or update an Azure Cosmos DB SQL database * @param resourceGroupName Name of an Azure resource group. * @param accountName Cosmos DB database account name. + * @param databaseName Cosmos DB database name. + * @param createUpdateSqlDatabaseParameters The parameters to provide for the current SQL database. * @param [options] The optional parameters - * @returns Promise + * @returns Promise */ - beginDeleteMethod(resourceGroupName: string, accountName: string, options?: msRest.RequestOptionsBase): Promise { - return this.client.sendLRORequest( + createUpdateSqlDatabase(resourceGroupName: string, accountName: string, databaseName: string, createUpdateSqlDatabaseParameters: Models.SqlDatabaseCreateUpdateParameters, options?: msRest.RequestOptionsBase): Promise { + return this.beginCreateUpdateSqlDatabase(resourceGroupName,accountName,databaseName,createUpdateSqlDatabaseParameters,options) + .then(lroPoller => lroPoller.pollUntilFinished()) as Promise; + } + + /** + * Deletes an existing Azure Cosmos DB SQL database. + * @param resourceGroupName Name of an Azure resource group. + * @param accountName Cosmos DB database account name. + * @param databaseName Cosmos DB database name. + * @param [options] The optional parameters + * @returns Promise + */ + deleteSqlDatabase(resourceGroupName: string, accountName: string, databaseName: string, options?: msRest.RequestOptionsBase): Promise { + return this.beginDeleteSqlDatabase(resourceGroupName,accountName,databaseName,options) + .then(lroPoller => lroPoller.pollUntilFinished()); + } + + /** + * Lists the SQL container under an existing Azure Cosmos DB database account. + * @param resourceGroupName Name of an Azure resource group. + * @param accountName Cosmos DB database account name. + * @param databaseName Cosmos DB database name. + * @param [options] The optional parameters + * @returns Promise + */ + listSqlContainers(resourceGroupName: string, accountName: string, databaseName: string, options?: msRest.RequestOptionsBase): Promise; + /** + * @param resourceGroupName Name of an Azure resource group. + * @param accountName Cosmos DB database account name. + * @param databaseName Cosmos DB database name. + * @param callback The callback + */ + listSqlContainers(resourceGroupName: string, accountName: string, databaseName: string, callback: msRest.ServiceCallback): void; + /** + * @param resourceGroupName Name of an Azure resource group. + * @param accountName Cosmos DB database account name. + * @param databaseName Cosmos DB database name. + * @param options The optional parameters + * @param callback The callback + */ + listSqlContainers(resourceGroupName: string, accountName: string, databaseName: string, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; + listSqlContainers(resourceGroupName: string, accountName: string, databaseName: string, options?: msRest.RequestOptionsBase | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { + return this.client.sendOperationRequest( { resourceGroupName, accountName, + databaseName, options }, - beginDeleteMethodOperationSpec, - options); + listSqlContainersOperationSpec, + callback) as Promise; } /** - * Changes the failover priority for the Azure Cosmos DB database account. A failover priority of 0 - * indicates a write region. The maximum value for a failover priority = (total number of regions - - * 1). Failover priority values must be unique for each of the regions in which the database - * account exists. + * Gets the SQL container under an existing Azure Cosmos DB database account. * @param resourceGroupName Name of an Azure resource group. * @param accountName Cosmos DB database account name. - * @param failoverParameters The new failover policies for the database account. + * @param databaseName Cosmos DB database name. + * @param containerName Cosmos DB container name. * @param [options] The optional parameters - * @returns Promise + * @returns Promise */ - beginFailoverPriorityChange(resourceGroupName: string, accountName: string, failoverParameters: Models.FailoverPolicies, options?: msRest.RequestOptionsBase): Promise { - return this.client.sendLRORequest( + getSqlContainer(resourceGroupName: string, accountName: string, databaseName: string, containerName: string, options?: msRest.RequestOptionsBase): Promise; + /** + * @param resourceGroupName Name of an Azure resource group. + * @param accountName Cosmos DB database account name. + * @param databaseName Cosmos DB database name. + * @param containerName Cosmos DB container name. + * @param callback The callback + */ + getSqlContainer(resourceGroupName: string, accountName: string, databaseName: string, containerName: string, callback: msRest.ServiceCallback): void; + /** + * @param resourceGroupName Name of an Azure resource group. + * @param accountName Cosmos DB database account name. + * @param databaseName Cosmos DB database name. + * @param containerName Cosmos DB container name. + * @param options The optional parameters + * @param callback The callback + */ + getSqlContainer(resourceGroupName: string, accountName: string, databaseName: string, containerName: string, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; + getSqlContainer(resourceGroupName: string, accountName: string, databaseName: string, containerName: string, options?: msRest.RequestOptionsBase | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { + return this.client.sendOperationRequest( { resourceGroupName, accountName, - failoverParameters, + databaseName, + containerName, options }, - beginFailoverPriorityChangeOperationSpec, - options); + getSqlContainerOperationSpec, + callback) as Promise; } /** - * Offline the specified region for the specified Azure Cosmos DB database account. + * Create or update an Azure Cosmos DB SQL container * @param resourceGroupName Name of an Azure resource group. * @param accountName Cosmos DB database account name. - * @param regionParameterForOffline Cosmos DB region to offline for the database account. + * @param databaseName Cosmos DB database name. + * @param containerName Cosmos DB container name. + * @param createUpdateSqlContainerParameters The parameters to provide for the current SQL + * container. * @param [options] The optional parameters - * @returns Promise + * @returns Promise */ - beginOfflineRegion(resourceGroupName: string, accountName: string, regionParameterForOffline: Models.RegionForOnlineOffline, options?: msRest.RequestOptionsBase): Promise { - return this.client.sendLRORequest( + createUpdateSqlContainer(resourceGroupName: string, accountName: string, databaseName: string, containerName: string, createUpdateSqlContainerParameters: Models.SqlContainerCreateUpdateParameters, options?: msRest.RequestOptionsBase): Promise { + return this.beginCreateUpdateSqlContainer(resourceGroupName,accountName,databaseName,containerName,createUpdateSqlContainerParameters,options) + .then(lroPoller => lroPoller.pollUntilFinished()) as Promise; + } + + /** + * Deletes an existing Azure Cosmos DB SQL container. + * @param resourceGroupName Name of an Azure resource group. + * @param accountName Cosmos DB database account name. + * @param databaseName Cosmos DB database name. + * @param containerName Cosmos DB container name. + * @param [options] The optional parameters + * @returns Promise + */ + deleteSqlContainer(resourceGroupName: string, accountName: string, databaseName: string, containerName: string, options?: msRest.RequestOptionsBase): Promise { + return this.beginDeleteSqlContainer(resourceGroupName,accountName,databaseName,containerName,options) + .then(lroPoller => lroPoller.pollUntilFinished()); + } + + /** + * Lists the MongoDB databases under an existing Azure Cosmos DB database account. + * @param resourceGroupName Name of an Azure resource group. + * @param accountName Cosmos DB database account name. + * @param [options] The optional parameters + * @returns Promise + */ + listMongoDBDatabases(resourceGroupName: string, accountName: string, options?: msRest.RequestOptionsBase): Promise; + /** + * @param resourceGroupName Name of an Azure resource group. + * @param accountName Cosmos DB database account name. + * @param callback The callback + */ + listMongoDBDatabases(resourceGroupName: string, accountName: string, callback: msRest.ServiceCallback): void; + /** + * @param resourceGroupName Name of an Azure resource group. + * @param accountName Cosmos DB database account name. + * @param options The optional parameters + * @param callback The callback + */ + listMongoDBDatabases(resourceGroupName: string, accountName: string, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; + listMongoDBDatabases(resourceGroupName: string, accountName: string, options?: msRest.RequestOptionsBase | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { + return this.client.sendOperationRequest( { resourceGroupName, accountName, - regionParameterForOffline, options }, - beginOfflineRegionOperationSpec, - options); + listMongoDBDatabasesOperationSpec, + callback) as Promise; } /** - * Online the specified region for the specified Azure Cosmos DB database account. + * Gets the MongoDB databases under an existing Azure Cosmos DB database account with the provided + * name. * @param resourceGroupName Name of an Azure resource group. * @param accountName Cosmos DB database account name. - * @param regionParameterForOnline Cosmos DB region to online for the database account. + * @param databaseName Cosmos DB database name. * @param [options] The optional parameters - * @returns Promise + * @returns Promise */ - beginOnlineRegion(resourceGroupName: string, accountName: string, regionParameterForOnline: Models.RegionForOnlineOffline, options?: msRest.RequestOptionsBase): Promise { - return this.client.sendLRORequest( + getMongoDBDatabase(resourceGroupName: string, accountName: string, databaseName: string, options?: msRest.RequestOptionsBase): Promise; + /** + * @param resourceGroupName Name of an Azure resource group. + * @param accountName Cosmos DB database account name. + * @param databaseName Cosmos DB database name. + * @param callback The callback + */ + getMongoDBDatabase(resourceGroupName: string, accountName: string, databaseName: string, callback: msRest.ServiceCallback): void; + /** + * @param resourceGroupName Name of an Azure resource group. + * @param accountName Cosmos DB database account name. + * @param databaseName Cosmos DB database name. + * @param options The optional parameters + * @param callback The callback + */ + getMongoDBDatabase(resourceGroupName: string, accountName: string, databaseName: string, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; + getMongoDBDatabase(resourceGroupName: string, accountName: string, databaseName: string, options?: msRest.RequestOptionsBase | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { + return this.client.sendOperationRequest( { resourceGroupName, accountName, - regionParameterForOnline, + databaseName, options }, - beginOnlineRegionOperationSpec, - options); + getMongoDBDatabaseOperationSpec, + callback) as Promise; } /** - * Regenerates an access key for the specified Azure Cosmos DB database account. + * Create or updates Azure Cosmos DB MongoDB database * @param resourceGroupName Name of an Azure resource group. * @param accountName Cosmos DB database account name. - * @param keyToRegenerate The name of the key to regenerate. + * @param databaseName Cosmos DB database name. + * @param createUpdateMongoDBDatabaseParameters The parameters to provide for the current MongoDB + * database. * @param [options] The optional parameters - * @returns Promise + * @returns Promise */ - beginRegenerateKey(resourceGroupName: string, accountName: string, keyToRegenerate: Models.DatabaseAccountRegenerateKeyParameters, options?: msRest.RequestOptionsBase): Promise { - return this.client.sendLRORequest( + createUpdateMongoDBDatabase(resourceGroupName: string, accountName: string, databaseName: string, createUpdateMongoDBDatabaseParameters: Models.MongoDBDatabaseCreateUpdateParameters, options?: msRest.RequestOptionsBase): Promise { + return this.beginCreateUpdateMongoDBDatabase(resourceGroupName,accountName,databaseName,createUpdateMongoDBDatabaseParameters,options) + .then(lroPoller => lroPoller.pollUntilFinished()) as Promise; + } + + /** + * Deletes an existing Azure Cosmos DB MongoDB database. + * @param resourceGroupName Name of an Azure resource group. + * @param accountName Cosmos DB database account name. + * @param databaseName Cosmos DB database name. + * @param [options] The optional parameters + * @returns Promise + */ + deleteMongoDBDatabase(resourceGroupName: string, accountName: string, databaseName: string, options?: msRest.RequestOptionsBase): Promise { + return this.beginDeleteMongoDBDatabase(resourceGroupName,accountName,databaseName,options) + .then(lroPoller => lroPoller.pollUntilFinished()); + } + + /** + * Lists the MongoDB collection under an existing Azure Cosmos DB database account. + * @param resourceGroupName Name of an Azure resource group. + * @param accountName Cosmos DB database account name. + * @param databaseName Cosmos DB database name. + * @param [options] The optional parameters + * @returns Promise + */ + listMongoDBCollections(resourceGroupName: string, accountName: string, databaseName: string, options?: msRest.RequestOptionsBase): Promise; + /** + * @param resourceGroupName Name of an Azure resource group. + * @param accountName Cosmos DB database account name. + * @param databaseName Cosmos DB database name. + * @param callback The callback + */ + listMongoDBCollections(resourceGroupName: string, accountName: string, databaseName: string, callback: msRest.ServiceCallback): void; + /** + * @param resourceGroupName Name of an Azure resource group. + * @param accountName Cosmos DB database account name. + * @param databaseName Cosmos DB database name. + * @param options The optional parameters + * @param callback The callback + */ + listMongoDBCollections(resourceGroupName: string, accountName: string, databaseName: string, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; + listMongoDBCollections(resourceGroupName: string, accountName: string, databaseName: string, options?: msRest.RequestOptionsBase | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { + return this.client.sendOperationRequest( { resourceGroupName, accountName, - keyToRegenerate, + databaseName, options }, - beginRegenerateKeyOperationSpec, - options); + listMongoDBCollectionsOperationSpec, + callback) as Promise; } -} -// Operation Specifications -const serializer = new msRest.Serializer(Mappers); -const getOperationSpec: msRest.OperationSpec = { - httpMethod: "GET", - path: "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}", + /** + * Gets the MongoDB collection under an existing Azure Cosmos DB database account. + * @param resourceGroupName Name of an Azure resource group. + * @param accountName Cosmos DB database account name. + * @param databaseName Cosmos DB database name. + * @param collectionName Cosmos DB collection name. + * @param [options] The optional parameters + * @returns Promise + */ + getMongoDBCollection(resourceGroupName: string, accountName: string, databaseName: string, collectionName: string, options?: msRest.RequestOptionsBase): Promise; + /** + * @param resourceGroupName Name of an Azure resource group. + * @param accountName Cosmos DB database account name. + * @param databaseName Cosmos DB database name. + * @param collectionName Cosmos DB collection name. + * @param callback The callback + */ + getMongoDBCollection(resourceGroupName: string, accountName: string, databaseName: string, collectionName: string, callback: msRest.ServiceCallback): void; + /** + * @param resourceGroupName Name of an Azure resource group. + * @param accountName Cosmos DB database account name. + * @param databaseName Cosmos DB database name. + * @param collectionName Cosmos DB collection name. + * @param options The optional parameters + * @param callback The callback + */ + getMongoDBCollection(resourceGroupName: string, accountName: string, databaseName: string, collectionName: string, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; + getMongoDBCollection(resourceGroupName: string, accountName: string, databaseName: string, collectionName: string, options?: msRest.RequestOptionsBase | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { + return this.client.sendOperationRequest( + { + resourceGroupName, + accountName, + databaseName, + collectionName, + options + }, + getMongoDBCollectionOperationSpec, + callback) as Promise; + } + + /** + * Create or update an Azure Cosmos DB MongoDB Collection + * @param resourceGroupName Name of an Azure resource group. + * @param accountName Cosmos DB database account name. + * @param databaseName Cosmos DB database name. + * @param collectionName Cosmos DB collection name. + * @param createUpdateMongoDBCollectionParameters The parameters to provide for the current MongoDB + * Collection. + * @param [options] The optional parameters + * @returns Promise + */ + createUpdateMongoDBCollection(resourceGroupName: string, accountName: string, databaseName: string, collectionName: string, createUpdateMongoDBCollectionParameters: Models.MongoDBCollectionCreateUpdateParameters, options?: msRest.RequestOptionsBase): Promise { + return this.beginCreateUpdateMongoDBCollection(resourceGroupName,accountName,databaseName,collectionName,createUpdateMongoDBCollectionParameters,options) + .then(lroPoller => lroPoller.pollUntilFinished()) as Promise; + } + + /** + * Deletes an existing Azure Cosmos DB MongoDB Collection. + * @param resourceGroupName Name of an Azure resource group. + * @param accountName Cosmos DB database account name. + * @param databaseName Cosmos DB database name. + * @param collectionName Cosmos DB collection name. + * @param [options] The optional parameters + * @returns Promise + */ + deleteMongoDBCollection(resourceGroupName: string, accountName: string, databaseName: string, collectionName: string, options?: msRest.RequestOptionsBase): Promise { + return this.beginDeleteMongoDBCollection(resourceGroupName,accountName,databaseName,collectionName,options) + .then(lroPoller => lroPoller.pollUntilFinished()); + } + + /** + * Lists the Tables under an existing Azure Cosmos DB database account. + * @param resourceGroupName Name of an Azure resource group. + * @param accountName Cosmos DB database account name. + * @param [options] The optional parameters + * @returns Promise + */ + listTables(resourceGroupName: string, accountName: string, options?: msRest.RequestOptionsBase): Promise; + /** + * @param resourceGroupName Name of an Azure resource group. + * @param accountName Cosmos DB database account name. + * @param callback The callback + */ + listTables(resourceGroupName: string, accountName: string, callback: msRest.ServiceCallback): void; + /** + * @param resourceGroupName Name of an Azure resource group. + * @param accountName Cosmos DB database account name. + * @param options The optional parameters + * @param callback The callback + */ + listTables(resourceGroupName: string, accountName: string, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; + listTables(resourceGroupName: string, accountName: string, options?: msRest.RequestOptionsBase | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { + return this.client.sendOperationRequest( + { + resourceGroupName, + accountName, + options + }, + listTablesOperationSpec, + callback) as Promise; + } + + /** + * Gets the Tables under an existing Azure Cosmos DB database account with the provided name. + * @param resourceGroupName Name of an Azure resource group. + * @param accountName Cosmos DB database account name. + * @param tableName Cosmos DB table name. + * @param [options] The optional parameters + * @returns Promise + */ + getTable(resourceGroupName: string, accountName: string, tableName: string, options?: msRest.RequestOptionsBase): Promise; + /** + * @param resourceGroupName Name of an Azure resource group. + * @param accountName Cosmos DB database account name. + * @param tableName Cosmos DB table name. + * @param callback The callback + */ + getTable(resourceGroupName: string, accountName: string, tableName: string, callback: msRest.ServiceCallback): void; + /** + * @param resourceGroupName Name of an Azure resource group. + * @param accountName Cosmos DB database account name. + * @param tableName Cosmos DB table name. + * @param options The optional parameters + * @param callback The callback + */ + getTable(resourceGroupName: string, accountName: string, tableName: string, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; + getTable(resourceGroupName: string, accountName: string, tableName: string, options?: msRest.RequestOptionsBase | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { + return this.client.sendOperationRequest( + { + resourceGroupName, + accountName, + tableName, + options + }, + getTableOperationSpec, + callback) as Promise; + } + + /** + * Create or update an Azure Cosmos DB Table + * @param resourceGroupName Name of an Azure resource group. + * @param accountName Cosmos DB database account name. + * @param tableName Cosmos DB table name. + * @param createUpdateTableParameters The parameters to provide for the current Table. + * @param [options] The optional parameters + * @returns Promise + */ + createUpdateTable(resourceGroupName: string, accountName: string, tableName: string, createUpdateTableParameters: Models.TableCreateUpdateParameters, options?: msRest.RequestOptionsBase): Promise { + return this.beginCreateUpdateTable(resourceGroupName,accountName,tableName,createUpdateTableParameters,options) + .then(lroPoller => lroPoller.pollUntilFinished()) as Promise; + } + + /** + * Deletes an existing Azure Cosmos DB Table. + * @param resourceGroupName Name of an Azure resource group. + * @param accountName Cosmos DB database account name. + * @param tableName Cosmos DB table name. + * @param [options] The optional parameters + * @returns Promise + */ + deleteTable(resourceGroupName: string, accountName: string, tableName: string, options?: msRest.RequestOptionsBase): Promise { + return this.beginDeleteTable(resourceGroupName,accountName,tableName,options) + .then(lroPoller => lroPoller.pollUntilFinished()); + } + + /** + * Lists the Cassandra keyspaces under an existing Azure Cosmos DB database account. + * @param resourceGroupName Name of an Azure resource group. + * @param accountName Cosmos DB database account name. + * @param [options] The optional parameters + * @returns Promise + */ + listCassandraKeyspaces(resourceGroupName: string, accountName: string, options?: msRest.RequestOptionsBase): Promise; + /** + * @param resourceGroupName Name of an Azure resource group. + * @param accountName Cosmos DB database account name. + * @param callback The callback + */ + listCassandraKeyspaces(resourceGroupName: string, accountName: string, callback: msRest.ServiceCallback): void; + /** + * @param resourceGroupName Name of an Azure resource group. + * @param accountName Cosmos DB database account name. + * @param options The optional parameters + * @param callback The callback + */ + listCassandraKeyspaces(resourceGroupName: string, accountName: string, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; + listCassandraKeyspaces(resourceGroupName: string, accountName: string, options?: msRest.RequestOptionsBase | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { + return this.client.sendOperationRequest( + { + resourceGroupName, + accountName, + options + }, + listCassandraKeyspacesOperationSpec, + callback) as Promise; + } + + /** + * Gets the Cassandra keyspaces under an existing Azure Cosmos DB database account with the + * provided name. + * @param resourceGroupName Name of an Azure resource group. + * @param accountName Cosmos DB database account name. + * @param keyspaceName Cosmos DB keyspace name. + * @param [options] The optional parameters + * @returns Promise + */ + getCassandraKeyspace(resourceGroupName: string, accountName: string, keyspaceName: string, options?: msRest.RequestOptionsBase): Promise; + /** + * @param resourceGroupName Name of an Azure resource group. + * @param accountName Cosmos DB database account name. + * @param keyspaceName Cosmos DB keyspace name. + * @param callback The callback + */ + getCassandraKeyspace(resourceGroupName: string, accountName: string, keyspaceName: string, callback: msRest.ServiceCallback): void; + /** + * @param resourceGroupName Name of an Azure resource group. + * @param accountName Cosmos DB database account name. + * @param keyspaceName Cosmos DB keyspace name. + * @param options The optional parameters + * @param callback The callback + */ + getCassandraKeyspace(resourceGroupName: string, accountName: string, keyspaceName: string, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; + getCassandraKeyspace(resourceGroupName: string, accountName: string, keyspaceName: string, options?: msRest.RequestOptionsBase | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { + return this.client.sendOperationRequest( + { + resourceGroupName, + accountName, + keyspaceName, + options + }, + getCassandraKeyspaceOperationSpec, + callback) as Promise; + } + + /** + * Create or update an Azure Cosmos DB Cassandra keyspace + * @param resourceGroupName Name of an Azure resource group. + * @param accountName Cosmos DB database account name. + * @param keyspaceName Cosmos DB keyspace name. + * @param createUpdateCassandraKeyspaceParameters The parameters to provide for the current + * Cassandra keyspace. + * @param [options] The optional parameters + * @returns Promise + */ + createUpdateCassandraKeyspace(resourceGroupName: string, accountName: string, keyspaceName: string, createUpdateCassandraKeyspaceParameters: Models.CassandraKeyspaceCreateUpdateParameters, options?: msRest.RequestOptionsBase): Promise { + return this.beginCreateUpdateCassandraKeyspace(resourceGroupName,accountName,keyspaceName,createUpdateCassandraKeyspaceParameters,options) + .then(lroPoller => lroPoller.pollUntilFinished()) as Promise; + } + + /** + * Deletes an existing Azure Cosmos DB Cassandra keyspace. + * @param resourceGroupName Name of an Azure resource group. + * @param accountName Cosmos DB database account name. + * @param keyspaceName Cosmos DB keyspace name. + * @param [options] The optional parameters + * @returns Promise + */ + deleteCassandraKeyspace(resourceGroupName: string, accountName: string, keyspaceName: string, options?: msRest.RequestOptionsBase): Promise { + return this.beginDeleteCassandraKeyspace(resourceGroupName,accountName,keyspaceName,options) + .then(lroPoller => lroPoller.pollUntilFinished()); + } + + /** + * Lists the Cassandra table under an existing Azure Cosmos DB database account. + * @param resourceGroupName Name of an Azure resource group. + * @param accountName Cosmos DB database account name. + * @param keyspaceName Cosmos DB keyspace name. + * @param [options] The optional parameters + * @returns Promise + */ + listCassandraTables(resourceGroupName: string, accountName: string, keyspaceName: string, options?: msRest.RequestOptionsBase): Promise; + /** + * @param resourceGroupName Name of an Azure resource group. + * @param accountName Cosmos DB database account name. + * @param keyspaceName Cosmos DB keyspace name. + * @param callback The callback + */ + listCassandraTables(resourceGroupName: string, accountName: string, keyspaceName: string, callback: msRest.ServiceCallback): void; + /** + * @param resourceGroupName Name of an Azure resource group. + * @param accountName Cosmos DB database account name. + * @param keyspaceName Cosmos DB keyspace name. + * @param options The optional parameters + * @param callback The callback + */ + listCassandraTables(resourceGroupName: string, accountName: string, keyspaceName: string, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; + listCassandraTables(resourceGroupName: string, accountName: string, keyspaceName: string, options?: msRest.RequestOptionsBase | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { + return this.client.sendOperationRequest( + { + resourceGroupName, + accountName, + keyspaceName, + options + }, + listCassandraTablesOperationSpec, + callback) as Promise; + } + + /** + * Gets the Cassandra table under an existing Azure Cosmos DB database account. + * @param resourceGroupName Name of an Azure resource group. + * @param accountName Cosmos DB database account name. + * @param keyspaceName Cosmos DB keyspace name. + * @param tableName Cosmos DB table name. + * @param [options] The optional parameters + * @returns Promise + */ + getCassandraTable(resourceGroupName: string, accountName: string, keyspaceName: string, tableName: string, options?: msRest.RequestOptionsBase): Promise; + /** + * @param resourceGroupName Name of an Azure resource group. + * @param accountName Cosmos DB database account name. + * @param keyspaceName Cosmos DB keyspace name. + * @param tableName Cosmos DB table name. + * @param callback The callback + */ + getCassandraTable(resourceGroupName: string, accountName: string, keyspaceName: string, tableName: string, callback: msRest.ServiceCallback): void; + /** + * @param resourceGroupName Name of an Azure resource group. + * @param accountName Cosmos DB database account name. + * @param keyspaceName Cosmos DB keyspace name. + * @param tableName Cosmos DB table name. + * @param options The optional parameters + * @param callback The callback + */ + getCassandraTable(resourceGroupName: string, accountName: string, keyspaceName: string, tableName: string, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; + getCassandraTable(resourceGroupName: string, accountName: string, keyspaceName: string, tableName: string, options?: msRest.RequestOptionsBase | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { + return this.client.sendOperationRequest( + { + resourceGroupName, + accountName, + keyspaceName, + tableName, + options + }, + getCassandraTableOperationSpec, + callback) as Promise; + } + + /** + * Create or update an Azure Cosmos DB Cassandra Table + * @param resourceGroupName Name of an Azure resource group. + * @param accountName Cosmos DB database account name. + * @param keyspaceName Cosmos DB keyspace name. + * @param tableName Cosmos DB table name. + * @param createUpdateCassandraTableParameters The parameters to provide for the current Cassandra + * Table. + * @param [options] The optional parameters + * @returns Promise + */ + createUpdateCassandraTable(resourceGroupName: string, accountName: string, keyspaceName: string, tableName: string, createUpdateCassandraTableParameters: Models.CassandraTableCreateUpdateParameters, options?: msRest.RequestOptionsBase): Promise { + return this.beginCreateUpdateCassandraTable(resourceGroupName,accountName,keyspaceName,tableName,createUpdateCassandraTableParameters,options) + .then(lroPoller => lroPoller.pollUntilFinished()) as Promise; + } + + /** + * Deletes an existing Azure Cosmos DB Cassandra table. + * @param resourceGroupName Name of an Azure resource group. + * @param accountName Cosmos DB database account name. + * @param keyspaceName Cosmos DB keyspace name. + * @param tableName Cosmos DB table name. + * @param [options] The optional parameters + * @returns Promise + */ + deleteCassandraTable(resourceGroupName: string, accountName: string, keyspaceName: string, tableName: string, options?: msRest.RequestOptionsBase): Promise { + return this.beginDeleteCassandraTable(resourceGroupName,accountName,keyspaceName,tableName,options) + .then(lroPoller => lroPoller.pollUntilFinished()); + } + + /** + * Lists the Gremlin databases under an existing Azure Cosmos DB database account. + * @param resourceGroupName Name of an Azure resource group. + * @param accountName Cosmos DB database account name. + * @param [options] The optional parameters + * @returns Promise + */ + listGremlinDatabases(resourceGroupName: string, accountName: string, options?: msRest.RequestOptionsBase): Promise; + /** + * @param resourceGroupName Name of an Azure resource group. + * @param accountName Cosmos DB database account name. + * @param callback The callback + */ + listGremlinDatabases(resourceGroupName: string, accountName: string, callback: msRest.ServiceCallback): void; + /** + * @param resourceGroupName Name of an Azure resource group. + * @param accountName Cosmos DB database account name. + * @param options The optional parameters + * @param callback The callback + */ + listGremlinDatabases(resourceGroupName: string, accountName: string, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; + listGremlinDatabases(resourceGroupName: string, accountName: string, options?: msRest.RequestOptionsBase | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { + return this.client.sendOperationRequest( + { + resourceGroupName, + accountName, + options + }, + listGremlinDatabasesOperationSpec, + callback) as Promise; + } + + /** + * Gets the Gremlin databases under an existing Azure Cosmos DB database account with the provided + * name. + * @param resourceGroupName Name of an Azure resource group. + * @param accountName Cosmos DB database account name. + * @param databaseName Cosmos DB database name. + * @param [options] The optional parameters + * @returns Promise + */ + getGremlinDatabase(resourceGroupName: string, accountName: string, databaseName: string, options?: msRest.RequestOptionsBase): Promise; + /** + * @param resourceGroupName Name of an Azure resource group. + * @param accountName Cosmos DB database account name. + * @param databaseName Cosmos DB database name. + * @param callback The callback + */ + getGremlinDatabase(resourceGroupName: string, accountName: string, databaseName: string, callback: msRest.ServiceCallback): void; + /** + * @param resourceGroupName Name of an Azure resource group. + * @param accountName Cosmos DB database account name. + * @param databaseName Cosmos DB database name. + * @param options The optional parameters + * @param callback The callback + */ + getGremlinDatabase(resourceGroupName: string, accountName: string, databaseName: string, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; + getGremlinDatabase(resourceGroupName: string, accountName: string, databaseName: string, options?: msRest.RequestOptionsBase | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { + return this.client.sendOperationRequest( + { + resourceGroupName, + accountName, + databaseName, + options + }, + getGremlinDatabaseOperationSpec, + callback) as Promise; + } + + /** + * Create or update an Azure Cosmos DB Gremlin database + * @param resourceGroupName Name of an Azure resource group. + * @param accountName Cosmos DB database account name. + * @param databaseName Cosmos DB database name. + * @param createUpdateGremlinDatabaseParameters The parameters to provide for the current Gremlin + * database. + * @param [options] The optional parameters + * @returns Promise + */ + createUpdateGremlinDatabase(resourceGroupName: string, accountName: string, databaseName: string, createUpdateGremlinDatabaseParameters: Models.GremlinDatabaseCreateUpdateParameters, options?: msRest.RequestOptionsBase): Promise { + return this.beginCreateUpdateGremlinDatabase(resourceGroupName,accountName,databaseName,createUpdateGremlinDatabaseParameters,options) + .then(lroPoller => lroPoller.pollUntilFinished()) as Promise; + } + + /** + * Deletes an existing Azure Cosmos DB Gremlin database. + * @param resourceGroupName Name of an Azure resource group. + * @param accountName Cosmos DB database account name. + * @param databaseName Cosmos DB database name. + * @param [options] The optional parameters + * @returns Promise + */ + deleteGremlinDatabase(resourceGroupName: string, accountName: string, databaseName: string, options?: msRest.RequestOptionsBase): Promise { + return this.beginDeleteGremlinDatabase(resourceGroupName,accountName,databaseName,options) + .then(lroPoller => lroPoller.pollUntilFinished()); + } + + /** + * Lists the Gremlin graph under an existing Azure Cosmos DB database account. + * @param resourceGroupName Name of an Azure resource group. + * @param accountName Cosmos DB database account name. + * @param databaseName Cosmos DB database name. + * @param [options] The optional parameters + * @returns Promise + */ + listGremlinGraphs(resourceGroupName: string, accountName: string, databaseName: string, options?: msRest.RequestOptionsBase): Promise; + /** + * @param resourceGroupName Name of an Azure resource group. + * @param accountName Cosmos DB database account name. + * @param databaseName Cosmos DB database name. + * @param callback The callback + */ + listGremlinGraphs(resourceGroupName: string, accountName: string, databaseName: string, callback: msRest.ServiceCallback): void; + /** + * @param resourceGroupName Name of an Azure resource group. + * @param accountName Cosmos DB database account name. + * @param databaseName Cosmos DB database name. + * @param options The optional parameters + * @param callback The callback + */ + listGremlinGraphs(resourceGroupName: string, accountName: string, databaseName: string, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; + listGremlinGraphs(resourceGroupName: string, accountName: string, databaseName: string, options?: msRest.RequestOptionsBase | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { + return this.client.sendOperationRequest( + { + resourceGroupName, + accountName, + databaseName, + options + }, + listGremlinGraphsOperationSpec, + callback) as Promise; + } + + /** + * Gets the Gremlin graph under an existing Azure Cosmos DB database account. + * @param resourceGroupName Name of an Azure resource group. + * @param accountName Cosmos DB database account name. + * @param databaseName Cosmos DB database name. + * @param graphName Cosmos DB graph name. + * @param [options] The optional parameters + * @returns Promise + */ + getGremlinGraph(resourceGroupName: string, accountName: string, databaseName: string, graphName: string, options?: msRest.RequestOptionsBase): Promise; + /** + * @param resourceGroupName Name of an Azure resource group. + * @param accountName Cosmos DB database account name. + * @param databaseName Cosmos DB database name. + * @param graphName Cosmos DB graph name. + * @param callback The callback + */ + getGremlinGraph(resourceGroupName: string, accountName: string, databaseName: string, graphName: string, callback: msRest.ServiceCallback): void; + /** + * @param resourceGroupName Name of an Azure resource group. + * @param accountName Cosmos DB database account name. + * @param databaseName Cosmos DB database name. + * @param graphName Cosmos DB graph name. + * @param options The optional parameters + * @param callback The callback + */ + getGremlinGraph(resourceGroupName: string, accountName: string, databaseName: string, graphName: string, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; + getGremlinGraph(resourceGroupName: string, accountName: string, databaseName: string, graphName: string, options?: msRest.RequestOptionsBase | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { + return this.client.sendOperationRequest( + { + resourceGroupName, + accountName, + databaseName, + graphName, + options + }, + getGremlinGraphOperationSpec, + callback) as Promise; + } + + /** + * Create or update an Azure Cosmos DB Gremlin graph + * @param resourceGroupName Name of an Azure resource group. + * @param accountName Cosmos DB database account name. + * @param databaseName Cosmos DB database name. + * @param graphName Cosmos DB graph name. + * @param createUpdateGremlinGraphParameters The parameters to provide for the current Gremlin + * graph. + * @param [options] The optional parameters + * @returns Promise + */ + createUpdateGremlinGraph(resourceGroupName: string, accountName: string, databaseName: string, graphName: string, createUpdateGremlinGraphParameters: Models.GremlinGraphCreateUpdateParameters, options?: msRest.RequestOptionsBase): Promise { + return this.beginCreateUpdateGremlinGraph(resourceGroupName,accountName,databaseName,graphName,createUpdateGremlinGraphParameters,options) + .then(lroPoller => lroPoller.pollUntilFinished()) as Promise; + } + + /** + * Deletes an existing Azure Cosmos DB Gremlin graph. + * @param resourceGroupName Name of an Azure resource group. + * @param accountName Cosmos DB database account name. + * @param databaseName Cosmos DB database name. + * @param graphName Cosmos DB graph name. + * @param [options] The optional parameters + * @returns Promise + */ + deleteGremlinGraph(resourceGroupName: string, accountName: string, databaseName: string, graphName: string, options?: msRest.RequestOptionsBase): Promise { + return this.beginDeleteGremlinGraph(resourceGroupName,accountName,databaseName,graphName,options) + .then(lroPoller => lroPoller.pollUntilFinished()); + } + + /** + * Patches the properties of an existing Azure Cosmos DB database account. + * @param resourceGroupName Name of an Azure resource group. + * @param accountName Cosmos DB database account name. + * @param updateParameters The tags parameter to patch for the current database account. + * @param [options] The optional parameters + * @returns Promise + */ + beginPatch(resourceGroupName: string, accountName: string, updateParameters: Models.DatabaseAccountPatchParameters, options?: msRest.RequestOptionsBase): Promise { + return this.client.sendLRORequest( + { + resourceGroupName, + accountName, + updateParameters, + options + }, + beginPatchOperationSpec, + options); + } + + /** + * Creates or updates an Azure Cosmos DB database account. + * @param resourceGroupName Name of an Azure resource group. + * @param accountName Cosmos DB database account name. + * @param createUpdateParameters The parameters to provide for the current database account. + * @param [options] The optional parameters + * @returns Promise + */ + beginCreateOrUpdate(resourceGroupName: string, accountName: string, createUpdateParameters: Models.DatabaseAccountCreateUpdateParameters, options?: msRest.RequestOptionsBase): Promise { + return this.client.sendLRORequest( + { + resourceGroupName, + accountName, + createUpdateParameters, + options + }, + beginCreateOrUpdateOperationSpec, + options); + } + + /** + * Deletes an existing Azure Cosmos DB database account. + * @param resourceGroupName Name of an Azure resource group. + * @param accountName Cosmos DB database account name. + * @param [options] The optional parameters + * @returns Promise + */ + beginDeleteMethod(resourceGroupName: string, accountName: string, options?: msRest.RequestOptionsBase): Promise { + return this.client.sendLRORequest( + { + resourceGroupName, + accountName, + options + }, + beginDeleteMethodOperationSpec, + options); + } + + /** + * Changes the failover priority for the Azure Cosmos DB database account. A failover priority of 0 + * indicates a write region. The maximum value for a failover priority = (total number of regions - + * 1). Failover priority values must be unique for each of the regions in which the database + * account exists. + * @param resourceGroupName Name of an Azure resource group. + * @param accountName Cosmos DB database account name. + * @param failoverParameters The new failover policies for the database account. + * @param [options] The optional parameters + * @returns Promise + */ + beginFailoverPriorityChange(resourceGroupName: string, accountName: string, failoverParameters: Models.FailoverPolicies, options?: msRest.RequestOptionsBase): Promise { + return this.client.sendLRORequest( + { + resourceGroupName, + accountName, + failoverParameters, + options + }, + beginFailoverPriorityChangeOperationSpec, + options); + } + + /** + * Offline the specified region for the specified Azure Cosmos DB database account. + * @param resourceGroupName Name of an Azure resource group. + * @param accountName Cosmos DB database account name. + * @param regionParameterForOffline Cosmos DB region to offline for the database account. + * @param [options] The optional parameters + * @returns Promise + */ + beginOfflineRegion(resourceGroupName: string, accountName: string, regionParameterForOffline: Models.RegionForOnlineOffline, options?: msRest.RequestOptionsBase): Promise { + return this.client.sendLRORequest( + { + resourceGroupName, + accountName, + regionParameterForOffline, + options + }, + beginOfflineRegionOperationSpec, + options); + } + + /** + * Online the specified region for the specified Azure Cosmos DB database account. + * @param resourceGroupName Name of an Azure resource group. + * @param accountName Cosmos DB database account name. + * @param regionParameterForOnline Cosmos DB region to online for the database account. + * @param [options] The optional parameters + * @returns Promise + */ + beginOnlineRegion(resourceGroupName: string, accountName: string, regionParameterForOnline: Models.RegionForOnlineOffline, options?: msRest.RequestOptionsBase): Promise { + return this.client.sendLRORequest( + { + resourceGroupName, + accountName, + regionParameterForOnline, + options + }, + beginOnlineRegionOperationSpec, + options); + } + + /** + * Regenerates an access key for the specified Azure Cosmos DB database account. + * @param resourceGroupName Name of an Azure resource group. + * @param accountName Cosmos DB database account name. + * @param keyToRegenerate The name of the key to regenerate. + * @param [options] The optional parameters + * @returns Promise + */ + beginRegenerateKey(resourceGroupName: string, accountName: string, keyToRegenerate: Models.DatabaseAccountRegenerateKeyParameters, options?: msRest.RequestOptionsBase): Promise { + return this.client.sendLRORequest( + { + resourceGroupName, + accountName, + keyToRegenerate, + options + }, + beginRegenerateKeyOperationSpec, + options); + } + + /** + * Create or update an Azure Cosmos DB SQL database + * @param resourceGroupName Name of an Azure resource group. + * @param accountName Cosmos DB database account name. + * @param databaseName Cosmos DB database name. + * @param createUpdateSqlDatabaseParameters The parameters to provide for the current SQL database. + * @param [options] The optional parameters + * @returns Promise + */ + beginCreateUpdateSqlDatabase(resourceGroupName: string, accountName: string, databaseName: string, createUpdateSqlDatabaseParameters: Models.SqlDatabaseCreateUpdateParameters, options?: msRest.RequestOptionsBase): Promise { + return this.client.sendLRORequest( + { + resourceGroupName, + accountName, + databaseName, + createUpdateSqlDatabaseParameters, + options + }, + beginCreateUpdateSqlDatabaseOperationSpec, + options); + } + + /** + * Deletes an existing Azure Cosmos DB SQL database. + * @param resourceGroupName Name of an Azure resource group. + * @param accountName Cosmos DB database account name. + * @param databaseName Cosmos DB database name. + * @param [options] The optional parameters + * @returns Promise + */ + beginDeleteSqlDatabase(resourceGroupName: string, accountName: string, databaseName: string, options?: msRest.RequestOptionsBase): Promise { + return this.client.sendLRORequest( + { + resourceGroupName, + accountName, + databaseName, + options + }, + beginDeleteSqlDatabaseOperationSpec, + options); + } + + /** + * Create or update an Azure Cosmos DB SQL container + * @param resourceGroupName Name of an Azure resource group. + * @param accountName Cosmos DB database account name. + * @param databaseName Cosmos DB database name. + * @param containerName Cosmos DB container name. + * @param createUpdateSqlContainerParameters The parameters to provide for the current SQL + * container. + * @param [options] The optional parameters + * @returns Promise + */ + beginCreateUpdateSqlContainer(resourceGroupName: string, accountName: string, databaseName: string, containerName: string, createUpdateSqlContainerParameters: Models.SqlContainerCreateUpdateParameters, options?: msRest.RequestOptionsBase): Promise { + return this.client.sendLRORequest( + { + resourceGroupName, + accountName, + databaseName, + containerName, + createUpdateSqlContainerParameters, + options + }, + beginCreateUpdateSqlContainerOperationSpec, + options); + } + + /** + * Deletes an existing Azure Cosmos DB SQL container. + * @param resourceGroupName Name of an Azure resource group. + * @param accountName Cosmos DB database account name. + * @param databaseName Cosmos DB database name. + * @param containerName Cosmos DB container name. + * @param [options] The optional parameters + * @returns Promise + */ + beginDeleteSqlContainer(resourceGroupName: string, accountName: string, databaseName: string, containerName: string, options?: msRest.RequestOptionsBase): Promise { + return this.client.sendLRORequest( + { + resourceGroupName, + accountName, + databaseName, + containerName, + options + }, + beginDeleteSqlContainerOperationSpec, + options); + } + + /** + * Create or updates Azure Cosmos DB MongoDB database + * @param resourceGroupName Name of an Azure resource group. + * @param accountName Cosmos DB database account name. + * @param databaseName Cosmos DB database name. + * @param createUpdateMongoDBDatabaseParameters The parameters to provide for the current MongoDB + * database. + * @param [options] The optional parameters + * @returns Promise + */ + beginCreateUpdateMongoDBDatabase(resourceGroupName: string, accountName: string, databaseName: string, createUpdateMongoDBDatabaseParameters: Models.MongoDBDatabaseCreateUpdateParameters, options?: msRest.RequestOptionsBase): Promise { + return this.client.sendLRORequest( + { + resourceGroupName, + accountName, + databaseName, + createUpdateMongoDBDatabaseParameters, + options + }, + beginCreateUpdateMongoDBDatabaseOperationSpec, + options); + } + + /** + * Deletes an existing Azure Cosmos DB MongoDB database. + * @param resourceGroupName Name of an Azure resource group. + * @param accountName Cosmos DB database account name. + * @param databaseName Cosmos DB database name. + * @param [options] The optional parameters + * @returns Promise + */ + beginDeleteMongoDBDatabase(resourceGroupName: string, accountName: string, databaseName: string, options?: msRest.RequestOptionsBase): Promise { + return this.client.sendLRORequest( + { + resourceGroupName, + accountName, + databaseName, + options + }, + beginDeleteMongoDBDatabaseOperationSpec, + options); + } + + /** + * Create or update an Azure Cosmos DB MongoDB Collection + * @param resourceGroupName Name of an Azure resource group. + * @param accountName Cosmos DB database account name. + * @param databaseName Cosmos DB database name. + * @param collectionName Cosmos DB collection name. + * @param createUpdateMongoDBCollectionParameters The parameters to provide for the current MongoDB + * Collection. + * @param [options] The optional parameters + * @returns Promise + */ + beginCreateUpdateMongoDBCollection(resourceGroupName: string, accountName: string, databaseName: string, collectionName: string, createUpdateMongoDBCollectionParameters: Models.MongoDBCollectionCreateUpdateParameters, options?: msRest.RequestOptionsBase): Promise { + return this.client.sendLRORequest( + { + resourceGroupName, + accountName, + databaseName, + collectionName, + createUpdateMongoDBCollectionParameters, + options + }, + beginCreateUpdateMongoDBCollectionOperationSpec, + options); + } + + /** + * Deletes an existing Azure Cosmos DB MongoDB Collection. + * @param resourceGroupName Name of an Azure resource group. + * @param accountName Cosmos DB database account name. + * @param databaseName Cosmos DB database name. + * @param collectionName Cosmos DB collection name. + * @param [options] The optional parameters + * @returns Promise + */ + beginDeleteMongoDBCollection(resourceGroupName: string, accountName: string, databaseName: string, collectionName: string, options?: msRest.RequestOptionsBase): Promise { + return this.client.sendLRORequest( + { + resourceGroupName, + accountName, + databaseName, + collectionName, + options + }, + beginDeleteMongoDBCollectionOperationSpec, + options); + } + + /** + * Create or update an Azure Cosmos DB Table + * @param resourceGroupName Name of an Azure resource group. + * @param accountName Cosmos DB database account name. + * @param tableName Cosmos DB table name. + * @param createUpdateTableParameters The parameters to provide for the current Table. + * @param [options] The optional parameters + * @returns Promise + */ + beginCreateUpdateTable(resourceGroupName: string, accountName: string, tableName: string, createUpdateTableParameters: Models.TableCreateUpdateParameters, options?: msRest.RequestOptionsBase): Promise { + return this.client.sendLRORequest( + { + resourceGroupName, + accountName, + tableName, + createUpdateTableParameters, + options + }, + beginCreateUpdateTableOperationSpec, + options); + } + + /** + * Deletes an existing Azure Cosmos DB Table. + * @param resourceGroupName Name of an Azure resource group. + * @param accountName Cosmos DB database account name. + * @param tableName Cosmos DB table name. + * @param [options] The optional parameters + * @returns Promise + */ + beginDeleteTable(resourceGroupName: string, accountName: string, tableName: string, options?: msRest.RequestOptionsBase): Promise { + return this.client.sendLRORequest( + { + resourceGroupName, + accountName, + tableName, + options + }, + beginDeleteTableOperationSpec, + options); + } + + /** + * Create or update an Azure Cosmos DB Cassandra keyspace + * @param resourceGroupName Name of an Azure resource group. + * @param accountName Cosmos DB database account name. + * @param keyspaceName Cosmos DB keyspace name. + * @param createUpdateCassandraKeyspaceParameters The parameters to provide for the current + * Cassandra keyspace. + * @param [options] The optional parameters + * @returns Promise + */ + beginCreateUpdateCassandraKeyspace(resourceGroupName: string, accountName: string, keyspaceName: string, createUpdateCassandraKeyspaceParameters: Models.CassandraKeyspaceCreateUpdateParameters, options?: msRest.RequestOptionsBase): Promise { + return this.client.sendLRORequest( + { + resourceGroupName, + accountName, + keyspaceName, + createUpdateCassandraKeyspaceParameters, + options + }, + beginCreateUpdateCassandraKeyspaceOperationSpec, + options); + } + + /** + * Deletes an existing Azure Cosmos DB Cassandra keyspace. + * @param resourceGroupName Name of an Azure resource group. + * @param accountName Cosmos DB database account name. + * @param keyspaceName Cosmos DB keyspace name. + * @param [options] The optional parameters + * @returns Promise + */ + beginDeleteCassandraKeyspace(resourceGroupName: string, accountName: string, keyspaceName: string, options?: msRest.RequestOptionsBase): Promise { + return this.client.sendLRORequest( + { + resourceGroupName, + accountName, + keyspaceName, + options + }, + beginDeleteCassandraKeyspaceOperationSpec, + options); + } + + /** + * Create or update an Azure Cosmos DB Cassandra Table + * @param resourceGroupName Name of an Azure resource group. + * @param accountName Cosmos DB database account name. + * @param keyspaceName Cosmos DB keyspace name. + * @param tableName Cosmos DB table name. + * @param createUpdateCassandraTableParameters The parameters to provide for the current Cassandra + * Table. + * @param [options] The optional parameters + * @returns Promise + */ + beginCreateUpdateCassandraTable(resourceGroupName: string, accountName: string, keyspaceName: string, tableName: string, createUpdateCassandraTableParameters: Models.CassandraTableCreateUpdateParameters, options?: msRest.RequestOptionsBase): Promise { + return this.client.sendLRORequest( + { + resourceGroupName, + accountName, + keyspaceName, + tableName, + createUpdateCassandraTableParameters, + options + }, + beginCreateUpdateCassandraTableOperationSpec, + options); + } + + /** + * Deletes an existing Azure Cosmos DB Cassandra table. + * @param resourceGroupName Name of an Azure resource group. + * @param accountName Cosmos DB database account name. + * @param keyspaceName Cosmos DB keyspace name. + * @param tableName Cosmos DB table name. + * @param [options] The optional parameters + * @returns Promise + */ + beginDeleteCassandraTable(resourceGroupName: string, accountName: string, keyspaceName: string, tableName: string, options?: msRest.RequestOptionsBase): Promise { + return this.client.sendLRORequest( + { + resourceGroupName, + accountName, + keyspaceName, + tableName, + options + }, + beginDeleteCassandraTableOperationSpec, + options); + } + + /** + * Create or update an Azure Cosmos DB Gremlin database + * @param resourceGroupName Name of an Azure resource group. + * @param accountName Cosmos DB database account name. + * @param databaseName Cosmos DB database name. + * @param createUpdateGremlinDatabaseParameters The parameters to provide for the current Gremlin + * database. + * @param [options] The optional parameters + * @returns Promise + */ + beginCreateUpdateGremlinDatabase(resourceGroupName: string, accountName: string, databaseName: string, createUpdateGremlinDatabaseParameters: Models.GremlinDatabaseCreateUpdateParameters, options?: msRest.RequestOptionsBase): Promise { + return this.client.sendLRORequest( + { + resourceGroupName, + accountName, + databaseName, + createUpdateGremlinDatabaseParameters, + options + }, + beginCreateUpdateGremlinDatabaseOperationSpec, + options); + } + + /** + * Deletes an existing Azure Cosmos DB Gremlin database. + * @param resourceGroupName Name of an Azure resource group. + * @param accountName Cosmos DB database account name. + * @param databaseName Cosmos DB database name. + * @param [options] The optional parameters + * @returns Promise + */ + beginDeleteGremlinDatabase(resourceGroupName: string, accountName: string, databaseName: string, options?: msRest.RequestOptionsBase): Promise { + return this.client.sendLRORequest( + { + resourceGroupName, + accountName, + databaseName, + options + }, + beginDeleteGremlinDatabaseOperationSpec, + options); + } + + /** + * Create or update an Azure Cosmos DB Gremlin graph + * @param resourceGroupName Name of an Azure resource group. + * @param accountName Cosmos DB database account name. + * @param databaseName Cosmos DB database name. + * @param graphName Cosmos DB graph name. + * @param createUpdateGremlinGraphParameters The parameters to provide for the current Gremlin + * graph. + * @param [options] The optional parameters + * @returns Promise + */ + beginCreateUpdateGremlinGraph(resourceGroupName: string, accountName: string, databaseName: string, graphName: string, createUpdateGremlinGraphParameters: Models.GremlinGraphCreateUpdateParameters, options?: msRest.RequestOptionsBase): Promise { + return this.client.sendLRORequest( + { + resourceGroupName, + accountName, + databaseName, + graphName, + createUpdateGremlinGraphParameters, + options + }, + beginCreateUpdateGremlinGraphOperationSpec, + options); + } + + /** + * Deletes an existing Azure Cosmos DB Gremlin graph. + * @param resourceGroupName Name of an Azure resource group. + * @param accountName Cosmos DB database account name. + * @param databaseName Cosmos DB database name. + * @param graphName Cosmos DB graph name. + * @param [options] The optional parameters + * @returns Promise + */ + beginDeleteGremlinGraph(resourceGroupName: string, accountName: string, databaseName: string, graphName: string, options?: msRest.RequestOptionsBase): Promise { + return this.client.sendLRORequest( + { + resourceGroupName, + accountName, + databaseName, + graphName, + options + }, + beginDeleteGremlinGraphOperationSpec, + options); + } +} + +// Operation Specifications +const serializer = new msRest.Serializer(Mappers); +const getOperationSpec: msRest.OperationSpec = { + httpMethod: "GET", + path: "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}", + urlParameters: [ + Parameters.subscriptionId, + Parameters.resourceGroupName, + Parameters.accountName + ], + queryParameters: [ + Parameters.apiVersion + ], + headerParameters: [ + Parameters.acceptLanguage + ], + responses: { + 200: { + bodyMapper: Mappers.DatabaseAccount + }, + default: { + bodyMapper: Mappers.CloudError + } + }, + serializer +}; + +const listOperationSpec: msRest.OperationSpec = { + httpMethod: "GET", + path: "subscriptions/{subscriptionId}/providers/Microsoft.DocumentDB/databaseAccounts", + urlParameters: [ + Parameters.subscriptionId + ], + queryParameters: [ + Parameters.apiVersion + ], + headerParameters: [ + Parameters.acceptLanguage + ], + responses: { + 200: { + bodyMapper: Mappers.DatabaseAccountsListResult + }, + default: { + bodyMapper: Mappers.CloudError + } + }, + serializer +}; + +const listByResourceGroupOperationSpec: msRest.OperationSpec = { + httpMethod: "GET", + path: "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts", + urlParameters: [ + Parameters.resourceGroupName, + Parameters.subscriptionId + ], + queryParameters: [ + Parameters.apiVersion + ], + headerParameters: [ + Parameters.acceptLanguage + ], + responses: { + 200: { + bodyMapper: Mappers.DatabaseAccountsListResult + }, + default: { + bodyMapper: Mappers.CloudError + } + }, + serializer +}; + +const listKeysOperationSpec: msRest.OperationSpec = { + httpMethod: "POST", + path: "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/listKeys", + urlParameters: [ + Parameters.subscriptionId, + Parameters.resourceGroupName, + Parameters.accountName + ], + queryParameters: [ + Parameters.apiVersion + ], + headerParameters: [ + Parameters.acceptLanguage + ], + responses: { + 200: { + bodyMapper: Mappers.DatabaseAccountListKeysResult + }, + default: { + bodyMapper: Mappers.CloudError + } + }, + serializer +}; + +const listConnectionStringsOperationSpec: msRest.OperationSpec = { + httpMethod: "POST", + path: "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/listConnectionStrings", + urlParameters: [ + Parameters.subscriptionId, + Parameters.resourceGroupName, + Parameters.accountName + ], + queryParameters: [ + Parameters.apiVersion + ], + headerParameters: [ + Parameters.acceptLanguage + ], + responses: { + 200: { + bodyMapper: Mappers.DatabaseAccountListConnectionStringsResult + }, + default: { + bodyMapper: Mappers.CloudError + } + }, + serializer +}; + +const getReadOnlyKeysOperationSpec: msRest.OperationSpec = { + httpMethod: "GET", + path: "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/readonlykeys", + urlParameters: [ + Parameters.subscriptionId, + Parameters.resourceGroupName, + Parameters.accountName + ], + queryParameters: [ + Parameters.apiVersion + ], + headerParameters: [ + Parameters.acceptLanguage + ], + responses: { + 200: { + bodyMapper: Mappers.DatabaseAccountListReadOnlyKeysResult + }, + default: { + bodyMapper: Mappers.CloudError + } + }, + serializer +}; + +const listReadOnlyKeysOperationSpec: msRest.OperationSpec = { + httpMethod: "POST", + path: "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/readonlykeys", + urlParameters: [ + Parameters.subscriptionId, + Parameters.resourceGroupName, + Parameters.accountName + ], + queryParameters: [ + Parameters.apiVersion + ], + headerParameters: [ + Parameters.acceptLanguage + ], + responses: { + 200: { + bodyMapper: Mappers.DatabaseAccountListReadOnlyKeysResult + }, + default: { + bodyMapper: Mappers.CloudError + } + }, + serializer +}; + +const checkNameExistsOperationSpec: msRest.OperationSpec = { + httpMethod: "HEAD", + path: "providers/Microsoft.DocumentDB/databaseAccountNames/{accountName}", + urlParameters: [ + Parameters.accountName + ], + queryParameters: [ + Parameters.apiVersion + ], + headerParameters: [ + Parameters.acceptLanguage + ], + responses: { + 200: {}, + 404: {}, + default: { + bodyMapper: Mappers.CloudError + } + }, + serializer +}; + +const listMetricsOperationSpec: msRest.OperationSpec = { + httpMethod: "GET", + path: "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/metrics", + urlParameters: [ + Parameters.subscriptionId, + Parameters.resourceGroupName, + Parameters.accountName + ], + queryParameters: [ + Parameters.apiVersion, + Parameters.filter0 + ], + headerParameters: [ + Parameters.acceptLanguage + ], + responses: { + 200: { + bodyMapper: Mappers.MetricListResult + }, + default: { + bodyMapper: Mappers.CloudError + } + }, + serializer +}; + +const listUsagesOperationSpec: msRest.OperationSpec = { + httpMethod: "GET", + path: "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/usages", + urlParameters: [ + Parameters.subscriptionId, + Parameters.resourceGroupName, + Parameters.accountName + ], + queryParameters: [ + Parameters.apiVersion, + Parameters.filter1 + ], + headerParameters: [ + Parameters.acceptLanguage + ], + responses: { + 200: { + bodyMapper: Mappers.UsagesResult + }, + default: { + bodyMapper: Mappers.CloudError + } + }, + serializer +}; + +const listMetricDefinitionsOperationSpec: msRest.OperationSpec = { + httpMethod: "GET", + path: "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/metricDefinitions", + urlParameters: [ + Parameters.subscriptionId, + Parameters.resourceGroupName, + Parameters.accountName + ], + queryParameters: [ + Parameters.apiVersion + ], + headerParameters: [ + Parameters.acceptLanguage + ], + responses: { + 200: { + bodyMapper: Mappers.MetricDefinitionsListResult + }, + default: { + bodyMapper: Mappers.CloudError + } + }, + serializer +}; + +const listSqlDatabasesOperationSpec: msRest.OperationSpec = { + httpMethod: "GET", + path: "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/apis/sql/databases", + urlParameters: [ + Parameters.subscriptionId, + Parameters.resourceGroupName, + Parameters.accountName + ], + queryParameters: [ + Parameters.apiVersion + ], + headerParameters: [ + Parameters.acceptLanguage + ], + responses: { + 200: { + bodyMapper: Mappers.SqlDatabaseListResult + }, + default: { + bodyMapper: Mappers.CloudError + } + }, + serializer +}; + +const getSqlDatabaseOperationSpec: msRest.OperationSpec = { + httpMethod: "GET", + path: "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/apis/sql/databases/{databaseName}", + urlParameters: [ + Parameters.subscriptionId, + Parameters.resourceGroupName, + Parameters.accountName, + Parameters.databaseName + ], + queryParameters: [ + Parameters.apiVersion + ], + headerParameters: [ + Parameters.acceptLanguage + ], + responses: { + 200: { + bodyMapper: Mappers.SqlDatabase + }, + default: { + bodyMapper: Mappers.CloudError + } + }, + serializer +}; + +const listSqlContainersOperationSpec: msRest.OperationSpec = { + httpMethod: "GET", + path: "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/apis/sql/databases/{databaseName}/containers", + urlParameters: [ + Parameters.subscriptionId, + Parameters.resourceGroupName, + Parameters.accountName, + Parameters.databaseName + ], + queryParameters: [ + Parameters.apiVersion + ], + headerParameters: [ + Parameters.acceptLanguage + ], + responses: { + 200: { + bodyMapper: Mappers.SqlContainerListResult + }, + default: { + bodyMapper: Mappers.CloudError + } + }, + serializer +}; + +const getSqlContainerOperationSpec: msRest.OperationSpec = { + httpMethod: "GET", + path: "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/apis/sql/databases/{databaseName}/containers/{containerName}", + urlParameters: [ + Parameters.subscriptionId, + Parameters.resourceGroupName, + Parameters.accountName, + Parameters.databaseName, + Parameters.containerName + ], + queryParameters: [ + Parameters.apiVersion + ], + headerParameters: [ + Parameters.acceptLanguage + ], + responses: { + 200: { + bodyMapper: Mappers.SqlContainer + }, + default: { + bodyMapper: Mappers.CloudError + } + }, + serializer +}; + +const listMongoDBDatabasesOperationSpec: msRest.OperationSpec = { + httpMethod: "GET", + path: "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/apis/mongodb/databases", + urlParameters: [ + Parameters.subscriptionId, + Parameters.resourceGroupName, + Parameters.accountName + ], + queryParameters: [ + Parameters.apiVersion + ], + headerParameters: [ + Parameters.acceptLanguage + ], + responses: { + 200: { + bodyMapper: Mappers.MongoDBDatabaseListResult + }, + default: { + bodyMapper: Mappers.CloudError + } + }, + serializer +}; + +const getMongoDBDatabaseOperationSpec: msRest.OperationSpec = { + httpMethod: "GET", + path: "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/apis/mongodb/databases/{databaseName}", + urlParameters: [ + Parameters.subscriptionId, + Parameters.resourceGroupName, + Parameters.accountName, + Parameters.databaseName + ], + queryParameters: [ + Parameters.apiVersion + ], + headerParameters: [ + Parameters.acceptLanguage + ], + responses: { + 200: { + bodyMapper: Mappers.MongoDBDatabase + }, + default: { + bodyMapper: Mappers.CloudError + } + }, + serializer +}; + +const listMongoDBCollectionsOperationSpec: msRest.OperationSpec = { + httpMethod: "GET", + path: "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/apis/mongodb/databases/{databaseName}/collections", + urlParameters: [ + Parameters.subscriptionId, + Parameters.resourceGroupName, + Parameters.accountName, + Parameters.databaseName + ], + queryParameters: [ + Parameters.apiVersion + ], + headerParameters: [ + Parameters.acceptLanguage + ], + responses: { + 200: { + bodyMapper: Mappers.MongoDBCollectionListResult + }, + default: { + bodyMapper: Mappers.CloudError + } + }, + serializer +}; + +const getMongoDBCollectionOperationSpec: msRest.OperationSpec = { + httpMethod: "GET", + path: "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/apis/mongodb/databases/{databaseName}/collections/{collectionName}", + urlParameters: [ + Parameters.subscriptionId, + Parameters.resourceGroupName, + Parameters.accountName, + Parameters.databaseName, + Parameters.collectionName + ], + queryParameters: [ + Parameters.apiVersion + ], + headerParameters: [ + Parameters.acceptLanguage + ], + responses: { + 200: { + bodyMapper: Mappers.MongoDBCollection + }, + default: { + bodyMapper: Mappers.CloudError + } + }, + serializer +}; + +const listTablesOperationSpec: msRest.OperationSpec = { + httpMethod: "GET", + path: "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/apis/table/tables", + urlParameters: [ + Parameters.subscriptionId, + Parameters.resourceGroupName, + Parameters.accountName + ], + queryParameters: [ + Parameters.apiVersion + ], + headerParameters: [ + Parameters.acceptLanguage + ], + responses: { + 200: { + bodyMapper: Mappers.TableListResult + }, + default: { + bodyMapper: Mappers.CloudError + } + }, + serializer +}; + +const getTableOperationSpec: msRest.OperationSpec = { + httpMethod: "GET", + path: "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/apis/table/tables/{tableName}", + urlParameters: [ + Parameters.subscriptionId, + Parameters.resourceGroupName, + Parameters.accountName, + Parameters.tableName + ], + queryParameters: [ + Parameters.apiVersion + ], + headerParameters: [ + Parameters.acceptLanguage + ], + responses: { + 200: { + bodyMapper: Mappers.Table + }, + default: { + bodyMapper: Mappers.CloudError + } + }, + serializer +}; + +const listCassandraKeyspacesOperationSpec: msRest.OperationSpec = { + httpMethod: "GET", + path: "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/apis/cassandra/keyspaces", + urlParameters: [ + Parameters.subscriptionId, + Parameters.resourceGroupName, + Parameters.accountName + ], + queryParameters: [ + Parameters.apiVersion + ], + headerParameters: [ + Parameters.acceptLanguage + ], + responses: { + 200: { + bodyMapper: Mappers.CassandraKeyspaceListResult + }, + default: { + bodyMapper: Mappers.CloudError + } + }, + serializer +}; + +const getCassandraKeyspaceOperationSpec: msRest.OperationSpec = { + httpMethod: "GET", + path: "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/apis/cassandra/keyspaces/{keyspaceName}", + urlParameters: [ + Parameters.subscriptionId, + Parameters.resourceGroupName, + Parameters.accountName, + Parameters.keyspaceName + ], + queryParameters: [ + Parameters.apiVersion + ], + headerParameters: [ + Parameters.acceptLanguage + ], + responses: { + 200: { + bodyMapper: Mappers.CassandraKeyspace + }, + default: { + bodyMapper: Mappers.CloudError + } + }, + serializer +}; + +const listCassandraTablesOperationSpec: msRest.OperationSpec = { + httpMethod: "GET", + path: "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/apis/cassandra/keyspaces/{keyspaceName}/tables", + urlParameters: [ + Parameters.subscriptionId, + Parameters.resourceGroupName, + Parameters.accountName, + Parameters.keyspaceName + ], + queryParameters: [ + Parameters.apiVersion + ], + headerParameters: [ + Parameters.acceptLanguage + ], + responses: { + 200: { + bodyMapper: Mappers.CassandraTableListResult + }, + default: { + bodyMapper: Mappers.CloudError + } + }, + serializer +}; + +const getCassandraTableOperationSpec: msRest.OperationSpec = { + httpMethod: "GET", + path: "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/apis/cassandra/keyspaces/{keyspaceName}/tables/{tableName}", + urlParameters: [ + Parameters.subscriptionId, + Parameters.resourceGroupName, + Parameters.accountName, + Parameters.keyspaceName, + Parameters.tableName + ], + queryParameters: [ + Parameters.apiVersion + ], + headerParameters: [ + Parameters.acceptLanguage + ], + responses: { + 200: { + bodyMapper: Mappers.CassandraTable + }, + default: { + bodyMapper: Mappers.CloudError + } + }, + serializer +}; + +const listGremlinDatabasesOperationSpec: msRest.OperationSpec = { + httpMethod: "GET", + path: "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/apis/gremlin/databases", + urlParameters: [ + Parameters.subscriptionId, + Parameters.resourceGroupName, + Parameters.accountName + ], + queryParameters: [ + Parameters.apiVersion + ], + headerParameters: [ + Parameters.acceptLanguage + ], + responses: { + 200: { + bodyMapper: Mappers.GremlinDatabaseListResult + }, + default: { + bodyMapper: Mappers.CloudError + } + }, + serializer +}; + +const getGremlinDatabaseOperationSpec: msRest.OperationSpec = { + httpMethod: "GET", + path: "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/apis/gremlin/databases/{databaseName}", + urlParameters: [ + Parameters.subscriptionId, + Parameters.resourceGroupName, + Parameters.accountName, + Parameters.databaseName + ], + queryParameters: [ + Parameters.apiVersion + ], + headerParameters: [ + Parameters.acceptLanguage + ], + responses: { + 200: { + bodyMapper: Mappers.GremlinDatabase + }, + default: { + bodyMapper: Mappers.CloudError + } + }, + serializer +}; + +const listGremlinGraphsOperationSpec: msRest.OperationSpec = { + httpMethod: "GET", + path: "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/apis/gremlin/databases/{databaseName}/graphs", + urlParameters: [ + Parameters.subscriptionId, + Parameters.resourceGroupName, + Parameters.accountName, + Parameters.databaseName + ], + queryParameters: [ + Parameters.apiVersion + ], + headerParameters: [ + Parameters.acceptLanguage + ], + responses: { + 200: { + bodyMapper: Mappers.GremlinGraphListResult + }, + default: { + bodyMapper: Mappers.CloudError + } + }, + serializer +}; + +const getGremlinGraphOperationSpec: msRest.OperationSpec = { + httpMethod: "GET", + path: "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/apis/gremlin/databases/{databaseName}/graphs/{graphName}", + urlParameters: [ + Parameters.subscriptionId, + Parameters.resourceGroupName, + Parameters.accountName, + Parameters.databaseName, + Parameters.graphName + ], + queryParameters: [ + Parameters.apiVersion + ], + headerParameters: [ + Parameters.acceptLanguage + ], + responses: { + 200: { + bodyMapper: Mappers.GremlinGraph + }, + default: { + bodyMapper: Mappers.CloudError + } + }, + serializer +}; + +const beginPatchOperationSpec: msRest.OperationSpec = { + httpMethod: "PATCH", + path: "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}", + urlParameters: [ + Parameters.subscriptionId, + Parameters.resourceGroupName, + Parameters.accountName + ], + queryParameters: [ + Parameters.apiVersion + ], + headerParameters: [ + Parameters.acceptLanguage + ], + requestBody: { + parameterPath: "updateParameters", + mapper: { + ...Mappers.DatabaseAccountPatchParameters, + required: true + } + }, + responses: { + 200: { + bodyMapper: Mappers.DatabaseAccount + }, + default: { + bodyMapper: Mappers.CloudError + } + }, + serializer +}; + +const beginCreateOrUpdateOperationSpec: msRest.OperationSpec = { + httpMethod: "PUT", + path: "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}", + urlParameters: [ + Parameters.subscriptionId, + Parameters.resourceGroupName, + Parameters.accountName + ], + queryParameters: [ + Parameters.apiVersion + ], + headerParameters: [ + Parameters.acceptLanguage + ], + requestBody: { + parameterPath: "createUpdateParameters", + mapper: { + ...Mappers.DatabaseAccountCreateUpdateParameters, + required: true + } + }, + responses: { + 200: { + bodyMapper: Mappers.DatabaseAccount + }, + default: { + bodyMapper: Mappers.CloudError + } + }, + serializer +}; + +const beginDeleteMethodOperationSpec: msRest.OperationSpec = { + httpMethod: "DELETE", + path: "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}", + urlParameters: [ + Parameters.subscriptionId, + Parameters.resourceGroupName, + Parameters.accountName + ], + queryParameters: [ + Parameters.apiVersion + ], + headerParameters: [ + Parameters.acceptLanguage + ], + responses: { + 202: {}, + 204: {}, + default: { + bodyMapper: Mappers.CloudError + } + }, + serializer +}; + +const beginFailoverPriorityChangeOperationSpec: msRest.OperationSpec = { + httpMethod: "POST", + path: "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/failoverPriorityChange", + urlParameters: [ + Parameters.subscriptionId, + Parameters.resourceGroupName, + Parameters.accountName + ], + queryParameters: [ + Parameters.apiVersion + ], + headerParameters: [ + Parameters.acceptLanguage + ], + requestBody: { + parameterPath: "failoverParameters", + mapper: { + ...Mappers.FailoverPolicies, + required: true + } + }, + responses: { + 202: {}, + 204: {}, + default: { + bodyMapper: Mappers.CloudError + } + }, + serializer +}; + +const beginOfflineRegionOperationSpec: msRest.OperationSpec = { + httpMethod: "POST", + path: "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/offlineRegion", + urlParameters: [ + Parameters.subscriptionId, + Parameters.resourceGroupName, + Parameters.accountName + ], + queryParameters: [ + Parameters.apiVersion + ], + headerParameters: [ + Parameters.acceptLanguage + ], + requestBody: { + parameterPath: "regionParameterForOffline", + mapper: { + ...Mappers.RegionForOnlineOffline, + required: true + } + }, + responses: { + 200: {}, + 202: {}, + default: { + bodyMapper: Mappers.ErrorResponse + } + }, + serializer +}; + +const beginOnlineRegionOperationSpec: msRest.OperationSpec = { + httpMethod: "POST", + path: "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/onlineRegion", + urlParameters: [ + Parameters.subscriptionId, + Parameters.resourceGroupName, + Parameters.accountName + ], + queryParameters: [ + Parameters.apiVersion + ], + headerParameters: [ + Parameters.acceptLanguage + ], + requestBody: { + parameterPath: "regionParameterForOnline", + mapper: { + ...Mappers.RegionForOnlineOffline, + required: true + } + }, + responses: { + 200: {}, + 202: {}, + default: { + bodyMapper: Mappers.ErrorResponse + } + }, + serializer +}; + +const beginRegenerateKeyOperationSpec: msRest.OperationSpec = { + httpMethod: "POST", + path: "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/regenerateKey", urlParameters: [ Parameters.subscriptionId, Parameters.resourceGroupName, @@ -625,10 +2851,16 @@ const getOperationSpec: msRest.OperationSpec = { headerParameters: [ Parameters.acceptLanguage ], + requestBody: { + parameterPath: "keyToRegenerate", + mapper: { + ...Mappers.DatabaseAccountRegenerateKeyParameters, + required: true + } + }, responses: { - 200: { - bodyMapper: Mappers.DatabaseAccount - }, + 200: {}, + 202: {}, default: { bodyMapper: Mappers.CloudError } @@ -636,11 +2868,14 @@ const getOperationSpec: msRest.OperationSpec = { serializer }; -const listOperationSpec: msRest.OperationSpec = { - httpMethod: "GET", - path: "subscriptions/{subscriptionId}/providers/Microsoft.DocumentDB/databaseAccounts", +const beginCreateUpdateSqlDatabaseOperationSpec: msRest.OperationSpec = { + httpMethod: "PUT", + path: "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/apis/sql/databases/{databaseName}", urlParameters: [ - Parameters.subscriptionId + Parameters.subscriptionId, + Parameters.resourceGroupName, + Parameters.accountName, + Parameters.databaseName ], queryParameters: [ Parameters.apiVersion @@ -648,10 +2883,18 @@ const listOperationSpec: msRest.OperationSpec = { headerParameters: [ Parameters.acceptLanguage ], + requestBody: { + parameterPath: "createUpdateSqlDatabaseParameters", + mapper: { + ...Mappers.SqlDatabaseCreateUpdateParameters, + required: true + } + }, responses: { 200: { - bodyMapper: Mappers.DatabaseAccountsListResult + bodyMapper: Mappers.SqlDatabase }, + 202: {}, default: { bodyMapper: Mappers.CloudError } @@ -659,12 +2902,14 @@ const listOperationSpec: msRest.OperationSpec = { serializer }; -const listByResourceGroupOperationSpec: msRest.OperationSpec = { - httpMethod: "GET", - path: "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts", +const beginDeleteSqlDatabaseOperationSpec: msRest.OperationSpec = { + httpMethod: "DELETE", + path: "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/apis/sql/databases/{databaseName}", urlParameters: [ + Parameters.subscriptionId, Parameters.resourceGroupName, - Parameters.subscriptionId + Parameters.accountName, + Parameters.databaseName ], queryParameters: [ Parameters.apiVersion @@ -673,9 +2918,8 @@ const listByResourceGroupOperationSpec: msRest.OperationSpec = { Parameters.acceptLanguage ], responses: { - 200: { - bodyMapper: Mappers.DatabaseAccountsListResult - }, + 202: {}, + 204: {}, default: { bodyMapper: Mappers.CloudError } @@ -683,13 +2927,15 @@ const listByResourceGroupOperationSpec: msRest.OperationSpec = { serializer }; -const listKeysOperationSpec: msRest.OperationSpec = { - httpMethod: "POST", - path: "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/listKeys", +const beginCreateUpdateSqlContainerOperationSpec: msRest.OperationSpec = { + httpMethod: "PUT", + path: "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/apis/sql/databases/{databaseName}/containers/{containerName}", urlParameters: [ Parameters.subscriptionId, Parameters.resourceGroupName, - Parameters.accountName + Parameters.accountName, + Parameters.databaseName, + Parameters.containerName ], queryParameters: [ Parameters.apiVersion @@ -697,10 +2943,18 @@ const listKeysOperationSpec: msRest.OperationSpec = { headerParameters: [ Parameters.acceptLanguage ], + requestBody: { + parameterPath: "createUpdateSqlContainerParameters", + mapper: { + ...Mappers.SqlContainerCreateUpdateParameters, + required: true + } + }, responses: { 200: { - bodyMapper: Mappers.DatabaseAccountListKeysResult + bodyMapper: Mappers.SqlContainer }, + 202: {}, default: { bodyMapper: Mappers.CloudError } @@ -708,13 +2962,15 @@ const listKeysOperationSpec: msRest.OperationSpec = { serializer }; -const listConnectionStringsOperationSpec: msRest.OperationSpec = { - httpMethod: "POST", - path: "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/listConnectionStrings", +const beginDeleteSqlContainerOperationSpec: msRest.OperationSpec = { + httpMethod: "DELETE", + path: "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/apis/sql/databases/{databaseName}/containers/{containerName}", urlParameters: [ Parameters.subscriptionId, Parameters.resourceGroupName, - Parameters.accountName + Parameters.accountName, + Parameters.databaseName, + Parameters.containerName ], queryParameters: [ Parameters.apiVersion @@ -723,9 +2979,8 @@ const listConnectionStringsOperationSpec: msRest.OperationSpec = { Parameters.acceptLanguage ], responses: { - 200: { - bodyMapper: Mappers.DatabaseAccountListConnectionStringsResult - }, + 202: {}, + 204: {}, default: { bodyMapper: Mappers.CloudError } @@ -733,13 +2988,14 @@ const listConnectionStringsOperationSpec: msRest.OperationSpec = { serializer }; -const getReadOnlyKeysOperationSpec: msRest.OperationSpec = { - httpMethod: "GET", - path: "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/readonlykeys", +const beginCreateUpdateMongoDBDatabaseOperationSpec: msRest.OperationSpec = { + httpMethod: "PUT", + path: "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/apis/mongodb/databases/{databaseName}", urlParameters: [ Parameters.subscriptionId, Parameters.resourceGroupName, - Parameters.accountName + Parameters.accountName, + Parameters.databaseName ], queryParameters: [ Parameters.apiVersion @@ -747,10 +3003,18 @@ const getReadOnlyKeysOperationSpec: msRest.OperationSpec = { headerParameters: [ Parameters.acceptLanguage ], + requestBody: { + parameterPath: "createUpdateMongoDBDatabaseParameters", + mapper: { + ...Mappers.MongoDBDatabaseCreateUpdateParameters, + required: true + } + }, responses: { 200: { - bodyMapper: Mappers.DatabaseAccountListReadOnlyKeysResult + bodyMapper: Mappers.MongoDBDatabase }, + 202: {}, default: { bodyMapper: Mappers.CloudError } @@ -758,13 +3022,14 @@ const getReadOnlyKeysOperationSpec: msRest.OperationSpec = { serializer }; -const listReadOnlyKeysOperationSpec: msRest.OperationSpec = { - httpMethod: "POST", - path: "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/readonlykeys", +const beginDeleteMongoDBDatabaseOperationSpec: msRest.OperationSpec = { + httpMethod: "DELETE", + path: "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/apis/mongodb/databases/{databaseName}", urlParameters: [ Parameters.subscriptionId, Parameters.resourceGroupName, - Parameters.accountName + Parameters.accountName, + Parameters.databaseName ], queryParameters: [ Parameters.apiVersion @@ -773,9 +3038,8 @@ const listReadOnlyKeysOperationSpec: msRest.OperationSpec = { Parameters.acceptLanguage ], responses: { - 200: { - bodyMapper: Mappers.DatabaseAccountListReadOnlyKeysResult - }, + 202: {}, + 204: {}, default: { bodyMapper: Mappers.CloudError } @@ -783,11 +3047,15 @@ const listReadOnlyKeysOperationSpec: msRest.OperationSpec = { serializer }; -const checkNameExistsOperationSpec: msRest.OperationSpec = { - httpMethod: "HEAD", - path: "providers/Microsoft.DocumentDB/databaseAccountNames/{accountName}", +const beginCreateUpdateMongoDBCollectionOperationSpec: msRest.OperationSpec = { + httpMethod: "PUT", + path: "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/apis/mongodb/databases/{databaseName}/collections/{collectionName}", urlParameters: [ - Parameters.accountName + Parameters.subscriptionId, + Parameters.resourceGroupName, + Parameters.accountName, + Parameters.databaseName, + Parameters.collectionName ], queryParameters: [ Parameters.apiVersion @@ -795,9 +3063,18 @@ const checkNameExistsOperationSpec: msRest.OperationSpec = { headerParameters: [ Parameters.acceptLanguage ], + requestBody: { + parameterPath: "createUpdateMongoDBCollectionParameters", + mapper: { + ...Mappers.MongoDBCollectionCreateUpdateParameters, + required: true + } + }, responses: { - 200: {}, - 404: {}, + 200: { + bodyMapper: Mappers.MongoDBCollection + }, + 202: {}, default: { bodyMapper: Mappers.CloudError } @@ -805,25 +3082,25 @@ const checkNameExistsOperationSpec: msRest.OperationSpec = { serializer }; -const listMetricsOperationSpec: msRest.OperationSpec = { - httpMethod: "GET", - path: "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/metrics", +const beginDeleteMongoDBCollectionOperationSpec: msRest.OperationSpec = { + httpMethod: "DELETE", + path: "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/apis/mongodb/databases/{databaseName}/collections/{collectionName}", urlParameters: [ Parameters.subscriptionId, Parameters.resourceGroupName, - Parameters.accountName + Parameters.accountName, + Parameters.databaseName, + Parameters.collectionName ], queryParameters: [ - Parameters.apiVersion, - Parameters.filter0 + Parameters.apiVersion ], headerParameters: [ Parameters.acceptLanguage ], responses: { - 200: { - bodyMapper: Mappers.MetricListResult - }, + 202: {}, + 204: {}, default: { bodyMapper: Mappers.CloudError } @@ -831,25 +3108,33 @@ const listMetricsOperationSpec: msRest.OperationSpec = { serializer }; -const listUsagesOperationSpec: msRest.OperationSpec = { - httpMethod: "GET", - path: "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/usages", +const beginCreateUpdateTableOperationSpec: msRest.OperationSpec = { + httpMethod: "PUT", + path: "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/apis/table/tables/{tableName}", urlParameters: [ Parameters.subscriptionId, Parameters.resourceGroupName, - Parameters.accountName + Parameters.accountName, + Parameters.tableName ], queryParameters: [ - Parameters.apiVersion, - Parameters.filter1 + Parameters.apiVersion ], headerParameters: [ Parameters.acceptLanguage ], + requestBody: { + parameterPath: "createUpdateTableParameters", + mapper: { + ...Mappers.TableCreateUpdateParameters, + required: true + } + }, responses: { 200: { - bodyMapper: Mappers.UsagesResult + bodyMapper: Mappers.Table }, + 202: {}, default: { bodyMapper: Mappers.CloudError } @@ -857,13 +3142,14 @@ const listUsagesOperationSpec: msRest.OperationSpec = { serializer }; -const listMetricDefinitionsOperationSpec: msRest.OperationSpec = { - httpMethod: "GET", - path: "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/metricDefinitions", +const beginDeleteTableOperationSpec: msRest.OperationSpec = { + httpMethod: "DELETE", + path: "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/apis/table/tables/{tableName}", urlParameters: [ Parameters.subscriptionId, Parameters.resourceGroupName, - Parameters.accountName + Parameters.accountName, + Parameters.tableName ], queryParameters: [ Parameters.apiVersion @@ -872,9 +3158,8 @@ const listMetricDefinitionsOperationSpec: msRest.OperationSpec = { Parameters.acceptLanguage ], responses: { - 200: { - bodyMapper: Mappers.MetricDefinitionsListResult - }, + 202: {}, + 204: {}, default: { bodyMapper: Mappers.CloudError } @@ -882,13 +3167,14 @@ const listMetricDefinitionsOperationSpec: msRest.OperationSpec = { serializer }; -const beginPatchOperationSpec: msRest.OperationSpec = { - httpMethod: "PATCH", - path: "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}", +const beginCreateUpdateCassandraKeyspaceOperationSpec: msRest.OperationSpec = { + httpMethod: "PUT", + path: "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/apis/cassandra/keyspaces/{keyspaceName}", urlParameters: [ Parameters.subscriptionId, Parameters.resourceGroupName, - Parameters.accountName + Parameters.accountName, + Parameters.keyspaceName ], queryParameters: [ Parameters.apiVersion @@ -897,16 +3183,17 @@ const beginPatchOperationSpec: msRest.OperationSpec = { Parameters.acceptLanguage ], requestBody: { - parameterPath: "updateParameters", + parameterPath: "createUpdateCassandraKeyspaceParameters", mapper: { - ...Mappers.DatabaseAccountPatchParameters, + ...Mappers.CassandraKeyspaceCreateUpdateParameters, required: true } }, responses: { 200: { - bodyMapper: Mappers.DatabaseAccount + bodyMapper: Mappers.CassandraKeyspace }, + 202: {}, default: { bodyMapper: Mappers.CloudError } @@ -914,13 +3201,40 @@ const beginPatchOperationSpec: msRest.OperationSpec = { serializer }; -const beginCreateOrUpdateOperationSpec: msRest.OperationSpec = { +const beginDeleteCassandraKeyspaceOperationSpec: msRest.OperationSpec = { + httpMethod: "DELETE", + path: "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/apis/cassandra/keyspaces/{keyspaceName}", + urlParameters: [ + Parameters.subscriptionId, + Parameters.resourceGroupName, + Parameters.accountName, + Parameters.keyspaceName + ], + queryParameters: [ + Parameters.apiVersion + ], + headerParameters: [ + Parameters.acceptLanguage + ], + responses: { + 202: {}, + 204: {}, + default: { + bodyMapper: Mappers.CloudError + } + }, + serializer +}; + +const beginCreateUpdateCassandraTableOperationSpec: msRest.OperationSpec = { httpMethod: "PUT", - path: "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}", + path: "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/apis/cassandra/keyspaces/{keyspaceName}/tables/{tableName}", urlParameters: [ Parameters.subscriptionId, Parameters.resourceGroupName, - Parameters.accountName + Parameters.accountName, + Parameters.keyspaceName, + Parameters.tableName ], queryParameters: [ Parameters.apiVersion @@ -929,16 +3243,17 @@ const beginCreateOrUpdateOperationSpec: msRest.OperationSpec = { Parameters.acceptLanguage ], requestBody: { - parameterPath: "createUpdateParameters", + parameterPath: "createUpdateCassandraTableParameters", mapper: { - ...Mappers.DatabaseAccountCreateUpdateParameters, + ...Mappers.CassandraTableCreateUpdateParameters, required: true } }, responses: { 200: { - bodyMapper: Mappers.DatabaseAccount + bodyMapper: Mappers.CassandraTable }, + 202: {}, default: { bodyMapper: Mappers.CloudError } @@ -946,13 +3261,15 @@ const beginCreateOrUpdateOperationSpec: msRest.OperationSpec = { serializer }; -const beginDeleteMethodOperationSpec: msRest.OperationSpec = { +const beginDeleteCassandraTableOperationSpec: msRest.OperationSpec = { httpMethod: "DELETE", - path: "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}", + path: "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/apis/cassandra/keyspaces/{keyspaceName}/tables/{tableName}", urlParameters: [ Parameters.subscriptionId, Parameters.resourceGroupName, - Parameters.accountName + Parameters.accountName, + Parameters.keyspaceName, + Parameters.tableName ], queryParameters: [ Parameters.apiVersion @@ -970,13 +3287,14 @@ const beginDeleteMethodOperationSpec: msRest.OperationSpec = { serializer }; -const beginFailoverPriorityChangeOperationSpec: msRest.OperationSpec = { - httpMethod: "POST", - path: "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/failoverPriorityChange", +const beginCreateUpdateGremlinDatabaseOperationSpec: msRest.OperationSpec = { + httpMethod: "PUT", + path: "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/apis/gremlin/databases/{databaseName}", urlParameters: [ Parameters.subscriptionId, Parameters.resourceGroupName, - Parameters.accountName + Parameters.accountName, + Parameters.databaseName ], queryParameters: [ Parameters.apiVersion @@ -985,15 +3303,17 @@ const beginFailoverPriorityChangeOperationSpec: msRest.OperationSpec = { Parameters.acceptLanguage ], requestBody: { - parameterPath: "failoverParameters", + parameterPath: "createUpdateGremlinDatabaseParameters", mapper: { - ...Mappers.FailoverPolicies, + ...Mappers.GremlinDatabaseCreateUpdateParameters, required: true } }, responses: { + 200: { + bodyMapper: Mappers.GremlinDatabase + }, 202: {}, - 204: {}, default: { bodyMapper: Mappers.CloudError } @@ -1001,13 +3321,14 @@ const beginFailoverPriorityChangeOperationSpec: msRest.OperationSpec = { serializer }; -const beginOfflineRegionOperationSpec: msRest.OperationSpec = { - httpMethod: "POST", - path: "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/offlineRegion", +const beginDeleteGremlinDatabaseOperationSpec: msRest.OperationSpec = { + httpMethod: "DELETE", + path: "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/apis/gremlin/databases/{databaseName}", urlParameters: [ Parameters.subscriptionId, Parameters.resourceGroupName, - Parameters.accountName + Parameters.accountName, + Parameters.databaseName ], queryParameters: [ Parameters.apiVersion @@ -1015,30 +3336,25 @@ const beginOfflineRegionOperationSpec: msRest.OperationSpec = { headerParameters: [ Parameters.acceptLanguage ], - requestBody: { - parameterPath: "regionParameterForOffline", - mapper: { - ...Mappers.RegionForOnlineOffline, - required: true - } - }, responses: { - 200: {}, 202: {}, + 204: {}, default: { - bodyMapper: Mappers.ErrorResponse + bodyMapper: Mappers.CloudError } }, serializer }; -const beginOnlineRegionOperationSpec: msRest.OperationSpec = { - httpMethod: "POST", - path: "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/onlineRegion", +const beginCreateUpdateGremlinGraphOperationSpec: msRest.OperationSpec = { + httpMethod: "PUT", + path: "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/apis/gremlin/databases/{databaseName}/graphs/{graphName}", urlParameters: [ Parameters.subscriptionId, Parameters.resourceGroupName, - Parameters.accountName + Parameters.accountName, + Parameters.databaseName, + Parameters.graphName ], queryParameters: [ Parameters.apiVersion @@ -1047,29 +3363,33 @@ const beginOnlineRegionOperationSpec: msRest.OperationSpec = { Parameters.acceptLanguage ], requestBody: { - parameterPath: "regionParameterForOnline", + parameterPath: "createUpdateGremlinGraphParameters", mapper: { - ...Mappers.RegionForOnlineOffline, + ...Mappers.GremlinGraphCreateUpdateParameters, required: true } }, responses: { - 200: {}, + 200: { + bodyMapper: Mappers.GremlinGraph + }, 202: {}, default: { - bodyMapper: Mappers.ErrorResponse + bodyMapper: Mappers.CloudError } }, serializer }; -const beginRegenerateKeyOperationSpec: msRest.OperationSpec = { - httpMethod: "POST", - path: "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/regenerateKey", +const beginDeleteGremlinGraphOperationSpec: msRest.OperationSpec = { + httpMethod: "DELETE", + path: "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/apis/gremlin/databases/{databaseName}/graphs/{graphName}", urlParameters: [ Parameters.subscriptionId, Parameters.resourceGroupName, - Parameters.accountName + Parameters.accountName, + Parameters.databaseName, + Parameters.graphName ], queryParameters: [ Parameters.apiVersion @@ -1077,16 +3397,9 @@ const beginRegenerateKeyOperationSpec: msRest.OperationSpec = { headerParameters: [ Parameters.acceptLanguage ], - requestBody: { - parameterPath: "keyToRegenerate", - mapper: { - ...Mappers.DatabaseAccountRegenerateKeyParameters, - required: true - } - }, responses: { - 200: {}, 202: {}, + 204: {}, default: { bodyMapper: Mappers.CloudError } diff --git a/sdk/cosmosdb/cosmos/ci.yml b/sdk/cosmosdb/cosmos/ci.yml new file mode 100644 index 000000000000..c2f3572939fb --- /dev/null +++ b/sdk/cosmosdb/cosmos/ci.yml @@ -0,0 +1,17 @@ +# DO NOT EDIT THIS FILE +# This file is generated automatically and any changes will be lost. + +trigger: none + +pr: + branches: + include: + - master + paths: + include: + - sdk/cosmosdb/cosmos/ + +jobs: + - template: ../../../eng/pipelines/templates/jobs/archetype-sdk-client.yml + parameters: + PackageName: "@azure/cosmos" diff --git a/sdk/eventhub/event-hubs/CONTRIBUTING.md b/sdk/eventhub/event-hubs/CONTRIBUTING.md new file mode 100644 index 000000000000..f37f78dde551 --- /dev/null +++ b/sdk/eventhub/event-hubs/CONTRIBUTING.md @@ -0,0 +1,61 @@ +# Contributing + +This project welcomes contributions and suggestions. Most contributions require you to +agree to a Contributor License Agreement (CLA) declaring that you have the right to, +and actually do, grant us the rights to use your contribution. For details, visit +https://cla.microsoft.com. + +When you submit a pull request, a CLA-bot will automatically determine whether you need +to provide a CLA and decorate the PR appropriately (e.g., label, comment). Simply follow the +instructions provided by the bot. You will only need to do this once across all repositories using our CLA. + +This project has adopted the [Microsoft Open Source Code of Conduct](https://opensource.microsoft.com/codeofconduct/). +For more information see the [Code of Conduct FAQ](https://opensource.microsoft.com/codeofconduct/faq/) +or contact [opencode@microsoft.com](mailto:opencode@microsoft.com) with any additional questions or comments. + +## What to contribute +There are many ways that you can contribute to the Azure Event Hubs client project: + +* Submit a bug +* Submit a code fix for a bug +* Submit additions or modifications to the documentation +* Submit a feature request + +## Contributing Code +To contribute code you need to issue a Pull Request against the develop branch. All code submissions will be reviewed and tested by the team, and those that meet a high bar for both quality and design/roadmap appropriateness will be merged into the source. Be sure to follow the existing file/folder structure when adding new boards or sensors. + +You must sign a [Contribution License Agreement](https://cla.microsoft.com/) ([CLA](https://cla.microsoft.com/)) before submitting a Pull Request. To complete the CLA, you will need to submit the request via the form and then electronically sign the CLA when you receive the email containing the link to the document. + +## Big contributions +If your contribution is significantly big it is better to first check with the project developers in order to make sure the change aligns with the long term plans. This can be done simply by submitting a question via the GitHub Issues section. + +## Things to keep in mind when contributing +Some guidance for when you make a contribution: + +* Add/update unit tests and code as required by your change +* Make sure you run all the unit tests on the affected platform(s)/languages. If the change is in common code, generally running on one platform would be acceptable. +* Run end-to-end tests or simple sample code to make sure the lib works in an end-to-end scenario. + +## Building the library +- Install typescript, ts-node globally (optional, but very useful) +``` +npm i -g typescript +npm i -g ts-node +``` +- Clone the repo, cd to the sub folder for event hubs and install the dependencies +``` +git clone https://github.com/azure/azure-sdk-for-js.git +cd azure-sdk-for-js/sdk/eventhub/event-hubs +npm install +``` +- Build the project +``` +npm run build +``` + +## Run/Debug tests + +If you want to run or debug tests in this project, please see our [Test README](https://github.com/Azure/azure-sdk-for-js/blob/master/sdk/eventhub/testhub/README.md). + +## AMQP Dependencies ## +The Event Hubs library depends on the [rhea-promise](https://github.com/amqp/rhea-promise) library for managing connections, sending and receiving events over the [AMQP](http://docs.oasis-open.org/amqp/core/v1.0/os/amqp-core-complete-v1.0-os.pdf) protocol. diff --git a/sdk/eventhub/event-hubs/License b/sdk/eventhub/event-hubs/License new file mode 100644 index 000000000000..cbf2717d8cd3 --- /dev/null +++ b/sdk/eventhub/event-hubs/License @@ -0,0 +1,22 @@ + MIT License + + Copyright (c) Microsoft Corporation. All rights reserved. + + 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/sdk/eventhub/event-hubs/ci.yml b/sdk/eventhub/event-hubs/ci.yml new file mode 100644 index 000000000000..69469b081e61 --- /dev/null +++ b/sdk/eventhub/event-hubs/ci.yml @@ -0,0 +1,17 @@ +# DO NOT EDIT THIS FILE +# This file is generated automatically and any changes will be lost. + +trigger: none + +pr: + branches: + include: + - master + paths: + include: + - sdk/eventhub/event-hubs/ + +jobs: + - template: ../../../eng/pipelines/templates/jobs/archetype-sdk-client.yml + parameters: + PackageName: "@azure/event-hubs" diff --git a/sdk/eventhub/event-hubs/package.json b/sdk/eventhub/event-hubs/package.json index 3a7ac55b7872..10c8942ed754 100644 --- a/sdk/eventhub/event-hubs/package.json +++ b/sdk/eventhub/event-hubs/package.json @@ -59,7 +59,7 @@ "unit-test": "npm run unit-test:node && npm run unit-test:browser" }, "dependencies": { - "@azure/amqp-common": "^1.0.0-preview.3", + "@azure/amqp-common": "^1.0.0-preview.5", "@azure/ms-rest-nodeauth": "^0.9.2", "async-lock": "^1.1.3", "debug": "^3.1.0", diff --git a/sdk/eventhub/event-hubs/samples/interactiveLogin.ts b/sdk/eventhub/event-hubs/samples/interactiveLogin.ts index 626f6e99fadf..1815a8331e23 100644 --- a/sdk/eventhub/event-hubs/samples/interactiveLogin.ts +++ b/sdk/eventhub/event-hubs/samples/interactiveLogin.ts @@ -22,7 +22,7 @@ async function main(): Promise { const client = EventHubClient.createFromAadTokenCredentials(evenHubsEndpoint, eventHubsName, credentials); /* Refer to other samples, and place your code here - to send/receive messages + to send/receive events */ await client.close(); } diff --git a/sdk/eventhub/event-hubs/samples/loginWithAzureAccount.ts b/sdk/eventhub/event-hubs/samples/loginWithAzureAccount.ts index 1d6a7bf74d72..b16623af68f5 100644 --- a/sdk/eventhub/event-hubs/samples/loginWithAzureAccount.ts +++ b/sdk/eventhub/event-hubs/samples/loginWithAzureAccount.ts @@ -30,7 +30,7 @@ async function main(): Promise { const client = EventHubClient.createFromAadTokenCredentials(evenHubsEndpoint, eventHubsName, credentials); /* Refer to other samples, and place your code here - to send/receive messages + to send/receive events */ await client.close(); } diff --git a/sdk/eventhub/event-hubs/samples/receiveMessagesLoop.ts b/sdk/eventhub/event-hubs/samples/receiveEventsLoop.ts similarity index 61% rename from sdk/eventhub/event-hubs/samples/receiveMessagesLoop.ts rename to sdk/eventhub/event-hubs/samples/receiveEventsLoop.ts index 73a0963c5673..a8779410115e 100644 --- a/sdk/eventhub/event-hubs/samples/receiveMessagesLoop.ts +++ b/sdk/eventhub/event-hubs/samples/receiveEventsLoop.ts @@ -2,10 +2,9 @@ Copyright (c) Microsoft Corporation. All rights reserved. Licensed under the MIT Licence. - This sample demonstrates how the receiveBatch() function can be used to receive Event Hubs - messages in a loop. + This sample demonstrates how the receiveBatch() function can be used to receive events in a loop. - If your Event Hubs instance doesn't have any messages, then please run "sendMesages.ts" sample + If your Event Hubs instance doesn't have any events, then please run "sendEvents.ts" sample to populate Event Hubs before running this sample. */ @@ -22,15 +21,16 @@ async function main(): Promise { const batchSize = 1; for (let i = 0; i < 10; i++) { - const messages = await client.receiveBatch(partitionIds[0], batchSize, 5, { - eventPosition: eventPosition + const events = await client.receiveBatch(partitionIds[0], batchSize, 5, { + eventPosition: eventPosition, + consumerGroup: "$Default" }); - if (!messages.length) { - console.log("No more messages to receive"); + if (!events.length) { + console.log("No more events to receive"); break; } - eventPosition = EventPosition.fromSequenceNumber(messages[messages.length - 1].sequenceNumber!); - console.log(`Received messages #${i}: ${messages.map(msg => msg.body)}`); + eventPosition = EventPosition.fromSequenceNumber(events[events.length - 1].sequenceNumber!); + console.log(`Received events #${i}: ${events.map(event => event.body)}`); } await client.close(); } diff --git a/sdk/eventhub/event-hubs/samples/receiveMessagesStreaming.ts b/sdk/eventhub/event-hubs/samples/receiveEventsStreaming.ts similarity index 81% rename from sdk/eventhub/event-hubs/samples/receiveMessagesStreaming.ts rename to sdk/eventhub/event-hubs/samples/receiveEventsStreaming.ts index 3ef6f34bb5cb..a232b19018f5 100644 --- a/sdk/eventhub/event-hubs/samples/receiveMessagesStreaming.ts +++ b/sdk/eventhub/event-hubs/samples/receiveEventsStreaming.ts @@ -2,10 +2,9 @@ Copyright (c) Microsoft Corporation. All rights reserved. Licensed under the MIT Licence. - This sample demonstrates how the receive() function can be used to receive Event Hubs messages - in a stream. + This sample demonstrates how the receive() function can be used to receive events in a stream. - If your Event Hubs instance doesn't have any messages, then please run "sendMesages.ts" sample + If your Event Hubs instance doesn't have any events, then please run "sendEvents.ts" sample to populate Event Hubs before running this sample. */ @@ -20,17 +19,18 @@ async function main(): Promise { const partitionIds = await client.getPartitionIds(); const onMessageHandler: OnMessage = async (brokeredMessage: EventData) => { - console.log(`Received message: ${brokeredMessage.body}`); + console.log(`Received event: ${brokeredMessage.body}`); }; const onErrorHandler: OnError = (err: MessagingError | Error) => { console.log("Error occurred: ", err); }; const rcvHandler = client.receive(partitionIds[0], onMessageHandler, onErrorHandler, { - eventPosition: EventPosition.fromStart() + eventPosition: EventPosition.fromStart(), + consumerGroup: "$Default" }); - // Waiting long enough before closing the receiver to receive messages + // Waiting long enough before closing the receiver to receive event await delay(5000); await rcvHandler.stop(); await client.close(); diff --git a/sdk/eventhub/event-hubs/samples/sendMessages.ts b/sdk/eventhub/event-hubs/samples/sendEvents.ts similarity index 85% rename from sdk/eventhub/event-hubs/samples/sendMessages.ts rename to sdk/eventhub/event-hubs/samples/sendEvents.ts index bfb40258ccfb..49a2d62b5afb 100644 --- a/sdk/eventhub/event-hubs/samples/sendMessages.ts +++ b/sdk/eventhub/event-hubs/samples/sendEvents.ts @@ -2,7 +2,7 @@ Copyright (c) Microsoft Corporation. All rights reserved. Licensed under the MIT Licence. - This sample demonstrates how the send() function can be used to send messages to Event Hubs. + This sample demonstrates how the send() function can be used to send events to Event Hubs. See https://docs.microsoft.com/en-us/azure/event-hubs/event-hubs-about to learn about Event Hubs. @@ -33,14 +33,14 @@ async function main(): Promise { for (let index = 0; index < listOfScientists.length; index++) { const scientist = listOfScientists[index]; - const data: EventData = { + const eventData: EventData = { body: `${scientist.firstName} ${scientist.name}` }; // NOTE: For receiving events from Azure Stream Analytics, please send Events to an EventHub // where the body is a JSON object/array. - // const data = { body: { "message": `${scientist.firstName} ${scientist.name}` } }; - console.log(`Sending message: ${data.body}`); - await client.send(data, partitionIds[0]); + // const eventData = { body: { "message": `${scientist.firstName} ${scientist.name}` } }; + console.log(`Sending event: ${eventData.body}`); + await client.send(eventData, partitionIds[0]); } await client.close(); diff --git a/sdk/eventhub/event-hubs/samples/servicePrincipalLogin.ts b/sdk/eventhub/event-hubs/samples/servicePrincipalLogin.ts index c658a47e71f8..652aaa3e43c3 100644 --- a/sdk/eventhub/event-hubs/samples/servicePrincipalLogin.ts +++ b/sdk/eventhub/event-hubs/samples/servicePrincipalLogin.ts @@ -36,7 +36,7 @@ async function main(): Promise { const client = EventHubClient.createFromAadTokenCredentials(evenHubsEndpoint, eventHubsName, credentials); /* Refer to other samples, and place your code here - to send/receive messages + to send/receive events */ await client.close(); } diff --git a/sdk/eventhub/event-hubs/samples/useProxy.ts b/sdk/eventhub/event-hubs/samples/useProxy.ts index 2192a95c6382..0ec492bb8090 100644 --- a/sdk/eventhub/event-hubs/samples/useProxy.ts +++ b/sdk/eventhub/event-hubs/samples/useProxy.ts @@ -29,7 +29,7 @@ async function main(): Promise { }); /* Refer to other samples, and place your code here - to send/receive messages + to send/receive events */ await client.close(); } diff --git a/sdk/eventhub/event-hubs/src/eventHubSender.ts b/sdk/eventhub/event-hubs/src/eventHubSender.ts index fd4f39724b55..1f29f716b08c 100644 --- a/sdk/eventhub/event-hubs/src/eventHubSender.ts +++ b/sdk/eventhub/event-hubs/src/eventHubSender.ts @@ -478,11 +478,15 @@ export class EventHubSender extends LinkEntity { let onModified: Func; let onAccepted: Func; const removeListeners = (): void => { - clearTimeout(waitTimer); - this._sender!.removeListener(SenderEvents.rejected, onRejected); - this._sender!.removeListener(SenderEvents.accepted, onAccepted); - this._sender!.removeListener(SenderEvents.released, onReleased); - this._sender!.removeListener(SenderEvents.modified, onModified); + clearTimeout(waitTimer); + // When `removeListeners` is called on timeout, the sender might be closed and cleared + // So, check if it exists, before removing listeners from it. + if (this._sender) { + this._sender.removeListener(SenderEvents.rejected, onRejected); + this._sender.removeListener(SenderEvents.accepted, onAccepted); + this._sender.removeListener(SenderEvents.released, onReleased); + this._sender.removeListener(SenderEvents.modified, onModified); + } }; onAccepted = (context: EventContext) => { diff --git a/sdk/eventhub/event-processor-host/CONTRIBUTING.md b/sdk/eventhub/event-processor-host/CONTRIBUTING.md new file mode 100644 index 000000000000..8a30fdc971a3 --- /dev/null +++ b/sdk/eventhub/event-processor-host/CONTRIBUTING.md @@ -0,0 +1,57 @@ +# Contributing + +This project welcomes contributions and suggestions. Most contributions require you to +agree to a Contributor License Agreement (CLA) declaring that you have the right to, +and actually do, grant us the rights to use your contribution. For details, visit +https://cla.microsoft.com. + +When you submit a pull request, a CLA-bot will automatically determine whether you need +to provide a CLA and decorate the PR appropriately (e.g., label, comment). Simply follow the +instructions provided by the bot. You will only need to do this once across all repositories using our CLA. + +This project has adopted the [Microsoft Open Source Code of Conduct](https://opensource.microsoft.com/codeofconduct/). +For more information see the [Code of Conduct FAQ](https://opensource.microsoft.com/codeofconduct/faq/) +or contact [opencode@microsoft.com](mailto:opencode@microsoft.com) with any additional questions or comments. + +## What to contribute +There are many ways that you can contribute to the Azure Event Processor Host project: + +* Submit a bug +* Submit a code fix for a bug +* Submit additions or modifications to the documentation +* Submit a feature request + +## Contributing Code +To contribute code you need to issue a Pull Request against the develop branch. All code submissions will be reviewed and tested by the team, and those that meet a high bar for both quality and design/roadmap appropriateness will be merged into the source. Be sure to follow the existing file/folder structure when adding new boards or sensors. + +You must sign a [Contribution License Agreement](https://cla.microsoft.com/) ([CLA](https://cla.microsoft.com/)) before submitting a Pull Request. To complete the CLA, you will need to submit the request via the form and then electronically sign the CLA when you receive the email containing the link to the document. + +## Big contributions +If your contribution is significantly big it is better to first check with the project developers in order to make sure the change aligns with the long term plans. This can be done simply by submitting a question via the GitHub Issues section. + +## Things to keep in mind when contributing +Some guidance for when you make a contribution: + +* Add/update unit tests and code as required by your change +* Make sure you run all the unit tests on the affected platform(s)/languages. If the change is in common code, generally running on one platform would be acceptable. +* Run end-to-end tests or simple sample code to make sure the lib works in an end-to-end scenario. + +## Building the library +- Install typescript, ts-node globally (optional, but very useful) +``` +npm i -g typescript +npm i -g ts-node +``` +- Clone the repo, cd to the sub folder for event processor host and install the dependencies +``` +git clone https://github.com/azure/azure-sdk-for-js.git +cd azure-sdk-for-js/sdk/eventhub/event-processor-host +npm install +``` +- Build the project +``` +npm run build +``` + +## AMQP Dependencies ## +The Event Processor Host library depends on the [Event Hubs](https://github.com/Azure/azure-sdk-for-js/tree/master/sdk/eventhub/event-hubs) library which in turn depends on [rhea-promise](https://github.com/amqp/rhea-promise) library for managing connections, sending and receiving events over the [AMQP](http://docs.oasis-open.org/amqp/core/v1.0/os/amqp-core-complete-v1.0-os.pdf) protocol. diff --git a/sdk/eventhub/event-processor-host/License b/sdk/eventhub/event-processor-host/License new file mode 100644 index 000000000000..21071075c245 --- /dev/null +++ b/sdk/eventhub/event-processor-host/License @@ -0,0 +1,21 @@ + MIT License + + Copyright (c) Microsoft Corporation. All rights reserved. + + 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/sdk/eventhub/event-processor-host/ci.yml b/sdk/eventhub/event-processor-host/ci.yml new file mode 100644 index 000000000000..a887660b7cdb --- /dev/null +++ b/sdk/eventhub/event-processor-host/ci.yml @@ -0,0 +1,17 @@ +# DO NOT EDIT THIS FILE +# This file is generated automatically and any changes will be lost. + +trigger: none + +pr: + branches: + include: + - master + paths: + include: + - sdk/eventhub/event-processor-host/ + +jobs: + - template: ../../../eng/pipelines/templates/jobs/archetype-sdk-client.yml + parameters: + PackageName: "@azure/event-processor-host" diff --git a/sdk/keyvault/keyvault/ci.yml b/sdk/keyvault/keyvault/ci.yml new file mode 100644 index 000000000000..dd1c6b5f3ea7 --- /dev/null +++ b/sdk/keyvault/keyvault/ci.yml @@ -0,0 +1,17 @@ +# DO NOT EDIT THIS FILE +# This file is generated automatically and any changes will be lost. + +trigger: none + +pr: + branches: + include: + - master + paths: + include: + - sdk/keyvault/keyvault/ + +jobs: + - template: ../../../eng/pipelines/templates/jobs/archetype-sdk-client.yml + parameters: + PackageName: "@azure/keyvault" diff --git a/sdk/servicebus/service-bus/ci.yml b/sdk/servicebus/service-bus/ci.yml new file mode 100644 index 000000000000..46e464884f94 --- /dev/null +++ b/sdk/servicebus/service-bus/ci.yml @@ -0,0 +1,17 @@ +# DO NOT EDIT THIS FILE +# This file is generated automatically and any changes will be lost. + +trigger: none + +pr: + branches: + include: + - master + paths: + include: + - sdk/servicebus/service-bus/ + +jobs: + - template: ../../../eng/pipelines/templates/jobs/archetype-sdk-client.yml + parameters: + PackageName: "@azure/service-bus" diff --git a/sdk/servicebus/service-bus/package.json b/sdk/servicebus/service-bus/package.json index 62ba13e219e7..e8b31be3d80f 100644 --- a/sdk/servicebus/service-bus/package.json +++ b/sdk/servicebus/service-bus/package.json @@ -25,7 +25,7 @@ "node": ">=6.0.0" }, "dependencies": { - "@azure/amqp-common": "^1.0.0-preview.3", + "@azure/amqp-common": "^1.0.0-preview.5", "@azure/ms-rest-nodeauth": "^0.9.2", "@types/long": "^4.0.0", "debug": "^3.1.0", @@ -84,6 +84,7 @@ }, "files": [ "dist/", + "dist-esm/package.json", "dist-esm/src/", "src/", "typings/src", diff --git a/sdk/servicebus/service-bus/src/clientEntityContext.ts b/sdk/servicebus/service-bus/src/clientEntityContext.ts index e0704b1327cf..baf4b1321218 100644 --- a/sdk/servicebus/service-bus/src/clientEntityContext.ts +++ b/sdk/servicebus/service-bus/src/clientEntityContext.ts @@ -147,7 +147,7 @@ export namespace ClientEntityContext { ); (entityContext as ClientEntityContext).getReceiver = (name: string, sessionId?: string) => { - if (sessionId && entityContext.expiredMessageSessions[sessionId]) { + if (sessionId != undefined && entityContext.expiredMessageSessions[sessionId]) { const error = new Error( `The session lock has expired on the session with id ${sessionId}.` ); diff --git a/sdk/servicebus/service-bus/src/core/managementClient.ts b/sdk/servicebus/service-bus/src/core/managementClient.ts index c5d13971ac4a..7f2ce8f734cb 100644 --- a/sdk/servicebus/service-bus/src/core/managementClient.ts +++ b/sdk/servicebus/service-bus/src/core/managementClient.ts @@ -314,7 +314,7 @@ export class ManagementClient extends LinkEntity { Buffer.from(fromSequenceNumber.toBytesBE()) ); messageBody[Constants.messageCount] = types.wrap_int(maxMessageCount); - if (sessionId) { + if (sessionId != undefined) { messageBody[Constants.sessionIdMapKey] = sessionId; } const request: AmqpMessage = { @@ -726,6 +726,7 @@ export class ManagementClient extends LinkEntity { async updateDispositionStatus( lockToken: string, dispositionStatus: DispositionStatus, + associatedLinkName?: string, options?: DispositionStatusOptions ): Promise { throwErrorIfConnectionClosed(this._context.namespace); @@ -757,6 +758,9 @@ export class ManagementClient extends LinkEntity { operation: Constants.operations.updateDisposition } }; + if (associatedLinkName) { + request.application_properties![Constants.associatedLinkName] = associatedLinkName; + } request.application_properties![Constants.trackingId] = generate_uuid(); log.mgmt( "[%s] Update disposition status request body: %O.", diff --git a/sdk/servicebus/service-bus/src/core/messageReceiver.ts b/sdk/servicebus/service-bus/src/core/messageReceiver.ts index bf60268dc8d8..7ee138defa1b 100644 --- a/sdk/servicebus/service-bus/src/core/messageReceiver.ts +++ b/sdk/servicebus/service-bus/src/core/messageReceiver.ts @@ -8,7 +8,8 @@ import { retry, RetryOperationType, RetryConfig, - ConditionErrorNameMapper + ConditionErrorNameMapper, + ErrorNameConditionMapper } from "@azure/amqp-common"; import { Receiver, @@ -21,12 +22,7 @@ import { import * as log from "../log"; import { LinkEntity } from "./linkEntity"; import { ClientEntityContext } from "../clientEntityContext"; -import { - ServiceBusMessage, - DispositionType, - ReceiveMode, - throwIfMessageCannotBeSettled -} from "../serviceBusMessage"; +import { ServiceBusMessage, DispositionType, ReceiveMode } from "../serviceBusMessage"; import { getUniqueName, calculateRenewAfterDuration } from "../util/utils"; import { MessageHandlerOptions } from "./streamingReceiver"; import { messageDispositionTimeout } from "../util/constants"; @@ -883,16 +879,21 @@ export class MessageReceiver extends LinkEntity { const timer = setTimeout(() => { this._deliveryDispositionMap.delete(delivery.id); - throwIfMessageCannotBeSettled(this, operation, delivery.remote_settled); - log.receiver( "[%s] Disposition for delivery id: %d, did not complete in %d milliseconds. " + - "Hence resolving the promise.", + "Hence rejecting the promise with timeout error.", this._context.namespace.connectionId, delivery.id, messageDispositionTimeout ); - return resolve(); + + const e: AmqpError = { + condition: ErrorNameConditionMapper.ServiceUnavailableError, + description: + "Operation to settle the message has timed out. The disposition of the " + + "message may or may not be successful" + }; + return reject(translate(e)); }, messageDispositionTimeout); this._deliveryDispositionMap.set(delivery.id, { resolve: resolve, diff --git a/sdk/servicebus/service-bus/src/queueClient.ts b/sdk/servicebus/service-bus/src/queueClient.ts index 6c5a6b5796bd..3159079b0462 100644 --- a/sdk/servicebus/service-bus/src/queueClient.ts +++ b/sdk/servicebus/service-bus/src/queueClient.ts @@ -17,6 +17,7 @@ import { } from "./util/errors"; import { generate_uuid } from "rhea-promise"; import { ClientEntityContext } from "./clientEntityContext"; +import { getAssociatedReceiverName } from "../src/util/utils"; /** * Describes the client that allows interacting with a Service Bus Queue. @@ -111,7 +112,8 @@ export class QueueClient implements Client { /** * Creates a Receiver for receiving messages from a Queue which does not have sessions enabled. * - Throws error if an open receiver already exists for this QueueClient. - * - Throws error if the Queue has sessions enabled. + * - Throws `InvalidOperationError` if the Queue has sessions enabled (in which case, use the + * overload of this method which takes `sessionOptions` argument) * * @param receiveMode An enum indicating the mode in which messages should be received. Possible * values are: @@ -129,7 +131,9 @@ export class QueueClient implements Client { * Creates a Receiver for receiving messages from a session enabled Queue. When no sessionId is * given, a random session among the available sessions is used. * - Throws error if an open receiver already exists for given sessionId. - * - Throws error if the Queue does not have sessions enabled. + * - Throws `SessionCannotBeLockedError` if the Queue does not have sessions enabled (in which + * case do not pass the `sessionOptions` argument) or if Service Bus is not able to get a lock on + * the session (in which case try again after some time) * * @param receiveMode An enum indicating the mode in which messages should be received. Possible * values are: @@ -201,13 +205,10 @@ export class QueueClient implements Client { this._context.isClosed ); - let receiverName; - if (this._context.batchingReceiver) { - receiverName = this._context.batchingReceiver.name; - } else if (this._context.streamingReceiver) { - receiverName = this._context.streamingReceiver.name; - } - return this._context.managementClient!.peek(maxMessageCount, receiverName); + return this._context.managementClient!.peek( + maxMessageCount, + getAssociatedReceiverName(this._context) + ); } /** @@ -230,18 +231,11 @@ export class QueueClient implements Client { this._context.isClosed ); - let receiverName; - if (this._context.batchingReceiver) { - receiverName = this._context.batchingReceiver.name; - } else if (this._context.streamingReceiver) { - receiverName = this._context.streamingReceiver.name; - } - return this._context.managementClient!.peekBySequenceNumber( fromSequenceNumber, maxMessageCount, undefined, - receiverName + getAssociatedReceiverName(this._context) ); } diff --git a/sdk/servicebus/service-bus/src/receiver.ts b/sdk/servicebus/service-bus/src/receiver.ts index b23a63687e90..251f22714d46 100644 --- a/sdk/servicebus/service-bus/src/receiver.ts +++ b/sdk/servicebus/service-bus/src/receiver.ts @@ -23,6 +23,8 @@ import { getErrorMessageNotSupportedInReceiveAndDeleteMode } from "./util/errors"; +import { getAssociatedReceiverName } from "../src/util/utils"; + /** * The Receiver class can be used to receive messages in a batch or by registering handlers. * Use the `createReceiver` function on the QueueClient or SubscriptionClient to instantiate a Receiver. @@ -73,6 +75,10 @@ export class Receiver { * from a Queue/Subscription. * To stop receiving messages, call `close()` on the Receiver. * + * Throws an error if there is another receive operation in progress on the same receiver. If you + * are not sure whether there is another receive operation running, check the `isReceivingMessages` + * property on the receiver. + * * @param onMessage - Handler for processing each incoming message. * @param onError - Handler for any error that occurs while receiving or processing messages. * @param options - Options to control if messages should be automatically completed, and/or have @@ -122,6 +128,10 @@ export class Receiver { * Returns a promise that resolves to an array of messages based on given count and timeout over * an AMQP receiver link from a Queue/Subscription. * + * Throws an error if there is another receive operation in progress on the same receiver. If you + * are not sure whether there is another receive operation running, check the `isReceivingMessages` + * property on the receiver. + * * @param maxMessageCount The maximum number of messages to receive from Queue/Subscription. * @param idleTimeoutInSeconds The maximum wait time in seconds for which the Receiver * should wait to receive the first message. If no message is received by this time, @@ -149,8 +159,12 @@ export class Receiver { /** * Gets an async iterator over messages from the receiver. - * While iterating, you will get `undefined` instead of a message, if the iterator is not able to - * fetch a new message in over a minute. + * + * Throws an error if there is another receive operation in progress on the same receiver. If you + * are not sure whether there is another receive operation running, check the `isReceivingMessages` + * property on the receiver. + * + * If the iterator is not able to fetch a new message in over a minute, `undefined` will be returned. */ async *getMessageIterator(): AsyncIterableIterator { while (true) { @@ -186,14 +200,10 @@ export class Receiver { ? String(lockTokenOrMessage.lockToken) : String(lockTokenOrMessage); - let receiverName; - if (this._context.batchingReceiver) { - receiverName = this._context.batchingReceiver.name; - } else if (this._context.streamingReceiver) { - receiverName = this._context.streamingReceiver.name; - } - - const lockedUntilUtc = await this._context.managementClient!.renewLock(lockToken, receiverName); + const lockedUntilUtc = await this._context.managementClient!.renewLock( + lockToken, + getAssociatedReceiverName(this._context) + ); return lockedUntilUtc; } @@ -219,17 +229,10 @@ export class Receiver { sequenceNumber ); - let receiverName; - if (this._context.batchingReceiver) { - receiverName = this._context.batchingReceiver.name; - } else if (this._context.streamingReceiver) { - receiverName = this._context.streamingReceiver.name; - } - const messages = await this._context.managementClient!.receiveDeferredMessages( [sequenceNumber], this._receiveMode, - receiverName + getAssociatedReceiverName(this._context) ); return messages[0]; } @@ -258,17 +261,10 @@ export class Receiver { sequenceNumbers ); - let receiverName; - if (this._context.batchingReceiver) { - receiverName = this._context.batchingReceiver.name; - } else if (this._context.streamingReceiver) { - receiverName = this._context.streamingReceiver.name; - } - return this._context.managementClient!.receiveDeferredMessages( sequenceNumbers, this._receiveMode, - receiverName + getAssociatedReceiverName(this._context) ); } @@ -429,7 +425,7 @@ export class SessionReceiver { receiveMode === ReceiveMode.receiveAndDelete ? receiveMode : ReceiveMode.peekLock; this._sessionOptions = sessionOptions; - if (sessionOptions.sessionId) { + if (sessionOptions.sessionId != undefined) { sessionOptions.sessionId = String(sessionOptions.sessionId); // Check if receiver for given session already exists @@ -614,6 +610,10 @@ export class SessionReceiver { * Returns a promise that resolves to an array of messages based on given count and timeout over * an AMQP receiver link from a Queue/Subscription. * + * Throws an error if there is another receive operation in progress on the same receiver. If you + * are not sure whether there is another receive operation running, check the `isReceivingMessages` + * property on the receiver. + * * @param maxMessageCount The maximum number of messages to receive from Queue/Subscription. * @param maxWaitTimeInSeconds The maximum wait time in seconds for which the Receiver * should wait to receive the first message. If no message is received by this time, @@ -636,6 +636,10 @@ export class SessionReceiver { * from a Queue/Subscription. * To stop receiving messages, call `close()` on the SessionReceiver. * + * Throws an error if there is another receive operation in progress on the same receiver. If you + * are not sure whether there is another receive operation running, check the `isReceivingMessages` + * property on the receiver. + * * @param onMessage - Handler for processing each incoming message. * @param onError - Handler for any error that occurs while receiving or processing messages. * @param options - Options to control whether messages should be automatically completed @@ -681,8 +685,12 @@ export class SessionReceiver { /** * Gets an async iterator over messages from the receiver. - * While iterating, you will get `undefined` instead of a message, if the iterator is not able to - * fetch a new message in over a minute. + * + * Throws an error if there is another receive operation in progress on the same receiver. If you + * are not sure whether there is another receive operation running, check the `isReceivingMessages` + * property on the receiver. + * + * If the iterator is not able to fetch a new message in over a minute, `undefined` will be returned */ async *getMessageIterator(): AsyncIterableIterator { while (true) { @@ -753,15 +761,8 @@ export class SessionReceiver { .maxSessionAutoRenewLockDurationInSeconds, receiveMode: this._receiveMode }); - // By this point, we should have a valid sessionId on the messageSession - // If not, the receiver cannot be used, so throw error. - if (!this._messageSession.sessionId) { - const error = new Error("Something went wrong. Cannot lock a session."); - log.error(`[${this._context.namespace.connectionId}] %O`, error); - throw error; - } this._sessionId = this._messageSession.sessionId; - delete this._context.expiredMessageSessions[this._messageSession.sessionId]; + delete this._context.expiredMessageSessions[this._messageSession.sessionId!]; } private _throwIfAlreadyReceiving(): void { diff --git a/sdk/servicebus/service-bus/src/serviceBusMessage.ts b/sdk/servicebus/service-bus/src/serviceBusMessage.ts index f65f96518d1f..2c0d25d4bada 100644 --- a/sdk/servicebus/service-bus/src/serviceBusMessage.ts +++ b/sdk/servicebus/service-bus/src/serviceBusMessage.ts @@ -9,10 +9,10 @@ import { MessageAnnotations, DeliveryAnnotations } from "rhea-promise"; -import { Constants, AmqpMessage } from "@azure/amqp-common"; +import { Constants, AmqpMessage, translate, ErrorNameConditionMapper } from "@azure/amqp-common"; import * as log from "./log"; import { ClientEntityContext } from "./clientEntityContext"; -import { reorderLockToken } from "../src/util/utils"; +import { reorderLockToken, getAssociatedReceiverName } from "../src/util/utils"; import { MessageReceiver } from "../src/core/messageReceiver"; import { MessageSession } from "../src/session/messageSession"; import { getErrorMessageNotSupportedInReceiveAndDeleteMode } from "./util/errors"; @@ -461,7 +461,9 @@ export function fromAmqpMessage( shouldReorderLockToken?: boolean ): ReceivedMessageInfo { if (!msg) { - throw new Error("'msg' cannot be null or undefined."); + msg = { + body: undefined + }; } const sbmsg: SendableMessageInfo = { body: msg.body @@ -782,6 +784,13 @@ export class ServiceBusMessage implements ReceivedMessage { * @readonly */ readonly _amqpMessage: AmqpMessage; + /** + * @property Boolean denoting if the message has already been settled. + * @readonly + */ + public get isSettled(): boolean { + return this.delivery.remote_settled; + } /** * @property {ClientEntityContext} _context The client entity context. * @readonly @@ -808,6 +817,20 @@ export class ServiceBusMessage implements ReceivedMessage { /** * Removes the message from Service Bus. + * + * - Throws `SessionLockLostError` (for messages from a Queue/Subscription with sessions enabled) + * if the AMQP link with which the message was received is no longer alive. This can + * happen either because the lock on the session expired or the receiver was explicitly closed by + * the user or the AMQP link got closed by the library due to network loss or service error. + * - Throws `MessageLockLostError` (for messages from a Queue/Subscription with sessions not enabled) + * if the lock on the message has expired or the AMQP link with which the message was received is + * no longer alive. The latter can happen if the receiver was explicitly closed by the user or the + * AMQP link got closed by the library due to network loss or service error. + * - Throws an error if the message is already settled. To avoid this error check the `isSettled` + * property on the message if you are not sure whether the message is settled. + * - Throws an error if used in `ReceiveAndDelete` mode because all messages received in this mode + * are pre-settled. + * * @returns Promise. */ async complete(): Promise { @@ -820,6 +843,7 @@ export class ServiceBusMessage implements ReceivedMessage { await this._context.managementClient!.updateDispositionStatus( this.lockToken!, DispositionStatus.completed, + getAssociatedReceiverName(this._context, this.sessionId), { sessionId: this.sessionId } @@ -830,13 +854,32 @@ export class ServiceBusMessage implements ReceivedMessage { return; } const receiver = this._context.getReceiver(this.delivery.link.name, this.sessionId); - throwIfMessageCannotBeSettled(receiver, DispositionType.complete, this.delivery.remote_settled); + throwIfMessageCannotBeSettled( + receiver, + DispositionType.complete, + this.delivery.remote_settled, + this.sessionId + ); return receiver!.settleMessage(this, DispositionType.complete); } /** * The lock held on the message by the receiver is let go, making the message available again in * Service Bus for another receive operation. + * + * - Throws `SessionLockLostError` (for messages from a Queue/Subscription with sessions enabled) + * if the AMQP link with which the message was received is no longer alive. This can + * happen either because the lock on the session expired or the receiver was explicitly closed by + * the user or the AMQP link got closed by the library due to network loss or service error. + * - Throws `MessageLockLostError` (for messages from a Queue/Subscription with sessions not enabled) + * if the lock on the message has expired or the AMQP link with which the message was received is + * no longer alive. The latter can happen if the receiver was explicitly closed by the user or the + * AMQP link got closed by the library due to network loss or service error. + * - Throws an error if the message is already settled. To avoid this error check the `isSettled` + * property on the message if you are not sure whether the message is settled. + * - Throws an error if used in `ReceiveAndDelete` mode because all messages received in this mode + * are pre-settled. + * * @param propertiesToModify The properties of the message to modify while abandoning the message. * * @return Promise. @@ -852,6 +895,7 @@ export class ServiceBusMessage implements ReceivedMessage { await this._context.managementClient!.updateDispositionStatus( this.lockToken!, DispositionStatus.abandoned, + getAssociatedReceiverName(this._context, this.sessionId), { propertiesToModify: propertiesToModify, sessionId: this.sessionId } ); @@ -860,7 +904,12 @@ export class ServiceBusMessage implements ReceivedMessage { return; } const receiver = this._context.getReceiver(this.delivery.link.name, this.sessionId); - throwIfMessageCannotBeSettled(receiver, DispositionType.abandon, this.delivery.remote_settled); + throwIfMessageCannotBeSettled( + receiver, + DispositionType.abandon, + this.delivery.remote_settled, + this.sessionId + ); return receiver!.settleMessage(this, DispositionType.abandon, { propertiesToModify: propertiesToModify @@ -870,6 +919,20 @@ export class ServiceBusMessage implements ReceivedMessage { /** * Defers the processing of the message. Save the `sequenceNumber` of the message, in order to * receive it message again in the future using the `receiveDeferredMessage` method. + * + * - Throws `SessionLockLostError` (for messages from a Queue/Subscription with sessions enabled) + * if the AMQP link with which the message was received is no longer alive. This can + * happen either because the lock on the session expired or the receiver was explicitly closed by + * the user or the AMQP link got closed by the library due to network loss or service error. + * - Throws `MessageLockLostError` (for messages from a Queue/Subscription with sessions not enabled) + * if the lock on the message has expired or the AMQP link with which the message was received is + * no longer alive. The latter can happen if the receiver was explicitly closed by the user or the + * AMQP link got closed by the library due to network loss or service error. + * - Throws an error if the message is already settled. To avoid this error check the `isSettled` + * property on the message if you are not sure whether the message is settled. + * - Throws an error if used in `ReceiveAndDelete` mode because all messages received in this mode + * are pre-settled. + * * @param propertiesToModify The properties of the message to modify while deferring the message * * @returns Promise @@ -884,6 +947,7 @@ export class ServiceBusMessage implements ReceivedMessage { await this._context.managementClient!.updateDispositionStatus( this.lockToken!, DispositionStatus.defered, + getAssociatedReceiverName(this._context, this.sessionId), { propertiesToModify: propertiesToModify, sessionId: this.sessionId } ); @@ -892,7 +956,12 @@ export class ServiceBusMessage implements ReceivedMessage { return; } const receiver = this._context.getReceiver(this.delivery.link.name, this.sessionId); - throwIfMessageCannotBeSettled(receiver, DispositionType.defer, this.delivery.remote_settled); + throwIfMessageCannotBeSettled( + receiver, + DispositionType.defer, + this.delivery.remote_settled, + this.sessionId + ); return receiver!.settleMessage(this, DispositionType.defer, { propertiesToModify: propertiesToModify @@ -902,6 +971,20 @@ export class ServiceBusMessage implements ReceivedMessage { /** * Moves the message to the deadletter sub-queue. To receive a deadletted message, create a new * QueueClient/SubscriptionClient using the path for the deadletter sub-queue. + * + * - Throws `SessionLockLostError` (for messages from a Queue/Subscription with sessions enabled) + * if the AMQP link with which the message was received is no longer alive. This can + * happen either because the lock on the session expired or the receiver was explicitly closed by + * the user or the AMQP link got closed by the library due to network loss or service error. + * - Throws `MessageLockLostError` (for messages from a Queue/Subscription with sessions not enabled) + * if the lock on the message has expired or the AMQP link with which the message was received is + * no longer alive. The latter can happen if the receiver was explicitly closed by the user or the + * AMQP link got closed by the library due to network loss or service error. + * - Throws an error if the message is already settled. To avoid this error check the `isSettled` + * property on the message if you are not sure whether the message is settled. + * - Throws an error if used in `ReceiveAndDelete` mode because all messages received in this mode + * are pre-settled. + * * @param options The DeadLetter options that can be provided while * rejecting the message. * @@ -926,6 +1009,7 @@ export class ServiceBusMessage implements ReceivedMessage { await this._context.managementClient!.updateDispositionStatus( this.lockToken!, DispositionStatus.suspended, + getAssociatedReceiverName(this._context, this.sessionId), { deadLetterReason: error.condition, deadLetterDescription: error.description, @@ -941,7 +1025,8 @@ export class ServiceBusMessage implements ReceivedMessage { throwIfMessageCannotBeSettled( receiver, DispositionType.deadletter, - this.delivery.remote_settled + this.delivery.remote_settled, + this.sessionId ); return receiver!.settleMessage(this, DispositionType.deadletter, { @@ -977,28 +1062,46 @@ export class ServiceBusMessage implements ReceivedMessage { } /** + * @internal * Logs and Throws an error if the given message cannot be settled. * @param receiver Receiver to be used to settle this message * @param operation Settle operation: complete, abandon, defer or deadLetter * @param isRemoteSettled Boolean indicating if the message has been settled at the remote + * @param sessionId sessionId of the message if applicable */ export function throwIfMessageCannotBeSettled( receiver: MessageReceiver | MessageSession | undefined, operation: DispositionType, - isRemoteSettled: boolean + isRemoteSettled: boolean, + sessionId?: string ): void { - let errorMessage; - if (!receiver || !receiver.isOpen()) { - errorMessage = `Failed to ${operation} the message as it's receiver has been closed.`; - } else if (receiver.receiveMode !== ReceiveMode.peekLock) { - errorMessage = getErrorMessageNotSupportedInReceiveAndDeleteMode(`${operation} the message`); + let error: Error | undefined; + + if (receiver && receiver.receiveMode !== ReceiveMode.peekLock) { + error = new Error( + getErrorMessageNotSupportedInReceiveAndDeleteMode(`${operation} the message`) + ); } else if (isRemoteSettled) { - errorMessage = `Failed to ${operation} the message as this message has been already settled.`; + error = new Error(`Failed to ${operation} the message as this message is already settled.`); + } else if (!receiver || !receiver.isOpen()) { + const errorMessage = + `Failed to ${operation} the message as the AMQP link with which the message was ` + + `received is no longer alive.`; + if (sessionId != undefined) { + error = translate({ + description: errorMessage, + condition: ErrorNameConditionMapper.SessionLockLostError + }); + } else { + error = translate({ + description: errorMessage, + condition: ErrorNameConditionMapper.MessageLockLostError + }); + } } - if (!errorMessage) { + if (!error) { return; } - const error = new Error(errorMessage); if (receiver) { log.error( "An error occured when settling a message using the receiver %s: %O", diff --git a/sdk/servicebus/service-bus/src/session/messageSession.ts b/sdk/servicebus/service-bus/src/session/messageSession.ts index b56519f848bb..e24bfbd7ed90 100644 --- a/sdk/servicebus/service-bus/src/session/messageSession.ts +++ b/sdk/servicebus/service-bus/src/session/messageSession.ts @@ -14,6 +14,7 @@ import { EventContext, ReceiverOptions, ReceiverEvents, + AmqpError, isAmqpError } from "rhea-promise"; import * as log from "../log"; @@ -136,7 +137,7 @@ export class MessageSession extends LinkEntity { */ sessionLockedUntilUtc?: Date; /** - * @property {string} [sessionId] The sessionId for the message session. + * @property {string} [sessionId] The sessionId for the message session. Empty string is valid sessionId */ sessionId?: string; /** @@ -937,12 +938,19 @@ export class MessageSession extends LinkEntity { this._deliveryDispositionMap.delete(delivery.id); log.receiver( "[%s] Disposition for delivery id: %d, did not complete in %d milliseconds. " + - "Hence resolving the promise.", + "Hence rejecting the promise with timeout error", this._context.namespace.connectionId, delivery.id, messageDispositionTimeout ); - return resolve(); + + const e: AmqpError = { + condition: ErrorNameConditionMapper.ServiceUnavailableError, + description: + "Operation to settle the message has timed out. The disposition of the " + + "message may or may not be successful" + }; + return reject(translate(e)); }, messageDispositionTimeout); this._deliveryDispositionMap.set(delivery.id, { resolve: resolve, @@ -1016,16 +1024,20 @@ export class MessageSession extends LinkEntity { this._receiver.source.filter && this._receiver.source.filter[Constants.sessionFilterName]; let errorMessage: string = ""; - // SB allows a sessionId with empty string value :) + // Service Bus creates receiver successfully with no sessionId if it fails to get a lock on + // the session instead of throwing the SessionCannotBeLockedError. So, we throw it instead. if (receivedSessionId == undefined) { - errorMessage = - `Received an incorrect sessionId '${receivedSessionId}' while creating ` + - `the receiver '${this.name}'.`; - } - if (this.sessionId != undefined && receivedSessionId !== this.sessionId) { - errorMessage = - `Received sessionId '${receivedSessionId}' does not match the provided ` + - `sessionId '${this.sessionId}' while creating the receiver '${this.name}'.`; + if (this.sessionId == undefined) { + // User asked for a random session to be picked, but there are no sessions free to take + // a lock on or the Queue/Subscription doesnt have sessions enabled. + errorMessage = `There are no sessions available for receiving messages.`; + } else { + // User passed a sessionId, but cannot get a lock on it either because somebody else + // has a lock on it or the Queue/Subscription doesnt have sessions enabled. + errorMessage = `The session with id '${ + this.sessionId + }' is not available for receiving messages.`; + } } if (errorMessage) { const error = translate({ diff --git a/sdk/servicebus/service-bus/src/subscriptionClient.ts b/sdk/servicebus/service-bus/src/subscriptionClient.ts index aa91b11d6fb8..42d2d5b440e0 100644 --- a/sdk/servicebus/service-bus/src/subscriptionClient.ts +++ b/sdk/servicebus/service-bus/src/subscriptionClient.ts @@ -15,6 +15,7 @@ import { } from "./util/errors"; import { generate_uuid } from "rhea-promise"; import { ClientEntityContext } from "./clientEntityContext"; +import { getAssociatedReceiverName } from "../src/util/utils"; /** * Describes the client that allows interacting with a Service Bus Subscription. @@ -109,9 +110,9 @@ export class SubscriptionClient implements Client { /** * Creates a Receiver for receiving messages from a Subscription which does not have sessions enabled. - * Throws error if an open receiver already exists for this SubscriptionClient. - * - * Throws error if the Subscription has sessions enabled. + * - Throws error if an open receiver already exists for this SubscriptionClient. + * - Throws `InvalidOperationError` if the Subscription has sessions enabled (in which case, use the + * overload of this method which takes `sessionOptions` argument) * * @param receiveMode An enum indicating the mode in which messages should be received. Possible * values are: @@ -129,7 +130,9 @@ export class SubscriptionClient implements Client { * Creates a Receiver for receiving messages from a session enabled Subscription. When no sessionId is * given, a random session among the available sessions is used. * - Throws error if an open receiver already exists for given sessionId. - * - Throws error if the Queue does not have sessions enabled. + * - Throws `SessionCannotBeLockedError` if the Subscription does not have sessions enabled (in which + * case do not pass the `sessionOptions` argument) or if Service Bus is not able to get a lock on + * the session (in which case try again after some time) * * @param receiveMode An enum indicating the mode in which messages should be received. Possible * values are: @@ -201,14 +204,10 @@ export class SubscriptionClient implements Client { this._context.isClosed ); - let receiverName; - if (this._context.batchingReceiver) { - receiverName = this._context.batchingReceiver.name; - } else if (this._context.streamingReceiver) { - receiverName = this._context.streamingReceiver.name; - } - - return this._context.managementClient!.peek(maxMessageCount, receiverName); + return this._context.managementClient!.peek( + maxMessageCount, + getAssociatedReceiverName(this._context) + ); } /** @@ -231,18 +230,11 @@ export class SubscriptionClient implements Client { this._context.isClosed ); - let receiverName; - if (this._context.batchingReceiver) { - receiverName = this._context.batchingReceiver.name; - } else if (this._context.streamingReceiver) { - receiverName = this._context.streamingReceiver.name; - } - return this._context.managementClient!.peekBySequenceNumber( fromSequenceNumber, maxMessageCount, undefined, - receiverName + getAssociatedReceiverName(this._context) ); } diff --git a/sdk/servicebus/service-bus/src/util/errors.ts b/sdk/servicebus/service-bus/src/util/errors.ts index bd323b9a6761..5d84f711f007 100644 --- a/sdk/servicebus/service-bus/src/util/errors.ts +++ b/sdk/servicebus/service-bus/src/util/errors.ts @@ -134,7 +134,7 @@ export function getReceiverClosedErrorMsg( `Please create a new client using an instance of ServiceBusClient.` ); } - if (!sessionId) { + if (sessionId == undefined) { return ( `The receiver for "${entityPath}" has been closed and can no longer be used. ` + `Please create a new receiver using the "createReceiver" function on the ${clientType}.` @@ -152,7 +152,7 @@ export function getReceiverClosedErrorMsg( * @param sessionId If using session receiver, then the id of the session */ export function getAlreadyReceivingErrorMsg(entityPath: string, sessionId?: string): string { - if (!sessionId) { + if (sessionId == undefined) { return `The receiver for "${entityPath}" is already receiving messages.`; } return `The receiver for session "${sessionId}" for "${entityPath}" is already receiving messages.`; @@ -261,6 +261,7 @@ export function throwTypeErrorIfParameterIsEmptyString( } /** + * @internal * Gets error message for when an operation is not supported in ReceiveAndDelete mode * @param failedToDo A string to add to the placeholder in the error message. Denotes the action * that is not supported in ReceiveAndDelete mode diff --git a/sdk/servicebus/service-bus/src/util/utils.ts b/sdk/servicebus/service-bus/src/util/utils.ts index 266e57f3ea5f..edcc172298d4 100644 --- a/sdk/servicebus/service-bus/src/util/utils.ts +++ b/sdk/servicebus/service-bus/src/util/utils.ts @@ -5,6 +5,7 @@ import Long from "long"; import * as log from "../log"; import { generate_uuid } from "rhea-promise"; import { isBuffer } from "util"; +import { ClientEntityContext } from "../../src/clientEntityContext"; // This is the only dependency we have on DOM types, so rather than require // the DOM lib we can just shim this in. @@ -160,3 +161,23 @@ export function toBuffer(input: any): Buffer { return result; } +/** + * @internal + * Helper function to retrieve active receiver name, if it exists. + */ +export function getAssociatedReceiverName( + clientEntityContext: ClientEntityContext, + sessionId?: string +): string | undefined { + let receiverName: string | undefined; + if (sessionId != undefined) { + if (clientEntityContext.messageSessions[sessionId]) { + receiverName = clientEntityContext.messageSessions[sessionId].name; + } + } else if (clientEntityContext.batchingReceiver) { + receiverName = clientEntityContext.batchingReceiver.name; + } else if (clientEntityContext.streamingReceiver) { + receiverName = clientEntityContext.streamingReceiver.name; + } + return receiverName; +} diff --git a/sdk/servicebus/service-bus/test/perf/rhea-promise/receive.ts b/sdk/servicebus/service-bus/test/perf/rhea-promise/receive.ts index 3468c7e51079..1587a5f82f87 100644 --- a/sdk/servicebus/service-bus/test/perf/rhea-promise/receive.ts +++ b/sdk/servicebus/service-bus/test/perf/rhea-promise/receive.ts @@ -9,15 +9,22 @@ Measures the maximum throughput of `receiver.receive()` in package `rhea-promise 4. This test presumes that there are messages in the queue. 5. `ts-node receive.ts [maxConcurrentCalls] [totalMessages]` 6. Example: `ts-node receive.ts 1000 1000000` +7. If "maxConcurrentCalls <= 0", then receive credits are automatically managed which seems to improve throughput (both maximum rate and consistency). */ -import { Connection, ConnectionOptions, ReceiverEvents } from "rhea-promise"; +import { + Connection, + ConnectionOptions, + ReceiverEvents, + ReceiverOptionsWithSession +} from "rhea-promise"; import delay from "delay"; import moment from "moment"; const _start = moment(); let _messages = 0; +let _credit = -1; async function main(): Promise { // Endpoint=sb://.servicebus.windows.net/;SharedAccessKeyName=RootManageSharedAccessKey;SharedAccessKey= @@ -77,23 +84,34 @@ async function RunTest( } as ConnectionOptions); await connection.open(); - const receiver = await connection.createReceiver({ + let receiverOptions: ReceiverOptionsWithSession = { name: "receiver-1", source: { address: entityPath - }, - credit_window: 0 - }); + } + }; + + const manuallyManageCredit = (maxConcurrentCalls > 0); + if (manuallyManageCredit) { + receiverOptions.credit_window = 0; + } - receiver.addCredit(maxConcurrentCalls); + const receiver = await connection.createReceiver(receiverOptions); + + if (manuallyManageCredit) { + receiver.addCredit(maxConcurrentCalls); + } receiver.on(ReceiverEvents.message, async (context: any) => { // console.log("Received message: %O", context.message.body); _messages++; + + _credit = receiver.credit; + if (_messages === messages) { await receiver.close(); await connection.close(); - } else { + } else if (manuallyManageCredit) { receiver.addCredit(1); } }); @@ -127,7 +145,8 @@ async function WriteResults(messages: number): Promise { currentMessages, currentElapsed, maxMessages, - maxElapsed + maxElapsed, + _credit ); } while (_messages < messages); } @@ -138,13 +157,15 @@ function WriteResult( currentMessages: number, currentElapsed: number, maxMessages: number, - maxElapsed: number + maxElapsed: number, + credit: number ): void { log( `\tTot Msg\t${totalMessages}` + `\tCur MPS\t${Math.round((currentMessages * 1000) / currentElapsed)}` + `\tAvg MPS\t${Math.round((totalMessages * 1000) / totalElapsed)}` + - `\tMax MPS\t${Math.round((maxMessages * 1000) / maxElapsed)}` + `\tMax MPS\t${Math.round((maxMessages * 1000) / maxElapsed)}` + + `\tCredit\t${credit}` ); } diff --git a/sdk/servicebus/service-bus/test/perf/rhea-promise/send.ts b/sdk/servicebus/service-bus/test/perf/rhea-promise/send.ts index 6ba55e5280e4..e36d6dbf0e88 100644 --- a/sdk/servicebus/service-bus/test/perf/rhea-promise/send.ts +++ b/sdk/servicebus/service-bus/test/perf/rhea-promise/send.ts @@ -132,13 +132,17 @@ async function WriteResults(messages: number): Promise { maxElapsed = currentElapsed; } + const inflightMessages = _sent - _accepted - _rejected; + WriteResult( acceptedMessages, elapsed, currentMessages, currentElapsed, maxMessages, - maxElapsed + maxElapsed, + _rejected, + inflightMessages ); } while (_accepted + _rejected < messages); } @@ -149,13 +153,17 @@ function WriteResult( currentMessages: number, currentElapsed: number, maxMessages: number, - maxElapsed: number + maxElapsed: number, + rejectedMessages: number, + inflightMessages: number ): void { log( `\tTot Msg\t${totalMessages}` + `\tCur MPS\t${Math.round((currentMessages * 1000) / currentElapsed)}` + `\tAvg MPS\t${Math.round((totalMessages * 1000) / totalElapsed)}` + - `\tMax MPS\t${Math.round((maxMessages * 1000) / maxElapsed)}` + `\tMax MPS\t${Math.round((maxMessages * 1000) / maxElapsed)}` + + `\tReject\t${rejectedMessages}` + + `\tInflt\t${inflightMessages}` ); } diff --git a/sdk/servicebus/service-bus/test/serviceBusClient.spec.ts b/sdk/servicebus/service-bus/test/serviceBusClient.spec.ts index 3bac74071aa7..264944ef45fb 100644 --- a/sdk/servicebus/service-bus/test/serviceBusClient.spec.ts +++ b/sdk/servicebus/service-bus/test/serviceBusClient.spec.ts @@ -36,6 +36,7 @@ import { TestMessage } from "./testUtils"; import { ClientType } from "../src/client"; +import { throwIfMessageCannotBeSettled, DispositionType } from "../src/serviceBusMessage"; const should = chai.should(); dotenv.config(); chai.use(chaiAsPromised); @@ -478,47 +479,51 @@ describe("Errors after close()", function(): void { /** * Tests the error from settling a message after the receiver is closed */ - async function testDisposition(): Promise { + async function testAllDispositions(): Promise { + await testDisposition(DispositionType.complete); + await testDisposition(DispositionType.abandon); + await testDisposition(DispositionType.defer); + await testDisposition(DispositionType.deadletter); + } + + async function testDisposition(operation: DispositionType): Promise { let caughtError: Error | undefined; - try { - await receivedMessage.complete(); - } catch (error) { - caughtError = error; - } - should.equal( - caughtError && caughtError.message, - "Failed to complete the message as it's receiver has been closed." - ); + let expectedError: Error | undefined; try { - await receivedMessage.abandon(); + switch (operation) { + case DispositionType.complete: + await receivedMessage.complete(); + break; + case DispositionType.abandon: + await receivedMessage.abandon(); + break; + case DispositionType.defer: + await receivedMessage.defer(); + break; + case DispositionType.deadletter: + await receivedMessage.deadLetter(); + break; + + default: + break; + } } catch (error) { caughtError = error; } - should.equal( - caughtError && caughtError.message, - "Failed to abandon the message as it's receiver has been closed." - ); try { - await receivedMessage.defer(); + throwIfMessageCannotBeSettled( + undefined, + operation, + receivedMessage.isSettled, + receivedMessage.sessionId + ); } catch (error) { - caughtError = error; + expectedError = error; } - should.equal( - caughtError && caughtError.message, - "Failed to defer the message as it's receiver has been closed." - ); - try { - await receivedMessage.deadLetter(); - } catch (error) { - caughtError = error; - } - should.equal( - caughtError && caughtError.message, - "Failed to deadletter the message as it's receiver has been closed." - ); + should.equal(caughtError && caughtError.message, expectedError && expectedError.message); } /** @@ -1349,7 +1354,7 @@ describe("Errors after close()", function(): void { await testReceiver( getReceiverClosedErrorMsg(receiverClient.entityPath, ClientType.QueueClient, false) ); - await testDisposition(); + await testAllDispositions(); }); it("Partitioned Queue with sessions: errors after close() on receiver", async function(): Promise< @@ -1370,7 +1375,7 @@ describe("Errors after close()", function(): void { TestMessage.sessionId ) ); - await testDisposition(); + await testAllDispositions(); }); it("Partitioned Topic/Subscription: errors after close() on receiver", async function(): Promise< @@ -1385,7 +1390,7 @@ describe("Errors after close()", function(): void { await testReceiver( getReceiverClosedErrorMsg(receiverClient.entityPath, ClientType.SubscriptionClient, false) ); - await testDisposition(); + await testAllDispositions(); }); it("Partitioned Topic/Subscription with sessions: errors after close() on receiver", async function(): Promise< @@ -1406,7 +1411,7 @@ describe("Errors after close()", function(): void { TestMessage.sessionId ) ); - await testDisposition(); + await testAllDispositions(); }); it("Unpartitioned Queue: errors after close() on receiver", async function(): Promise { @@ -1419,7 +1424,7 @@ describe("Errors after close()", function(): void { await testReceiver( getReceiverClosedErrorMsg(receiverClient.entityPath, ClientType.QueueClient, false) ); - await testDisposition(); + await testAllDispositions(); }); it("Unpartitioned Queue with sessions: errors after close() on receiver", async function(): Promise< @@ -1440,7 +1445,7 @@ describe("Errors after close()", function(): void { TestMessage.sessionId ) ); - await testDisposition(); + await testAllDispositions(); }); it("Unpartitioned Topic/Subscription: errors after close() on receiver", async function(): Promise< @@ -1455,7 +1460,7 @@ describe("Errors after close()", function(): void { await testReceiver( getReceiverClosedErrorMsg(receiverClient.entityPath, ClientType.SubscriptionClient, false) ); - await testDisposition(); + await testAllDispositions(); }); it("Unpartitioned Topic/Subscription with sessions: errors after close() on receiver", async function(): Promise< @@ -1476,7 +1481,7 @@ describe("Errors after close()", function(): void { TestMessage.sessionId ) ); - await testDisposition(); + await testAllDispositions(); }); }); diff --git a/sdk/servicebus/service-bus/test/sessionsTests.spec.ts b/sdk/servicebus/service-bus/test/sessionsTests.spec.ts index 116f1c6cd777..6c5b2c99577e 100644 --- a/sdk/servicebus/service-bus/test/sessionsTests.spec.ts +++ b/sdk/servicebus/service-bus/test/sessionsTests.spec.ts @@ -54,7 +54,10 @@ function unExpectedErrorHandler(err: Error): void { const testSessionId2 = "my-session2"; -async function beforeEachTest(senderType: TestClientType, sessionType: TestClientType): Promise { +async function beforeEachTest( + senderType: TestClientType, + sessionType: TestClientType +): Promise { // The tests in this file expect the env variables to contain the connection string and // the names of empty queue/topic/subscription that are to be tested @@ -255,7 +258,7 @@ describe("SessionReceiver with no sessionId", function(): void { let msgs = await receiver.receiveMessages(2); should.equal(msgs.length, 1, "Unexpected number of messages received"); - + should.equal(receiver.sessionId, msgs[0].sessionId, "Unexpected sessionId in receiver"); should.equal( testMessagesWithDifferentSessionIds.some( (x) => @@ -275,7 +278,7 @@ describe("SessionReceiver with no sessionId", function(): void { msgs = await receiver.receiveMessages(2); should.equal(msgs.length, 1, "Unexpected number of messages received"); - + should.equal(receiver.sessionId, msgs[0].sessionId, "Unexpected sessionId in receiver"); should.equal( testMessagesWithDifferentSessionIds.some( (x) => @@ -335,6 +338,98 @@ describe("SessionReceiver with no sessionId", function(): void { }); }); +describe("SessionReceiver with empty string as sessionId", function(): void { + afterEach(async () => { + await afterEachTest(); + }); + + // Sending messages with different session id, so that we know for sure we pick the right one + // and that Service Bus is not choosing a random one for us + const testMessagesWithDifferentSessionIds: SendableMessageInfo[] = [ + { + body: "hello1", + messageId: `test message ${Math.random()}`, + sessionId: TestMessage.sessionId + }, + { + body: "hello2", + messageId: `test message ${Math.random()}`, + sessionId: "" + } + ]; + + async function testComplete_batching(): Promise { + const sender = senderClient.createSender(); + await sender.send(testMessagesWithDifferentSessionIds[0]); + await sender.send(testMessagesWithDifferentSessionIds[1]); + + const receiver = receiverClient.createReceiver(ReceiveMode.peekLock, { + sessionId: "" + }); + const msgs = await receiver.receiveMessages(2); + + should.equal(msgs.length, 1, "Unexpected number of messages received"); + should.equal(receiver.sessionId, "", "Unexpected sessionId in receiver"); + should.equal( + testMessagesWithDifferentSessionIds[1].body === msgs[0].body && + testMessagesWithDifferentSessionIds[1].messageId === msgs[0].messageId && + testMessagesWithDifferentSessionIds[1].sessionId === msgs[0].sessionId, + true, + "Received Message doesnt match expected test message" + ); + await msgs[0].complete(); + + const peekedMsgsInSession = await receiver.peek(); + should.equal(peekedMsgsInSession.length, 0, "Unexpected number of messages peeked"); + + await receiver.close(); + } + + it("Partitioned Queue: complete() removes message from random session", async function(): Promise< + void + > { + await beforeEachTest( + TestClientType.PartitionedQueueWithSessions, + TestClientType.PartitionedQueueWithSessions + ); + await purge(receiverClient, testSessionId2); + await testComplete_batching(); + }); + + it("Partitioned Subscription: complete() removes message from random session", async function(): Promise< + void + > { + await beforeEachTest( + TestClientType.PartitionedTopicWithSessions, + TestClientType.PartitionedSubscriptionWithSessions + ); + await purge(receiverClient, testSessionId2); + await testComplete_batching(); + }); + + it("Unpartitioned Queue: complete() removes message from random session", async function(): Promise< + void + > { + await beforeEachTest( + TestClientType.UnpartitionedQueueWithSessions, + TestClientType.UnpartitionedQueueWithSessions + ); + await purge(receiverClient, testSessionId2); + await testComplete_batching(); + }); + + it("Unpartitioned Subscription: complete() removes message from random session", async function(): Promise< + void + > { + await beforeEachTest( + TestClientType.UnpartitionedTopicWithSessions, + TestClientType.UnpartitionedSubscriptionWithSessions + ); + await purge(receiverClient, testSessionId2); + await testComplete_batching(); + }); +}); + describe("Session State", function(): void { afterEach(async () => { await afterEachTest(); diff --git a/sdk/servicebus/service-bus/test/streamingReceiver.spec.ts b/sdk/servicebus/service-bus/test/streamingReceiver.spec.ts index ce39b88d5a06..01938fb20671 100644 --- a/sdk/servicebus/service-bus/test/streamingReceiver.spec.ts +++ b/sdk/servicebus/service-bus/test/streamingReceiver.spec.ts @@ -703,7 +703,7 @@ describe("Streaming - Settle an already Settled message throws error", () => { const testError = (err: Error, operation: DispositionType) => { should.equal( err.message, - `Failed to ${operation} the message as this message has been already settled.`, + `Failed to ${operation} the message as this message is already settled.`, "ErrorMessage is different than expected" ); errorWasThrown = true; diff --git a/sdk/servicebus/service-bus/test/streamingReceiverSessions.spec.ts b/sdk/servicebus/service-bus/test/streamingReceiverSessions.spec.ts index e564391d9213..24e1cf56cbec 100644 --- a/sdk/servicebus/service-bus/test/streamingReceiverSessions.spec.ts +++ b/sdk/servicebus/service-bus/test/streamingReceiverSessions.spec.ts @@ -830,7 +830,7 @@ describe("Sessions Streaming - Settle an already Settled message throws error", const testError = (err: Error, operation: DispositionType) => { should.equal( err.message, - `Failed to ${operation} the message as this message has been already settled.`, + `Failed to ${operation} the message as this message is already settled.`, "ErrorMessage is different than expected" ); errorWasThrown = true; diff --git a/sdk/storage/README.md b/sdk/storage/README.md index 87a7ae522cd9..ddfb65d3976c 100644 --- a/sdk/storage/README.md +++ b/sdk/storage/README.md @@ -108,9 +108,9 @@ const Azure = require("@azure/storage-blob"); To use the SDK with JS bundle in the browsers, simply add a script tag to your HTML pages pointing to the downloaded JS bundle file(s): ```html - - - + + + ``` The JS bundled file is compatible with [UMD](https://github.com/umdjs/umd) standard, if no module system found, following global variable(s) will be exported: diff --git a/sdk/storage/storage-blob/.npmignore b/sdk/storage/storage-blob/.npmignore index af440bfdb888..8a5a07d9992e 100644 --- a/sdk/storage/storage-blob/.npmignore +++ b/sdk/storage/storage-blob/.npmignore @@ -1,6 +1,6 @@ # browser # -browser/azure-storage.blob.js -browser/azure-storage.blob.js.map +browser/azure-storage-blob.js +browser/azure-storage-blob.js.map # dist-test # dist-test/ diff --git a/sdk/storage/storage-blob/.nycrc b/sdk/storage/storage-blob/.nycrc index 8706e6800b07..d254584d89d6 100644 --- a/sdk/storage/storage-blob/.nycrc +++ b/sdk/storage/storage-blob/.nycrc @@ -1,6 +1,6 @@ { "include": [ - "src/**/*.ts" + "dist-test/index.node.js" ], "exclude": [ "**/*.d.ts", @@ -21,6 +21,7 @@ "html", "cobertura" ], + "exclude-after-remap":false, "sourceMap": true, "instrument": true, "all": true diff --git a/sdk/storage/storage-blob/.prettierignore b/sdk/storage/storage-blob/.prettierignore new file mode 100644 index 000000000000..3fd7f651ed5f --- /dev/null +++ b/sdk/storage/storage-blob/.prettierignore @@ -0,0 +1,2 @@ +src/generated/**/*.ts +package-lock.json diff --git a/sdk/storage/storage-blob/.prettierrc.json b/sdk/storage/storage-blob/.prettierrc.json deleted file mode 100644 index 1ca87ab7d8af..000000000000 --- a/sdk/storage/storage-blob/.prettierrc.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "singleQuote": false -} diff --git a/sdk/storage/storage-blob/README.md b/sdk/storage/storage-blob/README.md index 73fbabf9cd45..32fcc6792185 100644 --- a/sdk/storage/storage-blob/README.md +++ b/sdk/storage/storage-blob/README.md @@ -89,7 +89,7 @@ const Azure = require("@azure/storage-blob"); To use the SDK with JS bundle in the browsers, simply add a script tag to your HTML pages pointing to the downloaded JS bundle file(s): ```html - + ``` The JS bundled file is compatible with [UMD](https://github.com/umdjs/umd) standard, if no module system found, following global variable(s) will be exported: @@ -118,7 +118,7 @@ For example, you can create following CORS settings for debugging. But please cu The Azure Storage SDK for JavaScript provides low-level and high-level APIs. -- ServiceURL, ContainerURL and BlobURL objects provide the low-level API functionality and map one-to-one to the [Azure Storage Blob REST APIs](https://docs.microsoft.com/en-us/rest/api/storageservices/blob-service-rest-api). +- BlobServiceClient, ContainerClient and BlobClient objects provide the low-level API functionality and map one-to-one to the [Azure Storage Blob REST APIs](https://docs.microsoft.com/en-us/rest/api/storageservices/blob-service-rest-api). - The high-level APIs provide convenience abstractions such as uploading a large stream to a block blob (using multiple PutBlock requests). @@ -127,11 +127,11 @@ The Azure Storage SDK for JavaScript provides low-level and high-level APIs. ```javascript const { Aborter, - BlobURL, - BlockBlobURL, - ContainerURL, - ServiceURL, - StorageURL, + BlobClient, + BlobServiceClient, + BlockBlobClient, + ContainerClient, + StorageClient, SharedKeyCredential, AnonymousCredential, TokenCredential @@ -153,10 +153,10 @@ async function main() { const anonymousCredential = new AnonymousCredential(); // Use sharedKeyCredential, tokenCredential or anonymousCredential to create a pipeline - const pipeline = StorageURL.newPipeline(sharedKeyCredential); + const pipeline = StorageClient.newPipeline(sharedKeyCredential); // List containers - const serviceURL = new ServiceURL( + const blobServiceClient = new BlobServiceClient( // When using AnonymousCredential, following url should include a valid SAS or support public access `https://${account}.blob.core.windows.net`, pipeline @@ -164,8 +164,7 @@ async function main() { let marker; do { - const listContainersResponse = await serviceURL.listContainersSegment( - Aborter.none, + const listContainersResponse = await blobServiceClient.listContainersSegment( marker ); @@ -177,9 +176,9 @@ async function main() { // Create a container const containerName = `newcontainer${new Date().getTime()}`; - const containerURL = ContainerURL.fromServiceURL(serviceURL, containerName); + const containerClient = ContainerClient.fromBlobServiceClient(blobServiceClient, containerName); - const createContainerResponse = await containerURL.create(Aborter.none); + const createContainerResponse = await containerClient.create(); console.log( `Create container ${containerName} successfully`, createContainerResponse.requestId @@ -188,10 +187,9 @@ async function main() { // Create a blob const content = "hello"; const blobName = "newblob" + new Date().getTime(); - const blobURL = BlobURL.fromContainerURL(containerURL, blobName); - const blockBlobURL = BlockBlobURL.fromBlobURL(blobURL); - const uploadBlobResponse = await blockBlobURL.upload( - Aborter.none, + const blobClient = BlobClient.fromContainerClient(containerClient, blobName); + const blockBlobClient = BlockBlobClient.fromBlobClient(blobClient); + const uploadBlobResponse = await blockBlobClient.upload( content, content.length ); @@ -203,8 +201,7 @@ async function main() { // List blobs marker = undefined; do { - const listBlobsResponse = await containerURL.listBlobFlatSegment( - Aborter.none, + const listBlobsResponse = await containerClient.listBlobFlatSegment( marker ); @@ -217,14 +214,14 @@ async function main() { // Get blob content from position 0 to the end // In Node.js, get downloaded data by accessing downloadBlockBlobResponse.readableStreamBody // In browsers, get downloaded data by accessing downloadBlockBlobResponse.blobBody - const downloadBlockBlobResponse = await blobURL.download(Aborter.none, 0); + const downloadBlockBlobResponse = await blobClient.download(0); console.log( "Downloaded blob content", await streamToString(downloadBlockBlobResponse.readableStreamBody) ); // Delete container - await containerURL.delete(Aborter.none); + await containerClient.delete(); console.log("deleted container"); } @@ -233,7 +230,7 @@ async function main() { async function streamToString(readableStream) { return new Promise((resolve, reject) => { const chunks = []; - readableStream.on("data", data => { + readableStream.on("data", (data) => { chunks.push(data.toString()); }); readableStream.on("end", () => { @@ -248,7 +245,7 @@ main() .then(() => { console.log("Successfully executed sample."); }) - .catch(err => { + .catch((err) => { console.log(err.message); }); ``` diff --git a/sdk/storage/storage-blob/ci.yml b/sdk/storage/storage-blob/ci.yml new file mode 100644 index 000000000000..3802af657de2 --- /dev/null +++ b/sdk/storage/storage-blob/ci.yml @@ -0,0 +1,17 @@ +# DO NOT EDIT THIS FILE +# This file is generated automatically and any changes will be lost. + +trigger: none + +pr: + branches: + include: + - master + paths: + include: + - sdk/storage/storage-blob/ + +jobs: + - template: ../../../eng/pipelines/templates/jobs/archetype-sdk-client.yml + parameters: + PackageName: "@azure/storage-blob" diff --git a/sdk/storage/storage-blob/gulpfile.js b/sdk/storage/storage-blob/gulpfile.js index a99dc6ee1dbd..9acff5891a1c 100644 --- a/sdk/storage/storage-blob/gulpfile.js +++ b/sdk/storage/storage-blob/gulpfile.js @@ -4,11 +4,11 @@ const zip = require("gulp-zip"); const version = require("./package.json").version; const zipFileName = `azurestoragejs.blob-${version}.zip`; -gulp.task("zip", function(callback) { +gulp.task("zip", function (callback) { gulp .src([ - "browser/azure-storage.blob.js", - "browser/azure-storage.blob.min.js", + "browser/azure-storage-blob.min.js", + "browser/azure-storage-blob.js", "browser/*.txt" ]) .pipe(zip(zipFileName)) diff --git a/sdk/storage/storage-blob/karma.conf.js b/sdk/storage/storage-blob/karma.conf.js index bf041dcb0346..f7fbf475657f 100644 --- a/sdk/storage/storage-blob/karma.conf.js +++ b/sdk/storage/storage-blob/karma.conf.js @@ -1,6 +1,6 @@ // https://github.com/karma-runner/karma-chrome-launcher process.env.CHROME_BIN = require("puppeteer").executablePath(); -require("dotenv").config({path:"../.env"}); +require("dotenv").config({ path: "../.env" }); module.exports = function(config) { config.set({ @@ -65,7 +65,7 @@ module.exports = function(config) { // Exclude coverage calculation for following files remapOptions: { - exclude: /node_modules|tests/g + exclude: /node_modules|test/g }, junitReporter: { diff --git a/sdk/storage/storage-blob/package.json b/sdk/storage/storage-blob/package.json index 667b565f9824..f59e49e6771a 100644 --- a/sdk/storage/storage-blob/package.json +++ b/sdk/storage/storage-blob/package.json @@ -1,11 +1,11 @@ { "name": "@azure/storage-blob", - "version": "10.3.0", + "version": "11.0.0-preview.1", "description": "Microsoft Azure Storage SDK for JavaScript - Blob", "main": "./dist/index.js", "module": "./dist-esm/src/index.js", "browser": { - "./dist/index.js": "./browser/azure-storage.blob.min.js", + "./dist/index.js": "./browser/azure-storage-blob.min.js", "./dist-esm/src/index.js": "./dist-esm/src/index.browser.js", "./dist-esm/test/utils/index.js": "./dist-esm/test/utils/index.browser.js", "./dist-esm/src/BlobDownloadResponse.js": "./dist-esm/src/BlobDownloadResponse.browser.js", @@ -73,12 +73,12 @@ "build:nodebrowser": "rollup -c 2>&1", "build:test": "npm run build:es6 && rollup -c rollup.test.config.js 2>&1", "build": "npm run build:es6 && npm run build:nodebrowser && npm run build:browserzip", - "check-format": "prettier --list-different --config .prettierrc.json \"src/**/*.ts\" \"test/**/*.ts\" \"*.{js,json}\"", + "check-format": "prettier --list-different --config ../../.prettierrc.json \"src/**/*.ts\" \"test/**/*.ts\" \"*.{js,json}\"", "clean": "rimraf dist dist-esm dist-test typings temp browser/*.js* browser/*.zip statistics.html coverage coverage-browser .nyc_output *.tgz *.log test*.xml TEST*.xml", "extract-api": "tsc -p . && api-extractor run --local", - "format": "prettier --write --config .prettierrc.json \"src/**/*.ts\" \"test/**/*.ts\" \"*.{js,json}\"", + "format": "prettier --write --config ../../.prettierrc.json \"src/**/*.ts\" \"test/**/*.ts\" \"*.{js,json}\"", "integration-test:browser": "karma start --single-run", - "integration-test:node": "cross-env TS_NODE_COMPILER_OPTIONS=\"{\\\"module\\\": \\\"commonjs\\\"}\" nyc mocha --compilers ts-node/register --require source-map-support/register --reporter mocha-multi --reporter-options spec=-,mocha-junit-reporter=- --full-trace --no-timeouts test/*.test.ts test/node/*.test.ts", + "integration-test:node": "nyc mocha --require source-map-support/register --reporter mocha-multi --reporter-options spec=-,mocha-junit-reporter=- --full-trace -t 120000 dist-test/index.node.js", "integration-test": "npm run integration-test:node && npm run integration-test:browser", "lint:fix": "echo skipped", "lint": "echo skipped", diff --git a/sdk/storage/storage-blob/rollup.base.config.js b/sdk/storage/storage-blob/rollup.base.config.js new file mode 100644 index 000000000000..40ac9d9a7eef --- /dev/null +++ b/sdk/storage/storage-blob/rollup.base.config.js @@ -0,0 +1,136 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +import nodeResolve from "rollup-plugin-node-resolve"; +import multiEntry from "rollup-plugin-multi-entry"; +import cjs from "rollup-plugin-commonjs"; +import replace from "rollup-plugin-replace"; +import { uglify } from "rollup-plugin-uglify"; +import sourcemaps from "rollup-plugin-sourcemaps"; +import shim from "rollup-plugin-shim"; +// import visualizer from "rollup-plugin-visualizer"; + +const version = require("./package.json").version; +const banner = [ + "/*!", + ` * Azure Storage SDK for JavaScript - Blob, ${version}`, + " * Copyright (c) Microsoft and contributors. All rights reserved.", + " */" +].join("\n"); + +const pkg = require("./package.json"); +const depNames = Object.keys(pkg.dependencies); +const production = process.env.NODE_ENV === "production"; + +export function nodeConfig(test = false) { + const externalNodeBuiltins = ["@azure/ms-rest-js", "crypto", "fs", "events", "os", "stream"]; + const baseConfig = { + input: "dist-esm/src/index.js", + external: depNames.concat(externalNodeBuiltins), + output: { + file: "dist/index.js", + format: "cjs", + sourcemap: true + }, + preserveSymlinks: false, + plugins: [ + sourcemaps(), + replace({ + delimiters: ["", ""], + values: { + // replace dynamic checks with if (true) since this is for node only. + // Allows rollup's dead code elimination to be more aggressive. + "if (isNode)": "if (true)" + } + }), + nodeResolve({ preferBuiltins: true }), + cjs() + ] + }; + + if (test) { + // entry point is every test file + baseConfig.input = ["dist-esm/test/*.spec.js", "dist-esm/test/node/*.spec.js"]; + baseConfig.plugins.unshift(multiEntry({ exports: false })); + + // different output file + baseConfig.output.file = "dist-test/index.node.js"; + + // mark assert as external + baseConfig.external.push("assert", "fs", "path"); + + baseConfig.context = "null"; + } else if (production) { + baseConfig.plugins.push(uglify()); + } + + return baseConfig; +} + +export function browserConfig(test = false, production = false) { + const baseConfig = { + input: "dist-esm/src/index.browser.js", + external: ["ms-rest-js"], + output: { + file: "browser/azure-storage-blob.js", + banner: banner, + format: "umd", + name: "azblob", + sourcemap: true + }, + preserveSymlinks: false, + plugins: [ + sourcemaps(), + replace({ + delimiters: ["", ""], + values: { + // replace dynamic checks with if (false) since this is for + // browser only. Rollup's dead code elimination will remove + // any code guarded by if (isNode) { ... } + "if (isNode)": "if (false)" + } + }), + // os is not used by the browser bundle, so just shim it + shim({ + dotenv: `export function config() { }`, + os: ` + export const type = 1; + export const release = 1; + ` + }), + nodeResolve({ + mainFields: ["module", "browser"], + preferBuiltins: false + }), + cjs({ + namedExports: { + events: ["EventEmitter"], + assert: ["ok", "deepEqual", "equal", "fail", "deepStrictEqual", "notDeepEqual"] + } + }) + ] + }; + + if (test) { + baseConfig.input = ["dist-esm/test/*.spec.js", "dist-esm/test/browser/*.spec.js"]; + baseConfig.plugins.unshift(multiEntry({ exports: false })); + baseConfig.output.file = "dist-test/index.browser.js"; + baseConfig.context = "null"; + } else if (production) { + baseConfig.output.file = "browser/azure-storage-blob.min.js"; + baseConfig.plugins.push( + uglify({ + output: { + preamble: banner + } + }) + // Comment visualizer because it only works on Node.js 8+; Uncomment it to get bundle analysis report + // visualizer({ + // filename: "./statistics.html", + // sourcemap: true + // }) + ); + } + + return baseConfig; +} diff --git a/sdk/storage/storage-blob/rollup.config.js b/sdk/storage/storage-blob/rollup.config.js index 16b60c8e772c..6f119550d77a 100644 --- a/sdk/storage/storage-blob/rollup.config.js +++ b/sdk/storage/storage-blob/rollup.config.js @@ -1,102 +1,18 @@ -import nodeResolve from "rollup-plugin-node-resolve"; -import { uglify } from "rollup-plugin-uglify"; -import replace from "rollup-plugin-replace"; -import commonjs from "rollup-plugin-commonjs"; -import shim from "rollup-plugin-shim"; -// import visualizer from "rollup-plugin-visualizer"; +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. -const version = require("./package.json").version; -const banner = [ - "/*!", - ` * Azure Storage SDK for JavaScript - Blob, ${version}`, - " * Copyright (c) Microsoft and contributors. All rights reserved.", - " */" -].join("\n"); +import * as base from "./rollup.base.config"; -const nodeRollupConfigFactory = () => { - return { - external: ["@azure/ms-rest-js", "crypto", "fs", "events", "os", "stream"], - input: "dist-esm/src/index.js", - output: { - file: "dist/index.js", - format: "cjs", - sourcemap: true - }, - preserveSymlinks: false, - plugins: [nodeResolve(), uglify()] - }; -}; +const inputs = []; -const browserRollupConfigFactory = isProduction => { - const browserRollupConfig = { - input: "dist-esm/src/index.browser.js", - output: { - file: "browser/azure-storage.blob.js", - banner: banner, - format: "umd", - name: "azblob", - sourcemap: true - }, - preserveSymlinks: false, - plugins: [ - replace({ - delimiters: ["", ""], - values: { - // replace dynamic checks with if (false) since this is for - // browser only. Rollup's dead code elimination will remove - // any code guarded by if (isNode) { ... } - "if (isNode)": "if (false)" - } - }), - // os is not used by the browser bundle, so just shim it - shim({ - dotenv: `export function config() { }`, - os: ` - export const type = 1; - export const release = 1; - ` - }), - nodeResolve({ - mainFields: ['module', 'browser'], - preferBuiltins: false - }), - commonjs({ - namedExports: { - events: ["EventEmitter"], - assert: [ - "ok", - "deepEqual", - "equal", - "fail", - "deepStrictEqual", - "notDeepEqual" - ] - } - }) - ] - }; +if (!process.env.ONLY_BROWSER) { + inputs.push(base.nodeConfig()); +} - if (isProduction) { - browserRollupConfig.output.file = "browser/azure-storage.blob.min.js"; - browserRollupConfig.plugins.push( - uglify({ - output: { - preamble: banner - } - }) - // Comment visualizer because it only works on Node.js 8+; Uncomment it to get bundle analysis report - // visualizer({ - // filename: "./statistics.html", - // sourcemap: true - // }) - ); - } +// Disable this until we are ready to run rollup for the browser. +if (!process.env.ONLY_NODE) { + inputs.push(base.browserConfig()); + inputs.push(base.browserConfig(false, true)); +} - return browserRollupConfig; -}; - -export default [ - browserRollupConfigFactory(false), - browserRollupConfigFactory(true), - nodeRollupConfigFactory() -]; +export default inputs; diff --git a/sdk/storage/storage-blob/rollup.test.config.js b/sdk/storage/storage-blob/rollup.test.config.js index 24622435837c..ad98718cce46 100644 --- a/sdk/storage/storage-blob/rollup.test.config.js +++ b/sdk/storage/storage-blob/rollup.test.config.js @@ -1,13 +1,6 @@ -import multi from "rollup-plugin-multi-entry"; -import baseConfig from "./rollup.config"; -import sourcemaps from "rollup-plugin-sourcemaps"; -const [browser] = baseConfig; +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. -browser.input = ["dist-esm/test/*.js", "dist-esm/test/browser/*.js"]; -browser.output.sourcemap = "inline"; -browser.output.file = "dist-test/index.browser.js"; -browser.plugins.unshift(multi()); -browser.plugins.unshift(sourcemaps()); -browser.context = "null"; +import * as base from "./rollup.base.config"; -export default [browser]; +export default [base.nodeConfig(true), base.browserConfig(true)]; diff --git a/sdk/storage/storage-blob/samples/javascript/advanced.js b/sdk/storage/storage-blob/samples/javascript/advanced.js index a605271784f0..27db88e63c84 100644 --- a/sdk/storage/storage-blob/samples/javascript/advanced.js +++ b/sdk/storage/storage-blob/samples/javascript/advanced.js @@ -10,11 +10,11 @@ const { uploadFileToBlockBlob, uploadStreamToBlockBlob, Aborter, - BlobURL, - BlockBlobURL, - ContainerURL, - ServiceURL, - StorageURL + BlobClient, + BlobServiceClient, + BlockBlobClient, + ContainerClient, + StorageClient } = require("../.."); // Change to "@azure/storage-blob" in your package async function main() { @@ -23,31 +23,31 @@ async function main() { const accountSas = ""; const localFilePath = ""; - const pipeline = StorageURL.newPipeline(new AnonymousCredential(), { + const pipeline = StorageClient.newPipeline(new AnonymousCredential(), { // httpClient: MyHTTPClient, // A customized HTTP client implementing IHttpClient interface // logger: MyLogger, // A customized logger implementing IHttpPipelineLogger interface retryOptions: { maxTries: 4 }, // Retry options telemetry: { value: "HighLevelSample V1.0.0" } // Customized telemetry string }); - const serviceURL = new ServiceURL( + const blobServiceClient = new BlobServiceClient( `https://${account}.blob.core.windows.net${accountSas}`, pipeline ); // Create a container const containerName = `newcontainer${new Date().getTime()}`; - const containerURL = ContainerURL.fromServiceURL(serviceURL, containerName); - await containerURL.create(Aborter.none); + const containerClient = ContainerClient.fromBlobServiceClient(blobServiceClient, containerName); + await containerClient.create(); // Create a blob const blobName = "newblob" + new Date().getTime(); - const blobURL = BlobURL.fromContainerURL(containerURL, blobName); - const blockBlobURL = BlockBlobURL.fromBlobURL(blobURL); + const blobClient = BlobClient.fromContainerClient(containerClient, blobName); + const blockBlobClient = BlockBlobClient.fromBlobClient(blobClient); // Parallel uploading with uploadFileToBlockBlob in Node.js runtime // uploadFileToBlockBlob is only available in Node.js - await uploadFileToBlockBlob(Aborter.none, localFilePath, blockBlobURL, { + await uploadFileToBlockBlob(localFilePath, blockBlobClient, { blockSize: 4 * 1024 * 1024, // 4MB block size parallelism: 20, // 20 concurrency progress: ev => console.log(ev) @@ -57,12 +57,12 @@ async function main() { // Parallel uploading a Readable stream with uploadStreamToBlockBlob in Node.js runtime // uploadStreamToBlockBlob is only available in Node.js await uploadStreamToBlockBlob( - Aborter.timeout(30 * 60 * 1000), // Abort uploading with timeout in 30mins fs.createReadStream(localFilePath), - blockBlobURL, + blockBlobClient, 4 * 1024 * 1024, 20, { + abortSignal: Aborter.timeout(30 * 60 * 1000), // Abort uploading with timeout in 30mins progress: ev => console.log(ev) } ); @@ -72,7 +72,7 @@ async function main() { // Uncomment following code in browsers because uploadBrowserDataToBlockBlob is only available in browsers /* const browserFile = document.getElementById("fileinput").files[0]; - await uploadBrowserDataToBlockBlob(Aborter.none, browserFile, blockBlobURL, { + await uploadBrowserDataToBlockBlob(browserFile, blockBlobClient, { blockSize: 4 * 1024 * 1024, // 4MB block size parallelism: 20, // 20 concurrency progress: ev => console.log(ev) @@ -84,12 +84,12 @@ async function main() { const fileSize = fs.statSync(localFilePath).size; const buffer = Buffer.alloc(fileSize); await downloadBlobToBuffer( - Aborter.timeout(30 * 60 * 1000), buffer, - blockBlobURL, + blockBlobClient, 0, undefined, { + abortSignal: Aborter.timeout(30 * 60 * 1000), blockSize: 4 * 1024 * 1024, // 4MB block size parallelism: 20, // 20 concurrency progress: ev => console.log(ev) @@ -98,7 +98,7 @@ async function main() { console.log("downloadBlobToBuffer success"); // Delete container - await containerURL.delete(Aborter.none); + await containerClient.delete(); console.log("deleted container"); } diff --git a/sdk/storage/storage-blob/samples/javascript/basic.js b/sdk/storage/storage-blob/samples/javascript/basic.js index e753d2d0850d..00644bda81c1 100644 --- a/sdk/storage/storage-blob/samples/javascript/basic.js +++ b/sdk/storage/storage-blob/samples/javascript/basic.js @@ -4,11 +4,11 @@ const { Aborter, - BlobURL, - BlockBlobURL, - ContainerURL, - ServiceURL, - StorageURL, + BlobClient, + BlockBlobClient, + ContainerClient, + BlobServiceClient, + StorageClient, SharedKeyCredential, AnonymousCredential, TokenCredential @@ -30,10 +30,10 @@ async function main() { const anonymousCredential = new AnonymousCredential(); // Use sharedKeyCredential, tokenCredential or anonymousCredential to create a pipeline - const pipeline = StorageURL.newPipeline(sharedKeyCredential); + const pipeline = StorageClient.newPipeline(sharedKeyCredential); // List containers - const serviceURL = new ServiceURL( + const blobServiceClient = new BlobServiceClient( // When using AnonymousCredential, following url should include a valid SAS or support public access `https://${account}.blob.core.windows.net`, pipeline @@ -41,8 +41,7 @@ async function main() { let marker; do { - const listContainersResponse = await serviceURL.listContainersSegment( - Aborter.none, + const listContainersResponse = await blobServiceClient.listContainersSegment( marker ); @@ -54,9 +53,9 @@ async function main() { // Create a container const containerName = `newcontainer${new Date().getTime()}`; - const containerURL = ContainerURL.fromServiceURL(serviceURL, containerName); + const containerClient = ContainerClient.fromBlobServiceClient(blobServiceClient, containerName); - const createContainerResponse = await containerURL.create(Aborter.none); + const createContainerResponse = await containerClient.create(); console.log( `Create container ${containerName} successfully`, createContainerResponse.requestId @@ -65,10 +64,9 @@ async function main() { // Create a blob const content = "hello"; const blobName = "newblob" + new Date().getTime(); - const blobURL = BlobURL.fromContainerURL(containerURL, blobName); - const blockBlobURL = BlockBlobURL.fromBlobURL(blobURL); - const uploadBlobResponse = await blockBlobURL.upload( - Aborter.none, + const blobClient = BlobClient.fromContainerClient(containerClient, blobName); + const blockBlobClient = BlockBlobClient.fromBlobClient(blobClient); + const uploadBlobResponse = await blockBlobClient.upload( content, content.length ); @@ -80,8 +78,7 @@ async function main() { // List blobs marker = undefined; do { - const listBlobsResponse = await containerURL.listBlobFlatSegment( - Aborter.none, + const listBlobsResponse = await containerClient.listBlobFlatSegment( marker ); @@ -94,14 +91,14 @@ async function main() { // Get blob content from position 0 to the end // In Node.js, get downloaded data by accessing downloadBlockBlobResponse.readableStreamBody // In browsers, get downloaded data by accessing downloadBlockBlobResponse.blobBody - const downloadBlockBlobResponse = await blobURL.download(Aborter.none, 0); + const downloadBlockBlobResponse = await blobClient.download(0); console.log( "Downloaded blob content", await streamToString(downloadBlockBlobResponse.readableStreamBody) ); // Delete container - await containerURL.delete(Aborter.none); + await containerClient.delete(); console.log("deleted container"); } @@ -127,4 +124,4 @@ main() }) .catch(err => { console.log(err.message); - }); \ No newline at end of file + }); diff --git a/sdk/storage/storage-blob/samples/typescript/advanced.ts b/sdk/storage/storage-blob/samples/typescript/advanced.ts index c9081e0c5717..14992893f1c1 100644 --- a/sdk/storage/storage-blob/samples/typescript/advanced.ts +++ b/sdk/storage/storage-blob/samples/typescript/advanced.ts @@ -9,11 +9,11 @@ import { uploadFileToBlockBlob, uploadStreamToBlockBlob, Aborter, - BlobURL, - BlockBlobURL, - ContainerURL, - ServiceURL, - StorageURL + BlobClient, + BlockBlobClient, + ContainerClient, + BlobServiceClient, + StorageClient } from "../.."; // Change to "@azure/storage-blob" in your package async function main() { @@ -22,31 +22,31 @@ async function main() { const accountSas = ""; const localFilePath = ""; - const pipeline = StorageURL.newPipeline(new AnonymousCredential(), { + const pipeline = StorageClient.newPipeline(new AnonymousCredential(), { // httpClient: MyHTTPClient, // A customized HTTP client implementing IHttpClient interface // logger: MyLogger, // A customized logger implementing IHttpPipelineLogger interface retryOptions: { maxTries: 4 }, // Retry options telemetry: { value: "HighLevelSample V1.0.0" } // Customized telemetry string }); - const serviceURL = new ServiceURL( + const blobServiceClient = new BlobServiceClient( `https://${account}.blob.core.windows.net${accountSas}`, pipeline ); // Create a container const containerName = `newcontainer${new Date().getTime()}`; - const containerURL = ContainerURL.fromServiceURL(serviceURL, containerName); - await containerURL.create(Aborter.none); + const containerClient = ContainerClient.fromBlobServiceClient(blobServiceClient, containerName); + await containerClient.create(); // Create a blob const blobName = "newblob" + new Date().getTime(); - const blobURL = BlobURL.fromContainerURL(containerURL, blobName); - const blockBlobURL = BlockBlobURL.fromBlobURL(blobURL); + const blobClient = BlobClient.fromContainerClient(containerClient, blobName); + const blockBlobClient = BlockBlobClient.fromBlobClient(blobClient); // Parallel uploading with uploadFileToBlockBlob in Node.js runtime // uploadFileToBlockBlob is only available in Node.js - await uploadFileToBlockBlob(Aborter.none, localFilePath, blockBlobURL, { + await uploadFileToBlockBlob(localFilePath, blockBlobClient, { blockSize: 4 * 1024 * 1024, // 4MB block size parallelism: 20, // 20 concurrency progress: ev => console.log(ev) @@ -56,12 +56,12 @@ async function main() { // Parallel uploading a Readable stream with uploadStreamToBlockBlob in Node.js runtime // uploadStreamToBlockBlob is only available in Node.js await uploadStreamToBlockBlob( - Aborter.timeout(30 * 60 * 1000), // Abort uploading with timeout in 30mins fs.createReadStream(localFilePath), - blockBlobURL, + blockBlobClient, 4 * 1024 * 1024, 20, { + abortSignal: Aborter.timeout(30 * 60 * 1000), // Abort uploading with timeout in 30mins progress: ev => console.log(ev) } ); @@ -71,7 +71,7 @@ async function main() { // Uncomment following code in browsers because uploadBrowserDataToBlockBlob is only available in browsers /* const browserFile = document.getElementById("fileinput").files[0]; - await uploadBrowserDataToBlockBlob(Aborter.none, browserFile, blockBlobURL, { + await uploadBrowserDataToBlockBlob(browserFile, blockBlobClient, { blockSize: 4 * 1024 * 1024, // 4MB block size parallelism: 20, // 20 concurrency progress: ev => console.log(ev) @@ -83,12 +83,12 @@ async function main() { const fileSize = fs.statSync(localFilePath).size; const buffer = Buffer.alloc(fileSize); await downloadBlobToBuffer( - Aborter.timeout(30 * 60 * 1000), buffer, - blockBlobURL, + blockBlobClient, 0, undefined, { + abortSignal: Aborter.timeout(30 * 60 * 1000), // Abort uploading with timeout in 30mins blockSize: 4 * 1024 * 1024, // 4MB block size parallelism: 20, // 20 concurrency progress: ev => console.log(ev) @@ -97,7 +97,7 @@ async function main() { console.log("downloadBlobToBuffer success"); // Delete container - await containerURL.delete(Aborter.none); + await containerClient.delete(); console.log("deleted container"); } diff --git a/sdk/storage/storage-blob/samples/typescript/basic.ts b/sdk/storage/storage-blob/samples/typescript/basic.ts index 4ca2bb6ed06d..16ee771bb017 100644 --- a/sdk/storage/storage-blob/samples/typescript/basic.ts +++ b/sdk/storage/storage-blob/samples/typescript/basic.ts @@ -3,12 +3,11 @@ */ import { - Aborter, - BlobURL, - BlockBlobURL, - ContainerURL, - ServiceURL, - StorageURL, + BlobClient, + BlockBlobClient, + ContainerClient, + BlobServiceClient, + StorageClient, SharedKeyCredential, TokenCredential, Models @@ -30,10 +29,10 @@ async function main() { // const anonymousCredential = new AnonymousCredential(); // Use sharedKeyCredential, tokenCredential or anonymousCredential to create a pipeline - const pipeline = StorageURL.newPipeline(sharedKeyCredential); + const pipeline = StorageClient.newPipeline(sharedKeyCredential); // List containers - const serviceURL = new ServiceURL( + const blobServiceClient = new BlobServiceClient( // When using AnonymousCredential, following url should include a valid SAS or support public access `https://${account}.blob.core.windows.net`, pipeline @@ -41,8 +40,7 @@ async function main() { let marker; do { - const listContainersResponse: Models.ServiceListContainersSegmentResponse = await serviceURL.listContainersSegment( - Aborter.none, + const listContainersResponse: Models.ServiceListContainersSegmentResponse = await blobServiceClient.listContainersSegment( marker ); @@ -54,9 +52,9 @@ async function main() { // Create a container const containerName = `newcontainer${new Date().getTime()}`; - const containerURL = ContainerURL.fromServiceURL(serviceURL, containerName); + const containerClient = ContainerClient.fromBlobServiceClient(blobServiceClient, containerName); - const createContainerResponse = await containerURL.create(Aborter.none); + const createContainerResponse = await containerClient.create(); console.log( `Create container ${containerName} successfully`, createContainerResponse.requestId @@ -65,10 +63,9 @@ async function main() { // Create a blob const content = "hello"; const blobName = "newblob" + new Date().getTime(); - const blobURL = BlobURL.fromContainerURL(containerURL, blobName); - const blockBlobURL = BlockBlobURL.fromBlobURL(blobURL); - const uploadBlobResponse = await blockBlobURL.upload( - Aborter.none, + const blobClient = BlobClient.fromContainerClient(containerClient, blobName); + const blockBlobClient = BlockBlobClient.fromBlobClient(blobClient); + const uploadBlobResponse = await blockBlobClient.upload( content, content.length ); @@ -80,8 +77,7 @@ async function main() { // List blobs marker = undefined; do { - const listBlobsResponse: Models.ContainerListBlobFlatSegmentResponse = await containerURL.listBlobFlatSegment( - Aborter.none, + const listBlobsResponse: Models.ContainerListBlobFlatSegmentResponse = await containerClient.listBlobFlatSegment( marker ); @@ -94,8 +90,7 @@ async function main() { // Get blob content from position 0 to the end // In Node.js, get downloaded data by accessing downloadBlockBlobResponse.readableStreamBody // In browsers, get downloaded data by accessing downloadBlockBlobResponse.blobBody - const downloadBlockBlobResponse: Models.BlobDownloadResponse = await blobURL.download( - Aborter.none, + const downloadBlockBlobResponse: Models.BlobDownloadResponse = await blobClient.download( 0 ); console.log( @@ -104,7 +99,7 @@ async function main() { ); // Delete container - await containerURL.delete(Aborter.none); + await containerClient.delete(); console.log("deleted container"); } diff --git a/sdk/storage/storage-blob/src/Aborter.ts b/sdk/storage/storage-blob/src/Aborter.ts index 9dde05777cb1..c63aa76ccf68 100644 --- a/sdk/storage/storage-blob/src/Aborter.ts +++ b/sdk/storage/storage-blob/src/Aborter.ts @@ -17,18 +17,18 @@ import { AbortSignalLike, isNode } from "@azure/ms-rest-js"; * * @example * // Abort without timeout - * await blockBlobURL.upload(Aborter.none, buf, buf.length); + * await blockBlobClient.upload(buf, buf.length); * * @example * // Abort container create in 1000ms - * await blockBlobURL.upload(Aborter.timeout(1000), buf, buf.length); + * await blockBlobClient.upload(Aborter.timeout(1000), buf, buf.length); * * @example * // Share aborter cross multiple operations in 30s * // Upload the same data to 2 different data centers at the same time, abort another when any of them is finished * const aborter = Aborter.timeout(30 * 1000); - * blockBlobURL1.upload(aborter, buf, buf.length).then(aborter.abort); - * blockBlobURL2.upload(aborter, buf, buf.length).then(aborter.abort); + * blockBlobClient1.upload(aborter, buf, buf.length).then(aborter.abort); + * blockBlobClient2.upload(aborter, buf, buf.length).then(aborter.abort); * * @example * // Cascaded aborting @@ -36,8 +36,8 @@ import { AbortSignalLike, isNode } from "@azure/ms-rest-js"; * const aborter = Aborter.timeout(30 * 1000); * * // Following 2 operations can't take more than 25 seconds - * await blockBlobURL.upload(aborter.withTimeout(25 * 1000), buf, buf.length); - * await blockBlobURL.upload(aborter.withTimeout(25 * 1000), buf, buf.length); + * await blockBlobClient.upload(aborter.withTimeout(25 * 1000), buf, buf.length); + * await blockBlobClient.upload(aborter.withTimeout(25 * 1000), buf, buf.length); * * @export * @class Aborter @@ -86,16 +86,14 @@ export class Aborter implements AbortSignalLike { * * @memberof Aborter */ - public onabort?: ((ev?: Event) => any); + public onabort?: (ev?: Event) => any; // tslint:disable-next-line:variable-name private _aborted: boolean = false; private timer?: any; private readonly parent?: Aborter; private readonly children: Aborter[] = []; // When child object calls dispose(), remove child from here - private readonly abortEventListeners: Array< - (this: AbortSignalLike, ev?: any) => any - > = []; + private readonly abortEventListeners: Array<(this: AbortSignalLike, ev?: any) => any> = []; // Pipeline proxies need to use "abortSignal as Aborter" in order to access non AbortSignalLike methods // immutable primitive types private readonly key?: string; @@ -167,10 +165,7 @@ export class Aborter implements AbortSignalLike { * @returns {Aborter} * @memberof Aborter */ - public withValue( - key: string, - value?: string | number | boolean | null - ): Aborter { + public withValue(key: string, value?: string | number | boolean | null): Aborter { const childCancelContext = new Aborter(this, 0, key, value); this.children.push(childCancelContext); return childCancelContext; @@ -187,11 +182,7 @@ export class Aborter implements AbortSignalLike { * @memberof Aborter */ public getValue(key: string): string | number | boolean | null | undefined { - for ( - let parent: Aborter | undefined = this; - parent; - parent = parent.parent - ) { + for (let parent: Aborter | undefined = this; parent; parent = parent.parent) { if (parent.key === key) { return parent.value; } @@ -219,11 +210,11 @@ export class Aborter implements AbortSignalLike { this.onabort.call(this); } - this.abortEventListeners.forEach(listener => { + this.abortEventListeners.forEach((listener) => { listener.call(this); }); - this.children.forEach(child => child.cancelByParent()); + this.children.forEach((child) => child.cancelByParent()); this._aborted = true; } diff --git a/sdk/storage/storage-blob/src/AccountSASPermissions.ts b/sdk/storage/storage-blob/src/AccountSASPermissions.ts index 88e83f5ee864..f7ec597d2ac9 100644 --- a/sdk/storage/storage-blob/src/AccountSASPermissions.ts +++ b/sdk/storage/storage-blob/src/AccountSASPermissions.ts @@ -7,7 +7,7 @@ * This is a helper class to construct a string representing the permissions granted by an AccountSAS. Setting a value * to true means that any SAS which uses these permissions will grant permissions for that operation. Once all the * values are set, this should be serialized with toString and set as the permissions field on an - * {@link IAccountSASSignatureValues} object. It is possible to construct the permissions string without this class, but + * {@link AccountSASSignatureValues} object. It is possible to construct the permissions string without this class, but * the order of the permissions is particular and this class guarantees correctness. * * @export @@ -125,7 +125,7 @@ export class AccountSASPermissions { /** * Produces the SAS permissions string for an Azure Storage account. - * Call this method to set IAccountSASSignatureValues Permissions field. + * Call this method to set AccountSASSignatureValues Permissions field. * * Using this method will guarantee the resource types are in * an order accepted by the service. diff --git a/sdk/storage/storage-blob/src/AccountSASResourceTypes.ts b/sdk/storage/storage-blob/src/AccountSASResourceTypes.ts index 0954cb9aa639..12b4988871fd 100644 --- a/sdk/storage/storage-blob/src/AccountSASResourceTypes.ts +++ b/sdk/storage/storage-blob/src/AccountSASResourceTypes.ts @@ -7,7 +7,7 @@ * This is a helper class to construct a string representing the resources accessible by an AccountSAS. Setting a value * to true means that any SAS which uses these permissions will grant access to that resource type. Once all the * values are set, this should be serialized with toString and set as the resources field on an - * {@link IAccountSASSignatureValues} object. It is possible to construct the resources string without this class, but + * {@link AccountSASSignatureValues} object. It is possible to construct the resources string without this class, but * the order of the resources is particular and this class guarantees correctness. * * @export diff --git a/sdk/storage/storage-blob/src/AccountSASServices.ts b/sdk/storage/storage-blob/src/AccountSASServices.ts index 82c6c5affe17..7a6c99f27c59 100644 --- a/sdk/storage/storage-blob/src/AccountSASServices.ts +++ b/sdk/storage/storage-blob/src/AccountSASServices.ts @@ -7,7 +7,7 @@ * This is a helper class to construct a string representing the services accessible by an AccountSAS. Setting a value * to true means that any SAS which uses these permissions will grant access to that service. Once all the * values are set, this should be serialized with toString and set as the services field on an - * {@link IAccountSASSignatureValues} object. It is possible to construct the services string without this class, but + * {@link AccountSASSignatureValues} object. It is possible to construct the services string without this class, but * the order of the services is particular and this class guarantees correctness. * * @export diff --git a/sdk/storage/storage-blob/src/IAccountSASSignatureValues.ts b/sdk/storage/storage-blob/src/AccountSASSignatureValues.ts similarity index 79% rename from sdk/storage/storage-blob/src/IAccountSASSignatureValues.ts rename to sdk/storage/storage-blob/src/AccountSASSignatureValues.ts index a672547932ce..a4d0b4b61320 100644 --- a/sdk/storage/storage-blob/src/IAccountSASSignatureValues.ts +++ b/sdk/storage/storage-blob/src/AccountSASSignatureValues.ts @@ -5,7 +5,7 @@ import { AccountSASPermissions } from "./AccountSASPermissions"; import { AccountSASResourceTypes } from "./AccountSASResourceTypes"; import { AccountSASServices } from "./AccountSASServices"; import { SharedKeyCredential } from "./credentials/SharedKeyCredential"; -import { IIPRange, ipRangeToString } from "./IIPRange"; +import { IPRange, ipRangeToString } from "./IPRange"; import { SASProtocol, SASQueryParameters } from "./SASQueryParameters"; import { SERVICE_VERSION } from "./utils/constants"; import { truncatedISO8061Date } from "./utils/utils.common"; @@ -13,7 +13,7 @@ import { truncatedISO8061Date } from "./utils/utils.common"; /** * ONLY AVAILABLE IN NODE.JS RUNTIME. * - * IAccountSASSignatureValues is used to generate a Shared Access Signature (SAS) for an Azure Storage account. Once + * AccountSASSignatureValues is used to generate a Shared Access Signature (SAS) for an Azure Storage account. Once * all the values here are set appropriately, call generateSASQueryParameters() to obtain a representation of the SAS * which can actually be applied to blob urls. Note: that both this class and {@link SASQueryParameters} exist because * the former is mutable and a logical representation while the latter is immutable and used to generate actual REST @@ -26,14 +26,14 @@ import { truncatedISO8061Date } from "./utils/utils.common"; * for descriptions of the parameters, including which are required * * @export - * @class IAccountSASSignatureValues + * @class AccountSASSignatureValues */ -export interface IAccountSASSignatureValues { +export interface AccountSASSignatureValues { /** * If not provided, this defaults to the service version targeted by this version of the library. * * @type {string} - * @memberof IAccountSASSignatureValues + * @memberof AccountSASSignatureValues */ version?: string; @@ -41,7 +41,7 @@ export interface IAccountSASSignatureValues { * Optional. SAS protocols allowed. * * @type {SASProtocol} - * @memberof IAccountSASSignatureValues + * @memberof AccountSASSignatureValues */ protocol?: SASProtocol; @@ -49,7 +49,7 @@ export interface IAccountSASSignatureValues { * Optional. When the SAS will take effect. * * @type {Date} - * @memberof IAccountSASSignatureValues + * @memberof AccountSASSignatureValues */ startTime?: Date; @@ -57,7 +57,7 @@ export interface IAccountSASSignatureValues { * The time after which the SAS will no longer work. * * @type {Date} - * @memberof IAccountSASSignatureValues + * @memberof AccountSASSignatureValues */ expiryTime: Date; @@ -66,24 +66,24 @@ export interface IAccountSASSignatureValues { * constructing the permissions string. * * @type {string} - * @memberof IAccountSASSignatureValues + * @memberof AccountSASSignatureValues */ permissions: string; /** * Optional. IP range allowed. * - * @type {IIPRange} - * @memberof IAccountSASSignatureValues + * @type {IPRange} + * @memberof AccountSASSignatureValues */ - ipRange?: IIPRange; + ipRange?: IPRange; /** * The values that indicate the services accessible with this SAS. Please refer to {@link AccountSASServices} to * construct this value. * * @type {string} - * @memberof IAccountSASSignatureValues + * @memberof AccountSASSignatureValues */ services: string; @@ -92,7 +92,7 @@ export interface IAccountSASSignatureValues { * to {@link AccountSASResourceTypes} to construct this value. * * @type {string} - * @memberof IAccountSASSignatureValues + * @memberof AccountSASSignatureValues */ resourceTypes: string; } @@ -107,10 +107,10 @@ export interface IAccountSASSignatureValues { * * @param {SharedKeyCredential} sharedKeyCredential * @returns {SASQueryParameters} - * @memberof IAccountSASSignatureValues + * @memberof AccountSASSignatureValues */ export function generateAccountSASQueryParameters( - accountSASSignatureValues: IAccountSASSignatureValues, + accountSASSignatureValues: AccountSASSignatureValues, sharedKeyCredential: SharedKeyCredential ): SASQueryParameters { const version = accountSASSignatureValues.version @@ -120,9 +120,7 @@ export function generateAccountSASQueryParameters( const parsedPermissions = AccountSASPermissions.parse( accountSASSignatureValues.permissions ).toString(); - const parsedServices = AccountSASServices.parse( - accountSASSignatureValues.services - ).toString(); + const parsedServices = AccountSASServices.parse(accountSASSignatureValues.services).toString(); const parsedResourceTypes = AccountSASResourceTypes.parse( accountSASSignatureValues.resourceTypes ).toString(); @@ -136,12 +134,8 @@ export function generateAccountSASQueryParameters( ? truncatedISO8061Date(accountSASSignatureValues.startTime, false) : "", truncatedISO8061Date(accountSASSignatureValues.expiryTime, false), - accountSASSignatureValues.ipRange - ? ipRangeToString(accountSASSignatureValues.ipRange) - : "", - accountSASSignatureValues.protocol - ? accountSASSignatureValues.protocol - : "", + accountSASSignatureValues.ipRange ? ipRangeToString(accountSASSignatureValues.ipRange) : "", + accountSASSignatureValues.protocol ? accountSASSignatureValues.protocol : "", version, "" // Account SAS requires an additional newline character ].join("\n"); diff --git a/sdk/storage/storage-blob/src/AppendBlobURL.ts b/sdk/storage/storage-blob/src/AppendBlobClient.ts similarity index 57% rename from sdk/storage/storage-blob/src/AppendBlobURL.ts rename to sdk/storage/storage-blob/src/AppendBlobClient.ts index c908ad3dddc9..05db48865484 100644 --- a/sdk/storage/storage-blob/src/AppendBlobURL.ts +++ b/sdk/storage/storage-blob/src/AppendBlobClient.ts @@ -3,69 +3,67 @@ import { HttpRequestBody, TransferProgressEvent } from "@azure/ms-rest-js"; -import * as Models from "../src/generated/lib/models"; +import * as Models from "./generated/lib/models"; import { Aborter } from "./Aborter"; -import { BlobURL } from "./BlobURL"; -import { ContainerURL } from "./ContainerURL"; +import { BlobClient } from "./BlobClient"; +import { ContainerClient } from "./ContainerClient"; import { AppendBlob } from "./generated/lib/operations"; -import { - IAppendBlobAccessConditions, - IBlobAccessConditions, - IMetadata -} from "./models"; +import { AppendBlobAccessConditions, BlobAccessConditions, Metadata } from "./models"; import { Pipeline } from "./Pipeline"; import { URLConstants } from "./utils/constants"; import { appendToURLPath, setURLParameter } from "./utils/utils.common"; -export interface IAppendBlobCreateOptions { - accessConditions?: IBlobAccessConditions; +export interface AppendBlobCreateOptions { + abortSignal?: Aborter; + accessConditions?: BlobAccessConditions; blobHTTPHeaders?: Models.BlobHTTPHeaders; - metadata?: IMetadata; + metadata?: Metadata; } -export interface IAppendBlobAppendBlockOptions { - accessConditions?: IAppendBlobAccessConditions; +export interface AppendBlobAppendBlockOptions { + abortSignal?: Aborter; + accessConditions?: AppendBlobAccessConditions; progress?: (progress: TransferProgressEvent) => void; transactionalContentMD5?: Uint8Array; } /** - * AppendBlobURL defines a set of operations applicable to append blobs. + * AppendBlobClient defines a set of operations applicable to append blobs. * * @export - * @class AppendBlobURL - * @extends {StorageURL} + * @class AppendBlobClient + * @extends {StorageClient} */ -export class AppendBlobURL extends BlobURL { +export class AppendBlobClient extends BlobClient { /** - * Creates a AppendBlobURL object from ContainerURL instance. + * Creates a AppendBlobClient object from ContainerClient instance. * * @static - * @param {ContainerURL} containerURL A ContainerURL object + * @param {ContainerClient} containerClient A ContainerClient object * @param {string} blobName An append blob name - * @returns {AppendBlobURL} - * @memberof AppendBlobURL + * @returns {AppendBlobClient} + * @memberof AppendBlobClient */ - public static fromContainerURL( - containerURL: ContainerURL, + public static fromContainerClient( + containerClient: ContainerClient, blobName: string - ): AppendBlobURL { - return new AppendBlobURL( - appendToURLPath(containerURL.url, encodeURIComponent(blobName)), - containerURL.pipeline + ): AppendBlobClient { + return new AppendBlobClient( + appendToURLPath(containerClient.url, encodeURIComponent(blobName)), + containerClient.pipeline ); } /** - * Creates a AppendBlobURL object from BlobURL instance. + * Creates a AppendBlobClient object from BlobClient instance. * * @static - * @param {BlobURL} blobURL - * @returns {AppendBlobURL} - * @memberof AppendBlobURL + * @param {BlobClient} blobClient + * @returns {AppendBlobClient} + * @memberof AppendBlobClient */ - public static fromBlobURL(blobURL: BlobURL): AppendBlobURL { - return new AppendBlobURL(blobURL.url, blobURL.pipeline); + public static fromBlobClient(blobClient: BlobClient): AppendBlobClient { + return new AppendBlobClient(blobClient.url, blobClient.pipeline); } /** @@ -73,12 +71,12 @@ export class AppendBlobURL extends BlobURL { * * @private * @type {AppendBlobs} - * @memberof AppendBlobURL + * @memberof AppendBlobClient */ private appendBlobContext: AppendBlob; /** - * Creates an instance of AppendBlobURL. + * Creates an instance of AppendBlobClient. * This method accepts an encoded URL or non-encoded URL pointing to an append blob. * Encoded URL string will NOT be escaped twice, only special characters in URL path will be escaped. * If a blob name includes ? or %, blob name must be encoded in the URL. @@ -91,9 +89,9 @@ export class AppendBlobURL extends BlobURL { * Encoded URL string will NOT be escaped twice, only special characters in URL path will be escaped. * However, if a blob name includes ? or %, blob name must be encoded in the URL. * Such as a blob named "my?blob%", the URL should be "https://myaccount.blob.core.windows.net/mycontainer/my%3Fblob%25". - * @param {Pipeline} pipeline Call StorageURL.newPipeline() to create a default + * @param {Pipeline} pipeline Call StorageClient.newPipeline() to create a default * pipeline, or provide a customized pipeline. - * @memberof AppendBlobURL + * @memberof AppendBlobClient */ constructor(url: string, pipeline: Pipeline) { super(url, pipeline); @@ -101,28 +99,28 @@ export class AppendBlobURL extends BlobURL { } /** - * Creates a new AppendBlobURL object identical to the source but with the + * Creates a new AppendBlobClient object identical to the source but with the * specified request policy pipeline. * * @param {Pipeline} pipeline - * @returns {AppendBlobURL} - * @memberof AppendBlobURL + * @returns {AppendBlobClient} + * @memberof AppendBlobClient */ - public withPipeline(pipeline: Pipeline): AppendBlobURL { - return new AppendBlobURL(this.url, pipeline); + public withPipeline(pipeline: Pipeline): AppendBlobClient { + return new AppendBlobClient(this.url, pipeline); } /** - * Creates a new AppendBlobURL object identical to the source but with the + * Creates a new AppendBlobClient object identical to the source but with the * specified snapshot timestamp. - * Provide "" will remove the snapshot and return a URL to the base blob. + * Provide "" will remove the snapshot and return a Client to the base blob. * * @param {string} snapshot - * @returns {AppendBlobURL} - * @memberof AppendBlobURL + * @returns {AppendBlobClient} + * @memberof AppendBlobClient */ - public withSnapshot(snapshot: string): AppendBlobURL { - return new AppendBlobURL( + public withSnapshot(snapshot: string): AppendBlobClient { + return new AppendBlobClient( setURLParameter( this.url, URLConstants.Parameters.SNAPSHOT, @@ -136,24 +134,21 @@ export class AppendBlobURL extends BlobURL { * Creates a 0-length append blob. Call AppendBlock to append data to an append blob. * @see https://docs.microsoft.com/rest/api/storageservices/put-blob * - * @param {Aborter} aborter Create a new Aborter instance with Aborter.none or Aborter.timeout(), - * goto documents of Aborter for more examples about request cancellation - * @param {IAppendBlobCreateOptions} [options] + * @param {AppendBlobCreateOptions} [options] * @returns {Promise} - * @memberof AppendBlobURL + * @memberof AppendBlobClient */ public async create( - aborter: Aborter, - options: IAppendBlobCreateOptions = {} + options: AppendBlobCreateOptions = {} ): Promise { + const aborter = options.abortSignal || Aborter.none; options.accessConditions = options.accessConditions || {}; return this.appendBlobContext.create(0, { abortSignal: aborter, blobHTTPHeaders: options.blobHTTPHeaders, leaseAccessConditions: options.accessConditions.leaseAccessConditions, metadata: options.metadata, - modifiedAccessConditions: - options.accessConditions.modifiedAccessConditions + modifiedAccessConditions: options.accessConditions.modifiedAccessConditions }); } @@ -161,28 +156,24 @@ export class AppendBlobURL extends BlobURL { * Commits a new block of data to the end of the existing append blob. * @see https://docs.microsoft.com/rest/api/storageservices/append-block * - * @param {Aborter} aborter Create a new Aborter instance with Aborter.none or Aborter.timeout(), - * goto documents of Aborter for more examples about request cancellation * @param {HttpRequestBody} body * @param {number} contentLength - * @param {IAppendBlobAppendBlockOptions} [options] + * @param {AppendBlobAppendBlockOptions} [options] * @returns {Promise} - * @memberof AppendBlobURL + * @memberof AppendBlobClient */ public async appendBlock( - aborter: Aborter, body: HttpRequestBody, contentLength: number, - options: IAppendBlobAppendBlockOptions = {} + options: AppendBlobAppendBlockOptions = {} ): Promise { + const aborter = options.abortSignal || Aborter.none; options.accessConditions = options.accessConditions || {}; return this.appendBlobContext.appendBlock(body, contentLength, { abortSignal: aborter, - appendPositionAccessConditions: - options.accessConditions.appendPositionAccessConditions, + appendPositionAccessConditions: options.accessConditions.appendPositionAccessConditions, leaseAccessConditions: options.accessConditions.leaseAccessConditions, - modifiedAccessConditions: - options.accessConditions.modifiedAccessConditions, + modifiedAccessConditions: options.accessConditions.modifiedAccessConditions, onUploadProgress: options.progress, transactionalContentMD5: options.transactionalContentMD5 }); diff --git a/sdk/storage/storage-blob/src/BlobURL.ts b/sdk/storage/storage-blob/src/BlobClient.ts similarity index 63% rename from sdk/storage/storage-blob/src/BlobURL.ts rename to sdk/storage/storage-blob/src/BlobClient.ts index 1b53f0bfcb15..079b6d997d4a 100644 --- a/sdk/storage/storage-blob/src/BlobURL.ts +++ b/sdk/storage/storage-blob/src/BlobClient.ts @@ -3,25 +3,23 @@ import { isNode, TransferProgressEvent } from "@azure/ms-rest-js"; -import * as Models from "../src/generated/lib/models"; +import * as Models from "./generated/lib/models"; import { Aborter } from "./Aborter"; import { BlobDownloadResponse } from "./BlobDownloadResponse"; -import { ContainerURL } from "./ContainerURL"; +import { ContainerClient } from "./ContainerClient"; import { Blob } from "./generated/lib/operations"; -import { rangeToString } from "./IRange"; -import { IBlobAccessConditions, IMetadata } from "./models"; +import { rangeToString } from "./Range"; +import { BlobAccessConditions, Metadata } from "./models"; import { Pipeline } from "./Pipeline"; -import { StorageURL } from "./StorageURL"; -import { - DEFAULT_MAX_DOWNLOAD_RETRY_REQUESTS, - URLConstants -} from "./utils/constants"; +import { StorageClient } from "./StorageClient"; +import { DEFAULT_MAX_DOWNLOAD_RETRY_REQUESTS, URLConstants } from "./utils/constants"; import { appendToURLPath, setURLParameter } from "./utils/utils.common"; -export interface IBlobDownloadOptions { +export interface BlobDownloadOptions { + abortSignal?: Aborter; snapshot?: string; rangeGetContentMD5?: boolean; - blobAccessConditions?: IBlobAccessConditions; + blobAccessConditions?: BlobAccessConditions; progress?: (progress: TransferProgressEvent) => void; /** @@ -31,95 +29,112 @@ export interface IBlobDownloadOptions { * Above kind of ends will not trigger retry policy defined in a pipeline, * because they doesn't emit network errors. * - * With this option, every additional retry means an additional FileURL.download() request will be made + * With this option, every additional retry means an additional FileClient.download() request will be made * from the broken point, until the requested range has been successfully downloaded or maxRetryRequests is reached. * * Default value is 5, please set a larger value when loading large files in poor network. * * @type {number} - * @memberof IBlobDownloadOptions + * @memberof BlobDownloadOptions */ maxRetryRequests?: number; } -export interface IBlobGetPropertiesOptions { - blobAccessConditions?: IBlobAccessConditions; +export interface BlobGetPropertiesOptions { + abortSignal?: Aborter; + blobAccessConditions?: BlobAccessConditions; } -export interface IBlobDeleteOptions { - blobAccessConditions?: IBlobAccessConditions; +export interface BlobDeleteOptions { + abortSignal?: Aborter; + blobAccessConditions?: BlobAccessConditions; deleteSnapshots?: Models.DeleteSnapshotsOptionType; } -export interface IBlobSetHTTPHeadersOptions { - blobAccessConditions?: IBlobAccessConditions; +export interface BlobUndeleteOptions { + abortSignal?: Aborter; } -export interface IBlobSetMetadataOptions { - blobAccessConditions?: IBlobAccessConditions; +export interface BlobSetHTTPHeadersOptions { + abortSignal?: Aborter; + blobAccessConditions?: BlobAccessConditions; } -export interface IBlobAcquireLeaseOptions { +export interface BlobSetMetadataOptions { + abortSignal?: Aborter; + blobAccessConditions?: BlobAccessConditions; +} + +export interface BlobAcquireLeaseOptions { + abortSignal?: Aborter; modifiedAccessConditions?: Models.ModifiedAccessConditions; } -export interface IBlobReleaseLeaseOptions { +export interface BlobReleaseLeaseOptions { + abortSignal?: Aborter; modifiedAccessConditions?: Models.ModifiedAccessConditions; } -export interface IBlobRenewLeaseOptions { +export interface BlobRenewLeaseOptions { + abortSignal?: Aborter; modifiedAccessConditions?: Models.ModifiedAccessConditions; } -export interface IBlobChangeLeaseOptions { +export interface BlobChangeLeaseOptions { + abortSignal?: Aborter; modifiedAccessConditions?: Models.ModifiedAccessConditions; } -export interface IBlobBreakLeaseOptions { +export interface BlobBreakLeaseOptions { + abortSignal?: Aborter; modifiedAccessConditions?: Models.ModifiedAccessConditions; } -export interface IBlobCreateSnapshotOptions { - metadata?: IMetadata; - blobAccessConditions?: IBlobAccessConditions; +export interface BlobCreateSnapshotOptions { + abortSignal?: Aborter; + metadata?: Metadata; + blobAccessConditions?: BlobAccessConditions; } -export interface IBlobStartCopyFromURLOptions { - metadata?: IMetadata; - blobAccessConditions?: IBlobAccessConditions; +export interface BlobStartCopyFromURLOptions { + abortSignal?: Aborter; + metadata?: Metadata; + blobAccessConditions?: BlobAccessConditions; sourceModifiedAccessConditions?: Models.ModifiedAccessConditions; } -export interface IBlobAbortCopyFromURLOptions { +export interface BlobAbortCopyFromURLOptions { + abortSignal?: Aborter; leaseAccessConditions?: Models.LeaseAccessConditions; } -export interface IBlobSetTierOptions { +export interface BlobSetTierOptions { + abortSignal?: Aborter; leaseAccessConditions?: Models.LeaseAccessConditions; } /** - * A BlobURL represents a URL to an Azure Storage blob; the blob may be a block blob, + * A BlobClient represents a URL to an Azure Storage blob; the blob may be a block blob, * append blob, or page blob. * * @export - * @class BlobURL - * @extends {StorageURL} + * @class BlobClient + * @extends {StorageClient} */ -export class BlobURL extends StorageURL { +export class BlobClient extends StorageClient { /** - * Creates a BlobURL object from an ContainerURL object. + * Creates a BlobClient object from an ContainerClient object. * * @static - * @param {ContainerURL} containerURL A ContainerURL object + * @param {ContainerClient} containerClient A ContainerClient object * @param {string} blobName A blob name * @returns - * @memberof BlobURL + * @memberof BlobClient */ - public static fromContainerURL(containerURL: ContainerURL, blobName: string) { - return new BlobURL( - appendToURLPath(containerURL.url, encodeURIComponent(blobName)), - containerURL.pipeline + public static fromContainerClient(containerClient: ContainerClient, blobName: string) { + return new BlobClient( + appendToURLPath(containerClient.url, encodeURIComponent(blobName)), + containerClient.pipeline ); } @@ -128,12 +143,12 @@ export class BlobURL extends StorageURL { * * @private * @type {Blobs} - * @memberof BlobURL + * @memberof BlobClient */ private blobContext: Blob; /** - * Creates an instance of BlobURL. + * Creates an instance of BlobClient. * This method accepts an encoded URL or non-encoded URL pointing to a blob. * Encoded URL string will NOT be escaped twice, only special characters in URL path will be escaped. * If a blob name includes ? or %, blob name must be encoded in the URL. @@ -146,9 +161,9 @@ export class BlobURL extends StorageURL { * Encoded URL string will NOT be escaped twice, only special characters in URL path will be escaped. * However, if a blob name includes ? or %, blob name must be encoded in the URL. * Such as a blob named "my?blob%", the URL should be "https://myaccount.blob.core.windows.net/mycontainer/my%3Fblob%25". - * @param {Pipeline} pipeline Call StorageURL.newPipeline() to create a default + * @param {Pipeline} pipeline Call StorageClient.newPipeline() to create a default * pipeline, or provide a customized pipeline. - * @memberof BlobURL + * @memberof BlobClient */ constructor(url: string, pipeline: Pipeline) { super(url, pipeline); @@ -156,27 +171,27 @@ export class BlobURL extends StorageURL { } /** - * Creates a new BlobURL object identical to the source but with the + * Creates a new BlobClient object identical to the source but with the * specified request policy pipeline. * * @param {Pipeline} pipeline - * @returns {BlobURL} - * @memberof BlobURL + * @returns {BlobClient} + * @memberof BlobClient */ - public withPipeline(pipeline: Pipeline): BlobURL { - return new BlobURL(this.url, pipeline); + public withPipeline(pipeline: Pipeline): BlobClient { + return new BlobClient(this.url, pipeline); } /** - * Creates a new BlobURL object identical to the source but with the specified snapshot timestamp. - * Provide "" will remove the snapshot and return a URL to the base blob. + * Creates a new BlobClient object identical to the source but with the specified snapshot timestamp. + * Provide "" will remove the snapshot and return a Client to the base blob. * * @param {string} snapshot - * @returns {BlobURL} A new BlobURL object identical to the source but with the specified snapshot timestamp - * @memberof BlobURL + * @returns {BlobClient} A new BlobClient object identical to the source but with the specified snapshot timestamp + * @memberof BlobClient */ - public withSnapshot(snapshot: string): BlobURL { - return new BlobURL( + public withSnapshot(snapshot: string): BlobClient { + return new BlobClient( setURLParameter( this.url, URLConstants.Parameters.SNAPSHOT, @@ -195,20 +210,18 @@ export class BlobURL extends StorageURL { * * @see https://docs.microsoft.com/en-us/rest/api/storageservices/get-blob * - * @param {Aborter} aborter Create a new Aborter instance with Aborter.none or Aborter.timeout(), - * goto documents of Aborter for more examples about request cancellation * @param {number} offset From which position of the blob to download, >= 0 * @param {number} [count] How much data to be downloaded, > 0. Will download to the end when undefined - * @param {IBlobDownloadOptions} [options] + * @param {BlobDownloadOptions} [options] * @returns {Promise} - * @memberof BlobURL + * @memberof BlobClient */ public async download( - aborter: Aborter, offset: number, count?: number, - options: IBlobDownloadOptions = {} + options: BlobDownloadOptions = {} ): Promise { + const aborter = options.abortSignal || Aborter.none; options.blobAccessConditions = options.blobAccessConditions || {}; options.blobAccessConditions.modifiedAccessConditions = options.blobAccessConditions.modifiedAccessConditions || {}; @@ -216,11 +229,9 @@ export class BlobURL extends StorageURL { const res = await this.blobContext.download({ abortSignal: aborter, leaseAccessConditions: options.blobAccessConditions.leaseAccessConditions, - modifiedAccessConditions: - options.blobAccessConditions.modifiedAccessConditions, + modifiedAccessConditions: options.blobAccessConditions.modifiedAccessConditions, onDownloadProgress: isNode ? undefined : options.progress, - range: - offset === 0 && !count ? undefined : rangeToString({ offset, count }), + range: offset === 0 && !count ? undefined : rangeToString({ offset, count }), rangeGetContentMD5: options.rangeGetContentMD5, snapshot: options.snapshot }); @@ -235,43 +246,31 @@ export class BlobURL extends StorageURL { // bundlers may try to bundle following code and "FileReadResponse.ts". // In this case, "FileDownloadResponse.browser.ts" will be used as a shim of "FileDownloadResponse.ts" // The config is in package.json "browser" field - if ( - options.maxRetryRequests === undefined || - options.maxRetryRequests < 0 - ) { + if (options.maxRetryRequests === undefined || options.maxRetryRequests < 0) { // TODO: Default value or make it a required parameter? options.maxRetryRequests = DEFAULT_MAX_DOWNLOAD_RETRY_REQUESTS; } if (res.contentLength === undefined) { - throw new RangeError( - `File download response doesn't contain valid content length header` - ); + throw new RangeError(`File download response doesn't contain valid content length header`); } if (!res.eTag) { - throw new RangeError( - `File download response doesn't contain valid etag header` - ); + throw new RangeError(`File download response doesn't contain valid etag header`); } return new BlobDownloadResponse( - aborter, res, async (start: number): Promise => { const updatedOptions: Models.BlobDownloadOptionalParams = { - leaseAccessConditions: options.blobAccessConditions! - .leaseAccessConditions, + leaseAccessConditions: options.blobAccessConditions!.leaseAccessConditions, modifiedAccessConditions: { - ifMatch: - options.blobAccessConditions!.modifiedAccessConditions!.ifMatch || - res.eTag, - ifModifiedSince: options.blobAccessConditions! - .modifiedAccessConditions!.ifModifiedSince, - ifNoneMatch: options.blobAccessConditions!.modifiedAccessConditions! - .ifNoneMatch, - ifUnmodifiedSince: options.blobAccessConditions! - .modifiedAccessConditions!.ifUnmodifiedSince + ifMatch: options.blobAccessConditions!.modifiedAccessConditions!.ifMatch || res.eTag, + ifModifiedSince: options.blobAccessConditions!.modifiedAccessConditions! + .ifModifiedSince, + ifNoneMatch: options.blobAccessConditions!.modifiedAccessConditions!.ifNoneMatch, + ifUnmodifiedSince: options.blobAccessConditions!.modifiedAccessConditions! + .ifUnmodifiedSince }, range: rangeToString({ count: offset + res.contentLength! - start, @@ -295,6 +294,7 @@ export class BlobURL extends StorageURL { offset, res.contentLength!, { + abortSignal: aborter, maxRetryRequests: options.maxRetryRequests, progress: options.progress } @@ -306,22 +306,19 @@ export class BlobURL extends StorageURL { * for the blob. It does not return the content of the blob. * @see https://docs.microsoft.com/en-us/rest/api/storageservices/get-blob-properties * - * @param {Aborter} aborter Create a new Aborter instance with Aborter.none or Aborter.timeout(), - * goto documents of Aborter for more examples about request cancellation - * @param {IBlobGetPropertiesOptions} [options] + * @param {BlobGetPropertiesOptions} [options] * @returns {Promise} - * @memberof BlobURL + * @memberof BlobClient */ public async getProperties( - aborter: Aborter, - options: IBlobGetPropertiesOptions = {} + options: BlobGetPropertiesOptions = {} ): Promise { + const aborter = options.abortSignal || Aborter.none; options.blobAccessConditions = options.blobAccessConditions || {}; return this.blobContext.getProperties({ abortSignal: aborter, leaseAccessConditions: options.blobAccessConditions.leaseAccessConditions, - modifiedAccessConditions: - options.blobAccessConditions.modifiedAccessConditions + modifiedAccessConditions: options.blobAccessConditions.modifiedAccessConditions }); } @@ -332,23 +329,20 @@ export class BlobURL extends StorageURL { * Blob operation. * @see https://docs.microsoft.com/en-us/rest/api/storageservices/delete-blob * - * @param {Aborter} aborter Create a new Aborter instance with Aborter.none or Aborter.timeout(), - * goto documents of Aborter for more examples about request cancellation - * @param {IBlobDeleteOptions} [options] + * @param {BlobDeleteOptions} [options] * @returns {Promise} - * @memberof BlobURL + * @memberof BlobClient */ public async delete( - aborter: Aborter, - options: IBlobDeleteOptions = {} + options: BlobDeleteOptions = {} ): Promise { + const aborter = options.abortSignal || Aborter.none; options.blobAccessConditions = options.blobAccessConditions || {}; return this.blobContext.deleteMethod({ abortSignal: aborter, deleteSnapshots: options.deleteSnapshots, leaseAccessConditions: options.blobAccessConditions.leaseAccessConditions, - modifiedAccessConditions: - options.blobAccessConditions.modifiedAccessConditions + modifiedAccessConditions: options.blobAccessConditions.modifiedAccessConditions }); } @@ -358,16 +352,15 @@ export class BlobURL extends StorageURL { * or later. * @see https://docs.microsoft.com/en-us/rest/api/storageservices/undelete-blob * - * @param {Aborter} aborter Create a new Aborter instance with Aborter.none or Aborter.timeout(), - * goto documents of Aborter for more examples about request cancellation * @returns {Promise} - * @memberof BlobURL + * @memberof BlobClient */ public async undelete( - aborter: Aborter + options: BlobUndeleteOptions = {} ): Promise { + const aborter = options.abortSignal || Aborter.none; return this.blobContext.undelete({ - abortSignal: aborter + abortSignal: aborter || Aborter.none }); } @@ -378,27 +371,24 @@ export class BlobURL extends StorageURL { * these blob HTTP headers without a value will be cleared. * @see https://docs.microsoft.com/en-us/rest/api/storageservices/set-blob-properties * - * @param {Aborter} aborter Create a new Aborter instance with Aborter.none or Aborter.timeout(), - * goto documents of Aborter for more examples about request cancellation * @param {Models.BlobHTTPHeaders} [blobHTTPHeaders] If no value provided, or no value provided for * the specificed blob HTTP headers, these blob HTTP * headers without a value will be cleared. - * @param {IBlobSetHTTPHeadersOptions} [options] + * @param {BlobSetHTTPHeadersOptions} [options] * @returns {Promise} - * @memberof BlobURL + * @memberof BlobClient */ public async setHTTPHeaders( - aborter: Aborter, blobHTTPHeaders?: Models.BlobHTTPHeaders, - options: IBlobSetHTTPHeadersOptions = {} + options: BlobSetHTTPHeadersOptions = {} ): Promise { + const aborter = options.abortSignal || Aborter.none; options.blobAccessConditions = options.blobAccessConditions || {}; return this.blobContext.setHTTPHeaders({ abortSignal: aborter, blobHTTPHeaders, leaseAccessConditions: options.blobAccessConditions.leaseAccessConditions, - modifiedAccessConditions: - options.blobAccessConditions.modifiedAccessConditions + modifiedAccessConditions: options.blobAccessConditions.modifiedAccessConditions }); } @@ -409,26 +399,23 @@ export class BlobURL extends StorageURL { * metadata will be removed. * @see https://docs.microsoft.com/en-us/rest/api/storageservices/set-blob-metadata * - * @param {Aborter} aborter Create a new Aborter instance with Aborter.none or Aborter.timeout(), - * goto documents of Aborter for more examples about request cancellation - * @param {IMetadata} [metadata] Replace existing metadata with this value. + * @param {Metadata} [metadata] Replace existing metadata with this value. * If no value provided the existing metadata will be removed. - * @param {IBlobSetMetadataOptions} [options] + * @param {BlobSetMetadataOptions} [options] * @returns {Promise} - * @memberof BlobURL + * @memberof BlobClient */ public async setMetadata( - aborter: Aborter, - metadata?: IMetadata, - options: IBlobSetMetadataOptions = {} + metadata?: Metadata, + options: BlobSetMetadataOptions = {} ): Promise { + const aborter = options.abortSignal || Aborter.none; options.blobAccessConditions = options.blobAccessConditions || {}; return this.blobContext.setMetadata({ abortSignal: aborter, leaseAccessConditions: options.blobAccessConditions.leaseAccessConditions, metadata, - modifiedAccessConditions: - options.blobAccessConditions.modifiedAccessConditions + modifiedAccessConditions: options.blobAccessConditions.modifiedAccessConditions }); } @@ -438,20 +425,18 @@ export class BlobURL extends StorageURL { * In versions prior to 2012-02-12, the lock duration is 60 seconds. * @see https://docs.microsoft.com/en-us/rest/api/storageservices/lease-blob * - * @param {Aborter} aborter Create a new Aborter instance with Aborter.none or Aborter.timeout(), - * goto documents of Aborter for more examples about request cancellation * @param {string} proposedLeaseId Can be specified in any valid GUID string format * @param {number} duration The lock duration can be 15 to 60 seconds, or can be infinite - * @param {IBlobAcquireLeaseOptions} [options] + * @param {BlobAcquireLeaseOptions} [options] * @returns {Promise} - * @memberof BlobURL + * @memberof BlobClient */ public async acquireLease( - aborter: Aborter, proposedLeaseId: string, duration: number, - options: IBlobAcquireLeaseOptions = {} + options: BlobAcquireLeaseOptions = {} ): Promise { + const aborter = options.abortSignal || Aborter.none; return this.blobContext.acquireLease({ abortSignal: aborter, duration, @@ -465,18 +450,16 @@ export class BlobURL extends StorageURL { * acquire a lease against the blob. * @see https://docs.microsoft.com/en-us/rest/api/storageservices/lease-blob * - * @param {Aborter} aborter Create a new Aborter instance with Aborter.none or Aborter.timeout(), - * goto documents of Aborter for more examples about request cancellation * @param {string} leaseId - * @param {IBlobReleaseLeaseOptions} [options] + * @param {BlobReleaseLeaseOptions} [options] * @returns {Promise} - * @memberof BlobURL + * @memberof BlobClient */ public async releaseLease( - aborter: Aborter, leaseId: string, - options: IBlobReleaseLeaseOptions = {} + options: BlobReleaseLeaseOptions = {} ): Promise { + const aborter = options.abortSignal || Aborter.none; return this.blobContext.releaseLease(leaseId, { abortSignal: aborter, modifiedAccessConditions: options.modifiedAccessConditions @@ -487,18 +470,16 @@ export class BlobURL extends StorageURL { * To renew an existing lease. * @see https://docs.microsoft.com/en-us/rest/api/storageservices/lease-blob * - * @param {Aborter} aborter Create a new Aborter instance with Aborter.none or Aborter.timeout(), - * goto documents of Aborter for more examples about request cancellation * @param {string} leaseId - * @param {IBlobRenewLeaseOptions} [options] + * @param {BlobRenewLeaseOptions} [options] * @returns {Promise} - * @memberof BlobURL + * @memberof BlobClient */ public async renewLease( - aborter: Aborter, leaseId: string, - options: IBlobRenewLeaseOptions = {} + options: BlobRenewLeaseOptions = {} ): Promise { + const aborter = options.abortSignal || Aborter.none; return this.blobContext.renewLease(leaseId, { abortSignal: aborter, modifiedAccessConditions: options.modifiedAccessConditions @@ -509,20 +490,18 @@ export class BlobURL extends StorageURL { * To change the ID of an existing lease. * @see https://docs.microsoft.com/en-us/rest/api/storageservices/lease-blob * - * @param {Aborter} aborter Create a new Aborter instance with Aborter.none or Aborter.timeout(), - * goto documents of Aborter for more examples about request cancellation * @param {string} leaseId * @param {string} proposedLeaseId - * @param {IBlobChangeLeaseOptions} [options] + * @param {BlobChangeLeaseOptions} [options] * @returns {Promise} - * @memberof BlobURL + * @memberof BlobClient */ public async changeLease( - aborter: Aborter, leaseId: string, proposedLeaseId: string, - options: IBlobChangeLeaseOptions = {} + options: BlobChangeLeaseOptions = {} ): Promise { + const aborter = options.abortSignal || Aborter.none; return this.blobContext.changeLease(leaseId, proposedLeaseId, { abortSignal: aborter, modifiedAccessConditions: options.modifiedAccessConditions @@ -534,18 +513,16 @@ export class BlobURL extends StorageURL { * until the current lease period has expired. * @see https://docs.microsoft.com/en-us/rest/api/storageservices/lease-blob * - * @param {Aborter} aborter Create a new Aborter instance with Aborter.none or Aborter.timeout(), - * goto documents of Aborter for more examples about request cancellation * @param {number} [breakPeriod] - * @param {IBlobBreakLeaseOptions} [options] + * @param {BlobBreakLeaseOptions} [options] * @returns {Promise} - * @memberof BlobURL + * @memberof BlobClient */ public async breakLease( - aborter: Aborter, breakPeriod?: number, - options: IBlobBreakLeaseOptions = {} + options: BlobBreakLeaseOptions = {} ): Promise { + const aborter = options.abortSignal || Aborter.none; return this.blobContext.breakLease({ abortSignal: aborter, breakPeriod, @@ -557,23 +534,20 @@ export class BlobURL extends StorageURL { * Creates a read-only snapshot of a blob. * @see https://docs.microsoft.com/en-us/rest/api/storageservices/snapshot-blob * - * @param {Aborter} aborter Create a new Aborter instance with Aborter.none or Aborter.timeout(), - * goto documents of Aborter for more examples about request cancellation - * @param {IBlobCreateSnapshotOptions} [options] + * @param {BlobCreateSnapshotOptions} [options] * @returns {Promise} - * @memberof BlobURL + * @memberof BlobClient */ public async createSnapshot( - aborter: Aborter, - options: IBlobCreateSnapshotOptions = {} + options: BlobCreateSnapshotOptions = {} ): Promise { + const aborter = options.abortSignal || Aborter.none; options.blobAccessConditions = options.blobAccessConditions || {}; return this.blobContext.createSnapshot({ abortSignal: aborter, leaseAccessConditions: options.blobAccessConditions.leaseAccessConditions, metadata: options.metadata, - modifiedAccessConditions: - options.blobAccessConditions.modifiedAccessConditions + modifiedAccessConditions: options.blobAccessConditions.modifiedAccessConditions }); } @@ -587,35 +561,29 @@ export class BlobURL extends StorageURL { * operation to copy from another storage account. * @see https://docs.microsoft.com/en-us/rest/api/storageservices/copy-blob * - * @param {Aborter} aborter Create a new Aborter instance with Aborter.none or Aborter.timeout(), - * goto documents of Aborter for more examples about request cancellation * @param {string} copySource - * @param {IBlobStartCopyFromURLOptions} [options] + * @param {BlobStartCopyFromURLOptions} [options] * @returns {Promise} - * @memberof BlobURL + * @memberof BlobClient */ public async startCopyFromURL( - aborter: Aborter, copySource: string, - options: IBlobStartCopyFromURLOptions = {} + options: BlobStartCopyFromURLOptions = {} ): Promise { + const aborter = options.abortSignal || Aborter.none; options.blobAccessConditions = options.blobAccessConditions || {}; - options.sourceModifiedAccessConditions = - options.sourceModifiedAccessConditions || {}; + options.sourceModifiedAccessConditions = options.sourceModifiedAccessConditions || {}; return this.blobContext.startCopyFromURL(copySource, { abortSignal: aborter, leaseAccessConditions: options.blobAccessConditions.leaseAccessConditions, metadata: options.metadata, - modifiedAccessConditions: - options.blobAccessConditions.modifiedAccessConditions, + modifiedAccessConditions: options.blobAccessConditions.modifiedAccessConditions, sourceModifiedAccessConditions: { sourceIfMatch: options.sourceModifiedAccessConditions.ifMatch, - sourceIfModifiedSince: - options.sourceModifiedAccessConditions.ifModifiedSince, + sourceIfModifiedSince: options.sourceModifiedAccessConditions.ifModifiedSince, sourceIfNoneMatch: options.sourceModifiedAccessConditions.ifNoneMatch, - sourceIfUnmodifiedSince: - options.sourceModifiedAccessConditions.ifUnmodifiedSince + sourceIfUnmodifiedSince: options.sourceModifiedAccessConditions.ifUnmodifiedSince } }); } @@ -625,18 +593,16 @@ export class BlobURL extends StorageURL { * length and full metadata. Version 2012-02-12 and newer. * @see https://docs.microsoft.com/en-us/rest/api/storageservices/abort-copy-blob * - * @param {Aborter} aborter Create a new Aborter instance with Aborter.none or Aborter.timeout(), - * goto documents of Aborter for more examples about request cancellation * @param {string} copyId - * @param {IBlobAbortCopyFromURLOptions} [options] + * @param {BlobAbortCopyFromURLOptions} [options] * @returns {Promise} - * @memberof BlobURL + * @memberof BlobClient */ public async abortCopyFromURL( - aborter: Aborter, copyId: string, - options: IBlobAbortCopyFromURLOptions = {} + options: BlobAbortCopyFromURLOptions = {} ): Promise { + const aborter = options.abortSignal || Aborter.none; return this.blobContext.abortCopyFromURL(copyId, { abortSignal: aborter, leaseAccessConditions: options.leaseAccessConditions @@ -651,18 +617,16 @@ export class BlobURL extends StorageURL { * storage type. This operation does not update the blob's ETag. * @see https://docs.microsoft.com/en-us/rest/api/storageservices/set-blob-tier * - * @param {Aborter} aborter Create a new Aborter instance with Aborter.none or Aborter.timeout(), - * goto documents of Aborter for more examples about request cancellation * @param {Models.AccessTier} tier - * @param {IBlobSetTierOptions} [options] + * @param {BlobSetTierOptions} [options] * @returns {Promise} - * @memberof BlobURL + * @memberof BlobClient */ public async setTier( - aborter: Aborter, tier: Models.AccessTier, - options: IBlobSetTierOptions = {} + options: BlobSetTierOptions = {} ): Promise { + const aborter = options.abortSignal || Aborter.none; return await this.blobContext.setTier(tier, { abortSignal: aborter, leaseAccessConditions: options.leaseAccessConditions diff --git a/sdk/storage/storage-blob/src/BlobDownloadResponse.ts b/sdk/storage/storage-blob/src/BlobDownloadResponse.ts index 960c744d1dfd..3b329fb30eb4 100644 --- a/sdk/storage/storage-blob/src/BlobDownloadResponse.ts +++ b/sdk/storage/storage-blob/src/BlobDownloadResponse.ts @@ -3,14 +3,10 @@ import { HttpResponse, isNode } from "@azure/ms-rest-js"; -import { Aborter } from "./Aborter"; import * as Models from "./generated/lib/models"; -import { IMetadata } from "./models"; -import { IRetriableReadableStreamOptions } from "./utils/RetriableReadableStream"; -import { - ReadableStreamGetter, - RetriableReadableStream -} from "./utils/RetriableReadableStream"; +import { Metadata } from "./models"; +import { RetriableReadableStreamOptions } from "./utils/RetriableReadableStream"; +import { ReadableStreamGetter, RetriableReadableStream } from "./utils/RetriableReadableStream"; /** * ONLY AVAILABLE IN NODE.JS RUNTIME. @@ -370,10 +366,10 @@ export class BlobDownloadResponse implements Models.BlobDownloadResponse { * to associate with a file storage object. * * @readonly - * @type {(IMetadata | undefined)} + * @type {(Metadata | undefined)} * @memberof BlobDownloadResponse */ - public get metadata(): IMetadata | undefined { + public get metadata(): Metadata | undefined { return this.originalResponse.metadata; } @@ -439,25 +435,22 @@ export class BlobDownloadResponse implements Models.BlobDownloadResponse { /** * Creates an instance of BlobDownloadResponse. * - * @param {Aborter} aborter * @param {Models.BlobDownloadResponse} originalResponse * @param {ReadableStreamGetter} getter * @param {number} offset * @param {number} count - * @param {IRetriableReadableStreamOptions} [options={}] + * @param {RetriableReadableStreamOptions} [options={}] * @memberof BlobDownloadResponse */ public constructor( - aborter: Aborter, originalResponse: Models.BlobDownloadResponse, getter: ReadableStreamGetter, offset: number, count: number, - options: IRetriableReadableStreamOptions = {} + options: RetriableReadableStreamOptions = {} ) { this.originalResponse = originalResponse; this.blobDownloadStream = new RetriableReadableStream( - aborter, this.originalResponse.readableStreamBody!, getter, offset, diff --git a/sdk/storage/storage-blob/src/BlobSASPermissions.ts b/sdk/storage/storage-blob/src/BlobSASPermissions.ts index bb058a6b6b8f..2df60e1af0b7 100644 --- a/sdk/storage/storage-blob/src/BlobSASPermissions.ts +++ b/sdk/storage/storage-blob/src/BlobSASPermissions.ts @@ -7,7 +7,7 @@ * This is a helper class to construct a string representing the permissions granted by a ServiceSAS to a blob. Setting * a value to true means that any SAS which uses these permissions will grant permissions for that operation. Once all * the values are set, this should be serialized with toString and set as the permissions field on a - * {@link IBlobSASSignatureValues} object. It is possible to construct the permissions string without this class, but + * {@link BlobSASSignatureValues} object. It is possible to construct the permissions string without this class, but * the order of the permissions is particular and this class guarantees correctness. * * @export diff --git a/sdk/storage/storage-blob/src/IBlobSASSignatureValues.ts b/sdk/storage/storage-blob/src/BlobSASSignatureValues.ts similarity index 76% rename from sdk/storage/storage-blob/src/IBlobSASSignatureValues.ts rename to sdk/storage/storage-blob/src/BlobSASSignatureValues.ts index 6197fcb47878..bd6ed7608452 100644 --- a/sdk/storage/storage-blob/src/IBlobSASSignatureValues.ts +++ b/sdk/storage/storage-blob/src/BlobSASSignatureValues.ts @@ -4,7 +4,7 @@ import { BlobSASPermissions } from "./BlobSASPermissions"; import { ContainerSASPermissions } from "./ContainerSASPermissions"; import { SharedKeyCredential } from "./credentials/SharedKeyCredential"; -import { IIPRange, ipRangeToString } from "./IIPRange"; +import { IPRange, ipRangeToString } from "./IPRange"; import { SASProtocol } from "./SASQueryParameters"; import { SASQueryParameters } from "./SASQueryParameters"; import { SERVICE_VERSION } from "./utils/constants"; @@ -13,18 +13,18 @@ import { truncatedISO8061Date } from "./utils/utils.common"; /** * ONLY AVAILABLE IN NODE.JS RUNTIME. * - * IBlobSASSignatureValues is used to help generating Blob service SAS tokens for containers or blobs. + * BlobSASSignatureValues is used to help generating Blob service SAS tokens for containers or blobs. * * @export - * @class IBlobSASSignatureValues + * @class BlobSASSignatureValues */ -export interface IBlobSASSignatureValues { +export interface BlobSASSignatureValues { /** * The version of the service this SAS will target. If not specified, it will default to the version targeted by the * library. * * @type {string} - * @memberof IBlobSASSignatureValues + * @memberof BlobSASSignatureValues */ version?: string; @@ -32,7 +32,7 @@ export interface IBlobSASSignatureValues { * Optional. SAS protocols, HTTPS only or HTTPSandHTTP * * @type {SASProtocol} - * @memberof IBlobSASSignatureValues + * @memberof BlobSASSignatureValues */ protocol?: SASProtocol; @@ -40,7 +40,7 @@ export interface IBlobSASSignatureValues { * Optional. When the SAS will take effect. * * @type {Date} - * @memberof IBlobSASSignatureValues + * @memberof BlobSASSignatureValues */ startTime?: Date; @@ -48,7 +48,7 @@ export interface IBlobSASSignatureValues { * Optional only when identifier is provided. The time after which the SAS will no longer work. * * @type {Date} - * @memberof IBlobSASSignatureValues + * @memberof BlobSASSignatureValues */ expiryTime?: Date; @@ -58,23 +58,23 @@ export interface IBlobSASSignatureValues { * being accessed for help constructing the permissions string. * * @type {string} - * @memberof IBlobSASSignatureValues + * @memberof BlobSASSignatureValues */ permissions?: string; /** * Optional. IP ranges allowed in this SAS. * - * @type {IIPRange} - * @memberof IBlobSASSignatureValues + * @type {IPRange} + * @memberof BlobSASSignatureValues */ - ipRange?: IIPRange; + ipRange?: IPRange; /** * The name of the container the SAS user may access. * * @type {string} - * @memberof IBlobSASSignatureValues + * @memberof BlobSASSignatureValues */ containerName: string; @@ -82,7 +82,7 @@ export interface IBlobSASSignatureValues { * Optional. The name of the container the SAS user may access. * * @type {string} - * @memberof IBlobSASSignatureValues + * @memberof BlobSASSignatureValues */ blobName?: string; @@ -92,7 +92,7 @@ export interface IBlobSASSignatureValues { * @see https://docs.microsoft.com/en-us/rest/api/storageservices/establishing-a-stored-access-policy * * @type {string} - * @memberof IBlobSASSignatureValues + * @memberof BlobSASSignatureValues */ identifier?: string; @@ -100,7 +100,7 @@ export interface IBlobSASSignatureValues { * Optional. The cache-control header for the SAS. * * @type {string} - * @memberof IBlobSASSignatureValues + * @memberof BlobSASSignatureValues */ cacheControl?: string; @@ -108,7 +108,7 @@ export interface IBlobSASSignatureValues { * Optional. The content-disposition header for the SAS. * * @type {string} - * @memberof IBlobSASSignatureValues + * @memberof BlobSASSignatureValues */ contentDisposition?: string; @@ -116,7 +116,7 @@ export interface IBlobSASSignatureValues { * Optional. The content-encoding header for the SAS. * * @type {string} - * @memberof IBlobSASSignatureValues + * @memberof BlobSASSignatureValues */ contentEncoding?: string; @@ -124,7 +124,7 @@ export interface IBlobSASSignatureValues { * Optional. The content-language header for the SAS. * * @type {string} - * @memberof IBlobSASSignatureValues + * @memberof BlobSASSignatureValues */ contentLanguage?: string; @@ -132,7 +132,7 @@ export interface IBlobSASSignatureValues { * Optional. The content-type header for the SAS. * * @type {string} - * @memberof IBlobSASSignatureValues + * @memberof BlobSASSignatureValues */ contentType?: string; } @@ -150,12 +150,12 @@ export interface IBlobSASSignatureValues { * this constructor. * * @export - * @param {IBlobSASSignatureValues} blobSASSignatureValues + * @param {BlobSASSignatureValues} blobSASSignatureValues * @param {SharedKeyCredential} sharedKeyCredential * @returns {SASQueryParameters} */ export function generateBlobSASQueryParameters( - blobSASSignatureValues: IBlobSASSignatureValues, + blobSASSignatureValues: BlobSASSignatureValues, sharedKeyCredential: SharedKeyCredential ): SASQueryParameters { if ( @@ -167,18 +167,14 @@ export function generateBlobSASQueryParameters( ); } - const version = blobSASSignatureValues.version - ? blobSASSignatureValues.version - : SERVICE_VERSION; + const version = blobSASSignatureValues.version ? blobSASSignatureValues.version : SERVICE_VERSION; let resource: string = "c"; let verifiedPermissions: string | undefined; // Calling parse and toString guarantees the proper ordering and throws on invalid characters. if (blobSASSignatureValues.permissions) { if (blobSASSignatureValues.blobName) { - verifiedPermissions = BlobSASPermissions.parse( - blobSASSignatureValues.permissions - ).toString(); + verifiedPermissions = BlobSASPermissions.parse(blobSASSignatureValues.permissions).toString(); resource = "b"; } else { verifiedPermissions = ContainerSASPermissions.parse( @@ -202,23 +198,13 @@ export function generateBlobSASQueryParameters( blobSASSignatureValues.blobName ), blobSASSignatureValues.identifier, - blobSASSignatureValues.ipRange - ? ipRangeToString(blobSASSignatureValues.ipRange) - : "", + blobSASSignatureValues.ipRange ? ipRangeToString(blobSASSignatureValues.ipRange) : "", blobSASSignatureValues.protocol ? blobSASSignatureValues.protocol : "", version, - blobSASSignatureValues.cacheControl - ? blobSASSignatureValues.cacheControl - : "", - blobSASSignatureValues.contentDisposition - ? blobSASSignatureValues.contentDisposition - : "", - blobSASSignatureValues.contentEncoding - ? blobSASSignatureValues.contentEncoding - : "", - blobSASSignatureValues.contentLanguage - ? blobSASSignatureValues.contentLanguage - : "", + blobSASSignatureValues.cacheControl ? blobSASSignatureValues.cacheControl : "", + blobSASSignatureValues.contentDisposition ? blobSASSignatureValues.contentDisposition : "", + blobSASSignatureValues.contentEncoding ? blobSASSignatureValues.contentEncoding : "", + blobSASSignatureValues.contentLanguage ? blobSASSignatureValues.contentLanguage : "", blobSASSignatureValues.contentType ? blobSASSignatureValues.contentType : "" ].join("\n"); @@ -244,11 +230,7 @@ export function generateBlobSASQueryParameters( ); } -function getCanonicalName( - accountName: string, - containerName: string, - blobName?: string -): string { +function getCanonicalName(accountName: string, containerName: string, blobName?: string): string { // Container: "/blob/account/containerName" // Blob: "/blob/account/containerName/blobName" const elements: string[] = [`/blob/${accountName}/${containerName}`]; diff --git a/sdk/storage/storage-blob/src/ServiceURL.ts b/sdk/storage/storage-blob/src/BlobServiceClient.ts similarity index 73% rename from sdk/storage/storage-blob/src/ServiceURL.ts rename to sdk/storage/storage-blob/src/BlobServiceClient.ts index dcdec0c32859..963cefb174b5 100644 --- a/sdk/storage/storage-blob/src/ServiceURL.ts +++ b/sdk/storage/storage-blob/src/BlobServiceClient.ts @@ -1,14 +1,31 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -import * as Models from "../src/generated/lib/models"; +import * as Models from "./generated/lib/models"; import { Aborter } from "./Aborter"; import { ListContainersIncludeType } from "./generated/lib/models/index"; import { Service } from "./generated/lib/operations"; import { Pipeline } from "./Pipeline"; -import { StorageURL } from "./StorageURL"; +import { StorageClient } from "./StorageClient"; -export interface IServiceListContainersSegmentOptions { +export interface ServiceGetPropertiesOptions { + abortSignal?: Aborter; +} + +export interface ServiceSetPropertiesOptions { + abortSignal?: Aborter; +} + +export interface ServiceGetAccountInfoOptions { + abortSignal?: Aborter; +} + +export interface ServiceGetStatisticsOptions { + abortSignal?: Aborter; +} + +export interface ServiceListContainersSegmentOptions { + abortSignal?: Aborter; /** * @member {string} [prefix] Filters the results to return only containers * whose name begins with the specified prefix. @@ -33,32 +50,32 @@ export interface IServiceListContainersSegmentOptions { } /** - * A ServiceURL represents a URL to the Azure Storage Blob service allowing you + * A BlobServiceClient represents a Client to the Azure Storage Blob service allowing you * to manipulate blob containers. * * @export - * @class ServiceURL - * @extends {StorageURL} + * @class BlobServiceClient + * @extends {StorageClient} */ -export class ServiceURL extends StorageURL { +export class BlobServiceClient extends StorageClient { /** * serviceContext provided by protocol layer. * * @private * @type {Service} - * @memberof ServiceURL + * @memberof BlobServiceClient */ private serviceContext: Service; /** - * Creates an instance of ServiceURL. + * Creates an instance of BlobServiceClient. * - * @param {string} url A URL string pointing to Azure Storage blob service, such as + * @param {string} url A Client string pointing to Azure Storage blob service, such as * "https://myaccount.blob.core.windows.net". You can append a SAS * if using AnonymousCredential, such as "https://myaccount.blob.core.windows.net?sasString". - * @param {Pipeline} pipeline Call StorageURL.newPipeline() to create a default + * @param {Pipeline} pipeline Call StorageClient.newPipeline() to create a default * pipeline, or provide a customized pipeline. - * @memberof ServiceURL + * @memberof BlobServiceClient */ constructor(url: string, pipeline: Pipeline) { super(url, pipeline); @@ -66,15 +83,15 @@ export class ServiceURL extends StorageURL { } /** - * Creates a new ServiceURL object identical to the source but with the + * Creates a new BlobServiceClient object identical to the source but with the * specified request policy pipeline. * * @param {Pipeline} pipeline - * @returns {ServiceURL} - * @memberof ServiceURL + * @returns {BlobServiceClient} + * @memberof BlobServiceClient */ - public withPipeline(pipeline: Pipeline): ServiceURL { - return new ServiceURL(this.url, pipeline); + public withPipeline(pipeline: Pipeline): BlobServiceClient { + return new BlobServiceClient(this.url, pipeline); } /** @@ -82,16 +99,15 @@ export class ServiceURL extends StorageURL { * for Storage Analytics and CORS (Cross-Origin Resource Sharing) rules. * @see https://docs.microsoft.com/en-us/rest/api/storageservices/get-blob-service-properties} * - * @param {Aborter} aborter Create a new Aborter instance with Aborter.none or Aborter.timeout(), - * goto documents of Aborter for more examples about request cancellation * @returns {Promise} - * @memberof ServiceURL + * @memberof BlobServiceClient */ public async getProperties( - aborter: Aborter + options: ServiceGetPropertiesOptions = {} ): Promise { + const aborter = options.abortSignal || Aborter.none; return this.serviceContext.getProperties({ - abortSignal: aborter + abortSignal: aborter || Aborter.none }); } @@ -100,18 +116,19 @@ export class ServiceURL extends StorageURL { * for Storage Analytics, CORS (Cross-Origin Resource Sharing) rules and soft delete settings. * @see https://docs.microsoft.com/en-us/rest/api/storageservices/set-blob-service-properties} * + * @param {Models.StorageServiceProperties} properties * @param {Aborter} aborter Create a new Aborter instance with Aborter.none or Aborter.timeout(), * goto documents of Aborter for more examples about request cancellation - * @param {Models.StorageServiceProperties} properties * @returns {Promise} - * @memberof ServiceURL + * @memberof BlobServiceClient */ public async setProperties( - aborter: Aborter, - properties: Models.StorageServiceProperties + properties: Models.StorageServiceProperties, + options: ServiceSetPropertiesOptions = {} ): Promise { + const aborter = options.abortSignal || Aborter.none; return this.serviceContext.setProperties(properties, { - abortSignal: aborter + abortSignal: aborter || Aborter.none }); } @@ -124,13 +141,14 @@ export class ServiceURL extends StorageURL { * @param {Aborter} aborter Create a new Aborter instance with Aborter.none or Aborter.timeout(), * goto documents of Aborter for more examples about request cancellation * @returns {Promise} - * @memberof ServiceURL + * @memberof BlobServiceClient */ public async getStatistics( - aborter: Aborter + options: ServiceGetStatisticsOptions = {} ): Promise { + const aborter = options.abortSignal || Aborter.none; return this.serviceContext.getStatistics({ - abortSignal: aborter + abortSignal: aborter || Aborter.none }); } @@ -144,13 +162,14 @@ export class ServiceURL extends StorageURL { * @param {Aborter} aborter Create a new Aborter instance with Aborter.none or Aborter.timeout(), * goto documents of Aborter for more examples about request cancellation * @returns {Promise} - * @memberof ServiceURL + * @memberof BlobServiceClient */ public async getAccountInfo( - aborter: Aborter + options: ServiceGetAccountInfoOptions = {} ): Promise { + const aborter = options.abortSignal || Aborter.none; return this.serviceContext.getAccountInfo({ - abortSignal: aborter + abortSignal: aborter || Aborter.none }); } @@ -167,15 +186,15 @@ export class ServiceURL extends StorageURL { * with the current page. The NextMarker value can be used as the value for * the marker parameter in a subsequent call to request the next page of list * items. The marker value is opaque to the client. - * @param {IServiceListContainersSegmentOptions} [options] + * @param {ServiceListContainersSegmentOptions} [options] * @returns {Promise} - * @memberof ServiceURL + * @memberof BlobServiceClient */ public async listContainersSegment( - aborter: Aborter, marker?: string, - options: IServiceListContainersSegmentOptions = {} + options: ServiceListContainersSegmentOptions = {} ): Promise { + const aborter = options.abortSignal || Aborter.none; return this.serviceContext.listContainersSegment({ abortSignal: aborter, marker, diff --git a/sdk/storage/storage-blob/src/BlockBlobURL.ts b/sdk/storage/storage-blob/src/BlockBlobClient.ts similarity index 68% rename from sdk/storage/storage-blob/src/BlockBlobURL.ts rename to sdk/storage/storage-blob/src/BlockBlobClient.ts index 75674ac4f01f..9931210f57d6 100644 --- a/sdk/storage/storage-blob/src/BlockBlobURL.ts +++ b/sdk/storage/storage-blob/src/BlockBlobClient.ts @@ -3,83 +3,88 @@ import { HttpRequestBody, TransferProgressEvent } from "@azure/ms-rest-js"; -import * as Models from "../src/generated/lib/models"; +import * as Models from "./generated/lib/models"; import { Aborter } from "./Aborter"; -import { BlobURL } from "./BlobURL"; -import { ContainerURL } from "./ContainerURL"; +import { BlobClient } from "./BlobClient"; +import { ContainerClient } from "./ContainerClient"; import { BlockBlob } from "./generated/lib/operations"; -import { IRange, rangeToString } from "./IRange"; -import { IBlobAccessConditions, IMetadata } from "./models"; +import { Range, rangeToString } from "./Range"; +import { BlobAccessConditions, Metadata } from "./models"; import { Pipeline } from "./Pipeline"; import { URLConstants } from "./utils/constants"; import { appendToURLPath, setURLParameter } from "./utils/utils.common"; -export interface IBlockBlobUploadOptions { - accessConditions?: IBlobAccessConditions; +export interface BlockBlobUploadOptions { + abortSignal?: Aborter; + accessConditions?: BlobAccessConditions; blobHTTPHeaders?: Models.BlobHTTPHeaders; - metadata?: IMetadata; + metadata?: Metadata; progress?: (progress: TransferProgressEvent) => void; } -export interface IBlockBlobStageBlockOptions { +export interface BlockBlobStageBlockOptions { + abortSignal?: Aborter; leaseAccessConditions?: Models.LeaseAccessConditions; progress?: (progress: TransferProgressEvent) => void; transactionalContentMD5?: Uint8Array; } -export interface IBlockBlobStageBlockFromURLOptions { - range?: IRange; +export interface BlockBlobStageBlockFromURLOptions { + abortSignal?: Aborter; + range?: Range; leaseAccessConditions?: Models.LeaseAccessConditions; sourceContentMD5?: Uint8Array; } -export interface IBlockBlobCommitBlockListOptions { - accessConditions?: IBlobAccessConditions; +export interface BlockBlobCommitBlockListOptions { + abortSignal?: Aborter; + accessConditions?: BlobAccessConditions; blobHTTPHeaders?: Models.BlobHTTPHeaders; - metadata?: IMetadata; + metadata?: Metadata; } -export interface IBlockBlobGetBlockListOptions { +export interface BlockBlobGetBlockListOptions { + abortSignal?: Aborter; leaseAccessConditions?: Models.LeaseAccessConditions; } /** - * BlockBlobURL defines a set of operations applicable to block blobs. + * BlockBlobClient defines a set of operations applicable to block blobs. * * @export - * @class BlockBlobURL - * @extends {StorageURL} + * @class BlockBlobClient + * @extends {StorageClient} */ -export class BlockBlobURL extends BlobURL { +export class BlockBlobClient extends BlobClient { /** - * Creates a BlockBlobURL object from ContainerURL instance. + * Creates a BlockBlobClient object from ContainerClient instance. * * @static - * @param {ContainerURL} containerURL A ContainerURL object + * @param {ContainerClient} containerClient A ContainerClient object * @param {string} blobName A block blob name - * @returns {BlockBlobURL} - * @memberof BlockBlobURL + * @returns {BlockBlobClient} + * @memberof BlockBlobClient */ - public static fromContainerURL( - containerURL: ContainerURL, + public static fromContainerClient( + containerClient: ContainerClient, blobName: string - ): BlockBlobURL { - return new BlockBlobURL( - appendToURLPath(containerURL.url, encodeURIComponent(blobName)), - containerURL.pipeline + ): BlockBlobClient { + return new BlockBlobClient( + appendToURLPath(containerClient.url, encodeURIComponent(blobName)), + containerClient.pipeline ); } /** - * Creates a BlockBlobURL object from BlobURL instance. + * Creates a BlockBlobClient object from BlobClient instance. * * @static - * @param {BlobURL} blobURL - * @returns {BlockBlobURL} - * @memberof BlockBlobURL + * @param {BlobClient} blobClient + * @returns {BlockBlobClient} + * @memberof BlockBlobClient */ - public static fromBlobURL(blobURL: BlobURL): BlockBlobURL { - return new BlockBlobURL(blobURL.url, blobURL.pipeline); + public static fromBlobClient(blobClient: BlobClient): BlockBlobClient { + return new BlockBlobClient(blobClient.url, blobClient.pipeline); } /** @@ -87,12 +92,12 @@ export class BlockBlobURL extends BlobURL { * * @private * @type {BlockBlobs} - * @memberof BlockBlobURL + * @memberof BlockBlobClient */ private blockBlobContext: BlockBlob; /** - * Creates an instance of BlockBlobURL. + * Creates an instance of BlockBlobClient. * This method accepts an encoded URL or non-encoded URL pointing to a block blob. * Encoded URL string will NOT be escaped twice, only special characters in URL path will be escaped. * If a blob name includes ? or %, blob name must be encoded in the URL. @@ -105,9 +110,9 @@ export class BlockBlobURL extends BlobURL { * Encoded URL string will NOT be escaped twice, only special characters in URL path will be escaped. * However, if a blob name includes ? or %, blob name must be encoded in the URL. * Such as a blob named "my?blob%", the URL should be "https://myaccount.blob.core.windows.net/mycontainer/my%3Fblob%25". - * @param {Pipeline} pipeline Call StorageURL.newPipeline() to create a default + * @param {Pipeline} pipeline Call StorageClient.newPipeline() to create a default * pipeline, or provide a customized pipeline. - * @memberof BlockBlobURL + * @memberof BlockBlobClient */ constructor(url: string, pipeline: Pipeline) { super(url, pipeline); @@ -115,28 +120,28 @@ export class BlockBlobURL extends BlobURL { } /** - * Creates a new BlockBlobURL object identical to the source but with the + * Creates a new BlockBlobClient object identical to the source but with the * specified request policy pipeline. * * @param {Pipeline} pipeline - * @returns {BlockBlobURL} - * @memberof BlockBlobURL + * @returns {BlockBlobClient} + * @memberof BlockBlobClient */ - public withPipeline(pipeline: Pipeline): BlockBlobURL { - return new BlockBlobURL(this.url, pipeline); + public withPipeline(pipeline: Pipeline): BlockBlobClient { + return new BlockBlobClient(this.url, pipeline); } /** - * Creates a new BlockBlobURL object identical to the source but with the + * Creates a new BlockBlobClient object identical to the source but with the * specified snapshot timestamp. * Provide "" will remove the snapshot and return a URL to the base blob. * * @param {string} snapshot - * @returns {BlockBlobURL} - * @memberof BlockBlobURL + * @returns {BlockBlobClient} + * @memberof BlockBlobClient */ - public withSnapshot(snapshot: string): BlockBlobURL { - return new BlockBlobURL( + public withSnapshot(snapshot: string): BlockBlobClient { + return new BlockBlobClient( setURLParameter( this.url, URLConstants.Parameters.SNAPSHOT, @@ -159,30 +164,27 @@ export class BlockBlobURL extends BlobURL { * * @see https://docs.microsoft.com/rest/api/storageservices/put-blob * - * @param {Aborter} aborter Create a new Aborter instance with Aborter.none or Aborter.timeout(), - * goto documents of Aborter for more examples about request cancellation * @param {HttpRequestBody} body Blob, string, ArrayBuffer, ArrayBufferView or a function * which returns a new Readable stream whose offset is from data source beginning. * @param {number} contentLength Length of body in bytes. Use Buffer.byteLength() to calculate body length for a * string including non non-Base64/Hex-encoded characters. - * @param {IBlockBlobUploadOptions} [options] + * @param {BlockBlobUploadOptions} [options] * @returns {Promise} - * @memberof BlockBlobURL + * @memberof BlockBlobClient */ public async upload( - aborter: Aborter, body: HttpRequestBody, contentLength: number, - options: IBlockBlobUploadOptions = {} + options: BlockBlobUploadOptions = {} ): Promise { + const aborter = options.abortSignal || Aborter.none; options.accessConditions = options.accessConditions || {}; return this.blockBlobContext.upload(body, contentLength, { abortSignal: aborter, blobHTTPHeaders: options.blobHTTPHeaders, leaseAccessConditions: options.accessConditions.leaseAccessConditions, metadata: options.metadata, - modifiedAccessConditions: - options.accessConditions.modifiedAccessConditions, + modifiedAccessConditions: options.accessConditions.modifiedAccessConditions, onUploadProgress: options.progress }); } @@ -192,22 +194,20 @@ export class BlockBlobURL extends BlobURL { * committed by a call to commitBlockList. * @see https://docs.microsoft.com/rest/api/storageservices/put-block * - * @param {Aborter} aborter Create a new Aborter instance with Aborter.none or Aborter.timeout(), - * goto documents of Aborter for more examples about request cancellation * @param {string} blockId A 64-byte value that is base64-encoded * @param {HttpRequestBody} body * @param {number} contentLength - * @param {IBlockBlobStageBlockOptions} [options] + * @param {BlockBlobStageBlockOptions} [options] * @returns {Promise} - * @memberof BlockBlobURL + * @memberof BlockBlobClient */ public async stageBlock( - aborter: Aborter, blockId: string, body: HttpRequestBody, contentLength: number, - options: IBlockBlobStageBlockOptions = {} + options: BlockBlobStageBlockOptions = {} ): Promise { + const aborter = options.abortSignal || Aborter.none; return this.blockBlobContext.stageBlock(blockId, contentLength, body, { abortSignal: aborter, leaseAccessConditions: options.leaseAccessConditions, @@ -222,8 +222,6 @@ export class BlockBlobURL extends BlobURL { * This API is available starting in version 2018-03-28. * @see https://docs.microsoft.com/en-us/rest/api/storageservices/put-block-from-url * - * @param {Aborter} aborter Create a new Aborter instance with Aborter.none or Aborter.timeout(), - * goto documents of Aborter for more examples about request cancellation * @param {string} blockId A 64-byte value that is base64-encoded * @param {string} sourceURL Specifies the URL of the blob. The value * may be a URL of up to 2 KB in length that specifies a blob. @@ -236,24 +234,23 @@ export class BlockBlobURL extends BlobURL { * - https://myaccount.blob.core.windows.net/mycontainer/myblob?snapshot= * @param {number} offset From which position of the blob to download, >= 0 * @param {number} [count] How much data to be downloaded, > 0. Will download to the end when undefined - * @param {IBlockBlobStageBlockFromURLOptions} [options={}] + * @param {BlockBlobStageBlockFromURLOptions} [options={}] * @returns {Promise} - * @memberof BlockBlobURL + * @memberof BlockBlobClient */ public async stageBlockFromURL( - aborter: Aborter, blockId: string, sourceURL: string, offset: number, count?: number, - options: IBlockBlobStageBlockFromURLOptions = {} + options: BlockBlobStageBlockFromURLOptions = {} ): Promise { + const aborter = options.abortSignal || Aborter.none; return this.blockBlobContext.stageBlockFromURL(blockId, 0, sourceURL, { abortSignal: aborter, leaseAccessConditions: options.leaseAccessConditions, sourceContentMD5: options.sourceContentMD5, - sourceRange: - offset === 0 && !count ? undefined : rangeToString({ offset, count }) + sourceRange: offset === 0 && !count ? undefined : rangeToString({ offset, count }) }); } @@ -265,18 +262,16 @@ export class BlockBlobURL extends BlobURL { * blocks together. Any blocks not specified in the block list and permanently deleted. * @see https://docs.microsoft.com/rest/api/storageservices/put-block-list * - * @param {Aborter} aborter Create a new Aborter instance with Aborter.none or Aborter.timeout(), - * goto documents of Aborter for more examples about request cancellation * @param {string[]} blocks Array of 64-byte value that is base64-encoded - * @param {IBlockBlobCommitBlockListOptions} [options] + * @param {BlockBlobCommitBlockListOptions} [options] * @returns {Promise} - * @memberof BlockBlobURL + * @memberof BlockBlobClient */ public async commitBlockList( - aborter: Aborter, blocks: string[], - options: IBlockBlobCommitBlockListOptions = {} + options: BlockBlobCommitBlockListOptions = {} ): Promise { + const aborter = options.abortSignal || Aborter.none; options.accessConditions = options.accessConditions || {}; return this.blockBlobContext.commitBlockList( { latest: blocks }, @@ -285,8 +280,7 @@ export class BlockBlobURL extends BlobURL { blobHTTPHeaders: options.blobHTTPHeaders, leaseAccessConditions: options.accessConditions.leaseAccessConditions, metadata: options.metadata, - modifiedAccessConditions: - options.accessConditions.modifiedAccessConditions + modifiedAccessConditions: options.accessConditions.modifiedAccessConditions } ); } @@ -296,18 +290,16 @@ export class BlockBlobURL extends BlobURL { * using the specified block list filter. * @see https://docs.microsoft.com/rest/api/storageservices/get-block-list * - * @param {Aborter} aborter Create a new Aborter instance with Aborter.none or Aborter.timeout(), - * goto documents of Aborter for more examples about request cancellation * @param {Models.BlockListType} listType - * @param {IBlockBlobGetBlockListOptions} [options] + * @param {BlockBlobGetBlockListOptions} [options] * @returns {Promise} - * @memberof BlockBlobURL + * @memberof BlockBlobClient */ public async getBlockList( - aborter: Aborter, listType: Models.BlockListType, - options: IBlockBlobGetBlockListOptions = {} + options: BlockBlobGetBlockListOptions = {} ): Promise { + const aborter = options.abortSignal || Aborter.none; const res = await this.blockBlobContext.getBlockList(listType, { abortSignal: aborter, leaseAccessConditions: options.leaseAccessConditions diff --git a/sdk/storage/storage-blob/src/BrowserPolicyFactory.ts b/sdk/storage/storage-blob/src/BrowserPolicyFactory.ts index 306981413e8a..081b843dab15 100644 --- a/sdk/storage/storage-blob/src/BrowserPolicyFactory.ts +++ b/sdk/storage/storage-blob/src/BrowserPolicyFactory.ts @@ -1,12 +1,7 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -import { - RequestPolicy, - RequestPolicyFactory, - RequestPolicyOptions -} from "@azure/ms-rest-js"; - +import { RequestPolicy, RequestPolicyFactory, RequestPolicyOptions } from "@azure/ms-rest-js"; import { BrowserPolicy } from "./policies/BrowserPolicy"; /** @@ -17,10 +12,7 @@ import { BrowserPolicy } from "./policies/BrowserPolicy"; * @implements {RequestPolicyFactory} */ export class BrowserPolicyFactory implements RequestPolicyFactory { - public create( - nextPolicy: RequestPolicy, - options: RequestPolicyOptions - ): BrowserPolicy { + public create(nextPolicy: RequestPolicy, options: RequestPolicyOptions): BrowserPolicy { return new BrowserPolicy(nextPolicy, options); } } diff --git a/sdk/storage/storage-blob/src/ContainerURL.ts b/sdk/storage/storage-blob/src/ContainerClient.ts similarity index 67% rename from sdk/storage/storage-blob/src/ContainerURL.ts rename to sdk/storage/storage-blob/src/ContainerClient.ts index ff795d17b17b..78b120e724ec 100644 --- a/sdk/storage/storage-blob/src/ContainerURL.ts +++ b/sdk/storage/storage-blob/src/ContainerClient.ts @@ -2,38 +2,43 @@ // Licensed under the MIT License. import { HttpResponse } from "@azure/ms-rest-js"; -import * as Models from "../src/generated/lib/models"; +import * as Models from "./generated/lib/models"; import { Aborter } from "./Aborter"; import { Container } from "./generated/lib/operations"; -import { IContainerAccessConditions, IMetadata } from "./models"; +import { ContainerAccessConditions, Metadata } from "./models"; import { Pipeline } from "./Pipeline"; -import { ServiceURL } from "./ServiceURL"; -import { StorageURL } from "./StorageURL"; +import { BlobServiceClient } from "./BlobServiceClient"; +import { StorageClient } from "./StorageClient"; import { ETagNone } from "./utils/constants"; import { appendToURLPath, truncatedISO8061Date } from "./utils/utils.common"; -export interface IContainerCreateOptions { - metadata?: IMetadata; +export interface ContainerCreateOptions { + abortSignal?: Aborter; + metadata?: Metadata; access?: Models.PublicAccessType; } -export interface IContainerGetPropertiesOptions { +export interface ContainerGetPropertiesOptions { + abortSignal?: Aborter; leaseAccessConditions?: Models.LeaseAccessConditions; } -export interface IContainerDeleteMethodOptions { - containerAccessConditions?: IContainerAccessConditions; +export interface ContainerDeleteMethodOptions { + abortSignal?: Aborter; + containerAccessConditions?: ContainerAccessConditions; } -export interface IContainerSetMetadataOptions { - containerAccessConditions?: IContainerAccessConditions; +export interface ContainerSetMetadataOptions { + abortSignal?: Aborter; + containerAccessConditions?: ContainerAccessConditions; } -export interface IContainerGetAccessPolicyOptions { +export interface ContainerGetAccessPolicyOptions { + abortSignal?: Aborter; leaseAccessConditions?: Models.LeaseAccessConditions; } -export interface ISignedIdentifier { +export interface SignedIdentifier { /** * @member {string} id a unique id */ @@ -59,7 +64,7 @@ export interface ISignedIdentifier { } export declare type ContainerGetAccessPolicyResponse = { - signedIdentifiers: ISignedIdentifier[]; + signedIdentifiers: SignedIdentifier[]; } & Models.ContainerGetAccessPolicyHeaders & { /** * The underlying HTTP response. @@ -80,31 +85,38 @@ export declare type ContainerGetAccessPolicyResponse = { }; }; -export interface IContainerSetAccessPolicyOptions { - containerAccessConditions?: IContainerAccessConditions; +export interface ContainerSetAccessPolicyOptions { + abortSignal?: Aborter; + containerAccessConditions?: ContainerAccessConditions; } -export interface IContainerAcquireLeaseOptions { +export interface ContainerAcquireLeaseOptions { + abortSignal?: Aborter; modifiedAccessConditions?: Models.ModifiedAccessConditions; } -export interface IContainerReleaseLeaseOptions { +export interface ContainerReleaseLeaseOptions { + abortSignal?: Aborter; modifiedAccessConditions?: Models.ModifiedAccessConditions; } -export interface IContainerRenewLeaseOptions { +export interface ContainerRenewLeaseOptions { + abortSignal?: Aborter; modifiedAccessConditions?: Models.ModifiedAccessConditions; } -export interface IContainerBreakLeaseOptions { +export interface ContainerBreakLeaseOptions { + abortSignal?: Aborter; modifiedAccessConditions?: Models.ModifiedAccessConditions; } -export interface IContainerChangeLeaseOptions { +export interface ContainerChangeLeaseOptions { + abortSignal?: Aborter; modifiedAccessConditions?: Models.ModifiedAccessConditions; } -export interface IContainerListBlobsSegmentOptions { +export interface ContainerListBlobsSegmentOptions { + abortSignal?: Aborter; /** * @member {string} [prefix] Filters the results to return only containers * whose name begins with the specified prefix. @@ -128,26 +140,26 @@ export interface IContainerListBlobsSegmentOptions { } /** - * A ContainerURL represents a URL to the Azure Storage container allowing you to manipulate its blobs. + * A ContainerClient represents a URL to the Azure Storage container allowing you to manipulate its blobs. * * @export - * @class ContainerURL - * @extends {StorageURL} + * @class ContainerClient + * @extends {StorageClient} */ -export class ContainerURL extends StorageURL { +export class ContainerClient extends StorageClient { /** - * Creates a ContainerURL object from ServiceURL + * Creates a ContainerClient object from BlobServiceClient * - * @param serviceURL A ServiceURL object + * @param blobServiceClient A BlobServiceClient object * @param containerName A container name */ - public static fromServiceURL( - serviceURL: ServiceURL, + public static fromBlobServiceClient( + blobServiceClient: BlobServiceClient, containerName: string - ): ContainerURL { - return new ContainerURL( - appendToURLPath(serviceURL.url, encodeURIComponent(containerName)), - serviceURL.pipeline + ): ContainerClient { + return new ContainerClient( + appendToURLPath(blobServiceClient.url, encodeURIComponent(containerName)), + blobServiceClient.pipeline ); } @@ -156,19 +168,19 @@ export class ContainerURL extends StorageURL { * * @private * @type {Containers} - * @memberof ContainerURL + * @memberof ContainerClient */ private containerContext: Container; /** - * Creates an instance of ContainerURL. + * Creates an instance of ContainerClient. * @param {string} url A URL string pointing to Azure Storage blob container, such as * "https://myaccount.blob.core.windows.net/mycontainer". You can * append a SAS if using AnonymousCredential, such as * "https://myaccount.blob.core.windows.net/mycontainer?sasString". - * @param {Pipeline} pipeline Call StorageURL.newPipeline() to create a default + * @param {Pipeline} pipeline Call StorageClient.newPipeline() to create a default * pipeline, or provide a customized pipeline. - * @memberof ContainerURL + * @memberof ContainerClient */ constructor(url: string, pipeline: Pipeline) { super(url, pipeline); @@ -176,15 +188,15 @@ export class ContainerURL extends StorageURL { } /** - * Creates a new ContainerURL object identical to the source but with the + * Creates a new ContainerClient object identical to the source but with the * specified request policy pipeline. * * @param {Pipeline} pipeline - * @returns {ContainerURL} - * @memberof ContainerURL + * @returns {ContainerClient} + * @memberof ContainerClient */ - public withPipeline(pipeline: Pipeline): ContainerURL { - return new ContainerURL(this.url, pipeline); + public withPipeline(pipeline: Pipeline): ContainerClient { + return new ContainerClient(this.url, pipeline); } /** @@ -192,21 +204,20 @@ export class ContainerURL extends StorageURL { * the same name already exists, the operation fails. * @see https://docs.microsoft.com/en-us/rest/api/storageservices/create-container * - * @param {Aborter} aborter Create a new Aborter instance with Aborter.none or Aborter.timeout(), - * goto documents of Aborter for more examples about request cancellation - * @param {IContainerCreateOptions} [options] + * @param {ContainerCreateOptions} [options] * @returns {Promise} - * @memberof ContainerURL + * @memberof ContainerClient */ public async create( - aborter: Aborter, - options: IContainerCreateOptions = {} + options: ContainerCreateOptions = {} ): Promise { + if (!options.abortSignal) { + options.abortSignal = Aborter.none; + } // Spread operator in destructuring assignments, // this will filter out unwanted properties from the response object into result object return this.containerContext.create({ - ...options, - abortSignal: aborter + ...options }); } @@ -215,20 +226,19 @@ export class ContainerURL extends StorageURL { * container. The data returned does not include the container's list of blobs. * @see https://docs.microsoft.com/en-us/rest/api/storageservices/get-container-properties * - * @param {Aborter} aborter Create a new Aborter instance with Aborter.none or Aborter.timeout(), - * goto documents of Aborter for more examples about request cancellation - * @param {IContainersGetPropertiesOptions} [options] + * @param {ContainersGetPropertiesOptions} [options] * @returns {Promise} - * @memberof ContainerURL + * @memberof ContainerClient */ public async getProperties( - aborter: Aborter, - options: IContainerGetPropertiesOptions = {} + options: ContainerGetPropertiesOptions = {} ): Promise { if (!options.leaseAccessConditions) { options.leaseAccessConditions = {}; } + const aborter = options.abortSignal || Aborter.none; + return this.containerContext.getProperties({ abortSignal: aborter, ...options.leaseAccessConditions @@ -240,16 +250,15 @@ export class ContainerURL extends StorageURL { * contained within it are later deleted during garbage collection. * @see https://docs.microsoft.com/en-us/rest/api/storageservices/delete-container * - * @param {Aborter} aborter Create a new Aborter instance with Aborter.none or Aborter.timeout(), - * goto documents of Aborter for more examples about request cancellation * @param {Models.ContainersDeleteMethodOptionalParams} [options] * @returns {Promise} - * @memberof ContainerURL + * @memberof ContainerClient */ public async delete( - aborter: Aborter, - options: IContainerDeleteMethodOptions = {} + options: ContainerDeleteMethodOptions = {} ): Promise { + const aborter = options.abortSignal || Aborter.none; + if (!options.containerAccessConditions) { options.containerAccessConditions = {}; } @@ -264,11 +273,9 @@ export class ContainerURL extends StorageURL { if ( (options.containerAccessConditions.modifiedAccessConditions.ifMatch && - options.containerAccessConditions.modifiedAccessConditions.ifMatch !== - ETagNone) || + options.containerAccessConditions.modifiedAccessConditions.ifMatch !== ETagNone) || (options.containerAccessConditions.modifiedAccessConditions.ifNoneMatch && - options.containerAccessConditions.modifiedAccessConditions - .ifNoneMatch !== ETagNone) + options.containerAccessConditions.modifiedAccessConditions.ifNoneMatch !== ETagNone) ) { throw new RangeError( "the IfMatch and IfNoneMatch access conditions must have their default\ @@ -278,10 +285,8 @@ export class ContainerURL extends StorageURL { return this.containerContext.deleteMethod({ abortSignal: aborter, - leaseAccessConditions: - options.containerAccessConditions.leaseAccessConditions, - modifiedAccessConditions: - options.containerAccessConditions.modifiedAccessConditions + leaseAccessConditions: options.containerAccessConditions.leaseAccessConditions, + modifiedAccessConditions: options.containerAccessConditions.modifiedAccessConditions }); } @@ -293,19 +298,18 @@ export class ContainerURL extends StorageURL { * * @see https://docs.microsoft.com/en-us/rest/api/storageservices/set-container-metadata * - * @param {Aborter} aborter Create a new Aborter instance with Aborter.none or Aborter.timeout(), - * goto documents of Aborter for more examples about request cancellation - * @param {IMetadata} [metadata] Replace existing metadata with this value. + * @param {Metadata} [metadata] Replace existing metadata with this value. * If no value provided the existing metadata will be removed. - * @param {IContainerSetMetadataOptions} [options] + * @param {ContainerSetMetadataOptions} [options] * @returns {Promise} - * @memberof ContainerURL + * @memberof ContainerClient */ public async setMetadata( - aborter: Aborter, - metadata?: IMetadata, - options: IContainerSetMetadataOptions = {} + metadata?: Metadata, + options: ContainerSetMetadataOptions = {} ): Promise { + const aborter = options.abortSignal || Aborter.none; + if (!options.containerAccessConditions) { options.containerAccessConditions = {}; } @@ -319,14 +323,11 @@ export class ContainerURL extends StorageURL { } if ( - options.containerAccessConditions.modifiedAccessConditions - .ifUnmodifiedSince || + options.containerAccessConditions.modifiedAccessConditions.ifUnmodifiedSince || (options.containerAccessConditions.modifiedAccessConditions.ifMatch && - options.containerAccessConditions.modifiedAccessConditions.ifMatch !== - ETagNone) || + options.containerAccessConditions.modifiedAccessConditions.ifMatch !== ETagNone) || (options.containerAccessConditions.modifiedAccessConditions.ifNoneMatch && - options.containerAccessConditions.modifiedAccessConditions - .ifNoneMatch !== ETagNone) + options.containerAccessConditions.modifiedAccessConditions.ifNoneMatch !== ETagNone) ) { throw new RangeError( "the IfUnmodifiedSince, IfMatch, and IfNoneMatch must have their default values\ @@ -336,11 +337,9 @@ export class ContainerURL extends StorageURL { return this.containerContext.setMetadata({ abortSignal: aborter, - leaseAccessConditions: - options.containerAccessConditions.leaseAccessConditions, + leaseAccessConditions: options.containerAccessConditions.leaseAccessConditions, metadata, - modifiedAccessConditions: - options.containerAccessConditions.modifiedAccessConditions + modifiedAccessConditions: options.containerAccessConditions.modifiedAccessConditions }); } @@ -353,19 +352,17 @@ export class ContainerURL extends StorageURL { * * @see https://docs.microsoft.com/en-us/rest/api/storageservices/get-container-acl * - * @param {Aborter} aborter Create a new Aborter instance with Aborter.none or Aborter.timeout(), - * goto documents of Aborter for more examples about request cancellation - * @param {IContainerGetAccessPolicyOptions} [options] + * @param {ContainerGetAccessPolicyOptions} [options] * @returns {Promise} - * @memberof ContainerURL + * @memberof ContainerClient */ public async getAccessPolicy( - aborter: Aborter, - options: IContainerGetAccessPolicyOptions = {} + options: ContainerGetAccessPolicyOptions = {} ): Promise { if (!options.leaseAccessConditions) { options.leaseAccessConditions = {}; } + const aborter = options.abortSignal || Aborter.none; const response = await this.containerContext.getAccessPolicy({ abortSignal: aborter, @@ -407,20 +404,18 @@ export class ContainerURL extends StorageURL { * removed. * @see https://docs.microsoft.com/en-us/rest/api/storageservices/set-container-acl * - * @param {Aborter} aborter Create a new Aborter instance with Aborter.none or Aborter.timeout(), - * goto documents of Aborter for more examples about request cancellation * @param {PublicAccessType} [access] - * @param {ISignedIdentifier[]} [containerAcl] - * @param {IContainerSetAccessPolicyOptions} [options] + * @param {SignedIdentifier[]} [containerAcl] + * @param {ContainerSetAccessPolicyOptions} [options] * @returns {Promise} - * @memberof ContainerURL + * @memberof ContainerClient */ public async setAccessPolicy( - aborter: Aborter, access?: Models.PublicAccessType, - containerAcl?: ISignedIdentifier[], - options: IContainerSetAccessPolicyOptions = {} + containerAcl?: SignedIdentifier[], + options: ContainerSetAccessPolicyOptions = {} ): Promise { + const aborter = options.abortSignal || Aborter.none; options.containerAccessConditions = options.containerAccessConditions || {}; const acl: Models.SignedIdentifier[] = []; for (const identifier of containerAcl || []) { @@ -438,10 +433,8 @@ export class ContainerURL extends StorageURL { abortSignal: aborter, access, containerAcl: acl, - leaseAccessConditions: - options.containerAccessConditions.leaseAccessConditions, - modifiedAccessConditions: - options.containerAccessConditions.modifiedAccessConditions + leaseAccessConditions: options.containerAccessConditions.leaseAccessConditions, + modifiedAccessConditions: options.containerAccessConditions.modifiedAccessConditions }); } @@ -450,20 +443,18 @@ export class ContainerURL extends StorageURL { * The lock duration can be 15 to 60 seconds, or can be infinite. * @see https://docs.microsoft.com/en-us/rest/api/storageservices/lease-container * - * @param {Aborter} aborter Create a new Aborter instance with Aborter.none or Aborter.timeout(), - * goto documents of Aborter for more examples about request cancellation * @param {string} proposedLeaseId Can be specified in any valid GUID string format * @param {number} duration Must be between 15 to 60 seconds, or infinite (-1) - * @param {IContainerAcquireLeaseOptions} [options] + * @param {ContainerAcquireLeaseOptions} [options] * @returns {Promise} - * @memberof ContainerURL + * @memberof ContainerClient */ public async acquireLease( - aborter: Aborter, proposedLeaseId: string, duration: number, - options: IContainerAcquireLeaseOptions = {} + options: ContainerAcquireLeaseOptions = {} ): Promise { + const aborter = options.abortSignal || Aborter.none; return this.containerContext.acquireLease({ abortSignal: aborter, duration, @@ -477,18 +468,16 @@ export class ContainerURL extends StorageURL { * immediately acquire a lease against the container. * @see https://docs.microsoft.com/en-us/rest/api/storageservices/lease-container * - * @param {Aborter} aborter Create a new Aborter instance with Aborter.none or Aborter.timeout(), - * goto documents of Aborter for more examples about request cancellation * @param {string} leaseId - * @param {IContainerReleaseLeaseOptions} [options] + * @param {ContainerReleaseLeaseOptions} [options] * @returns {Promise} - * @memberof ContainerURL + * @memberof ContainerClient */ public async releaseLease( - aborter: Aborter, leaseId: string, - options: IContainerReleaseLeaseOptions = {} + options: ContainerReleaseLeaseOptions = {} ): Promise { + const aborter = options.abortSignal || Aborter.none; return this.containerContext.releaseLease(leaseId, { abortSignal: aborter, modifiedAccessConditions: options.modifiedAccessConditions @@ -499,18 +488,16 @@ export class ContainerURL extends StorageURL { * To renew an existing lease. * @see https://docs.microsoft.com/en-us/rest/api/storageservices/lease-container * - * @param {Aborter} aborter Create a new Aborter instance with Aborter.none or Aborter.timeout(), - * goto documents of Aborter for more examples about request cancellation * @param {string} leaseId - * @param {IContainerRenewLeaseOptions} [options] + * @param {ContainerRenewLeaseOptions} [options] * @returns {Promise} - * @memberof ContainerURL + * @memberof ContainerClient */ public async renewLease( - aborter: Aborter, leaseId: string, - options: IContainerRenewLeaseOptions = {} + options: ContainerRenewLeaseOptions = {} ): Promise { + const aborter = options.abortSignal || Aborter.none; return this.containerContext.renewLease(leaseId, { abortSignal: aborter, modifiedAccessConditions: options.modifiedAccessConditions @@ -522,18 +509,16 @@ export class ContainerURL extends StorageURL { * until the current lease period has expired. * @see https://docs.microsoft.com/en-us/rest/api/storageservices/lease-container * - * @param {Aborter} aborter Create a new Aborter instance with Aborter.none or Aborter.timeout(), - * goto documents of Aborter for more examples about request cancellation * @param {number} period break period - * @param {IContainerBreakLeaseOptions} [options] + * @param {ContainerBreakLeaseOptions} [options] * @returns {Promise} - * @memberof ContainerURL + * @memberof ContainerClient */ public async breakLease( - aborter: Aborter, period: number, - options: IContainerBreakLeaseOptions = {} + options: ContainerBreakLeaseOptions = {} ): Promise { + const aborter = options.abortSignal || Aborter.none; return this.containerContext.breakLease({ abortSignal: aborter, breakPeriod: period, @@ -545,20 +530,18 @@ export class ContainerURL extends StorageURL { * To change the ID of an existing lease. * @see https://docs.microsoft.com/en-us/rest/api/storageservices/lease-container * - * @param {Aborter} aborter Create a new Aborter instance with Aborter.none or Aborter.timeout(), - * goto documents of Aborter for more examples about request cancellation * @param {string} leaseId * @param {string} proposedLeaseId - * @param {IContainerChangeLeaseOptions} [options] + * @param {ContainerChangeLeaseOptions} [options] * @returns {Promise} - * @memberof ContainerURL + * @memberof ContainerClient */ public async changeLease( - aborter: Aborter, leaseId: string, proposedLeaseId: string, - options: IContainerChangeLeaseOptions = {} + options: ContainerChangeLeaseOptions = {} ): Promise { + const aborter = options.abortSignal || Aborter.none; return this.containerContext.changeLease(leaseId, proposedLeaseId, { abortSignal: aborter, modifiedAccessConditions: options.modifiedAccessConditions @@ -572,18 +555,16 @@ export class ContainerURL extends StorageURL { * (passing the the previously-returned Marker) to get the next segment. * @see https://docs.microsoft.com/rest/api/storageservices/list-blobs * - * @param {Aborter} aborter Create a new Aborter instance with Aborter.none or Aborter.timeout(), - * goto documents of Aborter for more examples about request cancellation * @param {string} [marker] - * @param {IContainerListBlobsSegmentOptions} [options] + * @param {ContainerListBlobsSegmentOptions} [options] * @returns {Promise} - * @memberof ContainerURL + * @memberof ContainerClient */ public async listBlobFlatSegment( - aborter: Aborter, marker?: string, - options: IContainerListBlobsSegmentOptions = {} + options: ContainerListBlobsSegmentOptions = {} ): Promise { + const aborter = options.abortSignal || Aborter.none; return this.containerContext.listBlobFlatSegment({ abortSignal: aborter, marker, @@ -598,19 +579,17 @@ export class ContainerURL extends StorageURL { * again (passing the the previously-returned Marker) to get the next segment. * @see https://docs.microsoft.com/rest/api/storageservices/list-blobs * - * @param {Aborter} aborter Create a new Aborter instance with Aborter.none or Aborter.timeout(), - * goto documents of Aborter for more examples about request cancellation * @param {string} delimiter - * @param {IContainerListBlobsSegmentOptions} [options] + * @param {ContainerListBlobsSegmentOptions} [options] * @returns {Promise} - * @memberof ContainerURL + * @memberof ContainerClient */ public async listBlobHierarchySegment( - aborter: Aborter, delimiter: string, marker?: string, - options: IContainerListBlobsSegmentOptions = {} + options: ContainerListBlobsSegmentOptions = {} ): Promise { + const aborter = options.abortSignal || Aborter.none; return this.containerContext.listBlobHierarchySegment(delimiter, { abortSignal: aborter, marker, diff --git a/sdk/storage/storage-blob/src/ContainerSASPermissions.ts b/sdk/storage/storage-blob/src/ContainerSASPermissions.ts index ae69c426f913..a4c09d98791c 100644 --- a/sdk/storage/storage-blob/src/ContainerSASPermissions.ts +++ b/sdk/storage/storage-blob/src/ContainerSASPermissions.ts @@ -5,7 +5,7 @@ * This is a helper class to construct a string representing the permissions granted by a ServiceSAS to a container. * Setting a value to true means that any SAS which uses these permissions will grant permissions for that operation. * Once all the values are set, this should be serialized with toString and set as the permissions field on a - * {@link IBlobSASSignatureValues} object. It is possible to construct the permissions string without this class, but + * {@link BlobSASSignatureValues} object. It is possible to construct the permissions string without this class, but * the order of the permissions is particular and this class guarantees correctness. * * @export diff --git a/sdk/storage/storage-file/src/IIPRange.ts b/sdk/storage/storage-blob/src/IPRange.ts similarity index 83% rename from sdk/storage/storage-file/src/IIPRange.ts rename to sdk/storage/storage-blob/src/IPRange.ts index a19e43cdb5d0..4e0b31a3a060 100644 --- a/sdk/storage/storage-file/src/IIPRange.ts +++ b/sdk/storage/storage-blob/src/IPRange.ts @@ -5,9 +5,9 @@ * Allowed IP range for a SAS. * * @export - * @interface IIPRange + * @interface IPRange */ -export interface IIPRange { +export interface IPRange { /** * Starting IP address in the IP range. * If end IP doesn't provide, start IP will the only IP allowed. @@ -32,9 +32,9 @@ export interface IIPRange { * "8.8.8.8" or "1.1.1.1-255.255.255.255" * * @export - * @param {IIPRange} ipRange + * @param {IPRange} ipRange * @returns {string} */ -export function ipRangeToString(ipRange: IIPRange): string { +export function ipRangeToString(ipRange: IPRange): string { return ipRange.end ? `${ipRange.start}-${ipRange.end}` : ipRange.start; } diff --git a/sdk/storage/storage-blob/src/LoggingPolicyFactory.ts b/sdk/storage/storage-blob/src/LoggingPolicyFactory.ts index 809625c208d2..9ab0d1f1b4ee 100644 --- a/sdk/storage/storage-blob/src/LoggingPolicyFactory.ts +++ b/sdk/storage/storage-blob/src/LoggingPolicyFactory.ts @@ -1,11 +1,7 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -import { - RequestPolicy, - RequestPolicyFactory, - RequestPolicyOptions -} from "@azure/ms-rest-js"; +import { RequestPolicy, RequestPolicyFactory, RequestPolicyOptions } from "@azure/ms-rest-js"; import { LoggingPolicy } from "./policies/LoggingPolicy"; @@ -13,14 +9,14 @@ import { LoggingPolicy } from "./policies/LoggingPolicy"; * RequestLogOptions configures the retry policy's behavior. * * @export - * @interface IRequestLogOptions + * @interface RequestLogOptions */ -export interface IRequestLogOptions { +export interface RequestLogOptions { /** * LogWarningIfTryOverThreshold logs a warning if a tried operation takes longer than the specified * duration in ms. Default is 3000ms. * @type {number} - * @memberof IRequestLogOptions + * @memberof RequestLogOptions */ logWarningIfTryOverThreshold: number; } @@ -33,16 +29,13 @@ export interface IRequestLogOptions { * @implements {RequestPolicyFactory} */ export class LoggingPolicyFactory implements RequestPolicyFactory { - private readonly loggingOptions?: IRequestLogOptions; + private readonly loggingOptions?: RequestLogOptions; - constructor(loggingOptions?: IRequestLogOptions) { + constructor(loggingOptions?: RequestLogOptions) { this.loggingOptions = loggingOptions; } - public create( - nextPolicy: RequestPolicy, - options: RequestPolicyOptions - ): LoggingPolicy { + public create(nextPolicy: RequestPolicy, options: RequestPolicyOptions): LoggingPolicy { return new LoggingPolicy(nextPolicy, options, this.loggingOptions); } } diff --git a/sdk/storage/storage-blob/src/PageBlobURL.ts b/sdk/storage/storage-blob/src/PageBlobClient.ts similarity index 59% rename from sdk/storage/storage-blob/src/PageBlobURL.ts rename to sdk/storage/storage-blob/src/PageBlobClient.ts index 24d7796cd00c..77be53dcdda8 100644 --- a/sdk/storage/storage-blob/src/PageBlobURL.ts +++ b/sdk/storage/storage-blob/src/PageBlobClient.ts @@ -3,96 +3,100 @@ import { HttpRequestBody, TransferProgressEvent } from "@azure/ms-rest-js"; -import * as Models from "../src/generated/lib/models"; +import * as Models from "./generated/lib/models"; import { Aborter } from "./Aborter"; -import { BlobURL } from "./BlobURL"; -import { ContainerURL } from "./ContainerURL"; +import { BlobClient } from "./BlobClient"; +import { ContainerClient } from "./ContainerClient"; import { PageBlob } from "./generated/lib/operations"; -import { rangeToString } from "./IRange"; -import { - IBlobAccessConditions, - IMetadata, - IPageBlobAccessConditions -} from "./models"; +import { rangeToString } from "./Range"; +import { BlobAccessConditions, Metadata, PageBlobAccessConditions } from "./models"; import { Pipeline } from "./Pipeline"; import { URLConstants } from "./utils/constants"; import { appendToURLPath, setURLParameter } from "./utils/utils.common"; -export interface IPageBlobCreateOptions { - accessConditions?: IBlobAccessConditions; +export interface PageBlobCreateOptions { + abortSignal?: Aborter; + accessConditions?: BlobAccessConditions; blobSequenceNumber?: number; blobHTTPHeaders?: Models.BlobHTTPHeaders; - metadata?: IMetadata; + metadata?: Metadata; } -export interface IPageBlobUploadPagesOptions { - accessConditions?: IPageBlobAccessConditions; +export interface PageBlobUploadPagesOptions { + abortSignal?: Aborter; + accessConditions?: PageBlobAccessConditions; progress?: (progress: TransferProgressEvent) => void; transactionalContentMD5?: Uint8Array; } -export interface IPageBlobClearPagesOptions { - accessConditions?: IPageBlobAccessConditions; +export interface PageBlobClearPagesOptions { + abortSignal?: Aborter; + accessConditions?: PageBlobAccessConditions; } -export interface IPageBlobGetPageRangesOptions { - accessConditions?: IBlobAccessConditions; +export interface PageBlobGetPageRangesOptions { + abortSignal?: Aborter; + accessConditions?: BlobAccessConditions; } -export interface IPageBlobGetPageRangesDiffOptions { - accessConditions?: IBlobAccessConditions; +export interface PageBlobGetPageRangesDiffOptions { + abortSignal?: Aborter; + accessConditions?: BlobAccessConditions; range?: string; } -export interface IPageBlobResizeOptions { - accessConditions?: IBlobAccessConditions; +export interface PageBlobResizeOptions { + abortSignal?: Aborter; + accessConditions?: BlobAccessConditions; } -export interface IPageBlobUpdateSequenceNumberOptions { - accessConditions?: IBlobAccessConditions; +export interface PageBlobUpdateSequenceNumberOptions { + abortSignal?: Aborter; + accessConditions?: BlobAccessConditions; } -export interface IPageBlobStartCopyIncrementalOptions { +export interface PageBlobStartCopyIncrementalOptions { + abortSignal?: Aborter; modifiedAccessConditions?: Models.ModifiedAccessConditions; } /** - * PageBlobURL defines a set of operations applicable to page blobs. + * PageBlobClient defines a set of operations applicable to page blobs. * * @export - * @class PageBlobURL - * @extends {StorageURL} + * @class PageBlobClient + * @extends {StorageClient} */ -export class PageBlobURL extends BlobURL { +export class PageBlobClient extends BlobClient { /** - * Creates a PageBlobURL object from ContainerURL instance. + * Creates a PageBlobClient object from ContainerClient instance. * * @static - * @param {ContainerURL} containerURL A ContainerURL object + * @param {ContainerClient} containerClient A ContainerClient object * @param {string} blobName A page blob name - * @returns {PageBlobURL} - * @memberof PageBlobURL + * @returns {PageBlobClient} + * @memberof PageBlobClient */ - public static fromContainerURL( - containerURL: ContainerURL, + public static fromContainerClient( + containerClient: ContainerClient, blobName: string - ): PageBlobURL { - return new PageBlobURL( - appendToURLPath(containerURL.url, encodeURIComponent(blobName)), - containerURL.pipeline + ): PageBlobClient { + return new PageBlobClient( + appendToURLPath(containerClient.url, encodeURIComponent(blobName)), + containerClient.pipeline ); } /** - * Creates a PageBlobURL object from BlobURL instance. + * Creates a PageBlobClient object from BlobClient instance. * * @static - * @param {BlobURL} blobURL - * @returns {PageBlobURL} - * @memberof PageBlobURL + * @param {BlobClient} blobClient + * @returns {PageBlobClient} + * @memberof PageBlobClient */ - public static fromBlobURL(blobURL: BlobURL): PageBlobURL { - return new PageBlobURL(blobURL.url, blobURL.pipeline); + public static fromBlobClient(blobClient: BlobClient): PageBlobClient { + return new PageBlobClient(blobClient.url, blobClient.pipeline); } /** @@ -100,12 +104,12 @@ export class PageBlobURL extends BlobURL { * * @private * @type {PageBlobs} - * @memberof PageBlobURL + * @memberof PageBlobClient */ private pageBlobContext: PageBlob; /** - * Creates an instance of PageBlobURL. + * Creates an instance of PageBlobClient. * This method accepts an encoded URL or non-encoded URL pointing to a page blob. * Encoded URL string will NOT be escaped twice, only special characters in URL path will be escaped. * If a blob name includes ? or %, blob name must be encoded in the URL. @@ -118,9 +122,9 @@ export class PageBlobURL extends BlobURL { * Encoded URL string will NOT be escaped twice, only special characters in URL path will be escaped. * However, if a blob name includes ? or %, blob name must be encoded in the URL. * Such as a blob named "my?blob%", the URL should be "https://myaccount.blob.core.windows.net/mycontainer/my%3Fblob%25". - * @param {Pipeline} pipeline Call StorageURL.newPipeline() to create a default + * @param {Pipeline} pipeline Call StorageClient.newPipeline() to create a default * pipeline, or provide a customized pipeline. - * @memberof PageBlobURL + * @memberof PageBlobClient */ constructor(url: string, pipeline: Pipeline) { super(url, pipeline); @@ -128,28 +132,28 @@ export class PageBlobURL extends BlobURL { } /** - * Creates a new PageBlobURL object identical to the source but with the + * Creates a new PageBlobClient object identical to the source but with the * specified request policy pipeline. * * @param {Pipeline} pipeline - * @returns {PageBlobURL} - * @memberof PageBlobURL + * @returns {PageBlobClient} + * @memberof PageBlobClient */ - public withPipeline(pipeline: Pipeline): PageBlobURL { - return new PageBlobURL(this.url, pipeline); + public withPipeline(pipeline: Pipeline): PageBlobClient { + return new PageBlobClient(this.url, pipeline); } /** - * Creates a new PageBlobURL object identical to the source but with the + * Creates a new PageBlobClient object identical to the source but with the * specified snapshot timestamp. - * Provide "" will remove the snapshot and return a URL to the base blob. + * Provide "" will remove the snapshot and return a Client to the base blob. * * @param {string} snapshot - * @returns {PageBlobURL} - * @memberof PageBlobURL + * @returns {PageBlobClient} + * @memberof PageBlobClient */ - public withSnapshot(snapshot: string): PageBlobURL { - return new PageBlobURL( + public withSnapshot(snapshot: string): PageBlobClient { + return new PageBlobClient( setURLParameter( this.url, URLConstants.Parameters.SNAPSHOT, @@ -164,18 +168,16 @@ export class PageBlobURL extends BlobURL { * data to a page blob. * @see https://docs.microsoft.com/rest/api/storageservices/put-blob * - * @param {Aborter} aborter Create a new Aborter instance with Aborter.none or Aborter.timeout(), - * goto documents of Aborter for more examples about request cancellation * @param {number} size - * @param {IPageBlobCreateOptions} [options] + * @param {PageBlobCreateOptions} [options] * @returns {Promise} - * @memberof PageBlobURL + * @memberof PageBlobClient */ public async create( - aborter: Aborter, size: number, - options: IPageBlobCreateOptions = {} + options: PageBlobCreateOptions = {} ): Promise { + const aborter = options.abortSignal || Aborter.none; options.accessConditions = options.accessConditions || {}; return this.pageBlobContext.create(0, size, { abortSignal: aborter, @@ -183,8 +185,7 @@ export class PageBlobURL extends BlobURL { blobSequenceNumber: options.blobSequenceNumber, leaseAccessConditions: options.accessConditions.leaseAccessConditions, metadata: options.metadata, - modifiedAccessConditions: - options.accessConditions.modifiedAccessConditions + modifiedAccessConditions: options.accessConditions.modifiedAccessConditions }); } @@ -192,32 +193,28 @@ export class PageBlobURL extends BlobURL { * Writes 1 or more pages to the page blob. The start and end offsets must be a multiple of 512. * @see https://docs.microsoft.com/rest/api/storageservices/put-page * - * @param {Aborter} aborter Create a new Aborter instance with Aborter.none or Aborter.timeout(), - * goto documents of Aborter for more examples about request cancellation * @param {HttpRequestBody} body * @param {number} offset Offset of destination page blob * @param {number} count Content length of body, also how many bytes to be uploaded - * @param {IPageBlobUploadPagesOptions} [options] + * @param {PageBlobUploadPagesOptions} [options] * @returns {Promise} - * @memberof PageBlobURL + * @memberof PageBlobClient */ public async uploadPages( - aborter: Aborter, body: HttpRequestBody, offset: number, count: number, - options: IPageBlobUploadPagesOptions = {} + options: PageBlobUploadPagesOptions = {} ): Promise { + const aborter = options.abortSignal || Aborter.none; options.accessConditions = options.accessConditions || {}; return this.pageBlobContext.uploadPages(body, count, { abortSignal: aborter, leaseAccessConditions: options.accessConditions.leaseAccessConditions, - modifiedAccessConditions: - options.accessConditions.modifiedAccessConditions, + modifiedAccessConditions: options.accessConditions.modifiedAccessConditions, onUploadProgress: options.progress, range: rangeToString({ offset, count }), - sequenceNumberAccessConditions: - options.accessConditions.sequenceNumberAccessConditions, + sequenceNumberAccessConditions: options.accessConditions.sequenceNumberAccessConditions, transactionalContentMD5: options.transactionalContentMD5 }); } @@ -226,29 +223,25 @@ export class PageBlobURL extends BlobURL { * Frees the specified pages from the page blob. * @see https://docs.microsoft.com/rest/api/storageservices/put-page * - * @param {Aborter} aborter Create a new Aborter instance with Aborter.none or Aborter.timeout(), - * goto documents of Aborter for more examples about request cancellation * @param {number} offset * @param {number} count - * @param {IPageBlobClearPagesOptions} [options] + * @param {PageBlobClearPagesOptions} [options] * @returns {Promise} - * @memberof PageBlobURL + * @memberof PageBlobClient */ public async clearPages( - aborter: Aborter, offset: number, count: number, - options: IPageBlobClearPagesOptions = {} + options: PageBlobClearPagesOptions = {} ): Promise { + const aborter = options.abortSignal || Aborter.none; options.accessConditions = options.accessConditions || {}; return this.pageBlobContext.clearPages(0, { abortSignal: aborter, leaseAccessConditions: options.accessConditions.leaseAccessConditions, - modifiedAccessConditions: - options.accessConditions.modifiedAccessConditions, + modifiedAccessConditions: options.accessConditions.modifiedAccessConditions, range: rangeToString({ offset, count }), - sequenceNumberAccessConditions: - options.accessConditions.sequenceNumberAccessConditions + sequenceNumberAccessConditions: options.accessConditions.sequenceNumberAccessConditions }); } @@ -256,26 +249,23 @@ export class PageBlobURL extends BlobURL { * Returns the list of valid page ranges for a page blob or snapshot of a page blob. * @see https://docs.microsoft.com/rest/api/storageservices/get-page-ranges * - * @param {Aborter} aborter Create a new Aborter instance with Aborter.none or Aborter.timeout(), - * goto documents of Aborter for more examples about request cancellation * @param {number} offset * @param {number} count - * @param {IPageBlobGetPageRangesOptions} [options] + * @param {PageBlobGetPageRangesOptions} [options] * @returns {Promise} - * @memberof PageBlobURL + * @memberof PageBlobClient */ public async getPageRanges( - aborter: Aborter, offset: number, count: number, - options: IPageBlobGetPageRangesOptions = {} + options: PageBlobGetPageRangesOptions = {} ): Promise { + const aborter = options.abortSignal || Aborter.none; options.accessConditions = options.accessConditions || {}; return this.pageBlobContext.getPageRanges({ abortSignal: aborter, leaseAccessConditions: options.accessConditions.leaseAccessConditions, - modifiedAccessConditions: - options.accessConditions.modifiedAccessConditions, + modifiedAccessConditions: options.accessConditions.modifiedAccessConditions, range: rangeToString({ offset, count }) }); } @@ -284,28 +274,25 @@ export class PageBlobURL extends BlobURL { * Gets the collection of page ranges that differ between a specified snapshot and this page blob. * @see https://docs.microsoft.com/rest/api/storageservices/get-page-ranges * - * @param {Aborter} aborter Create a new Aborter instance with Aborter.none or Aborter.timeout(), - * goto documents of Aborter for more examples about request cancellation * @param {number} offset * @param {number} count * @param {string} prevSnapshot - * @param {IPageBlobGetPageRangesDiffOptions} [options] + * @param {PageBlobGetPageRangesDiffOptions} [options] * @returns {Promise} - * @memberof PageBlobURL + * @memberof PageBlobClient */ public async getPageRangesDiff( - aborter: Aborter, offset: number, count: number, prevSnapshot: string, - options: IPageBlobGetPageRangesDiffOptions = {} + options: PageBlobGetPageRangesDiffOptions = {} ): Promise { + const aborter = options.abortSignal || Aborter.none; options.accessConditions = options.accessConditions || {}; return this.pageBlobContext.getPageRangesDiff({ abortSignal: aborter, leaseAccessConditions: options.accessConditions.leaseAccessConditions, - modifiedAccessConditions: - options.accessConditions.modifiedAccessConditions, + modifiedAccessConditions: options.accessConditions.modifiedAccessConditions, prevsnapshot: prevSnapshot, range: rangeToString({ offset, count }) }); @@ -315,24 +302,21 @@ export class PageBlobURL extends BlobURL { * Resizes the page blob to the specified size (which must be a multiple of 512). * @see https://docs.microsoft.com/rest/api/storageservices/set-blob-properties * - * @param {Aborter} aborter Create a new Aborter instance with Aborter.none or Aborter.timeout(), - * goto documents of Aborter for more examples about request cancellation * @param {number} size - * @param {IPageBlobResizeOptions} [options] + * @param {PageBlobResizeOptions} [options] * @returns {Promise} - * @memberof PageBlobURL + * @memberof PageBlobClient */ public async resize( - aborter: Aborter, size: number, - options: IPageBlobResizeOptions = {} + options: PageBlobResizeOptions = {} ): Promise { + const aborter = options.abortSignal || Aborter.none; options.accessConditions = options.accessConditions || {}; return this.pageBlobContext.resize(size, { abortSignal: aborter, leaseAccessConditions: options.accessConditions.leaseAccessConditions, - modifiedAccessConditions: - options.accessConditions.modifiedAccessConditions + modifiedAccessConditions: options.accessConditions.modifiedAccessConditions }); } @@ -340,27 +324,24 @@ export class PageBlobURL extends BlobURL { * Sets a page blob's sequence number. * @see https://docs.microsoft.com/en-us/rest/api/storageservices/set-blob-properties * - * @param {Aborter} aborter Create a new Aborter instance with Aborter.none or Aborter.timeout(), - * goto documents of Aborter for more examples about request cancellation * @param {Models.SequenceNumberActionType} sequenceNumberAction * @param {number} [sequenceNumber] Required if sequenceNumberAction is max or update - * @param {IPageBlobUpdateSequenceNumberOptions} [options] + * @param {PageBlobUpdateSequenceNumberOptions} [options] * @returns {Promise} - * @memberof PageBlobURL + * @memberof PageBlobClient */ public async updateSequenceNumber( - aborter: Aborter, sequenceNumberAction: Models.SequenceNumberActionType, sequenceNumber?: number, - options: IPageBlobUpdateSequenceNumberOptions = {} + options: PageBlobUpdateSequenceNumberOptions = {} ): Promise { + const aborter = options.abortSignal || Aborter.none; options.accessConditions = options.accessConditions || {}; return this.pageBlobContext.updateSequenceNumber(sequenceNumberAction, { abortSignal: aborter, blobSequenceNumber: sequenceNumber, leaseAccessConditions: options.accessConditions.leaseAccessConditions, - modifiedAccessConditions: - options.accessConditions.modifiedAccessConditions + modifiedAccessConditions: options.accessConditions.modifiedAccessConditions }); } @@ -372,19 +353,17 @@ export class PageBlobURL extends BlobURL { * @see https://docs.microsoft.com/rest/api/storageservices/incremental-copy-blob * @see https://docs.microsoft.com/en-us/azure/virtual-machines/windows/incremental-snapshots * - * @param {Aborter} aborter Create a new Aborter instance with Aborter.none or Aborter.timeout(), - * goto documents of Aborter for more examples about request cancellation * @param {string} copySource Specifies the name of the source page blob snapshot. For example, * https://myaccount.blob.core.windows.net/mycontainer/myblob?snapshot= - * @param {IPageBlobStartCopyIncrementalOptions} [options] + * @param {PageBlobStartCopyIncrementalOptions} [options] * @returns {Promise} - * @memberof PageBlobURL + * @memberof PageBlobClient */ public async startCopyIncremental( - aborter: Aborter, copySource: string, - options: IPageBlobStartCopyIncrementalOptions = {} + options: PageBlobStartCopyIncrementalOptions = {} ): Promise { + const aborter = options.abortSignal || Aborter.none; return this.pageBlobContext.copyIncremental(copySource, { abortSignal: aborter, modifiedAccessConditions: options.modifiedAccessConditions diff --git a/sdk/storage/storage-blob/src/Pipeline.ts b/sdk/storage/storage-blob/src/Pipeline.ts index 98095c51b197..c41c3c660aff 100644 --- a/sdk/storage/storage-blob/src/Pipeline.ts +++ b/sdk/storage/storage-blob/src/Pipeline.ts @@ -36,18 +36,18 @@ export { * Option interface for Pipeline constructor. * * @export - * @interface IPipelineOptions + * @interface PipelineOptions */ -export interface IPipelineOptions { +export interface PipelineOptions { logger?: IHttpPipelineLogger; HTTPClient?: IHttpClient; } /** * A Pipeline class containing HTTP request policies. - * You can create a default Pipeline by calling StorageURL.newPipeline(). + * You can create a default Pipeline by calling StorageClient.newPipeline(). * Or you can create a Pipeline with your own policies by the constructor of Pipeline. - * Refer to StorageURL.newPipeline() and provided policies as reference before + * Refer to StorageClient.newPipeline() and provided policies as reference before * implementing your customized Pipeline. * * @export @@ -55,19 +55,16 @@ export interface IPipelineOptions { */ export class Pipeline { public readonly factories: RequestPolicyFactory[]; - public readonly options: IPipelineOptions; + public readonly options: PipelineOptions; /** * Creates an instance of Pipeline. Customize HTTPClient by implementing IHttpClient interface. * * @param {RequestPolicyFactory[]} factories - * @param {IPipelineOptions} [options={}] + * @param {PipelineOptions} [options={}] * @memberof Pipeline */ - constructor( - factories: RequestPolicyFactory[], - options: IPipelineOptions = {} - ) { + constructor(factories: RequestPolicyFactory[], options: PipelineOptions = {}) { this.factories = factories; this.options = options; } diff --git a/sdk/storage/storage-blob/src/IRange.ts b/sdk/storage/storage-blob/src/Range.ts similarity index 72% rename from sdk/storage/storage-blob/src/IRange.ts rename to sdk/storage/storage-blob/src/Range.ts index ddc1c07501d2..8f1ed64d5814 100644 --- a/sdk/storage/storage-blob/src/IRange.ts +++ b/sdk/storage/storage-blob/src/Range.ts @@ -7,14 +7,14 @@ * @see https://docs.microsoft.com/en-us/rest/api/storageservices/specifying-the-range-header-for-blob-service-operations * * @export - * @interface IRange + * @interface Range */ -export interface IRange { +export interface Range { /** * StartByte, larger than or equal 0. * * @type {string} - * @memberof IRange + * @memberof Range */ offset: number; /** @@ -22,7 +22,7 @@ export interface IRange { * If not provided, will return bytes from offset to the end. * * @type {string} - * @memberof IRange + * @memberof Range */ count?: number; } @@ -33,16 +33,16 @@ export interface IRange { * "bytes=255-" or "bytes=0-511" * * @export - * @param {IRange} iRange + * @param {Range} iRange * @returns {string} */ -export function rangeToString(iRange: IRange): string { +export function rangeToString(iRange: Range): string { if (iRange.offset < 0) { - throw new RangeError(`IRange.offset cannot be smaller than 0.`); + throw new RangeError(`Range.offset cannot be smaller than 0.`); } if (iRange.count && iRange.count <= 0) { throw new RangeError( - `IRange.count must be larger than 0. Leave it undefined if you want a range from offset to the end.` + `Range.count must be larger than 0. Leave it undefined if you want a range from offset to the end.` ); } return iRange.count diff --git a/sdk/storage/storage-blob/src/RetryPolicyFactory.ts b/sdk/storage/storage-blob/src/RetryPolicyFactory.ts index d3c197f6f100..2509f225e790 100644 --- a/sdk/storage/storage-blob/src/RetryPolicyFactory.ts +++ b/sdk/storage/storage-blob/src/RetryPolicyFactory.ts @@ -1,21 +1,16 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -import { - RequestPolicy, - RequestPolicyFactory, - RequestPolicyOptions -} from "@azure/ms-rest-js"; - +import { RequestPolicy, RequestPolicyFactory, RequestPolicyOptions } from "@azure/ms-rest-js"; import { RetryPolicy, RetryPolicyType } from "./policies/RetryPolicy"; /** * Retry options interface. * * @export - * @interface IRetryOptions + * @interface RetryOptions */ -export interface IRetryOptions { +export interface RetryOptions { /** * Optional. RetryPolicyType, default is exponential retry policy. * @@ -30,7 +25,7 @@ export interface IRetryOptions { * A value smaller than 1 means default retry number of attempts. * * @type {number} - * @memberof IRetryOptions + * @memberof RetryOptions */ readonly maxTries?: number; @@ -42,7 +37,7 @@ export interface IRetryOptions { * @see https://docs.microsoft.com/en-us/rest/api/storageservices/setting-timeouts-for-blob-service-operations * * @type {number} - * @memberof IRetryOptions + * @memberof RetryOptions */ readonly tryTimeoutInMs?: number; @@ -52,7 +47,7 @@ export interface IRetryOptions { * maxRetryDelayInMs. If you specify 0, then you must also specify 0 for maxRetryDelayInMs. * * @type {number} - * @memberof IRetryOptions + * @memberof RetryOptions */ readonly retryDelayInMs?: number; @@ -61,7 +56,7 @@ export interface IRetryOptions { * If you specify 0, then you must also specify 0 for retryDelayInMs. * * @type {number} - * @memberof IRetryOptions + * @memberof RetryOptions */ readonly maxRetryDelayInMs?: number; @@ -74,7 +69,7 @@ export interface IRetryOptions { * {@link https://docs.microsoft.com/en-us/azure/storage/common/storage-designing-ha-apps-with-ragrs} * * @type {string} - * @memberof IRetryOptions + * @memberof RetryOptions */ readonly secondaryHost?: string; } @@ -87,21 +82,18 @@ export interface IRetryOptions { * @implements {RequestPolicyFactory} */ export class RetryPolicyFactory implements RequestPolicyFactory { - private retryOptions?: IRetryOptions; + private retryOptions?: RetryOptions; /** * Creates an instance of RetryPolicyFactory. - * @param {IRetryOptions} [retryOptions] + * @param {RetryOptions} [retryOptions] * @memberof RetryPolicyFactory */ - constructor(retryOptions?: IRetryOptions) { + constructor(retryOptions?: RetryOptions) { this.retryOptions = retryOptions; } - public create( - nextPolicy: RequestPolicy, - options: RequestPolicyOptions - ): RetryPolicy { + public create(nextPolicy: RequestPolicy, options: RequestPolicyOptions): RetryPolicy { return new RetryPolicy(nextPolicy, options, this.retryOptions); } } diff --git a/sdk/storage/storage-blob/src/SASQueryParameters.ts b/sdk/storage/storage-blob/src/SASQueryParameters.ts index 52eb7bae2d9e..230c0750be15 100644 --- a/sdk/storage/storage-blob/src/SASQueryParameters.ts +++ b/sdk/storage/storage-blob/src/SASQueryParameters.ts @@ -1,7 +1,7 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -import { IIPRange, ipRangeToString } from "./IIPRange"; +import { IPRange, ipRangeToString } from "./IPRange"; import { truncatedISO8061Date } from "./utils/utils.common"; /** @@ -24,7 +24,7 @@ export enum SASProtocol { /** * Represents the components that make up an Azure Storage SAS' query parameters. This type is not constructed directly - * by the user; it is only generated by the {@link IAccountSASSignatureValues} and {@link IBlobSASSignatureValues} + * by the user; it is only generated by the {@link AccountSASSignatureValues} and {@link BlobSASSignatureValues} * types. Once generated, it can be encoded into a {@code String} and appended to a URL directly (though caution should * be taken here in case there are existing query parameters, which might affect the appropriate means of appending * these query parameters). @@ -96,7 +96,7 @@ export class SASQueryParameters { public readonly resourceTypes?: string; /** - * Optional. The signed identifier (only for {@link IBlobSASSignatureValues}). + * Optional. The signed identifier (only for {@link BlobSASSignatureValues}). * * @see https://docs.microsoft.com/en-us/rest/api/storageservices/establishing-a-stored-access-policy * @@ -106,7 +106,7 @@ export class SASQueryParameters { public readonly identifier?: string; /** - * Optional. The storage container or blob (only for {@link IBlobSASSignatureValues}). + * Optional. The storage container or blob (only for {@link BlobSASSignatureValues}). * * @type {string} * @memberof SASQueryParameters @@ -165,19 +165,19 @@ export class SASQueryParameters { * Inner value of getter ipRange. * * @private - * @type {IIPRange} + * @type {IPRange} * @memberof SASQueryParameters */ - private readonly ipRangeInner?: IIPRange; + private readonly ipRangeInner?: IPRange; /** * Optional. IP range allowed for this SAS. * * @readonly - * @type {(IIPRange | undefined)} + * @type {(IPRange | undefined)} * @memberof SASQueryParameters */ - public get ipRange(): IIPRange | undefined { + public get ipRange(): IPRange | undefined { if (this.ipRangeInner) { return { end: this.ipRangeInner.end, @@ -198,7 +198,7 @@ export class SASQueryParameters { * @param {SASProtocol} [protocol] Representing the allowed HTTP protocol(s) * @param {Date} [startTime] Representing the start time for this SAS token * @param {Date} [expiryTime] Representing the expiry time for this SAS token - * @param {IIPRange} [ipRange] Representing the range of valid IP addresses for this SAS token + * @param {IPRange} [ipRange] Representing the range of valid IP addresses for this SAS token * @param {string} [identifier] Representing the signed identifier (only for Service SAS) * @param {string} [resource] Representing the storage container or blob (only for Service SAS) * @param {string} [cacheControl] Representing the cache-control header (only for Blob/File Service SAS) @@ -217,7 +217,7 @@ export class SASQueryParameters { protocol?: SASProtocol, startTime?: Date, expiryTime?: Date, - ipRange?: IIPRange, + ipRange?: IPRange, identifier?: string, resource?: string, cacheControl?: string, @@ -289,18 +289,14 @@ export class SASQueryParameters { this.tryAppendQueryParameter( queries, param, - this.startTime - ? truncatedISO8061Date(this.startTime, false) - : undefined + this.startTime ? truncatedISO8061Date(this.startTime, false) : undefined ); break; case "se": this.tryAppendQueryParameter( queries, param, - this.expiryTime - ? truncatedISO8061Date(this.expiryTime, false) - : undefined + this.expiryTime ? truncatedISO8061Date(this.expiryTime, false) : undefined ); break; case "sip": @@ -352,11 +348,7 @@ export class SASQueryParameters { * @returns {void} * @memberof SASQueryParameters */ - private tryAppendQueryParameter( - queries: string[], - key: string, - value?: string - ): void { + private tryAppendQueryParameter(queries: string[], key: string, value?: string): void { if (!value) { return; } diff --git a/sdk/storage/storage-blob/src/StorageURL.ts b/sdk/storage/storage-blob/src/StorageClient.ts similarity index 79% rename from sdk/storage/storage-blob/src/StorageURL.ts rename to sdk/storage/storage-blob/src/StorageClient.ts index f1abc62016b9..327b3de798c3 100644 --- a/sdk/storage/storage-blob/src/StorageURL.ts +++ b/sdk/storage/storage-blob/src/StorageClient.ts @@ -8,11 +8,8 @@ import { Credential } from "./credentials/Credential"; import { StorageClientContext } from "./generated/lib/storageClientContext"; import { LoggingPolicyFactory } from "./LoggingPolicyFactory"; import { IHttpClient, IHttpPipelineLogger, Pipeline } from "./Pipeline"; -import { IRetryOptions, RetryPolicyFactory } from "./RetryPolicyFactory"; -import { - ITelemetryOptions, - TelemetryPolicyFactory -} from "./TelemetryPolicyFactory"; +import { RetryOptions, RetryPolicyFactory } from "./RetryPolicyFactory"; +import { TelemetryOptions, TelemetryPolicyFactory } from "./TelemetryPolicyFactory"; import { UniqueRequestIDPolicyFactory } from "./UniqueRequestIDPolicyFactory"; import { escapeURLPath } from "./utils/utils.common"; @@ -22,41 +19,41 @@ export { deserializationPolicy }; * Option interface for Pipeline.newPipeline method. * * @export - * @interface INewPipelineOptions + * @interface NewPipelineOptions */ -export interface INewPipelineOptions { +export interface NewPipelineOptions { /** * Telemetry configures the built-in telemetry policy behavior. * - * @type {ITelemetryOptions} - * @memberof INewPipelineOptions + * @type {TelemetryOptions} + * @memberof NewPipelineOptions */ - telemetry?: ITelemetryOptions; - retryOptions?: IRetryOptions; + telemetry?: TelemetryOptions; + retryOptions?: RetryOptions; logger?: IHttpPipelineLogger; httpClient?: IHttpClient; } /** - * A ServiceURL represents a based URL class for ServiceURL, ContainerURL and etc. + * A StorageClient represents a based URL class for BlobServiceClient, ContainerClient and etc. * * @export - * @class StorageURL + * @class StorageClient */ -export abstract class StorageURL { +export abstract class StorageClient { /** * A static method used to create a new Pipeline object with Credential provided. * * @static * @param {Credential} credential Such as AnonymousCredential, SharedKeyCredential or TokenCredential. - * @param {INewPipelineOptions} [pipelineOptions] Optional. Options. + * @param {NewPipelineOptions} [pipelineOptions] Optional. Options. * @returns {Pipeline} A new Pipeline object. * @memberof Pipeline */ public static newPipeline( credential: Credential, - pipelineOptions: INewPipelineOptions = {} + pipelineOptions: NewPipelineOptions = {} ): Pipeline { // Order is important. Closer to the API at the top & closer to the network at the bottom. // The credential's policy factory must appear close to the wire so it can sign any @@ -82,7 +79,7 @@ export abstract class StorageURL { * * @internal * @type {Pipeline} - * @memberof StorageURL + * @memberof StorageClient */ public readonly pipeline: Pipeline; @@ -90,7 +87,7 @@ export abstract class StorageURL { * Encoded URL string value. * * @type {string} - * @memberof StorageURL + * @memberof StorageClient */ public readonly url: string; @@ -100,15 +97,15 @@ export abstract class StorageURL { * * @protected * @type {StorageClient} - * @memberof StorageURL + * @memberof StorageClient */ protected readonly storageClientContext: StorageClientContext; /** - * Creates an instance of StorageURL. + * Creates an instance of StorageClient. * @param {string} url * @param {Pipeline} pipeline - * @memberof StorageURL + * @memberof StorageClient */ protected constructor(url: string, pipeline: Pipeline) { // URL should be encoded and only once, protocol layer shouldn't encode URL again diff --git a/sdk/storage/storage-blob/src/TelemetryPolicyFactory.ts b/sdk/storage/storage-blob/src/TelemetryPolicyFactory.ts index eb3b0dddd988..3804b8d6b3d7 100644 --- a/sdk/storage/storage-blob/src/TelemetryPolicyFactory.ts +++ b/sdk/storage/storage-blob/src/TelemetryPolicyFactory.ts @@ -16,9 +16,9 @@ import { SDK_VERSION } from "./utils/constants"; * Interface of TelemetryPolicy options. * * @export - * @interface ITelemetryOptions + * @interface TelemetryOptions */ -export interface ITelemetryOptions { +export interface TelemetryOptions { value: string; } @@ -34,19 +34,16 @@ export class TelemetryPolicyFactory implements RequestPolicyFactory { /** * Creates an instance of TelemetryPolicyFactory. - * @param {ITelemetryOptions} [telemetry] + * @param {TelemetryOptions} [telemetry] * @memberof TelemetryPolicyFactory */ - constructor(telemetry?: ITelemetryOptions) { + constructor(telemetry?: TelemetryOptions) { const userAgentInfo: string[] = []; if (isNode) { if (telemetry) { const telemetryString = telemetry.value; - if ( - telemetryString.length > 0 && - userAgentInfo.indexOf(telemetryString) === -1 - ) { + if (telemetryString.length > 0 && userAgentInfo.indexOf(telemetryString) === -1) { userAgentInfo.push(telemetryString); } } @@ -58,9 +55,7 @@ export class TelemetryPolicyFactory implements RequestPolicyFactory { } // e.g. (NODE-VERSION 4.9.1; Windows_NT 10.0.16299) - const runtimeInfo = `(NODE-VERSION ${ - process.version - }; ${os.type()} ${os.release()})`; + const runtimeInfo = `(NODE-VERSION ${process.version}; ${os.type()} ${os.release()})`; if (userAgentInfo.indexOf(runtimeInfo) === -1) { userAgentInfo.push(runtimeInfo); } @@ -69,10 +64,7 @@ export class TelemetryPolicyFactory implements RequestPolicyFactory { this.telemetryString = userAgentInfo.join(" "); } - public create( - nextPolicy: RequestPolicy, - options: RequestPolicyOptions - ): TelemetryPolicy { + public create(nextPolicy: RequestPolicy, options: RequestPolicyOptions): TelemetryPolicy { return new TelemetryPolicy(nextPolicy, options, this.telemetryString); } } diff --git a/sdk/storage/storage-blob/src/UniqueRequestIDPolicyFactory.ts b/sdk/storage/storage-blob/src/UniqueRequestIDPolicyFactory.ts index c9fe0a139c8c..b891c8512d60 100644 --- a/sdk/storage/storage-blob/src/UniqueRequestIDPolicyFactory.ts +++ b/sdk/storage/storage-blob/src/UniqueRequestIDPolicyFactory.ts @@ -1,12 +1,7 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -import { - RequestPolicy, - RequestPolicyFactory, - RequestPolicyOptions -} from "@azure/ms-rest-js"; - +import { RequestPolicy, RequestPolicyFactory, RequestPolicyOptions } from "@azure/ms-rest-js"; import { UniqueRequestIDPolicy } from "./policies/UniqueRequestIDPolicy"; /** @@ -17,10 +12,7 @@ import { UniqueRequestIDPolicy } from "./policies/UniqueRequestIDPolicy"; * @implements {RequestPolicyFactory} */ export class UniqueRequestIDPolicyFactory implements RequestPolicyFactory { - public create( - nextPolicy: RequestPolicy, - options: RequestPolicyOptions - ): UniqueRequestIDPolicy { + public create(nextPolicy: RequestPolicy, options: RequestPolicyOptions): UniqueRequestIDPolicy { return new UniqueRequestIDPolicy(nextPolicy, options); } } diff --git a/sdk/storage/storage-blob/src/credentials/Credential.ts b/sdk/storage/storage-blob/src/credentials/Credential.ts index 602569eec425..1150f504dc4d 100644 --- a/sdk/storage/storage-blob/src/credentials/Credential.ts +++ b/sdk/storage/storage-blob/src/credentials/Credential.ts @@ -1,12 +1,7 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -import { - RequestPolicy, - RequestPolicyFactory, - RequestPolicyOptions -} from "@azure/ms-rest-js"; - +import { RequestPolicy, RequestPolicyFactory, RequestPolicyOptions } from "@azure/ms-rest-js"; import { CredentialPolicy } from "../policies/CredentialPolicy"; /** diff --git a/sdk/storage/storage-blob/src/credentials/TokenCredential.ts b/sdk/storage/storage-blob/src/credentials/TokenCredential.ts index 4d15eb57fed3..8265157d0bc3 100644 --- a/sdk/storage/storage-blob/src/credentials/TokenCredential.ts +++ b/sdk/storage/storage-blob/src/credentials/TokenCredential.ts @@ -12,10 +12,10 @@ import { TokenCredentialPolicy } from "../policies/TokenCredentialPolicy"; * * @example * const tokenCredential = new TokenCredential("token"); - * const pipeline = StorageURL.newPipeline(tokenCredential); + * const pipeline = StorageClient.newPipeline(tokenCredential); * * // List containers - * const serviceURL = new ServiceURL("https://mystorageaccount.blob.core.windows.net", pipeline); + * const blobServiceClient = new BlobServiceClient("https://mystorageaccount.blob.core.windows.net", pipeline); * * // Set up a timer to refresh the token * const timerID = setInterval(() => { @@ -59,10 +59,7 @@ export class TokenCredential extends Credential { * @returns {TokenCredentialPolicy} * @memberof TokenCredential */ - public create( - nextPolicy: RequestPolicy, - options: RequestPolicyOptions - ): TokenCredentialPolicy { + public create(nextPolicy: RequestPolicy, options: RequestPolicyOptions): TokenCredentialPolicy { return new TokenCredentialPolicy(nextPolicy, options, this); } } diff --git a/sdk/storage/storage-blob/src/highlevel.browser.ts b/sdk/storage/storage-blob/src/highlevel.browser.ts index 344b6ea1bd48..a1f5a13dc314 100644 --- a/sdk/storage/storage-blob/src/highlevel.browser.ts +++ b/sdk/storage/storage-blob/src/highlevel.browser.ts @@ -3,12 +3,8 @@ import { generateUuid } from "@azure/ms-rest-js"; -import { Aborter } from "./Aborter"; -import { BlockBlobURL } from "./BlockBlobURL"; -import { - BlobUploadCommonResponse, - IUploadToBlockBlobOptions -} from "./highlevel.common"; +import { BlockBlobClient } from "./BlockBlobClient"; +import { BlobUploadCommonResponse, UploadToBlockBlobOptions } from "./highlevel.common"; import { Batch } from "./utils/Batch"; import { BLOCK_BLOB_MAX_BLOCKS, @@ -28,27 +24,23 @@ import { generateBlockID } from "./utils/utils.common"; * to commit the block list. * * @export - * @param {Aborter} aborter Create a new Aborter instance with Aborter.none or Aborter.timeout(), - * goto documents of Aborter for more examples about request cancellation * @param {Blob | ArrayBuffer | ArrayBufferView} browserData Blob, File, ArrayBuffer or ArrayBufferView - * @param {BlockBlobURL} blockBlobURL - * @param {IUploadToBlockBlobOptions} [options] + * @param {BlockBlobClient} blockBlobClient + * @param {UploadToBlockBlobOptions} [options] * @returns {Promise} */ export async function uploadBrowserDataToBlockBlob( - aborter: Aborter, browserData: Blob | ArrayBuffer | ArrayBufferView, - blockBlobURL: BlockBlobURL, - options?: IUploadToBlockBlobOptions + blockBlobClient: BlockBlobClient, + options?: UploadToBlockBlobOptions ): Promise { const browserBlob = new Blob([browserData]); return UploadSeekableBlobToBlockBlob( - aborter, (offset: number, size: number): Blob => { return browserBlob.slice(offset, offset + size); }, browserBlob.size, - blockBlobURL, + blockBlobClient, options ); } @@ -63,28 +55,22 @@ export async function uploadBrowserDataToBlockBlob( * Otherwise, this method will call stageBlock to upload blocks, and finally call commitBlockList * to commit the block list. * - * @param {Aborter} aborter Create a new Aborter instance with Aborter.none or Aborter.timeout(), - * goto documents of Aborter for more examples about request cancellation * @param {(offset: number, size: number) => Blob} blobFactory * @param {number} size - * @param {BlockBlobURL} blockBlobURL - * @param {IUploadToBlockBlobOptions} [options] + * @param {BlockBlobClient} blockBlobClient + * @param {UploadToBlockBlobOptions} [options] * @returns {Promise} */ async function UploadSeekableBlobToBlockBlob( - aborter: Aborter, blobFactory: (offset: number, size: number) => Blob, size: number, - blockBlobURL: BlockBlobURL, - options: IUploadToBlockBlobOptions = {} + blockBlobClient: BlockBlobClient, + options: UploadToBlockBlobOptions = {} ): Promise { if (!options.blockSize) { options.blockSize = 0; } - if ( - options.blockSize < 0 || - options.blockSize > BLOCK_BLOB_MAX_STAGE_BLOCK_BYTES - ) { + if (options.blockSize < 0 || options.blockSize > BLOCK_BLOB_MAX_STAGE_BLOCK_BYTES) { throw new RangeError( `blockSize option must be >= 0 and <= ${BLOCK_BLOB_MAX_STAGE_BLOCK_BYTES}` ); @@ -121,7 +107,7 @@ async function UploadSeekableBlobToBlockBlob( } if (size <= options.maxSingleShotSize) { - return blockBlobURL.upload(aborter, blobFactory(0, size), size, options); + return blockBlobClient.upload(blobFactory(0, size), size, options); } const numBlocks: number = Math.floor((size - 1) / options.blockSize) + 1; @@ -145,12 +131,12 @@ async function UploadSeekableBlobToBlockBlob( const end = i === numBlocks - 1 ? size : start + options.blockSize!; const contentLength = end - start; blockList.push(blockID); - await blockBlobURL.stageBlock( - aborter, + await blockBlobClient.stageBlock( blockID, blobFactory(start, contentLength), contentLength, { + abortSignal: options.abortSignal, leaseAccessConditions: options.blobAccessConditions! .leaseAccessConditions } @@ -168,5 +154,5 @@ async function UploadSeekableBlobToBlockBlob( } await batch.do(); - return blockBlobURL.commitBlockList(aborter, blockList, options); + return blockBlobClient.commitBlockList(blockList, options); } diff --git a/sdk/storage/storage-blob/src/highlevel.common.ts b/sdk/storage/storage-blob/src/highlevel.common.ts index a4af12b21db1..6b3b2485fa6b 100644 --- a/sdk/storage/storage-blob/src/highlevel.common.ts +++ b/sdk/storage/storage-blob/src/highlevel.common.ts @@ -3,21 +3,32 @@ import { HttpResponse, TransferProgressEvent } from "@azure/ms-rest-js"; +import { Aborter } from "./Aborter"; import * as Models from "./generated/lib/models"; -import { IBlobAccessConditions } from "./models"; +import { BlobAccessConditions } from "./models"; /** * Option interface for uploadFileToBlockBlob and uploadSeekableStreamToBlockBlob. * * @export - * @interface IUploadToBlockBlobOptions + * @interface UploadToBlockBlobOptions */ -export interface IUploadToBlockBlobOptions { +export interface UploadToBlockBlobOptions { + /** + * Aborter instance to cancel request. It can be created with Aborter.none + * or Aborter.timeout(). Go to documents of {@link Aborter} for more examples + * about request cancellation. + * + * @type {Aborter} + * @memberof IUploadToBlockBlobOptions + */ + abortSignal?: Aborter; + /** * Destination block blob size in bytes. * * @type {number} - * @memberof IUploadToBlockBlobOptions + * @memberof UploadToBlockBlobOptions */ blockSize?: number; @@ -28,14 +39,14 @@ export interface IUploadToBlockBlobOptions { * You can customize a value less equal than the default value. * * @type {number} - * @memberof IUploadToBlockBlobOptions + * @memberof UploadToBlockBlobOptions */ maxSingleShotSize?: number; /** * Progress updater. * - * @memberof IUploadToBlockBlobOptions + * @memberof UploadToBlockBlobOptions */ progress?: (progress: TransferProgressEvent) => void; @@ -43,7 +54,7 @@ export interface IUploadToBlockBlobOptions { * Blob HTTP Headers. * * @type {IBlobHTTPHeaders} - * @memberof IUploadToBlockBlobOptions + * @memberof UploadToBlockBlobOptions */ blobHTTPHeaders?: Models.BlobHTTPHeaders; @@ -51,23 +62,23 @@ export interface IUploadToBlockBlobOptions { * Metadata of block blob. * * @type {{ [propertyName: string]: string }} - * @memberof IUploadToBlockBlobOptions + * @memberof UploadToBlockBlobOptions */ metadata?: { [propertyName: string]: string }; /** * Access conditions headers. * - * @type {IBlobAccessConditions} - * @memberof IUploadToBlockBlobOptions + * @type {BlobAccessConditions} + * @memberof UploadToBlockBlobOptions */ - blobAccessConditions?: IBlobAccessConditions; + blobAccessConditions?: BlobAccessConditions; /** * Concurrency of parallel uploading. Must be >= 0. * * @type {number} - * @memberof IUploadToBlockBlobOptions + * @memberof UploadToBlockBlobOptions */ parallelism?: number; } @@ -91,16 +102,26 @@ export type BlobUploadCommonResponse = Models.BlockBlobUploadHeaders & { * Option interface for DownloadBlockBlobToBuffer. * * @export - * @interface IDownloadFromBlobOptions + * @interface DownloadFromBlobOptions */ -export interface IDownloadFromBlobOptions { +export interface DownloadFromBlobOptions { + /** + * Aborter instance to cancel request. It can be created with Aborter.none + * or Aborter.timeout(). Go to documents of {@link Aborter} for more examples + * about request cancellation. + * + * @type {Aborter} + * @memberof IUploadToBlockBlobOptions + */ + abortSignal?: Aborter; + /** * blockSize is the data every request trying to download. * Must be >= 0, if set to 0 or undefined, blockSize will automatically calculated according * to the blob size. * * @type {number} - * @memberof IDownloadFromBlobOptions + * @memberof DownloadFromBlobOptions */ blockSize?: number; @@ -111,37 +132,37 @@ export interface IDownloadFromBlobOptions { * Above kind of ends will not trigger retry policy defined in a pipeline, * because they doesn't emit network errors. * - * With this option, every additional retry means an additional FileURL.download() request will be made + * With this option, every additional retry means an additional FileClient.download() request will be made * from the broken point, until the requested block has been successfully downloaded or * maxRetryRequestsPerBlock is reached. * * Default value is 5, please set a larger value when in poor network. * * @type {number} - * @memberof IDownloadFromAzureFileOptions + * @memberof DownloadFromAzureFileOptions */ maxRetryRequestsPerBlock?: number; /** * Progress updater. * - * @memberof IDownloadFromBlobOptions + * @memberof DownloadFromBlobOptions */ progress?: (progress: TransferProgressEvent) => void; /** * Access conditions headers. * - * @type {IBlobAccessConditions} - * @memberof IDownloadFromBlobOptions + * @type {BlobAccessConditions} + * @memberof DownloadFromBlobOptions */ - blobAccessConditions?: IBlobAccessConditions; + blobAccessConditions?: BlobAccessConditions; /** * Concurrency of parallel download. * * @type {number} - * @memberof IDownloadFromBlobOptions + * @memberof DownloadFromBlobOptions */ parallelism?: number; } diff --git a/sdk/storage/storage-blob/src/highlevel.node.ts b/sdk/storage/storage-blob/src/highlevel.node.ts index 587977b037e3..17846c62b5e7 100644 --- a/sdk/storage/storage-blob/src/highlevel.node.ts +++ b/sdk/storage/storage-blob/src/highlevel.node.ts @@ -6,15 +6,15 @@ import { generateUuid, TransferProgressEvent } from "@azure/ms-rest-js"; import { Readable } from "stream"; import { Aborter } from "./Aborter"; -import { BlobURL } from "./BlobURL"; -import { BlockBlobURL } from "./BlockBlobURL"; +import { BlobClient } from "./BlobClient"; +import { BlockBlobClient } from "./BlockBlobClient"; import { BlobHTTPHeaders } from "./generated/lib/models"; import { BlobUploadCommonResponse, - IDownloadFromBlobOptions, - IUploadToBlockBlobOptions + DownloadFromBlobOptions, + UploadToBlockBlobOptions } from "./highlevel.common"; -import { IBlobAccessConditions } from "./models"; +import { BlobAccessConditions } from "./models"; import { Batch } from "./utils/Batch"; import { BufferScheduler } from "./utils/BufferScheduler"; import { @@ -36,22 +36,18 @@ import { streamToBuffer } from "./utils/utils.node"; * to commit the block list. * * @export - * @param {Aborter} aborter Create a new Aborter instance with Aborter.none or Aborter.timeout(), - * goto documents of Aborter for more examples about request cancellation * @param {string} filePath Full path of local file - * @param {BlockBlobURL} blockBlobURL BlockBlobURL - * @param {IUploadToBlockBlobOptions} [options] IUploadToBlockBlobOptions + * @param {BlockBlobClient} blockBlobClient BlockBlobClient + * @param {UploadToBlockBlobOptions} [options] UploadToBlockBlobOptions * @returns {(Promise)} ICommonResponse */ export async function uploadFileToBlockBlob( - aborter: Aborter, filePath: string, - blockBlobURL: BlockBlobURL, - options?: IUploadToBlockBlobOptions + blockBlobClient: BlockBlobClient, + options?: UploadToBlockBlobOptions ): Promise { const size = fs.statSync(filePath).size; return uploadResetableStreamToBlockBlob( - aborter, (offset, count) => fs.createReadStream(filePath, { autoClose: true, @@ -59,7 +55,7 @@ export async function uploadFileToBlockBlob( start: offset }), size, - blockBlobURL, + blockBlobClient, options ); } @@ -76,29 +72,23 @@ export async function uploadFileToBlockBlob( * to commit the block list. * * @export - * @param {Aborter} aborter Create a new Aborter instance with Aborter.none or Aborter.timeout(), - * goto documents of Aborter for more examples about request cancellation * @param {(offset: number) => NodeJS.ReadableStream} streamFactory Returns a Node.js Readable stream starting * from the offset defined * @param {number} size Size of the block blob - * @param {BlockBlobURL} blockBlobURL BlockBlobURL - * @param {IUploadToBlockBlobOptions} [options] IUploadToBlockBlobOptions + * @param {BlockBlobClient} blockBlobClient BlockBlobClient + * @param {UploadToBlockBlobOptions} [options] UploadToBlockBlobOptions * @returns {(Promise)} ICommonResponse */ async function uploadResetableStreamToBlockBlob( - aborter: Aborter, streamFactory: (offset: number, count?: number) => NodeJS.ReadableStream, size: number, - blockBlobURL: BlockBlobURL, - options: IUploadToBlockBlobOptions = {} + blockBlobClient: BlockBlobClient, + options: UploadToBlockBlobOptions = {} ): Promise { if (!options.blockSize) { options.blockSize = 0; } - if ( - options.blockSize < 0 || - options.blockSize > BLOCK_BLOB_MAX_STAGE_BLOCK_BYTES - ) { + if (options.blockSize < 0 || options.blockSize > BLOCK_BLOB_MAX_STAGE_BLOCK_BYTES) { throw new RangeError( `blockSize option must be >= 0 and <= ${BLOCK_BLOB_MAX_STAGE_BLOCK_BYTES}` ); @@ -135,7 +125,7 @@ async function uploadResetableStreamToBlockBlob( } if (size <= options.maxSingleShotSize) { - return blockBlobURL.upload(aborter, () => streamFactory(0), size, options); + return blockBlobClient.upload(() => streamFactory(0), size, options); } const numBlocks: number = Math.floor((size - 1) / options.blockSize) + 1; @@ -159,12 +149,12 @@ async function uploadResetableStreamToBlockBlob( const end = i === numBlocks - 1 ? size : start + options.blockSize!; const contentLength = end - start; blockList.push(blockID); - await blockBlobURL.stageBlock( - aborter, + await blockBlobClient.stageBlock( blockID, () => streamFactory(start, contentLength), contentLength, { + abortSignal: options.abortSignal, leaseAccessConditions: options.blobAccessConditions! .leaseAccessConditions } @@ -179,7 +169,7 @@ async function uploadResetableStreamToBlockBlob( } await batch.do(); - return blockBlobURL.commitBlockList(aborter, blockList, options); + return blockBlobClient.commitBlockList(blockList, options); } /** @@ -189,22 +179,19 @@ async function uploadResetableStreamToBlockBlob( * Offset and count are optional, pass 0 for both to download the entire blob. * * @export - * @param {Aborter} aborter Create a new Aborter instance with Aborter.none or Aborter.timeout(), - * goto documents of Aborter for more examples about request cancellation * @param {Buffer} buffer Buffer to be fill, must have length larger than count - * @param {BlobURL} blobURL A BlobURL object + * @param {BlobClient} blobClient A BlobClient object * @param {number} offset From which position of the block blob to download * @param {number} [count] How much data to be downloaded. Will download to the end when passing undefined - * @param {IDownloadFromBlobOptions} [options] IDownloadFromBlobOptions + * @param {DownloadFromBlobOptions} [options] DownloadFromBlobOptions * @returns {Promise} */ export async function downloadBlobToBuffer( - aborter: Aborter, buffer: Buffer, - blobURL: BlobURL, + blobClient: BlobClient, offset: number, count?: number, - options: IDownloadFromBlobOptions = {} + options: DownloadFromBlobOptions = {} ): Promise { if (!options.blockSize) { options.blockSize = 0; @@ -230,7 +217,7 @@ export async function downloadBlobToBuffer( // Customer doesn't specify length, get it if (!count) { - const response = await blobURL.getProperties(aborter, options); + const response = await blobClient.getProperties(options); count = response.contentLength! - offset; if (count < 0) { throw new RangeError( @@ -249,17 +236,12 @@ export async function downloadBlobToBuffer( const batch = new Batch(options.parallelism); for (let off = offset; off < offset + count; off = off + options.blockSize) { batch.addOperation(async () => { - const chunkEnd = - off + options.blockSize! < count! ? off + options.blockSize! : count!; - const response = await blobURL.download( - aborter, - off, - chunkEnd - off + 1, - { - blobAccessConditions: options.blobAccessConditions, - maxRetryRequests: options.maxRetryRequestsPerBlock - } - ); + const chunkEnd = off + options.blockSize! < count! ? off + options.blockSize! : count!; + const response = await blobClient.download(off, chunkEnd - off + 1, { + abortSignal: options.abortSignal, + blobAccessConditions: options.blobAccessConditions, + maxRetryRequests: options.maxRetryRequestsPerBlock + }); const stream = response.readableStreamBody!; await streamToBuffer(stream, buffer, off - offset, chunkEnd - offset); // Update progress after block is downloaded, in case of block trying @@ -278,14 +260,24 @@ export async function downloadBlobToBuffer( * Option interface for uploadStreamToBlockBlob. * * @export - * @interface IUploadStreamToBlockBlobOptions + * @interface UploadStreamToBlockBlobOptions */ -export interface IUploadStreamToBlockBlobOptions { +export interface UploadStreamToBlockBlobOptions { + /** + * Aborter instance to cancel request. It can be created with Aborter.none + * or Aborter.timeout(). Go to documents of {@link Aborter} for more examples + * about request cancellation. + * + * @type {Aborter} + * @memberof IUploadToBlockBlobOptions + */ + abortSignal?: Aborter; + /** * Blob HTTP Headers. * * @type {BlobHTTPHeaders} - * @memberof IUploadStreamToBlockBlobOptions + * @memberof UploadStreamToBlockBlobOptions */ blobHTTPHeaders?: BlobHTTPHeaders; @@ -293,22 +285,22 @@ export interface IUploadStreamToBlockBlobOptions { * Metadata of block blob. * * @type {{ [propertyName: string]: string }} - * @memberof IUploadStreamToBlockBlobOptions + * @memberof UploadStreamToBlockBlobOptions */ metadata?: { [propertyName: string]: string }; /** * Access conditions headers. * - * @type {IBlobAccessConditions} - * @memberof IUploadStreamToBlockBlobOptions + * @type {BlobAccessConditions} + * @memberof UploadStreamToBlockBlobOptions */ - accessConditions?: IBlobAccessConditions; + accessConditions?: BlobAccessConditions; /** * Progress updater. * - * @memberof IUploadStreamToBlockBlobOptions + * @memberof UploadStreamToBlockBlobOptions */ progress?: (progress: TransferProgressEvent) => void; } @@ -323,23 +315,20 @@ export interface IUploadStreamToBlockBlobOptions { * parameter, which will avoid Buffer.concat() operations. * * @export - * @param {Aborter} aborter Create a new Aborter instance with Aborter.none or Aborter.timeout(), - * goto documents of Aborter for more examples about request cancellation * @param {Readable} stream Node.js Readable stream - * @param {BlockBlobURL} blockBlobURL A BlockBlobURL instance + * @param {BlockBlobClient} blockBlobClient A BlockBlobClient instance * @param {number} bufferSize Size of every buffer allocated, also the block size in the uploaded block blob * @param {number} maxBuffers Max buffers will allocate during uploading, positive correlation * with max uploading concurrency - * @param {IUploadStreamToBlockBlobOptions} [options] + * @param {UploadStreamToBlockBlobOptions} [options] * @returns {Promise} */ export async function uploadStreamToBlockBlob( - aborter: Aborter, stream: Readable, - blockBlobURL: BlockBlobURL, + blockBlobClient: BlockBlobClient, bufferSize: number, maxBuffers: number, - options: IUploadStreamToBlockBlobOptions = {} + options: UploadStreamToBlockBlobOptions = {} ): Promise { if (!options.blobHTTPHeaders) { options.blobHTTPHeaders = {}; @@ -362,7 +351,7 @@ export async function uploadStreamToBlockBlob( blockList.push(blockID); blockNum++; - await blockBlobURL.stageBlock(aborter, blockID, buffer, buffer.length, { + await blockBlobClient.stageBlock(blockID, buffer, buffer.length, { leaseAccessConditions: options.accessConditions!.leaseAccessConditions }); @@ -380,5 +369,5 @@ export async function uploadStreamToBlockBlob( ); await scheduler.do(); - return blockBlobURL.commitBlockList(aborter, blockList, options); + return blockBlobClient.commitBlockList(blockList, options); } diff --git a/sdk/storage/storage-blob/src/index.browser.ts b/sdk/storage/storage-blob/src/index.browser.ts index ccb9df673549..7125ac7c2b74 100644 --- a/sdk/storage/storage-blob/src/index.browser.ts +++ b/sdk/storage/storage-blob/src/index.browser.ts @@ -6,19 +6,19 @@ import { RestError } from "@azure/ms-rest-js"; import * as Models from "../src/generated/lib/models"; export * from "./Aborter"; -export * from "./AppendBlobURL"; -export * from "./BlobURL"; -export * from "./BlockBlobURL"; +export * from "./AppendBlobClient"; +export * from "./BlobClient"; +export * from "./BlockBlobClient"; export * from "./BrowserPolicyFactory"; -export * from "./ContainerURL"; +export * from "./ContainerClient"; export * from "./credentials/AnonymousCredential"; export * from "./credentials/Credential"; export * from "./credentials/TokenCredential"; export * from "./highlevel.browser"; export * from "./highlevel.common"; -export { IIPRange } from "./IIPRange"; -export { IRange } from "./IRange"; -export * from "./PageBlobURL"; +export { IPRange } from "./IPRange"; +export { Range } from "./Range"; +export * from "./PageBlobClient"; export * from "./Pipeline"; export * from "./policies/AnonymousCredentialPolicy"; export * from "./policies/CredentialPolicy"; @@ -27,6 +27,6 @@ export * from "./LoggingPolicyFactory"; export * from "./TelemetryPolicyFactory"; export * from "./policies/TokenCredentialPolicy"; export * from "./UniqueRequestIDPolicyFactory"; -export * from "./ServiceURL"; -export * from "./StorageURL"; +export * from "./BlobServiceClient"; +export * from "./StorageClient"; export { Models, RestError }; diff --git a/sdk/storage/storage-blob/src/index.ts b/sdk/storage/storage-blob/src/index.ts index 9a9002142ff3..1d28a39b2b0a 100644 --- a/sdk/storage/storage-blob/src/index.ts +++ b/sdk/storage/storage-blob/src/index.ts @@ -9,15 +9,15 @@ export * from "./Aborter"; export * from "./AccountSASPermissions"; export * from "./AccountSASResourceTypes"; export * from "./AccountSASServices"; -export * from "./IAccountSASSignatureValues"; -export * from "./AppendBlobURL"; +export * from "./AccountSASSignatureValues"; +export * from "./AppendBlobClient"; export * from "./BlobSASPermissions"; -export * from "./IBlobSASSignatureValues"; -export * from "./BlobURL"; -export * from "./BlockBlobURL"; +export * from "./BlobSASSignatureValues"; +export * from "./BlobClient"; +export * from "./BlockBlobClient"; export * from "./BrowserPolicyFactory"; export * from "./ContainerSASPermissions"; -export * from "./ContainerURL"; +export * from "./ContainerClient"; export * from "./credentials/AnonymousCredential"; export * from "./credentials/Credential"; export * from "./credentials/SharedKeyCredential"; @@ -25,9 +25,9 @@ export * from "./credentials/TokenCredential"; export * from "./highlevel.browser"; export * from "./highlevel.common"; export * from "./highlevel.node"; -export { IIPRange } from "./IIPRange"; -export { IRange } from "./IRange"; -export * from "./PageBlobURL"; +export { IPRange } from "./IPRange"; +export { Range } from "./Range"; +export * from "./PageBlobClient"; export * from "./Pipeline"; export * from "./policies/AnonymousCredentialPolicy"; export * from "./policies/CredentialPolicy"; @@ -37,7 +37,7 @@ export * from "./policies/SharedKeyCredentialPolicy"; export * from "./TelemetryPolicyFactory"; export * from "./policies/TokenCredentialPolicy"; export * from "./UniqueRequestIDPolicyFactory"; -export * from "./ServiceURL"; -export * from "./StorageURL"; +export * from "./BlobServiceClient"; +export * from "./StorageClient"; export * from "./SASQueryParameters"; export { Models, RestError }; diff --git a/sdk/storage/storage-blob/src/models.ts b/sdk/storage/storage-blob/src/models.ts index 22aad5a78668..530433e87fb2 100644 --- a/sdk/storage/storage-blob/src/models.ts +++ b/sdk/storage/storage-blob/src/models.ts @@ -3,24 +3,24 @@ import * as Models from "./generated/lib/models"; -export interface IMetadata { +export interface Metadata { [propertyName: string]: string; } -export interface IContainerAccessConditions { +export interface ContainerAccessConditions { modifiedAccessConditions?: Models.ModifiedAccessConditions; leaseAccessConditions?: Models.LeaseAccessConditions; } -export interface IBlobAccessConditions { +export interface BlobAccessConditions { modifiedAccessConditions?: Models.ModifiedAccessConditions; leaseAccessConditions?: Models.LeaseAccessConditions; } -export interface IPageBlobAccessConditions extends IBlobAccessConditions { +export interface PageBlobAccessConditions extends BlobAccessConditions { sequenceNumberAccessConditions?: Models.SequenceNumberAccessConditions; } -export interface IAppendBlobAccessConditions extends IBlobAccessConditions { +export interface AppendBlobAccessConditions extends BlobAccessConditions { appendPositionAccessConditions?: Models.AppendPositionAccessConditions; } diff --git a/sdk/storage/storage-blob/src/policies/BrowserPolicy.ts b/sdk/storage/storage-blob/src/policies/BrowserPolicy.ts index 312a64eca570..2b7d37949eec 100644 --- a/sdk/storage/storage-blob/src/policies/BrowserPolicy.ts +++ b/sdk/storage/storage-blob/src/policies/BrowserPolicy.ts @@ -45,17 +45,12 @@ export class BrowserPolicy extends BaseRequestPolicy { * @returns {Promise} * @memberof BrowserPolicy */ - public async sendRequest( - request: WebResource - ): Promise { + public async sendRequest(request: WebResource): Promise { if (isNode) { return this._nextPolicy.sendRequest(request); } - if ( - request.method.toUpperCase() === "GET" || - request.method.toUpperCase() === "HEAD" - ) { + if (request.method.toUpperCase() === "GET" || request.method.toUpperCase() === "HEAD") { request.url = setURLParameter( request.url, URLConstants.Parameters.FORCE_BROWSER_NO_CACHE, diff --git a/sdk/storage/storage-blob/src/policies/CredentialPolicy.ts b/sdk/storage/storage-blob/src/policies/CredentialPolicy.ts index 429223215b12..e15490e27e3d 100644 --- a/sdk/storage/storage-blob/src/policies/CredentialPolicy.ts +++ b/sdk/storage/storage-blob/src/policies/CredentialPolicy.ts @@ -1,11 +1,7 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -import { - BaseRequestPolicy, - HttpOperationResponse, - WebResource -} from "@azure/ms-rest-js"; +import { BaseRequestPolicy, HttpOperationResponse, WebResource } from "@azure/ms-rest-js"; /** * Credential policy used to sign HTTP(S) requests before sending. This is an diff --git a/sdk/storage/storage-blob/src/policies/LoggingPolicy.ts b/sdk/storage/storage-blob/src/policies/LoggingPolicy.ts index b765120bec99..e91999d4b0bd 100644 --- a/sdk/storage/storage-blob/src/policies/LoggingPolicy.ts +++ b/sdk/storage/storage-blob/src/policies/LoggingPolicy.ts @@ -10,12 +10,12 @@ import { WebResource } from "@azure/ms-rest-js"; -import { IRequestLogOptions } from "../LoggingPolicyFactory"; +import { RequestLogOptions } from "../LoggingPolicyFactory"; import { HTTPURLConnection, URLConstants } from "../utils/constants"; import { getURLParameter, setURLParameter } from "../utils/utils.common"; -// Default values of IRetryOptions -const DEFAULT_REQUEST_LOG_OPTIONS: IRequestLogOptions = { +// Default values of RetryOptions +const DEFAULT_REQUEST_LOG_OPTIONS: RequestLogOptions = { logWarningIfTryOverThreshold: 3000 }; @@ -30,19 +30,19 @@ export class LoggingPolicy extends BaseRequestPolicy { private operationStartTime: Date = new Date(); private requestStartTime: Date = new Date(); - private readonly loggingOptions: IRequestLogOptions; + private readonly loggingOptions: RequestLogOptions; /** * Creates an instance of LoggingPolicy. * @param {RequestPolicy} nextPolicy * @param {RequestPolicyOptions} options - * @param {IRequestLogOptions} [loggingOptions=DEFAULT_REQUEST_LOG_OPTIONS] + * @param {RequestLogOptions} [loggingOptions=DEFAULT_REQUEST_LOG_OPTIONS] * @memberof LoggingPolicy */ constructor( nextPolicy: RequestPolicy, options: RequestPolicyOptions, - loggingOptions: IRequestLogOptions = DEFAULT_REQUEST_LOG_OPTIONS + loggingOptions: RequestLogOptions = DEFAULT_REQUEST_LOG_OPTIONS ) { super(nextPolicy, options); this.loggingOptions = loggingOptions; @@ -55,9 +55,7 @@ export class LoggingPolicy extends BaseRequestPolicy { * @returns {Promise} * @memberof LoggingPolicy */ - public async sendRequest( - request: WebResource - ): Promise { + public async sendRequest(request: WebResource): Promise { this.tryCount++; this.requestStartTime = new Date(); if (this.tryCount === 1) { @@ -66,11 +64,7 @@ export class LoggingPolicy extends BaseRequestPolicy { let safeURL: string = request.url; if (getURLParameter(safeURL, URLConstants.Parameters.SIGNATURE)) { - safeURL = setURLParameter( - safeURL, - URLConstants.Parameters.SIGNATURE, - "*****" - ); + safeURL = setURLParameter(safeURL, URLConstants.Parameters.SIGNATURE, "*****"); } this.log( HttpPipelineLogLevel.INFO, @@ -81,10 +75,8 @@ export class LoggingPolicy extends BaseRequestPolicy { const response = await this._nextPolicy.sendRequest(request); const requestEndTime = new Date(); - const requestCompletionTime = - requestEndTime.getTime() - this.requestStartTime.getTime(); - const operationDuration = - requestEndTime.getTime() - this.operationStartTime.getTime(); + const requestCompletionTime = requestEndTime.getTime() - this.requestStartTime.getTime(); + const operationDuration = requestEndTime.getTime() - this.operationStartTime.getTime(); let currentLevel: HttpPipelineLogLevel = HttpPipelineLogLevel.INFO; let logMessage: string = ""; @@ -94,10 +86,7 @@ export class LoggingPolicy extends BaseRequestPolicy { } // If the response took too long, we'll upgrade to warning. - if ( - requestCompletionTime >= - this.loggingOptions.logWarningIfTryOverThreshold - ) { + if (requestCompletionTime >= this.loggingOptions.logWarningIfTryOverThreshold) { // Log a warning if the try duration exceeded the specified threshold. if (this.shouldLog(HttpPipelineLogLevel.WARNING)) { currentLevel = HttpPipelineLogLevel.WARNING; @@ -113,8 +102,7 @@ export class LoggingPolicy extends BaseRequestPolicy { (response.status !== HTTPURLConnection.HTTP_NOT_FOUND && response.status !== HTTPURLConnection.HTTP_CONFLICT && response.status !== HTTPURLConnection.HTTP_PRECON_FAILED && - response.status !== - HTTPURLConnection.HTTP_RANGE_NOT_SATISFIABLE)) || + response.status !== HTTPURLConnection.HTTP_RANGE_NOT_SATISFIABLE)) || (response.status >= 500 && response.status <= 509) ) { const errorString = `REQUEST ERROR: HTTP request failed with status code: ${ @@ -134,9 +122,7 @@ export class LoggingPolicy extends BaseRequestPolicy { } catch (err) { this.log( HttpPipelineLogLevel.ERROR, - `Unexpected failure attempting to make request. Error message: ${ - err.message - }` + `Unexpected failure attempting to make request. Error message: ${err.message}` ); throw err; } diff --git a/sdk/storage/storage-blob/src/policies/RetryPolicy.ts b/sdk/storage/storage-blob/src/policies/RetryPolicy.ts index 5be9f3b5feb8..76086c4342c4 100644 --- a/sdk/storage/storage-blob/src/policies/RetryPolicy.ts +++ b/sdk/storage/storage-blob/src/policies/RetryPolicy.ts @@ -13,7 +13,7 @@ import { WebResource } from "@azure/ms-rest-js"; -import { IRetryOptions } from "../RetryPolicyFactory"; +import { RetryOptions } from "../RetryPolicyFactory"; import { URLConstants } from "../utils/constants"; import { setURLHost, setURLParameter } from "../utils/utils.common"; @@ -21,17 +21,12 @@ import { setURLHost, setURLParameter } from "../utils/utils.common"; * A factory method used to generated a RetryPolicy factory. * * @export - * @param {IRetryOptions} retryOptions + * @param {RetryOptions} retryOptions * @returns */ -export function NewRetryPolicyFactory( - retryOptions?: IRetryOptions -): RequestPolicyFactory { +export function NewRetryPolicyFactory(retryOptions?: RetryOptions): RequestPolicyFactory { return { - create: ( - nextPolicy: RequestPolicy, - options: RequestPolicyOptions - ): RetryPolicy => { + create: (nextPolicy: RequestPolicy, options: RequestPolicyOptions): RetryPolicy => { return new RetryPolicy(nextPolicy, options, retryOptions); } }; @@ -54,8 +49,8 @@ export enum RetryPolicyType { FIXED } -// Default values of IRetryOptions -const DEFAULT_RETRY_OPTIONS: IRetryOptions = { +// Default values of RetryOptions +const DEFAULT_RETRY_OPTIONS: RetryOptions = { maxRetryDelayInMs: 120 * 1000, maxTries: 4, retryDelayInMs: 4 * 1000, @@ -75,23 +70,23 @@ export class RetryPolicy extends BaseRequestPolicy { * RetryOptions. * * @private - * @type {IRetryOptions} + * @type {RetryOptions} * @memberof RetryPolicy */ - private readonly retryOptions: IRetryOptions; + private readonly retryOptions: RetryOptions; /** * Creates an instance of RetryPolicy. * * @param {RequestPolicy} nextPolicy * @param {RequestPolicyOptions} options - * @param {IRetryOptions} [retryOptions=DEFAULT_RETRY_OPTIONS] + * @param {RetryOptions} [retryOptions=DEFAULT_RETRY_OPTIONS] * @memberof RetryPolicy */ constructor( nextPolicy: RequestPolicy, options: RequestPolicyOptions, - retryOptions: IRetryOptions = DEFAULT_RETRY_OPTIONS + retryOptions: RetryOptions = DEFAULT_RETRY_OPTIONS ) { super(nextPolicy, options); @@ -139,9 +134,7 @@ export class RetryPolicy extends BaseRequestPolicy { * @returns {Promise} * @memberof RetryPolicy */ - public async sendRequest( - request: WebResource - ): Promise { + public async sendRequest(request: WebResource): Promise { return this.attemptSendRequest(request, false, 1); } @@ -169,18 +162,11 @@ export class RetryPolicy extends BaseRequestPolicy { const isPrimaryRetry = secondaryHas404 || !this.retryOptions.secondaryHost || - !( - request.method === "GET" || - request.method === "HEAD" || - request.method === "OPTIONS" - ) || + !(request.method === "GET" || request.method === "HEAD" || request.method === "OPTIONS") || attempt % 2 === 1; if (!isPrimaryRetry) { - newRequest.url = setURLHost( - newRequest.url, - this.retryOptions.secondaryHost! - ); + newRequest.url = setURLHost(newRequest.url, this.retryOptions.secondaryHost!); } // Set the server-side timeout query parameter "timeout=[seconds]" @@ -196,17 +182,14 @@ export class RetryPolicy extends BaseRequestPolicy { try { this.logf( HttpPipelineLogLevel.INFO, - `RetryPolicy: =====> Try=${attempt} ${ - isPrimaryRetry ? "Primary" : "Secondary" - }` + `RetryPolicy: =====> Try=${attempt} ${isPrimaryRetry ? "Primary" : "Secondary"}` ); response = await this._nextPolicy.sendRequest(newRequest); if (!this.shouldRetry(isPrimaryRetry, attempt, response)) { return response; } - secondaryHas404 = - secondaryHas404 || (!isPrimaryRetry && response.status === 404); + secondaryHas404 = secondaryHas404 || (!isPrimaryRetry && response.status === 404); } catch (err) { this.logf( HttpPipelineLogLevel.ERROR, @@ -281,10 +264,7 @@ export class RetryPolicy extends BaseRequestPolicy { if (response || err) { const statusCode = response ? response.status : err ? err.statusCode : 0; if (!isPrimaryRetry && statusCode === 404) { - this.logf( - HttpPipelineLogLevel.INFO, - `RetryPolicy: Secondary access with 404, will retry.` - ); + this.logf(HttpPipelineLogLevel.INFO, `RetryPolicy: Secondary access with 404, will retry.`); return true; } @@ -343,10 +323,7 @@ export class RetryPolicy extends BaseRequestPolicy { delayTimeInMs = Math.random() * 1000; } - this.logf( - HttpPipelineLogLevel.INFO, - `RetryPolicy: Delay for ${delayTimeInMs}ms` - ); + this.logf(HttpPipelineLogLevel.INFO, `RetryPolicy: Delay for ${delayTimeInMs}ms`); return delay(delayTimeInMs); } } diff --git a/sdk/storage/storage-blob/src/policies/SharedKeyCredentialPolicy.ts b/sdk/storage/storage-blob/src/policies/SharedKeyCredentialPolicy.ts index 6ba897516adb..c0beeecb45c3 100644 --- a/sdk/storage/storage-blob/src/policies/SharedKeyCredentialPolicy.ts +++ b/sdk/storage/storage-blob/src/policies/SharedKeyCredentialPolicy.ts @@ -1,11 +1,7 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -import { - RequestPolicy, - RequestPolicyOptions, - WebResource -} from "@azure/ms-rest-js"; +import { RequestPolicy, RequestPolicyOptions, WebResource } from "@azure/ms-rest-js"; import { SharedKeyCredential } from "../credentials/SharedKeyCredential"; import { HeaderConstants } from "../utils/constants"; import { getURLPath, getURLQueries } from "../utils/utils.common"; @@ -54,15 +50,8 @@ export class SharedKeyCredentialPolicy extends CredentialPolicy { protected signRequest(request: WebResource): WebResource { request.headers.set(HeaderConstants.X_MS_DATE, new Date().toUTCString()); - if ( - request.body && - typeof request.body === "string" && - request.body.length > 0 - ) { - request.headers.set( - HeaderConstants.CONTENT_LENGTH, - Buffer.byteLength(request.body) - ); + if (request.body && typeof request.body === "string" && request.body.length > 0) { + request.headers.set(HeaderConstants.CONTENT_LENGTH, Buffer.byteLength(request.body)); } const stringToSign: string = @@ -107,10 +96,7 @@ export class SharedKeyCredentialPolicy extends CredentialPolicy { * @returns {string} * @memberof SharedKeyCredentialPolicy */ - private getHeaderValueToSign( - request: WebResource, - headerName: string - ): string { + private getHeaderValueToSign(request: WebResource, headerName: string): string { const value = request.headers.get(headerName); if (!value) { @@ -144,10 +130,8 @@ export class SharedKeyCredentialPolicy extends CredentialPolicy { * @memberof SharedKeyCredentialPolicy */ private getCanonicalizedHeadersString(request: WebResource): string { - let headersArray = request.headers.headersArray().filter(value => { - return value.name - .toLowerCase() - .startsWith(HeaderConstants.PREFIX_FOR_STORAGE); + let headersArray = request.headers.headersArray().filter((value) => { + return value.name.toLowerCase().startsWith(HeaderConstants.PREFIX_FOR_STORAGE); }); headersArray.sort( @@ -158,17 +142,14 @@ export class SharedKeyCredentialPolicy extends CredentialPolicy { // Remove duplicate headers headersArray = headersArray.filter((value, index, array) => { - if ( - index > 0 && - value.name.toLowerCase() === array[index - 1].name.toLowerCase() - ) { + if (index > 0 && value.name.toLowerCase() === array[index - 1].name.toLowerCase()) { return false; } return true; }); let canonicalizedHeadersStringToSign: string = ""; - headersArray.forEach(header => { + headersArray.forEach((header) => { canonicalizedHeadersStringToSign += `${header.name .toLowerCase() .trimRight()}:${header.value.trimLeft()}\n`; @@ -205,9 +186,7 @@ export class SharedKeyCredentialPolicy extends CredentialPolicy { queryKeys.sort(); for (const key of queryKeys) { - canonicalizedResourceString += `\n${key}:${decodeURIComponent( - lowercaseQueries[key] - )}`; + canonicalizedResourceString += `\n${key}:${decodeURIComponent(lowercaseQueries[key])}`; } } diff --git a/sdk/storage/storage-blob/src/policies/TelemetryPolicy.ts b/sdk/storage/storage-blob/src/policies/TelemetryPolicy.ts index d245c6a02375..b60d509e5906 100644 --- a/sdk/storage/storage-blob/src/policies/TelemetryPolicy.ts +++ b/sdk/storage/storage-blob/src/policies/TelemetryPolicy.ts @@ -32,14 +32,10 @@ export class TelemetryPolicy extends BaseRequestPolicy { * Creates an instance of TelemetryPolicy. * @param {RequestPolicy} nextPolicy * @param {RequestPolicyOptions} options - * @param {ITelemetryOptions} [telemetry] + * @param {TelemetryOptions} [telemetry] * @memberof TelemetryPolicy */ - constructor( - nextPolicy: RequestPolicy, - options: RequestPolicyOptions, - telemetry: string - ) { + constructor(nextPolicy: RequestPolicy, options: RequestPolicyOptions, telemetry: string) { super(nextPolicy, options); this.telemetry = telemetry; } @@ -51,9 +47,7 @@ export class TelemetryPolicy extends BaseRequestPolicy { * @returns {Promise} * @memberof TelemetryPolicy */ - public async sendRequest( - request: WebResource - ): Promise { + public async sendRequest(request: WebResource): Promise { if (isNode) { if (!request.headers) { request.headers = new HttpHeaders(); diff --git a/sdk/storage/storage-blob/src/policies/TokenCredentialPolicy.ts b/sdk/storage/storage-blob/src/policies/TokenCredentialPolicy.ts index db5165e19194..295a6bbc53dc 100644 --- a/sdk/storage/storage-blob/src/policies/TokenCredentialPolicy.ts +++ b/sdk/storage/storage-blob/src/policies/TokenCredentialPolicy.ts @@ -1,13 +1,7 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -import { - HttpHeaders, - RequestPolicy, - RequestPolicyOptions, - WebResource -} from "@azure/ms-rest-js"; - +import { HttpHeaders, RequestPolicy, RequestPolicyOptions, WebResource } from "@azure/ms-rest-js"; import { TokenCredential } from "../credentials/TokenCredential"; import { HeaderConstants } from "../utils/constants"; import { CredentialPolicy } from "./CredentialPolicy"; diff --git a/sdk/storage/storage-blob/src/policies/UniqueRequestIDPolicy.ts b/sdk/storage/storage-blob/src/policies/UniqueRequestIDPolicy.ts index 662624df06b9..5fd1681dc9f4 100644 --- a/sdk/storage/storage-blob/src/policies/UniqueRequestIDPolicy.ts +++ b/sdk/storage/storage-blob/src/policies/UniqueRequestIDPolicy.ts @@ -36,14 +36,9 @@ export class UniqueRequestIDPolicy extends BaseRequestPolicy { * @returns {Promise} * @memberof UniqueRequestIDPolicy */ - public async sendRequest( - request: WebResource - ): Promise { + public async sendRequest(request: WebResource): Promise { if (!request.headers.contains(HeaderConstants.X_MS_CLIENT_REQUEST_ID)) { - request.headers.set( - HeaderConstants.X_MS_CLIENT_REQUEST_ID, - generateUuid() - ); + request.headers.set(HeaderConstants.X_MS_CLIENT_REQUEST_ID, generateUuid()); } return this._nextPolicy.sendRequest(request); diff --git a/sdk/storage/storage-blob/src/utils/Batch.ts b/sdk/storage/storage-blob/src/utils/Batch.ts index 5b04819fa9c4..2d982184bd3a 100644 --- a/sdk/storage/storage-blob/src/utils/Batch.ts +++ b/sdk/storage/storage-blob/src/utils/Batch.ts @@ -137,7 +137,7 @@ export class Batch { return new Promise((resolve, reject) => { this.emitter.on("finish", resolve); - this.emitter.on("error", error => { + this.emitter.on("error", (error) => { this.state = BatchStates.Error; reject(error); }); diff --git a/sdk/storage/storage-blob/src/utils/BufferScheduler.ts b/sdk/storage/storage-blob/src/utils/BufferScheduler.ts index 78bdb7245c93..a91e3fcb6e88 100644 --- a/sdk/storage/storage-blob/src/utils/BufferScheduler.ts +++ b/sdk/storage/storage-blob/src/utils/BufferScheduler.ts @@ -7,10 +7,7 @@ import { Readable } from "stream"; /** * OutgoingHandler is an async function triggered by BufferScheduler. */ -export declare type OutgoingHandler = ( - buffer: Buffer, - offset?: number -) => Promise; +export declare type OutgoingHandler = (buffer: Buffer, offset?: number) => Promise; /** * This class accepts a Node.js Readable stream as input, and keeps reading data @@ -209,21 +206,15 @@ export class BufferScheduler { encoding?: string ) { if (bufferSize <= 0) { - throw new RangeError( - `bufferSize must be larger than 0, current is ${bufferSize}` - ); + throw new RangeError(`bufferSize must be larger than 0, current is ${bufferSize}`); } if (maxBuffers <= 0) { - throw new RangeError( - `maxBuffers must be larger than 0, current is ${maxBuffers}` - ); + throw new RangeError(`maxBuffers must be larger than 0, current is ${maxBuffers}`); } if (parallelism <= 0) { - throw new RangeError( - `parallelism must be larger than 0, current is ${parallelism}` - ); + throw new RangeError(`parallelism must be larger than 0, current is ${parallelism}`); } this.bufferSize = bufferSize; @@ -243,9 +234,8 @@ export class BufferScheduler { */ public async do(): Promise { return new Promise((resolve, reject) => { - this.readable.on("data", data => { - data = - typeof data === "string" ? Buffer.from(data, this.encoding) : data; + this.readable.on("data", (data) => { + data = typeof data === "string" ? Buffer.from(data, this.encoding) : data; this.appendUnresolvedData(data); if (!this.resolveData()) { @@ -253,7 +243,7 @@ export class BufferScheduler { } }); - this.readable.on("error", err => { + this.readable.on("error", (err) => { this.emitter.emit("error", err); }); @@ -262,7 +252,7 @@ export class BufferScheduler { this.emitter.emit("checkEnd"); }); - this.emitter.on("error", err => { + this.emitter.on("error", (err) => { this.isError = true; this.readable.pause(); reject(err); @@ -275,14 +265,8 @@ export class BufferScheduler { } if (this.isStreamEnd && this.executingOutgoingHandlers === 0) { - if ( - this.unresolvedLength > 0 && - this.unresolvedLength < this.bufferSize - ) { - this.outgoingHandler( - this.shiftBufferFromUnresolvedDataArray(), - this.offset - ) + if (this.unresolvedLength > 0 && this.unresolvedLength < this.bufferSize) { + this.outgoingHandler(this.shiftBufferFromUnresolvedDataArray(), this.offset) .then(resolve) .catch(reject); } else if (this.unresolvedLength >= this.bufferSize) { @@ -323,20 +307,14 @@ export class BufferScheduler { } // Lazy concat because Buffer.concat highly drops performance - let merged = Buffer.concat( - this.unresolvedDataArray, - this.unresolvedLength - ); + let merged = Buffer.concat(this.unresolvedDataArray, this.unresolvedLength); const buffer = merged.slice(0, this.bufferSize); merged = merged.slice(this.bufferSize); this.unresolvedDataArray = [merged]; this.unresolvedLength -= buffer.length; return buffer; } else if (this.unresolvedLength > 0) { - const merged = Buffer.concat( - this.unresolvedDataArray, - this.unresolvedLength - ); + const merged = Buffer.concat(this.unresolvedDataArray, this.unresolvedLength); this.unresolvedDataArray = []; this.unresolvedLength = 0; return merged; diff --git a/sdk/storage/storage-blob/src/utils/RetriableReadableStream.ts b/sdk/storage/storage-blob/src/utils/RetriableReadableStream.ts index 46ddf0ac92d8..ff4e47a757d6 100644 --- a/sdk/storage/storage-blob/src/utils/RetriableReadableStream.ts +++ b/sdk/storage/storage-blob/src/utils/RetriableReadableStream.ts @@ -6,23 +6,31 @@ import { Readable } from "stream"; import { Aborter } from "../Aborter"; -export type ReadableStreamGetter = ( - offset: number -) => Promise; +export type ReadableStreamGetter = (offset: number) => Promise; + +export interface RetriableReadableStreamOptions { + /** + * Aborter instance to cancel request. It can be created with Aborter.none + * or Aborter.timeout(). Go to documents of {@link Aborter} for more examples + * about request cancellation. + * + * @type {Aborter} + * @memberof IUploadToBlockBlobOptions + */ + abortSignal?: Aborter; -export interface IRetriableReadableStreamOptions { /** * Max retry count (>=0), undefined or invalid value means no retry * * @type {number} - * @memberof IRetriableReadableStreamOptions + * @memberof RetriableReadableStreamOptions */ maxRetryRequests?: number; /** * Read progress event handler * - * @memberof IRetriableReadableStreamOptions + * @memberof RetriableReadableStreamOptions */ progress?: (progress: TransferProgressEvent) => void; @@ -36,7 +44,7 @@ export interface IRetriableReadableStreamOptions { * The value will then update to "undefined", once the injection works. * * @type {boolean} - * @memberof IRetriableReadableStreamOptions + * @memberof RetriableReadableStreamOptions */ doInjectErrorOnce?: boolean; } @@ -59,52 +67,41 @@ export class RetriableReadableStream extends Readable { private retries: number = 0; private maxRetryRequests: number; private progress?: (progress: TransferProgressEvent) => void; - private options: IRetriableReadableStreamOptions; + private options: RetriableReadableStreamOptions; /** * Creates an instance of RetriableReadableStream. * - * @param {Aborter} aborter Create a new Aborter instance with Aborter.none or Aborter.timeout(), - * goto documents of Aborter for more examples about request cancellation * @param {NodeJS.ReadableStream} source The current ReadableStream returned from getter * @param {ReadableStreamGetter} getter A method calling downloading request returning * a new ReadableStream from specified offset * @param {number} offset Offset position in original data source to read * @param {number} count How much data in original data source to read - * @param {IRetriableReadableStreamOptions} [options={}] + * @param {RetriableReadableStreamOptions} [options={}] * @memberof RetriableReadableStream */ public constructor( - aborter: Aborter, source: NodeJS.ReadableStream, getter: ReadableStreamGetter, offset: number, count: number, - options: IRetriableReadableStreamOptions = {} + options: RetriableReadableStreamOptions = {} ) { super(); - this.aborter = aborter; + this.aborter = options.abortSignal || Aborter.none; this.getter = getter; this.source = source; this.start = offset; this.offset = offset; this.end = offset + count - 1; this.maxRetryRequests = - options.maxRetryRequests && options.maxRetryRequests >= 0 - ? options.maxRetryRequests - : 0; + options.maxRetryRequests && options.maxRetryRequests >= 0 ? options.maxRetryRequests : 0; this.progress = options.progress; this.options = options; - aborter.addEventListener("abort", () => { + this.aborter.addEventListener("abort", () => { this.source.pause(); - this.emit( - "error", - new RestError( - "The request was aborted", - RestError.REQUEST_ABORTED_ERROR - ) - ); + this.emit("error", new RestError("The request was aborted", RestError.REQUEST_ABORTED_ERROR)); }); this.setSourceDataHandler(); @@ -157,13 +154,13 @@ export class RetriableReadableStream extends Readable { if (this.retries < this.maxRetryRequests) { this.retries += 1; this.getter(this.offset) - .then(newSource => { + .then((newSource) => { this.source = newSource; this.setSourceDataHandler(); this.setSourceEndHandler(); this.setSourceErrorHandler(); }) - .catch(error => { + .catch((error) => { this.emit("error", error); }); } else { @@ -192,7 +189,7 @@ export class RetriableReadableStream extends Readable { } private setSourceErrorHandler() { - this.source.on("error", error => { + this.source.on("error", (error) => { this.emit("error", error); }); } diff --git a/sdk/storage/storage-blob/src/utils/constants.ts b/sdk/storage/storage-blob/src/utils/constants.ts index 23add2457814..0f27b9dba798 100644 --- a/sdk/storage/storage-blob/src/utils/constants.ts +++ b/sdk/storage/storage-blob/src/utils/constants.ts @@ -1,7 +1,7 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -export const SDK_VERSION: string = "10.3.0"; +export const SDK_VERSION: string = "11.0.0-preview.1"; export const SERVICE_VERSION: string = "2018-03-28"; export const BLOCK_BLOB_MAX_UPLOAD_BLOB_BYTES: number = 256 * 1024 * 1024; // 256MB diff --git a/sdk/storage/storage-blob/src/utils/utils.common.ts b/sdk/storage/storage-blob/src/utils/utils.common.ts index 3ea0b9722c6f..ffc6aa88813c 100644 --- a/sdk/storage/storage-blob/src/utils/utils.common.ts +++ b/sdk/storage/storage-blob/src/utils/utils.common.ts @@ -8,9 +8,9 @@ import { isNode, URLBuilder } from "@azure/ms-rest-js"; * * ## URL encode and escape strategy for JSv10 SDKs * - * When customers pass a URL string into XXXURL classes constrcutor, the URL string may already be URL encoded or not. + * When customers pass a URL string into XxxClient classes constrcutor, the URL string may already be URL encoded or not. * But before sending to Azure Storage server, the URL must be encoded. However, it's hard for a SDK to guess whether the URL - * string has been encoded or not. We have 2 potential strategies, and chose strategy two for the XXXURL constructors. + * string has been encoded or not. We have 2 potential strategies, and chose strategy two for the XxxClient constructors. * * ### Strategy One: Assume the customer URL string is not encoded, and always encode URL string in SDK. * @@ -46,7 +46,7 @@ import { isNode, URLBuilder } from "@azure/ms-rest-js"; * * Another special character is "?", use "%2F" to represent a blob name with "?" in a URL string. * - * ### Strategy for containerName, blobName or other specific XXXName parameters in methods such as `BlobURL.fromContainerURL(containerURL, blobName)` + * ### Strategy for containerName, blobName or other specific XXXName parameters in methods such as `BlobClient.fromContainerClient(containerURL, blobName)` * * We will apply strategy one, and call encodeURIComponent for these parameters like blobName. Because what customers passes in is a plain name instead of a URL. * @@ -96,11 +96,7 @@ export function appendToURLPath(url: string, name: string): string { const urlParsed = URLBuilder.parse(url); let path = urlParsed.getPath(); - path = path - ? path.endsWith("/") - ? `${path}${name}` - : `${path}/${name}` - : name; + path = path ? (path.endsWith("/") ? `${path}${name}` : `${path}/${name}`) : name; urlParsed.setPath(path); return urlParsed.toString(); @@ -116,11 +112,7 @@ export function appendToURLPath(url: string, name: string): string { * @param {string} [value] Parameter value * @returns {string} An updated URL string */ -export function setURLParameter( - url: string, - name: string, - value?: string -): string { +export function setURLParameter(url: string, name: string, value?: string): string { const urlParsed = URLBuilder.parse(url); urlParsed.setQueryParameter(name, value); return urlParsed.toString(); @@ -134,10 +126,7 @@ export function setURLParameter( * @param {string} name * @returns {(string | string[] | undefined)} */ -export function getURLParameter( - url: string, - name: string -): string | string[] | undefined { +export function getURLParameter(url: string, name: string): string | string[] | undefined { const urlParsed = URLBuilder.parse(url); return urlParsed.getQueryParameterValue(name); } @@ -182,18 +171,14 @@ export function getURLQueries(url: string): { [key: string]: string } { } queryString = queryString.trim(); - queryString = queryString.startsWith("?") - ? queryString.substr(1) - : queryString; + queryString = queryString.startsWith("?") ? queryString.substr(1) : queryString; let querySubStrings: string[] = queryString.split("&"); querySubStrings = querySubStrings.filter((value: string) => { const indexOfEqual = value.indexOf("="); const lastIndexOfEqual = value.lastIndexOf("="); return ( - indexOfEqual > 0 && - indexOfEqual === lastIndexOfEqual && - lastIndexOfEqual < value.length - 1 + indexOfEqual > 0 && indexOfEqual === lastIndexOfEqual && lastIndexOfEqual < value.length - 1 ); }); @@ -217,10 +202,7 @@ export function getURLQueries(url: string): { [key: string]: string } { * If false, YYYY-MM-DDThh:mm:ssZ will be returned. * @returns {string} Date string in ISO8061 format, with or without 7 milliseconds component */ -export function truncatedISO8061Date( - date: Date, - withMilliseconds: boolean = true -): string { +export function truncatedISO8061Date(date: Date, withMilliseconds: boolean = true): string { // Date.toISOString() will return like "2018-10-29T06:34:36.139Z" const dateString = date.toISOString(); @@ -248,9 +230,7 @@ export function base64encode(content: string): string { * @returns {string} */ export function base64decode(encodedString: string): string { - return !isNode - ? atob(encodedString) - : Buffer.from(encodedString, "base64").toString(); + return !isNode ? atob(encodedString) : Buffer.from(encodedString, "base64").toString(); } /** @@ -260,29 +240,21 @@ export function base64decode(encodedString: string): string { * @param {number} blockIndex * @returns {string} */ -export function generateBlockID( - blockIDPrefix: string, - blockIndex: number -): string { +export function generateBlockID(blockIDPrefix: string, blockIndex: number): string { // To generate a 64 bytes base64 string, source string should be 48 const maxSourceStringLength = 48; // A blob can have a maximum of 100,000 uncommitted blocks at any given time const maxBlockIndexLength = 6; - const maxAllowedBlockIDPrefixLength = - maxSourceStringLength - maxBlockIndexLength; + const maxAllowedBlockIDPrefixLength = maxSourceStringLength - maxBlockIndexLength; if (blockIDPrefix.length > maxAllowedBlockIDPrefixLength) { blockIDPrefix = blockIDPrefix.slice(0, maxAllowedBlockIDPrefixLength); } const res = blockIDPrefix + - padStart( - blockIndex.toString(), - maxSourceStringLength - blockIDPrefix.length, - "0" - ); + padStart(blockIndex.toString(), maxSourceStringLength - blockIDPrefix.length, "0"); return base64encode(res); } diff --git a/sdk/storage/storage-blob/src/utils/utils.node.ts b/sdk/storage/storage-blob/src/utils/utils.node.ts index 6e2021fcd72f..849e92a90c51 100644 --- a/sdk/storage/storage-blob/src/utils/utils.node.ts +++ b/sdk/storage/storage-blob/src/utils/utils.node.ts @@ -38,14 +38,9 @@ export async function streamToBuffer( } // How much data needed in this chunk - const chunkLength = - pos + chunk.length > count ? count - pos : chunk.length; + const chunkLength = pos + chunk.length > count ? count - pos : chunk.length; - buffer.fill( - chunk.slice(0, chunkLength), - offset + pos, - offset + pos + chunkLength - ); + buffer.fill(chunk.slice(0, chunkLength), offset + pos, offset + pos + chunkLength); pos += chunkLength; }); diff --git a/sdk/storage/storage-blob/test/aborter.test.ts b/sdk/storage/storage-blob/test/aborter.spec.ts similarity index 65% rename from sdk/storage/storage-blob/test/aborter.test.ts rename to sdk/storage/storage-blob/test/aborter.spec.ts index f749b8ac02d9..ac4670a48d58 100644 --- a/sdk/storage/storage-blob/test/aborter.test.ts +++ b/sdk/storage/storage-blob/test/aborter.spec.ts @@ -1,20 +1,20 @@ import * as assert from "assert"; import { Aborter } from "../src/Aborter"; -import { ContainerURL } from "../src/ContainerURL"; +import { ContainerClient } from "../src/ContainerClient"; import { getBSU, getUniqueName } from "./utils"; import * as dotenv from "dotenv"; -dotenv.config({path:"../.env"}); +dotenv.config({ path: "../.env" }); // tslint:disable:no-empty describe("Aborter", () => { - const serviceURL = getBSU(); + const blobServiceClient = getBSU(); let containerName: string = getUniqueName("container"); - let containerURL = ContainerURL.fromServiceURL(serviceURL, containerName); + let containerClient = ContainerClient.fromBlobServiceClient(blobServiceClient, containerName); beforeEach(async () => { containerName = getUniqueName("container"); - containerURL = ContainerURL.fromServiceURL(serviceURL, containerName); + containerClient = ContainerClient.fromBlobServiceClient(blobServiceClient, containerName); }); it("should set value and get value successfully", async () => { @@ -23,12 +23,12 @@ describe("Aborter", () => { }); it("Should not abort after calling abort()", async () => { - await containerURL.create(Aborter.none); + await containerClient.create({abortSignal: Aborter.none}); }); it("Should abort when calling abort() before request finishes", async () => { const aborter = Aborter.none; - const response = containerURL.create(aborter); + const response = containerClient.create({abortSignal: aborter}); aborter.abort(); try { await response; @@ -38,13 +38,13 @@ describe("Aborter", () => { it("Should not abort when calling abort() after request finishes", async () => { const aborter = Aborter.none; - await containerURL.create(aborter); + await containerClient.create({abortSignal: aborter}); aborter.abort(); }); it("Should abort after aborter timeout", async () => { try { - await containerURL.create(Aborter.timeout(1)); + await containerClient.create({abortSignal: Aborter.timeout(1)}); assert.fail(); } catch (err) {} }); @@ -52,7 +52,7 @@ describe("Aborter", () => { it("Should abort after father aborter calls abort()", async () => { try { const aborter = Aborter.none; - const response = containerURL.create(aborter.withTimeout(10 * 60 * 1000)); + const response = containerClient.create({abortSignal: aborter.withTimeout(10 * 60 * 1000)}); aborter.abort(); await response; assert.fail(); @@ -62,7 +62,7 @@ describe("Aborter", () => { it("Should abort after father aborter timeout", async () => { try { const aborter = Aborter.timeout(1); - const response = containerURL.create(aborter.withTimeout(10 * 60 * 1000)); + const response = containerClient.create({abortSignal: aborter.withTimeout(10 * 60 * 1000)}); await response; assert.fail(); } catch (err) {} diff --git a/sdk/storage/storage-blob/test/appendblobclient.spec.ts b/sdk/storage/storage-blob/test/appendblobclient.spec.ts new file mode 100644 index 000000000000..b0fb8f8179cf --- /dev/null +++ b/sdk/storage/storage-blob/test/appendblobclient.spec.ts @@ -0,0 +1,68 @@ +import * as assert from "assert"; + +import { AppendBlobClient } from "../src/AppendBlobClient"; +import { ContainerClient } from "../src/ContainerClient"; +import { bodyToString, getBSU, getUniqueName } from "./utils"; +import * as dotenv from "dotenv"; +dotenv.config({ path: "../.env" }); + +describe("AppendBlobClient", () => { + const blobServiceClient = getBSU(); + let containerName: string = getUniqueName("container"); + let containerClient = ContainerClient.fromBlobServiceClient(blobServiceClient, containerName); + let blobName: string = getUniqueName("blob"); + let appendBlobClient = AppendBlobClient.fromContainerClient(containerClient, blobName); + + beforeEach(async () => { + containerName = getUniqueName("container"); + containerClient = ContainerClient.fromBlobServiceClient(blobServiceClient, containerName); + await containerClient.create(); + blobName = getUniqueName("blob"); + appendBlobClient = AppendBlobClient.fromContainerClient(containerClient, blobName); + }); + + afterEach(async () => { + await containerClient.delete(); + }); + + it("create with default parameters", async () => { + await appendBlobClient.create(); + await appendBlobClient.download(0); + }); + + it("create with parameters configured", async () => { + const options = { + blobHTTPHeaders: { + blobCacheControl: "blobCacheControl", + blobContentDisposition: "blobContentDisposition", + blobContentEncoding: "blobContentEncoding", + blobContentLanguage: "blobContentLanguage", + blobContentType: "blobContentType" + }, + metadata: { + key1: "vala", + key2: "valb" + } + }; + await appendBlobClient.create(options); + const properties = await appendBlobClient.getProperties(); + assert.equal(properties.cacheControl, options.blobHTTPHeaders.blobCacheControl); + assert.equal(properties.contentDisposition, options.blobHTTPHeaders.blobContentDisposition); + assert.equal(properties.contentEncoding, options.blobHTTPHeaders.blobContentEncoding); + assert.equal(properties.contentLanguage, options.blobHTTPHeaders.blobContentLanguage); + assert.equal(properties.contentType, options.blobHTTPHeaders.blobContentType); + assert.equal(properties.metadata!.key1, options.metadata.key1); + assert.equal(properties.metadata!.key2, options.metadata.key2); + }); + + it("appendBlock", async () => { + await appendBlobClient.create(); + + const content = "Hello World!"; + await appendBlobClient.appendBlock(content, content.length); + + const downloadResponse = await appendBlobClient.download(0); + assert.equal(await bodyToString(downloadResponse, content.length), content); + assert.equal(downloadResponse.contentLength!, content.length); + }); +}); diff --git a/sdk/storage/storage-blob/test/appendbloburl.test.ts b/sdk/storage/storage-blob/test/appendbloburl.test.ts deleted file mode 100644 index 462351eb6989..000000000000 --- a/sdk/storage/storage-blob/test/appendbloburl.test.ts +++ /dev/null @@ -1,84 +0,0 @@ -import * as assert from "assert"; - -import { Aborter } from "../src/Aborter"; -import { AppendBlobURL } from "../src/AppendBlobURL"; -import { ContainerURL } from "../src/ContainerURL"; -import { bodyToString, getBSU, getUniqueName } from "./utils"; -import * as dotenv from "dotenv"; -dotenv.config({path:"../.env"}); - -describe("AppendBlobURL", () => { - const serviceURL = getBSU(); - let containerName: string = getUniqueName("container"); - let containerURL = ContainerURL.fromServiceURL(serviceURL, containerName); - let blobName: string = getUniqueName("blob"); - let appendBlobURL = AppendBlobURL.fromContainerURL(containerURL, blobName); - - beforeEach(async () => { - containerName = getUniqueName("container"); - containerURL = ContainerURL.fromServiceURL(serviceURL, containerName); - await containerURL.create(Aborter.none); - blobName = getUniqueName("blob"); - appendBlobURL = AppendBlobURL.fromContainerURL(containerURL, blobName); - }); - - afterEach(async () => { - await containerURL.delete(Aborter.none); - }); - - it("create with default parameters", async () => { - await appendBlobURL.create(Aborter.none); - await appendBlobURL.download(Aborter.none, 0); - }); - - it("create with parameters configured", async () => { - const options = { - blobHTTPHeaders: { - blobCacheControl: "blobCacheControl", - blobContentDisposition: "blobContentDisposition", - blobContentEncoding: "blobContentEncoding", - blobContentLanguage: "blobContentLanguage", - blobContentType: "blobContentType" - }, - metadata: { - key1: "vala", - key2: "valb" - } - }; - await appendBlobURL.create(Aborter.none, options); - const properties = await appendBlobURL.getProperties(Aborter.none); - assert.equal( - properties.cacheControl, - options.blobHTTPHeaders.blobCacheControl - ); - assert.equal( - properties.contentDisposition, - options.blobHTTPHeaders.blobContentDisposition - ); - assert.equal( - properties.contentEncoding, - options.blobHTTPHeaders.blobContentEncoding - ); - assert.equal( - properties.contentLanguage, - options.blobHTTPHeaders.blobContentLanguage - ); - assert.equal( - properties.contentType, - options.blobHTTPHeaders.blobContentType - ); - assert.equal(properties.metadata!.key1, options.metadata.key1); - assert.equal(properties.metadata!.key2, options.metadata.key2); - }); - - it("appendBlock", async () => { - await appendBlobURL.create(Aborter.none); - - const content = "Hello World!"; - await appendBlobURL.appendBlock(Aborter.none, content, content.length); - - const downloadResponse = await appendBlobURL.download(Aborter.none, 0); - assert.equal(await bodyToString(downloadResponse, content.length), content); - assert.equal(downloadResponse.contentLength!, content.length); - }); -}); diff --git a/sdk/storage/storage-blob/test/bloburl.test.ts b/sdk/storage/storage-blob/test/blobclient.spec.ts similarity index 55% rename from sdk/storage/storage-blob/test/bloburl.test.ts rename to sdk/storage/storage-blob/test/blobclient.spec.ts index 9f449486e4fb..3386947fb963 100644 --- a/sdk/storage/storage-blob/test/bloburl.test.ts +++ b/sdk/storage/storage-blob/test/blobclient.spec.ts @@ -1,43 +1,42 @@ import * as assert from "assert"; import { isNode } from "@azure/ms-rest-js"; -import { Aborter } from "../src/Aborter"; -import { BlobURL } from "../src/BlobURL"; -import { BlockBlobURL } from "../src/BlockBlobURL"; -import { ContainerURL } from "../src/ContainerURL"; +import { BlobClient } from "../src/BlobClient"; +import { BlockBlobClient } from "../src/BlockBlobClient"; +import { ContainerClient } from "../src/ContainerClient"; import { bodyToString, getBSU, getUniqueName, sleep } from "./utils"; import * as dotenv from "dotenv"; dotenv.config({ path: "../.env" }); -describe("BlobURL", () => { - const serviceURL = getBSU(); +describe("BlobClient", () => { + const blobServiceClient = getBSU(); let containerName: string = getUniqueName("container"); - let containerURL = ContainerURL.fromServiceURL(serviceURL, containerName); + let containerClient = ContainerClient.fromBlobServiceClient(blobServiceClient, containerName); let blobName: string = getUniqueName("blob"); - let blobURL = BlobURL.fromContainerURL(containerURL, blobName); - let blockBlobURL = BlockBlobURL.fromBlobURL(blobURL); + let blobClient = BlobClient.fromContainerClient(containerClient, blobName); + let blockBlobClient = BlockBlobClient.fromBlobClient(blobClient); const content = "Hello World"; beforeEach(async () => { containerName = getUniqueName("container"); - containerURL = ContainerURL.fromServiceURL(serviceURL, containerName); - await containerURL.create(Aborter.none); + containerClient = ContainerClient.fromBlobServiceClient(blobServiceClient, containerName); + await containerClient.create(); blobName = getUniqueName("blob"); - blobURL = BlobURL.fromContainerURL(containerURL, blobName); - blockBlobURL = BlockBlobURL.fromBlobURL(blobURL); - await blockBlobURL.upload(Aborter.none, content, content.length); + blobClient = BlobClient.fromContainerClient(containerClient, blobName); + blockBlobClient = BlockBlobClient.fromBlobClient(blobClient); + await blockBlobClient.upload(content, content.length); }); afterEach(async () => { - await containerURL.delete(Aborter.none); + await containerClient.delete(); }); it("download with with default parameters", async () => { - const result = await blobURL.download(Aborter.none, 0); + const result = await blobClient.download(0); assert.deepStrictEqual(await bodyToString(result, content.length), content); }); it("download all parameters set", async () => { - const result = await blobURL.download(Aborter.none, 0, 1, { + const result = await blobClient.download(0, 1, { rangeGetContentMD5: true }); assert.deepStrictEqual(await bodyToString(result, 1), content[0]); @@ -48,8 +47,8 @@ describe("BlobURL", () => { a: "a", b: "b" }; - await blobURL.setMetadata(Aborter.none, metadata); - const result = await blobURL.getProperties(Aborter.none); + await blobClient.setMetadata(metadata); + const result = await blobClient.getProperties(); assert.deepStrictEqual(result.metadata, metadata); }); @@ -58,18 +57,18 @@ describe("BlobURL", () => { a: "a", b: "b" }; - await blobURL.setMetadata(Aborter.none, metadata); - const result = await blobURL.getProperties(Aborter.none); + await blobClient.setMetadata(metadata); + const result = await blobClient.getProperties(); assert.deepStrictEqual(result.metadata, metadata); - await blobURL.setMetadata(Aborter.none); - const result2 = await blobURL.getProperties(Aborter.none); + await blobClient.setMetadata(); + const result2 = await blobClient.getProperties(); assert.deepStrictEqual(result2.metadata, {}); }); it("setHTTPHeaders with default parameters", async () => { - await blobURL.setHTTPHeaders(Aborter.none, {}); - const result = await blobURL.getProperties(Aborter.none); + await blobClient.setHTTPHeaders({}); + const result = await blobClient.getProperties(); assert.deepStrictEqual(result.blobType, "BlockBlob"); assert.ok(result.lastModified); @@ -88,13 +87,11 @@ describe("BlobURL", () => { blobContentDisposition: "blobContentDisposition", blobContentEncoding: "blobContentEncoding", blobContentLanguage: "blobContentLanguage", - blobContentMD5: isNode - ? Buffer.from([1, 2, 3, 4]) - : new Uint8Array([1, 2, 3, 4]), + blobContentMD5: isNode ? Buffer.from([1, 2, 3, 4]) : new Uint8Array([1, 2, 3, 4]), blobContentType: "blobContentType" }; - await blobURL.setHTTPHeaders(Aborter.none, headers); - const result = await blobURL.getProperties(Aborter.none); + await blobClient.setHTTPHeaders(headers); + const result = await blobClient.getProperties(); assert.ok(result.date); assert.deepStrictEqual(result.blobType, "BlockBlob"); assert.ok(result.lastModified); @@ -104,147 +101,136 @@ describe("BlobURL", () => { assert.deepStrictEqual(result.contentMD5, headers.blobContentMD5); assert.deepStrictEqual(result.contentEncoding, headers.blobContentEncoding); assert.deepStrictEqual(result.contentLanguage, headers.blobContentLanguage); - assert.deepStrictEqual( - result.contentDisposition, - headers.blobContentDisposition - ); + assert.deepStrictEqual(result.contentDisposition, headers.blobContentDisposition); }); it("acquireLease", async () => { const guid = "ca761232ed4211cebacd00aa0057b223"; const duration = 30; - await blobURL.acquireLease(Aborter.none, guid, duration); + await blobClient.acquireLease(guid, duration); - const result = await blobURL.getProperties(Aborter.none); + const result = await blobClient.getProperties(); assert.equal(result.leaseDuration, "fixed"); assert.equal(result.leaseState, "leased"); assert.equal(result.leaseStatus, "locked"); - await blobURL.releaseLease(Aborter.none, guid); + await blobClient.releaseLease(guid); }); it("releaseLease", async () => { const guid = "ca761232ed4211cebacd00aa0057b223"; const duration = -1; - await blobURL.acquireLease(Aborter.none, guid, duration); + await blobClient.acquireLease(guid, duration); - const result = await blobURL.getProperties(Aborter.none); + const result = await blobClient.getProperties(); assert.equal(result.leaseDuration, "infinite"); assert.equal(result.leaseState, "leased"); assert.equal(result.leaseStatus, "locked"); - await blobURL.releaseLease(Aborter.none, guid); + await blobClient.releaseLease(guid); }); it("renewLease", async () => { const guid = "ca761232ed4211cebacd00aa0057b223"; const duration = 15; - await blobURL.acquireLease(Aborter.none, guid, duration); + await blobClient.acquireLease(guid, duration); - const result = await blobURL.getProperties(Aborter.none); + const result = await blobClient.getProperties(); assert.equal(result.leaseDuration, "fixed"); assert.equal(result.leaseState, "leased"); assert.equal(result.leaseStatus, "locked"); await sleep(20 * 1000); - const result2 = await blobURL.getProperties(Aborter.none); + const result2 = await blobClient.getProperties(); assert.ok(!result2.leaseDuration); assert.equal(result2.leaseState, "expired"); assert.equal(result2.leaseStatus, "unlocked"); - await blobURL.renewLease(Aborter.none, guid); - const result3 = await blobURL.getProperties(Aborter.none); + await blobClient.renewLease(guid); + const result3 = await blobClient.getProperties(); assert.equal(result3.leaseDuration, "fixed"); assert.equal(result3.leaseState, "leased"); assert.equal(result3.leaseStatus, "locked"); - await blobURL.releaseLease(Aborter.none, guid); + await blobClient.releaseLease(guid); }); it("changeLease", async () => { const guid = "ca761232ed4211cebacd00aa0057b223"; const duration = 15; - await blobURL.acquireLease(Aborter.none, guid, duration); + await blobClient.acquireLease(guid, duration); - const result = await blobURL.getProperties(Aborter.none); + const result = await blobClient.getProperties(); assert.equal(result.leaseDuration, "fixed"); assert.equal(result.leaseState, "leased"); assert.equal(result.leaseStatus, "locked"); const newGuid = "3c7e72ebb4304526bc53d8ecef03798f"; - await blobURL.changeLease(Aborter.none, guid, newGuid); + await blobClient.changeLease(guid, newGuid); - await blobURL.getProperties(Aborter.none); - await blobURL.releaseLease(Aborter.none, newGuid); + await blobClient.getProperties(); + await blobClient.releaseLease(newGuid); }); it("breakLease", async () => { const guid = "ca761232ed4211cebacd00aa0057b223"; const duration = 15; - await blobURL.acquireLease(Aborter.none, guid, duration); + await blobClient.acquireLease(guid, duration); - const result = await blobURL.getProperties(Aborter.none); + const result = await blobClient.getProperties(); assert.equal(result.leaseDuration, "fixed"); assert.equal(result.leaseState, "leased"); assert.equal(result.leaseStatus, "locked"); - await blobURL.breakLease(Aborter.none, 5); + await blobClient.breakLease(5); - const result2 = await blobURL.getProperties(Aborter.none); + const result2 = await blobClient.getProperties(); assert.ok(!result2.leaseDuration); assert.equal(result2.leaseState, "breaking"); assert.equal(result2.leaseStatus, "locked"); await sleep(5 * 1000); - const result3 = await blobURL.getProperties(Aborter.none); + const result3 = await blobClient.getProperties(); assert.ok(!result3.leaseDuration); assert.equal(result3.leaseState, "broken"); assert.equal(result3.leaseStatus, "unlocked"); }); it("delete", async () => { - await blobURL.delete(Aborter.none); + await blobClient.delete(); }); // The following code illustrates deleting a snapshot after creating one it("delete snapshot", async () => { - const result = await blobURL.createSnapshot(Aborter.none); + const result = await blobClient.createSnapshot(); assert.ok(result.snapshot); - const blobSnapshotURL = blobURL.withSnapshot(result.snapshot!); - await blobSnapshotURL.getProperties(Aborter.none); + const blobSnapshotClient = blobClient.withSnapshot(result.snapshot!); + await blobSnapshotClient.getProperties(); - await blobSnapshotURL.delete(Aborter.none); - await blobURL.delete(Aborter.none); + await blobSnapshotClient.delete(); + await blobClient.delete(); - const result2 = await containerURL.listBlobFlatSegment( - Aborter.none, - undefined, - { - include: ["snapshots"] - } - ); + const result2 = await containerClient.listBlobFlatSegment(undefined, { + include: ["snapshots"] + }); // Verify that the snapshot is deleted assert.equal(result2.segment.blobItems!.length, 0); }); it("createSnapshot", async () => { - const result = await blobURL.createSnapshot(Aborter.none); + const result = await blobClient.createSnapshot(); assert.ok(result.snapshot); - const blobSnapshotURL = blobURL.withSnapshot(result.snapshot!); - await blobSnapshotURL.getProperties(Aborter.none); + const blobSnapshotClient = blobClient.withSnapshot(result.snapshot!); + await blobSnapshotClient.getProperties(); - const result3 = await containerURL.listBlobFlatSegment( - Aborter.none, - undefined, - { - include: ["snapshots"] - } - ); + const result3 = await containerClient.listBlobFlatSegment(undefined, { + include: ["snapshots"] + }); // As a snapshot doesn't have leaseStatus and leaseState properties but origin blob has, // let assign them to undefined both for other properties' easy comparison @@ -261,16 +247,13 @@ describe("BlobURL", () => { result3.segment.blobItems![0].properties, result3.segment.blobItems![1].properties ); - assert.ok( - result3.segment.blobItems![0].snapshot || - result3.segment.blobItems![1].snapshot - ); + assert.ok(result3.segment.blobItems![0].snapshot || result3.segment.blobItems![1].snapshot); }); it("undelete", async () => { - const properties = await serviceURL.getProperties(Aborter.none); + const properties = await blobServiceClient.getProperties(); if (!properties.deleteRetentionPolicy!.enabled) { - await serviceURL.setProperties(Aborter.none, { + await blobServiceClient.setProperties({ deleteRetentionPolicy: { days: 7, enabled: true @@ -279,56 +262,48 @@ describe("BlobURL", () => { await sleep(15 * 1000); } - await blobURL.delete(Aborter.none); + await blobClient.delete(); - const result = await containerURL.listBlobFlatSegment( - Aborter.none, - undefined, - { - include: ["deleted"] - } - ); + const result = await containerClient.listBlobFlatSegment(undefined, { + include: ["deleted"] + }); assert.ok(result.segment.blobItems![0].deleted); - await blobURL.undelete(Aborter.none); - const result2 = await containerURL.listBlobFlatSegment( - Aborter.none, - undefined, - { - include: ["deleted"] - } - ); + await blobClient.undelete(); + const result2 = await containerClient.listBlobFlatSegment(undefined, { + include: ["deleted"] + }); assert.ok(!result2.segment.blobItems![0].deleted); }); - it("startCopyFromURL", async () => { - const newBlobURL = BlobURL.fromContainerURL( - containerURL, + it("startCopyFromClient", async () => { + const newBlobClient = BlobClient.fromContainerClient( + containerClient, getUniqueName("copiedblob") ); - const result = await newBlobURL.startCopyFromURL(Aborter.none, blobURL.url); + const result = await newBlobClient.startCopyFromURL(blobClient.url); assert.ok(result.copyId); - const properties1 = await blobURL.getProperties(Aborter.none); - const properties2 = await newBlobURL.getProperties(Aborter.none); + const properties1 = await blobClient.getProperties(); + const properties2 = await newBlobClient.getProperties(); assert.deepStrictEqual(properties1.contentMD5, properties2.contentMD5); assert.deepStrictEqual(properties2.copyId, result.copyId); - assert.deepStrictEqual(properties2.copySource, blobURL.url); + assert.deepStrictEqual(properties2.copySource, blobClient.url); }); - it("abortCopyFromURL should failed for a completed copy operation", async () => { - const newBlobURL = BlobURL.fromContainerURL( - containerURL, + it("abortCopyFromClient should failed for a completed copy operation", async () => { + const newBlobClient = BlobClient.fromContainerClient( + containerClient, getUniqueName("copiedblob") ); - const result = await newBlobURL.startCopyFromURL(Aborter.none, blobURL.url); + const result = await newBlobClient.startCopyFromURL(blobClient.url); assert.ok(result.copyId); sleep(1 * 1000); try { - await newBlobURL.abortCopyFromURL(Aborter.none, result.copyId!); + await newBlobClient.startCopyFromURL(result.copyId!); assert.fail( - "AbortCopyFromURL should be failed and throw exception for an completed copy operation." + "AbortCopyFromClient should be failed and throw exception for an completed copy operation." ); } catch (err) { assert.ok(true); @@ -336,23 +311,20 @@ describe("BlobURL", () => { }); it("setTier set default to cool", async () => { - await blockBlobURL.setTier(Aborter.none, "Cool"); - const properties = await blockBlobURL.getProperties(Aborter.none); + await blockBlobClient.setTier("Cool"); + const properties = await blockBlobClient.getProperties(); assert.equal(properties.accessTier!.toLowerCase(), "cool"); }); it("setTier set archive to hot", async () => { - await blockBlobURL.setTier(Aborter.none, "Archive"); - let properties = await blockBlobURL.getProperties(Aborter.none); + await blockBlobClient.setTier("Archive"); + let properties = await blockBlobClient.getProperties(); assert.equal(properties.accessTier!.toLowerCase(), "archive"); - await blockBlobURL.setTier(Aborter.none, "Hot"); - properties = await blockBlobURL.getProperties(Aborter.none); + await blockBlobClient.setTier("Hot"); + properties = await blockBlobClient.getProperties(); if (properties.archiveStatus) { - assert.equal( - properties.archiveStatus.toLowerCase(), - "rehydrate-pending-to-hot" - ); + assert.equal(properties.archiveStatus.toLowerCase(), "rehydrate-pending-to-hot"); } }); }); diff --git a/sdk/storage/storage-blob/test/serviceurl.test.ts b/sdk/storage/storage-blob/test/blobserviceclient.spec.ts similarity index 65% rename from sdk/storage/storage-blob/test/serviceurl.test.ts rename to sdk/storage/storage-blob/test/blobserviceclient.spec.ts index cc0d6623dcf9..6aa3e7653bc3 100644 --- a/sdk/storage/storage-blob/test/serviceurl.test.ts +++ b/sdk/storage/storage-blob/test/blobserviceclient.spec.ts @@ -1,16 +1,15 @@ import * as assert from "assert"; -import { Aborter } from "../src/Aborter"; -import { ContainerURL } from "../src/ContainerURL"; -import { ServiceURL } from "../src/ServiceURL"; +import { ContainerClient } from "../src/ContainerClient"; +import { BlobServiceClient } from "../src/BlobServiceClient"; import { getAlternateBSU, getBSU, getUniqueName, wait } from "./utils"; import * as dotenv from "dotenv"; -dotenv.config({path:"../.env"}); +dotenv.config({ path: "../.env" }); -describe("ServiceURL", () => { +describe("BlobServiceClient", () => { it("ListContainers with default parameters", async () => { - const serviceURL = getBSU(); - const result = await serviceURL.listContainersSegment(Aborter.none); + const blobServiceClient = getBSU(); + const result = await blobServiceClient.listContainersSegment(); assert.ok(typeof result.requestId); assert.ok(result.requestId!.length > 0); assert.ok(typeof result.version); @@ -28,31 +27,21 @@ describe("ServiceURL", () => { }); it("ListContainers with all parameters configured", async () => { - const serviceURL = getBSU(); + const blobServiceClient = getBSU(); const containerNamePrefix = getUniqueName("container"); const containerName1 = `${containerNamePrefix}x1`; const containerName2 = `${containerNamePrefix}x2`; - const containerURL1 = ContainerURL.fromServiceURL( - serviceURL, - containerName1 - ); - const containerURL2 = ContainerURL.fromServiceURL( - serviceURL, - containerName2 - ); - await containerURL1.create(Aborter.none, { metadata: { key: "val" } }); - await containerURL2.create(Aborter.none, { metadata: { key: "val" } }); - - const result1 = await serviceURL.listContainersSegment( - Aborter.none, - undefined, - { - include: "metadata", - maxresults: 1, - prefix: containerNamePrefix - } - ); + const containerClient1 = ContainerClient.fromBlobServiceClient(blobServiceClient, containerName1); + const containerClient2 = ContainerClient.fromBlobServiceClient(blobServiceClient, containerName2); + await containerClient1.create({ metadata: { key: "val" } }); + await containerClient2.create({ metadata: { key: "val" } }); + + const result1 = await blobServiceClient.listContainersSegment(undefined, { + include: "metadata", + maxresults: 1, + prefix: containerNamePrefix + }); assert.ok(result1.nextMarker); assert.equal(result1.containerItems!.length, 1); @@ -61,25 +50,15 @@ describe("ServiceURL", () => { assert.ok(result1.containerItems![0].properties.lastModified); assert.ok(!result1.containerItems![0].properties.leaseDuration); assert.ok(!result1.containerItems![0].properties.publicAccess); - assert.deepEqual( - result1.containerItems![0].properties.leaseState, - "available" - ); - assert.deepEqual( - result1.containerItems![0].properties.leaseStatus, - "unlocked" - ); + assert.deepEqual(result1.containerItems![0].properties.leaseState, "available"); + assert.deepEqual(result1.containerItems![0].properties.leaseStatus, "unlocked"); assert.deepEqual(result1.containerItems![0].metadata!.key, "val"); - const result2 = await serviceURL.listContainersSegment( - Aborter.none, - result1.nextMarker, - { - include: "metadata", - maxresults: 1, - prefix: containerNamePrefix - } - ); + const result2 = await blobServiceClient.listContainersSegment(result1.nextMarker, { + include: "metadata", + maxresults: 1, + prefix: containerNamePrefix + }); assert.ok(!result2.nextMarker); assert.equal(result2.containerItems!.length, 1); @@ -88,23 +67,17 @@ describe("ServiceURL", () => { assert.ok(result2.containerItems![0].properties.lastModified); assert.ok(!result2.containerItems![0].properties.leaseDuration); assert.ok(!result2.containerItems![0].properties.publicAccess); - assert.deepEqual( - result2.containerItems![0].properties.leaseState, - "available" - ); - assert.deepEqual( - result2.containerItems![0].properties.leaseStatus, - "unlocked" - ); + assert.deepEqual(result2.containerItems![0].properties.leaseState, "available"); + assert.deepEqual(result2.containerItems![0].properties.leaseStatus, "unlocked"); assert.deepEqual(result2.containerItems![0].metadata!.key, "val"); - await containerURL1.delete(Aborter.none); - await containerURL2.delete(Aborter.none); + await containerClient1.delete(); + await containerClient2.delete(); }); it("GetProperties", async () => { - const serviceURL = getBSU(); - const result = await serviceURL.getProperties(Aborter.none); + const blobServiceClient = getBSU(); + const result = await blobServiceClient.getProperties(); assert.ok(typeof result.requestId); assert.ok(result.requestId!.length > 0); @@ -121,9 +94,9 @@ describe("ServiceURL", () => { }); it("SetProperties", async () => { - const serviceURL = getBSU(); + const blobServiceClient = getBSU(); - const serviceProperties = await serviceURL.getProperties(Aborter.none); + const serviceProperties = await blobServiceClient.getProperties(); serviceProperties.logging = { deleteProperty: true, @@ -176,10 +149,10 @@ describe("ServiceURL", () => { }; } - await serviceURL.setProperties(Aborter.none, serviceProperties); + await blobServiceClient.setProperties(serviceProperties); await wait(5 * 1000); - const result = await serviceURL.getProperties(Aborter.none); + const result = await blobServiceClient.getProperties(); assert.ok(typeof result.requestId); assert.ok(result.requestId!.length > 0); assert.ok(typeof result.version); @@ -187,18 +160,18 @@ describe("ServiceURL", () => { assert.deepEqual(result.hourMetrics, serviceProperties.hourMetrics); }); - it("getStatistics", done => { - let serviceURL: ServiceURL | undefined; + it("getStatistics", (done) => { + let blobServiceClient: BlobServiceClient | undefined; try { - serviceURL = getAlternateBSU(); + blobServiceClient = getAlternateBSU(); } catch (err) { done(); return; } - serviceURL! - .getStatistics(Aborter.none) - .then(result => { + blobServiceClient! + .getStatistics() + .then((result) => { assert.ok(result.geoReplication!.lastSyncTime); done(); }) @@ -206,9 +179,9 @@ describe("ServiceURL", () => { }); it("getAccountInfo", async () => { - const serviceURL = getBSU(); + const blobServiceClient = getBSU(); - const accountInfo = await serviceURL.getAccountInfo(Aborter.none); + const accountInfo = await blobServiceClient.getAccountInfo(); assert.ok(accountInfo.accountKind); assert.ok(accountInfo.skuName); }); diff --git a/sdk/storage/storage-blob/test/blockbloburl.test.ts b/sdk/storage/storage-blob/test/blockblobclient.spec.ts similarity index 57% rename from sdk/storage/storage-blob/test/blockbloburl.test.ts rename to sdk/storage/storage-blob/test/blockblobclient.spec.ts index 7310d2f33949..f4909d7b0ae3 100644 --- a/sdk/storage/storage-blob/test/blockbloburl.test.ts +++ b/sdk/storage/storage-blob/test/blockblobclient.spec.ts @@ -1,38 +1,37 @@ import * as assert from "assert"; -import { Aborter } from "../src/Aborter"; -import { BlobURL } from "../src/BlobURL"; -import { BlockBlobURL } from "../src/BlockBlobURL"; -import { ContainerURL } from "../src/ContainerURL"; +import { BlobClient } from "../src/BlobClient"; +import { BlockBlobClient } from "../src/BlockBlobClient"; +import { ContainerClient } from "../src/ContainerClient"; import { base64encode, bodyToString, getBSU, getUniqueName } from "./utils"; import * as dotenv from "dotenv"; -dotenv.config({path:"../.env"}); +dotenv.config({ path: "../.env" }); -describe("BlockBlobURL", () => { - const serviceURL = getBSU(); +describe("BlockBlobClient", () => { + const blobServiceClient = getBSU(); let containerName: string = getUniqueName("container"); - let containerURL = ContainerURL.fromServiceURL(serviceURL, containerName); + let containerClient = ContainerClient.fromBlobServiceClient(blobServiceClient, containerName); let blobName: string = getUniqueName("blob"); - let blobURL = BlobURL.fromContainerURL(containerURL, blobName); - let blockBlobURL = BlockBlobURL.fromBlobURL(blobURL); + let blobClient = BlobClient.fromContainerClient(containerClient, blobName); + let blockBlobClient = BlockBlobClient.fromBlobClient(blobClient); beforeEach(async () => { containerName = getUniqueName("container"); - containerURL = ContainerURL.fromServiceURL(serviceURL, containerName); - await containerURL.create(Aborter.none); + containerClient = ContainerClient.fromBlobServiceClient(blobServiceClient, containerName); + await containerClient.create(); blobName = getUniqueName("blob"); - blobURL = BlobURL.fromContainerURL(containerURL, blobName); - blockBlobURL = BlockBlobURL.fromBlobURL(blobURL); + blobClient = BlobClient.fromContainerClient(containerClient, blobName); + blockBlobClient = BlockBlobClient.fromBlobClient(blobClient); }); afterEach(async () => { - await containerURL.delete(Aborter.none); + await containerClient.delete(); }); it("upload with string body and default parameters", async () => { const body: string = getUniqueName("randomstring"); - await blockBlobURL.upload(Aborter.none, body, body.length); - const result = await blobURL.download(Aborter.none, 0); + await blockBlobClient.upload(body, body.length); + const result = await blobClient.download(0); assert.deepStrictEqual(await bodyToString(result, body.length), body); }); @@ -49,17 +48,14 @@ describe("BlockBlobURL", () => { keyb: "valb" } }; - await blockBlobURL.upload(Aborter.none, body, body.length, { + await blockBlobClient.upload(body, body.length, { blobHTTPHeaders: options, metadata: options.metadata }); - const result = await blobURL.download(Aborter.none, 0); + const result = await blobClient.download(0); assert.deepStrictEqual(await bodyToString(result, body.length), body); assert.deepStrictEqual(result.cacheControl, options.blobCacheControl); - assert.deepStrictEqual( - result.contentDisposition, - options.blobContentDisposition - ); + assert.deepStrictEqual(result.contentDisposition, options.blobContentDisposition); assert.deepStrictEqual(result.contentEncoding, options.blobContentEncoding); assert.deepStrictEqual(result.contentLanguage, options.blobContentLanguage); assert.deepStrictEqual(result.contentType, options.blobContentType); @@ -68,22 +64,9 @@ describe("BlockBlobURL", () => { it("stageBlock", async () => { const body = "HelloWorld"; - await blockBlobURL.stageBlock( - Aborter.none, - base64encode("1"), - body, - body.length - ); - await blockBlobURL.stageBlock( - Aborter.none, - base64encode("2"), - body, - body.length - ); - const listResponse = await blockBlobURL.getBlockList( - Aborter.none, - "uncommitted" - ); + await blockBlobClient.stageBlock(base64encode("1"), body, body.length); + await blockBlobClient.stageBlock(base64encode("2"), body, body.length); + const listResponse = await blockBlobClient.getBlockList("uncommitted"); assert.equal(listResponse.uncommittedBlocks!.length, 2); assert.equal(listResponse.uncommittedBlocks![0].name, base64encode("1")); assert.equal(listResponse.uncommittedBlocks![0].size, body.length); @@ -93,30 +76,26 @@ describe("BlockBlobURL", () => { it("stageBlockFromURL copy source blob as single block", async () => { const body = "HelloWorld"; - await blockBlobURL.upload(Aborter.none, body, body.length); + await blockBlobClient.upload(body, body.length); // When testing is in Node.js environment with shared key, setAccessPolicy will work // But in browsers testing with SAS tokens, below will throw an exception, ignore it try { - await containerURL.setAccessPolicy(Aborter.none, "container"); + await containerClient.setAccessPolicy("container"); // tslint:disable-next-line:no-empty } catch (err) {} - const newBlockBlobURL = BlockBlobURL.fromContainerURL( - containerURL, + const newBlockBlobClient = BlockBlobClient.fromContainerClient( + containerClient, getUniqueName("newblockblob") ); - await newBlockBlobURL.stageBlockFromURL( - Aborter.none, + await newBlockBlobClient.stageBlockFromURL( base64encode("1"), - blockBlobURL.url, + blockBlobClient.url, 0 ); - const listResponse = await newBlockBlobURL.getBlockList( - Aborter.none, - "uncommitted" - ); + const listResponse = await newBlockBlobClient.getBlockList("uncommitted"); assert.equal(listResponse.uncommittedBlocks!.length, 1); assert.equal(listResponse.uncommittedBlocks![0].name, base64encode("1")); assert.equal(listResponse.uncommittedBlocks![0].size, body.length); @@ -124,45 +103,39 @@ describe("BlockBlobURL", () => { it("stageBlockFromURL copy source blob as separate blocks", async () => { const body = "HelloWorld"; - await blockBlobURL.upload(Aborter.none, body, body.length); + await blockBlobClient.upload(body, body.length); // When testing is in Node.js environment with shared key, setAccessPolicy will work // But in browsers testing with SAS tokens, below will throw an exception, ignore it try { - await containerURL.setAccessPolicy(Aborter.none, "container"); + await containerClient.setAccessPolicy("container"); // tslint:disable-next-line:no-empty } catch (err) {} - const newBlockBlobURL = BlockBlobURL.fromContainerURL( - containerURL, + const newBlockBlobClient = BlockBlobClient.fromContainerClient( + containerClient, getUniqueName("newblockblob") ); - await newBlockBlobURL.stageBlockFromURL( - Aborter.none, + await newBlockBlobClient.stageBlockFromURL( base64encode("1"), - blockBlobURL.url, + blockBlobClient.url, 0, 4 ); - await newBlockBlobURL.stageBlockFromURL( - Aborter.none, + await newBlockBlobClient.stageBlockFromURL( base64encode("2"), - blockBlobURL.url, + blockBlobClient.url, 4, 4 ); - await newBlockBlobURL.stageBlockFromURL( - Aborter.none, + await newBlockBlobClient.stageBlockFromURL( base64encode("3"), - blockBlobURL.url, + blockBlobClient.url, 8, 2 ); - const listResponse = await newBlockBlobURL.getBlockList( - Aborter.none, - "uncommitted" - ); + const listResponse = await newBlockBlobClient.getBlockList("uncommitted"); assert.equal(listResponse.uncommittedBlocks!.length, 3); assert.equal(listResponse.uncommittedBlocks![0].name, base64encode("1")); assert.equal(listResponse.uncommittedBlocks![0].size, 4); @@ -171,38 +144,22 @@ describe("BlockBlobURL", () => { assert.equal(listResponse.uncommittedBlocks![2].name, base64encode("3")); assert.equal(listResponse.uncommittedBlocks![2].size, 2); - await newBlockBlobURL.commitBlockList(Aborter.none, [ + await newBlockBlobClient.commitBlockList([ base64encode("1"), base64encode("2"), base64encode("3") ]); - const downloadResponse = await newBlockBlobURL.download(Aborter.none, 0); + const downloadResponse = await newBlockBlobClient.download(0); assert.equal(await bodyToString(downloadResponse, 10), body); }); it("commitBlockList", async () => { const body = "HelloWorld"; - await blockBlobURL.stageBlock( - Aborter.none, - base64encode("1"), - body, - body.length - ); - await blockBlobURL.stageBlock( - Aborter.none, - base64encode("2"), - body, - body.length - ); - await blockBlobURL.commitBlockList(Aborter.none, [ - base64encode("1"), - base64encode("2") - ]); - const listResponse = await blockBlobURL.getBlockList( - Aborter.none, - "committed" - ); + await blockBlobClient.stageBlock(base64encode("1"), body, body.length); + await blockBlobClient.stageBlock(base64encode("2"), body, body.length); + await blockBlobClient.commitBlockList([base64encode("1"), base64encode("2")]); + const listResponse = await blockBlobClient.getBlockList("committed"); assert.equal(listResponse.committedBlocks!.length, 2); assert.equal(listResponse.committedBlocks![0].name, base64encode("1")); assert.equal(listResponse.committedBlocks![0].size, body.length); @@ -212,18 +169,8 @@ describe("BlockBlobURL", () => { it("commitBlockList with all parameters set", async () => { const body = "HelloWorld"; - await blockBlobURL.stageBlock( - Aborter.none, - base64encode("1"), - body, - body.length - ); - await blockBlobURL.stageBlock( - Aborter.none, - base64encode("2"), - body, - body.length - ); + await blockBlobClient.stageBlock(base64encode("1"), body, body.length); + await blockBlobClient.stageBlock(base64encode("2"), body, body.length); const options = { blobCacheControl: "blobCacheControl", @@ -236,35 +183,22 @@ describe("BlockBlobURL", () => { keyb: "valb" } }; - await blockBlobURL.commitBlockList( - Aborter.none, - [base64encode("1"), base64encode("2")], - { - blobHTTPHeaders: options, - metadata: options.metadata - } - ); + await blockBlobClient.commitBlockList([base64encode("1"), base64encode("2")], { + blobHTTPHeaders: options, + metadata: options.metadata + }); - const listResponse = await blockBlobURL.getBlockList( - Aborter.none, - "committed" - ); + const listResponse = await blockBlobClient.getBlockList("committed"); assert.equal(listResponse.committedBlocks!.length, 2); assert.equal(listResponse.committedBlocks![0].name, base64encode("1")); assert.equal(listResponse.committedBlocks![0].size, body.length); assert.equal(listResponse.committedBlocks![1].name, base64encode("2")); assert.equal(listResponse.committedBlocks![1].size, body.length); - const result = await blobURL.download(Aborter.none, 0); - assert.deepStrictEqual( - await bodyToString(result, body.repeat(2).length), - body.repeat(2) - ); + const result = await blobClient.download(0); + assert.deepStrictEqual(await bodyToString(result, body.repeat(2).length), body.repeat(2)); assert.deepStrictEqual(result.cacheControl, options.blobCacheControl); - assert.deepStrictEqual( - result.contentDisposition, - options.blobContentDisposition - ); + assert.deepStrictEqual(result.contentDisposition, options.blobContentDisposition); assert.deepStrictEqual(result.contentEncoding, options.blobContentEncoding); assert.deepStrictEqual(result.contentLanguage, options.blobContentLanguage); assert.deepStrictEqual(result.contentType, options.blobContentType); @@ -273,20 +207,10 @@ describe("BlockBlobURL", () => { it("getBlockList", async () => { const body = "HelloWorld"; - await blockBlobURL.stageBlock( - Aborter.none, - base64encode("1"), - body, - body.length - ); - await blockBlobURL.stageBlock( - Aborter.none, - base64encode("2"), - body, - body.length - ); - await blockBlobURL.commitBlockList(Aborter.none, [base64encode("2")]); - const listResponse = await blockBlobURL.getBlockList(Aborter.none, "all"); + await blockBlobClient.stageBlock(base64encode("1"), body, body.length); + await blockBlobClient.stageBlock(base64encode("2"), body, body.length); + await blockBlobClient.commitBlockList([base64encode("2")]); + const listResponse = await blockBlobClient.getBlockList("all"); assert.equal(listResponse.committedBlocks!.length, 1); assert.equal(listResponse.uncommittedBlocks!.length, 0); assert.equal(listResponse.committedBlocks![0].name, base64encode("2")); diff --git a/sdk/storage/storage-blob/test/browser/highlevel.browser.test.ts b/sdk/storage/storage-blob/test/browser/highlevel.browser.spec.ts similarity index 70% rename from sdk/storage/storage-blob/test/browser/highlevel.browser.test.ts rename to sdk/storage/storage-blob/test/browser/highlevel.browser.spec.ts index 0a57e8f17219..cb3c85e34fff 100644 --- a/sdk/storage/storage-blob/test/browser/highlevel.browser.test.ts +++ b/sdk/storage/storage-blob/test/browser/highlevel.browser.spec.ts @@ -1,9 +1,9 @@ import * as assert from "assert"; import { Aborter } from "../../src/Aborter"; -import { BlobURL } from "../../src/BlobURL"; -import { BlockBlobURL } from "../../src/BlockBlobURL"; -import { ContainerURL } from "../../src/ContainerURL"; +import { BlobClient } from "../../src/BlobClient"; +import { BlockBlobClient } from "../../src/BlockBlobClient"; +import { ContainerClient } from "../../src/ContainerClient"; import { uploadBrowserDataToBlockBlob } from "../../src/highlevel.browser"; import { arrayBufferEqual, @@ -18,12 +18,12 @@ import { // tslint:disable:no-empty describe("Highelvel", () => { - const serviceURL = getBSU(); + const serviceClient = getBSU(); let containerName = getUniqueName("container"); - let containerURL = ContainerURL.fromServiceURL(serviceURL, containerName); + let containerClient = ContainerClient.fromBlobServiceClient(serviceClient, containerName); let blobName = getUniqueName("blob"); - let blobURL = BlobURL.fromContainerURL(containerURL, blobName); - let blockBlobURL = BlockBlobURL.fromBlobURL(blobURL); + let blobClient = BlobClient.fromContainerClient(containerClient, blobName); + let blockBlobClient = BlockBlobClient.fromBlobClient(blobClient); let tempFile1: File; const tempFile1Length: number = 257 * 1024 * 1024 - 1; let tempFile2: File; @@ -31,15 +31,15 @@ describe("Highelvel", () => { beforeEach(async () => { containerName = getUniqueName("container"); - containerURL = ContainerURL.fromServiceURL(serviceURL, containerName); - await containerURL.create(Aborter.none); + containerClient = ContainerClient.fromBlobServiceClient(serviceClient, containerName); + await containerClient.create(); blobName = getUniqueName("blob"); - blobURL = BlobURL.fromContainerURL(containerURL, blobName); - blockBlobURL = BlockBlobURL.fromBlobURL(blobURL); + blobClient = BlobClient.fromContainerClient(containerClient, blobName); + blockBlobClient = BlockBlobClient.fromBlobClient(blobClient); }); afterEach(async () => { - await containerURL.delete(Aborter.none); + await containerClient.delete(); }); before(async () => { @@ -53,7 +53,9 @@ describe("Highelvel", () => { const aborter = Aborter.timeout(1); try { - await uploadBrowserDataToBlockBlob(aborter, tempFile1, blockBlobURL); + await uploadBrowserDataToBlockBlob(tempFile1, blockBlobClient, { + abortSignal: aborter + }); assert.fail(); } catch (err) { assert.ok((err.code as string).toLowerCase().includes("abort")); @@ -64,7 +66,8 @@ describe("Highelvel", () => { const aborter = Aborter.timeout(1); try { - await uploadBrowserDataToBlockBlob(aborter, tempFile2, blockBlobURL, { + await uploadBrowserDataToBlockBlob(tempFile2, blockBlobClient, { + abortSignal: aborter, blockSize: 4 * 1024 * 1024, parallelism: 2 }); @@ -79,10 +82,11 @@ describe("Highelvel", () => { const aborter = Aborter.none; try { - await uploadBrowserDataToBlockBlob(aborter, tempFile1, blockBlobURL, { + await uploadBrowserDataToBlockBlob(tempFile1, blockBlobClient, { + abortSignal: aborter, blockSize: 4 * 1024 * 1024, parallelism: 2, - progress: ev => { + progress: (ev) => { assert.ok(ev.loadedBytes); eventTriggered = true; aborter.abort(); @@ -97,10 +101,11 @@ describe("Highelvel", () => { const aborter = Aborter.none; try { - await uploadBrowserDataToBlockBlob(aborter, tempFile2, blockBlobURL, { + await uploadBrowserDataToBlockBlob(tempFile2, blockBlobClient, { + abortSignal: aborter, blockSize: 4 * 1024 * 1024, parallelism: 2, - progress: ev => { + progress: (ev) => { assert.ok(ev.loadedBytes); eventTriggered = true; aborter.abort(); @@ -111,12 +116,12 @@ describe("Highelvel", () => { }); it("uploadBrowserDataToBlockBlob should success when blob < BLOCK_BLOB_MAX_UPLOAD_BLOB_BYTES", async () => { - await uploadBrowserDataToBlockBlob(Aborter.none, tempFile2, blockBlobURL, { + await uploadBrowserDataToBlockBlob(tempFile2, blockBlobClient, { blockSize: 4 * 1024 * 1024, parallelism: 2 }); - const downloadResponse = await blockBlobURL.download(Aborter.none, 0); + const downloadResponse = await blockBlobClient.download(0); const downloadedString = await bodyToString(downloadResponse); const uploadedString = await blobToString(tempFile2); @@ -124,12 +129,12 @@ describe("Highelvel", () => { }); it("uploadBrowserDataToBlockBlob should success when blob < BLOCK_BLOB_MAX_UPLOAD_BLOB_BYTES and configured maxSingleShotSize", async () => { - await uploadBrowserDataToBlockBlob(Aborter.none, tempFile2, blockBlobURL, { + await uploadBrowserDataToBlockBlob(tempFile2, blockBlobClient, { blockSize: 512 * 1024, maxSingleShotSize: 0 }); - const downloadResponse = await blockBlobURL.download(Aborter.none, 0); + const downloadResponse = await blockBlobClient.download(0); const downloadedString = await bodyToString(downloadResponse); const uploadedString = await blobToString(tempFile2); @@ -145,12 +150,12 @@ describe("Highelvel", () => { return; } - await uploadBrowserDataToBlockBlob(Aborter.none, tempFile1, blockBlobURL, { + await uploadBrowserDataToBlockBlob(tempFile1, blockBlobClient, { blockSize: 4 * 1024 * 1024, parallelism: 2 }); - const downloadResponse = await blockBlobURL.download(Aborter.none, 0); + const downloadResponse = await blockBlobClient.download(0); const buf1 = await blobToArrayBuffer(await downloadResponse.blobBody!); const buf2 = await blobToArrayBuffer(tempFile1); diff --git a/sdk/storage/storage-blob/test/containerurl.test.ts b/sdk/storage/storage-blob/test/containerclient.spec.ts similarity index 52% rename from sdk/storage/storage-blob/test/containerurl.test.ts rename to sdk/storage/storage-blob/test/containerclient.spec.ts index 24dd7860129c..0fa6ba49b5b8 100644 --- a/sdk/storage/storage-blob/test/containerurl.test.ts +++ b/sdk/storage/storage-blob/test/containerclient.spec.ts @@ -1,26 +1,25 @@ import * as assert from "assert"; -import { Aborter } from "../src/Aborter"; -import { BlobURL } from "../src/BlobURL"; -import { BlockBlobURL } from "../src/BlockBlobURL"; -import { ContainerURL } from "../src/ContainerURL"; +import { BlobClient } from "../src/BlobClient"; +import { BlockBlobClient } from "../src/BlockBlobClient"; +import { ContainerClient } from "../src/ContainerClient"; import { getBSU, getUniqueName, sleep } from "./utils"; import * as dotenv from "dotenv"; -dotenv.config({path:"../.env"}); +dotenv.config({ path: "../.env" }); -describe("ContainerURL", () => { - const serviceURL = getBSU(); +describe("ContainerClient", () => { + const blobServiceClient = getBSU(); let containerName: string = getUniqueName("container"); - let containerURL = ContainerURL.fromServiceURL(serviceURL, containerName); + let containerClient = ContainerClient.fromBlobServiceClient(blobServiceClient, containerName); beforeEach(async () => { containerName = getUniqueName("container"); - containerURL = ContainerURL.fromServiceURL(serviceURL, containerName); - await containerURL.create(Aborter.none); + containerClient = ContainerClient.fromBlobServiceClient(blobServiceClient, containerName); + await containerClient.create(); }); afterEach(async () => { - await containerURL.delete(Aborter.none); + await containerClient.delete(); }); it("setMetadata", async () => { @@ -29,14 +28,14 @@ describe("ContainerURL", () => { keya: "vala", keyb: "valb" }; - await containerURL.setMetadata(Aborter.none, metadata); + await containerClient.setMetadata(metadata); - const result = await containerURL.getProperties(Aborter.none); + const result = await containerClient.getProperties(); assert.deepEqual(result.metadata, metadata); }); it("getProperties", async () => { - const result = await containerURL.getProperties(Aborter.none); + const result = await containerClient.getProperties(); assert.ok(result.eTag!.length > 0); assert.ok(result.lastModified); assert.ok(!result.leaseDuration); @@ -48,25 +47,22 @@ describe("ContainerURL", () => { assert.ok(!result.blobPublicAccess); }); - it("create with default parameters", done => { + it("create with default parameters", (done) => { // create() with default parameters has been tested in beforeEach done(); }); it("create with all parameters configured", async () => { - const cURL = ContainerURL.fromServiceURL( - serviceURL, - getUniqueName(containerName) - ); + const cClient = ContainerClient.fromBlobServiceClient(blobServiceClient, getUniqueName(containerName)); const metadata = { key: "value" }; const access = "container"; - await cURL.create(Aborter.none, { metadata, access }); - const result = await cURL.getProperties(Aborter.none); + await cClient.create({ metadata, access }); + const result = await cClient.getProperties(); assert.deepEqual(result.blobPublicAccess, access); assert.deepEqual(result.metadata, metadata); }); - it("delete", done => { + it("delete", (done) => { // delete() with default parameters has been tested in afterEach done(); }); @@ -74,225 +70,199 @@ describe("ContainerURL", () => { it("acquireLease", async () => { const guid = "ca761232ed4211cebacd00aa0057b223"; const duration = 30; - await containerURL.acquireLease(Aborter.none, guid, duration); + await containerClient.acquireLease(guid, duration); - const result = await containerURL.getProperties(Aborter.none); + const result = await containerClient.getProperties(); assert.equal(result.leaseDuration, "fixed"); assert.equal(result.leaseState, "leased"); assert.equal(result.leaseStatus, "locked"); - await containerURL.releaseLease(Aborter.none, guid); + await containerClient.releaseLease(guid); }); it("releaseLease", async () => { const guid = "ca761232ed4211cebacd00aa0057b223"; const duration = -1; - await containerURL.acquireLease(Aborter.none, guid, duration); + await containerClient.acquireLease(guid, duration); - const result = await containerURL.getProperties(Aborter.none); + const result = await containerClient.getProperties(); assert.equal(result.leaseDuration, "infinite"); assert.equal(result.leaseState, "leased"); assert.equal(result.leaseStatus, "locked"); - await containerURL.releaseLease(Aborter.none, guid); + await containerClient.releaseLease(guid); }); it("renewLease", async () => { const guid = "ca761232ed4211cebacd00aa0057b223"; const duration = 15; - await containerURL.acquireLease(Aborter.none, guid, duration); + await containerClient.acquireLease(guid, duration); - const result = await containerURL.getProperties(Aborter.none); + const result = await containerClient.getProperties(); assert.equal(result.leaseDuration, "fixed"); assert.equal(result.leaseState, "leased"); assert.equal(result.leaseStatus, "locked"); await sleep(16 * 1000); - const result2 = await containerURL.getProperties(Aborter.none); + const result2 = await containerClient.getProperties(); assert.ok(!result2.leaseDuration); assert.equal(result2.leaseState, "expired"); assert.equal(result2.leaseStatus, "unlocked"); - await containerURL.renewLease(Aborter.none, guid); - const result3 = await containerURL.getProperties(Aborter.none); + await containerClient.renewLease(guid); + const result3 = await containerClient.getProperties(); assert.equal(result3.leaseDuration, "fixed"); assert.equal(result3.leaseState, "leased"); assert.equal(result3.leaseStatus, "locked"); - await containerURL.releaseLease(Aborter.none, guid); + await containerClient.releaseLease(guid); }); it("changeLease", async () => { const guid = "ca761232ed4211cebacd00aa0057b223"; const duration = 15; - await containerURL.acquireLease(Aborter.none, guid, duration); + await containerClient.acquireLease(guid, duration); - const result = await containerURL.getProperties(Aborter.none); + const result = await containerClient.getProperties(); assert.equal(result.leaseDuration, "fixed"); assert.equal(result.leaseState, "leased"); assert.equal(result.leaseStatus, "locked"); const newGuid = "3c7e72ebb4304526bc53d8ecef03798f"; - await containerURL.changeLease(Aborter.none, guid, newGuid); + await containerClient.changeLease(guid, newGuid); - await containerURL.getProperties(Aborter.none); - await containerURL.releaseLease(Aborter.none, newGuid); + await containerClient.getProperties(); + await containerClient.releaseLease(newGuid); }); it("breakLease", async () => { const guid = "ca761232ed4211cebacd00aa0057b223"; const duration = 15; - await containerURL.acquireLease(Aborter.none, guid, duration); + await containerClient.acquireLease(guid, duration); - const result = await containerURL.getProperties(Aborter.none); + const result = await containerClient.getProperties(); assert.equal(result.leaseDuration, "fixed"); assert.equal(result.leaseState, "leased"); assert.equal(result.leaseStatus, "locked"); - await containerURL.breakLease(Aborter.none, 3); + await containerClient.breakLease(3); - const result2 = await containerURL.getProperties(Aborter.none); + const result2 = await containerClient.getProperties(); assert.ok(!result2.leaseDuration); assert.equal(result2.leaseState, "breaking"); assert.equal(result2.leaseStatus, "locked"); await sleep(3 * 1000); - const result3 = await containerURL.getProperties(Aborter.none); + const result3 = await containerClient.getProperties(); assert.ok(!result3.leaseDuration); assert.equal(result3.leaseState, "broken"); assert.equal(result3.leaseStatus, "unlocked"); }); it("listBlobFlatSegment with default parameters", async () => { - const blobURLs = []; + const blobClients = []; for (let i = 0; i < 3; i++) { - const blobURL = BlobURL.fromContainerURL( - containerURL, + const blobClient = BlobClient.fromContainerClient( + containerClient, getUniqueName(`blockblob/${i}`) ); - const blockBlobURL = BlockBlobURL.fromBlobURL(blobURL); - await blockBlobURL.upload(Aborter.none, "", 0); - blobURLs.push(blobURL); + const blockBlobClient = BlockBlobClient.fromBlobClient(blobClient); + await blockBlobClient.upload("", 0); + blobClients.push(blobClient); } - const result = await containerURL.listBlobFlatSegment(Aborter.none); + const result = await containerClient.listBlobFlatSegment(); assert.ok(result.serviceEndpoint.length > 0); - assert.ok(containerURL.url.indexOf(result.containerName)); + assert.ok(containerClient.url.indexOf(result.containerName)); assert.deepStrictEqual(result.nextMarker, ""); - assert.deepStrictEqual(result.segment.blobItems!.length, blobURLs.length); - assert.ok(blobURLs[0].url.indexOf(result.segment.blobItems![0].name)); + assert.deepStrictEqual(result.segment.blobItems!.length, blobClients.length); + assert.ok(blobClients[0].url.indexOf(result.segment.blobItems![0].name)); - for (const blob of blobURLs) { - await blob.delete(Aborter.none); + for (const blob of blobClients) { + await blob.delete(); } }); it("listBlobFlatSegment with all parameters configured", async () => { - const blobURLs = []; + const blobClients = []; const prefix = "blockblob"; const metadata = { keya: "a", keyb: "c" }; for (let i = 0; i < 2; i++) { - const blobURL = BlobURL.fromContainerURL( - containerURL, + const blobClient = BlobClient.fromContainerClient( + containerClient, getUniqueName(`${prefix}/${i}`) ); - const blockBlobURL = BlockBlobURL.fromBlobURL(blobURL); - await blockBlobURL.upload(Aborter.none, "", 0, { + const blockBlobClient = BlockBlobClient.fromBlobClient(blobClient); + await blockBlobClient.upload("", 0, { metadata }); - blobURLs.push(blobURL); + blobClients.push(blobClient); } - const result = await containerURL.listBlobFlatSegment( - Aborter.none, - undefined, - { - include: [ - "snapshots", - "metadata", - "uncommittedblobs", - "copy", - "deleted" - ], - maxresults: 1, - prefix - } - ); + const result = await containerClient.listBlobFlatSegment(undefined, { + include: ["snapshots", "metadata", "uncommittedblobs", "copy", "deleted"], + maxresults: 1, + prefix + }); assert.ok(result.serviceEndpoint.length > 0); - assert.ok(containerURL.url.indexOf(result.containerName)); + assert.ok(containerClient.url.indexOf(result.containerName)); assert.deepStrictEqual(result.segment.blobItems!.length, 1); - assert.ok(blobURLs[0].url.indexOf(result.segment.blobItems![0].name)); + assert.ok(blobClients[0].url.indexOf(result.segment.blobItems![0].name)); assert.deepStrictEqual(result.segment.blobItems![0].metadata, metadata); - const result2 = await containerURL.listBlobFlatSegment( - Aborter.none, - result.nextMarker, - { - include: [ - "snapshots", - "metadata", - "uncommittedblobs", - "copy", - "deleted" - ], - maxresults: 2, - prefix - } - ); + const result2 = await containerClient.listBlobFlatSegment(result.nextMarker, { + include: ["snapshots", "metadata", "uncommittedblobs", "copy", "deleted"], + maxresults: 2, + prefix + }); assert.ok(result2.serviceEndpoint.length > 0); - assert.ok(containerURL.url.indexOf(result2.containerName)); + assert.ok(containerClient.url.indexOf(result2.containerName)); assert.deepStrictEqual(result2.segment.blobItems!.length, 1); - assert.ok(blobURLs[0].url.indexOf(result2.segment.blobItems![0].name)); + assert.ok(blobClients[0].url.indexOf(result2.segment.blobItems![0].name)); assert.deepStrictEqual(result2.segment.blobItems![0].metadata, metadata); - for (const blob of blobURLs) { - await blob.delete(Aborter.none); + for (const blob of blobClients) { + await blob.delete(); } }); it("listBlobHierarchySegment with default parameters", async () => { - const blobURLs = []; + const blobClients = []; for (let i = 0; i < 3; i++) { - const blobURL = BlobURL.fromContainerURL( - containerURL, + const blobClient = BlobClient.fromContainerClient( + containerClient, getUniqueName(`blockblob${i}/${i}`) ); - const blockBlobURL = BlockBlobURL.fromBlobURL(blobURL); - await blockBlobURL.upload(Aborter.none, "", 0); - blobURLs.push(blobURL); + const blockBlobClient = BlockBlobClient.fromBlobClient(blobClient); + await blockBlobClient.upload("", 0); + blobClients.push(blobClient); } const delimiter = "/"; - const result = await containerURL.listBlobHierarchySegment( - Aborter.none, - delimiter - ); + const result = await containerClient.listBlobHierarchySegment(delimiter); assert.ok(result.serviceEndpoint.length > 0); - assert.ok(containerURL.url.indexOf(result.containerName)); + assert.ok(containerClient.url.indexOf(result.containerName)); assert.deepStrictEqual(result.nextMarker, ""); assert.deepStrictEqual(result.delimiter, delimiter); - assert.deepStrictEqual( - result.segment.blobPrefixes!.length, - blobURLs.length - ); + assert.deepStrictEqual(result.segment.blobPrefixes!.length, blobClients.length); - for (const blob of blobURLs) { + for (const blob of blobClients) { let i = 0; assert.ok(blob.url.indexOf(result.segment.blobPrefixes![i++].name)); } - for (const blob of blobURLs) { - await blob.delete(Aborter.none); + for (const blob of blobClients) { + await blob.delete(); } }); it("listBlobHierarchySegment with all parameters configured", async () => { - const blobURLs = []; + const blobClients = []; const prefix = "blockblob"; const metadata = { keya: "a", @@ -300,19 +270,18 @@ describe("ContainerURL", () => { }; const delimiter = "/"; for (let i = 0; i < 2; i++) { - const blobURL = BlobURL.fromContainerURL( - containerURL, + const blobClient = BlobClient.fromContainerClient( + containerClient, getUniqueName(`${prefix}${i}${delimiter}${i}`) ); - const blockBlobURL = BlockBlobURL.fromBlobURL(blobURL); - await blockBlobURL.upload(Aborter.none, "", 0, { + const blockBlobClient = BlockBlobClient.fromBlobClient(blobClient); + await blockBlobClient.upload("", 0, { metadata }); - blobURLs.push(blobURL); + blobClients.push(blobClient); } - const result = await containerURL.listBlobHierarchySegment( - Aborter.none, + const result = await containerClient.listBlobHierarchySegment( delimiter, undefined, { @@ -322,13 +291,12 @@ describe("ContainerURL", () => { } ); assert.ok(result.serviceEndpoint.length > 0); - assert.ok(containerURL.url.indexOf(result.containerName)); + assert.ok(containerClient.url.indexOf(result.containerName)); assert.deepStrictEqual(result.segment.blobPrefixes!.length, 1); assert.deepStrictEqual(result.segment.blobItems!.length, 0); - assert.ok(blobURLs[0].url.indexOf(result.segment.blobPrefixes![0].name)); + assert.ok(blobClients[0].url.indexOf(result.segment.blobPrefixes![0].name)); - const result2 = await containerURL.listBlobHierarchySegment( - Aborter.none, + const result2 = await containerClient.listBlobHierarchySegment( delimiter, result.nextMarker, { @@ -338,13 +306,12 @@ describe("ContainerURL", () => { } ); assert.ok(result2.serviceEndpoint.length > 0); - assert.ok(containerURL.url.indexOf(result2.containerName)); + assert.ok(containerClient.url.indexOf(result2.containerName)); assert.deepStrictEqual(result2.segment.blobPrefixes!.length, 1); assert.deepStrictEqual(result2.segment.blobItems!.length, 0); - assert.ok(blobURLs[0].url.indexOf(result2.segment.blobPrefixes![0].name)); + assert.ok(blobClients[0].url.indexOf(result2.segment.blobPrefixes![0].name)); - const result3 = await containerURL.listBlobHierarchySegment( - Aborter.none, + const result3 = await containerClient.listBlobHierarchySegment( delimiter, undefined, { @@ -354,15 +321,15 @@ describe("ContainerURL", () => { } ); assert.ok(result3.serviceEndpoint.length > 0); - assert.ok(containerURL.url.indexOf(result3.containerName)); + assert.ok(containerClient.url.indexOf(result3.containerName)); assert.deepStrictEqual(result3.nextMarker, ""); assert.deepStrictEqual(result3.delimiter, delimiter); assert.deepStrictEqual(result3.segment.blobItems!.length, 1); assert.deepStrictEqual(result3.segment.blobItems![0].metadata, metadata); - assert.ok(blobURLs[0].url.indexOf(result3.segment.blobItems![0].name)); + assert.ok(blobClients[0].url.indexOf(result3.segment.blobItems![0].name)); - for (const blob of blobURLs) { - await blob.delete(Aborter.none); + for (const blob of blobClients) { + await blob.delete(); } }); }); diff --git a/sdk/storage/storage-blob/test/node/blockblobclient.spec.ts b/sdk/storage/storage-blob/test/node/blockblobclient.spec.ts new file mode 100644 index 000000000000..788aaed4890b --- /dev/null +++ b/sdk/storage/storage-blob/test/node/blockblobclient.spec.ts @@ -0,0 +1,56 @@ +import * as assert from "assert"; + +import { BlobClient } from "../../src/BlobClient"; +import { BlockBlobClient } from "../../src/BlockBlobClient"; +import { ContainerClient } from "../../src/ContainerClient"; +import { bodyToString, getBSU, getUniqueName } from "../utils"; + +describe("BlockBlobClient Node.js only", () => { + const blobServiceClient = getBSU(); + let containerName: string = getUniqueName("container"); + let containerClient = ContainerClient.fromBlobServiceClient(blobServiceClient, containerName); + let blobName: string = getUniqueName("blob"); + let blobClient = BlobClient.fromContainerClient(containerClient, blobName); + let blockBlobClient = BlockBlobClient.fromBlobClient(blobClient); + + beforeEach(async () => { + containerName = getUniqueName("container"); + containerClient = ContainerClient.fromBlobServiceClient(blobServiceClient, containerName); + await containerClient.create(); + blobName = getUniqueName("blob"); + blobClient = BlobClient.fromContainerClient(containerClient, blobName); + blockBlobClient = BlockBlobClient.fromBlobClient(blobClient); + }); + + afterEach(async () => { + await containerClient.delete(); + }); + + it("upload with Readable stream body and default parameters", async () => { + const body: string = getUniqueName("randomstring"); + const bodyBuffer = Buffer.from(body); + + await blockBlobClient.upload(bodyBuffer, body.length); + const result = await blobClient.download(0); + + const downloadedBody = await new Promise((resolve, reject) => { + const buffer: string[] = []; + result.readableStreamBody!.on("data", (data: Buffer) => { + buffer.push(data.toString()); + }); + result.readableStreamBody!.on("end", () => { + resolve(buffer.join("")); + }); + result.readableStreamBody!.on("error", reject); + }); + + assert.deepStrictEqual(downloadedBody, body); + }); + + it("upload with Chinese string body and default parameters", async () => { + const body: string = getUniqueName("randomstring你好"); + await blockBlobClient.upload(body, Buffer.byteLength(body)); + const result = await blobClient.download(0); + assert.deepStrictEqual(await bodyToString(result, Buffer.byteLength(body)), body); + }); +}); diff --git a/sdk/storage/storage-blob/test/node/blockbloburl.test.ts b/sdk/storage/storage-blob/test/node/blockbloburl.test.ts deleted file mode 100644 index caa0198821e0..000000000000 --- a/sdk/storage/storage-blob/test/node/blockbloburl.test.ts +++ /dev/null @@ -1,60 +0,0 @@ -import * as assert from "assert"; - -import { Aborter } from "../../src/Aborter"; -import { BlobURL } from "../../src/BlobURL"; -import { BlockBlobURL } from "../../src/BlockBlobURL"; -import { ContainerURL } from "../../src/ContainerURL"; -import { bodyToString, getBSU, getUniqueName } from "../utils"; - -describe("BlockBlobURL Node.js only", () => { - const serviceURL = getBSU(); - let containerName: string = getUniqueName("container"); - let containerURL = ContainerURL.fromServiceURL(serviceURL, containerName); - let blobName: string = getUniqueName("blob"); - let blobURL = BlobURL.fromContainerURL(containerURL, blobName); - let blockBlobURL = BlockBlobURL.fromBlobURL(blobURL); - - beforeEach(async () => { - containerName = getUniqueName("container"); - containerURL = ContainerURL.fromServiceURL(serviceURL, containerName); - await containerURL.create(Aborter.none); - blobName = getUniqueName("blob"); - blobURL = BlobURL.fromContainerURL(containerURL, blobName); - blockBlobURL = BlockBlobURL.fromBlobURL(blobURL); - }); - - afterEach(async () => { - await containerURL.delete(Aborter.none); - }); - - it("upload with Readable stream body and default parameters", async () => { - const body: string = getUniqueName("randomstring"); - const bodyBuffer = Buffer.from(body); - - await blockBlobURL.upload(Aborter.none, bodyBuffer, body.length); - const result = await blobURL.download(Aborter.none, 0); - - const downloadedBody = await new Promise((resolve, reject) => { - const buffer: string[] = []; - result.readableStreamBody!.on("data", (data: Buffer) => { - buffer.push(data.toString()); - }); - result.readableStreamBody!.on("end", () => { - resolve(buffer.join("")); - }); - result.readableStreamBody!.on("error", reject); - }); - - assert.deepStrictEqual(downloadedBody, body); - }); - - it("upload with Chinese string body and default parameters", async () => { - const body: string = getUniqueName("randomstring你好"); - await blockBlobURL.upload(Aborter.none, body, Buffer.byteLength(body)); - const result = await blobURL.download(Aborter.none, 0); - assert.deepStrictEqual( - await bodyToString(result, Buffer.byteLength(body)), - body - ); - }); -}); diff --git a/sdk/storage/storage-blob/test/node/containerurl.test.ts b/sdk/storage/storage-blob/test/node/containerclient.spec.ts similarity index 62% rename from sdk/storage/storage-blob/test/node/containerurl.test.ts rename to sdk/storage/storage-blob/test/node/containerclient.spec.ts index 7317edee4eda..18e118ba6ff8 100644 --- a/sdk/storage/storage-blob/test/node/containerurl.test.ts +++ b/sdk/storage/storage-blob/test/node/containerclient.spec.ts @@ -1,27 +1,26 @@ import * as assert from "assert"; -import { Aborter } from "../../src/Aborter"; -import { ContainerURL } from "../../src/ContainerURL"; +import { ContainerClient } from "../../src/ContainerClient"; import { getBSU, getUniqueName } from "../utils"; import { PublicAccessType } from "../../src/generated/lib/models/index"; -describe("ContainerURL", () => { - const serviceURL = getBSU(); +describe("ContainerClient", () => { + const blobServiceClient = getBSU(); let containerName: string = getUniqueName("container"); - let containerURL = ContainerURL.fromServiceURL(serviceURL, containerName); + let containerClient = ContainerClient.fromBlobServiceClient(blobServiceClient, containerName); beforeEach(async () => { containerName = getUniqueName("container"); - containerURL = ContainerURL.fromServiceURL(serviceURL, containerName); - await containerURL.create(Aborter.none); + containerClient = ContainerClient.fromBlobServiceClient(blobServiceClient, containerName); + await containerClient.create(); }); afterEach(async () => { - await containerURL.delete(Aborter.none); + await containerClient.delete(); }); it("getAccessPolicy", async () => { - const result = await containerURL.getAccessPolicy(Aborter.none); + const result = await containerClient.getAccessPolicy(); assert.ok(result.eTag!.length > 0); assert.ok(result.lastModified); assert.ok(result.requestId); @@ -42,8 +41,8 @@ describe("ContainerURL", () => { } ]; - await containerURL.setAccessPolicy(Aborter.none, access, containerAcl); - const result = await containerURL.getAccessPolicy(Aborter.none); + await containerClient.setAccessPolicy(access, containerAcl); + const result = await containerClient.getAccessPolicy(); assert.deepEqual(result.signedIdentifiers, containerAcl); assert.deepEqual(result.blobPublicAccess, access); }); diff --git a/sdk/storage/storage-blob/test/node/highlevel.node.test.ts b/sdk/storage/storage-blob/test/node/highlevel.node.spec.ts similarity index 58% rename from sdk/storage/storage-blob/test/node/highlevel.node.test.ts rename to sdk/storage/storage-blob/test/node/highlevel.node.spec.ts index 94f82d12ab98..dda890caf0a3 100644 --- a/sdk/storage/storage-blob/test/node/highlevel.node.test.ts +++ b/sdk/storage/storage-blob/test/node/highlevel.node.spec.ts @@ -3,29 +3,24 @@ import * as fs from "fs"; import * as path from "path"; import { PassThrough } from "stream"; -import { BlobURL, BlockBlobURL, ContainerURL } from "../../src"; +import { BlobClient, BlockBlobClient, ContainerClient } from "../../src"; import { Aborter } from "../../src/Aborter"; import { downloadBlobToBuffer, uploadFileToBlockBlob, uploadStreamToBlockBlob } from "../../src/highlevel.node"; -import { IRetriableReadableStreamOptions } from "../../src/utils/RetriableReadableStream"; -import { - createRandomLocalFile, - getBSU, - getUniqueName, - readStreamToLocalFile -} from "../utils"; +import { RetriableReadableStreamOptions } from "../../src/utils/RetriableReadableStream"; +import { createRandomLocalFile, getBSU, getUniqueName, readStreamToLocalFile } from "../utils"; // tslint:disable:no-empty describe("Highlevel", () => { - const serviceURL = getBSU(); + const blobServiceClient = getBSU(); let containerName = getUniqueName("container"); - let containerURL = ContainerURL.fromServiceURL(serviceURL, containerName); + let containerClient = ContainerClient.fromBlobServiceClient(blobServiceClient, containerName); let blobName = getUniqueName("blob"); - let blobURL = BlobURL.fromContainerURL(containerURL, blobName); - let blockBlobURL = BlockBlobURL.fromBlobURL(blobURL); + let blobClient = BlobClient.fromContainerClient(containerClient, blobName); + let blockBlobClient = BlockBlobClient.fromBlobClient(blobClient); let tempFileSmall: string; let tempFileSmallLength: number; let tempFileLarge: string; @@ -34,32 +29,24 @@ describe("Highlevel", () => { beforeEach(async () => { containerName = getUniqueName("container"); - containerURL = ContainerURL.fromServiceURL(serviceURL, containerName); - await containerURL.create(Aborter.none); + containerClient = ContainerClient.fromBlobServiceClient(blobServiceClient, containerName); + await containerClient.create(); blobName = getUniqueName("blob"); - blobURL = BlobURL.fromContainerURL(containerURL, blobName); - blockBlobURL = BlockBlobURL.fromBlobURL(blobURL); + blobClient = BlobClient.fromContainerClient(containerClient, blobName); + blockBlobClient = BlockBlobClient.fromBlobClient(blobClient); }); afterEach(async () => { - await containerURL.delete(Aborter.none); + await containerClient.delete(); }); before(async () => { if (!fs.existsSync(tempFolderPath)) { fs.mkdirSync(tempFolderPath); } - tempFileLarge = await createRandomLocalFile( - tempFolderPath, - 257, - 1024 * 1024 - ); + tempFileLarge = await createRandomLocalFile(tempFolderPath, 257, 1024 * 1024); tempFileLargeLength = 257 * 1024 * 1024; - tempFileSmall = await createRandomLocalFile( - tempFolderPath, - 15, - 1024 * 1024 - ); + tempFileSmall = await createRandomLocalFile(tempFolderPath, 15, 1024 * 1024); tempFileSmallLength = 15 * 1024 * 1024; }); @@ -69,20 +56,14 @@ describe("Highlevel", () => { }); it("uploadFileToBlockBlob should success when blob >= BLOCK_BLOB_MAX_UPLOAD_BLOB_BYTES", async () => { - await uploadFileToBlockBlob(Aborter.none, tempFileLarge, blockBlobURL, { + await uploadFileToBlockBlob(tempFileLarge, blockBlobClient, { blockSize: 4 * 1024 * 1024, parallelism: 20 }); - const downloadResponse = await blockBlobURL.download(Aborter.none, 0); - const downloadedFile = path.join( - tempFolderPath, - getUniqueName("downloadfile.") - ); - await readStreamToLocalFile( - downloadResponse.readableStreamBody!, - downloadedFile - ); + const downloadResponse = await blockBlobClient.download(0); + const downloadedFile = path.join(tempFolderPath, getUniqueName("downloadfile.")); + await readStreamToLocalFile(downloadResponse.readableStreamBody!, downloadedFile); const downloadedData = await fs.readFileSync(downloadedFile); const uploadedData = await fs.readFileSync(tempFileLarge); @@ -92,20 +73,14 @@ describe("Highlevel", () => { }); it("uploadFileToBlockBlob should success when blob < BLOCK_BLOB_MAX_UPLOAD_BLOB_BYTES", async () => { - await uploadFileToBlockBlob(Aborter.none, tempFileSmall, blockBlobURL, { + await uploadFileToBlockBlob(tempFileSmall, blockBlobClient, { blockSize: 4 * 1024 * 1024, parallelism: 20 }); - const downloadResponse = await blockBlobURL.download(Aborter.none, 0); - const downloadedFile = path.join( - tempFolderPath, - getUniqueName("downloadfile.") - ); - await readStreamToLocalFile( - downloadResponse.readableStreamBody!, - downloadedFile - ); + const downloadResponse = await blockBlobClient.download(0); + const downloadedFile = path.join(tempFolderPath, getUniqueName("downloadfile.")); + await readStreamToLocalFile(downloadResponse.readableStreamBody!, downloadedFile); const downloadedData = await fs.readFileSync(downloadedFile); const uploadedData = await fs.readFileSync(tempFileSmall); @@ -115,19 +90,13 @@ describe("Highlevel", () => { }); it("uploadFileToBlockBlob should success when blob < BLOCK_BLOB_MAX_UPLOAD_BLOB_BYTES and configured maxSingleShotSize", async () => { - await uploadFileToBlockBlob(Aborter.none, tempFileSmall, blockBlobURL, { + await uploadFileToBlockBlob(tempFileSmall, blockBlobClient, { maxSingleShotSize: 0 }); - const downloadResponse = await blockBlobURL.download(Aborter.none, 0); - const downloadedFile = path.join( - tempFolderPath, - getUniqueName("downloadfile.") - ); - await readStreamToLocalFile( - downloadResponse.readableStreamBody!, - downloadedFile - ); + const downloadResponse = await blockBlobClient.download(0); + const downloadedFile = path.join(tempFolderPath, getUniqueName("downloadfile.")); + await readStreamToLocalFile(downloadResponse.readableStreamBody!, downloadedFile); const downloadedData = await fs.readFileSync(downloadedFile); const uploadedData = await fs.readFileSync(tempFileSmall); @@ -140,7 +109,8 @@ describe("Highlevel", () => { const aborter = Aborter.timeout(1); try { - await uploadFileToBlockBlob(aborter, tempFileLarge, blockBlobURL, { + await uploadFileToBlockBlob(tempFileLarge, blockBlobClient, { + abortSignal: aborter, blockSize: 4 * 1024 * 1024, parallelism: 20 }); @@ -154,7 +124,8 @@ describe("Highlevel", () => { const aborter = Aborter.timeout(1); try { - await uploadFileToBlockBlob(aborter, tempFileSmall, blockBlobURL, { + await uploadFileToBlockBlob(tempFileSmall, blockBlobClient, { + abortSignal: aborter, blockSize: 4 * 1024 * 1024, parallelism: 20 }); @@ -169,10 +140,11 @@ describe("Highlevel", () => { const aborter = Aborter.none; try { - await uploadFileToBlockBlob(aborter, tempFileLarge, blockBlobURL, { + await uploadFileToBlockBlob(tempFileLarge, blockBlobClient, { + abortSignal: aborter, blockSize: 4 * 1024 * 1024, parallelism: 20, - progress: ev => { + progress: (ev) => { assert.ok(ev.loadedBytes); eventTriggered = true; aborter.abort(); @@ -187,10 +159,11 @@ describe("Highlevel", () => { const aborter = Aborter.none; try { - await uploadFileToBlockBlob(aborter, tempFileSmall, blockBlobURL, { + await uploadFileToBlockBlob(tempFileSmall, blockBlobClient, { + abortSignal: aborter, blockSize: 4 * 1024 * 1024, parallelism: 20, - progress: ev => { + progress: (ev) => { assert.ok(ev.loadedBytes); eventTriggered = true; aborter.abort(); @@ -202,24 +175,12 @@ describe("Highlevel", () => { it("uploadStreamToBlockBlob should success", async () => { const rs = fs.createReadStream(tempFileLarge); - await uploadStreamToBlockBlob( - Aborter.none, - rs, - blockBlobURL, - 4 * 1024 * 1024, - 20 - ); + await uploadStreamToBlockBlob(rs, blockBlobClient, 4 * 1024 * 1024, 20); - const downloadResponse = await blockBlobURL.download(Aborter.none, 0); + const downloadResponse = await blockBlobClient.download(0); - const downloadFilePath = path.join( - tempFolderPath, - getUniqueName("downloadFile") - ); - await readStreamToLocalFile( - downloadResponse.readableStreamBody!, - downloadFilePath - ); + const downloadFilePath = path.join(tempFolderPath, getUniqueName("downloadFile")); + await readStreamToLocalFile(downloadResponse.readableStreamBody!, downloadFilePath); const downloadedBuffer = fs.readFileSync(downloadFilePath); const uploadedBuffer = fs.readFileSync(tempFileLarge); @@ -233,24 +194,12 @@ describe("Highlevel", () => { const bufferStream = new PassThrough(); bufferStream.end(buf); - await uploadStreamToBlockBlob( - Aborter.none, - bufferStream, - blockBlobURL, - 4 * 1024 * 1024, - 20 - ); + await uploadStreamToBlockBlob(bufferStream, blockBlobClient, 4 * 1024 * 1024, 20); - const downloadResponse = await blockBlobURL.download(Aborter.none, 0); + const downloadResponse = await blockBlobClient.download(0); - const downloadFilePath = path.join( - tempFolderPath, - getUniqueName("downloadFile") - ); - await readStreamToLocalFile( - downloadResponse.readableStreamBody!, - downloadFilePath - ); + const downloadFilePath = path.join(tempFolderPath, getUniqueName("downloadFile")); + await readStreamToLocalFile(downloadResponse.readableStreamBody!, downloadFilePath); const downloadedBuffer = fs.readFileSync(downloadFilePath); assert.ok(buf.equals(downloadedBuffer)); @@ -264,11 +213,13 @@ describe("Highlevel", () => { try { await uploadStreamToBlockBlob( - aborter, rs, - blockBlobURL, + blockBlobClient, 4 * 1024 * 1024, - 20 + 20, + { + abortSignal: aborter + } ); assert.fail(); } catch (err) { @@ -280,34 +231,21 @@ describe("Highlevel", () => { const rs = fs.createReadStream(tempFileLarge); let eventTriggered = false; - await uploadStreamToBlockBlob( - Aborter.none, - rs, - blockBlobURL, - 4 * 1024 * 1024, - 20, - { - progress: ev => { - assert.ok(ev.loadedBytes); - eventTriggered = true; - } + await uploadStreamToBlockBlob(rs, blockBlobClient, 4 * 1024 * 1024, 20, { + progress: (ev) => { + assert.ok(ev.loadedBytes); + eventTriggered = true; } - ); + }); assert.ok(eventTriggered); }); it("downloadBlobToBuffer should success", async () => { const rs = fs.createReadStream(tempFileLarge); - await uploadStreamToBlockBlob( - Aborter.none, - rs, - blockBlobURL, - 4 * 1024 * 1024, - 20 - ); + await uploadStreamToBlockBlob(rs, blockBlobClient, 4 * 1024 * 1024, 20); const buf = Buffer.alloc(tempFileLargeLength); - await downloadBlobToBuffer(Aborter.none, buf, blockBlobURL, 0, undefined, { + await downloadBlobToBuffer(buf, blockBlobClient, 0, undefined, { blockSize: 4 * 1024 * 1024, maxRetryRequestsPerBlock: 5, parallelism: 20 @@ -319,23 +257,17 @@ describe("Highlevel", () => { it("downloadBlobToBuffer should abort", async () => { const rs = fs.createReadStream(tempFileLarge); - await uploadStreamToBlockBlob( - Aborter.none, - rs, - blockBlobURL, - 4 * 1024 * 1024, - 20 - ); + await uploadStreamToBlockBlob(rs, blockBlobClient, 4 * 1024 * 1024, 20); try { const buf = Buffer.alloc(tempFileLargeLength); await downloadBlobToBuffer( - Aborter.timeout(1), buf, - blockBlobURL, + blockBlobClient, 0, undefined, { + abortSignal: Aborter.timeout(1), blockSize: 4 * 1024 * 1024, maxRetryRequestsPerBlock: 5, parallelism: 20 @@ -349,19 +281,14 @@ describe("Highlevel", () => { it("downloadBlobToBuffer should update progress event", async () => { const rs = fs.createReadStream(tempFileSmall); - await uploadStreamToBlockBlob( - Aborter.none, - rs, - blockBlobURL, - 4 * 1024 * 1024, - 10 - ); + await uploadStreamToBlockBlob(rs, blockBlobClient, 4 * 1024 * 1024, 10); let eventTriggered = false; const buf = Buffer.alloc(tempFileSmallLength); const aborter = Aborter.none; try { - await downloadBlobToBuffer(aborter, buf, blockBlobURL, 0, undefined, { + await downloadBlobToBuffer(buf, blockBlobClient, 0, undefined, { + abortSignal: aborter, blockSize: 1 * 1024, maxRetryRequestsPerBlock: 5, parallelism: 1, @@ -374,20 +301,18 @@ describe("Highlevel", () => { assert.ok(eventTriggered); }); - it("bloburl.download should success when internal stream unexcepted ends at the stream end", async () => { + it("blobclient.download should success when internal stream unexcepted ends at the stream end", async () => { const uploadResponse = await uploadFileToBlockBlob( - Aborter.none, tempFileSmall, - blockBlobURL, + blockBlobClient, { blockSize: 4 * 1024 * 1024, parallelism: 20 } ); - let retirableReadableStreamOptions: IRetriableReadableStreamOptions; - const downloadResponse = await blockBlobURL.download( - Aborter.none, + let retirableReadableStreamOptions: RetriableReadableStreamOptions; + const downloadResponse = await blockBlobClient.download( 0, undefined, { @@ -402,20 +327,12 @@ describe("Highlevel", () => { retirableReadableStreamOptions.doInjectErrorOnce = true; } } - } - ); + }); - retirableReadableStreamOptions = (downloadResponse.readableStreamBody! as any) - .options; + retirableReadableStreamOptions = (downloadResponse.readableStreamBody! as any).options; - const downloadedFile = path.join( - tempFolderPath, - getUniqueName("downloadfile.") - ); - await readStreamToLocalFile( - downloadResponse.readableStreamBody!, - downloadedFile - ); + const downloadedFile = path.join(tempFolderPath, getUniqueName("downloadfile.")); + await readStreamToLocalFile(downloadResponse.readableStreamBody!, downloadedFile); const downloadedData = await fs.readFileSync(downloadedFile); const uploadedData = await fs.readFileSync(tempFileSmall); @@ -424,21 +341,19 @@ describe("Highlevel", () => { assert.ok(downloadedData.equals(uploadedData)); }); - it("bloburl.download should download full data successfully when internal stream unexcepted ends", async () => { + it("blobclient.download should download full data successfully when internal stream unexcepted ends", async () => { const uploadResponse = await uploadFileToBlockBlob( - Aborter.none, tempFileSmall, - blockBlobURL, + blockBlobClient, { blockSize: 4 * 1024 * 1024, parallelism: 20 } ); - let retirableReadableStreamOptions: IRetriableReadableStreamOptions; + let retirableReadableStreamOptions: RetriableReadableStreamOptions; let injectedErrors = 0; - const downloadResponse = await blockBlobURL.download( - Aborter.none, + const downloadResponse = await blockBlobClient.download( 0, undefined, { @@ -453,20 +368,12 @@ describe("Highlevel", () => { retirableReadableStreamOptions.doInjectErrorOnce = true; } } - } - ); + }); - retirableReadableStreamOptions = (downloadResponse.readableStreamBody! as any) - .options; + retirableReadableStreamOptions = (downloadResponse.readableStreamBody! as any).options; - const downloadedFile = path.join( - tempFolderPath, - getUniqueName("downloadfile.") - ); - await readStreamToLocalFile( - downloadResponse.readableStreamBody!, - downloadedFile - ); + const downloadedFile = path.join(tempFolderPath, getUniqueName("downloadfile.")); + await readStreamToLocalFile(downloadResponse.readableStreamBody!, downloadedFile); const downloadedData = await fs.readFileSync(downloadedFile); const uploadedData = await fs.readFileSync(tempFileSmall); @@ -475,11 +382,10 @@ describe("Highlevel", () => { assert.ok(downloadedData.equals(uploadedData)); }); - it("bloburl.download should download partial data when internal stream unexcepted ends", async () => { + it("blobclient.download should download partial data when internal stream unexcepted ends", async () => { const uploadResponse = await uploadFileToBlockBlob( - Aborter.none, tempFileSmall, - blockBlobURL, + blockBlobClient, { blockSize: 4 * 1024 * 1024, parallelism: 20 @@ -488,10 +394,9 @@ describe("Highlevel", () => { const partialSize = 500 * 1024; - let retirableReadableStreamOptions: IRetriableReadableStreamOptions; + let retirableReadableStreamOptions: RetriableReadableStreamOptions; let injectedErrors = 0; - const downloadResponse = await blockBlobURL.download( - Aborter.none, + const downloadResponse = await blockBlobClient.download( 0, partialSize, { @@ -506,77 +411,52 @@ describe("Highlevel", () => { retirableReadableStreamOptions.doInjectErrorOnce = true; } } - } - ); + }); - retirableReadableStreamOptions = (downloadResponse.readableStreamBody! as any) - .options; + retirableReadableStreamOptions = (downloadResponse.readableStreamBody! as any).options; - const downloadedFile = path.join( - tempFolderPath, - getUniqueName("downloadfile.") - ); - await readStreamToLocalFile( - downloadResponse.readableStreamBody!, - downloadedFile - ); + const downloadedFile = path.join(tempFolderPath, getUniqueName("downloadfile.")); + await readStreamToLocalFile(downloadResponse.readableStreamBody!, downloadedFile); const downloadedData = await fs.readFileSync(downloadedFile); const uploadedData = await fs.readFileSync(tempFileSmall); fs.unlinkSync(downloadedFile); - assert.ok( - downloadedData - .slice(0, partialSize) - .equals(uploadedData.slice(0, partialSize)) - ); + assert.ok(downloadedData.slice(0, partialSize).equals(uploadedData.slice(0, partialSize))); }); - it("bloburl.download should download data failed when exceeding max stream retry requests", async () => { + it("blobclient.download should download data failed when exceeding max stream retry requests", async () => { const uploadResponse = await uploadFileToBlockBlob( - Aborter.none, tempFileSmall, - blockBlobURL, + blockBlobClient, { blockSize: 4 * 1024 * 1024, parallelism: 20 } ); - const downloadedFile = path.join( - tempFolderPath, - getUniqueName("downloadfile.") - ); + const downloadedFile = path.join(tempFolderPath, getUniqueName("downloadfile.")); - let retirableReadableStreamOptions: IRetriableReadableStreamOptions; + let retirableReadableStreamOptions: RetriableReadableStreamOptions; let injectedErrors = 0; let expectedError = false; try { - const downloadResponse = await blockBlobURL.download( - Aborter.none, - 0, - undefined, - { - blobAccessConditions: { - modifiedAccessConditions: { - ifMatch: uploadResponse.eTag - } - }, - maxRetryRequests: 0, - progress: () => { - if (injectedErrors++ < 1) { - retirableReadableStreamOptions.doInjectErrorOnce = true; - } + const downloadResponse = await blockBlobClient.download(0, undefined, { + blobAccessConditions: { + modifiedAccessConditions: { + ifMatch: uploadResponse.eTag + } + }, + maxRetryRequests: 0, + progress: () => { + if (injectedErrors++ < 1) { + retirableReadableStreamOptions.doInjectErrorOnce = true; } } - ); - retirableReadableStreamOptions = (downloadResponse.readableStreamBody! as any) - .options; - await readStreamToLocalFile( - downloadResponse.readableStreamBody!, - downloadedFile - ); + }); + retirableReadableStreamOptions = (downloadResponse.readableStreamBody! as any).options; + await readStreamToLocalFile(downloadResponse.readableStreamBody!, downloadedFile); } catch (error) { expectedError = true; } @@ -585,33 +465,29 @@ describe("Highlevel", () => { fs.unlinkSync(downloadedFile); }); - it("bloburl.download should abort after retrys", async () => { + it("blobclient.download should abort after retrys", async () => { const uploadResponse = await uploadFileToBlockBlob( - Aborter.none, tempFileSmall, - blockBlobURL, + blockBlobClient, { blockSize: 4 * 1024 * 1024, parallelism: 20 } ); - const downloadedFile = path.join( - tempFolderPath, - getUniqueName("downloadfile.") - ); + const downloadedFile = path.join(tempFolderPath, getUniqueName("downloadfile.")); - let retirableReadableStreamOptions: IRetriableReadableStreamOptions; + let retirableReadableStreamOptions: RetriableReadableStreamOptions; let injectedErrors = 0; let expectedError = false; try { const aborter = Aborter.none; - const downloadResponse = await blockBlobURL.download( - aborter, + const downloadResponse = await blockBlobClient.download( 0, undefined, { + abortSignal: aborter, blobAccessConditions: { modifiedAccessConditions: { ifMatch: uploadResponse.eTag @@ -627,14 +503,9 @@ describe("Highlevel", () => { aborter.abort(); } } - } - ); - retirableReadableStreamOptions = (downloadResponse.readableStreamBody! as any) - .options; - await readStreamToLocalFile( - downloadResponse.readableStreamBody!, - downloadedFile - ); + }); + retirableReadableStreamOptions = (downloadResponse.readableStreamBody! as any).options; + await readStreamToLocalFile(downloadResponse.readableStreamBody!, downloadedFile); } catch (error) { expectedError = true; } diff --git a/sdk/storage/storage-blob/test/node/pageblobclient.spec.ts b/sdk/storage/storage-blob/test/node/pageblobclient.spec.ts new file mode 100644 index 000000000000..a60d65d64806 --- /dev/null +++ b/sdk/storage/storage-blob/test/node/pageblobclient.spec.ts @@ -0,0 +1,99 @@ +import * as assert from "assert"; + +import { BlobClient } from "../../src/BlobClient"; +import { ContainerClient } from "../../src/ContainerClient"; +import { PageBlobClient } from "../../src/PageBlobClient"; +import { getBSU, getUniqueName, sleep } from "../utils"; + +describe("PageBlobClient", () => { + const blobServiceClient = getBSU(); + let containerName: string = getUniqueName("container"); + let containerClient = ContainerClient.fromBlobServiceClient(blobServiceClient, containerName); + let blobName: string = getUniqueName("blob"); + let blobClient = BlobClient.fromContainerClient(containerClient, blobName); + let pageBlobClient = PageBlobClient.fromBlobClient(blobClient); + + beforeEach(async () => { + containerName = getUniqueName("container"); + containerClient = ContainerClient.fromBlobServiceClient(blobServiceClient, containerName); + await containerClient.create(); + blobName = getUniqueName("blob"); + blobClient = BlobClient.fromContainerClient(containerClient, blobName); + pageBlobClient = PageBlobClient.fromBlobClient(blobClient); + }); + + afterEach(async () => { + await containerClient.delete(); + }); + + it("startCopyIncremental", async () => { + await pageBlobClient.create(1024, { + metadata: { + sourcemeta: "val" + } + }); + await pageBlobClient.uploadPages("b".repeat(1024), 0, 1024); + + let snapshotResult = await pageBlobClient.createSnapshot(); + assert.ok(snapshotResult.snapshot); + + const destPageBlobClient = PageBlobClient.fromContainerClient( + containerClient, + getUniqueName("page") + ); + + await containerClient.setAccessPolicy("container"); + + await sleep(5 * 1000); + + let copySource = pageBlobClient.withSnapshot(snapshotResult.snapshot!).url; + let copyResponse = await destPageBlobClient.startCopyIncremental(copySource); + + async function waitForCopy(retries = 0) { + if (retries >= 30) { + throw new Error("Check copy status exceed max retries counts"); + } + + switch (copyResponse.copyStatus) { + case "success": + return; + case "aborted": + throw new Error("Copy unexcepted aborted."); + case "pending": + await sleep(3000); + copyResponse = await destPageBlobClient.getProperties(); + await waitForCopy(++retries); + return; + case "failed": + throw new Error("Copy failed."); + default: + return; + } + } + + await waitForCopy(); + + let listBlobResponse = await containerClient.listBlobFlatSegment(undefined, { + include: ["copy", "snapshots"] + }); + + assert.equal(listBlobResponse.segment.blobItems.length, 4); + + await pageBlobClient.uploadPages("c".repeat(1024), 0, 1024); + snapshotResult = await pageBlobClient.createSnapshot(); + assert.ok(snapshotResult.snapshot); + copySource = pageBlobClient.withSnapshot(snapshotResult.snapshot!).url; + copyResponse = await destPageBlobClient.startCopyIncremental(copySource); + + await waitForCopy(); + + listBlobResponse = await containerClient.listBlobFlatSegment(undefined, { + include: ["copy", "snapshots"] + }); + + assert.equal(listBlobResponse.segment.blobItems.length, 6); + + const pageBlobProperties = await destPageBlobClient.getProperties(); + assert.equal(pageBlobProperties.metadata!.sourcemeta, "val"); + }); +}); diff --git a/sdk/storage/storage-blob/test/node/pagebloburl.test.ts b/sdk/storage/storage-blob/test/node/pagebloburl.test.ts deleted file mode 100644 index 12b3a1d9118f..000000000000 --- a/sdk/storage/storage-blob/test/node/pagebloburl.test.ts +++ /dev/null @@ -1,116 +0,0 @@ -import * as assert from "assert"; - -import { Aborter } from "../../src/Aborter"; -import { BlobURL } from "../../src/BlobURL"; -import { ContainerURL } from "../../src/ContainerURL"; -import { PageBlobURL } from "../../src/PageBlobURL"; -import { getBSU, getUniqueName, sleep } from "../utils"; - -describe("PageBlobURL", () => { - const serviceURL = getBSU(); - let containerName: string = getUniqueName("container"); - let containerURL = ContainerURL.fromServiceURL(serviceURL, containerName); - let blobName: string = getUniqueName("blob"); - let blobURL = BlobURL.fromContainerURL(containerURL, blobName); - let pageBlobURL = PageBlobURL.fromBlobURL(blobURL); - - beforeEach(async () => { - containerName = getUniqueName("container"); - containerURL = ContainerURL.fromServiceURL(serviceURL, containerName); - await containerURL.create(Aborter.none); - blobName = getUniqueName("blob"); - blobURL = BlobURL.fromContainerURL(containerURL, blobName); - pageBlobURL = PageBlobURL.fromBlobURL(blobURL); - }); - - afterEach(async () => { - await containerURL.delete(Aborter.none); - }); - - it("startCopyIncremental", async () => { - await pageBlobURL.create(Aborter.none, 1024, { - metadata: { - sourcemeta: "val" - } - }); - await pageBlobURL.uploadPages(Aborter.none, "b".repeat(1024), 0, 1024); - - let snapshotResult = await pageBlobURL.createSnapshot(Aborter.none); - assert.ok(snapshotResult.snapshot); - - const destPageBlobURL = PageBlobURL.fromContainerURL( - containerURL, - getUniqueName("page") - ); - - await containerURL.setAccessPolicy(Aborter.none, "container"); - - await sleep(5 * 1000); - - let copySource = pageBlobURL.withSnapshot(snapshotResult.snapshot!).url; - let copyResponse = await destPageBlobURL.startCopyIncremental( - Aborter.none, - copySource - ); - - async function waitForCopy(retries = 0) { - if (retries >= 30) { - throw new Error("Check copy status exceed max retries counts"); - } - - switch (copyResponse.copyStatus) { - case "success": - return; - case "aborted": - throw new Error("Copy unexcepted aborted."); - case "pending": - await sleep(3000); - copyResponse = await destPageBlobURL.getProperties(Aborter.none); - await waitForCopy(++retries); - return; - case "failed": - throw new Error("Copy failed."); - default: - return; - } - } - - await waitForCopy(); - - let listBlobResponse = await containerURL.listBlobFlatSegment( - Aborter.none, - undefined, - { - include: ["copy", "snapshots"] - } - ); - - assert.equal(listBlobResponse.segment.blobItems.length, 4); - - await pageBlobURL.uploadPages(Aborter.none, "c".repeat(1024), 0, 1024); - snapshotResult = await pageBlobURL.createSnapshot(Aborter.none); - assert.ok(snapshotResult.snapshot); - copySource = pageBlobURL.withSnapshot(snapshotResult.snapshot!).url; - copyResponse = await destPageBlobURL.startCopyIncremental( - Aborter.none, - copySource - ); - - await waitForCopy(); - - listBlobResponse = await containerURL.listBlobFlatSegment( - Aborter.none, - undefined, - { - include: ["copy", "snapshots"] - } - ); - - assert.equal(listBlobResponse.segment.blobItems.length, 6); - - const pageBlobProperties = await destPageBlobURL.getProperties( - Aborter.none - ); - assert.equal(pageBlobProperties.metadata!.sourcemeta, "val"); - }); -}); diff --git a/sdk/storage/storage-blob/test/node/sas.test.ts b/sdk/storage/storage-blob/test/node/sas.spec.ts similarity index 71% rename from sdk/storage/storage-blob/test/node/sas.test.ts rename to sdk/storage/storage-blob/test/node/sas.spec.ts index 2687871d4a64..3afab02093d9 100644 --- a/sdk/storage/storage-blob/test/node/sas.test.ts +++ b/sdk/storage/storage-blob/test/node/sas.spec.ts @@ -1,26 +1,25 @@ import * as assert from "assert"; import { - Aborter, AccountSASPermissions, AccountSASResourceTypes, AccountSASServices, AnonymousCredential, BlobSASPermissions, ContainerSASPermissions, - ContainerURL, + ContainerClient, generateAccountSASQueryParameters, generateBlobSASQueryParameters, - PageBlobURL, - ServiceURL, + PageBlobClient, + BlobServiceClient, SharedKeyCredential, - StorageURL + StorageClient } from "../../src"; import { SASProtocol } from "../../src/SASQueryParameters"; import { getBSU, getUniqueName } from "../utils"; describe("Shared Access Signature (SAS) generation Node.js only", () => { - const serviceURL = getBSU(); + const blobServiceClient = getBSU(); it("generateAccountSASQueryParameters should work", async () => { const now = new Date(); @@ -30,7 +29,7 @@ describe("Shared Access Signature (SAS) generation Node.js only", () => { tmr.setDate(tmr.getDate() + 1); // By default, credential is always the last element of pipeline factories - const factories = serviceURL.pipeline.factories; + const factories = blobServiceClient.pipeline.factories; const sharedKeyCredential = factories[factories.length - 1]; const sas = generateAccountSASQueryParameters( @@ -47,13 +46,13 @@ describe("Shared Access Signature (SAS) generation Node.js only", () => { sharedKeyCredential as SharedKeyCredential ).toString(); - const sasURL = `${serviceURL.url}?${sas}`; - const serviceURLWithSAS = new ServiceURL( - sasURL, - StorageURL.newPipeline(new AnonymousCredential()) + const sasClient = `${blobServiceClient.url}?${sas}`; + const serviceClientWithSAS = new BlobServiceClient( + sasClient, + StorageClient.newPipeline(new AnonymousCredential()) ); - await serviceURLWithSAS.getAccountInfo(Aborter.none); + await serviceClientWithSAS.getAccountInfo(); }); it("generateAccountSASQueryParameters should not work with invalid permission", async () => { @@ -61,7 +60,7 @@ describe("Shared Access Signature (SAS) generation Node.js only", () => { tmr.setDate(tmr.getDate() + 1); // By default, credential is always the last element of pipeline factories - const factories = serviceURL.pipeline.factories; + const factories = blobServiceClient.pipeline.factories; const sharedKeyCredential = factories[factories.length - 1]; const sas = generateAccountSASQueryParameters( @@ -74,15 +73,15 @@ describe("Shared Access Signature (SAS) generation Node.js only", () => { sharedKeyCredential as SharedKeyCredential ).toString(); - const sasURL = `${serviceURL.url}?${sas}`; - const serviceURLWithSAS = new ServiceURL( - sasURL, - StorageURL.newPipeline(new AnonymousCredential()) + const sasClient = `${blobServiceClient.url}?${sas}`; + const serviceClientWithSAS = new BlobServiceClient( + sasClient, + StorageClient.newPipeline(new AnonymousCredential()) ); let error; try { - await serviceURLWithSAS.getProperties(Aborter.none); + await serviceClientWithSAS.getProperties(); } catch (err) { error = err; } @@ -95,7 +94,7 @@ describe("Shared Access Signature (SAS) generation Node.js only", () => { tmr.setDate(tmr.getDate() + 1); // By default, credential is always the last element of pipeline factories - const factories = serviceURL.pipeline.factories; + const factories = blobServiceClient.pipeline.factories; const sharedKeyCredential = factories[factories.length - 1]; const sas = generateAccountSASQueryParameters( @@ -108,15 +107,15 @@ describe("Shared Access Signature (SAS) generation Node.js only", () => { sharedKeyCredential as SharedKeyCredential ).toString(); - const sasURL = `${serviceURL.url}?${sas}`; - const serviceURLWithSAS = new ServiceURL( - sasURL, - StorageURL.newPipeline(new AnonymousCredential()) + const sasClient = `${blobServiceClient.url}?${sas}`; + const serviceClientWithSAS = new BlobServiceClient( + sasClient, + StorageClient.newPipeline(new AnonymousCredential()) ); let error; try { - await serviceURLWithSAS.getProperties(Aborter.none); + await serviceClientWithSAS.getProperties(); } catch (err) { error = err; } @@ -129,7 +128,7 @@ describe("Shared Access Signature (SAS) generation Node.js only", () => { tmr.setDate(tmr.getDate() + 1); // By default, credential is always the last element of pipeline factories - const factories = serviceURL.pipeline.factories; + const factories = blobServiceClient.pipeline.factories; const sharedKeyCredential = factories[factories.length - 1]; const sas = generateAccountSASQueryParameters( @@ -145,15 +144,15 @@ describe("Shared Access Signature (SAS) generation Node.js only", () => { sharedKeyCredential as SharedKeyCredential ).toString(); - const sasURL = `${serviceURL.url}?${sas}`; - const serviceURLWithSAS = new ServiceURL( - sasURL, - StorageURL.newPipeline(new AnonymousCredential()) + const sasClient = `${blobServiceClient.url}?${sas}`; + const serviceClientWithSAS = new BlobServiceClient( + sasClient, + StorageClient.newPipeline(new AnonymousCredential()) ); let error; try { - await serviceURLWithSAS.getProperties(Aborter.none); + await serviceClientWithSAS.getProperties(); } catch (err) { error = err; } @@ -169,12 +168,12 @@ describe("Shared Access Signature (SAS) generation Node.js only", () => { tmr.setDate(tmr.getDate() + 1); // By default, credential is always the last element of pipeline factories - const factories = serviceURL.pipeline.factories; + const factories = blobServiceClient.pipeline.factories; const sharedKeyCredential = factories[factories.length - 1]; const containerName = getUniqueName("container"); - const containerURL = ContainerURL.fromServiceURL(serviceURL, containerName); - await containerURL.create(Aborter.none); + const containerClient = ContainerClient.fromBlobServiceClient(blobServiceClient, containerName); + await containerClient.create(); const containerSAS = generateBlobSASQueryParameters( { @@ -189,14 +188,14 @@ describe("Shared Access Signature (SAS) generation Node.js only", () => { sharedKeyCredential as SharedKeyCredential ); - const sasURL = `${containerURL.url}?${containerSAS}`; - const containerURLwithSAS = new ContainerURL( - sasURL, - StorageURL.newPipeline(new AnonymousCredential()) + const sasClient = `${containerClient.url}?${containerSAS}`; + const containerClientwithSAS = new ContainerClient( + sasClient, + StorageClient.newPipeline(new AnonymousCredential()) ); - await containerURLwithSAS.listBlobFlatSegment(Aborter.none); - await containerURL.delete(Aborter.none); + await containerClientwithSAS.listBlobFlatSegment(); + await containerClient.delete(); }); it("generateBlobSASQueryParameters should work for blob", async () => { @@ -207,16 +206,16 @@ describe("Shared Access Signature (SAS) generation Node.js only", () => { tmr.setDate(tmr.getDate() + 1); // By default, credential is always the last element of pipeline factories - const factories = serviceURL.pipeline.factories; + const factories = blobServiceClient.pipeline.factories; const sharedKeyCredential = factories[factories.length - 1]; const containerName = getUniqueName("container"); - const containerURL = ContainerURL.fromServiceURL(serviceURL, containerName); - await containerURL.create(Aborter.none); + const containerClient = ContainerClient.fromBlobServiceClient(blobServiceClient, containerName); + await containerClient.create(); const blobName = getUniqueName("blob"); - const blobURL = PageBlobURL.fromContainerURL(containerURL, blobName); - await blobURL.create(Aborter.none, 1024, { + const blobClient = PageBlobClient.fromContainerClient(containerClient, blobName); + await blobClient.create(1024, { blobHTTPHeaders: { blobContentType: "content-type-original" } @@ -241,20 +240,20 @@ describe("Shared Access Signature (SAS) generation Node.js only", () => { sharedKeyCredential as SharedKeyCredential ); - const sasURL = `${blobURL.url}?${blobSAS}`; - const blobURLwithSAS = new PageBlobURL( - sasURL, - StorageURL.newPipeline(new AnonymousCredential()) + const sasClient = `${blobClient.url}?${blobSAS}`; + const blobClientwithSAS = new PageBlobClient( + sasClient, + StorageClient.newPipeline(new AnonymousCredential()) ); - const properties = await blobURLwithSAS.getProperties(Aborter.none); + const properties = await blobClientwithSAS.getProperties(); assert.equal(properties.cacheControl, "cache-control-override"); assert.equal(properties.contentDisposition, "content-disposition-override"); assert.equal(properties.contentEncoding, "content-encoding-override"); assert.equal(properties.contentLanguage, "content-language-override"); assert.equal(properties.contentType, "content-type-override"); - await containerURL.delete(Aborter.none); + await containerClient.delete(); }); it("generateBlobSASQueryParameters should work for blob with special namings", async () => { @@ -265,18 +264,18 @@ describe("Shared Access Signature (SAS) generation Node.js only", () => { tmr.setDate(tmr.getDate() + 1); // By default, credential is always the last element of pipeline factories - const factories = serviceURL.pipeline.factories; + const factories = blobServiceClient.pipeline.factories; const sharedKeyCredential = factories[factories.length - 1]; const containerName = getUniqueName("container-with-dash"); - const containerURL = ContainerURL.fromServiceURL(serviceURL, containerName); - await containerURL.create(Aborter.none); + const containerClient = ContainerClient.fromBlobServiceClient(blobServiceClient, containerName); + await containerClient.create(); const blobName = getUniqueName( "////Upper/blob/empty /another 汉字 ру́сский язы́к ру́сский язы́к عربي/عربى にっぽんご/にほんご . special ~!@#$%^&*()_+`1234567890-={}|[]\\:\";'<>?,/'" ); - const blobURL = PageBlobURL.fromContainerURL(containerURL, blobName); - await blobURL.create(Aborter.none, 1024, { + const blobClient = PageBlobClient.fromContainerClient(containerClient, blobName); + await blobClient.create(1024, { blobHTTPHeaders: { blobContentType: "content-type-original" } @@ -302,20 +301,20 @@ describe("Shared Access Signature (SAS) generation Node.js only", () => { sharedKeyCredential as SharedKeyCredential ); - const sasURL = `${blobURL.url}?${blobSAS}`; - const blobURLwithSAS = new PageBlobURL( - sasURL, - StorageURL.newPipeline(new AnonymousCredential()) + const sasClient = `${blobClient.url}?${blobSAS}`; + const blobClientwithSAS = new PageBlobClient( + sasClient, + StorageClient.newPipeline(new AnonymousCredential()) ); - const properties = await blobURLwithSAS.getProperties(Aborter.none); + const properties = await blobClientwithSAS.getProperties(); assert.equal(properties.cacheControl, "cache-control-override"); assert.equal(properties.contentDisposition, "content-disposition-override"); assert.equal(properties.contentEncoding, "content-encoding-override"); assert.equal(properties.contentLanguage, "content-language-override"); assert.equal(properties.contentType, "content-type-override"); - await containerURL.delete(Aborter.none); + await containerClient.delete(); }); it("generateBlobSASQueryParameters should work for blob with access policy", async () => { @@ -326,19 +325,19 @@ describe("Shared Access Signature (SAS) generation Node.js only", () => { tmr.setDate(tmr.getDate() + 1); // By default, credential is always the last element of pipeline factories - const factories = serviceURL.pipeline.factories; + const factories = blobServiceClient.pipeline.factories; const sharedKeyCredential = factories[factories.length - 1]; const containerName = getUniqueName("container"); - const containerURL = ContainerURL.fromServiceURL(serviceURL, containerName); - await containerURL.create(Aborter.none); + const containerClient = ContainerClient.fromBlobServiceClient(blobServiceClient, containerName); + await containerClient.create(); const blobName = getUniqueName("blob"); - const blobURL = PageBlobURL.fromContainerURL(containerURL, blobName); - await blobURL.create(Aborter.none, 1024); + const blobClient = PageBlobClient.fromContainerClient(containerClient, blobName); + await blobClient.create(1024); const id = "unique-id"; - await containerURL.setAccessPolicy(Aborter.none, undefined, [ + await containerClient.setAccessPolicy(undefined, [ { accessPolicy: { expiry: tmr, @@ -357,13 +356,13 @@ describe("Shared Access Signature (SAS) generation Node.js only", () => { sharedKeyCredential as SharedKeyCredential ); - const sasURL = `${blobURL.url}?${blobSAS}`; - const blobURLwithSAS = new PageBlobURL( - sasURL, - StorageURL.newPipeline(new AnonymousCredential()) + const sasClient = `${blobClient.url}?${blobSAS}`; + const blobClientwithSAS = new PageBlobClient( + sasClient, + StorageClient.newPipeline(new AnonymousCredential()) ); - await blobURLwithSAS.getProperties(Aborter.none); - await containerURL.delete(Aborter.none); + await blobClientwithSAS.getProperties(); + await containerClient.delete(); }); }); diff --git a/sdk/storage/storage-blob/test/pageblobclient.spec.ts b/sdk/storage/storage-blob/test/pageblobclient.spec.ts new file mode 100644 index 000000000000..a29241d345d4 --- /dev/null +++ b/sdk/storage/storage-blob/test/pageblobclient.spec.ts @@ -0,0 +1,154 @@ +import * as assert from "assert"; +import { bodyToString, getBSU, getUniqueName } from "./utils"; + +import { BlobClient } from "../src/BlobClient"; +import { ContainerClient } from "../src/ContainerClient"; +import { PageBlobClient } from "../src/PageBlobClient"; +import * as dotenv from "dotenv"; +dotenv.config({ path: "../.env" }); + +describe("PageBlobClient", () => { + const blobServiceClient = getBSU(); + let containerName: string = getUniqueName("container"); + let containerClient = ContainerClient.fromBlobServiceClient(blobServiceClient, containerName); + let blobName: string = getUniqueName("blob"); + let blobClient = BlobClient.fromContainerClient(containerClient, blobName); + let pageBlobClient = PageBlobClient.fromBlobClient(blobClient); + + beforeEach(async () => { + containerName = getUniqueName("container"); + containerClient = ContainerClient.fromBlobServiceClient(blobServiceClient, containerName); + await containerClient.create(); + blobName = getUniqueName("blob"); + blobClient = BlobClient.fromContainerClient(containerClient, blobName); + pageBlobClient = PageBlobClient.fromBlobClient(blobClient); + }); + + afterEach(async () => { + await containerClient.delete(); + }); + + it("create with default parameters", async () => { + await pageBlobClient.create(512); + + const result = await blobClient.download(0); + assert.deepStrictEqual(await bodyToString(result, 512), "\u0000".repeat(512)); + }); + + it("create with all parameters set", async () => { + const options = { + blobHTTPHeaders: { + blobCacheControl: "blobCacheControl", + blobContentDisposition: "blobContentDisposition", + blobContentEncoding: "blobContentEncoding", + blobContentLanguage: "blobContentLanguage", + blobContentType: "blobContentType" + }, + metadata: { + key1: "vala", + key2: "valb" + } + }; + await pageBlobClient.create(512, options); + + const result = await blobClient.download(0); + assert.deepStrictEqual(await bodyToString(result, 512), "\u0000".repeat(512)); + + const properties = await blobClient.getProperties(); + assert.equal(properties.cacheControl, options.blobHTTPHeaders.blobCacheControl); + assert.equal(properties.contentDisposition, options.blobHTTPHeaders.blobContentDisposition); + assert.equal(properties.contentEncoding, options.blobHTTPHeaders.blobContentEncoding); + assert.equal(properties.contentLanguage, options.blobHTTPHeaders.blobContentLanguage); + assert.equal(properties.contentType, options.blobHTTPHeaders.blobContentType); + assert.equal(properties.metadata!.key1, options.metadata.key1); + assert.equal(properties.metadata!.key2, options.metadata.key2); + }); + + it("uploadPages", async () => { + await pageBlobClient.create(1024); + + const result = await blobClient.download(0); + assert.equal(await bodyToString(result, 1024), "\u0000".repeat(1024)); + + await pageBlobClient.uploadPages("a".repeat(512), 0, 512); + await pageBlobClient.uploadPages("b".repeat(512), 512, 512); + + const page1 = await pageBlobClient.download(0, 512); + const page2 = await pageBlobClient.download(512, 512); + + assert.equal(await bodyToString(page1, 512), "a".repeat(512)); + assert.equal(await bodyToString(page2, 512), "b".repeat(512)); + }); + + it("clearPages", async () => { + await pageBlobClient.create(1024); + let result = await blobClient.download(0); + assert.deepStrictEqual(await bodyToString(result, 1024), "\u0000".repeat(1024)); + + await pageBlobClient.uploadPages("a".repeat(1024), 0, 1024); + result = await pageBlobClient.download(0, 1024); + assert.deepStrictEqual(await bodyToString(result, 1024), "a".repeat(1024)); + + await pageBlobClient.clearPages(0, 512); + result = await pageBlobClient.download(0, 512); + assert.deepStrictEqual(await bodyToString(result, 512), "\u0000".repeat(512)); + }); + + it("getPageRanges", async () => { + await pageBlobClient.create(1024); + + const result = await blobClient.download(0); + assert.deepStrictEqual(await bodyToString(result, 1024), "\u0000".repeat(1024)); + + await pageBlobClient.uploadPages("a".repeat(512), 0, 512); + await pageBlobClient.uploadPages("b".repeat(512), 512, 512); + + const page1 = await pageBlobClient.getPageRanges(0, 512); + const page2 = await pageBlobClient.getPageRanges(512, 512); + + assert.equal(page1.pageRange![0].end, 511); + assert.equal(page2.pageRange![0].end, 1023); + }); + + it("getPageRangesDiff", async () => { + await pageBlobClient.create(1024); + + const result = await blobClient.download(0); + assert.deepStrictEqual(await bodyToString(result, 1024), "\u0000".repeat(1024)); + + await pageBlobClient.uploadPages("b".repeat(1024), 0, 1024); + + const snapshotResult = await pageBlobClient.createSnapshot(); + assert.ok(snapshotResult.snapshot); + + await pageBlobClient.uploadPages("a".repeat(512), 0, 512); + await pageBlobClient.clearPages(512, 512); + + const rangesDiff = await pageBlobClient.getPageRangesDiff( + 0, + 1024, + snapshotResult.snapshot! + ); + assert.equal(rangesDiff.pageRange![0].start, 0); + assert.equal(rangesDiff.pageRange![0].end, 511); + assert.equal(rangesDiff.clearRange![0].start, 512); + assert.equal(rangesDiff.clearRange![0].end, 1023); + }); + + it("updateSequenceNumber", async () => { + await pageBlobClient.create(1024); + let propertiesResponse = await pageBlobClient.getProperties(); + + await pageBlobClient.updateSequenceNumber("increment"); + propertiesResponse = await pageBlobClient.getProperties(); + assert.equal(propertiesResponse.blobSequenceNumber!, 1); + + await pageBlobClient.updateSequenceNumber("update", 10); + propertiesResponse = await pageBlobClient.getProperties(); + assert.equal(propertiesResponse.blobSequenceNumber!, 10); + + await pageBlobClient.updateSequenceNumber("max", 100); + propertiesResponse = await pageBlobClient.getProperties(); + assert.equal(propertiesResponse.blobSequenceNumber!, 100); + }); +}); diff --git a/sdk/storage/storage-blob/test/pagebloburl.test.ts b/sdk/storage/storage-blob/test/pagebloburl.test.ts deleted file mode 100644 index 3cef7acd3d3f..000000000000 --- a/sdk/storage/storage-blob/test/pagebloburl.test.ts +++ /dev/null @@ -1,189 +0,0 @@ -import * as assert from "assert"; -import { bodyToString, getBSU, getUniqueName } from "./utils"; - -import { Aborter } from "../src/Aborter"; -import { BlobURL } from "../src/BlobURL"; -import { ContainerURL } from "../src/ContainerURL"; -import { PageBlobURL } from "../src/PageBlobURL"; -import * as dotenv from "dotenv"; -dotenv.config({path:"../.env"}); - -describe("PageBlobURL", () => { - const serviceURL = getBSU(); - let containerName: string = getUniqueName("container"); - let containerURL = ContainerURL.fromServiceURL(serviceURL, containerName); - let blobName: string = getUniqueName("blob"); - let blobURL = BlobURL.fromContainerURL(containerURL, blobName); - let pageBlobURL = PageBlobURL.fromBlobURL(blobURL); - - beforeEach(async () => { - containerName = getUniqueName("container"); - containerURL = ContainerURL.fromServiceURL(serviceURL, containerName); - await containerURL.create(Aborter.none); - blobName = getUniqueName("blob"); - blobURL = BlobURL.fromContainerURL(containerURL, blobName); - pageBlobURL = PageBlobURL.fromBlobURL(blobURL); - }); - - afterEach(async () => { - await containerURL.delete(Aborter.none); - }); - - it("create with default parameters", async () => { - await pageBlobURL.create(Aborter.none, 512); - - const result = await blobURL.download(Aborter.none, 0); - assert.deepStrictEqual( - await bodyToString(result, 512), - "\u0000".repeat(512) - ); - }); - - it("create with all parameters set", async () => { - const options = { - blobHTTPHeaders: { - blobCacheControl: "blobCacheControl", - blobContentDisposition: "blobContentDisposition", - blobContentEncoding: "blobContentEncoding", - blobContentLanguage: "blobContentLanguage", - blobContentType: "blobContentType" - }, - metadata: { - key1: "vala", - key2: "valb" - } - }; - await pageBlobURL.create(Aborter.none, 512, options); - - const result = await blobURL.download(Aborter.none, 0); - assert.deepStrictEqual( - await bodyToString(result, 512), - "\u0000".repeat(512) - ); - - const properties = await blobURL.getProperties(Aborter.none); - assert.equal( - properties.cacheControl, - options.blobHTTPHeaders.blobCacheControl - ); - assert.equal( - properties.contentDisposition, - options.blobHTTPHeaders.blobContentDisposition - ); - assert.equal( - properties.contentEncoding, - options.blobHTTPHeaders.blobContentEncoding - ); - assert.equal( - properties.contentLanguage, - options.blobHTTPHeaders.blobContentLanguage - ); - assert.equal( - properties.contentType, - options.blobHTTPHeaders.blobContentType - ); - assert.equal(properties.metadata!.key1, options.metadata.key1); - assert.equal(properties.metadata!.key2, options.metadata.key2); - }); - - it("uploadPages", async () => { - await pageBlobURL.create(Aborter.none, 1024); - - const result = await blobURL.download(Aborter.none, 0); - assert.equal(await bodyToString(result, 1024), "\u0000".repeat(1024)); - - await pageBlobURL.uploadPages(Aborter.none, "a".repeat(512), 0, 512); - await pageBlobURL.uploadPages(Aborter.none, "b".repeat(512), 512, 512); - - const page1 = await pageBlobURL.download(Aborter.none, 0, 512); - const page2 = await pageBlobURL.download(Aborter.none, 512, 512); - - assert.equal(await bodyToString(page1, 512), "a".repeat(512)); - assert.equal(await bodyToString(page2, 512), "b".repeat(512)); - }); - - it("clearPages", async () => { - await pageBlobURL.create(Aborter.none, 1024); - let result = await blobURL.download(Aborter.none, 0); - assert.deepStrictEqual( - await bodyToString(result, 1024), - "\u0000".repeat(1024) - ); - - await pageBlobURL.uploadPages(Aborter.none, "a".repeat(1024), 0, 1024); - result = await pageBlobURL.download(Aborter.none, 0, 1024); - assert.deepStrictEqual(await bodyToString(result, 1024), "a".repeat(1024)); - - await pageBlobURL.clearPages(Aborter.none, 0, 512); - result = await pageBlobURL.download(Aborter.none, 0, 512); - assert.deepStrictEqual( - await bodyToString(result, 512), - "\u0000".repeat(512) - ); - }); - - it("getPageRanges", async () => { - await pageBlobURL.create(Aborter.none, 1024); - - const result = await blobURL.download(Aborter.none, 0); - assert.deepStrictEqual( - await bodyToString(result, 1024), - "\u0000".repeat(1024) - ); - - await pageBlobURL.uploadPages(Aborter.none, "a".repeat(512), 0, 512); - await pageBlobURL.uploadPages(Aborter.none, "b".repeat(512), 512, 512); - - const page1 = await pageBlobURL.getPageRanges(Aborter.none, 0, 512); - const page2 = await pageBlobURL.getPageRanges(Aborter.none, 512, 512); - - assert.equal(page1.pageRange![0].end, 511); - assert.equal(page2.pageRange![0].end, 1023); - }); - - it("getPageRangesDiff", async () => { - await pageBlobURL.create(Aborter.none, 1024); - - const result = await blobURL.download(Aborter.none, 0); - assert.deepStrictEqual( - await bodyToString(result, 1024), - "\u0000".repeat(1024) - ); - - await pageBlobURL.uploadPages(Aborter.none, "b".repeat(1024), 0, 1024); - - const snapshotResult = await pageBlobURL.createSnapshot(Aborter.none); - assert.ok(snapshotResult.snapshot); - - await pageBlobURL.uploadPages(Aborter.none, "a".repeat(512), 0, 512); - await pageBlobURL.clearPages(Aborter.none, 512, 512); - - const rangesDiff = await pageBlobURL.getPageRangesDiff( - Aborter.none, - 0, - 1024, - snapshotResult.snapshot! - ); - assert.equal(rangesDiff.pageRange![0].start, 0); - assert.equal(rangesDiff.pageRange![0].end, 511); - assert.equal(rangesDiff.clearRange![0].start, 512); - assert.equal(rangesDiff.clearRange![0].end, 1023); - }); - - it("updateSequenceNumber", async () => { - await pageBlobURL.create(Aborter.none, 1024); - let propertiesResponse = await pageBlobURL.getProperties(Aborter.none); - - await pageBlobURL.updateSequenceNumber(Aborter.none, "increment"); - propertiesResponse = await pageBlobURL.getProperties(Aborter.none); - assert.equal(propertiesResponse.blobSequenceNumber!, 1); - - await pageBlobURL.updateSequenceNumber(Aborter.none, "update", 10); - propertiesResponse = await pageBlobURL.getProperties(Aborter.none); - assert.equal(propertiesResponse.blobSequenceNumber!, 10); - - await pageBlobURL.updateSequenceNumber(Aborter.none, "max", 100); - propertiesResponse = await pageBlobURL.getProperties(Aborter.none); - assert.equal(propertiesResponse.blobSequenceNumber!, 100); - }); -}); diff --git a/sdk/storage/storage-blob/test/retrypolicy.test.ts b/sdk/storage/storage-blob/test/retrypolicy.spec.ts similarity index 58% rename from sdk/storage/storage-blob/test/retrypolicy.test.ts rename to sdk/storage/storage-blob/test/retrypolicy.spec.ts index 260304f43fcc..2b7caac28762 100644 --- a/sdk/storage/storage-blob/test/retrypolicy.test.ts +++ b/sdk/storage/storage-blob/test/retrypolicy.spec.ts @@ -1,28 +1,27 @@ import { URLBuilder } from "@azure/ms-rest-js"; import * as assert from "assert"; -import { RestError, StorageURL } from "../src"; -import { Aborter } from "../src/Aborter"; -import { ContainerURL } from "../src/ContainerURL"; +import { RestError, StorageClient } from "../src"; +import { ContainerClient } from "../src/ContainerClient"; import { Pipeline } from "../src/Pipeline"; import { getBSU, getUniqueName } from "./utils"; import { InjectorPolicyFactory } from "./utils/InjectorPolicyFactory"; import * as dotenv from "dotenv"; -dotenv.config({path:"../.env"}); +dotenv.config({ path: "../.env" }); describe("RetryPolicy", () => { - const serviceURL = getBSU(); + const blobServiceClient = getBSU(); let containerName: string = getUniqueName("container"); - let containerURL = ContainerURL.fromServiceURL(serviceURL, containerName); + let containerClient = ContainerClient.fromBlobServiceClient(blobServiceClient, containerName); beforeEach(async () => { containerName = getUniqueName("container"); - containerURL = ContainerURL.fromServiceURL(serviceURL, containerName); - await containerURL.create(Aborter.none); + containerClient = ContainerClient.fromBlobServiceClient(blobServiceClient, containerName); + await containerClient.create(); }); afterEach(async () => { - await containerURL.delete(Aborter.none); + await containerClient.delete(); }); it("Retry Policy should work when first request fails with 500", async () => { @@ -30,26 +29,22 @@ describe("RetryPolicy", () => { const injector = new InjectorPolicyFactory(() => { if (injectCounter === 0) { injectCounter++; - return new RestError( - "Server Internal Error", - "ServerInternalError", - 500 - ); + return new RestError("Server Internal Error", "ServerInternalError", 500); } }); - const factories = containerURL.pipeline.factories.slice(); // clone factories array + const factories = containerClient.pipeline.factories.slice(); // clone factories array factories.push(injector); const pipeline = new Pipeline(factories); - const injectContainerURL = containerURL.withPipeline(pipeline); + const injectContainerClient = containerClient.withPipeline(pipeline); const metadata = { key0: "val0", keya: "vala", keyb: "valb" }; - await injectContainerURL.setMetadata(Aborter.none, metadata); + await injectContainerClient.setMetadata(metadata); - const result = await containerURL.getProperties(Aborter.none); + const result = await containerClient.getProperties(); assert.deepEqual(result.metadata, metadata); }); @@ -59,15 +54,13 @@ describe("RetryPolicy", () => { }); const credential = - containerURL.pipeline.factories[ - containerURL.pipeline.factories.length - 1 - ]; - const factories = StorageURL.newPipeline(credential, { + containerClient.pipeline.factories[containerClient.pipeline.factories.length - 1]; + const factories = StorageClient.newPipeline(credential, { retryOptions: { maxTries: 3 } }).factories; factories.push(injector); const pipeline = new Pipeline(factories); - const injectContainerURL = containerURL.withPipeline(pipeline); + const injectContainerClient = containerClient.withPipeline(pipeline); let hasError = false; try { @@ -76,7 +69,7 @@ describe("RetryPolicy", () => { keya: "vala", keyb: "valb" }; - await injectContainerURL.setMetadata(Aborter.none, metadata); + await injectContainerClient.setMetadata(metadata); } catch (err) { hasError = true; } @@ -87,15 +80,11 @@ describe("RetryPolicy", () => { let injectCounter = 0; const injector = new InjectorPolicyFactory(() => { if (injectCounter++ < 1) { - return new RestError( - "Server Internal Error", - "ServerInternalError", - 500 - ); + return new RestError("Server Internal Error", "ServerInternalError", 500); } }); - const url = serviceURL.url; + const url = blobServiceClient.url; const urlParsed = URLBuilder.parse(url); const host = urlParsed.getHost()!; const hostParts = host.split("."); @@ -105,27 +94,22 @@ describe("RetryPolicy", () => { const secondaryHost = hostParts.join("."); const credential = - containerURL.pipeline.factories[ - containerURL.pipeline.factories.length - 1 - ]; - const factories = StorageURL.newPipeline(credential, { + containerClient.pipeline.factories[containerClient.pipeline.factories.length - 1]; + const factories = StorageClient.newPipeline(credential, { retryOptions: { maxTries: 2, secondaryHost } }).factories; factories.push(injector); const pipeline = new Pipeline(factories); - const injectContainerURL = containerURL.withPipeline(pipeline); + const injectContainerClient = containerClient.withPipeline(pipeline); let finalRequestURL = ""; try { - const response = await injectContainerURL.getProperties(Aborter.none); + const response = await injectContainerClient.getProperties(); finalRequestURL = response._response.request.url; } catch (err) { finalRequestURL = err.request ? err.request.url : ""; } - assert.deepStrictEqual( - URLBuilder.parse(finalRequestURL).getHost(), - secondaryHost - ); + assert.deepStrictEqual(URLBuilder.parse(finalRequestURL).getHost(), secondaryHost); }); }); diff --git a/sdk/storage/storage-blob/test/specialnaming.spec.ts b/sdk/storage/storage-blob/test/specialnaming.spec.ts new file mode 100644 index 000000000000..37ac940fa9ea --- /dev/null +++ b/sdk/storage/storage-blob/test/specialnaming.spec.ts @@ -0,0 +1,283 @@ +import { BlockBlobClient } from "../src/BlockBlobClient"; +import { ContainerClient } from "../src/ContainerClient"; +import { getBSU, getUniqueName } from "./utils/index"; +import * as assert from "assert"; +import { appendToURLPath } from "../src/utils/utils.common"; +import * as dotenv from "dotenv"; +dotenv.config({ path: "../.env" }); + +describe("Special Naming Tests", () => { + const blobServiceClient = getBSU(); + const containerName: string = getUniqueName("1container-with-dash"); + const containerClient = ContainerClient.fromBlobServiceClient(blobServiceClient, containerName); + + before(async () => { + await containerClient.create(); + }); + + after(async () => { + await containerClient.delete(); + }); + + it("Should work with special container and blob names with spaces", async () => { + const blobName: string = getUniqueName("blob empty"); + const blockBlobClient = BlockBlobClient.fromContainerClient(containerClient, blobName); + + await blockBlobClient.upload("A", 1); + const response = await containerClient.listBlobFlatSegment(undefined, { + prefix: blobName + }); + assert.notDeepEqual(response.segment.blobItems.length, 0); + }); + + it("Should work with special container and blob names with spaces in URL string", async () => { + const blobName: string = getUniqueName("blob empty"); + const blockBlobClient = new BlockBlobClient( + appendToURLPath(containerClient.url, blobName), + containerClient.pipeline + ); + + await blockBlobClient.upload("A", 1); + const response = await containerClient.listBlobFlatSegment(undefined, { + prefix: blobName + }); + assert.notDeepEqual(response.segment.blobItems.length, 0); + }); + + it("Should work with special container and blob names with /", async () => { + const blobName: string = getUniqueName("////blob/empty /another"); + const blockBlobClient = BlockBlobClient.fromContainerClient(containerClient, blobName); + + await blockBlobClient.upload("A", 1); + await blockBlobClient.getProperties(); + const response = await containerClient.listBlobFlatSegment(undefined, { + prefix: blobName + }); + assert.notDeepEqual(response.segment.blobItems.length, 0); + }); + + it("Should work with special container and blob names with / in URL string", async () => { + const blobName: string = getUniqueName("////blob/empty /another"); + const blockBlobClient = new BlockBlobClient( + appendToURLPath(containerClient.url, blobName), + containerClient.pipeline + ); + + await blockBlobClient.upload("A", 1); + await blockBlobClient.getProperties(); + const response = await containerClient.listBlobFlatSegment(undefined, { + prefix: blobName + }); + assert.notDeepEqual(response.segment.blobItems.length, 0); + }); + + it("Should work with special container and blob names uppercase", async () => { + const blobName: string = getUniqueName("////Upper/blob/empty /another"); + const blockBlobClient = BlockBlobClient.fromContainerClient(containerClient, blobName); + + await blockBlobClient.upload("A", 1); + await blockBlobClient.getProperties(); + const response = await containerClient.listBlobFlatSegment(undefined, { + prefix: blobName + }); + assert.notDeepEqual(response.segment.blobItems.length, 0); + }); + + it("Should work with special container and blob names uppercase in URL string", async () => { + const blobName: string = getUniqueName("////Upper/blob/empty /another"); + const blockBlobClient = new BlockBlobClient( + appendToURLPath(containerClient.url, blobName), + containerClient.pipeline + ); + + await blockBlobClient.upload("A", 1); + await blockBlobClient.getProperties(); + const response = await containerClient.listBlobFlatSegment(undefined, { + prefix: blobName + }); + assert.notDeepEqual(response.segment.blobItems.length, 0); + }); + + it("Should work with special blob names Chinese characters", async () => { + const blobName: string = getUniqueName("////Upper/blob/empty /another 汉字"); + const blockBlobClient = BlockBlobClient.fromContainerClient(containerClient, blobName); + + await blockBlobClient.upload("A", 1); + await blockBlobClient.getProperties(); + const response = await containerClient.listBlobFlatSegment(undefined, { + prefix: blobName + }); + assert.notDeepEqual(response.segment.blobItems.length, 0); + }); + + it("Should work with special blob names Chinese characters in URL string", async () => { + const blobName: string = getUniqueName("////Upper/blob/empty /another 汉字"); + const blockBlobClient = new BlockBlobClient( + appendToURLPath(containerClient.url, blobName), + containerClient.pipeline + ); + + await blockBlobClient.upload("A", 1); + await blockBlobClient.getProperties(); + const response = await containerClient.listBlobFlatSegment(undefined, { + prefix: blobName + }); + assert.notDeepEqual(response.segment.blobItems.length, 0); + }); + + it("Should work with special blob name characters", async () => { + const blobName: string = getUniqueName( + "汉字. special ~!@#$%^&*()_+`1234567890-={}|[]\\:\";'<>?,/'" + ); + const blockBlobClient = BlockBlobClient.fromContainerClient(containerClient, blobName); + + await blockBlobClient.upload("A", 1); + await blockBlobClient.getProperties(); + const response = await containerClient.listBlobFlatSegment(undefined, { + // NOTICE: Azure Storage Server will replace "\" with "/" in the blob names + prefix: blobName.replace(/\\/g, "/") + }); + assert.notDeepEqual(response.segment.blobItems.length, 0); + }); + + it("Should work with special blob name characters in URL string", async () => { + const blobName: string = getUniqueName( + "汉字. special ~!@#$%^&*()_+`1234567890-={}|[]\\:\";'<>?,/'" + ); + const blockBlobClient = new BlockBlobClient( + // There are 2 special cases for a URL string: + // Escape "%" when creating XxxClient object with URL strings + // Escape "?" otherwise string after "?" will be treated as URL parameters + appendToURLPath(containerClient.url, blobName.replace(/%/g, "%25").replace(/\?/g, "%3F")), + containerClient.pipeline + ); + + await blockBlobClient.upload("A", 1); + await blockBlobClient.getProperties(); + const response = await containerClient.listBlobFlatSegment(undefined, { + // NOTICE: Azure Storage Server will replace "\" with "/" in the blob names + prefix: blobName.replace(/\\/g, "/") + }); + assert.notDeepEqual(response.segment.blobItems.length, 0); + }); + + it("Should work with special blob name Russian URI encoded", async () => { + const blobName: string = getUniqueName("ру́сский язы́к"); + const blobNameEncoded: string = encodeURIComponent(blobName); + const blockBlobClient = BlockBlobClient.fromContainerClient(containerClient, blobNameEncoded); + + await blockBlobClient.upload("A", 1); + await blockBlobClient.getProperties(); + const response = await containerClient.listBlobFlatSegment(undefined, { + prefix: blobNameEncoded + }); + assert.notDeepEqual(response.segment.blobItems.length, 0); + }); + + it("Should work with special blob name Russian", async () => { + const blobName: string = getUniqueName("ру́сский язы́к"); + const blockBlobClient = BlockBlobClient.fromContainerClient(containerClient, blobName); + + await blockBlobClient.upload("A", 1); + await blockBlobClient.getProperties(); + const response = await containerClient.listBlobFlatSegment(undefined, { + prefix: blobName + }); + assert.notDeepEqual(response.segment.blobItems.length, 0); + }); + + it("Should work with special blob name Russian in URL string", async () => { + const blobName: string = getUniqueName("ру́сский язы́к"); + const blockBlobClient = new BlockBlobClient( + appendToURLPath(containerClient.url, blobName), + containerClient.pipeline + ); + + await blockBlobClient.upload("A", 1); + await blockBlobClient.getProperties(); + const response = await containerClient.listBlobFlatSegment(undefined, { + prefix: blobName + }); + assert.notDeepEqual(response.segment.blobItems.length, 0); + }); + + it("Should work with special blob name Arabic URI encoded", async () => { + const blobName: string = getUniqueName("عربي/عربى"); + const blobNameEncoded: string = encodeURIComponent(blobName); + const blockBlobClient = BlockBlobClient.fromContainerClient(containerClient, blobNameEncoded); + + await blockBlobClient.upload("A", 1); + await blockBlobClient.getProperties(); + const response = await containerClient.listBlobFlatSegment(undefined, { + prefix: blobNameEncoded + }); + assert.notDeepEqual(response.segment.blobItems.length, 0); + }); + + it("Should work with special blob name Arabic", async () => { + const blobName: string = getUniqueName("عربي/عربى"); + const blockBlobClient = BlockBlobClient.fromContainerClient(containerClient, blobName); + + await blockBlobClient.upload("A", 1); + await blockBlobClient.getProperties(); + const response = await containerClient.listBlobFlatSegment(undefined, { + prefix: blobName + }); + assert.notDeepEqual(response.segment.blobItems.length, 0); + }); + + it("Should work with special blob name Arabic in URL string", async () => { + const blobName: string = getUniqueName("عربي/عربى"); + const blockBlobClient = new BlockBlobClient( + appendToURLPath(containerClient.url, blobName), + containerClient.pipeline + ); + + await blockBlobClient.upload("A", 1); + await blockBlobClient.getProperties(); + const response = await containerClient.listBlobFlatSegment(undefined, { + prefix: blobName + }); + assert.notDeepEqual(response.segment.blobItems.length, 0); + }); + + it("Should work with special blob name Japanese URI encoded", async () => { + const blobName: string = getUniqueName("にっぽんご/にほんご"); + const blobNameEncoded: string = encodeURIComponent(blobName); + const blockBlobClient = BlockBlobClient.fromContainerClient(containerClient, blobNameEncoded); + + await blockBlobClient.upload("A", 1); + await blockBlobClient.getProperties(); + const response = await containerClient.listBlobFlatSegment(undefined, { + prefix: blobNameEncoded + }); + assert.notDeepEqual(response.segment.blobItems.length, 0); + }); + + it("Should work with special blob name Japanese", async () => { + const blobName: string = getUniqueName("にっぽんご/にほんご"); + const blockBlobClient = BlockBlobClient.fromContainerClient(containerClient, blobName); + + await blockBlobClient.upload("A", 1); + await blockBlobClient.getProperties(); + const response = await containerClient.listBlobFlatSegment(undefined, { + prefix: blobName + }); + assert.notDeepEqual(response.segment.blobItems.length, 0); + }); + + it("Should work with special blob name Japanese in URL string", async () => { + const blobName: string = getUniqueName("にっぽんご/にほんご"); + const blockBlobClient = new BlockBlobClient( + appendToURLPath(containerClient.url, blobName), + containerClient.pipeline + ); + + await blockBlobClient.upload("A", 1); + await blockBlobClient.getProperties(); + const response = await containerClient.listBlobFlatSegment(undefined, { + prefix: blobName + }); + assert.notDeepEqual(response.segment.blobItems.length, 0); + }); +}); diff --git a/sdk/storage/storage-blob/test/specialnaming.test.ts b/sdk/storage/storage-blob/test/specialnaming.test.ts deleted file mode 100644 index f44444a9a557..000000000000 --- a/sdk/storage/storage-blob/test/specialnaming.test.ts +++ /dev/null @@ -1,376 +0,0 @@ -import { Aborter } from "../src/Aborter"; -import { BlockBlobURL } from "../src/BlockBlobURL"; -import { ContainerURL } from "../src/ContainerURL"; -import { getBSU, getUniqueName } from "./utils/index"; -import * as assert from "assert"; -import { appendToURLPath } from "../src/utils/utils.common"; -import * as dotenv from "dotenv"; -dotenv.config({path:"../.env"}); - -describe("Special Naming Tests", () => { - const serviceURL = getBSU(); - const containerName: string = getUniqueName("1container-with-dash"); - const containerURL = ContainerURL.fromServiceURL(serviceURL, containerName); - - before(async () => { - await containerURL.create(Aborter.none); - }); - - after(async () => { - await containerURL.delete(Aborter.none); - }); - - it("Should work with special container and blob names with spaces", async () => { - const blobName: string = getUniqueName("blob empty"); - const blockBlobURL = BlockBlobURL.fromContainerURL(containerURL, blobName); - - await blockBlobURL.upload(Aborter.none, "A", 1); - const response = await containerURL.listBlobFlatSegment( - Aborter.none, - undefined, - { - prefix: blobName - } - ); - assert.notDeepEqual(response.segment.blobItems.length, 0); - }); - - it("Should work with special container and blob names with spaces in URL string", async () => { - const blobName: string = getUniqueName("blob empty"); - const blockBlobURL = new BlockBlobURL( - appendToURLPath(containerURL.url, blobName), - containerURL.pipeline - ); - - await blockBlobURL.upload(Aborter.none, "A", 1); - const response = await containerURL.listBlobFlatSegment( - Aborter.none, - undefined, - { - prefix: blobName - } - ); - assert.notDeepEqual(response.segment.blobItems.length, 0); - }); - - it("Should work with special container and blob names with /", async () => { - const blobName: string = getUniqueName("////blob/empty /another"); - const blockBlobURL = BlockBlobURL.fromContainerURL(containerURL, blobName); - - await blockBlobURL.upload(Aborter.none, "A", 1); - await blockBlobURL.getProperties(Aborter.none); - const response = await containerURL.listBlobFlatSegment( - Aborter.none, - undefined, - { - prefix: blobName - } - ); - assert.notDeepEqual(response.segment.blobItems.length, 0); - }); - - it("Should work with special container and blob names with / in URL string", async () => { - const blobName: string = getUniqueName("////blob/empty /another"); - const blockBlobURL = new BlockBlobURL( - appendToURLPath(containerURL.url, blobName), - containerURL.pipeline - ); - - await blockBlobURL.upload(Aborter.none, "A", 1); - await blockBlobURL.getProperties(Aborter.none); - const response = await containerURL.listBlobFlatSegment( - Aborter.none, - undefined, - { - prefix: blobName - } - ); - assert.notDeepEqual(response.segment.blobItems.length, 0); - }); - - it("Should work with special container and blob names uppercase", async () => { - const blobName: string = getUniqueName("////Upper/blob/empty /another"); - const blockBlobURL = BlockBlobURL.fromContainerURL(containerURL, blobName); - - await blockBlobURL.upload(Aborter.none, "A", 1); - await blockBlobURL.getProperties(Aborter.none); - const response = await containerURL.listBlobFlatSegment( - Aborter.none, - undefined, - { - prefix: blobName - } - ); - assert.notDeepEqual(response.segment.blobItems.length, 0); - }); - - it("Should work with special container and blob names uppercase in URL string", async () => { - const blobName: string = getUniqueName("////Upper/blob/empty /another"); - const blockBlobURL = new BlockBlobURL( - appendToURLPath(containerURL.url, blobName), - containerURL.pipeline - ); - - await blockBlobURL.upload(Aborter.none, "A", 1); - await blockBlobURL.getProperties(Aborter.none); - const response = await containerURL.listBlobFlatSegment( - Aborter.none, - undefined, - { - prefix: blobName - } - ); - assert.notDeepEqual(response.segment.blobItems.length, 0); - }); - - it("Should work with special blob names Chinese characters", async () => { - const blobName: string = getUniqueName( - "////Upper/blob/empty /another 汉字" - ); - const blockBlobURL = BlockBlobURL.fromContainerURL(containerURL, blobName); - - await blockBlobURL.upload(Aborter.none, "A", 1); - await blockBlobURL.getProperties(Aborter.none); - const response = await containerURL.listBlobFlatSegment( - Aborter.none, - undefined, - { - prefix: blobName - } - ); - assert.notDeepEqual(response.segment.blobItems.length, 0); - }); - - it("Should work with special blob names Chinese characters in URL string", async () => { - const blobName: string = getUniqueName( - "////Upper/blob/empty /another 汉字" - ); - const blockBlobURL = new BlockBlobURL( - appendToURLPath(containerURL.url, blobName), - containerURL.pipeline - ); - - await blockBlobURL.upload(Aborter.none, "A", 1); - await blockBlobURL.getProperties(Aborter.none); - const response = await containerURL.listBlobFlatSegment( - Aborter.none, - undefined, - { - prefix: blobName - } - ); - assert.notDeepEqual(response.segment.blobItems.length, 0); - }); - - it("Should work with special blob name characters", async () => { - const blobName: string = getUniqueName( - "汉字. special ~!@#$%^&*()_+`1234567890-={}|[]\\:\";'<>?,/'" - ); - const blockBlobURL = BlockBlobURL.fromContainerURL(containerURL, blobName); - - await blockBlobURL.upload(Aborter.none, "A", 1); - await blockBlobURL.getProperties(Aborter.none); - const response = await containerURL.listBlobFlatSegment( - Aborter.none, - undefined, - { - // NOTICE: Azure Storage Server will replace "\" with "/" in the blob names - prefix: blobName.replace(/\\/g, "/") - } - ); - assert.notDeepEqual(response.segment.blobItems.length, 0); - }); - - it("Should work with special blob name characters in URL string", async () => { - const blobName: string = getUniqueName( - "汉字. special ~!@#$%^&*()_+`1234567890-={}|[]\\:\";'<>?,/'" - ); - const blockBlobURL = new BlockBlobURL( - // There are 2 special cases for a URL string: - // Escape "%" when creating XXXURL object with URL strings - // Escape "?" otherwise string after "?" will be treated as URL parameters - appendToURLPath( - containerURL.url, - blobName.replace(/%/g, "%25").replace(/\?/g, "%3F") - ), - containerURL.pipeline - ); - - await blockBlobURL.upload(Aborter.none, "A", 1); - await blockBlobURL.getProperties(Aborter.none); - const response = await containerURL.listBlobFlatSegment( - Aborter.none, - undefined, - { - // NOTICE: Azure Storage Server will replace "\" with "/" in the blob names - prefix: blobName.replace(/\\/g, "/") - } - ); - assert.notDeepEqual(response.segment.blobItems.length, 0); - }); - - it("Should work with special blob name Russian URI encoded", async () => { - const blobName: string = getUniqueName("ру́сский язы́к"); - const blobNameEncoded: string = encodeURIComponent(blobName); - const blockBlobURL = BlockBlobURL.fromContainerURL( - containerURL, - blobNameEncoded - ); - - await blockBlobURL.upload(Aborter.none, "A", 1); - await blockBlobURL.getProperties(Aborter.none); - const response = await containerURL.listBlobFlatSegment( - Aborter.none, - undefined, - { - prefix: blobNameEncoded - } - ); - assert.notDeepEqual(response.segment.blobItems.length, 0); - }); - - it("Should work with special blob name Russian", async () => { - const blobName: string = getUniqueName("ру́сский язы́к"); - const blockBlobURL = BlockBlobURL.fromContainerURL(containerURL, blobName); - - await blockBlobURL.upload(Aborter.none, "A", 1); - await blockBlobURL.getProperties(Aborter.none); - const response = await containerURL.listBlobFlatSegment( - Aborter.none, - undefined, - { - prefix: blobName - } - ); - assert.notDeepEqual(response.segment.blobItems.length, 0); - }); - - it("Should work with special blob name Russian in URL string", async () => { - const blobName: string = getUniqueName("ру́сский язы́к"); - const blockBlobURL = new BlockBlobURL( - appendToURLPath(containerURL.url, blobName), - containerURL.pipeline - ); - - await blockBlobURL.upload(Aborter.none, "A", 1); - await blockBlobURL.getProperties(Aborter.none); - const response = await containerURL.listBlobFlatSegment( - Aborter.none, - undefined, - { - prefix: blobName - } - ); - assert.notDeepEqual(response.segment.blobItems.length, 0); - }); - - it("Should work with special blob name Arabic URI encoded", async () => { - const blobName: string = getUniqueName("عربي/عربى"); - const blobNameEncoded: string = encodeURIComponent(blobName); - const blockBlobURL = BlockBlobURL.fromContainerURL( - containerURL, - blobNameEncoded - ); - - await blockBlobURL.upload(Aborter.none, "A", 1); - await blockBlobURL.getProperties(Aborter.none); - const response = await containerURL.listBlobFlatSegment( - Aborter.none, - undefined, - { - prefix: blobNameEncoded - } - ); - assert.notDeepEqual(response.segment.blobItems.length, 0); - }); - - it("Should work with special blob name Arabic", async () => { - const blobName: string = getUniqueName("عربي/عربى"); - const blockBlobURL = BlockBlobURL.fromContainerURL(containerURL, blobName); - - await blockBlobURL.upload(Aborter.none, "A", 1); - await blockBlobURL.getProperties(Aborter.none); - const response = await containerURL.listBlobFlatSegment( - Aborter.none, - undefined, - { - prefix: blobName - } - ); - assert.notDeepEqual(response.segment.blobItems.length, 0); - }); - - it("Should work with special blob name Arabic in URL string", async () => { - const blobName: string = getUniqueName("عربي/عربى"); - const blockBlobURL = new BlockBlobURL( - appendToURLPath(containerURL.url, blobName), - containerURL.pipeline - ); - - await blockBlobURL.upload(Aborter.none, "A", 1); - await blockBlobURL.getProperties(Aborter.none); - const response = await containerURL.listBlobFlatSegment( - Aborter.none, - undefined, - { - prefix: blobName - } - ); - assert.notDeepEqual(response.segment.blobItems.length, 0); - }); - - it("Should work with special blob name Japanese URI encoded", async () => { - const blobName: string = getUniqueName("にっぽんご/にほんご"); - const blobNameEncoded: string = encodeURIComponent(blobName); - const blockBlobURL = BlockBlobURL.fromContainerURL( - containerURL, - blobNameEncoded - ); - - await blockBlobURL.upload(Aborter.none, "A", 1); - await blockBlobURL.getProperties(Aborter.none); - const response = await containerURL.listBlobFlatSegment( - Aborter.none, - undefined, - { - prefix: blobNameEncoded - } - ); - assert.notDeepEqual(response.segment.blobItems.length, 0); - }); - - it("Should work with special blob name Japanese", async () => { - const blobName: string = getUniqueName("にっぽんご/にほんご"); - const blockBlobURL = BlockBlobURL.fromContainerURL(containerURL, blobName); - - await blockBlobURL.upload(Aborter.none, "A", 1); - await blockBlobURL.getProperties(Aborter.none); - const response = await containerURL.listBlobFlatSegment( - Aborter.none, - undefined, - { - prefix: blobName - } - ); - assert.notDeepEqual(response.segment.blobItems.length, 0); - }); - - it("Should work with special blob name Japanese in URL string", async () => { - const blobName: string = getUniqueName("にっぽんご/にほんご"); - const blockBlobURL = new BlockBlobURL( - appendToURLPath(containerURL.url, blobName), - containerURL.pipeline - ); - - await blockBlobURL.upload(Aborter.none, "A", 1); - await blockBlobURL.getProperties(Aborter.none); - const response = await containerURL.listBlobFlatSegment( - Aborter.none, - undefined, - { - prefix: blobName - } - ); - assert.notDeepEqual(response.segment.blobItems.length, 0); - }); -}); diff --git a/sdk/storage/storage-blob/test/utils/InjectorPolicy.ts b/sdk/storage/storage-blob/test/utils/InjectorPolicy.ts index 87dcc133dcf9..735225b3334c 100644 --- a/sdk/storage/storage-blob/test/utils/InjectorPolicy.ts +++ b/sdk/storage/storage-blob/test/utils/InjectorPolicy.ts @@ -7,7 +7,7 @@ import { RestError } from "../../src"; -export interface INextInjectErrorHolder { +export interface NextInjectErrorHolder { nextInjectError?: RestError; } @@ -27,11 +27,7 @@ export class InjectorPolicy extends BaseRequestPolicy { * @param {RequestPolicyOptions} options * @memberof InjectorPolicy */ - public constructor( - nextPolicy: RequestPolicy, - options: RequestPolicyOptions, - injector: Injector - ) { + public constructor(nextPolicy: RequestPolicy, options: RequestPolicyOptions, injector: Injector) { super(nextPolicy, options); this.injector = injector; } @@ -43,9 +39,7 @@ export class InjectorPolicy extends BaseRequestPolicy { * @returns {Promise} * @memberof InjectorPolicy */ - public async sendRequest( - request: WebResource - ): Promise { + public async sendRequest(request: WebResource): Promise { const error = this.injector(); if (error) { throw error; diff --git a/sdk/storage/storage-blob/test/utils/InjectorPolicyFactory.ts b/sdk/storage/storage-blob/test/utils/InjectorPolicyFactory.ts index c1f478b9b226..ebd5412e76d5 100644 --- a/sdk/storage/storage-blob/test/utils/InjectorPolicyFactory.ts +++ b/sdk/storage/storage-blob/test/utils/InjectorPolicyFactory.ts @@ -1,8 +1,4 @@ -import { - RequestPolicy, - RequestPolicyFactory, - RequestPolicyOptions -} from "../../src"; +import { RequestPolicy, RequestPolicyFactory, RequestPolicyOptions } from "../../src"; import { InjectorPolicy, Injector } from "./InjectorPolicy"; /** @@ -19,10 +15,7 @@ export class InjectorPolicyFactory implements RequestPolicyFactory { this.injector = injector; } - public create( - nextPolicy: RequestPolicy, - options: RequestPolicyOptions - ): InjectorPolicy { + public create(nextPolicy: RequestPolicy, options: RequestPolicyOptions): InjectorPolicy { return new InjectorPolicy(nextPolicy, options, this.injector); } } diff --git a/sdk/storage/storage-blob/test/utils/index.browser.ts b/sdk/storage/storage-blob/test/utils/index.browser.ts index 00ee2b84d2c2..b5415e3d5e61 100644 --- a/sdk/storage/storage-blob/test/utils/index.browser.ts +++ b/sdk/storage/storage-blob/test/utils/index.browser.ts @@ -1,13 +1,10 @@ import { AnonymousCredential } from "../../src/credentials/AnonymousCredential"; -import { ServiceURL } from "../../src/ServiceURL"; -import { StorageURL } from "../../src/StorageURL"; +import { BlobServiceClient } from "../../src/BlobServiceClient"; +import { StorageClient } from "../../src/StorageClient"; export * from "./testutils.common"; -export function getGenericBSU( - accountType: string, - accountNameSuffix: string = "" -): ServiceURL { +export function getGenericBSU(accountType: string, accountNameSuffix: string = ""): BlobServiceClient { const accountNameEnvVar = `${accountType}ACCOUNT_NAME`; const accountSASEnvVar = `${accountType}ACCOUNT_SAS`; @@ -27,19 +24,19 @@ export function getGenericBSU( } const credentials = new AnonymousCredential(); - const pipeline = StorageURL.newPipeline(credentials, { + const pipeline = StorageClient.newPipeline(credentials, { // Enable logger when debugging // logger: new ConsoleHttpPipelineLogger(HttpPipelineLogLevel.INFO) }); const blobPrimaryURL = `https://${accountName}${accountNameSuffix}.blob.core.windows.net${accountSAS}`; - return new ServiceURL(blobPrimaryURL, pipeline); + return new BlobServiceClient(blobPrimaryURL, pipeline); } -export function getBSU(): ServiceURL { +export function getBSU(): BlobServiceClient { return getGenericBSU(""); } -export function getAlternateBSU(): ServiceURL { +export function getAlternateBSU(): BlobServiceClient { return getGenericBSU("SECONDARY_", "-secondary"); } @@ -84,10 +81,7 @@ export async function blobToArrayBuffer(blob: Blob): Promise { }); } -export function arrayBufferEqual( - buf1: ArrayBuffer, - buf2: ArrayBuffer -): boolean { +export function arrayBufferEqual(buf1: ArrayBuffer, buf2: ArrayBuffer): boolean { if (buf1.byteLength !== buf2.byteLength) { return false; } diff --git a/sdk/storage/storage-blob/test/utils/index.ts b/sdk/storage/storage-blob/test/utils/index.ts index 10de427fdd45..3c09d7717399 100644 --- a/sdk/storage/storage-blob/test/utils/index.ts +++ b/sdk/storage/storage-blob/test/utils/index.ts @@ -3,16 +3,15 @@ import * as fs from "fs"; import * as path from "path"; import { SharedKeyCredential } from "../../src/credentials/SharedKeyCredential"; -import { ServiceURL } from "../../src/ServiceURL"; -import { StorageURL } from "../../src/StorageURL"; +import { BlobServiceClient } from "../../src/BlobServiceClient"; +import { StorageClient } from "../../src/StorageClient"; import { getUniqueName } from "./testutils.common"; +import * as dotenv from "dotenv"; +dotenv.config({ path: "../.env" }); export * from "./testutils.common"; -export function getGenericBSU( - accountType: string, - accountNameSuffix: string = "" -): ServiceURL { +export function getGenericBSU(accountType: string, accountNameSuffix: string = ""): BlobServiceClient { const accountNameEnvVar = `${accountType}ACCOUNT_NAME`; const accountKeyEnvVar = `${accountType}ACCOUNT_KEY`; @@ -23,25 +22,23 @@ export function getGenericBSU( accountKey = process.env[accountKeyEnvVar]; if (!accountName || !accountKey || accountName === "" || accountKey === "") { - throw new Error( - `${accountNameEnvVar} and/or ${accountKeyEnvVar} environment variables not specified.` - ); + throw new Error(`${accountNameEnvVar} and/or ${accountKeyEnvVar} environment variables not specified.`); } const credentials = new SharedKeyCredential(accountName, accountKey); - const pipeline = StorageURL.newPipeline(credentials, { + const pipeline = StorageClient.newPipeline(credentials, { // Enable logger when debugging // logger: new ConsoleHttpPipelineLogger(HttpPipelineLogLevel.INFO) }); const blobPrimaryURL = `https://${accountName}${accountNameSuffix}.blob.core.windows.net/`; - return new ServiceURL(blobPrimaryURL, pipeline); + return new BlobServiceClient(blobPrimaryURL, pipeline); } -export function getBSU(): ServiceURL { +export function getBSU(): BlobServiceClient { return getGenericBSU(""); } -export function getAlternateBSU(): ServiceURL { +export function getAlternateBSU(): BlobServiceClient { return getGenericBSU("SECONDARY_", "-secondary"); } @@ -72,11 +69,7 @@ export async function bodyToString( }); } -export async function createRandomLocalFile( - folder: string, - blockNumber: number, - blockSize: number -): Promise { +export async function createRandomLocalFile(folder: string, blockNumber: number, blockSize: number): Promise { return new Promise((resolve, reject) => { const destFile = path.join(folder, getUniqueName("tempfile.")); const ws = fs.createWriteStream(destFile); @@ -112,10 +105,7 @@ export async function createRandomLocalFile( // Returns a Promise which is completed after the file handle is closed. // If Promise is rejected, the reason will be set to the first error raised by either the // ReadableStream or the fs.WriteStream. -export async function readStreamToLocalFile( - rs: NodeJS.ReadableStream, - file: string -) { +export async function readStreamToLocalFile(rs: NodeJS.ReadableStream, file: string) { return new Promise((resolve, reject) => { const ws = fs.createWriteStream(file); @@ -131,10 +121,10 @@ export async function readStreamToLocalFile( ws.on("error", () => console.log("ws.error")); ws.on("finish", () => console.log("ws.finish")); ws.on("pipe", () => console.log("ws.pipe")); - ws.on("unpipe", () => console.log("ws.unpipe")); + ws.on("unpipe", () => console.log("ws.unpipe")); } - let error : Error; + let error: Error; rs.on("error", (err: Error) => { // First error wins diff --git a/sdk/storage/storage-blob/test/utils/testutils.common.ts b/sdk/storage/storage-blob/test/utils/testutils.common.ts index 4ec999c08633..de4d969696c9 100644 --- a/sdk/storage/storage-blob/test/utils/testutils.common.ts +++ b/sdk/storage/storage-blob/test/utils/testutils.common.ts @@ -14,7 +14,7 @@ export function getUniqueName(prefix: string): string { } export async function sleep(time: number): Promise { - return new Promise(resolve => { + return new Promise((resolve) => { setTimeout(resolve, time); }); } @@ -24,17 +24,13 @@ export function base64encode(content: string): string { } export function base64decode(encodedString: string): string { - return isBrowser() - ? atob(encodedString) - : Buffer.from(encodedString, "base64").toString(); + return isBrowser() ? atob(encodedString) : Buffer.from(encodedString, "base64").toString(); } export class ConsoleHttpPipelineLogger implements IHttpPipelineLogger { constructor(public minimumLogLevel: HttpPipelineLogLevel) {} public log(logLevel: HttpPipelineLogLevel, message: string): void { - const logMessage = `${new Date().toISOString()} ${ - HttpPipelineLogLevel[logLevel] - }: ${message}`; + const logMessage = `${new Date().toISOString()} ${HttpPipelineLogLevel[logLevel]}: ${message}`; switch (logLevel) { case HttpPipelineLogLevel.ERROR: // tslint:disable-next-line:no-console @@ -53,7 +49,7 @@ export class ConsoleHttpPipelineLogger implements IHttpPipelineLogger { } export async function wait(time: number): Promise { - return new Promise(resolve => { + return new Promise((resolve) => { setTimeout(resolve, time); }); } diff --git a/sdk/storage/storage-blob/tsconfig.json b/sdk/storage/storage-blob/tsconfig.json index 61885eb2e18c..eace00058c3d 100644 --- a/sdk/storage/storage-blob/tsconfig.json +++ b/sdk/storage/storage-blob/tsconfig.json @@ -20,6 +20,6 @@ "esModuleInterop": true }, "compileOnSave": true, - "exclude": ["node_modules", "./samples/*"], + "exclude": ["node_modules", "./samples/**"], "include": ["./src/**/*.ts", "./test/**/*.ts"] -} \ No newline at end of file +} diff --git a/sdk/storage/storage-blob/tslint.json b/sdk/storage/storage-blob/tslint.json index ae2eb09109a7..498d029bd134 100644 --- a/sdk/storage/storage-blob/tslint.json +++ b/sdk/storage/storage-blob/tslint.json @@ -4,7 +4,8 @@ "jsRules": {}, "rules": { "trailing-comma": false, - "arrow-parens": false + "arrow-parens": false, + "interface-name": [true, "never-prefix"] }, "rulesDirectory": [], "linterOptions": { diff --git a/sdk/storage/storage-file/.npmignore b/sdk/storage/storage-file/.npmignore index af749a5e8741..b84ea0bddf17 100644 --- a/sdk/storage/storage-file/.npmignore +++ b/sdk/storage/storage-file/.npmignore @@ -1,6 +1,6 @@ # browser # -browser/azure-storage.file.js -browser/azure-storage.file.js.map +browser/azure-storage-file.js +browser/azure-storage-file.js.map # dist-test # dist-test/ diff --git a/sdk/storage/storage-file/.nycrc b/sdk/storage/storage-file/.nycrc index 695f5ccbc1a0..f950dcc192c9 100644 --- a/sdk/storage/storage-file/.nycrc +++ b/sdk/storage/storage-file/.nycrc @@ -1,6 +1,6 @@ { "include": [ - "src/**/*.ts" + "dist-test/index.node.js" ], "exclude": [ "**/*.d.ts", @@ -24,6 +24,7 @@ "html", "cobertura" ], + "exclude-after-remap":false, "sourceMap": true, "instrument": true, "all": true diff --git a/sdk/storage/storage-file/.prettierignore b/sdk/storage/storage-file/.prettierignore new file mode 100644 index 000000000000..3fd7f651ed5f --- /dev/null +++ b/sdk/storage/storage-file/.prettierignore @@ -0,0 +1,2 @@ +src/generated/**/*.ts +package-lock.json diff --git a/sdk/storage/storage-file/.prettierrc.json b/sdk/storage/storage-file/.prettierrc.json deleted file mode 100644 index 1ca87ab7d8af..000000000000 --- a/sdk/storage/storage-file/.prettierrc.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "singleQuote": false -} diff --git a/sdk/storage/storage-file/README.md b/sdk/storage/storage-file/README.md index f073ffb9afd1..00ca072a07f2 100644 --- a/sdk/storage/storage-file/README.md +++ b/sdk/storage/storage-file/README.md @@ -1,7 +1,7 @@ # Azure Storage SDK V10 for JavaScript - File -* [![npm version](https://badge.fury.io/js/%40azure%2Fstorage-file.svg)](https://badge.fury.io/js/%40azure%2Fstorage-file) -* [API Reference documentation](https://docs.microsoft.com/en-us/javascript/api/%40azure/storage-file/index?view=azure-node-preview) +- [![npm version](https://badge.fury.io/js/%40azure%2Fstorage-file.svg)](https://badge.fury.io/js/%40azure%2Fstorage-file) +- [API Reference documentation](https://docs.microsoft.com/en-us/javascript/api/%40azure/storage-file/index?view=azure-node-preview) ## Introduction @@ -11,15 +11,15 @@ Please note that this version of the SDK is a compete overhaul of the current [A ### Features -* File Storage - * Get/Set File Service Properties - * Create/List/Delete File Shares - * Create/List/Delete File Directories - * Create/Read/List/Update/Delete Files -* Features new - * Asynchronous I/O for all operations using the async methods - * HttpPipeline which enables a high degree of per-request configurability - * 1-to-1 correlation with the Storage REST API for clarity and simplicity +- File Storage + - Get/Set File Service Properties + - Create/List/Delete File Shares + - Create/List/Delete File Directories + - Create/Read/List/Update/Delete Files +- Features new + - Asynchronous I/O for all operations using the async methods + - HttpPipeline which enables a high degree of per-request configurability + - 1-to-1 correlation with the Storage REST API for clarity and simplicity ### Compatibility @@ -31,13 +31,13 @@ You need polyfills to make this library work with IE11. The easiest way is to us Or you can load separate polyfills for missed ES feature(s). This library depends on following ES features which need external polyfills loaded. -* `Promise` -* `String.prototype.startsWith` -* `String.prototype.endsWith` -* `String.prototype.repeat` -* `String.prototype.includes` -* `Array.prototype.includes` -* `Object.keys` (Override IE11's `Object.keys` with ES6 polyfill forcely to enable [ES6 behavior](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/keys#Notes)) +- `Promise` +- `String.prototype.startsWith` +- `String.prototype.endsWith` +- `String.prototype.repeat` +- `String.prototype.includes` +- `Array.prototype.includes` +- `Object.keys` (Override IE11's `Object.keys` with ES6 polyfill forcely to enable [ES6 behavior](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/keys#Notes)) #### Differences between Node.js and browsers @@ -45,20 +45,20 @@ There are differences between Node.js and browsers runtime. When getting start w ##### Following features, interfaces, classes or functions are only available in Node.js -* Shared Key Authorization based on account name and account key - * `SharedKeyCredential` -* Shared Access Signature(SAS) generation - * `generateAccountSASQueryParameters()` - * `generateFileSASQueryParameters()` -* Parallel uploading and downloading - * `uploadFileToAzureFile()` - * `uploadStreamToAzureFile()` - * `downloadAzureFileToBuffer()` +- Shared Key Authorization based on account name and account key + - `SharedKeyCredential` +- Shared Access Signature(SAS) generation + - `generateAccountSASQueryParameters()` + - `generateFileSASQueryParameters()` +- Parallel uploading and downloading + - `uploadFileToAzureFile()` + - `uploadStreamToAzureFile()` + - `downloadAzureFileToBuffer()` ##### Following features, interfaces, classes or functions are only available in browsers -* Parallel uploading and downloading - * `uploadBrowserDataToAzureFile()` +- Parallel uploading and downloading + - `uploadBrowserDataToAzureFile()` ## Getting Started @@ -87,18 +87,18 @@ const Azure = require("@azure/storage-file"); To use the SDK with JS bundle in the browsers, simply add a script tag to your HTML pages pointing to the downloaded JS bundle file(s): ```html - + ``` The JS bundled file is compatible with [UMD](https://github.com/umdjs/umd) standard, if no module system found, following global variable(s) will be exported: -* `azfile` +- `azfile` #### Download Download latest released JS bundles from links in the [GitHub release page](https://github.com/Azure/azure-storage-js/releases). Or from following links directly: -* File [https://aka.ms/downloadazurestoragejsfile](https://aka.ms/downloadazurestoragejsfile) +- File [https://aka.ms/downloadazurestoragejsfile](https://aka.ms/downloadazurestoragejsfile) ### CORS @@ -106,30 +106,30 @@ You need to set up [Cross-Origin Resource Sharing (CORS)](https://docs.microsoft For example, you can create following CORS settings for debugging. But please customize the settings carefully according to your requirements in production environment. -* Allowed origins: \* -* Allowed verbs: DELETE,GET,HEAD,MERGE,POST,OPTIONS,PUT -* Allowed headers: \* -* Exposed headers: \* -* Maximum age (seconds): 86400 +- Allowed origins: \* +- Allowed verbs: DELETE,GET,HEAD,MERGE,POST,OPTIONS,PUT +- Allowed headers: \* +- Exposed headers: \* +- Maximum age (seconds): 86400 ## SDK Architecture The Azure Storage SDK for JavaScript provides low-level and high-level APIs. -* ServiceURL, ShareURL, DirectoryURL and FileURL objects provide the low-level API functionality and map one-to-one to the [Azure Storage File REST APIs](https://docs.microsoft.com/en-us/rest/api/storageservices/file-service-rest-api). +- ServiceURL, ShareURL, DirectoryURL and FileURL objects provide the low-level API functionality and map one-to-one to the [Azure Storage File REST APIs](https://docs.microsoft.com/en-us/rest/api/storageservices/file-service-rest-api). -* The high-level APIs provide convenience abstractions such as uploading a large stream to a file (using multiple PutBlock requests). +- The high-level APIs provide convenience abstractions such as uploading a large stream to a file (using multiple PutBlock requests). ## Code Samples ```javascript const { Aborter, - StorageURL, - ServiceURL, - ShareURL, - DirectoryURL, - FileURL, + StorageClient, + FileServiceClient, + ShareClient, + DirectoryClient, + FileClient, SharedKeyCredential, AnonymousCredential } = require("@azure/storage-file"); @@ -147,10 +147,10 @@ async function main() { const anonymousCredential = new AnonymousCredential(); // Use sharedKeyCredential or anonymousCredential to create a pipeline - const pipeline = StorageURL.newPipeline(sharedKeyCredential); + const pipeline = StorageClient.newPipeline(sharedKeyCredential); // List shares - const serviceURL = new ServiceURL( + const servieClient = new FileServiceClient( // When using AnonymousCredential, following url should include a valid SAS `https://${account}.file.core.windows.net`, pipeline @@ -159,7 +159,7 @@ async function main() { console.log(`List shares`); let marker; do { - const listSharesResponse = await serviceURL.listSharesSegment( + const listSharesResponse = await servieClient.listSharesSegment( Aborter.none, marker ); @@ -172,32 +172,32 @@ async function main() { // Create a share const shareName = `newshare${new Date().getTime()}`; - const shareURL = ShareURL.fromServiceURL(serviceURL, shareName); - await shareURL.create(Aborter.none); + const shareClient = ShareClient.fromFileServiceClient(servieClient, shareName); + await shareClient.create(Aborter.none); console.log(`Create share ${shareName} successfully`); // Create a directory const directoryName = `newdirectory${new Date().getTime()}`; - const directoryURL = DirectoryURL.fromShareURL(shareURL, directoryName); - await directoryURL.create(Aborter.none); + const directoryClient = DirectoryClient.fromShareClient(shareClient, directoryName); + await directoryClient.create(Aborter.none); console.log(`Create directory ${directoryName} successfully`); // Create a file const content = "Hello World!"; const fileName = "newfile" + new Date().getTime(); - const fileURL = FileURL.fromDirectoryURL(directoryURL, fileName); - await fileURL.create(Aborter.none, content.length); + const fileClient = FileClient.fromDirectoryClient(directoryClient, fileName); + await fileClient.create(Aborter.none, content.length); console.log(`Create file ${fileName} successfully`); // Upload file range - await fileURL.uploadRange(Aborter.none, content, 0, content.length); + await fileClient.uploadRange(Aborter.none, content, 0, content.length); console.log(`Upload file range "${content}" to ${fileName} successfully`); // List directories and files console.log(`List directories and files under directory ${directoryName}`); marker = undefined; do { - const listFilesAndDirectoriesResponse = await directoryURL.listFilesAndDirectoriesSegment( + const listFilesAndDirectoriesResponse = await directoryClient.listFilesAndDirectoriesSegment( Aborter.none, marker ); @@ -215,7 +215,7 @@ async function main() { // Get file content from position 0 to the end // In Node.js, get downloaded data by accessing downloadFileResponse.readableStreamBody // In browsers, get downloaded data by accessing downloadFileResponse.blobBody - const downloadFileResponse = await fileURL.download(Aborter.none, 0); + const downloadFileResponse = await fileClient.download(Aborter.none, 0); console.log( `Downloaded file content${await streamToString( downloadFileResponse.readableStreamBody @@ -223,7 +223,7 @@ async function main() { ); // Delete share - await shareURL.delete(Aborter.none); + await shareClient.delete(Aborter.none); console.log(`deleted share ${shareName}`); } @@ -253,8 +253,8 @@ main() ## More Code Samples -* [File Storage Examples](https://github.com/azure/azure-storage-js/tree/master/file/samples) -* [File Storage Examples - Test Cases](https://github.com/azure/azure-storage-js/tree/master/file/test/) +- [File Storage Examples](https://github.com/azure/azure-storage-js/tree/master/file/samples) +- [File Storage Examples - Test Cases](https://github.com/azure/azure-storage-js/tree/master/file/test/) ## License diff --git a/sdk/storage/storage-file/ci.yml b/sdk/storage/storage-file/ci.yml new file mode 100644 index 000000000000..1a056d4164da --- /dev/null +++ b/sdk/storage/storage-file/ci.yml @@ -0,0 +1,17 @@ +# DO NOT EDIT THIS FILE +# This file is generated automatically and any changes will be lost. + +trigger: none + +pr: + branches: + include: + - master + paths: + include: + - sdk/storage/storage-file/ + +jobs: + - template: ../../../eng/pipelines/templates/jobs/archetype-sdk-client.yml + parameters: + PackageName: "@azure/storage-file" diff --git a/sdk/storage/storage-file/gulpfile.js b/sdk/storage/storage-file/gulpfile.js index 340cdcd3418d..946b2b3cf0c2 100644 --- a/sdk/storage/storage-file/gulpfile.js +++ b/sdk/storage/storage-file/gulpfile.js @@ -4,11 +4,11 @@ const zip = require("gulp-zip"); const version = require("./package.json").version; const zipFileName = `azurestoragejs.file-${version}.zip`; -gulp.task("zip", function(callback) { +gulp.task("zip", function (callback) { gulp .src([ - "browser/azure-storage.file.js", - "browser/azure-storage.file.min.js", + "browser/azure-storage-file.js", + "browser/azure-storage-file.min.js", "browser/*.txt" ]) .pipe(zip(zipFileName)) diff --git a/sdk/storage/storage-file/karma.conf.js b/sdk/storage/storage-file/karma.conf.js index bf041dcb0346..f7fbf475657f 100644 --- a/sdk/storage/storage-file/karma.conf.js +++ b/sdk/storage/storage-file/karma.conf.js @@ -1,6 +1,6 @@ // https://github.com/karma-runner/karma-chrome-launcher process.env.CHROME_BIN = require("puppeteer").executablePath(); -require("dotenv").config({path:"../.env"}); +require("dotenv").config({ path: "../.env" }); module.exports = function(config) { config.set({ @@ -65,7 +65,7 @@ module.exports = function(config) { // Exclude coverage calculation for following files remapOptions: { - exclude: /node_modules|tests/g + exclude: /node_modules|test/g }, junitReporter: { diff --git a/sdk/storage/storage-file/package.json b/sdk/storage/storage-file/package.json index bf40db7dc60b..46e630fcab92 100644 --- a/sdk/storage/storage-file/package.json +++ b/sdk/storage/storage-file/package.json @@ -1,11 +1,11 @@ { "name": "@azure/storage-file", - "version": "10.1.0", + "version": "11.0.0-preview.1", "description": "Microsoft Azure Storage SDK for JavaScript - File", "main": "./dist/index.js", "module": "./dist-esm/src/index.js", "browser": { - "./dist/index.js": "./browser/azure-storage.file.min.js", + "./dist/index.js": "./browser/azure-storage-file.min.js", "./dist-esm/src/index.js": "./dist-esm/src/index.browser.js", "./dist-esm/test/utils/index.js": "./dist-esm/test/utils/index.browser.js", "./dist-esm/src/FileDownloadResponse.js": "./dist-esm/src/FileDownloadResponse.browser.js", @@ -73,12 +73,12 @@ "build:nodebrowser": "rollup -c 2>&1", "build:test": "npm run build:es6 && rollup -c rollup.test.config.js 2>&1", "build": "npm run build:es6 && npm run build:nodebrowser && npm run build:browserzip", - "check-format": "prettier --list-different --config .prettierrc.json \"src/**/*.ts\" \"test/**/*.ts\" \"*.{js,json}\"", + "check-format": "prettier --list-different --config ../../.prettierrc.json \"src/**/*.ts\" \"test/**/*.ts\" \"*.{js,json}\"", "clean": "rimraf dist dist-esm dist-test typings temp browser/*.js* browser/*.zip statistics.html coverage coverage-browser .nyc_output *.tgz *.log test*.xml TEST*.xml", "extract-api": "tsc -p . && api-extractor run --local", - "format": "prettier --write --config .prettierrc.json \"src/**/*.ts\" \"test/**/*.ts\" \"*.{js,json}\"", + "format": "prettier --write --config ../../.prettierrc.json \"src/**/*.ts\" \"test/**/*.ts\" \"*.{js,json}\"", "integration-test:browser": "karma start --single-run", - "integration-test:node": "cross-env TS_NODE_COMPILER_OPTIONS=\"{\\\"module\\\": \\\"commonjs\\\"}\" nyc mocha --compilers ts-node/register --require source-map-support/register --reporter mocha-multi --reporter-options spec=-,mocha-junit-reporter=- --full-trace --no-timeouts test/*.test.ts test/node/*.test.ts", + "integration-test:node": "nyc mocha --require source-map-support/register --reporter mocha-multi --reporter-options spec=-,mocha-junit-reporter=- --full-trace -t 120000 dist-test/index.node.js", "integration-test": "npm run integration-test:node && npm run integration-test:browser", "lint:fix": "echo skipped", "lint": "echo skipped", diff --git a/sdk/storage/storage-file/rollup.base.config.js b/sdk/storage/storage-file/rollup.base.config.js new file mode 100644 index 000000000000..798dbaf6ca0b --- /dev/null +++ b/sdk/storage/storage-file/rollup.base.config.js @@ -0,0 +1,146 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +import nodeResolve from "rollup-plugin-node-resolve"; +import multiEntry from "rollup-plugin-multi-entry"; +import cjs from "rollup-plugin-commonjs"; +import replace from "rollup-plugin-replace"; +import { uglify } from "rollup-plugin-uglify"; +import sourcemaps from "rollup-plugin-sourcemaps"; +import shim from "rollup-plugin-shim"; +// import visualizer from "rollup-plugin-visualizer"; + +const version = require("./package.json").version; +const banner = [ + "/*!", + ` * Azure Storage SDK for JavaScript - File, ${version}`, + " * Copyright (c) Microsoft and contributors. All rights reserved.", + " */" +].join("\n"); + +const pkg = require("./package.json"); +const depNames = Object.keys(pkg.dependencies); +const production = process.env.NODE_ENV === "production"; + +export function nodeConfig(test = false) { + const externalNodeBuiltins = ["@azure/ms-rest-js", "crypto", "fs", "events", "os", "stream"]; + const baseConfig = { + input: "dist-esm/src/index.js", + external: depNames.concat(externalNodeBuiltins), + output: { + file: "dist/index.js", + format: "cjs", + sourcemap: true + }, + preserveSymlinks: false, + plugins: [ + sourcemaps(), + replace({ + delimiters: ["", ""], + values: { + // replace dynamic checks with if (true) since this is for node only. + // Allows rollup's dead code elimination to be more aggressive. + "if (isNode)": "if (true)" + } + }), + nodeResolve({ preferBuiltins: true }), + cjs() + ] + }; + + if (test) { + // entry point is every test file + baseConfig.input = ["dist-esm/test/*.spec.js", "dist-esm/test/node/*.spec.js"]; + baseConfig.plugins.unshift(multiEntry({ exports: false })); + + // different output file + baseConfig.output.file = "dist-test/index.node.js"; + + // mark assert as external + baseConfig.external.push("assert", "fs", "path"); + + baseConfig.context = "null"; + } else if (production) { + baseConfig.plugins.push(uglify()); + } + + return baseConfig; +} + +export function browserConfig(test = false, production = false) { + const baseConfig = { + input: "dist-esm/src/index.browser.js", + external: ["ms-rest-js"], + output: { + file: "browser/azure-storage-file.js", + banner: banner, + format: "umd", + name: "azfile", + sourcemap: true + }, + preserveSymlinks: false, + plugins: [ + sourcemaps(), + replace({ + delimiters: ["", ""], + values: { + // replace dynamic checks with if (false) since this is for + // browser only. Rollup's dead code elimination will remove + // any code guarded by if (isNode) { ... } + "if (isNode)": "if (false)" + } + }), + // os is not used by the browser bundle, so just shim it + shim({ + dotenv: `export function config() { }`, + os: ` + export const type = 1; + export const release = 1; + ` + }), + nodeResolve({ + mainFields: ["module", "browser"], + preferBuiltins: false + }), + cjs({ + namedExports: { + events: ["EventEmitter"], + assert: [ + "ok", + "deepEqual", + "equal", + "fail", + "deepStrictEqual", + "notDeepStrictEqual", + "notDeepEqual", + "notEqual" + ] + } + }) + ] + }; + + if (test) { + baseConfig.input = ["dist-esm/test/*.spec.js", "dist-esm/test/browser/*.spec.js"]; + baseConfig.plugins.unshift(multiEntry({ exports: false })); + baseConfig.output.file = "dist-test/index.browser.js"; + + baseConfig.context = "null"; + } else if (production) { + baseConfig.output.file = "browser/azure-storage-file.min.js"; + baseConfig.plugins.push( + uglify({ + output: { + preamble: banner + } + }) + // Comment visualizer because it only works on Node.js 8+; Uncomment it to get bundle analysis report + // visualizer({ + // filename: "./statistics.html", + // sourcemap: true + // }) + ); + } + + return baseConfig; +} diff --git a/sdk/storage/storage-file/rollup.config.js b/sdk/storage/storage-file/rollup.config.js index a39ef73e03bf..6f119550d77a 100644 --- a/sdk/storage/storage-file/rollup.config.js +++ b/sdk/storage/storage-file/rollup.config.js @@ -1,104 +1,18 @@ -import nodeResolve from "rollup-plugin-node-resolve"; -import { uglify } from "rollup-plugin-uglify"; -import replace from "rollup-plugin-replace"; -import commonjs from "rollup-plugin-commonjs"; -import shim from "rollup-plugin-shim"; -// import visualizer from "rollup-plugin-visualizer"; +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. -const version = require("./package.json").version; -const banner = [ - "/*!", - ` * Azure Storage SDK for JavaScript - File, ${version}`, - " * Copyright (c) Microsoft and contributors. All rights reserved.", - " */" -].join("\n"); +import * as base from "./rollup.base.config"; -const nodeRollupConfigFactory = () => { - return { - external: ["@azure/ms-rest-js", "crypto", "fs", "events", "os", "stream"], - input: "dist-esm/src/index.js", - output: { - file: "dist/index.js", - format: "cjs", - sourcemap: true - }, - preserveSymlinks: false, - plugins: [nodeResolve(), uglify()] - }; -}; +const inputs = []; -const browserRollupConfigFactory = isProduction => { - const browserRollupConfig = { - input: "dist-esm/src/index.browser.js", - output: { - file: "browser/azure-storage.file.js", - banner: banner, - format: "umd", - name: "azfile", - sourcemap: true - }, - preserveSymlinks: false, - plugins: [ - replace({ - delimiters: ["", ""], - values: { - // replace dynamic checks with if (false) since this is for - // browser only. Rollup's dead code elimination will remove - // any code guarded by if (isNode) { ... } - "if (isNode)": "if (false)" - } - }), - // os is not used by the browser bundle, so just shim it - shim({ - dotenv: `export function config() { }`, - os: ` - export const type = 1; - export const release = 1; - ` - }), - nodeResolve({ - mainFields: ['module', 'browser'], - preferBuiltins: false - }), - commonjs({ - namedExports: { - events: ["EventEmitter"], - assert: [ - "ok", - "deepEqual", - "equal", - "fail", - "deepStrictEqual", - "notDeepStrictEqual", - "notDeepEqual", - "notEqual" - ] - } - }) - ] - }; +if (!process.env.ONLY_BROWSER) { + inputs.push(base.nodeConfig()); +} - if (isProduction) { - browserRollupConfig.output.file = "browser/azure-storage.file.min.js"; - browserRollupConfig.plugins.push( - uglify({ - output: { - preamble: banner - } - }) - // Comment visualizer because it only works on Node.js 8+; Uncomment it to get bundle analysis report - // visualizer({ - // filename: "./statistics.html", - // sourcemap: true - // }) - ); - } +// Disable this until we are ready to run rollup for the browser. +if (!process.env.ONLY_NODE) { + inputs.push(base.browserConfig()); + inputs.push(base.browserConfig(false, true)); +} - return browserRollupConfig; -}; - -export default [ - browserRollupConfigFactory(false), - browserRollupConfigFactory(true), - nodeRollupConfigFactory() -]; +export default inputs; diff --git a/sdk/storage/storage-file/rollup.test.config.js b/sdk/storage/storage-file/rollup.test.config.js index 24622435837c..ad98718cce46 100644 --- a/sdk/storage/storage-file/rollup.test.config.js +++ b/sdk/storage/storage-file/rollup.test.config.js @@ -1,13 +1,6 @@ -import multi from "rollup-plugin-multi-entry"; -import baseConfig from "./rollup.config"; -import sourcemaps from "rollup-plugin-sourcemaps"; -const [browser] = baseConfig; +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. -browser.input = ["dist-esm/test/*.js", "dist-esm/test/browser/*.js"]; -browser.output.sourcemap = "inline"; -browser.output.file = "dist-test/index.browser.js"; -browser.plugins.unshift(multi()); -browser.plugins.unshift(sourcemaps()); -browser.context = "null"; +import * as base from "./rollup.base.config"; -export default [browser]; +export default [base.nodeConfig(true), base.browserConfig(true)]; diff --git a/sdk/storage/storage-file/samples/javascript/advanced.js b/sdk/storage/storage-file/samples/javascript/advanced.js index d21156030c02..938eb98cf5e3 100644 --- a/sdk/storage/storage-file/samples/javascript/advanced.js +++ b/sdk/storage/storage-file/samples/javascript/advanced.js @@ -10,11 +10,11 @@ const { uploadFileToAzureFile, uploadStreamToAzureFile, Aborter, - FileURL, - DirectoryURL, - ShareURL, - ServiceURL, - StorageURL + FileClient, + DirectoryClient, + ShareClient, + FileServiceClient, + StorageClient } = require(".."); // Change to "@azure/storage-file" in your package async function main() { @@ -23,38 +23,38 @@ async function main() { const accountSas = ""; const localFilePath = ""; - const pipeline = StorageURL.newPipeline(new AnonymousCredential(), { + const pipeline = StorageClient.newPipeline(new AnonymousCredential(), { // httpClient: MyHTTPClient, // A customized HTTP client implementing IHttpClient interface // logger: MyLogger, // A customized logger implementing IHttpPipelineLogger interface retryOptions: { maxTries: 4 }, // Retry options telemetry: { value: "HighLevelSample V1.0.0" } // Customized telemetry string }); - const serviceURL = new ServiceURL( + const servieClient = new FileServiceClient( `https://${account}.file.core.windows.net${accountSas}`, pipeline ); // Create a share const shareName = `newshare${new Date().getTime()}`; - const shareURL = ShareURL.fromServiceURL(serviceURL, shareName); - await shareURL.create(Aborter.none); + const shareClient = ShareClient.fromFileServiceClient(servieClient, shareName); + await shareClient.create(Aborter.none); console.log(`Create share ${shareName} successfully`); // Create a directory const directoryName = `newdirectory${new Date().getTime()}`; - const directoryURL = DirectoryURL.fromShareURL(shareURL, directoryName); - await directoryURL.create(Aborter.none); + const directoryClient = DirectoryClient.fromShareClient(shareClient, directoryName); + await directoryClient.create(Aborter.none); console.log(`Create directory ${directoryName} successfully`); // Upload local file to Azure file parallelly const fileName = "newfile" + new Date().getTime(); - const fileURL = FileURL.fromDirectoryURL(directoryURL, fileName); + const fileClient = FileClient.fromDirectoryClient(directoryClient, fileName); const fileSize = fs.statSync(localFilePath).size; // Parallel uploading with uploadFileToAzureFile in Node.js runtime // uploadFileToAzureFile is only available in Node.js - await uploadFileToAzureFile(Aborter.none, localFilePath, fileURL, { + await uploadFileToAzureFile(Aborter.none, localFilePath, fileClient, { rangeSize: 4 * 1024 * 1024, // 4MB range size parallelism: 20, // 20 concurrency progress: ev => console.log(ev) @@ -67,7 +67,7 @@ async function main() { Aborter.timeout(30 * 60 * 1000), // Abort uploading with timeout in 30mins fs.createReadStream(localFilePath), fileSize, - fileURL, + fileClient, 4 * 1024 * 1024, 20, { @@ -80,7 +80,7 @@ async function main() { // Uncomment following code in browsers because uploadBrowserDataToAzureFile is only available in browsers /* const browserFile = document.getElementById("fileinput").files[0]; - await uploadBrowserDataToAzureFile(Aborter.none, browserFile, fileURL, { + await uploadBrowserDataToAzureFile(Aborter.none, browserFile, fileClient, { rangeSize: 4 * 1024 * 1024, // 4MB range size parallelism: 20, // 20 concurrency progress: ev => console.log(ev) @@ -93,7 +93,7 @@ async function main() { await downloadAzureFileToBuffer( Aborter.timeout(30 * 60 * 1000), buffer, - fileURL, + fileClient, 0, undefined, { @@ -105,7 +105,7 @@ async function main() { console.log("downloadAzureFileToBuffer success"); // Delete share - await shareURL.delete(Aborter.none); + await shareClient.delete(Aborter.none); console.log("deleted share"); } diff --git a/sdk/storage/storage-file/samples/javascript/basic.js b/sdk/storage/storage-file/samples/javascript/basic.js index 65150e5c192b..d2f0808f1bb6 100644 --- a/sdk/storage/storage-file/samples/javascript/basic.js +++ b/sdk/storage/storage-file/samples/javascript/basic.js @@ -4,11 +4,11 @@ const { Aborter, - StorageURL, - ServiceURL, - ShareURL, - DirectoryURL, - FileURL, + StorageClient, + FileServiceClient, + ShareClient, + DirectoryClient, + FileClient, SharedKeyCredential, AnonymousCredential } = require(".."); // Change to "@azure/storage-file" in your package @@ -26,10 +26,10 @@ async function main() { const anonymousCredential = new AnonymousCredential(); // Use sharedKeyCredential or anonymousCredential to create a pipeline - const pipeline = StorageURL.newPipeline(sharedKeyCredential); + const pipeline = StorageClient.newPipeline(sharedKeyCredential); // List shares - const serviceURL = new ServiceURL( + const servieClient = new FileServiceClient( // When using AnonymousCredential, following url should include a valid SAS `https://${account}.file.core.windows.net`, pipeline @@ -38,7 +38,7 @@ async function main() { console.log(`List shares`); let marker; do { - const listSharesResponse = await serviceURL.listSharesSegment( + const listSharesResponse = await servieClient.listSharesSegment( Aborter.none, marker ); @@ -51,32 +51,32 @@ async function main() { // Create a share const shareName = `newshare${new Date().getTime()}`; - const shareURL = ShareURL.fromServiceURL(serviceURL, shareName); - await shareURL.create(Aborter.none); + const shareClient = ShareClient.fromFileServiceClient(servieClient, shareName); + await shareClient.create(Aborter.none); console.log(`Create share ${shareName} successfully`); // Create a directory const directoryName = `newdirectory${new Date().getTime()}`; - const directoryURL = DirectoryURL.fromShareURL(shareURL, directoryName); - await directoryURL.create(Aborter.none); + const directoryClient = DirectoryClient.fromShareClient(shareClient, directoryName); + await directoryClient.create(Aborter.none); console.log(`Create directory ${directoryName} successfully`); // Create a file const content = "Hello World!"; const fileName = "newfile" + new Date().getTime(); - const fileURL = FileURL.fromDirectoryURL(directoryURL, fileName); - await fileURL.create(Aborter.none, content.length); + const fileClient = FileClient.fromDirectoryClient(directoryClient, fileName); + await fileClient.create(Aborter.none, content.length); console.log(`Create file ${fileName} successfully`); // Upload file range - await fileURL.uploadRange(Aborter.none, content, 0, content.length); + await fileClient.uploadRange(Aborter.none, content, 0, content.length); console.log(`Upload file range "${content}" to ${fileName} successfully`); // List directories and files console.log(`List directories and files under directory ${directoryName}`); marker = undefined; do { - const listFilesAndDirectoriesResponse = await directoryURL.listFilesAndDirectoriesSegment( + const listFilesAndDirectoriesResponse = await directoryClient.listFilesAndDirectoriesSegment( Aborter.none, marker ); @@ -94,7 +94,7 @@ async function main() { // Get file content from position 0 to the end // In Node.js, get downloaded data by accessing downloadFileResponse.readableStreamBody // In browsers, get downloaded data by accessing downloadFileResponse.blobBody - const downloadFileResponse = await fileURL.download(Aborter.none, 0); + const downloadFileResponse = await fileClient.download(Aborter.none, 0); console.log( `Downloaded file content${await streamToString( downloadFileResponse.readableStreamBody @@ -102,7 +102,7 @@ async function main() { ); // Delete share - await shareURL.delete(Aborter.none); + await shareClient.delete(Aborter.none); console.log(`deleted share ${shareName}`); } diff --git a/sdk/storage/storage-file/samples/typescript/advanced.ts b/sdk/storage/storage-file/samples/typescript/advanced.ts index e38e7e4aa4d9..577aa86f2f25 100644 --- a/sdk/storage/storage-file/samples/typescript/advanced.ts +++ b/sdk/storage/storage-file/samples/typescript/advanced.ts @@ -9,11 +9,11 @@ import { uploadFileToAzureFile, uploadStreamToAzureFile, Aborter, - FileURL, - DirectoryURL, - ShareURL, - ServiceURL, - StorageURL + FileClient, + DirectoryClient, + ShareClient, + FileServiceClient, + StorageClient } from "../.."; // Change to "@azure/storage-file" in your package async function main() { @@ -22,55 +22,55 @@ async function main() { const accountSas = ""; const localFilePath = ""; - const pipeline = StorageURL.newPipeline(new AnonymousCredential(), { + const pipeline = StorageClient.newPipeline(new AnonymousCredential(), { // httpClient: MyHTTPClient, // A customized HTTP client implementing IHttpClient interface // logger: MyLogger, // A customized logger implementing IHttpPipelineLogger interface retryOptions: { maxTries: 4 }, // Retry options telemetry: { value: "HighLevelSample V1.0.0" } // Customized telemetry string }); - const serviceURL = new ServiceURL( + const serviceClient = new FileServiceClient( `https://${account}.file.core.windows.net${accountSas}`, pipeline ); // Create a share const shareName = `newshare${new Date().getTime()}`; - const shareURL = ShareURL.fromServiceURL(serviceURL, shareName); - await shareURL.create(Aborter.none); + const shareClient = ShareClient.fromFileServiceClient(serviceClient, shareName); + await shareClient.create(); console.log(`Create share ${shareName} successfully`); // Create a directory const directoryName = `newdirectory${new Date().getTime()}`; - const directoryURL = DirectoryURL.fromShareURL(shareURL, directoryName); - await directoryURL.create(Aborter.none); + const directoryClient = DirectoryClient.fromShareClient(shareClient, directoryName); + await directoryClient.create(); console.log(`Create directory ${directoryName} successfully`); // Upload local file to Azure file parallelly const fileName = "newfile" + new Date().getTime(); - const fileURL = FileURL.fromDirectoryURL(directoryURL, fileName); + const fileClient = FileClient.fromDirectoryClient(directoryClient, fileName); const fileSize = fs.statSync(localFilePath).size; // Parallel uploading with uploadFileToAzureFile in Node.js runtime // uploadFileToAzureFile is only available in Node.js - await uploadFileToAzureFile(Aborter.none, localFilePath, fileURL, { + await uploadFileToAzureFile(localFilePath, fileClient, { rangeSize: 4 * 1024 * 1024, // 4MB range size parallelism: 20, // 20 concurrency - progress: ev => console.log(ev) + progress: (ev) => console.log(ev) }); console.log("uploadFileToAzureFile success"); // Parallel uploading a Readable stream with uploadStreamToAzureFile in Node.js runtime // uploadStreamToAzureFile is only available in Node.js await uploadStreamToAzureFile( - Aborter.timeout(30 * 60 * 1000), // Abort uploading with timeout in 30mins fs.createReadStream(localFilePath), fileSize, - fileURL, + fileClient, 4 * 1024 * 1024, 20, { - progress: ev => console.log(ev) + abortSignal: Aborter.timeout(30 * 60 * 1000), // Abort uploading with timeout in 30mins + progress: (ev: any) => console.log(ev) } ); console.log("uploadStreamToAzureFile success"); @@ -79,7 +79,7 @@ async function main() { // Uncomment following code in browsers because uploadBrowserDataToAzureFile is only available in browsers /* const browserFile = document.getElementById("fileinput").files[0]; - await uploadBrowserDataToAzureFile(Aborter.none, browserFile, fileURL, { + await uploadBrowserDataToAzureFile(browserFile, fileClient, { rangeSize: 4 * 1024 * 1024, // 4MB range size parallelism: 20, // 20 concurrency progress: ev => console.log(ev) @@ -89,22 +89,16 @@ async function main() { // Parallel downloading an Azure file into Node.js buffer // downloadAzureFileToBuffer is only available in Node.js const buffer = Buffer.alloc(fileSize); - await downloadAzureFileToBuffer( - Aborter.timeout(30 * 60 * 1000), - buffer, - fileURL, - 0, - undefined, - { - rangeSize: 4 * 1024 * 1024, // 4MB range size - parallelism: 20, // 20 concurrency - progress: ev => console.log(ev) - } - ); + await downloadAzureFileToBuffer(buffer, fileClient, 0, undefined, { + abortSignal: Aborter.timeout(30 * 60 * 1000), + rangeSize: 4 * 1024 * 1024, // 4MB range size + parallelism: 20, // 20 concurrency + progress: (ev) => console.log(ev) + }); console.log("downloadAzureFileToBuffer success"); // Delete share - await shareURL.delete(Aborter.none); + await shareClient.delete(); console.log("deleted share"); } @@ -113,6 +107,6 @@ main() .then(() => { console.log("Successfully executed sample."); }) - .catch(err => { + .catch((err) => { console.log(err.message); }); diff --git a/sdk/storage/storage-file/samples/typescript/basic.ts b/sdk/storage/storage-file/samples/typescript/basic.ts index 89aa54de8d10..f34c2a277ce0 100644 --- a/sdk/storage/storage-file/samples/typescript/basic.ts +++ b/sdk/storage/storage-file/samples/typescript/basic.ts @@ -3,14 +3,13 @@ */ import { - Aborter, - StorageURL, - ServiceURL, - ShareURL, - DirectoryURL, - FileURL, + StorageClient, + FileServiceClient, SharedKeyCredential, - Models + Models, + ShareClient, + DirectoryClient, + FileClient } from "../.."; // Change to "@azure/storage-file" in your package async function main() { @@ -25,10 +24,10 @@ async function main() { // const anonymousCredential = new AnonymousCredential(); // Use sharedKeyCredential or anonymousCredential to create a pipeline - const pipeline = StorageURL.newPipeline(sharedKeyCredential); + const pipeline = StorageClient.newPipeline(sharedKeyCredential); // List shares - const serviceURL = new ServiceURL( + const serviceClient = new FileServiceClient( // When using AnonymousCredential, following url should include a valid SAS `https://${account}.file.core.windows.net`, pipeline @@ -37,8 +36,7 @@ async function main() { console.log(`List shares`); let marker; do { - const listSharesResponse: Models.ServiceListSharesSegmentResponse = await serviceURL.listSharesSegment( - Aborter.none, + const listSharesResponse: Models.ServiceListSharesSegmentResponse = await serviceClient.listSharesSegment( marker ); @@ -50,33 +48,32 @@ async function main() { // Create a share const shareName = `newshare${new Date().getTime()}`; - const shareURL = ShareURL.fromServiceURL(serviceURL, shareName); - await shareURL.create(Aborter.none); + const shareClient = ShareClient.fromFileServiceClient(serviceClient, shareName); + await shareClient.create(); console.log(`Create share ${shareName} successfully`); // Create a directory const directoryName = `newdirectory${new Date().getTime()}`; - const directoryURL = DirectoryURL.fromShareURL(shareURL, directoryName); - await directoryURL.create(Aborter.none); + const directoryClient = DirectoryClient.fromShareClient(shareClient, directoryName); + await directoryClient.create(); console.log(`Create directory ${directoryName} successfully`); // Create a file const content = "Hello World!"; const fileName = "newfile" + new Date().getTime(); - const fileURL = FileURL.fromDirectoryURL(directoryURL, fileName); - await fileURL.create(Aborter.none, content.length); + const fileClient = FileClient.fromDirectoryClient(directoryClient, fileName); + await fileClient.create(content.length); console.log(`Create file ${fileName} successfully`); // Upload file range - await fileURL.uploadRange(Aborter.none, content, 0, content.length); + await fileClient.uploadRange(content, 0, content.length); console.log(`Upload file range "${content}" to ${fileName} successfully`); // List directories and files console.log(`List directories and files under directory ${directoryName}`); marker = undefined; do { - const listFilesAndDirectoriesResponse: Models.DirectoryListFilesAndDirectoriesSegmentResponse = await directoryURL.listFilesAndDirectoriesSegment( - Aborter.none, + const listFilesAndDirectoriesResponse: Models.DirectoryListFilesAndDirectoriesSegmentResponse = await directoryClient.listFilesAndDirectoriesSegment( marker ); @@ -84,8 +81,7 @@ async function main() { for (const file of listFilesAndDirectoriesResponse.segment.fileItems) { console.log(`\tFile: ${file.name}`); } - for (const directory of listFilesAndDirectoriesResponse.segment - .directoryItems) { + for (const directory of listFilesAndDirectoriesResponse.segment.directoryItems) { console.log(`\tDirectory: ${directory.name}`); } } while (marker); @@ -93,15 +89,13 @@ async function main() { // Get file content from position 0 to the end // In Node.js, get downloaded data by accessing downloadFileResponse.readableStreamBody // In browsers, get downloaded data by accessing downloadFileResponse.blobBody - const downloadFileResponse = await fileURL.download(Aborter.none, 0); + const downloadFileResponse = await fileClient.download(0); console.log( - `Downloaded file content${await streamToString( - downloadFileResponse.readableStreamBody! - )}` + `Downloaded file content${await streamToString(downloadFileResponse.readableStreamBody!)}` ); // Delete share - await shareURL.delete(Aborter.none); + await shareClient.delete(); console.log(`deleted share ${shareName}`); } @@ -109,7 +103,7 @@ async function main() { async function streamToString(readableStream: NodeJS.ReadableStream) { return new Promise((resolve, reject) => { const chunks: string[] = []; - readableStream.on("data", data => { + readableStream.on("data", (data) => { chunks.push(data.toString()); }); readableStream.on("end", () => { @@ -124,6 +118,6 @@ main() .then(() => { console.log("Successfully executed sample."); }) - .catch(err => { + .catch((err) => { console.log(err.message); }); diff --git a/sdk/storage/storage-file/src/Aborter.ts b/sdk/storage/storage-file/src/Aborter.ts index d7b1c7eb41fb..c2f612921006 100644 --- a/sdk/storage/storage-file/src/Aborter.ts +++ b/sdk/storage/storage-file/src/Aborter.ts @@ -17,18 +17,18 @@ import { AbortSignalLike, isNode } from "@azure/ms-rest-js"; * * @example * // Abort without timeout - * await fileURL.uploadRange(Aborter.none, buf, 0, buf.length); + * await fileClient.uploadRange(buf, 0, buf.length); * * @example * // Abort container create in 1000ms - * await fileURL.uploadRange(Aborter.timeout(1000), buf, 0, buf.length); + * await fileClient.uploadRange(buf, 0, buf.length, {abortSignal: Aborter.timeout(1000)}); * * @example * // Share aborter cross multiple operations in 30s * // Upload the same data to 2 different data centers at the same time, abort another when any of them is finished * const aborter = Aborter.timeout(30 * 1000); - * fileURL1.uploadRange(aborter, buf, 0, buf.length).then(aborter.abort); - * fileURL2.uploadRange(aborter, buf, 0, buf.length).then(aborter.abort); + * fileClient1.uploadRange(buf, 0, buf.length, {abortSignal: aborter}).then(aborter.abort); + * fileClient2.uploadRange(buf, 0, buf.length, {abortSignal: aborter}).then(aborter.abort); * * @example * // Cascaded aborting @@ -36,8 +36,8 @@ import { AbortSignalLike, isNode } from "@azure/ms-rest-js"; * const aborter = Aborter.timeout(30 * 1000); * * // Following 2 operations can't take more than 25 seconds - * await fileURL.uploadRange(aborter.withTimeout(25 * 1000), buf, 0, buf.length); - * await fileURL.uploadRange(aborter.withTimeout(25 * 1000), buf, 0, buf.length); + * await fileClient.uploadRange(buf, 0, buf.length, {abortSignal: aborter.withTimeout(25 * 1000)}); + * await fileClient.uploadRange(buf, 0, buf.length, {abortSignal: aborter.withTimeout(25 * 1000)}); * * @export * @class Aborter @@ -86,16 +86,14 @@ export class Aborter implements AbortSignalLike { * * @memberof Aborter */ - public onabort?: ((ev?: Event) => any); + public onabort?: (ev?: Event) => any; // tslint:disable-next-line:variable-name private _aborted: boolean = false; private timer?: any; private readonly parent?: Aborter; private readonly children: Aborter[] = []; // When child object calls dispose(), remove child from here - private readonly abortEventListeners: Array< - (this: AbortSignalLike, ev?: any) => any - > = []; + private readonly abortEventListeners: Array<(this: AbortSignalLike, ev?: any) => any> = []; // Pipeline proxies need to use "abortSignal as Aborter" in order to access non AbortSignalLike methods // immutable primitive types private readonly key?: string; @@ -167,10 +165,7 @@ export class Aborter implements AbortSignalLike { * @returns {Aborter} * @memberof Aborter */ - public withValue( - key: string, - value?: string | number | boolean | null - ): Aborter { + public withValue(key: string, value?: string | number | boolean | null): Aborter { const childCancelContext = new Aborter(this, 0, key, value); this.children.push(childCancelContext); return childCancelContext; @@ -187,11 +182,7 @@ export class Aborter implements AbortSignalLike { * @memberof Aborter */ public getValue(key: string): string | number | boolean | null | undefined { - for ( - let parent: Aborter | undefined = this; - parent; - parent = parent.parent - ) { + for (let parent: Aborter | undefined = this; parent; parent = parent.parent) { if (parent.key === key) { return parent.value; } @@ -219,11 +210,11 @@ export class Aborter implements AbortSignalLike { this.onabort.call(this); } - this.abortEventListeners.forEach(listener => { + this.abortEventListeners.forEach((listener) => { listener.call(this); }); - this.children.forEach(child => child.cancelByParent()); + this.children.forEach((child) => child.cancelByParent()); this._aborted = true; } diff --git a/sdk/storage/storage-file/src/AccountSASPermissions.ts b/sdk/storage/storage-file/src/AccountSASPermissions.ts index de395ff917d2..081ed6a25cbe 100644 --- a/sdk/storage/storage-file/src/AccountSASPermissions.ts +++ b/sdk/storage/storage-file/src/AccountSASPermissions.ts @@ -7,7 +7,7 @@ * This is a helper class to construct a string representing the permissions granted by an AccountSAS. Setting a value * to true means that any SAS which uses these permissions will grant permissions for that operation. Once all the * values are set, this should be serialized with toString and set as the permissions field on an - * {@link IAccountSASSignatureValues} object. It is possible to construct the permissions string without this class, but + * {@link AccountSASSignatureValues} object. It is possible to construct the permissions string without this class, but * the order of the permissions is particular and this class guarantees correctness. * * @export diff --git a/sdk/storage/storage-file/src/AccountSASResourceTypes.ts b/sdk/storage/storage-file/src/AccountSASResourceTypes.ts index 0954cb9aa639..12b4988871fd 100644 --- a/sdk/storage/storage-file/src/AccountSASResourceTypes.ts +++ b/sdk/storage/storage-file/src/AccountSASResourceTypes.ts @@ -7,7 +7,7 @@ * This is a helper class to construct a string representing the resources accessible by an AccountSAS. Setting a value * to true means that any SAS which uses these permissions will grant access to that resource type. Once all the * values are set, this should be serialized with toString and set as the resources field on an - * {@link IAccountSASSignatureValues} object. It is possible to construct the resources string without this class, but + * {@link AccountSASSignatureValues} object. It is possible to construct the resources string without this class, but * the order of the resources is particular and this class guarantees correctness. * * @export diff --git a/sdk/storage/storage-file/src/AccountSASServices.ts b/sdk/storage/storage-file/src/AccountSASServices.ts index 82c6c5affe17..7a6c99f27c59 100644 --- a/sdk/storage/storage-file/src/AccountSASServices.ts +++ b/sdk/storage/storage-file/src/AccountSASServices.ts @@ -7,7 +7,7 @@ * This is a helper class to construct a string representing the services accessible by an AccountSAS. Setting a value * to true means that any SAS which uses these permissions will grant access to that service. Once all the * values are set, this should be serialized with toString and set as the services field on an - * {@link IAccountSASSignatureValues} object. It is possible to construct the services string without this class, but + * {@link AccountSASSignatureValues} object. It is possible to construct the services string without this class, but * the order of the services is particular and this class guarantees correctness. * * @export diff --git a/sdk/storage/storage-file/src/IAccountSASSignatureValues.ts b/sdk/storage/storage-file/src/AccountSASSignatureValues.ts similarity index 79% rename from sdk/storage/storage-file/src/IAccountSASSignatureValues.ts rename to sdk/storage/storage-file/src/AccountSASSignatureValues.ts index 438c03156c48..26b12d278e25 100644 --- a/sdk/storage/storage-file/src/IAccountSASSignatureValues.ts +++ b/sdk/storage/storage-file/src/AccountSASSignatureValues.ts @@ -5,7 +5,7 @@ import { AccountSASPermissions } from "./AccountSASPermissions"; import { AccountSASResourceTypes } from "./AccountSASResourceTypes"; import { AccountSASServices } from "./AccountSASServices"; import { SharedKeyCredential } from "./credentials/SharedKeyCredential"; -import { IIPRange, ipRangeToString } from "./IIPRange"; +import { IPRange, ipRangeToString } from "./IPRange"; import { SASProtocol, SASQueryParameters } from "./SASQueryParameters"; import { SERVICE_VERSION } from "./utils/constants"; import { truncatedISO8061Date } from "./utils/utils.common"; @@ -13,7 +13,7 @@ import { truncatedISO8061Date } from "./utils/utils.common"; /** * ONLY AVAILABLE IN NODE.JS RUNTIME. * - * IAccountSASSignatureValues is used to generate a Shared Access Signature (SAS) for an Azure Storage account. Once + * AccountSASSignatureValues is used to generate a Shared Access Signature (SAS) for an Azure Storage account. Once * all the values here are set appropriately, call generateSASQueryParameters() to obtain a representation of the SAS * which can actually be applied to file urls. Note: that both this class and {@link SASQueryParameters} exist because * the former is mutable and a logical representation while the latter is immutable and used to generate actual REST @@ -26,14 +26,14 @@ import { truncatedISO8061Date } from "./utils/utils.common"; * for descriptions of the parameters, including which are required * * @export - * @class IAccountSASSignatureValues + * @class AccountSASSignatureValues */ -export interface IAccountSASSignatureValues { +export interface AccountSASSignatureValues { /** * If not provided, this defaults to the service version targeted by this version of the library. * * @type {string} - * @memberof IAccountSASSignatureValues + * @memberof AccountSASSignatureValues */ version?: string; @@ -41,7 +41,7 @@ export interface IAccountSASSignatureValues { * Optional. SAS protocols allowed. * * @type {SASProtocol} - * @memberof IAccountSASSignatureValues + * @memberof AccountSASSignatureValues */ protocol?: SASProtocol; @@ -49,7 +49,7 @@ export interface IAccountSASSignatureValues { * Optional. When the SAS will take effect. * * @type {Date} - * @memberof IAccountSASSignatureValues + * @memberof AccountSASSignatureValues */ startTime?: Date; @@ -57,7 +57,7 @@ export interface IAccountSASSignatureValues { * The time after which the SAS will no longer work. * * @type {Date} - * @memberof IAccountSASSignatureValues + * @memberof AccountSASSignatureValues */ expiryTime: Date; @@ -66,24 +66,24 @@ export interface IAccountSASSignatureValues { * constructing the permissions string. * * @type {string} - * @memberof IAccountSASSignatureValues + * @memberof AccountSASSignatureValues */ permissions: string; /** * Optional. IP range allowed. * - * @type {IIPRange} - * @memberof IAccountSASSignatureValues + * @type {IPRange} + * @memberof AccountSASSignatureValues */ - ipRange?: IIPRange; + ipRange?: IPRange; /** * The values that indicate the services accessible with this SAS. Please refer to {@link AccountSASServices} to * construct this value. * * @type {string} - * @memberof IAccountSASSignatureValues + * @memberof AccountSASSignatureValues */ services: string; @@ -92,7 +92,7 @@ export interface IAccountSASSignatureValues { * to {@link AccountSASResourceTypes} to construct this value. * * @type {string} - * @memberof IAccountSASSignatureValues + * @memberof AccountSASSignatureValues */ resourceTypes: string; } @@ -107,10 +107,10 @@ export interface IAccountSASSignatureValues { * * @param {SharedKeyCredential} sharedKeyCredential * @returns {SASQueryParameters} - * @memberof IAccountSASSignatureValues + * @memberof AccountSASSignatureValues */ export function generateAccountSASQueryParameters( - accountSASSignatureValues: IAccountSASSignatureValues, + accountSASSignatureValues: AccountSASSignatureValues, sharedKeyCredential: SharedKeyCredential ): SASQueryParameters { const version = accountSASSignatureValues.version @@ -120,9 +120,7 @@ export function generateAccountSASQueryParameters( const parsedPermissions = AccountSASPermissions.parse( accountSASSignatureValues.permissions ).toString(); - const parsedServices = AccountSASServices.parse( - accountSASSignatureValues.services - ).toString(); + const parsedServices = AccountSASServices.parse(accountSASSignatureValues.services).toString(); const parsedResourceTypes = AccountSASResourceTypes.parse( accountSASSignatureValues.resourceTypes ).toString(); @@ -136,12 +134,8 @@ export function generateAccountSASQueryParameters( ? truncatedISO8061Date(accountSASSignatureValues.startTime, false) : "", truncatedISO8061Date(accountSASSignatureValues.expiryTime, false), - accountSASSignatureValues.ipRange - ? ipRangeToString(accountSASSignatureValues.ipRange) - : "", - accountSASSignatureValues.protocol - ? accountSASSignatureValues.protocol - : "", + accountSASSignatureValues.ipRange ? ipRangeToString(accountSASSignatureValues.ipRange) : "", + accountSASSignatureValues.protocol ? accountSASSignatureValues.protocol : "", version, "" // Account SAS requires an additional newline character ].join("\n"); diff --git a/sdk/storage/storage-file/src/BrowserPolicyFactory.ts b/sdk/storage/storage-file/src/BrowserPolicyFactory.ts index 306981413e8a..081b843dab15 100644 --- a/sdk/storage/storage-file/src/BrowserPolicyFactory.ts +++ b/sdk/storage/storage-file/src/BrowserPolicyFactory.ts @@ -1,12 +1,7 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -import { - RequestPolicy, - RequestPolicyFactory, - RequestPolicyOptions -} from "@azure/ms-rest-js"; - +import { RequestPolicy, RequestPolicyFactory, RequestPolicyOptions } from "@azure/ms-rest-js"; import { BrowserPolicy } from "./policies/BrowserPolicy"; /** @@ -17,10 +12,7 @@ import { BrowserPolicy } from "./policies/BrowserPolicy"; * @implements {RequestPolicyFactory} */ export class BrowserPolicyFactory implements RequestPolicyFactory { - public create( - nextPolicy: RequestPolicy, - options: RequestPolicyOptions - ): BrowserPolicy { + public create(nextPolicy: RequestPolicy, options: RequestPolicyOptions): BrowserPolicy { return new BrowserPolicy(nextPolicy, options); } } diff --git a/sdk/storage/storage-file/src/DirectoryURL.ts b/sdk/storage/storage-file/src/DirectoryClient.ts similarity index 58% rename from sdk/storage/storage-file/src/DirectoryURL.ts rename to sdk/storage/storage-file/src/DirectoryClient.ts index 1da7b9cbaa12..201afc9a3675 100644 --- a/sdk/storage/storage-file/src/DirectoryURL.ts +++ b/sdk/storage/storage-file/src/DirectoryClient.ts @@ -4,30 +4,32 @@ import { Aborter } from "./Aborter"; import * as Models from "./generated/lib/models"; import { Directory } from "./generated/lib/operations"; -import { IMetadata } from "./models"; +import { Metadata } from "./models"; import { Pipeline } from "./Pipeline"; -import { ShareURL } from "./ShareURL"; -import { StorageURL } from "./StorageURL"; +import { ShareClient } from "./ShareClient"; +import { StorageClient } from "./StorageClient"; import { appendToURLPath } from "./utils/utils.common"; -export interface IDirectoryCreateOptions { +export interface DirectoryCreateOptions { + abortSignal?: Aborter; /** * A name-value pair * to associate with a file storage object. * - * @type {IMetadata} - * @memberof IDirectoryCreateOptions + * @type {Metadata} + * @memberof DirectoryCreateOptions */ - metadata?: IMetadata; + metadata?: Metadata; } -export interface IDirectoryListFilesAndDirectoriesSegmentOptions { +export interface DirectoryListFilesAndDirectoriesSegmentOptions { + abortSignal?: Aborter; /** * Filters the results to return only entries whose * name begins with the specified prefix. * * @type {string} - * @memberof IDirectoryListFilesAndDirectoriesSegmentOptions + * @memberof DirectoryListFilesAndDirectoriesSegmentOptions */ prefix?: string; @@ -37,48 +39,57 @@ export interface IDirectoryListFilesAndDirectoriesSegmentOptions { * greater than 5,000, the server will return up to 5,000 items. * * @type {number} - * @memberof IDirectoryListFilesAndDirectoriesSegmentOptions + * @memberof DirectoryListFilesAndDirectoriesSegmentOptions */ maxresults?: number; } +export interface DirectoryDeleteOptions { + abortSignal?: Aborter; +} + +export interface DirectoryGetPropertiesOptions { + abortSignal?: Aborter; +} + +export interface DirectorySetMetadataOptions { + abortSignal?: Aborter; +} + /** - * A DirectoryURL represents a URL to the Azure Storage directory allowing you to manipulate its files and directories. + * A DirectoryClient represents a URL to the Azure Storage directory allowing you to manipulate its files and directories. * * @export - * @class DirectoryURL - * @extends {StorageURL} + * @class DirectoryClient + * @extends {StorageClient} */ -export class DirectoryURL extends StorageURL { +export class DirectoryClient extends StorageClient { /** - * Creates a DirectoryURL object from ShareURL. + * Creates a DirectoryClient object from ShareClient. * - * @param shareURL A ShareURL object + * @param shareClient A ShareClient object * @param directoryName A directory name */ - public static fromShareURL( - shareURL: ShareURL, - directoryName: string - ): DirectoryURL { - return new DirectoryURL( - appendToURLPath(shareURL.url, encodeURIComponent(directoryName)), - shareURL.pipeline + public static fromShareClient(shareClient: ShareClient, directoryName: string): DirectoryClient { + return new DirectoryClient( + appendToURLPath(shareClient.url, encodeURIComponent(directoryName)), + shareClient.pipeline ); } /** - * Creates a DirectoryURL object from an existing DirectoryURL. + * Creates a DirectoryClient object from an existing DirectoryClient. * - * @param directoryURL A DirectoryURL object + * @param directoryClient A DirectoryClient object * @param directoryName A subdirectory name */ - public static fromDirectoryURL( - directoryURL: DirectoryURL, + public static fromDirectoryClient( + directoryClient: DirectoryClient, directoryName: string - ): DirectoryURL { - return new DirectoryURL( - appendToURLPath(directoryURL.url, encodeURIComponent(directoryName)), - directoryURL.pipeline + ): DirectoryClient { + return new DirectoryClient( + appendToURLPath(directoryClient.url, encodeURIComponent(directoryName)), + directoryClient.pipeline ); } @@ -87,12 +98,12 @@ export class DirectoryURL extends StorageURL { * * @private * @type {Directory} - * @memberof DirectoryURL + * @memberof DirectoryClient */ private context: Directory; /** - * Creates an instance of DirectoryURL. + * Creates an instance of DirectoryClient. * * @param {string} url A URL string pointing to Azure Storage file directory, such as * "https://myaccount.file.core.windows.net/myshare/mydirectory". You can @@ -102,9 +113,9 @@ export class DirectoryURL extends StorageURL { * Encoded URL string will NOT be escaped twice, only special characters in URL path will be escaped. * However, if a directory name includes %, directory name must be encoded in the URL. * Such as a directory named "mydir%", the URL should be "https://myaccount.file.core.windows.net/myshare/mydir%25". - * @param {Pipeline} pipeline Call StorageURL.newPipeline() to create a default + * @param {Pipeline} pipeline Call StorageClient.newPipeline() to create a default * pipeline, or provide a customized pipeline. - * @memberof DirectoryURL + * @memberof DirectoryClient */ constructor(url: string, pipeline: Pipeline) { super(url, pipeline); @@ -112,31 +123,29 @@ export class DirectoryURL extends StorageURL { } /** - * Creates a new DirectoryURL object identical to the source but with the + * Creates a new DirectoryClient object identical to the source but with the * specified request policy pipeline. * * @param {Pipeline} pipeline - * @returns {DirectoryURL} - * @memberof DirectoryURL + * @returns {DirectoryClient} + * @memberof DirectoryClient */ - public withPipeline(pipeline: Pipeline): DirectoryURL { - return new DirectoryURL(this.url, pipeline); + public withPipeline(pipeline: Pipeline): DirectoryClient { + return new DirectoryClient(this.url, pipeline); } /** * Creates a new directory under the specified share or parent directory. * @see https://docs.microsoft.com/en-us/rest/api/storageservices/create-directory * - * @param {Aborter} aborter Create a new Aborter instance with Aborter.none or Aborter.timeout(), - * goto documents of Aborter for more examples about request cancellation - * @param {IDirectoryCreateOptions} [options] + * @param {DirectoryCreateOptions} [options] * @returns {Promise} - * @memberof DirectoryURL + * @memberof DirectoryClient */ public async create( - aborter: Aborter, - options: IDirectoryCreateOptions = {} + options: DirectoryCreateOptions = {} ): Promise { + const aborter = options.abortSignal || Aborter.none; return this.context.create({ ...options, abortSignal: aborter @@ -149,14 +158,13 @@ export class DirectoryURL extends StorageURL { * subdirectories. * @see https://docs.microsoft.com/en-us/rest/api/storageservices/get-directory-properties * - * @param {Aborter} aborter Create a new Aborter instance with Aborter.none or Aborter.timeout(), - * goto documents of Aborter for more examples about request cancellation * @returns {Promise} - * @memberof DirectoryURL + * @memberof DirectoryClient */ public async getProperties( - aborter: Aborter + options: DirectoryGetPropertiesOptions = {} ): Promise { + const aborter = options.abortSignal || Aborter.none; return this.context.getProperties({ abortSignal: aborter }); @@ -167,14 +175,13 @@ export class DirectoryURL extends StorageURL { * deleted. * @see https://docs.microsoft.com/en-us/rest/api/storageservices/delete-directory * - * @param {Aborter} aborter Create a new Aborter instance with Aborter.none or Aborter.timeout(), - * goto documents of Aborter for more examples about request cancellation * @returns {Promise} - * @memberof DirectoryURL + * @memberof DirectoryClient */ public async delete( - aborter: Aborter + options: DirectoryDeleteOptions = {} ): Promise { + const aborter = options.abortSignal || Aborter.none; return this.context.deleteMethod({ abortSignal: aborter }); @@ -184,16 +191,15 @@ export class DirectoryURL extends StorageURL { * Updates user defined metadata for the specified directory. * @see https://docs.microsoft.com/en-us/rest/api/storageservices/set-directory-metadata * - * @param {Aborter} aborter Create a new Aborter instance with Aborter.none or Aborter.timeout(), - * goto documents of Aborter for more examples about request cancellation - * @param {IMetadata} [metadata] If no metadata provided, all existing directory metadata will be removed + * @param {Metadata} [metadata] If no metadata provided, all existing directory metadata will be removed * @returns {Promise} - * @memberof DirectoryURL + * @memberof DirectoryClient */ public async setMetadata( - aborter: Aborter, - metadata?: IMetadata + metadata?: Metadata, + options: DirectorySetMetadataOptions = {} ): Promise { + const aborter = options.abortSignal || Aborter.none; return this.context.setMetadata({ abortSignal: aborter, metadata @@ -205,18 +211,16 @@ export class DirectoryURL extends StorageURL { * contents only for a single level of the directory hierarchy. * @see https://docs.microsoft.com/en-us/rest/api/storageservices/list-directories-and-files * - * @param {Aborter} aborter Create a new Aborter instance with Aborter.none or Aborter.timeout(), - * goto documents of Aborter for more examples about request cancellation * @param {string} [marker] - * @param {IDirectoryListFilesAndDirectoriesSegmentOptions} [options] + * @param {DirectoryListFilesAndDirectoriesSegmentOptions} [options] * @returns {Promise} - * @memberof DirectoryURL + * @memberof DirectoryClient */ public async listFilesAndDirectoriesSegment( - aborter: Aborter, marker?: string, - options: IDirectoryListFilesAndDirectoriesSegmentOptions = {} + options: DirectoryListFilesAndDirectoriesSegmentOptions = {} ): Promise { + const aborter = options.abortSignal || Aborter.none; return this.context.listFilesAndDirectoriesSegment({ abortSignal: aborter, marker, diff --git a/sdk/storage/storage-file/src/FileURL.ts b/sdk/storage/storage-file/src/FileClient.ts similarity index 70% rename from sdk/storage/storage-file/src/FileURL.ts rename to sdk/storage/storage-file/src/FileClient.ts index 547557342552..3debfe81fbe2 100644 --- a/sdk/storage/storage-file/src/FileURL.ts +++ b/sdk/storage/storage-file/src/FileClient.ts @@ -1,21 +1,16 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -import { - HttpRequestBody, - HttpResponse, - isNode, - TransferProgressEvent -} from "@azure/ms-rest-js"; +import { HttpRequestBody, HttpResponse, isNode, TransferProgressEvent } from "@azure/ms-rest-js"; import { Aborter } from "./Aborter"; -import { DirectoryURL } from "./DirectoryURL"; +import { DirectoryClient } from "./DirectoryClient"; import { FileDownloadResponse } from "./FileDownloadResponse"; import * as Models from "./generated/lib/models"; import { File } from "./generated/lib/operations"; -import { IRange, rangeToString } from "./IRange"; -import { IFileHTTPHeaders, IMetadata } from "./models"; +import { Range, rangeToString } from "./Range"; +import { FileHTTPHeaders, Metadata } from "./models"; import { Pipeline } from "./Pipeline"; -import { StorageURL } from "./StorageURL"; +import { StorageClient } from "./StorageClient"; import { DEFAULT_MAX_DOWNLOAD_RETRY_REQUESTS, FILE_MAX_SIZE_BYTES, @@ -23,26 +18,32 @@ import { } from "./utils/constants"; import { appendToURLPath } from "./utils/utils.common"; -export interface IFileCreateOptions { +export interface FileCreateOptions { + abortSignal?: Aborter; /** * File HTTP headers like Content-Type. * - * @type {IFileHTTPHeaders} - * @memberof IFileCreateOptions + * @type {FileHTTPHeaders} + * @memberof FileCreateOptions */ - fileHTTPHeaders?: IFileHTTPHeaders; + fileHTTPHeaders?: FileHTTPHeaders; /** * A name-value pair * to associate with a file storage object. * - * @type {IMetadata} - * @memberof IFileCreateOptions + * @type {Metadata} + * @memberof FileCreateOptions */ - metadata?: IMetadata; + metadata?: Metadata; +} + +export interface FileDeleteOptions { + abortSignal?: Aborter; } -export interface IFileDownloadOptions { +export interface FileDownloadOptions { + abortSignal?: Aborter; /** * Optional. ONLY AVAILABLE IN NODE.JS. * @@ -50,13 +51,13 @@ export interface IFileDownloadOptions { * Above kind of ends will not trigger retry policy defined in a pipeline, * because they doesn't emit network errors. * - * With this option, every additional retry means an additional FileURL.download() request will be made + * With this option, every additional retry means an additional FileClient.download() request will be made * from the broken point, until the requested range has been successfully downloaded or maxRetryRequests is reached. * * Default value is 5, please set a larger value when loading large files in poor network. * * @type {number} - * @memberof IFileDownloadOptions + * @memberof FileDownloadOptions */ maxRetryRequests?: number; @@ -66,19 +67,20 @@ export interface IFileDownloadOptions { * for the range, as long as the range is less than or equal to 4 MB in size. * * @type {boolean} - * @memberof IFileDownloadOptions + * @memberof FileDownloadOptions */ rangeGetContentMD5?: boolean; /** * Download progress updating event handler. * - * @memberof IFileDownloadOptions + * @memberof FileDownloadOptions */ progress?: (progress: TransferProgressEvent) => void; } -export interface IFileUploadRangeOptions { +export interface FileUploadRangeOptions { + abortSignal?: Aborter; /** * An MD5 hash of the content. This hash is * used to verify the integrity of the data during transport. When the @@ -88,26 +90,31 @@ export interface IFileUploadRangeOptions { * Request). * * @type {Uint8Array} - * @memberof IFileUploadRangeOptions + * @memberof FileUploadRangeOptions */ contentMD5?: Uint8Array; /** * Progress updating event handler. * - * @memberof IFileUploadRangeOptions + * @memberof FileUploadRangeOptions */ progress?: (progress: TransferProgressEvent) => void; } -export interface IFileGetRangeListOptions { +export interface FileGetRangeListOptions { + abortSignal?: Aborter; /** * Optional. Specifies the range of bytes over which to list ranges, inclusively. * - * @type {IRange} - * @memberof IFileGetRangeListOptions + * @type {Range} + * @memberof FileGetRangeListOptions */ - range?: IRange; + range?: Range; +} + +export interface FileGetPropertiesOptions { + abortSignal?: Aborter; } /** @@ -140,38 +147,59 @@ export type FileGetRangeListResponse = Models.FileGetRangeListHeaders & { }; }; -export interface IFileStartCopyOptions { +export interface FileStartCopyOptions { + abortSignal?: Aborter; /** * A name-value pair * to associate with a file storage object. * - * @type {IMetadata} - * @memberof IFileCreateOptions + * @type {Metadata} + * @memberof FileCreateOptions */ - metadata?: IMetadata; + metadata?: Metadata; +} + +export interface FileSetMetadataOptions { + abortSignal?: Aborter; +} + +export interface FileHTTPHeadersOptions { + abortSignal?: Aborter; +} + +export interface FileAbortCopyFromURLOptions { + abortSignal?: Aborter; +} + +export interface FileResizeOptions { + abortSignal?: Aborter; +} + +export interface FileClearRangeOptions { + abortSignal?: Aborter; } /** - * A FileURL represents a URL to an Azure Storage file. + * A FileClient represents a URL to an Azure Storage file. * * @export - * @class FileURL - * @extends {StorageURL} + * @class FileClient + * @extends {StorageClient} */ -export class FileURL extends StorageURL { +export class FileClient extends StorageClient { /** - * Creates a FileURL object from a DirectoryURL object. + * Creates a FileClient object from a DirectoryClient object. * * @static - * @param {DirectoryURL} directoryURL A DirectoryURL object + * @param {DirectoryClient} directoryClient A DirectoryClient object * @param {string} fileName A file name * @returns - * @memberof FileURL + * @memberof FileClient */ - public static fromDirectoryURL(directoryURL: DirectoryURL, fileName: string) { - return new FileURL( - appendToURLPath(directoryURL.url, encodeURIComponent(fileName)), - directoryURL.pipeline + public static fromDirectoryClient(directoryClient: DirectoryClient, fileName: string) { + return new FileClient( + appendToURLPath(directoryClient.url, encodeURIComponent(fileName)), + directoryClient.pipeline ); } @@ -180,12 +208,12 @@ export class FileURL extends StorageURL { * * @private * @type {File} - * @memberof FileURL + * @memberof FileClient */ private context: File; /** - * Creates an instance of FileURL. + * Creates an instance of FileClient. * * @param {string} url A URL string pointing to Azure Storage file, such as * "https://myaccount.file.core.windows.net/myshare/mydirectory/file". You can @@ -195,9 +223,9 @@ export class FileURL extends StorageURL { * Encoded URL string will NOT be escaped twice, only special characters in URL path will be escaped. * However, if a file or directory name includes %, file or directory name must be encoded in the URL. * Such as a file named "myfile%", the URL should be "https://myaccount.file.core.windows.net/myshare/mydirectory/myfile%25". - * @param {Pipeline} pipeline Call StorageURL.newPipeline() to create a default + * @param {Pipeline} pipeline Call StorageClient.newPipeline() to create a default * pipeline, or provide a customized pipeline. - * @memberof FileURL + * @memberof FileClient */ constructor(url: string, pipeline: Pipeline) { super(url, pipeline); @@ -205,33 +233,31 @@ export class FileURL extends StorageURL { } /** - * Creates a new FileURL object identical to the source but with the + * Creates a new FileClient object identical to the source but with the * specified request policy pipeline. * * @param {Pipeline} pipeline - * @returns {FileURL} - * @memberof FileURL + * @returns {FileClient} + * @memberof FileClient */ - public withPipeline(pipeline: Pipeline): FileURL { - return new FileURL(this.url, pipeline); + public withPipeline(pipeline: Pipeline): FileClient { + return new FileClient(this.url, pipeline); } /** * Creates a new file or replaces a file. Note it only initializes the file with no content. * @see https://docs.microsoft.com/en-us/rest/api/storageservices/create-file * - * @param {Aborter} aborter Create a new Aborter instance with Aborter.none or Aborter.timeout(), - * goto documents of Aborter for more examples about request cancellation * @param {number} size Specifies the maximum size in bytes for the file, up to 1 TB. - * @param {IFileCreateOptions} [options] + * @param {FileCreateOptions} [options] * @returns {Promise} - * @memberof FileURL + * @memberof FileClient */ public async create( - aborter: Aborter, size: number, - options: IFileCreateOptions = {} + options: FileCreateOptions = {} ): Promise { + const aborter = options.abortSignal || Aborter.none; if (size < 0 || size > FILE_MAX_SIZE_BYTES) { throw new RangeError(`File size must >= 0 and < ${FILE_MAX_SIZE_BYTES}.`); } @@ -252,24 +278,20 @@ export class FileURL extends StorageURL { * * @see https://docs.microsoft.com/en-us/rest/api/storageservices/get-file * - * @param {Aborter} aborter Create a new Aborter instance with Aborter.none or Aborter.timeout(), - * goto documents of Aborter for more examples about request cancellation * @param {number} offset From which position of the file to download, >= 0 * @param {number} [count] How much data to be downloaded, > 0. Will download to the end when undefined - * @param {IFileDownloadOptions} [options] + * @param {FileDownloadOptions} [options] * @returns {Promise} - * @memberof FileURL + * @memberof FileClient */ public async download( - aborter: Aborter, offset: number, count?: number, - options: IFileDownloadOptions = {} + options: FileDownloadOptions = {} ): Promise { + const aborter = options.abortSignal || Aborter.none; if (options.rangeGetContentMD5 && offset === 0 && count === undefined) { - throw new RangeError( - `rangeGetContentMD5 only works with partial data downloading` - ); + throw new RangeError(`rangeGetContentMD5 only works with partial data downloading`); } const downloadFullFile = offset === 0 && !count; @@ -290,22 +312,16 @@ export class FileURL extends StorageURL { // bundlers may try to bundle following code and "FileReadResponse.ts". // In this case, "FileDownloadResponse.browser.ts" will be used as a shim of "FileDownloadResponse.ts" // The config is in package.json "browser" field - if ( - options.maxRetryRequests === undefined || - options.maxRetryRequests < 0 - ) { + if (options.maxRetryRequests === undefined || options.maxRetryRequests < 0) { // TODO: Default value or make it a required parameter? options.maxRetryRequests = DEFAULT_MAX_DOWNLOAD_RETRY_REQUESTS; } if (res.contentLength === undefined) { - throw new RangeError( - `File download response doesn't contain valid content length header` - ); + throw new RangeError(`File download response doesn't contain valid content length header`); } return new FileDownloadResponse( - aborter, res, async (start: number): Promise => { const updatedOptions: Models.FileDownloadOptionalParams = { @@ -330,6 +346,7 @@ export class FileURL extends StorageURL { offset, res.contentLength!, { + abortSignal: aborter, maxRetryRequests: options.maxRetryRequests, progress: options.progress } @@ -341,14 +358,13 @@ export class FileURL extends StorageURL { * for the file. It does not return the content of the file. * @see https://docs.microsoft.com/en-us/rest/api/storageservices/get-file-properties * - * @param {Aborter} aborter Create a new Aborter instance with Aborter.none or Aborter.timeout(), - * goto documents of Aborter for more examples about request cancellation * @returns {Promise} - * @memberof FileURL + * @memberof FileClient */ public async getProperties( - aborter: Aborter + options: FileGetPropertiesOptions = {} ): Promise { + const aborter = options.abortSignal || Aborter.none; return this.context.getProperties({ abortSignal: aborter }); @@ -368,12 +384,11 @@ export class FileURL extends StorageURL { * * @see https://docs.microsoft.com/en-us/rest/api/storageservices/delete-file2 * - * @param {Aborter} aborter Create a new Aborter instance with Aborter.none or Aborter.timeout(), - * goto documents of Aborter for more examples about request cancellation * @returns {Promise} - * @memberof FileURL + * @memberof FileClient */ - public async delete(aborter: Aborter): Promise { + public async delete(options: FileDeleteOptions = {}): Promise { + const aborter = options.abortSignal || Aborter.none; return this.context.deleteMethod({ abortSignal: aborter }); @@ -386,17 +401,16 @@ export class FileURL extends StorageURL { * these file HTTP headers without a value will be cleared. * @see https://docs.microsoft.com/en-us/rest/api/storageservices/set-file-properties * - * @param {Aborter} aborter Create a new Aborter instance with Aborter.none or Aborter.timeout(), - * goto documents of Aborter for more examples about request cancellation - * @param {fileHTTPHeaders} [IFileHTTPHeaders] File HTTP headers like Content-Type. + * @param {fileHTTPHeaders} [FileHTTPHeaders] File HTTP headers like Content-Type. * Provide undefined will remove existing HTTP headers. * @returns {Promise} - * @memberof FileURL + * @memberof FileClient */ public async setHTTPHeaders( - aborter: Aborter, - fileHTTPHeaders: IFileHTTPHeaders = {} + fileHTTPHeaders: FileHTTPHeaders = {}, + options: FileHTTPHeadersOptions = {} ): Promise { + const aborter = options.abortSignal || Aborter.none; return this.context.setHTTPHeaders({ abortSignal: aborter, ...fileHTTPHeaders @@ -408,18 +422,17 @@ export class FileURL extends StorageURL { * * @see https://docs.microsoft.com/en-us/rest/api/storageservices/set-file-properties * - * @param {Aborter} aborter Create a new Aborter instance with Aborter.none or Aborter.timeout(), - * goto documents of Aborter for more examples about request cancellation * @param {number} length Resizes a file to the specified size in bytes. * If the specified byte value is less than the current size of the file, * then all ranges above the specified byte value are cleared. * @returns {Promise} - * @memberof FileURL + * @memberof FileClient */ public async resize( - aborter: Aborter, - length: number + length: number, + options: FileResizeOptions = {} ): Promise { + const aborter = options.abortSignal || Aborter.none; if (length < 0) { throw new RangeError(`Size cannot less than 0 when resizing file.`); } @@ -436,16 +449,15 @@ export class FileURL extends StorageURL { * metadata will be removed. * @see https://docs.microsoft.com/en-us/rest/api/storageservices/set-file-metadata * - * @param {Aborter} aborter Create a new Aborter instance with Aborter.none or Aborter.timeout(), - * goto documents of Aborter for more examples about request cancellation - * @param {IMetadata} [metadata] If no metadata provided, all existing directory metadata will be removed + * @param {Metadata} [metadata] If no metadata provided, all existing directory metadata will be removed * @returns {Promise} - * @memberof FileURL + * @memberof FileClient */ public async setMetadata( - aborter: Aborter, - metadata: IMetadata = {} + metadata: Metadata = {}, + options: FileSetMetadataOptions = {} ): Promise { + const aborter = options.abortSignal || Aborter.none; return this.context.setMetadata({ abortSignal: aborter, metadata @@ -456,32 +468,28 @@ export class FileURL extends StorageURL { * Upload a range of bytes to a file. Both the start and count of the * range must be specified. The range can be up to 4 MB in size. * - * @param {Aborter} aborter Create a new Aborter instance with Aborter.none or Aborter.timeout(), - * goto documents of Aborter for more examples about request cancellation * @param {HttpRequestBody} body Blob, string, ArrayBuffer, ArrayBufferView or a function * which returns a new Readable stream whose offset is from data source beginning. * @param {number} offset Offset position of the destination Azure File to upload. * @param {number} contentLength Length of body in bytes. Use Buffer.byteLength() to calculate body length for a * string including non non-Base64/Hex-encoded characters. - * @param {IFileUploadRangeOptions} [options] + * @param {FileUploadRangeOptions} [options] * @returns {Promise} - * @memberof FileURL + * @memberof FileClient */ public async uploadRange( - aborter: Aborter, body: HttpRequestBody, offset: number, contentLength: number, - options: IFileUploadRangeOptions = {} + options: FileUploadRangeOptions = {} ): Promise { + const aborter = options.abortSignal || Aborter.none; if (offset < 0 || contentLength <= 0) { throw new RangeError(`offset must >= 0 and contentLength must be > 0`); } if (contentLength > FILE_RANGE_MAX_SIZE_BYTES) { - throw new RangeError( - `offset must be < ${FILE_RANGE_MAX_SIZE_BYTES} bytes` - ); + throw new RangeError(`offset must be < ${FILE_RANGE_MAX_SIZE_BYTES} bytes`); } return this.context.uploadRange( @@ -501,45 +509,37 @@ export class FileURL extends StorageURL { * Clears the specified range and * releases the space used in storage for that range. * - * @param {Aborter} aborter Create a new Aborter instance with Aborter.none or Aborter.timeout(), - * goto documents of Aborter for more examples about request cancellation * @param {number} offset * @param {number} contentLength * @returns {Promise} - * @memberof FileURL + * @memberof FileClient */ public async clearRange( - aborter: Aborter, offset: number, - contentLength: number + contentLength: number, + options: FileClearRangeOptions = {} ): Promise { + const aborter = options.abortSignal || Aborter.none; if (offset < 0 || contentLength <= 0) { throw new RangeError(`offset must >= 0 and contentLength must be > 0`); } - return this.context.uploadRange( - rangeToString({ count: contentLength, offset }), - "clear", - 0, - { - abortSignal: aborter - } - ); + return this.context.uploadRange(rangeToString({ count: contentLength, offset }), "clear", 0, { + abortSignal: aborter + }); } /** * Returns the list of valid ranges for a file. * - * @param {Aborter} aborter Create a new Aborter instance with Aborter.none or Aborter.timeout(), - * goto documents of Aborter for more examples about request cancellation - * @param {IFileGetRangeListOptions} [options] + * @param {FileGetRangeListOptions} [options] * @returns {Promise} - * @memberof FileURL + * @memberof FileClient */ public async getRangeList( - aborter: Aborter, - options: IFileGetRangeListOptions = {} + options: FileGetRangeListOptions = {} ): Promise { + const aborter = options.abortSignal || Aborter.none; const originalResponse = await this.context.getRangeList({ abortSignal: aborter, range: options.range ? rangeToString(options.range) : undefined @@ -562,8 +562,6 @@ export class FileURL extends StorageURL { /** * Copies a blob or file to a destination file within the storage account. * - * @param {Aborter} aborter Create a new Aborter instance with Aborter.none or Aborter.timeout(), - * goto documents of Aborter for more examples about request cancellation * @param {string} copySource Specifies the URL of the source file or blob, up to 2 KB in length. * To copy a file to another file within the same storage account, you may use Shared Key to * authenticate the source file. If you are copying a file from another storage account, or if you @@ -571,15 +569,15 @@ export class FileURL extends StorageURL { * authenticate the source file or blob using a shared access signature. If the source is a public * blob, no authentication is required to perform the copy operation. A file in a share snapshot * can also be specified as a copy source. - * @param {IFileStartCopyOptions} [options] + * @param {FileStartCopyOptions} [options] * @returns {Promise} - * @memberof FileURL + * @memberof FileClient */ public async startCopyFromURL( - aborter: Aborter, copySource: string, - options: IFileStartCopyOptions = {} + options: FileStartCopyOptions = {} ): Promise { + const aborter = options.abortSignal || Aborter.none; return this.context.startCopy(copySource, { abortSignal: aborter, metadata: options.metadata @@ -591,16 +589,15 @@ export class FileURL extends StorageURL { * metadata. * @see https://docs.microsoft.com/en-us/rest/api/storageservices/abort-copy-file * - * @param {Aborter} aborter Create a new Aborter instance with Aborter.none or Aborter.timeout(), - * goto documents of Aborter for more examples about request cancellation * @param {string} copyId * @returns {Promise} - * @memberof FileURL + * @memberof FileClient */ public async abortCopyFromURL( - aborter: Aborter, - copyId: string + copyId: string, + options: FileAbortCopyFromURLOptions = {} ): Promise { + const aborter = options.abortSignal || Aborter.none; return this.context.abortCopy(copyId, { abortSignal: aborter }); diff --git a/sdk/storage/storage-file/src/FileDownloadResponse.ts b/sdk/storage/storage-file/src/FileDownloadResponse.ts index c23883352a28..f57aece3b7fe 100644 --- a/sdk/storage/storage-file/src/FileDownloadResponse.ts +++ b/sdk/storage/storage-file/src/FileDownloadResponse.ts @@ -2,14 +2,12 @@ // Licensed under the MIT License. import { HttpResponse, isNode } from "@azure/ms-rest-js"; - -import { Aborter } from "./Aborter"; import * as Models from "./generated/lib/models"; -import { IMetadata } from "./models"; +import { Metadata } from "./models"; import { ReadableStreamGetter, RetriableReadableStream, - IRetriableReadableStreamOptions + RetriableReadableStreamOptions } from "./utils/RetriableReadableStream"; /** @@ -297,10 +295,10 @@ export class FileDownloadResponse implements Models.FileDownloadResponse { * to associate with a file storage object. * * @readonly - * @type {(IMetadata | undefined)} + * @type {(Metadata | undefined)} * @memberof FileDownloadResponse */ - public get metadata(): IMetadata | undefined { + public get metadata(): Metadata | undefined { return this.originalResponse.metadata; } @@ -366,25 +364,22 @@ export class FileDownloadResponse implements Models.FileDownloadResponse { /** * Creates an instance of FileDownloadResponse. * - * @param {Aborter} aborter * @param {Models.FileDownloadResponse} originalResponse * @param {ReadableStreamGetter} getter * @param {number} offset * @param {number} count - * @param {IRetriableReadableStreamOptions} [options={}] + * @param {RetriableReadableStreamOptions} [options={}] * @memberof FileDownloadResponse */ public constructor( - aborter: Aborter, originalResponse: Models.FileDownloadResponse, getter: ReadableStreamGetter, offset: number, count: number, - options: IRetriableReadableStreamOptions = {} + options: RetriableReadableStreamOptions = {} ) { this.originalResponse = originalResponse; this.fileDownloadStream = new RetriableReadableStream( - aborter, this.originalResponse.readableStreamBody!, getter, offset, diff --git a/sdk/storage/storage-file/src/FileSASPermissions.ts b/sdk/storage/storage-file/src/FileSASPermissions.ts index 6f64f1eee813..846903a9cbcd 100644 --- a/sdk/storage/storage-file/src/FileSASPermissions.ts +++ b/sdk/storage/storage-file/src/FileSASPermissions.ts @@ -7,7 +7,7 @@ * This is a helper class to construct a string representing the permissions granted by a ServiceSAS to a file. Setting * a value to true means that any SAS which uses these permissions will grant permissions for that operation. Once all * the values are set, this should be serialized with toString and set as the permissions field on a - * {@link IFileSASSignatureValues} object. It is possible to construct the permissions string without this class, but + * {@link FileSASSignatureValues} object. It is possible to construct the permissions string without this class, but * the order of the permissions is particular and this class guarantees correctness. * * @export diff --git a/sdk/storage/storage-file/src/IFileSASSignatureValues.ts b/sdk/storage/storage-file/src/FileSASSignatureValues.ts similarity index 80% rename from sdk/storage/storage-file/src/IFileSASSignatureValues.ts rename to sdk/storage/storage-file/src/FileSASSignatureValues.ts index 1d905550c8ca..8d89bccc8af8 100644 --- a/sdk/storage/storage-file/src/IFileSASSignatureValues.ts +++ b/sdk/storage/storage-file/src/FileSASSignatureValues.ts @@ -3,7 +3,7 @@ import { SharedKeyCredential } from "./credentials/SharedKeyCredential"; import { FileSASPermissions } from "./FileSASPermissions"; -import { IIPRange, ipRangeToString } from "./IIPRange"; +import { IPRange, ipRangeToString } from "./IPRange"; import { SASProtocol, SASQueryParameters } from "./SASQueryParameters"; import { ShareSASPermissions } from "./ShareSASPermissions"; import { SERVICE_VERSION } from "./utils/constants"; @@ -12,19 +12,19 @@ import { truncatedISO8061Date } from "./utils/utils.common"; /** * ONLY AVAILABLE IN NODE.JS RUNTIME. * - * IFileSASSignatureValues is used to help generating File service SAS tokens for shares or files. + * FileSASSignatureValues is used to help generating File service SAS tokens for shares or files. * * @export - * @class IFileSASSignatureValues + * @class FileSASSignatureValues */ -export interface IFileSASSignatureValues { +export interface FileSASSignatureValues { /** * The version of the service this SAS will target. If not specified, it will default to the version targeted by the * library. * * @type {string} - * @memberof IFileSASSignatureValues + * @memberof FileSASSignatureValues */ version?: string; @@ -32,7 +32,7 @@ export interface IFileSASSignatureValues { * Optional. SAS protocols, HTTPS only or HTTPSandHTTP * * @type {SASProtocol} - * @memberof IFileSASSignatureValues + * @memberof FileSASSignatureValues */ protocol?: SASProtocol; @@ -40,7 +40,7 @@ export interface IFileSASSignatureValues { * Optional. When the SAS will take effect. * * @type {Date} - * @memberof IFileSASSignatureValues + * @memberof FileSASSignatureValues */ startTime?: Date; @@ -48,7 +48,7 @@ export interface IFileSASSignatureValues { * Optional only when identifier is provided. The time after which the SAS will no longer work. * * @type {Date} - * @memberof IFileSASSignatureValues + * @memberof FileSASSignatureValues */ expiryTime?: Date; @@ -58,23 +58,23 @@ export interface IFileSASSignatureValues { * being accessed for help constructing the permissions string. * * @type {string} - * @memberof IFileSASSignatureValues + * @memberof FileSASSignatureValues */ permissions?: string; /** * Optional. IP ranges allowed in this SAS. * - * @type {IIPRange} - * @memberof IFileSASSignatureValues + * @type {IPRange} + * @memberof FileSASSignatureValues */ - ipRange?: IIPRange; + ipRange?: IPRange; /** * The name of the share the SAS user may access. * * @type {string} - * @memberof IFileSASSignatureValues + * @memberof FileSASSignatureValues */ shareName: string; @@ -82,7 +82,7 @@ export interface IFileSASSignatureValues { * Optional. The path of the file like, "directory/FileName" or "FileName". * * @type {string} - * @memberof IFileSASSignatureValues + * @memberof FileSASSignatureValues */ filePath?: string; @@ -92,7 +92,7 @@ export interface IFileSASSignatureValues { * @see https://docs.microsoft.com/en-us/rest/api/storageservices/establishing-a-stored-access-policy * * @type {string} - * @memberof IFileSASSignatureValues + * @memberof FileSASSignatureValues */ identifier?: string; @@ -100,7 +100,7 @@ export interface IFileSASSignatureValues { * Optional. The cache-control header for the SAS. * * @type {string} - * @memberof IFileSASSignatureValues + * @memberof FileSASSignatureValues */ cacheControl?: string; @@ -108,7 +108,7 @@ export interface IFileSASSignatureValues { * Optional. The content-disposition header for the SAS. * * @type {string} - * @memberof IFileSASSignatureValues + * @memberof FileSASSignatureValues */ contentDisposition?: string; @@ -116,7 +116,7 @@ export interface IFileSASSignatureValues { * Optional. The content-encoding header for the SAS. * * @type {string} - * @memberof IFileSASSignatureValues + * @memberof FileSASSignatureValues */ contentEncoding?: string; @@ -124,7 +124,7 @@ export interface IFileSASSignatureValues { * Optional. The content-language header for the SAS. * * @type {string} - * @memberof IFileSASSignatureValues + * @memberof FileSASSignatureValues */ contentLanguage?: string; @@ -132,7 +132,7 @@ export interface IFileSASSignatureValues { * Optional. The content-type header for the SAS. * * @type {string} - * @memberof IFileSASSignatureValues + * @memberof FileSASSignatureValues */ contentType?: string; } @@ -150,12 +150,12 @@ export interface IFileSASSignatureValues { * this constructor. * * @export - * @param {IFileSASSignatureValues} fileSASSignatureValues + * @param {FileSASSignatureValues} fileSASSignatureValues * @param {SharedKeyCredential} sharedKeyCredential * @returns {SASQueryParameters} */ export function generateFileSASQueryParameters( - fileSASSignatureValues: IFileSASSignatureValues, + fileSASSignatureValues: FileSASSignatureValues, sharedKeyCredential: SharedKeyCredential ): SASQueryParameters { if ( @@ -167,18 +167,14 @@ export function generateFileSASQueryParameters( ); } - const version = fileSASSignatureValues.version - ? fileSASSignatureValues.version - : SERVICE_VERSION; + const version = fileSASSignatureValues.version ? fileSASSignatureValues.version : SERVICE_VERSION; let resource: string = "s"; let verifiedPermissions: string | undefined; // Calling parse and toString guarantees the proper ordering and throws on invalid characters. if (fileSASSignatureValues.permissions) { if (fileSASSignatureValues.filePath) { - verifiedPermissions = FileSASPermissions.parse( - fileSASSignatureValues.permissions - ).toString(); + verifiedPermissions = FileSASPermissions.parse(fileSASSignatureValues.permissions).toString(); resource = "f"; } else { verifiedPermissions = ShareSASPermissions.parse( @@ -202,9 +198,7 @@ export function generateFileSASQueryParameters( fileSASSignatureValues.filePath ), fileSASSignatureValues.identifier, - fileSASSignatureValues.ipRange - ? ipRangeToString(fileSASSignatureValues.ipRange) - : "", + fileSASSignatureValues.ipRange ? ipRangeToString(fileSASSignatureValues.ipRange) : "", fileSASSignatureValues.protocol, version, fileSASSignatureValues.cacheControl, @@ -236,11 +230,7 @@ export function generateFileSASQueryParameters( ); } -function getCanonicalName( - accountName: string, - shareName: string, - filePath?: string -): string { +function getCanonicalName(accountName: string, shareName: string, filePath?: string): string { // Share: "/file/account/sharename" // File: "/file/account/sharename/filename" // File: "/file/account/sharename/directoryname/filename" diff --git a/sdk/storage/storage-file/src/ServiceURL.ts b/sdk/storage/storage-file/src/FileServiceClient.ts similarity index 67% rename from sdk/storage/storage-file/src/ServiceURL.ts rename to sdk/storage/storage-file/src/FileServiceClient.ts index 3860779ba395..94ee5fb738f0 100644 --- a/sdk/storage/storage-file/src/ServiceURL.ts +++ b/sdk/storage/storage-file/src/FileServiceClient.ts @@ -1,19 +1,20 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -import * as Models from "../src/generated/lib/models"; +import * as Models from "./generated/lib/models"; import { Aborter } from "./Aborter"; import { Service } from "./generated/lib/operations"; import { Pipeline } from "./Pipeline"; -import { StorageURL } from "./StorageURL"; +import { StorageClient } from "./StorageClient"; -export interface IServiceListSharesSegmentOptions { +export interface ServiceListSharesSegmentOptions { + abortSignal?: Aborter; /** * Filters the results to return only entries whose * name begins with the specified prefix. * * @type {string} - * @memberof IServiceListSharesSegmentOptions + * @memberof ServiceListSharesSegmentOptions */ prefix?: string; @@ -23,7 +24,7 @@ export interface IServiceListSharesSegmentOptions { * greater than 5,000, the server will return up to 5,000 items. * * @type {number} - * @memberof IServiceListSharesSegmentOptions + * @memberof ServiceListSharesSegmentOptions */ maxresults?: number; @@ -32,38 +33,46 @@ export interface IServiceListSharesSegmentOptions { * specify one or more datasets to include in the response. * * @type {Models.ListSharesIncludeType[]} - * @memberof IServiceListSharesSegmentOptions + * @memberof ServiceListSharesSegmentOptions */ include?: Models.ListSharesIncludeType[]; } +export interface IServiceGetPropertiesOptions { + abortSignal?: Aborter; +} + +export interface IServiceSetPropertiesOptions { + abortSignal?: Aborter; +} + /** - * A ServiceURL represents a URL to the Azure Storage File service allowing you + * A FileServiceClient represents a URL to the Azure Storage File service allowing you * to manipulate file shares. * * @export - * @class ServiceURL - * @extends {StorageURL} + * @class FileServiceClient + * @extends {StorageClient} */ -export class ServiceURL extends StorageURL { +export class FileServiceClient extends StorageClient { /** * serviceContext provided by protocol layer. * * @private * @type {Service} - * @memberof ServiceURL + * @memberof FileServiceClient */ private serviceContext: Service; /** - * Creates an instance of ServiceURL. + * Creates an instance of FileServiceClient. * * @param {string} url A URL string pointing to Azure Storage file service, such as * "https://myaccount.file.core.windows.net". You can Append a SAS * if using AnonymousCredential, such as "https://myaccount.file.core.windows.net?sasString". - * @param {Pipeline} pipeline Call StorageURL.newPipeline() to create a default + * @param {Pipeline} pipeline Call StorageClient.newPipeline() to create a default * pipeline, or provide a customized pipeline. - * @memberof ServiceURL + * @memberof FileServiceClient */ constructor(url: string, pipeline: Pipeline) { super(url, pipeline); @@ -71,15 +80,15 @@ export class ServiceURL extends StorageURL { } /** - * Creates a new ServiceURL object identical to the source but with the + * Creates a new FileServiceClient object identical to the source but with the * specified request policy pipeline. * * @param {Pipeline} pipeline - * @returns {ServiceURL} - * @memberof ServiceURL + * @returns {FileServiceClient} + * @memberof FileServiceClient */ - public withPipeline(pipeline: Pipeline): ServiceURL { - return new ServiceURL(this.url, pipeline); + public withPipeline(pipeline: Pipeline): FileServiceClient { + return new FileServiceClient(this.url, pipeline); } /** @@ -87,14 +96,13 @@ export class ServiceURL extends StorageURL { * for Storage Analytics and CORS (Cross-Origin Resource Sharing) rules. * @see https://docs.microsoft.com/en-us/rest/api/storageservices/get-file-service-properties} * - * @param {Aborter} aborter Create a new Aborter instance with Aborter.none or Aborter.timeout(), - * goto documents of Aborter for more examples about request cancellation * @returns {Promise} - * @memberof ServiceURL + * @memberof FileServiceClient */ public async getProperties( - aborter: Aborter + options: IServiceGetPropertiesOptions = {} ): Promise { + const aborter = options.abortSignal || Aborter.none; return this.serviceContext.getProperties({ abortSignal: aborter }); @@ -105,16 +113,15 @@ export class ServiceURL extends StorageURL { * for Storage Analytics, CORS (Cross-Origin Resource Sharing) rules and soft delete settings. * @see https://docs.microsoft.com/en-us/rest/api/storageservices/set-file-service-properties} * - * @param {Aborter} aborter Create a new Aborter instance with Aborter.none or Aborter.timeout(), - * goto documents of Aborter for more examples about request cancellation * @param {Models.StorageServiceProperties} properties * @returns {Promise} - * @memberof ServiceURL + * @memberof FileServiceClient */ public async setProperties( - aborter: Aborter, - properties: Models.StorageServiceProperties + properties: Models.StorageServiceProperties, + options: IServiceSetPropertiesOptions = {} ): Promise { + const aborter = options.abortSignal || Aborter.none; return this.serviceContext.setProperties(properties, { abortSignal: aborter }); @@ -124,23 +131,21 @@ export class ServiceURL extends StorageURL { * Gets the properties of a storage account's File service, including properties for Storage * Analytics metrics and CORS (Cross-Origin Resource Sharing) rules. * - * @param {Aborter} aborter Create a new Aborter instance with Aborter.none or Aborter.timeout(), - * goto documents of Aborter for more examples about request cancellation * @param {string} [marker] A string value that identifies the portion of * the list to be returned with the next list operation. The operation * returns a marker value within the response body if the list returned was * not complete. The marker value may then be used in a subsequent call to * request the next set of list items. The marker value is opaque to the * client. - * @param {IServiceListSharesSegmentOptions} [options={}] + * @param {ServiceListSharesSegmentOptions} [options={}] * @returns {Promise} - * @memberof ServiceURL + * @memberof FileServiceClient */ public async listSharesSegment( - aborter: Aborter, marker?: string, - options: IServiceListSharesSegmentOptions = {} + options: ServiceListSharesSegmentOptions = {} ): Promise { + const aborter = options.abortSignal || Aborter.none; return this.serviceContext.listSharesSegment({ abortSignal: aborter, marker, diff --git a/sdk/storage/storage-blob/src/IIPRange.ts b/sdk/storage/storage-file/src/IPRange.ts similarity index 83% rename from sdk/storage/storage-blob/src/IIPRange.ts rename to sdk/storage/storage-file/src/IPRange.ts index a19e43cdb5d0..4e0b31a3a060 100644 --- a/sdk/storage/storage-blob/src/IIPRange.ts +++ b/sdk/storage/storage-file/src/IPRange.ts @@ -5,9 +5,9 @@ * Allowed IP range for a SAS. * * @export - * @interface IIPRange + * @interface IPRange */ -export interface IIPRange { +export interface IPRange { /** * Starting IP address in the IP range. * If end IP doesn't provide, start IP will the only IP allowed. @@ -32,9 +32,9 @@ export interface IIPRange { * "8.8.8.8" or "1.1.1.1-255.255.255.255" * * @export - * @param {IIPRange} ipRange + * @param {IPRange} ipRange * @returns {string} */ -export function ipRangeToString(ipRange: IIPRange): string { +export function ipRangeToString(ipRange: IPRange): string { return ipRange.end ? `${ipRange.start}-${ipRange.end}` : ipRange.start; } diff --git a/sdk/storage/storage-file/src/LoggingPolicyFactory.ts b/sdk/storage/storage-file/src/LoggingPolicyFactory.ts index 809625c208d2..2c0658385e69 100644 --- a/sdk/storage/storage-file/src/LoggingPolicyFactory.ts +++ b/sdk/storage/storage-file/src/LoggingPolicyFactory.ts @@ -1,26 +1,21 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -import { - RequestPolicy, - RequestPolicyFactory, - RequestPolicyOptions -} from "@azure/ms-rest-js"; - +import { RequestPolicy, RequestPolicyFactory, RequestPolicyOptions } from "@azure/ms-rest-js"; import { LoggingPolicy } from "./policies/LoggingPolicy"; /** * RequestLogOptions configures the retry policy's behavior. * * @export - * @interface IRequestLogOptions + * @interface RequestLogOptions */ -export interface IRequestLogOptions { +export interface RequestLogOptions { /** * LogWarningIfTryOverThreshold logs a warning if a tried operation takes longer than the specified * duration in ms. Default is 3000ms. * @type {number} - * @memberof IRequestLogOptions + * @memberof RequestLogOptions */ logWarningIfTryOverThreshold: number; } @@ -33,16 +28,13 @@ export interface IRequestLogOptions { * @implements {RequestPolicyFactory} */ export class LoggingPolicyFactory implements RequestPolicyFactory { - private readonly loggingOptions?: IRequestLogOptions; + private readonly loggingOptions?: RequestLogOptions; - constructor(loggingOptions?: IRequestLogOptions) { + constructor(loggingOptions?: RequestLogOptions) { this.loggingOptions = loggingOptions; } - public create( - nextPolicy: RequestPolicy, - options: RequestPolicyOptions - ): LoggingPolicy { + public create(nextPolicy: RequestPolicy, options: RequestPolicyOptions): LoggingPolicy { return new LoggingPolicy(nextPolicy, options, this.loggingOptions); } } diff --git a/sdk/storage/storage-file/src/Pipeline.ts b/sdk/storage/storage-file/src/Pipeline.ts index e1ac7d53fa8a..9f9e8b8ec95e 100644 --- a/sdk/storage/storage-file/src/Pipeline.ts +++ b/sdk/storage/storage-file/src/Pipeline.ts @@ -36,18 +36,18 @@ export { * Option interface for Pipeline constructor. * * @export - * @interface IPipelineOptions + * @interface PipelineOptions */ -export interface IPipelineOptions { +export interface PipelineOptions { logger?: IHttpPipelineLogger; HTTPClient?: IHttpClient; } /** * A Pipeline class containing HTTP request policies. - * You can create a default Pipeline by calling StorageURL.newPipeline(). + * You can create a default Pipeline by calling StorageClient.newPipeline(). * Or you can create a Pipeline with your own policies by the constructor of Pipeline. - * Refer to StorageURL.newPipeline() and provided policies as reference before + * Refer to StorageClient.newPipeline() and provided policies as reference before * implementing your customized Pipeline. * * @export @@ -55,19 +55,16 @@ export interface IPipelineOptions { */ export class Pipeline { public readonly factories: RequestPolicyFactory[]; - public readonly options: IPipelineOptions; + public readonly options: PipelineOptions; /** * Creates an instance of Pipeline. Customize HTTPClient by implementing IHttpClient interface. * * @param {RequestPolicyFactory[]} factories - * @param {IPipelineOptions} [options={}] + * @param {PipelineOptions} [options={}] * @memberof Pipeline */ - constructor( - factories: RequestPolicyFactory[], - options: IPipelineOptions = {} - ) { + constructor(factories: RequestPolicyFactory[], options: PipelineOptions = {}) { this.factories = factories; this.options = options; } diff --git a/sdk/storage/storage-file/src/IRange.ts b/sdk/storage/storage-file/src/Range.ts similarity index 57% rename from sdk/storage/storage-file/src/IRange.ts rename to sdk/storage/storage-file/src/Range.ts index 974748bc4adc..d8eb94968717 100644 --- a/sdk/storage/storage-file/src/IRange.ts +++ b/sdk/storage/storage-file/src/Range.ts @@ -7,14 +7,14 @@ * @see https://docs.microsoft.com/en-us/rest/api/storageservices/specifying-the-range-header-for-file-service-operations * * @export - * @interface IRange + * @interface Range */ -export interface IRange { +export interface Range { /** * StartByte, larger than or equal 0. * * @type {string} - * @memberof IRange + * @memberof Range */ offset: number; /** @@ -22,7 +22,7 @@ export interface IRange { * If not provided, will return bytes from offset to the end. * * @type {string} - * @memberof IRange + * @memberof Range */ count?: number; } @@ -33,19 +33,19 @@ export interface IRange { * "bytes=255-" or "bytes=0-511" * * @export - * @param {IRange} iRange + * @param {Range} range * @returns {string} */ -export function rangeToString(iRange: IRange): string { - if (iRange.offset < 0) { - throw new RangeError(`IRange.offset cannot be smaller than 0.`); +export function rangeToString(range: Range): string { + if (range.offset < 0) { + throw new RangeError(`Range.offset cannot be smaller than 0.`); } - if (iRange.count && iRange.count <= 0) { + if (range.count && range.count <= 0) { throw new RangeError( - `IRange.count must be larger than 0. Leave it undefined if you want a range from offset to the end.` + `Range.count must be larger than 0. Leave it undefined if you want a range from offset to the end.` ); } - return iRange.count - ? `bytes=${iRange.offset}-${iRange.offset + iRange.count - 1}` - : `bytes=${iRange.offset}-`; + return range.count + ? `bytes=${range.offset}-${range.offset + range.count - 1}` + : `bytes=${range.offset}-`; } diff --git a/sdk/storage/storage-file/src/RetryPolicyFactory.ts b/sdk/storage/storage-file/src/RetryPolicyFactory.ts index 891dd169d86b..94b960a7739f 100644 --- a/sdk/storage/storage-file/src/RetryPolicyFactory.ts +++ b/sdk/storage/storage-file/src/RetryPolicyFactory.ts @@ -1,21 +1,16 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -import { - RequestPolicy, - RequestPolicyFactory, - RequestPolicyOptions -} from "@azure/ms-rest-js"; - +import { RequestPolicy, RequestPolicyFactory, RequestPolicyOptions } from "@azure/ms-rest-js"; import { RetryPolicy, RetryPolicyType } from "./policies/RetryPolicy"; /** * Retry options interface. * * @export - * @interface IRetryOptions + * @interface RetryOptions */ -export interface IRetryOptions { +export interface RetryOptions { /** * Optional. RetryPolicyType, default is exponential retry policy. * @@ -30,7 +25,7 @@ export interface IRetryOptions { * A value smaller than 1 means default retry number of attempts. * * @type {number} - * @memberof IRetryOptions + * @memberof RetryOptions */ readonly maxTries?: number; @@ -44,7 +39,7 @@ export interface IRetryOptions { * like (60 seconds per MB of anticipated-payload-size) * * @type {number} - * @memberof IRetryOptions + * @memberof RetryOptions */ readonly tryTimeoutInMs?: number; @@ -54,7 +49,7 @@ export interface IRetryOptions { * maxRetryDelayInMs. If you specify 0, then you must also specify 0 for maxRetryDelayInMs. * * @type {number} - * @memberof IRetryOptions + * @memberof RetryOptions */ readonly retryDelayInMs?: number; @@ -63,7 +58,7 @@ export interface IRetryOptions { * If you specify 0, then you must also specify 0 for retryDelayInMs. * * @type {number} - * @memberof IRetryOptions + * @memberof RetryOptions */ readonly maxRetryDelayInMs?: number; } @@ -76,21 +71,18 @@ export interface IRetryOptions { * @implements {RequestPolicyFactory} */ export class RetryPolicyFactory implements RequestPolicyFactory { - private retryOptions?: IRetryOptions; + private retryOptions?: RetryOptions; /** * Creates an instance of RetryPolicyFactory. - * @param {IRetryOptions} [retryOptions] + * @param {RetryOptions} [retryOptions] * @memberof RetryPolicyFactory */ - constructor(retryOptions?: IRetryOptions) { + constructor(retryOptions?: RetryOptions) { this.retryOptions = retryOptions; } - public create( - nextPolicy: RequestPolicy, - options: RequestPolicyOptions - ): RetryPolicy { + public create(nextPolicy: RequestPolicy, options: RequestPolicyOptions): RetryPolicy { return new RetryPolicy(nextPolicy, options, this.retryOptions); } } diff --git a/sdk/storage/storage-file/src/SASQueryParameters.ts b/sdk/storage/storage-file/src/SASQueryParameters.ts index d8e43f3a3738..c1542289bb8e 100644 --- a/sdk/storage/storage-file/src/SASQueryParameters.ts +++ b/sdk/storage/storage-file/src/SASQueryParameters.ts @@ -1,7 +1,7 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -import { IIPRange, ipRangeToString } from "./IIPRange"; +import { IPRange, ipRangeToString } from "./IPRange"; import { truncatedISO8061Date } from "./utils/utils.common"; /** @@ -24,7 +24,7 @@ export enum SASProtocol { /** * Represents the components that make up an Azure Storage SAS' query parameters. This type is not constructed directly - * by the user; it is only generated by the {@link IAccountSASSignatureValues} and {@link IFileSASSignatureValues} + * by the user; it is only generated by the {@link AccountSASSignatureValues} and {@link FileSASSignatureValues} * types. Once generated, it can be encoded into a {@code String} and appended to a URL directly (though caution should * be taken here in case there are existing query parameters, which might affect the appropriate means of appending * these query parameters). @@ -96,7 +96,7 @@ export class SASQueryParameters { public readonly resourceTypes?: string; /** - * Optional. The signed identifier (only for {@link IFileSASSignatureValues}). + * Optional. The signed identifier (only for {@link FileSASSignatureValues}). * * @see https://docs.microsoft.com/en-us/rest/api/storageservices/establishing-a-stored-access-policy * @@ -106,7 +106,7 @@ export class SASQueryParameters { public readonly identifier?: string; /** - * Optional. The storage share or file path (only for {@link IFileSASSignatureValues}). + * Optional. The storage share or file path (only for {@link FileSASSignatureValues}). * * @type {string} * @memberof SASQueryParameters @@ -165,19 +165,19 @@ export class SASQueryParameters { * Inner value of getter ipRange. * * @private - * @type {IIPRange} + * @type {IPRange} * @memberof SASQueryParameters */ - private readonly ipRangeInner?: IIPRange; + private readonly ipRangeInner?: IPRange; /** * Optional. IP range allowed for this SAS. * * @readonly - * @type {(IIPRange | undefined)} + * @type {(IPRange | undefined)} * @memberof SASQueryParameters */ - public get ipRange(): IIPRange | undefined { + public get ipRange(): IPRange | undefined { if (this.ipRangeInner) { return { end: this.ipRangeInner.end, @@ -198,7 +198,7 @@ export class SASQueryParameters { * @param {SASProtocol} [protocol] Representing the allowed HTTP protocol(s) * @param {Date} [startTime] Representing the start time for this SAS token * @param {Date} [expiryTime] Representing the expiry time for this SAS token - * @param {IIPRange} [ipRange] Representing the range of valid IP addresses for this SAS token + * @param {IPRange} [ipRange] Representing the range of valid IP addresses for this SAS token * @param {string} [identifier] Representing the signed identifier (only for Service SAS) * @param {string} [resource] Representing the storage container or blob (only for Service SAS) * @param {string} [cacheControl] Representing the cache-control header (only for Blob/File Service SAS) @@ -217,7 +217,7 @@ export class SASQueryParameters { protocol?: SASProtocol, startTime?: Date, expiryTime?: Date, - ipRange?: IIPRange, + ipRange?: IPRange, identifier?: string, resource?: string, cacheControl?: string, @@ -289,18 +289,14 @@ export class SASQueryParameters { this.tryAppendQueryParameter( queries, param, - this.startTime - ? truncatedISO8061Date(this.startTime, false) - : undefined + this.startTime ? truncatedISO8061Date(this.startTime, false) : undefined ); break; case "se": this.tryAppendQueryParameter( queries, param, - this.expiryTime - ? truncatedISO8061Date(this.expiryTime, false) - : undefined + this.expiryTime ? truncatedISO8061Date(this.expiryTime, false) : undefined ); break; case "sip": @@ -352,11 +348,7 @@ export class SASQueryParameters { * @returns {void} * @memberof SASQueryParameters */ - private tryAppendQueryParameter( - queries: string[], - key: string, - value?: string - ): void { + private tryAppendQueryParameter(queries: string[], key: string, value?: string): void { if (!value) { return; } diff --git a/sdk/storage/storage-file/src/ShareURL.ts b/sdk/storage/storage-file/src/ShareClient.ts similarity index 65% rename from sdk/storage/storage-file/src/ShareURL.ts rename to sdk/storage/storage-file/src/ShareClient.ts index 4d1b53416579..c82496c14890 100644 --- a/sdk/storage/storage-file/src/ShareURL.ts +++ b/sdk/storage/storage-file/src/ShareClient.ts @@ -6,23 +6,20 @@ import { HttpResponse } from "@azure/ms-rest-js"; import { Aborter } from "./Aborter"; import * as Models from "./generated/lib/models"; import { Share } from "./generated/lib/operations"; -import { IMetadata } from "./models"; +import { Metadata } from "./models"; import { Pipeline } from "./Pipeline"; -import { ServiceURL } from "./ServiceURL"; -import { StorageURL } from "./StorageURL"; +import { FileServiceClient } from "./FileServiceClient"; +import { StorageClient } from "./StorageClient"; import { URLConstants } from "./utils/constants"; -import { - appendToURLPath, - setURLParameter, - truncatedISO8061Date -} from "./utils/utils.common"; +import { appendToURLPath, setURLParameter, truncatedISO8061Date } from "./utils/utils.common"; -export interface IShareCreateOptions { +export interface ShareCreateOptions { + abortSignal?: Aborter; /** * A name-value pair to associate with a file storage object. * * @type {{ [propertyName: string]: string }} - * @memberof IShareCreateOptions + * @memberof ShareCreateOptions */ metadata?: { [propertyName: string]: string }; @@ -31,24 +28,52 @@ export interface IShareCreateOptions { * gigabytes. * * @type {number} - * @memberof IShareCreateOptions + * @memberof ShareCreateOptions */ quota?: number; } -export interface IShareDeleteMethodOptions { +export interface ShareDeleteMethodOptions { + abortSignal?: Aborter; /** * Specifies the option * include to delete the base share and all of its snapshots. Possible values * include: 'include' * * @type {Models.DeleteSnapshotsOptionType} - * @memberof IShareDeleteMethodOptions + * @memberof ShareDeleteMethodOptions */ deleteSnapshots?: Models.DeleteSnapshotsOptionType; } -export interface ISignedIdentifier { +export interface ShareSetMetadataOptions { + abortSignal?: Aborter; +} + +export interface ShareSetAccessPolicyOptions { + abortSignal?: Aborter; +} + +export interface ShareGetAccessPolicyOptions { + abortSignal?: Aborter; +} + +export interface ShareGetAccessPolicyOptions { + abortSignal?: Aborter; +} +export interface ShareGetPropertiesOptions { + abortSignal?: Aborter; +} + +export interface ShareSetQuotaOptions { + abortSignal?: Aborter; +} + +export interface ShareGetStatisticsOptions { + abortSignal?: Aborter; +} + +export interface SignedIdentifier { /** * @member {string} id a unique id */ @@ -74,7 +99,7 @@ export interface ISignedIdentifier { } export declare type ShareGetAccessPolicyResponse = { - signedIdentifiers: ISignedIdentifier[]; + signedIdentifiers: SignedIdentifier[]; } & Models.ShareGetAccessPolicyHeaders & { /** * The underlying HTTP response. @@ -95,38 +120,36 @@ export declare type ShareGetAccessPolicyResponse = { }; }; -export interface IShareCreateSnapshotOptions { +export interface ShareCreateSnapshotOptions { + abortSignal?: Aborter; /** * A name-value pair to associate with a file storage object. * * @type {{ [propertyName: string]: string }} - * @memberof IShareCreateOptions + * @memberof ShareCreateOptions */ metadata?: { [propertyName: string]: string }; } /** - * A ShareURL represents a URL to the Azure Storage share allowing you to manipulate its directories and files. + * A ShareClient represents a URL to the Azure Storage share allowing you to manipulate its directories and files. * * @export - * @class ShareURL - * @extends {StorageURL} + * @class ShareClient + * @extends {StorageClient} */ -export class ShareURL extends StorageURL { +export class ShareClient extends StorageClient { /** - * Creates a ShareURL object from ServiceURL + * Creates a ShareClient object from ServiceClient * - * @param serviceURL + * @param serviceClient * @param shareName */ - public static fromServiceURL( - serviceURL: ServiceURL, + public static fromFileServiceClient( + serviceClient: FileServiceClient, shareName: string - ): ShareURL { - return new ShareURL( - appendToURLPath(serviceURL.url, shareName), - serviceURL.pipeline - ); + ): ShareClient { + return new ShareClient(appendToURLPath(serviceClient.url, shareName), serviceClient.pipeline); } /** @@ -134,20 +157,20 @@ export class ShareURL extends StorageURL { * * @private * @type {Share} - * @memberof ShareURL + * @memberof ShareClient */ private context: Share; /** - * Creates an instance of ShareURL. + * Creates an instance of ShareClient. * * @param {string} url A URL string pointing to Azure Storage file share, such as * "https://myaccount.file.core.windows.net/share". You can * append a SAS if using AnonymousCredential, such as * "https://myaccount.file.core.windows.net/share?sasString". - * @param {Pipeline} pipeline Call StorageURL.newPipeline() to create a default + * @param {Pipeline} pipeline Call StorageClient.newPipeline() to create a default * pipeline, or provide a customized pipeline. - * @memberof ShareURL + * @memberof ShareClient */ constructor(url: string, pipeline: Pipeline) { super(url, pipeline); @@ -155,27 +178,27 @@ export class ShareURL extends StorageURL { } /** - * Creates a new ShareURL object identical to the source but with the + * Creates a new ShareClient object identical to the source but with the * specified request policy pipeline. * * @param {Pipeline} pipeline - * @returns {ShareURL} - * @memberof ShareURL + * @returns {ShareClient} + * @memberof ShareClient */ - public withPipeline(pipeline: Pipeline): ShareURL { - return new ShareURL(this.url, pipeline); + public withPipeline(pipeline: Pipeline): ShareClient { + return new ShareClient(this.url, pipeline); } /** - * Creates a new ShareURL object identical to the source but with the specified snapshot timestamp. + * Creates a new ShareClient object identical to the source but with the specified snapshot timestamp. * Provide "" will remove the snapshot and return a URL to the base share. * * @param {string} snapshot - * @returns {ShareURL} A new ShareURL object identical to the source but with the specified snapshot timestamp - * @memberof ShareURL + * @returns {ShareClient} A new ShareClient object identical to the source but with the specified snapshot timestamp + * @memberof ShareClient */ - public withSnapshot(snapshot: string): ShareURL { - return new ShareURL( + public withSnapshot(snapshot: string): ShareClient { + return new ShareClient( setURLParameter( this.url, URLConstants.Parameters.SHARE_SNAPSHOT, @@ -190,16 +213,12 @@ export class ShareURL extends StorageURL { * the same name already exists, the operation fails. * @see https://docs.microsoft.com/en-us/rest/api/storageservices/create-share * - * @param {Aborter} aborter Create a new Aborter instance with Aborter.none or Aborter.timeout(), - * goto documents of Aborter for more examples about request cancellation - * @param {IShareCreateOptions} [options] + * @param {ShareCreateOptions} [options] * @returns {Promise} - * @memberof ShareURL + * @memberof ShareClient */ - public async create( - aborter: Aborter, - options: IShareCreateOptions = {} - ): Promise { + public async create(options: ShareCreateOptions = {}): Promise { + const aborter = options.abortSignal || Aborter.none; return this.context.create({ ...options, abortSignal: aborter @@ -211,14 +230,13 @@ export class ShareURL extends StorageURL { * share. * @see https://docs.microsoft.com/en-us/rest/api/storageservices/get-share-properties * - * @param {Aborter} aborter Create a new Aborter instance with Aborter.none or Aborter.timeout(), - * goto documents of Aborter for more examples about request cancellation * @returns {Promise} - * @memberof ShareURL + * @memberof ShareClient */ public async getProperties( - aborter: Aborter + options: ShareGetPropertiesOptions = {} ): Promise { + const aborter = options.abortSignal || Aborter.none; return this.context.getProperties({ abortSignal: aborter }); @@ -229,16 +247,14 @@ export class ShareURL extends StorageURL { * contained within it are later deleted during garbage collection. * @see https://docs.microsoft.com/en-us/rest/api/storageservices/delete-share * - * @param {Aborter} aborter Create a new Aborter instance with Aborter.none or Aborter.timeout(), - * goto documents of Aborter for more examples about request cancellation - * @param {Models.IShareDeleteMethodOptions} [options] + * @param {Models.ShareDeleteMethodOptions} [options] * @returns {Promise} - * @memberof ShareURL + * @memberof ShareClient */ public async delete( - aborter: Aborter, - options: IShareDeleteMethodOptions = {} + options: ShareDeleteMethodOptions = {} ): Promise { + const aborter = options.abortSignal || Aborter.none; return this.context.deleteMethod({ abortSignal: aborter, ...options @@ -252,16 +268,15 @@ export class ShareURL extends StorageURL { * metadata will be removed. * @see https://docs.microsoft.com/en-us/rest/api/storageservices/set-share-metadata * - * @param {Aborter} aborter Create a new Aborter instance with Aborter.none or Aborter.timeout(), - * goto documents of Aborter for more examples about request cancellation - * @param {IMetadata} [metadata] If no metadata provided, all existing directory metadata will be removed + * @param {Metadata} [metadata] If no metadata provided, all existing directory metadata will be removed * @returns {Promise} - * @memberof ShareURL + * @memberof ShareClient */ public async setMetadata( - aborter: Aborter, - metadata?: IMetadata + metadata?: Metadata, + options: ShareSetMetadataOptions = {} ): Promise { + const aborter = options.abortSignal || Aborter.none; return this.context.setMetadata({ abortSignal: aborter, metadata @@ -277,14 +292,13 @@ export class ShareURL extends StorageURL { * * @see https://docs.microsoft.com/en-us/rest/api/storageservices/get-share-acl * - * @param {Aborter} aborter Create a new Aborter instance with Aborter.none or Aborter.timeout(), - * goto documents of Aborter for more examples about request cancellation * @returns {Promise} - * @memberof ShareURL + * @memberof ShareClient */ public async getAccessPolicy( - aborter: Aborter + options: ShareGetAccessPolicyOptions = {} ): Promise { + const aborter = options.abortSignal || Aborter.none; const response = await this.context.getAccessPolicy({ abortSignal: aborter }); @@ -322,16 +336,15 @@ export class ShareURL extends StorageURL { * removed. * @see https://docs.microsoft.com/en-us/rest/api/storageservices/set-share-acl * - * @param {Aborter} aborter Create a new Aborter instance with Aborter.none or Aborter.timeout(), - * goto documents of Aborter for more examples about request cancellation - * @param {ISignedIdentifier[]} [shareAcl] + * @param {SignedIdentifier[]} [shareAcl] * @returns {Promise} - * @memberof ShareURL + * @memberof ShareClient */ public async setAccessPolicy( - aborter: Aborter, - shareAcl?: ISignedIdentifier[] + shareAcl?: SignedIdentifier[], + options: ShareSetAccessPolicyOptions = {} ): Promise { + const aborter = options.abortSignal || Aborter.none; const acl: Models.SignedIdentifier[] = []; for (const identifier of shareAcl || []) { acl.push({ @@ -353,16 +366,14 @@ export class ShareURL extends StorageURL { /** * Creates a read-only snapshot of a share. * - * @param {Aborter} aborter Create a new Aborter instance with Aborter.none or Aborter.timeout(), - * goto documents of Aborter for more examples about request cancellation - * @param {IShareCreateSnapshotOptions} [options={}] + * @param {ShareCreateSnapshotOptions} [options={}] * @returns {Promise} - * @memberof ShareURL + * @memberof ShareClient */ public async createSnapshot( - aborter: Aborter, - options: IShareCreateSnapshotOptions = {} + options: ShareCreateSnapshotOptions = {} ): Promise { + const aborter = options.abortSignal || Aborter.none; return this.context.createSnapshot({ abortSignal: aborter, ...options @@ -372,16 +383,15 @@ export class ShareURL extends StorageURL { /** * Sets quota for the specified share. * - * @param {Aborter} aborter Create a new Aborter instance with Aborter.none or Aborter.timeout(), - * goto documents of Aborter for more examples about request cancellation * @param {number} quotaInGB Specifies the maximum size of the share in gigabytes * @returns {Promise} - * @memberof ShareURL + * @memberof ShareClient */ public async setQuota( - aborter: Aborter, - quotaInGB: number + quotaInGB: number, + options: ShareSetQuotaOptions = {} ): Promise { + const aborter = options.abortSignal || Aborter.none; if (quotaInGB <= 0 || quotaInGB > 5120) { throw new RangeError( `Share quota must be greater than 0, and less than or equal to 5Tib (5120GB)` @@ -396,14 +406,13 @@ export class ShareURL extends StorageURL { /** * Retrieves statistics related to the share. * - * @param {Aborter} aborter Create a new Aborter instance with Aborter.none or Aborter.timeout(), - * goto documents of Aborter for more examples about request cancellation * @returns {Promise} - * @memberof ShareURL + * @memberof ShareClient */ public async getStatistics( - aborter: Aborter + options: ShareGetStatisticsOptions = {} ): Promise { + const aborter = options.abortSignal || Aborter.none; return this.context.getStatistics({ abortSignal: aborter }); diff --git a/sdk/storage/storage-file/src/ShareSASPermissions.ts b/sdk/storage/storage-file/src/ShareSASPermissions.ts index 2f44d6923a53..f92f5bace638 100644 --- a/sdk/storage/storage-file/src/ShareSASPermissions.ts +++ b/sdk/storage/storage-file/src/ShareSASPermissions.ts @@ -5,7 +5,7 @@ * This is a helper class to construct a string representing the permissions granted by a ServiceSAS to a share. * Setting a value to true means that any SAS which uses these permissions will grant permissions for that operation. * Once all the values are set, this should be serialized with toString and set as the permissions field on a - * {@link IFileSASSignatureValues} object. It is possible to construct the permissions string without this class, but + * {@link FileSASSignatureValues} object. It is possible to construct the permissions string without this class, but * the order of the permissions is particular and this class guarantees correctness. * * @export diff --git a/sdk/storage/storage-file/src/StorageURL.ts b/sdk/storage/storage-file/src/StorageClient.ts similarity index 80% rename from sdk/storage/storage-file/src/StorageURL.ts rename to sdk/storage/storage-file/src/StorageClient.ts index 119fe62a3530..7cd168714a17 100644 --- a/sdk/storage/storage-file/src/StorageURL.ts +++ b/sdk/storage/storage-file/src/StorageClient.ts @@ -8,11 +8,8 @@ import { Credential } from "./credentials/Credential"; import { StorageClientContext } from "./generated/lib/storageClientContext"; import { LoggingPolicyFactory } from "./LoggingPolicyFactory"; import { IHttpClient, IHttpPipelineLogger, Pipeline } from "./Pipeline"; -import { IRetryOptions, RetryPolicyFactory } from "./RetryPolicyFactory"; -import { - ITelemetryOptions, - TelemetryPolicyFactory -} from "./TelemetryPolicyFactory"; +import { RetryOptions, RetryPolicyFactory } from "./RetryPolicyFactory"; +import { TelemetryOptions, TelemetryPolicyFactory } from "./TelemetryPolicyFactory"; import { UniqueRequestIDPolicyFactory } from "./UniqueRequestIDPolicyFactory"; import { escapeURLPath } from "./utils/utils.common"; @@ -22,41 +19,41 @@ export { deserializationPolicy }; * Option interface for Pipeline.newPipeline method. * * @export - * @interface INewPipelineOptions + * @interface NewPipelineOptions */ -export interface INewPipelineOptions { +export interface NewPipelineOptions { /** * Telemetry configures the built-in telemetry policy behavior. * - * @type {ITelemetryOptions} - * @memberof INewPipelineOptions + * @type {TelemetryOptions} + * @memberof NewPipelineOptions */ - telemetry?: ITelemetryOptions; - retryOptions?: IRetryOptions; + telemetry?: TelemetryOptions; + retryOptions?: RetryOptions; logger?: IHttpPipelineLogger; httpClient?: IHttpClient; } /** - * A ServiceURL represents a based URL class for ServiceURL, ContainerURL and etc. + * A ServiceClient represents a based URL class for ServiceClient, ContainerURL and etc. * * @export - * @class StorageURL + * @class StorageClient */ -export abstract class StorageURL { +export abstract class StorageClient { /** * A static method used to create a new Pipeline object with Credential provided. * * @static * @param {Credential} credential Such as AnonymousCredential, SharedKeyCredential. - * @param {INewPipelineOptions} [pipelineOptions] Optional. Options. + * @param {NewPipelineOptions} [pipelineOptions] Optional. Options. * @returns {Pipeline} A new Pipeline object. * @memberof Pipeline */ public static newPipeline( credential: Credential, - pipelineOptions: INewPipelineOptions = {} + pipelineOptions: NewPipelineOptions = {} ): Pipeline { // Order is important. Closer to the API at the top & closer to the network at the bottom. // The credential's policy factory must appear close to the wire so it can sign any @@ -82,7 +79,7 @@ export abstract class StorageURL { * * @internal * @type {Pipeline} - * @memberof StorageURL + * @memberof StorageClient */ public readonly pipeline: Pipeline; @@ -90,7 +87,7 @@ export abstract class StorageURL { * URL string value. * * @type {string} - * @memberof StorageURL + * @memberof StorageClient */ public readonly url: string; @@ -100,15 +97,15 @@ export abstract class StorageURL { * * @protected * @type {StorageClient} - * @memberof StorageURL + * @memberof StorageClient */ protected readonly storageClientContext: StorageClientContext; /** - * Creates an instance of StorageURL. + * Creates an instance of StorageClient. * @param {string} url * @param {Pipeline} pipeline - * @memberof StorageURL + * @memberof StorageClient */ protected constructor(url: string, pipeline: Pipeline) { // URL should be encoded and only once, protocol layer shouldn't encode URL again diff --git a/sdk/storage/storage-file/src/TelemetryPolicyFactory.ts b/sdk/storage/storage-file/src/TelemetryPolicyFactory.ts index 93c412bf988f..3804b8d6b3d7 100644 --- a/sdk/storage/storage-file/src/TelemetryPolicyFactory.ts +++ b/sdk/storage/storage-file/src/TelemetryPolicyFactory.ts @@ -16,9 +16,9 @@ import { SDK_VERSION } from "./utils/constants"; * Interface of TelemetryPolicy options. * * @export - * @interface ITelemetryOptions + * @interface TelemetryOptions */ -export interface ITelemetryOptions { +export interface TelemetryOptions { value: string; } @@ -34,19 +34,16 @@ export class TelemetryPolicyFactory implements RequestPolicyFactory { /** * Creates an instance of TelemetryPolicyFactory. - * @param {ITelemetryOptions} [telemetry] + * @param {TelemetryOptions} [telemetry] * @memberof TelemetryPolicyFactory */ - constructor(telemetry?: ITelemetryOptions) { + constructor(telemetry?: TelemetryOptions) { const userAgentInfo: string[] = []; if (isNode) { if (telemetry) { const telemetryString = telemetry.value; - if ( - telemetryString.length > 0 && - userAgentInfo.indexOf(telemetryString) === -1 - ) { + if (telemetryString.length > 0 && userAgentInfo.indexOf(telemetryString) === -1) { userAgentInfo.push(telemetryString); } } @@ -58,9 +55,7 @@ export class TelemetryPolicyFactory implements RequestPolicyFactory { } // e.g. (NODE-VERSION 4.9.1; Windows_NT 10.0.16299) - const runtimeInfo = `(NODE-VERSION ${ - process.version - }; ${os.type()} ${os.release()})`; + const runtimeInfo = `(NODE-VERSION ${process.version}; ${os.type()} ${os.release()})`; if (userAgentInfo.indexOf(runtimeInfo) === -1) { userAgentInfo.push(runtimeInfo); } @@ -69,10 +64,7 @@ export class TelemetryPolicyFactory implements RequestPolicyFactory { this.telemetryString = userAgentInfo.join(" "); } - public create( - nextPolicy: RequestPolicy, - options: RequestPolicyOptions - ): TelemetryPolicy { + public create(nextPolicy: RequestPolicy, options: RequestPolicyOptions): TelemetryPolicy { return new TelemetryPolicy(nextPolicy, options, this.telemetryString); } } diff --git a/sdk/storage/storage-file/src/UniqueRequestIDPolicyFactory.ts b/sdk/storage/storage-file/src/UniqueRequestIDPolicyFactory.ts index 03bae4b3de81..782caca4f7f2 100644 --- a/sdk/storage/storage-file/src/UniqueRequestIDPolicyFactory.ts +++ b/sdk/storage/storage-file/src/UniqueRequestIDPolicyFactory.ts @@ -13,10 +13,7 @@ import { UniqueRequestIDPolicy } from "./policies/UniqueRequestIDPolicy"; * @implements {RequestPolicyFactory} */ export class UniqueRequestIDPolicyFactory implements RequestPolicyFactory { - public create( - nextPolicy: RequestPolicy, - options: RequestPolicyOptions - ): UniqueRequestIDPolicy { + public create(nextPolicy: RequestPolicy, options: RequestPolicyOptions): UniqueRequestIDPolicy { return new UniqueRequestIDPolicy(nextPolicy, options); } } diff --git a/sdk/storage/storage-file/src/credentials/Credential.ts b/sdk/storage/storage-file/src/credentials/Credential.ts index 602569eec425..1150f504dc4d 100644 --- a/sdk/storage/storage-file/src/credentials/Credential.ts +++ b/sdk/storage/storage-file/src/credentials/Credential.ts @@ -1,12 +1,7 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -import { - RequestPolicy, - RequestPolicyFactory, - RequestPolicyOptions -} from "@azure/ms-rest-js"; - +import { RequestPolicy, RequestPolicyFactory, RequestPolicyOptions } from "@azure/ms-rest-js"; import { CredentialPolicy } from "../policies/CredentialPolicy"; /** diff --git a/sdk/storage/storage-file/src/highlevel.browser.ts b/sdk/storage/storage-file/src/highlevel.browser.ts index e7ad9da14640..351a784daace 100644 --- a/sdk/storage/storage-file/src/highlevel.browser.ts +++ b/sdk/storage/storage-file/src/highlevel.browser.ts @@ -2,13 +2,10 @@ // Licensed under the MIT License. import { Aborter } from "./Aborter"; -import { FileURL } from "./FileURL"; -import { IUploadToAzureFileOptions } from "./highlevel.common"; +import { FileClient } from "./FileClient"; +import { UploadToAzureFileOptions } from "./highlevel.common"; import { Batch } from "./utils/Batch"; -import { - FILE_RANGE_MAX_SIZE_BYTES, - DEFAULT_HIGH_LEVEL_PARALLELISM -} from "./utils/constants"; +import { FILE_RANGE_MAX_SIZE_BYTES, DEFAULT_HIGH_LEVEL_PARALLELISM } from "./utils/constants"; /** * ONLY AVAILABLE IN BROWSERS. @@ -16,27 +13,23 @@ import { * Uploads a browser Blob/File/ArrayBuffer/ArrayBufferView object to an Azure File. * * @export - * @param {Aborter} aborter Create a new Aborter instance with Aborter.none or Aborter.timeout(), - * goto documents of Aborter for more examples about request cancellation * @param {Blob | ArrayBuffer | ArrayBufferView} browserData Blob, File, ArrayBuffer or ArrayBufferView - * @param {FileURL} fileURL - * @param {IUploadToAzureFileOptions} [options] + * @param {FileClient} fileClient + * @param {UploadToAzureFileOptions} [options] * @returns {Promise} */ export async function uploadBrowserDataToAzureFile( - aborter: Aborter, browserData: Blob | ArrayBuffer | ArrayBufferView, - fileURL: FileURL, - options?: IUploadToAzureFileOptions + fileClient: FileClient, + options: UploadToAzureFileOptions = {} ): Promise { const browserBlob = new Blob([browserData]); return UploadSeekableBlobToAzureFile( - aborter, (offset: number, size: number): Blob => { return browserBlob.slice(offset, offset + size); }, browserBlob.size, - fileURL, + fileClient, options ); } @@ -47,28 +40,24 @@ export async function uploadBrowserDataToAzureFile( * Uploads a browser Blob object to an Azure file. Requires a blobFactory as the data source, * which need to return a Blob object with the offset and size provided. * - * @param {Aborter} aborter Create a new Aborter instance with Aborter.none or Aborter.timeout(), - * goto documents of Aborter for more examples about request cancellation * @param {(offset: number, size: number) => Blob} blobFactory * @param {number} size - * @param {FileURL} fileURL - * @param {IUploadToAzureFileOptions} [options] + * @param {FileClient} fileClient + * @param {UploadToAzureFileOptions} [options] * @returns {Promise} */ async function UploadSeekableBlobToAzureFile( - aborter: Aborter, blobFactory: (offset: number, size: number) => Blob, size: number, - fileURL: FileURL, - options: IUploadToAzureFileOptions = {} + fileClient: FileClient, + options: UploadToAzureFileOptions = {} ): Promise { + const aborter = options.abortSignal || Aborter.none; if (!options.rangeSize) { options.rangeSize = FILE_RANGE_MAX_SIZE_BYTES; } if (options.rangeSize < 0 || options.rangeSize > FILE_RANGE_MAX_SIZE_BYTES) { - throw new RangeError( - `options.rangeSize must be > 0 and <= ${FILE_RANGE_MAX_SIZE_BYTES}` - ); + throw new RangeError(`options.rangeSize must be > 0 and <= ${FILE_RANGE_MAX_SIZE_BYTES}`); } if (!options.fileHTTPHeaders) { @@ -83,7 +72,8 @@ async function UploadSeekableBlobToAzureFile( } // Create the file - await fileURL.create(aborter, size, { + await fileClient.create(size, { + abortSignal: aborter, fileHTTPHeaders: options.fileHTTPHeaders, metadata: options.metadata }); @@ -98,12 +88,9 @@ async function UploadSeekableBlobToAzureFile( const start = options.rangeSize! * i; const end = i === numBlocks - 1 ? size : start + options.rangeSize!; const contentLength = end - start; - await fileURL.uploadRange( - aborter, - blobFactory(start, contentLength), - start, - contentLength - ); + await fileClient.uploadRange(blobFactory(start, contentLength), start, contentLength, { + abortSignal: aborter + }); // Update progress after block is successfully uploaded to server, in case of block trying // TODO: Hook with convenience layer progress event in finer level transferProgress += contentLength; diff --git a/sdk/storage/storage-file/src/highlevel.common.ts b/sdk/storage/storage-file/src/highlevel.common.ts index e18624d30ba2..627ab5d065b6 100644 --- a/sdk/storage/storage-file/src/highlevel.common.ts +++ b/sdk/storage/storage-file/src/highlevel.common.ts @@ -3,53 +3,55 @@ import { TransferProgressEvent } from "@azure/ms-rest-js"; -import { IFileHTTPHeaders, IMetadata } from "./models"; +import { FileHTTPHeaders, Metadata } from "./models"; +import { Aborter } from "./Aborter"; /** * Option interface for uploadFileToAzureFile and uploadSeekableStreamToAzureFile. * * @export - * @interface IUploadToAzureFileOptions + * @interface UploadToAzureFileOptions */ -export interface IUploadToAzureFileOptions { +export interface UploadToAzureFileOptions { + abortSignal?: Aborter; /** * RangeSize specifies the range size to use in each parallel upload, * the default (and maximum size) is FILE_RANGE_MAX_SIZE_BYTES. * * @type {number} - * @memberof IUploadToAzureFileOptions + * @memberof UploadToAzureFileOptions */ rangeSize?: number; /** * Progress updater. * - * @memberof IUploadToAzureFileOptions + * @memberof UploadToAzureFileOptions */ progress?: (progress: TransferProgressEvent) => void; /** * File HTTP Headers. * - * @type {IFileHTTPHeaders} - * @memberof IUploadToAzureFileOptions + * @type {FileHTTPHeaders} + * @memberof UploadToAzureFileOptions */ - fileHTTPHeaders?: IFileHTTPHeaders; + fileHTTPHeaders?: FileHTTPHeaders; /** * Metadata of an Azure file. * - * @type {IMetadata} - * @memberof IUploadToAzureFileOptions + * @type {Metadata} + * @memberof UploadToAzureFileOptions */ - metadata?: IMetadata; + metadata?: Metadata; /** * Parallelism indicates the maximum number of ranges to upload in parallel. * If not provided, 5 parallelism will be used by default. * * @type {number} - * @memberof IUploadToAzureFileOptions + * @memberof UploadToAzureFileOptions */ parallelism?: number; } @@ -58,9 +60,10 @@ export interface IUploadToAzureFileOptions { * Option interface for DownloadAzurefileToBuffer. * * @export - * @interface IDownloadFromAzureFileOptions + * @interface DownloadFromAzureFileOptions */ -export interface IDownloadFromAzureFileOptions { +export interface DownloadFromAzureFileOptions { + abortSignal?: Aborter; /** * When downloading Azure files, download method will try to split large file into small ranges. * Every small range will be downloaded via a separte request. @@ -68,7 +71,7 @@ export interface IDownloadFromAzureFileOptions { * Must be > 0, will use the default value if undefined, * * @type {number} - * @memberof IDownloadFromAzureFileOptions + * @memberof DownloadFromAzureFileOptions */ rangeSize?: number; @@ -79,21 +82,21 @@ export interface IDownloadFromAzureFileOptions { * Above kind of ends will not trigger retry policy defined in a pipeline, * because they doesn't emit network errors. * - * With this option, every additional retry means an additional FileURL.download() request will be made + * With this option, every additional retry means an additional FileClient.download() request will be made * from the broken point, until the requested range has been successfully downloaded or * maxRetryRequestsPerRange is reached. * * Default value is 5, please set a larger value when in poor network. * * @type {number} - * @memberof IDownloadFromAzureFileOptions + * @memberof DownloadFromAzureFileOptions */ maxRetryRequestsPerRange?: number; /** * Progress updater. * - * @memberof IDownloadFromAzureFileOptions + * @memberof DownloadFromAzureFileOptions */ progress?: (progress: TransferProgressEvent) => void; @@ -102,7 +105,7 @@ export interface IDownloadFromAzureFileOptions { * If not provided, 5 parallelism will be used by default. * * @type {number} - * @memberof IDownloadFromAzureFileOptions + * @memberof DownloadFromAzureFileOptions */ parallelism?: number; } diff --git a/sdk/storage/storage-file/src/highlevel.node.ts b/sdk/storage/storage-file/src/highlevel.node.ts index 8c34cd6fdfb1..390b2801669d 100644 --- a/sdk/storage/storage-file/src/highlevel.node.ts +++ b/sdk/storage/storage-file/src/highlevel.node.ts @@ -5,18 +5,12 @@ import * as fs from "fs"; import { TransferProgressEvent } from "@azure/ms-rest-js"; import { Readable } from "stream"; import { Aborter } from "./Aborter"; -import { FileURL } from "./FileURL"; -import { - IDownloadFromAzureFileOptions, - IUploadToAzureFileOptions -} from "./highlevel.common"; -import { IFileHTTPHeaders, IMetadata } from "./models"; +import { FileClient } from "./FileClient"; +import { DownloadFromAzureFileOptions, UploadToAzureFileOptions } from "./highlevel.common"; +import { FileHTTPHeaders, Metadata } from "./models"; import { Batch } from "./utils/Batch"; import { BufferScheduler } from "./utils/BufferScheduler"; -import { - DEFAULT_HIGH_LEVEL_PARALLELISM, - FILE_RANGE_MAX_SIZE_BYTES -} from "./utils/constants"; +import { DEFAULT_HIGH_LEVEL_PARALLELISM, FILE_RANGE_MAX_SIZE_BYTES } from "./utils/constants"; import { streamToBuffer } from "./utils/utils.node"; /** @@ -25,22 +19,18 @@ import { streamToBuffer } from "./utils/utils.node"; * Uploads a local file to an Azure file. * * @export - * @param {Aborter} aborter Create a new Aborter instance with Aborter.none or Aborter.timeout(), - * goto documents of Aborter for more examples about request cancellation * @param {string} filePath Full path of local file - * @param {FileURL} fileURL FileURL - * @param {IUploadToAzureFileOptions} [options] + * @param {FileClient} fileClient FileClient + * @param {UploadToAzureFileOptions} [options] * @returns {(Promise)} */ export async function uploadFileToAzureFile( - aborter: Aborter, filePath: string, - fileURL: FileURL, - options?: IUploadToAzureFileOptions + fileClient: FileClient, + options?: UploadToAzureFileOptions ): Promise { const size = fs.statSync(filePath).size; return uploadResetableStreamToAzureFile( - aborter, (offset, count) => fs.createReadStream(filePath, { autoClose: true, @@ -48,7 +38,7 @@ export async function uploadFileToAzureFile( start: offset }), size, - fileURL, + fileClient, options ); } @@ -61,29 +51,25 @@ export async function uploadFileToAzureFile( * is the offset in the Azure file to be uploaded. * * @export - * @param {Aborter} aborter Create a new Aborter instance with Aborter.none or Aborter.timeout(), - * goto documents of Aborter for more examples about request cancellation * @param {(offset: number) => NodeJS.ReadableStream} streamFactory Returns a Node.js Readable stream starting * from the offset defined * @param {number} size Size of the Azure file - * @param {FileURL} fileURL FileURL - * @param {IUploadToAzureFileOptions} [options] + * @param {FileClient} fileClient FileClient + * @param {UploadToAzureFileOptions} [options] * @returns {(Promise)} */ async function uploadResetableStreamToAzureFile( - aborter: Aborter, streamFactory: (offset: number, count?: number) => NodeJS.ReadableStream, size: number, - fileURL: FileURL, - options: IUploadToAzureFileOptions = {} + fileClient: FileClient, + options: UploadToAzureFileOptions = {} ): Promise { + const aborter = options.abortSignal || Aborter.none; if (!options.rangeSize) { options.rangeSize = FILE_RANGE_MAX_SIZE_BYTES; } if (options.rangeSize < 0 || options.rangeSize > FILE_RANGE_MAX_SIZE_BYTES) { - throw new RangeError( - `options.rangeSize must be > 0 and <= ${FILE_RANGE_MAX_SIZE_BYTES}` - ); + throw new RangeError(`options.rangeSize must be > 0 and <= ${FILE_RANGE_MAX_SIZE_BYTES}`); } if (!options.fileHTTPHeaders) { @@ -98,7 +84,8 @@ async function uploadResetableStreamToAzureFile( } // Create the file - await fileURL.create(aborter, size, { + await fileClient.create(size, { + abortSignal: aborter, fileHTTPHeaders: options.fileHTTPHeaders, metadata: options.metadata }); @@ -113,11 +100,13 @@ async function uploadResetableStreamToAzureFile( const start = options.rangeSize! * i; const end = i === numBlocks - 1 ? size : start + options.rangeSize!; const contentLength = end - start; - await fileURL.uploadRange( - aborter, + await fileClient.uploadRange( () => streamFactory(start, contentLength), start, - contentLength + contentLength, + { + abortSignal: aborter + } ); // Update progress after block is successfully uploaded to server, in case of block trying transferProgress += contentLength; @@ -137,23 +126,21 @@ async function uploadResetableStreamToAzureFile( * Offset and count are optional, pass 0 for both to download the entire file. * * @export - * @param {Aborter} aborter Create a new Aborter instance with Aborter.none or Aborter.timeout(), - * goto documents of Aborter for more examples about request cancellation * @param {Buffer} buffer Buffer to be fill, must have length larger than count - * @param {FileURL} fileURL A FileURL object + * @param {FileClient} fileClient A FileClient object * @param {number} offset From which position of the Azure File to download * @param {number} [count] How much data to be downloaded. Will download to the end when passing undefined - * @param {IDownloadFromAzureFileOptions} [options] + * @param {DownloadFromAzureFileOptions} [options] * @returns {Promise} */ export async function downloadAzureFileToBuffer( - aborter: Aborter, buffer: Buffer, - fileURL: FileURL, + fileClient: FileClient, offset: number, count?: number, - options: IDownloadFromAzureFileOptions = {} + options: DownloadFromAzureFileOptions = {} ): Promise { + const aborter = options.abortSignal || Aborter.none; if (!options.rangeSize) { options.rangeSize = FILE_RANGE_MAX_SIZE_BYTES; } @@ -178,7 +165,7 @@ export async function downloadAzureFileToBuffer( // Customer doesn't specify length, get it if (!count) { - const response = await fileURL.getProperties(aborter); + const response = await fileClient.getProperties({ abortSignal: aborter }); count = response.contentLength! - offset; if (count < 0) { throw new RangeError( @@ -197,16 +184,11 @@ export async function downloadAzureFileToBuffer( const batch = new Batch(options.parallelism); for (let off = offset; off < offset + count; off = off + options.rangeSize) { batch.addOperation(async () => { - const chunkEnd = - off + options.rangeSize! < count! ? off + options.rangeSize! : count!; - const response = await fileURL.download( - aborter, - off, - chunkEnd - off + 1, - { - maxRetryRequests: options.maxRetryRequestsPerRange - } - ); + const chunkEnd = off + options.rangeSize! < count! ? off + options.rangeSize! : count!; + const response = await fileClient.download(off, chunkEnd - off + 1, { + abortSignal: aborter, + maxRetryRequests: options.maxRetryRequestsPerRange + }); const stream = response.readableStreamBody!; await streamToBuffer(stream, buffer, off - offset, chunkEnd - offset); // Update progress after block is downloaded, in case of block trying @@ -225,29 +207,30 @@ export async function downloadAzureFileToBuffer( * Option interface for uploadStreamToAzureFile. * * @export - * @interface IUploadStreamToAzureFileOptions + * @interface UploadStreamToAzureFileOptions */ -export interface IUploadStreamToAzureFileOptions { +export interface UploadStreamToAzureFileOptions { + abortSignal?: Aborter; /** * Azure File HTTP Headers. * - * @type {IFileHTTPHeaders} - * @memberof IUploadStreamToAzureFileOptions + * @type {FileHTTPHeaders} + * @memberof UploadStreamToAzureFileOptions */ - fileHTTPHeaders?: IFileHTTPHeaders; + fileHTTPHeaders?: FileHTTPHeaders; /** * Metadata of the Azure file. * - * @type {IMetadata} - * @memberof IUploadStreamToAzureFileOptions + * @type {Metadata} + * @memberof UploadStreamToAzureFileOptions */ - metadata?: IMetadata; + metadata?: Metadata; /** * Progress updater. * - * @memberof IUploadStreamToAzureFileOptions + * @memberof UploadStreamToAzureFileOptions */ progress?: (progress: TransferProgressEvent) => void; } @@ -265,36 +248,32 @@ export interface IUploadStreamToAzureFileOptions { * parameter, which will avoid Buffer.concat() operations. * * @export - * @param {Aborter} aborter Create a new Aborter instance with Aborter.none or Aborter.timeout(), - * goto documents of Aborter for more examples about request cancellation * @param {Readable} stream Node.js Readable stream. Must be less or equal than file size. * @param {number} size Size of file to be created. Maxium size allowed is 1TB. * If this value is larger than stream size, there will be empty bytes in file tail. - * @param {FileURL} fileURL A FileURL instance + * @param {FileClient} fileClient A FileClient instance * @param {number} bufferSize Size of every buffer allocated in bytes, also the chunk/range size during * the uploaded file. Size must be > 0 and <= 4 * 1024 * 1024 (4MB) * @param {number} maxBuffers Max buffers will allocate during uploading, positive correlation * with max uploading concurrency - * @param {IUploadStreamToAzureFileOptions} [options] + * @param {UploadStreamToAzureFileOptions} [options] * @returns {Promise} */ export async function uploadStreamToAzureFile( - aborter: Aborter, stream: Readable, size: number, - fileURL: FileURL, + fileClient: FileClient, bufferSize: number, maxBuffers: number, - options: IUploadStreamToAzureFileOptions = {} + options: UploadStreamToAzureFileOptions = {} ): Promise { + const aborter = options.abortSignal || Aborter.none; if (!options.fileHTTPHeaders) { options.fileHTTPHeaders = {}; } if (bufferSize <= 0 || bufferSize > FILE_RANGE_MAX_SIZE_BYTES) { - throw new RangeError( - `bufferSize must be > 0 and <= ${FILE_RANGE_MAX_SIZE_BYTES}` - ); + throw new RangeError(`bufferSize must be > 0 and <= ${FILE_RANGE_MAX_SIZE_BYTES}`); } if (maxBuffers < 0) { @@ -302,7 +281,8 @@ export async function uploadStreamToAzureFile( } // Create the file - await fileURL.create(aborter, size, { + await fileClient.create(size, { + abortSignal: aborter, fileHTTPHeaders: options.fileHTTPHeaders, metadata: options.metadata }); @@ -320,7 +300,7 @@ export async function uploadStreamToAzureFile( ); } - await fileURL.uploadRange(aborter, buffer, offset!, buffer.length); + await fileClient.uploadRange(buffer, offset!, buffer.length, { abortSignal: aborter }); // Update progress after block is successfully uploaded to server, in case of block trying transferProgress += buffer.length; diff --git a/sdk/storage/storage-file/src/index.browser.ts b/sdk/storage/storage-file/src/index.browser.ts index 334111eeb675..1680ec1782de 100644 --- a/sdk/storage/storage-file/src/index.browser.ts +++ b/sdk/storage/storage-file/src/index.browser.ts @@ -6,15 +6,15 @@ import { RestError } from "@azure/ms-rest-js"; import * as Models from "../src/generated/lib/models"; export * from "./Aborter"; -export * from "./ShareURL"; -export * from "./DirectoryURL"; -export * from "./FileURL"; +export * from "./ShareClient"; +export * from "./DirectoryClient"; +export * from "./FileClient"; export * from "./credentials/AnonymousCredential"; export * from "./credentials/Credential"; export * from "./highlevel.browser"; export * from "./highlevel.common"; -export { IIPRange } from "./IIPRange"; -export { IRange } from "./IRange"; +export { IPRange as IPRange } from "./IPRange"; +export { Range } from "./Range"; export * from "./Pipeline"; export * from "./policies/AnonymousCredentialPolicy"; export * from "./policies/CredentialPolicy"; @@ -23,6 +23,6 @@ export * from "./LoggingPolicyFactory"; export * from "./TelemetryPolicyFactory"; export * from "./UniqueRequestIDPolicyFactory"; export * from "./BrowserPolicyFactory"; -export * from "./ServiceURL"; -export * from "./StorageURL"; +export * from "./FileServiceClient"; +export * from "./StorageClient"; export { Models, RestError }; diff --git a/sdk/storage/storage-file/src/index.ts b/sdk/storage/storage-file/src/index.ts index 2b3433b547ed..39bf8b12dc50 100644 --- a/sdk/storage/storage-file/src/index.ts +++ b/sdk/storage/storage-file/src/index.ts @@ -9,21 +9,21 @@ export * from "./Aborter"; export * from "./AccountSASPermissions"; export * from "./AccountSASResourceTypes"; export * from "./AccountSASServices"; -export * from "./IAccountSASSignatureValues"; +export * from "./AccountSASSignatureValues"; export * from "./FileSASPermissions"; -export * from "./IFileSASSignatureValues"; -export * from "./DirectoryURL"; -export * from "./FileURL"; +export * from "./FileSASSignatureValues"; +export * from "./DirectoryClient"; +export * from "./FileClient"; export * from "./ShareSASPermissions"; -export * from "./ShareURL"; +export * from "./ShareClient"; export * from "./credentials/AnonymousCredential"; export * from "./credentials/Credential"; export * from "./credentials/SharedKeyCredential"; export * from "./highlevel.browser"; export * from "./highlevel.common"; export * from "./highlevel.node"; -export { IIPRange } from "./IIPRange"; -export { IRange } from "./IRange"; +export { IPRange as IPRange } from "./IPRange"; +export { Range } from "./Range"; export * from "./Pipeline"; export * from "./policies/AnonymousCredentialPolicy"; export * from "./policies/CredentialPolicy"; @@ -33,7 +33,7 @@ export * from "./policies/SharedKeyCredentialPolicy"; export * from "./TelemetryPolicyFactory"; export * from "./UniqueRequestIDPolicyFactory"; export * from "./BrowserPolicyFactory"; -export * from "./ServiceURL"; -export * from "./StorageURL"; +export * from "./FileServiceClient"; +export * from "./StorageClient"; export * from "./SASQueryParameters"; export { Models, RestError }; diff --git a/sdk/storage/storage-file/src/models.ts b/sdk/storage/storage-file/src/models.ts index b73642f55e53..f6997f63c0db 100644 --- a/sdk/storage/storage-file/src/models.ts +++ b/sdk/storage/storage-file/src/models.ts @@ -1,11 +1,11 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -export interface IMetadata { +export interface Metadata { [propertyName: string]: string; } -export interface IFileHTTPHeaders { +export interface FileHTTPHeaders { /** * @member {string} [fileCacheControl] Optional. Sets the file's cache * control. If specified, this property is stored with the file and returned diff --git a/sdk/storage/storage-file/src/policies/BrowserPolicy.ts b/sdk/storage/storage-file/src/policies/BrowserPolicy.ts index 312a64eca570..2b7d37949eec 100644 --- a/sdk/storage/storage-file/src/policies/BrowserPolicy.ts +++ b/sdk/storage/storage-file/src/policies/BrowserPolicy.ts @@ -45,17 +45,12 @@ export class BrowserPolicy extends BaseRequestPolicy { * @returns {Promise} * @memberof BrowserPolicy */ - public async sendRequest( - request: WebResource - ): Promise { + public async sendRequest(request: WebResource): Promise { if (isNode) { return this._nextPolicy.sendRequest(request); } - if ( - request.method.toUpperCase() === "GET" || - request.method.toUpperCase() === "HEAD" - ) { + if (request.method.toUpperCase() === "GET" || request.method.toUpperCase() === "HEAD") { request.url = setURLParameter( request.url, URLConstants.Parameters.FORCE_BROWSER_NO_CACHE, diff --git a/sdk/storage/storage-file/src/policies/CredentialPolicy.ts b/sdk/storage/storage-file/src/policies/CredentialPolicy.ts index 429223215b12..e15490e27e3d 100644 --- a/sdk/storage/storage-file/src/policies/CredentialPolicy.ts +++ b/sdk/storage/storage-file/src/policies/CredentialPolicy.ts @@ -1,11 +1,7 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -import { - BaseRequestPolicy, - HttpOperationResponse, - WebResource -} from "@azure/ms-rest-js"; +import { BaseRequestPolicy, HttpOperationResponse, WebResource } from "@azure/ms-rest-js"; /** * Credential policy used to sign HTTP(S) requests before sending. This is an diff --git a/sdk/storage/storage-file/src/policies/LoggingPolicy.ts b/sdk/storage/storage-file/src/policies/LoggingPolicy.ts index ec3420ecb12f..e91999d4b0bd 100644 --- a/sdk/storage/storage-file/src/policies/LoggingPolicy.ts +++ b/sdk/storage/storage-file/src/policies/LoggingPolicy.ts @@ -10,12 +10,12 @@ import { WebResource } from "@azure/ms-rest-js"; -import { IRequestLogOptions } from "../LoggingPolicyFactory"; +import { RequestLogOptions } from "../LoggingPolicyFactory"; import { HTTPURLConnection, URLConstants } from "../utils/constants"; import { getURLParameter, setURLParameter } from "../utils/utils.common"; -// Default values of IRetryOptions -const DEFAULT_REQUEST_LOG_OPTIONS: IRequestLogOptions = { +// Default values of RetryOptions +const DEFAULT_REQUEST_LOG_OPTIONS: RequestLogOptions = { logWarningIfTryOverThreshold: 3000 }; @@ -30,19 +30,19 @@ export class LoggingPolicy extends BaseRequestPolicy { private operationStartTime: Date = new Date(); private requestStartTime: Date = new Date(); - private readonly loggingOptions: IRequestLogOptions; + private readonly loggingOptions: RequestLogOptions; /** * Creates an instance of LoggingPolicy. * @param {RequestPolicy} nextPolicy * @param {RequestPolicyOptions} options - * @param {IRequestLogOptions} [loggingOptions=DEFAULT_REQUEST_LOG_OPTIONS] + * @param {RequestLogOptions} [loggingOptions=DEFAULT_REQUEST_LOG_OPTIONS] * @memberof LoggingPolicy */ constructor( nextPolicy: RequestPolicy, options: RequestPolicyOptions, - loggingOptions: IRequestLogOptions = DEFAULT_REQUEST_LOG_OPTIONS + loggingOptions: RequestLogOptions = DEFAULT_REQUEST_LOG_OPTIONS ) { super(nextPolicy, options); this.loggingOptions = loggingOptions; @@ -55,9 +55,7 @@ export class LoggingPolicy extends BaseRequestPolicy { * @returns {Promise} * @memberof LoggingPolicy */ - public async sendRequest( - request: WebResource - ): Promise { + public async sendRequest(request: WebResource): Promise { this.tryCount++; this.requestStartTime = new Date(); if (this.tryCount === 1) { @@ -66,11 +64,7 @@ export class LoggingPolicy extends BaseRequestPolicy { let safeURL: string = request.url; if (getURLParameter(safeURL, URLConstants.Parameters.SIGNATURE)) { - safeURL = setURLParameter( - safeURL, - URLConstants.Parameters.SIGNATURE, - "*****" - ); + safeURL = setURLParameter(safeURL, URLConstants.Parameters.SIGNATURE, "*****"); } this.log( HttpPipelineLogLevel.INFO, @@ -81,10 +75,8 @@ export class LoggingPolicy extends BaseRequestPolicy { const response = await this._nextPolicy.sendRequest(request); const requestEndTime = new Date(); - const requestCompletionTime = - requestEndTime.getTime() - this.requestStartTime.getTime(); - const operationDuration = - requestEndTime.getTime() - this.operationStartTime.getTime(); + const requestCompletionTime = requestEndTime.getTime() - this.requestStartTime.getTime(); + const operationDuration = requestEndTime.getTime() - this.operationStartTime.getTime(); let currentLevel: HttpPipelineLogLevel = HttpPipelineLogLevel.INFO; let logMessage: string = ""; @@ -94,16 +86,13 @@ export class LoggingPolicy extends BaseRequestPolicy { } // If the response took too long, we'll upgrade to warning. - if ( - requestCompletionTime >= - this.loggingOptions.logWarningIfTryOverThreshold - ) { + if (requestCompletionTime >= this.loggingOptions.logWarningIfTryOverThreshold) { // Log a warning if the try duration exceeded the specified threshold. if (this.shouldLog(HttpPipelineLogLevel.WARNING)) { currentLevel = HttpPipelineLogLevel.WARNING; logMessage = `SLOW OPERATION. Duration > ${ this.loggingOptions.logWarningIfTryOverThreshold - } ms. `; + } ms. `; } } @@ -113,13 +102,12 @@ export class LoggingPolicy extends BaseRequestPolicy { (response.status !== HTTPURLConnection.HTTP_NOT_FOUND && response.status !== HTTPURLConnection.HTTP_CONFLICT && response.status !== HTTPURLConnection.HTTP_PRECON_FAILED && - response.status !== - HTTPURLConnection.HTTP_RANGE_NOT_SATISFIABLE)) || + response.status !== HTTPURLConnection.HTTP_RANGE_NOT_SATISFIABLE)) || (response.status >= 500 && response.status <= 509) ) { const errorString = `REQUEST ERROR: HTTP request failed with status code: ${ response.status - }. `; + }. `; logMessage = errorString; currentLevel = HttpPipelineLogLevel.ERROR; @@ -127,16 +115,14 @@ export class LoggingPolicy extends BaseRequestPolicy { const messageInfo = `Request try:${this.tryCount}, status:${ response.status - } request duration:${requestCompletionTime} ms, operation duration:${operationDuration} ms\n`; + } request duration:${requestCompletionTime} ms, operation duration:${operationDuration} ms\n`; this.log(currentLevel, logMessage + messageInfo); return response; } catch (err) { this.log( HttpPipelineLogLevel.ERROR, - `Unexpected failure attempting to make request. Error message: ${ - err.message - }` + `Unexpected failure attempting to make request. Error message: ${err.message}` ); throw err; } diff --git a/sdk/storage/storage-file/src/policies/RetryPolicy.ts b/sdk/storage/storage-file/src/policies/RetryPolicy.ts index 0a575301af5c..4aebeb792e9a 100644 --- a/sdk/storage/storage-file/src/policies/RetryPolicy.ts +++ b/sdk/storage/storage-file/src/policies/RetryPolicy.ts @@ -13,7 +13,7 @@ import { WebResource } from "@azure/ms-rest-js"; -import { IRetryOptions } from "../RetryPolicyFactory"; +import { RetryOptions } from "../RetryPolicyFactory"; import { URLConstants } from "../utils/constants"; import { setURLParameter } from "../utils/utils.common"; @@ -21,17 +21,12 @@ import { setURLParameter } from "../utils/utils.common"; * A factory method used to generated a RetryPolicy factory. * * @export - * @param {IRetryOptions} retryOptions + * @param {RetryOptions} retryOptions * @returns */ -export function NewRetryPolicyFactory( - retryOptions?: IRetryOptions -): RequestPolicyFactory { +export function NewRetryPolicyFactory(retryOptions?: RetryOptions): RequestPolicyFactory { return { - create: ( - nextPolicy: RequestPolicy, - options: RequestPolicyOptions - ): RetryPolicy => { + create: (nextPolicy: RequestPolicy, options: RequestPolicyOptions): RetryPolicy => { return new RetryPolicy(nextPolicy, options, retryOptions); } }; @@ -54,8 +49,8 @@ export enum RetryPolicyType { FIXED } -// Default values of IRetryOptions -const DEFAULT_RETRY_OPTIONS: IRetryOptions = { +// Default values of RetryOptions +const DEFAULT_RETRY_OPTIONS: RetryOptions = { maxRetryDelayInMs: 120 * 1000, maxTries: 4, retryDelayInMs: 4 * 1000, @@ -74,23 +69,23 @@ export class RetryPolicy extends BaseRequestPolicy { * RetryOptions. * * @private - * @type {IRetryOptions} + * @type {RetryOptions} * @memberof RetryPolicy */ - private readonly retryOptions: IRetryOptions; + private readonly retryOptions: RetryOptions; /** * Creates an instance of RetryPolicy. * * @param {RequestPolicy} nextPolicy * @param {RequestPolicyOptions} options - * @param {IRetryOptions} [retryOptions=DEFAULT_RETRY_OPTIONS] + * @param {RetryOptions} [retryOptions=DEFAULT_RETRY_OPTIONS] * @memberof RetryPolicy */ constructor( nextPolicy: RequestPolicy, options: RequestPolicyOptions, - retryOptions: IRetryOptions = DEFAULT_RETRY_OPTIONS + retryOptions: RetryOptions = DEFAULT_RETRY_OPTIONS ) { super(nextPolicy, options); @@ -113,11 +108,11 @@ export class RetryPolicy extends BaseRequestPolicy { retryDelayInMs: retryOptions.retryDelayInMs && retryOptions.retryDelayInMs >= 0 ? Math.min( - retryOptions.retryDelayInMs, - retryOptions.maxRetryDelayInMs - ? retryOptions.maxRetryDelayInMs - : DEFAULT_RETRY_OPTIONS.maxRetryDelayInMs! - ) + retryOptions.retryDelayInMs, + retryOptions.maxRetryDelayInMs + ? retryOptions.maxRetryDelayInMs + : DEFAULT_RETRY_OPTIONS.maxRetryDelayInMs! + ) : DEFAULT_RETRY_OPTIONS.retryDelayInMs, maxRetryDelayInMs: @@ -134,9 +129,7 @@ export class RetryPolicy extends BaseRequestPolicy { * @returns {Promise} * @memberof RetryPolicy */ - public async sendRequest( - request: WebResource - ): Promise { + public async sendRequest(request: WebResource): Promise { return this.attemptSendRequest(request, false, 1); } @@ -176,17 +169,14 @@ export class RetryPolicy extends BaseRequestPolicy { try { this.logf( HttpPipelineLogLevel.INFO, - `RetryPolicy: =====> Try=${attempt} ${ - isPrimaryRetry ? "Primary" : "Secondary" - }` + `RetryPolicy: =====> Try=${attempt} ${isPrimaryRetry ? "Primary" : "Secondary"}` ); response = await this._nextPolicy.sendRequest(newRequest); if (!this.shouldRetry(isPrimaryRetry, attempt, response)) { return response; } - secondaryHas404 = - secondaryHas404 || (!isPrimaryRetry && response.status === 404); + secondaryHas404 = secondaryHas404 || (!isPrimaryRetry && response.status === 404); } catch (err) { this.logf( HttpPipelineLogLevel.ERROR, @@ -261,10 +251,7 @@ export class RetryPolicy extends BaseRequestPolicy { if (response || err) { const statusCode = response ? response.status : err ? err.statusCode : 0; if (!isPrimaryRetry && statusCode === 404) { - this.logf( - HttpPipelineLogLevel.INFO, - `RetryPolicy: Secondary access with 404, will retry.` - ); + this.logf(HttpPipelineLogLevel.INFO, `RetryPolicy: Secondary access with 404, will retry.`); return true; } @@ -323,10 +310,7 @@ export class RetryPolicy extends BaseRequestPolicy { delayTimeInMs = Math.random() * 1000; } - this.logf( - HttpPipelineLogLevel.INFO, - `RetryPolicy: Delay for ${delayTimeInMs}ms` - ); + this.logf(HttpPipelineLogLevel.INFO, `RetryPolicy: Delay for ${delayTimeInMs}ms`); return delay(delayTimeInMs); } } diff --git a/sdk/storage/storage-file/src/policies/SharedKeyCredentialPolicy.ts b/sdk/storage/storage-file/src/policies/SharedKeyCredentialPolicy.ts index 6ba897516adb..c0beeecb45c3 100644 --- a/sdk/storage/storage-file/src/policies/SharedKeyCredentialPolicy.ts +++ b/sdk/storage/storage-file/src/policies/SharedKeyCredentialPolicy.ts @@ -1,11 +1,7 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -import { - RequestPolicy, - RequestPolicyOptions, - WebResource -} from "@azure/ms-rest-js"; +import { RequestPolicy, RequestPolicyOptions, WebResource } from "@azure/ms-rest-js"; import { SharedKeyCredential } from "../credentials/SharedKeyCredential"; import { HeaderConstants } from "../utils/constants"; import { getURLPath, getURLQueries } from "../utils/utils.common"; @@ -54,15 +50,8 @@ export class SharedKeyCredentialPolicy extends CredentialPolicy { protected signRequest(request: WebResource): WebResource { request.headers.set(HeaderConstants.X_MS_DATE, new Date().toUTCString()); - if ( - request.body && - typeof request.body === "string" && - request.body.length > 0 - ) { - request.headers.set( - HeaderConstants.CONTENT_LENGTH, - Buffer.byteLength(request.body) - ); + if (request.body && typeof request.body === "string" && request.body.length > 0) { + request.headers.set(HeaderConstants.CONTENT_LENGTH, Buffer.byteLength(request.body)); } const stringToSign: string = @@ -107,10 +96,7 @@ export class SharedKeyCredentialPolicy extends CredentialPolicy { * @returns {string} * @memberof SharedKeyCredentialPolicy */ - private getHeaderValueToSign( - request: WebResource, - headerName: string - ): string { + private getHeaderValueToSign(request: WebResource, headerName: string): string { const value = request.headers.get(headerName); if (!value) { @@ -144,10 +130,8 @@ export class SharedKeyCredentialPolicy extends CredentialPolicy { * @memberof SharedKeyCredentialPolicy */ private getCanonicalizedHeadersString(request: WebResource): string { - let headersArray = request.headers.headersArray().filter(value => { - return value.name - .toLowerCase() - .startsWith(HeaderConstants.PREFIX_FOR_STORAGE); + let headersArray = request.headers.headersArray().filter((value) => { + return value.name.toLowerCase().startsWith(HeaderConstants.PREFIX_FOR_STORAGE); }); headersArray.sort( @@ -158,17 +142,14 @@ export class SharedKeyCredentialPolicy extends CredentialPolicy { // Remove duplicate headers headersArray = headersArray.filter((value, index, array) => { - if ( - index > 0 && - value.name.toLowerCase() === array[index - 1].name.toLowerCase() - ) { + if (index > 0 && value.name.toLowerCase() === array[index - 1].name.toLowerCase()) { return false; } return true; }); let canonicalizedHeadersStringToSign: string = ""; - headersArray.forEach(header => { + headersArray.forEach((header) => { canonicalizedHeadersStringToSign += `${header.name .toLowerCase() .trimRight()}:${header.value.trimLeft()}\n`; @@ -205,9 +186,7 @@ export class SharedKeyCredentialPolicy extends CredentialPolicy { queryKeys.sort(); for (const key of queryKeys) { - canonicalizedResourceString += `\n${key}:${decodeURIComponent( - lowercaseQueries[key] - )}`; + canonicalizedResourceString += `\n${key}:${decodeURIComponent(lowercaseQueries[key])}`; } } diff --git a/sdk/storage/storage-file/src/policies/TelemetryPolicy.ts b/sdk/storage/storage-file/src/policies/TelemetryPolicy.ts index d245c6a02375..b60d509e5906 100644 --- a/sdk/storage/storage-file/src/policies/TelemetryPolicy.ts +++ b/sdk/storage/storage-file/src/policies/TelemetryPolicy.ts @@ -32,14 +32,10 @@ export class TelemetryPolicy extends BaseRequestPolicy { * Creates an instance of TelemetryPolicy. * @param {RequestPolicy} nextPolicy * @param {RequestPolicyOptions} options - * @param {ITelemetryOptions} [telemetry] + * @param {TelemetryOptions} [telemetry] * @memberof TelemetryPolicy */ - constructor( - nextPolicy: RequestPolicy, - options: RequestPolicyOptions, - telemetry: string - ) { + constructor(nextPolicy: RequestPolicy, options: RequestPolicyOptions, telemetry: string) { super(nextPolicy, options); this.telemetry = telemetry; } @@ -51,9 +47,7 @@ export class TelemetryPolicy extends BaseRequestPolicy { * @returns {Promise} * @memberof TelemetryPolicy */ - public async sendRequest( - request: WebResource - ): Promise { + public async sendRequest(request: WebResource): Promise { if (isNode) { if (!request.headers) { request.headers = new HttpHeaders(); diff --git a/sdk/storage/storage-file/src/policies/UniqueRequestIDPolicy.ts b/sdk/storage/storage-file/src/policies/UniqueRequestIDPolicy.ts index 662624df06b9..5fd1681dc9f4 100644 --- a/sdk/storage/storage-file/src/policies/UniqueRequestIDPolicy.ts +++ b/sdk/storage/storage-file/src/policies/UniqueRequestIDPolicy.ts @@ -36,14 +36,9 @@ export class UniqueRequestIDPolicy extends BaseRequestPolicy { * @returns {Promise} * @memberof UniqueRequestIDPolicy */ - public async sendRequest( - request: WebResource - ): Promise { + public async sendRequest(request: WebResource): Promise { if (!request.headers.contains(HeaderConstants.X_MS_CLIENT_REQUEST_ID)) { - request.headers.set( - HeaderConstants.X_MS_CLIENT_REQUEST_ID, - generateUuid() - ); + request.headers.set(HeaderConstants.X_MS_CLIENT_REQUEST_ID, generateUuid()); } return this._nextPolicy.sendRequest(request); diff --git a/sdk/storage/storage-file/src/utils/Batch.ts b/sdk/storage/storage-file/src/utils/Batch.ts index 5b04819fa9c4..2d982184bd3a 100644 --- a/sdk/storage/storage-file/src/utils/Batch.ts +++ b/sdk/storage/storage-file/src/utils/Batch.ts @@ -137,7 +137,7 @@ export class Batch { return new Promise((resolve, reject) => { this.emitter.on("finish", resolve); - this.emitter.on("error", error => { + this.emitter.on("error", (error) => { this.state = BatchStates.Error; reject(error); }); diff --git a/sdk/storage/storage-file/src/utils/BufferScheduler.ts b/sdk/storage/storage-file/src/utils/BufferScheduler.ts index 78bdb7245c93..a91e3fcb6e88 100644 --- a/sdk/storage/storage-file/src/utils/BufferScheduler.ts +++ b/sdk/storage/storage-file/src/utils/BufferScheduler.ts @@ -7,10 +7,7 @@ import { Readable } from "stream"; /** * OutgoingHandler is an async function triggered by BufferScheduler. */ -export declare type OutgoingHandler = ( - buffer: Buffer, - offset?: number -) => Promise; +export declare type OutgoingHandler = (buffer: Buffer, offset?: number) => Promise; /** * This class accepts a Node.js Readable stream as input, and keeps reading data @@ -209,21 +206,15 @@ export class BufferScheduler { encoding?: string ) { if (bufferSize <= 0) { - throw new RangeError( - `bufferSize must be larger than 0, current is ${bufferSize}` - ); + throw new RangeError(`bufferSize must be larger than 0, current is ${bufferSize}`); } if (maxBuffers <= 0) { - throw new RangeError( - `maxBuffers must be larger than 0, current is ${maxBuffers}` - ); + throw new RangeError(`maxBuffers must be larger than 0, current is ${maxBuffers}`); } if (parallelism <= 0) { - throw new RangeError( - `parallelism must be larger than 0, current is ${parallelism}` - ); + throw new RangeError(`parallelism must be larger than 0, current is ${parallelism}`); } this.bufferSize = bufferSize; @@ -243,9 +234,8 @@ export class BufferScheduler { */ public async do(): Promise { return new Promise((resolve, reject) => { - this.readable.on("data", data => { - data = - typeof data === "string" ? Buffer.from(data, this.encoding) : data; + this.readable.on("data", (data) => { + data = typeof data === "string" ? Buffer.from(data, this.encoding) : data; this.appendUnresolvedData(data); if (!this.resolveData()) { @@ -253,7 +243,7 @@ export class BufferScheduler { } }); - this.readable.on("error", err => { + this.readable.on("error", (err) => { this.emitter.emit("error", err); }); @@ -262,7 +252,7 @@ export class BufferScheduler { this.emitter.emit("checkEnd"); }); - this.emitter.on("error", err => { + this.emitter.on("error", (err) => { this.isError = true; this.readable.pause(); reject(err); @@ -275,14 +265,8 @@ export class BufferScheduler { } if (this.isStreamEnd && this.executingOutgoingHandlers === 0) { - if ( - this.unresolvedLength > 0 && - this.unresolvedLength < this.bufferSize - ) { - this.outgoingHandler( - this.shiftBufferFromUnresolvedDataArray(), - this.offset - ) + if (this.unresolvedLength > 0 && this.unresolvedLength < this.bufferSize) { + this.outgoingHandler(this.shiftBufferFromUnresolvedDataArray(), this.offset) .then(resolve) .catch(reject); } else if (this.unresolvedLength >= this.bufferSize) { @@ -323,20 +307,14 @@ export class BufferScheduler { } // Lazy concat because Buffer.concat highly drops performance - let merged = Buffer.concat( - this.unresolvedDataArray, - this.unresolvedLength - ); + let merged = Buffer.concat(this.unresolvedDataArray, this.unresolvedLength); const buffer = merged.slice(0, this.bufferSize); merged = merged.slice(this.bufferSize); this.unresolvedDataArray = [merged]; this.unresolvedLength -= buffer.length; return buffer; } else if (this.unresolvedLength > 0) { - const merged = Buffer.concat( - this.unresolvedDataArray, - this.unresolvedLength - ); + const merged = Buffer.concat(this.unresolvedDataArray, this.unresolvedLength); this.unresolvedDataArray = []; this.unresolvedLength = 0; return merged; diff --git a/sdk/storage/storage-file/src/utils/RetriableReadableStream.ts b/sdk/storage/storage-file/src/utils/RetriableReadableStream.ts index fb8717354b96..db7856449c15 100644 --- a/sdk/storage/storage-file/src/utils/RetriableReadableStream.ts +++ b/sdk/storage/storage-file/src/utils/RetriableReadableStream.ts @@ -5,23 +5,22 @@ import { RestError, TransferProgressEvent } from "@azure/ms-rest-js"; import { Readable } from "stream"; import { Aborter } from "../Aborter"; -export type ReadableStreamGetter = ( - offset: number -) => Promise; +export type ReadableStreamGetter = (offset: number) => Promise; -export interface IRetriableReadableStreamOptions { +export interface RetriableReadableStreamOptions { + abortSignal?: Aborter; /** * Max retry count (>=0), undefined or invalid value means no retry * * @type {number} - * @memberof IRetriableReadableStreamOptions + * @memberof RetriableReadableStreamOptions */ maxRetryRequests?: number; /** * Read progress event handler * - * @memberof IRetriableReadableStreamOptions + * @memberof RetriableReadableStreamOptions */ progress?: (progress: TransferProgressEvent) => void; @@ -35,7 +34,7 @@ export interface IRetriableReadableStreamOptions { * The value will then update to "undefined", once the injection works. * * @type {boolean} - * @memberof IRetriableReadableStreamOptions + * @memberof RetriableReadableStreamOptions */ doInjectErrorOnce?: boolean; } @@ -58,30 +57,28 @@ export class RetriableReadableStream extends Readable { private retries: number = 0; private maxRetryRequests: number; private progress?: (progress: TransferProgressEvent) => void; - private options: IRetriableReadableStreamOptions; + private options: RetriableReadableStreamOptions; /** * Creates an instance of RetriableReadableStream. * - * @param {Aborter} aborter Create a new Aborter instance with Aborter.none or Aborter.timeout(), - * goto documents of Aborter for more examples about request cancellation * @param {NodeJS.ReadableStream} source The current ReadableStream returned from getter * @param {ReadableStreamGetter} getter A method calling downloading request returning * a new ReadableStream from specified offset * @param {number} offset Offset position in original data source to read * @param {number} count How much data in original data source to read - * @param {IRetriableReadableStreamOptions} [options={}] + * @param {RetriableReadableStreamOptions} [options={}] * @memberof RetriableReadableStream */ public constructor( - aborter: Aborter, source: NodeJS.ReadableStream, getter: ReadableStreamGetter, offset: number, count: number, - options: IRetriableReadableStreamOptions = {} + options: RetriableReadableStreamOptions = {} ) { super(); + const aborter = options.abortSignal || Aborter.none; this.aborter = aborter; this.getter = getter; this.source = source; @@ -89,21 +86,13 @@ export class RetriableReadableStream extends Readable { this.offset = offset; this.end = offset + count - 1; this.maxRetryRequests = - options.maxRetryRequests && options.maxRetryRequests >= 0 - ? options.maxRetryRequests - : 0; + options.maxRetryRequests && options.maxRetryRequests >= 0 ? options.maxRetryRequests : 0; this.progress = options.progress; this.options = options; aborter.addEventListener("abort", () => { this.source.pause(); - this.emit( - "error", - new RestError( - "The request was aborted", - RestError.REQUEST_ABORTED_ERROR - ) - ); + this.emit("error", new RestError("The request was aborted", RestError.REQUEST_ABORTED_ERROR)); }); this.setSourceDataHandler(); @@ -156,13 +145,13 @@ export class RetriableReadableStream extends Readable { if (this.retries < this.maxRetryRequests) { this.retries += 1; this.getter(this.offset) - .then(newSource => { + .then((newSource) => { this.source = newSource; this.setSourceDataHandler(); this.setSourceEndHandler(); this.setSourceErrorHandler(); }) - .catch(error => { + .catch((error) => { this.emit("error", error); }); } else { @@ -191,7 +180,7 @@ export class RetriableReadableStream extends Readable { } private setSourceErrorHandler() { - this.source.on("error", error => { + this.source.on("error", (error) => { this.emit("error", error); }); } diff --git a/sdk/storage/storage-file/src/utils/constants.ts b/sdk/storage/storage-file/src/utils/constants.ts index 7aeb56ff7fda..f53f64e22441 100644 --- a/sdk/storage/storage-file/src/utils/constants.ts +++ b/sdk/storage/storage-file/src/utils/constants.ts @@ -1,7 +1,7 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -export const SDK_VERSION: string = "10.1.0"; +export const SDK_VERSION: string = "11.0.0-preview.1"; export const SERVICE_VERSION: string = "2018-03-28"; export const FILE_MAX_SIZE_BYTES: number = 1024 * 1024 * 1024 * 1024; // 1TB diff --git a/sdk/storage/storage-file/src/utils/utils.common.ts b/sdk/storage/storage-file/src/utils/utils.common.ts index 97f285e6f7ce..f3cfd39592f6 100644 --- a/sdk/storage/storage-file/src/utils/utils.common.ts +++ b/sdk/storage/storage-file/src/utils/utils.common.ts @@ -8,9 +8,9 @@ import { isNode, URLBuilder } from "@azure/ms-rest-js"; * * ## URL encode and escape strategy for JSv10 SDKs * - * When customers pass a URL string into XXXURL classes constructor, the URL string may already be URL encoded or not. + * When customers pass a URL string into XXXClient classes constructor, the URL string may already be URL encoded or not. * But before sending to Azure Storage server, the URL must be encoded. However, it's hard for a SDK to guess whether the URL - * string has been encoded or not. We have 2 potential strategies, and chose strategy two for the XXXURL constructors. + * string has been encoded or not. We have 2 potential strategies, and chose strategy two for the XXXClient constructors. * * ### Strategy One: Assume the customer URL string is not encoded, and always encode URL string in SDK. * @@ -46,7 +46,7 @@ import { isNode, URLBuilder } from "@azure/ms-rest-js"; * * Another special character is "?", use "%2F" to represent a blob name with "?" in a URL string. * - * ### Strategy for containerName, blobName or other specific XXXName parameters in methods such as `BlobURL.fromContainerURL(containerURL, blobName)` + * ### Strategy for containerName, blobName or other specific XXXName parameters in methods such as `BlobClient.fromContainerClient(containerClient, blobName)` * * We will apply strategy one, and call encodeURIComponent for these parameters like blobName. Because what customers passes in is a plain name instead of a URL. * @@ -96,11 +96,7 @@ export function appendToURLPath(url: string, name: string): string { const urlParsed = URLBuilder.parse(url); let path = urlParsed.getPath(); - path = path - ? path.endsWith("/") - ? `${path}${name}` - : `${path}/${name}` - : name; + path = path ? (path.endsWith("/") ? `${path}${name}` : `${path}/${name}`) : name; urlParsed.setPath(path); return urlParsed.toString(); @@ -116,11 +112,7 @@ export function appendToURLPath(url: string, name: string): string { * @param {string} [value] Parameter value * @returns {string} An updated URL string */ -export function setURLParameter( - url: string, - name: string, - value?: string -): string { +export function setURLParameter(url: string, name: string, value?: string): string { const urlParsed = URLBuilder.parse(url); urlParsed.setQueryParameter(name, value); return urlParsed.toString(); @@ -134,10 +126,7 @@ export function setURLParameter( * @param {string} name * @returns {(string | string[] | undefined)} */ -export function getURLParameter( - url: string, - name: string -): string | string[] | undefined { +export function getURLParameter(url: string, name: string): string | string[] | undefined { const urlParsed = URLBuilder.parse(url); return urlParsed.getQueryParameterValue(name); } @@ -182,18 +171,14 @@ export function getURLQueries(url: string): { [key: string]: string } { } queryString = queryString.trim(); - queryString = queryString.startsWith("?") - ? queryString.substr(1) - : queryString; + queryString = queryString.startsWith("?") ? queryString.substr(1) : queryString; let querySubStrings: string[] = queryString.split("&"); querySubStrings = querySubStrings.filter((value: string) => { const indexOfEqual = value.indexOf("="); const lastIndexOfEqual = value.lastIndexOf("="); return ( - indexOfEqual > 0 && - indexOfEqual === lastIndexOfEqual && - lastIndexOfEqual < value.length - 1 + indexOfEqual > 0 && indexOfEqual === lastIndexOfEqual && lastIndexOfEqual < value.length - 1 ); }); @@ -217,10 +202,7 @@ export function getURLQueries(url: string): { [key: string]: string } { * If false, YYYY-MM-DDThh:mm:ssZ will be returned. * @returns {string} Date string in ISO8061 format, with or without 7 milliseconds component */ -export function truncatedISO8061Date( - date: Date, - withMilliseconds: boolean = true -): string { +export function truncatedISO8061Date(date: Date, withMilliseconds: boolean = true): string { // Date.toISOString() will return like "2018-10-29T06:34:36.139Z" const dateString = date.toISOString(); @@ -248,9 +230,7 @@ export function base64encode(content: string): string { * @returns {string} */ export function base64decode(encodedString: string): string { - return !isNode - ? atob(encodedString) - : Buffer.from(encodedString, "base64").toString(); + return !isNode ? atob(encodedString) : Buffer.from(encodedString, "base64").toString(); } /** diff --git a/sdk/storage/storage-file/src/utils/utils.node.ts b/sdk/storage/storage-file/src/utils/utils.node.ts index 6e2021fcd72f..849e92a90c51 100644 --- a/sdk/storage/storage-file/src/utils/utils.node.ts +++ b/sdk/storage/storage-file/src/utils/utils.node.ts @@ -38,14 +38,9 @@ export async function streamToBuffer( } // How much data needed in this chunk - const chunkLength = - pos + chunk.length > count ? count - pos : chunk.length; + const chunkLength = pos + chunk.length > count ? count - pos : chunk.length; - buffer.fill( - chunk.slice(0, chunkLength), - offset + pos, - offset + pos + chunkLength - ); + buffer.fill(chunk.slice(0, chunkLength), offset + pos, offset + pos + chunkLength); pos += chunkLength; }); diff --git a/sdk/storage/storage-file/test/aborter.test.ts b/sdk/storage/storage-file/test/aborter.spec.ts similarity index 67% rename from sdk/storage/storage-file/test/aborter.test.ts rename to sdk/storage/storage-file/test/aborter.spec.ts index 6f8def20c25f..4322193c1844 100644 --- a/sdk/storage/storage-file/test/aborter.test.ts +++ b/sdk/storage/storage-file/test/aborter.spec.ts @@ -1,20 +1,20 @@ import * as assert from "assert"; import { Aborter } from "../src/Aborter"; -import { ShareURL } from "../src/ShareURL"; +import { ShareClient } from "../src/ShareClient"; import { getBSU, getUniqueName } from "./utils"; import * as dotenv from "dotenv"; -dotenv.config({path:"../.env"}); +dotenv.config({ path: "../.env" }); // tslint:disable:no-empty describe("Aborter", () => { - const serviceURL = getBSU(); + const serviceClient = getBSU(); let shareName: string = getUniqueName("share"); - let shareURL = ShareURL.fromServiceURL(serviceURL, shareName); + let shareClient = ShareClient.fromFileServiceClient(serviceClient, shareName); beforeEach(async () => { shareName = getUniqueName("share"); - shareURL = ShareURL.fromServiceURL(serviceURL, shareName); + shareClient = ShareClient.fromFileServiceClient(serviceClient, shareName); }); it("should set value and get value successfully", async () => { @@ -23,13 +23,13 @@ describe("Aborter", () => { }); it("Should not abort after calling abort()", async () => { - await shareURL.create(Aborter.none); - await shareURL.delete(Aborter.none); + await shareClient.create(); + await shareClient.delete(); }); it("Should abort when calling abort() before request finishes", async () => { const aborter = Aborter.none; - const response = shareURL.create(aborter); + const response = shareClient.create({ abortSignal: aborter }); aborter.abort(); try { await response; @@ -39,13 +39,13 @@ describe("Aborter", () => { it("Should not abort when calling abort() after request finishes", async () => { const aborter = Aborter.none; - await shareURL.create(aborter); + await shareClient.create(); aborter.abort(); }); it("Should abort after aborter timeout", async () => { try { - await shareURL.create(Aborter.timeout(1)); + await shareClient.create({ abortSignal: Aborter.timeout(1) }); assert.fail(); } catch (err) {} }); @@ -53,7 +53,7 @@ describe("Aborter", () => { it("Should abort after parent aborter calls abort()", async () => { try { const aborter = Aborter.none; - const response = shareURL.create(aborter.withTimeout(10 * 60 * 1000)); + const response = shareClient.create({ abortSignal: aborter.withTimeout(10 * 60 * 1000) }); aborter.abort(); await response; assert.fail(); @@ -63,7 +63,7 @@ describe("Aborter", () => { it("Should abort after parent aborter timeout", async () => { try { const aborter = Aborter.timeout(1); - const response = shareURL.create(aborter.withTimeout(10 * 60 * 1000)); + const response = shareClient.create({ abortSignal: aborter.withTimeout(10 * 60 * 1000) }); await response; assert.fail(); } catch (err) {} diff --git a/sdk/storage/storage-file/test/directoryclient.spec.ts b/sdk/storage/storage-file/test/directoryclient.spec.ts new file mode 100644 index 000000000000..2c220531dd57 --- /dev/null +++ b/sdk/storage/storage-file/test/directoryclient.spec.ts @@ -0,0 +1,179 @@ +import * as assert from "assert"; +import { DirectoryClient } from "../src/DirectoryClient"; +import { FileClient } from "../src/FileClient"; +import { ShareClient } from "../src/ShareClient"; +import { getBSU, getUniqueName } from "./utils"; +import * as dotenv from "dotenv"; +dotenv.config({ path: "../.env" }); + +describe("DirectoryClient", () => { + const serviceClient = getBSU(); + let shareName = getUniqueName("share"); + let shareClient = ShareClient.fromFileServiceClient(serviceClient, shareName); + let dirName = getUniqueName("dir"); + let dirClient = DirectoryClient.fromShareClient(shareClient, dirName); + + beforeEach(async () => { + shareName = getUniqueName("share"); + shareClient = ShareClient.fromFileServiceClient(serviceClient, shareName); + await shareClient.create(); + + dirName = getUniqueName("dir"); + dirClient = DirectoryClient.fromShareClient(shareClient, dirName); + await dirClient.create(); + }); + + afterEach(async () => { + await dirClient.delete(); + await shareClient.delete(); + }); + + it("setMetadata", async () => { + const metadata = { + key0: "val0", + keya: "vala", + keyb: "valb" + }; + try { + await dirClient.setMetadata(metadata); + + const result = await dirClient.getProperties(); + assert.deepEqual(result.metadata, metadata); + } catch (err) { + console.log(err); + } + }); + + it("getProperties", async () => { + const result = await dirClient.getProperties(); + assert.ok(result.eTag!.length > 0); + assert.ok(result.lastModified); + assert.ok(result.requestId); + assert.ok(result.version); + assert.ok(result.date); + }); + + it("create with default parameters", (done) => { + // create() with default parameters has been tested in beforeEach + done(); + }); + + it("create with all parameters configured", async () => { + const cClient = ShareClient.fromFileServiceClient(serviceClient, getUniqueName(shareName)); + const metadata = { key: "value" }; + await cClient.create({ metadata }); + const result = await cClient.getProperties(); + assert.deepStrictEqual(result.metadata, metadata); + }); + + it("delete", (done) => { + // delete() with default parameters has been tested in afterEach + done(); + }); + + it("listFilesAndDirectoriesSegment under root directory", async () => { + const subDirClients = []; + const rootDirClient = DirectoryClient.fromShareClient(shareClient, ""); + + const prefix = getUniqueName(`pre${new Date().getTime().toString()}`); + for (let i = 0; i < 3; i++) { + const subDirClient = DirectoryClient.fromDirectoryClient( + rootDirClient, + getUniqueName(`${prefix}dir${i}`) + ); + await subDirClient.create(); + subDirClients.push(subDirClient); + } + + const subFileClients = []; + for (let i = 0; i < 3; i++) { + const subFileClient = FileClient.fromDirectoryClient( + rootDirClient, + getUniqueName(`${prefix}file${i}`) + ); + await subFileClient.create(1024); + subFileClients.push(subFileClient); + } + + const result = await rootDirClient.listFilesAndDirectoriesSegment(undefined, { + prefix + }); + assert.ok(result.serviceEndpoint.length > 0); + assert.ok(shareClient.url.indexOf(result.shareName)); + assert.deepStrictEqual(result.nextMarker, ""); + assert.deepStrictEqual(result.segment.directoryItems.length, subDirClients.length); + assert.deepStrictEqual(result.segment.fileItems.length, subFileClients.length); + + let i = 0; + for (const entry of result.segment.directoryItems) { + assert.ok(subDirClients[i++].url.indexOf(entry.name) > 0); + } + + i = 0; + for (const entry of result.segment.fileItems) { + assert.ok(subFileClients[i++].url.indexOf(entry.name) > 0); + } + + for (const subFile of subFileClients) { + await subFile.delete(); + } + for (const subDir of subDirClients) { + await subDir.delete(); + } + }); + + it("listFilesAndDirectoriesSegment with all parameters confirgured", async () => { + const subDirClients = []; + const rootDirClient = DirectoryClient.fromShareClient(shareClient, ""); + + const prefix = getUniqueName(`pre${new Date().getTime().toString()}`); + for (let i = 0; i < 3; i++) { + const subDirClient = DirectoryClient.fromDirectoryClient( + rootDirClient, + getUniqueName(`${prefix}dir${i}`) + ); + await subDirClient.create(); + subDirClients.push(subDirClient); + } + + const subFileClients = []; + for (let i = 0; i < 3; i++) { + const subFileClient = FileClient.fromDirectoryClient( + rootDirClient, + getUniqueName(`${prefix}file${i}`) + ); + await subFileClient.create(1024); + subFileClients.push(subFileClient); + } + + const firstRequestSize = Math.ceil((subDirClients.length + subFileClients.length) / 2); + const secondRequestSize = subDirClients.length + subFileClients.length - firstRequestSize; + + const firstResult = await rootDirClient.listFilesAndDirectoriesSegment(undefined, { + prefix, + maxresults: firstRequestSize + }); + + assert.deepStrictEqual( + firstResult.segment.directoryItems.length + firstResult.segment.fileItems.length, + firstRequestSize + ); + assert.notDeepEqual(firstResult.nextMarker, undefined); + + const secondResult = await rootDirClient.listFilesAndDirectoriesSegment( + firstResult.nextMarker, + { prefix, maxresults: firstRequestSize + secondRequestSize } + ); + assert.deepStrictEqual( + secondResult.segment.directoryItems.length + secondResult.segment.fileItems.length, + secondRequestSize + ); + + for (const subFile of subFileClients) { + await subFile.delete(); + } + for (const subDir of subDirClients) { + await subDir.delete(); + } + }); +}); diff --git a/sdk/storage/storage-file/test/directoryurl.test.ts b/sdk/storage/storage-file/test/directoryurl.test.ts deleted file mode 100644 index 5a4c7330ea73..000000000000 --- a/sdk/storage/storage-file/test/directoryurl.test.ts +++ /dev/null @@ -1,193 +0,0 @@ -import * as assert from "assert"; - -import { Aborter } from "../src/Aborter"; -import { DirectoryURL } from "../src/DirectoryURL"; -import { FileURL } from "../src/FileURL"; -import { ShareURL } from "../src/ShareURL"; -import { getBSU, getUniqueName } from "./utils"; -import * as dotenv from "dotenv"; -dotenv.config({path:"../.env"}); - -describe("DirectoryURL", () => { - const serviceURL = getBSU(); - let shareName = getUniqueName("share"); - let shareURL = ShareURL.fromServiceURL(serviceURL, shareName); - let dirName = getUniqueName("dir"); - let dirURL = DirectoryURL.fromShareURL(shareURL, dirName); - - beforeEach(async () => { - shareName = getUniqueName("share"); - shareURL = ShareURL.fromServiceURL(serviceURL, shareName); - await shareURL.create(Aborter.none); - - dirName = getUniqueName("dir"); - dirURL = DirectoryURL.fromShareURL(shareURL, dirName); - await dirURL.create(Aborter.none); - }); - - afterEach(async () => { - await dirURL.delete(Aborter.none); - await shareURL.delete(Aborter.none); - }); - - it("setMetadata", async () => { - const metadata = { - key0: "val0", - keya: "vala", - keyb: "valb" - }; - try { - await dirURL.setMetadata(Aborter.none, metadata); - - const result = await dirURL.getProperties(Aborter.none); - assert.deepEqual(result.metadata, metadata); - } catch (err) { - console.log(err); - } - }); - - it("getProperties", async () => { - const result = await dirURL.getProperties(Aborter.none); - assert.ok(result.eTag!.length > 0); - assert.ok(result.lastModified); - assert.ok(result.requestId); - assert.ok(result.version); - assert.ok(result.date); - }); - - it("create with default parameters", done => { - // create() with default parameters has been tested in beforeEach - done(); - }); - - it("create with all parameters configured", async () => { - const cURL = ShareURL.fromServiceURL(serviceURL, getUniqueName(shareName)); - const metadata = { key: "value" }; - await cURL.create(Aborter.none, { metadata }); - const result = await cURL.getProperties(Aborter.none); - assert.deepStrictEqual(result.metadata, metadata); - }); - - it("delete", done => { - // delete() with default parameters has been tested in afterEach - done(); - }); - - it("listFilesAndDirectoriesSegment under root directory", async () => { - const subDirURLs = []; - const rootDirURL = DirectoryURL.fromShareURL(shareURL, ""); - - const prefix = getUniqueName(`pre${new Date().getTime().toString()}`); - for (let i = 0; i < 3; i++) { - const subDirURL = DirectoryURL.fromDirectoryURL( - rootDirURL, - getUniqueName(`${prefix}dir${i}`) - ); - await subDirURL.create(Aborter.none); - subDirURLs.push(subDirURL); - } - - const subFileURLs = []; - for (let i = 0; i < 3; i++) { - const subFileURL = FileURL.fromDirectoryURL( - rootDirURL, - getUniqueName(`${prefix}file${i}`) - ); - await subFileURL.create(Aborter.none, 1024); - subFileURLs.push(subFileURL); - } - - const result = await rootDirURL.listFilesAndDirectoriesSegment( - Aborter.none, - undefined, - { prefix } - ); - assert.ok(result.serviceEndpoint.length > 0); - assert.ok(shareURL.url.indexOf(result.shareName)); - assert.deepStrictEqual(result.nextMarker, ""); - assert.deepStrictEqual( - result.segment.directoryItems.length, - subDirURLs.length - ); - assert.deepStrictEqual(result.segment.fileItems.length, subFileURLs.length); - - let i = 0; - for (const entry of result.segment.directoryItems) { - assert.ok(subDirURLs[i++].url.indexOf(entry.name) > 0); - } - - i = 0; - for (const entry of result.segment.fileItems) { - assert.ok(subFileURLs[i++].url.indexOf(entry.name) > 0); - } - - for (const subFile of subFileURLs) { - await subFile.delete(Aborter.none); - } - for (const subDir of subDirURLs) { - await subDir.delete(Aborter.none); - } - }); - - it("listFilesAndDirectoriesSegment with all parameters confirgured", async () => { - const subDirURLs = []; - const rootDirURL = DirectoryURL.fromShareURL(shareURL, ""); - - const prefix = getUniqueName(`pre${new Date().getTime().toString()}`); - for (let i = 0; i < 3; i++) { - const subDirURL = DirectoryURL.fromDirectoryURL( - rootDirURL, - getUniqueName(`${prefix}dir${i}`) - ); - await subDirURL.create(Aborter.none); - subDirURLs.push(subDirURL); - } - - const subFileURLs = []; - for (let i = 0; i < 3; i++) { - const subFileURL = FileURL.fromDirectoryURL( - rootDirURL, - getUniqueName(`${prefix}file${i}`) - ); - await subFileURL.create(Aborter.none, 1024); - subFileURLs.push(subFileURL); - } - - const firstRequestSize = Math.ceil( - (subDirURLs.length + subFileURLs.length) / 2 - ); - const secondRequestSize = - subDirURLs.length + subFileURLs.length - firstRequestSize; - - const firstResult = await rootDirURL.listFilesAndDirectoriesSegment( - Aborter.none, - undefined, - { prefix, maxresults: firstRequestSize } - ); - - assert.deepStrictEqual( - firstResult.segment.directoryItems.length + - firstResult.segment.fileItems.length, - firstRequestSize - ); - assert.notDeepEqual(firstResult.nextMarker, undefined); - - const secondResult = await rootDirURL.listFilesAndDirectoriesSegment( - Aborter.none, - firstResult.nextMarker, - { prefix, maxresults: firstRequestSize + secondRequestSize } - ); - assert.deepStrictEqual( - secondResult.segment.directoryItems.length + - secondResult.segment.fileItems.length, - secondRequestSize - ); - - for (const subFile of subFileURLs) { - await subFile.delete(Aborter.none); - } - for (const subDir of subDirURLs) { - await subDir.delete(Aborter.none); - } - }); -}); diff --git a/sdk/storage/storage-file/test/fileurl.test.ts b/sdk/storage/storage-file/test/fileclient.spec.ts similarity index 50% rename from sdk/storage/storage-file/test/fileurl.test.ts rename to sdk/storage/storage-file/test/fileclient.spec.ts index a59963d1eb22..7397a3d2040c 100644 --- a/sdk/storage/storage-file/test/fileurl.test.ts +++ b/sdk/storage/storage-file/test/fileclient.spec.ts @@ -1,44 +1,43 @@ import * as assert from "assert"; import { isNode } from "@azure/ms-rest-js"; - -import { Aborter } from "../src/Aborter"; -import { DirectoryURL } from "../src/DirectoryURL"; -import { FileURL } from "../src/FileURL"; -import { ShareURL } from "../src/ShareURL"; +import { DirectoryClient } from "../src/DirectoryClient"; +import { FileClient } from "../src/FileClient"; +import { ShareClient } from "../src/ShareClient"; import { bodyToString, getBSU, getUniqueName, sleep } from "./utils"; import * as dotenv from "dotenv"; -dotenv.config({path:"../.env"}); +import { Aborter } from "../src"; +dotenv.config({ path: "../.env" }); -describe("FileURL", () => { - const serviceURL = getBSU(); +describe("FileClient", () => { + const serviceClient = getBSU(); let shareName = getUniqueName("share"); - let shareURL = ShareURL.fromServiceURL(serviceURL, shareName); + let shareClient = ShareClient.fromFileServiceClient(serviceClient, shareName); let dirName = getUniqueName("dir"); - let dirURL = DirectoryURL.fromShareURL(shareURL, dirName); + let dirClient = DirectoryClient.fromShareClient(shareClient, dirName); let fileName = getUniqueName("file"); - let fileURL = FileURL.fromDirectoryURL(dirURL, fileName); + let fileClient = FileClient.fromDirectoryClient(dirClient, fileName); const content = "Hello World"; beforeEach(async () => { shareName = getUniqueName("share"); - shareURL = ShareURL.fromServiceURL(serviceURL, shareName); - await shareURL.create(Aborter.none); + shareClient = ShareClient.fromFileServiceClient(serviceClient, shareName); + await shareClient.create(); dirName = getUniqueName("dir"); - dirURL = DirectoryURL.fromShareURL(shareURL, dirName); - await dirURL.create(Aborter.none); + dirClient = DirectoryClient.fromShareClient(shareClient, dirName); + await dirClient.create(); fileName = getUniqueName("file"); - fileURL = FileURL.fromDirectoryURL(dirURL, fileName); + fileClient = FileClient.fromDirectoryClient(dirClient, fileName); }); afterEach(async () => { - await shareURL.delete(Aborter.none); + await shareClient.delete(); }); it("create with default parameters", async () => { - await fileURL.create(Aborter.none, content.length); - const result = await fileURL.download(Aborter.none, 0); + await fileClient.create(content.length); + const result = await fileClient.download(0); assert.deepStrictEqual( await bodyToString(result, content.length), "\u0000".repeat(content.length) @@ -59,69 +58,51 @@ describe("FileURL", () => { key2: "valb" } }; - await fileURL.create(Aborter.none, 512, options); + await fileClient.create(512, options); - const result = await fileURL.download(Aborter.none, 0); - assert.deepStrictEqual( - await bodyToString(result, 512), - "\u0000".repeat(512) - ); + const result = await fileClient.download(0); + assert.deepStrictEqual(await bodyToString(result, 512), "\u0000".repeat(512)); - const properties = await fileURL.getProperties(Aborter.none); - assert.equal( - properties.cacheControl, - options.fileHTTPHeaders.fileCacheControl - ); - assert.equal( - properties.contentDisposition, - options.fileHTTPHeaders.fileContentDisposition - ); - assert.equal( - properties.contentEncoding, - options.fileHTTPHeaders.fileContentEncoding - ); - assert.equal( - properties.contentLanguage, - options.fileHTTPHeaders.fileContentLanguage - ); - assert.equal( - properties.contentType, - options.fileHTTPHeaders.fileContentType - ); + const properties = await fileClient.getProperties(); + assert.equal(properties.cacheControl, options.fileHTTPHeaders.fileCacheControl); + assert.equal(properties.contentDisposition, options.fileHTTPHeaders.fileContentDisposition); + assert.equal(properties.contentEncoding, options.fileHTTPHeaders.fileContentEncoding); + assert.equal(properties.contentLanguage, options.fileHTTPHeaders.fileContentLanguage); + assert.equal(properties.contentType, options.fileHTTPHeaders.fileContentType); assert.equal(properties.metadata!.key1, options.metadata.key1); assert.equal(properties.metadata!.key2, options.metadata.key2); }); it("setMetadata with new metadata set", async () => { - await fileURL.create(Aborter.none, content.length); + await fileClient.create(content.length); const metadata = { a: "a", b: "b" }; - await fileURL.setMetadata(Aborter.none, metadata); - const result = await fileURL.getProperties(Aborter.none); + await fileClient.setMetadata(metadata); + const result = await fileClient.getProperties(); assert.deepStrictEqual(result.metadata, metadata); }); it("setMetadata with cleaning up metadata", async () => { - await fileURL.create(Aborter.none, content.length); + await fileClient.create(content.length); const metadata = { a: "a", b: "b" }; - await fileURL.setMetadata(Aborter.none, metadata); - const result = await fileURL.getProperties(Aborter.none); + await fileClient.setMetadata(metadata); + const result = await fileClient.getProperties(); assert.deepStrictEqual(result.metadata, metadata); - await fileURL.setMetadata(Aborter.none); - const result2 = await fileURL.getProperties(Aborter.none); + await fileClient.setMetadata(); + const result2 = await fileClient.getProperties(); assert.deepStrictEqual(result2.metadata, {}); }); it("setHTTPHeaders with default parameters", async () => { - await fileURL.create(Aborter.none, content.length); - await fileURL.setHTTPHeaders(Aborter.none, {}); - const result = await fileURL.getProperties(Aborter.none); + await fileClient.create(content.length); + await fileClient.setHTTPHeaders({}); + const result = await fileClient.getProperties(); assert.ok(result.lastModified); assert.deepStrictEqual(result.metadata, {}); @@ -134,19 +115,17 @@ describe("FileURL", () => { }); it("setHTTPHeaders with all parameters set", async () => { - await fileURL.create(Aborter.none, content.length); + await fileClient.create(content.length); const headers = { fileCacheControl: "fileCacheControl", fileContentDisposition: "fileContentDisposition", fileContentEncoding: "fileContentEncoding", fileContentLanguage: "fileContentLanguage", - fileContentMD5: isNode - ? Buffer.from([1, 2, 3, 4]) - : new Uint8Array([1, 2, 3, 4]), + fileContentMD5: isNode ? Buffer.from([1, 2, 3, 4]) : new Uint8Array([1, 2, 3, 4]), fileContentType: "fileContentType" }; - await fileURL.setHTTPHeaders(Aborter.none, headers); - const result = await fileURL.getProperties(Aborter.none); + await fileClient.setHTTPHeaders(headers); + const result = await fileClient.getProperties(); assert.ok(result.lastModified); assert.deepStrictEqual(result.metadata, {}); assert.deepStrictEqual(result.cacheControl, headers.fileCacheControl); @@ -154,45 +133,36 @@ describe("FileURL", () => { assert.deepStrictEqual(result.contentMD5, headers.fileContentMD5); assert.deepStrictEqual(result.contentEncoding, headers.fileContentEncoding); assert.deepStrictEqual(result.contentLanguage, headers.fileContentLanguage); - assert.deepStrictEqual( - result.contentDisposition, - headers.fileContentDisposition - ); + assert.deepStrictEqual(result.contentDisposition, headers.fileContentDisposition); }); it("delete", async () => { - await fileURL.create(Aborter.none, content.length); - await fileURL.delete(Aborter.none); + await fileClient.create(content.length); + await fileClient.delete(); }); it("startCopyFromURL", async () => { - await fileURL.create(Aborter.none, 1024); - const newFileURL = FileURL.fromDirectoryURL( - dirURL, - getUniqueName("copiedfile") - ); - const result = await newFileURL.startCopyFromURL(Aborter.none, fileURL.url); + await fileClient.create(1024); + const newFileClient = FileClient.fromDirectoryClient(dirClient, getUniqueName("copiedfile")); + const result = await newFileClient.startCopyFromURL(fileClient.url); assert.ok(result.copyId); - const properties1 = await fileURL.getProperties(Aborter.none); - const properties2 = await newFileURL.getProperties(Aborter.none); + const properties1 = await fileClient.getProperties(); + const properties2 = await newFileClient.getProperties(); assert.deepStrictEqual(properties1.contentMD5, properties2.contentMD5); assert.deepStrictEqual(properties2.copyId, result.copyId); - assert.deepStrictEqual(properties2.copySource, fileURL.url); + assert.deepStrictEqual(properties2.copySource, fileClient.url); }); it("abortCopyFromURL should failed for a completed copy operation", async () => { - await fileURL.create(Aborter.none, content.length); - const newFileURL = FileURL.fromDirectoryURL( - dirURL, - getUniqueName("copiedfile") - ); - const result = await newFileURL.startCopyFromURL(Aborter.none, fileURL.url); + await fileClient.create(content.length); + const newFileClient = FileClient.fromDirectoryClient(dirClient, getUniqueName("copiedfile")); + const result = await newFileClient.startCopyFromURL(fileClient.url); assert.ok(result.copyId); sleep(1 * 1000); try { - await newFileURL.abortCopyFromURL(Aborter.none, result.copyId!); + await newFileClient.abortCopyFromURL(result.copyId!); assert.fail( "AbortCopyFromURL should be failed and throw exception for an completed copy operation." ); @@ -202,26 +172,26 @@ describe("FileURL", () => { }); it("resize", async () => { - await fileURL.create(Aborter.none, content.length); - const properties = await fileURL.getProperties(Aborter.none); + await fileClient.create(content.length); + const properties = await fileClient.getProperties(); assert.deepStrictEqual(properties.contentLength, content.length); - await fileURL.resize(Aborter.none, 1); - const updatedProperties = await fileURL.getProperties(Aborter.none); + await fileClient.resize(1); + const updatedProperties = await fileClient.getProperties(); assert.deepStrictEqual(updatedProperties.contentLength, 1); }); it("uploadRange", async () => { - await fileURL.create(Aborter.none, 10); - await fileURL.uploadRange(Aborter.none, "Hello", 0, 5); - await fileURL.uploadRange(Aborter.none, "World", 5, 5); - const response = await fileURL.download(Aborter.none, 0, 8); + await fileClient.create(10); + await fileClient.uploadRange("Hello", 0, 5); + await fileClient.uploadRange("World", 5, 5); + const response = await fileClient.download(0, 8); assert.deepStrictEqual(await bodyToString(response, 8), "HelloWor"); }); it("uploadRange with conent MD5", async () => { - await fileURL.create(Aborter.none, 10); - await fileURL.uploadRange(Aborter.none, "Hello", 0, 5, { + await fileClient.create(10); + await fileClient.uploadRange("Hello", 0, 5, { contentMD5: new Uint8Array([ 0x8b, 0x1a, @@ -241,15 +211,15 @@ describe("FileURL", () => { 0xd7 ]) }); - await fileURL.uploadRange(Aborter.none, "World", 5, 5); - const response = await fileURL.download(Aborter.none, 0, 8); + await fileClient.uploadRange("World", 5, 5); + const response = await fileClient.download(0, 8); assert.deepStrictEqual(await bodyToString(response, 8), "HelloWor"); }); it("uploadRange with progress event", async () => { - await fileURL.create(Aborter.none, 10); + await fileClient.create(10); let progressUpdated = false; - await fileURL.uploadRange(Aborter.none, "HelloWorld", 0, 10, { + await fileClient.uploadRange("HelloWorld", 0, 10, { progress: () => { progressUpdated = true; } @@ -258,60 +228,57 @@ describe("FileURL", () => { }); it("clearRange", async () => { - await fileURL.create(Aborter.none, 10); - await fileURL.uploadRange(Aborter.none, "Hello", 0, 5); - await fileURL.uploadRange(Aborter.none, "World", 5, 5); - await fileURL.clearRange(Aborter.none, 1, 8); + await fileClient.create(10); + await fileClient.uploadRange("Hello", 0, 5); + await fileClient.uploadRange("World", 5, 5); + await fileClient.clearRange(1, 8); - const result = await fileURL.download(Aborter.none, 0); - assert.deepStrictEqual( - await bodyToString(result, 10), - "H" + "\u0000".repeat(8) + "d" - ); + const result = await fileClient.download(0); + assert.deepStrictEqual(await bodyToString(result, 10), "H" + "\u0000".repeat(8) + "d"); }); it("getRangeList", async () => { - await fileURL.create(Aborter.none, 10); - await fileURL.uploadRange(Aborter.none, "Hello", 0, 5); - await fileURL.uploadRange(Aborter.none, "World", 5, 5); - await fileURL.clearRange(Aborter.none, 1, 8); + await fileClient.create(10); + await fileClient.uploadRange("Hello", 0, 5); + await fileClient.uploadRange("World", 5, 5); + await fileClient.clearRange(1, 8); - const result = await fileURL.getRangeList(Aborter.none); + const result = await fileClient.getRangeList(); assert.deepStrictEqual(result.rangeList.length, 1); assert.deepStrictEqual(result.rangeList[0], { start: 0, end: 9 }); }); it("download with with default parameters", async () => { - await fileURL.create(Aborter.none, content.length); - await fileURL.uploadRange(Aborter.none, content, 0, content.length); - const result = await fileURL.download(Aborter.none, 0); + await fileClient.create(content.length); + await fileClient.uploadRange(content, 0, content.length); + const result = await fileClient.download(0); assert.deepStrictEqual(await bodyToString(result, content.length), content); }); it("download all parameters set", async () => { - await fileURL.create(Aborter.none, content.length); - await fileURL.uploadRange(Aborter.none, content, 0, content.length); - const result = await fileURL.download(Aborter.none, 0, 1, { + await fileClient.create(content.length); + await fileClient.uploadRange(content, 0, content.length); + const result = await fileClient.download(0, 1, { rangeGetContentMD5: true }); assert.deepStrictEqual(await bodyToString(result, 1), content[0]); }); it("download partial content", async () => { - await fileURL.create(Aborter.none, 10); - await fileURL.uploadRange(Aborter.none, "HelloWorld", 0, 10); + await fileClient.create(10); + await fileClient.uploadRange("HelloWorld", 0, 10); - const result = await fileURL.download(Aborter.none, 0, 2); + const result = await fileClient.download(0, 2); assert.deepStrictEqual(await bodyToString(result, 2), "He"); }); it("download should update progress and abort successfully", async () => { - await fileURL.create(Aborter.none, 128 * 1024 * 1024); + await fileClient.create(128 * 1024 * 1024); let eventTriggered = false; try { const aborter = Aborter.none; - const result = await fileURL.download(aborter, 0, undefined, { + const result = await fileClient.download(0, undefined, { progress: () => { eventTriggered = true; aborter.abort(); diff --git a/sdk/storage/storage-file/test/serviceurl.test.ts b/sdk/storage/storage-file/test/fileserviceclient.spec.ts similarity index 69% rename from sdk/storage/storage-file/test/serviceurl.test.ts rename to sdk/storage/storage-file/test/fileserviceclient.spec.ts index 95230f66bc2c..e2b9e3d61837 100644 --- a/sdk/storage/storage-file/test/serviceurl.test.ts +++ b/sdk/storage/storage-file/test/fileserviceclient.spec.ts @@ -1,15 +1,13 @@ import * as assert from "assert"; - -import { Aborter } from "../src/Aborter"; -import { ShareURL } from "../src/ShareURL"; +import { ShareClient } from "../src/ShareClient"; import { getBSU, getUniqueName, wait } from "./utils"; import * as dotenv from "dotenv"; -dotenv.config({path:"../.env"}); +dotenv.config({ path: "../.env" }); -describe("ServiceURL", () => { +describe("FileServiceClient", () => { it("ListShares with default parameters", async () => { - const serviceURL = getBSU(); - const result = await serviceURL.listSharesSegment(Aborter.none); + const serviceClient = getBSU(); + const result = await serviceClient.listSharesSegment(); assert.ok(typeof result.requestId); assert.ok(result.requestId!.length > 0); @@ -28,25 +26,21 @@ describe("ServiceURL", () => { }); it("ListShares with all parameters configured", async () => { - const serviceURL = getBSU(); + const serviceClient = getBSU(); const shareNamePrefix = getUniqueName("share"); const shareName1 = `${shareNamePrefix}x1`; const shareName2 = `${shareNamePrefix}x2`; - const shareURL1 = ShareURL.fromServiceURL(serviceURL, shareName1); - const shareURL2 = ShareURL.fromServiceURL(serviceURL, shareName2); - await shareURL1.create(Aborter.none, { metadata: { key: "val" } }); - await shareURL2.create(Aborter.none, { metadata: { key: "val" } }); - - const result1 = await serviceURL.listSharesSegment( - Aborter.none, - undefined, - { - include: ["metadata", "snapshots"], - maxresults: 1, - prefix: shareNamePrefix - } - ); + const shareClient1 = ShareClient.fromFileServiceClient(serviceClient, shareName1); + const shareClient2 = ShareClient.fromFileServiceClient(serviceClient, shareName2); + await shareClient1.create({ metadata: { key: "val" } }); + await shareClient2.create({ metadata: { key: "val" } }); + + const result1 = await serviceClient.listSharesSegment(undefined, { + include: ["metadata", "snapshots"], + maxresults: 1, + prefix: shareNamePrefix + }); assert.ok(result1.nextMarker); assert.equal(result1.shareItems!.length, 1); @@ -55,15 +49,11 @@ describe("ServiceURL", () => { assert.ok(result1.shareItems![0].properties.lastModified); assert.deepEqual(result1.shareItems![0].metadata!.key, "val"); - const result2 = await serviceURL.listSharesSegment( - Aborter.none, - result1.nextMarker, - { - include: ["metadata", "snapshots"], - maxresults: 1, - prefix: shareNamePrefix - } - ); + const result2 = await serviceClient.listSharesSegment(result1.nextMarker, { + include: ["metadata", "snapshots"], + maxresults: 1, + prefix: shareNamePrefix + }); assert.ok(!result2.nextMarker); assert.equal(result2.shareItems!.length, 1); @@ -72,13 +62,13 @@ describe("ServiceURL", () => { assert.ok(result2.shareItems![0].properties.lastModified); assert.deepEqual(result2.shareItems![0].metadata!.key, "val"); - await shareURL1.delete(Aborter.none); - await shareURL2.delete(Aborter.none); + await shareClient1.delete(); + await shareClient2.delete(); }); it("GetProperties", async () => { - const serviceURL = getBSU(); - const result = await serviceURL.getProperties(Aborter.none); + const serviceClient = getBSU(); + const result = await serviceClient.getProperties(); assert.ok(typeof result.requestId); assert.ok(result.requestId!.length > 0); @@ -95,9 +85,9 @@ describe("ServiceURL", () => { }); it("SetProperties", async () => { - const serviceURL = getBSU(); + const serviceClient = getBSU(); - const serviceProperties = await serviceURL.getProperties(Aborter.none); + const serviceProperties = await serviceClient.getProperties(); serviceProperties.minuteMetrics = { enabled: true, @@ -132,10 +122,10 @@ describe("ServiceURL", () => { serviceProperties.cors.push(newCORS); } - await serviceURL.setProperties(Aborter.none, serviceProperties); + await serviceClient.setProperties(serviceProperties); await wait(5 * 1000); - const result = await serviceURL.getProperties(Aborter.none); + const result = await serviceClient.getProperties(); assert.ok(typeof result.requestId); assert.ok(result.requestId!.length > 0); assert.ok(typeof result.version); diff --git a/sdk/storage/storage-file/test/node/fileurl.test.ts b/sdk/storage/storage-file/test/node/fileclient.spec.ts similarity index 53% rename from sdk/storage/storage-file/test/node/fileurl.test.ts rename to sdk/storage/storage-file/test/node/fileclient.spec.ts index 6f942307ac08..78ee1fc9c310 100644 --- a/sdk/storage/storage-file/test/node/fileurl.test.ts +++ b/sdk/storage/storage-file/test/node/fileclient.spec.ts @@ -1,55 +1,52 @@ import * as assert from "assert"; import { Duplex } from "stream"; - -import { Aborter } from "../../src/Aborter"; -import { DirectoryURL } from "../../src/DirectoryURL"; -import { FileURL } from "../../src/FileURL"; -import { ShareURL } from "../../src/ShareURL"; +import { DirectoryClient } from "../../src/DirectoryClient"; +import { FileClient } from "../../src/FileClient"; +import { ShareClient } from "../../src/ShareClient"; import { bodyToString, getBSU, getUniqueName } from "../utils"; import { Buffer } from "buffer"; describe("BlockBlobURL Node.js only", () => { - const serviceURL = getBSU(); + const serviceClient = getBSU(); let shareName = getUniqueName("share"); - let shareURL = ShareURL.fromServiceURL(serviceURL, shareName); + let shareClient = ShareClient.fromFileServiceClient(serviceClient, shareName); let dirName = getUniqueName("dir"); - let dirURL = DirectoryURL.fromShareURL(shareURL, dirName); + let dirClient = DirectoryClient.fromShareClient(shareClient, dirName); let fileName = getUniqueName("file"); - let fileURL = FileURL.fromDirectoryURL(dirURL, fileName); + let fileClient = FileClient.fromDirectoryClient(dirClient, fileName); beforeEach(async () => { shareName = getUniqueName("share"); - shareURL = ShareURL.fromServiceURL(serviceURL, shareName); - await shareURL.create(Aborter.none); + shareClient = ShareClient.fromFileServiceClient(serviceClient, shareName); + await shareClient.create(); dirName = getUniqueName("dir"); - dirURL = DirectoryURL.fromShareURL(shareURL, dirName); - await dirURL.create(Aborter.none); + dirClient = DirectoryClient.fromShareClient(shareClient, dirName); + await dirClient.create(); fileName = getUniqueName("file"); - fileURL = FileURL.fromDirectoryURL(dirURL, fileName); + fileClient = FileClient.fromDirectoryClient(dirClient, fileName); }); afterEach(async () => { - await shareURL.delete(Aborter.none); + await shareClient.delete(); }); it("upload with buffer and default parameters", async () => { const body: string = getUniqueName("randomstring"); const bodyBuffer = Buffer.from(body); - await fileURL.create(Aborter.none, body.length); - await fileURL.uploadRange(Aborter.none, bodyBuffer, 0, body.length); - const result = await fileURL.download(Aborter.none, 0); + await fileClient.create(body.length); + await fileClient.uploadRange(bodyBuffer, 0, body.length); + const result = await fileClient.download(0); assert.deepStrictEqual(await bodyToString(result, body.length), body); }); it("upload with Node.js stream", async () => { const body: string = getUniqueName("randomstring"); - await fileURL.create(Aborter.none, body.length); - await fileURL.uploadRange( - Aborter.none, + await fileClient.create(body.length); + await fileClient.uploadRange( () => { const duplexStream = new Duplex(); duplexStream.push(body); @@ -59,7 +56,7 @@ describe("BlockBlobURL Node.js only", () => { 0, body.length ); - const result = await fileURL.download(Aborter.none, 0); + const result = await fileClient.download(0); assert.deepStrictEqual(await bodyToString(result, body.length), body); }); @@ -67,9 +64,9 @@ describe("BlockBlobURL Node.js only", () => { const body: string = getUniqueName("randomstring你好"); const bodyLength = Buffer.byteLength(body); - await fileURL.create(Aborter.none, bodyLength); - await fileURL.uploadRange(Aborter.none, body, 0, bodyLength); - const result = await fileURL.download(Aborter.none, 0); + await fileClient.create(bodyLength); + await fileClient.uploadRange(body, 0, bodyLength); + const result = await fileClient.download(0); assert.deepStrictEqual(await bodyToString(result, bodyLength), body); }); }); diff --git a/sdk/storage/storage-file/test/node/highlevel.node.test.ts b/sdk/storage/storage-file/test/node/highlevel.node.spec.ts similarity index 50% rename from sdk/storage/storage-file/test/node/highlevel.node.test.ts rename to sdk/storage/storage-file/test/node/highlevel.node.spec.ts index 9be923eb83a6..72b290dde8d9 100644 --- a/sdk/storage/storage-file/test/node/highlevel.node.test.ts +++ b/sdk/storage/storage-file/test/node/highlevel.node.spec.ts @@ -2,31 +2,26 @@ import * as assert from "assert"; import * as fs from "fs"; import * as path from "path"; -import { FileURL, ShareURL } from "../../src"; +import { FileClient, ShareClient } from "../../src"; import { Aborter } from "../../src/Aborter"; -import { DirectoryURL } from "../../src/DirectoryURL"; +import { DirectoryClient } from "../../src/DirectoryClient"; import { downloadAzureFileToBuffer, uploadFileToAzureFile, uploadStreamToAzureFile } from "../../src/highlevel.node"; -import { - createRandomLocalFile, - getBSU, - getUniqueName, - readStreamToLocalFile -} from "../utils"; -import { IRetriableReadableStreamOptions } from "../../src/utils/RetriableReadableStream"; +import { createRandomLocalFile, getBSU, getUniqueName, readStreamToLocalFile } from "../utils"; +import { RetriableReadableStreamOptions } from "../../src/utils/RetriableReadableStream"; // tslint:disable:no-empty describe("Highlevel", () => { - const serviceURL = getBSU(); + const serviceClient = getBSU(); let shareName = getUniqueName("share"); - let shareURL = ShareURL.fromServiceURL(serviceURL, shareName); + let shareClient = ShareClient.fromFileServiceClient(serviceClient, shareName); let dirName = getUniqueName("dir"); - let dirURL = DirectoryURL.fromShareURL(shareURL, dirName); + let dirClient = DirectoryClient.fromShareClient(shareClient, dirName); let fileName = getUniqueName("file"); - let fileURL = FileURL.fromDirectoryURL(dirURL, fileName); + let fileClient = FileClient.fromDirectoryClient(dirClient, fileName); let tempFileSmall: string; let tempFileSmallLength: number; let tempFileLarge: string; @@ -35,34 +30,26 @@ describe("Highlevel", () => { beforeEach(async () => { shareName = getUniqueName("share"); - shareURL = ShareURL.fromServiceURL(serviceURL, shareName); - await shareURL.create(Aborter.none); + shareClient = ShareClient.fromFileServiceClient(serviceClient, shareName); + await shareClient.create(); dirName = getUniqueName("dir"); - dirURL = DirectoryURL.fromShareURL(shareURL, dirName); - await dirURL.create(Aborter.none); + dirClient = DirectoryClient.fromShareClient(shareClient, dirName); + await dirClient.create(); fileName = getUniqueName("file"); - fileURL = FileURL.fromDirectoryURL(dirURL, fileName); + fileClient = FileClient.fromDirectoryClient(dirClient, fileName); }); afterEach(async () => { - await shareURL.delete(Aborter.none); + await shareClient.delete(); }); before(async () => { if (!fs.existsSync(tempFolderPath)) { fs.mkdirSync(tempFolderPath); } - tempFileLarge = await createRandomLocalFile( - tempFolderPath, - 257, - 1024 * 1024 - ); + tempFileLarge = await createRandomLocalFile(tempFolderPath, 257, 1024 * 1024); tempFileLargeLength = 257 * 1024 * 1024; - tempFileSmall = await createRandomLocalFile( - tempFolderPath, - 15, - 1024 * 1024 - ); + tempFileSmall = await createRandomLocalFile(tempFolderPath, 15, 1024 * 1024); tempFileSmallLength = 15 * 1024 * 1024; }); @@ -72,20 +59,14 @@ describe("Highlevel", () => { }); it("uploadFileToAzureFile should success for large data", async () => { - await uploadFileToAzureFile(Aborter.none, tempFileLarge, fileURL, { + await uploadFileToAzureFile(tempFileLarge, fileClient, { parallelism: 20, rangeSize: 4 * 1024 * 1024 }); - const downloadResponse = await fileURL.download(Aborter.none, 0); - const downloadedFile = path.join( - tempFolderPath, - getUniqueName("downloadfile.") - ); - await readStreamToLocalFile( - downloadResponse.readableStreamBody!, - downloadedFile - ); + const downloadResponse = await fileClient.download(0); + const downloadedFile = path.join(tempFolderPath, getUniqueName("downloadfile.")); + await readStreamToLocalFile(downloadResponse.readableStreamBody!, downloadedFile); const downloadedData = await fs.readFileSync(downloadedFile); const uploadedData = await fs.readFileSync(tempFileLarge); @@ -95,20 +76,14 @@ describe("Highlevel", () => { }); it("uploadFileToAzureFile should success for samll data", async () => { - await uploadFileToAzureFile(Aborter.none, tempFileSmall, fileURL, { + await uploadFileToAzureFile(tempFileSmall, fileClient, { parallelism: 20, rangeSize: 4 * 1024 * 1024 }); - const downloadResponse = await fileURL.download(Aborter.none, 0); - const downloadedFile = path.join( - tempFolderPath, - getUniqueName("downloadfile.") - ); - await readStreamToLocalFile( - downloadResponse.readableStreamBody!, - downloadedFile - ); + const downloadResponse = await fileClient.download(0); + const downloadedFile = path.join(tempFolderPath, getUniqueName("downloadfile.")); + await readStreamToLocalFile(downloadResponse.readableStreamBody!, downloadedFile); const downloadedData = await fs.readFileSync(downloadedFile); const uploadedData = await fs.readFileSync(tempFileSmall); @@ -121,7 +96,8 @@ describe("Highlevel", () => { const aborter = Aborter.timeout(1); try { - await uploadFileToAzureFile(aborter, tempFileLarge, fileURL, { + await uploadFileToAzureFile(tempFileLarge, fileClient, { + abortSignal: aborter, parallelism: 20, rangeSize: 4 * 1024 * 1024 }); @@ -135,7 +111,8 @@ describe("Highlevel", () => { const aborter = Aborter.timeout(1); try { - await uploadFileToAzureFile(aborter, tempFileSmall, fileURL, { + await uploadFileToAzureFile(tempFileSmall, fileClient, { + abortSignal: aborter, parallelism: 20, rangeSize: 4 * 1024 * 1024 }); @@ -150,9 +127,10 @@ describe("Highlevel", () => { const aborter = Aborter.none; try { - await uploadFileToAzureFile(aborter, tempFileLarge, fileURL, { + await uploadFileToAzureFile(tempFileLarge, fileClient, { + abortSignal: aborter, parallelism: 20, - progress: ev => { + progress: (ev) => { assert.ok(ev.loadedBytes); eventTriggered = true; aborter.abort(); @@ -168,9 +146,10 @@ describe("Highlevel", () => { const aborter = Aborter.none; try { - await uploadFileToAzureFile(aborter, tempFileSmall, fileURL, { + await uploadFileToAzureFile(tempFileSmall, fileClient, { + abortSignal: aborter, parallelism: 20, - progress: ev => { + progress: (ev) => { assert.ok(ev.loadedBytes); eventTriggered = true; aborter.abort(); @@ -183,25 +162,12 @@ describe("Highlevel", () => { it("uploadStreamToAzureFile should success", async () => { const rs = fs.createReadStream(tempFileLarge); - await uploadStreamToAzureFile( - Aborter.none, - rs, - tempFileLargeLength, - fileURL, - 4 * 1024 * 1024, - 20 - ); - - const downloadResponse = await fileURL.download(Aborter.none, 0); - - const downloadFilePath = path.join( - tempFolderPath, - getUniqueName("downloadFile") - ); - await readStreamToLocalFile( - downloadResponse.readableStreamBody!, - downloadFilePath - ); + await uploadStreamToAzureFile(rs, tempFileLargeLength, fileClient, 4 * 1024 * 1024, 20); + + const downloadResponse = await fileClient.download(0); + + const downloadFilePath = path.join(tempFolderPath, getUniqueName("downloadFile")); + await readStreamToLocalFile(downloadResponse.readableStreamBody!, downloadFilePath); const downloadedBuffer = fs.readFileSync(downloadFilePath); const uploadedBuffer = fs.readFileSync(tempFileLarge); @@ -215,14 +181,9 @@ describe("Highlevel", () => { const aborter = Aborter.timeout(1); try { - await uploadStreamToAzureFile( - aborter, - rs, - tempFileLargeLength, - fileURL, - 4 * 1024 * 1024, - 20 - ); + await uploadStreamToAzureFile(rs, tempFileLargeLength, fileClient, 4 * 1024 * 1024, 20, { + abortSignal: aborter + }); assert.fail(); } catch (err) { assert.ok((err.code as string).toLowerCase().includes("abort")); @@ -233,36 +194,21 @@ describe("Highlevel", () => { const rs = fs.createReadStream(tempFileLarge); let eventTriggered = false; - await uploadStreamToAzureFile( - Aborter.none, - rs, - tempFileLargeLength, - fileURL, - 4 * 1024 * 1024, - 20, - { - progress: ev => { - assert.ok(ev.loadedBytes); - eventTriggered = true; - } + await uploadStreamToAzureFile(rs, tempFileLargeLength, fileClient, 4 * 1024 * 1024, 20, { + progress: (ev) => { + assert.ok(ev.loadedBytes); + eventTriggered = true; } - ); + }); assert.ok(eventTriggered); }); it("downloadAzureFileToBuffer should success", async () => { const rs = fs.createReadStream(tempFileLarge); - await uploadStreamToAzureFile( - Aborter.none, - rs, - tempFileLargeLength, - fileURL, - 4 * 1024 * 1024, - 20 - ); + await uploadStreamToAzureFile(rs, tempFileLargeLength, fileClient, 4 * 1024 * 1024, 20); const buf = Buffer.alloc(tempFileLargeLength); - await downloadAzureFileToBuffer(Aborter.none, buf, fileURL, 0, undefined, { + await downloadAzureFileToBuffer(buf, fileClient, 0, undefined, { parallelism: 20, rangeSize: 4 * 1024 * 1024 }); @@ -273,28 +219,15 @@ describe("Highlevel", () => { it("downloadAzureFileToBuffer should abort", async () => { const rs = fs.createReadStream(tempFileLarge); - await uploadStreamToAzureFile( - Aborter.none, - rs, - tempFileLargeLength, - fileURL, - 4 * 1024 * 1024, - 20 - ); + await uploadStreamToAzureFile(rs, tempFileLargeLength, fileClient, 4 * 1024 * 1024, 20); try { const buf = Buffer.alloc(tempFileLargeLength); - await downloadAzureFileToBuffer( - Aborter.timeout(1), - buf, - fileURL, - 0, - undefined, - { - parallelism: 20, - rangeSize: 4 * 1024 * 1024 - } - ); + await downloadAzureFileToBuffer(buf, fileClient, 0, undefined, { + abortSignal: Aborter.timeout(1), + parallelism: 20, + rangeSize: 4 * 1024 * 1024 + }); assert.fail(); } catch (err) { assert.ok((err.code as string).toLowerCase().includes("abort")); @@ -303,20 +236,14 @@ describe("Highlevel", () => { it("downloadAzureFileToBuffer should update progress event", async () => { const rs = fs.createReadStream(tempFileSmall); - await uploadStreamToAzureFile( - Aborter.none, - rs, - tempFileSmallLength, - fileURL, - 4 * 1024 * 1024, - 10 - ); + await uploadStreamToAzureFile(rs, tempFileSmallLength, fileClient, 4 * 1024 * 1024, 10); let eventTriggered = false; const buf = Buffer.alloc(tempFileSmallLength); const aborter = Aborter.none; try { - await downloadAzureFileToBuffer(aborter, buf, fileURL, 0, undefined, { + await downloadAzureFileToBuffer(buf, fileClient, 0, undefined, { + abortSignal: aborter, parallelism: 1, progress: () => { eventTriggered = true; @@ -328,38 +255,26 @@ describe("Highlevel", () => { assert.ok(eventTriggered); }); - it("bloburl.download should success when internal stream unexcepted ends at the stream end", async () => { - await uploadFileToAzureFile(Aborter.none, tempFileSmall, fileURL, { + it("fileClient.download should success when internal stream unexcepted ends at the stream end", async () => { + await uploadFileToAzureFile(tempFileSmall, fileClient, { rangeSize: 4 * 1024 * 1024, parallelism: 20 }); - let retirableReadableStreamOptions: IRetriableReadableStreamOptions; - const downloadResponse = await fileURL.download( - Aborter.none, - 0, - undefined, - { - maxRetryRequests: 1, - progress: ev => { - if (ev.loadedBytes >= tempFileSmallLength) { - retirableReadableStreamOptions.doInjectErrorOnce = true; - } + let retirableReadableStreamOptions: RetriableReadableStreamOptions; + const downloadResponse = await fileClient.download(0, undefined, { + maxRetryRequests: 1, + progress: (ev) => { + if (ev.loadedBytes >= tempFileSmallLength) { + retirableReadableStreamOptions.doInjectErrorOnce = true; } } - ); + }); - retirableReadableStreamOptions = (downloadResponse.readableStreamBody! as any) - .options; + retirableReadableStreamOptions = (downloadResponse.readableStreamBody! as any).options; - const downloadedFile = path.join( - tempFolderPath, - getUniqueName("downloadfile.") - ); - await readStreamToLocalFile( - downloadResponse.readableStreamBody!, - downloadedFile - ); + const downloadedFile = path.join(tempFolderPath, getUniqueName("downloadfile.")); + await readStreamToLocalFile(downloadResponse.readableStreamBody!, downloadedFile); const downloadedData = await fs.readFileSync(downloadedFile); const uploadedData = await fs.readFileSync(tempFileSmall); @@ -368,39 +283,27 @@ describe("Highlevel", () => { assert.ok(downloadedData.equals(uploadedData)); }); - it("bloburl.download should download full data successfully when internal stream unexcepted ends", async () => { - await uploadFileToAzureFile(Aborter.none, tempFileSmall, fileURL, { + it("fileClient.download should download full data successfully when internal stream unexcepted ends", async () => { + await uploadFileToAzureFile(tempFileSmall, fileClient, { rangeSize: 4 * 1024 * 1024, parallelism: 20 }); - let retirableReadableStreamOptions: IRetriableReadableStreamOptions; + let retirableReadableStreamOptions: RetriableReadableStreamOptions; let injectedErrors = 0; - const downloadResponse = await fileURL.download( - Aborter.none, - 0, - undefined, - { - maxRetryRequests: 3, - progress: () => { - if (injectedErrors++ < 3) { - retirableReadableStreamOptions.doInjectErrorOnce = true; - } + const downloadResponse = await fileClient.download(0, undefined, { + maxRetryRequests: 3, + progress: () => { + if (injectedErrors++ < 3) { + retirableReadableStreamOptions.doInjectErrorOnce = true; } } - ); + }); - retirableReadableStreamOptions = (downloadResponse.readableStreamBody! as any) - .options; + retirableReadableStreamOptions = (downloadResponse.readableStreamBody! as any).options; - const downloadedFile = path.join( - tempFolderPath, - getUniqueName("downloadfile.") - ); - await readStreamToLocalFile( - downloadResponse.readableStreamBody!, - downloadedFile - ); + const downloadedFile = path.join(tempFolderPath, getUniqueName("downloadfile.")); + await readStreamToLocalFile(downloadResponse.readableStreamBody!, downloadedFile); const downloadedData = await fs.readFileSync(downloadedFile); const uploadedData = await fs.readFileSync(tempFileSmall); @@ -409,41 +312,29 @@ describe("Highlevel", () => { assert.ok(downloadedData.equals(uploadedData)); }); - it("bloburl.download should download partial data when internal stream unexcepted ends", async () => { - await uploadFileToAzureFile(Aborter.none, tempFileSmall, fileURL, { + it("fileClient.download should download partial data when internal stream unexcepted ends", async () => { + await uploadFileToAzureFile(tempFileSmall, fileClient, { rangeSize: 4 * 1024 * 1024, parallelism: 20 }); const partialSize = 10 * 1024; - let retirableReadableStreamOptions: IRetriableReadableStreamOptions; + let retirableReadableStreamOptions: RetriableReadableStreamOptions; let injectedErrors = 0; - const downloadResponse = await fileURL.download( - Aborter.none, - 1, - partialSize, - { - maxRetryRequests: 3, - progress: () => { - if (injectedErrors++ < 3) { - retirableReadableStreamOptions.doInjectErrorOnce = true; - } + const downloadResponse = await fileClient.download(1, partialSize, { + maxRetryRequests: 3, + progress: () => { + if (injectedErrors++ < 3) { + retirableReadableStreamOptions.doInjectErrorOnce = true; } } - ); + }); - retirableReadableStreamOptions = (downloadResponse.readableStreamBody! as any) - .options; + retirableReadableStreamOptions = (downloadResponse.readableStreamBody! as any).options; - const downloadedFile = path.join( - tempFolderPath, - getUniqueName("downloadfile.") - ); - await readStreamToLocalFile( - downloadResponse.readableStreamBody!, - downloadedFile - ); + const downloadedFile = path.join(tempFolderPath, getUniqueName("downloadfile.")); + await readStreamToLocalFile(downloadResponse.readableStreamBody!, downloadedFile); const downloadedData = await fs.readFileSync(downloadedFile); const uploadedData = await fs.readFileSync(tempFileSmall); @@ -452,41 +343,29 @@ describe("Highlevel", () => { assert.ok(downloadedData.equals(uploadedData.slice(1, partialSize + 1))); }); - it("bloburl.download should download data failed when exceeding max stream retry requests", async () => { - await uploadFileToAzureFile(Aborter.none, tempFileSmall, fileURL, { + it("fileClient.download should download data failed when exceeding max stream retry requests", async () => { + await uploadFileToAzureFile(tempFileSmall, fileClient, { rangeSize: 4 * 1024 * 1024, parallelism: 20 }); - const downloadedFile = path.join( - tempFolderPath, - getUniqueName("downloadfile.") - ); + const downloadedFile = path.join(tempFolderPath, getUniqueName("downloadfile.")); - let retirableReadableStreamOptions: IRetriableReadableStreamOptions; + let retirableReadableStreamOptions: RetriableReadableStreamOptions; let injectedErrors = 0; let expectedError = false; try { - const downloadResponse = await fileURL.download( - Aborter.none, - 0, - undefined, - { - maxRetryRequests: 0, - progress: () => { - if (injectedErrors++ < 1) { - retirableReadableStreamOptions.doInjectErrorOnce = true; - } + const downloadResponse = await fileClient.download(0, undefined, { + maxRetryRequests: 0, + progress: () => { + if (injectedErrors++ < 1) { + retirableReadableStreamOptions.doInjectErrorOnce = true; } } - ); - retirableReadableStreamOptions = (downloadResponse.readableStreamBody! as any) - .options; - await readStreamToLocalFile( - downloadResponse.readableStreamBody!, - downloadedFile - ); + }); + retirableReadableStreamOptions = (downloadResponse.readableStreamBody! as any).options; + await readStreamToLocalFile(downloadResponse.readableStreamBody!, downloadedFile); } catch (error) { expectedError = true; } @@ -495,24 +374,22 @@ describe("Highlevel", () => { fs.unlinkSync(downloadedFile); }); - it("bloburl.download should abort after retrys", async () => { - await uploadFileToAzureFile(Aborter.none, tempFileSmall, fileURL, { + it("fileClient.download should abort after retrys", async () => { + await uploadFileToAzureFile(tempFileSmall, fileClient, { rangeSize: 4 * 1024 * 1024, parallelism: 20 }); - const downloadedFile = path.join( - tempFolderPath, - getUniqueName("downloadfile.") - ); + const downloadedFile = path.join(tempFolderPath, getUniqueName("downloadfile.")); - let retirableReadableStreamOptions: IRetriableReadableStreamOptions; + let retirableReadableStreamOptions: RetriableReadableStreamOptions; let injectedErrors = 0; let expectedError = false; try { const aborter = Aborter.none; - const downloadResponse = await fileURL.download(aborter, 0, undefined, { + const downloadResponse = await fileClient.download(0, undefined, { + abortSignal: aborter, maxRetryRequests: 3, progress: () => { if (injectedErrors++ < 2) { @@ -524,12 +401,8 @@ describe("Highlevel", () => { } } }); - retirableReadableStreamOptions = (downloadResponse.readableStreamBody! as any) - .options; - await readStreamToLocalFile( - downloadResponse.readableStreamBody!, - downloadedFile - ); + retirableReadableStreamOptions = (downloadResponse.readableStreamBody! as any).options; + await readStreamToLocalFile(downloadResponse.readableStreamBody!, downloadedFile); } catch (error) { expectedError = true; } diff --git a/sdk/storage/storage-file/test/node/sas.test.ts b/sdk/storage/storage-file/test/node/sas.spec.ts similarity index 69% rename from sdk/storage/storage-file/test/node/sas.test.ts rename to sdk/storage/storage-file/test/node/sas.spec.ts index f8c5900c5c48..f73943bbdca9 100644 --- a/sdk/storage/storage-file/test/node/sas.test.ts +++ b/sdk/storage/storage-file/test/node/sas.spec.ts @@ -6,22 +6,21 @@ import { AccountSASServices, AnonymousCredential, generateAccountSASQueryParameters, - ServiceURL, + FileServiceClient, SharedKeyCredential, - StorageURL, + StorageClient, SASProtocol } from "../../src"; -import { Aborter } from "../../src/Aborter"; -import { DirectoryURL } from "../../src/DirectoryURL"; +import { DirectoryClient } from "../../src/DirectoryClient"; import { FileSASPermissions } from "../../src/FileSASPermissions"; -import { FileURL } from "../../src/FileURL"; -import { generateFileSASQueryParameters } from "../../src/IFileSASSignatureValues"; +import { FileClient } from "../../src/FileClient"; +import { generateFileSASQueryParameters } from "../../src/FileSASSignatureValues"; import { ShareSASPermissions } from "../../src/ShareSASPermissions"; -import { ShareURL } from "../../src/ShareURL"; +import { ShareClient } from "../../src/ShareClient"; import { getBSU, getUniqueName } from "../utils"; describe("Shared Access Signature (SAS) generation Node.js only", () => { - const serviceURL = getBSU(); + const serviceClient = getBSU(); it("generateAccountSASQueryParameters should work", async () => { const now = new Date(); @@ -31,7 +30,7 @@ describe("Shared Access Signature (SAS) generation Node.js only", () => { tmr.setDate(tmr.getDate() + 1); // By default, credential is always the last element of pipeline factories - const factories = serviceURL.pipeline.factories; + const factories = serviceClient.pipeline.factories; const sharedKeyCredential = factories[factories.length - 1]; const sas = generateAccountSASQueryParameters( @@ -48,13 +47,13 @@ describe("Shared Access Signature (SAS) generation Node.js only", () => { sharedKeyCredential as SharedKeyCredential ).toString(); - const sasURL = `${serviceURL.url}?${sas}`; - const serviceURLWithSAS = new ServiceURL( + const sasURL = `${serviceClient.url}?${sas}`; + const serviceClientWithSAS = new FileServiceClient( sasURL, - StorageURL.newPipeline(new AnonymousCredential()) + StorageClient.newPipeline(new AnonymousCredential()) ); - await serviceURLWithSAS.listSharesSegment(Aborter.none); + await serviceClientWithSAS.listSharesSegment(); }); it("generateAccountSASQueryParameters should not work with invalid permission", async () => { @@ -62,7 +61,7 @@ describe("Shared Access Signature (SAS) generation Node.js only", () => { tmr.setDate(tmr.getDate() + 1); // By default, credential is always the last element of pipeline factories - const factories = serviceURL.pipeline.factories; + const factories = serviceClient.pipeline.factories; const sharedKeyCredential = factories[factories.length - 1]; const sas = generateAccountSASQueryParameters( @@ -75,15 +74,15 @@ describe("Shared Access Signature (SAS) generation Node.js only", () => { sharedKeyCredential as SharedKeyCredential ).toString(); - const sasURL = `${serviceURL.url}?${sas}`; - const serviceURLWithSAS = new ServiceURL( + const sasURL = `${serviceClient.url}?${sas}`; + const serviceClientWithSAS = new FileServiceClient( sasURL, - StorageURL.newPipeline(new AnonymousCredential()) + StorageClient.newPipeline(new AnonymousCredential()) ); let error; try { - await serviceURLWithSAS.getProperties(Aborter.none); + await serviceClientWithSAS.getProperties(); } catch (err) { error = err; } @@ -96,7 +95,7 @@ describe("Shared Access Signature (SAS) generation Node.js only", () => { tmr.setDate(tmr.getDate() + 1); // By default, credential is always the last element of pipeline factories - const factories = serviceURL.pipeline.factories; + const factories = serviceClient.pipeline.factories; const sharedKeyCredential = factories[factories.length - 1]; const sas = generateAccountSASQueryParameters( @@ -109,15 +108,15 @@ describe("Shared Access Signature (SAS) generation Node.js only", () => { sharedKeyCredential as SharedKeyCredential ).toString(); - const sasURL = `${serviceURL.url}?${sas}`; - const serviceURLWithSAS = new ServiceURL( + const sasURL = `${serviceClient.url}?${sas}`; + const serviceClientWithSAS = new FileServiceClient( sasURL, - StorageURL.newPipeline(new AnonymousCredential()) + StorageClient.newPipeline(new AnonymousCredential()) ); let error; try { - await serviceURLWithSAS.getProperties(Aborter.none); + await serviceClientWithSAS.getProperties(); } catch (err) { error = err; } @@ -130,7 +129,7 @@ describe("Shared Access Signature (SAS) generation Node.js only", () => { tmr.setDate(tmr.getDate() + 1); // By default, credential is always the last element of pipeline factories - const factories = serviceURL.pipeline.factories; + const factories = serviceClient.pipeline.factories; const sharedKeyCredential = factories[factories.length - 1]; const sas = generateAccountSASQueryParameters( @@ -146,15 +145,15 @@ describe("Shared Access Signature (SAS) generation Node.js only", () => { sharedKeyCredential as SharedKeyCredential ).toString(); - const sasURL = `${serviceURL.url}?${sas}`; - const serviceURLWithSAS = new ServiceURL( + const sasURL = `${serviceClient.url}?${sas}`; + const serviceClientWithSAS = new FileServiceClient( sasURL, - StorageURL.newPipeline(new AnonymousCredential()) + StorageClient.newPipeline(new AnonymousCredential()) ); let error; try { - await serviceURLWithSAS.getProperties(Aborter.none); + await serviceClientWithSAS.getProperties(); } catch (err) { error = err; } @@ -170,12 +169,12 @@ describe("Shared Access Signature (SAS) generation Node.js only", () => { tmr.setDate(tmr.getDate() + 1); // By default, credential is always the last element of pipeline factories - const factories = serviceURL.pipeline.factories; + const factories = serviceClient.pipeline.factories; const sharedKeyCredential = factories[factories.length - 1]; const shareName = getUniqueName("share"); - const shareURL = ShareURL.fromServiceURL(serviceURL, shareName); - await shareURL.create(Aborter.none); + const shareClient = ShareClient.fromFileServiceClient(serviceClient, shareName); + await shareClient.create(); const shareSAS = generateFileSASQueryParameters( { @@ -190,16 +189,16 @@ describe("Shared Access Signature (SAS) generation Node.js only", () => { sharedKeyCredential as SharedKeyCredential ); - const sasURL = `${shareURL.url}?${shareSAS}`; - const shareURLwithSAS = new ShareURL( + const sasURL = `${shareClient.url}?${shareSAS}`; + const shareClientwithSAS = new ShareClient( sasURL, - StorageURL.newPipeline(new AnonymousCredential()) + StorageClient.newPipeline(new AnonymousCredential()) ); - const dirURLwithSAS = DirectoryURL.fromShareURL(shareURLwithSAS, ""); - await dirURLwithSAS.listFilesAndDirectoriesSegment(Aborter.none); + const dirURLwithSAS = DirectoryClient.fromShareClient(shareClientwithSAS, ""); + await dirURLwithSAS.listFilesAndDirectoriesSegment(); - await shareURL.delete(Aborter.none); + await shareClient.delete(); }); it("generateFileSASQueryParameters should work for file", async () => { @@ -210,20 +209,20 @@ describe("Shared Access Signature (SAS) generation Node.js only", () => { tmr.setDate(tmr.getDate() + 1); // By default, credential is always the last element of pipeline factories - const factories = serviceURL.pipeline.factories; + const factories = serviceClient.pipeline.factories; const sharedKeyCredential = factories[factories.length - 1]; const shareName = getUniqueName("share"); - const shareURL = ShareURL.fromServiceURL(serviceURL, shareName); - await shareURL.create(Aborter.none); + const shareClient = ShareClient.fromFileServiceClient(serviceClient, shareName); + await shareClient.create(); const dirName = getUniqueName("dir"); - const dirURL = DirectoryURL.fromShareURL(shareURL, dirName); - await dirURL.create(Aborter.none); + const dirClient = DirectoryClient.fromShareClient(shareClient, dirName); + await dirClient.create(); const fileName = getUniqueName("file"); - const fileURL = FileURL.fromDirectoryURL(dirURL, fileName); - await fileURL.create(Aborter.none, 1024, { + const fileClient = FileClient.fromDirectoryClient(dirClient, fileName); + await fileClient.create(1024, { fileHTTPHeaders: { fileContentType: "content-type-original" } @@ -248,20 +247,20 @@ describe("Shared Access Signature (SAS) generation Node.js only", () => { sharedKeyCredential as SharedKeyCredential ); - const sasURL = `${fileURL.url}?${fileSAS}`; - const fileURLwithSAS = new FileURL( + const sasURL = `${fileClient.url}?${fileSAS}`; + const fileClientwithSAS = new FileClient( sasURL, - StorageURL.newPipeline(new AnonymousCredential()) + StorageClient.newPipeline(new AnonymousCredential()) ); - const properties = await fileURLwithSAS.getProperties(Aborter.none); + const properties = await fileClientwithSAS.getProperties(); assert.equal(properties.cacheControl, "cache-control-override"); assert.equal(properties.contentDisposition, "content-disposition-override"); assert.equal(properties.contentEncoding, "content-encoding-override"); assert.equal(properties.contentLanguage, "content-language-override"); assert.equal(properties.contentType, "content-type-override"); - await shareURL.delete(Aborter.none); + await shareClient.delete(); }); it("generateFileSASQueryParameters should work for file with access policy", async () => { @@ -272,27 +271,27 @@ describe("Shared Access Signature (SAS) generation Node.js only", () => { tmr.setDate(tmr.getDate() + 1); // By default, credential is always the last element of pipeline factories - const factories = serviceURL.pipeline.factories; + const factories = serviceClient.pipeline.factories; const sharedKeyCredential = factories[factories.length - 1]; const shareName = getUniqueName("share"); - const shareURL = ShareURL.fromServiceURL(serviceURL, shareName); - await shareURL.create(Aborter.none); + const shareClient = ShareClient.fromFileServiceClient(serviceClient, shareName); + await shareClient.create(); const dirName = getUniqueName("dir"); - const dirURL = DirectoryURL.fromShareURL(shareURL, dirName); - await dirURL.create(Aborter.none); + const dirClient = DirectoryClient.fromShareClient(shareClient, dirName); + await dirClient.create(); const fileName = getUniqueName("file"); - const fileURL = FileURL.fromDirectoryURL(dirURL, fileName); - await fileURL.create(Aborter.none, 1024, { + const fileClient = FileClient.fromDirectoryClient(dirClient, fileName); + await fileClient.create(1024, { fileHTTPHeaders: { fileContentType: "content-type-original" } }); const id = "unique-id"; - await shareURL.setAccessPolicy(Aborter.none, [ + await shareClient.setAccessPolicy([ { accessPolicy: { expiry: tmr, @@ -311,14 +310,14 @@ describe("Shared Access Signature (SAS) generation Node.js only", () => { sharedKeyCredential as SharedKeyCredential ); - const sasURL = `${shareURL.url}?${shareSAS}`; - const shareURLwithSAS = new ShareURL( + const sasURL = `${shareClient.url}?${shareSAS}`; + const shareClientwithSAS = new ShareClient( sasURL, - StorageURL.newPipeline(new AnonymousCredential()) + StorageClient.newPipeline(new AnonymousCredential()) ); - const dirURLwithSAS = DirectoryURL.fromShareURL(shareURLwithSAS, ""); - await dirURLwithSAS.listFilesAndDirectoriesSegment(Aborter.none); - await shareURL.delete(Aborter.none); + const dirURLwithSAS = DirectoryClient.fromShareClient(shareClientwithSAS, ""); + await dirURLwithSAS.listFilesAndDirectoriesSegment(); + await shareClient.delete(); }); }); diff --git a/sdk/storage/storage-file/test/node/shareurl.test.ts b/sdk/storage/storage-file/test/node/shareclient.spec.ts similarity index 62% rename from sdk/storage/storage-file/test/node/shareurl.test.ts rename to sdk/storage/storage-file/test/node/shareclient.spec.ts index 7e5dd66af850..d1701713f17f 100644 --- a/sdk/storage/storage-file/test/node/shareurl.test.ts +++ b/sdk/storage/storage-file/test/node/shareclient.spec.ts @@ -1,22 +1,20 @@ import * as assert from "assert"; - -import { Aborter } from "../../src/Aborter"; -import { ISignedIdentifier, ShareURL } from "../../src/ShareURL"; +import { SignedIdentifier, ShareClient } from "../../src/ShareClient"; import { getBSU, getUniqueName } from "./../utils"; -describe("ShareURL", () => { - const serviceURL = getBSU(); +describe("ShareClient", () => { + const serviceClient = getBSU(); let shareName: string = getUniqueName("share"); - let shareURL = ShareURL.fromServiceURL(serviceURL, shareName); + let shareClient = ShareClient.fromFileServiceClient(serviceClient, shareName); beforeEach(async () => { shareName = getUniqueName("share"); - shareURL = ShareURL.fromServiceURL(serviceURL, shareName); - await shareURL.create(Aborter.none); + shareClient = ShareClient.fromFileServiceClient(serviceClient, shareName); + await shareClient.create(); }); afterEach(async () => { - await shareURL.delete(Aborter.none); + await shareClient.delete(); }); it("setAccessPolicy", async () => { @@ -25,7 +23,7 @@ describe("ShareURL", () => { yesterday.setDate(yesterday.getDate() - 1); tomorrow.setDate(tomorrow.getDate() + 1); - const identifiers: ISignedIdentifier[] = [ + const identifiers: SignedIdentifier[] = [ { accessPolicy: { expiry: tomorrow, @@ -36,15 +34,10 @@ describe("ShareURL", () => { } ]; - await shareURL.setAccessPolicy(Aborter.none, identifiers); - const getAccessPolicyResponse = await shareURL.getAccessPolicy( - Aborter.none - ); + await shareClient.setAccessPolicy(identifiers); + const getAccessPolicyResponse = await shareClient.getAccessPolicy(); - assert.equal( - getAccessPolicyResponse.signedIdentifiers[0].id, - identifiers[0].id - ); + assert.equal(getAccessPolicyResponse.signedIdentifiers[0].id, identifiers[0].id); assert.equal( getAccessPolicyResponse.signedIdentifiers[0].accessPolicy.expiry.getTime(), identifiers[0].accessPolicy.expiry.getTime() @@ -59,7 +52,7 @@ describe("ShareURL", () => { ); }); - it("getAccessPolicy", done => { + it("getAccessPolicy", (done) => { // create() with default parameters has been tested in setAccessPolicy done(); }); diff --git a/sdk/storage/storage-file/test/node/sharedkeycredentialpolicy.spec.ts b/sdk/storage/storage-file/test/node/sharedkeycredentialpolicy.spec.ts new file mode 100644 index 000000000000..860a0d99acaf --- /dev/null +++ b/sdk/storage/storage-file/test/node/sharedkeycredentialpolicy.spec.ts @@ -0,0 +1,38 @@ +import { DirectoryClient } from "../../src/DirectoryClient"; +import { FileClient } from "../../src/FileClient"; +import { ShareClient } from "../../src/ShareClient"; +import { getBSU, getUniqueName } from "../utils"; + +describe("SharedKeyCredentialPolicy Node.js only", () => { + const serviceClient = getBSU(); + const shareName: string = getUniqueName("1share-with-dash"); + const shareClient = ShareClient.fromFileServiceClient(serviceClient, shareName); + + before(async () => { + await shareClient.create(); + }); + + after(async () => { + await shareClient.delete(); + }); + + it("SharedKeyCredentialPolicy should work with special share and file names with spaces", async () => { + const dirName = getUniqueName("dir empty"); + const dirClient = DirectoryClient.fromShareClient(shareClient, dirName); + await dirClient.create(); + + const fileName: string = getUniqueName("file empty"); + const fileClient = FileClient.fromDirectoryClient(dirClient, fileName); + await fileClient.create(0); + }); + + it("SharedKeyCredentialPolicy should work with special share and file names uppercase", async () => { + const dirName = getUniqueName("Dir empty"); + const dirClient = DirectoryClient.fromShareClient(shareClient, dirName); + await dirClient.create(); + + const fileName: string = getUniqueName("Upper_another"); + const fileClient = FileClient.fromDirectoryClient(dirClient, fileName); + await fileClient.create(0); + }); +}); diff --git a/sdk/storage/storage-file/test/node/sharedkeycredentialpolicy.test.ts b/sdk/storage/storage-file/test/node/sharedkeycredentialpolicy.test.ts deleted file mode 100644 index 54af3ddaaf0f..000000000000 --- a/sdk/storage/storage-file/test/node/sharedkeycredentialpolicy.test.ts +++ /dev/null @@ -1,39 +0,0 @@ -import { Aborter } from "../../src/Aborter"; -import { DirectoryURL } from "../../src/DirectoryURL"; -import { FileURL } from "../../src/FileURL"; -import { ShareURL } from "../../src/ShareURL"; -import { getBSU, getUniqueName } from "../utils"; - -describe("SharedKeyCredentialPolicy Node.js only", () => { - const serviceURL = getBSU(); - const shareName: string = getUniqueName("1share-with-dash"); - const shareURL = ShareURL.fromServiceURL(serviceURL, shareName); - - before(async () => { - await shareURL.create(Aborter.none); - }); - - after(async () => { - await shareURL.delete(Aborter.none); - }); - - it("SharedKeyCredentialPolicy should work with special share and file names with spaces", async () => { - const dirName = getUniqueName("dir empty"); - const dirURL = DirectoryURL.fromShareURL(shareURL, dirName); - await dirURL.create(Aborter.none); - - const fileName: string = getUniqueName("file empty"); - const fileURL = FileURL.fromDirectoryURL(dirURL, fileName); - await fileURL.create(Aborter.none, 0); - }); - - it("SharedKeyCredentialPolicy should work with special share and file names uppercase", async () => { - const dirName = getUniqueName("Dir empty"); - const dirURL = DirectoryURL.fromShareURL(shareURL, dirName); - await dirURL.create(Aborter.none); - - const fileName: string = getUniqueName("Upper_another"); - const fileURL = FileURL.fromDirectoryURL(dirURL, fileName); - await fileURL.create(Aborter.none, 0); - }); -}); diff --git a/sdk/storage/storage-file/test/retrypolicy.test.ts b/sdk/storage/storage-file/test/retrypolicy.spec.ts similarity index 57% rename from sdk/storage/storage-file/test/retrypolicy.test.ts rename to sdk/storage/storage-file/test/retrypolicy.spec.ts index 5816ef8a393d..35347c270f67 100644 --- a/sdk/storage/storage-file/test/retrypolicy.test.ts +++ b/sdk/storage/storage-file/test/retrypolicy.spec.ts @@ -1,27 +1,25 @@ import * as assert from "assert"; - -import { RestError, StorageURL } from "../src"; -import { Aborter } from "../src/Aborter"; -import { ShareURL } from "../src/ShareURL"; +import { RestError, StorageClient } from "../src"; +import { ShareClient } from "../src/ShareClient"; import { Pipeline } from "../src/Pipeline"; import { getBSU, getUniqueName } from "./utils"; import { InjectorPolicyFactory } from "./utils/InjectorPolicyFactory"; import * as dotenv from "dotenv"; -dotenv.config({path:"../.env"}); +dotenv.config({ path: "../.env" }); describe("RetryPolicy", () => { - const serviceURL = getBSU(); + const serviceClient = getBSU(); let shareName: string = getUniqueName("share"); - let shareURL = ShareURL.fromServiceURL(serviceURL, shareName); + let shareClient = ShareClient.fromFileServiceClient(serviceClient, shareName); beforeEach(async () => { shareName = getUniqueName("share"); - shareURL = ShareURL.fromServiceURL(serviceURL, shareName); - await shareURL.create(Aborter.none); + shareClient = ShareClient.fromFileServiceClient(serviceClient, shareName); + await shareClient.create(); }); afterEach(async () => { - await shareURL.delete(Aborter.none); + await shareClient.delete(); }); it("Retry Policy should work when first request fails with 500", async () => { @@ -29,26 +27,22 @@ describe("RetryPolicy", () => { const injector = new InjectorPolicyFactory(() => { if (injectCounter === 0) { injectCounter++; - return new RestError( - "Server Internal Error", - "ServerInternalError", - 500 - ); + return new RestError("Server Internal Error", "ServerInternalError", 500); } }); - const factories = shareURL.pipeline.factories.slice(); // clone factories array + const factories = shareClient.pipeline.factories.slice(); // clone factories array factories.push(injector); const pipeline = new Pipeline(factories); - const injectShareURL = shareURL.withPipeline(pipeline); + const injectShareClient = shareClient.withPipeline(pipeline); const metadata = { key0: "val0", keya: "vala", keyb: "valb" }; - await injectShareURL.setMetadata(Aborter.none, metadata); + await injectShareClient.setMetadata(metadata); - const result = await shareURL.getProperties(Aborter.none); + const result = await shareClient.getProperties(); assert.deepEqual(result.metadata, metadata); }); @@ -57,14 +51,13 @@ describe("RetryPolicy", () => { return new RestError("Server Internal Error", "ServerInternalError", 500); }); - const credential = - shareURL.pipeline.factories[shareURL.pipeline.factories.length - 1]; - const factories = StorageURL.newPipeline(credential, { + const credential = shareClient.pipeline.factories[shareClient.pipeline.factories.length - 1]; + const factories = StorageClient.newPipeline(credential, { retryOptions: { maxTries: 3 } }).factories; factories.push(injector); const pipeline = new Pipeline(factories); - const injectShareURL = shareURL.withPipeline(pipeline); + const injectShareClient = shareClient.withPipeline(pipeline); let hasError = false; try { @@ -73,7 +66,7 @@ describe("RetryPolicy", () => { keya: "vala", keyb: "valb" }; - await injectShareURL.setMetadata(Aborter.none, metadata); + await injectShareClient.setMetadata(metadata); } catch (err) { hasError = true; } diff --git a/sdk/storage/storage-file/test/shareurl.test.ts b/sdk/storage/storage-file/test/shareclient.spec.ts similarity index 52% rename from sdk/storage/storage-file/test/shareurl.test.ts rename to sdk/storage/storage-file/test/shareclient.spec.ts index feef6c17aab1..00ddc50fab25 100644 --- a/sdk/storage/storage-file/test/shareurl.test.ts +++ b/sdk/storage/storage-file/test/shareclient.spec.ts @@ -1,24 +1,22 @@ import * as assert from "assert"; - -import { Aborter } from "../src/Aborter"; -import { ShareURL } from "../src/ShareURL"; +import { ShareClient } from "../src/ShareClient"; import { getBSU, getUniqueName } from "./utils"; import * as dotenv from "dotenv"; -dotenv.config({path:"../.env"}); +dotenv.config({ path: "../.env" }); -describe("ShareURL", () => { - const serviceURL = getBSU(); +describe("ShareClient", () => { + const serviceClient = getBSU(); let shareName: string = getUniqueName("share"); - let shareURL = ShareURL.fromServiceURL(serviceURL, shareName); + let shareClient = ShareClient.fromFileServiceClient(serviceClient, shareName); beforeEach(async () => { shareName = getUniqueName("share"); - shareURL = ShareURL.fromServiceURL(serviceURL, shareName); - await shareURL.create(Aborter.none); + shareClient = ShareClient.fromFileServiceClient(serviceClient, shareName); + await shareClient.create(); }); afterEach(async () => { - await shareURL.delete(Aborter.none); + await shareClient.delete(); }); it("setMetadata", async () => { @@ -27,14 +25,14 @@ describe("ShareURL", () => { keya: "vala", keyb: "valb" }; - await shareURL.setMetadata(Aborter.none, metadata); + await shareClient.setMetadata(metadata); - const result = await shareURL.getProperties(Aborter.none); + const result = await shareClient.getProperties(); assert.deepEqual(result.metadata, metadata); }); it("getProperties", async () => { - const result = await shareURL.getProperties(Aborter.none); + const result = await shareClient.getProperties(); assert.ok(result.eTag!.length > 0); assert.ok(result.lastModified); assert.ok(result.requestId); @@ -42,57 +40,52 @@ describe("ShareURL", () => { assert.ok(result.date); }); - it("create with default parameters", done => { + it("create with default parameters", (done) => { // create() with default parameters has been tested in beforeEach done(); }); it("create with all parameters configured", async () => { - const shareURL2 = ShareURL.fromServiceURL( - serviceURL, - getUniqueName(shareName) - ); + const shareClient2 = ShareClient.fromFileServiceClient(serviceClient, getUniqueName(shareName)); const metadata = { key: "value" }; - await shareURL2.create(Aborter.none, { metadata }); - const result = await shareURL2.getProperties(Aborter.none); + await shareClient2.create({ metadata }); + const result = await shareClient2.getProperties(); assert.deepEqual(result.metadata, metadata); }); - it("delete", done => { + it("delete", (done) => { // delete() with default parameters has been tested in afterEach done(); }); it("setQuota", async () => { const quotaInGB = 20; - await shareURL.setQuota(Aborter.none, quotaInGB); - const propertiesResponse = await shareURL.getProperties(Aborter.none); + await shareClient.setQuota(quotaInGB); + const propertiesResponse = await shareClient.getProperties(); assert.equal(propertiesResponse.quota, quotaInGB); }); it("getStatistics", async () => { - const statisticsResponse = await shareURL.getStatistics(Aborter.none); + const statisticsResponse = await shareClient.getStatistics(); assert.notEqual(statisticsResponse.shareUsage, undefined); }); it("create snapshot", async () => { const metadata = { key1: "value1", key2: "value2" }; - const createSnapshotResponse = await shareURL.createSnapshot(Aborter.none, { + const createSnapshotResponse = await shareClient.createSnapshot({ metadata }); assert.notEqual(createSnapshotResponse.snapshot, undefined); const sanpshot = createSnapshotResponse.snapshot!; - const snapshotShareURL = shareURL.withSnapshot(sanpshot); + const snapshotShareClient = shareClient.withSnapshot(sanpshot); - const snapshotProperties = await snapshotShareURL.getProperties( - Aborter.none - ); + const snapshotProperties = await snapshotShareClient.getProperties(); assert.deepStrictEqual(snapshotProperties.metadata, metadata); - const originProperties = await shareURL.getProperties(Aborter.none); + const originProperties = await shareClient.getProperties(); assert.notDeepStrictEqual(originProperties.metadata, metadata); - await snapshotShareURL.delete(Aborter.none, {}); + await snapshotShareClient.delete({}); }); }); diff --git a/sdk/storage/storage-file/test/specialnaming.spec.ts b/sdk/storage/storage-file/test/specialnaming.spec.ts new file mode 100644 index 000000000000..e586f8822cc3 --- /dev/null +++ b/sdk/storage/storage-file/test/specialnaming.spec.ts @@ -0,0 +1,291 @@ +import { FileClient } from "../src/FileClient"; +import { ShareClient } from "../src/ShareClient"; +import { getBSU, getUniqueName } from "./utils/index"; +import * as assert from "assert"; +import { appendToURLPath } from "../src/utils/utils.common"; +import { DirectoryClient } from "../src/DirectoryClient"; +import * as dotenv from "dotenv"; +dotenv.config({ path: "../.env" }); + +describe("Special Naming Tests", () => { + const serviceClient = getBSU(); + const shareName: string = getUniqueName("1share-with-dash"); + const shareClient = ShareClient.fromFileServiceClient(serviceClient, shareName); + const directoryName = getUniqueName("dir"); + const directoryClient = DirectoryClient.fromShareClient(shareClient, directoryName); + + before(async () => { + await shareClient.create(); + await directoryClient.create(); + }); + + after(async () => { + await shareClient.delete(); + }); + + it("Should work with special container and file names with spaces", async () => { + const fileName: string = getUniqueName("file empty"); + const fileClient = FileClient.fromDirectoryClient(directoryClient, fileName); + + await fileClient.create(10); + const response = await directoryClient.listFilesAndDirectoriesSegment(undefined, { + prefix: fileName + }); + assert.notDeepEqual(response.segment.fileItems.length, 0); + }); + + it("Should work with special container and file names with spaces in URL string", async () => { + const fileName: string = getUniqueName("file empty"); + const fileClient = new FileClient( + appendToURLPath(directoryClient.url, fileName), + directoryClient.pipeline + ); + + await fileClient.create(10); + const response = await directoryClient.listFilesAndDirectoriesSegment(undefined, { + prefix: fileName + }); + assert.notDeepEqual(response.segment.fileItems.length, 0); + }); + + it("Should work with special container and file names uppercase", async () => { + const fileName: string = getUniqueName("Upper file empty another"); + const fileClient = FileClient.fromDirectoryClient(directoryClient, fileName); + + await fileClient.create(10); + await fileClient.getProperties(); + const response = await directoryClient.listFilesAndDirectoriesSegment(undefined, { + prefix: fileName + }); + assert.notDeepEqual(response.segment.fileItems.length, 0); + }); + + it("Should work with special container and file names uppercase in URL string", async () => { + const fileName: string = getUniqueName("Upper file empty another"); + const fileClient = new FileClient( + appendToURLPath(directoryClient.url, fileName), + directoryClient.pipeline + ); + + await fileClient.create(10); + await fileClient.getProperties(); + const response = await directoryClient.listFilesAndDirectoriesSegment(undefined, { + prefix: fileName + }); + assert.notDeepEqual(response.segment.fileItems.length, 0); + }); + + it("Should work with special file names Chinese characters", async () => { + const fileName: string = getUniqueName("Upper file empty another 汉字"); + const fileClient = FileClient.fromDirectoryClient(directoryClient, fileName); + + await fileClient.create(10); + await fileClient.getProperties(); + const response = await directoryClient.listFilesAndDirectoriesSegment(undefined, { + prefix: fileName + }); + assert.notDeepEqual(response.segment.fileItems.length, 0); + }); + + it("Should work with special file names Chinese characters in URL string", async () => { + const fileName: string = getUniqueName("Upper file empty another 汉字"); + const fileClient = new FileClient( + appendToURLPath(directoryClient.url, fileName), + directoryClient.pipeline + ); + + await fileClient.create(10); + await fileClient.getProperties(); + const response = await directoryClient.listFilesAndDirectoriesSegment(undefined, { + prefix: fileName + }); + assert.notDeepEqual(response.segment.fileItems.length, 0); + }); + + it("Should work with special file name characters", async () => { + const fileName: string = getUniqueName("汉字. special ~!@#$%^&()_+`1234567890-={}[];','"); + const fileClient = FileClient.fromDirectoryClient(directoryClient, fileName); + + await fileClient.create(10); + await fileClient.getProperties(); + const response = await directoryClient.listFilesAndDirectoriesSegment(undefined, { + // NOTICE: Azure Storage Server will replace "\" with "/" in the file names + prefix: fileName.replace(/\\/g, "/") + }); + assert.notDeepEqual(response.segment.fileItems.length, 0); + }); + + it("Should work with special file name characters in URL string", async () => { + const fileName: string = getUniqueName("汉字. special ~!@#$%^&()_+`1234567890-={}[];','"); + const fileClient = new FileClient( + // There are 2 special cases for a URL string: + // Escape "%" when creating XXXURL object with URL strings + // Escape "?" otherwise string after "?" will be treated as URL parameters + appendToURLPath(directoryClient.url, fileName.replace(/%/g, "%25").replace(/\?/g, "%3F")), + directoryClient.pipeline + ); + + await fileClient.create(10); + await fileClient.getProperties(); + const response = await directoryClient.listFilesAndDirectoriesSegment(undefined, { + // NOTICE: Azure Storage Server will replace "\" with "/" in the file names + prefix: fileName.replace(/\\/g, "/") + }); + assert.notDeepEqual(response.segment.fileItems.length, 0); + }); + + it("Should work with special directory name characters", async () => { + const directoryName: string = getUniqueName("汉字. special ~!@#$%^&()_+`1234567890-={}[];','"); + const specialDirectoryClient = DirectoryClient.fromShareClient(shareClient, directoryName); + const rootDirectoryClient = DirectoryClient.fromShareClient(shareClient, ""); + + await specialDirectoryClient.create(); + await specialDirectoryClient.getProperties(); + const response = await rootDirectoryClient.listFilesAndDirectoriesSegment(undefined, { + // NOTICE: Azure Storage Server will replace "\" with "/" in the file names + prefix: directoryName.replace(/\\/g, "/") + }); + assert.notDeepEqual(response.segment.directoryItems.length, 0); + }); + + it("Should work with special directory name characters in URL string", async () => { + const directoryName: string = getUniqueName("汉字. special ~!@#$%^&()_+`1234567890-={}[];','"); + const specialDirectoryClient = new DirectoryClient( + // There are 2 special cases for a URL string: + // Escape "%" when creating XXXURL object with URL strings + // Escape "?" otherwise string after "?" will be treated as URL parameters + appendToURLPath(shareClient.url, directoryName.replace(/%/g, "%25").replace(/\?/g, "%3F")), + shareClient.pipeline + ); + + await specialDirectoryClient.create(); + await specialDirectoryClient.getProperties(); + + const rootDirectoryClient = DirectoryClient.fromShareClient(shareClient, ""); + const response = await rootDirectoryClient.listFilesAndDirectoriesSegment(undefined, { + // NOTICE: Azure Storage Server will replace "\" with "/" in the file names + prefix: directoryName.replace(/\\/g, "/") + }); + assert.notDeepEqual(response.segment.directoryItems.length, 0); + }); + + it("Should work with special file name Russian URI encoded", async () => { + const fileName: string = getUniqueName("ру́сский язы́к"); + const blobNameEncoded: string = encodeURIComponent(fileName); + const fileClient = FileClient.fromDirectoryClient(directoryClient, blobNameEncoded); + + await fileClient.create(10); + await fileClient.getProperties(); + const response = await directoryClient.listFilesAndDirectoriesSegment(undefined, { + prefix: blobNameEncoded + }); + assert.notDeepEqual(response.segment.fileItems.length, 0); + }); + + it("Should work with special file name Russian", async () => { + const fileName: string = getUniqueName("ру́сский язы́к"); + const fileClient = FileClient.fromDirectoryClient(directoryClient, fileName); + + await fileClient.create(10); + await fileClient.getProperties(); + const response = await directoryClient.listFilesAndDirectoriesSegment(undefined, { + prefix: fileName + }); + assert.notDeepEqual(response.segment.fileItems.length, 0); + }); + + it("Should work with special file name Russian in URL string", async () => { + const fileName: string = getUniqueName("ру́сский язы́к"); + const fileClient = new FileClient( + appendToURLPath(directoryClient.url, fileName), + directoryClient.pipeline + ); + + await fileClient.create(10); + await fileClient.getProperties(); + const response = await directoryClient.listFilesAndDirectoriesSegment(undefined, { + prefix: fileName + }); + assert.notDeepEqual(response.segment.fileItems.length, 0); + }); + + it("Should work with special file name Arabic URI encoded", async () => { + const fileName: string = getUniqueName("عربي/عربى"); + const blobNameEncoded: string = encodeURIComponent(fileName); + const fileClient = FileClient.fromDirectoryClient(directoryClient, blobNameEncoded); + + await fileClient.create(10); + await fileClient.getProperties(); + const response = await directoryClient.listFilesAndDirectoriesSegment(undefined, { + prefix: blobNameEncoded + }); + assert.notDeepEqual(response.segment.fileItems.length, 0); + }); + + it("Should work with special file name Arabic", async () => { + const fileName: string = getUniqueName("عربيعربى"); + const fileClient = FileClient.fromDirectoryClient(directoryClient, fileName); + + await fileClient.create(10); + await fileClient.getProperties(); + const response = await directoryClient.listFilesAndDirectoriesSegment(undefined, { + prefix: fileName + }); + assert.notDeepEqual(response.segment.fileItems.length, 0); + }); + + it("Should work with special file name Arabic in URL string", async () => { + const fileName: string = getUniqueName("عربيعربى"); + const fileClient = new FileClient( + appendToURLPath(directoryClient.url, fileName), + directoryClient.pipeline + ); + + await fileClient.create(10); + await fileClient.getProperties(); + const response = await directoryClient.listFilesAndDirectoriesSegment(undefined, { + prefix: fileName + }); + assert.notDeepEqual(response.segment.fileItems.length, 0); + }); + + it("Should work with special file name Japanese URI encoded", async () => { + const fileName: string = getUniqueName("にっぽんごにほんご"); + const blobNameEncoded: string = encodeURIComponent(fileName); + const fileClient = FileClient.fromDirectoryClient(directoryClient, blobNameEncoded); + + await fileClient.create(10); + await fileClient.getProperties(); + const response = await directoryClient.listFilesAndDirectoriesSegment(undefined, { + prefix: blobNameEncoded + }); + assert.notDeepEqual(response.segment.fileItems.length, 0); + }); + + it("Should work with special file name Japanese", async () => { + const fileName: string = getUniqueName("にっぽんごにほんご"); + const fileClient = FileClient.fromDirectoryClient(directoryClient, fileName); + + await fileClient.create(10); + await fileClient.getProperties(); + const response = await directoryClient.listFilesAndDirectoriesSegment(undefined, { + prefix: fileName + }); + assert.notDeepEqual(response.segment.fileItems.length, 0); + }); + + it("Should work with special file name Japanese in URL string", async () => { + const fileName: string = getUniqueName("にっぽんごにほんご"); + const fileClient = new FileClient( + appendToURLPath(directoryClient.url, fileName), + directoryClient.pipeline + ); + + await fileClient.create(10); + await fileClient.getProperties(); + const response = await directoryClient.listFilesAndDirectoriesSegment(undefined, { + prefix: fileName + }); + assert.notDeepEqual(response.segment.fileItems.length, 0); + }); +}); diff --git a/sdk/storage/storage-file/test/specialnaming.test.ts b/sdk/storage/storage-file/test/specialnaming.test.ts deleted file mode 100644 index 7e148a548a3b..000000000000 --- a/sdk/storage/storage-file/test/specialnaming.test.ts +++ /dev/null @@ -1,385 +0,0 @@ -import { Aborter } from "../src/Aborter"; -import { FileURL } from "../src/FileURL"; -import { ShareURL } from "../src/ShareURL"; -import { getBSU, getUniqueName } from "./utils/index"; -import * as assert from "assert"; -import { appendToURLPath } from "../src/utils/utils.common"; -import { DirectoryURL } from "../src/DirectoryURL"; -import * as dotenv from "dotenv"; -dotenv.config({path:"../.env"}); - -describe("Special Naming Tests", () => { - const serviceURL = getBSU(); - const shareName: string = getUniqueName("1share-with-dash"); - const shareURL = ShareURL.fromServiceURL(serviceURL, shareName); - const directoryName = getUniqueName("dir"); - const directoryURL = DirectoryURL.fromShareURL(shareURL, directoryName); - - before(async () => { - await shareURL.create(Aborter.none); - await directoryURL.create(Aborter.none); - }); - - after(async () => { - await shareURL.delete(Aborter.none); - }); - - it("Should work with special container and file names with spaces", async () => { - const fileName: string = getUniqueName("file empty"); - const fileURL = FileURL.fromDirectoryURL(directoryURL, fileName); - - await fileURL.create(Aborter.none, 10); - const response = await directoryURL.listFilesAndDirectoriesSegment( - Aborter.none, - undefined, - { - prefix: fileName - } - ); - assert.notDeepEqual(response.segment.fileItems.length, 0); - }); - - it("Should work with special container and file names with spaces in URL string", async () => { - const fileName: string = getUniqueName("file empty"); - const fileURL = new FileURL( - appendToURLPath(directoryURL.url, fileName), - directoryURL.pipeline - ); - - await fileURL.create(Aborter.none, 10); - const response = await directoryURL.listFilesAndDirectoriesSegment( - Aborter.none, - undefined, - { - prefix: fileName - } - ); - assert.notDeepEqual(response.segment.fileItems.length, 0); - }); - - it("Should work with special container and file names uppercase", async () => { - const fileName: string = getUniqueName("Upper file empty another"); - const fileURL = FileURL.fromDirectoryURL(directoryURL, fileName); - - await fileURL.create(Aborter.none, 10); - await fileURL.getProperties(Aborter.none); - const response = await directoryURL.listFilesAndDirectoriesSegment( - Aborter.none, - undefined, - { - prefix: fileName - } - ); - assert.notDeepEqual(response.segment.fileItems.length, 0); - }); - - it("Should work with special container and file names uppercase in URL string", async () => { - const fileName: string = getUniqueName("Upper file empty another"); - const fileURL = new FileURL( - appendToURLPath(directoryURL.url, fileName), - directoryURL.pipeline - ); - - await fileURL.create(Aborter.none, 10); - await fileURL.getProperties(Aborter.none); - const response = await directoryURL.listFilesAndDirectoriesSegment( - Aborter.none, - undefined, - { - prefix: fileName - } - ); - assert.notDeepEqual(response.segment.fileItems.length, 0); - }); - - it("Should work with special file names Chinese characters", async () => { - const fileName: string = getUniqueName("Upper file empty another 汉字"); - const fileURL = FileURL.fromDirectoryURL(directoryURL, fileName); - - await fileURL.create(Aborter.none, 10); - await fileURL.getProperties(Aborter.none); - const response = await directoryURL.listFilesAndDirectoriesSegment( - Aborter.none, - undefined, - { - prefix: fileName - } - ); - assert.notDeepEqual(response.segment.fileItems.length, 0); - }); - - it("Should work with special file names Chinese characters in URL string", async () => { - const fileName: string = getUniqueName("Upper file empty another 汉字"); - const fileURL = new FileURL( - appendToURLPath(directoryURL.url, fileName), - directoryURL.pipeline - ); - - await fileURL.create(Aborter.none, 10); - await fileURL.getProperties(Aborter.none); - const response = await directoryURL.listFilesAndDirectoriesSegment( - Aborter.none, - undefined, - { - prefix: fileName - } - ); - assert.notDeepEqual(response.segment.fileItems.length, 0); - }); - - it("Should work with special file name characters", async () => { - const fileName: string = getUniqueName( - "汉字. special ~!@#$%^&()_+`1234567890-={}[];','" - ); - const fileURL = FileURL.fromDirectoryURL(directoryURL, fileName); - - await fileURL.create(Aborter.none, 10); - await fileURL.getProperties(Aborter.none); - const response = await directoryURL.listFilesAndDirectoriesSegment( - Aborter.none, - undefined, - { - // NOTICE: Azure Storage Server will replace "\" with "/" in the file names - prefix: fileName.replace(/\\/g, "/") - } - ); - assert.notDeepEqual(response.segment.fileItems.length, 0); - }); - - it("Should work with special file name characters in URL string", async () => { - const fileName: string = getUniqueName( - "汉字. special ~!@#$%^&()_+`1234567890-={}[];','" - ); - const fileURL = new FileURL( - // There are 2 special cases for a URL string: - // Escape "%" when creating XXXURL object with URL strings - // Escape "?" otherwise string after "?" will be treated as URL parameters - appendToURLPath( - directoryURL.url, - fileName.replace(/%/g, "%25").replace(/\?/g, "%3F") - ), - directoryURL.pipeline - ); - - await fileURL.create(Aborter.none, 10); - await fileURL.getProperties(Aborter.none); - const response = await directoryURL.listFilesAndDirectoriesSegment( - Aborter.none, - undefined, - { - // NOTICE: Azure Storage Server will replace "\" with "/" in the file names - prefix: fileName.replace(/\\/g, "/") - } - ); - assert.notDeepEqual(response.segment.fileItems.length, 0); - }); - - it("Should work with special directory name characters", async () => { - const directoryName: string = getUniqueName( - "汉字. special ~!@#$%^&()_+`1234567890-={}[];','" - ); - const specialDirectoryURL = DirectoryURL.fromShareURL( - shareURL, - directoryName - ); - const rootDirectoryURL = DirectoryURL.fromShareURL(shareURL, ""); - - await specialDirectoryURL.create(Aborter.none); - await specialDirectoryURL.getProperties(Aborter.none); - const response = await rootDirectoryURL.listFilesAndDirectoriesSegment( - Aborter.none, - undefined, - { - // NOTICE: Azure Storage Server will replace "\" with "/" in the file names - prefix: directoryName.replace(/\\/g, "/") - } - ); - assert.notDeepEqual(response.segment.directoryItems.length, 0); - }); - - it("Should work with special directory name characters in URL string", async () => { - const directoryName: string = getUniqueName( - "汉字. special ~!@#$%^&()_+`1234567890-={}[];','" - ); - const specialDirectoryURL = new DirectoryURL( - // There are 2 special cases for a URL string: - // Escape "%" when creating XXXURL object with URL strings - // Escape "?" otherwise string after "?" will be treated as URL parameters - appendToURLPath( - shareURL.url, - directoryName.replace(/%/g, "%25").replace(/\?/g, "%3F") - ), - shareURL.pipeline - ); - - await specialDirectoryURL.create(Aborter.none); - await specialDirectoryURL.getProperties(Aborter.none); - - const rootDirectoryURL = DirectoryURL.fromShareURL(shareURL, ""); - const response = await rootDirectoryURL.listFilesAndDirectoriesSegment( - Aborter.none, - undefined, - { - // NOTICE: Azure Storage Server will replace "\" with "/" in the file names - prefix: directoryName.replace(/\\/g, "/") - } - ); - assert.notDeepEqual(response.segment.directoryItems.length, 0); - }); - - it("Should work with special file name Russian URI encoded", async () => { - const fileName: string = getUniqueName("ру́сский язы́к"); - const blobNameEncoded: string = encodeURIComponent(fileName); - const fileURL = FileURL.fromDirectoryURL(directoryURL, blobNameEncoded); - - await fileURL.create(Aborter.none, 10); - await fileURL.getProperties(Aborter.none); - const response = await directoryURL.listFilesAndDirectoriesSegment( - Aborter.none, - undefined, - { - prefix: blobNameEncoded - } - ); - assert.notDeepEqual(response.segment.fileItems.length, 0); - }); - - it("Should work with special file name Russian", async () => { - const fileName: string = getUniqueName("ру́сский язы́к"); - const fileURL = FileURL.fromDirectoryURL(directoryURL, fileName); - - await fileURL.create(Aborter.none, 10); - await fileURL.getProperties(Aborter.none); - const response = await directoryURL.listFilesAndDirectoriesSegment( - Aborter.none, - undefined, - { - prefix: fileName - } - ); - assert.notDeepEqual(response.segment.fileItems.length, 0); - }); - - it("Should work with special file name Russian in URL string", async () => { - const fileName: string = getUniqueName("ру́сский язы́к"); - const fileURL = new FileURL( - appendToURLPath(directoryURL.url, fileName), - directoryURL.pipeline - ); - - await fileURL.create(Aborter.none, 10); - await fileURL.getProperties(Aborter.none); - const response = await directoryURL.listFilesAndDirectoriesSegment( - Aborter.none, - undefined, - { - prefix: fileName - } - ); - assert.notDeepEqual(response.segment.fileItems.length, 0); - }); - - it("Should work with special file name Arabic URI encoded", async () => { - const fileName: string = getUniqueName("عربي/عربى"); - const blobNameEncoded: string = encodeURIComponent(fileName); - const fileURL = FileURL.fromDirectoryURL(directoryURL, blobNameEncoded); - - await fileURL.create(Aborter.none, 10); - await fileURL.getProperties(Aborter.none); - const response = await directoryURL.listFilesAndDirectoriesSegment( - Aborter.none, - undefined, - { - prefix: blobNameEncoded - } - ); - assert.notDeepEqual(response.segment.fileItems.length, 0); - }); - - it("Should work with special file name Arabic", async () => { - const fileName: string = getUniqueName("عربيعربى"); - const fileURL = FileURL.fromDirectoryURL(directoryURL, fileName); - - await fileURL.create(Aborter.none, 10); - await fileURL.getProperties(Aborter.none); - const response = await directoryURL.listFilesAndDirectoriesSegment( - Aborter.none, - undefined, - { - prefix: fileName - } - ); - assert.notDeepEqual(response.segment.fileItems.length, 0); - }); - - it("Should work with special file name Arabic in URL string", async () => { - const fileName: string = getUniqueName("عربيعربى"); - const fileURL = new FileURL( - appendToURLPath(directoryURL.url, fileName), - directoryURL.pipeline - ); - - await fileURL.create(Aborter.none, 10); - await fileURL.getProperties(Aborter.none); - const response = await directoryURL.listFilesAndDirectoriesSegment( - Aborter.none, - undefined, - { - prefix: fileName - } - ); - assert.notDeepEqual(response.segment.fileItems.length, 0); - }); - - it("Should work with special file name Japanese URI encoded", async () => { - const fileName: string = getUniqueName("にっぽんごにほんご"); - const blobNameEncoded: string = encodeURIComponent(fileName); - const fileURL = FileURL.fromDirectoryURL(directoryURL, blobNameEncoded); - - await fileURL.create(Aborter.none, 10); - await fileURL.getProperties(Aborter.none); - const response = await directoryURL.listFilesAndDirectoriesSegment( - Aborter.none, - undefined, - { - prefix: blobNameEncoded - } - ); - assert.notDeepEqual(response.segment.fileItems.length, 0); - }); - - it("Should work with special file name Japanese", async () => { - const fileName: string = getUniqueName("にっぽんごにほんご"); - const fileURL = FileURL.fromDirectoryURL(directoryURL, fileName); - - await fileURL.create(Aborter.none, 10); - await fileURL.getProperties(Aborter.none); - const response = await directoryURL.listFilesAndDirectoriesSegment( - Aborter.none, - undefined, - { - prefix: fileName - } - ); - assert.notDeepEqual(response.segment.fileItems.length, 0); - }); - - it("Should work with special file name Japanese in URL string", async () => { - const fileName: string = getUniqueName("にっぽんごにほんご"); - const fileURL = new FileURL( - appendToURLPath(directoryURL.url, fileName), - directoryURL.pipeline - ); - - await fileURL.create(Aborter.none, 10); - await fileURL.getProperties(Aborter.none); - const response = await directoryURL.listFilesAndDirectoriesSegment( - Aborter.none, - undefined, - { - prefix: fileName - } - ); - assert.notDeepEqual(response.segment.fileItems.length, 0); - }); -}); diff --git a/sdk/storage/storage-file/test/utils/InjectorPolicy.ts b/sdk/storage/storage-file/test/utils/InjectorPolicy.ts index 87dcc133dcf9..735225b3334c 100644 --- a/sdk/storage/storage-file/test/utils/InjectorPolicy.ts +++ b/sdk/storage/storage-file/test/utils/InjectorPolicy.ts @@ -7,7 +7,7 @@ import { RestError } from "../../src"; -export interface INextInjectErrorHolder { +export interface NextInjectErrorHolder { nextInjectError?: RestError; } @@ -27,11 +27,7 @@ export class InjectorPolicy extends BaseRequestPolicy { * @param {RequestPolicyOptions} options * @memberof InjectorPolicy */ - public constructor( - nextPolicy: RequestPolicy, - options: RequestPolicyOptions, - injector: Injector - ) { + public constructor(nextPolicy: RequestPolicy, options: RequestPolicyOptions, injector: Injector) { super(nextPolicy, options); this.injector = injector; } @@ -43,9 +39,7 @@ export class InjectorPolicy extends BaseRequestPolicy { * @returns {Promise} * @memberof InjectorPolicy */ - public async sendRequest( - request: WebResource - ): Promise { + public async sendRequest(request: WebResource): Promise { const error = this.injector(); if (error) { throw error; diff --git a/sdk/storage/storage-file/test/utils/InjectorPolicyFactory.ts b/sdk/storage/storage-file/test/utils/InjectorPolicyFactory.ts index c1f478b9b226..ebd5412e76d5 100644 --- a/sdk/storage/storage-file/test/utils/InjectorPolicyFactory.ts +++ b/sdk/storage/storage-file/test/utils/InjectorPolicyFactory.ts @@ -1,8 +1,4 @@ -import { - RequestPolicy, - RequestPolicyFactory, - RequestPolicyOptions -} from "../../src"; +import { RequestPolicy, RequestPolicyFactory, RequestPolicyOptions } from "../../src"; import { InjectorPolicy, Injector } from "./InjectorPolicy"; /** @@ -19,10 +15,7 @@ export class InjectorPolicyFactory implements RequestPolicyFactory { this.injector = injector; } - public create( - nextPolicy: RequestPolicy, - options: RequestPolicyOptions - ): InjectorPolicy { + public create(nextPolicy: RequestPolicy, options: RequestPolicyOptions): InjectorPolicy { return new InjectorPolicy(nextPolicy, options, this.injector); } } diff --git a/sdk/storage/storage-file/test/utils/index.browser.ts b/sdk/storage/storage-file/test/utils/index.browser.ts index 8514c6938719..61f6d3d25abb 100644 --- a/sdk/storage/storage-file/test/utils/index.browser.ts +++ b/sdk/storage/storage-file/test/utils/index.browser.ts @@ -1,13 +1,13 @@ import { AnonymousCredential } from "../../src/credentials/AnonymousCredential"; -import { ServiceURL } from "../../src/ServiceURL"; -import { StorageURL } from "../../src/StorageURL"; +import { FileServiceClient } from "../../src/FileServiceClient"; +import { StorageClient } from "../../src/StorageClient"; export * from "./testutils.common"; export function getGenericBSU( accountType: string, accountNameSuffix: string = "" -): ServiceURL { +): FileServiceClient { const accountNameEnvVar = `${accountType}ACCOUNT_NAME`; const accountSASEnvVar = `${accountType}ACCOUNT_SAS`; @@ -27,19 +27,19 @@ export function getGenericBSU( } const credentials = new AnonymousCredential(); - const pipeline = StorageURL.newPipeline(credentials, { + const pipeline = StorageClient.newPipeline(credentials, { // Enable logger when debugging // logger: new ConsoleHttpPipelineLogger(HttpPipelineLogLevel.INFO) }); const filePrimaryURL = `https://${accountName}${accountNameSuffix}.file.core.windows.net${accountSAS}`; - return new ServiceURL(filePrimaryURL, pipeline); + return new FileServiceClient(filePrimaryURL, pipeline); } -export function getBSU(): ServiceURL { +export function getBSU(): FileServiceClient { return getGenericBSU(""); } -export function getAlternateBSU(): ServiceURL { +export function getAlternateBSU(): FileServiceClient { return getGenericBSU("SECONDARY_", "-secondary"); } @@ -84,10 +84,7 @@ export async function blobToArrayBuffer(blob: Blob): Promise { }); } -export function arrayBufferEqual( - buf1: ArrayBuffer, - buf2: ArrayBuffer -): boolean { +export function arrayBufferEqual(buf1: ArrayBuffer, buf2: ArrayBuffer): boolean { if (buf1.byteLength !== buf2.byteLength) { return false; } diff --git a/sdk/storage/storage-file/test/utils/index.ts b/sdk/storage/storage-file/test/utils/index.ts index 2077373c98dc..d8822e40a4c6 100644 --- a/sdk/storage/storage-file/test/utils/index.ts +++ b/sdk/storage/storage-file/test/utils/index.ts @@ -3,8 +3,8 @@ import * as fs from "fs"; import * as path from "path"; import { SharedKeyCredential } from "../../src/credentials/SharedKeyCredential"; -import { ServiceURL } from "../../src/ServiceURL"; -import { StorageURL } from "../../src/StorageURL"; +import { FileServiceClient } from "../../src/FileServiceClient"; +import { StorageClient } from "../../src/StorageClient"; import { getUniqueName } from "./testutils.common"; export * from "./testutils.common"; @@ -12,7 +12,7 @@ export * from "./testutils.common"; export function getGenericBSU( accountType: string, accountNameSuffix: string = "" -): ServiceURL { +): FileServiceClient { const accountNameEnvVar = `${accountType}ACCOUNT_NAME`; const accountKeyEnvVar = `${accountType}ACCOUNT_KEY`; @@ -29,19 +29,19 @@ export function getGenericBSU( } const credentials = new SharedKeyCredential(accountName, accountKey); - const pipeline = StorageURL.newPipeline(credentials, { + const pipeline = StorageClient.newPipeline(credentials, { // Enable logger when debugging // logger: new ConsoleHttpPipelineLogger(HttpPipelineLogLevel.INFO) }); const filePrimaryURL = `https://${accountName}${accountNameSuffix}.file.core.windows.net/`; - return new ServiceURL(filePrimaryURL, pipeline); + return new FileServiceClient(filePrimaryURL, pipeline); } -export function getBSU(): ServiceURL { +export function getBSU(): FileServiceClient { return getGenericBSU(""); } -export function getAlternateBSU(): ServiceURL { +export function getAlternateBSU(): FileServiceClient { return getGenericBSU("SECONDARY_", "-secondary"); } @@ -112,10 +112,7 @@ export async function createRandomLocalFile( // Returns a Promise which is completed after the file handle is closed. // If Promise is rejected, the reason will be set to the first error raised by either the // ReadableStream or the fs.WriteStream. -export async function readStreamToLocalFile( - rs: NodeJS.ReadableStream, - file: string -) { +export async function readStreamToLocalFile(rs: NodeJS.ReadableStream, file: string) { return new Promise((resolve, reject) => { const ws = fs.createWriteStream(file); @@ -134,7 +131,7 @@ export async function readStreamToLocalFile( ws.on("unpipe", () => console.log("ws.unpipe")); } - let error : Error; + let error: Error; rs.on("error", (err: Error) => { // First error wins diff --git a/sdk/storage/storage-file/test/utils/testutils.common.ts b/sdk/storage/storage-file/test/utils/testutils.common.ts index 4ec999c08633..de4d969696c9 100644 --- a/sdk/storage/storage-file/test/utils/testutils.common.ts +++ b/sdk/storage/storage-file/test/utils/testutils.common.ts @@ -14,7 +14,7 @@ export function getUniqueName(prefix: string): string { } export async function sleep(time: number): Promise { - return new Promise(resolve => { + return new Promise((resolve) => { setTimeout(resolve, time); }); } @@ -24,17 +24,13 @@ export function base64encode(content: string): string { } export function base64decode(encodedString: string): string { - return isBrowser() - ? atob(encodedString) - : Buffer.from(encodedString, "base64").toString(); + return isBrowser() ? atob(encodedString) : Buffer.from(encodedString, "base64").toString(); } export class ConsoleHttpPipelineLogger implements IHttpPipelineLogger { constructor(public minimumLogLevel: HttpPipelineLogLevel) {} public log(logLevel: HttpPipelineLogLevel, message: string): void { - const logMessage = `${new Date().toISOString()} ${ - HttpPipelineLogLevel[logLevel] - }: ${message}`; + const logMessage = `${new Date().toISOString()} ${HttpPipelineLogLevel[logLevel]}: ${message}`; switch (logLevel) { case HttpPipelineLogLevel.ERROR: // tslint:disable-next-line:no-console @@ -53,7 +49,7 @@ export class ConsoleHttpPipelineLogger implements IHttpPipelineLogger { } export async function wait(time: number): Promise { - return new Promise(resolve => { + return new Promise((resolve) => { setTimeout(resolve, time); }); } diff --git a/sdk/storage/storage-file/tsconfig.json b/sdk/storage/storage-file/tsconfig.json index 61885eb2e18c..e271ee388662 100644 --- a/sdk/storage/storage-file/tsconfig.json +++ b/sdk/storage/storage-file/tsconfig.json @@ -22,4 +22,4 @@ "compileOnSave": true, "exclude": ["node_modules", "./samples/*"], "include": ["./src/**/*.ts", "./test/**/*.ts"] -} \ No newline at end of file +} diff --git a/sdk/storage/storage-file/tslint.json b/sdk/storage/storage-file/tslint.json index ae2eb09109a7..498d029bd134 100644 --- a/sdk/storage/storage-file/tslint.json +++ b/sdk/storage/storage-file/tslint.json @@ -4,7 +4,8 @@ "jsRules": {}, "rules": { "trailing-comma": false, - "arrow-parens": false + "arrow-parens": false, + "interface-name": [true, "never-prefix"] }, "rulesDirectory": [], "linterOptions": { diff --git a/sdk/storage/storage-queue/.npmignore b/sdk/storage/storage-queue/.npmignore index 7f8e2a7885bf..ecf17923297a 100644 --- a/sdk/storage/storage-queue/.npmignore +++ b/sdk/storage/storage-queue/.npmignore @@ -1,6 +1,6 @@ # browser # -browser/azure-storage.queue.js -browser/azure-storage.queue.js.map +browser/azure-storage-queue.js +browser/azure-storage-queue.js.map # dist-test # dist-test/ diff --git a/sdk/storage/storage-queue/.nycrc b/sdk/storage/storage-queue/.nycrc index db40901a5a06..9d172c4525f3 100644 --- a/sdk/storage/storage-queue/.nycrc +++ b/sdk/storage/storage-queue/.nycrc @@ -1,6 +1,6 @@ { "include": [ - "src/**/*.ts" + "dist-test/index.node.js" ], "exclude": [ "**/*.d.ts", @@ -18,6 +18,7 @@ "html", "cobertura" ], + "exclude-after-remap":false, "sourceMap": true, "instrument": true, "all": true diff --git a/sdk/storage/storage-queue/.prettierignore b/sdk/storage/storage-queue/.prettierignore new file mode 100644 index 000000000000..3fd7f651ed5f --- /dev/null +++ b/sdk/storage/storage-queue/.prettierignore @@ -0,0 +1,2 @@ +src/generated/**/*.ts +package-lock.json diff --git a/sdk/storage/storage-queue/.prettierrc.json b/sdk/storage/storage-queue/.prettierrc.json deleted file mode 100644 index 1ca87ab7d8af..000000000000 --- a/sdk/storage/storage-queue/.prettierrc.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "singleQuote": false -} diff --git a/sdk/storage/storage-queue/README.md b/sdk/storage/storage-queue/README.md index b44e074bac87..358606b7f482 100644 --- a/sdk/storage/storage-queue/README.md +++ b/sdk/storage/storage-queue/README.md @@ -1,7 +1,7 @@ # Azure Storage SDK V10 for JavaScript - Queue -* [![npm version](https://badge.fury.io/js/%40azure%2Fstorage-queue.svg)](https://badge.fury.io/js/%40azure%2Fstorage-queue) -* [API Reference documentation](https://docs.microsoft.com/en-us/javascript/api/%40azure/storage-queue/index?view=azure-node-preview) +- [![npm version](https://badge.fury.io/js/%40azure%2Fstorage-queue.svg)](https://badge.fury.io/js/%40azure%2Fstorage-queue) +- [API Reference documentation](https://docs.microsoft.com/en-us/javascript/api/%40azure/storage-queue/index?view=azure-node-preview) ## Introduction @@ -11,14 +11,14 @@ Please note that this version of the SDK is a compete overhaul of the current [A ### Features -* Queue Storage - * Get/Set Queue Service Properties - * Create/List/Delete Queues - * Enqueue/Dequeue/Peek/Clear/Update/Delete Queue Messages -* Features new - * Asynchronous I/O for all operations using the async methods - * HttpPipeline which enables a high degree of per-request configurability - * 1-to-1 correlation with the Storage REST API for clarity and simplicity +- Queue Storage + - Get/Set Queue Service Properties + - Create/List/Delete Queues + - Enqueue/Dequeue/Peek/Clear/Update/Delete Queue Messages +- Features new + - Asynchronous I/O for all operations using the async methods + - HttpPipeline which enables a high degree of per-request configurability + - 1-to-1 correlation with the Storage REST API for clarity and simplicity ### Compatibility @@ -30,14 +30,13 @@ You need polyfills to make this library work with IE11. The easiest way is to us Or you can load separate polyfills for missed ES feature(s). This library depends on following ES features which need external polyfills loaded. -* `Promise` -* `String.prototype.startsWith` -* `String.prototype.endsWith` -* `String.prototype.repeat` -* `String.prototype.includes` -* `Array.prototype.includes` -* `Object.keys` (Override IE11's `Object.keys` with ES6 polyfill forcely to enable [ES6 behavior](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/keys#Notes)) - +- `Promise` +- `String.prototype.startsWith` +- `String.prototype.endsWith` +- `String.prototype.repeat` +- `String.prototype.includes` +- `Array.prototype.includes` +- `Object.keys` (Override IE11's `Object.keys` with ES6 polyfill forcely to enable [ES6 behavior](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/keys#Notes)) #### Differences between Node.js and browsers @@ -45,11 +44,11 @@ There are differences between Node.js and browsers runtime. When getting start w ##### Following features, interfaces, classes or functions are only available in Node.js -* Shared Key Authorization based on account name and account key - * `SharedKeyCredential` -* Shared Access Signature(SAS) generation - * `generateAccountSASQueryParameters()` - * `generateQueueSASQueryParameters()` +- Shared Key Authorization based on account name and account key + - `SharedKeyCredential` +- Shared Access Signature(SAS) generation + - `generateAccountSASQueryParameters()` + - `generateQueueSASQueryParameters()` ## Getting Started @@ -78,18 +77,18 @@ const Azure = require("@azure/storage-queue"); To use the SDK with JS bundle in the browsers, simply add a script tag to your HTML pages pointing to the downloaded JS bundle file(s): ```html - + ``` The JS bundled file is compatible with [UMD](https://github.com/umdjs/umd) standard, if no module system found, following global variable(s) will be exported: -* `azqueue` +- `azqueue` #### Download Download latest released JS bundles from links in the [GitHub release page](https://github.com/Azure/azure-sdk-for-js/releases). Or from following links directly: -* Queue [https://aka.ms/downloadazurestoragejsqueue](https://aka.ms/downloadazurestoragejsqueue) +- Queue [https://aka.ms/downloadazurestoragejsqueue](https://aka.ms/downloadazurestoragejsqueue) ### CORS @@ -97,128 +96,154 @@ You need to set up [Cross-Origin Resource Sharing (CORS)](https://docs.microsoft For example, you can create following CORS settings for debugging. But please customize the settings carefully according to your requirements in production environment. -* Allowed origins: \* -* Allowed verbs: DELETE,GET,HEAD,MERGE,POST,OPTIONS,PUT -* Allowed headers: \* -* Exposed headers: \* -* Maximum age (seconds): 86400 +- Allowed origins: \* +- Allowed verbs: DELETE,GET,HEAD,MERGE,POST,OPTIONS,PUT +- Allowed headers: \* +- Exposed headers: \* +- Maximum age (seconds): 86400 ## SDK Architecture The Azure Storage SDK for JavaScript provides low-level and high-level APIs. -* ServiceURL, QueueURL, MessagesURL and MessageIdURL objects provide the low-level API functionality and map one-to-one to the [Azure Storage Queue REST APIs](https://docs.microsoft.com/en-us/rest/api/storageservices/queue-service-rest-api). +* QueueServiceClient, QueueClient, MessagesClient and MessageIdClient objects provide the low-level API functionality and map one-to-one to the [Azure Storage Queue REST APIs](https://docs.microsoft.com/en-us/rest/api/storageservices/queue-service-rest-api). ## Code Samples ```javascript const { - Aborter, - QueueURL, - MessagesURL, - MessageIdURL, - ServiceURL, - StorageURL, - SharedKeyCredential, - AnonymousCredential, - TokenCredential + Aborter, + QueueClient, + MessagesClient, + MessageIdClient, + QueueServiceClient, + StorageClient, + SharedKeyCredential, + AnonymousCredential, + TokenCredential } = require(".."); // Change to "@azure/storage-queue" in your package async function main() { - // Enter your storage account name and shared key - const account = ""; - const accountKey = ""; - - // Use SharedKeyCredential with storage account and account key - const sharedKeyCredential = new SharedKeyCredential(account, accountKey); - - // Use TokenCredential with OAuth token - const tokenCredential = new TokenCredential("token"); - tokenCredential.token = "renewedToken"; // Renew the token by updating token field of token credential - - // Use AnonymousCredential when url already includes a SAS signature - const anonymousCredential = new AnonymousCredential(); - - // Use sharedKeyCredential, tokenCredential or anonymousCredential to create a pipeline - const pipeline = StorageURL.newPipeline(sharedKeyCredential, { - // httpClient: MyHTTPClient, // A customized HTTP client implementing IHttpClient interface - // logger: MyLogger, // A customized logger implementing IHttpPipelineLogger interface - retryOptions: { maxTries: 4 }, // Retry options - telemetry: { value: "BasicSample V10.0.0" } // Customized telemetry string - }); - - // List queues - const serviceURL = new ServiceURL( - // When using AnonymousCredential, following url should include a valid SAS or support public access - `https://${account}.queue.core.windows.net`, - pipeline + // Enter your storage account name and shared key + const account = ""; + const accountKey = ""; + + // Use SharedKeyCredential with storage account and account key + const sharedKeyCredential = new SharedKeyCredential(account, accountKey); + + // Use TokenCredential with OAuth token + const tokenCredential = new TokenCredential("token"); + tokenCredential.token = "renewedToken"; // Renew the token by updating token field of token credential + + // Use AnonymousCredential when url already includes a SAS signature + const anonymousCredential = new AnonymousCredential(); + + // Use sharedKeyCredential, tokenCredential or anonymousCredential to create a pipeline + const pipeline = StorageClient.newPipeline(sharedKeyCredential, { + // httpClient: MyHTTPClient, // A customized HTTP client implementing IHttpClient interface + // logger: MyLogger, // A customized logger implementing IHttpPipelineLogger interface + retryOptions: { maxTries: 4 }, // Retry options + telemetry: { value: "BasicSample V10.0.0" } // Customized telemetry string + }); + + // List queues + const blobServiceClient = new QueueServiceClient( + // When using AnonymousCredential, following url should include a valid SAS or support public access + `https://${account}.queue.core.windows.net`, + pipeline + ); + + console.log(`List queues`); + let marker; + do { + const listQueuesResponse = await blobServiceClient.listQueuesSegment( + marker ); - console.log(`List queues`); - let marker; - do { - const listQueuesResponse = await serviceURL.listQueuesSegment( - Aborter.none, - marker - ); - - marker = listQueuesResponse.nextMarker; - for (const queue of listQueuesResponse.queueItems) { - console.log(`Queue: ${queue.name}`); - } - } while (marker); - - // Create a new queue - const queueName = `newqueue${new Date().getTime()}`; - const queueURL = QueueURL.fromServiceURL(serviceURL, queueName); - const createQueueResponse = await queueURL.create(Aborter.none); + marker = listQueuesResponse.nextMarker; + for (const queue of listQueuesResponse.queueItems) { + console.log(`Queue: ${queue.name}`); + } + } while (marker); + + // Create a new queue + const queueName = `newqueue${new Date().getTime()}`; + const queueClient = QueueClient.fromQueueServiceClient(blobServiceClient, queueName); + const createQueueResponse = await queueClient.create(); + console.log( + `Create queue ${queueName} successfully, service assigned request Id: ${ + createQueueResponse.requestId + }` + ); + + // Enqueue a message into the queue using the enqueue method. + const messagesClient = MessagesClient.fromQueueClient(queueClient); + const enqueueQueueResponse = await messagesClient.enqueue( + "Hello World!" + ); + console.log( + `Enqueue message successfully, service assigned message Id: ${ + enqueueQueueResponse.messageId + }, service assigned request Id: ${enqueueQueueResponse.requestId}` + ); + + // Peek a message using peek method. + const peekQueueResponse = await messagesClient.peek(); + console.log( + `The peeked message is: ${ + peekQueueResponse.peekedMessageItems[0].messageText + }` + ); + + // You de-queue a message in two steps. Call GetMessage at which point the message becomes invisible to any other code reading messages + // from this queue for a default period of 30 seconds. To finish removing the message from the queue, you call DeleteMessage. + // This two-step process ensures that if your code fails to process a message due to hardware or software failure, another instance + // of your code can get the same message and try again. + const dequeueResponse = await messagesClient.dequeue(); + if (dequeueResponse.dequeuedMessageItems.length == 1) { + const dequeueMessageItem = dequeueResponse.dequeuedMessageItems[0]; console.log( - `Create queue ${queueName} successfully, service assigned request Id: ${createQueueResponse.requestId}` + `Processing & deleting message with content: ${ + dequeueMessageItem.messageText + }` + ); + const messageIdClient = MessageIdClient.fromMessagesClient( + messagesClient, + dequeueMessageItem.messageId + ); + const deleteMessageResponse = await messageIdClient.delete( + dequeueMessageItem.popReceipt ); - - // Enqueue a message into the queue using the enqueue method. - const messagesURL = MessagesURL.fromQueueURL(queueURL); - const enqueueQueueResponse = await messagesURL.enqueue(Aborter.none, "Hello World!"); console.log( - `Enqueue message successfully, service assigned message Id: ${enqueueQueueResponse.messageId}, service assigned request Id: ${enqueueQueueResponse.requestId}` + `Delete message succesfully, service assigned request Id: ${ + deleteMessageResponse.requestId + }` ); - - // Peek a message using peek method. - const peekQueueResponse = await messagesURL.peek(Aborter.none); - console.log(`The peeked message is: ${peekQueueResponse.peekedMessageItems[0].messageText}`); - - // You de-queue a message in two steps. Call GetMessage at which point the message becomes invisible to any other code reading messages - // from this queue for a default period of 30 seconds. To finish removing the message from the queue, you call DeleteMessage. - // This two-step process ensures that if your code fails to process a message due to hardware or software failure, another instance - // of your code can get the same message and try again. - const dequeueResponse = await messagesURL.dequeue(Aborter.none); - if (dequeueResponse.dequeuedMessageItems.length == 1) { - const dequeueMessageItem = dequeueResponse.dequeuedMessageItems[0]; - console.log(`Processing & deleting message with content: ${dequeueMessageItem.messageText}`); - const messageIdURL = MessageIdURL.fromMessagesURL(messagesURL, dequeueMessageItem.messageId); - const deleteMessageResponse = await messageIdURL.delete(Aborter.none, dequeueMessageItem.popReceipt); - console.log(`Delete message succesfully, service assigned request Id: ${deleteMessageResponse.requestId}`); - } - - // Delete the queue. - const deleteQueueResponse = await queueURL.delete(Aborter.none); - console.log(`Delete queue successfully, service assigned request Id: ${deleteQueueResponse.requestId}`); + } + + // Delete the queue. + const deleteQueueResponse = await queueClient.delete(); + console.log( + `Delete queue successfully, service assigned request Id: ${ + deleteQueueResponse.requestId + }` + ); } // An async method returns a Promise object, which is compatible with then().catch() coding style. main() - .then(() => { - console.log("Successfully executed sample."); - }) - .catch(err => { - console.log(err.message); - }); + .then(() => { + console.log("Successfully executed sample."); + }) + .catch(err => { + console.log(err.message); + }); ``` ## More Code Samples -* [Queue Storage Examples](https://github.com/azure/azure-sdk-for-js/tree/master/sdk/storage/storage-queue/samples) -* [Queue Storage Examples - Test Cases](https://github.com/azure/azure-sdk-for-js/tree/master/sdk/storage/storage-queue/test/) +- [Queue Storage Examples](https://github.com/azure/azure-sdk-for-js/tree/master/sdk/storage/storage-queue/samples) +- [Queue Storage Examples - Test Cases](https://github.com/azure/azure-sdk-for-js/tree/master/sdk/storage/storage-queue/test/) ## License diff --git a/sdk/storage/storage-queue/ci.yml b/sdk/storage/storage-queue/ci.yml new file mode 100644 index 000000000000..8e28011141c2 --- /dev/null +++ b/sdk/storage/storage-queue/ci.yml @@ -0,0 +1,17 @@ +# DO NOT EDIT THIS FILE +# This file is generated automatically and any changes will be lost. + +trigger: none + +pr: + branches: + include: + - master + paths: + include: + - sdk/storage/storage-queue/ + +jobs: + - template: ../../../eng/pipelines/templates/jobs/archetype-sdk-client.yml + parameters: + PackageName: "@azure/storage-queue" diff --git a/sdk/storage/storage-queue/gulpfile.js b/sdk/storage/storage-queue/gulpfile.js index e966445ed2b2..fdb257c9ef55 100644 --- a/sdk/storage/storage-queue/gulpfile.js +++ b/sdk/storage/storage-queue/gulpfile.js @@ -4,14 +4,14 @@ const zip = require("gulp-zip"); const version = require("./package.json").version; const zipFileName = `azurestoragejs.queue-${version}.zip`; -gulp.task("zip", function(callback) { - gulp - .src([ - "browser/azure-storage.queue.js", - "browser/azure-storage.queue.min.js", - "browser/*.txt" - ]) - .pipe(zip(zipFileName)) - .pipe(gulp.dest("browser")) - .on("end", callback); -}); \ No newline at end of file +gulp.task("zip", function (callback) { + gulp + .src([ + "browser/azure-storage-queue.js", + "browser/azure-storage-queue.min.js", + "browser/*.txt" + ]) + .pipe(zip(zipFileName)) + .pipe(gulp.dest("browser")) + .on("end", callback); +}); diff --git a/sdk/storage/storage-queue/karma.conf.js b/sdk/storage/storage-queue/karma.conf.js index f4e5570b2382..22d8ae1b7cc2 100644 --- a/sdk/storage/storage-queue/karma.conf.js +++ b/sdk/storage/storage-queue/karma.conf.js @@ -1,119 +1,119 @@ // https://github.com/karma-runner/karma-chrome-launcher process.env.CHROME_BIN = require("puppeteer").executablePath(); -require("dotenv").config({path:"../.env"}); - -module.exports = function(config) { - config.set({ - // base path that will be used to resolve all patterns (eg. files, exclude) - basePath: "./", - - // frameworks to use - // available frameworks: https://npmjs.org/browse/keyword/karma-adapter - frameworks: ["mocha"], - - plugins: [ - "karma-mocha", - "karma-mocha-reporter", - "karma-chrome-launcher", - "karma-edge-launcher", - "karma-firefox-launcher", - "karma-ie-launcher", - "karma-env-preprocessor", - "karma-coverage", - "karma-remap-coverage", - "karma-junit-reporter" - ], - - // list of files / patterns to load in the browser - files: [ - // polyfill service supporting IE11 missing features - // Promise,String.prototype.startsWith,String.prototype.endsWith,String.prototype.repeat,String.prototype.includes,Array.prototype.includes,Object.keys - "https://cdn.polyfill.io/v2/polyfill.js?features=Promise,String.prototype.startsWith,String.prototype.endsWith,String.prototype.repeat,String.prototype.includes,Array.prototype.includes,Object.keys|always", - "dist-test/index.browser.js" - ], - - // list of files / patterns to exclude - exclude: [], - - // preprocess matching files before serving them to the browser - // available preprocessors: https://npmjs.org/browse/keyword/karma-preprocessor - preprocessors: { - "**/*.js": ["env"], - // IMPORTANT: COMMENT following line if you want to debug in your browsers!! - // Preprocess source file to calculate code coverage, however this will make source file unreadable - "dist-test/index.browser.js": ["coverage"] - }, - - // inject following environment values into browser testing with window.__env__ - // environment values MUST be exported or set with same console running "karma start" - // https://www.npmjs.com/package/karma-env-preprocessor - envPreprocessor: ["ACCOUNT_NAME", "ACCOUNT_SAS"], - - // test results reporter to use - // possible values: 'dots', 'progress' - // available reporters: https://npmjs.org/browse/keyword/karma-reporter - reporters: ["mocha", "coverage", "remap-coverage", "junit"], - - coverageReporter: { type: "in-memory" }, - - // Coverage report settings - remapCoverageReporter: { - "text-summary": null, // to show summary in console - html: "./coverage-browser", - cobertura: "./coverage-browser/cobertura-coverage.xml" - }, - - // Exclude coverage calculation for following files - remapOptions: { - exclude: /node_modules|tests/g - }, - - junitReporter: { - outputDir: "", // results will be saved as $outputDir/$browserName.xml - outputFile: "test-results.browser.xml", // if included, results will be saved as $outputDir/$browserName/$outputFile - suite: "", // suite will become the package name attribute in xml testsuite element - useBrowserName: false, // add browser name to report and classes names - nameFormatter: undefined, // function (browser, result) to customize the name attribute in xml testcase element - classNameFormatter: undefined, // function (browser, result) to customize the classname attribute in xml testcase element - properties: {} // key value pair of properties to add to the section of the report - }, - - // web server port - port: 9328, - - // enable / disable colors in the output (reporters and logs) - colors: true, - - // level of logging - // possible values: config.LOG_DISABLE || config.LOG_ERROR || config.LOG_WARN || config.LOG_INFO || config.LOG_DEBUG - logLevel: config.LOG_INFO, - - // enable / disable watching file and executing tests whenever any file changes - autoWatch: false, - - // start these browsers - // available browser launchers: https://npmjs.org/browse/keyword/karma-launcher - // 'ChromeHeadless', 'Chrome', 'Firefox', 'Edge', 'IE' - browsers: ["ChromeHeadless"], - - // Continuous Integration mode - // if true, Karma captures browsers, runs the tests and exits - singleRun: false, - - // Concurrency level - // how many browser should be started simultaneous - concurrency: 1, - - browserNoActivityTimeout: 600000, - browserDisconnectTimeout: 10000, - browserDisconnectTolerance: 3, - - client: { - mocha: { - // change Karma's debug.html to the mocha web reporter - reporter: "html", - timeout: "600000" - } - } - }); -}; \ No newline at end of file +require("dotenv").config({ path: "../.env" }); + +module.exports = function (config) { + config.set({ + // base path that will be used to resolve all patterns (eg. files, exclude) + basePath: "./", + + // frameworks to use + // available frameworks: https://npmjs.org/browse/keyword/karma-adapter + frameworks: ["mocha"], + + plugins: [ + "karma-mocha", + "karma-mocha-reporter", + "karma-chrome-launcher", + "karma-edge-launcher", + "karma-firefox-launcher", + "karma-ie-launcher", + "karma-env-preprocessor", + "karma-coverage", + "karma-remap-coverage", + "karma-junit-reporter" + ], + + // list of files / patterns to load in the browser + files: [ + // polyfill service supporting IE11 missing features + // Promise,String.prototype.startsWith,String.prototype.endsWith,String.prototype.repeat,String.prototype.includes,Array.prototype.includes,Object.keys + "https://cdn.polyfill.io/v2/polyfill.js?features=Promise,String.prototype.startsWith,String.prototype.endsWith,String.prototype.repeat,String.prototype.includes,Array.prototype.includes,Object.keys|always", + "dist-test/index.browser.js" + ], + + // list of files / patterns to exclude + exclude: [], + + // preprocess matching files before serving them to the browser + // available preprocessors: https://npmjs.org/browse/keyword/karma-preprocessor + preprocessors: { + "**/*.js": ["env"], + // IMPORTANT: COMMENT following line if you want to debug in your browsers!! + // Preprocess source file to calculate code coverage, however this will make source file unreadable + "dist-test/index.browser.js": ["coverage"] + }, + + // inject following environment values into browser testing with window.__env__ + // environment values MUST be exported or set with same console running "karma start" + // https://www.npmjs.com/package/karma-env-preprocessor + envPreprocessor: ["ACCOUNT_NAME", "ACCOUNT_SAS"], + + // test results reporter to use + // possible values: 'dots', 'progress' + // available reporters: https://npmjs.org/browse/keyword/karma-reporter + reporters: ["mocha", "coverage", "remap-coverage", "junit"], + + coverageReporter: { type: "in-memory" }, + + // Coverage report settings + remapCoverageReporter: { + "text-summary": null, // to show summary in console + html: "./coverage-browser", + cobertura: "./coverage-browser/cobertura-coverage.xml" + }, + + // Exclude coverage calculation for following files + remapOptions: { + exclude: /node_modules|test/g + }, + + junitReporter: { + outputDir: "", // results will be saved as $outputDir/$browserName.xml + outputFile: "test-results.browser.xml", // if included, results will be saved as $outputDir/$browserName/$outputFile + suite: "", // suite will become the package name attribute in xml testsuite element + useBrowserName: false, // add browser name to report and classes names + nameFormatter: undefined, // function (browser, result) to customize the name attribute in xml testcase element + classNameFormatter: undefined, // function (browser, result) to customize the classname attribute in xml testcase element + properties: {} // key value pair of properties to add to the section of the report + }, + + // web server port + port: 9328, + + // enable / disable colors in the output (reporters and logs) + colors: true, + + // level of logging + // possible values: config.LOG_DISABLE || config.LOG_ERROR || config.LOG_WARN || config.LOG_INFO || config.LOG_DEBUG + logLevel: config.LOG_INFO, + + // enable / disable watching file and executing tests whenever any file changes + autoWatch: false, + + // start these browsers + // available browser launchers: https://npmjs.org/browse/keyword/karma-launcher + // 'ChromeHeadless', 'Chrome', 'Firefox', 'Edge', 'IE' + browsers: ["ChromeHeadless"], + + // Continuous Integration mode + // if true, Karma captures browsers, runs the tests and exits + singleRun: false, + + // Concurrency level + // how many browser should be started simultaneous + concurrency: 1, + + browserNoActivityTimeout: 600000, + browserDisconnectTimeout: 10000, + browserDisconnectTolerance: 3, + + client: { + mocha: { + // change Karma's debug.html to the mocha web reporter + reporter: "html", + timeout: "600000" + } + } + }); +}; diff --git a/sdk/storage/storage-queue/package.json b/sdk/storage/storage-queue/package.json index 28abeb38700e..9a41629c0ef4 100644 --- a/sdk/storage/storage-queue/package.json +++ b/sdk/storage/storage-queue/package.json @@ -1,11 +1,11 @@ { "name": "@azure/storage-queue", - "version": "10.1.0", + "version": "11.0.0-preview.1", "description": "Microsoft Azure Storage SDK for JavaScript - Queue", "main": "./dist/index.js", "module": "./dist-esm/src/index.js", "browser": { - "./dist/index.js": "./browser/azure-storage.queue.min.js", + "./dist/index.js": "./browser/azure-storage-queue.min.js", "./dist-esm/src/index.js": "./dist-esm/src/index.browser.js", "./dist-esm/test/utils/index.js": "./dist-esm/test/utils/index.browser.js", "os": false, @@ -71,12 +71,12 @@ "build:nodebrowser": "rollup -c 2>&1", "build:test": "npm run build:es6 && rollup -c rollup.test.config.js 2>&1", "build": "npm run build:es6 && npm run build:nodebrowser && npm run build:browserzip", - "check-format": "prettier --list-different --config .prettierrc.json \"src/**/*.ts\" \"test/**/*.ts\" \"*.{js,json}\"", + "check-format": "prettier --list-different --config ../../.prettierrc.json \"src/**/*.ts\" \"test/**/*.ts\" \"*.{js,json}\"", "clean": "rimraf dist dist-esm dist-test typings temp browser/*.js* browser/*.zip statistics.html coverage coverage-browser .nyc_output *.tgz *.log test*.xml TEST*.xml", "extract-api": "tsc -p . && api-extractor run --local", - "format": "prettier --write --config .prettierrc.json \"src/**/*.ts\" \"test/**/*.ts\" \"*.{js,json}\"", + "format": "prettier --write --config ../../.prettierrc.json \"src/**/*.ts\" \"test/**/*.ts\" \"*.{js,json}\"", "integration-test:browser": "karma start --single-run", - "integration-test:node": "cross-env TS_NODE_COMPILER_OPTIONS=\"{\\\"module\\\": \\\"commonjs\\\"}\" nyc mocha --compilers ts-node/register --require source-map-support/register --reporter mocha-multi --reporter-options spec=-,mocha-junit-reporter=- --full-trace --no-timeouts test/*.test.ts test/node/*.test.ts", + "integration-test:node": "nyc mocha --require source-map-support/register --reporter mocha-multi --reporter-options spec=-,mocha-junit-reporter=- --full-trace -t 120000 dist-test/index.node.js", "integration-test": "npm run integration-test:node && npm run integration-test:browser", "lint:fix": "echo skipped", "lint": "echo skipped", diff --git a/sdk/storage/storage-queue/rollup.base.config.js b/sdk/storage/storage-queue/rollup.base.config.js new file mode 100644 index 000000000000..7d40f05230e8 --- /dev/null +++ b/sdk/storage/storage-queue/rollup.base.config.js @@ -0,0 +1,135 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +import nodeResolve from "rollup-plugin-node-resolve"; +import multiEntry from "rollup-plugin-multi-entry"; +import cjs from "rollup-plugin-commonjs"; +import replace from "rollup-plugin-replace"; +import { uglify } from "rollup-plugin-uglify"; +import sourcemaps from "rollup-plugin-sourcemaps"; +import shim from "rollup-plugin-shim"; +// import visualizer from "rollup-plugin-visualizer"; + +const version = require("./package.json").version; +const banner = [ + "/*!", + ` * Azure Storage SDK for JavaScript - Queue, ${version}`, + " * Copyright (c) Microsoft and contributors. All rights reserved.", + " */" +].join("\n"); + +const pkg = require("./package.json"); +const depNames = Object.keys(pkg.dependencies); +const production = process.env.NODE_ENV === "production"; + +export function nodeConfig(test = false) { + const externalNodeBuiltins = ["@azure/ms-rest-js", "crypto", "fs", "os"]; + const baseConfig = { + input: "dist-esm/src/index.js", + external: depNames.concat(externalNodeBuiltins), + output: { + file: "dist/index.js", + format: "cjs", + sourcemap: true + }, + preserveSymlinks: false, + plugins: [ + sourcemaps(), + replace({ + delimiters: ["", ""], + values: { + // replace dynamic checks with if (true) since this is for node only. + // Allows rollup's dead code elimination to be more aggressive. + "if (isNode)": "if (true)" + } + }), + nodeResolve({ preferBuiltins: true }), + cjs() + ] + }; + + if (test) { + // entry point is every test file + baseConfig.input = ["dist-esm/test/*.spec.js", "dist-esm/test/node/*.spec.js"]; + baseConfig.plugins.unshift(multiEntry({ exports: false })); + + // different output file + baseConfig.output.file = "dist-test/index.node.js"; + + // mark assert as external + baseConfig.external.push("assert", "fs", "path"); + + baseConfig.context = "null"; + } else if (production) { + baseConfig.plugins.push(uglify()); + } + + return baseConfig; +} + +export function browserConfig(test = false, production = false) { + const baseConfig = { + input: "dist-esm/src/index.browser.js", + output: { + file: "browser/azure-storage-queue.js", + banner: banner, + format: "umd", + name: "azqueue", + sourcemap: true + }, + preserveSymlinks: false, + plugins: [ + sourcemaps(), + replace({ + delimiters: ["", ""], + values: { + // replace dynamic checks with if (false) since this is for + // browser only. Rollup's dead code elimination will remove + // any code guarded by if (isNode) { ... } + "if (isNode)": "if (false)" + } + }), + // os is not used by the browser bundle, so just shim it + shim({ + dotenv: `export function config() { }`, + os: ` + export const type = 1; + export const release = 1; + ` + }), + nodeResolve({ + mainFields: ["module", "browser"], + preferBuiltins: false + }), + cjs({ + namedExports: { + assert: ["ok", "deepEqual", "equal", "fail", "deepStrictEqual"] + } + }) + ] + }; + + if (test) { + baseConfig.input = ["dist-esm/test/*.spec.js", "dist-esm/test/browser/*.spec.js"]; + baseConfig.plugins.unshift(multiEntry({ exports: false })); + baseConfig.output.file = "dist-test/index.browser.js"; + + baseConfig.context = "null"; + } else if (production) { + baseConfig.output.file = "browser/azure-storage-queue.min.js"; + baseConfig.plugins.push( + uglify({ + output: { + preamble: banner + } + }) + // Comment visualizer because it only works on Node.js 8+; Uncomment it to get bundle analysis report + // visualizer({ + // filename: "./statistics.html", + // sourcemap: true + // }) + ); + } + + return baseConfig; +} diff --git a/sdk/storage/storage-queue/rollup.config.js b/sdk/storage/storage-queue/rollup.config.js index edde22230377..6f119550d77a 100644 --- a/sdk/storage/storage-queue/rollup.config.js +++ b/sdk/storage/storage-queue/rollup.config.js @@ -1,94 +1,18 @@ -import nodeResolve from "rollup-plugin-node-resolve"; -import { uglify } from "rollup-plugin-uglify"; -import replace from "rollup-plugin-replace"; -import commonjs from "rollup-plugin-commonjs"; -import shim from "rollup-plugin-shim"; -//import visualizer from "rollup-plugin-visualizer"; +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. -const version = require("./package.json").version; -const banner = [ - "/*!", - ` * Azure Storage SDK for JavaScript - Queue, ${version}`, - " * Copyright (c) Microsoft and contributors. All rights reserved.", - " */" -].join("\n"); +import * as base from "./rollup.base.config"; -const nodeRollupConfigFactory = () => { - return { - external: ["@azure/ms-rest-js", "crypto", "fs", "os"], - input: "dist-esm/src/index.js", - output: { - file: "dist/index.js", - format: "cjs", - sourcemap: true - }, - preserveSymlinks: false, - plugins: [nodeResolve(), uglify()] - }; -}; +const inputs = []; -const browserRollupConfigFactory = isProduction => { - const browserRollupConfig = { - input: "dist-esm/src/index.browser.js", - output: { - file: "browser/azure-storage.queue.js", - banner: banner, - format: "umd", - name: "azqueue", - sourcemap: true - }, - preserveSymlinks: false, - plugins: [ - replace({ - delimiters: ["", ""], - values: { - // replace dynamic checks with if (false) since this is for - // browser only. Rollup's dead code elimination will remove - // any code guarded by if (isNode) { ... } - "if (isNode)": "if (false)" - } - }), - // os is not used by the browser bundle, so just shim it - shim({ - dotenv: `export function config() { }`, - os: ` - export const type = 1; - export const release = 1; - ` - }), - nodeResolve({ - mainFields: ['module', 'browser'], - preferBuiltins: false - }), - commonjs({ - namedExports: { - assert: ["ok", "deepEqual", "equal", "fail", "deepStrictEqual"] - } - }) - ] - }; +if (!process.env.ONLY_BROWSER) { + inputs.push(base.nodeConfig()); +} - if (isProduction) { - browserRollupConfig.output.file = "browser/azure-storage.queue.min.js"; - browserRollupConfig.plugins.push( - uglify({ - output: { - preamble: banner - } - }) - // Comment visualizer because it only works on Node.js 8+; Uncomment it to get bundle analysis report - // visualizer({ - // filename: "./statistics.html", - // sourcemap: true - // }) - ); - } +// Disable this until we are ready to run rollup for the browser. +if (!process.env.ONLY_NODE) { + inputs.push(base.browserConfig()); + inputs.push(base.browserConfig(false, true)); +} - return browserRollupConfig; -}; - -export default [ - browserRollupConfigFactory(false), - browserRollupConfigFactory(true), - nodeRollupConfigFactory() -]; \ No newline at end of file +export default inputs; diff --git a/sdk/storage/storage-queue/rollup.test.config.js b/sdk/storage/storage-queue/rollup.test.config.js index c938a6ac63f6..ad98718cce46 100644 --- a/sdk/storage/storage-queue/rollup.test.config.js +++ b/sdk/storage/storage-queue/rollup.test.config.js @@ -1,13 +1,6 @@ -import multi from "rollup-plugin-multi-entry"; -import baseConfig from "./rollup.config"; -import sourcemaps from "rollup-plugin-sourcemaps"; -const [browser] = baseConfig; +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. -browser.input = ["dist-esm/test/*.js", "dist-esm/test/browser/*.js"]; -browser.output.sourcemap = "inline"; -browser.output.file = "dist-test/index.browser.js"; -browser.plugins.unshift(multi()); -browser.plugins.unshift(sourcemaps()); -browser.context = "null"; +import * as base from "./rollup.base.config"; -export default [browser]; \ No newline at end of file +export default [base.nodeConfig(true), base.browserConfig(true)]; diff --git a/sdk/storage/storage-queue/samples/javascript/basic.js b/sdk/storage/storage-queue/samples/javascript/basic.js index 1b84868410f4..51b523d7d169 100644 --- a/sdk/storage/storage-queue/samples/javascript/basic.js +++ b/sdk/storage/storage-queue/samples/javascript/basic.js @@ -4,11 +4,11 @@ const { Aborter, - QueueURL, - MessagesURL, - MessageIdURL, - ServiceURL, - StorageURL, + QueueClient, + MessagesClient, + MessageIdClient, + QueueServiceClient, + StorageClient, SharedKeyCredential, AnonymousCredential, TokenCredential @@ -30,7 +30,7 @@ async function main() { const anonymousCredential = new AnonymousCredential(); // Use sharedKeyCredential, tokenCredential or anonymousCredential to create a pipeline - const pipeline = StorageURL.newPipeline(sharedKeyCredential, { + const pipeline = StorageClient.newPipeline(sharedKeyCredential, { // httpClient: MyHTTPClient, // A customized HTTP client implementing IHttpClient interface // logger: MyLogger, // A customized logger implementing IHttpPipelineLogger interface retryOptions: { @@ -42,7 +42,7 @@ async function main() { }); // List queues - const serviceURL = new ServiceURL( + const queueServiceClient = new QueueServiceClient( // When using AnonymousCredential, following url should include a valid SAS or support public access `https://${account}.queue.core.windows.net`, pipeline @@ -51,8 +51,7 @@ async function main() { console.log(`List queues`); let marker; do { - const listQueuesResponse = await serviceURL.listQueuesSegment( - Aborter.none, + const listQueuesResponse = await queueServiceClient.listQueuesSegment( marker ); @@ -64,38 +63,38 @@ async function main() { // Create a new queue const queueName = `newqueue${new Date().getTime()}`; - const queueURL = QueueURL.fromServiceURL(serviceURL, queueName); - const createQueueResponse = await queueURL.create(Aborter.none); + const queueClient = QueueClient.fromQueueServiceClient(queueServiceClient, queueName); + const createQueueResponse = await queueClient.create(); console.log( `Create queue ${queueName} successfully, service assigned request Id: ${createQueueResponse.requestId}` ); // Enqueue a message into the queue using the enqueue method. - const messagesURL = MessagesURL.fromQueueURL(queueURL); - const enqueueQueueResponse = await messagesURL.enqueue(Aborter.none, "Hello World!"); + const messagesClient = MessagesClient.fromQueueClient(queueClient); + const enqueueQueueResponse = await messagesClient.enqueue("Hello World!"); console.log( `Enqueue message successfully, service assigned message Id: ${enqueueQueueResponse.messageId}, service assigned request Id: ${enqueueQueueResponse.requestId}` ); // Peek a message using peek method. - const peekQueueResponse = await messagesURL.peek(Aborter.none); + const peekQueueResponse = await messagesClient.peek(); console.log(`The peeked message is: ${peekQueueResponse.peekedMessageItems[0].messageText}`); // You de-queue a message in two steps. Call GetMessage at which point the message becomes invisible to any other code reading messages // from this queue for a default period of 30 seconds. To finish removing the message from the queue, you call DeleteMessage. // This two-step process ensures that if your code fails to process a message due to hardware or software failure, another instance // of your code can get the same message and try again. - const dequeueResponse = await messagesURL.dequeue(Aborter.none); + const dequeueResponse = await messagesClient.dequeue(); if (dequeueResponse.dequeuedMessageItems.length == 1) { const dequeueMessageItem = dequeueResponse.dequeuedMessageItems[0]; console.log(`Processing & deleting message with content: ${dequeueMessageItem.messageText}`); - const messageIdURL = MessageIdURL.fromMessagesURL(messagesURL, dequeueMessageItem.messageId); - const deleteMessageResponse = await messageIdURL.delete(Aborter.none, dequeueMessageItem.popReceipt); + const messageIdClient = MessageIdClient.fromMessagesClient(messagesClient, dequeueMessageItem.messageId); + const deleteMessageResponse = await messageIdClient.delete(dequeueMessageItem.popReceipt); console.log(`Delete message succesfully, service assigned request Id: ${deleteMessageResponse.requestId}`); } // Delete the queue. - const deleteQueueResponse = await queueURL.delete(Aborter.none); + const deleteQueueResponse = await queueClient.delete(); console.log(`Delete queue successfully, service assigned request Id: ${deleteQueueResponse.requestId}`); } diff --git a/sdk/storage/storage-queue/samples/typescript/basic.ts b/sdk/storage/storage-queue/samples/typescript/basic.ts index b68cad816e07..c454890edc78 100644 --- a/sdk/storage/storage-queue/samples/typescript/basic.ts +++ b/sdk/storage/storage-queue/samples/typescript/basic.ts @@ -3,12 +3,11 @@ */ import { - Aborter, - QueueURL, - MessagesURL, - MessageIdURL, - ServiceURL, - StorageURL, + QueueClient, + MessagesClient, + MessageIdClient, + QueueServiceClient, + StorageClient, SharedKeyCredential, TokenCredential, Models @@ -29,7 +28,7 @@ async function main() { // const anonymousCredential = new AnonymousCredential(); // Use sharedKeyCredential, tokenCredential or anonymousCredential to create a pipeline - const pipeline = StorageURL.newPipeline(sharedKeyCredential, { + const pipeline = StorageClient.newPipeline(sharedKeyCredential, { // httpClient: MyHTTPClient, // A customized HTTP client implementing IHttpClient interface // logger: MyLogger, // A customized logger implementing IHttpPipelineLogger interface retryOptions: { @@ -41,7 +40,7 @@ async function main() { }); // List queues - const serviceURL = new ServiceURL( + const queueServiceClient = new QueueServiceClient( // When using AnonymousCredential, following url should include a valid SAS or support public access `https://${account}.queue.core.windows.net`, pipeline @@ -50,8 +49,7 @@ async function main() { console.log(`List queues`); let marker; do { - const listQueuesResponse: Models.ServiceListQueuesSegmentResponse = await serviceURL.listQueuesSegment( - Aborter.none, + const listQueuesResponse: Models.ServiceListQueuesSegmentResponse = await queueServiceClient.listQueuesSegment( marker ); @@ -63,8 +61,8 @@ async function main() { // Create a new queue const queueName = `newqueue${new Date().getTime()}`; - const queueURL = QueueURL.fromServiceURL(serviceURL, queueName); - const createQueueResponse = await queueURL.create(Aborter.none); + const queueClient = QueueClient.fromQueueServiceClient(queueServiceClient, queueName); + const createQueueResponse = await queueClient.create(); console.log( `Create queue ${queueName} successfully, service assigned request Id: ${ createQueueResponse.requestId @@ -72,9 +70,8 @@ async function main() { ); // Enqueue a message into the queue using the enqueue method. - const messagesURL = MessagesURL.fromQueueURL(queueURL); - const enqueueQueueResponse = await messagesURL.enqueue( - Aborter.none, + const messagesClient = MessagesClient.fromQueueClient(queueClient); + const enqueueQueueResponse = await messagesClient.enqueue( "Hello World!" ); console.log( @@ -84,7 +81,7 @@ async function main() { ); // Peek a message using peek method. - const peekQueueResponse = await messagesURL.peek(Aborter.none); + const peekQueueResponse = await messagesClient.peek(); console.log( `The peeked message is: ${ peekQueueResponse.peekedMessageItems[0].messageText @@ -95,7 +92,7 @@ async function main() { // from this queue for a default period of 30 seconds. To finish removing the message from the queue, you call DeleteMessage. // This two-step process ensures that if your code fails to process a message due to hardware or software failure, another instance // of your code can get the same message and try again. - const dequeueResponse = await messagesURL.dequeue(Aborter.none); + const dequeueResponse = await messagesClient.dequeue(); if (dequeueResponse.dequeuedMessageItems.length == 1) { const dequeueMessageItem = dequeueResponse.dequeuedMessageItems[0]; console.log( @@ -103,12 +100,11 @@ async function main() { dequeueMessageItem.messageText }` ); - const messageIdURL = MessageIdURL.fromMessagesURL( - messagesURL, + const messageIdClient = MessageIdClient.fromMessagesClient( + messagesClient, dequeueMessageItem.messageId ); - const deleteMessageResponse = await messageIdURL.delete( - Aborter.none, + const deleteMessageResponse = await messageIdClient.delete( dequeueMessageItem.popReceipt ); console.log( @@ -119,7 +115,7 @@ async function main() { } // Delete the queue. - const deleteQueueResponse = await queueURL.delete(Aborter.none); + const deleteQueueResponse = await queueClient.delete(); console.log( `Delete queue successfully, service assigned request Id: ${ deleteQueueResponse.requestId diff --git a/sdk/storage/storage-queue/src/Aborter.ts b/sdk/storage/storage-queue/src/Aborter.ts index 7f95e4dd65a2..30be81bfac43 100644 --- a/sdk/storage/storage-queue/src/Aborter.ts +++ b/sdk/storage/storage-queue/src/Aborter.ts @@ -62,16 +62,14 @@ export class Aborter implements AbortSignalLike { * * @memberof Aborter */ - public onabort?: ((ev?: Event) => any); + public onabort?: (ev?: Event) => any; // tslint:disable-next-line:variable-name private _aborted: boolean = false; private timer?: any; private readonly parent?: Aborter; private readonly children: Aborter[] = []; // When child object calls dispose(), remove child from here - private readonly abortEventListeners: Array< - (this: AbortSignalLike, ev?: any) => any - > = []; + private readonly abortEventListeners: Array<(this: AbortSignalLike, ev?: any) => any> = []; // Pipeline proxies need to use "abortSignal as Aborter" in order to access non AbortSignalLike methods // immutable primitive types private readonly key?: string; @@ -143,10 +141,7 @@ export class Aborter implements AbortSignalLike { * @returns {Aborter} * @memberof Aborter */ - public withValue( - key: string, - value?: string | number | boolean | null - ): Aborter { + public withValue(key: string, value?: string | number | boolean | null): Aborter { const childCancelContext = new Aborter(this, 0, key, value); this.children.push(childCancelContext); return childCancelContext; @@ -163,11 +158,7 @@ export class Aborter implements AbortSignalLike { * @memberof Aborter */ public getValue(key: string): string | number | boolean | null | undefined { - for ( - let parent: Aborter | undefined = this; - parent; - parent = parent.parent - ) { + for (let parent: Aborter | undefined = this; parent; parent = parent.parent) { if (parent.key === key) { return parent.value; } @@ -195,11 +186,11 @@ export class Aborter implements AbortSignalLike { this.onabort.call(this); } - this.abortEventListeners.forEach(listener => { + this.abortEventListeners.forEach((listener) => { listener.call(this, undefined); }); - this.children.forEach(child => child.cancelByParent()); + this.children.forEach((child) => child.cancelByParent()); this._aborted = true; } diff --git a/sdk/storage/storage-queue/src/AccountSASPermissions.ts b/sdk/storage/storage-queue/src/AccountSASPermissions.ts index 4c337df4ffed..8d590fe00013 100644 --- a/sdk/storage/storage-queue/src/AccountSASPermissions.ts +++ b/sdk/storage/storage-queue/src/AccountSASPermissions.ts @@ -7,7 +7,7 @@ * This is a helper class to construct a string representing the permissions granted by an AccountSAS. Setting a value * to true means that any SAS which uses these permissions will grant permissions for that operation. Once all the * values are set, this should be serialized with toString and set as the permissions field on an - * {@link IAccountSASSignatureValues} object. It is possible to construct the permissions string without this class, but + * {@link AccountSASSignatureValues} object. It is possible to construct the permissions string without this class, but * the order of the permissions is particular and this class guarantees correctness. * * @export @@ -125,7 +125,7 @@ export class AccountSASPermissions { /** * Produces the SAS permissions string for an Azure Storage account. - * Call this method to set IAccountSASSignatureValues Permissions field. + * Call this method to set AccountSASSignatureValues Permissions field. * * Using this method will guarantee the resource types are in * an order accepted by the service. diff --git a/sdk/storage/storage-queue/src/AccountSASResourceTypes.ts b/sdk/storage/storage-queue/src/AccountSASResourceTypes.ts index 0954cb9aa639..12b4988871fd 100644 --- a/sdk/storage/storage-queue/src/AccountSASResourceTypes.ts +++ b/sdk/storage/storage-queue/src/AccountSASResourceTypes.ts @@ -7,7 +7,7 @@ * This is a helper class to construct a string representing the resources accessible by an AccountSAS. Setting a value * to true means that any SAS which uses these permissions will grant access to that resource type. Once all the * values are set, this should be serialized with toString and set as the resources field on an - * {@link IAccountSASSignatureValues} object. It is possible to construct the resources string without this class, but + * {@link AccountSASSignatureValues} object. It is possible to construct the resources string without this class, but * the order of the resources is particular and this class guarantees correctness. * * @export diff --git a/sdk/storage/storage-queue/src/AccountSASServices.ts b/sdk/storage/storage-queue/src/AccountSASServices.ts index 82c6c5affe17..7a6c99f27c59 100644 --- a/sdk/storage/storage-queue/src/AccountSASServices.ts +++ b/sdk/storage/storage-queue/src/AccountSASServices.ts @@ -7,7 +7,7 @@ * This is a helper class to construct a string representing the services accessible by an AccountSAS. Setting a value * to true means that any SAS which uses these permissions will grant access to that service. Once all the * values are set, this should be serialized with toString and set as the services field on an - * {@link IAccountSASSignatureValues} object. It is possible to construct the services string without this class, but + * {@link AccountSASSignatureValues} object. It is possible to construct the services string without this class, but * the order of the services is particular and this class guarantees correctness. * * @export diff --git a/sdk/storage/storage-queue/src/IAccountSASSignatureValues.ts b/sdk/storage/storage-queue/src/AccountSASSignatureValues.ts similarity index 79% rename from sdk/storage/storage-queue/src/IAccountSASSignatureValues.ts rename to sdk/storage/storage-queue/src/AccountSASSignatureValues.ts index cd53c7b1388a..1de130aed331 100644 --- a/sdk/storage/storage-queue/src/IAccountSASSignatureValues.ts +++ b/sdk/storage/storage-queue/src/AccountSASSignatureValues.ts @@ -5,7 +5,7 @@ import { AccountSASPermissions } from "./AccountSASPermissions"; import { AccountSASResourceTypes } from "./AccountSASResourceTypes"; import { AccountSASServices } from "./AccountSASServices"; import { SharedKeyCredential } from "./credentials/SharedKeyCredential"; -import { IIPRange, ipRangeToString } from "./IIPRange"; +import { IPRange, ipRangeToString } from "./IPRange"; import { SASProtocol, SASQueryParameters } from "./SASQueryParameters"; import { SERVICE_VERSION } from "./utils/constants"; import { truncatedISO8061Date } from "./utils/utils.common"; @@ -13,7 +13,7 @@ import { truncatedISO8061Date } from "./utils/utils.common"; /** * ONLY AVAILABLE IN NODE.JS RUNTIME. * - * IAccountSASSignatureValues is used to generate a Shared Access Signature (SAS) for an Azure Storage account. Once + * AccountSASSignatureValues is used to generate a Shared Access Signature (SAS) for an Azure Storage account. Once * all the values here are set appropriately, call generateSASQueryParameters() to obtain a representation of the SAS * which can actually be applied to queue urls. Note: that both this class and {@link SASQueryParameters} exist because * the former is mutable and a logical representation while the latter is immutable and used to generate actual REST @@ -26,14 +26,14 @@ import { truncatedISO8061Date } from "./utils/utils.common"; * for descriptions of the parameters, including which are required * * @export - * @class IAccountSASSignatureValues + * @class AccountSASSignatureValues */ -export interface IAccountSASSignatureValues { +export interface AccountSASSignatureValues { /** * If not provided, this defaults to the service version targeted by this version of the library. * * @type {string} - * @memberof IAccountSASSignatureValues + * @memberof AccountSASSignatureValues */ version?: string; @@ -41,7 +41,7 @@ export interface IAccountSASSignatureValues { * Optional. SAS protocols allowed. * * @type {SASProtocol} - * @memberof IAccountSASSignatureValues + * @memberof AccountSASSignatureValues */ protocol?: SASProtocol; @@ -49,7 +49,7 @@ export interface IAccountSASSignatureValues { * Optional. When the SAS will take effect. * * @type {Date} - * @memberof IAccountSASSignatureValues + * @memberof AccountSASSignatureValues */ startTime?: Date; @@ -57,7 +57,7 @@ export interface IAccountSASSignatureValues { * The time after which the SAS will no longer work. * * @type {Date} - * @memberof IAccountSASSignatureValues + * @memberof AccountSASSignatureValues */ expiryTime: Date; @@ -66,24 +66,24 @@ export interface IAccountSASSignatureValues { * constructing the permissions string. * * @type {string} - * @memberof IAccountSASSignatureValues + * @memberof AccountSASSignatureValues */ permissions: string; /** * Optional. IP range allowed. * - * @type {IIPRange} - * @memberof IAccountSASSignatureValues + * @type {IPRange} + * @memberof AccountSASSignatureValues */ - ipRange?: IIPRange; + ipRange?: IPRange; /** * The values that indicate the services accessible with this SAS. Please refer to {@link AccountSASServices} to * construct this value. * * @type {string} - * @memberof IAccountSASSignatureValues + * @memberof AccountSASSignatureValues */ services: string; @@ -92,7 +92,7 @@ export interface IAccountSASSignatureValues { * to {@link AccountSASResourceTypes} to construct this value. * * @type {string} - * @memberof IAccountSASSignatureValues + * @memberof AccountSASSignatureValues */ resourceTypes: string; } @@ -107,10 +107,10 @@ export interface IAccountSASSignatureValues { * * @param {SharedKeyCredential} sharedKeyCredential * @returns {SASQueryParameters} - * @memberof IAccountSASSignatureValues + * @memberof AccountSASSignatureValues */ export function generateAccountSASQueryParameters( - accountSASSignatureValues: IAccountSASSignatureValues, + accountSASSignatureValues: AccountSASSignatureValues, sharedKeyCredential: SharedKeyCredential ): SASQueryParameters { const version = accountSASSignatureValues.version @@ -120,9 +120,7 @@ export function generateAccountSASQueryParameters( const parsedPermissions = AccountSASPermissions.parse( accountSASSignatureValues.permissions ).toString(); - const parsedServices = AccountSASServices.parse( - accountSASSignatureValues.services - ).toString(); + const parsedServices = AccountSASServices.parse(accountSASSignatureValues.services).toString(); const parsedResourceTypes = AccountSASResourceTypes.parse( accountSASSignatureValues.resourceTypes ).toString(); @@ -136,12 +134,8 @@ export function generateAccountSASQueryParameters( ? truncatedISO8061Date(accountSASSignatureValues.startTime, false) : "", truncatedISO8061Date(accountSASSignatureValues.expiryTime, false), - accountSASSignatureValues.ipRange - ? ipRangeToString(accountSASSignatureValues.ipRange) - : "", - accountSASSignatureValues.protocol - ? accountSASSignatureValues.protocol - : "", + accountSASSignatureValues.ipRange ? ipRangeToString(accountSASSignatureValues.ipRange) : "", + accountSASSignatureValues.protocol ? accountSASSignatureValues.protocol : "", version, "" // Account SAS requires an additional newline character ].join("\n"); diff --git a/sdk/storage/storage-queue/src/BrowserPolicyFactory.ts b/sdk/storage/storage-queue/src/BrowserPolicyFactory.ts index 306981413e8a..081b843dab15 100644 --- a/sdk/storage/storage-queue/src/BrowserPolicyFactory.ts +++ b/sdk/storage/storage-queue/src/BrowserPolicyFactory.ts @@ -1,12 +1,7 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -import { - RequestPolicy, - RequestPolicyFactory, - RequestPolicyOptions -} from "@azure/ms-rest-js"; - +import { RequestPolicy, RequestPolicyFactory, RequestPolicyOptions } from "@azure/ms-rest-js"; import { BrowserPolicy } from "./policies/BrowserPolicy"; /** @@ -17,10 +12,7 @@ import { BrowserPolicy } from "./policies/BrowserPolicy"; * @implements {RequestPolicyFactory} */ export class BrowserPolicyFactory implements RequestPolicyFactory { - public create( - nextPolicy: RequestPolicy, - options: RequestPolicyOptions - ): BrowserPolicy { + public create(nextPolicy: RequestPolicy, options: RequestPolicyOptions): BrowserPolicy { return new BrowserPolicy(nextPolicy, options); } } diff --git a/sdk/storage/storage-queue/src/IIPRange.ts b/sdk/storage/storage-queue/src/IPRange.ts similarity index 83% rename from sdk/storage/storage-queue/src/IIPRange.ts rename to sdk/storage/storage-queue/src/IPRange.ts index a19e43cdb5d0..4e0b31a3a060 100644 --- a/sdk/storage/storage-queue/src/IIPRange.ts +++ b/sdk/storage/storage-queue/src/IPRange.ts @@ -5,9 +5,9 @@ * Allowed IP range for a SAS. * * @export - * @interface IIPRange + * @interface IPRange */ -export interface IIPRange { +export interface IPRange { /** * Starting IP address in the IP range. * If end IP doesn't provide, start IP will the only IP allowed. @@ -32,9 +32,9 @@ export interface IIPRange { * "8.8.8.8" or "1.1.1.1-255.255.255.255" * * @export - * @param {IIPRange} ipRange + * @param {IPRange} ipRange * @returns {string} */ -export function ipRangeToString(ipRange: IIPRange): string { +export function ipRangeToString(ipRange: IPRange): string { return ipRange.end ? `${ipRange.start}-${ipRange.end}` : ipRange.start; } diff --git a/sdk/storage/storage-queue/src/LoggingPolicyFactory.ts b/sdk/storage/storage-queue/src/LoggingPolicyFactory.ts index 809625c208d2..2c0658385e69 100644 --- a/sdk/storage/storage-queue/src/LoggingPolicyFactory.ts +++ b/sdk/storage/storage-queue/src/LoggingPolicyFactory.ts @@ -1,26 +1,21 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -import { - RequestPolicy, - RequestPolicyFactory, - RequestPolicyOptions -} from "@azure/ms-rest-js"; - +import { RequestPolicy, RequestPolicyFactory, RequestPolicyOptions } from "@azure/ms-rest-js"; import { LoggingPolicy } from "./policies/LoggingPolicy"; /** * RequestLogOptions configures the retry policy's behavior. * * @export - * @interface IRequestLogOptions + * @interface RequestLogOptions */ -export interface IRequestLogOptions { +export interface RequestLogOptions { /** * LogWarningIfTryOverThreshold logs a warning if a tried operation takes longer than the specified * duration in ms. Default is 3000ms. * @type {number} - * @memberof IRequestLogOptions + * @memberof RequestLogOptions */ logWarningIfTryOverThreshold: number; } @@ -33,16 +28,13 @@ export interface IRequestLogOptions { * @implements {RequestPolicyFactory} */ export class LoggingPolicyFactory implements RequestPolicyFactory { - private readonly loggingOptions?: IRequestLogOptions; + private readonly loggingOptions?: RequestLogOptions; - constructor(loggingOptions?: IRequestLogOptions) { + constructor(loggingOptions?: RequestLogOptions) { this.loggingOptions = loggingOptions; } - public create( - nextPolicy: RequestPolicy, - options: RequestPolicyOptions - ): LoggingPolicy { + public create(nextPolicy: RequestPolicy, options: RequestPolicyOptions): LoggingPolicy { return new LoggingPolicy(nextPolicy, options, this.loggingOptions); } } diff --git a/sdk/storage/storage-queue/src/MessageIdURL.ts b/sdk/storage/storage-queue/src/MessageIdClient.ts similarity index 64% rename from sdk/storage/storage-queue/src/MessageIdURL.ts rename to sdk/storage/storage-queue/src/MessageIdClient.ts index 596314cfea73..18598456d520 100644 --- a/sdk/storage/storage-queue/src/MessageIdURL.ts +++ b/sdk/storage/storage-queue/src/MessageIdClient.ts @@ -5,30 +5,38 @@ import * as Models from "./generated/lib/models"; import { Aborter } from "./Aborter"; import { MessageId } from "./generated/lib/operations"; import { Pipeline } from "./Pipeline"; -import { MessagesURL } from "./MessagesURL"; -import { StorageURL } from "./StorageURL"; +import { MessagesClient } from "./MessagesClient"; +import { StorageClient } from "./StorageClient"; import { appendToURLPath } from "./utils/utils.common"; +export interface MessageIdDeleteOptions { + abortSignal?: Aborter; +} + +export interface MessageIdUpdateOptions { + abortSignal?: Aborter; +} + /** - * A MessageIdURL represents a URL to a specific Azure Storage Queue message allowing you to manipulate the message. + * A MessageIdClient represents a URL to a specific Azure Storage Queue message allowing you to manipulate the message. * * @export - * @class MessageIdURL - * @extends {StorageURL} + * @class MessageIdClient + * @extends {StorageClient} */ -export class MessageIdURL extends StorageURL { +export class MessageIdClient extends StorageClient { /** - * Creates a MessageIdURL object from MessagesURL - * @param messagesURL + * Creates a MessageIdClient object from MessagesClient + * @param messagesClient * @param messageId */ - public static fromMessagesURL( - messagesURL: MessagesURL, + public static fromMessagesClient( + messagesClient: MessagesClient, messageId: string - ): MessageIdURL { - return new MessageIdURL( - appendToURLPath(messagesURL.url, messageId), - messagesURL.pipeline + ): MessageIdClient { + return new MessageIdClient( + appendToURLPath(messagesClient.url, messageId), + messagesClient.pipeline ); } @@ -37,19 +45,19 @@ export class MessageIdURL extends StorageURL { * * @private * @type {MessageId} - * @memberof MessageIdURL + * @memberof MessageIdClient */ private messageIdContext: MessageId; /** - * Creates an instance of MessageIdURL. + * Creates an instance of MessageIdClient. * @param {string} url A URL string pointing to Azure Storage queue's message, such as * "https://myaccount.queue.core.windows.net/myqueue/messages/messageid". You can * append a SAS if using AnonymousCredential, such as * "https://myaccount.queue.core.windows.net/myqueue/messages/messageid?sasString". - * @param {Pipeline} pipeline Call StorageURL.newPipeline() to create a default + * @param {Pipeline} pipeline Call StorageClient.newPipeline() to create a default * pipeline, or provide a customized pipeline. - * @memberof MessageIdURL + * @memberof MessageIdClient */ constructor(url: string, pipeline: Pipeline) { super(url, pipeline); @@ -57,31 +65,31 @@ export class MessageIdURL extends StorageURL { } /** - * Creates a new MessageIdURL object identical to the source but with the + * Creates a new MessageIdClient object identical to the source but with the * specified request policy pipeline. * * @param {Pipeline} pipeline - * @returns {MessageIdURL} - * @memberof MessageIdURL + * @returns {MessageIdClient} + * @memberof MessageIdClient */ - public withPipeline(pipeline: Pipeline): MessageIdURL { - return new MessageIdURL(this.url, pipeline); + public withPipeline(pipeline: Pipeline): MessageIdClient { + return new MessageIdClient(this.url, pipeline); } /** * Delete permanently removes the specified message from its queue. * @see https://docs.microsoft.com/en-us/rest/api/storageservices/delete-message2 * - * @param {Aborter} aborter Create a new Aborter instance with Aborter.none or Aborter.timeout(), - * goto documents of Aborter for more examples about request cancellation * @param {string} popReceipt A valid pop receipt value returned from an earlier call to the dequeue messages or update message operation. + * @param {MessageIdDeleteOptions} [options] Optional options to MessageId Delete operation. * @returns {Promise} - * @memberof MessageIdURL + * @memberof MessageIdClient */ public async delete( - aborter: Aborter, - popReceipt: string + popReceipt: string, + options: MessageIdDeleteOptions = {} ): Promise { + const aborter = options.abortSignal || Aborter.none; return this.messageIdContext.deleteMethod(popReceipt, { abortSignal: aborter }); @@ -89,12 +97,10 @@ export class MessageIdURL extends StorageURL { /** * Update changes a message's visibility timeout and contents. - * The message content is up to 64KB in size, and must be in a format that can be included in an XML request with UTF-8 encoding. - * To include markup in the message, the contents of the message must either be XML-escaped or Base64-encode. + * The message content is up to 64KB in size, and must be in a format that can be included in an XML request with UTF-8 encoding. + * To include markup in the message, the contents of the message must either be XML-escaped or Base64-encode. * @see https://docs.microsoft.com/en-us/rest/api/storageservices/update-message * - * @param {Aborter} aborter Create a new Aborter instance with Aborter.none or Aborter.timeout(), - * goto documents of Aborter for more examples about request cancellation * @param {string} popReceipt A valid pop receipt value returned from an earlier call to the dequeue messages or update message operation. * @param {number} visibilityTimeout Specifies the new visibility timeout value, in seconds, * relative to server time. The new value must be larger than or equal to 0, @@ -102,15 +108,17 @@ export class MessageIdURL extends StorageURL { * be set to a value later than the expiry time. * A message can be updated until it has been deleted or has expired. * @param {string} message Message to update. + * @param {MessageIdUpdateOptions} [options] Optional options to MessageId Update operation. * @returns {Promise} - * @memberof MessageIdURL + * @memberof MessageIdClient */ public async update( - aborter: Aborter, popReceipt: string, visibilityTimeout: number, - message: string + message: string, + options: MessageIdUpdateOptions = {} ): Promise { + const aborter = options.abortSignal || Aborter.none; return this.messageIdContext.update( { messageText: message diff --git a/sdk/storage/storage-queue/src/MessagesURL.ts b/sdk/storage/storage-queue/src/MessagesClient.ts similarity index 74% rename from sdk/storage/storage-queue/src/MessagesURL.ts rename to sdk/storage/storage-queue/src/MessagesClient.ts index db24f52425e2..20176c58d83d 100644 --- a/sdk/storage/storage-queue/src/MessagesURL.ts +++ b/sdk/storage/storage-queue/src/MessagesClient.ts @@ -2,14 +2,27 @@ // Licensed under the MIT License. import { HttpResponse } from "@azure/ms-rest-js"; -import * as Models from "../src/generated/lib/models"; +import * as Models from "./generated/lib/models"; import { Aborter } from "./Aborter"; import { Messages } from "./generated/lib/operations"; import { Pipeline } from "./Pipeline"; -import { QueueURL } from "./QueueURL"; -import { StorageURL } from "./StorageURL"; +import { QueueClient } from "./QueueClient"; +import { StorageClient } from "./StorageClient"; import { appendToURLPath } from "./utils/utils.common"; +export interface MessagesClearOptions { + abortSignal?: Aborter; +} + +export interface MessagesEnqueueOptions extends Models.MessagesEnqueueOptionalParams { +} + +export interface MessagesDequeueOptions extends Models.MessagesDequeueOptionalParams { +} + +export interface MessagesPeekOptions extends Models.MessagesPeekOptionalParams { +} + export declare type MessagesEnqueueResponse = { /** * @member {string} messageId The ID of the enqueued Message. @@ -101,23 +114,20 @@ export declare type MessagesPeekResponse = { }; /** - * A MessagesURL represents a URL to an Azure Storage Queue's messages allowing you to manipulate its messages. + * A MessagesClient represents a URL to an Azure Storage Queue's messages allowing you to manipulate its messages. * * @export - * @class MessagesURL - * @extends {StorageURL} + * @class MessagesClient + * @extends {StorageClient} */ -export class MessagesURL extends StorageURL { +export class MessagesClient extends StorageClient { /** - * Creates a MessagesURL object from QueueURL - * @param queueURL + * Creates a MessagesClient object from QueueClient + * @param queueClient * @param queueName */ - public static fromQueueURL(queueURL: QueueURL): MessagesURL { - return new MessagesURL( - appendToURLPath(queueURL.url, "messages"), - queueURL.pipeline - ); + public static fromQueueClient(queueClient: QueueClient): MessagesClient { + return new MessagesClient(appendToURLPath(queueClient.url, "messages"), queueClient.pipeline); } /** @@ -125,19 +135,19 @@ export class MessagesURL extends StorageURL { * * @private * @type {Messages} - * @memberof MessagesURL + * @memberof MessagesClient */ private messagesContext: Messages; /** - * Creates an instance of MessagesURL. + * Creates an instance of MessagesClient. * @param {string} url A URL string pointing to Azure Storage queue's messages, such as * "https://myaccount.queue.core.windows.net/myqueue/messages". You can * append a SAS if using AnonymousCredential, such as * "https://myaccount.queue.core.windows.net/myqueue/messages?sasString". - * @param {Pipeline} pipeline Call StorageURL.newPipeline() to create a default + * @param {Pipeline} pipeline Call StorageClient.newPipeline() to create a default * pipeline, or provide a customized pipeline. - * @memberof MessagesURL + * @memberof MessagesClient */ constructor(url: string, pipeline: Pipeline) { super(url, pipeline); @@ -145,27 +155,29 @@ export class MessagesURL extends StorageURL { } /** - * Creates a new MessagesURL object identical to the source but with the + * Creates a new MessagesClient object identical to the source but with the * specified request policy pipeline. * * @param {Pipeline} pipeline - * @returns {MessagesURL} - * @memberof MessagesURL + * @returns {MessagesClient} + * @memberof MessagesClient */ - public withPipeline(pipeline: Pipeline): MessagesURL { - return new MessagesURL(this.url, pipeline); + public withPipeline(pipeline: Pipeline): MessagesClient { + return new MessagesClient(this.url, pipeline); } /** * Clear deletes all messages from a queue. * @see https://docs.microsoft.com/en-us/rest/api/storageservices/clear-messages * - * @param {Aborter} aborter Create a new Aborter instance with Aborter.none or Aborter.timeout(), - * goto documents of Aborter for more examples about request cancellation + * @param {MessagesClearOptions} [options] Optional options to Messages clear operation. * @returns {Promise} - * @memberof MessagesURL + * @memberof MessagesClient */ - public async clear(aborter: Aborter): Promise { + public async clear( + options: MessagesClearOptions = {} + ): Promise { + const aborter = options.abortSignal || Aborter.none; return this.messagesContext.clear({ abortSignal: aborter }); @@ -174,22 +186,20 @@ export class MessagesURL extends StorageURL { /** * Enqueue adds a new message to the back of a queue. The visibility timeout specifies how long * the message should be invisible to Dequeue and Peek operations. - * The message content is up to 64KB in size, and must be in a format that can be included in an XML request with UTF-8 encoding. - * To include markup in the message, the contents of the message must either be XML-escaped or Base64-encode. + * The message content is up to 64KB in size, and must be in a format that can be included in an XML request with UTF-8 encoding. + * To include markup in the message, the contents of the message must either be XML-escaped or Base64-encode. * @see https://docs.microsoft.com/en-us/rest/api/storageservices/put-message * - * @param {Aborter} aborter Create a new Aborter instance with Aborter.none or Aborter.timeout(), - * goto documents of Aborter for more examples about request cancellation * @param {string} messageText - * @param {Models.MessagesEnqueueOptionalParams} [options] + * @param {MessagesEnqueueOptionas} [options] Optional optiosn to Messages enqueue operation. * @returns {Promise} - * @memberof MessagesURL + * @memberof MessagesClient */ public async enqueue( - aborter: Aborter, messageText: string, - options: Models.MessagesEnqueueOptionalParams = {} + options: MessagesEnqueueOptions = {} ): Promise { + const aborter = options.abortSignal || Aborter.none; const response = await this.messagesContext.enqueue( { messageText: messageText @@ -220,14 +230,14 @@ export class MessagesURL extends StorageURL { * * @param {Aborter} aborter Create a new Aborter instance with Aborter.none or Aborter.timeout(), * goto documents of Aborter for more examples about request cancellation - * @param {Models.MessagesDequeueOptionalParams} [options] + * @param {MessagesDequeueOptionals} [options] Optional optiosn to Messages dequeue operation. * @returns {Promise} - * @memberof MessagesURL + * @memberof MessagesClient */ public async dequeue( - aborter: Aborter, - options: Models.MessagesDequeueOptionalParams = {} + options: MessagesDequeueOptions = {} ): Promise { + const aborter = options.abortSignal || Aborter.none; const response = await this.messagesContext.dequeue({ abortSignal: aborter, ...options @@ -255,14 +265,14 @@ export class MessagesURL extends StorageURL { * * @param {Aborter} aborter Create a new Aborter instance with Aborter.none or Aborter.timeout(), * goto documents of Aborter for more examples about request cancellation - * @param {Models.MessagesPeekOptionalParams} [options] + * @param {MessagesPeekOptions} [options] Optional optiosn to Messages peek operation. * @returns {Promise} - * @memberof MessagesURL + * @memberof MessagesClient */ public async peek( - aborter: Aborter, - options: Models.MessagesPeekOptionalParams = {} + options: MessagesPeekOptions = {} ): Promise { + const aborter = options.abortSignal || Aborter.none; const response = await this.messagesContext.peek({ abortSignal: aborter, ...options diff --git a/sdk/storage/storage-queue/src/Pipeline.ts b/sdk/storage/storage-queue/src/Pipeline.ts index e1ac7d53fa8a..9f9e8b8ec95e 100644 --- a/sdk/storage/storage-queue/src/Pipeline.ts +++ b/sdk/storage/storage-queue/src/Pipeline.ts @@ -36,18 +36,18 @@ export { * Option interface for Pipeline constructor. * * @export - * @interface IPipelineOptions + * @interface PipelineOptions */ -export interface IPipelineOptions { +export interface PipelineOptions { logger?: IHttpPipelineLogger; HTTPClient?: IHttpClient; } /** * A Pipeline class containing HTTP request policies. - * You can create a default Pipeline by calling StorageURL.newPipeline(). + * You can create a default Pipeline by calling StorageClient.newPipeline(). * Or you can create a Pipeline with your own policies by the constructor of Pipeline. - * Refer to StorageURL.newPipeline() and provided policies as reference before + * Refer to StorageClient.newPipeline() and provided policies as reference before * implementing your customized Pipeline. * * @export @@ -55,19 +55,16 @@ export interface IPipelineOptions { */ export class Pipeline { public readonly factories: RequestPolicyFactory[]; - public readonly options: IPipelineOptions; + public readonly options: PipelineOptions; /** * Creates an instance of Pipeline. Customize HTTPClient by implementing IHttpClient interface. * * @param {RequestPolicyFactory[]} factories - * @param {IPipelineOptions} [options={}] + * @param {PipelineOptions} [options={}] * @memberof Pipeline */ - constructor( - factories: RequestPolicyFactory[], - options: IPipelineOptions = {} - ) { + constructor(factories: RequestPolicyFactory[], options: PipelineOptions = {}) { this.factories = factories; this.options = options; } diff --git a/sdk/storage/storage-queue/src/QueueURL.ts b/sdk/storage/storage-queue/src/QueueClient.ts similarity index 69% rename from sdk/storage/storage-queue/src/QueueURL.ts rename to sdk/storage/storage-queue/src/QueueClient.ts index 44c7c773ad7f..af0ce2a9fa85 100644 --- a/sdk/storage/storage-queue/src/QueueURL.ts +++ b/sdk/storage/storage-queue/src/QueueClient.ts @@ -2,20 +2,41 @@ // Licensed under the MIT License. import { HttpResponse } from "@azure/ms-rest-js"; -import * as Models from "../src/generated/lib/models"; +import * as Models from "./generated/lib/models"; import { Aborter } from "./Aborter"; import { Queue } from "./generated/lib/operations"; -import { IMetadata } from "./models"; +import { Metadata } from "./models"; import { Pipeline } from "./Pipeline"; -import { ServiceURL } from "./ServiceURL"; -import { StorageURL } from "./StorageURL"; +import { QueueServiceClient } from "./QueueServiceClient"; +import { StorageClient } from "./StorageClient"; import { appendToURLPath, truncatedISO8061Date } from "./utils/utils.common"; -export interface IQueueCreateOptions { - metadata?: IMetadata; +export interface QueueCreateOptions { + abortSignal?: Aborter; + metadata?: Metadata; } -export interface ISignedIdentifier { +export interface QueueGetPropertiesOptions { + abortSignal?: Aborter; +} + +export interface QueueDeleteOptions { + abortSignal?: Aborter; +} + +export interface QueueGetAccessPolicyOptions { + abortSignal?: Aborter; +} + +export interface QueueSetAccessPolicyOptions { + abortSignal?: Aborter; +} + +export interface QueueSetMetadataOptions { + abortSignal?: Aborter; +} + +export interface SignedIdentifier { /** * @member {string} id a unique id */ @@ -41,7 +62,7 @@ export interface ISignedIdentifier { } export declare type QueueGetAccessPolicyResponse = { - signedIdentifiers: ISignedIdentifier[]; + signedIdentifiers: SignedIdentifier[]; } & Models.QueueGetAccessPolicyHeaders & { /** * The underlying HTTP response. @@ -67,21 +88,21 @@ export declare type QueueGetAccessPolicyResponse = { * * @export * @class QueueURL - * @extends {StorageURL} + * @extends {StorageClient} */ -export class QueueURL extends StorageURL { +export class QueueClient extends StorageClient { /** - * Creates a QueueURL object from ServiceURL - * @param serviceURL + * Creates a QueueURL object from QueueServiceClient + * @param queueServiceClient * @param queueName */ - public static fromServiceURL( - serviceURL: ServiceURL, + public static fromQueueServiceClient( + queueServiceClient: QueueServiceClient, queueName: string - ): QueueURL { - return new QueueURL( - appendToURLPath(serviceURL.url, queueName), - serviceURL.pipeline + ): QueueClient { + return new QueueClient( + appendToURLPath(queueServiceClient.url, queueName), + queueServiceClient.pipeline ); } @@ -100,7 +121,7 @@ export class QueueURL extends StorageURL { * "https://myaccount.queue.core.windows.net/myqueue". You can * append a SAS if using AnonymousCredential, such as * "https://myaccount.queue.core.windows.net/myqueue?sasString". - * @param {Pipeline} pipeline Call StorageURL.newPipeline() to create a default + * @param {Pipeline} pipeline Call StorageClient.newPipeline() to create a default * pipeline, or provide a customized pipeline. * @memberof QueueURL */ @@ -114,27 +135,25 @@ export class QueueURL extends StorageURL { * specified request policy pipeline. * * @param {Pipeline} pipeline - * @returns {QueueURL} + * @returns {QueueClient} * @memberof QueueURL */ - public withPipeline(pipeline: Pipeline): QueueURL { - return new QueueURL(this.url, pipeline); + public withPipeline(pipeline: Pipeline): QueueClient { + return new QueueClient(this.url, pipeline); } /** * Creates a new queue under the specified account. * @see https://docs.microsoft.com/en-us/rest/api/storageservices/create-queue4 * - * @param {Aborter} aborter Create a new Aborter instance with Aborter.none or Aborter.timeout(), - * goto documents of Aborter for more examples about request cancellation - * @param {IQueueCreateOptions} [options] + * @param {QueueCreateOptions} [options] Optional options to Queue create operation. * @returns {Promise} * @memberof QueueURL */ public async create( - aborter: Aborter, - options: IQueueCreateOptions = {} + options: QueueCreateOptions = {} ): Promise { + const aborter = options.abortSignal || Aborter.none; return this.queueContext.create({ ...options, abortSignal: aborter @@ -146,14 +165,14 @@ export class QueueURL extends StorageURL { * queue. Metadata is associated with the queue as name-values pairs. * @see https://docs.microsoft.com/en-us/rest/api/storageservices/get-queue-metadata * - * @param {Aborter} aborter Create a new Aborter instance with Aborter.none or Aborter.timeout(), - * goto documents of Aborter for more examples about request cancellation + * @param {QueueGetPropertiesOptions} [options] Optional options to Queue get properties operation. * @returns {Promise} * @memberof QueueURL */ public async getProperties( - aborter: Aborter + options: QueueGetPropertiesOptions = {} ): Promise { + const aborter = options.abortSignal || Aborter.none; return this.queueContext.getProperties({ abortSignal: aborter }); @@ -163,12 +182,14 @@ export class QueueURL extends StorageURL { * Deletes the specified queue permanently. * @see https://docs.microsoft.com/en-us/rest/api/storageservices/delete-queue3 * - * @param {Aborter} aborter Create a new Aborter instance with Aborter.none or Aborter.timeout(), - * goto documents of Aborter for more examples about request cancellation + * @param {QueueDeleteOptions} [options] Optional options to Queue delete operation. * @returns {Promise} * @memberof QueueURL */ - public async delete(aborter: Aborter): Promise { + public async delete( + options: QueueDeleteOptions = {} + ): Promise { + const aborter = options.abortSignal || Aborter.none; return this.queueContext.deleteMethod({ abortSignal: aborter }); @@ -181,16 +202,16 @@ export class QueueURL extends StorageURL { * metadata will be removed. * @see https://docs.microsoft.com/en-us/rest/api/storageservices/set-queue-metadata * - * @param {Aborter} aborter Create a new Aborter instance with Aborter.none or Aborter.timeout(), - * goto documents of Aborter for more examples about request cancellation - * @param {IMetadata} [metadata] If no metadata provided, all existing metadata will be removed. + * @param {Metadata} [metadata] If no metadata provided, all existing metadata will be removed. + * @param {QueueSetMetadataOptions} [options] Optional options to Queue set metadata operation. * @returns {Promise} * @memberof QueueURL */ public async setMetadata( - aborter: Aborter, - metadata?: IMetadata + metadata?: Metadata, + options: QueueSetMetadataOptions = {} ): Promise { + const aborter = options.abortSignal || Aborter.none; return this.queueContext.setMetadata({ abortSignal: aborter, metadata @@ -205,15 +226,14 @@ export class QueueURL extends StorageURL { * * @see https://docs.microsoft.com/en-us/rest/api/storageservices/get-queue-acl * - * @param {Aborter} aborter Create a new Aborter instance with Aborter.none or Aborter.timeout(), - * goto documents of Aborter for more examples about request cancellation - * @param {IQueueGetAccessPolicyOptions} [options] + * @param {QueueGetAccessPolicyOptions} [options] Optional options to Queue get access policy operation. * @returns {Promise} * @memberof QueueURL */ public async getAccessPolicy( - aborter: Aborter + options: QueueGetAccessPolicyOptions = {} ): Promise { + const aborter = options.abortSignal || Aborter.none; const response = await this.queueContext.getAccessPolicy({ abortSignal: aborter }); @@ -245,18 +265,17 @@ export class QueueURL extends StorageURL { * Sets stored access policies for the queue that may be used with Shared Access Signatures. * @see https://docs.microsoft.com/en-us/rest/api/storageservices/set-queue-acl * - * @param {Aborter} aborter Create a new Aborter instance with Aborter.none or Aborter.timeout(), - * goto documents of Aborter for more examples about request cancellation * @param {PublicAccessType} [access] - * @param {ISignedIdentifier[]} [queueAcl] - * @param {IQueueSetAccessPolicyOptions} [options] + * @param {SignedIdentifier[]} [queueAcl] + * @param {QueueSetAccessPolicyOptions} [options] Optional options to Queue set access policy operation. * @returns {Promise} * @memberof QueueURL */ public async setAccessPolicy( - aborter: Aborter, - queueAcl?: ISignedIdentifier[] + queueAcl?: SignedIdentifier[], + options: QueueSetAccessPolicyOptions = {} ): Promise { + const aborter = options.abortSignal || Aborter.none; const acl: Models.SignedIdentifier[] = []; for (const identifier of queueAcl || []) { acl.push({ diff --git a/sdk/storage/storage-queue/src/QueueSASPermissions.ts b/sdk/storage/storage-queue/src/QueueSASPermissions.ts index ea4199f24458..fc6717886ffe 100644 --- a/sdk/storage/storage-queue/src/QueueSASPermissions.ts +++ b/sdk/storage/storage-queue/src/QueueSASPermissions.ts @@ -7,7 +7,7 @@ * This is a helper class to construct a string representing the permissions granted by a ServiceSAS to a Queue. Setting * a value to true means that any SAS which uses these permissions will grant permissions for that operation. Once all * the values are set, this should be serialized with toString and set as the permissions field on a - * {@link IQueueSASSignatureValues} object. It is possible to construct the permissions string without this class, but + * {@link QueueSASSignatureValues} object. It is possible to construct the permissions string without this class, but * the order of the permissions is particular and this class guarantees correctness. * * @export diff --git a/sdk/storage/storage-queue/src/IQueueSASSignatureValues.ts b/sdk/storage/storage-queue/src/QueueSASSignatureValues.ts similarity index 78% rename from sdk/storage/storage-queue/src/IQueueSASSignatureValues.ts rename to sdk/storage/storage-queue/src/QueueSASSignatureValues.ts index 0c717a5b2d0b..7bfaf5c5a68e 100644 --- a/sdk/storage/storage-queue/src/IQueueSASSignatureValues.ts +++ b/sdk/storage/storage-queue/src/QueueSASSignatureValues.ts @@ -3,7 +3,7 @@ import { QueueSASPermissions } from "./QueueSASPermissions"; import { SharedKeyCredential } from "./credentials/SharedKeyCredential"; -import { IIPRange, ipRangeToString } from "./IIPRange"; +import { IPRange, ipRangeToString } from "./IPRange"; import { SASProtocol } from "./SASQueryParameters"; import { SASQueryParameters } from "./SASQueryParameters"; import { SERVICE_VERSION } from "./utils/constants"; @@ -12,18 +12,18 @@ import { truncatedISO8061Date } from "./utils/utils.common"; /** * ONLY AVAILABLE IN NODE.JS RUNTIME. * - * IQueueSASSignatureValues is used to help generating Queue service SAS tokens for queues. + * QueueSASSignatureValues is used to help generating Queue service SAS tokens for queues. * * @export - * @class IQueueSASSignatureValues + * @class QueueSASSignatureValues */ -export interface IQueueSASSignatureValues { +export interface QueueSASSignatureValues { /** * The version of the service this SAS will target. If not specified, it will default to the version targeted by the * library. * * @type {string} - * @memberof IQueueSASSignatureValues + * @memberof QueueSASSignatureValues */ version?: string; @@ -31,7 +31,7 @@ export interface IQueueSASSignatureValues { * Optional. SAS protocols, HTTPS only or HTTPSandHTTP * * @type {SASProtocol} - * @memberof IQueueSASSignatureValues + * @memberof QueueSASSignatureValues */ protocol?: SASProtocol; @@ -39,7 +39,7 @@ export interface IQueueSASSignatureValues { * Optional. When the SAS will take effect. * * @type {Date} - * @memberof IQueueSASSignatureValues + * @memberof QueueSASSignatureValues */ startTime?: Date; @@ -47,7 +47,7 @@ export interface IQueueSASSignatureValues { * Optional only when identifier is provided. The time after which the SAS will no longer work. * * @type {Date} - * @memberof IQueueSASSignatureValues + * @memberof QueueSASSignatureValues */ expiryTime?: Date; @@ -57,23 +57,23 @@ export interface IQueueSASSignatureValues { * being accessed for help constructing the permissions string. * * @type {string} - * @memberof IQueueSASSignatureValues + * @memberof QueueSASSignatureValues */ permissions?: string; /** * Optional. IP ranges allowed in this SAS. * - * @type {IIPRange} - * @memberof IQueueSASSignatureValues + * @type {IPRange} + * @memberof QueueSASSignatureValues */ - ipRange?: IIPRange; + ipRange?: IPRange; /** * The name of the queue the SAS user may access. * * @type {string} - * @memberof IQueueSASSignatureValues + * @memberof QueueSASSignatureValues */ queueName: string; @@ -83,7 +83,7 @@ export interface IQueueSASSignatureValues { * @see https://docs.microsoft.com/en-us/rest/api/storageservices/establishing-a-stored-access-policy * * @type {string} - * @memberof IQueueSASSignatureValues + * @memberof QueueSASSignatureValues */ identifier?: string; } @@ -101,12 +101,12 @@ export interface IQueueSASSignatureValues { * this constructor. * * @export - * @param {IQueueSASSignatureValues} queueSASSignatureValues + * @param {QueueSASSignatureValues} queueSASSignatureValues * @param {SharedKeyCredential} sharedKeyCredential * @returns {SASQueryParameters} */ export function generateQueueSASQueryParameters( - queueSASSignatureValues: IQueueSASSignatureValues, + queueSASSignatureValues: QueueSASSignatureValues, sharedKeyCredential: SharedKeyCredential ): SASQueryParameters { if ( @@ -125,9 +125,7 @@ export function generateQueueSASQueryParameters( // Calling parse and toString guarantees the proper ordering and throws on invalid characters. if (queueSASSignatureValues.permissions) { - verifiedPermissions = QueueSASPermissions.parse( - queueSASSignatureValues.permissions - ).toString(); + verifiedPermissions = QueueSASPermissions.parse(queueSASSignatureValues.permissions).toString(); } // Signature is generated on the un-url-encoded values. @@ -139,14 +137,9 @@ export function generateQueueSASQueryParameters( queueSASSignatureValues.expiryTime ? truncatedISO8061Date(queueSASSignatureValues.expiryTime, false) : "", - getCanonicalName( - sharedKeyCredential.accountName, - queueSASSignatureValues.queueName - ), + getCanonicalName(sharedKeyCredential.accountName, queueSASSignatureValues.queueName), queueSASSignatureValues.identifier, - queueSASSignatureValues.ipRange - ? ipRangeToString(queueSASSignatureValues.ipRange) - : "", + queueSASSignatureValues.ipRange ? ipRangeToString(queueSASSignatureValues.ipRange) : "", queueSASSignatureValues.protocol ? queueSASSignatureValues.protocol : "", version ].join("\n"); @@ -167,10 +160,7 @@ export function generateQueueSASQueryParameters( ); } -function getCanonicalName( - accountName: string, - queueName: string -): string { +function getCanonicalName(accountName: string, queueName: string): string { // Queue: "/queue/account/queueName" return `/queue/${accountName}/${queueName}`; } diff --git a/sdk/storage/storage-queue/src/ServiceURL.ts b/sdk/storage/storage-queue/src/QueueServiceClient.ts similarity index 70% rename from sdk/storage/storage-queue/src/ServiceURL.ts rename to sdk/storage/storage-queue/src/QueueServiceClient.ts index 12716dc8aa47..8bf36d429308 100644 --- a/sdk/storage/storage-queue/src/ServiceURL.ts +++ b/sdk/storage/storage-queue/src/QueueServiceClient.ts @@ -1,14 +1,27 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -import * as Models from "../src/generated/lib/models"; +import * as Models from "./generated/lib/models"; import { Aborter } from "./Aborter"; import { ListQueuesIncludeType } from "./generated/lib/models/index"; import { Service } from "./generated/lib/operations"; import { Pipeline } from "./Pipeline"; -import { StorageURL } from "./StorageURL"; +import { StorageClient } from "./StorageClient"; -export interface IServiceListQueuesSegmentOptions { +export interface ServiceGetPropertiesOptions { + abortSignal?: Aborter; +} + +export interface ServiceSetPropertiesOptions { + abortSignal?: Aborter; +} + +export interface ServiceGetStatisticsOptions { + abortSignal?: Aborter; +} + +export interface ServiceListQueuesSegmentOptions { + abortSignal?: Aborter; /** * @member {string} [prefix] Filters the results to return only queues * whose name begins with the specified prefix. @@ -33,31 +46,31 @@ export interface IServiceListQueuesSegmentOptions { } /** - * A ServiceURL represents a URL to the Azure Storage Queue service allowing you + * A QueueServiceClient represents a URL to the Azure Storage Queue service allowing you * to manipulate queues. * * @export - * @class ServiceURL - * @extends {StorageURL} + * @class QueueServiceClient + * @extends {StorageClient} */ -export class ServiceURL extends StorageURL { +export class QueueServiceClient extends StorageClient { /** * serviceContext provided by protocol layer. * * @private * @type {Service} - * @memberof ServiceURL + * @memberof QueueServiceClient */ private serviceContext: Service; /** - * Creates an instance of ServiceURL. + * Creates an instance of QueueServiceClient. * @param {string} url A URL string pointing to Azure Storage queue service, such as * "https://myaccount.queue.core.windows.net". You can append a SAS * if using AnonymousCredential, such as "https://myaccount.queue.core.windows.net?sasString". - * @param {Pipeline} pipeline Call StorageURL.newPipeline() to create a default + * @param {Pipeline} pipeline Call StorageClient.newPipeline() to create a default * pipeline, or provide a customized pipeline. - * @memberof ServiceURL + * @memberof QueueServiceClient */ constructor(url: string, pipeline: Pipeline) { super(url, pipeline); @@ -65,15 +78,15 @@ export class ServiceURL extends StorageURL { } /** - * Creates a new ServiceURL object identical to the source but with the + * Creates a new QueueServiceClient object identical to the source but with the * specified request policy pipeline. * * @param {Pipeline} pipeline - * @returns {ServiceURL} - * @memberof ServiceURL + * @returns {QueueServiceClient} + * @memberof QueueServiceClient */ - public withPipeline(pipeline: Pipeline): ServiceURL { - return new ServiceURL(this.url, pipeline); + public withPipeline(pipeline: Pipeline): QueueServiceClient { + return new QueueServiceClient(this.url, pipeline); } /** @@ -81,14 +94,14 @@ export class ServiceURL extends StorageURL { * for Storage Analytics and CORS (Cross-Origin Resource Sharing) rules. * @see https://docs.microsoft.com/en-us/rest/api/storageservices/get-queue-service-properties * - * @param {Aborter} aborter Create a new Aborter instance with Aborter.none or Aborter.timeout(), - * goto documents of Aborter for more examples about request cancellation + * @param {ServiceGetPropertiesOptions} [options] Optional options to get properties operation. * @returns {Promise} - * @memberof ServiceURL + * @memberof QueueServiceClient */ public async getProperties( - aborter: Aborter + options: ServiceGetPropertiesOptions = {} ): Promise { + const aborter = options.abortSignal || Aborter.none; return this.serviceContext.getProperties({ abortSignal: aborter }); @@ -99,16 +112,16 @@ export class ServiceURL extends StorageURL { * for Storage Analytics, CORS (Cross-Origin Resource Sharing) rules and soft delete settings. * @see https://docs.microsoft.com/en-us/rest/api/storageservices/set-queue-service-properties * - * @param {Aborter} aborter Create a new Aborter instance with Aborter.none or Aborter.timeout(), - * goto documents of Aborter for more examples about request cancellation * @param {Models.StorageServiceProperties} properties + * @param {ServiceGetPropertiesOptions} [options] Optional options to set properties operation. * @returns {Promise} - * @memberof ServiceURL + * @memberof QueueServiceClient */ public async setProperties( - aborter: Aborter, - properties: Models.StorageServiceProperties + properties: Models.StorageServiceProperties, + options: ServiceGetPropertiesOptions = {} ): Promise { + const aborter = options.abortSignal || Aborter.none; return this.serviceContext.setProperties(properties, { abortSignal: aborter }); @@ -120,14 +133,14 @@ export class ServiceURL extends StorageURL { * replication is enabled for the storage account. * @see https://docs.microsoft.com/en-us/rest/api/storageservices/get-queue-service-stats * - * @param {Aborter} aborter Create a new Aborter instance with Aborter.none or Aborter.timeout(), - * goto documents of Aborter for more examples about request cancellation + * @param {ServiceGetStatisticsOptions} [options] Optional optiosn to get statistics operation. * @returns {Promise} - * @memberof ServiceURL + * @memberof QueueServiceClient */ public async getStatistics( - aborter: Aborter + options: ServiceGetStatisticsOptions = {} ): Promise { + const aborter = options.abortSignal || Aborter.none; return this.serviceContext.getStatistics({ abortSignal: aborter }); @@ -137,8 +150,6 @@ export class ServiceURL extends StorageURL { * Returns a list of the queues under the specified account. * @see https://docs.microsoft.com/en-us/rest/api/storageservices/list-queues1 * - * @param {Aborter} aborter Create a new Aborter instance with Aborter.none or Aborter.timeout(), - * goto documents of Aborter for more examples about request cancellation * @param {string} [marker] A string value that identifies the portion of * the list of queues to be returned with the next listing operation. The * operation returns the NextMarker value within the response body if the @@ -146,15 +157,15 @@ export class ServiceURL extends StorageURL { * with the current page. The NextMarker value can be used as the value for * the marker parameter in a subsequent call to request the next page of list * items. The marker value is opaque to the client. - * @param {IServiceListQueuesSegmentOptions} [options] + * @param {ServiceListQueuesSegmentOptions} [options] Optional optiosn to list queues operation. * @returns {Promise} - * @memberof ServiceURL + * @memberof QueueServiceClient */ public async listQueuesSegment( - aborter: Aborter, marker?: string, - options: IServiceListQueuesSegmentOptions = {} + options: ServiceListQueuesSegmentOptions = {} ): Promise { + const aborter = options.abortSignal || Aborter.none; return this.serviceContext.listQueuesSegment({ abortSignal: aborter, marker, diff --git a/sdk/storage/storage-queue/src/RetryPolicyFactory.ts b/sdk/storage/storage-queue/src/RetryPolicyFactory.ts index 6a54b6f02db9..cd2041cf8197 100644 --- a/sdk/storage/storage-queue/src/RetryPolicyFactory.ts +++ b/sdk/storage/storage-queue/src/RetryPolicyFactory.ts @@ -1,21 +1,16 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -import { - RequestPolicy, - RequestPolicyFactory, - RequestPolicyOptions -} from "@azure/ms-rest-js"; - +import { RequestPolicy, RequestPolicyFactory, RequestPolicyOptions } from "@azure/ms-rest-js"; import { RetryPolicy, RetryPolicyType } from "./policies/RetryPolicy"; /** * Retry options interface. * * @export - * @interface IRetryOptions + * @interface RetryOptions */ -export interface IRetryOptions { +export interface RetryOptions { /** * Optional. RetryPolicyType, default is exponential retry policy. * @@ -30,7 +25,7 @@ export interface IRetryOptions { * A value smaller than 1 means default retry number of attempts. * * @type {number} - * @memberof IRetryOptions + * @memberof RetryOptions */ readonly maxTries?: number; @@ -41,7 +36,7 @@ export interface IRetryOptions { * @see https://docs.microsoft.com/en-us/rest/api/storageservices/setting-timeouts-for-queue-service-operations * * @type {number} - * @memberof IRetryOptions + * @memberof RetryOptions */ readonly tryTimeoutInMs?: number; @@ -51,7 +46,7 @@ export interface IRetryOptions { * maxRetryDelayInMs. If you specify 0, then you must also specify 0 for maxRetryDelayInMs. * * @type {number} - * @memberof IRetryOptions + * @memberof RetryOptions */ readonly retryDelayInMs?: number; @@ -60,7 +55,7 @@ export interface IRetryOptions { * If you specify 0, then you must also specify 0 for retryDelayInMs. * * @type {number} - * @memberof IRetryOptions + * @memberof RetryOptions */ readonly maxRetryDelayInMs?: number; @@ -73,7 +68,7 @@ export interface IRetryOptions { * {@link https://docs.microsoft.com/en-us/azure/storage/common/storage-designing-ha-apps-with-ragrs} * * @type {string} - * @memberof IRetryOptions + * @memberof RetryOptions */ readonly secondaryHost?: string; } @@ -86,21 +81,18 @@ export interface IRetryOptions { * @implements {RequestPolicyFactory} */ export class RetryPolicyFactory implements RequestPolicyFactory { - private retryOptions?: IRetryOptions; + private retryOptions?: RetryOptions; /** * Creates an instance of RetryPolicyFactory. - * @param {IRetryOptions} [retryOptions] + * @param {RetryOptions} [retryOptions] * @memberof RetryPolicyFactory */ - constructor(retryOptions?: IRetryOptions) { + constructor(retryOptions?: RetryOptions) { this.retryOptions = retryOptions; } - public create( - nextPolicy: RequestPolicy, - options: RequestPolicyOptions - ): RetryPolicy { + public create(nextPolicy: RequestPolicy, options: RequestPolicyOptions): RetryPolicy { return new RetryPolicy(nextPolicy, options, this.retryOptions); } } diff --git a/sdk/storage/storage-queue/src/SASQueryParameters.ts b/sdk/storage/storage-queue/src/SASQueryParameters.ts index b51ef6314d01..d6ed83c968f5 100644 --- a/sdk/storage/storage-queue/src/SASQueryParameters.ts +++ b/sdk/storage/storage-queue/src/SASQueryParameters.ts @@ -1,7 +1,7 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -import { IIPRange, ipRangeToString } from "./IIPRange"; +import { IPRange, ipRangeToString } from "./IPRange"; import { truncatedISO8061Date } from "./utils/utils.common"; /** @@ -24,7 +24,7 @@ export enum SASProtocol { /** * Represents the components that make up an Azure Storage SAS' query parameters. This type is not constructed directly - * by the user; it is only generated by the {@link IAccountSASSignatureValues} and {@link IQueueSASSignatureValues} + * by the user; it is only generated by the {@link AccountSASSignatureValues} and {@link QueueSASSignatureValues} * types. Once generated, it can be encoded into a {@code String} and appended to a URL directly (though caution should * be taken here in case there are existing query parameters, which might affect the appropriate means of appending * these query parameters). @@ -95,7 +95,7 @@ export class SASQueryParameters { public readonly resourceTypes?: string; /** - * Optional. The signed identifier (only for {@link IQueueSASSignatureValues}). + * Optional. The signed identifier (only for {@link QueueSASSignatureValues}). * * @see https://docs.microsoft.com/en-us/rest/api/storageservices/establishing-a-stored-access-policy * @@ -105,7 +105,7 @@ export class SASQueryParameters { public readonly identifier?: string; /** - * Optional. The storage queue (only for {@link IQueueSASSignatureValues}). + * Optional. The storage queue (only for {@link QueueSASSignatureValues}). * * @type {string} * @memberof SASQueryParameters @@ -124,19 +124,19 @@ export class SASQueryParameters { * Inner value of getter ipRange. * * @private - * @type {IIPRange} + * @type {IPRange} * @memberof SASQueryParameters */ - private readonly ipRangeInner?: IIPRange; + private readonly ipRangeInner?: IPRange; /** * Optional. IP range allowed for this SAS. * * @readonly - * @type {(IIPRange | undefined)} + * @type {(IPRange | undefined)} * @memberof SASQueryParameters */ - public get ipRange(): IIPRange | undefined { + public get ipRange(): IPRange | undefined { if (this.ipRangeInner) { return { end: this.ipRangeInner.end, @@ -157,7 +157,7 @@ export class SASQueryParameters { * @param {SASProtocol} [protocol] Representing the allowed HTTP protocol(s) * @param {Date} [startTime] Representing the start time for this SAS token * @param {Date} [expiryTime] Representing the expiry time for this SAS token - * @param {IIPRange} [ipRange] Representing the range of valid IP addresses for this SAS token + * @param {IPRange} [ipRange] Representing the range of valid IP addresses for this SAS token * @param {string} [identifier] Representing the signed identifier (only for Service SAS) * @param {string} [resource] Representing the storage queue (only for Service SAS) * @memberof SASQueryParameters @@ -171,7 +171,7 @@ export class SASQueryParameters { protocol?: SASProtocol, startTime?: Date, expiryTime?: Date, - ipRange?: IIPRange, + ipRange?: IPRange, identifier?: string, resource?: string ) { @@ -195,19 +195,7 @@ export class SASQueryParameters { * @memberof SASQueryParameters */ public toString(): string { - const params: string[] = [ - "sv", - "ss", - "srt", - "spr", - "st", - "se", - "sip", - "si", - "sr", - "sp", - "sig" - ]; + const params: string[] = ["sv", "ss", "srt", "spr", "st", "se", "sip", "si", "sr", "sp", "sig"]; const queries: string[] = []; for (const param of params) { @@ -228,18 +216,14 @@ export class SASQueryParameters { this.tryAppendQueryParameter( queries, param, - this.startTime - ? truncatedISO8061Date(this.startTime, false) - : undefined + this.startTime ? truncatedISO8061Date(this.startTime, false) : undefined ); break; case "se": this.tryAppendQueryParameter( queries, param, - this.expiryTime - ? truncatedISO8061Date(this.expiryTime, false) - : undefined + this.expiryTime ? truncatedISO8061Date(this.expiryTime, false) : undefined ); break; case "sip": @@ -276,11 +260,7 @@ export class SASQueryParameters { * @returns {void} * @memberof SASQueryParameters */ - private tryAppendQueryParameter( - queries: string[], - key: string, - value?: string - ): void { + private tryAppendQueryParameter(queries: string[], key: string, value?: string): void { if (!value) { return; } diff --git a/sdk/storage/storage-queue/src/StorageURL.ts b/sdk/storage/storage-queue/src/StorageClient.ts similarity index 76% rename from sdk/storage/storage-queue/src/StorageURL.ts rename to sdk/storage/storage-queue/src/StorageClient.ts index 8f259ce45904..b3c1e8d1497c 100644 --- a/sdk/storage/storage-queue/src/StorageURL.ts +++ b/sdk/storage/storage-queue/src/StorageClient.ts @@ -8,11 +8,8 @@ import { Credential } from "./credentials/Credential"; import { StorageClientContext } from "./generated/lib/storageClientContext"; import { LoggingPolicyFactory } from "./LoggingPolicyFactory"; import { IHttpClient, IHttpPipelineLogger, Pipeline } from "./Pipeline"; -import { IRetryOptions, RetryPolicyFactory } from "./RetryPolicyFactory"; -import { - ITelemetryOptions, - TelemetryPolicyFactory -} from "./TelemetryPolicyFactory"; +import { RetryOptions, RetryPolicyFactory } from "./RetryPolicyFactory"; +import { TelemetryOptions, TelemetryPolicyFactory } from "./TelemetryPolicyFactory"; import { UniqueRequestIDPolicyFactory } from "./UniqueRequestIDPolicyFactory"; export { deserializationPolicy }; @@ -21,41 +18,41 @@ export { deserializationPolicy }; * Option interface for Pipeline.newPipeline method. * * @export - * @interface INewPipelineOptions + * @interface NewPipelineOptions */ -export interface INewPipelineOptions { +export interface NewPipelineOptions { /** * Telemetry configures the built-in telemetry policy behavior. * - * @type {ITelemetryOptions} - * @memberof INewPipelineOptions + * @type {TelemetryOptions} + * @memberof NewPipelineOptions */ - telemetry?: ITelemetryOptions; - retryOptions?: IRetryOptions; + telemetry?: TelemetryOptions; + retryOptions?: RetryOptions; logger?: IHttpPipelineLogger; httpClient?: IHttpClient; } /** - * A ServiceURL represents a based URL class for ServiceURL, QueueURL and etc. + * A StorageClient represents a based client class for QueueServiceClient, QueueClient and etc. * * @export - * @class StorageURL + * @class StorageClient */ -export abstract class StorageURL { +export abstract class StorageClient { /** * A static method used to create a new Pipeline object with Credential provided. * * @static * @param {Credential} credential Such as AnonymousCredential, SharedKeyCredential or TokenCredential. - * @param {INewPipelineOptions} [pipelineOptions] Optional. Options. + * @param {NewPipelineOptions} [pipelineOptions] Optional. Options. * @returns {Pipeline} A new Pipeline object. * @memberof Pipeline */ public static newPipeline( credential: Credential, - pipelineOptions: INewPipelineOptions = {} + pipelineOptions: NewPipelineOptions = {} ): Pipeline { // Order is important. Closer to the API at the top & closer to the network at the bottom. // The credential's policy factory must appear close to the wire so it can sign any @@ -81,7 +78,7 @@ export abstract class StorageURL { * * @internal * @type {Pipeline} - * @memberof StorageURL + * @memberof StorageClient */ public readonly pipeline: Pipeline; @@ -89,7 +86,7 @@ export abstract class StorageURL { * URL string value. * * @type {string} - * @memberof StorageURL + * @memberof StorageClient */ public readonly url: string; @@ -99,23 +96,20 @@ export abstract class StorageURL { * * @protected * @type {StorageClient} - * @memberof StorageURL + * @memberof StorageClient */ protected readonly storageClientContext: StorageClientContext; /** - * Creates an instance of StorageURL. + * Creates an instance of StorageClient. * @param {string} url * @param {Pipeline} pipeline - * @memberof StorageURL + * @memberof StorageClient */ protected constructor(url: string, pipeline: Pipeline) { this.url = url; this.pipeline = pipeline; - this.storageClientContext = new StorageClientContext( - url, - pipeline.toServiceClientOptions() - ); + this.storageClientContext = new StorageClientContext(url, pipeline.toServiceClientOptions()); // Override protocol layer's default content-type const storageClientContext = this.storageClientContext as any; diff --git a/sdk/storage/storage-queue/src/TelemetryPolicyFactory.ts b/sdk/storage/storage-queue/src/TelemetryPolicyFactory.ts index 93c412bf988f..3804b8d6b3d7 100644 --- a/sdk/storage/storage-queue/src/TelemetryPolicyFactory.ts +++ b/sdk/storage/storage-queue/src/TelemetryPolicyFactory.ts @@ -16,9 +16,9 @@ import { SDK_VERSION } from "./utils/constants"; * Interface of TelemetryPolicy options. * * @export - * @interface ITelemetryOptions + * @interface TelemetryOptions */ -export interface ITelemetryOptions { +export interface TelemetryOptions { value: string; } @@ -34,19 +34,16 @@ export class TelemetryPolicyFactory implements RequestPolicyFactory { /** * Creates an instance of TelemetryPolicyFactory. - * @param {ITelemetryOptions} [telemetry] + * @param {TelemetryOptions} [telemetry] * @memberof TelemetryPolicyFactory */ - constructor(telemetry?: ITelemetryOptions) { + constructor(telemetry?: TelemetryOptions) { const userAgentInfo: string[] = []; if (isNode) { if (telemetry) { const telemetryString = telemetry.value; - if ( - telemetryString.length > 0 && - userAgentInfo.indexOf(telemetryString) === -1 - ) { + if (telemetryString.length > 0 && userAgentInfo.indexOf(telemetryString) === -1) { userAgentInfo.push(telemetryString); } } @@ -58,9 +55,7 @@ export class TelemetryPolicyFactory implements RequestPolicyFactory { } // e.g. (NODE-VERSION 4.9.1; Windows_NT 10.0.16299) - const runtimeInfo = `(NODE-VERSION ${ - process.version - }; ${os.type()} ${os.release()})`; + const runtimeInfo = `(NODE-VERSION ${process.version}; ${os.type()} ${os.release()})`; if (userAgentInfo.indexOf(runtimeInfo) === -1) { userAgentInfo.push(runtimeInfo); } @@ -69,10 +64,7 @@ export class TelemetryPolicyFactory implements RequestPolicyFactory { this.telemetryString = userAgentInfo.join(" "); } - public create( - nextPolicy: RequestPolicy, - options: RequestPolicyOptions - ): TelemetryPolicy { + public create(nextPolicy: RequestPolicy, options: RequestPolicyOptions): TelemetryPolicy { return new TelemetryPolicy(nextPolicy, options, this.telemetryString); } } diff --git a/sdk/storage/storage-queue/src/UniqueRequestIDPolicyFactory.ts b/sdk/storage/storage-queue/src/UniqueRequestIDPolicyFactory.ts index c9fe0a139c8c..b891c8512d60 100644 --- a/sdk/storage/storage-queue/src/UniqueRequestIDPolicyFactory.ts +++ b/sdk/storage/storage-queue/src/UniqueRequestIDPolicyFactory.ts @@ -1,12 +1,7 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -import { - RequestPolicy, - RequestPolicyFactory, - RequestPolicyOptions -} from "@azure/ms-rest-js"; - +import { RequestPolicy, RequestPolicyFactory, RequestPolicyOptions } from "@azure/ms-rest-js"; import { UniqueRequestIDPolicy } from "./policies/UniqueRequestIDPolicy"; /** @@ -17,10 +12,7 @@ import { UniqueRequestIDPolicy } from "./policies/UniqueRequestIDPolicy"; * @implements {RequestPolicyFactory} */ export class UniqueRequestIDPolicyFactory implements RequestPolicyFactory { - public create( - nextPolicy: RequestPolicy, - options: RequestPolicyOptions - ): UniqueRequestIDPolicy { + public create(nextPolicy: RequestPolicy, options: RequestPolicyOptions): UniqueRequestIDPolicy { return new UniqueRequestIDPolicy(nextPolicy, options); } } diff --git a/sdk/storage/storage-queue/src/credentials/Credential.ts b/sdk/storage/storage-queue/src/credentials/Credential.ts index 602569eec425..1150f504dc4d 100644 --- a/sdk/storage/storage-queue/src/credentials/Credential.ts +++ b/sdk/storage/storage-queue/src/credentials/Credential.ts @@ -1,12 +1,7 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -import { - RequestPolicy, - RequestPolicyFactory, - RequestPolicyOptions -} from "@azure/ms-rest-js"; - +import { RequestPolicy, RequestPolicyFactory, RequestPolicyOptions } from "@azure/ms-rest-js"; import { CredentialPolicy } from "../policies/CredentialPolicy"; /** diff --git a/sdk/storage/storage-queue/src/credentials/TokenCredential.ts b/sdk/storage/storage-queue/src/credentials/TokenCredential.ts index 21ec319b493a..2edc993ef07f 100644 --- a/sdk/storage/storage-queue/src/credentials/TokenCredential.ts +++ b/sdk/storage/storage-queue/src/credentials/TokenCredential.ts @@ -12,9 +12,9 @@ import { TokenCredentialPolicy } from "../policies/TokenCredentialPolicy"; * * @example * const tokenCredential = new TokenCredential("token"); - * const pipeline = StorageURL.newPipeline(tokenCredential); + * const pipeline = StorageClient.newPipeline(tokenCredential); * - * const serviceURL = new ServiceURL("https://mystorageaccount.queue.core.windows.net", pipeline); + * const queueServiceClient = new QueueServiceClient("https://mystorageaccount.queue.core.windows.net", pipeline); * * // Set up a timer to refresh the token * const timerID = setInterval(() => { @@ -58,10 +58,7 @@ export class TokenCredential extends Credential { * @returns {TokenCredentialPolicy} * @memberof TokenCredential */ - public create( - nextPolicy: RequestPolicy, - options: RequestPolicyOptions - ): TokenCredentialPolicy { + public create(nextPolicy: RequestPolicy, options: RequestPolicyOptions): TokenCredentialPolicy { return new TokenCredentialPolicy(nextPolicy, options, this); } } diff --git a/sdk/storage/storage-queue/src/index.browser.ts b/sdk/storage/storage-queue/src/index.browser.ts index 5ef61b107472..95612c9cbbe4 100644 --- a/sdk/storage/storage-queue/src/index.browser.ts +++ b/sdk/storage/storage-queue/src/index.browser.ts @@ -9,9 +9,9 @@ export * from "./Aborter"; export * from "./credentials/AnonymousCredential"; export * from "./credentials/Credential"; export * from "./credentials/TokenCredential"; -export { IIPRange } from "./IIPRange"; -export * from "./MessageIdURL"; -export * from "./MessagesURL"; +export { IPRange } from "./IPRange"; +export * from "./MessageIdClient"; +export * from "./MessagesClient"; export * from "./Pipeline"; export * from "./policies/AnonymousCredentialPolicy"; export * from "./policies/CredentialPolicy"; @@ -19,9 +19,9 @@ export * from "./RetryPolicyFactory"; export * from "./LoggingPolicyFactory"; export * from "./TelemetryPolicyFactory"; export * from "./policies/TokenCredentialPolicy"; -export * from "./QueueURL" +export * from "./QueueClient"; export * from "./QueueSASPermissions"; export * from "./UniqueRequestIDPolicyFactory"; -export * from "./ServiceURL"; -export * from "./StorageURL"; +export * from "./QueueServiceClient"; +export * from "./StorageClient"; export { Models, RestError }; diff --git a/sdk/storage/storage-queue/src/index.ts b/sdk/storage/storage-queue/src/index.ts index f445732a2b2c..9190c8d30877 100644 --- a/sdk/storage/storage-queue/src/index.ts +++ b/sdk/storage/storage-queue/src/index.ts @@ -9,14 +9,14 @@ export * from "./Aborter"; export * from "./AccountSASPermissions"; export * from "./AccountSASResourceTypes"; export * from "./AccountSASServices"; -export * from "./IAccountSASSignatureValues"; +export * from "./AccountSASSignatureValues"; export * from "./credentials/AnonymousCredential"; export * from "./credentials/Credential"; export * from "./credentials/SharedKeyCredential"; export * from "./credentials/TokenCredential"; -export { IIPRange } from "./IIPRange"; -export * from "./MessageIdURL"; -export * from "./MessagesURL"; +export { IPRange } from "./IPRange"; +export * from "./MessageIdClient"; +export * from "./MessagesClient"; export * from "./Pipeline"; export * from "./policies/AnonymousCredentialPolicy"; export * from "./policies/CredentialPolicy"; @@ -25,11 +25,11 @@ export * from "./LoggingPolicyFactory"; export * from "./policies/SharedKeyCredentialPolicy"; export * from "./TelemetryPolicyFactory"; export * from "./policies/TokenCredentialPolicy"; -export * from "./QueueURL" +export * from "./QueueClient"; export * from "./QueueSASPermissions"; -export * from "./IQueueSASSignatureValues" +export * from "./QueueSASSignatureValues"; export * from "./UniqueRequestIDPolicyFactory"; -export * from "./ServiceURL"; -export * from "./StorageURL"; +export * from "./QueueServiceClient"; +export * from "./StorageClient"; export * from "./SASQueryParameters"; export { Models, RestError }; diff --git a/sdk/storage/storage-queue/src/models.ts b/sdk/storage/storage-queue/src/models.ts index 3e6160022c15..b4e039379891 100644 --- a/sdk/storage/storage-queue/src/models.ts +++ b/sdk/storage/storage-queue/src/models.ts @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -export interface IMetadata { +export interface Metadata { [propertyName: string]: string; } diff --git a/sdk/storage/storage-queue/src/policies/BrowserPolicy.ts b/sdk/storage/storage-queue/src/policies/BrowserPolicy.ts index 312a64eca570..2b7d37949eec 100644 --- a/sdk/storage/storage-queue/src/policies/BrowserPolicy.ts +++ b/sdk/storage/storage-queue/src/policies/BrowserPolicy.ts @@ -45,17 +45,12 @@ export class BrowserPolicy extends BaseRequestPolicy { * @returns {Promise} * @memberof BrowserPolicy */ - public async sendRequest( - request: WebResource - ): Promise { + public async sendRequest(request: WebResource): Promise { if (isNode) { return this._nextPolicy.sendRequest(request); } - if ( - request.method.toUpperCase() === "GET" || - request.method.toUpperCase() === "HEAD" - ) { + if (request.method.toUpperCase() === "GET" || request.method.toUpperCase() === "HEAD") { request.url = setURLParameter( request.url, URLConstants.Parameters.FORCE_BROWSER_NO_CACHE, diff --git a/sdk/storage/storage-queue/src/policies/CredentialPolicy.ts b/sdk/storage/storage-queue/src/policies/CredentialPolicy.ts index 429223215b12..e15490e27e3d 100644 --- a/sdk/storage/storage-queue/src/policies/CredentialPolicy.ts +++ b/sdk/storage/storage-queue/src/policies/CredentialPolicy.ts @@ -1,11 +1,7 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -import { - BaseRequestPolicy, - HttpOperationResponse, - WebResource -} from "@azure/ms-rest-js"; +import { BaseRequestPolicy, HttpOperationResponse, WebResource } from "@azure/ms-rest-js"; /** * Credential policy used to sign HTTP(S) requests before sending. This is an diff --git a/sdk/storage/storage-queue/src/policies/LoggingPolicy.ts b/sdk/storage/storage-queue/src/policies/LoggingPolicy.ts index ec3420ecb12f..e91999d4b0bd 100644 --- a/sdk/storage/storage-queue/src/policies/LoggingPolicy.ts +++ b/sdk/storage/storage-queue/src/policies/LoggingPolicy.ts @@ -10,12 +10,12 @@ import { WebResource } from "@azure/ms-rest-js"; -import { IRequestLogOptions } from "../LoggingPolicyFactory"; +import { RequestLogOptions } from "../LoggingPolicyFactory"; import { HTTPURLConnection, URLConstants } from "../utils/constants"; import { getURLParameter, setURLParameter } from "../utils/utils.common"; -// Default values of IRetryOptions -const DEFAULT_REQUEST_LOG_OPTIONS: IRequestLogOptions = { +// Default values of RetryOptions +const DEFAULT_REQUEST_LOG_OPTIONS: RequestLogOptions = { logWarningIfTryOverThreshold: 3000 }; @@ -30,19 +30,19 @@ export class LoggingPolicy extends BaseRequestPolicy { private operationStartTime: Date = new Date(); private requestStartTime: Date = new Date(); - private readonly loggingOptions: IRequestLogOptions; + private readonly loggingOptions: RequestLogOptions; /** * Creates an instance of LoggingPolicy. * @param {RequestPolicy} nextPolicy * @param {RequestPolicyOptions} options - * @param {IRequestLogOptions} [loggingOptions=DEFAULT_REQUEST_LOG_OPTIONS] + * @param {RequestLogOptions} [loggingOptions=DEFAULT_REQUEST_LOG_OPTIONS] * @memberof LoggingPolicy */ constructor( nextPolicy: RequestPolicy, options: RequestPolicyOptions, - loggingOptions: IRequestLogOptions = DEFAULT_REQUEST_LOG_OPTIONS + loggingOptions: RequestLogOptions = DEFAULT_REQUEST_LOG_OPTIONS ) { super(nextPolicy, options); this.loggingOptions = loggingOptions; @@ -55,9 +55,7 @@ export class LoggingPolicy extends BaseRequestPolicy { * @returns {Promise} * @memberof LoggingPolicy */ - public async sendRequest( - request: WebResource - ): Promise { + public async sendRequest(request: WebResource): Promise { this.tryCount++; this.requestStartTime = new Date(); if (this.tryCount === 1) { @@ -66,11 +64,7 @@ export class LoggingPolicy extends BaseRequestPolicy { let safeURL: string = request.url; if (getURLParameter(safeURL, URLConstants.Parameters.SIGNATURE)) { - safeURL = setURLParameter( - safeURL, - URLConstants.Parameters.SIGNATURE, - "*****" - ); + safeURL = setURLParameter(safeURL, URLConstants.Parameters.SIGNATURE, "*****"); } this.log( HttpPipelineLogLevel.INFO, @@ -81,10 +75,8 @@ export class LoggingPolicy extends BaseRequestPolicy { const response = await this._nextPolicy.sendRequest(request); const requestEndTime = new Date(); - const requestCompletionTime = - requestEndTime.getTime() - this.requestStartTime.getTime(); - const operationDuration = - requestEndTime.getTime() - this.operationStartTime.getTime(); + const requestCompletionTime = requestEndTime.getTime() - this.requestStartTime.getTime(); + const operationDuration = requestEndTime.getTime() - this.operationStartTime.getTime(); let currentLevel: HttpPipelineLogLevel = HttpPipelineLogLevel.INFO; let logMessage: string = ""; @@ -94,16 +86,13 @@ export class LoggingPolicy extends BaseRequestPolicy { } // If the response took too long, we'll upgrade to warning. - if ( - requestCompletionTime >= - this.loggingOptions.logWarningIfTryOverThreshold - ) { + if (requestCompletionTime >= this.loggingOptions.logWarningIfTryOverThreshold) { // Log a warning if the try duration exceeded the specified threshold. if (this.shouldLog(HttpPipelineLogLevel.WARNING)) { currentLevel = HttpPipelineLogLevel.WARNING; logMessage = `SLOW OPERATION. Duration > ${ this.loggingOptions.logWarningIfTryOverThreshold - } ms. `; + } ms. `; } } @@ -113,13 +102,12 @@ export class LoggingPolicy extends BaseRequestPolicy { (response.status !== HTTPURLConnection.HTTP_NOT_FOUND && response.status !== HTTPURLConnection.HTTP_CONFLICT && response.status !== HTTPURLConnection.HTTP_PRECON_FAILED && - response.status !== - HTTPURLConnection.HTTP_RANGE_NOT_SATISFIABLE)) || + response.status !== HTTPURLConnection.HTTP_RANGE_NOT_SATISFIABLE)) || (response.status >= 500 && response.status <= 509) ) { const errorString = `REQUEST ERROR: HTTP request failed with status code: ${ response.status - }. `; + }. `; logMessage = errorString; currentLevel = HttpPipelineLogLevel.ERROR; @@ -127,16 +115,14 @@ export class LoggingPolicy extends BaseRequestPolicy { const messageInfo = `Request try:${this.tryCount}, status:${ response.status - } request duration:${requestCompletionTime} ms, operation duration:${operationDuration} ms\n`; + } request duration:${requestCompletionTime} ms, operation duration:${operationDuration} ms\n`; this.log(currentLevel, logMessage + messageInfo); return response; } catch (err) { this.log( HttpPipelineLogLevel.ERROR, - `Unexpected failure attempting to make request. Error message: ${ - err.message - }` + `Unexpected failure attempting to make request. Error message: ${err.message}` ); throw err; } diff --git a/sdk/storage/storage-queue/src/policies/RetryPolicy.ts b/sdk/storage/storage-queue/src/policies/RetryPolicy.ts index 52dfcbff5c88..8781d9d990fb 100644 --- a/sdk/storage/storage-queue/src/policies/RetryPolicy.ts +++ b/sdk/storage/storage-queue/src/policies/RetryPolicy.ts @@ -13,7 +13,7 @@ import { WebResource } from "@azure/ms-rest-js"; -import { IRetryOptions } from "../RetryPolicyFactory"; +import { RetryOptions } from "../RetryPolicyFactory"; import { URLConstants } from "../utils/constants"; import { setURLHost, setURLParameter } from "../utils/utils.common"; @@ -21,17 +21,12 @@ import { setURLHost, setURLParameter } from "../utils/utils.common"; * A factory method used to generated a RetryPolicy factory. * * @export - * @param {IRetryOptions} retryOptions + * @param {RetryOptions} retryOptions * @returns */ -export function NewRetryPolicyFactory( - retryOptions?: IRetryOptions -): RequestPolicyFactory { +export function NewRetryPolicyFactory(retryOptions?: RetryOptions): RequestPolicyFactory { return { - create: ( - nextPolicy: RequestPolicy, - options: RequestPolicyOptions - ): RetryPolicy => { + create: (nextPolicy: RequestPolicy, options: RequestPolicyOptions): RetryPolicy => { return new RetryPolicy(nextPolicy, options, retryOptions); } }; @@ -54,8 +49,8 @@ export enum RetryPolicyType { FIXED } -// Default values of IRetryOptions -const DEFAULT_RETRY_OPTIONS: IRetryOptions = { +// Default values of RetryOptions +const DEFAULT_RETRY_OPTIONS: RetryOptions = { maxRetryDelayInMs: 120 * 1000, maxTries: 4, retryDelayInMs: 4 * 1000, @@ -75,23 +70,23 @@ export class RetryPolicy extends BaseRequestPolicy { * RetryOptions. * * @private - * @type {IRetryOptions} + * @type {RetryOptions} * @memberof RetryPolicy */ - private readonly retryOptions: IRetryOptions; + private readonly retryOptions: RetryOptions; /** * Creates an instance of RetryPolicy. * * @param {RequestPolicy} nextPolicy * @param {RequestPolicyOptions} options - * @param {IRetryOptions} [retryOptions=DEFAULT_RETRY_OPTIONS] + * @param {RetryOptions} [retryOptions=DEFAULT_RETRY_OPTIONS] * @memberof RetryPolicy */ constructor( nextPolicy: RequestPolicy, options: RequestPolicyOptions, - retryOptions: IRetryOptions = DEFAULT_RETRY_OPTIONS + retryOptions: RetryOptions = DEFAULT_RETRY_OPTIONS ) { super(nextPolicy, options); @@ -114,11 +109,11 @@ export class RetryPolicy extends BaseRequestPolicy { retryDelayInMs: retryOptions.retryDelayInMs && retryOptions.retryDelayInMs >= 0 ? Math.min( - retryOptions.retryDelayInMs, - retryOptions.maxRetryDelayInMs - ? retryOptions.maxRetryDelayInMs - : DEFAULT_RETRY_OPTIONS.maxRetryDelayInMs! - ) + retryOptions.retryDelayInMs, + retryOptions.maxRetryDelayInMs + ? retryOptions.maxRetryDelayInMs + : DEFAULT_RETRY_OPTIONS.maxRetryDelayInMs! + ) : DEFAULT_RETRY_OPTIONS.retryDelayInMs, maxRetryDelayInMs: @@ -139,9 +134,7 @@ export class RetryPolicy extends BaseRequestPolicy { * @returns {Promise} * @memberof RetryPolicy */ - public async sendRequest( - request: WebResource - ): Promise { + public async sendRequest(request: WebResource): Promise { return this.attemptSendRequest(request, false, 1); } @@ -169,18 +162,11 @@ export class RetryPolicy extends BaseRequestPolicy { const isPrimaryRetry = secondaryHas404 || !this.retryOptions.secondaryHost || - !( - request.method === "GET" || - request.method === "HEAD" || - request.method === "OPTIONS" - ) || + !(request.method === "GET" || request.method === "HEAD" || request.method === "OPTIONS") || attempt % 2 === 1; if (!isPrimaryRetry) { - newRequest.url = setURLHost( - newRequest.url, - this.retryOptions.secondaryHost! - ); + newRequest.url = setURLHost(newRequest.url, this.retryOptions.secondaryHost!); } // Set the server-side timeout query parameter "timeout=[seconds]" @@ -194,17 +180,14 @@ export class RetryPolicy extends BaseRequestPolicy { try { this.logf( HttpPipelineLogLevel.INFO, - `RetryPolicy: =====> Try=${attempt} ${ - isPrimaryRetry ? "Primary" : "Secondary" - }` + `RetryPolicy: =====> Try=${attempt} ${isPrimaryRetry ? "Primary" : "Secondary"}` ); response = await this._nextPolicy.sendRequest(newRequest); if (!this.shouldRetry(isPrimaryRetry, attempt, response)) { return response; } - secondaryHas404 = - secondaryHas404 || (!isPrimaryRetry && response.status === 404); + secondaryHas404 = secondaryHas404 || (!isPrimaryRetry && response.status === 404); } catch (err) { this.logf( HttpPipelineLogLevel.ERROR, @@ -279,10 +262,7 @@ export class RetryPolicy extends BaseRequestPolicy { if (response || err) { const statusCode = response ? response.status : err ? err.statusCode : 0; if (!isPrimaryRetry && statusCode === 404) { - this.logf( - HttpPipelineLogLevel.INFO, - `RetryPolicy: Secondary access with 404, will retry.` - ); + this.logf(HttpPipelineLogLevel.INFO, `RetryPolicy: Secondary access with 404, will retry.`); return true; } @@ -341,10 +321,7 @@ export class RetryPolicy extends BaseRequestPolicy { delayTimeInMs = Math.random() * 1000; } - this.logf( - HttpPipelineLogLevel.INFO, - `RetryPolicy: Delay for ${delayTimeInMs}ms` - ); + this.logf(HttpPipelineLogLevel.INFO, `RetryPolicy: Delay for ${delayTimeInMs}ms`); return delay(delayTimeInMs); } } diff --git a/sdk/storage/storage-queue/src/policies/SharedKeyCredentialPolicy.ts b/sdk/storage/storage-queue/src/policies/SharedKeyCredentialPolicy.ts index 6ffe7b6131f6..c5a2b20bb2a3 100644 --- a/sdk/storage/storage-queue/src/policies/SharedKeyCredentialPolicy.ts +++ b/sdk/storage/storage-queue/src/policies/SharedKeyCredentialPolicy.ts @@ -51,11 +51,7 @@ export class SharedKeyCredentialPolicy extends CredentialPolicy { request.headers.set(HeaderConstants.X_MS_DATE, new Date().toUTCString()); let contentLength = this.getHeaderValueToSign(request, HeaderConstants.CONTENT_LENGTH); - if ( - request.body && - typeof request.body === "string" && - request.body.length > 0 - ) { + if (request.body && typeof request.body === "string" && request.body.length > 0) { // Workaround for https://github.com/axios/axios/issues/2107 // We should properly set the 'content-length' header once the issue is solved contentLength = `${Buffer.byteLength(request.body)}`; @@ -103,10 +99,7 @@ export class SharedKeyCredentialPolicy extends CredentialPolicy { * @returns {string} * @memberof SharedKeyCredentialPolicy */ - private getHeaderValueToSign( - request: WebResource, - headerName: string - ): string { + private getHeaderValueToSign(request: WebResource, headerName: string): string { const value = request.headers.get(headerName); if (!value) { @@ -140,10 +133,8 @@ export class SharedKeyCredentialPolicy extends CredentialPolicy { * @memberof SharedKeyCredentialPolicy */ private getCanonicalizedHeadersString(request: WebResource): string { - let headersArray = request.headers.headersArray().filter(value => { - return value.name - .toLowerCase() - .startsWith(HeaderConstants.PREFIX_FOR_STORAGE); + let headersArray = request.headers.headersArray().filter((value) => { + return value.name.toLowerCase().startsWith(HeaderConstants.PREFIX_FOR_STORAGE); }); headersArray.sort( @@ -154,17 +145,14 @@ export class SharedKeyCredentialPolicy extends CredentialPolicy { // Remove duplicate headers headersArray = headersArray.filter((value, index, array) => { - if ( - index > 0 && - value.name.toLowerCase() === array[index - 1].name.toLowerCase() - ) { + if (index > 0 && value.name.toLowerCase() === array[index - 1].name.toLowerCase()) { return false; } return true; }); let canonicalizedHeadersStringToSign: string = ""; - headersArray.forEach(header => { + headersArray.forEach((header) => { canonicalizedHeadersStringToSign += `${header.name .toLowerCase() .trimRight()}:${header.value.trimLeft()}\n`; @@ -201,9 +189,7 @@ export class SharedKeyCredentialPolicy extends CredentialPolicy { queryKeys.sort(); for (const key of queryKeys) { - canonicalizedResourceString += `\n${key}:${decodeURIComponent( - lowercaseQueries[key] - )}`; + canonicalizedResourceString += `\n${key}:${decodeURIComponent(lowercaseQueries[key])}`; } } diff --git a/sdk/storage/storage-queue/src/policies/TelemetryPolicy.ts b/sdk/storage/storage-queue/src/policies/TelemetryPolicy.ts index d245c6a02375..b60d509e5906 100644 --- a/sdk/storage/storage-queue/src/policies/TelemetryPolicy.ts +++ b/sdk/storage/storage-queue/src/policies/TelemetryPolicy.ts @@ -32,14 +32,10 @@ export class TelemetryPolicy extends BaseRequestPolicy { * Creates an instance of TelemetryPolicy. * @param {RequestPolicy} nextPolicy * @param {RequestPolicyOptions} options - * @param {ITelemetryOptions} [telemetry] + * @param {TelemetryOptions} [telemetry] * @memberof TelemetryPolicy */ - constructor( - nextPolicy: RequestPolicy, - options: RequestPolicyOptions, - telemetry: string - ) { + constructor(nextPolicy: RequestPolicy, options: RequestPolicyOptions, telemetry: string) { super(nextPolicy, options); this.telemetry = telemetry; } @@ -51,9 +47,7 @@ export class TelemetryPolicy extends BaseRequestPolicy { * @returns {Promise} * @memberof TelemetryPolicy */ - public async sendRequest( - request: WebResource - ): Promise { + public async sendRequest(request: WebResource): Promise { if (isNode) { if (!request.headers) { request.headers = new HttpHeaders(); diff --git a/sdk/storage/storage-queue/src/policies/TokenCredentialPolicy.ts b/sdk/storage/storage-queue/src/policies/TokenCredentialPolicy.ts index db5165e19194..f852d3b331d1 100644 --- a/sdk/storage/storage-queue/src/policies/TokenCredentialPolicy.ts +++ b/sdk/storage/storage-queue/src/policies/TokenCredentialPolicy.ts @@ -1,12 +1,7 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -import { - HttpHeaders, - RequestPolicy, - RequestPolicyOptions, - WebResource -} from "@azure/ms-rest-js"; +import { HttpHeaders, RequestPolicy, RequestPolicyOptions, WebResource } from "@azure/ms-rest-js"; import { TokenCredential } from "../credentials/TokenCredential"; import { HeaderConstants } from "../utils/constants"; diff --git a/sdk/storage/storage-queue/src/policies/UniqueRequestIDPolicy.ts b/sdk/storage/storage-queue/src/policies/UniqueRequestIDPolicy.ts index 662624df06b9..5fd1681dc9f4 100644 --- a/sdk/storage/storage-queue/src/policies/UniqueRequestIDPolicy.ts +++ b/sdk/storage/storage-queue/src/policies/UniqueRequestIDPolicy.ts @@ -36,14 +36,9 @@ export class UniqueRequestIDPolicy extends BaseRequestPolicy { * @returns {Promise} * @memberof UniqueRequestIDPolicy */ - public async sendRequest( - request: WebResource - ): Promise { + public async sendRequest(request: WebResource): Promise { if (!request.headers.contains(HeaderConstants.X_MS_CLIENT_REQUEST_ID)) { - request.headers.set( - HeaderConstants.X_MS_CLIENT_REQUEST_ID, - generateUuid() - ); + request.headers.set(HeaderConstants.X_MS_CLIENT_REQUEST_ID, generateUuid()); } return this._nextPolicy.sendRequest(request); diff --git a/sdk/storage/storage-queue/src/utils/constants.ts b/sdk/storage/storage-queue/src/utils/constants.ts index 2496092f43e5..71b9efd11ac1 100644 --- a/sdk/storage/storage-queue/src/utils/constants.ts +++ b/sdk/storage/storage-queue/src/utils/constants.ts @@ -1,7 +1,7 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -export const SDK_VERSION: string = "10.1.0"; +export const SDK_VERSION: string = "11.0.0-preview.1"; export const SERVICE_VERSION: string = "2018-03-28"; export const URLConstants = { diff --git a/sdk/storage/storage-queue/src/utils/utils.common.ts b/sdk/storage/storage-queue/src/utils/utils.common.ts index 40a874368022..c67fd8bbc7c3 100644 --- a/sdk/storage/storage-queue/src/utils/utils.common.ts +++ b/sdk/storage/storage-queue/src/utils/utils.common.ts @@ -16,11 +16,7 @@ export function appendToURLPath(url: string, name: string): string { const urlParsed = URLBuilder.parse(url); let path = urlParsed.getPath(); - path = path - ? path.endsWith("/") - ? `${path}${name}` - : `${path}/${name}` - : name; + path = path ? (path.endsWith("/") ? `${path}${name}` : `${path}/${name}`) : name; urlParsed.setPath(path); return urlParsed.toString(); @@ -36,11 +32,7 @@ export function appendToURLPath(url: string, name: string): string { * @param {string} [value] Parameter value * @returns {string} An updated URL string */ -export function setURLParameter( - url: string, - name: string, - value?: string -): string { +export function setURLParameter(url: string, name: string, value?: string): string { const urlParsed = URLBuilder.parse(url); urlParsed.setQueryParameter(name, value); return urlParsed.toString(); @@ -54,10 +46,7 @@ export function setURLParameter( * @param {string} name * @returns {(string | string[] | undefined)} */ -export function getURLParameter( - url: string, - name: string -): string | string[] | undefined { +export function getURLParameter(url: string, name: string): string | string[] | undefined { const urlParsed = URLBuilder.parse(url); return urlParsed.getQueryParameterValue(name); } @@ -102,18 +91,14 @@ export function getURLQueries(url: string): { [key: string]: string } { } queryString = queryString.trim(); - queryString = queryString.startsWith("?") - ? queryString.substr(1) - : queryString; + queryString = queryString.startsWith("?") ? queryString.substr(1) : queryString; let querySubStrings: string[] = queryString.split("&"); querySubStrings = querySubStrings.filter((value: string) => { const indexOfEqual = value.indexOf("="); const lastIndexOfEqual = value.lastIndexOf("="); return ( - indexOfEqual > 0 && - indexOfEqual === lastIndexOfEqual && - lastIndexOfEqual < value.length - 1 + indexOfEqual > 0 && indexOfEqual === lastIndexOfEqual && lastIndexOfEqual < value.length - 1 ); }); @@ -137,10 +122,7 @@ export function getURLQueries(url: string): { [key: string]: string } { * If false, YYYY-MM-DDThh:mm:ssZ will be returned. * @returns {string} Date string in ISO8061 format, with or without 7 milliseconds component */ -export function truncatedISO8061Date( - date: Date, - withMilliseconds: boolean = true -): string { +export function truncatedISO8061Date(date: Date, withMilliseconds: boolean = true): string { // Date.toISOString() will return like "2018-10-29T06:34:36.139Z" const dateString = date.toISOString(); diff --git a/sdk/storage/storage-queue/test/aborter.test.ts b/sdk/storage/storage-queue/test/aborter.spec.ts similarity index 65% rename from sdk/storage/storage-queue/test/aborter.test.ts rename to sdk/storage/storage-queue/test/aborter.spec.ts index d7871465103f..44aabf3f5efa 100644 --- a/sdk/storage/storage-queue/test/aborter.test.ts +++ b/sdk/storage/storage-queue/test/aborter.spec.ts @@ -1,20 +1,20 @@ import * as assert from "assert"; import { Aborter } from "../src/Aborter"; -import { QueueURL } from "../src/QueueURL"; +import { QueueClient } from "../src/QueueClient"; import { getQSU, getUniqueName } from "./utils"; import * as dotenv from "dotenv"; -dotenv.config({path:"../.env"}); +dotenv.config({ path: "../.env" }); // tslint:disable:no-empty describe("Aborter", () => { - const serviceURL = getQSU(); + const queueServiceClient = getQSU(); let queueName: string = getUniqueName("queue"); - let queueURL = QueueURL.fromServiceURL(serviceURL, queueName); + let queueClient = QueueClient.fromQueueServiceClient(queueServiceClient, queueName); beforeEach(async () => { queueName = getUniqueName("queue"); - queueURL = QueueURL.fromServiceURL(serviceURL, queueName); + queueClient = QueueClient.fromQueueServiceClient(queueServiceClient, queueName); }); it("should set value and get value successfully", async () => { @@ -23,14 +23,14 @@ describe("Aborter", () => { }); it("should not abort after calling abort()", async () => { - const cResp = await queueURL.create(Aborter.none); + const cResp = await queueClient.create(); assert.ok(cResp.date); - await queueURL.delete(Aborter.none); + await queueClient.delete(); }); it("should abort when calling abort() before request finishes", async () => { const aborter = Aborter.none; - const response = queueURL.create(aborter); + const response = queueClient.create({ abortSignal: aborter }); aborter.abort(); try { await response; @@ -40,14 +40,14 @@ describe("Aborter", () => { it("should not abort when calling abort() after request finishes", async () => { const aborter = Aborter.none; - await queueURL.create(aborter); + await queueClient.create({ abortSignal: aborter }); aborter.abort(); - await queueURL.delete(Aborter.none); + await queueClient.delete(); }); it("should abort after aborter timeout", async () => { try { - await queueURL.create(Aborter.timeout(1)); + await queueClient.create({ abortSignal: Aborter.timeout(1) }); assert.fail(); } catch (err) {} }); @@ -55,7 +55,7 @@ describe("Aborter", () => { it("should abort after parent aborter calls abort()", async () => { try { const aborter = Aborter.none; - const response = queueURL.create(aborter.withTimeout(10 * 60 * 1000)); + const response = queueClient.create({ abortSignal: aborter.withTimeout(10 * 60 * 1000) }); aborter.abort(); await response; assert.fail(); @@ -65,7 +65,7 @@ describe("Aborter", () => { it("should abort after parent aborter timeout", async () => { try { const aborter = Aborter.timeout(1); - const response = queueURL.create(aborter.withTimeout(10 * 60 * 1000)); + const response = queueClient.create({ abortSignal: aborter.withTimeout(10 * 60 * 1000) }); await response; assert.fail(); } catch (err) {} diff --git a/sdk/storage/storage-queue/test/messageidclient.spec.ts b/sdk/storage/storage-queue/test/messageidclient.spec.ts new file mode 100644 index 000000000000..234d74e3d794 --- /dev/null +++ b/sdk/storage/storage-queue/test/messageidclient.spec.ts @@ -0,0 +1,161 @@ +import * as assert from "assert"; + +import { QueueClient } from "../src/QueueClient"; +import { MessagesClient } from "../src/MessagesClient"; +import { MessageIdClient } from "../src/MessageIdClient"; +import { getQSU, getUniqueName, sleep } from "./utils"; +import * as dotenv from "dotenv"; +dotenv.config({ path: "../.env" }); + +describe("MessageIdClient", () => { + const queueServiceClient = getQSU(); + let queueName = getUniqueName("queue"); + let queueClient = QueueClient.fromQueueServiceClient(queueServiceClient, queueName); + const messageContent = "Hello World"; + + beforeEach(async () => { + queueName = getUniqueName("queue"); + queueClient = QueueClient.fromQueueServiceClient(queueServiceClient, queueName); + await queueClient.create(); + }); + + afterEach(async () => { + await queueClient.delete(); + }); + + it("update and delete empty message with default parameters", async () => { + let messagesClient = MessagesClient.fromQueueClient(queueClient); + let eResult = await messagesClient.enqueue(messageContent); + assert.ok(eResult.date); + assert.ok(eResult.expirationTime); + assert.ok(eResult.insertionTime); + assert.ok(eResult.messageId); + assert.ok(eResult.popReceipt); + assert.ok(eResult.requestId); + assert.ok(eResult.timeNextVisible); + assert.ok(eResult.version); + + let newMessage = ""; + let messageIdClient = MessageIdClient.fromMessagesClient(messagesClient, eResult.messageId); + let uResult = await messageIdClient.update(eResult.popReceipt, 0, newMessage); + assert.ok(uResult.version); + assert.ok(uResult.timeNextVisible); + assert.ok(uResult.date); + assert.ok(uResult.requestId); + assert.ok(uResult.popReceipt); + + let pResult = await messagesClient.peek(); + assert.equal(pResult.peekedMessageItems.length, 1); + assert.deepStrictEqual(pResult.peekedMessageItems[0].messageText, newMessage); + + let dResult = await messageIdClient.delete(uResult.popReceipt!); + assert.ok(dResult.date); + assert.ok(dResult.requestId); + assert.ok(dResult.version); + + pResult = await messagesClient.peek(); + assert.equal(pResult.peekedMessageItems.length, 0); + }); + + it("update and delete message with all parameters", async () => { + let messagesClient = MessagesClient.fromQueueClient(queueClient); + let eResult = await messagesClient.enqueue(messageContent); + assert.ok(eResult.date); + assert.ok(eResult.expirationTime); + assert.ok(eResult.insertionTime); + assert.ok(eResult.messageId); + assert.ok(eResult.popReceipt); + assert.ok(eResult.requestId); + assert.ok(eResult.timeNextVisible); + assert.ok(eResult.version); + + let newMessage = "New Message"; + let messageIdClient = MessageIdClient.fromMessagesClient(messagesClient, eResult.messageId); + let uResult = await messageIdClient.update(eResult.popReceipt, 10, newMessage); + assert.ok(uResult.version); + assert.ok(uResult.timeNextVisible); + assert.ok(uResult.date); + assert.ok(uResult.requestId); + assert.ok(uResult.popReceipt); + + let pResult = await messagesClient.peek(); + assert.equal(pResult.peekedMessageItems.length, 0); + + await sleep(11 * 1000); // Sleep 11 seconds, and wait the message to be visible again + + let pResult2 = await messagesClient.peek(); + assert.equal(pResult2.peekedMessageItems.length, 1); + assert.deepStrictEqual(pResult2.peekedMessageItems[0].messageText, newMessage); + }); + + it("update message with 64KB characters size which is computed after encoding", async () => { + let messagesClient = MessagesClient.fromQueueClient(queueClient); + let eResult = await messagesClient.enqueue(messageContent); + assert.ok(eResult.date); + assert.ok(eResult.expirationTime); + assert.ok(eResult.insertionTime); + assert.ok(eResult.messageId); + assert.ok(eResult.popReceipt); + assert.ok(eResult.requestId); + assert.ok(eResult.timeNextVisible); + assert.ok(eResult.version); + + let newMessage = new Array(64 * 1024 + 1).join("a"); + let messageIdClient = MessageIdClient.fromMessagesClient(messagesClient, eResult.messageId); + let uResult = await messageIdClient.update(eResult.popReceipt, 0, newMessage); + assert.ok(uResult.version); + assert.ok(uResult.timeNextVisible); + assert.ok(uResult.date); + assert.ok(uResult.requestId); + assert.ok(uResult.popReceipt); + + let pResult = await messagesClient.peek(); + assert.equal(pResult.peekedMessageItems.length, 1); + assert.deepStrictEqual(pResult.peekedMessageItems[0].messageText, newMessage); + }); + + it("update message negative with 65537B (64KB+1B) characters size which is computed after encoding", async () => { + let messagesClient = MessagesClient.fromQueueClient(queueClient); + let eResult = await messagesClient.enqueue(messageContent); + assert.ok(eResult.date); + assert.ok(eResult.expirationTime); + assert.ok(eResult.insertionTime); + assert.ok(eResult.messageId); + assert.ok(eResult.popReceipt); + assert.ok(eResult.requestId); + assert.ok(eResult.timeNextVisible); + assert.ok(eResult.version); + + let newMessage = new Array(64 * 1024 + 2).join("a"); + + let messageIdClient = MessageIdClient.fromMessagesClient(messagesClient, eResult.messageId); + + let error; + try { + await messageIdClient.update(eResult.popReceipt, 0, newMessage); + } catch (err) { + error = err; + } + assert.ok(error); + assert.ok( + error.message.includes( + "The request body is too large and exceeds the maximum permissible limit." + ) + ); + }); + + it("delete message negative", async () => { + let messagesClient = MessagesClient.fromQueueClient(queueClient); + let eResult = await messagesClient.enqueue(messageContent); + + let messageIdClient = MessageIdClient.fromMessagesClient(messagesClient, eResult.messageId); + + let error; + try { + await messageIdClient.delete("invalid"); + } catch (err) { + error = err; + } + assert.ok(error); + }); +}); diff --git a/sdk/storage/storage-queue/test/messageidurl.test.ts b/sdk/storage/storage-queue/test/messageidurl.test.ts deleted file mode 100644 index 8c4d4091f605..000000000000 --- a/sdk/storage/storage-queue/test/messageidurl.test.ts +++ /dev/null @@ -1,203 +0,0 @@ -import * as assert from "assert"; - -import { Aborter } from "../src/Aborter"; -import { QueueURL } from "../src/QueueURL"; -import { MessagesURL } from "../src/MessagesURL"; -import { MessageIdURL } from "../src/MessageIdURL"; -import { getQSU, getUniqueName, sleep } from "./utils"; -import * as dotenv from "dotenv"; -dotenv.config({path:"../.env"}); - -describe("MessageIdURL", () => { - const serviceURL = getQSU(); - let queueName = getUniqueName("queue"); - let queueURL = QueueURL.fromServiceURL(serviceURL, queueName); - const messageContent = "Hello World"; - - beforeEach(async () => { - queueName = getUniqueName("queue"); - queueURL = QueueURL.fromServiceURL(serviceURL, queueName); - await queueURL.create(Aborter.none); - }); - - afterEach(async () => { - await queueURL.delete(Aborter.none); - }); - - it("update and delete empty message with default parameters", async () => { - let messagesURL = MessagesURL.fromQueueURL(queueURL); - let eResult = await messagesURL.enqueue(Aborter.none, messageContent); - assert.ok(eResult.date); - assert.ok(eResult.expirationTime); - assert.ok(eResult.insertionTime); - assert.ok(eResult.messageId); - assert.ok(eResult.popReceipt); - assert.ok(eResult.requestId); - assert.ok(eResult.timeNextVisible); - assert.ok(eResult.version); - - let newMessage = ""; - let messageIdURL = MessageIdURL.fromMessagesURL( - messagesURL, - eResult.messageId - ); - let uResult = await messageIdURL.update( - Aborter.none, - eResult.popReceipt, - 0, - newMessage - ); - assert.ok(uResult.version); - assert.ok(uResult.timeNextVisible); - assert.ok(uResult.date); - assert.ok(uResult.requestId); - assert.ok(uResult.popReceipt); - - let pResult = await messagesURL.peek(Aborter.none); - assert.equal(pResult.peekedMessageItems.length, 1); - assert.deepStrictEqual( - pResult.peekedMessageItems[0].messageText, - newMessage - ); - - let dResult = await messageIdURL.delete(Aborter.none, uResult.popReceipt!); - assert.ok(dResult.date); - assert.ok(dResult.requestId); - assert.ok(dResult.version); - - pResult = await messagesURL.peek(Aborter.none); - assert.equal(pResult.peekedMessageItems.length, 0); - }); - - it("update and delete message with all parameters", async () => { - let messagesURL = MessagesURL.fromQueueURL(queueURL); - let eResult = await messagesURL.enqueue(Aborter.none, messageContent); - assert.ok(eResult.date); - assert.ok(eResult.expirationTime); - assert.ok(eResult.insertionTime); - assert.ok(eResult.messageId); - assert.ok(eResult.popReceipt); - assert.ok(eResult.requestId); - assert.ok(eResult.timeNextVisible); - assert.ok(eResult.version); - - let newMessage = "New Message"; - let messageIdURL = MessageIdURL.fromMessagesURL( - messagesURL, - eResult.messageId - ); - let uResult = await messageIdURL.update( - Aborter.none, - eResult.popReceipt, - 10, - newMessage - ); - assert.ok(uResult.version); - assert.ok(uResult.timeNextVisible); - assert.ok(uResult.date); - assert.ok(uResult.requestId); - assert.ok(uResult.popReceipt); - - let pResult = await messagesURL.peek(Aborter.none); - assert.equal(pResult.peekedMessageItems.length, 0); - - await sleep(11 * 1000); // Sleep 11 seconds, and wait the message to be visible again - - let pResult2 = await messagesURL.peek(Aborter.none); - assert.equal(pResult2.peekedMessageItems.length, 1); - assert.deepStrictEqual( - pResult2.peekedMessageItems[0].messageText, - newMessage - ); - }); - - it("update message with 64KB characters size which is computed after encoding", async () => { - let messagesURL = MessagesURL.fromQueueURL(queueURL); - let eResult = await messagesURL.enqueue(Aborter.none, messageContent); - assert.ok(eResult.date); - assert.ok(eResult.expirationTime); - assert.ok(eResult.insertionTime); - assert.ok(eResult.messageId); - assert.ok(eResult.popReceipt); - assert.ok(eResult.requestId); - assert.ok(eResult.timeNextVisible); - assert.ok(eResult.version); - - let newMessage = new Array(64*1024 + 1).join('a'); - let messageIdURL = MessageIdURL.fromMessagesURL( - messagesURL, - eResult.messageId - ); - let uResult = await messageIdURL.update( - Aborter.none, - eResult.popReceipt, - 0, - newMessage - ); - assert.ok(uResult.version); - assert.ok(uResult.timeNextVisible); - assert.ok(uResult.date); - assert.ok(uResult.requestId); - assert.ok(uResult.popReceipt); - - let pResult = await messagesURL.peek(Aborter.none); - assert.equal(pResult.peekedMessageItems.length, 1); - assert.deepStrictEqual( - pResult.peekedMessageItems[0].messageText, - newMessage - ); - }); - - it("update message negative with 65537B (64KB+1B) characters size which is computed after encoding", async () => { - let messagesURL = MessagesURL.fromQueueURL(queueURL); - let eResult = await messagesURL.enqueue(Aborter.none, messageContent); - assert.ok(eResult.date); - assert.ok(eResult.expirationTime); - assert.ok(eResult.insertionTime); - assert.ok(eResult.messageId); - assert.ok(eResult.popReceipt); - assert.ok(eResult.requestId); - assert.ok(eResult.timeNextVisible); - assert.ok(eResult.version); - - let newMessage = new Array(64*1024 + 2).join('a'); - - let messageIdURL = MessageIdURL.fromMessagesURL( - messagesURL, - eResult.messageId - ); - - let error; - try{ - await messageIdURL.update( - Aborter.none, - eResult.popReceipt, - 0, - newMessage - ); - } catch(err) { - error = err - } - assert.ok(error); - assert.ok(error.message.includes("The request body is too large and exceeds the maximum permissible limit.")) - }); - - - it("delete message negative", async () => { - let messagesURL = MessagesURL.fromQueueURL(queueURL); - let eResult = await messagesURL.enqueue(Aborter.none, messageContent); - - let messageIdURL = MessageIdURL.fromMessagesURL( - messagesURL, - eResult.messageId - ); - - let error - try{ - await messageIdURL.delete(Aborter.none, "invalid"); - } catch(err) { - error = err - } - assert.ok(error); - }); -}); diff --git a/sdk/storage/storage-queue/test/messagesclient.spec.ts b/sdk/storage/storage-queue/test/messagesclient.spec.ts new file mode 100644 index 000000000000..37e3e0b41a08 --- /dev/null +++ b/sdk/storage/storage-queue/test/messagesclient.spec.ts @@ -0,0 +1,341 @@ +import * as assert from "assert"; + +import { QueueClient } from "../src/QueueClient"; +import { MessagesClient } from "../src/MessagesClient"; +import { getQSU, getUniqueName } from "./utils"; +import * as dotenv from "dotenv"; +dotenv.config({ path: "../.env" }); + +describe("MessagesClient", () => { + const queueServiceClient = getQSU(); + let queueName = getUniqueName("queue"); + let queueClient = QueueClient.fromQueueServiceClient(queueServiceClient, queueName); + const messageContent = "Hello World"; + + beforeEach(async () => { + queueName = getUniqueName("queue"); + queueClient = QueueClient.fromQueueServiceClient(queueServiceClient, queueName); + await queueClient.create(); + }); + + afterEach(async () => { + await queueClient.delete(); + }); + + it("enqueue, peek, dequeue and clear message with default parameters", async () => { + let messagesClient = MessagesClient.fromQueueClient(queueClient); + let eResult = await messagesClient.enqueue(messageContent); + assert.ok(eResult.date); + assert.ok(eResult.expirationTime); + assert.ok(eResult.insertionTime); + assert.ok(eResult.messageId); + assert.ok(eResult.popReceipt); + assert.ok(eResult.requestId); + assert.ok(eResult.timeNextVisible); + assert.ok(eResult.version); + + await messagesClient.enqueue(messageContent); + + let pResult = await messagesClient.peek(); + assert.ok(pResult.date); + assert.ok(pResult.requestId); + assert.ok(pResult.version); + assert.deepStrictEqual(pResult.peekedMessageItems.length, 1); + assert.deepStrictEqual(pResult.peekedMessageItems[0].messageText, messageContent); + assert.deepStrictEqual(pResult.peekedMessageItems[0].messageId, eResult.messageId); + + let dqResult = await messagesClient.dequeue(); + assert.ok(dqResult.date); + assert.ok(dqResult.requestId); + assert.ok(dqResult.version); + assert.deepStrictEqual(dqResult.dequeuedMessageItems.length, 1); + assert.ok(dqResult.dequeuedMessageItems[0].popReceipt); + assert.deepStrictEqual(dqResult.dequeuedMessageItems[0].messageText, messageContent); + assert.deepStrictEqual(dqResult.dequeuedMessageItems[0].messageId, eResult.messageId); + + let cResult = await messagesClient.clear(); + assert.ok(cResult.date); + assert.ok(cResult.requestId); + assert.ok(cResult.version); + + // check all messages are cleared + let pResult2 = await messagesClient.peek(); + assert.ok(pResult2.date); + assert.deepStrictEqual(pResult2.peekedMessageItems.length, 0); + }); + + it("enqueue, peek, dequeue and clear message with all parameters", async () => { + let messagesClient = MessagesClient.fromQueueClient(queueClient); + + let eResult = await messagesClient.enqueue(messageContent, { + messageTimeToLive: 40, + visibilitytimeout: 0 + }); + assert.ok(eResult.date); + assert.ok(eResult.expirationTime); + assert.ok(eResult.insertionTime); + assert.ok(eResult.messageId); + assert.ok(eResult.popReceipt); + assert.ok(eResult.requestId); + assert.ok(eResult.timeNextVisible); + assert.ok(eResult.version); + + let eResult2 = await messagesClient.enqueue(messageContent, { + messageTimeToLive: 40, + visibilitytimeout: 0 + }); + await messagesClient.enqueue(messageContent, { + messageTimeToLive: 10, + visibilitytimeout: 5 + }); + await messagesClient.enqueue(messageContent, { + messageTimeToLive: 20, + visibilitytimeout: 19 + }); + + let pResult = await messagesClient.peek({ numberOfMessages: 2 }); + assert.ok(pResult.date); + assert.ok(pResult.requestId); + assert.ok(pResult.version); + assert.deepStrictEqual(pResult.peekedMessageItems.length, 2); + assert.deepStrictEqual(pResult.peekedMessageItems[0].messageText, messageContent); + assert.deepStrictEqual(pResult.peekedMessageItems[0].dequeueCount, 0); + assert.deepStrictEqual(pResult.peekedMessageItems[0].messageId, eResult.messageId); + assert.deepStrictEqual(pResult.peekedMessageItems[0].insertionTime, eResult.insertionTime); + assert.deepStrictEqual(pResult.peekedMessageItems[0].expirationTime, eResult.expirationTime); + + assert.deepStrictEqual(pResult.peekedMessageItems[1].messageText, messageContent); + assert.deepStrictEqual(pResult.peekedMessageItems[1].dequeueCount, 0); + assert.deepStrictEqual(pResult.peekedMessageItems[1].messageId, eResult2.messageId); + assert.deepStrictEqual(pResult.peekedMessageItems[1].insertionTime, eResult2.insertionTime); + assert.deepStrictEqual(pResult.peekedMessageItems[1].expirationTime, eResult2.expirationTime); + + let dResult = await messagesClient.dequeue({ + visibilitytimeout: 10, + numberOfMessages: 2 + }); + assert.ok(dResult.date); + assert.ok(dResult.requestId); + assert.ok(dResult.version); + assert.deepStrictEqual(dResult.dequeuedMessageItems.length, 2); + assert.deepStrictEqual(dResult.dequeuedMessageItems[0].messageText, messageContent); + assert.deepStrictEqual(dResult.dequeuedMessageItems[0].dequeueCount, 1); + assert.deepStrictEqual(dResult.dequeuedMessageItems[0].messageId, eResult.messageId); + assert.deepStrictEqual(dResult.dequeuedMessageItems[0].insertionTime, eResult.insertionTime); + assert.deepStrictEqual(dResult.dequeuedMessageItems[0].expirationTime, eResult.expirationTime); + assert.ok(dResult.dequeuedMessageItems[0].popReceipt); + assert.ok(dResult.dequeuedMessageItems[0].timeNextVisible); + + assert.deepStrictEqual(pResult.peekedMessageItems[1].messageText, messageContent); + + // check no message is visible + let pResult2 = await messagesClient.peek(); + assert.ok(pResult2.date); + assert.deepStrictEqual(pResult2.peekedMessageItems.length, 0); + }); + + it("enqueue, peek, dequeue empty message, and peek, dequeue with numberOfMessages > count(messages)", async () => { + let messagesClient = MessagesClient.fromQueueClient(queueClient); + + let eResult = await messagesClient.enqueue("", { + messageTimeToLive: 40, + visibilitytimeout: 0 + }); + assert.ok(eResult.date); + assert.ok(eResult.expirationTime); + assert.ok(eResult.insertionTime); + assert.ok(eResult.messageId); + assert.ok(eResult.popReceipt); + assert.ok(eResult.requestId); + assert.ok(eResult.timeNextVisible); + assert.ok(eResult.version); + + let pResult = await messagesClient.peek({ numberOfMessages: 2 }); + assert.ok(pResult.date); + assert.ok(pResult.requestId); + assert.ok(pResult.version); + assert.deepStrictEqual(pResult.peekedMessageItems.length, 1); + assert.deepStrictEqual(pResult.peekedMessageItems[0].messageText, ""); + assert.deepStrictEqual(pResult.peekedMessageItems[0].dequeueCount, 0); + assert.deepStrictEqual(pResult.peekedMessageItems[0].messageId, eResult.messageId); + assert.deepStrictEqual(pResult.peekedMessageItems[0].insertionTime, eResult.insertionTime); + assert.deepStrictEqual(pResult.peekedMessageItems[0].expirationTime, eResult.expirationTime); + + let dResult = await messagesClient.dequeue({ + visibilitytimeout: 10, + numberOfMessages: 2 + }); + assert.ok(dResult.date); + assert.ok(dResult.requestId); + assert.ok(dResult.version); + assert.deepStrictEqual(dResult.dequeuedMessageItems.length, 1); + assert.deepStrictEqual(dResult.dequeuedMessageItems[0].messageText, ""); + assert.deepStrictEqual(dResult.dequeuedMessageItems[0].dequeueCount, 1); + assert.deepStrictEqual(dResult.dequeuedMessageItems[0].messageId, eResult.messageId); + assert.deepStrictEqual(dResult.dequeuedMessageItems[0].insertionTime, eResult.insertionTime); + assert.deepStrictEqual(dResult.dequeuedMessageItems[0].expirationTime, eResult.expirationTime); + assert.ok(dResult.dequeuedMessageItems[0].popReceipt); + assert.ok(dResult.dequeuedMessageItems[0].timeNextVisible); + }); + + it("enqueue, peek, dequeue special characters", async () => { + let messagesClient = MessagesClient.fromQueueClient(queueClient); + + let specialMessage = + "!@#$%^&*()_+`-=[]|};'\":,./?><`~漢字㒈保ᨍ揫^p[뷁)׷񬓔7񈺝l鮍򧽶ͺ簣ڞ츊䈗㝯綞߫⯹?ÎᦡC왶żsmt㖩닡򈸱𕩣ОլFZ򃀮9tC榅ٻ컦驿Ϳ[𱿛봻烌󱰷򙥱Ռ򽒏򘤰δŊϜ췮㐦9ͽƙp퐂ʩ由巩•KFÓ֮򨾭⨿󊻅aBm󶴂旨Ϣ񓙠򻐪񇧱򆋸ջ֨ipn򒷐ꝷՆ򆊙斡賆𒚑m˞𻆕󛿓򐞺Ӯ򡗺򴜍<񐸩԰Bu)򁉂񖨞á<џɏ嗂�⨣1PJ㬵┡ḸI򰱂ˮaࢸ۳i灛ȯɨb𹺪򕕱뿶uٔ䎴񷯆Φ륽󬃨س_NƵ¦\u00E9"; + + let eResult = await messagesClient.enqueue(specialMessage, { + messageTimeToLive: 40, + visibilitytimeout: 0 + }); + assert.ok(eResult.date); + assert.ok(eResult.expirationTime); + assert.ok(eResult.insertionTime); + assert.ok(eResult.messageId); + assert.ok(eResult.popReceipt); + assert.ok(eResult.requestId); + assert.ok(eResult.timeNextVisible); + assert.ok(eResult.version); + + let pResult = await messagesClient.peek({ numberOfMessages: 2 }); + assert.ok(pResult.date); + assert.ok(pResult.requestId); + assert.ok(pResult.version); + assert.deepStrictEqual(pResult.peekedMessageItems.length, 1); + assert.deepStrictEqual(pResult.peekedMessageItems[0].messageText, specialMessage); + assert.deepStrictEqual(pResult.peekedMessageItems[0].dequeueCount, 0); + assert.deepStrictEqual(pResult.peekedMessageItems[0].messageId, eResult.messageId); + assert.deepStrictEqual(pResult.peekedMessageItems[0].insertionTime, eResult.insertionTime); + assert.deepStrictEqual(pResult.peekedMessageItems[0].expirationTime, eResult.expirationTime); + + let dResult = await messagesClient.dequeue({ + visibilitytimeout: 10, + numberOfMessages: 2 + }); + assert.ok(dResult.date); + assert.ok(dResult.requestId); + assert.ok(dResult.version); + assert.deepStrictEqual(dResult.dequeuedMessageItems.length, 1); + assert.deepStrictEqual(dResult.dequeuedMessageItems[0].messageText, specialMessage); + assert.deepStrictEqual(dResult.dequeuedMessageItems[0].dequeueCount, 1); + assert.deepStrictEqual(dResult.dequeuedMessageItems[0].messageId, eResult.messageId); + assert.deepStrictEqual(dResult.dequeuedMessageItems[0].insertionTime, eResult.insertionTime); + assert.deepStrictEqual(dResult.dequeuedMessageItems[0].expirationTime, eResult.expirationTime); + assert.ok(dResult.dequeuedMessageItems[0].popReceipt); + assert.ok(dResult.dequeuedMessageItems[0].timeNextVisible); + }); + + it("enqueue, peek, dequeue with 64KB characters size which is computed after encoding", async () => { + let messagesClient = MessagesClient.fromQueueClient(queueClient); + let messageContent = new Array(64 * 1024 + 1).join("a"); + + let eResult = await messagesClient.enqueue(messageContent, { + messageTimeToLive: 40, + visibilitytimeout: 0 + }); + assert.ok(eResult.date); + assert.ok(eResult.expirationTime); + assert.ok(eResult.insertionTime); + assert.ok(eResult.messageId); + assert.ok(eResult.popReceipt); + assert.ok(eResult.requestId); + assert.ok(eResult.timeNextVisible); + assert.ok(eResult.version); + + let pResult = await messagesClient.peek({ numberOfMessages: 2 }); + assert.ok(pResult.date); + assert.ok(pResult.requestId); + assert.ok(pResult.version); + assert.deepStrictEqual(pResult.peekedMessageItems.length, 1); + assert.deepStrictEqual(pResult.peekedMessageItems[0].messageText, messageContent); + assert.deepStrictEqual(pResult.peekedMessageItems[0].dequeueCount, 0); + assert.deepStrictEqual(pResult.peekedMessageItems[0].messageId, eResult.messageId); + assert.deepStrictEqual(pResult.peekedMessageItems[0].insertionTime, eResult.insertionTime); + assert.deepStrictEqual(pResult.peekedMessageItems[0].expirationTime, eResult.expirationTime); + + let dResult = await messagesClient.dequeue({ + visibilitytimeout: 10, + numberOfMessages: 2 + }); + assert.ok(dResult.date); + assert.ok(dResult.requestId); + assert.ok(dResult.version); + assert.deepStrictEqual(dResult.dequeuedMessageItems.length, 1); + assert.deepStrictEqual(dResult.dequeuedMessageItems[0].messageText, messageContent); + assert.deepStrictEqual(dResult.dequeuedMessageItems[0].dequeueCount, 1); + assert.deepStrictEqual(dResult.dequeuedMessageItems[0].messageId, eResult.messageId); + assert.deepStrictEqual(dResult.dequeuedMessageItems[0].insertionTime, eResult.insertionTime); + assert.deepStrictEqual(dResult.dequeuedMessageItems[0].expirationTime, eResult.expirationTime); + assert.ok(dResult.dequeuedMessageItems[0].popReceipt); + assert.ok(dResult.dequeuedMessageItems[0].timeNextVisible); + }); + + it("enqueue, peek and dequeue negative", async () => { + let messagesClient = MessagesClient.fromQueueClient(queueClient); + let eResult = await messagesClient.enqueue(messageContent, { + messageTimeToLive: 40 + }); + assert.ok(eResult.date); + assert.ok(eResult.expirationTime); + assert.ok(eResult.insertionTime); + assert.ok(eResult.messageId); + assert.ok(eResult.popReceipt); + assert.ok(eResult.requestId); + assert.ok(eResult.timeNextVisible); + assert.ok(eResult.version); + + let error; + try { + await messagesClient.enqueue(messageContent, { + messageTimeToLive: 30, + visibilitytimeout: 30 + }); + } catch (err) { + error = err; + } + assert.ok(error); + + let errorPeek; + try { + await messagesClient.peek({ numberOfMessages: 100 }); + } catch (err) { + errorPeek = err; + } + assert.ok(errorPeek); + + let pResult = await messagesClient.peek({ numberOfMessages: 2 }); + assert.ok(pResult.date); + assert.ok(pResult.requestId); + assert.ok(pResult.version); + assert.deepStrictEqual(pResult.peekedMessageItems.length, 1); + assert.deepStrictEqual(pResult.peekedMessageItems[0].messageText, messageContent); + assert.deepStrictEqual(pResult.peekedMessageItems[0].dequeueCount, 0); + assert.deepStrictEqual(pResult.peekedMessageItems[0].messageId, eResult.messageId); + assert.deepStrictEqual(pResult.peekedMessageItems[0].insertionTime, eResult.insertionTime); + assert.deepStrictEqual(pResult.peekedMessageItems[0].expirationTime, eResult.expirationTime); + + // Note visibility time could be larger then message time to live for dequeue. + await messagesClient.dequeue({ + visibilitytimeout: 40, + numberOfMessages: 2 + }); + }); + + it("enqueue negative with 65537B(64KB+1B) characters size which is computed after encoding", async () => { + let messagesClient = MessagesClient.fromQueueClient(queueClient); + let messageContent = new Array(64 * 1024 + 2).join("a"); + + let error; + try { + await messagesClient.enqueue(messageContent, {}); + } catch (err) { + error = err; + } + assert.ok(error); + assert.ok( + error.message.includes( + "The request body is too large and exceeds the maximum permissible limit." + ) + ); + }); +}); diff --git a/sdk/storage/storage-queue/test/messagesurl.test.ts b/sdk/storage/storage-queue/test/messagesurl.test.ts deleted file mode 100644 index 6198139cca9f..000000000000 --- a/sdk/storage/storage-queue/test/messagesurl.test.ts +++ /dev/null @@ -1,472 +0,0 @@ -import * as assert from "assert"; - -import { Aborter } from "../src/Aborter"; -import { QueueURL } from "../src/QueueURL"; -import { MessagesURL } from "../src/MessagesURL"; -import { getQSU, getUniqueName } from "./utils"; -import * as dotenv from "dotenv"; -dotenv.config({path:"../.env"}); - -describe("MessagesURL", () => { - const serviceURL = getQSU(); - let queueName = getUniqueName("queue"); - let queueURL = QueueURL.fromServiceURL(serviceURL, queueName); - const messageContent = "Hello World"; - - beforeEach(async () => { - queueName = getUniqueName("queue"); - queueURL = QueueURL.fromServiceURL(serviceURL, queueName); - await queueURL.create(Aborter.none); - }); - - afterEach(async () => { - await queueURL.delete(Aborter.none); - }); - - it("enqueue, peek, dequeue and clear message with default parameters", async () => { - let messagesURL = MessagesURL.fromQueueURL(queueURL); - let eResult = await messagesURL.enqueue(Aborter.none, messageContent); - assert.ok(eResult.date); - assert.ok(eResult.expirationTime); - assert.ok(eResult.insertionTime); - assert.ok(eResult.messageId); - assert.ok(eResult.popReceipt); - assert.ok(eResult.requestId); - assert.ok(eResult.timeNextVisible); - assert.ok(eResult.version); - - await messagesURL.enqueue(Aborter.none, messageContent); - - let pResult = await messagesURL.peek(Aborter.none); - assert.ok(pResult.date); - assert.ok(pResult.requestId); - assert.ok(pResult.version); - assert.deepStrictEqual(pResult.peekedMessageItems.length, 1); - assert.deepStrictEqual( - pResult.peekedMessageItems[0].messageText, - messageContent - ); - assert.deepStrictEqual( - pResult.peekedMessageItems[0].messageId, - eResult.messageId - ); - - let dqResult = await messagesURL.dequeue(Aborter.none); - assert.ok(dqResult.date); - assert.ok(dqResult.requestId); - assert.ok(dqResult.version); - assert.deepStrictEqual(dqResult.dequeuedMessageItems.length, 1); - assert.ok(dqResult.dequeuedMessageItems[0].popReceipt); - assert.deepStrictEqual( - dqResult.dequeuedMessageItems[0].messageText, - messageContent - ); - assert.deepStrictEqual( - dqResult.dequeuedMessageItems[0].messageId, - eResult.messageId - ); - - let cResult = await messagesURL.clear(Aborter.none); - assert.ok(cResult.date); - assert.ok(cResult.requestId); - assert.ok(cResult.version); - - // check all messages are cleared - let pResult2 = await messagesURL.peek(Aborter.none); - assert.ok(pResult2.date); - assert.deepStrictEqual(pResult2.peekedMessageItems.length, 0); - }); - - it("enqueue, peek, dequeue and clear message with all parameters", async () => { - let messagesURL = MessagesURL.fromQueueURL(queueURL); - - let eResult = await messagesURL.enqueue(Aborter.none, messageContent, { - messageTimeToLive: 40, - visibilitytimeout: 0 - }); - assert.ok(eResult.date); - assert.ok(eResult.expirationTime); - assert.ok(eResult.insertionTime); - assert.ok(eResult.messageId); - assert.ok(eResult.popReceipt); - assert.ok(eResult.requestId); - assert.ok(eResult.timeNextVisible); - assert.ok(eResult.version); - - let eResult2 = await messagesURL.enqueue(Aborter.none, messageContent, { - messageTimeToLive: 40, - visibilitytimeout: 0 - }); - await messagesURL.enqueue(Aborter.none, messageContent, { - messageTimeToLive: 10, - visibilitytimeout: 5 - }); - await messagesURL.enqueue(Aborter.none, messageContent, { - messageTimeToLive: 20, - visibilitytimeout: 19 - }); - - let pResult = await messagesURL.peek(Aborter.none, { numberOfMessages: 2 }); - assert.ok(pResult.date); - assert.ok(pResult.requestId); - assert.ok(pResult.version); - assert.deepStrictEqual(pResult.peekedMessageItems.length, 2); - assert.deepStrictEqual( - pResult.peekedMessageItems[0].messageText, - messageContent - ); - assert.deepStrictEqual(pResult.peekedMessageItems[0].dequeueCount, 0); - assert.deepStrictEqual( - pResult.peekedMessageItems[0].messageId, - eResult.messageId - ); - assert.deepStrictEqual( - pResult.peekedMessageItems[0].insertionTime, - eResult.insertionTime - ); - assert.deepStrictEqual( - pResult.peekedMessageItems[0].expirationTime, - eResult.expirationTime - ); - - assert.deepStrictEqual( - pResult.peekedMessageItems[1].messageText, - messageContent - ); - assert.deepStrictEqual(pResult.peekedMessageItems[1].dequeueCount, 0); - assert.deepStrictEqual( - pResult.peekedMessageItems[1].messageId, - eResult2.messageId - ); - assert.deepStrictEqual( - pResult.peekedMessageItems[1].insertionTime, - eResult2.insertionTime - ); - assert.deepStrictEqual( - pResult.peekedMessageItems[1].expirationTime, - eResult2.expirationTime - ); - - let dResult = await messagesURL.dequeue(Aborter.none, { - visibilitytimeout: 10, - numberOfMessages: 2 - }); - assert.ok(dResult.date); - assert.ok(dResult.requestId); - assert.ok(dResult.version); - assert.deepStrictEqual(dResult.dequeuedMessageItems.length, 2); - assert.deepStrictEqual( - dResult.dequeuedMessageItems[0].messageText, - messageContent - ); - assert.deepStrictEqual(dResult.dequeuedMessageItems[0].dequeueCount, 1); - assert.deepStrictEqual( - dResult.dequeuedMessageItems[0].messageId, - eResult.messageId - ); - assert.deepStrictEqual( - dResult.dequeuedMessageItems[0].insertionTime, - eResult.insertionTime - ); - assert.deepStrictEqual( - dResult.dequeuedMessageItems[0].expirationTime, - eResult.expirationTime - ); - assert.ok(dResult.dequeuedMessageItems[0].popReceipt); - assert.ok(dResult.dequeuedMessageItems[0].timeNextVisible); - - assert.deepStrictEqual( - pResult.peekedMessageItems[1].messageText, - messageContent - ); - - // check no message is visible - let pResult2 = await messagesURL.peek(Aborter.none); - assert.ok(pResult2.date); - assert.deepStrictEqual(pResult2.peekedMessageItems.length, 0); - }); - - it("enqueue, peek, dequeue empty message, and peek, dequeue with numberOfMessages > count(messages)", async () => { - let messagesURL = MessagesURL.fromQueueURL(queueURL); - - let eResult = await messagesURL.enqueue(Aborter.none, "", { - messageTimeToLive: 40, - visibilitytimeout: 0 - }); - assert.ok(eResult.date); - assert.ok(eResult.expirationTime); - assert.ok(eResult.insertionTime); - assert.ok(eResult.messageId); - assert.ok(eResult.popReceipt); - assert.ok(eResult.requestId); - assert.ok(eResult.timeNextVisible); - assert.ok(eResult.version); - - let pResult = await messagesURL.peek(Aborter.none, { numberOfMessages: 2 }); - assert.ok(pResult.date); - assert.ok(pResult.requestId); - assert.ok(pResult.version); - assert.deepStrictEqual(pResult.peekedMessageItems.length, 1); - assert.deepStrictEqual( - pResult.peekedMessageItems[0].messageText, - "" - ); - assert.deepStrictEqual(pResult.peekedMessageItems[0].dequeueCount, 0); - assert.deepStrictEqual( - pResult.peekedMessageItems[0].messageId, - eResult.messageId - ); - assert.deepStrictEqual( - pResult.peekedMessageItems[0].insertionTime, - eResult.insertionTime - ); - assert.deepStrictEqual( - pResult.peekedMessageItems[0].expirationTime, - eResult.expirationTime - ); - - let dResult = await messagesURL.dequeue(Aborter.none, { - visibilitytimeout: 10, - numberOfMessages: 2 - }); - assert.ok(dResult.date); - assert.ok(dResult.requestId); - assert.ok(dResult.version); - assert.deepStrictEqual(dResult.dequeuedMessageItems.length, 1); - assert.deepStrictEqual( - dResult.dequeuedMessageItems[0].messageText, - '' - ); - assert.deepStrictEqual(dResult.dequeuedMessageItems[0].dequeueCount, 1); - assert.deepStrictEqual( - dResult.dequeuedMessageItems[0].messageId, - eResult.messageId - ); - assert.deepStrictEqual( - dResult.dequeuedMessageItems[0].insertionTime, - eResult.insertionTime - ); - assert.deepStrictEqual( - dResult.dequeuedMessageItems[0].expirationTime, - eResult.expirationTime - ); - assert.ok(dResult.dequeuedMessageItems[0].popReceipt); - assert.ok(dResult.dequeuedMessageItems[0].timeNextVisible); - }); - - it("enqueue, peek, dequeue special characters", async () => { - let messagesURL = MessagesURL.fromQueueURL(queueURL); - - let specialMessage = '!@#$%^&*()_+`-=[]\|};\'":,./?><`~漢字㒈保ᨍ揫^p[뷁)׷񬓔7񈺝l鮍򧽶ͺ簣ڞ츊䈗㝯綞߫⯹?ÎᦡC왶żsmt㖩닡򈸱𕩣ОլFZ򃀮9tC榅ٻ컦驿Ϳ[𱿛봻烌󱰷򙥱Ռ򽒏򘤰δŊϜ췮㐦9ͽƙp퐂ʩ由巩•KFÓ֮򨾭⨿󊻅aBm󶴂旨Ϣ񓙠򻐪񇧱򆋸ջ֨ipn򒷐ꝷՆ򆊙斡賆𒚑m˞\𻆕󛿓򐞺Ӯ򡗺򴜍<񐸩԰Bu)򁉂񖨞á<џɏ嗂�⨣1PJ㬵┡ḸI򰱂ˮaࢸ۳i灛ȯɨb𹺪򕕱뿶uٔ䎴񷯆Φ륽󬃨س_NƵ¦\u00E9' - - let eResult = await messagesURL.enqueue(Aborter.none, specialMessage, { - messageTimeToLive: 40, - visibilitytimeout: 0 - }); - assert.ok(eResult.date); - assert.ok(eResult.expirationTime); - assert.ok(eResult.insertionTime); - assert.ok(eResult.messageId); - assert.ok(eResult.popReceipt); - assert.ok(eResult.requestId); - assert.ok(eResult.timeNextVisible); - assert.ok(eResult.version); - - let pResult = await messagesURL.peek(Aborter.none, { numberOfMessages: 2 }); - assert.ok(pResult.date); - assert.ok(pResult.requestId); - assert.ok(pResult.version); - assert.deepStrictEqual(pResult.peekedMessageItems.length, 1); - assert.deepStrictEqual( - pResult.peekedMessageItems[0].messageText, - specialMessage - ); - assert.deepStrictEqual(pResult.peekedMessageItems[0].dequeueCount, 0); - assert.deepStrictEqual( - pResult.peekedMessageItems[0].messageId, - eResult.messageId - ); - assert.deepStrictEqual( - pResult.peekedMessageItems[0].insertionTime, - eResult.insertionTime - ); - assert.deepStrictEqual( - pResult.peekedMessageItems[0].expirationTime, - eResult.expirationTime - ); - - let dResult = await messagesURL.dequeue(Aborter.none, { - visibilitytimeout: 10, - numberOfMessages: 2 - }); - assert.ok(dResult.date); - assert.ok(dResult.requestId); - assert.ok(dResult.version); - assert.deepStrictEqual(dResult.dequeuedMessageItems.length, 1); - assert.deepStrictEqual( - dResult.dequeuedMessageItems[0].messageText, - specialMessage - ); - assert.deepStrictEqual(dResult.dequeuedMessageItems[0].dequeueCount, 1); - assert.deepStrictEqual( - dResult.dequeuedMessageItems[0].messageId, - eResult.messageId - ); - assert.deepStrictEqual( - dResult.dequeuedMessageItems[0].insertionTime, - eResult.insertionTime - ); - assert.deepStrictEqual( - dResult.dequeuedMessageItems[0].expirationTime, - eResult.expirationTime - ); - assert.ok(dResult.dequeuedMessageItems[0].popReceipt); - assert.ok(dResult.dequeuedMessageItems[0].timeNextVisible); - }); - - it("enqueue, peek, dequeue with 64KB characters size which is computed after encoding", async () => { - let messagesURL = MessagesURL.fromQueueURL(queueURL); - let messageContent = new Array(64*1024 + 1).join('a'); - - let eResult = await messagesURL.enqueue(Aborter.none, messageContent, { - messageTimeToLive: 40, - visibilitytimeout: 0 - }); - assert.ok(eResult.date); - assert.ok(eResult.expirationTime); - assert.ok(eResult.insertionTime); - assert.ok(eResult.messageId); - assert.ok(eResult.popReceipt); - assert.ok(eResult.requestId); - assert.ok(eResult.timeNextVisible); - assert.ok(eResult.version); - - let pResult = await messagesURL.peek(Aborter.none, { numberOfMessages: 2 }); - assert.ok(pResult.date); - assert.ok(pResult.requestId); - assert.ok(pResult.version); - assert.deepStrictEqual(pResult.peekedMessageItems.length, 1); - assert.deepStrictEqual( - pResult.peekedMessageItems[0].messageText, - messageContent - ); - assert.deepStrictEqual(pResult.peekedMessageItems[0].dequeueCount, 0); - assert.deepStrictEqual( - pResult.peekedMessageItems[0].messageId, - eResult.messageId - ); - assert.deepStrictEqual( - pResult.peekedMessageItems[0].insertionTime, - eResult.insertionTime - ); - assert.deepStrictEqual( - pResult.peekedMessageItems[0].expirationTime, - eResult.expirationTime - ); - - let dResult = await messagesURL.dequeue(Aborter.none, { - visibilitytimeout: 10, - numberOfMessages: 2 - }); - assert.ok(dResult.date); - assert.ok(dResult.requestId); - assert.ok(dResult.version); - assert.deepStrictEqual(dResult.dequeuedMessageItems.length, 1); - assert.deepStrictEqual( - dResult.dequeuedMessageItems[0].messageText, - messageContent - ); - assert.deepStrictEqual(dResult.dequeuedMessageItems[0].dequeueCount, 1); - assert.deepStrictEqual( - dResult.dequeuedMessageItems[0].messageId, - eResult.messageId - ); - assert.deepStrictEqual( - dResult.dequeuedMessageItems[0].insertionTime, - eResult.insertionTime - ); - assert.deepStrictEqual( - dResult.dequeuedMessageItems[0].expirationTime, - eResult.expirationTime - ); - assert.ok(dResult.dequeuedMessageItems[0].popReceipt); - assert.ok(dResult.dequeuedMessageItems[0].timeNextVisible); - }); - - it("enqueue, peek and dequeue negative", async () => { - let messagesURL = MessagesURL.fromQueueURL(queueURL); - let eResult = await messagesURL.enqueue(Aborter.none, messageContent, { - messageTimeToLive: 40 - }); - assert.ok(eResult.date); - assert.ok(eResult.expirationTime); - assert.ok(eResult.insertionTime); - assert.ok(eResult.messageId); - assert.ok(eResult.popReceipt); - assert.ok(eResult.requestId); - assert.ok(eResult.timeNextVisible); - assert.ok(eResult.version); - - let error; - try { - await messagesURL.enqueue(Aborter.none, messageContent, { - messageTimeToLive: 30, - visibilitytimeout: 30 - }); - } catch (err) { - error = err; - } - assert.ok(error); - - let errorPeek; - try { - await messagesURL.peek(Aborter.none, { numberOfMessages: 100 }); - } catch (err) { - errorPeek = err; - } - assert.ok(errorPeek); - - let pResult = await messagesURL.peek(Aborter.none, { numberOfMessages: 2 }); - assert.ok(pResult.date); - assert.ok(pResult.requestId); - assert.ok(pResult.version); - assert.deepStrictEqual(pResult.peekedMessageItems.length, 1); - assert.deepStrictEqual( - pResult.peekedMessageItems[0].messageText, - messageContent - ); - assert.deepStrictEqual(pResult.peekedMessageItems[0].dequeueCount, 0); - assert.deepStrictEqual( - pResult.peekedMessageItems[0].messageId, - eResult.messageId - ); - assert.deepStrictEqual( - pResult.peekedMessageItems[0].insertionTime, - eResult.insertionTime - ); - assert.deepStrictEqual( - pResult.peekedMessageItems[0].expirationTime, - eResult.expirationTime - ); - - // Note visibility time could be larger then message time to live for dequeue. - await messagesURL.dequeue(Aborter.none, { - visibilitytimeout: 40, - numberOfMessages: 2 - }); - }); - - it("enqueue negative with 65537B(64KB+1B) characters size which is computed after encoding", async () => { - let messagesURL = MessagesURL.fromQueueURL(queueURL); - let messageContent = new Array(64*1024 + 2).join('a'); - - let error - try { - await messagesURL.enqueue(Aborter.none, messageContent, {}); - } catch(err) { - error = err - } - assert.ok(error) - assert.ok(error.message.includes("The request body is too large and exceeds the maximum permissible limit.")) - }); -}); \ No newline at end of file diff --git a/sdk/storage/storage-queue/test/node/messageidclient.spec.ts b/sdk/storage/storage-queue/test/node/messageidclient.spec.ts new file mode 100644 index 000000000000..b23e4244c08b --- /dev/null +++ b/sdk/storage/storage-queue/test/node/messageidclient.spec.ts @@ -0,0 +1,88 @@ +import * as assert from "assert"; + +import { QueueClient } from "../../src/QueueClient"; +import { MessagesClient } from "../../src/MessagesClient"; +import { MessageIdClient } from "../../src/MessageIdClient"; +import { getQSU, getUniqueName } from "../utils"; + +describe("MessageIdClient Node", () => { + const queueServiceClient = getQSU(); + let queueName = getUniqueName("queue"); + let queueClient = QueueClient.fromQueueServiceClient(queueServiceClient, queueName); + const messageContent = "Hello World"; + + beforeEach(async () => { + queueName = getUniqueName("queue"); + queueClient = QueueClient.fromQueueServiceClient(queueServiceClient, queueName); + await queueClient.create(); + }); + + afterEach(async () => { + await queueClient.delete(); + }); + + it("update message with 64KB characters including special char which is computed after encoding", async () => { + let messagesClient = MessagesClient.fromQueueClient(queueClient); + let eResult = await messagesClient.enqueue(messageContent); + assert.ok(eResult.date); + assert.ok(eResult.expirationTime); + assert.ok(eResult.insertionTime); + assert.ok(eResult.messageId); + assert.ok(eResult.popReceipt); + assert.ok(eResult.requestId); + assert.ok(eResult.timeNextVisible); + assert.ok(eResult.version); + + let specialChars = + "!@#$%^&*()_+`-=[]|};'\":,./?><`~漢字㒈保ᨍ揫^p[뷁)׷񬓔7񈺝l鮍򧽶ͺ簣ڞ츊䈗㝯綞߫⯹?ÎᦡC왶żsmt㖩닡򈸱𕩣ОլFZ򃀮9tC榅ٻ컦驿Ϳ[𱿛봻烌󱰷򙥱Ռ򽒏򘤰δŊϜ췮㐦9ͽƙp퐂ʩ由巩•KFÓ֮򨾭⨿󊻅aBm󶴂旨Ϣ񓙠򻐪񇧱򆋸ջ֨ipn򒷐ꝷՆ򆊙斡賆𒚑m˞𻆕󛿓򐞺Ӯ򡗺򴜍<񐸩԰Bu)򁉂񖨞á<џɏ嗂�⨣1PJ㬵┡ḸI򰱂ˮaࢸ۳i灛ȯɨb𹺪򕕱뿶uٔ䎴񷯆Φ륽󬃨س_NƵ¦"; + let buffer = Buffer.alloc(64 * 1024); //64KB + buffer.fill("a"); + buffer.write(specialChars, 0); + let newMessage = buffer.toString(); + let messageIdClient = MessageIdClient.fromMessagesClient(messagesClient, eResult.messageId); + let uResult = await messageIdClient.update(eResult.popReceipt, 0, newMessage); + assert.ok(uResult.version); + assert.ok(uResult.timeNextVisible); + assert.ok(uResult.date); + assert.ok(uResult.requestId); + assert.ok(uResult.popReceipt); + + let pResult = await messagesClient.peek(); + assert.equal(pResult.peekedMessageItems.length, 1); + assert.deepStrictEqual(pResult.peekedMessageItems[0].messageText, newMessage); + }); + + it("update message negative with 65537B (64KB+1B) characters including special char which is computed after encoding", async () => { + let messagesClient = MessagesClient.fromQueueClient(queueClient); + let eResult = await messagesClient.enqueue(messageContent); + assert.ok(eResult.date); + assert.ok(eResult.expirationTime); + assert.ok(eResult.insertionTime); + assert.ok(eResult.messageId); + assert.ok(eResult.popReceipt); + assert.ok(eResult.requestId); + assert.ok(eResult.timeNextVisible); + assert.ok(eResult.version); + + let specialChars = + "!@#$%^&*()_+`-=[]|};'\":,./?><`~漢字㒈保ᨍ揫^p[뷁)׷񬓔7񈺝l鮍򧽶ͺ簣ڞ츊䈗㝯綞߫⯹?ÎᦡC왶żsmt㖩닡򈸱𕩣ОլFZ򃀮9tC榅ٻ컦驿Ϳ[𱿛봻烌󱰷򙥱Ռ򽒏򘤰δŊϜ췮㐦9ͽƙp퐂ʩ由巩•KFÓ֮򨾭⨿󊻅aBm󶴂旨Ϣ񓙠򻐪񇧱򆋸ջ֨ipn򒷐ꝷՆ򆊙斡賆𒚑m˞𻆕󛿓򐞺Ӯ򡗺򴜍<񐸩԰Bu)򁉂񖨞á<џɏ嗂�⨣1PJ㬵┡ḸI򰱂ˮaࢸ۳i灛ȯɨb𹺪򕕱뿶uٔ䎴񷯆Φ륽󬃨س_NƵ¦"; + let buffer = Buffer.alloc(64 * 1024 + 1); + buffer.fill("a"); + buffer.write(specialChars, 0); + let newMessage = buffer.toString(); + let messageIdClient = MessageIdClient.fromMessagesClient(messagesClient, eResult.messageId); + + let error; + try { + await messageIdClient.update(eResult.popReceipt, 0, newMessage); + } catch (err) { + error = err; + } + assert.ok(error); + assert.ok( + error.message.includes( + "The request body is too large and exceeds the maximum permissible limit." + ) + ); + }); +}); diff --git a/sdk/storage/storage-queue/test/node/messageidurl.test.ts b/sdk/storage/storage-queue/test/node/messageidurl.test.ts deleted file mode 100644 index 3d40b2961ddb..000000000000 --- a/sdk/storage/storage-queue/test/node/messageidurl.test.ts +++ /dev/null @@ -1,102 +0,0 @@ -import * as assert from "assert"; - -import { Aborter } from "../../src/Aborter"; -import { QueueURL } from "../../src/QueueURL"; -import { MessagesURL } from "../../src/MessagesURL"; -import { MessageIdURL } from "../../src/MessageIdURL"; -import { getQSU, getUniqueName } from "../utils"; - -describe("MessageIdURL Node", () => { - const serviceURL = getQSU(); - let queueName = getUniqueName("queue"); - let queueURL = QueueURL.fromServiceURL(serviceURL, queueName); - const messageContent = "Hello World"; - - beforeEach(async () => { - queueName = getUniqueName("queue"); - queueURL = QueueURL.fromServiceURL(serviceURL, queueName); - await queueURL.create(Aborter.none); - }); - - afterEach(async () => { - await queueURL.delete(Aborter.none); - }); - - it("update message with 64KB characters including special char which is computed after encoding", async () => { - let messagesURL = MessagesURL.fromQueueURL(queueURL); - let eResult = await messagesURL.enqueue(Aborter.none, messageContent); - assert.ok(eResult.date); - assert.ok(eResult.expirationTime); - assert.ok(eResult.insertionTime); - assert.ok(eResult.messageId); - assert.ok(eResult.popReceipt); - assert.ok(eResult.requestId); - assert.ok(eResult.timeNextVisible); - assert.ok(eResult.version); - - let specialChars = '!@#$%^&*()_+`-=[]\|};\'":,./?><`~漢字㒈保ᨍ揫^p[뷁)׷񬓔7񈺝l鮍򧽶ͺ簣ڞ츊䈗㝯綞߫⯹?ÎᦡC왶żsmt㖩닡򈸱𕩣ОլFZ򃀮9tC榅ٻ컦驿Ϳ[𱿛봻烌󱰷򙥱Ռ򽒏򘤰δŊϜ췮㐦9ͽƙp퐂ʩ由巩•KFÓ֮򨾭⨿󊻅aBm󶴂旨Ϣ񓙠򻐪񇧱򆋸ջ֨ipn򒷐ꝷՆ򆊙斡賆𒚑m˞\𻆕󛿓򐞺Ӯ򡗺򴜍<񐸩԰Bu)򁉂񖨞á<џɏ嗂�⨣1PJ㬵┡ḸI򰱂ˮaࢸ۳i灛ȯɨb𹺪򕕱뿶uٔ䎴񷯆Φ륽󬃨س_NƵ¦' - let buffer = Buffer.alloc(64*1024); //64KB - buffer.fill('a'); - buffer.write(specialChars, 0); - let newMessage = buffer.toString(); - let messageIdURL = MessageIdURL.fromMessagesURL( - messagesURL, - eResult.messageId - ); - let uResult = await messageIdURL.update( - Aborter.none, - eResult.popReceipt, - 0, - newMessage - ); - assert.ok(uResult.version); - assert.ok(uResult.timeNextVisible); - assert.ok(uResult.date); - assert.ok(uResult.requestId); - assert.ok(uResult.popReceipt); - - let pResult = await messagesURL.peek(Aborter.none); - assert.equal(pResult.peekedMessageItems.length, 1); - assert.deepStrictEqual( - pResult.peekedMessageItems[0].messageText, - newMessage - ); - }); - - it("update message negative with 65537B (64KB+1B) characters including special char which is computed after encoding", async () => { - let messagesURL = MessagesURL.fromQueueURL(queueURL); - let eResult = await messagesURL.enqueue(Aborter.none, messageContent); - assert.ok(eResult.date); - assert.ok(eResult.expirationTime); - assert.ok(eResult.insertionTime); - assert.ok(eResult.messageId); - assert.ok(eResult.popReceipt); - assert.ok(eResult.requestId); - assert.ok(eResult.timeNextVisible); - assert.ok(eResult.version); - - let specialChars = '!@#$%^&*()_+`-=[]\|};\'":,./?><`~漢字㒈保ᨍ揫^p[뷁)׷񬓔7񈺝l鮍򧽶ͺ簣ڞ츊䈗㝯綞߫⯹?ÎᦡC왶żsmt㖩닡򈸱𕩣ОլFZ򃀮9tC榅ٻ컦驿Ϳ[𱿛봻烌󱰷򙥱Ռ򽒏򘤰δŊϜ췮㐦9ͽƙp퐂ʩ由巩•KFÓ֮򨾭⨿󊻅aBm󶴂旨Ϣ񓙠򻐪񇧱򆋸ջ֨ipn򒷐ꝷՆ򆊙斡賆𒚑m˞\𻆕󛿓򐞺Ӯ򡗺򴜍<񐸩԰Bu)򁉂񖨞á<џɏ嗂�⨣1PJ㬵┡ḸI򰱂ˮaࢸ۳i灛ȯɨb𹺪򕕱뿶uٔ䎴񷯆Φ륽󬃨س_NƵ¦' - let buffer = Buffer.alloc(64*1024 + 1); - buffer.fill('a'); - buffer.write(specialChars, 0); - let newMessage = buffer.toString(); - let messageIdURL = MessageIdURL.fromMessagesURL( - messagesURL, - eResult.messageId - ); - - let error; - try{ - await messageIdURL.update( - Aborter.none, - eResult.popReceipt, - 0, - newMessage - ); - } catch(err) { - error = err - } - assert.ok(error); - assert.ok(error.message.includes("The request body is too large and exceeds the maximum permissible limit.")) - }); -}); diff --git a/sdk/storage/storage-queue/test/node/messagesclient.spec.ts b/sdk/storage/storage-queue/test/node/messagesclient.spec.ts new file mode 100644 index 000000000000..6430ec35e502 --- /dev/null +++ b/sdk/storage/storage-queue/test/node/messagesclient.spec.ts @@ -0,0 +1,94 @@ +import * as assert from "assert"; + +import { QueueClient } from "../../src/QueueClient"; +import { MessagesClient } from "../../src/MessagesClient"; +import { getQSU, getUniqueName } from "../utils"; + +describe("MessagesClient Node", () => { + const queueServiceClient = getQSU(); + let queueName = getUniqueName("queue"); + let queueClient = QueueClient.fromQueueServiceClient(queueServiceClient, queueName); + + beforeEach(async () => { + queueName = getUniqueName("queue"); + queueClient = QueueClient.fromQueueServiceClient(queueServiceClient, queueName); + await queueClient.create(); + }); + + afterEach(async () => { + await queueClient.delete(); + }); + + it("enqueue, peek, dequeue with 64KB characters including special char which is computed after encoding", async () => { + let messagesClient = MessagesClient.fromQueueClient(queueClient); + let specialChars = + "!@#$%^&*()_+`-=[]|};'\":,./?><`~漢字㒈保ᨍ揫^p[뷁)׷񬓔7񈺝l鮍򧽶ͺ簣ڞ츊䈗㝯綞߫⯹?ÎᦡC왶żsmt㖩닡򈸱𕩣ОլFZ򃀮9tC榅ٻ컦驿Ϳ[𱿛봻烌󱰷򙥱Ռ򽒏򘤰δŊϜ췮㐦9ͽƙp퐂ʩ由巩•KFÓ֮򨾭⨿󊻅aBm󶴂旨Ϣ񓙠򻐪񇧱򆋸ջ֨ipn򒷐ꝷՆ򆊙斡賆𒚑m˞𻆕󛿓򐞺Ӯ򡗺򴜍<񐸩԰Bu)򁉂񖨞á<џɏ嗂�⨣1PJ㬵┡ḸI򰱂ˮaࢸ۳i灛ȯɨb𹺪򕕱뿶uٔ䎴񷯆Φ륽󬃨س_NƵ¦"; + let buffer = Buffer.alloc(64 * 1024); //64KB + buffer.fill("a"); + buffer.write(specialChars, 0); + let messageContent = buffer.toString(); + + let eResult = await messagesClient.enqueue(messageContent, { + messageTimeToLive: 40, + visibilitytimeout: 0 + }); + assert.ok(eResult.date); + assert.ok(eResult.expirationTime); + assert.ok(eResult.insertionTime); + assert.ok(eResult.messageId); + assert.ok(eResult.popReceipt); + assert.ok(eResult.requestId); + assert.ok(eResult.timeNextVisible); + assert.ok(eResult.version); + + let pResult = await messagesClient.peek({ numberOfMessages: 2 }); + assert.ok(pResult.date); + assert.ok(pResult.requestId); + assert.ok(pResult.version); + assert.deepStrictEqual(pResult.peekedMessageItems.length, 1); + assert.deepStrictEqual(pResult.peekedMessageItems[0].messageText, messageContent); + assert.deepStrictEqual(pResult.peekedMessageItems[0].dequeueCount, 0); + assert.deepStrictEqual(pResult.peekedMessageItems[0].messageId, eResult.messageId); + assert.deepStrictEqual(pResult.peekedMessageItems[0].insertionTime, eResult.insertionTime); + assert.deepStrictEqual(pResult.peekedMessageItems[0].expirationTime, eResult.expirationTime); + + let dResult = await messagesClient.dequeue({ + visibilitytimeout: 10, + numberOfMessages: 2 + }); + assert.ok(dResult.date); + assert.ok(dResult.requestId); + assert.ok(dResult.version); + assert.deepStrictEqual(dResult.dequeuedMessageItems.length, 1); + assert.deepStrictEqual(dResult.dequeuedMessageItems[0].messageText, messageContent); + assert.deepStrictEqual(dResult.dequeuedMessageItems[0].dequeueCount, 1); + assert.deepStrictEqual(dResult.dequeuedMessageItems[0].messageId, eResult.messageId); + assert.deepStrictEqual(dResult.dequeuedMessageItems[0].insertionTime, eResult.insertionTime); + assert.deepStrictEqual(dResult.dequeuedMessageItems[0].expirationTime, eResult.expirationTime); + assert.ok(dResult.dequeuedMessageItems[0].popReceipt); + assert.ok(dResult.dequeuedMessageItems[0].timeNextVisible); + }); + + it("enqueue negative with 65537B(64KB+1B) characters including special char which is computed after encoding", async () => { + let messagesClient = MessagesClient.fromQueueClient(queueClient); + let specialChars = + "!@#$%^&*()_+`-=[]|};'\":,./?><`~漢字㒈保ᨍ揫^p[뷁)׷񬓔7񈺝l鮍򧽶ͺ簣ڞ츊䈗㝯綞߫⯹?ÎᦡC왶żsmt㖩닡򈸱𕩣ОլFZ򃀮9tC榅ٻ컦驿Ϳ[𱿛봻烌󱰷򙥱Ռ򽒏򘤰δŊϜ췮㐦9ͽƙp퐂ʩ由巩•KFÓ֮򨾭⨿󊻅aBm󶴂旨Ϣ񓙠򻐪񇧱򆋸ջ֨ipn򒷐ꝷՆ򆊙斡賆𒚑m˞𻆕󛿓򐞺Ӯ򡗺򴜍<񐸩԰Bu)򁉂񖨞á<џɏ嗂�⨣1PJ㬵┡ḸI򰱂ˮaࢸ۳i灛ȯɨb𹺪򕕱뿶uٔ䎴񷯆Φ륽󬃨س_NƵ¦"; + let buffer = Buffer.alloc(64 * 1024 + 1); + buffer.fill("a"); + buffer.write(specialChars, 0); + let messageContent = buffer.toString(); + + let error; + try { + await messagesClient.enqueue(messageContent, {}); + } catch (err) { + error = err; + } + assert.ok(error); + assert.ok( + error.message.includes( + "The request body is too large and exceeds the maximum permissible limit." + ) + ); + }); +}); diff --git a/sdk/storage/storage-queue/test/node/messagesurl.test.ts b/sdk/storage/storage-queue/test/node/messagesurl.test.ts deleted file mode 100644 index 96ae4dbfb074..000000000000 --- a/sdk/storage/storage-queue/test/node/messagesurl.test.ts +++ /dev/null @@ -1,113 +0,0 @@ -import * as assert from "assert"; - -import { Aborter } from "../../src/Aborter"; -import { QueueURL } from "../../src/QueueURL"; -import { MessagesURL } from "../../src/MessagesURL"; -import { getQSU, getUniqueName } from "../utils"; - -describe("MessagesURL Node", () => { - const serviceURL = getQSU(); - let queueName = getUniqueName("queue"); - let queueURL = QueueURL.fromServiceURL(serviceURL, queueName); - - beforeEach(async () => { - queueName = getUniqueName("queue"); - queueURL = QueueURL.fromServiceURL(serviceURL, queueName); - await queueURL.create(Aborter.none); - }); - - afterEach(async () => { - await queueURL.delete(Aborter.none); - }); - - it("enqueue, peek, dequeue with 64KB characters including special char which is computed after encoding", async () => { - let messagesURL = MessagesURL.fromQueueURL(queueURL); - let specialChars = '!@#$%^&*()_+`-=[]\|};\'":,./?><`~漢字㒈保ᨍ揫^p[뷁)׷񬓔7񈺝l鮍򧽶ͺ簣ڞ츊䈗㝯綞߫⯹?ÎᦡC왶żsmt㖩닡򈸱𕩣ОլFZ򃀮9tC榅ٻ컦驿Ϳ[𱿛봻烌󱰷򙥱Ռ򽒏򘤰δŊϜ췮㐦9ͽƙp퐂ʩ由巩•KFÓ֮򨾭⨿󊻅aBm󶴂旨Ϣ񓙠򻐪񇧱򆋸ջ֨ipn򒷐ꝷՆ򆊙斡賆𒚑m˞\𻆕󛿓򐞺Ӯ򡗺򴜍<񐸩԰Bu)򁉂񖨞á<џɏ嗂�⨣1PJ㬵┡ḸI򰱂ˮaࢸ۳i灛ȯɨb𹺪򕕱뿶uٔ䎴񷯆Φ륽󬃨س_NƵ¦' - let buffer = Buffer.alloc(64*1024); //64KB - buffer.fill('a'); - buffer.write(specialChars, 0); - let messageContent = buffer.toString(); - - let eResult = await messagesURL.enqueue(Aborter.none, messageContent, { - messageTimeToLive: 40, - visibilitytimeout: 0 - }); - assert.ok(eResult.date); - assert.ok(eResult.expirationTime); - assert.ok(eResult.insertionTime); - assert.ok(eResult.messageId); - assert.ok(eResult.popReceipt); - assert.ok(eResult.requestId); - assert.ok(eResult.timeNextVisible); - assert.ok(eResult.version); - - let pResult = await messagesURL.peek(Aborter.none, { numberOfMessages: 2 }); - assert.ok(pResult.date); - assert.ok(pResult.requestId); - assert.ok(pResult.version); - assert.deepStrictEqual(pResult.peekedMessageItems.length, 1); - assert.deepStrictEqual( - pResult.peekedMessageItems[0].messageText, - messageContent - ); - assert.deepStrictEqual(pResult.peekedMessageItems[0].dequeueCount, 0); - assert.deepStrictEqual( - pResult.peekedMessageItems[0].messageId, - eResult.messageId - ); - assert.deepStrictEqual( - pResult.peekedMessageItems[0].insertionTime, - eResult.insertionTime - ); - assert.deepStrictEqual( - pResult.peekedMessageItems[0].expirationTime, - eResult.expirationTime - ); - - let dResult = await messagesURL.dequeue(Aborter.none, { - visibilitytimeout: 10, - numberOfMessages: 2 - }); - assert.ok(dResult.date); - assert.ok(dResult.requestId); - assert.ok(dResult.version); - assert.deepStrictEqual(dResult.dequeuedMessageItems.length, 1); - assert.deepStrictEqual( - dResult.dequeuedMessageItems[0].messageText, - messageContent - ); - assert.deepStrictEqual(dResult.dequeuedMessageItems[0].dequeueCount, 1); - assert.deepStrictEqual( - dResult.dequeuedMessageItems[0].messageId, - eResult.messageId - ); - assert.deepStrictEqual( - dResult.dequeuedMessageItems[0].insertionTime, - eResult.insertionTime - ); - assert.deepStrictEqual( - dResult.dequeuedMessageItems[0].expirationTime, - eResult.expirationTime - ); - assert.ok(dResult.dequeuedMessageItems[0].popReceipt); - assert.ok(dResult.dequeuedMessageItems[0].timeNextVisible); - }); - - it("enqueue negative with 65537B(64KB+1B) characters including special char which is computed after encoding", async () => { - let messagesURL = MessagesURL.fromQueueURL(queueURL); - let specialChars = '!@#$%^&*()_+`-=[]\|};\'":,./?><`~漢字㒈保ᨍ揫^p[뷁)׷񬓔7񈺝l鮍򧽶ͺ簣ڞ츊䈗㝯綞߫⯹?ÎᦡC왶żsmt㖩닡򈸱𕩣ОլFZ򃀮9tC榅ٻ컦驿Ϳ[𱿛봻烌󱰷򙥱Ռ򽒏򘤰δŊϜ췮㐦9ͽƙp퐂ʩ由巩•KFÓ֮򨾭⨿󊻅aBm󶴂旨Ϣ񓙠򻐪񇧱򆋸ջ֨ipn򒷐ꝷՆ򆊙斡賆𒚑m˞\𻆕󛿓򐞺Ӯ򡗺򴜍<񐸩԰Bu)򁉂񖨞á<џɏ嗂�⨣1PJ㬵┡ḸI򰱂ˮaࢸ۳i灛ȯɨb𹺪򕕱뿶uٔ䎴񷯆Φ륽󬃨س_NƵ¦' - let buffer = Buffer.alloc(64*1024 + 1); - buffer.fill('a'); - buffer.write(specialChars, 0); - let messageContent = buffer.toString(); - - let error - try { - await messagesURL.enqueue(Aborter.none, messageContent, {}); - } catch(err) { - error = err - } - assert.ok(error) - assert.ok(error.message.includes("The request body is too large and exceeds the maximum permissible limit.")) - }); -}); \ No newline at end of file diff --git a/sdk/storage/storage-queue/test/node/queueurl.test.ts b/sdk/storage/storage-queue/test/node/queueclient.spec.ts similarity index 58% rename from sdk/storage/storage-queue/test/node/queueurl.test.ts rename to sdk/storage/storage-queue/test/node/queueclient.spec.ts index 976a2c3b56b9..a3f7da94f295 100644 --- a/sdk/storage/storage-queue/test/node/queueurl.test.ts +++ b/sdk/storage/storage-queue/test/node/queueclient.spec.ts @@ -1,26 +1,25 @@ import * as assert from "assert"; -import { Aborter } from "../../src/Aborter"; -import { QueueURL } from "../../src/QueueURL"; +import { QueueClient } from "../../src/QueueClient"; import { getQSU, getUniqueName } from "../utils"; -describe("QueueURL Node", () => { - const serviceURL = getQSU(); +describe("QueueClient Node", () => { + const queueServiceClient = getQSU(); let queueName: string = getUniqueName("queue"); - let queueURL = QueueURL.fromServiceURL(serviceURL, queueName); + let queueClient = QueueClient.fromQueueServiceClient(queueServiceClient, queueName); beforeEach(async () => { queueName = getUniqueName("queue"); - queueURL = QueueURL.fromServiceURL(serviceURL, queueName); - await queueURL.create(Aborter.none); + queueClient = QueueClient.fromQueueServiceClient(queueServiceClient, queueName); + await queueClient.create(); }); afterEach(async () => { - await queueURL.delete(Aborter.none); + await queueClient.delete(); }); it("getAccessPolicy", async () => { - const result = await queueURL.getAccessPolicy(Aborter.none); + const result = await queueClient.getAccessPolicy(); assert.ok(result.requestId); assert.ok(result.version); assert.ok(result.date); @@ -38,8 +37,8 @@ describe("QueueURL Node", () => { } ]; - await queueURL.setAccessPolicy(Aborter.none, queueAcl); - const result = await queueURL.getAccessPolicy(Aborter.none); + await queueClient.setAccessPolicy(queueAcl); + const result = await queueClient.getAccessPolicy(); assert.deepEqual(result.signedIdentifiers, queueAcl); }); }); diff --git a/sdk/storage/storage-queue/test/node/sas.test.ts b/sdk/storage/storage-queue/test/node/sas.spec.ts similarity index 63% rename from sdk/storage/storage-queue/test/node/sas.test.ts rename to sdk/storage/storage-queue/test/node/sas.spec.ts index aadf45f837d1..f38aae0f6c70 100644 --- a/sdk/storage/storage-queue/test/node/sas.test.ts +++ b/sdk/storage/storage-queue/test/node/sas.spec.ts @@ -5,22 +5,21 @@ import { AccountSASResourceTypes, AccountSASServices, AnonymousCredential, - MessagesURL, - MessageIdURL, + MessagesClient, + MessageIdClient, QueueSASPermissions, - QueueURL, + QueueClient, generateAccountSASQueryParameters, generateQueueSASQueryParameters, - ServiceURL, + QueueServiceClient, SharedKeyCredential, - StorageURL + StorageClient } from "../../src"; -import { Aborter } from "../../src/Aborter"; import { SASProtocol } from "../../src/SASQueryParameters"; import { getQSU, getUniqueName, sleep } from "../utils/index"; describe("Shared Access Signature (SAS) generation Node.js only", () => { - const serviceURL = getQSU(); + const queueServiceClient = getQSU(); it("generateAccountSASQueryParameters should work", async () => { const now = new Date(); @@ -30,7 +29,7 @@ describe("Shared Access Signature (SAS) generation Node.js only", () => { tmr.setDate(tmr.getDate() + 1); // By default, credential is always the last element of pipeline factories - const factories = serviceURL.pipeline.factories; + const factories = queueServiceClient.pipeline.factories; const sharedKeyCredential = factories[factories.length - 1]; const sas = generateAccountSASQueryParameters( @@ -47,13 +46,13 @@ describe("Shared Access Signature (SAS) generation Node.js only", () => { sharedKeyCredential as SharedKeyCredential ).toString(); - const sasURL = `${serviceURL.url}?${sas}`; - const serviceURLwithSAS = new ServiceURL( + const sasURL = `${queueServiceClient.url}?${sas}`; + const queueServiceClientwithSAS = new QueueServiceClient( sasURL, - StorageURL.newPipeline(new AnonymousCredential()) + StorageClient.newPipeline(new AnonymousCredential()) ); - await serviceURLwithSAS.getProperties(Aborter.none); + await queueServiceClientwithSAS.getProperties(); }); it("generateAccountSASQueryParameters should not work with invalid permission", async () => { @@ -61,7 +60,7 @@ describe("Shared Access Signature (SAS) generation Node.js only", () => { tmr.setDate(tmr.getDate() + 1); // By default, credential is always the last element of pipeline factories - const factories = serviceURL.pipeline.factories; + const factories = queueServiceClient.pipeline.factories; const sharedKeyCredential = factories[factories.length - 1]; const sas = generateAccountSASQueryParameters( @@ -74,15 +73,15 @@ describe("Shared Access Signature (SAS) generation Node.js only", () => { sharedKeyCredential as SharedKeyCredential ).toString(); - const sasURL = `${serviceURL.url}?${sas}`; - const serviceURLwithSAS = new ServiceURL( + const sasURL = `${queueServiceClient.url}?${sas}`; + const queueServiceClientwithSAS = new QueueServiceClient( sasURL, - StorageURL.newPipeline(new AnonymousCredential()) + StorageClient.newPipeline(new AnonymousCredential()) ); let error; try { - await serviceURLwithSAS.getProperties(Aborter.none); + await queueServiceClientwithSAS.getProperties(); } catch (err) { error = err; } @@ -95,7 +94,7 @@ describe("Shared Access Signature (SAS) generation Node.js only", () => { tmr.setDate(tmr.getDate() + 1); // By default, credential is always the last element of pipeline factories - const factories = serviceURL.pipeline.factories; + const factories = queueServiceClient.pipeline.factories; const sharedKeyCredential = factories[factories.length - 1]; const sas = generateAccountSASQueryParameters( @@ -108,15 +107,15 @@ describe("Shared Access Signature (SAS) generation Node.js only", () => { sharedKeyCredential as SharedKeyCredential ).toString(); - const sasURL = `${serviceURL.url}?${sas}`; - const serviceURLwithSAS = new ServiceURL( + const sasURL = `${queueServiceClient.url}?${sas}`; + const queueServiceClientwithSAS = new QueueServiceClient( sasURL, - StorageURL.newPipeline(new AnonymousCredential()) + StorageClient.newPipeline(new AnonymousCredential()) ); let error; try { - await serviceURLwithSAS.getProperties(Aborter.none); + await queueServiceClientwithSAS.getProperties(); } catch (err) { error = err; } @@ -129,7 +128,7 @@ describe("Shared Access Signature (SAS) generation Node.js only", () => { tmr.setDate(tmr.getDate() + 1); // By default, credential is always the last element of pipeline factories - const factories = serviceURL.pipeline.factories; + const factories = queueServiceClient.pipeline.factories; const sharedKeyCredential = factories[factories.length - 1]; const sas = generateAccountSASQueryParameters( @@ -145,15 +144,15 @@ describe("Shared Access Signature (SAS) generation Node.js only", () => { sharedKeyCredential as SharedKeyCredential ).toString(); - const sasURL = `${serviceURL.url}?${sas}`; - const serviceURLwithSAS = new ServiceURL( + const sasURL = `${queueServiceClient.url}?${sas}`; + const queueServiceClientwithSAS = new QueueServiceClient( sasURL, - StorageURL.newPipeline(new AnonymousCredential()) + StorageClient.newPipeline(new AnonymousCredential()) ); let error; try { - await serviceURLwithSAS.getProperties(Aborter.none); + await queueServiceClientwithSAS.getProperties(); } catch (err) { error = err; } @@ -169,12 +168,12 @@ describe("Shared Access Signature (SAS) generation Node.js only", () => { tmr.setDate(tmr.getDate() + 1); // By default, credential is always the last element of pipeline factories - const factories = serviceURL.pipeline.factories; + const factories = queueServiceClient.pipeline.factories; const sharedKeyCredential = factories[factories.length - 1]; const queueName = getUniqueName("queue"); - const queueURL = QueueURL.fromServiceURL(serviceURL, queueName); - await queueURL.create(Aborter.none); + const queueClient = QueueClient.fromQueueServiceClient(queueServiceClient, queueName); + await queueClient.create(); const queueSAS = generateQueueSASQueryParameters( { @@ -189,14 +188,14 @@ describe("Shared Access Signature (SAS) generation Node.js only", () => { sharedKeyCredential as SharedKeyCredential ); - const sasURL = `${queueURL.url}?${queueSAS}`; - const queueURLwithSAS = new QueueURL( + const sasURL = `${queueClient.url}?${queueSAS}`; + const queueClientwithSAS = new QueueClient( sasURL, - StorageURL.newPipeline(new AnonymousCredential()) + StorageClient.newPipeline(new AnonymousCredential()) ); - await queueURLwithSAS.getProperties(Aborter.none); - await queueURL.delete(Aborter.none); + await queueClientwithSAS.getProperties(); + await queueClient.delete(); }); it("generateQueueSASQueryParameters should work for messages", async () => { @@ -207,12 +206,12 @@ describe("Shared Access Signature (SAS) generation Node.js only", () => { tmr.setDate(tmr.getDate() + 1); // By default, credential is always the last element of pipeline factories - const factories = serviceURL.pipeline.factories; + const factories = queueServiceClient.pipeline.factories; const sharedKeyCredential = factories[factories.length - 1]; const queueName = getUniqueName("queue"); - const queueURL = QueueURL.fromServiceURL(serviceURL, queueName); - await queueURL.create(Aborter.none); + const queueClient = QueueClient.fromQueueServiceClient(queueServiceClient, queueName); + await queueClient.create(); const queueSAS = generateQueueSASQueryParameters( { @@ -229,36 +228,33 @@ describe("Shared Access Signature (SAS) generation Node.js only", () => { const messageContent = "Hello World!"; - const messagesURL = MessagesURL.fromQueueURL(queueURL); - const sasURLForMessages = `${messagesURL.url}?${queueSAS}`; - const messagesURLWithSAS = new MessagesURL( + const messagesClient = MessagesClient.fromQueueClient(queueClient); + const sasURLForMessages = `${messagesClient.url}?${queueSAS}`; + const messagesClientWithSAS = new MessagesClient( sasURLForMessages, - StorageURL.newPipeline(new AnonymousCredential()) - ); - const enqueueResult = await messagesURLWithSAS.enqueue( - Aborter.none, - messageContent + StorageClient.newPipeline(new AnonymousCredential()) ); + const enqueueResult = await messagesClientWithSAS.enqueue(messageContent); - let pResult = await messagesURL.peek(Aborter.none); + let pResult = await messagesClient.peek(); assert.deepStrictEqual(pResult.peekedMessageItems.length, 1); - const messageIdURL = MessageIdURL.fromMessagesURL( - messagesURL, + const messageIdClient = MessageIdClient.fromMessagesClient( + messagesClient, enqueueResult.messageId ); - const sasURLForMessageId = `${messageIdURL.url}?${queueSAS}`; - const messageIdURLWithSAS = new MessageIdURL( + const sasURLForMessageId = `${messageIdClient.url}?${queueSAS}`; + const messageIdClientWithSAS = new MessageIdClient( sasURLForMessageId, - StorageURL.newPipeline(new AnonymousCredential()) + StorageClient.newPipeline(new AnonymousCredential()) ); - await messageIdURLWithSAS.delete(Aborter.none, enqueueResult.popReceipt); + await messageIdClientWithSAS.delete(enqueueResult.popReceipt); - pResult = await messagesURL.peek(Aborter.none); + pResult = await messagesClient.peek(); assert.deepStrictEqual(pResult.peekedMessageItems.length, 0); - await queueURL.delete(Aborter.none); + await queueClient.delete(); }); it("generateQueueSASQueryParameters should work for queue with access policy", async () => { @@ -269,15 +265,15 @@ describe("Shared Access Signature (SAS) generation Node.js only", () => { tmr.setDate(tmr.getDate() + 1); // By default, credential is always the last element of pipeline factories - const factories = serviceURL.pipeline.factories; + const factories = queueServiceClient.pipeline.factories; const sharedKeyCredential = factories[factories.length - 1]; const queueName = getUniqueName("queue"); - const queueURL = QueueURL.fromServiceURL(serviceURL, queueName); - await queueURL.create(Aborter.none); + const queueClient = QueueClient.fromQueueServiceClient(queueServiceClient, queueName); + await queueClient.create(); const id = "unique-id"; - await queueURL.setAccessPolicy(Aborter.none, [ + await queueClient.setAccessPolicy([ { accessPolicy: { expiry: tmr, @@ -296,52 +292,42 @@ describe("Shared Access Signature (SAS) generation Node.js only", () => { sharedKeyCredential as SharedKeyCredential ); - const messagesURL = MessagesURL.fromQueueURL(queueURL); + const messagesClient = MessagesClient.fromQueueClient(queueClient); - const sasURL = `${messagesURL.url}?${queueSAS}`; - const messagesURLwithSAS = new MessagesURL( + const sasURL = `${messagesClient.url}?${queueSAS}`; + const messagesClientwithSAS = new MessagesClient( sasURL, - StorageURL.newPipeline(new AnonymousCredential()) + StorageClient.newPipeline(new AnonymousCredential()) ); const messageContent = "hello"; - const eResult = await messagesURLwithSAS.enqueue( - Aborter.none, - messageContent - ); + const eResult = await messagesClientwithSAS.enqueue(messageContent); assert.ok(eResult.messageId); - const pResult = await messagesURLwithSAS.peek(Aborter.none); - assert.deepStrictEqual( - pResult.peekedMessageItems[0].messageText, - messageContent - ); - const dResult = await messagesURLwithSAS.dequeue(Aborter.none, { + const pResult = await messagesClientwithSAS.peek(); + assert.deepStrictEqual(pResult.peekedMessageItems[0].messageText, messageContent); + const dResult = await messagesClientwithSAS.dequeue({ visibilitytimeout: 1 }); - assert.deepStrictEqual( - dResult.dequeuedMessageItems[0].messageText, - messageContent - ); + assert.deepStrictEqual(dResult.dequeuedMessageItems[0].messageText, messageContent); await sleep(2 * 1000); - const messageIdURL = MessageIdURL.fromMessagesURL( - messagesURL, + const messageIdClient = MessageIdClient.fromMessagesClient( + messagesClient, dResult.dequeuedMessageItems[0].messageId ); - const sasURLForMessage = `${messageIdURL.url}?${queueSAS}`; - const messageIdURLwithSAS = new MessageIdURL( + const sasURLForMessage = `${messageIdClient.url}?${queueSAS}`; + const messageIdClientwithSAS = new MessageIdClient( sasURLForMessage, - StorageURL.newPipeline(new AnonymousCredential()) + StorageClient.newPipeline(new AnonymousCredential()) ); - const deleteResult = await messageIdURLwithSAS.delete( - Aborter.none, + const deleteResult = await messageIdClientwithSAS.delete( dResult.dequeuedMessageItems[0].popReceipt ); assert.ok(deleteResult.requestId); - //const cResult = await messagesURLwithSAS.clear(Aborter.none); //This request is not authorized to perform this operation. As testing, this is service's current behavior. + //const cResult = await messagesClientwithSAS.clear(); //This request is not authorized to perform this operation. As testing, this is service's current behavior. }); }); diff --git a/sdk/storage/storage-queue/test/queueurl.test.ts b/sdk/storage/storage-queue/test/queueclient.spec.ts similarity index 56% rename from sdk/storage/storage-queue/test/queueurl.test.ts rename to sdk/storage/storage-queue/test/queueclient.spec.ts index efac43b89276..046fc735a89b 100644 --- a/sdk/storage/storage-queue/test/queueurl.test.ts +++ b/sdk/storage/storage-queue/test/queueclient.spec.ts @@ -1,24 +1,23 @@ import * as assert from "assert"; -import { Aborter } from "../src/Aborter"; -import { QueueURL } from "../src/QueueURL"; +import { QueueClient } from "../src/QueueClient"; import { getQSU, getUniqueName } from "./utils"; import * as dotenv from "dotenv"; -dotenv.config({path:"../.env"}); +dotenv.config({ path: "../.env" }); -describe("QueueURL", () => { - const serviceURL = getQSU(); +describe("QueueClient", () => { + const queueServiceClient = getQSU(); let queueName = getUniqueName("queue"); - let queueURL = QueueURL.fromServiceURL(serviceURL, queueName); + let queueClient = QueueClient.fromQueueServiceClient(queueServiceClient, queueName); beforeEach(async () => { queueName = getUniqueName("queue"); - queueURL = QueueURL.fromServiceURL(serviceURL, queueName); - await queueURL.create(Aborter.none); + queueClient = QueueClient.fromQueueServiceClient(queueServiceClient, queueName); + await queueClient.create(); }); afterEach(async () => { - await queueURL.delete(Aborter.none); + await queueClient.delete(); }); it("setMetadata", async () => { @@ -27,14 +26,14 @@ describe("QueueURL", () => { keya: "vala", keyb: "valb" }; - await queueURL.setMetadata(Aborter.none, metadata); + await queueClient.setMetadata(metadata); - const result = await queueURL.getProperties(Aborter.none); + const result = await queueClient.getProperties(); assert.deepEqual(result.metadata, metadata); }); it("getProperties with default/all parameters", async () => { - const result = await queueURL.getProperties(Aborter.none); + const result = await queueClient.getProperties(); assert.ok(result.approximateMessagesCount! >= 0); assert.ok(result.requestId); assert.ok(result.version); @@ -42,53 +41,53 @@ describe("QueueURL", () => { }); it("getPropertis negative", async () => { - const queueName2 = getUniqueName("queue") - const queueURL2 = QueueURL.fromServiceURL(serviceURL, queueName2) + const queueName2 = getUniqueName("queue"); + const queueClient2 = QueueClient.fromQueueServiceClient(queueServiceClient, queueName2); let error; try { - await queueURL2.getProperties(Aborter.none); + await queueClient2.getProperties(); } catch (err) { error = err; } assert.ok(error); assert.ok(error.statusCode); - assert.deepEqual(error.statusCode, 404) - assert.ok(error.response) - assert.ok(error.response.body) - assert.ok(error.response.body.includes("QueueNotFound")) - }) + assert.deepEqual(error.statusCode, 404); + assert.ok(error.response); + assert.ok(error.response.body); + assert.ok(error.response.body.includes("QueueNotFound")); + }); - it("create with default parameters", done => { + it("create with default parameters", (done) => { // create() with default parameters has been tested in beforeEach done(); }); it("create with all parameters", async () => { - const qURL = QueueURL.fromServiceURL(serviceURL, getUniqueName(queueName)); + const qURL = QueueClient.fromQueueServiceClient(queueServiceClient, getUniqueName(queueName)); const metadata = { key: "value" }; - await qURL.create(Aborter.none, { metadata }); - const result = await qURL.getProperties(Aborter.none); + await qURL.create({ metadata }); + const result = await qURL.getProperties(); assert.deepEqual(result.metadata, metadata); }); // create with invalid queue name - it("create negative", async() => { - const qURL = QueueURL.fromServiceURL(serviceURL, ""); + it("create negative", async () => { + const qURL = QueueClient.fromQueueServiceClient(queueServiceClient, ""); let error; try { - await qURL.create(Aborter.none); - } catch(err) { + await qURL.create(); + } catch (err) { error = err; } assert.ok(error); assert.ok(error.statusCode); - assert.deepEqual(error.statusCode, 400) - assert.ok(error.response) - assert.ok(error.response.body) - assert.ok(error.response.body.includes("InvalidResourceName")) + assert.deepEqual(error.statusCode, 400); + assert.ok(error.response); + assert.ok(error.response.body); + assert.ok(error.response.body.includes("InvalidResourceName")); }); - it("delete", done => { + it("delete", (done) => { // delete() with default parameters has been tested in afterEach done(); }); @@ -108,7 +107,7 @@ describe("QueueURL", () => { let error; try { - await queueURL.setAccessPolicy(Aborter.none, queueAcl); + await queueClient.setAccessPolicy(queueAcl); } catch (err) { error = err; } diff --git a/sdk/storage/storage-queue/test/serviceurl.test.ts b/sdk/storage/storage-queue/test/queueserviceclient.spec.ts similarity index 66% rename from sdk/storage/storage-queue/test/serviceurl.test.ts rename to sdk/storage/storage-queue/test/queueserviceclient.spec.ts index 641d256b532a..0d701c55f17b 100644 --- a/sdk/storage/storage-queue/test/serviceurl.test.ts +++ b/sdk/storage/storage-queue/test/queueserviceclient.spec.ts @@ -1,16 +1,15 @@ import * as assert from "assert"; -import { Aborter } from "../src/Aborter"; -import { QueueURL } from "../src/QueueURL"; -import { ServiceURL } from "../src/ServiceURL"; +import { QueueClient } from "../src/QueueClient"; +import { QueueServiceClient } from "../src/QueueServiceClient"; import { getAlternateQSU, getQSU, getUniqueName, wait } from "./utils"; import * as dotenv from "dotenv"; -dotenv.config({path:"../.env"}); +dotenv.config({ path: "../.env" }); -describe("ServiceURL", () => { +describe("QueueServiceClient", () => { it("listQueuesSegment with default parameters", async () => { - const serviceURL = getQSU(); - const result = await serviceURL.listQueuesSegment(Aborter.none); + const queueServiceClient = getQSU(); + const result = await queueServiceClient.listQueuesSegment(); assert.ok(typeof result.requestId); assert.ok(result.requestId!.length > 0); assert.ok(typeof result.version); @@ -26,53 +25,45 @@ describe("ServiceURL", () => { }); it("listQueuesSegment with all parameters", async () => { - const serviceURL = getQSU(); + const queueServiceClient = getQSU(); const queueNamePrefix = getUniqueName("queue"); const queueName1 = `${queueNamePrefix}x1`; const queueName2 = `${queueNamePrefix}x2`; - const queueURL1 = QueueURL.fromServiceURL(serviceURL, queueName1); - const queueURL2 = QueueURL.fromServiceURL(serviceURL, queueName2); - await queueURL1.create(Aborter.none, { metadata: { key: "val" } }); - await queueURL2.create(Aborter.none, { metadata: { key: "val" } }); - - const result1 = await serviceURL.listQueuesSegment( - Aborter.none, - undefined, - { - include: 'metadata', - maxresults: 1, - prefix: queueNamePrefix - } - ); + const queueClient1 = QueueClient.fromQueueServiceClient(queueServiceClient, queueName1); + const queueClient2 = QueueClient.fromQueueServiceClient(queueServiceClient, queueName2); + await queueClient1.create({ metadata: { key: "val" } }); + await queueClient2.create({ metadata: { key: "val" } }); + + const result1 = await queueServiceClient.listQueuesSegment(undefined, { + include: "metadata", + maxresults: 1, + prefix: queueNamePrefix + }); assert.ok(result1.nextMarker); assert.equal(result1.queueItems!.length, 1); assert.ok(result1.queueItems![0].name.startsWith(queueNamePrefix)); assert.deepEqual(result1.queueItems![0].metadata!.key, "val"); - const result2 = await serviceURL.listQueuesSegment( - Aborter.none, - result1.nextMarker, - { - include: 'metadata', - maxresults: 1, - prefix: queueNamePrefix - } - ); + const result2 = await queueServiceClient.listQueuesSegment(result1.nextMarker, { + include: "metadata", + maxresults: 1, + prefix: queueNamePrefix + }); assert.ok(!result2.nextMarker); assert.equal(result2.queueItems!.length, 1); assert.ok(result2.queueItems![0].name.startsWith(queueNamePrefix)); assert.deepEqual(result2.queueItems![0].metadata!.key, "val"); - await queueURL1.delete(Aborter.none); - await queueURL2.delete(Aborter.none); + await queueClient1.delete(); + await queueClient2.delete(); }); it("getProperties with default/all parameters", async () => { - const serviceURL = getQSU(); - const result = await serviceURL.getProperties(Aborter.none); + const queueServiceClient = getQSU(); + const result = await queueServiceClient.getProperties(); assert.ok(typeof result.requestId); assert.ok(result.requestId!.length > 0); @@ -89,9 +80,9 @@ describe("ServiceURL", () => { }); it("setProperties with all parameters", async () => { - const serviceURL = getQSU(); + const queueServiceClient = getQSU(); - const serviceProperties = await serviceURL.getProperties(Aborter.none); + const serviceProperties = await queueServiceClient.getProperties(); serviceProperties.logging = { deleteProperty: true, @@ -137,10 +128,10 @@ describe("ServiceURL", () => { serviceProperties.cors.push(newCORS); } - await serviceURL.setProperties(Aborter.none, serviceProperties); + await queueServiceClient.setProperties(serviceProperties); await wait(5 * 1000); - const result = await serviceURL.getProperties(Aborter.none); + const result = await queueServiceClient.getProperties(); assert.ok(typeof result.requestId); assert.ok(result.requestId!.length > 0); assert.ok(typeof result.version); @@ -148,18 +139,18 @@ describe("ServiceURL", () => { assert.deepEqual(result.hourMetrics, serviceProperties.hourMetrics); }); - it("getStatistics with default/all parameters secondary", done => { - let serviceURL: ServiceURL | undefined; + it("getStatistics with default/all parameters secondary", (done) => { + let queueServiceClient: QueueServiceClient | undefined; try { - serviceURL = getAlternateQSU(); + queueServiceClient = getAlternateQSU(); } catch (err) { done(); return; } - serviceURL! - .getStatistics(Aborter.none) - .then(result => { + queueServiceClient! + .getStatistics() + .then((result) => { assert.ok(result.geoReplication!.lastSyncTime); done(); }) diff --git a/sdk/storage/storage-queue/test/retrypolicy.test.ts b/sdk/storage/storage-queue/test/retrypolicy.spec.ts similarity index 58% rename from sdk/storage/storage-queue/test/retrypolicy.test.ts rename to sdk/storage/storage-queue/test/retrypolicy.spec.ts index c18b99e38caa..636527a50537 100644 --- a/sdk/storage/storage-queue/test/retrypolicy.test.ts +++ b/sdk/storage/storage-queue/test/retrypolicy.spec.ts @@ -1,28 +1,27 @@ import { URLBuilder } from "@azure/ms-rest-js"; import * as assert from "assert"; -import { RestError, StorageURL } from "../src"; -import { Aborter } from "../src/Aborter"; -import { QueueURL } from "../src/QueueURL"; +import { RestError, StorageClient } from "../src"; +import { QueueClient } from "../src/QueueClient"; import { Pipeline } from "../src/Pipeline"; import { getQSU, getUniqueName } from "./utils"; import { InjectorPolicyFactory } from "./utils/InjectorPolicyFactory"; import * as dotenv from "dotenv"; -dotenv.config({path:"../.env"}); +dotenv.config({ path: "../.env" }); describe("RetryPolicy", () => { - const serviceURL = getQSU(); + const queueServiceClient = getQSU(); let queueName: string = getUniqueName("queue"); - let queueURL = QueueURL.fromServiceURL(serviceURL, queueName); + let queueClient = QueueClient.fromQueueServiceClient(queueServiceClient, queueName); beforeEach(async () => { queueName = getUniqueName("queue"); - queueURL = QueueURL.fromServiceURL(serviceURL, queueName); - await queueURL.create(Aborter.none); + queueClient = QueueClient.fromQueueServiceClient(queueServiceClient, queueName); + await queueClient.create(); }); afterEach(async () => { - await queueURL.delete(Aborter.none); + await queueClient.delete(); }); it("Retry policy should work when first request fails with 500", async () => { @@ -30,26 +29,22 @@ describe("RetryPolicy", () => { const injector = new InjectorPolicyFactory(() => { if (injectCounter === 0) { injectCounter++; - return new RestError( - "Server Internal Error", - "ServerInternalError", - 500 - ); + return new RestError("Server Internal Error", "ServerInternalError", 500); } }); - const factories = queueURL.pipeline.factories.slice(); // clone factories array + const factories = queueClient.pipeline.factories.slice(); // clone factories array factories.push(injector); const pipeline = new Pipeline(factories); - const injectqueueURL = queueURL.withPipeline(pipeline); + const injectqueueClient = queueClient.withPipeline(pipeline); const metadata = { key0: "val0", keya: "vala", keyb: "valb" }; - await injectqueueURL.setMetadata(Aborter.none, metadata); + await injectqueueClient.setMetadata(metadata); - const result = await queueURL.getProperties(Aborter.none); + const result = await queueClient.getProperties(); assert.deepEqual(result.metadata, metadata); }); @@ -58,16 +53,13 @@ describe("RetryPolicy", () => { return new RestError("Server Internal Error", "ServerInternalError", 500); }); - const credential = - queueURL.pipeline.factories[ - queueURL.pipeline.factories.length - 1 - ]; - const factories = StorageURL.newPipeline(credential, { + const credential = queueClient.pipeline.factories[queueClient.pipeline.factories.length - 1]; + const factories = StorageClient.newPipeline(credential, { retryOptions: { maxTries: 3 } }).factories; factories.push(injector); const pipeline = new Pipeline(factories); - const injectqueueURL = queueURL.withPipeline(pipeline); + const injectqueueClient = queueClient.withPipeline(pipeline); let hasError = false; try { @@ -76,7 +68,7 @@ describe("RetryPolicy", () => { keya: "vala", keyb: "valb" }; - await injectqueueURL.setMetadata(Aborter.none, metadata); + await injectqueueClient.setMetadata(metadata); } catch (err) { hasError = true; } @@ -87,15 +79,11 @@ describe("RetryPolicy", () => { let injectCounter = 0; const injector = new InjectorPolicyFactory(() => { if (injectCounter++ < 1) { - return new RestError( - "Server Internal Error", - "ServerInternalError", - 500 - ); + return new RestError("Server Internal Error", "ServerInternalError", 500); } }); - const url = serviceURL.url; + const url = queueServiceClient.url; const urlParsed = URLBuilder.parse(url); const host = urlParsed.getHost()!; const hostParts = host.split("."); @@ -104,28 +92,22 @@ describe("RetryPolicy", () => { hostParts.unshift(secondaryAccount); const secondaryHost = hostParts.join("."); - const credential = - queueURL.pipeline.factories[ - queueURL.pipeline.factories.length - 1 - ]; - const factories = StorageURL.newPipeline(credential, { + const credential = queueClient.pipeline.factories[queueClient.pipeline.factories.length - 1]; + const factories = StorageClient.newPipeline(credential, { retryOptions: { maxTries: 2, secondaryHost } }).factories; factories.push(injector); const pipeline = new Pipeline(factories); - const injectqueueURL = queueURL.withPipeline(pipeline); + const injectqueueClient = queueClient.withPipeline(pipeline); let finalRequestURL = ""; try { - const response = await injectqueueURL.getProperties(Aborter.none); + const response = await injectqueueClient.getProperties(); finalRequestURL = response._response.request.url; } catch (err) { finalRequestURL = err.request ? err.request.url : ""; } - assert.deepStrictEqual( - URLBuilder.parse(finalRequestURL).getHost(), - secondaryHost - ); + assert.deepStrictEqual(URLBuilder.parse(finalRequestURL).getHost(), secondaryHost); }); }); diff --git a/sdk/storage/storage-queue/test/utils/InjectorPolicy.ts b/sdk/storage/storage-queue/test/utils/InjectorPolicy.ts index 07f566a7acc5..735225b3334c 100644 --- a/sdk/storage/storage-queue/test/utils/InjectorPolicy.ts +++ b/sdk/storage/storage-queue/test/utils/InjectorPolicy.ts @@ -1,58 +1,51 @@ import { - BaseRequestPolicy, - HttpOperationResponse, - RequestPolicy, - RequestPolicyOptions, - WebResource, - RestError - } from "../../src"; - - export interface INextInjectErrorHolder { - nextInjectError?: RestError; + BaseRequestPolicy, + HttpOperationResponse, + RequestPolicy, + RequestPolicyOptions, + WebResource, + RestError +} from "../../src"; + +export interface NextInjectErrorHolder { + nextInjectError?: RestError; +} + +export type Injector = () => RestError | undefined; + +/** + * InjectorPolicy will inject a customized error before next HTTP request. + * + * @class InjectorPolicy + * @extends {BaseRequestPolicy} + */ +export class InjectorPolicy extends BaseRequestPolicy { + /** + * Creates an instance of InjectorPolicy. + * + * @param {RequestPolicy} nextPolicy + * @param {RequestPolicyOptions} options + * @memberof InjectorPolicy + */ + public constructor(nextPolicy: RequestPolicy, options: RequestPolicyOptions, injector: Injector) { + super(nextPolicy, options); + this.injector = injector; } - - export type Injector = () => RestError | undefined; - + /** - * InjectorPolicy will inject a customized error before next HTTP request. + * Sends request. * - * @class InjectorPolicy - * @extends {BaseRequestPolicy} + * @param {WebResource} request + * @returns {Promise} + * @memberof InjectorPolicy */ - export class InjectorPolicy extends BaseRequestPolicy { - /** - * Creates an instance of InjectorPolicy. - * - * @param {RequestPolicy} nextPolicy - * @param {RequestPolicyOptions} options - * @memberof InjectorPolicy - */ - public constructor( - nextPolicy: RequestPolicy, - options: RequestPolicyOptions, - injector: Injector - ) { - super(nextPolicy, options); - this.injector = injector; - } - - /** - * Sends request. - * - * @param {WebResource} request - * @returns {Promise} - * @memberof InjectorPolicy - */ - public async sendRequest( - request: WebResource - ): Promise { - const error = this.injector(); - if (error) { - throw error; - } - return this._nextPolicy.sendRequest(request); + public async sendRequest(request: WebResource): Promise { + const error = this.injector(); + if (error) { + throw error; } - - private injector: Injector; + return this._nextPolicy.sendRequest(request); } - \ No newline at end of file + + private injector: Injector; +} diff --git a/sdk/storage/storage-queue/test/utils/InjectorPolicyFactory.ts b/sdk/storage/storage-queue/test/utils/InjectorPolicyFactory.ts index f2eab351b18d..73ca1749b535 100644 --- a/sdk/storage/storage-queue/test/utils/InjectorPolicyFactory.ts +++ b/sdk/storage/storage-queue/test/utils/InjectorPolicyFactory.ts @@ -1,29 +1,21 @@ -import { - RequestPolicy, - RequestPolicyFactory, - RequestPolicyOptions - } from "../../src"; - import { InjectorPolicy, Injector } from "./InjectorPolicy"; - - /** - * InjectorPolicyFactory is a factory class injects customized errors for retry policy testing. - * - * @export - * @class InjectorPolicyFactory - * @implements {RequestPolicyFactory} - */ - export class InjectorPolicyFactory implements RequestPolicyFactory { - public readonly injector: Injector; - - public constructor(injector: Injector) { - this.injector = injector; - } - - public create( - nextPolicy: RequestPolicy, - options: RequestPolicyOptions - ): InjectorPolicy { - return new InjectorPolicy(nextPolicy, options, this.injector); - } +import { RequestPolicy, RequestPolicyFactory, RequestPolicyOptions } from "../../src"; +import { InjectorPolicy, Injector } from "./InjectorPolicy"; + +/** + * InjectorPolicyFactory is a factory class injects customized errors for retry policy testing. + * + * @export + * @class InjectorPolicyFactory + * @implements {RequestPolicyFactory} + */ +export class InjectorPolicyFactory implements RequestPolicyFactory { + public readonly injector: Injector; + + public constructor(injector: Injector) { + this.injector = injector; } - \ No newline at end of file + + public create(nextPolicy: RequestPolicy, options: RequestPolicyOptions): InjectorPolicy { + return new InjectorPolicy(nextPolicy, options, this.injector); + } +} diff --git a/sdk/storage/storage-queue/test/utils/index.browser.ts b/sdk/storage/storage-queue/test/utils/index.browser.ts index f9cf1aa051f3..352592ed50c6 100644 --- a/sdk/storage/storage-queue/test/utils/index.browser.ts +++ b/sdk/storage/storage-queue/test/utils/index.browser.ts @@ -1,13 +1,13 @@ import { AnonymousCredential } from "../../src/credentials/AnonymousCredential"; -import { ServiceURL } from "../../src/ServiceURL"; -import { StorageURL } from "../../src/StorageURL"; +import { QueueServiceClient } from "../../src/QueueServiceClient"; +import { StorageClient } from "../../src/StorageClient"; export * from "./testutils.common"; export function getGenericQSU( accountType: string, accountNameSuffix: string = "" -): ServiceURL { +): QueueServiceClient { const accountNameEnvVar = `${accountType}ACCOUNT_NAME`; const accountSASEnvVar = `${accountType}ACCOUNT_SAS`; @@ -27,19 +27,19 @@ export function getGenericQSU( } const credentials = new AnonymousCredential(); - const pipeline = StorageURL.newPipeline(credentials, { + const pipeline = StorageClient.newPipeline(credentials, { // Enable logger when debugging // logger: new ConsoleHttpPipelineLogger(HttpPipelineLogLevel.INFO) }); const filePrimaryURL = `https://${accountName}${accountNameSuffix}.queue.core.windows.net${accountSAS}`; - return new ServiceURL(filePrimaryURL, pipeline); + return new QueueServiceClient(filePrimaryURL, pipeline); } -export function getQSU(): ServiceURL { +export function getQSU(): QueueServiceClient { return getGenericQSU(""); } -export function getAlternateQSU(): ServiceURL { +export function getAlternateQSU(): QueueServiceClient { return getGenericQSU("SECONDARY_", "-secondary"); } @@ -84,10 +84,7 @@ export async function blobToArrayBuffer(blob: Blob): Promise { }); } -export function arrayBufferEqual( - buf1: ArrayBuffer, - buf2: ArrayBuffer -): boolean { +export function arrayBufferEqual(buf1: ArrayBuffer, buf2: ArrayBuffer): boolean { if (buf1.byteLength !== buf2.byteLength) { return false; } diff --git a/sdk/storage/storage-queue/test/utils/index.ts b/sdk/storage/storage-queue/test/utils/index.ts index 69a10ea21650..c9bac111649d 100644 --- a/sdk/storage/storage-queue/test/utils/index.ts +++ b/sdk/storage/storage-queue/test/utils/index.ts @@ -1,6 +1,6 @@ import { SharedKeyCredential } from "../../src/credentials/SharedKeyCredential"; -import { ServiceURL } from "../../src/ServiceURL"; -import { StorageURL } from "../../src/StorageURL"; +import { QueueServiceClient } from "../../src/QueueServiceClient"; +import { StorageClient } from "../../src/StorageClient"; // Uncomment if need to enable logger when debugging // import {HttpPipelineLogLevel} from "../../src" // import {ConsoleHttpPipelineLogger} from "./testutils.common" @@ -10,7 +10,7 @@ export * from "./testutils.common"; export function getGenericQSU( accountType: string, accountNameSuffix: string = "" -): ServiceURL { +): QueueServiceClient { const accountNameEnvVar = `${accountType}ACCOUNT_NAME`; const accountKeyEnvVar = `${accountType}ACCOUNT_KEY`; @@ -27,18 +27,18 @@ export function getGenericQSU( } const credentials = new SharedKeyCredential(accountName, accountKey); - const pipeline = StorageURL.newPipeline(credentials, { + const pipeline = StorageClient.newPipeline(credentials, { // Enable logger when debugging // logger: new ConsoleHttpPipelineLogger(HttpPipelineLogLevel.INFO) }); const queuePrimaryURL = `https://${accountName}${accountNameSuffix}.queue.core.windows.net/`; - return new ServiceURL(queuePrimaryURL, pipeline); + return new QueueServiceClient(queuePrimaryURL, pipeline); } -export function getQSU(): ServiceURL { +export function getQSU(): QueueServiceClient { return getGenericQSU(""); } -export function getAlternateQSU(): ServiceURL { +export function getAlternateQSU(): QueueServiceClient { return getGenericQSU("SECONDARY_", "-secondary"); } diff --git a/sdk/storage/storage-queue/test/utils/testutils.common.ts b/sdk/storage/storage-queue/test/utils/testutils.common.ts index 4ec999c08633..de4d969696c9 100644 --- a/sdk/storage/storage-queue/test/utils/testutils.common.ts +++ b/sdk/storage/storage-queue/test/utils/testutils.common.ts @@ -14,7 +14,7 @@ export function getUniqueName(prefix: string): string { } export async function sleep(time: number): Promise { - return new Promise(resolve => { + return new Promise((resolve) => { setTimeout(resolve, time); }); } @@ -24,17 +24,13 @@ export function base64encode(content: string): string { } export function base64decode(encodedString: string): string { - return isBrowser() - ? atob(encodedString) - : Buffer.from(encodedString, "base64").toString(); + return isBrowser() ? atob(encodedString) : Buffer.from(encodedString, "base64").toString(); } export class ConsoleHttpPipelineLogger implements IHttpPipelineLogger { constructor(public minimumLogLevel: HttpPipelineLogLevel) {} public log(logLevel: HttpPipelineLogLevel, message: string): void { - const logMessage = `${new Date().toISOString()} ${ - HttpPipelineLogLevel[logLevel] - }: ${message}`; + const logMessage = `${new Date().toISOString()} ${HttpPipelineLogLevel[logLevel]}: ${message}`; switch (logLevel) { case HttpPipelineLogLevel.ERROR: // tslint:disable-next-line:no-console @@ -53,7 +49,7 @@ export class ConsoleHttpPipelineLogger implements IHttpPipelineLogger { } export async function wait(time: number): Promise { - return new Promise(resolve => { + return new Promise((resolve) => { setTimeout(resolve, time); }); } diff --git a/sdk/storage/storage-queue/tsconfig.json b/sdk/storage/storage-queue/tsconfig.json index 61885eb2e18c..e271ee388662 100644 --- a/sdk/storage/storage-queue/tsconfig.json +++ b/sdk/storage/storage-queue/tsconfig.json @@ -22,4 +22,4 @@ "compileOnSave": true, "exclude": ["node_modules", "./samples/*"], "include": ["./src/**/*.ts", "./test/**/*.ts"] -} \ No newline at end of file +} diff --git a/sdk/storage/storage-queue/tslint.json b/sdk/storage/storage-queue/tslint.json index ae2eb09109a7..498d029bd134 100644 --- a/sdk/storage/storage-queue/tslint.json +++ b/sdk/storage/storage-queue/tslint.json @@ -4,7 +4,8 @@ "jsRules": {}, "rules": { "trailing-comma": false, - "arrow-parens": false + "arrow-parens": false, + "interface-name": [true, "never-prefix"] }, "rulesDirectory": [], "linterOptions": {