diff --git a/common/config/rush/pnpm-lock.yaml b/common/config/rush/pnpm-lock.yaml index d58eb67f1035..667f4ec6af5f 100644 --- a/common/config/rush/pnpm-lock.yaml +++ b/common/config/rush/pnpm-lock.yaml @@ -43,6 +43,7 @@ specifiers: '@rush-temp/arm-customerinsights': file:./projects/arm-customerinsights.tgz '@rush-temp/arm-databox': file:./projects/arm-databox.tgz '@rush-temp/arm-databoxedge': file:./projects/arm-databoxedge.tgz + '@rush-temp/arm-databoxedge-profile-2020-09-01-hybrid': file:./projects/arm-databoxedge-profile-2020-09-01-hybrid.tgz '@rush-temp/arm-databricks': file:./projects/arm-databricks.tgz '@rush-temp/arm-datacatalog': file:./projects/arm-datacatalog.tgz '@rush-temp/arm-datadog': file:./projects/arm-datadog.tgz @@ -312,6 +313,7 @@ dependencies: '@rush-temp/arm-customerinsights': file:projects/arm-customerinsights.tgz '@rush-temp/arm-databox': file:projects/arm-databox.tgz '@rush-temp/arm-databoxedge': file:projects/arm-databoxedge.tgz + '@rush-temp/arm-databoxedge-profile-2020-09-01-hybrid': file:projects/arm-databoxedge-profile-2020-09-01-hybrid.tgz '@rush-temp/arm-databricks': file:projects/arm-databricks.tgz '@rush-temp/arm-datacatalog': file:projects/arm-datacatalog.tgz '@rush-temp/arm-datadog': file:projects/arm-datadog.tgz @@ -9964,6 +9966,34 @@ packages: - supports-color dev: false + file:projects/arm-databoxedge-profile-2020-09-01-hybrid.tgz: + resolution: {integrity: sha512-IjX+dn/e+mrxCfhpuvksYnBK1ydo3yRncMSM2UnvcIhyQi8Y3G5gCAnFpT24vZrI1f3ZBv2/glA3e5RH58Dybg==, tarball: file:projects/arm-databoxedge-profile-2020-09-01-hybrid.tgz} + name: '@rush-temp/arm-databoxedge-profile-2020-09-01-hybrid' + version: 0.0.0 + dependencies: + '@azure-tools/test-recorder': 1.0.2 + '@azure/identity': 2.0.4 + '@microsoft/api-extractor': 7.19.4 + '@rollup/plugin-commonjs': 21.0.2_rollup@2.70.0 + '@rollup/plugin-json': 4.1.0_rollup@2.70.0 + '@rollup/plugin-multi-entry': 4.1.0_rollup@2.70.0 + '@rollup/plugin-node-resolve': 13.1.3_rollup@2.70.0 + cross-env: 7.0.3 + mkdirp: 1.0.4 + mocha: 7.2.0 + rimraf: 3.0.2 + rollup: 2.70.0 + rollup-plugin-sourcemaps: 0.6.3_rollup@2.70.0 + tslib: 2.3.1 + typescript: 4.2.4 + uglify-js: 3.15.2 + transitivePeerDependencies: + - '@types/node' + - debug + - encoding + - supports-color + dev: false + file:projects/arm-databoxedge.tgz: resolution: {integrity: sha512-kNfcboC76r1zKltjFmM5Azjf/Zd1gfFXXCzZFfI3pjNMaNo0p2BVNLS5nC6fRIGdI2Rd2E16cQ7zf+SjtnDA2A==, tarball: file:projects/arm-databoxedge.tgz} name: '@rush-temp/arm-databoxedge' diff --git a/eng/ignore-links.txt b/eng/ignore-links.txt index 2e6bdfaa5182..6478e7662cf0 100644 --- a/eng/ignore-links.txt +++ b/eng/ignore-links.txt @@ -25,3 +25,4 @@ https://docs.microsoft.com/javascript/api/@azure/arm-eventhub-profile-2020-09-01 https://docs.microsoft.com/javascript/api/@azure/arm-authorization-profile-2020-09-01-hybrid https://docs.microsoft.com/javascript/api/@azure/arm-iothub-profile-2020-09-01-hybrid?view=azure-node-preview https://docs.microsoft.com/javascript/api/@azure/arm-monitor-profile-2020-09-01-hybrid?view=azure-node-preview +https://docs.microsoft.com/javascript/api/@azure/arm-databoxedge-profile-2020-09-01-hybrid diff --git a/rush.json b/rush.json index e10d5aa37e79..3017f954082f 100644 --- a/rush.json +++ b/rush.json @@ -1654,6 +1654,11 @@ "packageName": "@azure/arm-iothub-profile-2020-09-01-hybrid", "projectFolder": "sdk/iothub/arm-iothub-profile-2020-09-01-hybrid", "versionPolicyName": "management" + }, + { + "packageName": "@azure/arm-databoxedge-profile-2020-09-01-hybrid", + "projectFolder": "sdk/databoxedge/arm-databoxedge-profile-2020-09-01-hybrid", + "versionPolicyName": "management" } ] } diff --git a/sdk/databoxedge/arm-databoxedge-profile-2020-09-01-hybrid/CHANGELOG.md b/sdk/databoxedge/arm-databoxedge-profile-2020-09-01-hybrid/CHANGELOG.md new file mode 100644 index 000000000000..a24a246a3ca4 --- /dev/null +++ b/sdk/databoxedge/arm-databoxedge-profile-2020-09-01-hybrid/CHANGELOG.md @@ -0,0 +1,11 @@ +# Release History + +## 2.0.0 (2022-03-11) + +The package of @azure/arm-databoxedge-profile-2020-09-01-hybrid is using our next generation design principles since version 2.0.0, which contains breaking changes. + +To understand the detail of the change, please refer to [Changelog](https://aka.ms/js-track2-changelog). + +To migrate the existing applications to the latest version, please refer to [Migration Guide](https://aka.ms/js-track2-migration-guide). + +To learn more, please refer to our documentation [Quick Start](https://aka.ms/js-track2-quickstart). diff --git a/sdk/databoxedge/arm-databoxedge-profile-2020-09-01-hybrid/LICENSE b/sdk/databoxedge/arm-databoxedge-profile-2020-09-01-hybrid/LICENSE new file mode 100644 index 000000000000..5d1d36e0af80 --- /dev/null +++ b/sdk/databoxedge/arm-databoxedge-profile-2020-09-01-hybrid/LICENSE @@ -0,0 +1,21 @@ +The MIT License (MIT) + +Copyright (c) 2022 Microsoft + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. \ No newline at end of file diff --git a/sdk/databoxedge/arm-databoxedge-profile-2020-09-01-hybrid/README.md b/sdk/databoxedge/arm-databoxedge-profile-2020-09-01-hybrid/README.md index ce1d3af84c2d..0c57da900302 100644 --- a/sdk/databoxedge/arm-databoxedge-profile-2020-09-01-hybrid/README.md +++ b/sdk/databoxedge/arm-databoxedge-profile-2020-09-01-hybrid/README.md @@ -1,109 +1,109 @@ -## Azure DataBoxEdgeManagementClient SDK for JavaScript +# Azure DataBoxEdgeManagement client library for JavaScript -This package contains an isomorphic SDK (runs both in Node.js and in browsers) for DataBoxEdgeManagementClient. +This package contains an isomorphic SDK (runs both in Node.js and in browsers) for Azure DataBoxEdgeManagement client. + + + +[Source code](https://github.com/Azure/azure-sdk-for-js/tree/main/sdk/databoxedge/arm-databoxedge-profile-2020-09-01-hybrid) | +[Package (NPM)](https://www.npmjs.com/package/@azure/arm-databoxedge-profile-2020-09-01-hybrid) | +[API reference documentation](https://docs.microsoft.com/javascript/api/@azure/arm-databoxedge-profile-2020-09-01-hybrid) | +[Samples](https://github.com/Azure-Samples/azure-samples-js-management) + +## Getting started ### Currently supported environments - [LTS versions of Node.js](https://nodejs.org/about/releases/) -- Latest versions of Safari, Chrome, Edge, and Firefox. +- Latest versions of Safari, Chrome, Edge and Firefox. + +See our [support policy](https://github.com/Azure/azure-sdk-for-js/blob/main/SUPPORT.md) for more details. ### Prerequisites -You must have an [Azure subscription](https://azure.microsoft.com/free/). +- An [Azure subscription][azure_sub]. -### How to install +### Install the `@azure/arm-databoxedge-profile-2020-09-01-hybrid` package -To use this SDK in your project, you will need to install two packages. -- `@azure/arm-databoxedge-profile-2020-09-01-hybrid` that contains the client. -- `@azure/identity` that provides different mechanisms for the client to authenticate your requests using Azure Active Directory. +Install the Azure DataBoxEdgeManagement client library for JavaScript with `npm`: -Install both packages using the below command: ```bash -npm install --save @azure/arm-databoxedge-profile-2020-09-01-hybrid @azure/identity +npm install @azure/arm-databoxedge-profile-2020-09-01-hybrid ``` -> **Note**: You may have used either `@azure/ms-rest-nodeauth` or `@azure/ms-rest-browserauth` in the past. These packages are in maintenance mode receiving critical bug fixes, but no new features. -If you are on a [Node.js that has LTS status](https://nodejs.org/about/releases/), or are writing a client side browser application, we strongly encourage you to upgrade to `@azure/identity` which uses the latest versions of Azure Active Directory and MSAL APIs and provides more authentication options. +### Create and authenticate a `DataBoxEdgeManagementClient` + +To create a client object to access the Azure DataBoxEdgeManagement API, you will need the `endpoint` of your Azure DataBoxEdgeManagement resource and a `credential`. The Azure DataBoxEdgeManagement client can use Azure Active Directory credentials to authenticate. +You can find the endpoint for your Azure DataBoxEdgeManagement resource in the [Azure Portal][azure_portal]. -### How to use +You can authenticate with Azure Active Directory using a credential from the [@azure/identity][azure_identity] library or [an existing AAD Token](https://github.com/Azure/azure-sdk-for-js/blob/master/sdk/identity/identity/samples/AzureIdentityExamples.md#authenticating-with-a-pre-fetched-access-token). -- If you are writing a client side browser application, - - Follow the instructions in the section on Authenticating client side browser applications in [Azure Identity examples](https://aka.ms/azsdk/js/identity/examples) to register your application in the Microsoft identity platform and set the right permissions. - - Copy the client ID and tenant ID from the Overview section of your app registration in Azure portal and use it in the browser sample below. -- If you are writing a server side application, - - [Select a credential from `@azure/identity` based on the authentication method of your choice](https://aka.ms/azsdk/js/identity/examples) - - Complete the set up steps required by the credential if any. - - Use the credential you picked in the place of `DefaultAzureCredential` in the Node.js sample below. +To use the [DefaultAzureCredential][defaultazurecredential] provider shown below, or other credential providers provided with the Azure SDK, please install the `@azure/identity` package: -In the below samples, we pass the credential and the Azure subscription id to instantiate the client. -Once the client is created, explore the operations on it either in your favorite editor or in our [API reference documentation](https://docs.microsoft.com/javascript/api) to get started. +```bash +npm install @azure/identity +``` -#### nodejs - Authentication, client creation, and list operations as an example written in JavaScript. +You will also need to **register a new AAD application and grant access to Azure DataBoxEdgeManagement** by assigning the suitable role to your service principal (note: roles such as `"Owner"` will not grant the necessary permissions). +Set the values of the client ID, tenant ID, and client secret of the AAD application as environment variables: `AZURE_CLIENT_ID`, `AZURE_TENANT_ID`, `AZURE_CLIENT_SECRET`. -##### Sample code +For more information about how to create an Azure AD Application check out [this guide](https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal). ```javascript -const { DefaultAzureCredential } = require("@azure/identity"); const { DataBoxEdgeManagementClient } = require("@azure/arm-databoxedge-profile-2020-09-01-hybrid"); -const subscriptionId = process.env["AZURE_SUBSCRIPTION_ID"]; - -// Use `DefaultAzureCredential` or any other credential of your choice based on https://aka.ms/azsdk/js/identity/examples -// Please note that you can also use credentials from the `@azure/ms-rest-nodeauth` package instead. -const creds = new DefaultAzureCredential(); -const client = new DataBoxEdgeManagementClient(creds, subscriptionId); - -client.operations.list().then((result) => { - console.log("The result is:"); - console.log(result); -}).catch((err) => { - console.log("An error occurred:"); - console.error(err); -}); +const { DefaultAzureCredential } = require("@azure/identity"); +// For client-side applications running in the browser, use InteractiveBrowserCredential instead of DefaultAzureCredential. See https://aka.ms/azsdk/js/identity/examples for more details. + +const subscriptionId = "00000000-0000-0000-0000-000000000000"; +const client = new DataBoxEdgeManagementClient(new DefaultAzureCredential(), subscriptionId); + +// For client-side applications running in the browser, use this code instead: +// const credential = new InteractiveBrowserCredential({ +// tenantId: "", +// clientId: "" +// }); +// const client = new DataBoxEdgeManagementClient(credential, subscriptionId); ``` -#### browser - Authentication, client creation, and list operations as an example written in JavaScript. - -In browser applications, we recommend using the `InteractiveBrowserCredential` that interactively authenticates using the default system browser. - - See [Single-page application: App registration guide](https://docs.microsoft.com/azure/active-directory/develop/scenario-spa-app-registration) to configure your app registration for the browser. - - Note down the client Id from the previous step and use it in the browser sample below. - -##### Sample code - -- index.html - -```html - - - - @azure/arm-databoxedge-profile-2020-09-01-hybrid sample - - - - - - - + +### JavaScript Bundle +To use this client library in the browser, first you need to use a bundler. For details on how to do this, please refer to our [bundling documentation](https://aka.ms/AzureSDKBundling). + +## Key concepts + +### DataBoxEdgeManagementClient + +`DataBoxEdgeManagementClient` is the primary interface for developers using the Azure DataBoxEdgeManagement client library. Explore the methods on this client object to understand the different features of the Azure DataBoxEdgeManagement service that you can access. + +## Troubleshooting + +### Logging + +Enabling logging may help uncover useful information about failures. In order to see a log of HTTP requests and responses, set the `AZURE_LOG_LEVEL` environment variable to `info`. Alternatively, logging can be enabled at runtime by calling `setLogLevel` in the `@azure/logger`: + +```javascript +const { setLogLevel } = require("@azure/logger"); +setLogLevel("info"); ``` +For more detailed instructions on how to enable logs, you can look at the [@azure/logger package docs](https://github.com/Azure/azure-sdk-for-js/tree/main/sdk/core/logger). + +## Next steps + +Please take a look at the [samples](https://github.com/Azure-Samples/azure-samples-js-management) directory for detailed examples on how to use this library. + +## Contributing + +If you'd like to contribute to this library, please read the [contributing guide](https://github.com/Azure/azure-sdk-for-js/blob/main/CONTRIBUTING.md) to learn more about how to build and test the code. + ## Related projects -- [Microsoft Azure SDK for Javascript](https://github.com/Azure/azure-sdk-for-js) +- [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%2Fsdk%2Fdataboxedge%2Farm-databoxedge-profile-2020-09-01-hybrid%2FREADME.png) -![Impressions](https://azure-sdk-impressions.azurewebsites.net/api/impressions/azure-sdk-for-js/sdk/databoxedge/arm-databoxedge-profile-2020-09-01-hybrid/README.png) +[azure_cli]: https://docs.microsoft.com/cli/azure +[azure_sub]: https://azure.microsoft.com/free/ +[azure_sub]: https://azure.microsoft.com/free/ +[azure_portal]: https://portal.azure.com +[azure_identity]: https://github.com/Azure/azure-sdk-for-js/tree/main/sdk/identity/identity +[defaultazurecredential]: https://github.com/Azure/azure-sdk-for-js/tree/main/sdk/identity/identity#defaultazurecredential diff --git a/sdk/databoxedge/arm-databoxedge-profile-2020-09-01-hybrid/_meta.json b/sdk/databoxedge/arm-databoxedge-profile-2020-09-01-hybrid/_meta.json new file mode 100644 index 000000000000..cccc48df7b6b --- /dev/null +++ b/sdk/databoxedge/arm-databoxedge-profile-2020-09-01-hybrid/_meta.json @@ -0,0 +1,8 @@ +{ + "commit": "1067b78669466324a1a2666adf053433c61e7f77", + "readme": "specification/databoxedge/resource-manager/readme.md", + "autorest_command": "autorest --version=3.7.3 --typescript --modelerfour.lenient-model-deduplication --head-as-boolean=true --license-header=MICROSOFT_MIT_NO_VERSION --generate-test --typescript-sdks-folder=D:\\mydev\\azure-sdk-for-js ..\\azure-rest-api-specs\\specification\\databoxedge\\resource-manager\\readme.md --use=@autorest/typescript@6.0.0-beta.16 --tag=profile-hybrid-2020-09-01 --profile-content=profile-hybrid-2020-09-01", + "repository_url": "https://github.com/Azure/azure-rest-api-specs.git", + "release_tool": "@azure-tools/js-sdk-release-tools@2.1.1", + "use": "@autorest/typescript@6.0.0-beta.16" +} \ No newline at end of file diff --git a/sdk/databoxedge/arm-databoxedge-profile-2020-09-01-hybrid/api-extractor.json b/sdk/databoxedge/arm-databoxedge-profile-2020-09-01-hybrid/api-extractor.json new file mode 100644 index 000000000000..c1c32dd2ba98 --- /dev/null +++ b/sdk/databoxedge/arm-databoxedge-profile-2020-09-01-hybrid/api-extractor.json @@ -0,0 +1,31 @@ +{ + "$schema": "https://developer.microsoft.com/json-schemas/api-extractor/v7/api-extractor.schema.json", + "mainEntryPointFilePath": "./dist-esm/src/index.d.ts", + "docModel": { + "enabled": true + }, + "apiReport": { + "enabled": true, + "reportFolder": "./review" + }, + "dtsRollup": { + "enabled": true, + "untrimmedFilePath": "", + "publicTrimmedFilePath": "./types/arm-databoxedge-profile-2020-09-01-hybrid.d.ts" + }, + "messages": { + "tsdocMessageReporting": { + "default": { + "logLevel": "none" + } + }, + "extractorMessageReporting": { + "ae-missing-release-tag": { + "logLevel": "none" + }, + "ae-unresolved-link": { + "logLevel": "none" + } + } + } +} \ No newline at end of file diff --git a/sdk/databoxedge/arm-databoxedge-profile-2020-09-01-hybrid/package.json b/sdk/databoxedge/arm-databoxedge-profile-2020-09-01-hybrid/package.json index ab84c75a50f7..2ca11cf42165 100644 --- a/sdk/databoxedge/arm-databoxedge-profile-2020-09-01-hybrid/package.json +++ b/sdk/databoxedge/arm-databoxedge-profile-2020-09-01-hybrid/package.json @@ -1,13 +1,20 @@ { "name": "@azure/arm-databoxedge-profile-2020-09-01-hybrid", + "sdk-type": "mgmt", "author": "Microsoft Corporation", - "description": "DataBoxEdgeManagementClient Library with typescript type definitions for node.js and browser.", - "version": "1.1.0", + "description": "A generated SDK for DataBoxEdgeManagementClient.", + "version": "2.0.0", + "engines": { + "node": ">=12.0.0" + }, "dependencies": { - "@azure/ms-rest-azure-js": "^2.1.0", - "@azure/ms-rest-js": "^2.2.0", - "@azure/core-auth": "^1.1.4", - "tslib": "^1.10.0" + "@azure/core-lro": "^2.2.0", + "@azure/abort-controller": "^1.0.0", + "@azure/core-paging": "^1.2.0", + "@azure/core-client": "^1.0.0", + "@azure/core-auth": "^1.3.0", + "@azure/core-rest-pipeline": "^1.1.0", + "tslib": "^2.2.0" }, "keywords": [ "node", @@ -17,15 +24,25 @@ "isomorphic" ], "license": "MIT", - "main": "./dist/arm-databoxedge-profile-2020-09-01-hybrid.js", - "module": "./esm/dataBoxEdgeManagementClient.js", - "types": "./esm/dataBoxEdgeManagementClient.d.ts", + "main": "./dist/index.js", + "module": "./dist-esm/src/index.js", + "types": "./types/arm-databoxedge-profile-2020-09-01-hybrid.d.ts", "devDependencies": { - "typescript": "^3.6.0", - "rollup": "^1.18.0", - "rollup-plugin-node-resolve": "^5.2.0", - "rollup-plugin-sourcemaps": "^0.4.2", - "uglify-js": "^3.6.0" + "@microsoft/api-extractor": "^7.18.11", + "@rollup/plugin-commonjs": "^21.0.1", + "@rollup/plugin-json": "^4.1.0", + "@rollup/plugin-multi-entry": "^4.1.0", + "@rollup/plugin-node-resolve": "^13.1.3", + "mkdirp": "^1.0.4", + "rollup": "^2.66.1", + "rollup-plugin-sourcemaps": "^0.6.3", + "typescript": "~4.2.0", + "uglify-js": "^3.4.9", + "rimraf": "^3.0.0", + "@azure/identity": "^2.0.1", + "@azure-tools/test-recorder": "^1.0.0", + "mocha": "^7.1.1", + "cross-env": "^7.0.2" }, "homepage": "https://github.com/Azure/azure-sdk-for-js/tree/main/sdk/databoxedge/arm-databoxedge-profile-2020-09-01-hybrid", "repository": { @@ -40,20 +57,54 @@ "dist/**/*.js.map", "dist/**/*.d.ts", "dist/**/*.d.ts.map", - "esm/**/*.js", - "esm/**/*.js.map", - "esm/**/*.d.ts", - "esm/**/*.d.ts.map", + "dist-esm/**/*.js", + "dist-esm/**/*.js.map", + "dist-esm/**/*.d.ts", + "dist-esm/**/*.d.ts.map", "src/**/*.ts", "README.md", + "LICENSE", "rollup.config.js", - "tsconfig.json" + "tsconfig.json", + "review/*", + "CHANGELOG.md", + "types/*" ], "scripts": { - "build": "tsc && rollup -c rollup.config.js && npm run minify", - "minify": "uglifyjs -c -m --comments --source-map \"content='./dist/arm-databoxedge-profile-2020-09-01-hybrid.js.map'\" -o ./dist/arm-databoxedge-profile-2020-09-01-hybrid.min.js ./dist/arm-databoxedge-profile-2020-09-01-hybrid.js", - "prepack": "npm install && npm run build" + "build": "npm run clean && tsc && rollup -c 2>&1 && npm run minify && mkdirp ./review && npm run extract-api", + "minify": "uglifyjs -c -m --comments --source-map \"content='./dist/index.js.map'\" -o ./dist/index.min.js ./dist/index.js", + "prepack": "npm run build", + "pack": "npm pack 2>&1", + "extract-api": "api-extractor run --local", + "lint": "echo skipped", + "audit": "echo skipped", + "clean": "rimraf dist dist-browser dist-esm test-dist temp types *.tgz *.log", + "build:node": "echo skipped", + "build:browser": "echo skipped", + "build:test": "echo skipped", + "build:samples": "echo skipped.", + "check-format": "echo skipped", + "execute:samples": "echo skipped", + "format": "echo skipped", + "test": "npm run integration-test", + "test:node": "echo skipped", + "test:browser": "echo skipped", + "unit-test": "npm run unit-test:node && npm run unit-test:browser", + "unit-test:node": "cross-env TEST_MODE=playback npm run integration-test:node", + "unit-test:browser": "echo skipped", + "integration-test": "npm run integration-test:node && npm run integration-test:browser", + "integration-test:node": "mocha -r esm --require ts-node/register --timeout 1200000 --full-trace test/*.ts --reporter ../../../common/tools/mocha-multi-reporter.js", + "integration-test:browser": "echo skipped", + "docs": "echo skipped" }, "sideEffects": false, + "//metadata": { + "constantPaths": [ + { + "path": "src/dataBoxEdgeManagementClient.ts", + "prefix": "packageDetails" + } + ] + }, "autoPublish": true -} +} \ No newline at end of file diff --git a/sdk/databoxedge/arm-databoxedge-profile-2020-09-01-hybrid/recordings/node/my_test/recording_sample_test.js b/sdk/databoxedge/arm-databoxedge-profile-2020-09-01-hybrid/recordings/node/my_test/recording_sample_test.js new file mode 100644 index 000000000000..0f6ecb857acf --- /dev/null +++ b/sdk/databoxedge/arm-databoxedge-profile-2020-09-01-hybrid/recordings/node/my_test/recording_sample_test.js @@ -0,0 +1,5 @@ +let nock = require('nock'); + +module.exports.hash = "7a6be38bb8cb644d64b4094802301751"; + +module.exports.testInfo = {"uniqueName":{},"newDate":{}} diff --git a/sdk/databoxedge/arm-databoxedge-profile-2020-09-01-hybrid/review/arm-databoxedge-profile-2020-09-01-hybrid.api.md b/sdk/databoxedge/arm-databoxedge-profile-2020-09-01-hybrid/review/arm-databoxedge-profile-2020-09-01-hybrid.api.md new file mode 100644 index 000000000000..0eb3455419c9 --- /dev/null +++ b/sdk/databoxedge/arm-databoxedge-profile-2020-09-01-hybrid/review/arm-databoxedge-profile-2020-09-01-hybrid.api.md @@ -0,0 +1,2002 @@ +## API Report File for "@azure/arm-databoxedge-profile-2020-09-01-hybrid" + +> Do not edit this file. It is a report generated by [API Extractor](https://api-extractor.com/). + +```ts + +import * as coreAuth from '@azure/core-auth'; +import * as coreClient from '@azure/core-client'; +import { PagedAsyncIterableIterator } from '@azure/core-paging'; +import { PollerLike } from '@azure/core-lro'; +import { PollOperationState } from '@azure/core-lro'; + +// @public +export type AccountType = string; + +// @public +export interface Address { + addressLine1: string; + addressLine2?: string; + addressLine3?: string; + city: string; + country: string; + postalCode: string; + state: string; +} + +// @public +export type Alert = ARMBaseModel & { + readonly title?: string; + readonly alertType?: string; + readonly appearedAtDateTime?: Date; + readonly recommendation?: string; + readonly severity?: AlertSeverity; + readonly errorDetails?: AlertErrorDetails; + readonly detailedInformation?: { + [propertyName: string]: string; + }; +}; + +// @public +export interface AlertErrorDetails { + readonly errorCode?: string; + readonly errorMessage?: string; + readonly occurrences?: number; +} + +// @public +export interface AlertList { + readonly nextLink?: string; + readonly value?: Alert[]; +} + +// @public +export interface Alerts { + get(deviceName: string, name: string, resourceGroupName: string, options?: AlertsGetOptionalParams): Promise; + listByDataBoxEdgeDevice(deviceName: string, resourceGroupName: string, options?: AlertsListByDataBoxEdgeDeviceOptionalParams): PagedAsyncIterableIterator; +} + +// @public +export type AlertSeverity = string; + +// @public +export interface AlertsGetOptionalParams extends coreClient.OperationOptions { +} + +// @public +export type AlertsGetResponse = Alert; + +// @public +export interface AlertsListByDataBoxEdgeDeviceNextOptionalParams extends coreClient.OperationOptions { +} + +// @public +export type AlertsListByDataBoxEdgeDeviceNextResponse = AlertList; + +// @public +export interface AlertsListByDataBoxEdgeDeviceOptionalParams extends coreClient.OperationOptions { +} + +// @public +export type AlertsListByDataBoxEdgeDeviceResponse = AlertList; + +// @public +export interface ARMBaseModel { + readonly id?: string; + readonly name?: string; + readonly type?: string; +} + +// @public +export interface AsymmetricEncryptedSecret { + encryptionAlgorithm: EncryptionAlgorithm; + encryptionCertThumbprint?: string; + value: string; +} + +// @public +export interface Authentication { + symmetricKey?: SymmetricKey; +} + +// @public +export type AuthenticationType = string; + +// @public +export type AzureContainerDataFormat = string; + +// @public +export interface AzureContainerInfo { + containerName: string; + dataFormat: AzureContainerDataFormat; + storageAccountCredentialId: string; +} + +// @public +export type BandwidthSchedule = ARMBaseModel & { + start: string; + stop: string; + rateInMbps: number; + days: DayOfWeek[]; +}; + +// @public +export interface BandwidthSchedules { + beginCreateOrUpdate(deviceName: string, name: string, resourceGroupName: string, parameters: BandwidthSchedule, options?: BandwidthSchedulesCreateOrUpdateOptionalParams): Promise, BandwidthSchedulesCreateOrUpdateResponse>>; + beginCreateOrUpdateAndWait(deviceName: string, name: string, resourceGroupName: string, parameters: BandwidthSchedule, options?: BandwidthSchedulesCreateOrUpdateOptionalParams): Promise; + beginDelete(deviceName: string, name: string, resourceGroupName: string, options?: BandwidthSchedulesDeleteOptionalParams): Promise, void>>; + beginDeleteAndWait(deviceName: string, name: string, resourceGroupName: string, options?: BandwidthSchedulesDeleteOptionalParams): Promise; + get(deviceName: string, name: string, resourceGroupName: string, options?: BandwidthSchedulesGetOptionalParams): Promise; + listByDataBoxEdgeDevice(deviceName: string, resourceGroupName: string, options?: BandwidthSchedulesListByDataBoxEdgeDeviceOptionalParams): PagedAsyncIterableIterator; +} + +// @public +export interface BandwidthSchedulesCreateOrUpdateOptionalParams extends coreClient.OperationOptions { + resumeFrom?: string; + updateIntervalInMs?: number; +} + +// @public +export type BandwidthSchedulesCreateOrUpdateResponse = BandwidthSchedule; + +// @public +export interface BandwidthSchedulesDeleteOptionalParams extends coreClient.OperationOptions { + resumeFrom?: string; + updateIntervalInMs?: number; +} + +// @public +export interface BandwidthSchedulesGetOptionalParams extends coreClient.OperationOptions { +} + +// @public +export type BandwidthSchedulesGetResponse = BandwidthSchedule; + +// @public +export interface BandwidthSchedulesList { + readonly nextLink?: string; + readonly value?: BandwidthSchedule[]; +} + +// @public +export interface BandwidthSchedulesListByDataBoxEdgeDeviceNextOptionalParams extends coreClient.OperationOptions { +} + +// @public +export type BandwidthSchedulesListByDataBoxEdgeDeviceNextResponse = BandwidthSchedulesList; + +// @public +export interface BandwidthSchedulesListByDataBoxEdgeDeviceOptionalParams extends coreClient.OperationOptions { +} + +// @public +export type BandwidthSchedulesListByDataBoxEdgeDeviceResponse = BandwidthSchedulesList; + +// @public +export interface ClientAccessRight { + accessPermission: ClientPermissionType; + client: string; +} + +// @public +export type ClientPermissionType = string; + +// @public +export interface CloudError { + error?: CloudErrorBody; +} + +// @public +export interface CloudErrorBody { + code?: string; + details?: CloudErrorBody[]; + message?: string; +} + +// @public +export interface ContactDetails { + companyName: string; + contactPerson: string; + emailList: string[]; + phone: string; +} + +// @public +export type Container = ARMBaseModel & { + readonly containerStatus?: ContainerStatus; + dataFormat: AzureContainerDataFormat; + readonly refreshDetails?: RefreshDetails; + readonly createdDateTime?: Date; +}; + +// @public +export interface ContainerList { + readonly nextLink?: string; + readonly value?: Container[]; +} + +// @public +export interface Containers { + beginCreateOrUpdate(deviceName: string, storageAccountName: string, containerName: string, resourceGroupName: string, container: Container, options?: ContainersCreateOrUpdateOptionalParams): Promise, ContainersCreateOrUpdateResponse>>; + beginCreateOrUpdateAndWait(deviceName: string, storageAccountName: string, containerName: string, resourceGroupName: string, container: Container, options?: ContainersCreateOrUpdateOptionalParams): Promise; + beginDelete(deviceName: string, storageAccountName: string, containerName: string, resourceGroupName: string, options?: ContainersDeleteOptionalParams): Promise, void>>; + beginDeleteAndWait(deviceName: string, storageAccountName: string, containerName: string, resourceGroupName: string, options?: ContainersDeleteOptionalParams): Promise; + beginRefresh(deviceName: string, storageAccountName: string, containerName: string, resourceGroupName: string, options?: ContainersRefreshOptionalParams): Promise, void>>; + beginRefreshAndWait(deviceName: string, storageAccountName: string, containerName: string, resourceGroupName: string, options?: ContainersRefreshOptionalParams): Promise; + get(deviceName: string, storageAccountName: string, containerName: string, resourceGroupName: string, options?: ContainersGetOptionalParams): Promise; + listByStorageAccount(deviceName: string, storageAccountName: string, resourceGroupName: string, options?: ContainersListByStorageAccountOptionalParams): PagedAsyncIterableIterator; +} + +// @public +export interface ContainersCreateOrUpdateOptionalParams extends coreClient.OperationOptions { + resumeFrom?: string; + updateIntervalInMs?: number; +} + +// @public +export type ContainersCreateOrUpdateResponse = Container; + +// @public +export interface ContainersDeleteOptionalParams extends coreClient.OperationOptions { + resumeFrom?: string; + updateIntervalInMs?: number; +} + +// @public +export interface ContainersGetOptionalParams extends coreClient.OperationOptions { +} + +// @public +export type ContainersGetResponse = Container; + +// @public +export interface ContainersListByStorageAccountNextOptionalParams extends coreClient.OperationOptions { +} + +// @public +export type ContainersListByStorageAccountNextResponse = ContainerList; + +// @public +export interface ContainersListByStorageAccountOptionalParams extends coreClient.OperationOptions { +} + +// @public +export type ContainersListByStorageAccountResponse = ContainerList; + +// @public +export interface ContainersRefreshOptionalParams extends coreClient.OperationOptions { + resumeFrom?: string; + updateIntervalInMs?: number; +} + +// @public +export type ContainerStatus = string; + +// @public +export type DataBoxEdgeDevice = ARMBaseModel & { + location: string; + tags?: { + [propertyName: string]: string; + }; + sku?: Sku; + etag?: string; + dataBoxEdgeDeviceStatus?: DataBoxEdgeDeviceStatus; + readonly serialNumber?: string; + description?: string; + modelDescription?: string; + readonly deviceType?: DeviceType; + friendlyName?: string; + readonly culture?: string; + readonly deviceModel?: string; + readonly deviceSoftwareVersion?: string; + readonly deviceLocalCapacity?: number; + readonly timeZone?: string; + readonly deviceHcsVersion?: string; + readonly configuredRoleTypes?: RoleTypes[]; + readonly nodeCount?: number; +}; + +// @public +export type DataBoxEdgeDeviceExtendedInfo = ARMBaseModel & { + encryptionKeyThumbprint?: string; + encryptionKey?: string; + readonly resourceKey?: string; +}; + +// @public +export interface DataBoxEdgeDeviceList { + readonly nextLink?: string; + readonly value?: DataBoxEdgeDevice[]; +} + +// @public +export interface DataBoxEdgeDevicePatch { + tags?: { + [propertyName: string]: string; + }; +} + +// @public +export type DataBoxEdgeDeviceStatus = string; + +// @public (undocumented) +export class DataBoxEdgeManagementClient extends coreClient.ServiceClient { + // (undocumented) + $host: string; + constructor(credentials: coreAuth.TokenCredential, subscriptionId: string, options?: DataBoxEdgeManagementClientOptionalParams); + // (undocumented) + alerts: Alerts; + // (undocumented) + apiVersion: string; + // (undocumented) + bandwidthSchedules: BandwidthSchedules; + // (undocumented) + containers: Containers; + // (undocumented) + devices: Devices; + // (undocumented) + jobs: Jobs; + // (undocumented) + nodes: Nodes; + // (undocumented) + operations: Operations; + // (undocumented) + operationsStatus: OperationsStatus; + // (undocumented) + orders: Orders; + // (undocumented) + roles: Roles; + // (undocumented) + shares: Shares; + // (undocumented) + skus: Skus; + // (undocumented) + storageAccountCredentials: StorageAccountCredentials; + // (undocumented) + storageAccounts: StorageAccounts; + // (undocumented) + subscriptionId: string; + // (undocumented) + triggers: Triggers; + // (undocumented) + users: Users; +} + +// @public +export interface DataBoxEdgeManagementClientOptionalParams extends coreClient.ServiceClientOptions { + $host?: string; + apiVersion?: string; + endpoint?: string; +} + +// @public +export type DataPolicy = string; + +// @public +export type DayOfWeek = string; + +// @public +export interface Devices { + beginCreateOrUpdate(deviceName: string, resourceGroupName: string, dataBoxEdgeDevice: DataBoxEdgeDevice, options?: DevicesCreateOrUpdateOptionalParams): Promise, DevicesCreateOrUpdateResponse>>; + beginCreateOrUpdateAndWait(deviceName: string, resourceGroupName: string, dataBoxEdgeDevice: DataBoxEdgeDevice, options?: DevicesCreateOrUpdateOptionalParams): Promise; + beginCreateOrUpdateSecuritySettings(deviceName: string, resourceGroupName: string, securitySettings: SecuritySettings, options?: DevicesCreateOrUpdateSecuritySettingsOptionalParams): Promise, void>>; + beginCreateOrUpdateSecuritySettingsAndWait(deviceName: string, resourceGroupName: string, securitySettings: SecuritySettings, options?: DevicesCreateOrUpdateSecuritySettingsOptionalParams): Promise; + beginDelete(deviceName: string, resourceGroupName: string, options?: DevicesDeleteOptionalParams): Promise, void>>; + beginDeleteAndWait(deviceName: string, resourceGroupName: string, options?: DevicesDeleteOptionalParams): Promise; + beginDownloadUpdates(deviceName: string, resourceGroupName: string, options?: DevicesDownloadUpdatesOptionalParams): Promise, void>>; + beginDownloadUpdatesAndWait(deviceName: string, resourceGroupName: string, options?: DevicesDownloadUpdatesOptionalParams): Promise; + beginInstallUpdates(deviceName: string, resourceGroupName: string, options?: DevicesInstallUpdatesOptionalParams): Promise, void>>; + beginInstallUpdatesAndWait(deviceName: string, resourceGroupName: string, options?: DevicesInstallUpdatesOptionalParams): Promise; + beginScanForUpdates(deviceName: string, resourceGroupName: string, options?: DevicesScanForUpdatesOptionalParams): Promise, void>>; + beginScanForUpdatesAndWait(deviceName: string, resourceGroupName: string, options?: DevicesScanForUpdatesOptionalParams): Promise; + get(deviceName: string, resourceGroupName: string, options?: DevicesGetOptionalParams): Promise; + getExtendedInformation(deviceName: string, resourceGroupName: string, options?: DevicesGetExtendedInformationOptionalParams): Promise; + getNetworkSettings(deviceName: string, resourceGroupName: string, options?: DevicesGetNetworkSettingsOptionalParams): Promise; + getUpdateSummary(deviceName: string, resourceGroupName: string, options?: DevicesGetUpdateSummaryOptionalParams): Promise; + listByResourceGroup(resourceGroupName: string, options?: DevicesListByResourceGroupOptionalParams): PagedAsyncIterableIterator; + listBySubscription(options?: DevicesListBySubscriptionOptionalParams): PagedAsyncIterableIterator; + update(deviceName: string, resourceGroupName: string, parameters: DataBoxEdgeDevicePatch, options?: DevicesUpdateOptionalParams): Promise; + uploadCertificate(deviceName: string, resourceGroupName: string, parameters: UploadCertificateRequest, options?: DevicesUploadCertificateOptionalParams): Promise; +} + +// @public +export interface DevicesCreateOrUpdateOptionalParams extends coreClient.OperationOptions { + resumeFrom?: string; + updateIntervalInMs?: number; +} + +// @public +export type DevicesCreateOrUpdateResponse = DataBoxEdgeDevice; + +// @public +export interface DevicesCreateOrUpdateSecuritySettingsOptionalParams extends coreClient.OperationOptions { + resumeFrom?: string; + updateIntervalInMs?: number; +} + +// @public +export interface DevicesDeleteOptionalParams extends coreClient.OperationOptions { + resumeFrom?: string; + updateIntervalInMs?: number; +} + +// @public +export interface DevicesDownloadUpdatesOptionalParams extends coreClient.OperationOptions { + resumeFrom?: string; + updateIntervalInMs?: number; +} + +// @public +export interface DevicesGetExtendedInformationOptionalParams extends coreClient.OperationOptions { +} + +// @public +export type DevicesGetExtendedInformationResponse = DataBoxEdgeDeviceExtendedInfo; + +// @public +export interface DevicesGetNetworkSettingsOptionalParams extends coreClient.OperationOptions { +} + +// @public +export type DevicesGetNetworkSettingsResponse = NetworkSettings; + +// @public +export interface DevicesGetOptionalParams extends coreClient.OperationOptions { +} + +// @public +export type DevicesGetResponse = DataBoxEdgeDevice; + +// @public +export interface DevicesGetUpdateSummaryOptionalParams extends coreClient.OperationOptions { +} + +// @public +export type DevicesGetUpdateSummaryResponse = UpdateSummary; + +// @public +export interface DevicesInstallUpdatesOptionalParams extends coreClient.OperationOptions { + resumeFrom?: string; + updateIntervalInMs?: number; +} + +// @public +export interface DevicesListByResourceGroupNextOptionalParams extends coreClient.OperationOptions { + expand?: string; +} + +// @public +export type DevicesListByResourceGroupNextResponse = DataBoxEdgeDeviceList; + +// @public +export interface DevicesListByResourceGroupOptionalParams extends coreClient.OperationOptions { + expand?: string; +} + +// @public +export type DevicesListByResourceGroupResponse = DataBoxEdgeDeviceList; + +// @public +export interface DevicesListBySubscriptionNextOptionalParams extends coreClient.OperationOptions { + expand?: string; +} + +// @public +export type DevicesListBySubscriptionNextResponse = DataBoxEdgeDeviceList; + +// @public +export interface DevicesListBySubscriptionOptionalParams extends coreClient.OperationOptions { + expand?: string; +} + +// @public +export type DevicesListBySubscriptionResponse = DataBoxEdgeDeviceList; + +// @public +export interface DevicesScanForUpdatesOptionalParams extends coreClient.OperationOptions { + resumeFrom?: string; + updateIntervalInMs?: number; +} + +// @public +export interface DevicesUpdateOptionalParams extends coreClient.OperationOptions { +} + +// @public +export type DevicesUpdateResponse = DataBoxEdgeDevice; + +// @public +export interface DevicesUploadCertificateOptionalParams extends coreClient.OperationOptions { +} + +// @public +export type DevicesUploadCertificateResponse = UploadCertificateResponse; + +// @public +export type DeviceType = string; + +// @public +export type DownloadPhase = string; + +// @public +export type EncryptionAlgorithm = string; + +// @public +export type FileEventTrigger = Trigger & { + sourceInfo: FileSourceInfo; + sinkInfo: RoleSinkInfo; + customContextTag?: string; +}; + +// @public +export interface FileSourceInfo { + shareId: string; +} + +// @public +export type InstallRebootBehavior = string; + +// @public +export interface IoTDeviceInfo { + authentication?: Authentication; + deviceId: string; + ioTHostHub: string; + ioTHostHubId?: string; +} + +// @public +export type IoTRole = Role & { + hostPlatform?: PlatformType; + ioTDeviceDetails?: IoTDeviceInfo; + ioTEdgeDeviceDetails?: IoTDeviceInfo; + shareMappings?: MountPointMap[]; + roleStatus?: RoleStatus; +}; + +// @public +export interface Ipv4Config { + readonly gateway?: string; + readonly ipAddress?: string; + readonly subnet?: string; +} + +// @public +export interface Ipv6Config { + readonly gateway?: string; + readonly ipAddress?: string; + readonly prefixLength?: number; +} + +// @public +export interface Job { + readonly currentStage?: UpdateOperationStage; + readonly downloadProgress?: UpdateDownloadProgress; + readonly endTime?: Date; + readonly error?: JobErrorDetails; + readonly errorManifestFile?: string; + folder?: string; + readonly id?: string; + readonly installProgress?: UpdateInstallProgress; + readonly jobType?: JobType; + readonly name?: string; + readonly percentComplete?: number; + readonly refreshedEntityId?: string; + readonly startTime?: Date; + readonly status?: JobStatus; + readonly totalRefreshErrors?: number; + readonly type?: string; +} + +// @public +export interface JobErrorDetails { + readonly code?: string; + readonly errorDetails?: JobErrorItem[]; + readonly message?: string; +} + +// @public +export interface JobErrorItem { + readonly code?: string; + readonly message?: string; + readonly recommendations?: string[]; +} + +// @public +export interface Jobs { + get(deviceName: string, name: string, resourceGroupName: string, options?: JobsGetOptionalParams): Promise; +} + +// @public +export interface JobsGetOptionalParams extends coreClient.OperationOptions { +} + +// @public +export type JobsGetResponse = Job; + +// @public +export type JobStatus = string; + +// @public +export type JobType = string; + +// @public +export enum KnownAccountType { + // (undocumented) + BlobStorage = "BlobStorage", + // (undocumented) + GeneralPurposeStorage = "GeneralPurposeStorage" +} + +// @public +export enum KnownAlertSeverity { + // (undocumented) + Critical = "Critical", + // (undocumented) + Informational = "Informational", + // (undocumented) + Warning = "Warning" +} + +// @public +export enum KnownAuthenticationType { + // (undocumented) + AzureActiveDirectory = "AzureActiveDirectory", + // (undocumented) + Invalid = "Invalid" +} + +// @public +export enum KnownAzureContainerDataFormat { + // (undocumented) + AzureFile = "AzureFile", + // (undocumented) + BlockBlob = "BlockBlob", + // (undocumented) + PageBlob = "PageBlob" +} + +// @public +export enum KnownClientPermissionType { + // (undocumented) + NoAccess = "NoAccess", + // (undocumented) + ReadOnly = "ReadOnly", + // (undocumented) + ReadWrite = "ReadWrite" +} + +// @public +export enum KnownContainerStatus { + // (undocumented) + NeedsAttention = "NeedsAttention", + // (undocumented) + Offline = "Offline", + // (undocumented) + OK = "OK", + // (undocumented) + Unknown = "Unknown", + // (undocumented) + Updating = "Updating" +} + +// @public +export enum KnownDataBoxEdgeDeviceStatus { + // (undocumented) + Disconnected = "Disconnected", + // (undocumented) + Maintenance = "Maintenance", + // (undocumented) + NeedsAttention = "NeedsAttention", + // (undocumented) + Offline = "Offline", + // (undocumented) + Online = "Online", + // (undocumented) + PartiallyDisconnected = "PartiallyDisconnected", + // (undocumented) + ReadyToSetup = "ReadyToSetup" +} + +// @public +export enum KnownDataPolicy { + // (undocumented) + Cloud = "Cloud", + // (undocumented) + Local = "Local" +} + +// @public +export enum KnownDayOfWeek { + // (undocumented) + Friday = "Friday", + // (undocumented) + Monday = "Monday", + // (undocumented) + Saturday = "Saturday", + // (undocumented) + Sunday = "Sunday", + // (undocumented) + Thursday = "Thursday", + // (undocumented) + Tuesday = "Tuesday", + // (undocumented) + Wednesday = "Wednesday" +} + +// @public +export enum KnownDeviceType { + // (undocumented) + DataBoxEdgeDevice = "DataBoxEdgeDevice" +} + +// @public +export enum KnownDownloadPhase { + // (undocumented) + Downloading = "Downloading", + // (undocumented) + Initializing = "Initializing", + // (undocumented) + Unknown = "Unknown", + // (undocumented) + Verifying = "Verifying" +} + +// @public +export enum KnownEncryptionAlgorithm { + // (undocumented) + AES256 = "AES256", + // (undocumented) + None = "None", + // (undocumented) + RsaesPkcs1V15 = "RSAES_PKCS1_v_1_5" +} + +// @public +export enum KnownInstallRebootBehavior { + // (undocumented) + NeverReboots = "NeverReboots", + // (undocumented) + RequestReboot = "RequestReboot", + // (undocumented) + RequiresReboot = "RequiresReboot" +} + +// @public +export enum KnownJobStatus { + // (undocumented) + Canceled = "Canceled", + // (undocumented) + Failed = "Failed", + // (undocumented) + Invalid = "Invalid", + // (undocumented) + Paused = "Paused", + // (undocumented) + Running = "Running", + // (undocumented) + Scheduled = "Scheduled", + // (undocumented) + Succeeded = "Succeeded" +} + +// @public +export enum KnownJobType { + // (undocumented) + DownloadUpdates = "DownloadUpdates", + // (undocumented) + InstallUpdates = "InstallUpdates", + // (undocumented) + Invalid = "Invalid", + // (undocumented) + RefreshContainer = "RefreshContainer", + // (undocumented) + RefreshShare = "RefreshShare", + // (undocumented) + ScanForUpdates = "ScanForUpdates" +} + +// @public +export enum KnownMetricAggregationType { + // (undocumented) + Average = "Average", + // (undocumented) + Count = "Count", + // (undocumented) + Maximum = "Maximum", + // (undocumented) + Minimum = "Minimum", + // (undocumented) + None = "None", + // (undocumented) + NotSpecified = "NotSpecified", + // (undocumented) + Total = "Total" +} + +// @public +export enum KnownMetricCategory { + // (undocumented) + Capacity = "Capacity", + // (undocumented) + Transaction = "Transaction" +} + +// @public +export enum KnownMetricUnit { + // (undocumented) + Bytes = "Bytes", + // (undocumented) + BytesPerSecond = "BytesPerSecond", + // (undocumented) + Count = "Count", + // (undocumented) + CountPerSecond = "CountPerSecond", + // (undocumented) + Milliseconds = "Milliseconds", + // (undocumented) + NotSpecified = "NotSpecified", + // (undocumented) + Percent = "Percent", + // (undocumented) + Seconds = "Seconds" +} + +// @public +export enum KnownMonitoringStatus { + // (undocumented) + Disabled = "Disabled", + // (undocumented) + Enabled = "Enabled" +} + +// @public +export enum KnownNetworkAdapterDhcpStatus { + // (undocumented) + Disabled = "Disabled", + // (undocumented) + Enabled = "Enabled" +} + +// @public +export enum KnownNetworkAdapterRdmaStatus { + // (undocumented) + Capable = "Capable", + // (undocumented) + Incapable = "Incapable" +} + +// @public +export enum KnownNetworkAdapterStatus { + // (undocumented) + Active = "Active", + // (undocumented) + Inactive = "Inactive" +} + +// @public +export enum KnownNetworkGroup { + // (undocumented) + None = "None", + // (undocumented) + NonRdma = "NonRDMA", + // (undocumented) + Rdma = "RDMA" +} + +// @public +export enum KnownNodeStatus { + // (undocumented) + Down = "Down", + // (undocumented) + Rebooting = "Rebooting", + // (undocumented) + ShuttingDown = "ShuttingDown", + // (undocumented) + Unknown = "Unknown", + // (undocumented) + Up = "Up" +} + +// @public +export enum KnownOrderState { + // (undocumented) + Arriving = "Arriving", + // (undocumented) + AwaitingFulfilment = "AwaitingFulfilment", + // (undocumented) + AwaitingPreparation = "AwaitingPreparation", + // (undocumented) + AwaitingReturnShipment = "AwaitingReturnShipment", + // (undocumented) + AwaitingShipment = "AwaitingShipment", + // (undocumented) + CollectedAtMicrosoft = "CollectedAtMicrosoft", + // (undocumented) + Declined = "Declined", + // (undocumented) + Delivered = "Delivered", + // (undocumented) + LostDevice = "LostDevice", + // (undocumented) + ReplacementRequested = "ReplacementRequested", + // (undocumented) + ReturnInitiated = "ReturnInitiated", + // (undocumented) + Shipped = "Shipped", + // (undocumented) + ShippedBack = "ShippedBack", + // (undocumented) + Untracked = "Untracked" +} + +// @public +export enum KnownPlatformType { + // (undocumented) + Linux = "Linux", + // (undocumented) + Windows = "Windows" +} + +// @public +export enum KnownRoleStatus { + // (undocumented) + Disabled = "Disabled", + // (undocumented) + Enabled = "Enabled" +} + +// @public +export enum KnownRoleTypes { + // (undocumented) + ASA = "ASA", + // (undocumented) + Cognitive = "Cognitive", + // (undocumented) + Functions = "Functions", + // (undocumented) + IOT = "IOT" +} + +// @public +export enum KnownShareAccessProtocol { + // (undocumented) + NFS = "NFS", + // (undocumented) + SMB = "SMB" +} + +// @public +export enum KnownShareAccessType { + // (undocumented) + Change = "Change", + // (undocumented) + Custom = "Custom", + // (undocumented) + Read = "Read" +} + +// @public +export enum KnownShareStatus { + // (undocumented) + NeedsAttention = "NeedsAttention", + // (undocumented) + Offline = "Offline", + // (undocumented) + OK = "OK", + // (undocumented) + Unknown = "Unknown", + // (undocumented) + Updating = "Updating" +} + +// @public +export enum KnownSkuName { + // (undocumented) + Edge = "Edge", + // (undocumented) + Gateway = "Gateway", + // (undocumented) + TEA1Node = "TEA_1Node", + // (undocumented) + TEA1NodeHeater = "TEA_1Node_Heater", + // (undocumented) + TEA1NodeUPS = "TEA_1Node_UPS", + // (undocumented) + TEA1NodeUPSHeater = "TEA_1Node_UPS_Heater", + // (undocumented) + TEA4NodeHeater = "TEA_4Node_Heater", + // (undocumented) + TEA4NodeUPSHeater = "TEA_4Node_UPS_Heater", + // (undocumented) + TMA = "TMA" +} + +// @public +export enum KnownSkuRestrictionReasonCode { + // (undocumented) + NotAvailableForSubscription = "NotAvailableForSubscription", + // (undocumented) + QuotaId = "QuotaId" +} + +// @public +export enum KnownSkuTier { + // (undocumented) + Standard = "Standard" +} + +// @public +export enum KnownSSLStatus { + // (undocumented) + Disabled = "Disabled", + // (undocumented) + Enabled = "Enabled" +} + +// @public +export enum KnownStorageAccountStatus { + // (undocumented) + NeedsAttention = "NeedsAttention", + // (undocumented) + Offline = "Offline", + // (undocumented) + OK = "OK", + // (undocumented) + Unknown = "Unknown", + // (undocumented) + Updating = "Updating" +} + +// @public +export enum KnownTimeGrain { + // (undocumented) + PT12H = "PT12H", + // (undocumented) + PT15M = "PT15M", + // (undocumented) + PT1D = "PT1D", + // (undocumented) + PT1H = "PT1H", + // (undocumented) + PT1M = "PT1M", + // (undocumented) + PT30M = "PT30M", + // (undocumented) + PT5M = "PT5M", + // (undocumented) + PT6H = "PT6H" +} + +// @public +export enum KnownTriggerEventType { + // (undocumented) + FileEvent = "FileEvent", + // (undocumented) + PeriodicTimerEvent = "PeriodicTimerEvent" +} + +// @public +export enum KnownUpdateOperation { + // (undocumented) + Download = "Download", + // (undocumented) + Install = "Install", + // (undocumented) + None = "None", + // (undocumented) + Scan = "Scan" +} + +// @public +export enum KnownUpdateOperationStage { + // (undocumented) + DownloadComplete = "DownloadComplete", + // (undocumented) + DownloadFailed = "DownloadFailed", + // (undocumented) + DownloadStarted = "DownloadStarted", + // (undocumented) + Failure = "Failure", + // (undocumented) + Initial = "Initial", + // (undocumented) + InstallComplete = "InstallComplete", + // (undocumented) + InstallFailed = "InstallFailed", + // (undocumented) + InstallStarted = "InstallStarted", + // (undocumented) + RebootInitiated = "RebootInitiated", + // (undocumented) + RescanComplete = "RescanComplete", + // (undocumented) + RescanFailed = "RescanFailed", + // (undocumented) + RescanStarted = "RescanStarted", + // (undocumented) + ScanComplete = "ScanComplete", + // (undocumented) + ScanFailed = "ScanFailed", + // (undocumented) + ScanStarted = "ScanStarted", + // (undocumented) + Success = "Success", + // (undocumented) + Unknown = "Unknown" +} + +// @public +export enum KnownUserType { + // (undocumented) + ARM = "ARM", + // (undocumented) + LocalManagement = "LocalManagement", + // (undocumented) + Share = "Share" +} + +// @public +export type MetricAggregationType = string; + +// @public +export type MetricCategory = string; + +// @public +export interface MetricDimensionV1 { + displayName?: string; + name?: string; + toBeExportedForShoebox?: boolean; +} + +// @public +export interface MetricSpecificationV1 { + aggregationType?: MetricAggregationType; + category?: MetricCategory; + dimensions?: MetricDimensionV1[]; + displayDescription?: string; + displayName?: string; + fillGapWithZero?: boolean; + name?: string; + resourceIdDimensionNameOverride?: string; + supportedAggregationTypes?: MetricAggregationType[]; + supportedTimeGrainTypes?: TimeGrain[]; + unit?: MetricUnit; +} + +// @public +export type MetricUnit = string; + +// @public +export type MonitoringStatus = string; + +// @public +export interface MountPointMap { + readonly mountPoint?: string; + readonly roleId?: string; + readonly roleType?: RoleTypes; + shareId: string; +} + +// @public +export interface NetworkAdapter { + readonly adapterId?: string; + readonly adapterPosition?: NetworkAdapterPosition; + dhcpStatus?: NetworkAdapterDhcpStatus; + readonly dnsServers?: string[]; + readonly index?: number; + readonly ipv4Configuration?: Ipv4Config; + readonly ipv6Configuration?: Ipv6Config; + readonly ipv6LinkLocalAddress?: string; + readonly label?: string; + readonly linkSpeed?: number; + readonly macAddress?: string; + readonly networkAdapterName?: string; + readonly nodeId?: string; + rdmaStatus?: NetworkAdapterRdmaStatus; + readonly status?: NetworkAdapterStatus; +} + +// @public +export type NetworkAdapterDhcpStatus = string; + +// @public +export interface NetworkAdapterPosition { + readonly networkGroup?: NetworkGroup; + readonly port?: number; +} + +// @public +export type NetworkAdapterRdmaStatus = string; + +// @public +export type NetworkAdapterStatus = string; + +// @public +export type NetworkGroup = string; + +// @public +export type NetworkSettings = ARMBaseModel & { + readonly networkAdapters?: NetworkAdapter[]; +}; + +// @public +type Node_2 = ARMBaseModel & { + readonly nodeStatus?: NodeStatus; + readonly nodeChassisSerialNumber?: string; + readonly nodeSerialNumber?: string; + readonly nodeDisplayName?: string; + readonly nodeFriendlySoftwareVersion?: string; + readonly nodeHcsVersion?: string; + readonly nodeInstanceId?: string; +}; +export { Node_2 as Node } + +// @public +interface NodeList_2 { + readonly value?: Node_2[]; +} +export { NodeList_2 as NodeList } + +// @public +export interface Nodes { + listByDataBoxEdgeDevice(deviceName: string, resourceGroupName: string, options?: NodesListByDataBoxEdgeDeviceOptionalParams): PagedAsyncIterableIterator; +} + +// @public +export interface NodesListByDataBoxEdgeDeviceOptionalParams extends coreClient.OperationOptions { +} + +// @public +export type NodesListByDataBoxEdgeDeviceResponse = NodeList_2; + +// @public +export type NodeStatus = string; + +// @public +export interface Operation { + display?: OperationDisplay; + name?: string; + origin?: string; + serviceSpecification?: ServiceSpecification; +} + +// @public +export interface OperationDisplay { + description?: string; + operation?: string; + provider?: string; + resource?: string; +} + +// @public +export interface Operations { + list(options?: OperationsListOptionalParams): PagedAsyncIterableIterator; +} + +// @public +export interface OperationsList { + nextLink?: string; + value: Operation[]; +} + +// @public +export interface OperationsListNextOptionalParams extends coreClient.OperationOptions { +} + +// @public +export type OperationsListNextResponse = OperationsList; + +// @public +export interface OperationsListOptionalParams extends coreClient.OperationOptions { +} + +// @public +export type OperationsListResponse = OperationsList; + +// @public +export interface OperationsStatus { + get(deviceName: string, name: string, resourceGroupName: string, options?: OperationsStatusGetOptionalParams): Promise; +} + +// @public +export interface OperationsStatusGetOptionalParams extends coreClient.OperationOptions { +} + +// @public +export type OperationsStatusGetResponse = Job; + +// @public +export type Order = ARMBaseModel & { + contactInformation?: ContactDetails; + shippingAddress?: Address; + currentStatus?: OrderStatus; + readonly orderHistory?: OrderStatus[]; + readonly serialNumber?: string; + readonly deliveryTrackingInfo?: TrackingInfo[]; + readonly returnTrackingInfo?: TrackingInfo[]; +}; + +// @public +export interface OrderList { + readonly nextLink?: string; + readonly value?: Order[]; +} + +// @public +export interface Orders { + beginCreateOrUpdate(deviceName: string, resourceGroupName: string, order: Order, options?: OrdersCreateOrUpdateOptionalParams): Promise, OrdersCreateOrUpdateResponse>>; + beginCreateOrUpdateAndWait(deviceName: string, resourceGroupName: string, order: Order, options?: OrdersCreateOrUpdateOptionalParams): Promise; + beginDelete(deviceName: string, resourceGroupName: string, options?: OrdersDeleteOptionalParams): Promise, void>>; + beginDeleteAndWait(deviceName: string, resourceGroupName: string, options?: OrdersDeleteOptionalParams): Promise; + get(deviceName: string, resourceGroupName: string, options?: OrdersGetOptionalParams): Promise; + listByDataBoxEdgeDevice(deviceName: string, resourceGroupName: string, options?: OrdersListByDataBoxEdgeDeviceOptionalParams): PagedAsyncIterableIterator; +} + +// @public +export interface OrdersCreateOrUpdateOptionalParams extends coreClient.OperationOptions { + resumeFrom?: string; + updateIntervalInMs?: number; +} + +// @public +export type OrdersCreateOrUpdateResponse = Order; + +// @public +export interface OrdersDeleteOptionalParams extends coreClient.OperationOptions { + resumeFrom?: string; + updateIntervalInMs?: number; +} + +// @public +export interface OrdersGetOptionalParams extends coreClient.OperationOptions { +} + +// @public +export type OrdersGetResponse = Order; + +// @public +export interface OrdersListByDataBoxEdgeDeviceNextOptionalParams extends coreClient.OperationOptions { +} + +// @public +export type OrdersListByDataBoxEdgeDeviceNextResponse = OrderList; + +// @public +export interface OrdersListByDataBoxEdgeDeviceOptionalParams extends coreClient.OperationOptions { +} + +// @public +export type OrdersListByDataBoxEdgeDeviceResponse = OrderList; + +// @public +export type OrderState = string; + +// @public +export interface OrderStatus { + readonly additionalOrderDetails?: { + [propertyName: string]: string; + }; + comments?: string; + status: OrderState; + readonly updateDateTime?: Date; +} + +// @public +export type PeriodicTimerEventTrigger = Trigger & { + sourceInfo: PeriodicTimerSourceInfo; + sinkInfo: RoleSinkInfo; + customContextTag?: string; +}; + +// @public +export interface PeriodicTimerSourceInfo { + schedule: string; + startTime: Date; + topic?: string; +} + +// @public +export type PlatformType = string; + +// @public +export interface RefreshDetails { + errorManifestFile?: string; + inProgressRefreshJobId?: string; + lastCompletedRefreshJobTimeInUTC?: Date; + lastJob?: string; +} + +// @public +export interface ResourceTypeSku { + readonly apiVersions?: string[]; + readonly costs?: SkuCost[]; + readonly family?: string; + readonly kind?: string; + readonly locationInfo?: SkuLocationInfo[]; + readonly locations?: string[]; + readonly name?: SkuName; + readonly resourceType?: string; + readonly restrictions?: SkuRestriction[]; + readonly tier?: SkuTier; +} + +// @public +export type Role = ARMBaseModel & { + kind: RoleTypes; +}; + +// @public +export interface RoleList { + readonly nextLink?: string; + readonly value?: RoleUnion[]; +} + +// @public +export interface Roles { + beginCreateOrUpdate(deviceName: string, name: string, resourceGroupName: string, role: RoleUnion, options?: RolesCreateOrUpdateOptionalParams): Promise, RolesCreateOrUpdateResponse>>; + beginCreateOrUpdateAndWait(deviceName: string, name: string, resourceGroupName: string, role: RoleUnion, options?: RolesCreateOrUpdateOptionalParams): Promise; + beginDelete(deviceName: string, name: string, resourceGroupName: string, options?: RolesDeleteOptionalParams): Promise, void>>; + beginDeleteAndWait(deviceName: string, name: string, resourceGroupName: string, options?: RolesDeleteOptionalParams): Promise; + get(deviceName: string, name: string, resourceGroupName: string, options?: RolesGetOptionalParams): Promise; + listByDataBoxEdgeDevice(deviceName: string, resourceGroupName: string, options?: RolesListByDataBoxEdgeDeviceOptionalParams): PagedAsyncIterableIterator; +} + +// @public +export interface RolesCreateOrUpdateOptionalParams extends coreClient.OperationOptions { + resumeFrom?: string; + updateIntervalInMs?: number; +} + +// @public +export type RolesCreateOrUpdateResponse = RoleUnion; + +// @public +export interface RolesDeleteOptionalParams extends coreClient.OperationOptions { + resumeFrom?: string; + updateIntervalInMs?: number; +} + +// @public +export interface RolesGetOptionalParams extends coreClient.OperationOptions { +} + +// @public +export type RolesGetResponse = RoleUnion; + +// @public +export interface RoleSinkInfo { + roleId: string; +} + +// @public +export interface RolesListByDataBoxEdgeDeviceNextOptionalParams extends coreClient.OperationOptions { +} + +// @public +export type RolesListByDataBoxEdgeDeviceNextResponse = RoleList; + +// @public +export interface RolesListByDataBoxEdgeDeviceOptionalParams extends coreClient.OperationOptions { +} + +// @public +export type RolesListByDataBoxEdgeDeviceResponse = RoleList; + +// @public +export type RoleStatus = string; + +// @public +export type RoleTypes = string; + +// @public (undocumented) +export type RoleUnion = Role | IoTRole; + +// @public +export type SecuritySettings = ARMBaseModel & { + deviceAdminPassword: AsymmetricEncryptedSecret; +}; + +// @public +export interface ServiceSpecification { + metricSpecifications?: MetricSpecificationV1[]; +} + +// @public +export type Share = ARMBaseModel & { + description?: string; + shareStatus: ShareStatus; + monitoringStatus: MonitoringStatus; + azureContainerInfo?: AzureContainerInfo; + accessProtocol: ShareAccessProtocol; + userAccessRights?: UserAccessRight[]; + clientAccessRights?: ClientAccessRight[]; + refreshDetails?: RefreshDetails; + readonly shareMappings?: MountPointMap[]; + dataPolicy?: DataPolicy; +}; + +// @public +export type ShareAccessProtocol = string; + +// @public +export interface ShareAccessRight { + accessType: ShareAccessType; + shareId: string; +} + +// @public +export type ShareAccessType = string; + +// @public +export interface ShareList { + readonly nextLink?: string; + readonly value?: Share[]; +} + +// @public +export interface Shares { + beginCreateOrUpdate(deviceName: string, name: string, resourceGroupName: string, share: Share, options?: SharesCreateOrUpdateOptionalParams): Promise, SharesCreateOrUpdateResponse>>; + beginCreateOrUpdateAndWait(deviceName: string, name: string, resourceGroupName: string, share: Share, options?: SharesCreateOrUpdateOptionalParams): Promise; + beginDelete(deviceName: string, name: string, resourceGroupName: string, options?: SharesDeleteOptionalParams): Promise, void>>; + beginDeleteAndWait(deviceName: string, name: string, resourceGroupName: string, options?: SharesDeleteOptionalParams): Promise; + beginRefresh(deviceName: string, name: string, resourceGroupName: string, options?: SharesRefreshOptionalParams): Promise, void>>; + beginRefreshAndWait(deviceName: string, name: string, resourceGroupName: string, options?: SharesRefreshOptionalParams): Promise; + get(deviceName: string, name: string, resourceGroupName: string, options?: SharesGetOptionalParams): Promise; + listByDataBoxEdgeDevice(deviceName: string, resourceGroupName: string, options?: SharesListByDataBoxEdgeDeviceOptionalParams): PagedAsyncIterableIterator; +} + +// @public +export interface SharesCreateOrUpdateOptionalParams extends coreClient.OperationOptions { + resumeFrom?: string; + updateIntervalInMs?: number; +} + +// @public +export type SharesCreateOrUpdateResponse = Share; + +// @public +export interface SharesDeleteOptionalParams extends coreClient.OperationOptions { + resumeFrom?: string; + updateIntervalInMs?: number; +} + +// @public +export interface SharesGetOptionalParams extends coreClient.OperationOptions { +} + +// @public +export type SharesGetResponse = Share; + +// @public +export interface SharesListByDataBoxEdgeDeviceNextOptionalParams extends coreClient.OperationOptions { +} + +// @public +export type SharesListByDataBoxEdgeDeviceNextResponse = ShareList; + +// @public +export interface SharesListByDataBoxEdgeDeviceOptionalParams extends coreClient.OperationOptions { +} + +// @public +export type SharesListByDataBoxEdgeDeviceResponse = ShareList; + +// @public +export interface SharesRefreshOptionalParams extends coreClient.OperationOptions { + resumeFrom?: string; + updateIntervalInMs?: number; +} + +// @public +export type ShareStatus = string; + +// @public +export interface Sku { + name?: SkuName; + tier?: SkuTier; +} + +// @public +export interface SkuCost { + readonly extendedUnit?: string; + readonly meterId?: string; + readonly quantity?: number; +} + +// @public +export interface SkuInformationList { + readonly nextLink?: string; + readonly value?: ResourceTypeSku[]; +} + +// @public +export interface SkuLocationInfo { + readonly location?: string; + readonly sites?: string[]; + readonly zones?: string[]; +} + +// @public +export type SkuName = string; + +// @public +export interface SkuRestriction { + readonly reasonCode?: SkuRestrictionReasonCode; + readonly restrictionInfo?: SkuRestrictionInfo; + readonly type?: string; + readonly values?: string[]; +} + +// @public +export interface SkuRestrictionInfo { + readonly locations?: string[]; + readonly zones?: string[]; +} + +// @public +export type SkuRestrictionReasonCode = string; + +// @public +export interface Skus { + list(options?: SkusListOptionalParams): PagedAsyncIterableIterator; +} + +// @public +export interface SkusListOptionalParams extends coreClient.OperationOptions { + filter?: string; +} + +// @public +export type SkusListResponse = SkuInformationList; + +// @public +export type SkuTier = string; + +// @public +export type SSLStatus = string; + +// @public +export type StorageAccount = ARMBaseModel & { + description?: string; + storageAccountStatus?: StorageAccountStatus; + dataPolicy?: DataPolicy; + storageAccountCredentialId?: string; + readonly blobEndpoint?: string; + readonly containerCount?: number; +}; + +// @public +export type StorageAccountCredential = ARMBaseModel & { + alias: string; + userName?: string; + accountKey?: AsymmetricEncryptedSecret; + connectionString?: string; + sslStatus: SSLStatus; + blobDomainName?: string; + accountType: AccountType; + storageAccountId?: string; +}; + +// @public +export interface StorageAccountCredentialList { + readonly nextLink?: string; + readonly value?: StorageAccountCredential[]; +} + +// @public +export interface StorageAccountCredentials { + beginCreateOrUpdate(deviceName: string, name: string, resourceGroupName: string, storageAccountCredential: StorageAccountCredential, options?: StorageAccountCredentialsCreateOrUpdateOptionalParams): Promise, StorageAccountCredentialsCreateOrUpdateResponse>>; + beginCreateOrUpdateAndWait(deviceName: string, name: string, resourceGroupName: string, storageAccountCredential: StorageAccountCredential, options?: StorageAccountCredentialsCreateOrUpdateOptionalParams): Promise; + beginDelete(deviceName: string, name: string, resourceGroupName: string, options?: StorageAccountCredentialsDeleteOptionalParams): Promise, void>>; + beginDeleteAndWait(deviceName: string, name: string, resourceGroupName: string, options?: StorageAccountCredentialsDeleteOptionalParams): Promise; + get(deviceName: string, name: string, resourceGroupName: string, options?: StorageAccountCredentialsGetOptionalParams): Promise; + listByDataBoxEdgeDevice(deviceName: string, resourceGroupName: string, options?: StorageAccountCredentialsListByDataBoxEdgeDeviceOptionalParams): PagedAsyncIterableIterator; +} + +// @public +export interface StorageAccountCredentialsCreateOrUpdateOptionalParams extends coreClient.OperationOptions { + resumeFrom?: string; + updateIntervalInMs?: number; +} + +// @public +export type StorageAccountCredentialsCreateOrUpdateResponse = StorageAccountCredential; + +// @public +export interface StorageAccountCredentialsDeleteOptionalParams extends coreClient.OperationOptions { + resumeFrom?: string; + updateIntervalInMs?: number; +} + +// @public +export interface StorageAccountCredentialsGetOptionalParams extends coreClient.OperationOptions { +} + +// @public +export type StorageAccountCredentialsGetResponse = StorageAccountCredential; + +// @public +export interface StorageAccountCredentialsListByDataBoxEdgeDeviceNextOptionalParams extends coreClient.OperationOptions { +} + +// @public +export type StorageAccountCredentialsListByDataBoxEdgeDeviceNextResponse = StorageAccountCredentialList; + +// @public +export interface StorageAccountCredentialsListByDataBoxEdgeDeviceOptionalParams extends coreClient.OperationOptions { +} + +// @public +export type StorageAccountCredentialsListByDataBoxEdgeDeviceResponse = StorageAccountCredentialList; + +// @public +export interface StorageAccountList { + readonly nextLink?: string; + readonly value?: StorageAccount[]; +} + +// @public +export interface StorageAccounts { + beginCreateOrUpdate(deviceName: string, storageAccountName: string, resourceGroupName: string, storageAccount: StorageAccount, options?: StorageAccountsCreateOrUpdateOptionalParams): Promise, StorageAccountsCreateOrUpdateResponse>>; + beginCreateOrUpdateAndWait(deviceName: string, storageAccountName: string, resourceGroupName: string, storageAccount: StorageAccount, options?: StorageAccountsCreateOrUpdateOptionalParams): Promise; + beginDelete(deviceName: string, storageAccountName: string, resourceGroupName: string, options?: StorageAccountsDeleteOptionalParams): Promise, void>>; + beginDeleteAndWait(deviceName: string, storageAccountName: string, resourceGroupName: string, options?: StorageAccountsDeleteOptionalParams): Promise; + get(deviceName: string, storageAccountName: string, resourceGroupName: string, options?: StorageAccountsGetOptionalParams): Promise; + listByDataBoxEdgeDevice(deviceName: string, resourceGroupName: string, options?: StorageAccountsListByDataBoxEdgeDeviceOptionalParams): PagedAsyncIterableIterator; +} + +// @public +export interface StorageAccountsCreateOrUpdateOptionalParams extends coreClient.OperationOptions { + resumeFrom?: string; + updateIntervalInMs?: number; +} + +// @public +export type StorageAccountsCreateOrUpdateResponse = StorageAccount; + +// @public +export interface StorageAccountsDeleteOptionalParams extends coreClient.OperationOptions { + resumeFrom?: string; + updateIntervalInMs?: number; +} + +// @public +export interface StorageAccountsGetOptionalParams extends coreClient.OperationOptions { +} + +// @public +export type StorageAccountsGetResponse = StorageAccount; + +// @public +export interface StorageAccountsListByDataBoxEdgeDeviceNextOptionalParams extends coreClient.OperationOptions { +} + +// @public +export type StorageAccountsListByDataBoxEdgeDeviceNextResponse = StorageAccountList; + +// @public +export interface StorageAccountsListByDataBoxEdgeDeviceOptionalParams extends coreClient.OperationOptions { +} + +// @public +export type StorageAccountsListByDataBoxEdgeDeviceResponse = StorageAccountList; + +// @public +export type StorageAccountStatus = string; + +// @public +export interface SymmetricKey { + connectionString?: AsymmetricEncryptedSecret; +} + +// @public +export type TimeGrain = string; + +// @public +export interface TrackingInfo { + carrierName?: string; + serialNumber?: string; + trackingId?: string; + trackingUrl?: string; +} + +// @public +export type Trigger = ARMBaseModel & { + kind: TriggerEventType; +}; + +// @public +export type TriggerEventType = string; + +// @public +export interface TriggerList { + readonly nextLink?: string; + readonly value?: TriggerUnion[]; +} + +// @public +export interface Triggers { + beginCreateOrUpdate(deviceName: string, name: string, resourceGroupName: string, trigger: TriggerUnion, options?: TriggersCreateOrUpdateOptionalParams): Promise, TriggersCreateOrUpdateResponse>>; + beginCreateOrUpdateAndWait(deviceName: string, name: string, resourceGroupName: string, trigger: TriggerUnion, options?: TriggersCreateOrUpdateOptionalParams): Promise; + beginDelete(deviceName: string, name: string, resourceGroupName: string, options?: TriggersDeleteOptionalParams): Promise, void>>; + beginDeleteAndWait(deviceName: string, name: string, resourceGroupName: string, options?: TriggersDeleteOptionalParams): Promise; + get(deviceName: string, name: string, resourceGroupName: string, options?: TriggersGetOptionalParams): Promise; + listByDataBoxEdgeDevice(deviceName: string, resourceGroupName: string, options?: TriggersListByDataBoxEdgeDeviceOptionalParams): PagedAsyncIterableIterator; +} + +// @public +export interface TriggersCreateOrUpdateOptionalParams extends coreClient.OperationOptions { + resumeFrom?: string; + updateIntervalInMs?: number; +} + +// @public +export type TriggersCreateOrUpdateResponse = TriggerUnion; + +// @public +export interface TriggersDeleteOptionalParams extends coreClient.OperationOptions { + resumeFrom?: string; + updateIntervalInMs?: number; +} + +// @public +export interface TriggersGetOptionalParams extends coreClient.OperationOptions { +} + +// @public +export type TriggersGetResponse = TriggerUnion; + +// @public +export interface TriggersListByDataBoxEdgeDeviceNextOptionalParams extends coreClient.OperationOptions { + filter?: string; +} + +// @public +export type TriggersListByDataBoxEdgeDeviceNextResponse = TriggerList; + +// @public +export interface TriggersListByDataBoxEdgeDeviceOptionalParams extends coreClient.OperationOptions { + filter?: string; +} + +// @public +export type TriggersListByDataBoxEdgeDeviceResponse = TriggerList; + +// @public (undocumented) +export type TriggerUnion = Trigger | FileEventTrigger | PeriodicTimerEventTrigger; + +// @public +export interface UpdateDownloadProgress { + readonly downloadPhase?: DownloadPhase; + readonly numberOfUpdatesDownloaded?: number; + readonly numberOfUpdatesToDownload?: number; + readonly percentComplete?: number; + readonly totalBytesDownloaded?: number; + readonly totalBytesToDownload?: number; +} + +// @public +export interface UpdateInstallProgress { + readonly numberOfUpdatesInstalled?: number; + readonly numberOfUpdatesToInstall?: number; + readonly percentComplete?: number; +} + +// @public +export type UpdateOperation = string; + +// @public +export type UpdateOperationStage = string; + +// @public +export type UpdateSummary = ARMBaseModel & { + deviceVersionNumber?: string; + friendlyDeviceVersionName?: string; + deviceLastScannedDateTime?: Date; + lastCompletedScanJobDateTime?: Date; + readonly lastCompletedDownloadJobDateTime?: Date; + readonly lastCompletedInstallJobDateTime?: Date; + readonly totalNumberOfUpdatesAvailable?: number; + readonly totalNumberOfUpdatesPendingDownload?: number; + readonly totalNumberOfUpdatesPendingInstall?: number; + readonly rebootBehavior?: InstallRebootBehavior; + readonly ongoingUpdateOperation?: UpdateOperation; + readonly inProgressDownloadJobId?: string; + readonly inProgressInstallJobId?: string; + readonly inProgressDownloadJobStartedDateTime?: Date; + readonly inProgressInstallJobStartedDateTime?: Date; + readonly updateTitles?: string[]; + readonly totalUpdateSizeInBytes?: number; +}; + +// @public +export interface UploadCertificateRequest { + authenticationType?: AuthenticationType; + certificate: string; +} + +// @public +export interface UploadCertificateResponse { + readonly aadAudience?: string; + readonly aadAuthority?: string; + readonly aadTenantId?: string; + authType?: AuthenticationType; + readonly azureManagementEndpointAudience?: string; + readonly resourceId?: string; + readonly servicePrincipalClientId?: string; + readonly servicePrincipalObjectId?: string; +} + +// @public +export type User = ARMBaseModel & { + encryptedPassword?: AsymmetricEncryptedSecret; + shareAccessRights?: ShareAccessRight[]; + userType: UserType; +}; + +// @public +export interface UserAccessRight { + accessType: ShareAccessType; + userId: string; +} + +// @public +export interface UserList { + readonly nextLink?: string; + readonly value?: User[]; +} + +// @public +export interface Users { + beginCreateOrUpdate(deviceName: string, name: string, resourceGroupName: string, user: User, options?: UsersCreateOrUpdateOptionalParams): Promise, UsersCreateOrUpdateResponse>>; + beginCreateOrUpdateAndWait(deviceName: string, name: string, resourceGroupName: string, user: User, options?: UsersCreateOrUpdateOptionalParams): Promise; + beginDelete(deviceName: string, name: string, resourceGroupName: string, options?: UsersDeleteOptionalParams): Promise, void>>; + beginDeleteAndWait(deviceName: string, name: string, resourceGroupName: string, options?: UsersDeleteOptionalParams): Promise; + get(deviceName: string, name: string, resourceGroupName: string, options?: UsersGetOptionalParams): Promise; + listByDataBoxEdgeDevice(deviceName: string, resourceGroupName: string, options?: UsersListByDataBoxEdgeDeviceOptionalParams): PagedAsyncIterableIterator; +} + +// @public +export interface UsersCreateOrUpdateOptionalParams extends coreClient.OperationOptions { + resumeFrom?: string; + updateIntervalInMs?: number; +} + +// @public +export type UsersCreateOrUpdateResponse = User; + +// @public +export interface UsersDeleteOptionalParams extends coreClient.OperationOptions { + resumeFrom?: string; + updateIntervalInMs?: number; +} + +// @public +export interface UsersGetOptionalParams extends coreClient.OperationOptions { +} + +// @public +export type UsersGetResponse = User; + +// @public +export interface UsersListByDataBoxEdgeDeviceNextOptionalParams extends coreClient.OperationOptions { + filter?: string; +} + +// @public +export type UsersListByDataBoxEdgeDeviceNextResponse = UserList; + +// @public +export interface UsersListByDataBoxEdgeDeviceOptionalParams extends coreClient.OperationOptions { + filter?: string; +} + +// @public +export type UsersListByDataBoxEdgeDeviceResponse = UserList; + +// @public +export type UserType = string; + +// (No @packageDocumentation comment for this package) + +``` diff --git a/sdk/databoxedge/arm-databoxedge-profile-2020-09-01-hybrid/rollup.config.js b/sdk/databoxedge/arm-databoxedge-profile-2020-09-01-hybrid/rollup.config.js index 6395e72b1a2c..3f89d7309da5 100644 --- a/sdk/databoxedge/arm-databoxedge-profile-2020-09-01-hybrid/rollup.config.js +++ b/sdk/databoxedge/arm-databoxedge-profile-2020-09-01-hybrid/rollup.config.js @@ -1,37 +1,122 @@ -import rollup from "rollup"; -import nodeResolve from "rollup-plugin-node-resolve"; +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +import nodeResolve from "@rollup/plugin-node-resolve"; +import cjs from "@rollup/plugin-commonjs"; import sourcemaps from "rollup-plugin-sourcemaps"; +import multiEntry from "@rollup/plugin-multi-entry"; +import json from "@rollup/plugin-json"; + +import nodeBuiltins from "builtin-modules"; + +// #region Warning Handler + +/** + * A function that can determine whether a rollup warning should be ignored. If + * the function returns `true`, then the warning will not be displayed. + */ + +function ignoreNiseSinonEval(warning) { + return ( + warning.code === "EVAL" && + warning.id && + (warning.id.includes("node_modules/nise") || + warning.id.includes("node_modules/sinon")) === true + ); +} + +function ignoreChaiCircularDependency(warning) { + return ( + warning.code === "CIRCULAR_DEPENDENCY" && + warning.importer && warning.importer.includes("node_modules/chai") === true + ); +} + +const warningInhibitors = [ignoreChaiCircularDependency, ignoreNiseSinonEval]; /** - * @type {rollup.RollupFileOptions} + * Construct a warning handler for the shared rollup configuration + * that ignores certain warnings that are not relevant to testing. */ -const config = { - input: "./esm/dataBoxEdgeManagementClient.js", - external: [ - "@azure/ms-rest-js", - "@azure/ms-rest-azure-js" - ], - output: { - file: "./dist/arm-databoxedge-profile-2020-09-01-hybrid.js", - format: "umd", - name: "Azure.ArmDataboxedgeProfile20200901Hybrid", - sourcemap: true, - globals: { - "@azure/ms-rest-js": "msRest", - "@azure/ms-rest-azure-js": "msRestAzure" +function makeOnWarnForTesting() { + return (warning, warn) => { + // If every inhibitor returns false (i.e. no inhibitors), then show the warning + if (warningInhibitors.every((inhib) => !inhib(warning))) { + warn(warning); + } + }; +} + +// #endregion + +function makeBrowserTestConfig() { + const config = { + input: { + include: ["dist-esm/test/**/*.spec.js"], + exclude: ["dist-esm/test/**/node/**"] }, - 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({ mainFields: ['module', 'main'] }), - sourcemaps() - ] + output: { + file: `dist-test/index.browser.js`, + format: "umd", + sourcemap: true + }, + preserveSymlinks: false, + plugins: [ + multiEntry({ exports: false }), + nodeResolve({ + mainFields: ["module", "browser"] + }), + cjs(), + json(), + sourcemaps() + //viz({ filename: "dist-test/browser-stats.html", sourcemap: true }) + ], + onwarn: makeOnWarnForTesting(), + // Disable tree-shaking of test code. In rollup-plugin-node-resolve@5.0.0, + // rollup started respecting the "sideEffects" field in package.json. Since + // our package.json sets "sideEffects=false", this also applies to test + // code, which causes all tests to be removed by tree-shaking. + treeshake: false + }; + + return config; +} + +const defaultConfigurationOptions = { + disableBrowserBundle: false }; -export default config; +export function makeConfig(pkg, options) { + options = { + ...defaultConfigurationOptions, + ...(options || {}) + }; + + const baseConfig = { + // Use the package's module field if it has one + input: pkg["module"] || "dist-esm/src/index.js", + external: [ + ...nodeBuiltins, + ...Object.keys(pkg.dependencies), + ...Object.keys(pkg.devDependencies) + ], + output: { file: "dist/index.js", format: "cjs", sourcemap: true }, + preserveSymlinks: false, + plugins: [sourcemaps(), nodeResolve()] + }; + + const config = [baseConfig]; + + if (!options.disableBrowserBundle) { + config.push(makeBrowserTestConfig()); + } + + return config; +} + +export default makeConfig(require("./package.json")); diff --git a/sdk/databoxedge/arm-databoxedge-profile-2020-09-01-hybrid/src/dataBoxEdgeManagementClient.ts b/sdk/databoxedge/arm-databoxedge-profile-2020-09-01-hybrid/src/dataBoxEdgeManagementClient.ts index 5c59037970dc..d97463064c99 100644 --- a/sdk/databoxedge/arm-databoxedge-profile-2020-09-01-hybrid/src/dataBoxEdgeManagementClient.ts +++ b/sdk/databoxedge/arm-databoxedge-profile-2020-09-01-hybrid/src/dataBoxEdgeManagementClient.ts @@ -1,78 +1,139 @@ /* - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for - * license information. + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. * * 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 * as msRest from "@azure/ms-rest-js"; -import { TokenCredential } from "@azure/core-auth"; -import * as Models from "./models"; -import * as Mappers from "./models/mappers"; -import * as operations from "./operations"; -import { DataBoxEdgeManagementClientContext } from "./dataBoxEdgeManagementClientContext"; +import * as coreClient from "@azure/core-client"; +import * as coreAuth from "@azure/core-auth"; +import { + OperationsImpl, + DevicesImpl, + AlertsImpl, + BandwidthSchedulesImpl, + JobsImpl, + NodesImpl, + OperationsStatusImpl, + OrdersImpl, + RolesImpl, + SharesImpl, + StorageAccountCredentialsImpl, + StorageAccountsImpl, + ContainersImpl, + TriggersImpl, + UsersImpl, + SkusImpl +} from "./operations"; +import { + Operations, + Devices, + Alerts, + BandwidthSchedules, + Jobs, + Nodes, + OperationsStatus, + Orders, + Roles, + Shares, + StorageAccountCredentials, + StorageAccounts, + Containers, + Triggers, + Users, + Skus +} from "./operationsInterfaces"; +import { DataBoxEdgeManagementClientOptionalParams } from "./models"; - -class DataBoxEdgeManagementClient extends DataBoxEdgeManagementClientContext { - // Operation groups - operations: operations.Operations; - devices: operations.Devices; - alerts: operations.Alerts; - bandwidthSchedules: operations.BandwidthSchedules; - jobs: operations.Jobs; - nodes: operations.Nodes; - operationsStatus: operations.OperationsStatus; - orders: operations.Orders; - roles: operations.Roles; - shares: operations.Shares; - storageAccountCredentials: operations.StorageAccountCredentials; - storageAccounts: operations.StorageAccounts; - containers: operations.Containers; - triggers: operations.Triggers; - users: operations.Users; - skus: operations.Skus; +export class DataBoxEdgeManagementClient extends coreClient.ServiceClient { + $host: string; + apiVersion: string; + subscriptionId: string; /** * Initializes a new instance of the DataBoxEdgeManagementClient class. - * @param credentials Credentials needed for the client to connect to Azure. Credentials - * implementing the TokenCredential interface from the @azure/identity package are recommended. For - * more information about these credentials, see - * {@link https://www.npmjs.com/package/@azure/identity}. Credentials implementing the - * ServiceClientCredentials interface from the older packages @azure/ms-rest-nodeauth and - * @azure/ms-rest-browserauth are also supported. + * @param credentials Subscription credentials which uniquely identify client subscription. * @param subscriptionId The subscription ID. - * @param [options] The parameter options + * @param options The parameter options */ - constructor(credentials: msRest.ServiceClientCredentials | TokenCredential, subscriptionId: string, options?: Models.DataBoxEdgeManagementClientOptions) { - super(credentials, subscriptionId, options); - this.operations = new operations.Operations(this); - this.devices = new operations.Devices(this); - this.alerts = new operations.Alerts(this); - this.bandwidthSchedules = new operations.BandwidthSchedules(this); - this.jobs = new operations.Jobs(this); - this.nodes = new operations.Nodes(this); - this.operationsStatus = new operations.OperationsStatus(this); - this.orders = new operations.Orders(this); - this.roles = new operations.Roles(this); - this.shares = new operations.Shares(this); - this.storageAccountCredentials = new operations.StorageAccountCredentials(this); - this.storageAccounts = new operations.StorageAccounts(this); - this.containers = new operations.Containers(this); - this.triggers = new operations.Triggers(this); - this.users = new operations.Users(this); - this.skus = new operations.Skus(this); - } -} + constructor( + credentials: coreAuth.TokenCredential, + subscriptionId: string, + options?: DataBoxEdgeManagementClientOptionalParams + ) { + if (credentials === undefined) { + throw new Error("'credentials' cannot be null"); + } + if (subscriptionId === undefined) { + throw new Error("'subscriptionId' cannot be null"); + } + + // Initializing default values for options + if (!options) { + options = {}; + } + const defaults: DataBoxEdgeManagementClientOptionalParams = { + requestContentType: "application/json; charset=utf-8", + credential: credentials + }; -// Operation Specifications + const packageDetails = `azsdk-js-arm-databoxedge-profile-2020-09-01-hybrid/2.0.0`; + const userAgentPrefix = + options.userAgentOptions && options.userAgentOptions.userAgentPrefix + ? `${options.userAgentOptions.userAgentPrefix} ${packageDetails}` + : `${packageDetails}`; -export { - DataBoxEdgeManagementClient, - DataBoxEdgeManagementClientContext, - Models as DataBoxEdgeManagementModels, - Mappers as DataBoxEdgeManagementMappers -}; -export * from "./operations"; + if (!options.credentialScopes) { + options.credentialScopes = ["https://management.azure.com/.default"]; + } + const optionsWithDefaults = { + ...defaults, + ...options, + userAgentOptions: { + userAgentPrefix + }, + baseUri: options.endpoint || "https://management.azure.com" + }; + super(optionsWithDefaults); + // Parameter assignments + this.subscriptionId = subscriptionId; + + // Assigning values to Constant parameters + this.$host = options.$host || "https://management.azure.com"; + this.apiVersion = options.apiVersion || "2019-08-01"; + this.operations = new OperationsImpl(this); + this.devices = new DevicesImpl(this); + this.alerts = new AlertsImpl(this); + this.bandwidthSchedules = new BandwidthSchedulesImpl(this); + this.jobs = new JobsImpl(this); + this.nodes = new NodesImpl(this); + this.operationsStatus = new OperationsStatusImpl(this); + this.orders = new OrdersImpl(this); + this.roles = new RolesImpl(this); + this.shares = new SharesImpl(this); + this.storageAccountCredentials = new StorageAccountCredentialsImpl(this); + this.storageAccounts = new StorageAccountsImpl(this); + this.containers = new ContainersImpl(this); + this.triggers = new TriggersImpl(this); + this.users = new UsersImpl(this); + this.skus = new SkusImpl(this); + } + + operations: Operations; + devices: Devices; + alerts: Alerts; + bandwidthSchedules: BandwidthSchedules; + jobs: Jobs; + nodes: Nodes; + operationsStatus: OperationsStatus; + orders: Orders; + roles: Roles; + shares: Shares; + storageAccountCredentials: StorageAccountCredentials; + storageAccounts: StorageAccounts; + containers: Containers; + triggers: Triggers; + users: Users; + skus: Skus; +} diff --git a/sdk/databoxedge/arm-databoxedge-profile-2020-09-01-hybrid/src/dataBoxEdgeManagementClientContext.ts b/sdk/databoxedge/arm-databoxedge-profile-2020-09-01-hybrid/src/dataBoxEdgeManagementClientContext.ts deleted file mode 100644 index 5c2a8b6738ca..000000000000 --- a/sdk/databoxedge/arm-databoxedge-profile-2020-09-01-hybrid/src/dataBoxEdgeManagementClientContext.ts +++ /dev/null @@ -1,68 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for - * license information. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is - * regenerated. - */ - -import * as Models from "./models"; -import * as msRest from "@azure/ms-rest-js"; -import { TokenCredential } from "@azure/core-auth"; -import * as msRestAzure from "@azure/ms-rest-azure-js"; - -const packageName = "@azure/arm-databoxedge-profile-2020-09-01-hybrid"; -const packageVersion = "1.1.0"; - -export class DataBoxEdgeManagementClientContext extends msRestAzure.AzureServiceClient { - credentials: msRest.ServiceClientCredentials | TokenCredential; - apiVersion?: string; - subscriptionId: string; - - /** - * Initializes a new instance of the DataBoxEdgeManagementClient class. - * @param credentials Credentials needed for the client to connect to Azure. Credentials - * implementing the TokenCredential interface from the @azure/identity package are recommended. For - * more information about these credentials, see - * {@link https://www.npmjs.com/package/@azure/identity}. Credentials implementing the - * ServiceClientCredentials interface from the older packages @azure/ms-rest-nodeauth and - * @azure/ms-rest-browserauth are also supported. - * @param subscriptionId The subscription ID. - * @param [options] The parameter options - */ - constructor(credentials: msRest.ServiceClientCredentials | TokenCredential, subscriptionId: string, options?: Models.DataBoxEdgeManagementClientOptions) { - 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 = '2019-08-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/databoxedge/arm-databoxedge-profile-2020-09-01-hybrid/src/index.ts b/sdk/databoxedge/arm-databoxedge-profile-2020-09-01-hybrid/src/index.ts new file mode 100644 index 000000000000..a395908b52ad --- /dev/null +++ b/sdk/databoxedge/arm-databoxedge-profile-2020-09-01-hybrid/src/index.ts @@ -0,0 +1,12 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +/// +export * from "./models"; +export { DataBoxEdgeManagementClient } from "./dataBoxEdgeManagementClient"; +export * from "./operationsInterfaces"; diff --git a/sdk/databoxedge/arm-databoxedge-profile-2020-09-01-hybrid/src/lroImpl.ts b/sdk/databoxedge/arm-databoxedge-profile-2020-09-01-hybrid/src/lroImpl.ts new file mode 100644 index 000000000000..518d5f053b4e --- /dev/null +++ b/sdk/databoxedge/arm-databoxedge-profile-2020-09-01-hybrid/src/lroImpl.ts @@ -0,0 +1,34 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +import { LongRunningOperation, LroResponse } from "@azure/core-lro"; + +export class LroImpl implements LongRunningOperation { + constructor( + private sendOperationFn: (args: any, spec: any) => Promise>, + private args: Record, + private spec: { + readonly requestBody?: unknown; + readonly path?: string; + readonly httpMethod: string; + } & Record, + public requestPath: string = spec.path!, + public requestMethod: string = spec.httpMethod + ) {} + public async sendInitialRequest(): Promise> { + return this.sendOperationFn(this.args, this.spec); + } + public async sendPollRequest(path: string): Promise> { + const { requestBody, ...restSpec } = this.spec; + return this.sendOperationFn(this.args, { + ...restSpec, + path, + httpMethod: "GET" + }); + } +} diff --git a/sdk/databoxedge/arm-databoxedge-profile-2020-09-01-hybrid/src/models/alertsMappers.ts b/sdk/databoxedge/arm-databoxedge-profile-2020-09-01-hybrid/src/models/alertsMappers.ts deleted file mode 100644 index fd3bcdf1b586..000000000000 --- a/sdk/databoxedge/arm-databoxedge-profile-2020-09-01-hybrid/src/models/alertsMappers.ts +++ /dev/null @@ -1,57 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for license information. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -export { - discriminators, - Address, - Alert, - AlertErrorDetails, - AlertList, - ARMBaseModel, - AsymmetricEncryptedSecret, - Authentication, - AzureContainerInfo, - BandwidthSchedule, - BaseResource, - ClientAccessRight, - CloudError, - ContactDetails, - Container, - DataBoxEdgeDevice, - DataBoxEdgeDeviceExtendedInfo, - FileEventTrigger, - FileSourceInfo, - IoTDeviceInfo, - IoTRole, - Ipv4Config, - Ipv6Config, - MountPointMap, - NetworkAdapter, - NetworkAdapterPosition, - NetworkSettings, - Node, - Order, - OrderStatus, - PeriodicTimerEventTrigger, - PeriodicTimerSourceInfo, - RefreshDetails, - Role, - RoleSinkInfo, - SecuritySettings, - Share, - ShareAccessRight, - Sku, - StorageAccount, - StorageAccountCredential, - SymmetricKey, - TrackingInfo, - Trigger, - UpdateSummary, - User, - UserAccessRight -} from "../models/mappers"; diff --git a/sdk/databoxedge/arm-databoxedge-profile-2020-09-01-hybrid/src/models/bandwidthSchedulesMappers.ts b/sdk/databoxedge/arm-databoxedge-profile-2020-09-01-hybrid/src/models/bandwidthSchedulesMappers.ts deleted file mode 100644 index f915bde43738..000000000000 --- a/sdk/databoxedge/arm-databoxedge-profile-2020-09-01-hybrid/src/models/bandwidthSchedulesMappers.ts +++ /dev/null @@ -1,57 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for license information. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -export { - discriminators, - Address, - Alert, - AlertErrorDetails, - ARMBaseModel, - AsymmetricEncryptedSecret, - Authentication, - AzureContainerInfo, - BandwidthSchedule, - BandwidthSchedulesList, - BaseResource, - ClientAccessRight, - CloudError, - ContactDetails, - Container, - DataBoxEdgeDevice, - DataBoxEdgeDeviceExtendedInfo, - FileEventTrigger, - FileSourceInfo, - IoTDeviceInfo, - IoTRole, - Ipv4Config, - Ipv6Config, - MountPointMap, - NetworkAdapter, - NetworkAdapterPosition, - NetworkSettings, - Node, - Order, - OrderStatus, - PeriodicTimerEventTrigger, - PeriodicTimerSourceInfo, - RefreshDetails, - Role, - RoleSinkInfo, - SecuritySettings, - Share, - ShareAccessRight, - Sku, - StorageAccount, - StorageAccountCredential, - SymmetricKey, - TrackingInfo, - Trigger, - UpdateSummary, - User, - UserAccessRight -} from "../models/mappers"; diff --git a/sdk/databoxedge/arm-databoxedge-profile-2020-09-01-hybrid/src/models/containersMappers.ts b/sdk/databoxedge/arm-databoxedge-profile-2020-09-01-hybrid/src/models/containersMappers.ts deleted file mode 100644 index 8540a4f43389..000000000000 --- a/sdk/databoxedge/arm-databoxedge-profile-2020-09-01-hybrid/src/models/containersMappers.ts +++ /dev/null @@ -1,57 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for license information. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -export { - discriminators, - Address, - Alert, - AlertErrorDetails, - ARMBaseModel, - AsymmetricEncryptedSecret, - Authentication, - AzureContainerInfo, - BandwidthSchedule, - BaseResource, - ClientAccessRight, - CloudError, - ContactDetails, - Container, - ContainerList, - DataBoxEdgeDevice, - DataBoxEdgeDeviceExtendedInfo, - FileEventTrigger, - FileSourceInfo, - IoTDeviceInfo, - IoTRole, - Ipv4Config, - Ipv6Config, - MountPointMap, - NetworkAdapter, - NetworkAdapterPosition, - NetworkSettings, - Node, - Order, - OrderStatus, - PeriodicTimerEventTrigger, - PeriodicTimerSourceInfo, - RefreshDetails, - Role, - RoleSinkInfo, - SecuritySettings, - Share, - ShareAccessRight, - Sku, - StorageAccount, - StorageAccountCredential, - SymmetricKey, - TrackingInfo, - Trigger, - UpdateSummary, - User, - UserAccessRight -} from "../models/mappers"; diff --git a/sdk/databoxedge/arm-databoxedge-profile-2020-09-01-hybrid/src/models/devicesMappers.ts b/sdk/databoxedge/arm-databoxedge-profile-2020-09-01-hybrid/src/models/devicesMappers.ts deleted file mode 100644 index e4686b1116a5..000000000000 --- a/sdk/databoxedge/arm-databoxedge-profile-2020-09-01-hybrid/src/models/devicesMappers.ts +++ /dev/null @@ -1,60 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for license information. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -export { - discriminators, - Address, - Alert, - AlertErrorDetails, - ARMBaseModel, - AsymmetricEncryptedSecret, - Authentication, - AzureContainerInfo, - BandwidthSchedule, - BaseResource, - ClientAccessRight, - CloudError, - ContactDetails, - Container, - DataBoxEdgeDevice, - DataBoxEdgeDeviceExtendedInfo, - DataBoxEdgeDeviceList, - DataBoxEdgeDevicePatch, - FileEventTrigger, - FileSourceInfo, - IoTDeviceInfo, - IoTRole, - Ipv4Config, - Ipv6Config, - MountPointMap, - NetworkAdapter, - NetworkAdapterPosition, - NetworkSettings, - Node, - Order, - OrderStatus, - PeriodicTimerEventTrigger, - PeriodicTimerSourceInfo, - RefreshDetails, - Role, - RoleSinkInfo, - SecuritySettings, - Share, - ShareAccessRight, - Sku, - StorageAccount, - StorageAccountCredential, - SymmetricKey, - TrackingInfo, - Trigger, - UpdateSummary, - UploadCertificateRequest, - UploadCertificateResponse, - User, - UserAccessRight -} from "../models/mappers"; diff --git a/sdk/databoxedge/arm-databoxedge-profile-2020-09-01-hybrid/src/models/index.ts b/sdk/databoxedge/arm-databoxedge-profile-2020-09-01-hybrid/src/models/index.ts index 32d02574968f..78b15da8f497 100644 --- a/sdk/databoxedge/arm-databoxedge-profile-2020-09-01-hybrid/src/models/index.ts +++ b/sdk/databoxedge/arm-databoxedge-profile-2020-09-01-hybrid/src/models/index.ts @@ -1,3666 +1,2897 @@ /* - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for license information. + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. * * 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"; +import * as coreClient from "@azure/core-client"; -export { BaseResource, CloudError }; +export type RoleUnion = Role | IoTRole; +export type TriggerUnion = + | Trigger + | FileEventTrigger + | PeriodicTimerEventTrigger; + +/** The list of operations used for the discovery of available provider operations. */ +export interface OperationsList { + /** The value. */ + value: Operation[]; + /** Link to the next set of results. */ + nextLink?: string; +} -/** - * The shipping address of the customer. - */ -export interface Address { +/** Operations. */ +export interface Operation { + /** Name of the operation. */ + name?: string; + /** Properties displayed for the operation. */ + display?: OperationDisplay; + /** Origin of the operation. */ + origin?: string; + /** Service specification. */ + serviceSpecification?: ServiceSpecification; +} + +/** Operation display properties. */ +export interface OperationDisplay { + /** Provider name. */ + provider?: string; + /** The type of resource in which the operation is performed. */ + resource?: string; + /** Operation to be performed on the resource. */ + operation?: string; + /** Description of the operation to be performed. */ + description?: string; +} + +/** Service specification. */ +export interface ServiceSpecification { + /** Metric specification as defined by shoebox. */ + metricSpecifications?: MetricSpecificationV1[]; +} + +/** Metric specification version 1. */ +export interface MetricSpecificationV1 { + /** Name of the metric. */ + name?: string; + /** Display name of the metric. */ + displayName?: string; + /** Description of the metric to be displayed. */ + displayDescription?: string; + /** Metric units. */ + unit?: MetricUnit; + /** Metric aggregation type. */ + aggregationType?: MetricAggregationType; + /** Metric dimensions, other than default dimension which is resource. */ + dimensions?: MetricDimensionV1[]; + /** Set true to fill the gaps with zero. */ + fillGapWithZero?: boolean; + /** Metric category. */ + category?: MetricCategory; + /** Resource name override. */ + resourceIdDimensionNameOverride?: string; + /** Support granularity of metrics. */ + supportedTimeGrainTypes?: TimeGrain[]; + /** Support metric aggregation type. */ + supportedAggregationTypes?: MetricAggregationType[]; +} + +/** Metric Dimension v1. */ +export interface MetricDimensionV1 { + /** Name of the metrics dimension. */ + name?: string; + /** Display name of the metrics dimension. */ + displayName?: string; + /** To be exported to shoe box. */ + toBeExportedForShoebox?: boolean; +} + +/** An error response from the service. */ +export interface CloudError { + /** The error details. */ + error?: CloudErrorBody; +} + +/** An error response from the service. */ +export interface CloudErrorBody { + /** An identifier for the error. Codes are invariant and are intended to be consumed programmatically. */ + code?: string; + /** A message describing the error, intended to be suitable for display in a user interface. */ + message?: string; + /** A list of additional details about the error. */ + details?: CloudErrorBody[]; +} + +/** The collection of Data Box Edge/Gateway devices. */ +export interface DataBoxEdgeDeviceList { /** - * The address line1. + * The list of Data Box Edge/Gateway devices. + * NOTE: This property will not be serialized. It can only be populated by the server. */ - addressLine1: string; + readonly value?: DataBoxEdgeDevice[]; /** - * The address line2. + * Link to the next set of results. + * NOTE: This property will not be serialized. It can only be populated by the server. */ - addressLine2?: string; + readonly nextLink?: string; +} + +/** The SKU type. */ +export interface Sku { + /** SKU name. */ + name?: SkuName; + /** The SKU tier. This is based on the SKU name. */ + tier?: SkuTier; +} + +/** Represents the base class for all object models. */ +export interface ARMBaseModel { /** - * The address line3. + * The path ID that uniquely identifies the object. + * NOTE: This property will not be serialized. It can only be populated by the server. */ - addressLine3?: string; + readonly id?: string; /** - * The postal code. + * The object name. + * NOTE: This property will not be serialized. It can only be populated by the server. */ - postalCode: string; + readonly name?: string; /** - * The city name. + * The hierarchical type of the object. + * NOTE: This property will not be serialized. It can only be populated by the server. */ - city: string; + readonly type?: string; +} + +/** The Data Box Edge/Gateway device patch. */ +export interface DataBoxEdgeDevicePatch { + /** The tags attached to the Data Box Edge/Gateway resource. */ + tags?: { [propertyName: string]: string }; +} + +/** Collection of alerts. */ +export interface AlertList { /** - * The state name. + * The value. + * NOTE: This property will not be serialized. It can only be populated by the server. */ - state: string; + readonly value?: Alert[]; /** - * The country name. + * Link to the next set of results. + * NOTE: This property will not be serialized. It can only be populated by the server. */ - country: string; + readonly nextLink?: string; } -/** - * Error details for the alert. - */ +/** Error details for the alert. */ export interface AlertErrorDetails { /** * Error code. - * **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 errorCode?: string; /** * Error Message. - * **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 errorMessage?: string; /** * Number of occurrences. - * **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 occurrences?: number; } -/** - * Represents the base class for all object models. - */ -export interface ARMBaseModel extends BaseResource { +/** The collection of bandwidth schedules. */ +export interface BandwidthSchedulesList { + /** + * The list of bandwidth schedules. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly value?: BandwidthSchedule[]; + /** + * Link to the next set of results. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly nextLink?: string; +} + +/** A device job. */ +export interface Job { /** * The path ID that uniquely identifies the object. - * **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; /** - * The object name. - * **NOTE: This property will not be serialized. It can only be populated by the server.** + * The name of the object. + * NOTE: This property will not be serialized. It can only be populated by the server. */ readonly name?: string; /** * The hierarchical type of the object. - * **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 type?: string; -} - -/** - * Alert on the data box edge/gateway device. - */ -export interface Alert extends ARMBaseModel { /** - * Alert title. - * **NOTE: This property will not be serialized. It can only be populated by the server.** + * The current status of the job. + * NOTE: This property will not be serialized. It can only be populated by the server. */ - readonly title?: string; + readonly status?: JobStatus; /** - * Alert type. - * **NOTE: This property will not be serialized. It can only be populated by the server.** + * The UTC date and time at which the job started. + * NOTE: This property will not be serialized. It can only be populated by the server. */ - readonly alertType?: string; + readonly startTime?: Date; /** - * UTC time when the alert appeared. - * **NOTE: This property will not be serialized. It can only be populated by the server.** + * The UTC date and time at which the job completed. + * NOTE: This property will not be serialized. It can only be populated by the server. */ - readonly appearedAtDateTime?: Date; + readonly endTime?: Date; /** - * Alert recommendation. - * **NOTE: This property will not be serialized. It can only be populated by the server.** + * The percentage of the job that is complete. + * NOTE: This property will not be serialized. It can only be populated by the server. */ - readonly recommendation?: string; + readonly percentComplete?: number; /** - * Severity of the alert. Possible values include: 'Informational', 'Warning', 'Critical' - * **NOTE: This property will not be serialized. It can only be populated by the server.** + * The error details. + * NOTE: This property will not be serialized. It can only be populated by the server. */ - readonly severity?: AlertSeverity; + readonly error?: JobErrorDetails; /** - * Error details of the alert. - * **NOTE: This property will not be serialized. It can only be populated by the server.** + * The type of the job. + * NOTE: This property will not be serialized. It can only be populated by the server. */ - readonly errorDetails?: AlertErrorDetails; + readonly jobType?: JobType; /** - * Alert details. - * **NOTE: This property will not be serialized. It can only be populated by the server.** + * Current stage of the update operation. + * NOTE: This property will not be serialized. It can only be populated by the server. */ - readonly detailedInformation?: { [propertyName: string]: string }; -} - -/** - * Represent the secrets intended for encryption with asymmetric key pair. - */ -export interface AsymmetricEncryptedSecret { + readonly currentStage?: UpdateOperationStage; /** - * The value of the secret. + * The download progress. + * NOTE: This property will not be serialized. It can only be populated by the server. */ - value: string; + readonly downloadProgress?: UpdateDownloadProgress; /** - * Thumbprint certificate used to encrypt \"Value\". If the value is unencrypted, it will be - * null. + * The install progress. + * NOTE: This property will not be serialized. It can only be populated by the server. */ - encryptionCertThumbprint?: string; + readonly installProgress?: UpdateInstallProgress; /** - * The algorithm used to encrypt "Value". Possible values include: 'None', 'AES256', - * 'RSAES_PKCS1_v_1_5' + * Total number of errors encountered during the refresh process. + * NOTE: This property will not be serialized. It can only be populated by the server. */ - encryptionAlgorithm: EncryptionAlgorithm; -} - -/** - * Symmetric key for authentication. - */ -export interface SymmetricKey { + readonly totalRefreshErrors?: number; /** - * Connection string based on the symmetric key. + * Local share/remote container relative path to the error manifest file of the refresh. + * NOTE: This property will not be serialized. It can only be populated by the server. */ - connectionString?: AsymmetricEncryptedSecret; -} - -/** - * Authentication mechanism for IoT devices. - */ -export interface Authentication { + readonly errorManifestFile?: string; /** - * Symmetric key for authentication. + * ARM ID of the entity that was refreshed. + * NOTE: This property will not be serialized. It can only be populated by the server. */ - symmetricKey?: SymmetricKey; + readonly refreshedEntityId?: string; + /** If only subfolders need to be refreshed, then the subfolder path inside the share or container. (The path is empty if there are no subfolders.) */ + folder?: string; } -/** - * Azure container mapping of the endpoint. - */ -export interface AzureContainerInfo { +/** The job error information containing the list of job errors. */ +export interface JobErrorDetails { /** - * ID of the storage account credential used to access storage. + * The error details. + * NOTE: This property will not be serialized. It can only be populated by the server. */ - storageAccountCredentialId: string; + readonly errorDetails?: JobErrorItem[]; /** - * Container name (Based on the data format specified, this represents the name of Azure - * Files/Page blob/Block blob). + * The code intended for programmatic access. + * NOTE: This property will not be serialized. It can only be populated by the server. */ - containerName: string; + readonly code?: string; /** - * Storage format used for the file represented by the share. Possible values include: - * 'BlockBlob', 'PageBlob', 'AzureFile' + * The message that describes the error in detail. + * NOTE: This property will not be serialized. It can only be populated by the server. */ - dataFormat: AzureContainerDataFormat; + readonly message?: string; } -/** - * The bandwidth schedule details. - */ -export interface BandwidthSchedule extends ARMBaseModel { - /** - * The start time of the schedule in UTC. - */ - start: string; +/** The job error items. */ +export interface JobErrorItem { /** - * The stop time of the schedule in UTC. + * The recommended actions. + * NOTE: This property will not be serialized. It can only be populated by the server. */ - stop: string; + readonly recommendations?: string[]; /** - * The bandwidth rate in Mbps. + * The code intended for programmatic access. + * NOTE: This property will not be serialized. It can only be populated by the server. */ - rateInMbps: number; + readonly code?: string; /** - * The days of the week when this schedule is applicable. + * The message that describes the error in detail. + * NOTE: This property will not be serialized. It can only be populated by the server. */ - days: DayOfWeek[]; + readonly message?: string; } -/** - * The mapping between a particular client IP and the type of access client has on the NFS share. - */ -export interface ClientAccessRight { +/** Details about the download progress of update. */ +export interface UpdateDownloadProgress { /** - * IP of the client. + * The download phase. + * NOTE: This property will not be serialized. It can only be populated by the server. */ - client: string; + readonly downloadPhase?: DownloadPhase; /** - * Type of access to be allowed for the client. Possible values include: 'NoAccess', 'ReadOnly', - * 'ReadWrite' + * Percentage of completion. + * NOTE: This property will not be serialized. It can only be populated by the server. */ - accessPermission: ClientPermissionType; -} - -/** - * Contains all the contact details of the customer. - */ -export interface ContactDetails { + readonly percentComplete?: number; /** - * The contact person name. + * Total bytes to download. + * NOTE: This property will not be serialized. It can only be populated by the server. */ - contactPerson: string; + readonly totalBytesToDownload?: number; /** - * The name of the company. + * Total bytes downloaded. + * NOTE: This property will not be serialized. It can only be populated by the server. */ - companyName: string; + readonly totalBytesDownloaded?: number; /** - * The phone number. + * Number of updates to download. + * NOTE: This property will not be serialized. It can only be populated by the server. */ - phone: string; + readonly numberOfUpdatesToDownload?: number; /** - * The email list. + * Number of updates downloaded. + * NOTE: This property will not be serialized. It can only be populated by the server. */ - emailList: string[]; + readonly numberOfUpdatesDownloaded?: number; } -/** - * Fields for tracking refresh job on the share or container. - */ -export interface RefreshDetails { - /** - * If a refresh job is currently in progress on this share or container, this field indicates the - * ARM resource ID of that job. The field is empty if no job is in progress. - */ - inProgressRefreshJobId?: string; +/** Progress details during installation of updates. */ +export interface UpdateInstallProgress { /** - * Indicates the completed time for the last refresh job on this particular share or container, - * if any.This could be a failed job or a successful job. + * Percentage completed. + * NOTE: This property will not be serialized. It can only be populated by the server. */ - lastCompletedRefreshJobTimeInUTC?: Date; + readonly percentComplete?: number; /** - * Indicates the relative path of the error xml for the last refresh job on this particular share - * or container, if any. This could be a failed job or a successful job. + * Number of updates to install. + * NOTE: This property will not be serialized. It can only be populated by the server. */ - errorManifestFile?: string; + readonly numberOfUpdatesToInstall?: number; /** - * Indicates the id of the last refresh job on this particular share or container,if any. This - * could be a failed job or a successful job. + * Number of updates installed. + * NOTE: This property will not be serialized. It can only be populated by the server. */ - lastJob?: string; + readonly numberOfUpdatesInstalled?: number; } -/** - * Represents a container on the Data Box Edge/Gateway device. - */ -export interface Container extends ARMBaseModel { +/** Represents the networkAdapter on a device. */ +export interface NetworkAdapter { /** - * Current status of the container. Possible values include: 'OK', 'Offline', 'Unknown', - * 'Updating', 'NeedsAttention' - * **NOTE: This property will not be serialized. It can only be populated by the server.** + * Instance ID of network adapter. + * NOTE: This property will not be serialized. It can only be populated by the server. */ - readonly containerStatus?: ContainerStatus; + readonly adapterId?: string; /** - * DataFormat for Container. Possible values include: 'BlockBlob', 'PageBlob', 'AzureFile' + * Hardware position of network adapter. + * NOTE: This property will not be serialized. It can only be populated by the server. */ - dataFormat: AzureContainerDataFormat; + readonly adapterPosition?: NetworkAdapterPosition; /** - * Details of the refresh job on this container. - * **NOTE: This property will not be serialized. It can only be populated by the server.** + * Logical index of the adapter. + * NOTE: This property will not be serialized. It can only be populated by the server. */ - readonly refreshDetails?: RefreshDetails; + readonly index?: number; /** - * The UTC time when container got created. - * **NOTE: This property will not be serialized. It can only be populated by the server.** + * Node ID of the network adapter. + * NOTE: This property will not be serialized. It can only be populated by the server. */ - readonly createdDateTime?: Date; -} - -/** - * The SKU type. - */ -export interface Sku { + readonly nodeId?: string; /** - * SKU name. Possible values include: 'Gateway', 'Edge', 'TEA_1Node', 'TEA_1Node_UPS', - * 'TEA_1Node_Heater', 'TEA_1Node_UPS_Heater', 'TEA_4Node_Heater', 'TEA_4Node_UPS_Heater', 'TMA' + * Network adapter name. + * NOTE: This property will not be serialized. It can only be populated by the server. */ - name?: SkuName; + readonly networkAdapterName?: string; /** - * The SKU tier. This is based on the SKU name. Possible values include: 'Standard' + * Hardware label for the adapter. + * NOTE: This property will not be serialized. It can only be populated by the server. */ - tier?: SkuTier; -} - -/** - * The Data Box Edge/Gateway device. - */ -export interface DataBoxEdgeDevice extends ARMBaseModel { + readonly label?: string; /** - * The location of the device. This is a supported and registered Azure geographical region (for - * example, West US, East US, or Southeast Asia). The geographical region of a device cannot be - * changed once it is created, but if an identical geographical region is specified on update, - * the request will succeed. + * MAC address. + * NOTE: This property will not be serialized. It can only be populated by the server. */ - location: string; - /** - * The list of tags that describe the device. These tags can be used to view and group this - * device (across resource groups). - */ - tags?: { [propertyName: string]: string }; - /** - * The SKU type. - */ - sku?: Sku; - /** - * The etag for the devices. - */ - etag?: string; - /** - * The status of the Data Box Edge/Gateway device. Possible values include: 'ReadyToSetup', - * 'Online', 'Offline', 'NeedsAttention', 'Disconnected', 'PartiallyDisconnected', 'Maintenance' - */ - dataBoxEdgeDeviceStatus?: DataBoxEdgeDeviceStatus; - /** - * The Serial Number of Data Box Edge/Gateway device. - * **NOTE: This property will not be serialized. It can only be populated by the server.** - */ - readonly serialNumber?: string; - /** - * The Description of the Data Box Edge/Gateway device. - */ - description?: string; + readonly macAddress?: string; /** - * The description of the Data Box Edge/Gateway device model. + * Link speed. + * NOTE: This property will not be serialized. It can only be populated by the server. */ - modelDescription?: string; + readonly linkSpeed?: number; /** - * The type of the Data Box Edge/Gateway device. Possible values include: 'DataBoxEdgeDevice' - * **NOTE: This property will not be serialized. It can only be populated by the server.** + * Value indicating whether this adapter is valid. + * NOTE: This property will not be serialized. It can only be populated by the server. */ - readonly deviceType?: DeviceType; + readonly status?: NetworkAdapterStatus; + /** Value indicating whether this adapter is RDMA capable. */ + rdmaStatus?: NetworkAdapterRdmaStatus; + /** Value indicating whether this adapter has DHCP enabled. */ + dhcpStatus?: NetworkAdapterDhcpStatus; /** - * The Data Box Edge/Gateway device name. + * The IPv4 configuration of the network adapter. + * NOTE: This property will not be serialized. It can only be populated by the server. */ - friendlyName?: string; + readonly ipv4Configuration?: Ipv4Config; /** - * The Data Box Edge/Gateway device culture. - * **NOTE: This property will not be serialized. It can only be populated by the server.** + * The IPv6 configuration of the network adapter. + * NOTE: This property will not be serialized. It can only be populated by the server. */ - readonly culture?: string; + readonly ipv6Configuration?: Ipv6Config; /** - * The Data Box Edge/Gateway device model. - * **NOTE: This property will not be serialized. It can only be populated by the server.** + * The IPv6 local address. + * NOTE: This property will not be serialized. It can only be populated by the server. */ - readonly deviceModel?: string; + readonly ipv6LinkLocalAddress?: string; /** - * The Data Box Edge/Gateway device software version. - * **NOTE: This property will not be serialized. It can only be populated by the server.** + * The list of DNS Servers of the device. + * NOTE: This property will not be serialized. It can only be populated by the server. */ - readonly deviceSoftwareVersion?: string; + readonly dnsServers?: string[]; +} + +/** The network adapter position. */ +export interface NetworkAdapterPosition { /** - * The Data Box Edge/Gateway device local capacity in MB. - * **NOTE: This property will not be serialized. It can only be populated by the server.** + * The network group. + * NOTE: This property will not be serialized. It can only be populated by the server. */ - readonly deviceLocalCapacity?: number; + readonly networkGroup?: NetworkGroup; /** - * The Data Box Edge/Gateway device timezone. - * **NOTE: This property will not be serialized. It can only be populated by the server.** + * The port. + * NOTE: This property will not be serialized. It can only be populated by the server. */ - readonly timeZone?: string; + readonly port?: number; +} + +/** Details related to the IPv4 address configuration. */ +export interface Ipv4Config { /** - * The device software version number of the device (eg: 1.2.18105.6). - * **NOTE: This property will not be serialized. It can only be populated by the server.** + * The IPv4 address of the network adapter. + * NOTE: This property will not be serialized. It can only be populated by the server. */ - readonly deviceHcsVersion?: string; + readonly ipAddress?: string; /** - * Type of compute roles configured. - * **NOTE: This property will not be serialized. It can only be populated by the server.** + * The IPv4 subnet of the network adapter. + * NOTE: This property will not be serialized. It can only be populated by the server. */ - readonly configuredRoleTypes?: RoleTypes[]; + readonly subnet?: string; /** - * The number of nodes in the cluster. - * **NOTE: This property will not be serialized. It can only be populated by the server.** + * The IPv4 gateway of the network adapter. + * NOTE: This property will not be serialized. It can only be populated by the server. */ - readonly nodeCount?: number; + readonly gateway?: string; } -/** - * The extended Info of the Data Box Edge/Gateway device. - */ -export interface DataBoxEdgeDeviceExtendedInfo extends ARMBaseModel { +/** Details related to the IPv6 address configuration. */ +export interface Ipv6Config { /** - * The digital signature of encrypted certificate. + * The IPv6 address of the network adapter. + * NOTE: This property will not be serialized. It can only be populated by the server. */ - encryptionKeyThumbprint?: string; + readonly ipAddress?: string; /** - * The public part of the encryption certificate. Client uses this to encrypt any secret. + * The IPv6 prefix of the network adapter. + * NOTE: This property will not be serialized. It can only be populated by the server. */ - encryptionKey?: string; + readonly prefixLength?: number; /** - * The Resource ID of the Resource. - * **NOTE: This property will not be serialized. It can only be populated by the server.** + * The IPv6 gateway of the network adapter. + * NOTE: This property will not be serialized. It can only be populated by the server. */ - readonly resourceKey?: string; + readonly gateway?: string; } -/** - * The Data Box Edge/Gateway device patch. - */ -export interface DataBoxEdgeDevicePatch { +/** Collection of Nodes. */ +export interface NodeList { /** - * The tags attached to the Data Box Edge/Gateway resource. + * The list of Nodes. + * NOTE: This property will not be serialized. It can only be populated by the server. */ - tags?: { [propertyName: string]: string }; + readonly value?: Node[]; } -/** - * File source details. - */ -export interface FileSourceInfo { +/** List of order entities. */ +export interface OrderList { /** - * File share ID. + * The list of orders. + * NOTE: This property will not be serialized. It can only be populated by the server. */ - shareId: string; -} - -/** - * Compute role against which events will be raised. - */ -export interface RoleSinkInfo { + readonly value?: Order[]; /** - * Compute role ID. + * Link to the next set of results. + * NOTE: This property will not be serialized. It can only be populated by the server. */ - roleId: string; + readonly nextLink?: string; } -/** - * Contains the possible cases for Trigger. - */ -export type TriggerUnion = Trigger | FileEventTrigger | PeriodicTimerEventTrigger; +/** Contains all the contact details of the customer. */ +export interface ContactDetails { + /** The contact person name. */ + contactPerson: string; + /** The name of the company. */ + companyName: string; + /** The phone number. */ + phone: string; + /** The email list. */ + emailList: string[]; +} -/** - * Trigger details. - */ -export interface Trigger { - /** - * Polymorphic Discriminator - */ - kind: "Trigger"; - /** - * The path ID that uniquely identifies the object. - * **NOTE: This property will not be serialized. It can only be populated by the server.** - */ - readonly id?: string; - /** - * The object name. - * **NOTE: This property will not be serialized. It can only be populated by the server.** - */ - readonly name?: string; - /** - * The hierarchical type of the object. - * **NOTE: This property will not be serialized. It can only be populated by the server.** - */ - readonly type?: string; +/** The shipping address of the customer. */ +export interface Address { + /** The address line1. */ + addressLine1: string; + /** The address line2. */ + addressLine2?: string; + /** The address line3. */ + addressLine3?: string; + /** The postal code. */ + postalCode: string; + /** The city name. */ + city: string; + /** The state name. */ + state: string; + /** The country name. */ + country: string; } -/** - * Trigger details. - */ -export interface FileEventTrigger { - /** - * Polymorphic Discriminator - */ - kind: "FileEvent"; - /** - * The path ID that uniquely identifies the object. - * **NOTE: This property will not be serialized. It can only be populated by the server.** - */ - readonly id?: string; - /** - * The object name. - * **NOTE: This property will not be serialized. It can only be populated by the server.** - */ - readonly name?: string; - /** - * The hierarchical type of the object. - * **NOTE: This property will not be serialized. It can only be populated by the server.** - */ - readonly type?: string; - /** - * File event source details. - */ - sourceInfo: FileSourceInfo; +/** Represents a single status change. */ +export interface OrderStatus { + /** Status of the order as per the allowed status types. */ + status: OrderState; /** - * Role sink info. + * Time of status update. + * NOTE: This property will not be serialized. It can only be populated by the server. */ - sinkInfo: RoleSinkInfo; + readonly updateDateTime?: Date; + /** Comments related to this status change. */ + comments?: string; /** - * A custom context tag typically used to correlate the trigger against its usage. For example, - * if a periodic timer trigger is intended for certain specific IoT modules in the device, the - * tag can be the name or the image URL of the module. + * Dictionary to hold generic information which is not stored + * by the already existing properties + * NOTE: This property will not be serialized. It can only be populated by the server. */ - customContextTag?: string; + readonly additionalOrderDetails?: { [propertyName: string]: string }; } -/** - * Metadata of IoT device/IoT Edge device to be configured. - */ -export interface IoTDeviceInfo { +/** Tracking courier information. */ +export interface TrackingInfo { + /** Serial number of the device being tracked. */ + serialNumber?: string; + /** Name of the carrier used in the delivery. */ + carrierName?: string; + /** Tracking ID of the shipment. */ + trackingId?: string; + /** Tracking URL of the shipment. */ + trackingUrl?: string; +} + +/** Collection of all the roles on the Data Box Edge device. */ +export interface RoleList { /** - * ID of the IoT device/edge device. + * The Value. + * NOTE: This property will not be serialized. It can only be populated by the server. */ - deviceId: string; + readonly value?: RoleUnion[]; /** - * Host name for the IoT hub associated to the device. + * Link to the next set of results. + * NOTE: This property will not be serialized. It can only be populated by the server. */ - ioTHostHub: string; + readonly nextLink?: string; +} + +/** Represent the secrets intended for encryption with asymmetric key pair. */ +export interface AsymmetricEncryptedSecret { + /** The value of the secret. */ + value: string; + /** Thumbprint certificate used to encrypt \"Value\". If the value is unencrypted, it will be null. */ + encryptionCertThumbprint?: string; + /** The algorithm used to encrypt "Value". */ + encryptionAlgorithm: EncryptionAlgorithm; +} + +/** Collection of all the shares on the Data Box Edge/Gateway device. */ +export interface ShareList { /** - * Id for the IoT hub associated to the device. + * The list of shares. + * NOTE: This property will not be serialized. It can only be populated by the server. */ - ioTHostHubId?: string; + readonly value?: Share[]; /** - * IoT device authentication info. + * Link to the next set of results. + * NOTE: This property will not be serialized. It can only be populated by the server. */ - authentication?: Authentication; + readonly nextLink?: string; } -/** - * The share mount point. - */ +/** Azure container mapping of the endpoint. */ +export interface AzureContainerInfo { + /** ID of the storage account credential used to access storage. */ + storageAccountCredentialId: string; + /** Container name (Based on the data format specified, this represents the name of Azure Files/Page blob/Block blob). */ + containerName: string; + /** Storage format used for the file represented by the share. */ + dataFormat: AzureContainerDataFormat; +} + +/** The mapping between a particular user and the access type on the SMB share. */ +export interface UserAccessRight { + /** User ID (already existing in the device). */ + userId: string; + /** Type of access to be allowed for the user. */ + accessType: ShareAccessType; +} + +/** The mapping between a particular client IP and the type of access client has on the NFS share. */ +export interface ClientAccessRight { + /** IP of the client. */ + client: string; + /** Type of access to be allowed for the client. */ + accessPermission: ClientPermissionType; +} + +/** Fields for tracking refresh job on the share or container. */ +export interface RefreshDetails { + /** If a refresh job is currently in progress on this share or container, this field indicates the ARM resource ID of that job. The field is empty if no job is in progress. */ + inProgressRefreshJobId?: string; + /** Indicates the completed time for the last refresh job on this particular share or container, if any.This could be a failed job or a successful job. */ + lastCompletedRefreshJobTimeInUTC?: Date; + /** Indicates the relative path of the error xml for the last refresh job on this particular share or container, if any. This could be a failed job or a successful job. */ + errorManifestFile?: string; + /** Indicates the id of the last refresh job on this particular share or container,if any. This could be a failed job or a successful job. */ + lastJob?: string; +} + +/** The share mount point. */ export interface MountPointMap { - /** - * ID of the share mounted to the role VM. - */ + /** ID of the share mounted to the role VM. */ shareId: string; /** * ID of the role to which share is mounted. - * **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 roleId?: string; /** * Mount point for the share. - * **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 mountPoint?: string; /** - * Role type. Possible values include: 'IOT', 'ASA', 'Functions', 'Cognitive' - * **NOTE: This property will not be serialized. It can only be populated by the server.** + * Role type. + * NOTE: This property will not be serialized. It can only be populated by the server. */ readonly roleType?: RoleTypes; } -/** - * Contains the possible cases for Role. - */ -export type RoleUnion = Role | IoTRole; - -/** - * Compute role. - */ -export interface Role { +/** The collection of storage account credentials. */ +export interface StorageAccountCredentialList { /** - * Polymorphic Discriminator + * The value. + * NOTE: This property will not be serialized. It can only be populated by the server. */ - kind: "Role"; + readonly value?: StorageAccountCredential[]; /** - * The path ID that uniquely identifies the object. - * **NOTE: This property will not be serialized. It can only be populated by the server.** + * Link to the next set of results. + * NOTE: This property will not be serialized. It can only be populated by the server. */ - readonly id?: string; + readonly nextLink?: string; +} + +/** Collection of all the Storage Accounts on the Data Box Edge/Gateway device. */ +export interface StorageAccountList { /** - * The object name. - * **NOTE: This property will not be serialized. It can only be populated by the server.** + * The list of storageAccounts. + * NOTE: This property will not be serialized. It can only be populated by the server. */ - readonly name?: string; + readonly value?: StorageAccount[]; /** - * The hierarchical type of the object. - * **NOTE: This property will not be serialized. It can only be populated by the server.** + * Link to the next set of results. + * NOTE: This property will not be serialized. It can only be populated by the server. */ - readonly type?: string; + readonly nextLink?: string; } -/** - * Compute role. - */ -export interface IoTRole { +/** Collection of all the containers on the Data Box Edge/Gateway device. */ +export interface ContainerList { /** - * Polymorphic Discriminator + * The list of containers. + * NOTE: This property will not be serialized. It can only be populated by the server. */ - kind: "IOT"; + readonly value?: Container[]; /** - * The path ID that uniquely identifies the object. - * **NOTE: This property will not be serialized. It can only be populated by the server.** + * Link to the next set of results. + * NOTE: This property will not be serialized. It can only be populated by the server. */ - readonly id?: string; + readonly nextLink?: string; +} + +/** Collection of all trigger on the data box edge device. */ +export interface TriggerList { /** - * The object name. - * **NOTE: This property will not be serialized. It can only be populated by the server.** + * The list of triggers. + * NOTE: This property will not be serialized. It can only be populated by the server. */ - readonly name?: string; + readonly value?: TriggerUnion[]; /** - * The hierarchical type of the object. - * **NOTE: This property will not be serialized. It can only be populated by the server.** + * Link to the next set of results. + * NOTE: This property will not be serialized. It can only be populated by the server. */ - readonly type?: string; + readonly nextLink?: string; +} + +/** The upload certificate request. */ +export interface UploadCertificateRequest { + /** The authentication type. */ + authenticationType?: AuthenticationType; + /** The base64 encoded certificate raw data. */ + certificate: string; +} + +/** The upload registration certificate response. */ +export interface UploadCertificateResponse { + /** Specifies authentication type. */ + authType?: AuthenticationType; /** - * Host OS supported by the IoT role. Possible values include: 'Windows', 'Linux' + * The resource ID of the Data Box Edge/Gateway device. + * NOTE: This property will not be serialized. It can only be populated by the server. */ - hostPlatform: PlatformType; + readonly resourceId?: string; /** - * IoT device metadata to which data box edge device needs to be connected. + * Azure Active Directory tenant authority. + * NOTE: This property will not be serialized. It can only be populated by the server. */ - ioTDeviceDetails: IoTDeviceInfo; + readonly aadAuthority?: string; /** - * IoT edge device to which the IoT role needs to be configured. + * Azure Active Directory tenant ID. + * NOTE: This property will not be serialized. It can only be populated by the server. */ - ioTEdgeDeviceDetails: IoTDeviceInfo; + readonly aadTenantId?: string; /** - * Mount points of shares in role(s). + * Azure Active Directory service principal client ID. + * NOTE: This property will not be serialized. It can only be populated by the server. */ - shareMappings?: MountPointMap[]; - /** - * Role status. Possible values include: 'Enabled', 'Disabled' - */ - roleStatus: RoleStatus; -} - -/** - * Details related to the IPv4 address configuration. - */ -export interface Ipv4Config { + readonly servicePrincipalClientId?: string; /** - * The IPv4 address of the network adapter. - * **NOTE: This property will not be serialized. It can only be populated by the server.** + * Azure Active Directory service principal object ID. + * NOTE: This property will not be serialized. It can only be populated by the server. */ - readonly ipAddress?: string; + readonly servicePrincipalObjectId?: string; /** - * The IPv4 subnet of the network adapter. - * **NOTE: This property will not be serialized. It can only be populated by the server.** + * The azure management endpoint audience. + * NOTE: This property will not be serialized. It can only be populated by the server. */ - readonly subnet?: string; + readonly azureManagementEndpointAudience?: string; /** - * The IPv4 gateway of the network adapter. - * **NOTE: This property will not be serialized. It can only be populated by the server.** + * Identifier of the target resource that is the recipient of the requested token. + * NOTE: This property will not be serialized. It can only be populated by the server. */ - readonly gateway?: string; + readonly aadAudience?: string; } -/** - * Details related to the IPv6 address configuration. - */ -export interface Ipv6Config { +/** Collection of users. */ +export interface UserList { /** - * The IPv6 address of the network adapter. - * **NOTE: This property will not be serialized. It can only be populated by the server.** - */ - readonly ipAddress?: string; - /** - * The IPv6 prefix of the network adapter. - * **NOTE: This property will not be serialized. It can only be populated by the server.** + * The list of users. + * NOTE: This property will not be serialized. It can only be populated by the server. */ - readonly prefixLength?: number; + readonly value?: User[]; /** - * The IPv6 gateway of the network adapter. - * **NOTE: This property will not be serialized. It can only be populated by the server.** + * Link to the next set of results. + * NOTE: This property will not be serialized. It can only be populated by the server. */ - readonly gateway?: string; + readonly nextLink?: string; } -/** - * The job error items. - */ -export interface JobErrorItem { - /** - * The recommended actions. - * **NOTE: This property will not be serialized. It can only be populated by the server.** - */ - readonly recommendations?: string[]; +/** Specifies the mapping between this particular user and the type of access he has on shares on this device. */ +export interface ShareAccessRight { + /** The share ID. */ + shareId: string; + /** Type of access to be allowed on the share for this user. */ + accessType: ShareAccessType; +} + +/** List of SKU Information objects */ +export interface SkuInformationList { /** - * The code intended for programmatic access. - * **NOTE: This property will not be serialized. It can only be populated by the server.** + * List of ResourceType Sku + * NOTE: This property will not be serialized. It can only be populated by the server. */ - readonly code?: string; + readonly value?: ResourceTypeSku[]; /** - * The message that describes the error in detail. - * **NOTE: This property will not be serialized. It can only be populated by the server.** + * Links to the next set of results + * NOTE: This property will not be serialized. It can only be populated by the server. */ - readonly message?: string; + readonly nextLink?: string; } -/** - * The job error information containing the list of job errors. - */ -export interface JobErrorDetails { +/** SkuInformation object */ +export interface ResourceTypeSku { /** - * The error details. - * **NOTE: This property will not be serialized. It can only be populated by the server.** + * The type of the resource + * NOTE: This property will not be serialized. It can only be populated by the server. */ - readonly errorDetails?: JobErrorItem[]; + readonly resourceType?: string; /** - * The code intended for programmatic access. - * **NOTE: This property will not be serialized. It can only be populated by the server.** + * The Sku name + * NOTE: This property will not be serialized. It can only be populated by the server. */ - readonly code?: string; + readonly name?: SkuName; /** - * The message that describes the error in detail. - * **NOTE: This property will not be serialized. It can only be populated by the server.** + * The Sku kind + * NOTE: This property will not be serialized. It can only be populated by the server. */ - readonly message?: string; -} - -/** - * Details about the download progress of update. - */ -export interface UpdateDownloadProgress { + readonly kind?: string; /** - * The download phase. Possible values include: 'Unknown', 'Initializing', 'Downloading', - * 'Verifying' - * **NOTE: This property will not be serialized. It can only be populated by the server.** + * The Sku tier + * NOTE: This property will not be serialized. It can only be populated by the server. */ - readonly downloadPhase?: DownloadPhase; + readonly tier?: SkuTier; /** - * Percentage of completion. - * **NOTE: This property will not be serialized. It can only be populated by the server.** + * The Sku family + * NOTE: This property will not be serialized. It can only be populated by the server. */ - readonly percentComplete?: number; + readonly family?: string; /** - * Total bytes to download. - * **NOTE: This property will not be serialized. It can only be populated by the server.** + * Availability of the SKU for the region + * NOTE: This property will not be serialized. It can only be populated by the server. */ - readonly totalBytesToDownload?: number; + readonly locations?: string[]; /** - * Total bytes downloaded. - * **NOTE: This property will not be serialized. It can only be populated by the server.** + * The API versions in which SKU is available + * NOTE: This property will not be serialized. It can only be populated by the server. */ - readonly totalBytesDownloaded?: number; + readonly apiVersions?: string[]; /** - * Number of updates to download. - * **NOTE: This property will not be serialized. It can only be populated by the server.** + * Availability of the SKU for the location/zone + * NOTE: This property will not be serialized. It can only be populated by the server. */ - readonly numberOfUpdatesToDownload?: number; + readonly locationInfo?: SkuLocationInfo[]; /** - * Number of updates downloaded. - * **NOTE: This property will not be serialized. It can only be populated by the server.** + * The pricing info of the Sku. + * NOTE: This property will not be serialized. It can only be populated by the server. */ - readonly numberOfUpdatesDownloaded?: number; + readonly costs?: SkuCost[]; + /** + * Restrictions of the SKU availability. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly restrictions?: SkuRestriction[]; } -/** - * Progress details during installation of updates. - */ -export interface UpdateInstallProgress { +/** The location info. */ +export interface SkuLocationInfo { /** - * Percentage completed. - * **NOTE: This property will not be serialized. It can only be populated by the server.** + * The location. + * NOTE: This property will not be serialized. It can only be populated by the server. */ - readonly percentComplete?: number; + readonly location?: string; /** - * Number of updates to install. - * **NOTE: This property will not be serialized. It can only be populated by the server.** + * The zones. + * NOTE: This property will not be serialized. It can only be populated by the server. */ - readonly numberOfUpdatesToInstall?: number; + readonly zones?: string[]; /** - * Number of updates installed. - * **NOTE: This property will not be serialized. It can only be populated by the server.** + * The sites. + * NOTE: This property will not be serialized. It can only be populated by the server. */ - readonly numberOfUpdatesInstalled?: number; + readonly sites?: string[]; } -/** - * A device job. - */ -export interface Job { +/** The metadata for retrieving price info. */ +export interface SkuCost { /** - * The path ID that uniquely identifies the object. - * **NOTE: This property will not be serialized. It can only be populated by the server.** + * Used for querying price from commerce. + * NOTE: This property will not be serialized. It can only be populated by the server. */ - readonly id?: string; + readonly meterId?: string; /** - * The name of the object. - * **NOTE: This property will not be serialized. It can only be populated by the server.** + * The cost quantity. + * NOTE: This property will not be serialized. It can only be populated by the server. */ - readonly name?: string; + readonly quantity?: number; /** - * The hierarchical type of the object. - * **NOTE: This property will not be serialized. It can only be populated by the server.** + * Restriction of the SKU for the location/zone + * NOTE: This property will not be serialized. It can only be populated by the server. */ - readonly type?: string; + readonly extendedUnit?: string; +} + +/** The restrictions because of which SKU cannot be used. */ +export interface SkuRestriction { /** - * The current status of the job. Possible values include: 'Invalid', 'Running', 'Succeeded', - * 'Failed', 'Canceled', 'Paused', 'Scheduled' - * **NOTE: This property will not be serialized. It can only be populated by the server.** + * The type of the restriction. + * NOTE: This property will not be serialized. It can only be populated by the server. */ - readonly status?: JobStatus; + readonly type?: string; /** - * The UTC date and time at which the job started. - * **NOTE: This property will not be serialized. It can only be populated by the server.** + * The locations where sku is restricted. + * NOTE: This property will not be serialized. It can only be populated by the server. */ - readonly startTime?: Date; + readonly values?: string[]; /** - * The UTC date and time at which the job completed. - * **NOTE: This property will not be serialized. It can only be populated by the server.** + * The SKU restriction reason. + * NOTE: This property will not be serialized. It can only be populated by the server. */ - readonly endTime?: Date; + readonly reasonCode?: SkuRestrictionReasonCode; /** - * The percentage of the job that is complete. - * **NOTE: This property will not be serialized. It can only be populated by the server.** + * Restriction of the SKU for the location/zone + * NOTE: This property will not be serialized. It can only be populated by the server. */ - readonly percentComplete?: number; + readonly restrictionInfo?: SkuRestrictionInfo; +} + +/** The restriction info with locations and zones. */ +export interface SkuRestrictionInfo { /** - * The error details. - * **NOTE: This property will not be serialized. It can only be populated by the server.** + * The locations. + * NOTE: This property will not be serialized. It can only be populated by the server. */ - readonly error?: JobErrorDetails; + readonly locations?: string[]; /** - * The type of the job. Possible values include: 'Invalid', 'ScanForUpdates', 'DownloadUpdates', - * 'InstallUpdates', 'RefreshShare', 'RefreshContainer' - * **NOTE: This property will not be serialized. It can only be populated by the server.** + * The zones. + * NOTE: This property will not be serialized. It can only be populated by the server. */ - readonly jobType?: JobType; + readonly zones?: string[]; +} + +/** Authentication mechanism for IoT devices. */ +export interface Authentication { + /** Symmetric key for authentication. */ + symmetricKey?: SymmetricKey; +} + +/** Symmetric key for authentication. */ +export interface SymmetricKey { + /** Connection string based on the symmetric key. */ + connectionString?: AsymmetricEncryptedSecret; +} + +/** File source details. */ +export interface FileSourceInfo { + /** File share ID. */ + shareId: string; +} + +/** Compute role against which events will be raised. */ +export interface RoleSinkInfo { + /** Compute role ID. */ + roleId: string; +} + +/** Metadata of IoT device/IoT Edge device to be configured. */ +export interface IoTDeviceInfo { + /** ID of the IoT device/edge device. */ + deviceId: string; + /** Host name for the IoT hub associated to the device. */ + ioTHostHub: string; + /** Id for the IoT hub associated to the device. */ + ioTHostHubId?: string; + /** IoT device authentication info. */ + authentication?: Authentication; +} + +/** Periodic timer event source. */ +export interface PeriodicTimerSourceInfo { + /** The time of the day that results in a valid trigger. Schedule is computed with reference to the time specified upto seconds. If timezone is not specified the time will considered to be in device timezone. The value will always be returned as UTC time. */ + startTime: Date; + /** Periodic frequency at which timer event needs to be raised. Supports daily, hourly, minutes, and seconds. */ + schedule: string; + /** Topic where periodic events are published to IoT device. */ + topic?: string; +} + +/** The Data Box Edge/Gateway device. */ +export type DataBoxEdgeDevice = ARMBaseModel & { + /** The location of the device. This is a supported and registered Azure geographical region (for example, West US, East US, or Southeast Asia). The geographical region of a device cannot be changed once it is created, but if an identical geographical region is specified on update, the request will succeed. */ + location: string; + /** The list of tags that describe the device. These tags can be used to view and group this device (across resource groups). */ + tags?: { [propertyName: string]: string }; + /** The SKU type. */ + sku?: Sku; + /** The etag for the devices. */ + etag?: string; + /** The status of the Data Box Edge/Gateway device. */ + dataBoxEdgeDeviceStatus?: DataBoxEdgeDeviceStatus; /** - * Current stage of the update operation. Possible values include: 'Unknown', 'Initial', - * 'ScanStarted', 'ScanComplete', 'ScanFailed', 'DownloadStarted', 'DownloadComplete', - * 'DownloadFailed', 'InstallStarted', 'InstallComplete', 'InstallFailed', 'RebootInitiated', - * 'Success', 'Failure', 'RescanStarted', 'RescanComplete', 'RescanFailed' - * **NOTE: This property will not be serialized. It can only be populated by the server.** + * The Serial Number of Data Box Edge/Gateway device. + * NOTE: This property will not be serialized. It can only be populated by the server. */ - readonly currentStage?: UpdateOperationStage; + readonly serialNumber?: string; + /** The Description of the Data Box Edge/Gateway device. */ + description?: string; + /** The description of the Data Box Edge/Gateway device model. */ + modelDescription?: string; /** - * The download progress. - * **NOTE: This property will not be serialized. It can only be populated by the server.** + * The type of the Data Box Edge/Gateway device. + * NOTE: This property will not be serialized. It can only be populated by the server. */ - readonly downloadProgress?: UpdateDownloadProgress; + readonly deviceType?: DeviceType; + /** The Data Box Edge/Gateway device name. */ + friendlyName?: string; /** - * The install progress. - * **NOTE: This property will not be serialized. It can only be populated by the server.** + * The Data Box Edge/Gateway device culture. + * NOTE: This property will not be serialized. It can only be populated by the server. */ - readonly installProgress?: UpdateInstallProgress; + readonly culture?: string; /** - * Total number of errors encountered during the refresh process. - * **NOTE: This property will not be serialized. It can only be populated by the server.** + * The Data Box Edge/Gateway device model. + * NOTE: This property will not be serialized. It can only be populated by the server. */ - readonly totalRefreshErrors?: number; + readonly deviceModel?: string; /** - * Local share/remote container relative path to the error manifest file of the refresh. - * **NOTE: This property will not be serialized. It can only be populated by the server.** + * The Data Box Edge/Gateway device software version. + * NOTE: This property will not be serialized. It can only be populated by the server. */ - readonly errorManifestFile?: string; + readonly deviceSoftwareVersion?: string; /** - * ARM ID of the entity that was refreshed. - * **NOTE: This property will not be serialized. It can only be populated by the server.** + * The Data Box Edge/Gateway device local capacity in MB. + * NOTE: This property will not be serialized. It can only be populated by the server. */ - readonly refreshedEntityId?: string; + readonly deviceLocalCapacity?: number; /** - * If only subfolders need to be refreshed, then the subfolder path inside the share or - * container. (The path is empty if there are no subfolders.) + * The Data Box Edge/Gateway device timezone. + * NOTE: This property will not be serialized. It can only be populated by the server. */ - folder?: string; -} - -/** - * Metric Dimension v1. - */ -export interface MetricDimensionV1 { + readonly timeZone?: string; /** - * Name of the metrics dimension. + * The device software version number of the device (eg: 1.2.18105.6). + * NOTE: This property will not be serialized. It can only be populated by the server. */ - name?: string; + readonly deviceHcsVersion?: string; /** - * Display name of the metrics dimension. + * Type of compute roles configured. + * NOTE: This property will not be serialized. It can only be populated by the server. */ - displayName?: string; + readonly configuredRoleTypes?: RoleTypes[]; /** - * To be exported to shoe box. + * The number of nodes in the cluster. + * NOTE: This property will not be serialized. It can only be populated by the server. */ - toBeExportedForShoebox?: boolean; -} + readonly nodeCount?: number; +}; -/** - * Metric specification version 1. - */ -export interface MetricSpecificationV1 { +/** Alert on the data box edge/gateway device. */ +export type Alert = ARMBaseModel & { /** - * Name of the metric. + * Alert title. + * NOTE: This property will not be serialized. It can only be populated by the server. */ - name?: string; + readonly title?: string; /** - * Display name of the metric. + * Alert type. + * NOTE: This property will not be serialized. It can only be populated by the server. */ - displayName?: string; + readonly alertType?: string; /** - * Description of the metric to be displayed. + * UTC time when the alert appeared. + * NOTE: This property will not be serialized. It can only be populated by the server. */ - displayDescription?: string; + readonly appearedAtDateTime?: Date; /** - * Metric units. Possible values include: 'NotSpecified', 'Percent', 'Count', 'Seconds', - * 'Milliseconds', 'Bytes', 'BytesPerSecond', 'CountPerSecond' + * Alert recommendation. + * NOTE: This property will not be serialized. It can only be populated by the server. */ - unit?: MetricUnit; + readonly recommendation?: string; /** - * Metric aggregation type. Possible values include: 'NotSpecified', 'None', 'Average', - * 'Minimum', 'Maximum', 'Total', 'Count' + * Severity of the alert. + * NOTE: This property will not be serialized. It can only be populated by the server. */ - aggregationType?: MetricAggregationType; + readonly severity?: AlertSeverity; /** - * Metric dimensions, other than default dimension which is resource. + * Error details of the alert. + * NOTE: This property will not be serialized. It can only be populated by the server. */ - dimensions?: MetricDimensionV1[]; - /** - * Set true to fill the gaps with zero. - */ - fillGapWithZero?: boolean; - /** - * Metric category. Possible values include: 'Capacity', 'Transaction' - */ - category?: MetricCategory; - /** - * Resource name override. - */ - resourceIdDimensionNameOverride?: string; - /** - * Support granularity of metrics. - */ - supportedTimeGrainTypes?: TimeGrain[]; + readonly errorDetails?: AlertErrorDetails; /** - * Support metric aggregation type. + * Alert details. + * NOTE: This property will not be serialized. It can only be populated by the server. */ - supportedAggregationTypes?: MetricAggregationType[]; -} + readonly detailedInformation?: { [propertyName: string]: string }; +}; -/** - * The network adapter position. - */ -export interface NetworkAdapterPosition { - /** - * The network group. Possible values include: 'None', 'NonRDMA', 'RDMA' - * **NOTE: This property will not be serialized. It can only be populated by the server.** - */ - readonly networkGroup?: NetworkGroup; - /** - * The port. - * **NOTE: This property will not be serialized. It can only be populated by the server.** - */ - readonly port?: number; -} +/** The bandwidth schedule details. */ +export type BandwidthSchedule = ARMBaseModel & { + /** The start time of the schedule in UTC. */ + start: string; + /** The stop time of the schedule in UTC. */ + stop: string; + /** The bandwidth rate in Mbps. */ + rateInMbps: number; + /** The days of the week when this schedule is applicable. */ + days: DayOfWeek[]; +}; -/** - * Represents the networkAdapter on a device. - */ -export interface NetworkAdapter { - /** - * Instance ID of network adapter. - * **NOTE: This property will not be serialized. It can only be populated by the server.** - */ - readonly adapterId?: string; - /** - * Hardware position of network adapter. - * **NOTE: This property will not be serialized. It can only be populated by the server.** - */ - readonly adapterPosition?: NetworkAdapterPosition; - /** - * Logical index of the adapter. - * **NOTE: This property will not be serialized. It can only be populated by the server.** - */ - readonly index?: number; - /** - * Node ID of the network adapter. - * **NOTE: This property will not be serialized. It can only be populated by the server.** - */ - readonly nodeId?: string; - /** - * Network adapter name. - * **NOTE: This property will not be serialized. It can only be populated by the server.** - */ - readonly networkAdapterName?: string; - /** - * Hardware label for the adapter. - * **NOTE: This property will not be serialized. It can only be populated by the server.** - */ - readonly label?: string; - /** - * MAC address. - * **NOTE: This property will not be serialized. It can only be populated by the server.** - */ - readonly macAddress?: string; - /** - * Link speed. - * **NOTE: This property will not be serialized. It can only be populated by the server.** - */ - readonly linkSpeed?: number; - /** - * Value indicating whether this adapter is valid. Possible values include: 'Inactive', 'Active' - * **NOTE: This property will not be serialized. It can only be populated by the server.** - */ - readonly status?: NetworkAdapterStatus; - /** - * Value indicating whether this adapter is RDMA capable. Possible values include: 'Incapable', - * 'Capable' - */ - rdmaStatus?: NetworkAdapterRDMAStatus; - /** - * Value indicating whether this adapter has DHCP enabled. Possible values include: 'Disabled', - * 'Enabled' - */ - dhcpStatus?: NetworkAdapterDHCPStatus; - /** - * The IPv4 configuration of the network adapter. - * **NOTE: This property will not be serialized. It can only be populated by the server.** - */ - readonly ipv4Configuration?: Ipv4Config; - /** - * The IPv6 configuration of the network adapter. - * **NOTE: This property will not be serialized. It can only be populated by the server.** - */ - readonly ipv6Configuration?: Ipv6Config; - /** - * The IPv6 local address. - * **NOTE: This property will not be serialized. It can only be populated by the server.** - */ - readonly ipv6LinkLocalAddress?: string; +/** The extended Info of the Data Box Edge/Gateway device. */ +export type DataBoxEdgeDeviceExtendedInfo = ARMBaseModel & { + /** The digital signature of encrypted certificate. */ + encryptionKeyThumbprint?: string; + /** The public part of the encryption certificate. Client uses this to encrypt any secret. */ + encryptionKey?: string; /** - * The list of DNS Servers of the device. - * **NOTE: This property will not be serialized. It can only be populated by the server.** + * The Resource ID of the Resource. + * NOTE: This property will not be serialized. It can only be populated by the server. */ - readonly dnsServers?: string[]; -} + readonly resourceKey?: string; +}; -/** - * The network settings of a device. - */ -export interface NetworkSettings extends ARMBaseModel { +/** The network settings of a device. */ +export type NetworkSettings = ARMBaseModel & { /** * The network adapter list on the device. - * **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 networkAdapters?: NetworkAdapter[]; -} +}; /** * Represents a single node in a Data box Edge/Gateway device - * Gateway devices, standalone Edge devices and a single node cluster Edge device will all have 1 - * node + * Gateway devices, standalone Edge devices and a single node cluster Edge device will all have 1 node * Multi-node Edge devices will have more than 1 nodes */ -export interface Node extends ARMBaseModel { +export type Node = ARMBaseModel & { /** - * The current status of the individual node. Possible values include: 'Unknown', 'Up', 'Down', - * 'Rebooting', 'ShuttingDown' - * **NOTE: This property will not be serialized. It can only be populated by the server.** + * The current status of the individual node + * NOTE: This property will not be serialized. It can only be populated by the server. */ readonly nodeStatus?: NodeStatus; /** * Serial number of the Chassis - * **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 nodeChassisSerialNumber?: string; /** * Serial number of the individual node - * **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 nodeSerialNumber?: string; /** * Display Name of the individual node - * **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 nodeDisplayName?: string; /** * Friendly software version name that is currently installed on the node - * **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 nodeFriendlySoftwareVersion?: string; /** * HCS version that is currently installed on the node - * **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 nodeHcsVersion?: string; /** * Guid instance id of the node - * **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 nodeInstanceId?: string; -} +}; -/** - * Operation display properties. - */ -export interface OperationDisplay { +/** The order details. */ +export type Order = ARMBaseModel & { + /** The contact details. */ + contactInformation?: ContactDetails; + /** The shipping address. */ + shippingAddress?: Address; + /** Current status of the order. */ + currentStatus?: OrderStatus; /** - * Provider name. + * List of status changes in the order. + * NOTE: This property will not be serialized. It can only be populated by the server. */ - provider?: string; + readonly orderHistory?: OrderStatus[]; /** - * The type of resource in which the operation is performed. + * Serial number of the device. + * NOTE: This property will not be serialized. It can only be populated by the server. */ - resource?: string; + readonly serialNumber?: string; /** - * Operation to be performed on the resource. + * Tracking information for the package delivered to the customer whether it has an original or a replacement device. + * NOTE: This property will not be serialized. It can only be populated by the server. */ - operation?: string; + readonly deliveryTrackingInfo?: TrackingInfo[]; /** - * Description of the operation to be performed. + * Tracking information for the package returned from the customer whether it has an original or a replacement device. + * NOTE: This property will not be serialized. It can only be populated by the server. */ - description?: string; -} + readonly returnTrackingInfo?: TrackingInfo[]; +}; -/** - * Service specification. - */ -export interface ServiceSpecification { - /** - * Metric specification as defined by shoebox. - */ - metricSpecifications?: MetricSpecificationV1[]; -} +/** Compute role. */ +export type Role = ARMBaseModel & { + /** Role type. */ + kind: RoleTypes; +}; -/** - * Operations. - */ -export interface Operation { - /** - * Name of the operation. - */ - name?: string; +/** The security settings of a device. */ +export type SecuritySettings = ARMBaseModel & { + /** Device administrator password as an encrypted string (encrypted using RSA PKCS #1) is used to sign into the local web UI of the device. The Actual password should have at least 8 characters that are a combination of uppercase, lowercase, numeric, and special characters. */ + deviceAdminPassword: AsymmetricEncryptedSecret; +}; + +/** Represents a share on the Data Box Edge/Gateway device. */ +export type Share = ARMBaseModel & { + /** Description for the share. */ + description?: string; + /** Current status of the share. */ + shareStatus: ShareStatus; + /** Current monitoring status of the share. */ + monitoringStatus: MonitoringStatus; + /** Azure container mapping for the share. */ + azureContainerInfo?: AzureContainerInfo; + /** Access protocol to be used by the share. */ + accessProtocol: ShareAccessProtocol; + /** Mapping of users and corresponding access rights on the share (required for SMB protocol). */ + userAccessRights?: UserAccessRight[]; + /** List of IP addresses and corresponding access rights on the share(required for NFS protocol). */ + clientAccessRights?: ClientAccessRight[]; + /** Details of the refresh job on this share. */ + refreshDetails?: RefreshDetails; /** - * Properties displayed for the operation. + * Share mount point to the role. + * NOTE: This property will not be serialized. It can only be populated by the server. */ - display?: OperationDisplay; + readonly shareMappings?: MountPointMap[]; + /** Data policy of the share. */ + dataPolicy?: DataPolicy; +}; + +/** The storage account credential. */ +export type StorageAccountCredential = ARMBaseModel & { + /** Alias for the storage account. */ + alias: string; + /** Username for the storage account. */ + userName?: string; + /** Encrypted storage key. */ + accountKey?: AsymmetricEncryptedSecret; + /** Connection string for the storage account. Use this string if username and account key are not specified. */ + connectionString?: string; + /** Signifies whether SSL needs to be enabled or not. */ + sslStatus: SSLStatus; + /** Blob end point for private clouds. */ + blobDomainName?: string; + /** Type of storage accessed on the storage account. */ + accountType: AccountType; + /** Id of the storage account. */ + storageAccountId?: string; +}; + +/** Represents a Storage Account on the Data Box Edge/Gateway device. */ +export type StorageAccount = ARMBaseModel & { + /** Description for the storage Account. */ + description?: string; + /** Current status of the storage account */ + storageAccountStatus?: StorageAccountStatus; + /** Data policy of the storage Account. */ + dataPolicy?: DataPolicy; + /** Storage Account Credential Id */ + storageAccountCredentialId?: string; /** - * Origin of the operation. + * BlobEndpoint of Storage Account + * NOTE: This property will not be serialized. It can only be populated by the server. */ - origin?: string; + readonly blobEndpoint?: string; /** - * Service specification. + * The Container Count. Present only for Storage Accounts with DataPolicy set to Cloud. + * NOTE: This property will not be serialized. It can only be populated by the server. */ - serviceSpecification?: ServiceSpecification; -} + readonly containerCount?: number; +}; -/** - * Represents a single status change. - */ -export interface OrderStatus { - /** - * Status of the order as per the allowed status types. Possible values include: 'Untracked', - * 'AwaitingFulfilment', 'AwaitingPreparation', 'AwaitingShipment', 'Shipped', 'Arriving', - * 'Delivered', 'ReplacementRequested', 'LostDevice', 'Declined', 'ReturnInitiated', - * 'AwaitingReturnShipment', 'ShippedBack', 'CollectedAtMicrosoft' - */ - status: OrderState; +/** Represents a container on the Data Box Edge/Gateway device. */ +export type Container = ARMBaseModel & { /** - * Time of status update. - * **NOTE: This property will not be serialized. It can only be populated by the server.** + * Current status of the container. + * NOTE: This property will not be serialized. It can only be populated by the server. */ - readonly updateDateTime?: Date; + readonly containerStatus?: ContainerStatus; + /** DataFormat for Container */ + dataFormat: AzureContainerDataFormat; /** - * Comments related to this status change. + * Details of the refresh job on this container. + * NOTE: This property will not be serialized. It can only be populated by the server. */ - comments?: string; + readonly refreshDetails?: RefreshDetails; /** - * Dictionary to hold generic information which is not stored - * by the already existing properties - * **NOTE: This property will not be serialized. It can only be populated by the server.** + * The UTC time when container got created. + * NOTE: This property will not be serialized. It can only be populated by the server. */ - readonly additionalOrderDetails?: { [propertyName: string]: string }; -} + readonly createdDateTime?: Date; +}; -/** - * Tracking courier information. - */ -export interface TrackingInfo { - /** - * Serial number of the device being tracked. - */ - serialNumber?: string; +/** Trigger details. */ +export type Trigger = ARMBaseModel & { + /** Trigger Kind. */ + kind: TriggerEventType; +}; + +/** Details about ongoing updates and availability of updates on the device. */ +export type UpdateSummary = ARMBaseModel & { + /** The current version of the device in format: 1.2.17312.13.", */ + deviceVersionNumber?: string; + /** The current version of the device in text format. */ + friendlyDeviceVersionName?: string; + /** The last time when a scan was done on the device. */ + deviceLastScannedDateTime?: Date; + /** The time when the last scan job was completed (success/cancelled/failed) on the appliance. */ + lastCompletedScanJobDateTime?: Date; /** - * Name of the carrier used in the delivery. + * The time when the last Download job was completed (success/cancelled/failed) on the appliance. + * NOTE: This property will not be serialized. It can only be populated by the server. */ - carrierName?: string; + readonly lastCompletedDownloadJobDateTime?: Date; /** - * Tracking ID of the shipment. + * The time when the last Install job was completed (success/cancelled/failed) on the appliance. + * NOTE: This property will not be serialized. It can only be populated by the server. */ - trackingId?: string; + readonly lastCompletedInstallJobDateTime?: Date; /** - * Tracking URL of the shipment. + * The number of updates available for the current device version as per the last device scan. + * NOTE: This property will not be serialized. It can only be populated by the server. */ - trackingUrl?: string; -} - -/** - * The order details. - */ -export interface Order extends ARMBaseModel { + readonly totalNumberOfUpdatesAvailable?: number; /** - * The contact details. + * The total number of items pending download. + * NOTE: This property will not be serialized. It can only be populated by the server. */ - contactInformation: ContactDetails; + readonly totalNumberOfUpdatesPendingDownload?: number; /** - * The shipping address. + * The total number of items pending install. + * NOTE: This property will not be serialized. It can only be populated by the server. */ - shippingAddress: Address; + readonly totalNumberOfUpdatesPendingInstall?: number; /** - * Current status of the order. + * Indicates if updates are available and at least one of the updates needs a reboot. + * NOTE: This property will not be serialized. It can only be populated by the server. */ - currentStatus?: OrderStatus; + readonly rebootBehavior?: InstallRebootBehavior; /** - * List of status changes in the order. - * **NOTE: This property will not be serialized. It can only be populated by the server.** + * The current update operation. + * NOTE: This property will not be serialized. It can only be populated by the server. */ - readonly orderHistory?: OrderStatus[]; + readonly ongoingUpdateOperation?: UpdateOperation; /** - * Serial number of the device. - * **NOTE: This property will not be serialized. It can only be populated by the server.** + * The job ID of the download job in progress. + * NOTE: This property will not be serialized. It can only be populated by the server. */ - readonly serialNumber?: string; + readonly inProgressDownloadJobId?: string; /** - * Tracking information for the package delivered to the customer whether it has an original or a - * replacement device. - * **NOTE: This property will not be serialized. It can only be populated by the server.** + * The job ID of the install job in progress. + * NOTE: This property will not be serialized. It can only be populated by the server. */ - readonly deliveryTrackingInfo?: TrackingInfo[]; + readonly inProgressInstallJobId?: string; /** - * Tracking information for the package returned from the customer whether it has an original or - * a replacement device. - * **NOTE: This property will not be serialized. It can only be populated by the server.** + * The time when the currently running download (if any) started. + * NOTE: This property will not be serialized. It can only be populated by the server. */ - readonly returnTrackingInfo?: TrackingInfo[]; -} - -/** - * Periodic timer event source. - */ -export interface PeriodicTimerSourceInfo { + readonly inProgressDownloadJobStartedDateTime?: Date; /** - * The time of the day that results in a valid trigger. Schedule is computed with reference to - * the time specified upto seconds. If timezone is not specified the time will considered to be - * in device timezone. The value will always be returned as UTC time. + * The time when the currently running install (if any) started. + * NOTE: This property will not be serialized. It can only be populated by the server. */ - startTime: Date; + readonly inProgressInstallJobStartedDateTime?: Date; /** - * Periodic frequency at which timer event needs to be raised. Supports daily, hourly, minutes, - * and seconds. + * The list of updates available for install. + * NOTE: This property will not be serialized. It can only be populated by the server. */ - schedule: string; + readonly updateTitles?: string[]; /** - * Topic where periodic events are published to IoT device. + * The total size of updates available for download in bytes. + * NOTE: This property will not be serialized. It can only be populated by the server. */ - topic?: string; -} + readonly totalUpdateSizeInBytes?: number; +}; -/** - * Trigger details. - */ -export interface PeriodicTimerEventTrigger { - /** - * Polymorphic Discriminator - */ - kind: "PeriodicTimerEvent"; - /** - * The path ID that uniquely identifies the object. - * **NOTE: This property will not be serialized. It can only be populated by the server.** - */ - readonly id?: string; - /** - * The object name. - * **NOTE: This property will not be serialized. It can only be populated by the server.** - */ - readonly name?: string; - /** - * The hierarchical type of the object. - * **NOTE: This property will not be serialized. It can only be populated by the server.** - */ - readonly type?: string; - /** - * Periodic timer details. - */ - sourceInfo: PeriodicTimerSourceInfo; - /** - * Role Sink information. - */ - sinkInfo: RoleSinkInfo; - /** - * A custom context tag typically used to correlate the trigger against its usage. For example, - * if a periodic timer trigger is intended for certain specific IoT modules in the device, the - * tag can be the name or the image URL of the module. - */ - customContextTag?: string; -} - -/** - * The location info. - */ -export interface SkuLocationInfo { - /** - * The location. - * **NOTE: This property will not be serialized. It can only be populated by the server.** - */ - readonly location?: string; - /** - * The zones. - * **NOTE: This property will not be serialized. It can only be populated by the server.** - */ - readonly zones?: string[]; - /** - * The sites. - * **NOTE: This property will not be serialized. It can only be populated by the server.** - */ - readonly sites?: string[]; -} - -/** - * The metadata for retrieving price info. - */ -export interface SkuCost { - /** - * Used for querying price from commerce. - * **NOTE: This property will not be serialized. It can only be populated by the server.** - */ - readonly meterId?: string; - /** - * The cost quantity. - * **NOTE: This property will not be serialized. It can only be populated by the server.** - */ - readonly quantity?: number; - /** - * Restriction of the SKU for the location/zone - * **NOTE: This property will not be serialized. It can only be populated by the server.** - */ - readonly extendedUnit?: string; -} - -/** - * The restriction info with locations and zones. - */ -export interface SkuRestrictionInfo { - /** - * The locations. - * **NOTE: This property will not be serialized. It can only be populated by the server.** - */ - readonly locations?: string[]; - /** - * The zones. - * **NOTE: This property will not be serialized. It can only be populated by the server.** - */ - readonly zones?: string[]; -} - -/** - * The restrictions because of which SKU cannot be used. - */ -export interface SkuRestriction { - /** - * The type of the restriction. - * **NOTE: This property will not be serialized. It can only be populated by the server.** - */ - readonly type?: string; - /** - * The locations where sku is restricted. - * **NOTE: This property will not be serialized. It can only be populated by the server.** - */ - readonly values?: string[]; - /** - * The SKU restriction reason. Possible values include: 'NotAvailableForSubscription', 'QuotaId' - * **NOTE: This property will not be serialized. It can only be populated by the server.** - */ - readonly reasonCode?: SkuRestrictionReasonCode; - /** - * Restriction of the SKU for the location/zone - * **NOTE: This property will not be serialized. It can only be populated by the server.** - */ - readonly restrictionInfo?: SkuRestrictionInfo; -} - -/** - * SkuInformation object - */ -export interface ResourceTypeSku { - /** - * The type of the resource - * **NOTE: This property will not be serialized. It can only be populated by the server.** - */ - readonly resourceType?: string; - /** - * The Sku name. Possible values include: 'Gateway', 'Edge', 'TEA_1Node', 'TEA_1Node_UPS', - * 'TEA_1Node_Heater', 'TEA_1Node_UPS_Heater', 'TEA_4Node_Heater', 'TEA_4Node_UPS_Heater', 'TMA' - * **NOTE: This property will not be serialized. It can only be populated by the server.** - */ - readonly name?: SkuName; - /** - * The Sku kind - * **NOTE: This property will not be serialized. It can only be populated by the server.** - */ - readonly kind?: string; - /** - * The Sku tier. Possible values include: 'Standard' - * **NOTE: This property will not be serialized. It can only be populated by the server.** - */ - readonly tier?: SkuTier; - /** - * The Sku family - * **NOTE: This property will not be serialized. It can only be populated by the server.** - */ - readonly family?: string; - /** - * Availability of the SKU for the region - * **NOTE: This property will not be serialized. It can only be populated by the server.** - */ - readonly locations?: string[]; - /** - * The API versions in which SKU is available - * **NOTE: This property will not be serialized. It can only be populated by the server.** - */ - readonly apiVersions?: string[]; - /** - * Availability of the SKU for the location/zone - * **NOTE: This property will not be serialized. It can only be populated by the server.** - */ - readonly locationInfo?: SkuLocationInfo[]; - /** - * The pricing info of the Sku. - * **NOTE: This property will not be serialized. It can only be populated by the server.** - */ - readonly costs?: SkuCost[]; - /** - * Restrictions of the SKU availability. - * **NOTE: This property will not be serialized. It can only be populated by the server.** - */ - readonly restrictions?: SkuRestriction[]; -} - -/** - * The security settings of a device. - */ -export interface SecuritySettings extends ARMBaseModel { - /** - * Device administrator password as an encrypted string (encrypted using RSA PKCS #1) is used to - * sign into the local web UI of the device. The Actual password should have at least 8 - * characters that are a combination of uppercase, lowercase, numeric, and special characters. - */ - deviceAdminPassword: AsymmetricEncryptedSecret; -} - -/** - * The mapping between a particular user and the access type on the SMB share. - */ -export interface UserAccessRight { - /** - * User ID (already existing in the device). - */ - userId: string; - /** - * Type of access to be allowed for the user. Possible values include: 'Change', 'Read', 'Custom' - */ - accessType: ShareAccessType; -} - -/** - * Represents a share on the Data Box Edge/Gateway device. - */ -export interface Share extends ARMBaseModel { - /** - * Description for the share. - */ - description?: string; - /** - * Current status of the share. Possible values include: 'Offline', 'Unknown', 'OK', 'Updating', - * 'NeedsAttention' - */ - shareStatus: ShareStatus; - /** - * Current monitoring status of the share. Possible values include: 'Enabled', 'Disabled' - */ - monitoringStatus: MonitoringStatus; - /** - * Azure container mapping for the share. - */ - azureContainerInfo?: AzureContainerInfo; - /** - * Access protocol to be used by the share. Possible values include: 'SMB', 'NFS' - */ - accessProtocol: ShareAccessProtocol; - /** - * Mapping of users and corresponding access rights on the share (required for SMB protocol). - */ - userAccessRights?: UserAccessRight[]; - /** - * List of IP addresses and corresponding access rights on the share(required for NFS protocol). - */ - clientAccessRights?: ClientAccessRight[]; - /** - * Details of the refresh job on this share. - */ - refreshDetails?: RefreshDetails; - /** - * Share mount point to the role. - * **NOTE: This property will not be serialized. It can only be populated by the server.** - */ - readonly shareMappings?: MountPointMap[]; - /** - * Data policy of the share. Possible values include: 'Cloud', 'Local' - */ - dataPolicy?: DataPolicy; -} - -/** - * Specifies the mapping between this particular user and the type of access he has on shares on - * this device. - */ -export interface ShareAccessRight { - /** - * The share ID. - */ - shareId: string; - /** - * Type of access to be allowed on the share for this user. Possible values include: 'Change', - * 'Read', 'Custom' - */ - accessType: ShareAccessType; -} - -/** - * Represents a Storage Account on the Data Box Edge/Gateway device. - */ -export interface StorageAccount extends ARMBaseModel { - /** - * Description for the storage Account. - */ - description?: string; - /** - * Current status of the storage account. Possible values include: 'OK', 'Offline', 'Unknown', - * 'Updating', 'NeedsAttention' - */ - storageAccountStatus?: StorageAccountStatus; - /** - * Data policy of the storage Account. Possible values include: 'Cloud', 'Local' - */ - dataPolicy?: DataPolicy; - /** - * Storage Account Credential Id - */ - storageAccountCredentialId?: string; - /** - * BlobEndpoint of Storage Account - * **NOTE: This property will not be serialized. It can only be populated by the server.** - */ - readonly blobEndpoint?: string; - /** - * The Container Count. Present only for Storage Accounts with DataPolicy set to Cloud. - * **NOTE: This property will not be serialized. It can only be populated by the server.** - */ - readonly containerCount?: number; -} - -/** - * The storage account credential. - */ -export interface StorageAccountCredential extends ARMBaseModel { - /** - * Alias for the storage account. - */ - alias: string; - /** - * Username for the storage account. - */ - userName?: string; - /** - * Encrypted storage key. - */ - accountKey?: AsymmetricEncryptedSecret; - /** - * Connection string for the storage account. Use this string if username and account key are not - * specified. - */ - connectionString?: string; - /** - * Signifies whether SSL needs to be enabled or not. Possible values include: 'Enabled', - * 'Disabled' - */ - sslStatus: SSLStatus; - /** - * Blob end point for private clouds. - */ - blobDomainName?: string; - /** - * Type of storage accessed on the storage account. Possible values include: - * 'GeneralPurposeStorage', 'BlobStorage' - */ - accountType: AccountType; - /** - * Id of the storage account. - */ - storageAccountId?: string; -} - -/** - * Details about ongoing updates and availability of updates on the device. - */ -export interface UpdateSummary extends ARMBaseModel { - /** - * The current version of the device in format: 1.2.17312.13.", - */ - deviceVersionNumber?: string; - /** - * The current version of the device in text format. - */ - friendlyDeviceVersionName?: string; - /** - * The last time when a scan was done on the device. - */ - deviceLastScannedDateTime?: Date; - /** - * The time when the last scan job was completed (success/cancelled/failed) on the appliance. - */ - lastCompletedScanJobDateTime?: Date; - /** - * The time when the last Download job was completed (success/cancelled/failed) on the appliance. - * **NOTE: This property will not be serialized. It can only be populated by the server.** - */ - readonly lastCompletedDownloadJobDateTime?: Date; - /** - * The time when the last Install job was completed (success/cancelled/failed) on the appliance. - * **NOTE: This property will not be serialized. It can only be populated by the server.** - */ - readonly lastCompletedInstallJobDateTime?: Date; - /** - * The number of updates available for the current device version as per the last device scan. - * **NOTE: This property will not be serialized. It can only be populated by the server.** - */ - readonly totalNumberOfUpdatesAvailable?: number; - /** - * The total number of items pending download. - * **NOTE: This property will not be serialized. It can only be populated by the server.** - */ - readonly totalNumberOfUpdatesPendingDownload?: number; - /** - * The total number of items pending install. - * **NOTE: This property will not be serialized. It can only be populated by the server.** - */ - readonly totalNumberOfUpdatesPendingInstall?: number; - /** - * Indicates if updates are available and at least one of the updates needs a reboot. Possible - * values include: 'NeverReboots', 'RequiresReboot', 'RequestReboot' - * **NOTE: This property will not be serialized. It can only be populated by the server.** - */ - readonly rebootBehavior?: InstallRebootBehavior; - /** - * The current update operation. Possible values include: 'None', 'Scan', 'Download', 'Install' - * **NOTE: This property will not be serialized. It can only be populated by the server.** - */ - readonly ongoingUpdateOperation?: UpdateOperation; - /** - * The job ID of the download job in progress. - * **NOTE: This property will not be serialized. It can only be populated by the server.** - */ - readonly inProgressDownloadJobId?: string; - /** - * The job ID of the install job in progress. - * **NOTE: This property will not be serialized. It can only be populated by the server.** - */ - readonly inProgressInstallJobId?: string; - /** - * The time when the currently running download (if any) started. - * **NOTE: This property will not be serialized. It can only be populated by the server.** - */ - readonly inProgressDownloadJobStartedDateTime?: Date; - /** - * The time when the currently running install (if any) started. - * **NOTE: This property will not be serialized. It can only be populated by the server.** - */ - readonly inProgressInstallJobStartedDateTime?: Date; - /** - * The list of updates available for install. - * **NOTE: This property will not be serialized. It can only be populated by the server.** - */ - readonly updateTitles?: string[]; - /** - * The total size of updates available for download in bytes. - * **NOTE: This property will not be serialized. It can only be populated by the server.** - */ - readonly totalUpdateSizeInBytes?: number; -} - -/** - * The upload certificate request. - */ -export interface UploadCertificateRequest { - /** - * The authentication type. Possible values include: 'Invalid', 'AzureActiveDirectory' - */ - authenticationType?: AuthenticationType; - /** - * The base64 encoded certificate raw data. - */ - certificate: string; -} - -/** - * The upload registration certificate response. - */ -export interface UploadCertificateResponse { - /** - * Specifies authentication type. Possible values include: 'Invalid', 'AzureActiveDirectory' - */ - authType?: AuthenticationType; - /** - * The resource ID of the Data Box Edge/Gateway device. - * **NOTE: This property will not be serialized. It can only be populated by the server.** - */ - readonly resourceId?: string; - /** - * Azure Active Directory tenant authority. - * **NOTE: This property will not be serialized. It can only be populated by the server.** - */ - readonly aadAuthority?: string; - /** - * Azure Active Directory tenant ID. - * **NOTE: This property will not be serialized. It can only be populated by the server.** - */ - readonly aadTenantId?: string; - /** - * Azure Active Directory service principal client ID. - * **NOTE: This property will not be serialized. It can only be populated by the server.** - */ - readonly servicePrincipalClientId?: string; - /** - * Azure Active Directory service principal object ID. - * **NOTE: This property will not be serialized. It can only be populated by the server.** - */ - readonly servicePrincipalObjectId?: string; - /** - * The azure management endpoint audience. - * **NOTE: This property will not be serialized. It can only be populated by the server.** - */ - readonly azureManagementEndpointAudience?: string; - /** - * Identifier of the target resource that is the recipient of the requested token. - * **NOTE: This property will not be serialized. It can only be populated by the server.** - */ - readonly aadAudience?: string; -} - -/** - * Represents a user who has access to one or more shares on the Data Box Edge/Gateway device. - */ -export interface User extends ARMBaseModel { - /** - * The password details. - */ +/** Represents a user who has access to one or more shares on the Data Box Edge/Gateway device. */ +export type User = ARMBaseModel & { + /** The password details. */ encryptedPassword?: AsymmetricEncryptedSecret; - /** - * List of shares that the user has rights on. This field should not be specified during user - * creation. - */ + /** List of shares that the user has rights on. This field should not be specified during user creation. */ shareAccessRights?: ShareAccessRight[]; - /** - * Type of the user. Possible values include: 'Share', 'LocalManagement', 'ARM' - */ + /** Type of the user. */ userType: UserType; -} - -/** - * Optional Parameters. - */ -export interface DevicesListBySubscriptionOptionalParams extends msRest.RequestOptionsBase { - /** - * Specify $expand=details to populate additional fields related to the resource or Specify - * $skipToken= to populate the next page in the list. - */ - expand?: string; -} - -/** - * Optional Parameters. - */ -export interface DevicesListByResourceGroupOptionalParams extends msRest.RequestOptionsBase { - /** - * Specify $expand=details to populate additional fields related to the resource or Specify - * $skipToken= to populate the next page in the list. - */ - expand?: string; -} - -/** - * Optional Parameters. - */ -export interface TriggersListByDataBoxEdgeDeviceOptionalParams extends msRest.RequestOptionsBase { - /** - * Specify $filter='CustomContextTag eq ' to filter on custom context tag property - */ - filter?: string; -} - -/** - * Optional Parameters. - */ -export interface UsersListByDataBoxEdgeDeviceOptionalParams extends msRest.RequestOptionsBase { - /** - * Specify $filter='UserType eq ' to filter on user type property - */ - filter?: string; -} - -/** - * Optional Parameters. - */ -export interface SkusListOptionalParams extends msRest.RequestOptionsBase { - /** - * Specify $filter='location eq ' to filter on location. - */ - filter?: string; -} - -/** - * An interface representing DataBoxEdgeManagementClientOptions. - */ -export interface DataBoxEdgeManagementClientOptions extends AzureServiceClientOptions { - baseUri?: string; -} - -/** - * @interface - * The list of operations used for the discovery of available provider operations. - * @extends Array - */ -export interface OperationsList extends Array { - /** - * Link to the next set of results. - */ - nextLink?: string; -} - -/** - * @interface - * The collection of Data Box Edge/Gateway devices. - * @extends Array - */ -export interface DataBoxEdgeDeviceList extends Array { - /** - * Link to the next set of results. - * **NOTE: This property will not be serialized. It can only be populated by the server.** - */ - readonly nextLink?: string; -} - -/** - * @interface - * Collection of alerts. - * @extends Array - */ -export interface AlertList extends Array { - /** - * Link to the next set of results. - * **NOTE: This property will not be serialized. It can only be populated by the server.** - */ - readonly nextLink?: string; -} - -/** - * @interface - * The collection of bandwidth schedules. - * @extends Array - */ -export interface BandwidthSchedulesList extends Array { - /** - * Link to the next set of results. - * **NOTE: This property will not be serialized. It can only be populated by the server.** - */ - readonly nextLink?: string; -} +}; -/** - * @interface - * Collection of Nodes. - * @extends Array - */ -export interface NodeList extends Array { -} +/** Compute role. */ +export type IoTRole = Role & { + /** Host OS supported by the IoT role. */ + hostPlatform?: PlatformType; + /** IoT device metadata to which data box edge device needs to be connected. */ + ioTDeviceDetails?: IoTDeviceInfo; + /** IoT edge device to which the IoT role needs to be configured. */ + ioTEdgeDeviceDetails?: IoTDeviceInfo; + /** Mount points of shares in role(s). */ + shareMappings?: MountPointMap[]; + /** Role status. */ + roleStatus?: RoleStatus; +}; -/** - * @interface - * List of order entities. - * @extends Array - */ -export interface OrderList extends Array { - /** - * Link to the next set of results. - * **NOTE: This property will not be serialized. It can only be populated by the server.** - */ - readonly nextLink?: string; -} +/** Trigger details. */ +export type FileEventTrigger = Trigger & { + /** File event source details. */ + sourceInfo: FileSourceInfo; + /** Role sink info. */ + sinkInfo: RoleSinkInfo; + /** A custom context tag typically used to correlate the trigger against its usage. For example, if a periodic timer trigger is intended for certain specific IoT modules in the device, the tag can be the name or the image URL of the module. */ + customContextTag?: string; +}; -/** - * @interface - * Collection of all the roles on the Data Box Edge device. - * @extends Array - */ -export interface RoleList extends Array { - /** - * Link to the next set of results. - * **NOTE: This property will not be serialized. It can only be populated by the server.** - */ - readonly nextLink?: string; -} +/** Trigger details. */ +export type PeriodicTimerEventTrigger = Trigger & { + /** Periodic timer details. */ + sourceInfo: PeriodicTimerSourceInfo; + /** Role Sink information. */ + sinkInfo: RoleSinkInfo; + /** A custom context tag typically used to correlate the trigger against its usage. For example, if a periodic timer trigger is intended for certain specific IoT modules in the device, the tag can be the name or the image URL of the module. */ + customContextTag?: string; +}; -/** - * @interface - * Collection of all the shares on the Data Box Edge/Gateway device. - * @extends Array - */ -export interface ShareList extends Array { - /** - * Link to the next set of results. - * **NOTE: This property will not be serialized. It can only be populated by the server.** - */ - readonly nextLink?: string; -} +/** Known values of {@link MetricUnit} that the service accepts. */ +export enum KnownMetricUnit { + NotSpecified = "NotSpecified", + Percent = "Percent", + Count = "Count", + Seconds = "Seconds", + Milliseconds = "Milliseconds", + Bytes = "Bytes", + BytesPerSecond = "BytesPerSecond", + CountPerSecond = "CountPerSecond" +} + +/** + * Defines values for MetricUnit. \ + * {@link KnownMetricUnit} can be used interchangeably with MetricUnit, + * this enum contains the known values that the service supports. + * ### Known values supported by the service + * **NotSpecified** \ + * **Percent** \ + * **Count** \ + * **Seconds** \ + * **Milliseconds** \ + * **Bytes** \ + * **BytesPerSecond** \ + * **CountPerSecond** + */ +export type MetricUnit = string; + +/** Known values of {@link MetricAggregationType} that the service accepts. */ +export enum KnownMetricAggregationType { + NotSpecified = "NotSpecified", + None = "None", + Average = "Average", + Minimum = "Minimum", + Maximum = "Maximum", + Total = "Total", + Count = "Count" +} + +/** + * Defines values for MetricAggregationType. \ + * {@link KnownMetricAggregationType} can be used interchangeably with MetricAggregationType, + * this enum contains the known values that the service supports. + * ### Known values supported by the service + * **NotSpecified** \ + * **None** \ + * **Average** \ + * **Minimum** \ + * **Maximum** \ + * **Total** \ + * **Count** + */ +export type MetricAggregationType = string; + +/** Known values of {@link MetricCategory} that the service accepts. */ +export enum KnownMetricCategory { + Capacity = "Capacity", + Transaction = "Transaction" +} + +/** + * Defines values for MetricCategory. \ + * {@link KnownMetricCategory} can be used interchangeably with MetricCategory, + * this enum contains the known values that the service supports. + * ### Known values supported by the service + * **Capacity** \ + * **Transaction** + */ +export type MetricCategory = string; + +/** Known values of {@link TimeGrain} that the service accepts. */ +export enum KnownTimeGrain { + PT1M = "PT1M", + PT5M = "PT5M", + PT15M = "PT15M", + PT30M = "PT30M", + PT1H = "PT1H", + PT6H = "PT6H", + PT12H = "PT12H", + PT1D = "PT1D" +} + +/** + * Defines values for TimeGrain. \ + * {@link KnownTimeGrain} can be used interchangeably with TimeGrain, + * this enum contains the known values that the service supports. + * ### Known values supported by the service + * **PT1M** \ + * **PT5M** \ + * **PT15M** \ + * **PT30M** \ + * **PT1H** \ + * **PT6H** \ + * **PT12H** \ + * **PT1D** + */ +export type TimeGrain = string; + +/** Known values of {@link SkuName} that the service accepts. */ +export enum KnownSkuName { + Gateway = "Gateway", + Edge = "Edge", + TEA1Node = "TEA_1Node", + TEA1NodeUPS = "TEA_1Node_UPS", + TEA1NodeHeater = "TEA_1Node_Heater", + TEA1NodeUPSHeater = "TEA_1Node_UPS_Heater", + TEA4NodeHeater = "TEA_4Node_Heater", + TEA4NodeUPSHeater = "TEA_4Node_UPS_Heater", + TMA = "TMA" +} + +/** + * Defines values for SkuName. \ + * {@link KnownSkuName} can be used interchangeably with SkuName, + * this enum contains the known values that the service supports. + * ### Known values supported by the service + * **Gateway** \ + * **Edge** \ + * **TEA_1Node** \ + * **TEA_1Node_UPS** \ + * **TEA_1Node_Heater** \ + * **TEA_1Node_UPS_Heater** \ + * **TEA_4Node_Heater** \ + * **TEA_4Node_UPS_Heater** \ + * **TMA** + */ +export type SkuName = string; + +/** Known values of {@link SkuTier} that the service accepts. */ +export enum KnownSkuTier { + Standard = "Standard" +} + +/** + * Defines values for SkuTier. \ + * {@link KnownSkuTier} can be used interchangeably with SkuTier, + * this enum contains the known values that the service supports. + * ### Known values supported by the service + * **Standard** + */ +export type SkuTier = string; + +/** Known values of {@link DataBoxEdgeDeviceStatus} that the service accepts. */ +export enum KnownDataBoxEdgeDeviceStatus { + ReadyToSetup = "ReadyToSetup", + Online = "Online", + Offline = "Offline", + NeedsAttention = "NeedsAttention", + Disconnected = "Disconnected", + PartiallyDisconnected = "PartiallyDisconnected", + Maintenance = "Maintenance" +} + +/** + * Defines values for DataBoxEdgeDeviceStatus. \ + * {@link KnownDataBoxEdgeDeviceStatus} can be used interchangeably with DataBoxEdgeDeviceStatus, + * this enum contains the known values that the service supports. + * ### Known values supported by the service + * **ReadyToSetup** \ + * **Online** \ + * **Offline** \ + * **NeedsAttention** \ + * **Disconnected** \ + * **PartiallyDisconnected** \ + * **Maintenance** + */ +export type DataBoxEdgeDeviceStatus = string; + +/** Known values of {@link DeviceType} that the service accepts. */ +export enum KnownDeviceType { + DataBoxEdgeDevice = "DataBoxEdgeDevice" +} + +/** + * Defines values for DeviceType. \ + * {@link KnownDeviceType} can be used interchangeably with DeviceType, + * this enum contains the known values that the service supports. + * ### Known values supported by the service + * **DataBoxEdgeDevice** + */ +export type DeviceType = string; + +/** Known values of {@link RoleTypes} that the service accepts. */ +export enum KnownRoleTypes { + IOT = "IOT", + ASA = "ASA", + Functions = "Functions", + Cognitive = "Cognitive" +} + +/** + * Defines values for RoleTypes. \ + * {@link KnownRoleTypes} can be used interchangeably with RoleTypes, + * this enum contains the known values that the service supports. + * ### Known values supported by the service + * **IOT** \ + * **ASA** \ + * **Functions** \ + * **Cognitive** + */ +export type RoleTypes = string; + +/** Known values of {@link AlertSeverity} that the service accepts. */ +export enum KnownAlertSeverity { + Informational = "Informational", + Warning = "Warning", + Critical = "Critical" +} + +/** + * Defines values for AlertSeverity. \ + * {@link KnownAlertSeverity} can be used interchangeably with AlertSeverity, + * this enum contains the known values that the service supports. + * ### Known values supported by the service + * **Informational** \ + * **Warning** \ + * **Critical** + */ +export type AlertSeverity = string; + +/** Known values of {@link DayOfWeek} that the service accepts. */ +export enum KnownDayOfWeek { + Sunday = "Sunday", + Monday = "Monday", + Tuesday = "Tuesday", + Wednesday = "Wednesday", + Thursday = "Thursday", + Friday = "Friday", + Saturday = "Saturday" +} + +/** + * Defines values for DayOfWeek. \ + * {@link KnownDayOfWeek} can be used interchangeably with DayOfWeek, + * this enum contains the known values that the service supports. + * ### Known values supported by the service + * **Sunday** \ + * **Monday** \ + * **Tuesday** \ + * **Wednesday** \ + * **Thursday** \ + * **Friday** \ + * **Saturday** + */ +export type DayOfWeek = string; + +/** Known values of {@link JobStatus} that the service accepts. */ +export enum KnownJobStatus { + Invalid = "Invalid", + Running = "Running", + Succeeded = "Succeeded", + Failed = "Failed", + Canceled = "Canceled", + Paused = "Paused", + Scheduled = "Scheduled" +} + +/** + * Defines values for JobStatus. \ + * {@link KnownJobStatus} can be used interchangeably with JobStatus, + * this enum contains the known values that the service supports. + * ### Known values supported by the service + * **Invalid** \ + * **Running** \ + * **Succeeded** \ + * **Failed** \ + * **Canceled** \ + * **Paused** \ + * **Scheduled** + */ +export type JobStatus = string; + +/** Known values of {@link JobType} that the service accepts. */ +export enum KnownJobType { + Invalid = "Invalid", + ScanForUpdates = "ScanForUpdates", + DownloadUpdates = "DownloadUpdates", + InstallUpdates = "InstallUpdates", + RefreshShare = "RefreshShare", + RefreshContainer = "RefreshContainer" +} + +/** + * Defines values for JobType. \ + * {@link KnownJobType} can be used interchangeably with JobType, + * this enum contains the known values that the service supports. + * ### Known values supported by the service + * **Invalid** \ + * **ScanForUpdates** \ + * **DownloadUpdates** \ + * **InstallUpdates** \ + * **RefreshShare** \ + * **RefreshContainer** + */ +export type JobType = string; + +/** Known values of {@link UpdateOperationStage} that the service accepts. */ +export enum KnownUpdateOperationStage { + Unknown = "Unknown", + Initial = "Initial", + ScanStarted = "ScanStarted", + ScanComplete = "ScanComplete", + ScanFailed = "ScanFailed", + DownloadStarted = "DownloadStarted", + DownloadComplete = "DownloadComplete", + DownloadFailed = "DownloadFailed", + InstallStarted = "InstallStarted", + InstallComplete = "InstallComplete", + InstallFailed = "InstallFailed", + RebootInitiated = "RebootInitiated", + Success = "Success", + Failure = "Failure", + RescanStarted = "RescanStarted", + RescanComplete = "RescanComplete", + RescanFailed = "RescanFailed" +} + +/** + * Defines values for UpdateOperationStage. \ + * {@link KnownUpdateOperationStage} can be used interchangeably with UpdateOperationStage, + * this enum contains the known values that the service supports. + * ### Known values supported by the service + * **Unknown** \ + * **Initial** \ + * **ScanStarted** \ + * **ScanComplete** \ + * **ScanFailed** \ + * **DownloadStarted** \ + * **DownloadComplete** \ + * **DownloadFailed** \ + * **InstallStarted** \ + * **InstallComplete** \ + * **InstallFailed** \ + * **RebootInitiated** \ + * **Success** \ + * **Failure** \ + * **RescanStarted** \ + * **RescanComplete** \ + * **RescanFailed** + */ +export type UpdateOperationStage = string; + +/** Known values of {@link DownloadPhase} that the service accepts. */ +export enum KnownDownloadPhase { + Unknown = "Unknown", + Initializing = "Initializing", + Downloading = "Downloading", + Verifying = "Verifying" +} + +/** + * Defines values for DownloadPhase. \ + * {@link KnownDownloadPhase} can be used interchangeably with DownloadPhase, + * this enum contains the known values that the service supports. + * ### Known values supported by the service + * **Unknown** \ + * **Initializing** \ + * **Downloading** \ + * **Verifying** + */ +export type DownloadPhase = string; + +/** Known values of {@link NetworkGroup} that the service accepts. */ +export enum KnownNetworkGroup { + None = "None", + NonRdma = "NonRDMA", + Rdma = "RDMA" +} + +/** + * Defines values for NetworkGroup. \ + * {@link KnownNetworkGroup} can be used interchangeably with NetworkGroup, + * this enum contains the known values that the service supports. + * ### Known values supported by the service + * **None** \ + * **NonRDMA** \ + * **RDMA** + */ +export type NetworkGroup = string; + +/** Known values of {@link NetworkAdapterStatus} that the service accepts. */ +export enum KnownNetworkAdapterStatus { + Inactive = "Inactive", + Active = "Active" +} + +/** + * Defines values for NetworkAdapterStatus. \ + * {@link KnownNetworkAdapterStatus} can be used interchangeably with NetworkAdapterStatus, + * this enum contains the known values that the service supports. + * ### Known values supported by the service + * **Inactive** \ + * **Active** + */ +export type NetworkAdapterStatus = string; + +/** Known values of {@link NetworkAdapterRdmaStatus} that the service accepts. */ +export enum KnownNetworkAdapterRdmaStatus { + Incapable = "Incapable", + Capable = "Capable" +} + +/** + * Defines values for NetworkAdapterRdmaStatus. \ + * {@link KnownNetworkAdapterRdmaStatus} can be used interchangeably with NetworkAdapterRdmaStatus, + * this enum contains the known values that the service supports. + * ### Known values supported by the service + * **Incapable** \ + * **Capable** + */ +export type NetworkAdapterRdmaStatus = string; + +/** Known values of {@link NetworkAdapterDhcpStatus} that the service accepts. */ +export enum KnownNetworkAdapterDhcpStatus { + Disabled = "Disabled", + Enabled = "Enabled" +} + +/** + * Defines values for NetworkAdapterDhcpStatus. \ + * {@link KnownNetworkAdapterDhcpStatus} can be used interchangeably with NetworkAdapterDhcpStatus, + * this enum contains the known values that the service supports. + * ### Known values supported by the service + * **Disabled** \ + * **Enabled** + */ +export type NetworkAdapterDhcpStatus = string; + +/** Known values of {@link NodeStatus} that the service accepts. */ +export enum KnownNodeStatus { + Unknown = "Unknown", + Up = "Up", + Down = "Down", + Rebooting = "Rebooting", + ShuttingDown = "ShuttingDown" +} /** - * @interface - * The collection of storage account credentials. - * @extends Array + * Defines values for NodeStatus. \ + * {@link KnownNodeStatus} can be used interchangeably with NodeStatus, + * this enum contains the known values that the service supports. + * ### Known values supported by the service + * **Unknown** \ + * **Up** \ + * **Down** \ + * **Rebooting** \ + * **ShuttingDown** */ -export interface StorageAccountCredentialList extends Array { - /** - * Link to the next set of results. - * **NOTE: This property will not be serialized. It can only be populated by the server.** - */ - readonly nextLink?: string; +export type NodeStatus = string; + +/** Known values of {@link OrderState} that the service accepts. */ +export enum KnownOrderState { + Untracked = "Untracked", + AwaitingFulfilment = "AwaitingFulfilment", + AwaitingPreparation = "AwaitingPreparation", + AwaitingShipment = "AwaitingShipment", + Shipped = "Shipped", + Arriving = "Arriving", + Delivered = "Delivered", + ReplacementRequested = "ReplacementRequested", + LostDevice = "LostDevice", + Declined = "Declined", + ReturnInitiated = "ReturnInitiated", + AwaitingReturnShipment = "AwaitingReturnShipment", + ShippedBack = "ShippedBack", + CollectedAtMicrosoft = "CollectedAtMicrosoft" } /** - * @interface - * Collection of all the Storage Accounts on the Data Box Edge/Gateway device. - * @extends Array + * Defines values for OrderState. \ + * {@link KnownOrderState} can be used interchangeably with OrderState, + * this enum contains the known values that the service supports. + * ### Known values supported by the service + * **Untracked** \ + * **AwaitingFulfilment** \ + * **AwaitingPreparation** \ + * **AwaitingShipment** \ + * **Shipped** \ + * **Arriving** \ + * **Delivered** \ + * **ReplacementRequested** \ + * **LostDevice** \ + * **Declined** \ + * **ReturnInitiated** \ + * **AwaitingReturnShipment** \ + * **ShippedBack** \ + * **CollectedAtMicrosoft** */ -export interface StorageAccountList extends Array { - /** - * Link to the next set of results. - * **NOTE: This property will not be serialized. It can only be populated by the server.** - */ - readonly nextLink?: string; -} +export type OrderState = string; -/** - * @interface - * Collection of all the containers on the Data Box Edge/Gateway device. - * @extends Array - */ -export interface ContainerList extends Array { - /** - * Link to the next set of results. - * **NOTE: This property will not be serialized. It can only be populated by the server.** - */ - readonly nextLink?: string; +/** Known values of {@link EncryptionAlgorithm} that the service accepts. */ +export enum KnownEncryptionAlgorithm { + None = "None", + AES256 = "AES256", + RsaesPkcs1V15 = "RSAES_PKCS1_v_1_5" } - + /** - * @interface - * Collection of all trigger on the data box edge device. - * @extends Array + * Defines values for EncryptionAlgorithm. \ + * {@link KnownEncryptionAlgorithm} can be used interchangeably with EncryptionAlgorithm, + * this enum contains the known values that the service supports. + * ### Known values supported by the service + * **None** \ + * **AES256** \ + * **RSAES_PKCS1_v_1_5** */ -export interface TriggerList extends Array { - /** - * Link to the next set of results. - * **NOTE: This property will not be serialized. It can only be populated by the server.** - */ - readonly nextLink?: string; -} +export type EncryptionAlgorithm = string; -/** - * @interface - * Collection of users. - * @extends Array - */ -export interface UserList extends Array { - /** - * Link to the next set of results. - * **NOTE: This property will not be serialized. It can only be populated by the server.** - */ - readonly nextLink?: string; +/** Known values of {@link ShareStatus} that the service accepts. */ +export enum KnownShareStatus { + Offline = "Offline", + Unknown = "Unknown", + OK = "OK", + Updating = "Updating", + NeedsAttention = "NeedsAttention" } -/** - * @interface - * List of SKU Information objects - * @extends Array - */ -export interface SkuInformationList extends Array { - /** - * Links to the next set of results - * **NOTE: This property will not be serialized. It can only be populated by the server.** - */ - readonly nextLink?: string; +/** + * Defines values for ShareStatus. \ + * {@link KnownShareStatus} can be used interchangeably with ShareStatus, + * this enum contains the known values that the service supports. + * ### Known values supported by the service + * **Offline** \ + * **Unknown** \ + * **OK** \ + * **Updating** \ + * **NeedsAttention** + */ +export type ShareStatus = string; + +/** Known values of {@link MonitoringStatus} that the service accepts. */ +export enum KnownMonitoringStatus { + Enabled = "Enabled", + Disabled = "Disabled" } /** - * Defines values for AlertSeverity. - * Possible values include: 'Informational', 'Warning', 'Critical' - * @readonly - * @enum {string} - */ -export type AlertSeverity = 'Informational' | 'Warning' | 'Critical'; - -/** - * Defines values for EncryptionAlgorithm. - * Possible values include: 'None', 'AES256', 'RSAES_PKCS1_v_1_5' - * @readonly - * @enum {string} - */ -export type EncryptionAlgorithm = 'None' | 'AES256' | 'RSAES_PKCS1_v_1_5'; - -/** - * Defines values for AzureContainerDataFormat. - * Possible values include: 'BlockBlob', 'PageBlob', 'AzureFile' - * @readonly - * @enum {string} - */ -export type AzureContainerDataFormat = 'BlockBlob' | 'PageBlob' | 'AzureFile'; - -/** - * Defines values for DayOfWeek. - * Possible values include: 'Sunday', 'Monday', 'Tuesday', 'Wednesday', 'Thursday', 'Friday', - * 'Saturday' - * @readonly - * @enum {string} - */ -export type DayOfWeek = 'Sunday' | 'Monday' | 'Tuesday' | 'Wednesday' | 'Thursday' | 'Friday' | 'Saturday'; - -/** - * Defines values for ClientPermissionType. - * Possible values include: 'NoAccess', 'ReadOnly', 'ReadWrite' - * @readonly - * @enum {string} + * Defines values for MonitoringStatus. \ + * {@link KnownMonitoringStatus} can be used interchangeably with MonitoringStatus, + * this enum contains the known values that the service supports. + * ### Known values supported by the service + * **Enabled** \ + * **Disabled** */ -export type ClientPermissionType = 'NoAccess' | 'ReadOnly' | 'ReadWrite'; +export type MonitoringStatus = string; -/** - * Defines values for ContainerStatus. - * Possible values include: 'OK', 'Offline', 'Unknown', 'Updating', 'NeedsAttention' - * @readonly - * @enum {string} - */ -export type ContainerStatus = 'OK' | 'Offline' | 'Unknown' | 'Updating' | 'NeedsAttention'; - -/** - * Defines values for SkuName. - * Possible values include: 'Gateway', 'Edge', 'TEA_1Node', 'TEA_1Node_UPS', 'TEA_1Node_Heater', - * 'TEA_1Node_UPS_Heater', 'TEA_4Node_Heater', 'TEA_4Node_UPS_Heater', 'TMA' - * @readonly - * @enum {string} - */ -export type SkuName = 'Gateway' | 'Edge' | 'TEA_1Node' | 'TEA_1Node_UPS' | 'TEA_1Node_Heater' | 'TEA_1Node_UPS_Heater' | 'TEA_4Node_Heater' | 'TEA_4Node_UPS_Heater' | 'TMA'; - -/** - * Defines values for SkuTier. - * Possible values include: 'Standard' - * @readonly - * @enum {string} - */ -export type SkuTier = 'Standard'; - -/** - * Defines values for DataBoxEdgeDeviceStatus. - * Possible values include: 'ReadyToSetup', 'Online', 'Offline', 'NeedsAttention', 'Disconnected', - * 'PartiallyDisconnected', 'Maintenance' - * @readonly - * @enum {string} - */ -export type DataBoxEdgeDeviceStatus = 'ReadyToSetup' | 'Online' | 'Offline' | 'NeedsAttention' | 'Disconnected' | 'PartiallyDisconnected' | 'Maintenance'; - -/** - * Defines values for DeviceType. - * Possible values include: 'DataBoxEdgeDevice' - * @readonly - * @enum {string} - */ -export type DeviceType = 'DataBoxEdgeDevice'; +/** Known values of {@link AzureContainerDataFormat} that the service accepts. */ +export enum KnownAzureContainerDataFormat { + BlockBlob = "BlockBlob", + PageBlob = "PageBlob", + AzureFile = "AzureFile" +} /** - * Defines values for RoleTypes. - * Possible values include: 'IOT', 'ASA', 'Functions', 'Cognitive' - * @readonly - * @enum {string} + * Defines values for AzureContainerDataFormat. \ + * {@link KnownAzureContainerDataFormat} can be used interchangeably with AzureContainerDataFormat, + * this enum contains the known values that the service supports. + * ### Known values supported by the service + * **BlockBlob** \ + * **PageBlob** \ + * **AzureFile** */ -export type RoleTypes = 'IOT' | 'ASA' | 'Functions' | 'Cognitive'; +export type AzureContainerDataFormat = string; -/** - * Defines values for PlatformType. - * Possible values include: 'Windows', 'Linux' - * @readonly - * @enum {string} - */ -export type PlatformType = 'Windows' | 'Linux'; +/** Known values of {@link ShareAccessProtocol} that the service accepts. */ +export enum KnownShareAccessProtocol { + SMB = "SMB", + NFS = "NFS" +} /** - * Defines values for RoleStatus. - * Possible values include: 'Enabled', 'Disabled' - * @readonly - * @enum {string} + * Defines values for ShareAccessProtocol. \ + * {@link KnownShareAccessProtocol} can be used interchangeably with ShareAccessProtocol, + * this enum contains the known values that the service supports. + * ### Known values supported by the service + * **SMB** \ + * **NFS** */ -export type RoleStatus = 'Enabled' | 'Disabled'; +export type ShareAccessProtocol = string; -/** - * Defines values for JobStatus. - * Possible values include: 'Invalid', 'Running', 'Succeeded', 'Failed', 'Canceled', 'Paused', - * 'Scheduled' - * @readonly - * @enum {string} - */ -export type JobStatus = 'Invalid' | 'Running' | 'Succeeded' | 'Failed' | 'Canceled' | 'Paused' | 'Scheduled'; +/** Known values of {@link ShareAccessType} that the service accepts. */ +export enum KnownShareAccessType { + Change = "Change", + Read = "Read", + Custom = "Custom" +} /** - * Defines values for JobType. - * Possible values include: 'Invalid', 'ScanForUpdates', 'DownloadUpdates', 'InstallUpdates', - * 'RefreshShare', 'RefreshContainer' - * @readonly - * @enum {string} + * Defines values for ShareAccessType. \ + * {@link KnownShareAccessType} can be used interchangeably with ShareAccessType, + * this enum contains the known values that the service supports. + * ### Known values supported by the service + * **Change** \ + * **Read** \ + * **Custom** */ -export type JobType = 'Invalid' | 'ScanForUpdates' | 'DownloadUpdates' | 'InstallUpdates' | 'RefreshShare' | 'RefreshContainer'; +export type ShareAccessType = string; -/** - * Defines values for UpdateOperationStage. - * Possible values include: 'Unknown', 'Initial', 'ScanStarted', 'ScanComplete', 'ScanFailed', - * 'DownloadStarted', 'DownloadComplete', 'DownloadFailed', 'InstallStarted', 'InstallComplete', - * 'InstallFailed', 'RebootInitiated', 'Success', 'Failure', 'RescanStarted', 'RescanComplete', - * 'RescanFailed' - * @readonly - * @enum {string} - */ -export type UpdateOperationStage = 'Unknown' | 'Initial' | 'ScanStarted' | 'ScanComplete' | 'ScanFailed' | 'DownloadStarted' | 'DownloadComplete' | 'DownloadFailed' | 'InstallStarted' | 'InstallComplete' | 'InstallFailed' | 'RebootInitiated' | 'Success' | 'Failure' | 'RescanStarted' | 'RescanComplete' | 'RescanFailed'; +/** Known values of {@link ClientPermissionType} that the service accepts. */ +export enum KnownClientPermissionType { + NoAccess = "NoAccess", + ReadOnly = "ReadOnly", + ReadWrite = "ReadWrite" +} /** - * Defines values for DownloadPhase. - * Possible values include: 'Unknown', 'Initializing', 'Downloading', 'Verifying' - * @readonly - * @enum {string} + * Defines values for ClientPermissionType. \ + * {@link KnownClientPermissionType} can be used interchangeably with ClientPermissionType, + * this enum contains the known values that the service supports. + * ### Known values supported by the service + * **NoAccess** \ + * **ReadOnly** \ + * **ReadWrite** */ -export type DownloadPhase = 'Unknown' | 'Initializing' | 'Downloading' | 'Verifying'; +export type ClientPermissionType = string; -/** - * Defines values for MetricUnit. - * Possible values include: 'NotSpecified', 'Percent', 'Count', 'Seconds', 'Milliseconds', 'Bytes', - * 'BytesPerSecond', 'CountPerSecond' - * @readonly - * @enum {string} - */ -export type MetricUnit = 'NotSpecified' | 'Percent' | 'Count' | 'Seconds' | 'Milliseconds' | 'Bytes' | 'BytesPerSecond' | 'CountPerSecond'; +/** Known values of {@link DataPolicy} that the service accepts. */ +export enum KnownDataPolicy { + Cloud = "Cloud", + Local = "Local" +} /** - * Defines values for MetricAggregationType. - * Possible values include: 'NotSpecified', 'None', 'Average', 'Minimum', 'Maximum', 'Total', - * 'Count' - * @readonly - * @enum {string} + * Defines values for DataPolicy. \ + * {@link KnownDataPolicy} can be used interchangeably with DataPolicy, + * this enum contains the known values that the service supports. + * ### Known values supported by the service + * **Cloud** \ + * **Local** */ -export type MetricAggregationType = 'NotSpecified' | 'None' | 'Average' | 'Minimum' | 'Maximum' | 'Total' | 'Count'; +export type DataPolicy = string; -/** - * Defines values for MetricCategory. - * Possible values include: 'Capacity', 'Transaction' - * @readonly - * @enum {string} - */ -export type MetricCategory = 'Capacity' | 'Transaction'; +/** Known values of {@link SSLStatus} that the service accepts. */ +export enum KnownSSLStatus { + Enabled = "Enabled", + Disabled = "Disabled" +} /** - * Defines values for TimeGrain. - * Possible values include: 'PT1M', 'PT5M', 'PT15M', 'PT30M', 'PT1H', 'PT6H', 'PT12H', 'PT1D' - * @readonly - * @enum {string} + * Defines values for SSLStatus. \ + * {@link KnownSSLStatus} can be used interchangeably with SSLStatus, + * this enum contains the known values that the service supports. + * ### Known values supported by the service + * **Enabled** \ + * **Disabled** */ -export type TimeGrain = 'PT1M' | 'PT5M' | 'PT15M' | 'PT30M' | 'PT1H' | 'PT6H' | 'PT12H' | 'PT1D'; +export type SSLStatus = string; -/** - * Defines values for NetworkGroup. - * Possible values include: 'None', 'NonRDMA', 'RDMA' - * @readonly - * @enum {string} - */ -export type NetworkGroup = 'None' | 'NonRDMA' | 'RDMA'; +/** Known values of {@link AccountType} that the service accepts. */ +export enum KnownAccountType { + GeneralPurposeStorage = "GeneralPurposeStorage", + BlobStorage = "BlobStorage" +} /** - * Defines values for NetworkAdapterStatus. - * Possible values include: 'Inactive', 'Active' - * @readonly - * @enum {string} + * Defines values for AccountType. \ + * {@link KnownAccountType} can be used interchangeably with AccountType, + * this enum contains the known values that the service supports. + * ### Known values supported by the service + * **GeneralPurposeStorage** \ + * **BlobStorage** */ -export type NetworkAdapterStatus = 'Inactive' | 'Active'; +export type AccountType = string; -/** - * Defines values for NetworkAdapterRDMAStatus. - * Possible values include: 'Incapable', 'Capable' - * @readonly - * @enum {string} - */ -export type NetworkAdapterRDMAStatus = 'Incapable' | 'Capable'; +/** Known values of {@link StorageAccountStatus} that the service accepts. */ +export enum KnownStorageAccountStatus { + OK = "OK", + Offline = "Offline", + Unknown = "Unknown", + Updating = "Updating", + NeedsAttention = "NeedsAttention" +} /** - * Defines values for NetworkAdapterDHCPStatus. - * Possible values include: 'Disabled', 'Enabled' - * @readonly - * @enum {string} + * Defines values for StorageAccountStatus. \ + * {@link KnownStorageAccountStatus} can be used interchangeably with StorageAccountStatus, + * this enum contains the known values that the service supports. + * ### Known values supported by the service + * **OK** \ + * **Offline** \ + * **Unknown** \ + * **Updating** \ + * **NeedsAttention** */ -export type NetworkAdapterDHCPStatus = 'Disabled' | 'Enabled'; +export type StorageAccountStatus = string; -/** - * Defines values for NodeStatus. - * Possible values include: 'Unknown', 'Up', 'Down', 'Rebooting', 'ShuttingDown' - * @readonly - * @enum {string} - */ -export type NodeStatus = 'Unknown' | 'Up' | 'Down' | 'Rebooting' | 'ShuttingDown'; +/** Known values of {@link ContainerStatus} that the service accepts. */ +export enum KnownContainerStatus { + OK = "OK", + Offline = "Offline", + Unknown = "Unknown", + Updating = "Updating", + NeedsAttention = "NeedsAttention" +} /** - * Defines values for OrderState. - * Possible values include: 'Untracked', 'AwaitingFulfilment', 'AwaitingPreparation', - * 'AwaitingShipment', 'Shipped', 'Arriving', 'Delivered', 'ReplacementRequested', 'LostDevice', - * 'Declined', 'ReturnInitiated', 'AwaitingReturnShipment', 'ShippedBack', 'CollectedAtMicrosoft' - * @readonly - * @enum {string} + * Defines values for ContainerStatus. \ + * {@link KnownContainerStatus} can be used interchangeably with ContainerStatus, + * this enum contains the known values that the service supports. + * ### Known values supported by the service + * **OK** \ + * **Offline** \ + * **Unknown** \ + * **Updating** \ + * **NeedsAttention** */ -export type OrderState = 'Untracked' | 'AwaitingFulfilment' | 'AwaitingPreparation' | 'AwaitingShipment' | 'Shipped' | 'Arriving' | 'Delivered' | 'ReplacementRequested' | 'LostDevice' | 'Declined' | 'ReturnInitiated' | 'AwaitingReturnShipment' | 'ShippedBack' | 'CollectedAtMicrosoft'; +export type ContainerStatus = string; -/** - * Defines values for AuthenticationType. - * Possible values include: 'Invalid', 'AzureActiveDirectory' - * @readonly - * @enum {string} - */ -export type AuthenticationType = 'Invalid' | 'AzureActiveDirectory'; +/** Known values of {@link TriggerEventType} that the service accepts. */ +export enum KnownTriggerEventType { + FileEvent = "FileEvent", + PeriodicTimerEvent = "PeriodicTimerEvent" +} /** - * Defines values for SkuRestrictionReasonCode. - * Possible values include: 'NotAvailableForSubscription', 'QuotaId' - * @readonly - * @enum {string} + * Defines values for TriggerEventType. \ + * {@link KnownTriggerEventType} can be used interchangeably with TriggerEventType, + * this enum contains the known values that the service supports. + * ### Known values supported by the service + * **FileEvent** \ + * **PeriodicTimerEvent** */ -export type SkuRestrictionReasonCode = 'NotAvailableForSubscription' | 'QuotaId'; +export type TriggerEventType = string; -/** - * Defines values for ShareStatus. - * Possible values include: 'Offline', 'Unknown', 'OK', 'Updating', 'NeedsAttention' - * @readonly - * @enum {string} - */ -export type ShareStatus = 'Offline' | 'Unknown' | 'OK' | 'Updating' | 'NeedsAttention'; +/** Known values of {@link InstallRebootBehavior} that the service accepts. */ +export enum KnownInstallRebootBehavior { + NeverReboots = "NeverReboots", + RequiresReboot = "RequiresReboot", + RequestReboot = "RequestReboot" +} /** - * Defines values for MonitoringStatus. - * Possible values include: 'Enabled', 'Disabled' - * @readonly - * @enum {string} + * Defines values for InstallRebootBehavior. \ + * {@link KnownInstallRebootBehavior} can be used interchangeably with InstallRebootBehavior, + * this enum contains the known values that the service supports. + * ### Known values supported by the service + * **NeverReboots** \ + * **RequiresReboot** \ + * **RequestReboot** */ -export type MonitoringStatus = 'Enabled' | 'Disabled'; +export type InstallRebootBehavior = string; -/** - * Defines values for ShareAccessProtocol. - * Possible values include: 'SMB', 'NFS' - * @readonly - * @enum {string} - */ -export type ShareAccessProtocol = 'SMB' | 'NFS'; +/** Known values of {@link UpdateOperation} that the service accepts. */ +export enum KnownUpdateOperation { + None = "None", + Scan = "Scan", + Download = "Download", + Install = "Install" +} /** - * Defines values for ShareAccessType. - * Possible values include: 'Change', 'Read', 'Custom' - * @readonly - * @enum {string} + * Defines values for UpdateOperation. \ + * {@link KnownUpdateOperation} can be used interchangeably with UpdateOperation, + * this enum contains the known values that the service supports. + * ### Known values supported by the service + * **None** \ + * **Scan** \ + * **Download** \ + * **Install** */ -export type ShareAccessType = 'Change' | 'Read' | 'Custom'; +export type UpdateOperation = string; -/** - * Defines values for DataPolicy. - * Possible values include: 'Cloud', 'Local' - * @readonly - * @enum {string} - */ -export type DataPolicy = 'Cloud' | 'Local'; +/** Known values of {@link AuthenticationType} that the service accepts. */ +export enum KnownAuthenticationType { + Invalid = "Invalid", + AzureActiveDirectory = "AzureActiveDirectory" +} /** - * Defines values for StorageAccountStatus. - * Possible values include: 'OK', 'Offline', 'Unknown', 'Updating', 'NeedsAttention' - * @readonly - * @enum {string} + * Defines values for AuthenticationType. \ + * {@link KnownAuthenticationType} can be used interchangeably with AuthenticationType, + * this enum contains the known values that the service supports. + * ### Known values supported by the service + * **Invalid** \ + * **AzureActiveDirectory** */ -export type StorageAccountStatus = 'OK' | 'Offline' | 'Unknown' | 'Updating' | 'NeedsAttention'; +export type AuthenticationType = string; -/** - * Defines values for SSLStatus. - * Possible values include: 'Enabled', 'Disabled' - * @readonly - * @enum {string} - */ -export type SSLStatus = 'Enabled' | 'Disabled'; +/** Known values of {@link UserType} that the service accepts. */ +export enum KnownUserType { + Share = "Share", + LocalManagement = "LocalManagement", + ARM = "ARM" +} /** - * Defines values for AccountType. - * Possible values include: 'GeneralPurposeStorage', 'BlobStorage' - * @readonly - * @enum {string} + * Defines values for UserType. \ + * {@link KnownUserType} can be used interchangeably with UserType, + * this enum contains the known values that the service supports. + * ### Known values supported by the service + * **Share** \ + * **LocalManagement** \ + * **ARM** */ -export type AccountType = 'GeneralPurposeStorage' | 'BlobStorage'; +export type UserType = string; -/** - * Defines values for InstallRebootBehavior. - * Possible values include: 'NeverReboots', 'RequiresReboot', 'RequestReboot' - * @readonly - * @enum {string} - */ -export type InstallRebootBehavior = 'NeverReboots' | 'RequiresReboot' | 'RequestReboot'; +/** Known values of {@link SkuRestrictionReasonCode} that the service accepts. */ +export enum KnownSkuRestrictionReasonCode { + NotAvailableForSubscription = "NotAvailableForSubscription", + QuotaId = "QuotaId" +} /** - * Defines values for UpdateOperation. - * Possible values include: 'None', 'Scan', 'Download', 'Install' - * @readonly - * @enum {string} + * Defines values for SkuRestrictionReasonCode. \ + * {@link KnownSkuRestrictionReasonCode} can be used interchangeably with SkuRestrictionReasonCode, + * this enum contains the known values that the service supports. + * ### Known values supported by the service + * **NotAvailableForSubscription** \ + * **QuotaId** */ -export type UpdateOperation = 'None' | 'Scan' | 'Download' | 'Install'; +export type SkuRestrictionReasonCode = string; -/** - * Defines values for UserType. - * Possible values include: 'Share', 'LocalManagement', 'ARM' - * @readonly - * @enum {string} - */ -export type UserType = 'Share' | 'LocalManagement' | 'ARM'; +/** Known values of {@link PlatformType} that the service accepts. */ +export enum KnownPlatformType { + Windows = "Windows", + Linux = "Linux" +} /** - * Contains response data for the list operation. + * Defines values for PlatformType. \ + * {@link KnownPlatformType} can be used interchangeably with PlatformType, + * this enum contains the known values that the service supports. + * ### Known values supported by the service + * **Windows** \ + * **Linux** */ -export type OperationsListResponse = OperationsList & { - /** - * The underlying HTTP response. - */ - _response: msRest.HttpResponse & { - /** - * The response body as text (string format) - */ - bodyAsText: string; +export type PlatformType = string; - /** - * The response body as parsed JSON or XML - */ - parsedBody: OperationsList; - }; -}; +/** Known values of {@link RoleStatus} that the service accepts. */ +export enum KnownRoleStatus { + Enabled = "Enabled", + Disabled = "Disabled" +} /** - * Contains response data for the listNext operation. + * Defines values for RoleStatus. \ + * {@link KnownRoleStatus} can be used interchangeably with RoleStatus, + * this enum contains the known values that the service supports. + * ### Known values supported by the service + * **Enabled** \ + * **Disabled** */ -export type OperationsListNextResponse = OperationsList & { - /** - * The underlying HTTP response. - */ - _response: msRest.HttpResponse & { - /** - * The response body as text (string format) - */ - bodyAsText: string; +export type RoleStatus = string; - /** - * The response body as parsed JSON or XML - */ - parsedBody: OperationsList; - }; -}; +/** Optional parameters. */ +export interface OperationsListOptionalParams + extends coreClient.OperationOptions {} -/** - * Contains response data for the listBySubscription operation. - */ -export type DevicesListBySubscriptionResponse = DataBoxEdgeDeviceList & { - /** - * The underlying HTTP response. - */ - _response: msRest.HttpResponse & { - /** - * The response body as text (string format) - */ - bodyAsText: string; +/** Contains response data for the list operation. */ +export type OperationsListResponse = OperationsList; - /** - * The response body as parsed JSON or XML - */ - parsedBody: DataBoxEdgeDeviceList; - }; -}; +/** Optional parameters. */ +export interface OperationsListNextOptionalParams + extends coreClient.OperationOptions {} -/** - * Contains response data for the listByResourceGroup operation. - */ -export type DevicesListByResourceGroupResponse = DataBoxEdgeDeviceList & { - /** - * The underlying HTTP response. - */ - _response: msRest.HttpResponse & { - /** - * The response body as text (string format) - */ - bodyAsText: string; +/** Contains response data for the listNext operation. */ +export type OperationsListNextResponse = OperationsList; - /** - * The response body as parsed JSON or XML - */ - parsedBody: DataBoxEdgeDeviceList; - }; -}; +/** Optional parameters. */ +export interface DevicesListBySubscriptionOptionalParams + extends coreClient.OperationOptions { + /** Specify $expand=details to populate additional fields related to the resource or Specify $skipToken= to populate the next page in the list. */ + expand?: string; +} -/** - * Contains response data for the get operation. - */ -export type DevicesGetResponse = DataBoxEdgeDevice & { - /** - * The underlying HTTP response. - */ - _response: msRest.HttpResponse & { - /** - * The response body as text (string format) - */ - bodyAsText: string; +/** Contains response data for the listBySubscription operation. */ +export type DevicesListBySubscriptionResponse = DataBoxEdgeDeviceList; - /** - * The response body as parsed JSON or XML - */ - parsedBody: DataBoxEdgeDevice; - }; -}; +/** Optional parameters. */ +export interface DevicesListByResourceGroupOptionalParams + extends coreClient.OperationOptions { + /** Specify $expand=details to populate additional fields related to the resource or Specify $skipToken= to populate the next page in the list. */ + expand?: string; +} -/** - * Contains response data for the createOrUpdate operation. - */ -export type DevicesCreateOrUpdateResponse = DataBoxEdgeDevice & { - /** - * The underlying HTTP response. - */ - _response: msRest.HttpResponse & { - /** - * The response body as text (string format) - */ - bodyAsText: string; +/** Contains response data for the listByResourceGroup operation. */ +export type DevicesListByResourceGroupResponse = DataBoxEdgeDeviceList; - /** - * The response body as parsed JSON or XML - */ - parsedBody: DataBoxEdgeDevice; - }; -}; +/** Optional parameters. */ +export interface DevicesGetOptionalParams extends coreClient.OperationOptions {} -/** - * Contains response data for the update operation. - */ -export type DevicesUpdateResponse = DataBoxEdgeDevice & { - /** - * The underlying HTTP response. - */ - _response: msRest.HttpResponse & { - /** - * The response body as text (string format) - */ - bodyAsText: string; +/** Contains response data for the get operation. */ +export type DevicesGetResponse = DataBoxEdgeDevice; - /** - * The response body as parsed JSON or XML - */ - parsedBody: DataBoxEdgeDevice; - }; -}; +/** Optional parameters. */ +export interface DevicesCreateOrUpdateOptionalParams + extends coreClient.OperationOptions { + /** Delay to wait until next poll, in milliseconds. */ + updateIntervalInMs?: number; + /** A serialized poller which can be used to resume an existing paused Long-Running-Operation. */ + resumeFrom?: string; +} -/** - * Contains response data for the getExtendedInformation operation. - */ -export type DevicesGetExtendedInformationResponse = DataBoxEdgeDeviceExtendedInfo & { - /** - * The underlying HTTP response. - */ - _response: msRest.HttpResponse & { - /** - * The response body as text (string format) - */ - bodyAsText: string; +/** Contains response data for the createOrUpdate operation. */ +export type DevicesCreateOrUpdateResponse = DataBoxEdgeDevice; - /** - * The response body as parsed JSON or XML - */ - parsedBody: DataBoxEdgeDeviceExtendedInfo; - }; -}; +/** Optional parameters. */ +export interface DevicesDeleteOptionalParams + extends coreClient.OperationOptions { + /** Delay to wait until next poll, in milliseconds. */ + updateIntervalInMs?: number; + /** A serialized poller which can be used to resume an existing paused Long-Running-Operation. */ + resumeFrom?: string; +} -/** - * Contains response data for the getNetworkSettings operation. - */ -export type DevicesGetNetworkSettingsResponse = NetworkSettings & { - /** - * The underlying HTTP response. - */ - _response: msRest.HttpResponse & { - /** - * The response body as text (string format) - */ - bodyAsText: string; +/** Optional parameters. */ +export interface DevicesUpdateOptionalParams + extends coreClient.OperationOptions {} - /** - * The response body as parsed JSON or XML - */ - parsedBody: NetworkSettings; - }; -}; +/** Contains response data for the update operation. */ +export type DevicesUpdateResponse = DataBoxEdgeDevice; -/** - * Contains response data for the getUpdateSummary operation. - */ -export type DevicesGetUpdateSummaryResponse = UpdateSummary & { - /** - * The underlying HTTP response. - */ - _response: msRest.HttpResponse & { - /** - * The response body as text (string format) - */ - bodyAsText: string; +/** Optional parameters. */ +export interface DevicesDownloadUpdatesOptionalParams + extends coreClient.OperationOptions { + /** Delay to wait until next poll, in milliseconds. */ + updateIntervalInMs?: number; + /** A serialized poller which can be used to resume an existing paused Long-Running-Operation. */ + resumeFrom?: string; +} - /** - * The response body as parsed JSON or XML - */ - parsedBody: UpdateSummary; - }; -}; +/** Optional parameters. */ +export interface DevicesGetExtendedInformationOptionalParams + extends coreClient.OperationOptions {} -/** - * Contains response data for the uploadCertificate operation. - */ -export type DevicesUploadCertificateResponse = UploadCertificateResponse & { - /** - * The underlying HTTP response. - */ - _response: msRest.HttpResponse & { - /** - * The response body as text (string format) - */ - bodyAsText: string; +/** Contains response data for the getExtendedInformation operation. */ +export type DevicesGetExtendedInformationResponse = DataBoxEdgeDeviceExtendedInfo; - /** - * The response body as parsed JSON or XML - */ - parsedBody: UploadCertificateResponse; - }; -}; +/** Optional parameters. */ +export interface DevicesInstallUpdatesOptionalParams + extends coreClient.OperationOptions { + /** Delay to wait until next poll, in milliseconds. */ + updateIntervalInMs?: number; + /** A serialized poller which can be used to resume an existing paused Long-Running-Operation. */ + resumeFrom?: string; +} -/** - * Contains response data for the beginCreateOrUpdate operation. - */ -export type DevicesBeginCreateOrUpdateResponse = DataBoxEdgeDevice & { - /** - * The underlying HTTP response. - */ - _response: msRest.HttpResponse & { - /** - * The response body as text (string format) - */ - bodyAsText: string; +/** Optional parameters. */ +export interface DevicesGetNetworkSettingsOptionalParams + extends coreClient.OperationOptions {} - /** - * The response body as parsed JSON or XML - */ - parsedBody: DataBoxEdgeDevice; - }; -}; +/** Contains response data for the getNetworkSettings operation. */ +export type DevicesGetNetworkSettingsResponse = NetworkSettings; -/** - * Contains response data for the listBySubscriptionNext operation. - */ -export type DevicesListBySubscriptionNextResponse = DataBoxEdgeDeviceList & { - /** - * The underlying HTTP response. - */ - _response: msRest.HttpResponse & { - /** - * The response body as text (string format) - */ - bodyAsText: string; +/** Optional parameters. */ +export interface DevicesScanForUpdatesOptionalParams + extends coreClient.OperationOptions { + /** Delay to wait until next poll, in milliseconds. */ + updateIntervalInMs?: number; + /** A serialized poller which can be used to resume an existing paused Long-Running-Operation. */ + resumeFrom?: string; +} - /** - * The response body as parsed JSON or XML - */ - parsedBody: DataBoxEdgeDeviceList; - }; -}; +/** Optional parameters. */ +export interface DevicesCreateOrUpdateSecuritySettingsOptionalParams + extends coreClient.OperationOptions { + /** Delay to wait until next poll, in milliseconds. */ + updateIntervalInMs?: number; + /** A serialized poller which can be used to resume an existing paused Long-Running-Operation. */ + resumeFrom?: string; +} -/** - * Contains response data for the listByResourceGroupNext operation. - */ -export type DevicesListByResourceGroupNextResponse = DataBoxEdgeDeviceList & { - /** - * The underlying HTTP response. - */ - _response: msRest.HttpResponse & { - /** - * The response body as text (string format) - */ - bodyAsText: string; +/** Optional parameters. */ +export interface DevicesGetUpdateSummaryOptionalParams + extends coreClient.OperationOptions {} - /** - * The response body as parsed JSON or XML - */ - parsedBody: DataBoxEdgeDeviceList; - }; -}; +/** Contains response data for the getUpdateSummary operation. */ +export type DevicesGetUpdateSummaryResponse = UpdateSummary; -/** - * Contains response data for the listByDataBoxEdgeDevice operation. - */ -export type AlertsListByDataBoxEdgeDeviceResponse = AlertList & { - /** - * The underlying HTTP response. - */ - _response: msRest.HttpResponse & { - /** - * The response body as text (string format) - */ - bodyAsText: string; +/** Optional parameters. */ +export interface DevicesUploadCertificateOptionalParams + extends coreClient.OperationOptions {} - /** - * The response body as parsed JSON or XML - */ - parsedBody: AlertList; - }; -}; +/** Contains response data for the uploadCertificate operation. */ +export type DevicesUploadCertificateResponse = UploadCertificateResponse; -/** - * Contains response data for the get operation. - */ -export type AlertsGetResponse = Alert & { - /** - * The underlying HTTP response. - */ - _response: msRest.HttpResponse & { - /** - * The response body as text (string format) - */ - bodyAsText: string; +/** Optional parameters. */ +export interface DevicesListBySubscriptionNextOptionalParams + extends coreClient.OperationOptions { + /** Specify $expand=details to populate additional fields related to the resource or Specify $skipToken= to populate the next page in the list. */ + expand?: string; +} - /** - * The response body as parsed JSON or XML - */ - parsedBody: Alert; - }; -}; +/** Contains response data for the listBySubscriptionNext operation. */ +export type DevicesListBySubscriptionNextResponse = DataBoxEdgeDeviceList; -/** - * Contains response data for the listByDataBoxEdgeDeviceNext operation. - */ -export type AlertsListByDataBoxEdgeDeviceNextResponse = AlertList & { - /** - * The underlying HTTP response. - */ - _response: msRest.HttpResponse & { - /** - * The response body as text (string format) - */ - bodyAsText: string; +/** Optional parameters. */ +export interface DevicesListByResourceGroupNextOptionalParams + extends coreClient.OperationOptions { + /** Specify $expand=details to populate additional fields related to the resource or Specify $skipToken= to populate the next page in the list. */ + expand?: string; +} - /** - * The response body as parsed JSON or XML - */ - parsedBody: AlertList; - }; -}; +/** Contains response data for the listByResourceGroupNext operation. */ +export type DevicesListByResourceGroupNextResponse = DataBoxEdgeDeviceList; -/** - * Contains response data for the listByDataBoxEdgeDevice operation. - */ -export type BandwidthSchedulesListByDataBoxEdgeDeviceResponse = BandwidthSchedulesList & { - /** - * The underlying HTTP response. - */ - _response: msRest.HttpResponse & { - /** - * The response body as text (string format) - */ - bodyAsText: string; +/** Optional parameters. */ +export interface AlertsListByDataBoxEdgeDeviceOptionalParams + extends coreClient.OperationOptions {} - /** - * The response body as parsed JSON or XML - */ - parsedBody: BandwidthSchedulesList; - }; -}; +/** Contains response data for the listByDataBoxEdgeDevice operation. */ +export type AlertsListByDataBoxEdgeDeviceResponse = AlertList; -/** - * Contains response data for the get operation. - */ -export type BandwidthSchedulesGetResponse = BandwidthSchedule & { - /** - * The underlying HTTP response. - */ - _response: msRest.HttpResponse & { - /** - * The response body as text (string format) - */ - bodyAsText: string; +/** Optional parameters. */ +export interface AlertsGetOptionalParams extends coreClient.OperationOptions {} - /** - * The response body as parsed JSON or XML - */ - parsedBody: BandwidthSchedule; - }; -}; +/** Contains response data for the get operation. */ +export type AlertsGetResponse = Alert; -/** - * Contains response data for the createOrUpdate operation. - */ -export type BandwidthSchedulesCreateOrUpdateResponse = BandwidthSchedule & { - /** - * The underlying HTTP response. - */ - _response: msRest.HttpResponse & { - /** - * The response body as text (string format) - */ - bodyAsText: string; +/** Optional parameters. */ +export interface AlertsListByDataBoxEdgeDeviceNextOptionalParams + extends coreClient.OperationOptions {} - /** - * The response body as parsed JSON or XML - */ - parsedBody: BandwidthSchedule; - }; -}; +/** Contains response data for the listByDataBoxEdgeDeviceNext operation. */ +export type AlertsListByDataBoxEdgeDeviceNextResponse = AlertList; -/** - * Contains response data for the beginCreateOrUpdate operation. - */ -export type BandwidthSchedulesBeginCreateOrUpdateResponse = BandwidthSchedule & { - /** - * The underlying HTTP response. - */ - _response: msRest.HttpResponse & { - /** - * The response body as text (string format) - */ - bodyAsText: string; +/** Optional parameters. */ +export interface BandwidthSchedulesListByDataBoxEdgeDeviceOptionalParams + extends coreClient.OperationOptions {} - /** - * The response body as parsed JSON or XML - */ - parsedBody: BandwidthSchedule; - }; -}; +/** Contains response data for the listByDataBoxEdgeDevice operation. */ +export type BandwidthSchedulesListByDataBoxEdgeDeviceResponse = BandwidthSchedulesList; -/** - * Contains response data for the listByDataBoxEdgeDeviceNext operation. - */ -export type BandwidthSchedulesListByDataBoxEdgeDeviceNextResponse = BandwidthSchedulesList & { - /** - * The underlying HTTP response. - */ - _response: msRest.HttpResponse & { - /** - * The response body as text (string format) - */ - bodyAsText: string; +/** Optional parameters. */ +export interface BandwidthSchedulesGetOptionalParams + extends coreClient.OperationOptions {} - /** - * The response body as parsed JSON or XML - */ - parsedBody: BandwidthSchedulesList; - }; -}; +/** Contains response data for the get operation. */ +export type BandwidthSchedulesGetResponse = BandwidthSchedule; -/** - * Contains response data for the get operation. - */ -export type JobsGetResponse = Job & { - /** - * The underlying HTTP response. - */ - _response: msRest.HttpResponse & { - /** - * The response body as text (string format) - */ - bodyAsText: string; +/** Optional parameters. */ +export interface BandwidthSchedulesCreateOrUpdateOptionalParams + extends coreClient.OperationOptions { + /** Delay to wait until next poll, in milliseconds. */ + updateIntervalInMs?: number; + /** A serialized poller which can be used to resume an existing paused Long-Running-Operation. */ + resumeFrom?: string; +} - /** - * The response body as parsed JSON or XML - */ - parsedBody: Job; - }; -}; +/** Contains response data for the createOrUpdate operation. */ +export type BandwidthSchedulesCreateOrUpdateResponse = BandwidthSchedule; -/** - * Contains response data for the listByDataBoxEdgeDevice operation. - */ -export type NodesListByDataBoxEdgeDeviceResponse = NodeList & { - /** - * The underlying HTTP response. - */ - _response: msRest.HttpResponse & { - /** - * The response body as text (string format) - */ - bodyAsText: string; +/** Optional parameters. */ +export interface BandwidthSchedulesDeleteOptionalParams + extends coreClient.OperationOptions { + /** Delay to wait until next poll, in milliseconds. */ + updateIntervalInMs?: number; + /** A serialized poller which can be used to resume an existing paused Long-Running-Operation. */ + resumeFrom?: string; +} - /** - * The response body as parsed JSON or XML - */ - parsedBody: NodeList; - }; -}; +/** Optional parameters. */ +export interface BandwidthSchedulesListByDataBoxEdgeDeviceNextOptionalParams + extends coreClient.OperationOptions {} -/** - * Contains response data for the get operation. - */ -export type OperationsStatusGetResponse = Job & { - /** - * The underlying HTTP response. - */ - _response: msRest.HttpResponse & { - /** - * The response body as text (string format) - */ - bodyAsText: string; +/** Contains response data for the listByDataBoxEdgeDeviceNext operation. */ +export type BandwidthSchedulesListByDataBoxEdgeDeviceNextResponse = BandwidthSchedulesList; - /** - * The response body as parsed JSON or XML - */ - parsedBody: Job; - }; -}; +/** Optional parameters. */ +export interface JobsGetOptionalParams extends coreClient.OperationOptions {} -/** - * Contains response data for the listByDataBoxEdgeDevice operation. - */ -export type OrdersListByDataBoxEdgeDeviceResponse = OrderList & { - /** - * The underlying HTTP response. - */ - _response: msRest.HttpResponse & { - /** - * The response body as text (string format) - */ - bodyAsText: string; +/** Contains response data for the get operation. */ +export type JobsGetResponse = Job; - /** - * The response body as parsed JSON or XML - */ - parsedBody: OrderList; - }; -}; +/** Optional parameters. */ +export interface NodesListByDataBoxEdgeDeviceOptionalParams + extends coreClient.OperationOptions {} -/** - * Contains response data for the get operation. - */ -export type OrdersGetResponse = Order & { - /** - * The underlying HTTP response. - */ - _response: msRest.HttpResponse & { - /** - * The response body as text (string format) - */ - bodyAsText: string; +/** Contains response data for the listByDataBoxEdgeDevice operation. */ +export type NodesListByDataBoxEdgeDeviceResponse = NodeList; - /** - * The response body as parsed JSON or XML - */ - parsedBody: Order; - }; -}; +/** Optional parameters. */ +export interface OperationsStatusGetOptionalParams + extends coreClient.OperationOptions {} -/** - * Contains response data for the createOrUpdate operation. - */ -export type OrdersCreateOrUpdateResponse = Order & { - /** - * The underlying HTTP response. - */ - _response: msRest.HttpResponse & { - /** - * The response body as text (string format) - */ - bodyAsText: string; +/** Contains response data for the get operation. */ +export type OperationsStatusGetResponse = Job; - /** - * The response body as parsed JSON or XML - */ - parsedBody: Order; - }; -}; +/** Optional parameters. */ +export interface OrdersListByDataBoxEdgeDeviceOptionalParams + extends coreClient.OperationOptions {} -/** - * Contains response data for the beginCreateOrUpdate operation. - */ -export type OrdersBeginCreateOrUpdateResponse = Order & { - /** - * The underlying HTTP response. - */ - _response: msRest.HttpResponse & { - /** - * The response body as text (string format) - */ - bodyAsText: string; +/** Contains response data for the listByDataBoxEdgeDevice operation. */ +export type OrdersListByDataBoxEdgeDeviceResponse = OrderList; - /** - * The response body as parsed JSON or XML - */ - parsedBody: Order; - }; -}; +/** Optional parameters. */ +export interface OrdersGetOptionalParams extends coreClient.OperationOptions {} -/** - * Contains response data for the listByDataBoxEdgeDeviceNext operation. - */ -export type OrdersListByDataBoxEdgeDeviceNextResponse = OrderList & { - /** - * The underlying HTTP response. - */ - _response: msRest.HttpResponse & { - /** - * The response body as text (string format) - */ - bodyAsText: string; +/** Contains response data for the get operation. */ +export type OrdersGetResponse = Order; - /** - * The response body as parsed JSON or XML - */ - parsedBody: OrderList; - }; -}; +/** Optional parameters. */ +export interface OrdersCreateOrUpdateOptionalParams + extends coreClient.OperationOptions { + /** Delay to wait until next poll, in milliseconds. */ + updateIntervalInMs?: number; + /** A serialized poller which can be used to resume an existing paused Long-Running-Operation. */ + resumeFrom?: string; +} -/** - * Contains response data for the listByDataBoxEdgeDevice operation. - */ -export type RolesListByDataBoxEdgeDeviceResponse = RoleList & { - /** - * The underlying HTTP response. - */ - _response: msRest.HttpResponse & { - /** - * The response body as text (string format) - */ - bodyAsText: string; +/** Contains response data for the createOrUpdate operation. */ +export type OrdersCreateOrUpdateResponse = Order; - /** - * The response body as parsed JSON or XML - */ - parsedBody: RoleList; - }; -}; +/** Optional parameters. */ +export interface OrdersDeleteOptionalParams + extends coreClient.OperationOptions { + /** Delay to wait until next poll, in milliseconds. */ + updateIntervalInMs?: number; + /** A serialized poller which can be used to resume an existing paused Long-Running-Operation. */ + resumeFrom?: string; +} -/** - * Contains response data for the get operation. - */ -export type RolesGetResponse = RoleUnion & { - /** - * The underlying HTTP response. - */ - _response: msRest.HttpResponse & { - /** - * The response body as text (string format) - */ - bodyAsText: string; +/** Optional parameters. */ +export interface OrdersListByDataBoxEdgeDeviceNextOptionalParams + extends coreClient.OperationOptions {} - /** - * The response body as parsed JSON or XML - */ - parsedBody: RoleUnion; - }; -}; +/** Contains response data for the listByDataBoxEdgeDeviceNext operation. */ +export type OrdersListByDataBoxEdgeDeviceNextResponse = OrderList; -/** - * Contains response data for the createOrUpdate operation. - */ -export type RolesCreateOrUpdateResponse = RoleUnion & { - /** - * The underlying HTTP response. - */ - _response: msRest.HttpResponse & { - /** - * The response body as text (string format) - */ - bodyAsText: string; +/** Optional parameters. */ +export interface RolesListByDataBoxEdgeDeviceOptionalParams + extends coreClient.OperationOptions {} - /** - * The response body as parsed JSON or XML - */ - parsedBody: RoleUnion; - }; -}; +/** Contains response data for the listByDataBoxEdgeDevice operation. */ +export type RolesListByDataBoxEdgeDeviceResponse = RoleList; -/** - * Contains response data for the beginCreateOrUpdate operation. - */ -export type RolesBeginCreateOrUpdateResponse = RoleUnion & { - /** - * The underlying HTTP response. - */ - _response: msRest.HttpResponse & { - /** - * The response body as text (string format) - */ - bodyAsText: string; +/** Optional parameters. */ +export interface RolesGetOptionalParams extends coreClient.OperationOptions {} - /** - * The response body as parsed JSON or XML - */ - parsedBody: RoleUnion; - }; -}; +/** Contains response data for the get operation. */ +export type RolesGetResponse = RoleUnion; -/** - * Contains response data for the listByDataBoxEdgeDeviceNext operation. - */ -export type RolesListByDataBoxEdgeDeviceNextResponse = RoleList & { - /** - * The underlying HTTP response. - */ - _response: msRest.HttpResponse & { - /** - * The response body as text (string format) - */ - bodyAsText: string; +/** Optional parameters. */ +export interface RolesCreateOrUpdateOptionalParams + extends coreClient.OperationOptions { + /** Delay to wait until next poll, in milliseconds. */ + updateIntervalInMs?: number; + /** A serialized poller which can be used to resume an existing paused Long-Running-Operation. */ + resumeFrom?: string; +} - /** - * The response body as parsed JSON or XML - */ - parsedBody: RoleList; - }; -}; +/** Contains response data for the createOrUpdate operation. */ +export type RolesCreateOrUpdateResponse = RoleUnion; -/** - * Contains response data for the listByDataBoxEdgeDevice operation. - */ -export type SharesListByDataBoxEdgeDeviceResponse = ShareList & { - /** - * The underlying HTTP response. - */ - _response: msRest.HttpResponse & { - /** - * The response body as text (string format) - */ - bodyAsText: string; +/** Optional parameters. */ +export interface RolesDeleteOptionalParams extends coreClient.OperationOptions { + /** Delay to wait until next poll, in milliseconds. */ + updateIntervalInMs?: number; + /** A serialized poller which can be used to resume an existing paused Long-Running-Operation. */ + resumeFrom?: string; +} - /** - * The response body as parsed JSON or XML - */ - parsedBody: ShareList; - }; -}; +/** Optional parameters. */ +export interface RolesListByDataBoxEdgeDeviceNextOptionalParams + extends coreClient.OperationOptions {} -/** - * Contains response data for the get operation. - */ -export type SharesGetResponse = Share & { - /** - * The underlying HTTP response. - */ - _response: msRest.HttpResponse & { - /** - * The response body as text (string format) - */ - bodyAsText: string; +/** Contains response data for the listByDataBoxEdgeDeviceNext operation. */ +export type RolesListByDataBoxEdgeDeviceNextResponse = RoleList; - /** - * The response body as parsed JSON or XML - */ - parsedBody: Share; - }; -}; +/** Optional parameters. */ +export interface SharesListByDataBoxEdgeDeviceOptionalParams + extends coreClient.OperationOptions {} -/** - * Contains response data for the createOrUpdate operation. - */ -export type SharesCreateOrUpdateResponse = Share & { - /** - * The underlying HTTP response. - */ - _response: msRest.HttpResponse & { - /** - * The response body as text (string format) - */ - bodyAsText: string; +/** Contains response data for the listByDataBoxEdgeDevice operation. */ +export type SharesListByDataBoxEdgeDeviceResponse = ShareList; - /** - * The response body as parsed JSON or XML - */ - parsedBody: Share; - }; -}; +/** Optional parameters. */ +export interface SharesGetOptionalParams extends coreClient.OperationOptions {} -/** - * Contains response data for the beginCreateOrUpdate operation. - */ -export type SharesBeginCreateOrUpdateResponse = Share & { - /** - * The underlying HTTP response. - */ - _response: msRest.HttpResponse & { - /** - * The response body as text (string format) - */ - bodyAsText: string; +/** Contains response data for the get operation. */ +export type SharesGetResponse = Share; - /** - * The response body as parsed JSON or XML - */ - parsedBody: Share; - }; -}; +/** Optional parameters. */ +export interface SharesCreateOrUpdateOptionalParams + extends coreClient.OperationOptions { + /** Delay to wait until next poll, in milliseconds. */ + updateIntervalInMs?: number; + /** A serialized poller which can be used to resume an existing paused Long-Running-Operation. */ + resumeFrom?: string; +} -/** - * Contains response data for the listByDataBoxEdgeDeviceNext operation. - */ -export type SharesListByDataBoxEdgeDeviceNextResponse = ShareList & { - /** - * The underlying HTTP response. - */ - _response: msRest.HttpResponse & { - /** - * The response body as text (string format) - */ - bodyAsText: string; +/** Contains response data for the createOrUpdate operation. */ +export type SharesCreateOrUpdateResponse = Share; - /** - * The response body as parsed JSON or XML - */ - parsedBody: ShareList; - }; -}; +/** Optional parameters. */ +export interface SharesDeleteOptionalParams + extends coreClient.OperationOptions { + /** Delay to wait until next poll, in milliseconds. */ + updateIntervalInMs?: number; + /** A serialized poller which can be used to resume an existing paused Long-Running-Operation. */ + resumeFrom?: string; +} -/** - * Contains response data for the listByDataBoxEdgeDevice operation. - */ -export type StorageAccountCredentialsListByDataBoxEdgeDeviceResponse = StorageAccountCredentialList & { - /** - * The underlying HTTP response. - */ - _response: msRest.HttpResponse & { - /** - * The response body as text (string format) - */ - bodyAsText: string; +/** Optional parameters. */ +export interface SharesRefreshOptionalParams + extends coreClient.OperationOptions { + /** Delay to wait until next poll, in milliseconds. */ + updateIntervalInMs?: number; + /** A serialized poller which can be used to resume an existing paused Long-Running-Operation. */ + resumeFrom?: string; +} - /** - * The response body as parsed JSON or XML - */ - parsedBody: StorageAccountCredentialList; - }; -}; +/** Optional parameters. */ +export interface SharesListByDataBoxEdgeDeviceNextOptionalParams + extends coreClient.OperationOptions {} -/** - * Contains response data for the get operation. - */ -export type StorageAccountCredentialsGetResponse = StorageAccountCredential & { - /** - * The underlying HTTP response. - */ - _response: msRest.HttpResponse & { - /** - * The response body as text (string format) - */ - bodyAsText: string; +/** Contains response data for the listByDataBoxEdgeDeviceNext operation. */ +export type SharesListByDataBoxEdgeDeviceNextResponse = ShareList; - /** - * The response body as parsed JSON or XML - */ - parsedBody: StorageAccountCredential; - }; -}; +/** Optional parameters. */ +export interface StorageAccountCredentialsListByDataBoxEdgeDeviceOptionalParams + extends coreClient.OperationOptions {} -/** - * Contains response data for the createOrUpdate operation. - */ -export type StorageAccountCredentialsCreateOrUpdateResponse = StorageAccountCredential & { - /** - * The underlying HTTP response. - */ - _response: msRest.HttpResponse & { - /** - * The response body as text (string format) - */ - bodyAsText: string; +/** Contains response data for the listByDataBoxEdgeDevice operation. */ +export type StorageAccountCredentialsListByDataBoxEdgeDeviceResponse = StorageAccountCredentialList; - /** - * The response body as parsed JSON or XML - */ - parsedBody: StorageAccountCredential; - }; -}; +/** Optional parameters. */ +export interface StorageAccountCredentialsGetOptionalParams + extends coreClient.OperationOptions {} -/** - * Contains response data for the beginCreateOrUpdate operation. - */ -export type StorageAccountCredentialsBeginCreateOrUpdateResponse = StorageAccountCredential & { - /** - * The underlying HTTP response. - */ - _response: msRest.HttpResponse & { - /** - * The response body as text (string format) - */ - bodyAsText: string; +/** Contains response data for the get operation. */ +export type StorageAccountCredentialsGetResponse = StorageAccountCredential; - /** - * The response body as parsed JSON or XML - */ - parsedBody: StorageAccountCredential; - }; -}; +/** Optional parameters. */ +export interface StorageAccountCredentialsCreateOrUpdateOptionalParams + extends coreClient.OperationOptions { + /** Delay to wait until next poll, in milliseconds. */ + updateIntervalInMs?: number; + /** A serialized poller which can be used to resume an existing paused Long-Running-Operation. */ + resumeFrom?: string; +} -/** - * Contains response data for the listByDataBoxEdgeDeviceNext operation. - */ -export type StorageAccountCredentialsListByDataBoxEdgeDeviceNextResponse = StorageAccountCredentialList & { - /** - * The underlying HTTP response. - */ - _response: msRest.HttpResponse & { - /** - * The response body as text (string format) - */ - bodyAsText: string; +/** Contains response data for the createOrUpdate operation. */ +export type StorageAccountCredentialsCreateOrUpdateResponse = StorageAccountCredential; - /** - * The response body as parsed JSON or XML - */ - parsedBody: StorageAccountCredentialList; - }; -}; +/** Optional parameters. */ +export interface StorageAccountCredentialsDeleteOptionalParams + extends coreClient.OperationOptions { + /** Delay to wait until next poll, in milliseconds. */ + updateIntervalInMs?: number; + /** A serialized poller which can be used to resume an existing paused Long-Running-Operation. */ + resumeFrom?: string; +} -/** - * Contains response data for the listByDataBoxEdgeDevice operation. - */ -export type StorageAccountsListByDataBoxEdgeDeviceResponse = StorageAccountList & { - /** - * The underlying HTTP response. - */ - _response: msRest.HttpResponse & { - /** - * The response body as text (string format) - */ - bodyAsText: string; +/** Optional parameters. */ +export interface StorageAccountCredentialsListByDataBoxEdgeDeviceNextOptionalParams + extends coreClient.OperationOptions {} - /** - * The response body as parsed JSON or XML - */ - parsedBody: StorageAccountList; - }; -}; +/** Contains response data for the listByDataBoxEdgeDeviceNext operation. */ +export type StorageAccountCredentialsListByDataBoxEdgeDeviceNextResponse = StorageAccountCredentialList; -/** - * Contains response data for the get operation. - */ -export type StorageAccountsGetResponse = StorageAccount & { - /** - * The underlying HTTP response. - */ - _response: msRest.HttpResponse & { - /** - * The response body as text (string format) - */ - bodyAsText: string; +/** Optional parameters. */ +export interface StorageAccountsListByDataBoxEdgeDeviceOptionalParams + extends coreClient.OperationOptions {} - /** - * The response body as parsed JSON or XML - */ - parsedBody: StorageAccount; - }; -}; +/** Contains response data for the listByDataBoxEdgeDevice operation. */ +export type StorageAccountsListByDataBoxEdgeDeviceResponse = StorageAccountList; -/** - * Contains response data for the createOrUpdate operation. - */ -export type StorageAccountsCreateOrUpdateResponse = StorageAccount & { - /** - * The underlying HTTP response. - */ - _response: msRest.HttpResponse & { - /** - * The response body as text (string format) - */ - bodyAsText: string; +/** Optional parameters. */ +export interface StorageAccountsGetOptionalParams + extends coreClient.OperationOptions {} - /** - * The response body as parsed JSON or XML - */ - parsedBody: StorageAccount; - }; -}; +/** Contains response data for the get operation. */ +export type StorageAccountsGetResponse = StorageAccount; -/** - * Contains response data for the beginCreateOrUpdate operation. - */ -export type StorageAccountsBeginCreateOrUpdateResponse = StorageAccount & { - /** - * The underlying HTTP response. - */ - _response: msRest.HttpResponse & { - /** - * The response body as text (string format) - */ - bodyAsText: string; +/** Optional parameters. */ +export interface StorageAccountsCreateOrUpdateOptionalParams + extends coreClient.OperationOptions { + /** Delay to wait until next poll, in milliseconds. */ + updateIntervalInMs?: number; + /** A serialized poller which can be used to resume an existing paused Long-Running-Operation. */ + resumeFrom?: string; +} - /** - * The response body as parsed JSON or XML - */ - parsedBody: StorageAccount; - }; -}; +/** Contains response data for the createOrUpdate operation. */ +export type StorageAccountsCreateOrUpdateResponse = StorageAccount; -/** - * Contains response data for the listByDataBoxEdgeDeviceNext operation. - */ -export type StorageAccountsListByDataBoxEdgeDeviceNextResponse = StorageAccountList & { - /** - * The underlying HTTP response. - */ - _response: msRest.HttpResponse & { - /** - * The response body as text (string format) - */ - bodyAsText: string; +/** Optional parameters. */ +export interface StorageAccountsDeleteOptionalParams + extends coreClient.OperationOptions { + /** Delay to wait until next poll, in milliseconds. */ + updateIntervalInMs?: number; + /** A serialized poller which can be used to resume an existing paused Long-Running-Operation. */ + resumeFrom?: string; +} - /** - * The response body as parsed JSON or XML - */ - parsedBody: StorageAccountList; - }; -}; +/** Optional parameters. */ +export interface StorageAccountsListByDataBoxEdgeDeviceNextOptionalParams + extends coreClient.OperationOptions {} -/** - * Contains response data for the listByStorageAccount operation. - */ -export type ContainersListByStorageAccountResponse = ContainerList & { - /** - * The underlying HTTP response. - */ - _response: msRest.HttpResponse & { - /** - * The response body as text (string format) - */ - bodyAsText: string; +/** Contains response data for the listByDataBoxEdgeDeviceNext operation. */ +export type StorageAccountsListByDataBoxEdgeDeviceNextResponse = StorageAccountList; - /** - * The response body as parsed JSON or XML - */ - parsedBody: ContainerList; - }; -}; +/** Optional parameters. */ +export interface ContainersListByStorageAccountOptionalParams + extends coreClient.OperationOptions {} -/** - * Contains response data for the get operation. - */ -export type ContainersGetResponse = Container & { - /** - * The underlying HTTP response. - */ - _response: msRest.HttpResponse & { - /** - * The response body as text (string format) - */ - bodyAsText: string; +/** Contains response data for the listByStorageAccount operation. */ +export type ContainersListByStorageAccountResponse = ContainerList; - /** - * The response body as parsed JSON or XML - */ - parsedBody: Container; - }; -}; +/** Optional parameters. */ +export interface ContainersGetOptionalParams + extends coreClient.OperationOptions {} -/** - * Contains response data for the createOrUpdate operation. - */ -export type ContainersCreateOrUpdateResponse = Container & { - /** - * The underlying HTTP response. - */ - _response: msRest.HttpResponse & { - /** - * The response body as text (string format) - */ - bodyAsText: string; +/** Contains response data for the get operation. */ +export type ContainersGetResponse = Container; - /** - * The response body as parsed JSON or XML - */ - parsedBody: Container; - }; -}; +/** Optional parameters. */ +export interface ContainersCreateOrUpdateOptionalParams + extends coreClient.OperationOptions { + /** Delay to wait until next poll, in milliseconds. */ + updateIntervalInMs?: number; + /** A serialized poller which can be used to resume an existing paused Long-Running-Operation. */ + resumeFrom?: string; +} -/** - * Contains response data for the beginCreateOrUpdate operation. - */ -export type ContainersBeginCreateOrUpdateResponse = Container & { - /** - * The underlying HTTP response. - */ - _response: msRest.HttpResponse & { - /** - * The response body as text (string format) - */ - bodyAsText: string; +/** Contains response data for the createOrUpdate operation. */ +export type ContainersCreateOrUpdateResponse = Container; - /** - * The response body as parsed JSON or XML - */ - parsedBody: Container; - }; -}; +/** Optional parameters. */ +export interface ContainersDeleteOptionalParams + extends coreClient.OperationOptions { + /** Delay to wait until next poll, in milliseconds. */ + updateIntervalInMs?: number; + /** A serialized poller which can be used to resume an existing paused Long-Running-Operation. */ + resumeFrom?: string; +} -/** - * Contains response data for the listByStorageAccountNext operation. - */ -export type ContainersListByStorageAccountNextResponse = ContainerList & { - /** - * The underlying HTTP response. - */ - _response: msRest.HttpResponse & { - /** - * The response body as text (string format) - */ - bodyAsText: string; +/** Optional parameters. */ +export interface ContainersRefreshOptionalParams + extends coreClient.OperationOptions { + /** Delay to wait until next poll, in milliseconds. */ + updateIntervalInMs?: number; + /** A serialized poller which can be used to resume an existing paused Long-Running-Operation. */ + resumeFrom?: string; +} - /** - * The response body as parsed JSON or XML - */ - parsedBody: ContainerList; - }; -}; +/** Optional parameters. */ +export interface ContainersListByStorageAccountNextOptionalParams + extends coreClient.OperationOptions {} -/** - * Contains response data for the listByDataBoxEdgeDevice operation. - */ -export type TriggersListByDataBoxEdgeDeviceResponse = TriggerList & { - /** - * The underlying HTTP response. - */ - _response: msRest.HttpResponse & { - /** - * The response body as text (string format) - */ - bodyAsText: string; +/** Contains response data for the listByStorageAccountNext operation. */ +export type ContainersListByStorageAccountNextResponse = ContainerList; - /** - * The response body as parsed JSON or XML - */ - parsedBody: TriggerList; - }; -}; +/** Optional parameters. */ +export interface TriggersListByDataBoxEdgeDeviceOptionalParams + extends coreClient.OperationOptions { + /** Specify $filter='CustomContextTag eq ' to filter on custom context tag property */ + filter?: string; +} -/** - * Contains response data for the get operation. - */ -export type TriggersGetResponse = TriggerUnion & { - /** - * The underlying HTTP response. - */ - _response: msRest.HttpResponse & { - /** - * The response body as text (string format) - */ - bodyAsText: string; +/** Contains response data for the listByDataBoxEdgeDevice operation. */ +export type TriggersListByDataBoxEdgeDeviceResponse = TriggerList; - /** - * The response body as parsed JSON or XML - */ - parsedBody: TriggerUnion; - }; -}; +/** Optional parameters. */ +export interface TriggersGetOptionalParams + extends coreClient.OperationOptions {} -/** - * Contains response data for the createOrUpdate operation. - */ -export type TriggersCreateOrUpdateResponse = TriggerUnion & { - /** - * The underlying HTTP response. - */ - _response: msRest.HttpResponse & { - /** - * The response body as text (string format) - */ - bodyAsText: string; +/** Contains response data for the get operation. */ +export type TriggersGetResponse = TriggerUnion; - /** - * The response body as parsed JSON or XML - */ - parsedBody: TriggerUnion; - }; -}; +/** Optional parameters. */ +export interface TriggersCreateOrUpdateOptionalParams + extends coreClient.OperationOptions { + /** Delay to wait until next poll, in milliseconds. */ + updateIntervalInMs?: number; + /** A serialized poller which can be used to resume an existing paused Long-Running-Operation. */ + resumeFrom?: string; +} -/** - * Contains response data for the beginCreateOrUpdate operation. - */ -export type TriggersBeginCreateOrUpdateResponse = TriggerUnion & { - /** - * The underlying HTTP response. - */ - _response: msRest.HttpResponse & { - /** - * The response body as text (string format) - */ - bodyAsText: string; +/** Contains response data for the createOrUpdate operation. */ +export type TriggersCreateOrUpdateResponse = TriggerUnion; - /** - * The response body as parsed JSON or XML - */ - parsedBody: TriggerUnion; - }; -}; +/** Optional parameters. */ +export interface TriggersDeleteOptionalParams + extends coreClient.OperationOptions { + /** Delay to wait until next poll, in milliseconds. */ + updateIntervalInMs?: number; + /** A serialized poller which can be used to resume an existing paused Long-Running-Operation. */ + resumeFrom?: string; +} -/** - * Contains response data for the listByDataBoxEdgeDeviceNext operation. - */ -export type TriggersListByDataBoxEdgeDeviceNextResponse = TriggerList & { - /** - * The underlying HTTP response. - */ - _response: msRest.HttpResponse & { - /** - * The response body as text (string format) - */ - bodyAsText: string; +/** Optional parameters. */ +export interface TriggersListByDataBoxEdgeDeviceNextOptionalParams + extends coreClient.OperationOptions { + /** Specify $filter='CustomContextTag eq ' to filter on custom context tag property */ + filter?: string; +} - /** - * The response body as parsed JSON or XML - */ - parsedBody: TriggerList; - }; -}; +/** Contains response data for the listByDataBoxEdgeDeviceNext operation. */ +export type TriggersListByDataBoxEdgeDeviceNextResponse = TriggerList; -/** - * Contains response data for the listByDataBoxEdgeDevice operation. - */ -export type UsersListByDataBoxEdgeDeviceResponse = UserList & { - /** - * The underlying HTTP response. - */ - _response: msRest.HttpResponse & { - /** - * The response body as text (string format) - */ - bodyAsText: string; +/** Optional parameters. */ +export interface UsersListByDataBoxEdgeDeviceOptionalParams + extends coreClient.OperationOptions { + /** Specify $filter='UserType eq ' to filter on user type property */ + filter?: string; +} - /** - * The response body as parsed JSON or XML - */ - parsedBody: UserList; - }; -}; +/** Contains response data for the listByDataBoxEdgeDevice operation. */ +export type UsersListByDataBoxEdgeDeviceResponse = UserList; -/** - * Contains response data for the get operation. - */ -export type UsersGetResponse = User & { - /** - * The underlying HTTP response. - */ - _response: msRest.HttpResponse & { - /** - * The response body as text (string format) - */ - bodyAsText: string; +/** Optional parameters. */ +export interface UsersGetOptionalParams extends coreClient.OperationOptions {} - /** - * The response body as parsed JSON or XML - */ - parsedBody: User; - }; -}; +/** Contains response data for the get operation. */ +export type UsersGetResponse = User; -/** - * Contains response data for the createOrUpdate operation. - */ -export type UsersCreateOrUpdateResponse = User & { - /** - * The underlying HTTP response. - */ - _response: msRest.HttpResponse & { - /** - * The response body as text (string format) - */ - bodyAsText: string; +/** Optional parameters. */ +export interface UsersCreateOrUpdateOptionalParams + extends coreClient.OperationOptions { + /** Delay to wait until next poll, in milliseconds. */ + updateIntervalInMs?: number; + /** A serialized poller which can be used to resume an existing paused Long-Running-Operation. */ + resumeFrom?: string; +} - /** - * The response body as parsed JSON or XML - */ - parsedBody: User; - }; -}; +/** Contains response data for the createOrUpdate operation. */ +export type UsersCreateOrUpdateResponse = User; -/** - * Contains response data for the beginCreateOrUpdate operation. - */ -export type UsersBeginCreateOrUpdateResponse = User & { - /** - * The underlying HTTP response. - */ - _response: msRest.HttpResponse & { - /** - * The response body as text (string format) - */ - bodyAsText: string; +/** Optional parameters. */ +export interface UsersDeleteOptionalParams extends coreClient.OperationOptions { + /** Delay to wait until next poll, in milliseconds. */ + updateIntervalInMs?: number; + /** A serialized poller which can be used to resume an existing paused Long-Running-Operation. */ + resumeFrom?: string; +} - /** - * The response body as parsed JSON or XML - */ - parsedBody: User; - }; -}; +/** Optional parameters. */ +export interface UsersListByDataBoxEdgeDeviceNextOptionalParams + extends coreClient.OperationOptions { + /** Specify $filter='UserType eq ' to filter on user type property */ + filter?: string; +} -/** - * Contains response data for the listByDataBoxEdgeDeviceNext operation. - */ -export type UsersListByDataBoxEdgeDeviceNextResponse = UserList & { - /** - * The underlying HTTP response. - */ - _response: msRest.HttpResponse & { - /** - * The response body as text (string format) - */ - bodyAsText: string; +/** Contains response data for the listByDataBoxEdgeDeviceNext operation. */ +export type UsersListByDataBoxEdgeDeviceNextResponse = UserList; - /** - * The response body as parsed JSON or XML - */ - parsedBody: UserList; - }; -}; +/** Optional parameters. */ +export interface SkusListOptionalParams extends coreClient.OperationOptions { + /** Specify $filter='location eq ' to filter on location. */ + filter?: string; +} -/** - * Contains response data for the list operation. - */ -export type SkusListResponse = SkuInformationList & { - /** - * The underlying HTTP response. - */ - _response: msRest.HttpResponse & { - /** - * The response body as text (string format) - */ - bodyAsText: string; +/** Contains response data for the list operation. */ +export type SkusListResponse = SkuInformationList; - /** - * The response body as parsed JSON or XML - */ - parsedBody: SkuInformationList; - }; -}; +/** Optional parameters. */ +export interface DataBoxEdgeManagementClientOptionalParams + extends coreClient.ServiceClientOptions { + /** server parameter */ + $host?: string; + /** Api Version */ + apiVersion?: string; + /** Overrides client endpoint. */ + endpoint?: string; +} diff --git a/sdk/databoxedge/arm-databoxedge-profile-2020-09-01-hybrid/src/models/jobsMappers.ts b/sdk/databoxedge/arm-databoxedge-profile-2020-09-01-hybrid/src/models/jobsMappers.ts deleted file mode 100644 index 0f195ce2be53..000000000000 --- a/sdk/databoxedge/arm-databoxedge-profile-2020-09-01-hybrid/src/models/jobsMappers.ts +++ /dev/null @@ -1,17 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for 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 { - discriminators, - CloudError, - Job, - JobErrorDetails, - JobErrorItem, - UpdateDownloadProgress, - UpdateInstallProgress -} from "../models/mappers"; diff --git a/sdk/databoxedge/arm-databoxedge-profile-2020-09-01-hybrid/src/models/mappers.ts b/sdk/databoxedge/arm-databoxedge-profile-2020-09-01-hybrid/src/models/mappers.ts index 3cfe52b682f2..ff7751695ddb 100644 --- a/sdk/databoxedge/arm-databoxedge-profile-2020-09-01-hybrid/src/models/mappers.ts +++ b/sdk/databoxedge/arm-databoxedge-profile-2020-09-01-hybrid/src/models/mappers.ts @@ -1,192 +1,211 @@ /* - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for license information. + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. * * 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"; +import * as coreClient from "@azure/core-client"; -export const CloudError = CloudErrorMapper; -export const BaseResource = BaseResourceMapper; - -export const Address: msRest.CompositeMapper = { - serializedName: "Address", +export const OperationsList: coreClient.CompositeMapper = { type: { name: "Composite", - className: "Address", + className: "OperationsList", modelProperties: { - addressLine1: { + value: { + serializedName: "value", required: true, - serializedName: "addressLine1", - type: { - name: "String" - } - }, - addressLine2: { - serializedName: "addressLine2", type: { - name: "String" + name: "Sequence", + element: { + type: { + name: "Composite", + className: "Operation" + } + } } }, - addressLine3: { - serializedName: "addressLine3", + nextLink: { + serializedName: "nextLink", type: { name: "String" } - }, - postalCode: { - required: true, - serializedName: "postalCode", + } + } + } +}; + +export const Operation: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "Operation", + modelProperties: { + name: { + serializedName: "name", type: { name: "String" } }, - city: { - required: true, - serializedName: "city", + display: { + serializedName: "display", type: { - name: "String" + name: "Composite", + className: "OperationDisplay" } }, - state: { - required: true, - serializedName: "state", + origin: { + serializedName: "origin", type: { name: "String" } }, - country: { - required: true, - serializedName: "country", + serviceSpecification: { + serializedName: "properties.serviceSpecification", type: { - name: "String" + name: "Composite", + className: "ServiceSpecification" } } } } }; -export const AlertErrorDetails: msRest.CompositeMapper = { - serializedName: "AlertErrorDetails", +export const OperationDisplay: coreClient.CompositeMapper = { type: { name: "Composite", - className: "AlertErrorDetails", + className: "OperationDisplay", modelProperties: { - errorCode: { - readOnly: true, - serializedName: "errorCode", + provider: { + serializedName: "provider", type: { name: "String" } }, - errorMessage: { - readOnly: true, - serializedName: "errorMessage", + resource: { + serializedName: "resource", type: { name: "String" } }, - occurrences: { - readOnly: true, - serializedName: "occurrences", + operation: { + serializedName: "operation", type: { - name: "Number" + name: "String" + } + }, + description: { + serializedName: "description", + type: { + name: "String" } } } } }; -export const ARMBaseModel: msRest.CompositeMapper = { - serializedName: "ARMBaseModel", +export const ServiceSpecification: coreClient.CompositeMapper = { type: { name: "Composite", - className: "ARMBaseModel", + className: "ServiceSpecification", modelProperties: { - id: { - readOnly: true, - serializedName: "id", + metricSpecifications: { + serializedName: "metricSpecifications", type: { - name: "String" + name: "Sequence", + element: { + type: { + name: "Composite", + className: "MetricSpecificationV1" + } + } } - }, + } + } + } +}; + +export const MetricSpecificationV1: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "MetricSpecificationV1", + modelProperties: { name: { - readOnly: true, serializedName: "name", type: { name: "String" } }, - type: { - readOnly: true, - serializedName: "type", + displayName: { + serializedName: "displayName", type: { name: "String" } - } - } - } -}; - -export const Alert: msRest.CompositeMapper = { - serializedName: "Alert", - type: { - name: "Composite", - className: "Alert", - modelProperties: { - ...ARMBaseModel.type.modelProperties, - title: { - readOnly: true, - serializedName: "properties.title", + }, + displayDescription: { + serializedName: "displayDescription", type: { name: "String" } }, - alertType: { - readOnly: true, - serializedName: "properties.alertType", + unit: { + serializedName: "unit", type: { name: "String" } }, - appearedAtDateTime: { - readOnly: true, - serializedName: "properties.appearedAtDateTime", + aggregationType: { + serializedName: "aggregationType", type: { - name: "DateTime" + name: "String" } }, - recommendation: { - readOnly: true, - serializedName: "properties.recommendation", + dimensions: { + serializedName: "dimensions", + type: { + name: "Sequence", + element: { + type: { + name: "Composite", + className: "MetricDimensionV1" + } + } + } + }, + fillGapWithZero: { + serializedName: "fillGapWithZero", + type: { + name: "Boolean" + } + }, + category: { + serializedName: "category", type: { name: "String" } }, - severity: { - readOnly: true, - serializedName: "properties.severity", + resourceIdDimensionNameOverride: { + serializedName: "resourceIdDimensionNameOverride", type: { name: "String" } }, - errorDetails: { - readOnly: true, - serializedName: "properties.errorDetails", + supportedTimeGrainTypes: { + serializedName: "supportedTimeGrainTypes", type: { - name: "Composite", - className: "AlertErrorDetails" + name: "Sequence", + element: { + type: { + name: "String" + } + } } }, - detailedInformation: { - readOnly: true, - serializedName: "properties.detailedInformation", + supportedAggregationTypes: { + serializedName: "supportedAggregationTypes", type: { - name: "Dictionary", - value: { + name: "Sequence", + element: { type: { name: "String" } @@ -197,161 +216,124 @@ export const Alert: msRest.CompositeMapper = { } }; -export const AsymmetricEncryptedSecret: msRest.CompositeMapper = { - serializedName: "AsymmetricEncryptedSecret", +export const MetricDimensionV1: coreClient.CompositeMapper = { type: { name: "Composite", - className: "AsymmetricEncryptedSecret", + className: "MetricDimensionV1", modelProperties: { - value: { - required: true, - serializedName: "value", + name: { + serializedName: "name", type: { name: "String" } }, - encryptionCertThumbprint: { - serializedName: "encryptionCertThumbprint", + displayName: { + serializedName: "displayName", type: { name: "String" } }, - encryptionAlgorithm: { - required: true, - serializedName: "encryptionAlgorithm", - type: { - name: "String" - } - } - } - } -}; - -export const SymmetricKey: msRest.CompositeMapper = { - serializedName: "SymmetricKey", - type: { - name: "Composite", - className: "SymmetricKey", - modelProperties: { - connectionString: { - serializedName: "connectionString", + toBeExportedForShoebox: { + serializedName: "toBeExportedForShoebox", type: { - name: "Composite", - className: "AsymmetricEncryptedSecret" + name: "Boolean" } } } } }; -export const Authentication: msRest.CompositeMapper = { - serializedName: "Authentication", +export const CloudError: coreClient.CompositeMapper = { type: { name: "Composite", - className: "Authentication", + className: "CloudError", modelProperties: { - symmetricKey: { - serializedName: "symmetricKey", + error: { + serializedName: "error", type: { name: "Composite", - className: "SymmetricKey" + className: "CloudErrorBody" } } } } }; -export const AzureContainerInfo: msRest.CompositeMapper = { - serializedName: "AzureContainerInfo", +export const CloudErrorBody: coreClient.CompositeMapper = { type: { name: "Composite", - className: "AzureContainerInfo", + className: "CloudErrorBody", modelProperties: { - storageAccountCredentialId: { - required: true, - serializedName: "storageAccountCredentialId", + code: { + serializedName: "code", type: { name: "String" } }, - containerName: { - required: true, - serializedName: "containerName", + message: { + serializedName: "message", type: { name: "String" } }, - dataFormat: { - required: true, - serializedName: "dataFormat", + details: { + serializedName: "details", type: { - name: "String" + name: "Sequence", + element: { + type: { + name: "Composite", + className: "CloudErrorBody" + } + } } } } } }; -export const BandwidthSchedule: msRest.CompositeMapper = { - serializedName: "BandwidthSchedule", +export const DataBoxEdgeDeviceList: coreClient.CompositeMapper = { type: { name: "Composite", - className: "BandwidthSchedule", + className: "DataBoxEdgeDeviceList", modelProperties: { - ...ARMBaseModel.type.modelProperties, - start: { - required: true, - serializedName: "properties.start", - type: { - name: "String" - } - }, - stop: { - required: true, - serializedName: "properties.stop", - type: { - name: "String" - } - }, - rateInMbps: { - required: true, - serializedName: "properties.rateInMbps", - type: { - name: "Number" - } - }, - days: { - required: true, - serializedName: "properties.days", + value: { + serializedName: "value", + readOnly: true, type: { name: "Sequence", element: { type: { - name: "String" + name: "Composite", + className: "DataBoxEdgeDevice" } } } + }, + nextLink: { + serializedName: "nextLink", + readOnly: true, + type: { + name: "String" + } } } } }; -export const ClientAccessRight: msRest.CompositeMapper = { - serializedName: "ClientAccessRight", +export const Sku: coreClient.CompositeMapper = { type: { name: "Composite", - className: "ClientAccessRight", + className: "Sku", modelProperties: { - client: { - required: true, - serializedName: "client", + name: { + serializedName: "name", type: { name: "String" } }, - accessPermission: { - required: true, - serializedName: "accessPermission", + tier: { + serializedName: "tier", type: { name: "String" } @@ -360,75 +342,73 @@ export const ClientAccessRight: msRest.CompositeMapper = { } }; -export const ContactDetails: msRest.CompositeMapper = { - serializedName: "ContactDetails", +export const ARMBaseModel: coreClient.CompositeMapper = { type: { name: "Composite", - className: "ContactDetails", + className: "ARMBaseModel", modelProperties: { - contactPerson: { - required: true, - serializedName: "contactPerson", + id: { + serializedName: "id", + readOnly: true, type: { name: "String" } }, - companyName: { - required: true, - serializedName: "companyName", + name: { + serializedName: "name", + readOnly: true, type: { name: "String" } }, - phone: { - required: true, - serializedName: "phone", + type: { + serializedName: "type", + readOnly: true, type: { name: "String" } - }, - emailList: { - required: true, - serializedName: "emailList", - type: { - name: "Sequence", - element: { - type: { - name: "String" - } - } - } } } } }; -export const RefreshDetails: msRest.CompositeMapper = { - serializedName: "RefreshDetails", +export const DataBoxEdgeDevicePatch: coreClient.CompositeMapper = { type: { name: "Composite", - className: "RefreshDetails", + className: "DataBoxEdgeDevicePatch", modelProperties: { - inProgressRefreshJobId: { - serializedName: "inProgressRefreshJobId", - type: { - name: "String" - } - }, - lastCompletedRefreshJobTimeInUTC: { - serializedName: "lastCompletedRefreshJobTimeInUTC", + tags: { + serializedName: "tags", type: { - name: "DateTime" + name: "Dictionary", + value: { type: { name: "String" } } } - }, - errorManifestFile: { - serializedName: "errorManifestFile", + } + } + } +}; + +export const AlertList: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "AlertList", + modelProperties: { + value: { + serializedName: "value", + readOnly: true, type: { - name: "String" + name: "Sequence", + element: { + type: { + name: "Composite", + className: "Alert" + } + } } }, - lastJob: { - serializedName: "lastJob", + nextLink: { + serializedName: "nextLink", + readOnly: true, type: { name: "String" } @@ -437,60 +417,57 @@ export const RefreshDetails: msRest.CompositeMapper = { } }; -export const Container: msRest.CompositeMapper = { - serializedName: "Container", +export const AlertErrorDetails: coreClient.CompositeMapper = { type: { name: "Composite", - className: "Container", + className: "AlertErrorDetails", modelProperties: { - ...ARMBaseModel.type.modelProperties, - containerStatus: { + errorCode: { + serializedName: "errorCode", readOnly: true, - serializedName: "properties.containerStatus", - type: { - name: "String" - } - }, - dataFormat: { - required: true, - serializedName: "properties.dataFormat", type: { name: "String" } }, - refreshDetails: { + errorMessage: { + serializedName: "errorMessage", readOnly: true, - serializedName: "properties.refreshDetails", type: { - name: "Composite", - className: "RefreshDetails" + name: "String" } }, - createdDateTime: { + occurrences: { + serializedName: "occurrences", readOnly: true, - serializedName: "properties.createdDateTime", type: { - name: "DateTime" + name: "Number" } } } } }; -export const Sku: msRest.CompositeMapper = { - serializedName: "Sku", +export const BandwidthSchedulesList: coreClient.CompositeMapper = { type: { name: "Composite", - className: "Sku", + className: "BandwidthSchedulesList", modelProperties: { - name: { - serializedName: "name", + value: { + serializedName: "value", + readOnly: true, type: { - name: "String" + name: "Sequence", + element: { + type: { + name: "Composite", + className: "BandwidthSchedule" + } + } } }, - tier: { - serializedName: "tier", + nextLink: { + serializedName: "nextLink", + readOnly: true, type: { name: "String" } @@ -499,169 +476,154 @@ export const Sku: msRest.CompositeMapper = { } }; -export const DataBoxEdgeDevice: msRest.CompositeMapper = { - serializedName: "DataBoxEdgeDevice", +export const Job: coreClient.CompositeMapper = { type: { name: "Composite", - className: "DataBoxEdgeDevice", + className: "Job", modelProperties: { - ...ARMBaseModel.type.modelProperties, - location: { - required: true, - serializedName: "location", + id: { + serializedName: "id", + readOnly: true, type: { name: "String" } }, - tags: { - serializedName: "tags", - type: { - name: "Dictionary", - value: { - type: { - name: "String" - } - } - } - }, - sku: { - serializedName: "sku", - type: { - name: "Composite", - className: "Sku" - } - }, - etag: { - serializedName: "etag", + name: { + serializedName: "name", + readOnly: true, type: { name: "String" } }, - dataBoxEdgeDeviceStatus: { - serializedName: "properties.dataBoxEdgeDeviceStatus", + type: { + serializedName: "type", + readOnly: true, type: { name: "String" } }, - serialNumber: { + status: { + serializedName: "status", readOnly: true, - serializedName: "properties.serialNumber", type: { name: "String" } }, - description: { - serializedName: "properties.description", + startTime: { + serializedName: "startTime", + readOnly: true, type: { - name: "String" + name: "DateTime" } }, - modelDescription: { - serializedName: "properties.modelDescription", + endTime: { + serializedName: "endTime", + readOnly: true, type: { - name: "String" + name: "DateTime" } }, - deviceType: { + percentComplete: { + serializedName: "percentComplete", readOnly: true, - serializedName: "properties.deviceType", type: { - name: "String" + name: "Number" } }, - friendlyName: { - serializedName: "properties.friendlyName", + error: { + serializedName: "error", type: { - name: "String" + name: "Composite", + className: "JobErrorDetails" } }, - culture: { + jobType: { + serializedName: "properties.jobType", readOnly: true, - serializedName: "properties.culture", type: { name: "String" } }, - deviceModel: { + currentStage: { + serializedName: "properties.currentStage", readOnly: true, - serializedName: "properties.deviceModel", type: { name: "String" } }, - deviceSoftwareVersion: { - readOnly: true, - serializedName: "properties.deviceSoftwareVersion", + downloadProgress: { + serializedName: "properties.downloadProgress", type: { - name: "String" + name: "Composite", + className: "UpdateDownloadProgress" } }, - deviceLocalCapacity: { - readOnly: true, - serializedName: "properties.deviceLocalCapacity", + installProgress: { + serializedName: "properties.installProgress", type: { - name: "Number" + name: "Composite", + className: "UpdateInstallProgress" } }, - timeZone: { + totalRefreshErrors: { + serializedName: "properties.totalRefreshErrors", readOnly: true, - serializedName: "properties.timeZone", type: { - name: "String" + name: "Number" } }, - deviceHcsVersion: { + errorManifestFile: { + serializedName: "properties.errorManifestFile", readOnly: true, - serializedName: "properties.deviceHcsVersion", type: { name: "String" } }, - configuredRoleTypes: { + refreshedEntityId: { + serializedName: "properties.refreshedEntityId", readOnly: true, - serializedName: "properties.configuredRoleTypes", type: { - name: "Sequence", - element: { - type: { - name: "String" - } - } + name: "String" } }, - nodeCount: { - readOnly: true, - serializedName: "properties.nodeCount", + folder: { + serializedName: "properties.folder", type: { - name: "Number" + name: "String" } } } } }; -export const DataBoxEdgeDeviceExtendedInfo: msRest.CompositeMapper = { - serializedName: "DataBoxEdgeDeviceExtendedInfo", +export const JobErrorDetails: coreClient.CompositeMapper = { type: { name: "Composite", - className: "DataBoxEdgeDeviceExtendedInfo", + className: "JobErrorDetails", modelProperties: { - ...ARMBaseModel.type.modelProperties, - encryptionKeyThumbprint: { - serializedName: "properties.encryptionKeyThumbprint", + errorDetails: { + serializedName: "errorDetails", + readOnly: true, type: { - name: "String" + name: "Sequence", + element: { + type: { + name: "Composite", + className: "JobErrorItem" + } + } } }, - encryptionKey: { - serializedName: "properties.encryptionKey", + code: { + serializedName: "code", + readOnly: true, type: { name: "String" } }, - resourceKey: { + message: { + serializedName: "message", readOnly: true, - serializedName: "properties.resourceKey", type: { name: "String" } @@ -670,53 +632,33 @@ export const DataBoxEdgeDeviceExtendedInfo: msRest.CompositeMapper = { } }; -export const DataBoxEdgeDevicePatch: msRest.CompositeMapper = { - serializedName: "DataBoxEdgeDevicePatch", +export const JobErrorItem: coreClient.CompositeMapper = { type: { name: "Composite", - className: "DataBoxEdgeDevicePatch", + className: "JobErrorItem", modelProperties: { - tags: { - serializedName: "tags", + recommendations: { + serializedName: "recommendations", + readOnly: true, type: { - name: "Dictionary", - value: { + name: "Sequence", + element: { type: { name: "String" } } } - } - } - } -}; - -export const FileSourceInfo: msRest.CompositeMapper = { - serializedName: "FileSourceInfo", - type: { - name: "Composite", - className: "FileSourceInfo", - modelProperties: { - shareId: { - required: true, - serializedName: "shareId", + }, + code: { + serializedName: "code", + readOnly: true, type: { name: "String" } - } - } - } -}; - -export const RoleSinkInfo: msRest.CompositeMapper = { - serializedName: "RoleSinkInfo", - type: { - name: "Composite", - className: "RoleSinkInfo", - modelProperties: { - roleId: { - required: true, - serializedName: "roleId", + }, + message: { + serializedName: "message", + readOnly: true, type: { name: "String" } @@ -725,240 +667,249 @@ export const RoleSinkInfo: msRest.CompositeMapper = { } }; -export const Trigger: msRest.CompositeMapper = { - serializedName: "Trigger", +export const UpdateDownloadProgress: coreClient.CompositeMapper = { type: { name: "Composite", - polymorphicDiscriminator: { - serializedName: "kind", - clientName: "kind" - }, - uberParent: "Trigger", - className: "Trigger", + className: "UpdateDownloadProgress", modelProperties: { - ...ARMBaseModel.type.modelProperties, - kind: { - required: true, - serializedName: "kind", + downloadPhase: { + serializedName: "downloadPhase", + readOnly: true, type: { name: "String" } + }, + percentComplete: { + serializedName: "percentComplete", + readOnly: true, + type: { + name: "Number" + } + }, + totalBytesToDownload: { + serializedName: "totalBytesToDownload", + readOnly: true, + type: { + name: "Number" + } + }, + totalBytesDownloaded: { + serializedName: "totalBytesDownloaded", + readOnly: true, + type: { + name: "Number" + } + }, + numberOfUpdatesToDownload: { + serializedName: "numberOfUpdatesToDownload", + readOnly: true, + type: { + name: "Number" + } + }, + numberOfUpdatesDownloaded: { + serializedName: "numberOfUpdatesDownloaded", + readOnly: true, + type: { + name: "Number" + } } } } }; -export const FileEventTrigger: msRest.CompositeMapper = { - serializedName: "FileEvent", +export const UpdateInstallProgress: coreClient.CompositeMapper = { type: { name: "Composite", - polymorphicDiscriminator: Trigger.type.polymorphicDiscriminator, - uberParent: "Trigger", - className: "FileEventTrigger", + className: "UpdateInstallProgress", modelProperties: { - ...Trigger.type.modelProperties, - sourceInfo: { - required: true, - serializedName: "properties.sourceInfo", + percentComplete: { + serializedName: "percentComplete", + readOnly: true, type: { - name: "Composite", - className: "FileSourceInfo" + name: "Number" } }, - sinkInfo: { - required: true, - serializedName: "properties.sinkInfo", + numberOfUpdatesToInstall: { + serializedName: "numberOfUpdatesToInstall", + readOnly: true, type: { - name: "Composite", - className: "RoleSinkInfo" + name: "Number" } }, - customContextTag: { - serializedName: "properties.customContextTag", + numberOfUpdatesInstalled: { + serializedName: "numberOfUpdatesInstalled", + readOnly: true, type: { - name: "String" + name: "Number" } } } } }; -export const IoTDeviceInfo: msRest.CompositeMapper = { - serializedName: "IoTDeviceInfo", +export const NetworkAdapter: coreClient.CompositeMapper = { type: { name: "Composite", - className: "IoTDeviceInfo", + className: "NetworkAdapter", modelProperties: { - deviceId: { - required: true, - serializedName: "deviceId", + adapterId: { + serializedName: "adapterId", + readOnly: true, type: { name: "String" } }, - ioTHostHub: { - required: true, - serializedName: "ioTHostHub", + adapterPosition: { + serializedName: "adapterPosition", type: { - name: "String" + name: "Composite", + className: "NetworkAdapterPosition" } }, - ioTHostHubId: { - serializedName: "ioTHostHubId", + index: { + serializedName: "index", + readOnly: true, type: { - name: "String" + name: "Number" } }, - authentication: { - serializedName: "authentication", + nodeId: { + serializedName: "nodeId", + readOnly: true, type: { - name: "Composite", - className: "Authentication" + name: "String" } - } - } - } -}; - -export const MountPointMap: msRest.CompositeMapper = { - serializedName: "MountPointMap", - type: { - name: "Composite", - className: "MountPointMap", - modelProperties: { - shareId: { - required: true, - serializedName: "shareId", + }, + networkAdapterName: { + serializedName: "networkAdapterName", + readOnly: true, type: { name: "String" } }, - roleId: { + label: { + serializedName: "label", readOnly: true, - serializedName: "roleId", type: { name: "String" } }, - mountPoint: { + macAddress: { + serializedName: "macAddress", readOnly: true, - serializedName: "mountPoint", type: { name: "String" } }, - roleType: { + linkSpeed: { + serializedName: "linkSpeed", + readOnly: true, + type: { + name: "Number" + } + }, + status: { + serializedName: "status", readOnly: true, - serializedName: "roleType", type: { name: "String" } - } - } - } -}; - -export const Role: msRest.CompositeMapper = { - serializedName: "Role", - type: { - name: "Composite", - polymorphicDiscriminator: { - serializedName: "kind", - clientName: "kind" - }, - uberParent: "Role", - className: "Role", - modelProperties: { - ...ARMBaseModel.type.modelProperties, - kind: { - required: true, - serializedName: "kind", + }, + rdmaStatus: { + serializedName: "rdmaStatus", type: { name: "String" } - } - } - } -}; - -export const IoTRole: msRest.CompositeMapper = { - serializedName: "IOT", - type: { - name: "Composite", - polymorphicDiscriminator: Role.type.polymorphicDiscriminator, - uberParent: "Role", - className: "IoTRole", - modelProperties: { - ...Role.type.modelProperties, - hostPlatform: { - required: true, - serializedName: "properties.hostPlatform", + }, + dhcpStatus: { + serializedName: "dhcpStatus", type: { name: "String" } }, - ioTDeviceDetails: { - required: true, - serializedName: "properties.ioTDeviceDetails", + ipv4Configuration: { + serializedName: "ipv4Configuration", type: { name: "Composite", - className: "IoTDeviceInfo" + className: "Ipv4Config" } }, - ioTEdgeDeviceDetails: { - required: true, - serializedName: "properties.ioTEdgeDeviceDetails", + ipv6Configuration: { + serializedName: "ipv6Configuration", type: { name: "Composite", - className: "IoTDeviceInfo" + className: "Ipv6Config" } }, - shareMappings: { - serializedName: "properties.shareMappings", + ipv6LinkLocalAddress: { + serializedName: "ipv6LinkLocalAddress", + readOnly: true, + type: { + name: "String" + } + }, + dnsServers: { + serializedName: "dnsServers", + readOnly: true, type: { name: "Sequence", element: { type: { - name: "Composite", - className: "MountPointMap" + name: "String" } } } - }, - roleStatus: { - required: true, - serializedName: "properties.roleStatus", + } + } + } +}; + +export const NetworkAdapterPosition: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "NetworkAdapterPosition", + modelProperties: { + networkGroup: { + serializedName: "networkGroup", + readOnly: true, type: { name: "String" } + }, + port: { + serializedName: "port", + readOnly: true, + type: { + name: "Number" + } } } } }; -export const Ipv4Config: msRest.CompositeMapper = { - serializedName: "Ipv4Config", +export const Ipv4Config: coreClient.CompositeMapper = { type: { name: "Composite", className: "Ipv4Config", modelProperties: { ipAddress: { - readOnly: true, serializedName: "ipAddress", + readOnly: true, type: { name: "String" } }, subnet: { - readOnly: true, serializedName: "subnet", + readOnly: true, type: { name: "String" } }, gateway: { - readOnly: true, serializedName: "gateway", + readOnly: true, type: { name: "String" } @@ -967,29 +918,28 @@ export const Ipv4Config: msRest.CompositeMapper = { } }; -export const Ipv6Config: msRest.CompositeMapper = { - serializedName: "Ipv6Config", +export const Ipv6Config: coreClient.CompositeMapper = { type: { name: "Composite", className: "Ipv6Config", modelProperties: { ipAddress: { - readOnly: true, serializedName: "ipAddress", + readOnly: true, type: { name: "String" } }, prefixLength: { - readOnly: true, serializedName: "prefixLength", + readOnly: true, type: { name: "Number" } }, gateway: { - readOnly: true, serializedName: "gateway", + readOnly: true, type: { name: "String" } @@ -998,278 +948,357 @@ export const Ipv6Config: msRest.CompositeMapper = { } }; -export const JobErrorItem: msRest.CompositeMapper = { - serializedName: "JobErrorItem", +export const NodeList: coreClient.CompositeMapper = { type: { name: "Composite", - className: "JobErrorItem", + className: "NodeList", modelProperties: { - recommendations: { + value: { + serializedName: "value", readOnly: true, - serializedName: "recommendations", type: { name: "Sequence", element: { type: { - name: "String" + name: "Composite", + className: "Node" } } } - }, - code: { - readOnly: true, - serializedName: "code", - type: { - name: "String" - } - }, - message: { - readOnly: true, - serializedName: "message", - type: { - name: "String" - } } } } }; -export const JobErrorDetails: msRest.CompositeMapper = { - serializedName: "JobErrorDetails", +export const OrderList: coreClient.CompositeMapper = { type: { name: "Composite", - className: "JobErrorDetails", + className: "OrderList", modelProperties: { - errorDetails: { + value: { + serializedName: "value", readOnly: true, - serializedName: "errorDetails", type: { name: "Sequence", element: { type: { name: "Composite", - className: "JobErrorItem" + className: "Order" } } } }, - code: { + nextLink: { + serializedName: "nextLink", readOnly: true, - serializedName: "code", + type: { + name: "String" + } + } + } + } +}; + +export const ContactDetails: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "ContactDetails", + modelProperties: { + contactPerson: { + serializedName: "contactPerson", + required: true, type: { name: "String" } }, - message: { - readOnly: true, - serializedName: "message", + companyName: { + serializedName: "companyName", + required: true, + type: { + name: "String" + } + }, + phone: { + serializedName: "phone", + required: true, type: { name: "String" } + }, + emailList: { + serializedName: "emailList", + required: true, + type: { + name: "Sequence", + element: { + type: { + name: "String" + } + } + } } } } }; -export const UpdateDownloadProgress: msRest.CompositeMapper = { - serializedName: "UpdateDownloadProgress", +export const Address: coreClient.CompositeMapper = { type: { name: "Composite", - className: "UpdateDownloadProgress", + className: "Address", modelProperties: { - downloadPhase: { - readOnly: true, - serializedName: "downloadPhase", + addressLine1: { + serializedName: "addressLine1", + required: true, type: { name: "String" } }, - percentComplete: { - readOnly: true, - serializedName: "percentComplete", + addressLine2: { + serializedName: "addressLine2", type: { - name: "Number" + name: "String" } }, - totalBytesToDownload: { - readOnly: true, - serializedName: "totalBytesToDownload", + addressLine3: { + serializedName: "addressLine3", type: { - name: "Number" + name: "String" } }, - totalBytesDownloaded: { - readOnly: true, - serializedName: "totalBytesDownloaded", + postalCode: { + serializedName: "postalCode", + required: true, type: { - name: "Number" + name: "String" } }, - numberOfUpdatesToDownload: { - readOnly: true, - serializedName: "numberOfUpdatesToDownload", + city: { + serializedName: "city", + required: true, type: { - name: "Number" + name: "String" } }, - numberOfUpdatesDownloaded: { - readOnly: true, - serializedName: "numberOfUpdatesDownloaded", + state: { + serializedName: "state", + required: true, type: { - name: "Number" + name: "String" + } + }, + country: { + serializedName: "country", + required: true, + type: { + name: "String" } } } } }; -export const UpdateInstallProgress: msRest.CompositeMapper = { - serializedName: "UpdateInstallProgress", +export const OrderStatus: coreClient.CompositeMapper = { type: { name: "Composite", - className: "UpdateInstallProgress", + className: "OrderStatus", modelProperties: { - percentComplete: { - readOnly: true, - serializedName: "percentComplete", + status: { + serializedName: "status", + required: true, type: { - name: "Number" + name: "String" } }, - numberOfUpdatesToInstall: { + updateDateTime: { + serializedName: "updateDateTime", readOnly: true, - serializedName: "numberOfUpdatesToInstall", type: { - name: "Number" + name: "DateTime" } }, - numberOfUpdatesInstalled: { + comments: { + serializedName: "comments", + type: { + name: "String" + } + }, + additionalOrderDetails: { + serializedName: "additionalOrderDetails", readOnly: true, - serializedName: "numberOfUpdatesInstalled", type: { - name: "Number" + name: "Dictionary", + value: { type: { name: "String" } } } } } } }; -export const Job: msRest.CompositeMapper = { - serializedName: "Job", +export const TrackingInfo: coreClient.CompositeMapper = { type: { name: "Composite", - className: "Job", + className: "TrackingInfo", modelProperties: { - id: { - readOnly: true, - serializedName: "id", + serialNumber: { + serializedName: "serialNumber", type: { name: "String" } }, - name: { - readOnly: true, - serializedName: "name", + carrierName: { + serializedName: "carrierName", type: { name: "String" } }, - type: { - readOnly: true, - serializedName: "type", + trackingId: { + serializedName: "trackingId", type: { name: "String" } }, - status: { - readOnly: true, - serializedName: "status", + trackingUrl: { + serializedName: "trackingUrl", type: { name: "String" } - }, - startTime: { + } + } + } +}; + +export const RoleList: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "RoleList", + modelProperties: { + value: { + serializedName: "value", readOnly: true, - serializedName: "startTime", type: { - name: "DateTime" + name: "Sequence", + element: { + type: { + name: "Composite", + className: "Role" + } + } } }, - endTime: { + nextLink: { + serializedName: "nextLink", readOnly: true, - serializedName: "endTime", type: { - name: "DateTime" + name: "String" } - }, - percentComplete: { - readOnly: true, - serializedName: "percentComplete", + } + } + } +}; + +export const AsymmetricEncryptedSecret: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "AsymmetricEncryptedSecret", + modelProperties: { + value: { + serializedName: "value", + required: true, type: { - name: "Number" + name: "String" } }, - error: { - readOnly: true, - serializedName: "error", + encryptionCertThumbprint: { + serializedName: "encryptionCertThumbprint", type: { - name: "Composite", - className: "JobErrorDetails" + name: "String" } }, - jobType: { - readOnly: true, - serializedName: "properties.jobType", + encryptionAlgorithm: { + serializedName: "encryptionAlgorithm", + required: true, type: { name: "String" } - }, - currentStage: { + } + } + } +}; + +export const ShareList: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "ShareList", + modelProperties: { + value: { + serializedName: "value", readOnly: true, - serializedName: "properties.currentStage", type: { - name: "String" + name: "Sequence", + element: { + type: { + name: "Composite", + className: "Share" + } + } } }, - downloadProgress: { + nextLink: { + serializedName: "nextLink", readOnly: true, - serializedName: "properties.downloadProgress", type: { - name: "Composite", - className: "UpdateDownloadProgress" + name: "String" } - }, - installProgress: { - readOnly: true, - serializedName: "properties.installProgress", + } + } + } +}; + +export const AzureContainerInfo: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "AzureContainerInfo", + modelProperties: { + storageAccountCredentialId: { + serializedName: "storageAccountCredentialId", + required: true, type: { - name: "Composite", - className: "UpdateInstallProgress" + name: "String" } }, - totalRefreshErrors: { - readOnly: true, - serializedName: "properties.totalRefreshErrors", + containerName: { + serializedName: "containerName", + required: true, type: { - name: "Number" + name: "String" } }, - errorManifestFile: { - readOnly: true, - serializedName: "properties.errorManifestFile", + dataFormat: { + serializedName: "dataFormat", + required: true, type: { name: "String" } - }, - refreshedEntityId: { - readOnly: true, - serializedName: "properties.refreshedEntityId", + } + } + } +}; + +export const UserAccessRight: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "UserAccessRight", + modelProperties: { + userId: { + serializedName: "userId", + required: true, type: { name: "String" } }, - folder: { - serializedName: "properties.folder", + accessType: { + serializedName: "accessType", + required: true, type: { name: "String" } @@ -1278,479 +1307,519 @@ export const Job: msRest.CompositeMapper = { } }; -export const MetricDimensionV1: msRest.CompositeMapper = { - serializedName: "MetricDimension_V1", +export const ClientAccessRight: coreClient.CompositeMapper = { type: { name: "Composite", - className: "MetricDimensionV1", + className: "ClientAccessRight", modelProperties: { - name: { - serializedName: "name", + client: { + serializedName: "client", + required: true, type: { name: "String" } }, - displayName: { - serializedName: "displayName", + accessPermission: { + serializedName: "accessPermission", + required: true, type: { name: "String" } - }, - toBeExportedForShoebox: { - serializedName: "toBeExportedForShoebox", - type: { - name: "Boolean" - } } } } }; -export const MetricSpecificationV1: msRest.CompositeMapper = { - serializedName: "MetricSpecification_V1", +export const RefreshDetails: coreClient.CompositeMapper = { type: { name: "Composite", - className: "MetricSpecificationV1", + className: "RefreshDetails", modelProperties: { - name: { - serializedName: "name", + inProgressRefreshJobId: { + serializedName: "inProgressRefreshJobId", type: { name: "String" } }, - displayName: { - serializedName: "displayName", + lastCompletedRefreshJobTimeInUTC: { + serializedName: "lastCompletedRefreshJobTimeInUTC", type: { - name: "String" + name: "DateTime" } }, - displayDescription: { - serializedName: "displayDescription", + errorManifestFile: { + serializedName: "errorManifestFile", type: { name: "String" } }, - unit: { - serializedName: "unit", + lastJob: { + serializedName: "lastJob", type: { name: "String" } - }, - aggregationType: { - serializedName: "aggregationType", + } + } + } +}; + +export const MountPointMap: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "MountPointMap", + modelProperties: { + shareId: { + serializedName: "shareId", + required: true, type: { name: "String" } }, - dimensions: { - serializedName: "dimensions", - type: { - name: "Sequence", - element: { - type: { - name: "Composite", - className: "MetricDimensionV1" - } - } - } - }, - fillGapWithZero: { - serializedName: "fillGapWithZero", + roleId: { + serializedName: "roleId", + readOnly: true, type: { - name: "Boolean" + name: "String" } }, - category: { - serializedName: "category", + mountPoint: { + serializedName: "mountPoint", + readOnly: true, type: { name: "String" } }, - resourceIdDimensionNameOverride: { - serializedName: "resourceIdDimensionNameOverride", + roleType: { + serializedName: "roleType", + readOnly: true, type: { name: "String" } - }, - supportedTimeGrainTypes: { - serializedName: "supportedTimeGrainTypes", + } + } + } +}; + +export const StorageAccountCredentialList: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "StorageAccountCredentialList", + modelProperties: { + value: { + serializedName: "value", + readOnly: true, type: { name: "Sequence", element: { type: { - name: "String" + name: "Composite", + className: "StorageAccountCredential" } } } }, - supportedAggregationTypes: { - serializedName: "supportedAggregationTypes", + nextLink: { + serializedName: "nextLink", + readOnly: true, type: { - name: "Sequence", - element: { - type: { - name: "String" - } - } + name: "String" } } } } }; -export const NetworkAdapterPosition: msRest.CompositeMapper = { - serializedName: "NetworkAdapterPosition", +export const StorageAccountList: coreClient.CompositeMapper = { type: { name: "Composite", - className: "NetworkAdapterPosition", + className: "StorageAccountList", modelProperties: { - networkGroup: { + value: { + serializedName: "value", readOnly: true, - serializedName: "networkGroup", type: { - name: "String" + name: "Sequence", + element: { + type: { + name: "Composite", + className: "StorageAccount" + } + } } }, - port: { + nextLink: { + serializedName: "nextLink", readOnly: true, - serializedName: "port", type: { - name: "Number" + name: "String" } } } } }; -export const NetworkAdapter: msRest.CompositeMapper = { - serializedName: "NetworkAdapter", +export const ContainerList: coreClient.CompositeMapper = { type: { name: "Composite", - className: "NetworkAdapter", + className: "ContainerList", modelProperties: { - adapterId: { + value: { + serializedName: "value", readOnly: true, - serializedName: "adapterId", type: { - name: "String" + name: "Sequence", + element: { + type: { + name: "Composite", + className: "Container" + } + } } }, - adapterPosition: { + nextLink: { + serializedName: "nextLink", readOnly: true, - serializedName: "adapterPosition", type: { - name: "Composite", - className: "NetworkAdapterPosition" + name: "String" } - }, - index: { + } + } + } +}; + +export const TriggerList: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "TriggerList", + modelProperties: { + value: { + serializedName: "value", readOnly: true, - serializedName: "index", type: { - name: "Number" + name: "Sequence", + element: { + type: { + name: "Composite", + className: "Trigger" + } + } } }, - nodeId: { + nextLink: { + serializedName: "nextLink", readOnly: true, - serializedName: "nodeId", type: { name: "String" } - }, - networkAdapterName: { - readOnly: true, - serializedName: "networkAdapterName", + } + } + } +}; + +export const UploadCertificateRequest: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "UploadCertificateRequest", + modelProperties: { + authenticationType: { + serializedName: "properties.authenticationType", type: { name: "String" } }, - label: { - readOnly: true, - serializedName: "label", + certificate: { + serializedName: "properties.certificate", + required: true, type: { name: "String" } - }, - macAddress: { - readOnly: true, - serializedName: "macAddress", + } + } + } +}; + +export const UploadCertificateResponse: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "UploadCertificateResponse", + modelProperties: { + authType: { + serializedName: "authType", type: { name: "String" } }, - linkSpeed: { + resourceId: { + serializedName: "resourceId", readOnly: true, - serializedName: "linkSpeed", type: { - name: "Number" + name: "String" } }, - status: { + aadAuthority: { + serializedName: "aadAuthority", readOnly: true, - serializedName: "status", type: { name: "String" } }, - rdmaStatus: { - serializedName: "rdmaStatus", + aadTenantId: { + serializedName: "aadTenantId", + readOnly: true, type: { name: "String" } }, - dhcpStatus: { - serializedName: "dhcpStatus", + servicePrincipalClientId: { + serializedName: "servicePrincipalClientId", + readOnly: true, type: { name: "String" } }, - ipv4Configuration: { + servicePrincipalObjectId: { + serializedName: "servicePrincipalObjectId", readOnly: true, - serializedName: "ipv4Configuration", type: { - name: "Composite", - className: "Ipv4Config" + name: "String" } }, - ipv6Configuration: { + azureManagementEndpointAudience: { + serializedName: "azureManagementEndpointAudience", readOnly: true, - serializedName: "ipv6Configuration", type: { - name: "Composite", - className: "Ipv6Config" + name: "String" } }, - ipv6LinkLocalAddress: { + aadAudience: { + serializedName: "aadAudience", readOnly: true, - serializedName: "ipv6LinkLocalAddress", type: { name: "String" } - }, - dnsServers: { + } + } + } +}; + +export const UserList: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "UserList", + modelProperties: { + value: { + serializedName: "value", readOnly: true, - serializedName: "dnsServers", type: { name: "Sequence", element: { type: { - name: "String" + name: "Composite", + className: "User" } } } + }, + nextLink: { + serializedName: "nextLink", + readOnly: true, + type: { + name: "String" + } } } } }; -export const NetworkSettings: msRest.CompositeMapper = { - serializedName: "NetworkSettings", +export const ShareAccessRight: coreClient.CompositeMapper = { type: { name: "Composite", - className: "NetworkSettings", + className: "ShareAccessRight", modelProperties: { - ...ARMBaseModel.type.modelProperties, - networkAdapters: { + shareId: { + serializedName: "shareId", + required: true, + type: { + name: "String" + } + }, + accessType: { + serializedName: "accessType", + required: true, + type: { + name: "String" + } + } + } + } +}; + +export const SkuInformationList: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "SkuInformationList", + modelProperties: { + value: { + serializedName: "value", readOnly: true, - serializedName: "properties.networkAdapters", type: { name: "Sequence", element: { type: { name: "Composite", - className: "NetworkAdapter" + className: "ResourceTypeSku" } } } + }, + nextLink: { + serializedName: "nextLink", + readOnly: true, + type: { + name: "String" + } } } } }; -export const Node: msRest.CompositeMapper = { - serializedName: "Node", +export const ResourceTypeSku: coreClient.CompositeMapper = { type: { name: "Composite", - className: "Node", + className: "ResourceTypeSku", modelProperties: { - ...ARMBaseModel.type.modelProperties, - nodeStatus: { + resourceType: { + serializedName: "resourceType", readOnly: true, - serializedName: "properties.nodeStatus", type: { name: "String" } }, - nodeChassisSerialNumber: { + name: { + serializedName: "name", readOnly: true, - serializedName: "properties.nodeChassisSerialNumber", type: { name: "String" } }, - nodeSerialNumber: { + kind: { + serializedName: "kind", readOnly: true, - serializedName: "properties.nodeSerialNumber", type: { name: "String" } }, - nodeDisplayName: { + tier: { + serializedName: "tier", readOnly: true, - serializedName: "properties.nodeDisplayName", type: { name: "String" } }, - nodeFriendlySoftwareVersion: { + family: { + serializedName: "family", readOnly: true, - serializedName: "properties.nodeFriendlySoftwareVersion", type: { name: "String" } }, - nodeHcsVersion: { + locations: { + serializedName: "locations", readOnly: true, - serializedName: "properties.nodeHcsVersion", type: { - name: "String" + name: "Sequence", + element: { + type: { + name: "String" + } + } } }, - nodeInstanceId: { + apiVersions: { + serializedName: "apiVersions", readOnly: true, - serializedName: "properties.nodeInstanceId", type: { - name: "String" - } - } - } - } -}; - -export const OperationDisplay: msRest.CompositeMapper = { - serializedName: "OperationDisplay", - type: { - name: "Composite", - className: "OperationDisplay", - modelProperties: { - provider: { - serializedName: "provider", - type: { - name: "String" - } - }, - resource: { - serializedName: "resource", - type: { - name: "String" - } - }, - operation: { - serializedName: "operation", - type: { - name: "String" + name: "Sequence", + element: { + type: { + name: "String" + } + } } }, - description: { - serializedName: "description", - type: { - name: "String" - } - } - } - } -}; - -export const ServiceSpecification: msRest.CompositeMapper = { - serializedName: "ServiceSpecification", - type: { - name: "Composite", - className: "ServiceSpecification", - modelProperties: { - metricSpecifications: { - serializedName: "metricSpecifications", + locationInfo: { + serializedName: "locationInfo", + readOnly: true, type: { name: "Sequence", element: { type: { name: "Composite", - className: "MetricSpecificationV1" + className: "SkuLocationInfo" } } } - } - } - } -}; - -export const Operation: msRest.CompositeMapper = { - serializedName: "Operation", - type: { - name: "Composite", - className: "Operation", - modelProperties: { - name: { - serializedName: "name", - type: { - name: "String" - } - }, - display: { - serializedName: "display", - type: { - name: "Composite", - className: "OperationDisplay" - } }, - origin: { - serializedName: "origin", + costs: { + serializedName: "costs", + readOnly: true, type: { - name: "String" + name: "Sequence", + element: { + type: { + name: "Composite", + className: "SkuCost" + } + } } }, - serviceSpecification: { - serializedName: "properties.serviceSpecification", + restrictions: { + serializedName: "restrictions", + readOnly: true, type: { - name: "Composite", - className: "ServiceSpecification" + name: "Sequence", + element: { + type: { + name: "Composite", + className: "SkuRestriction" + } + } } } } } }; -export const OrderStatus: msRest.CompositeMapper = { - serializedName: "OrderStatus", +export const SkuLocationInfo: coreClient.CompositeMapper = { type: { name: "Composite", - className: "OrderStatus", + className: "SkuLocationInfo", modelProperties: { - status: { - required: true, - serializedName: "status", + location: { + serializedName: "location", + readOnly: true, type: { name: "String" } }, - updateDateTime: { + zones: { + serializedName: "zones", readOnly: true, - serializedName: "updateDateTime", - type: { - name: "DateTime" - } - }, - comments: { - serializedName: "comments", type: { - name: "String" + name: "Sequence", + element: { + type: { + name: "String" + } + } } }, - additionalOrderDetails: { + sites: { + serializedName: "sites", readOnly: true, - serializedName: "additionalOrderDetails", type: { - name: "Dictionary", - value: { + name: "Sequence", + element: { type: { name: "String" } @@ -1761,32 +1830,28 @@ export const OrderStatus: msRest.CompositeMapper = { } }; -export const TrackingInfo: msRest.CompositeMapper = { - serializedName: "TrackingInfo", +export const SkuCost: coreClient.CompositeMapper = { type: { name: "Composite", - className: "TrackingInfo", + className: "SkuCost", modelProperties: { - serialNumber: { - serializedName: "serialNumber", - type: { - name: "String" - } - }, - carrierName: { - serializedName: "carrierName", + meterId: { + serializedName: "meterId", + readOnly: true, type: { name: "String" } }, - trackingId: { - serializedName: "trackingId", + quantity: { + serializedName: "quantity", + readOnly: true, type: { - name: "String" + name: "Number" } }, - trackingUrl: { - serializedName: "trackingUrl", + extendedUnit: { + serializedName: "extendedUnit", + readOnly: true, type: { name: "String" } @@ -1795,78 +1860,73 @@ export const TrackingInfo: msRest.CompositeMapper = { } }; -export const Order: msRest.CompositeMapper = { - serializedName: "Order", +export const SkuRestriction: coreClient.CompositeMapper = { type: { name: "Composite", - className: "Order", + className: "SkuRestriction", modelProperties: { - ...ARMBaseModel.type.modelProperties, - contactInformation: { - required: true, - serializedName: "properties.contactInformation", - type: { - name: "Composite", - className: "ContactDetails" - } - }, - shippingAddress: { - required: true, - serializedName: "properties.shippingAddress", - type: { - name: "Composite", - className: "Address" - } - }, - currentStatus: { - serializedName: "properties.currentStatus", + type: { + serializedName: "type", + readOnly: true, type: { - name: "Composite", - className: "OrderStatus" + name: "String" } }, - orderHistory: { + values: { + serializedName: "values", readOnly: true, - serializedName: "properties.orderHistory", type: { name: "Sequence", element: { type: { - name: "Composite", - className: "OrderStatus" + name: "String" } } } }, - serialNumber: { + reasonCode: { + serializedName: "reasonCode", readOnly: true, - serializedName: "properties.serialNumber", type: { name: "String" } }, - deliveryTrackingInfo: { + restrictionInfo: { + serializedName: "restrictionInfo", + type: { + name: "Composite", + className: "SkuRestrictionInfo" + } + } + } + } +}; + +export const SkuRestrictionInfo: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "SkuRestrictionInfo", + modelProperties: { + locations: { + serializedName: "locations", readOnly: true, - serializedName: "properties.deliveryTrackingInfo", type: { name: "Sequence", element: { type: { - name: "Composite", - className: "TrackingInfo" + name: "String" } } } }, - returnTrackingInfo: { + zones: { + serializedName: "zones", readOnly: true, - serializedName: "properties.returnTrackingInfo", type: { name: "Sequence", element: { type: { - name: "Composite", - className: "TrackingInfo" + name: "String" } } } @@ -1875,63 +1935,46 @@ export const Order: msRest.CompositeMapper = { } }; -export const PeriodicTimerSourceInfo: msRest.CompositeMapper = { - serializedName: "PeriodicTimerSourceInfo", +export const Authentication: coreClient.CompositeMapper = { type: { name: "Composite", - className: "PeriodicTimerSourceInfo", + className: "Authentication", modelProperties: { - startTime: { - required: true, - serializedName: "startTime", - type: { - name: "DateTime" - } - }, - schedule: { - required: true, - serializedName: "schedule", - type: { - name: "String" - } - }, - topic: { - serializedName: "topic", + symmetricKey: { + serializedName: "symmetricKey", type: { - name: "String" + name: "Composite", + className: "SymmetricKey" } } } } }; -export const PeriodicTimerEventTrigger: msRest.CompositeMapper = { - serializedName: "PeriodicTimerEvent", +export const SymmetricKey: coreClient.CompositeMapper = { type: { name: "Composite", - polymorphicDiscriminator: Trigger.type.polymorphicDiscriminator, - uberParent: "Trigger", - className: "PeriodicTimerEventTrigger", + className: "SymmetricKey", modelProperties: { - ...Trigger.type.modelProperties, - sourceInfo: { - required: true, - serializedName: "properties.sourceInfo", + connectionString: { + serializedName: "connectionString", type: { name: "Composite", - className: "PeriodicTimerSourceInfo" + className: "AsymmetricEncryptedSecret" } - }, - sinkInfo: { + } + } + } +}; + +export const FileSourceInfo: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "FileSourceInfo", + modelProperties: { + shareId: { + serializedName: "shareId", required: true, - serializedName: "properties.sinkInfo", - type: { - name: "Composite", - className: "RoleSinkInfo" - } - }, - customContextTag: { - serializedName: "properties.customContextTag", type: { name: "String" } @@ -1940,530 +1983,429 @@ export const PeriodicTimerEventTrigger: msRest.CompositeMapper = { } }; -export const SkuLocationInfo: msRest.CompositeMapper = { - serializedName: "SkuLocationInfo", +export const RoleSinkInfo: coreClient.CompositeMapper = { type: { name: "Composite", - className: "SkuLocationInfo", + className: "RoleSinkInfo", modelProperties: { - location: { - readOnly: true, - serializedName: "location", + roleId: { + serializedName: "roleId", + required: true, type: { name: "String" } - }, - zones: { - readOnly: true, - serializedName: "zones", - type: { - name: "Sequence", - element: { - type: { - name: "String" - } - } - } - }, - sites: { - readOnly: true, - serializedName: "sites", - type: { - name: "Sequence", - element: { - type: { - name: "String" - } - } - } } } } }; -export const SkuCost: msRest.CompositeMapper = { - serializedName: "SkuCost", +export const IoTDeviceInfo: coreClient.CompositeMapper = { type: { name: "Composite", - className: "SkuCost", + className: "IoTDeviceInfo", modelProperties: { - meterId: { - readOnly: true, - serializedName: "meterId", + deviceId: { + serializedName: "deviceId", + required: true, type: { name: "String" } }, - quantity: { - readOnly: true, - serializedName: "quantity", + ioTHostHub: { + serializedName: "ioTHostHub", + required: true, type: { - name: "Number" + name: "String" } }, - extendedUnit: { - readOnly: true, - serializedName: "extendedUnit", + ioTHostHubId: { + serializedName: "ioTHostHubId", type: { name: "String" } + }, + authentication: { + serializedName: "authentication", + type: { + name: "Composite", + className: "Authentication" + } } } } }; -export const SkuRestrictionInfo: msRest.CompositeMapper = { - serializedName: "SkuRestrictionInfo", +export const PeriodicTimerSourceInfo: coreClient.CompositeMapper = { type: { name: "Composite", - className: "SkuRestrictionInfo", + className: "PeriodicTimerSourceInfo", modelProperties: { - locations: { - readOnly: true, - serializedName: "locations", + startTime: { + serializedName: "startTime", + required: true, type: { - name: "Sequence", - element: { - type: { - name: "String" - } - } + name: "DateTime" } }, - zones: { - readOnly: true, - serializedName: "zones", + schedule: { + serializedName: "schedule", + required: true, type: { - name: "Sequence", - element: { - type: { - name: "String" - } - } + name: "String" + } + }, + topic: { + serializedName: "topic", + type: { + name: "String" } } } } }; -export const SkuRestriction: msRest.CompositeMapper = { - serializedName: "SkuRestriction", +export const DataBoxEdgeDevice: coreClient.CompositeMapper = { type: { name: "Composite", - className: "SkuRestriction", + className: "DataBoxEdgeDevice", modelProperties: { - type: { - readOnly: true, - serializedName: "type", + ...ARMBaseModel.type.modelProperties, + location: { + serializedName: "location", + required: true, type: { name: "String" } }, - values: { - readOnly: true, - serializedName: "values", + tags: { + serializedName: "tags", type: { - name: "Sequence", - element: { - type: { - name: "String" - } - } + name: "Dictionary", + value: { type: { name: "String" } } } }, - reasonCode: { - readOnly: true, - serializedName: "reasonCode", + sku: { + serializedName: "sku", + type: { + name: "Composite", + className: "Sku" + } + }, + etag: { + serializedName: "etag", type: { name: "String" } }, - restrictionInfo: { - readOnly: true, - serializedName: "restrictionInfo", + dataBoxEdgeDeviceStatus: { + serializedName: "properties.dataBoxEdgeDeviceStatus", type: { - name: "Composite", - className: "SkuRestrictionInfo" + name: "String" } - } - } - } -}; - -export const ResourceTypeSku: msRest.CompositeMapper = { - serializedName: "ResourceTypeSku", - type: { - name: "Composite", - className: "ResourceTypeSku", - modelProperties: { - resourceType: { + }, + serialNumber: { + serializedName: "properties.serialNumber", readOnly: true, - serializedName: "resourceType", type: { name: "String" } }, - name: { - readOnly: true, - serializedName: "name", + description: { + serializedName: "properties.description", type: { name: "String" } }, - kind: { + modelDescription: { + serializedName: "properties.modelDescription", + type: { + name: "String" + } + }, + deviceType: { + serializedName: "properties.deviceType", readOnly: true, - serializedName: "kind", type: { name: "String" } }, - tier: { + friendlyName: { + serializedName: "properties.friendlyName", + type: { + name: "String" + } + }, + culture: { + serializedName: "properties.culture", readOnly: true, - serializedName: "tier", type: { name: "String" } }, - family: { + deviceModel: { + serializedName: "properties.deviceModel", readOnly: true, - serializedName: "family", type: { name: "String" } }, - locations: { + deviceSoftwareVersion: { + serializedName: "properties.deviceSoftwareVersion", readOnly: true, - serializedName: "locations", type: { - name: "Sequence", - element: { - type: { - name: "String" - } - } + name: "String" } }, - apiVersions: { + deviceLocalCapacity: { + serializedName: "properties.deviceLocalCapacity", readOnly: true, - serializedName: "apiVersions", type: { - name: "Sequence", - element: { - type: { - name: "String" - } - } + name: "Number" } }, - locationInfo: { + timeZone: { + serializedName: "properties.timeZone", readOnly: true, - serializedName: "locationInfo", type: { - name: "Sequence", - element: { - type: { - name: "Composite", - className: "SkuLocationInfo" - } - } + name: "String" } }, - costs: { + deviceHcsVersion: { + serializedName: "properties.deviceHcsVersion", readOnly: true, - serializedName: "costs", type: { - name: "Sequence", - element: { - type: { - name: "Composite", - className: "SkuCost" - } - } + name: "String" } }, - restrictions: { + configuredRoleTypes: { + serializedName: "properties.configuredRoleTypes", readOnly: true, - serializedName: "restrictions", type: { name: "Sequence", element: { type: { - name: "Composite", - className: "SkuRestriction" + name: "String" } } } - } - } - } -}; - -export const SecuritySettings: msRest.CompositeMapper = { - serializedName: "SecuritySettings", - type: { - name: "Composite", - className: "SecuritySettings", - modelProperties: { - ...ARMBaseModel.type.modelProperties, - deviceAdminPassword: { - required: true, - serializedName: "properties.deviceAdminPassword", - type: { - name: "Composite", - className: "AsymmetricEncryptedSecret" - } - } - } - } -}; - -export const UserAccessRight: msRest.CompositeMapper = { - serializedName: "UserAccessRight", - type: { - name: "Composite", - className: "UserAccessRight", - modelProperties: { - userId: { - required: true, - serializedName: "userId", - type: { - name: "String" - } }, - accessType: { - required: true, - serializedName: "accessType", + nodeCount: { + serializedName: "properties.nodeCount", + readOnly: true, type: { - name: "String" + name: "Number" } } } } }; -export const Share: msRest.CompositeMapper = { - serializedName: "Share", +export const Alert: coreClient.CompositeMapper = { type: { name: "Composite", - className: "Share", + className: "Alert", modelProperties: { ...ARMBaseModel.type.modelProperties, - description: { - serializedName: "properties.description", - type: { - name: "String" - } - }, - shareStatus: { - required: true, - serializedName: "properties.shareStatus", + title: { + serializedName: "properties.title", + readOnly: true, type: { name: "String" } }, - monitoringStatus: { - required: true, - serializedName: "properties.monitoringStatus", + alertType: { + serializedName: "properties.alertType", + readOnly: true, type: { name: "String" } }, - azureContainerInfo: { - serializedName: "properties.azureContainerInfo", + appearedAtDateTime: { + serializedName: "properties.appearedAtDateTime", + readOnly: true, type: { - name: "Composite", - className: "AzureContainerInfo" + name: "DateTime" } }, - accessProtocol: { - required: true, - serializedName: "properties.accessProtocol", + recommendation: { + serializedName: "properties.recommendation", + readOnly: true, type: { name: "String" } }, - userAccessRights: { - serializedName: "properties.userAccessRights", - type: { - name: "Sequence", - element: { - type: { - name: "Composite", - className: "UserAccessRight" - } - } - } - }, - clientAccessRights: { - serializedName: "properties.clientAccessRights", + severity: { + serializedName: "properties.severity", + readOnly: true, type: { - name: "Sequence", - element: { - type: { - name: "Composite", - className: "ClientAccessRight" - } - } + name: "String" } }, - refreshDetails: { - serializedName: "properties.refreshDetails", + errorDetails: { + serializedName: "properties.errorDetails", type: { name: "Composite", - className: "RefreshDetails" + className: "AlertErrorDetails" } }, - shareMappings: { + detailedInformation: { + serializedName: "properties.detailedInformation", readOnly: true, - serializedName: "properties.shareMappings", - type: { - name: "Sequence", - element: { - type: { - name: "Composite", - className: "MountPointMap" - } - } - } - }, - dataPolicy: { - serializedName: "properties.dataPolicy", type: { - name: "String" + name: "Dictionary", + value: { type: { name: "String" } } } } } } }; -export const ShareAccessRight: msRest.CompositeMapper = { - serializedName: "ShareAccessRight", +export const BandwidthSchedule: coreClient.CompositeMapper = { type: { name: "Composite", - className: "ShareAccessRight", + className: "BandwidthSchedule", modelProperties: { - shareId: { + ...ARMBaseModel.type.modelProperties, + start: { + serializedName: "properties.start", required: true, - serializedName: "shareId", type: { name: "String" } }, - accessType: { + stop: { + serializedName: "properties.stop", required: true, - serializedName: "accessType", type: { name: "String" } + }, + rateInMbps: { + serializedName: "properties.rateInMbps", + required: true, + type: { + name: "Number" + } + }, + days: { + serializedName: "properties.days", + required: true, + type: { + name: "Sequence", + element: { + type: { + name: "String" + } + } + } } } } }; -export const StorageAccount: msRest.CompositeMapper = { - serializedName: "StorageAccount", +export const DataBoxEdgeDeviceExtendedInfo: coreClient.CompositeMapper = { type: { name: "Composite", - className: "StorageAccount", + className: "DataBoxEdgeDeviceExtendedInfo", modelProperties: { ...ARMBaseModel.type.modelProperties, - description: { - serializedName: "properties.description", - type: { - name: "String" - } - }, - storageAccountStatus: { - serializedName: "properties.storageAccountStatus", - type: { - name: "String" - } - }, - dataPolicy: { - serializedName: "properties.dataPolicy", + encryptionKeyThumbprint: { + serializedName: "properties.encryptionKeyThumbprint", type: { name: "String" } }, - storageAccountCredentialId: { - serializedName: "properties.storageAccountCredentialId", + encryptionKey: { + serializedName: "properties.encryptionKey", type: { name: "String" } }, - blobEndpoint: { + resourceKey: { + serializedName: "properties.resourceKey", readOnly: true, - serializedName: "properties.blobEndpoint", type: { name: "String" } - }, - containerCount: { + } + } + } +}; + +export const NetworkSettings: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "NetworkSettings", + modelProperties: { + ...ARMBaseModel.type.modelProperties, + networkAdapters: { + serializedName: "properties.networkAdapters", readOnly: true, - serializedName: "properties.containerCount", type: { - name: "Number" + name: "Sequence", + element: { + type: { + name: "Composite", + className: "NetworkAdapter" + } + } } } } } }; -export const StorageAccountCredential: msRest.CompositeMapper = { - serializedName: "StorageAccountCredential", +export const Node: coreClient.CompositeMapper = { type: { name: "Composite", - className: "StorageAccountCredential", + className: "Node", modelProperties: { ...ARMBaseModel.type.modelProperties, - alias: { - required: true, - serializedName: "properties.alias", + nodeStatus: { + serializedName: "properties.nodeStatus", + readOnly: true, type: { name: "String" } }, - userName: { - serializedName: "properties.userName", + nodeChassisSerialNumber: { + serializedName: "properties.nodeChassisSerialNumber", + readOnly: true, type: { name: "String" } }, - accountKey: { - serializedName: "properties.accountKey", - type: { - name: "Composite", - className: "AsymmetricEncryptedSecret" - } - }, - connectionString: { - serializedName: "properties.connectionString", + nodeSerialNumber: { + serializedName: "properties.nodeSerialNumber", + readOnly: true, type: { name: "String" } }, - sslStatus: { - required: true, - serializedName: "properties.sslStatus", + nodeDisplayName: { + serializedName: "properties.nodeDisplayName", + readOnly: true, type: { name: "String" } }, - blobDomainName: { - serializedName: "properties.blobDomainName", + nodeFriendlySoftwareVersion: { + serializedName: "properties.nodeFriendlySoftwareVersion", + readOnly: true, type: { name: "String" } }, - accountType: { - required: true, - serializedName: "properties.accountType", + nodeHcsVersion: { + serializedName: "properties.nodeHcsVersion", + readOnly: true, type: { name: "String" } }, - storageAccountId: { - serializedName: "properties.storageAccountId", + nodeInstanceId: { + serializedName: "properties.nodeInstanceId", + readOnly: true, type: { name: "String" } @@ -2472,283 +2414,380 @@ export const StorageAccountCredential: msRest.CompositeMapper = { } }; -export const UpdateSummary: msRest.CompositeMapper = { - serializedName: "UpdateSummary", +export const Order: coreClient.CompositeMapper = { type: { name: "Composite", - className: "UpdateSummary", + className: "Order", modelProperties: { ...ARMBaseModel.type.modelProperties, - deviceVersionNumber: { - serializedName: "properties.deviceVersionNumber", + contactInformation: { + serializedName: "properties.contactInformation", type: { - name: "String" + name: "Composite", + className: "ContactDetails" } }, - friendlyDeviceVersionName: { - serializedName: "properties.friendlyDeviceVersionName", + shippingAddress: { + serializedName: "properties.shippingAddress", type: { - name: "String" + name: "Composite", + className: "Address" } }, - deviceLastScannedDateTime: { - serializedName: "properties.deviceLastScannedDateTime", + currentStatus: { + serializedName: "properties.currentStatus", type: { - name: "DateTime" + name: "Composite", + className: "OrderStatus" } }, - lastCompletedScanJobDateTime: { - serializedName: "properties.lastCompletedScanJobDateTime", + orderHistory: { + serializedName: "properties.orderHistory", + readOnly: true, type: { - name: "DateTime" + name: "Sequence", + element: { + type: { + name: "Composite", + className: "OrderStatus" + } + } } }, - lastCompletedDownloadJobDateTime: { + serialNumber: { + serializedName: "properties.serialNumber", readOnly: true, - serializedName: "properties.lastCompletedDownloadJobDateTime", type: { - name: "DateTime" + name: "String" } }, - lastCompletedInstallJobDateTime: { + deliveryTrackingInfo: { + serializedName: "properties.deliveryTrackingInfo", readOnly: true, - serializedName: "properties.lastCompletedInstallJobDateTime", type: { - name: "DateTime" + name: "Sequence", + element: { + type: { + name: "Composite", + className: "TrackingInfo" + } + } } }, - totalNumberOfUpdatesAvailable: { + returnTrackingInfo: { + serializedName: "properties.returnTrackingInfo", readOnly: true, - serializedName: "properties.totalNumberOfUpdatesAvailable", type: { - name: "Number" + name: "Sequence", + element: { + type: { + name: "Composite", + className: "TrackingInfo" + } + } } - }, - totalNumberOfUpdatesPendingDownload: { - readOnly: true, - serializedName: "properties.totalNumberOfUpdatesPendingDownload", + } + } + } +}; + +export const Role: coreClient.CompositeMapper = { + serializedName: "Role", + type: { + name: "Composite", + className: "Role", + uberParent: "ARMBaseModel", + polymorphicDiscriminator: { + serializedName: "kind", + clientName: "kind" + }, + modelProperties: { + ...ARMBaseModel.type.modelProperties, + kind: { + serializedName: "kind", + required: true, type: { - name: "Number" + name: "String" } - }, - totalNumberOfUpdatesPendingInstall: { - readOnly: true, - serializedName: "properties.totalNumberOfUpdatesPendingInstall", + } + } + } +}; + +export const SecuritySettings: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "SecuritySettings", + modelProperties: { + ...ARMBaseModel.type.modelProperties, + deviceAdminPassword: { + serializedName: "properties.deviceAdminPassword", type: { - name: "Number" + name: "Composite", + className: "AsymmetricEncryptedSecret" } - }, - rebootBehavior: { - readOnly: true, - serializedName: "properties.rebootBehavior", + } + } + } +}; + +export const Share: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "Share", + modelProperties: { + ...ARMBaseModel.type.modelProperties, + description: { + serializedName: "properties.description", type: { name: "String" } }, - ongoingUpdateOperation: { - readOnly: true, - serializedName: "properties.ongoingUpdateOperation", + shareStatus: { + serializedName: "properties.shareStatus", + required: true, type: { name: "String" } }, - inProgressDownloadJobId: { - readOnly: true, - serializedName: "properties.inProgressDownloadJobId", + monitoringStatus: { + serializedName: "properties.monitoringStatus", + required: true, type: { name: "String" } }, - inProgressInstallJobId: { - readOnly: true, - serializedName: "properties.inProgressInstallJobId", + azureContainerInfo: { + serializedName: "properties.azureContainerInfo", + type: { + name: "Composite", + className: "AzureContainerInfo" + } + }, + accessProtocol: { + serializedName: "properties.accessProtocol", + required: true, type: { name: "String" } }, - inProgressDownloadJobStartedDateTime: { - readOnly: true, - serializedName: "properties.inProgressDownloadJobStartedDateTime", + userAccessRights: { + serializedName: "properties.userAccessRights", type: { - name: "DateTime" + name: "Sequence", + element: { + type: { + name: "Composite", + className: "UserAccessRight" + } + } } }, - inProgressInstallJobStartedDateTime: { - readOnly: true, - serializedName: "properties.inProgressInstallJobStartedDateTime", + clientAccessRights: { + serializedName: "properties.clientAccessRights", type: { - name: "DateTime" + name: "Sequence", + element: { + type: { + name: "Composite", + className: "ClientAccessRight" + } + } } }, - updateTitles: { + refreshDetails: { + serializedName: "properties.refreshDetails", + type: { + name: "Composite", + className: "RefreshDetails" + } + }, + shareMappings: { + serializedName: "properties.shareMappings", readOnly: true, - serializedName: "properties.updateTitles", type: { name: "Sequence", element: { type: { - name: "String" + name: "Composite", + className: "MountPointMap" } } } }, - totalUpdateSizeInBytes: { - readOnly: true, - serializedName: "properties.totalUpdateSizeInBytes", + dataPolicy: { + serializedName: "properties.dataPolicy", type: { - name: "Number" + name: "String" } } } } }; -export const UploadCertificateRequest: msRest.CompositeMapper = { - serializedName: "UploadCertificateRequest", +export const StorageAccountCredential: coreClient.CompositeMapper = { type: { name: "Composite", - className: "UploadCertificateRequest", + className: "StorageAccountCredential", modelProperties: { - authenticationType: { - serializedName: "properties.authenticationType", + ...ARMBaseModel.type.modelProperties, + alias: { + serializedName: "properties.alias", + required: true, type: { name: "String" } }, - certificate: { + userName: { + serializedName: "properties.userName", + type: { + name: "String" + } + }, + accountKey: { + serializedName: "properties.accountKey", + type: { + name: "Composite", + className: "AsymmetricEncryptedSecret" + } + }, + connectionString: { + serializedName: "properties.connectionString", + type: { + name: "String" + } + }, + sslStatus: { + serializedName: "properties.sslStatus", required: true, - serializedName: "properties.certificate", type: { name: "String" } - } - } - } -}; - -export const UploadCertificateResponse: msRest.CompositeMapper = { - serializedName: "UploadCertificateResponse", - type: { - name: "Composite", - className: "UploadCertificateResponse", - modelProperties: { - authType: { - serializedName: "authType", + }, + blobDomainName: { + serializedName: "properties.blobDomainName", type: { name: "String" } }, - resourceId: { - readOnly: true, - serializedName: "resourceId", + accountType: { + serializedName: "properties.accountType", + required: true, type: { name: "String" } }, - aadAuthority: { - readOnly: true, - serializedName: "aadAuthority", + storageAccountId: { + serializedName: "properties.storageAccountId", + type: { + name: "String" + } + } + } + } +}; + +export const StorageAccount: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "StorageAccount", + modelProperties: { + ...ARMBaseModel.type.modelProperties, + description: { + serializedName: "properties.description", type: { name: "String" } }, - aadTenantId: { - readOnly: true, - serializedName: "aadTenantId", + storageAccountStatus: { + serializedName: "properties.storageAccountStatus", type: { name: "String" } }, - servicePrincipalClientId: { - readOnly: true, - serializedName: "servicePrincipalClientId", + dataPolicy: { + serializedName: "properties.dataPolicy", type: { name: "String" } }, - servicePrincipalObjectId: { - readOnly: true, - serializedName: "servicePrincipalObjectId", + storageAccountCredentialId: { + serializedName: "properties.storageAccountCredentialId", type: { name: "String" } }, - azureManagementEndpointAudience: { + blobEndpoint: { + serializedName: "properties.blobEndpoint", readOnly: true, - serializedName: "azureManagementEndpointAudience", type: { name: "String" } }, - aadAudience: { + containerCount: { + serializedName: "properties.containerCount", readOnly: true, - serializedName: "aadAudience", type: { - name: "String" + name: "Number" } } } } }; -export const User: msRest.CompositeMapper = { - serializedName: "User", +export const Container: coreClient.CompositeMapper = { type: { name: "Composite", - className: "User", + className: "Container", modelProperties: { ...ARMBaseModel.type.modelProperties, - encryptedPassword: { - serializedName: "properties.encryptedPassword", + containerStatus: { + serializedName: "properties.containerStatus", + readOnly: true, type: { - name: "Composite", - className: "AsymmetricEncryptedSecret" + name: "String" } }, - shareAccessRights: { - serializedName: "properties.shareAccessRights", + dataFormat: { + serializedName: "properties.dataFormat", + required: true, type: { - name: "Sequence", - element: { - type: { - name: "Composite", - className: "ShareAccessRight" - } - } + name: "String" } }, - userType: { - required: true, - serializedName: "properties.userType", + refreshDetails: { + serializedName: "properties.refreshDetails", type: { - name: "String" + name: "Composite", + className: "RefreshDetails" + } + }, + createdDateTime: { + serializedName: "properties.createdDateTime", + readOnly: true, + type: { + name: "DateTime" } } } } }; -export const OperationsList: msRest.CompositeMapper = { - serializedName: "OperationsList", +export const Trigger: coreClient.CompositeMapper = { + serializedName: "Trigger", type: { name: "Composite", - className: "OperationsList", + className: "Trigger", + uberParent: "ARMBaseModel", + polymorphicDiscriminator: { + serializedName: "kind", + clientName: "kind" + }, modelProperties: { - value: { + ...ARMBaseModel.type.modelProperties, + kind: { + serializedName: "kind", required: true, - serializedName: "", - type: { - name: "Sequence", - element: { - type: { - name: "Composite", - className: "Operation" - } - } - } - }, - nextLink: { - serializedName: "nextLink", type: { name: "String" } @@ -2757,231 +2796,164 @@ export const OperationsList: msRest.CompositeMapper = { } }; -export const DataBoxEdgeDeviceList: msRest.CompositeMapper = { - serializedName: "DataBoxEdgeDeviceList", +export const UpdateSummary: coreClient.CompositeMapper = { type: { name: "Composite", - className: "DataBoxEdgeDeviceList", + className: "UpdateSummary", modelProperties: { - value: { - readOnly: true, - serializedName: "", + ...ARMBaseModel.type.modelProperties, + deviceVersionNumber: { + serializedName: "properties.deviceVersionNumber", type: { - name: "Sequence", - element: { - type: { - name: "Composite", - className: "DataBoxEdgeDevice" - } - } + name: "String" } }, - nextLink: { - readOnly: true, - serializedName: "nextLink", + friendlyDeviceVersionName: { + serializedName: "properties.friendlyDeviceVersionName", type: { name: "String" } - } - } - } -}; - -export const AlertList: msRest.CompositeMapper = { - serializedName: "AlertList", - type: { - name: "Composite", - className: "AlertList", - modelProperties: { - value: { + }, + deviceLastScannedDateTime: { + serializedName: "properties.deviceLastScannedDateTime", + type: { + name: "DateTime" + } + }, + lastCompletedScanJobDateTime: { + serializedName: "properties.lastCompletedScanJobDateTime", + type: { + name: "DateTime" + } + }, + lastCompletedDownloadJobDateTime: { + serializedName: "properties.lastCompletedDownloadJobDateTime", readOnly: true, - serializedName: "", type: { - name: "Sequence", - element: { - type: { - name: "Composite", - className: "Alert" - } - } + name: "DateTime" } }, - nextLink: { + lastCompletedInstallJobDateTime: { + serializedName: "properties.lastCompletedInstallJobDateTime", readOnly: true, - serializedName: "nextLink", type: { - name: "String" + name: "DateTime" } - } - } - } -}; - -export const BandwidthSchedulesList: msRest.CompositeMapper = { - serializedName: "BandwidthSchedulesList", - type: { - name: "Composite", - className: "BandwidthSchedulesList", - modelProperties: { - value: { + }, + totalNumberOfUpdatesAvailable: { + serializedName: "properties.totalNumberOfUpdatesAvailable", readOnly: true, - serializedName: "", type: { - name: "Sequence", - element: { - type: { - name: "Composite", - className: "BandwidthSchedule" - } - } + name: "Number" + } + }, + totalNumberOfUpdatesPendingDownload: { + serializedName: "properties.totalNumberOfUpdatesPendingDownload", + readOnly: true, + type: { + name: "Number" + } + }, + totalNumberOfUpdatesPendingInstall: { + serializedName: "properties.totalNumberOfUpdatesPendingInstall", + readOnly: true, + type: { + name: "Number" } }, - nextLink: { + rebootBehavior: { + serializedName: "properties.rebootBehavior", readOnly: true, - serializedName: "nextLink", type: { name: "String" } - } - } - } -}; - -export const NodeList: msRest.CompositeMapper = { - serializedName: "NodeList", - type: { - name: "Composite", - className: "NodeList", - modelProperties: { - value: { + }, + ongoingUpdateOperation: { + serializedName: "properties.ongoingUpdateOperation", readOnly: true, - serializedName: "", type: { - name: "Sequence", - element: { - type: { - name: "Composite", - className: "Node" - } - } + name: "String" } - } - } - } -}; - -export const OrderList: msRest.CompositeMapper = { - serializedName: "OrderList", - type: { - name: "Composite", - className: "OrderList", - modelProperties: { - value: { + }, + inProgressDownloadJobId: { + serializedName: "properties.inProgressDownloadJobId", readOnly: true, - serializedName: "", type: { - name: "Sequence", - element: { - type: { - name: "Composite", - className: "Order" - } - } + name: "String" } }, - nextLink: { + inProgressInstallJobId: { + serializedName: "properties.inProgressInstallJobId", readOnly: true, - serializedName: "nextLink", type: { name: "String" } - } - } - } -}; - -export const RoleList: msRest.CompositeMapper = { - serializedName: "RoleList", - type: { - name: "Composite", - className: "RoleList", - modelProperties: { - value: { + }, + inProgressDownloadJobStartedDateTime: { + serializedName: "properties.inProgressDownloadJobStartedDateTime", readOnly: true, - serializedName: "", type: { - name: "Sequence", - element: { - type: { - name: "Composite", - className: "Role" - } - } + name: "DateTime" } }, - nextLink: { + inProgressInstallJobStartedDateTime: { + serializedName: "properties.inProgressInstallJobStartedDateTime", readOnly: true, - serializedName: "nextLink", type: { - name: "String" + name: "DateTime" } - } - } - } -}; - -export const ShareList: msRest.CompositeMapper = { - serializedName: "ShareList", - type: { - name: "Composite", - className: "ShareList", - modelProperties: { - value: { + }, + updateTitles: { + serializedName: "properties.updateTitles", readOnly: true, - serializedName: "", type: { name: "Sequence", element: { type: { - name: "Composite", - className: "Share" + name: "String" } } } }, - nextLink: { + totalUpdateSizeInBytes: { + serializedName: "properties.totalUpdateSizeInBytes", readOnly: true, - serializedName: "nextLink", type: { - name: "String" + name: "Number" } } } } }; -export const StorageAccountCredentialList: msRest.CompositeMapper = { - serializedName: "StorageAccountCredentialList", +export const User: coreClient.CompositeMapper = { type: { name: "Composite", - className: "StorageAccountCredentialList", + className: "User", modelProperties: { - value: { - readOnly: true, - serializedName: "", + ...ARMBaseModel.type.modelProperties, + encryptedPassword: { + serializedName: "properties.encryptedPassword", + type: { + name: "Composite", + className: "AsymmetricEncryptedSecret" + } + }, + shareAccessRights: { + serializedName: "properties.shareAccessRights", type: { name: "Sequence", element: { type: { name: "Composite", - className: "StorageAccountCredential" + className: "ShareAccessRight" } } } }, - nextLink: { - readOnly: true, - serializedName: "nextLink", + userType: { + serializedName: "properties.userType", + required: true, type: { name: "String" } @@ -2990,58 +2962,49 @@ export const StorageAccountCredentialList: msRest.CompositeMapper = { } }; -export const StorageAccountList: msRest.CompositeMapper = { - serializedName: "StorageAccountList", +export const IoTRole: coreClient.CompositeMapper = { + serializedName: "IOT", type: { name: "Composite", - className: "StorageAccountList", + className: "IoTRole", + uberParent: "ARMBaseModel", + polymorphicDiscriminator: ARMBaseModel.type.polymorphicDiscriminator, modelProperties: { - value: { - readOnly: true, - serializedName: "", + ...Role.type.modelProperties, + hostPlatform: { + serializedName: "properties.hostPlatform", type: { - name: "Sequence", - element: { - type: { - name: "Composite", - className: "StorageAccount" - } - } + name: "String" } }, - nextLink: { - readOnly: true, - serializedName: "nextLink", + ioTDeviceDetails: { + serializedName: "properties.ioTDeviceDetails", type: { - name: "String" + name: "Composite", + className: "IoTDeviceInfo" } - } - } - } -}; - -export const ContainerList: msRest.CompositeMapper = { - serializedName: "ContainerList", - type: { - name: "Composite", - className: "ContainerList", - modelProperties: { - value: { - readOnly: true, - serializedName: "", + }, + ioTEdgeDeviceDetails: { + serializedName: "properties.ioTEdgeDeviceDetails", + type: { + name: "Composite", + className: "IoTDeviceInfo" + } + }, + shareMappings: { + serializedName: "properties.shareMappings", type: { name: "Sequence", element: { type: { name: "Composite", - className: "Container" + className: "MountPointMap" } } } }, - nextLink: { - readOnly: true, - serializedName: "nextLink", + roleStatus: { + serializedName: "properties.roleStatus", type: { name: "String" } @@ -3050,28 +3013,31 @@ export const ContainerList: msRest.CompositeMapper = { } }; -export const TriggerList: msRest.CompositeMapper = { - serializedName: "TriggerList", +export const FileEventTrigger: coreClient.CompositeMapper = { + serializedName: "FileEvent", type: { name: "Composite", - className: "TriggerList", + className: "FileEventTrigger", + uberParent: "ARMBaseModel", + polymorphicDiscriminator: ARMBaseModel.type.polymorphicDiscriminator, modelProperties: { - value: { - readOnly: true, - serializedName: "", + ...Trigger.type.modelProperties, + sourceInfo: { + serializedName: "properties.sourceInfo", type: { - name: "Sequence", - element: { - type: { - name: "Composite", - className: "Trigger" - } - } + name: "Composite", + className: "FileSourceInfo" } }, - nextLink: { - readOnly: true, - serializedName: "nextLink", + sinkInfo: { + serializedName: "properties.sinkInfo", + type: { + name: "Composite", + className: "RoleSinkInfo" + } + }, + customContextTag: { + serializedName: "properties.customContextTag", type: { name: "String" } @@ -3080,64 +3046,43 @@ export const TriggerList: msRest.CompositeMapper = { } }; -export const UserList: msRest.CompositeMapper = { - serializedName: "UserList", +export const PeriodicTimerEventTrigger: coreClient.CompositeMapper = { + serializedName: "PeriodicTimerEvent", type: { name: "Composite", - className: "UserList", + className: "PeriodicTimerEventTrigger", + uberParent: "ARMBaseModel", + polymorphicDiscriminator: ARMBaseModel.type.polymorphicDiscriminator, modelProperties: { - value: { - readOnly: true, - serializedName: "", + ...Trigger.type.modelProperties, + sourceInfo: { + serializedName: "properties.sourceInfo", type: { - name: "Sequence", - element: { - type: { - name: "Composite", - className: "User" - } - } + name: "Composite", + className: "PeriodicTimerSourceInfo" } }, - nextLink: { - readOnly: true, - serializedName: "nextLink", + sinkInfo: { + serializedName: "properties.sinkInfo", type: { - name: "String" + name: "Composite", + className: "RoleSinkInfo" } - } - } - } -}; - -export const SkuInformationList: msRest.CompositeMapper = { - serializedName: "SkuInformationList", - type: { - name: "Composite", - className: "SkuInformationList", - modelProperties: { - value: { - readOnly: true, - serializedName: "", + }, + customContextTag: { + serializedName: "properties.customContextTag", type: { - name: "Sequence", - element: { - type: { - name: "Composite", - className: "ResourceTypeSku" - } - } + name: "String" } } } } }; -export const discriminators = { - 'Trigger.FileEvent' : FileEventTrigger, - 'Role.IOT' : IoTRole, - 'Trigger.PeriodicTimerEvent' : PeriodicTimerEventTrigger, - 'Role' : Role, - 'Trigger' : Trigger - +export let discriminators = { + "ARMBaseModel.Role": Role, + "ARMBaseModel.Trigger": Trigger, + "ARMBaseModel.IOT": IoTRole, + "ARMBaseModel.FileEvent": FileEventTrigger, + "ARMBaseModel.PeriodicTimerEvent": PeriodicTimerEventTrigger }; diff --git a/sdk/databoxedge/arm-databoxedge-profile-2020-09-01-hybrid/src/models/nodesMappers.ts b/sdk/databoxedge/arm-databoxedge-profile-2020-09-01-hybrid/src/models/nodesMappers.ts deleted file mode 100644 index f03b310a1e46..000000000000 --- a/sdk/databoxedge/arm-databoxedge-profile-2020-09-01-hybrid/src/models/nodesMappers.ts +++ /dev/null @@ -1,57 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for license information. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -export { - discriminators, - Address, - Alert, - AlertErrorDetails, - ARMBaseModel, - AsymmetricEncryptedSecret, - Authentication, - AzureContainerInfo, - BandwidthSchedule, - BaseResource, - ClientAccessRight, - CloudError, - ContactDetails, - Container, - DataBoxEdgeDevice, - DataBoxEdgeDeviceExtendedInfo, - FileEventTrigger, - FileSourceInfo, - IoTDeviceInfo, - IoTRole, - Ipv4Config, - Ipv6Config, - MountPointMap, - NetworkAdapter, - NetworkAdapterPosition, - NetworkSettings, - Node, - NodeList, - Order, - OrderStatus, - PeriodicTimerEventTrigger, - PeriodicTimerSourceInfo, - RefreshDetails, - Role, - RoleSinkInfo, - SecuritySettings, - Share, - ShareAccessRight, - Sku, - StorageAccount, - StorageAccountCredential, - SymmetricKey, - TrackingInfo, - Trigger, - UpdateSummary, - User, - UserAccessRight -} from "../models/mappers"; diff --git a/sdk/databoxedge/arm-databoxedge-profile-2020-09-01-hybrid/src/models/operationsMappers.ts b/sdk/databoxedge/arm-databoxedge-profile-2020-09-01-hybrid/src/models/operationsMappers.ts deleted file mode 100644 index af4a5e3a1bf6..000000000000 --- a/sdk/databoxedge/arm-databoxedge-profile-2020-09-01-hybrid/src/models/operationsMappers.ts +++ /dev/null @@ -1,18 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for 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 { - discriminators, - CloudError, - MetricDimensionV1, - MetricSpecificationV1, - Operation, - OperationDisplay, - OperationsList, - ServiceSpecification -} from "../models/mappers"; diff --git a/sdk/databoxedge/arm-databoxedge-profile-2020-09-01-hybrid/src/models/operationsStatusMappers.ts b/sdk/databoxedge/arm-databoxedge-profile-2020-09-01-hybrid/src/models/operationsStatusMappers.ts deleted file mode 100644 index 0f195ce2be53..000000000000 --- a/sdk/databoxedge/arm-databoxedge-profile-2020-09-01-hybrid/src/models/operationsStatusMappers.ts +++ /dev/null @@ -1,17 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for 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 { - discriminators, - CloudError, - Job, - JobErrorDetails, - JobErrorItem, - UpdateDownloadProgress, - UpdateInstallProgress -} from "../models/mappers"; diff --git a/sdk/databoxedge/arm-databoxedge-profile-2020-09-01-hybrid/src/models/ordersMappers.ts b/sdk/databoxedge/arm-databoxedge-profile-2020-09-01-hybrid/src/models/ordersMappers.ts deleted file mode 100644 index f11141788b6e..000000000000 --- a/sdk/databoxedge/arm-databoxedge-profile-2020-09-01-hybrid/src/models/ordersMappers.ts +++ /dev/null @@ -1,57 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for license information. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -export { - discriminators, - Address, - Alert, - AlertErrorDetails, - ARMBaseModel, - AsymmetricEncryptedSecret, - Authentication, - AzureContainerInfo, - BandwidthSchedule, - BaseResource, - ClientAccessRight, - CloudError, - ContactDetails, - Container, - DataBoxEdgeDevice, - DataBoxEdgeDeviceExtendedInfo, - FileEventTrigger, - FileSourceInfo, - IoTDeviceInfo, - IoTRole, - Ipv4Config, - Ipv6Config, - MountPointMap, - NetworkAdapter, - NetworkAdapterPosition, - NetworkSettings, - Node, - Order, - OrderList, - OrderStatus, - PeriodicTimerEventTrigger, - PeriodicTimerSourceInfo, - RefreshDetails, - Role, - RoleSinkInfo, - SecuritySettings, - Share, - ShareAccessRight, - Sku, - StorageAccount, - StorageAccountCredential, - SymmetricKey, - TrackingInfo, - Trigger, - UpdateSummary, - User, - UserAccessRight -} from "../models/mappers"; diff --git a/sdk/databoxedge/arm-databoxedge-profile-2020-09-01-hybrid/src/models/parameters.ts b/sdk/databoxedge/arm-databoxedge-profile-2020-09-01-hybrid/src/models/parameters.ts index 4dbe31a0c020..00f4d18ea446 100644 --- a/sdk/databoxedge/arm-databoxedge-profile-2020-09-01-hybrid/src/models/parameters.ts +++ b/sdk/databoxedge/arm-databoxedge-profile-2020-09-01-hybrid/src/models/parameters.ts @@ -1,60 +1,93 @@ /* - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for - * license information. + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. * * 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 * as msRest from "@azure/ms-rest-js"; +import { + OperationParameter, + OperationURLParameter, + OperationQueryParameter +} from "@azure/core-client"; +import { + DataBoxEdgeDevice as DataBoxEdgeDeviceMapper, + DataBoxEdgeDevicePatch as DataBoxEdgeDevicePatchMapper, + SecuritySettings as SecuritySettingsMapper, + UploadCertificateRequest as UploadCertificateRequestMapper, + BandwidthSchedule as BandwidthScheduleMapper, + Order as OrderMapper, + Role as RoleMapper, + Share as ShareMapper, + StorageAccountCredential as StorageAccountCredentialMapper, + StorageAccount as StorageAccountMapper, + Container as ContainerMapper, + Trigger as TriggerMapper, + User as UserMapper +} from "../models/mappers"; -export const acceptLanguage: msRest.OperationParameter = { - parameterPath: "acceptLanguage", +export const accept: OperationParameter = { + parameterPath: "accept", mapper: { - serializedName: "accept-language", - defaultValue: 'en-US', + defaultValue: "application/json", + isConstant: true, + serializedName: "Accept", type: { name: "String" } } }; -export const apiVersion: msRest.OperationQueryParameter = { - parameterPath: "apiVersion", + +export const $host: OperationURLParameter = { + parameterPath: "$host", mapper: { + serializedName: "$host", required: true, + type: { + name: "String" + } + }, + skipEncoding: true +}; + +export const apiVersion: OperationQueryParameter = { + parameterPath: "apiVersion", + mapper: { + defaultValue: "2019-08-01", + isConstant: true, serializedName: "api-version", type: { name: "String" } } }; -export const containerName: msRest.OperationURLParameter = { - parameterPath: "containerName", + +export const nextLink: OperationURLParameter = { + parameterPath: "nextLink", mapper: { + serializedName: "nextLink", required: true, - serializedName: "containerName", type: { name: "String" } - } + }, + skipEncoding: true }; -export const deviceName: msRest.OperationURLParameter = { - parameterPath: "deviceName", + +export const subscriptionId: OperationURLParameter = { + parameterPath: "subscriptionId", mapper: { + serializedName: "subscriptionId", required: true, - serializedName: "deviceName", type: { name: "String" } } }; -export const expand: msRest.OperationQueryParameter = { - parameterPath: [ - "options", - "expand" - ], + +export const expand: OperationQueryParameter = { + parameterPath: ["options", "expand"], mapper: { serializedName: "$expand", type: { @@ -62,66 +95,145 @@ export const expand: msRest.OperationQueryParameter = { } } }; -export const filter: msRest.OperationQueryParameter = { - parameterPath: [ - "options", - "filter" - ], + +export const resourceGroupName: OperationURLParameter = { + parameterPath: "resourceGroupName", mapper: { - serializedName: "$filter", + serializedName: "resourceGroupName", + required: true, type: { name: "String" } } }; -export const name: msRest.OperationURLParameter = { - parameterPath: "name", + +export const deviceName: OperationURLParameter = { + parameterPath: "deviceName", mapper: { + serializedName: "deviceName", required: true, - serializedName: "name", type: { name: "String" } } }; -export const nextPageLink: msRest.OperationURLParameter = { - parameterPath: "nextPageLink", + +export const contentType: OperationParameter = { + parameterPath: ["options", "contentType"], mapper: { - required: true, - serializedName: "nextLink", + defaultValue: "application/json", + isConstant: true, + serializedName: "Content-Type", type: { name: "String" } - }, - skipEncoding: true + } }; -export const resourceGroupName: msRest.OperationURLParameter = { - parameterPath: "resourceGroupName", + +export const dataBoxEdgeDevice: OperationParameter = { + parameterPath: "dataBoxEdgeDevice", + mapper: DataBoxEdgeDeviceMapper +}; + +export const parameters: OperationParameter = { + parameterPath: "parameters", + mapper: DataBoxEdgeDevicePatchMapper +}; + +export const securitySettings: OperationParameter = { + parameterPath: "securitySettings", + mapper: SecuritySettingsMapper +}; + +export const parameters1: OperationParameter = { + parameterPath: "parameters", + mapper: UploadCertificateRequestMapper +}; + +export const name: OperationURLParameter = { + parameterPath: "name", mapper: { + serializedName: "name", required: true, - serializedName: "resourceGroupName", type: { name: "String" } } }; -export const storageAccountName: msRest.OperationURLParameter = { + +export const parameters2: OperationParameter = { + parameterPath: "parameters", + mapper: BandwidthScheduleMapper +}; + +export const order: OperationParameter = { + parameterPath: "order", + mapper: OrderMapper +}; + +export const role: OperationParameter = { + parameterPath: "role", + mapper: RoleMapper +}; + +export const share: OperationParameter = { + parameterPath: "share", + mapper: ShareMapper +}; + +export const storageAccountCredential: OperationParameter = { + parameterPath: "storageAccountCredential", + mapper: StorageAccountCredentialMapper +}; + +export const storageAccountName: OperationURLParameter = { parameterPath: "storageAccountName", mapper: { - required: true, serializedName: "storageAccountName", + required: true, type: { name: "String" } } }; -export const subscriptionId: msRest.OperationURLParameter = { - parameterPath: "subscriptionId", + +export const storageAccount: OperationParameter = { + parameterPath: "storageAccount", + mapper: StorageAccountMapper +}; + +export const containerName: OperationURLParameter = { + parameterPath: "containerName", mapper: { + serializedName: "containerName", required: true, - serializedName: "subscriptionId", type: { name: "String" } } }; + +export const container: OperationParameter = { + parameterPath: "container", + mapper: ContainerMapper +}; + +export const filter: OperationQueryParameter = { + parameterPath: ["options", "filter"], + mapper: { + serializedName: "$filter", + type: { + name: "String" + } + } +}; + +export const trigger: OperationParameter = { + parameterPath: "trigger", + mapper: TriggerMapper +}; + +export const user: OperationParameter = { + parameterPath: "user", + mapper: UserMapper +}; diff --git a/sdk/databoxedge/arm-databoxedge-profile-2020-09-01-hybrid/src/models/rolesMappers.ts b/sdk/databoxedge/arm-databoxedge-profile-2020-09-01-hybrid/src/models/rolesMappers.ts deleted file mode 100644 index cba36ea7003a..000000000000 --- a/sdk/databoxedge/arm-databoxedge-profile-2020-09-01-hybrid/src/models/rolesMappers.ts +++ /dev/null @@ -1,57 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for license information. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -export { - discriminators, - Address, - Alert, - AlertErrorDetails, - ARMBaseModel, - AsymmetricEncryptedSecret, - Authentication, - AzureContainerInfo, - BandwidthSchedule, - BaseResource, - ClientAccessRight, - CloudError, - ContactDetails, - Container, - DataBoxEdgeDevice, - DataBoxEdgeDeviceExtendedInfo, - FileEventTrigger, - FileSourceInfo, - IoTDeviceInfo, - IoTRole, - Ipv4Config, - Ipv6Config, - MountPointMap, - NetworkAdapter, - NetworkAdapterPosition, - NetworkSettings, - Node, - Order, - OrderStatus, - PeriodicTimerEventTrigger, - PeriodicTimerSourceInfo, - RefreshDetails, - Role, - RoleList, - RoleSinkInfo, - SecuritySettings, - Share, - ShareAccessRight, - Sku, - StorageAccount, - StorageAccountCredential, - SymmetricKey, - TrackingInfo, - Trigger, - UpdateSummary, - User, - UserAccessRight -} from "../models/mappers"; diff --git a/sdk/databoxedge/arm-databoxedge-profile-2020-09-01-hybrid/src/models/sharesMappers.ts b/sdk/databoxedge/arm-databoxedge-profile-2020-09-01-hybrid/src/models/sharesMappers.ts deleted file mode 100644 index 603f3c72edac..000000000000 --- a/sdk/databoxedge/arm-databoxedge-profile-2020-09-01-hybrid/src/models/sharesMappers.ts +++ /dev/null @@ -1,57 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for license information. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -export { - discriminators, - Address, - Alert, - AlertErrorDetails, - ARMBaseModel, - AsymmetricEncryptedSecret, - Authentication, - AzureContainerInfo, - BandwidthSchedule, - BaseResource, - ClientAccessRight, - CloudError, - ContactDetails, - Container, - DataBoxEdgeDevice, - DataBoxEdgeDeviceExtendedInfo, - FileEventTrigger, - FileSourceInfo, - IoTDeviceInfo, - IoTRole, - Ipv4Config, - Ipv6Config, - MountPointMap, - NetworkAdapter, - NetworkAdapterPosition, - NetworkSettings, - Node, - Order, - OrderStatus, - PeriodicTimerEventTrigger, - PeriodicTimerSourceInfo, - RefreshDetails, - Role, - RoleSinkInfo, - SecuritySettings, - Share, - ShareAccessRight, - ShareList, - Sku, - StorageAccount, - StorageAccountCredential, - SymmetricKey, - TrackingInfo, - Trigger, - UpdateSummary, - User, - UserAccessRight -} from "../models/mappers"; diff --git a/sdk/databoxedge/arm-databoxedge-profile-2020-09-01-hybrid/src/models/skusMappers.ts b/sdk/databoxedge/arm-databoxedge-profile-2020-09-01-hybrid/src/models/skusMappers.ts deleted file mode 100644 index bde0673c7017..000000000000 --- a/sdk/databoxedge/arm-databoxedge-profile-2020-09-01-hybrid/src/models/skusMappers.ts +++ /dev/null @@ -1,18 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for 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 { - discriminators, - CloudError, - ResourceTypeSku, - SkuCost, - SkuInformationList, - SkuLocationInfo, - SkuRestriction, - SkuRestrictionInfo -} from "../models/mappers"; diff --git a/sdk/databoxedge/arm-databoxedge-profile-2020-09-01-hybrid/src/models/storageAccountCredentialsMappers.ts b/sdk/databoxedge/arm-databoxedge-profile-2020-09-01-hybrid/src/models/storageAccountCredentialsMappers.ts deleted file mode 100644 index fe70da1500f3..000000000000 --- a/sdk/databoxedge/arm-databoxedge-profile-2020-09-01-hybrid/src/models/storageAccountCredentialsMappers.ts +++ /dev/null @@ -1,57 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for license information. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -export { - discriminators, - Address, - Alert, - AlertErrorDetails, - ARMBaseModel, - AsymmetricEncryptedSecret, - Authentication, - AzureContainerInfo, - BandwidthSchedule, - BaseResource, - ClientAccessRight, - CloudError, - ContactDetails, - Container, - DataBoxEdgeDevice, - DataBoxEdgeDeviceExtendedInfo, - FileEventTrigger, - FileSourceInfo, - IoTDeviceInfo, - IoTRole, - Ipv4Config, - Ipv6Config, - MountPointMap, - NetworkAdapter, - NetworkAdapterPosition, - NetworkSettings, - Node, - Order, - OrderStatus, - PeriodicTimerEventTrigger, - PeriodicTimerSourceInfo, - RefreshDetails, - Role, - RoleSinkInfo, - SecuritySettings, - Share, - ShareAccessRight, - Sku, - StorageAccount, - StorageAccountCredential, - StorageAccountCredentialList, - SymmetricKey, - TrackingInfo, - Trigger, - UpdateSummary, - User, - UserAccessRight -} from "../models/mappers"; diff --git a/sdk/databoxedge/arm-databoxedge-profile-2020-09-01-hybrid/src/models/storageAccountsMappers.ts b/sdk/databoxedge/arm-databoxedge-profile-2020-09-01-hybrid/src/models/storageAccountsMappers.ts deleted file mode 100644 index 75464d8d0b4f..000000000000 --- a/sdk/databoxedge/arm-databoxedge-profile-2020-09-01-hybrid/src/models/storageAccountsMappers.ts +++ /dev/null @@ -1,57 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for license information. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -export { - discriminators, - Address, - Alert, - AlertErrorDetails, - ARMBaseModel, - AsymmetricEncryptedSecret, - Authentication, - AzureContainerInfo, - BandwidthSchedule, - BaseResource, - ClientAccessRight, - CloudError, - ContactDetails, - Container, - DataBoxEdgeDevice, - DataBoxEdgeDeviceExtendedInfo, - FileEventTrigger, - FileSourceInfo, - IoTDeviceInfo, - IoTRole, - Ipv4Config, - Ipv6Config, - MountPointMap, - NetworkAdapter, - NetworkAdapterPosition, - NetworkSettings, - Node, - Order, - OrderStatus, - PeriodicTimerEventTrigger, - PeriodicTimerSourceInfo, - RefreshDetails, - Role, - RoleSinkInfo, - SecuritySettings, - Share, - ShareAccessRight, - Sku, - StorageAccount, - StorageAccountCredential, - StorageAccountList, - SymmetricKey, - TrackingInfo, - Trigger, - UpdateSummary, - User, - UserAccessRight -} from "../models/mappers"; diff --git a/sdk/databoxedge/arm-databoxedge-profile-2020-09-01-hybrid/src/models/triggersMappers.ts b/sdk/databoxedge/arm-databoxedge-profile-2020-09-01-hybrid/src/models/triggersMappers.ts deleted file mode 100644 index 6851ac5d88ac..000000000000 --- a/sdk/databoxedge/arm-databoxedge-profile-2020-09-01-hybrid/src/models/triggersMappers.ts +++ /dev/null @@ -1,57 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for license information. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -export { - discriminators, - Address, - Alert, - AlertErrorDetails, - ARMBaseModel, - AsymmetricEncryptedSecret, - Authentication, - AzureContainerInfo, - BandwidthSchedule, - BaseResource, - ClientAccessRight, - CloudError, - ContactDetails, - Container, - DataBoxEdgeDevice, - DataBoxEdgeDeviceExtendedInfo, - FileEventTrigger, - FileSourceInfo, - IoTDeviceInfo, - IoTRole, - Ipv4Config, - Ipv6Config, - MountPointMap, - NetworkAdapter, - NetworkAdapterPosition, - NetworkSettings, - Node, - Order, - OrderStatus, - PeriodicTimerEventTrigger, - PeriodicTimerSourceInfo, - RefreshDetails, - Role, - RoleSinkInfo, - SecuritySettings, - Share, - ShareAccessRight, - Sku, - StorageAccount, - StorageAccountCredential, - SymmetricKey, - TrackingInfo, - Trigger, - TriggerList, - UpdateSummary, - User, - UserAccessRight -} from "../models/mappers"; diff --git a/sdk/databoxedge/arm-databoxedge-profile-2020-09-01-hybrid/src/models/usersMappers.ts b/sdk/databoxedge/arm-databoxedge-profile-2020-09-01-hybrid/src/models/usersMappers.ts deleted file mode 100644 index f0d6bae872b2..000000000000 --- a/sdk/databoxedge/arm-databoxedge-profile-2020-09-01-hybrid/src/models/usersMappers.ts +++ /dev/null @@ -1,57 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for license information. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -export { - discriminators, - Address, - Alert, - AlertErrorDetails, - ARMBaseModel, - AsymmetricEncryptedSecret, - Authentication, - AzureContainerInfo, - BandwidthSchedule, - BaseResource, - ClientAccessRight, - CloudError, - ContactDetails, - Container, - DataBoxEdgeDevice, - DataBoxEdgeDeviceExtendedInfo, - FileEventTrigger, - FileSourceInfo, - IoTDeviceInfo, - IoTRole, - Ipv4Config, - Ipv6Config, - MountPointMap, - NetworkAdapter, - NetworkAdapterPosition, - NetworkSettings, - Node, - Order, - OrderStatus, - PeriodicTimerEventTrigger, - PeriodicTimerSourceInfo, - RefreshDetails, - Role, - RoleSinkInfo, - SecuritySettings, - Share, - ShareAccessRight, - Sku, - StorageAccount, - StorageAccountCredential, - SymmetricKey, - TrackingInfo, - Trigger, - UpdateSummary, - User, - UserAccessRight, - UserList -} from "../models/mappers"; diff --git a/sdk/databoxedge/arm-databoxedge-profile-2020-09-01-hybrid/src/operations/alerts.ts b/sdk/databoxedge/arm-databoxedge-profile-2020-09-01-hybrid/src/operations/alerts.ts index efee17c9614d..9a98ccbcd86a 100644 --- a/sdk/databoxedge/arm-databoxedge-profile-2020-09-01-hybrid/src/operations/alerts.ts +++ b/sdk/databoxedge/arm-databoxedge-profile-2020-09-01-hybrid/src/operations/alerts.ts @@ -1,28 +1,37 @@ /* - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for - * license information. + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. * * 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 * as msRest from "@azure/ms-rest-js"; -import * as Models from "../models"; -import * as Mappers from "../models/alertsMappers"; +import { PagedAsyncIterableIterator } from "@azure/core-paging"; +import { Alerts } from "../operationsInterfaces"; +import * as coreClient from "@azure/core-client"; +import * as Mappers from "../models/mappers"; import * as Parameters from "../models/parameters"; -import { DataBoxEdgeManagementClientContext } from "../dataBoxEdgeManagementClientContext"; +import { DataBoxEdgeManagementClient } from "../dataBoxEdgeManagementClient"; +import { + Alert, + AlertsListByDataBoxEdgeDeviceNextOptionalParams, + AlertsListByDataBoxEdgeDeviceOptionalParams, + AlertsListByDataBoxEdgeDeviceResponse, + AlertsGetOptionalParams, + AlertsGetResponse, + AlertsListByDataBoxEdgeDeviceNextResponse +} from "../models"; -/** Class representing a Alerts. */ -export class Alerts { - private readonly client: DataBoxEdgeManagementClientContext; +/// +/** Class containing Alerts operations. */ +export class AlertsImpl implements Alerts { + private readonly client: DataBoxEdgeManagementClient; /** - * Create a Alerts. - * @param {DataBoxEdgeManagementClientContext} client Reference to the service client. + * Initialize a new instance of the class Alerts class. + * @param client Reference to the service client */ - constructor(client: DataBoxEdgeManagementClientContext) { + constructor(client: DataBoxEdgeManagementClient) { this.client = client; } @@ -30,115 +39,136 @@ export class Alerts { * Gets all the alerts for a Data Box Edge/Data Box Gateway device. * @param deviceName The device name. * @param resourceGroupName The resource group name. - * @param [options] The optional parameters - * @returns Promise + * @param options The options parameters. */ - listByDataBoxEdgeDevice(deviceName: string, resourceGroupName: string, options?: msRest.RequestOptionsBase): Promise; - /** - * @param deviceName The device name. - * @param resourceGroupName The resource group name. - * @param callback The callback - */ - listByDataBoxEdgeDevice(deviceName: string, resourceGroupName: string, callback: msRest.ServiceCallback): void; - /** - * @param deviceName The device name. - * @param resourceGroupName The resource group name. - * @param options The optional parameters - * @param callback The callback - */ - listByDataBoxEdgeDevice(deviceName: string, resourceGroupName: string, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; - listByDataBoxEdgeDevice(deviceName: string, resourceGroupName: string, options?: msRest.RequestOptionsBase | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { - return this.client.sendOperationRequest( - { + public listByDataBoxEdgeDevice( + deviceName: string, + resourceGroupName: string, + options?: AlertsListByDataBoxEdgeDeviceOptionalParams + ): PagedAsyncIterableIterator { + const iter = this.listByDataBoxEdgeDevicePagingAll( + deviceName, + resourceGroupName, + options + ); + return { + next() { + return iter.next(); + }, + [Symbol.asyncIterator]() { + return this; + }, + byPage: () => { + return this.listByDataBoxEdgeDevicePagingPage( + deviceName, + resourceGroupName, + options + ); + } + }; + } + + private async *listByDataBoxEdgeDevicePagingPage( + deviceName: string, + resourceGroupName: string, + options?: AlertsListByDataBoxEdgeDeviceOptionalParams + ): AsyncIterableIterator { + let result = await this._listByDataBoxEdgeDevice( + deviceName, + resourceGroupName, + options + ); + yield result.value || []; + let continuationToken = result.nextLink; + while (continuationToken) { + result = await this._listByDataBoxEdgeDeviceNext( deviceName, resourceGroupName, + continuationToken, options - }, - listByDataBoxEdgeDeviceOperationSpec, - callback) as Promise; + ); + continuationToken = result.nextLink; + yield result.value || []; + } + } + + private async *listByDataBoxEdgeDevicePagingAll( + deviceName: string, + resourceGroupName: string, + options?: AlertsListByDataBoxEdgeDeviceOptionalParams + ): AsyncIterableIterator { + for await (const page of this.listByDataBoxEdgeDevicePagingPage( + deviceName, + resourceGroupName, + options + )) { + yield* page; + } } /** - * @summary Gets an alert by name. - * @param deviceName The device name. - * @param name The alert name. - * @param resourceGroupName The resource group name. - * @param [options] The optional parameters - * @returns Promise - */ - get(deviceName: string, name: string, resourceGroupName: string, options?: msRest.RequestOptionsBase): Promise; - /** + * Gets all the alerts for a Data Box Edge/Data Box Gateway device. * @param deviceName The device name. - * @param name The alert name. * @param resourceGroupName The resource group name. - * @param callback The callback + * @param options The options parameters. */ - get(deviceName: string, name: string, resourceGroupName: string, callback: msRest.ServiceCallback): void; + private _listByDataBoxEdgeDevice( + deviceName: string, + resourceGroupName: string, + options?: AlertsListByDataBoxEdgeDeviceOptionalParams + ): Promise { + return this.client.sendOperationRequest( + { deviceName, resourceGroupName, options }, + listByDataBoxEdgeDeviceOperationSpec + ); + } + /** + * Gets an alert by name. * @param deviceName The device name. * @param name The alert name. * @param resourceGroupName The resource group name. - * @param options The optional parameters - * @param callback The callback + * @param options The options parameters. */ - get(deviceName: string, name: string, resourceGroupName: string, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; - get(deviceName: string, name: string, resourceGroupName: string, options?: msRest.RequestOptionsBase | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { + get( + deviceName: string, + name: string, + resourceGroupName: string, + options?: AlertsGetOptionalParams + ): Promise { return this.client.sendOperationRequest( - { - deviceName, - name, - resourceGroupName, - options - }, - getOperationSpec, - callback) as Promise; + { deviceName, name, resourceGroupName, options }, + getOperationSpec + ); } /** - * Gets all the alerts for a Data Box Edge/Data Box Gateway device. - * @param nextPageLink The NextLink from the previous successful call to List operation. - * @param [options] The optional parameters - * @returns Promise - */ - listByDataBoxEdgeDeviceNext(nextPageLink: string, options?: msRest.RequestOptionsBase): Promise; - /** - * @param nextPageLink The NextLink from the previous successful call to List operation. - * @param callback The callback - */ - listByDataBoxEdgeDeviceNext(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 + * ListByDataBoxEdgeDeviceNext + * @param deviceName The device name. + * @param resourceGroupName The resource group name. + * @param nextLink The nextLink from the previous successful call to the ListByDataBoxEdgeDevice + * method. + * @param options The options parameters. */ - listByDataBoxEdgeDeviceNext(nextPageLink: string, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; - listByDataBoxEdgeDeviceNext(nextPageLink: string, options?: msRest.RequestOptionsBase | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { + private _listByDataBoxEdgeDeviceNext( + deviceName: string, + resourceGroupName: string, + nextLink: string, + options?: AlertsListByDataBoxEdgeDeviceNextOptionalParams + ): Promise { return this.client.sendOperationRequest( - { - nextPageLink, - options - }, - listByDataBoxEdgeDeviceNextOperationSpec, - callback) as Promise; + { deviceName, resourceGroupName, nextLink, options }, + listByDataBoxEdgeDeviceNextOperationSpec + ); } } - // Operation Specifications -const serializer = new msRest.Serializer(Mappers); -const listByDataBoxEdgeDeviceOperationSpec: msRest.OperationSpec = { +const serializer = coreClient.createSerializer(Mappers, /* isXml */ false); + +const listByDataBoxEdgeDeviceOperationSpec: coreClient.OperationSpec = { + path: + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/{deviceName}/alerts", httpMethod: "GET", - path: "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/{deviceName}/alerts", - urlParameters: [ - Parameters.deviceName, - Parameters.subscriptionId, - Parameters.resourceGroupName - ], - queryParameters: [ - Parameters.apiVersion - ], - headerParameters: [ - Parameters.acceptLanguage - ], responses: { 200: { bodyMapper: Mappers.AlertList @@ -147,24 +177,20 @@ const listByDataBoxEdgeDeviceOperationSpec: msRest.OperationSpec = { bodyMapper: Mappers.CloudError } }, - serializer -}; - -const getOperationSpec: msRest.OperationSpec = { - httpMethod: "GET", - path: "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/{deviceName}/alerts/{name}", + queryParameters: [Parameters.apiVersion], urlParameters: [ - Parameters.deviceName, - Parameters.name, + Parameters.$host, Parameters.subscriptionId, - Parameters.resourceGroupName - ], - queryParameters: [ - Parameters.apiVersion - ], - headerParameters: [ - Parameters.acceptLanguage + Parameters.resourceGroupName, + Parameters.deviceName ], + headerParameters: [Parameters.accept], + serializer +}; +const getOperationSpec: coreClient.OperationSpec = { + path: + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/{deviceName}/alerts/{name}", + httpMethod: "GET", responses: { 200: { bodyMapper: Mappers.Alert @@ -173,19 +199,20 @@ const getOperationSpec: msRest.OperationSpec = { bodyMapper: Mappers.CloudError } }, + queryParameters: [Parameters.apiVersion], + urlParameters: [ + Parameters.$host, + Parameters.subscriptionId, + Parameters.resourceGroupName, + Parameters.deviceName, + Parameters.name + ], + headerParameters: [Parameters.accept], serializer }; - -const listByDataBoxEdgeDeviceNextOperationSpec: msRest.OperationSpec = { - httpMethod: "GET", - baseUrl: "https://management.azure.com", +const listByDataBoxEdgeDeviceNextOperationSpec: coreClient.OperationSpec = { path: "{nextLink}", - urlParameters: [ - Parameters.nextPageLink - ], - headerParameters: [ - Parameters.acceptLanguage - ], + httpMethod: "GET", responses: { 200: { bodyMapper: Mappers.AlertList @@ -194,5 +221,14 @@ const listByDataBoxEdgeDeviceNextOperationSpec: msRest.OperationSpec = { bodyMapper: Mappers.CloudError } }, + queryParameters: [Parameters.apiVersion], + urlParameters: [ + Parameters.$host, + Parameters.nextLink, + Parameters.subscriptionId, + Parameters.resourceGroupName, + Parameters.deviceName + ], + headerParameters: [Parameters.accept], serializer }; diff --git a/sdk/databoxedge/arm-databoxedge-profile-2020-09-01-hybrid/src/operations/bandwidthSchedules.ts b/sdk/databoxedge/arm-databoxedge-profile-2020-09-01-hybrid/src/operations/bandwidthSchedules.ts index 7c4b6aea7abd..ea178140ca4f 100644 --- a/sdk/databoxedge/arm-databoxedge-profile-2020-09-01-hybrid/src/operations/bandwidthSchedules.ts +++ b/sdk/databoxedge/arm-databoxedge-profile-2020-09-01-hybrid/src/operations/bandwidthSchedules.ts @@ -1,29 +1,42 @@ /* - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for - * license information. + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. * * 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 * 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/bandwidthSchedulesMappers"; +import { PagedAsyncIterableIterator } from "@azure/core-paging"; +import { BandwidthSchedules } from "../operationsInterfaces"; +import * as coreClient from "@azure/core-client"; +import * as Mappers from "../models/mappers"; import * as Parameters from "../models/parameters"; -import { DataBoxEdgeManagementClientContext } from "../dataBoxEdgeManagementClientContext"; +import { DataBoxEdgeManagementClient } from "../dataBoxEdgeManagementClient"; +import { PollerLike, PollOperationState, LroEngine } from "@azure/core-lro"; +import { LroImpl } from "../lroImpl"; +import { + BandwidthSchedule, + BandwidthSchedulesListByDataBoxEdgeDeviceNextOptionalParams, + BandwidthSchedulesListByDataBoxEdgeDeviceOptionalParams, + BandwidthSchedulesListByDataBoxEdgeDeviceResponse, + BandwidthSchedulesGetOptionalParams, + BandwidthSchedulesGetResponse, + BandwidthSchedulesCreateOrUpdateOptionalParams, + BandwidthSchedulesCreateOrUpdateResponse, + BandwidthSchedulesDeleteOptionalParams, + BandwidthSchedulesListByDataBoxEdgeDeviceNextResponse +} from "../models"; -/** Class representing a BandwidthSchedules. */ -export class BandwidthSchedules { - private readonly client: DataBoxEdgeManagementClientContext; +/// +/** Class containing BandwidthSchedules operations. */ +export class BandwidthSchedulesImpl implements BandwidthSchedules { + private readonly client: DataBoxEdgeManagementClient; /** - * Create a BandwidthSchedules. - * @param {DataBoxEdgeManagementClientContext} client Reference to the service client. + * Initialize a new instance of the class BandwidthSchedules class. + * @param client Reference to the service client */ - constructor(client: DataBoxEdgeManagementClientContext) { + constructor(client: DataBoxEdgeManagementClient) { this.client = client; } @@ -31,117 +44,265 @@ export class BandwidthSchedules { * Gets all the bandwidth schedules for a Data Box Edge/Data Box Gateway device. * @param deviceName The device name. * @param resourceGroupName The resource group name. - * @param [options] The optional parameters - * @returns Promise + * @param options The options parameters. */ - listByDataBoxEdgeDevice(deviceName: string, resourceGroupName: string, options?: msRest.RequestOptionsBase): Promise; - /** - * @param deviceName The device name. - * @param resourceGroupName The resource group name. - * @param callback The callback - */ - listByDataBoxEdgeDevice(deviceName: string, resourceGroupName: string, callback: msRest.ServiceCallback): void; - /** - * @param deviceName The device name. - * @param resourceGroupName The resource group name. - * @param options The optional parameters - * @param callback The callback - */ - listByDataBoxEdgeDevice(deviceName: string, resourceGroupName: string, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; - listByDataBoxEdgeDevice(deviceName: string, resourceGroupName: string, options?: msRest.RequestOptionsBase | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { - return this.client.sendOperationRequest( - { + public listByDataBoxEdgeDevice( + deviceName: string, + resourceGroupName: string, + options?: BandwidthSchedulesListByDataBoxEdgeDeviceOptionalParams + ): PagedAsyncIterableIterator { + const iter = this.listByDataBoxEdgeDevicePagingAll( + deviceName, + resourceGroupName, + options + ); + return { + next() { + return iter.next(); + }, + [Symbol.asyncIterator]() { + return this; + }, + byPage: () => { + return this.listByDataBoxEdgeDevicePagingPage( + deviceName, + resourceGroupName, + options + ); + } + }; + } + + private async *listByDataBoxEdgeDevicePagingPage( + deviceName: string, + resourceGroupName: string, + options?: BandwidthSchedulesListByDataBoxEdgeDeviceOptionalParams + ): AsyncIterableIterator { + let result = await this._listByDataBoxEdgeDevice( + deviceName, + resourceGroupName, + options + ); + yield result.value || []; + let continuationToken = result.nextLink; + while (continuationToken) { + result = await this._listByDataBoxEdgeDeviceNext( deviceName, resourceGroupName, + continuationToken, options - }, - listByDataBoxEdgeDeviceOperationSpec, - callback) as Promise; + ); + continuationToken = result.nextLink; + yield result.value || []; + } + } + + private async *listByDataBoxEdgeDevicePagingAll( + deviceName: string, + resourceGroupName: string, + options?: BandwidthSchedulesListByDataBoxEdgeDeviceOptionalParams + ): AsyncIterableIterator { + for await (const page of this.listByDataBoxEdgeDevicePagingPage( + deviceName, + resourceGroupName, + options + )) { + yield* page; + } } /** - * Gets the properties of the specified bandwidth schedule. - * @param deviceName The device name. - * @param name The bandwidth schedule name. - * @param resourceGroupName The resource group name. - * @param [options] The optional parameters - * @returns Promise - */ - get(deviceName: string, name: string, resourceGroupName: string, options?: msRest.RequestOptionsBase): Promise; - /** + * Gets all the bandwidth schedules for a Data Box Edge/Data Box Gateway device. * @param deviceName The device name. - * @param name The bandwidth schedule name. * @param resourceGroupName The resource group name. - * @param callback The callback + * @param options The options parameters. */ - get(deviceName: string, name: string, resourceGroupName: string, callback: msRest.ServiceCallback): void; + private _listByDataBoxEdgeDevice( + deviceName: string, + resourceGroupName: string, + options?: BandwidthSchedulesListByDataBoxEdgeDeviceOptionalParams + ): Promise { + return this.client.sendOperationRequest( + { deviceName, resourceGroupName, options }, + listByDataBoxEdgeDeviceOperationSpec + ); + } + /** + * Gets the properties of the specified bandwidth schedule. * @param deviceName The device name. * @param name The bandwidth schedule name. * @param resourceGroupName The resource group name. - * @param options The optional parameters - * @param callback The callback + * @param options The options parameters. */ - get(deviceName: string, name: string, resourceGroupName: string, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; - get(deviceName: string, name: string, resourceGroupName: string, options?: msRest.RequestOptionsBase | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { + get( + deviceName: string, + name: string, + resourceGroupName: string, + options?: BandwidthSchedulesGetOptionalParams + ): Promise { return this.client.sendOperationRequest( - { - deviceName, - name, - resourceGroupName, - options - }, - getOperationSpec, - callback) as Promise; + { deviceName, name, resourceGroupName, options }, + getOperationSpec + ); } /** * Creates or updates a bandwidth schedule. * @param deviceName The device name. * @param name The bandwidth schedule name which needs to be added/updated. - * @param parameters The bandwidth schedule to be added or updated. * @param resourceGroupName The resource group name. - * @param [options] The optional parameters - * @returns Promise + * @param parameters The bandwidth schedule to be added or updated. + * @param options The options parameters. */ - createOrUpdate(deviceName: string, name: string, parameters: Models.BandwidthSchedule, resourceGroupName: string, options?: msRest.RequestOptionsBase): Promise { - return this.beginCreateOrUpdate(deviceName,name,parameters,resourceGroupName,options) - .then(lroPoller => lroPoller.pollUntilFinished()) as Promise; + async beginCreateOrUpdate( + deviceName: string, + name: string, + resourceGroupName: string, + parameters: BandwidthSchedule, + options?: BandwidthSchedulesCreateOrUpdateOptionalParams + ): Promise< + PollerLike< + PollOperationState, + BandwidthSchedulesCreateOrUpdateResponse + > + > { + const directSendOperation = async ( + args: coreClient.OperationArguments, + spec: coreClient.OperationSpec + ): Promise => { + return this.client.sendOperationRequest(args, spec); + }; + const sendOperation = async ( + args: coreClient.OperationArguments, + spec: coreClient.OperationSpec + ) => { + let currentRawResponse: + | coreClient.FullOperationResponse + | undefined = undefined; + const providedCallback = args.options?.onResponse; + const callback: coreClient.RawResponseCallback = ( + rawResponse: coreClient.FullOperationResponse, + flatResponse: unknown + ) => { + currentRawResponse = rawResponse; + providedCallback?.(rawResponse, flatResponse); + }; + const updatedArgs = { + ...args, + options: { + ...args.options, + onResponse: callback + } + }; + const flatResponse = await directSendOperation(updatedArgs, spec); + return { + flatResponse, + rawResponse: { + statusCode: currentRawResponse!.status, + body: currentRawResponse!.parsedBody, + headers: currentRawResponse!.headers.toJSON() + } + }; + }; + + const lro = new LroImpl( + sendOperation, + { deviceName, name, resourceGroupName, parameters, options }, + createOrUpdateOperationSpec + ); + return new LroEngine(lro, { + resumeFrom: options?.resumeFrom, + intervalInMs: options?.updateIntervalInMs + }); } /** - * Deletes the specified bandwidth schedule. + * Creates or updates a bandwidth schedule. * @param deviceName The device name. - * @param name The bandwidth schedule name. + * @param name The bandwidth schedule name which needs to be added/updated. * @param resourceGroupName The resource group name. - * @param [options] The optional parameters - * @returns Promise + * @param parameters The bandwidth schedule to be added or updated. + * @param options The options parameters. */ - deleteMethod(deviceName: string, name: string, resourceGroupName: string, options?: msRest.RequestOptionsBase): Promise { - return this.beginDeleteMethod(deviceName,name,resourceGroupName,options) - .then(lroPoller => lroPoller.pollUntilFinished()); + async beginCreateOrUpdateAndWait( + deviceName: string, + name: string, + resourceGroupName: string, + parameters: BandwidthSchedule, + options?: BandwidthSchedulesCreateOrUpdateOptionalParams + ): Promise { + const poller = await this.beginCreateOrUpdate( + deviceName, + name, + resourceGroupName, + parameters, + options + ); + return poller.pollUntilDone(); } /** - * Creates or updates a bandwidth schedule. + * Deletes the specified bandwidth schedule. * @param deviceName The device name. - * @param name The bandwidth schedule name which needs to be added/updated. - * @param parameters The bandwidth schedule to be added or updated. + * @param name The bandwidth schedule name. * @param resourceGroupName The resource group name. - * @param [options] The optional parameters - * @returns Promise + * @param options The options parameters. */ - beginCreateOrUpdate(deviceName: string, name: string, parameters: Models.BandwidthSchedule, resourceGroupName: string, options?: msRest.RequestOptionsBase): Promise { - return this.client.sendLRORequest( - { - deviceName, - name, - parameters, - resourceGroupName, - options - }, - beginCreateOrUpdateOperationSpec, - options); + async beginDelete( + deviceName: string, + name: string, + resourceGroupName: string, + options?: BandwidthSchedulesDeleteOptionalParams + ): Promise, void>> { + const directSendOperation = async ( + args: coreClient.OperationArguments, + spec: coreClient.OperationSpec + ): Promise => { + return this.client.sendOperationRequest(args, spec); + }; + const sendOperation = async ( + args: coreClient.OperationArguments, + spec: coreClient.OperationSpec + ) => { + let currentRawResponse: + | coreClient.FullOperationResponse + | undefined = undefined; + const providedCallback = args.options?.onResponse; + const callback: coreClient.RawResponseCallback = ( + rawResponse: coreClient.FullOperationResponse, + flatResponse: unknown + ) => { + currentRawResponse = rawResponse; + providedCallback?.(rawResponse, flatResponse); + }; + const updatedArgs = { + ...args, + options: { + ...args.options, + onResponse: callback + } + }; + const flatResponse = await directSendOperation(updatedArgs, spec); + return { + flatResponse, + rawResponse: { + statusCode: currentRawResponse!.status, + body: currentRawResponse!.parsedBody, + headers: currentRawResponse!.headers.toJSON() + } + }; + }; + + const lro = new LroImpl( + sendOperation, + { deviceName, name, resourceGroupName, options }, + deleteOperationSpec + ); + return new LroEngine(lro, { + resumeFrom: options?.resumeFrom, + intervalInMs: options?.updateIntervalInMs + }); } /** @@ -149,66 +310,50 @@ export class BandwidthSchedules { * @param deviceName The device name. * @param name The bandwidth schedule name. * @param resourceGroupName The resource group name. - * @param [options] The optional parameters - * @returns Promise + * @param options The options parameters. */ - beginDeleteMethod(deviceName: string, name: string, resourceGroupName: string, options?: msRest.RequestOptionsBase): Promise { - return this.client.sendLRORequest( - { - deviceName, - name, - resourceGroupName, - options - }, - beginDeleteMethodOperationSpec, - options); + async beginDeleteAndWait( + deviceName: string, + name: string, + resourceGroupName: string, + options?: BandwidthSchedulesDeleteOptionalParams + ): Promise { + const poller = await this.beginDelete( + deviceName, + name, + resourceGroupName, + options + ); + return poller.pollUntilDone(); } /** - * Gets all the bandwidth schedules for a Data Box Edge/Data Box Gateway device. - * @param nextPageLink The NextLink from the previous successful call to List operation. - * @param [options] The optional parameters - * @returns Promise - */ - listByDataBoxEdgeDeviceNext(nextPageLink: string, options?: msRest.RequestOptionsBase): Promise; - /** - * @param nextPageLink The NextLink from the previous successful call to List operation. - * @param callback The callback - */ - listByDataBoxEdgeDeviceNext(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 + * ListByDataBoxEdgeDeviceNext + * @param deviceName The device name. + * @param resourceGroupName The resource group name. + * @param nextLink The nextLink from the previous successful call to the ListByDataBoxEdgeDevice + * method. + * @param options The options parameters. */ - listByDataBoxEdgeDeviceNext(nextPageLink: string, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; - listByDataBoxEdgeDeviceNext(nextPageLink: string, options?: msRest.RequestOptionsBase | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { + private _listByDataBoxEdgeDeviceNext( + deviceName: string, + resourceGroupName: string, + nextLink: string, + options?: BandwidthSchedulesListByDataBoxEdgeDeviceNextOptionalParams + ): Promise { return this.client.sendOperationRequest( - { - nextPageLink, - options - }, - listByDataBoxEdgeDeviceNextOperationSpec, - callback) as Promise; + { deviceName, resourceGroupName, nextLink, options }, + listByDataBoxEdgeDeviceNextOperationSpec + ); } } - // Operation Specifications -const serializer = new msRest.Serializer(Mappers); -const listByDataBoxEdgeDeviceOperationSpec: msRest.OperationSpec = { +const serializer = coreClient.createSerializer(Mappers, /* isXml */ false); + +const listByDataBoxEdgeDeviceOperationSpec: coreClient.OperationSpec = { + path: + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/{deviceName}/bandwidthSchedules", httpMethod: "GET", - path: "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/{deviceName}/bandwidthSchedules", - urlParameters: [ - Parameters.deviceName, - Parameters.subscriptionId, - Parameters.resourceGroupName - ], - queryParameters: [ - Parameters.apiVersion - ], - headerParameters: [ - Parameters.acceptLanguage - ], responses: { 200: { bodyMapper: Mappers.BandwidthSchedulesList @@ -217,24 +362,20 @@ const listByDataBoxEdgeDeviceOperationSpec: msRest.OperationSpec = { bodyMapper: Mappers.CloudError } }, - serializer -}; - -const getOperationSpec: msRest.OperationSpec = { - httpMethod: "GET", - path: "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/{deviceName}/bandwidthSchedules/{name}", + queryParameters: [Parameters.apiVersion], urlParameters: [ - Parameters.deviceName, - Parameters.name, + Parameters.$host, Parameters.subscriptionId, - Parameters.resourceGroupName - ], - queryParameters: [ - Parameters.apiVersion - ], - headerParameters: [ - Parameters.acceptLanguage + Parameters.resourceGroupName, + Parameters.deviceName ], + headerParameters: [Parameters.accept], + serializer +}; +const getOperationSpec: coreClient.OperationSpec = { + path: + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/{deviceName}/bandwidthSchedules/{name}", + httpMethod: "GET", responses: { 200: { bodyMapper: Mappers.BandwidthSchedule @@ -243,79 +384,78 @@ const getOperationSpec: msRest.OperationSpec = { bodyMapper: Mappers.CloudError } }, - serializer -}; - -const beginCreateOrUpdateOperationSpec: msRest.OperationSpec = { - httpMethod: "PUT", - path: "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/{deviceName}/bandwidthSchedules/{name}", + queryParameters: [Parameters.apiVersion], urlParameters: [ - Parameters.deviceName, - Parameters.name, + Parameters.$host, Parameters.subscriptionId, - Parameters.resourceGroupName - ], - queryParameters: [ - Parameters.apiVersion - ], - headerParameters: [ - Parameters.acceptLanguage + Parameters.resourceGroupName, + Parameters.deviceName, + Parameters.name ], - requestBody: { - parameterPath: "parameters", - mapper: { - ...Mappers.BandwidthSchedule, - required: true - } - }, + headerParameters: [Parameters.accept], + serializer +}; +const createOrUpdateOperationSpec: coreClient.OperationSpec = { + path: + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/{deviceName}/bandwidthSchedules/{name}", + httpMethod: "PUT", responses: { 200: { bodyMapper: Mappers.BandwidthSchedule }, - 202: {}, + 201: { + bodyMapper: Mappers.BandwidthSchedule + }, + 202: { + bodyMapper: Mappers.BandwidthSchedule + }, + 204: { + bodyMapper: Mappers.BandwidthSchedule + }, default: { bodyMapper: Mappers.CloudError } }, - serializer -}; - -const beginDeleteMethodOperationSpec: msRest.OperationSpec = { - httpMethod: "DELETE", - path: "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/{deviceName}/bandwidthSchedules/{name}", + requestBody: Parameters.parameters2, + queryParameters: [Parameters.apiVersion], urlParameters: [ - Parameters.deviceName, - Parameters.name, + Parameters.$host, Parameters.subscriptionId, - Parameters.resourceGroupName - ], - queryParameters: [ - Parameters.apiVersion - ], - headerParameters: [ - Parameters.acceptLanguage + Parameters.resourceGroupName, + Parameters.deviceName, + Parameters.name ], + headerParameters: [Parameters.accept, Parameters.contentType], + mediaType: "json", + serializer +}; +const deleteOperationSpec: coreClient.OperationSpec = { + path: + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/{deviceName}/bandwidthSchedules/{name}", + httpMethod: "DELETE", responses: { 200: {}, + 201: {}, 202: {}, 204: {}, default: { bodyMapper: Mappers.CloudError } }, + queryParameters: [Parameters.apiVersion], + urlParameters: [ + Parameters.$host, + Parameters.subscriptionId, + Parameters.resourceGroupName, + Parameters.deviceName, + Parameters.name + ], + headerParameters: [Parameters.accept], serializer }; - -const listByDataBoxEdgeDeviceNextOperationSpec: msRest.OperationSpec = { - httpMethod: "GET", - baseUrl: "https://management.azure.com", +const listByDataBoxEdgeDeviceNextOperationSpec: coreClient.OperationSpec = { path: "{nextLink}", - urlParameters: [ - Parameters.nextPageLink - ], - headerParameters: [ - Parameters.acceptLanguage - ], + httpMethod: "GET", responses: { 200: { bodyMapper: Mappers.BandwidthSchedulesList @@ -324,5 +464,14 @@ const listByDataBoxEdgeDeviceNextOperationSpec: msRest.OperationSpec = { bodyMapper: Mappers.CloudError } }, + queryParameters: [Parameters.apiVersion], + urlParameters: [ + Parameters.$host, + Parameters.nextLink, + Parameters.subscriptionId, + Parameters.resourceGroupName, + Parameters.deviceName + ], + headerParameters: [Parameters.accept], serializer }; diff --git a/sdk/databoxedge/arm-databoxedge-profile-2020-09-01-hybrid/src/operations/containers.ts b/sdk/databoxedge/arm-databoxedge-profile-2020-09-01-hybrid/src/operations/containers.ts index 95e47ec04154..f39c0c4924c7 100644 --- a/sdk/databoxedge/arm-databoxedge-profile-2020-09-01-hybrid/src/operations/containers.ts +++ b/sdk/databoxedge/arm-databoxedge-profile-2020-09-01-hybrid/src/operations/containers.ts @@ -1,97 +1,160 @@ /* - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for - * license information. + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. * * 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 * 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/containersMappers"; +import { PagedAsyncIterableIterator } from "@azure/core-paging"; +import { Containers } from "../operationsInterfaces"; +import * as coreClient from "@azure/core-client"; +import * as Mappers from "../models/mappers"; import * as Parameters from "../models/parameters"; -import { DataBoxEdgeManagementClientContext } from "../dataBoxEdgeManagementClientContext"; +import { DataBoxEdgeManagementClient } from "../dataBoxEdgeManagementClient"; +import { PollerLike, PollOperationState, LroEngine } from "@azure/core-lro"; +import { LroImpl } from "../lroImpl"; +import { + Container, + ContainersListByStorageAccountNextOptionalParams, + ContainersListByStorageAccountOptionalParams, + ContainersListByStorageAccountResponse, + ContainersGetOptionalParams, + ContainersGetResponse, + ContainersCreateOrUpdateOptionalParams, + ContainersCreateOrUpdateResponse, + ContainersDeleteOptionalParams, + ContainersRefreshOptionalParams, + ContainersListByStorageAccountNextResponse +} from "../models"; -/** Class representing a Containers. */ -export class Containers { - private readonly client: DataBoxEdgeManagementClientContext; +/// +/** Class containing Containers operations. */ +export class ContainersImpl implements Containers { + private readonly client: DataBoxEdgeManagementClient; /** - * Create a Containers. - * @param {DataBoxEdgeManagementClientContext} client Reference to the service client. + * Initialize a new instance of the class Containers class. + * @param client Reference to the service client */ - constructor(client: DataBoxEdgeManagementClientContext) { + constructor(client: DataBoxEdgeManagementClient) { this.client = client; } /** - * @summary Lists all the containers of a storage Account in a Data Box Edge/Data Box Gateway - * device. + * Lists all the containers of a storage Account in a Data Box Edge/Data Box Gateway device. * @param deviceName The device name. * @param storageAccountName The storage Account name. * @param resourceGroupName The resource group name. - * @param [options] The optional parameters - * @returns Promise + * @param options The options parameters. */ - listByStorageAccount(deviceName: string, storageAccountName: string, resourceGroupName: string, options?: msRest.RequestOptionsBase): Promise; - /** - * @param deviceName The device name. - * @param storageAccountName The storage Account name. - * @param resourceGroupName The resource group name. - * @param callback The callback - */ - listByStorageAccount(deviceName: string, storageAccountName: string, resourceGroupName: string, callback: msRest.ServiceCallback): void; - /** - * @param deviceName The device name. - * @param storageAccountName The storage Account name. - * @param resourceGroupName The resource group name. - * @param options The optional parameters - * @param callback The callback - */ - listByStorageAccount(deviceName: string, storageAccountName: string, resourceGroupName: string, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; - listByStorageAccount(deviceName: string, storageAccountName: string, resourceGroupName: string, options?: msRest.RequestOptionsBase | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { - return this.client.sendOperationRequest( - { + public listByStorageAccount( + deviceName: string, + storageAccountName: string, + resourceGroupName: string, + options?: ContainersListByStorageAccountOptionalParams + ): PagedAsyncIterableIterator { + const iter = this.listByStorageAccountPagingAll( + deviceName, + storageAccountName, + resourceGroupName, + options + ); + return { + next() { + return iter.next(); + }, + [Symbol.asyncIterator]() { + return this; + }, + byPage: () => { + return this.listByStorageAccountPagingPage( + deviceName, + storageAccountName, + resourceGroupName, + options + ); + } + }; + } + + private async *listByStorageAccountPagingPage( + deviceName: string, + storageAccountName: string, + resourceGroupName: string, + options?: ContainersListByStorageAccountOptionalParams + ): AsyncIterableIterator { + let result = await this._listByStorageAccount( + deviceName, + storageAccountName, + resourceGroupName, + options + ); + yield result.value || []; + let continuationToken = result.nextLink; + while (continuationToken) { + result = await this._listByStorageAccountNext( deviceName, storageAccountName, resourceGroupName, + continuationToken, options - }, - listByStorageAccountOperationSpec, - callback) as Promise; + ); + continuationToken = result.nextLink; + yield result.value || []; + } + } + + private async *listByStorageAccountPagingAll( + deviceName: string, + storageAccountName: string, + resourceGroupName: string, + options?: ContainersListByStorageAccountOptionalParams + ): AsyncIterableIterator { + for await (const page of this.listByStorageAccountPagingPage( + deviceName, + storageAccountName, + resourceGroupName, + options + )) { + yield* page; + } } /** - * @summary Gets a container by name. - * @param deviceName The device name. - * @param storageAccountName The Storage Account Name - * @param containerName The container Name - * @param resourceGroupName The resource group name. - * @param [options] The optional parameters - * @returns Promise - */ - get(deviceName: string, storageAccountName: string, containerName: string, resourceGroupName: string, options?: msRest.RequestOptionsBase): Promise; - /** + * Lists all the containers of a storage Account in a Data Box Edge/Data Box Gateway device. * @param deviceName The device name. - * @param storageAccountName The Storage Account Name - * @param containerName The container Name + * @param storageAccountName The storage Account name. * @param resourceGroupName The resource group name. - * @param callback The callback + * @param options The options parameters. */ - get(deviceName: string, storageAccountName: string, containerName: string, resourceGroupName: string, callback: msRest.ServiceCallback): void; + private _listByStorageAccount( + deviceName: string, + storageAccountName: string, + resourceGroupName: string, + options?: ContainersListByStorageAccountOptionalParams + ): Promise { + return this.client.sendOperationRequest( + { deviceName, storageAccountName, resourceGroupName, options }, + listByStorageAccountOperationSpec + ); + } + /** + * Gets a container by name. * @param deviceName The device name. * @param storageAccountName The Storage Account Name * @param containerName The container Name * @param resourceGroupName The resource group name. - * @param options The optional parameters - * @param callback The callback + * @param options The options parameters. */ - get(deviceName: string, storageAccountName: string, containerName: string, resourceGroupName: string, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; - get(deviceName: string, storageAccountName: string, containerName: string, resourceGroupName: string, options?: msRest.RequestOptionsBase | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { + get( + deviceName: string, + storageAccountName: string, + containerName: string, + resourceGroupName: string, + options?: ContainersGetOptionalParams + ): Promise { return this.client.sendOperationRequest( { deviceName, @@ -100,75 +163,186 @@ export class Containers { resourceGroupName, options }, - getOperationSpec, - callback) as Promise; + getOperationSpec + ); } /** - * @summary Creates a new container or updates an existing container on the device. + * Creates a new container or updates an existing container on the device. * @param deviceName The device name. * @param storageAccountName The Storage Account Name * @param containerName The container name. - * @param container The container properties. * @param resourceGroupName The resource group name. - * @param [options] The optional parameters - * @returns Promise + * @param container The container properties. + * @param options The options parameters. */ - createOrUpdate(deviceName: string, storageAccountName: string, containerName: string, container: Models.Container, resourceGroupName: string, options?: msRest.RequestOptionsBase): Promise { - return this.beginCreateOrUpdate(deviceName,storageAccountName,containerName,container,resourceGroupName,options) - .then(lroPoller => lroPoller.pollUntilFinished()) as Promise; - } + async beginCreateOrUpdate( + deviceName: string, + storageAccountName: string, + containerName: string, + resourceGroupName: string, + container: Container, + options?: ContainersCreateOrUpdateOptionalParams + ): Promise< + PollerLike< + PollOperationState, + ContainersCreateOrUpdateResponse + > + > { + const directSendOperation = async ( + args: coreClient.OperationArguments, + spec: coreClient.OperationSpec + ): Promise => { + return this.client.sendOperationRequest(args, spec); + }; + const sendOperation = async ( + args: coreClient.OperationArguments, + spec: coreClient.OperationSpec + ) => { + let currentRawResponse: + | coreClient.FullOperationResponse + | undefined = undefined; + const providedCallback = args.options?.onResponse; + const callback: coreClient.RawResponseCallback = ( + rawResponse: coreClient.FullOperationResponse, + flatResponse: unknown + ) => { + currentRawResponse = rawResponse; + providedCallback?.(rawResponse, flatResponse); + }; + const updatedArgs = { + ...args, + options: { + ...args.options, + onResponse: callback + } + }; + const flatResponse = await directSendOperation(updatedArgs, spec); + return { + flatResponse, + rawResponse: { + statusCode: currentRawResponse!.status, + body: currentRawResponse!.parsedBody, + headers: currentRawResponse!.headers.toJSON() + } + }; + }; - /** - * Deletes the container on the Data Box Edge/Data Box Gateway device. - * @param deviceName The device name. - * @param storageAccountName The Storage Account Name - * @param containerName The container name. - * @param resourceGroupName The resource group name. - * @param [options] The optional parameters - * @returns Promise - */ - deleteMethod(deviceName: string, storageAccountName: string, containerName: string, resourceGroupName: string, options?: msRest.RequestOptionsBase): Promise { - return this.beginDeleteMethod(deviceName,storageAccountName,containerName,resourceGroupName,options) - .then(lroPoller => lroPoller.pollUntilFinished()); + const lro = new LroImpl( + sendOperation, + { + deviceName, + storageAccountName, + containerName, + resourceGroupName, + container, + options + }, + createOrUpdateOperationSpec + ); + return new LroEngine(lro, { + resumeFrom: options?.resumeFrom, + intervalInMs: options?.updateIntervalInMs + }); } /** - * @summary Refreshes the container metadata with the data from the cloud. + * Creates a new container or updates an existing container on the device. * @param deviceName The device name. * @param storageAccountName The Storage Account Name * @param containerName The container name. * @param resourceGroupName The resource group name. - * @param [options] The optional parameters - * @returns Promise + * @param container The container properties. + * @param options The options parameters. */ - refresh(deviceName: string, storageAccountName: string, containerName: string, resourceGroupName: string, options?: msRest.RequestOptionsBase): Promise { - return this.beginRefresh(deviceName,storageAccountName,containerName,resourceGroupName,options) - .then(lroPoller => lroPoller.pollUntilFinished()); + async beginCreateOrUpdateAndWait( + deviceName: string, + storageAccountName: string, + containerName: string, + resourceGroupName: string, + container: Container, + options?: ContainersCreateOrUpdateOptionalParams + ): Promise { + const poller = await this.beginCreateOrUpdate( + deviceName, + storageAccountName, + containerName, + resourceGroupName, + container, + options + ); + return poller.pollUntilDone(); } /** - * @summary Creates a new container or updates an existing container on the device. + * Deletes the container on the Data Box Edge/Data Box Gateway device. * @param deviceName The device name. * @param storageAccountName The Storage Account Name * @param containerName The container name. - * @param container The container properties. * @param resourceGroupName The resource group name. - * @param [options] The optional parameters - * @returns Promise + * @param options The options parameters. */ - beginCreateOrUpdate(deviceName: string, storageAccountName: string, containerName: string, container: Models.Container, resourceGroupName: string, options?: msRest.RequestOptionsBase): Promise { - return this.client.sendLRORequest( + async beginDelete( + deviceName: string, + storageAccountName: string, + containerName: string, + resourceGroupName: string, + options?: ContainersDeleteOptionalParams + ): Promise, void>> { + const directSendOperation = async ( + args: coreClient.OperationArguments, + spec: coreClient.OperationSpec + ): Promise => { + return this.client.sendOperationRequest(args, spec); + }; + const sendOperation = async ( + args: coreClient.OperationArguments, + spec: coreClient.OperationSpec + ) => { + let currentRawResponse: + | coreClient.FullOperationResponse + | undefined = undefined; + const providedCallback = args.options?.onResponse; + const callback: coreClient.RawResponseCallback = ( + rawResponse: coreClient.FullOperationResponse, + flatResponse: unknown + ) => { + currentRawResponse = rawResponse; + providedCallback?.(rawResponse, flatResponse); + }; + const updatedArgs = { + ...args, + options: { + ...args.options, + onResponse: callback + } + }; + const flatResponse = await directSendOperation(updatedArgs, spec); + return { + flatResponse, + rawResponse: { + statusCode: currentRawResponse!.status, + body: currentRawResponse!.parsedBody, + headers: currentRawResponse!.headers.toJSON() + } + }; + }; + + const lro = new LroImpl( + sendOperation, { deviceName, storageAccountName, containerName, - container, resourceGroupName, options }, - beginCreateOrUpdateOperationSpec, - options); + deleteOperationSpec + ); + return new LroEngine(lro, { + resumeFrom: options?.resumeFrom, + intervalInMs: options?.updateIntervalInMs + }); } /** @@ -177,33 +351,81 @@ export class Containers { * @param storageAccountName The Storage Account Name * @param containerName The container name. * @param resourceGroupName The resource group name. - * @param [options] The optional parameters - * @returns Promise + * @param options The options parameters. */ - beginDeleteMethod(deviceName: string, storageAccountName: string, containerName: string, resourceGroupName: string, options?: msRest.RequestOptionsBase): Promise { - return this.client.sendLRORequest( - { - deviceName, - storageAccountName, - containerName, - resourceGroupName, - options - }, - beginDeleteMethodOperationSpec, - options); + async beginDeleteAndWait( + deviceName: string, + storageAccountName: string, + containerName: string, + resourceGroupName: string, + options?: ContainersDeleteOptionalParams + ): Promise { + const poller = await this.beginDelete( + deviceName, + storageAccountName, + containerName, + resourceGroupName, + options + ); + return poller.pollUntilDone(); } /** - * @summary Refreshes the container metadata with the data from the cloud. + * Refreshes the container metadata with the data from the cloud. * @param deviceName The device name. * @param storageAccountName The Storage Account Name * @param containerName The container name. * @param resourceGroupName The resource group name. - * @param [options] The optional parameters - * @returns Promise + * @param options The options parameters. */ - beginRefresh(deviceName: string, storageAccountName: string, containerName: string, resourceGroupName: string, options?: msRest.RequestOptionsBase): Promise { - return this.client.sendLRORequest( + async beginRefresh( + deviceName: string, + storageAccountName: string, + containerName: string, + resourceGroupName: string, + options?: ContainersRefreshOptionalParams + ): Promise, void>> { + const directSendOperation = async ( + args: coreClient.OperationArguments, + spec: coreClient.OperationSpec + ): Promise => { + return this.client.sendOperationRequest(args, spec); + }; + const sendOperation = async ( + args: coreClient.OperationArguments, + spec: coreClient.OperationSpec + ) => { + let currentRawResponse: + | coreClient.FullOperationResponse + | undefined = undefined; + const providedCallback = args.options?.onResponse; + const callback: coreClient.RawResponseCallback = ( + rawResponse: coreClient.FullOperationResponse, + flatResponse: unknown + ) => { + currentRawResponse = rawResponse; + providedCallback?.(rawResponse, flatResponse); + }; + const updatedArgs = { + ...args, + options: { + ...args.options, + onResponse: callback + } + }; + const flatResponse = await directSendOperation(updatedArgs, spec); + return { + flatResponse, + rawResponse: { + statusCode: currentRawResponse!.status, + body: currentRawResponse!.parsedBody, + headers: currentRawResponse!.headers.toJSON() + } + }; + }; + + const lro = new LroImpl( + sendOperation, { deviceName, storageAccountName, @@ -211,57 +433,67 @@ export class Containers { resourceGroupName, options }, - beginRefreshOperationSpec, - options); + refreshOperationSpec + ); + return new LroEngine(lro, { + resumeFrom: options?.resumeFrom, + intervalInMs: options?.updateIntervalInMs + }); } /** - * @summary Lists all the containers of a storage Account in a Data Box Edge/Data Box Gateway - * device. - * @param nextPageLink The NextLink from the previous successful call to List operation. - * @param [options] The optional parameters - * @returns Promise - */ - listByStorageAccountNext(nextPageLink: string, options?: msRest.RequestOptionsBase): Promise; - /** - * @param nextPageLink The NextLink from the previous successful call to List operation. - * @param callback The callback + * Refreshes the container metadata with the data from the cloud. + * @param deviceName The device name. + * @param storageAccountName The Storage Account Name + * @param containerName The container name. + * @param resourceGroupName The resource group name. + * @param options The options parameters. */ - listByStorageAccountNext(nextPageLink: string, callback: msRest.ServiceCallback): void; + async beginRefreshAndWait( + deviceName: string, + storageAccountName: string, + containerName: string, + resourceGroupName: string, + options?: ContainersRefreshOptionalParams + ): Promise { + const poller = await this.beginRefresh( + deviceName, + storageAccountName, + containerName, + resourceGroupName, + options + ); + return poller.pollUntilDone(); + } + /** - * @param nextPageLink The NextLink from the previous successful call to List operation. - * @param options The optional parameters - * @param callback The callback + * ListByStorageAccountNext + * @param deviceName The device name. + * @param storageAccountName The storage Account name. + * @param resourceGroupName The resource group name. + * @param nextLink The nextLink from the previous successful call to the ListByStorageAccount method. + * @param options The options parameters. */ - listByStorageAccountNext(nextPageLink: string, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; - listByStorageAccountNext(nextPageLink: string, options?: msRest.RequestOptionsBase | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { + private _listByStorageAccountNext( + deviceName: string, + storageAccountName: string, + resourceGroupName: string, + nextLink: string, + options?: ContainersListByStorageAccountNextOptionalParams + ): Promise { return this.client.sendOperationRequest( - { - nextPageLink, - options - }, - listByStorageAccountNextOperationSpec, - callback) as Promise; + { deviceName, storageAccountName, resourceGroupName, nextLink, options }, + listByStorageAccountNextOperationSpec + ); } } - // Operation Specifications -const serializer = new msRest.Serializer(Mappers); -const listByStorageAccountOperationSpec: msRest.OperationSpec = { +const serializer = coreClient.createSerializer(Mappers, /* isXml */ false); + +const listByStorageAccountOperationSpec: coreClient.OperationSpec = { + path: + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/{deviceName}/storageAccounts/{storageAccountName}/containers", httpMethod: "GET", - path: "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/{deviceName}/storageAccounts/{storageAccountName}/containers", - urlParameters: [ - Parameters.deviceName, - Parameters.storageAccountName, - Parameters.subscriptionId, - Parameters.resourceGroupName - ], - queryParameters: [ - Parameters.apiVersion - ], - headerParameters: [ - Parameters.acceptLanguage - ], responses: { 200: { bodyMapper: Mappers.ContainerList @@ -270,25 +502,21 @@ const listByStorageAccountOperationSpec: msRest.OperationSpec = { bodyMapper: Mappers.CloudError } }, - serializer -}; - -const getOperationSpec: msRest.OperationSpec = { - httpMethod: "GET", - path: "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/{deviceName}/storageAccounts/{storageAccountName}/containers/{containerName}", + queryParameters: [Parameters.apiVersion], urlParameters: [ - Parameters.deviceName, - Parameters.storageAccountName, - Parameters.containerName, + Parameters.$host, Parameters.subscriptionId, - Parameters.resourceGroupName - ], - queryParameters: [ - Parameters.apiVersion - ], - headerParameters: [ - Parameters.acceptLanguage + Parameters.resourceGroupName, + Parameters.deviceName, + Parameters.storageAccountName ], + headerParameters: [Parameters.accept], + serializer +}; +const getOperationSpec: coreClient.OperationSpec = { + path: + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/{deviceName}/storageAccounts/{storageAccountName}/containers/{containerName}", + httpMethod: "GET", responses: { 200: { bodyMapper: Mappers.Container @@ -297,106 +525,106 @@ const getOperationSpec: msRest.OperationSpec = { bodyMapper: Mappers.CloudError } }, - serializer -}; - -const beginCreateOrUpdateOperationSpec: msRest.OperationSpec = { - httpMethod: "PUT", - path: "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/{deviceName}/storageAccounts/{storageAccountName}/containers/{containerName}", + queryParameters: [Parameters.apiVersion], urlParameters: [ + Parameters.$host, + Parameters.subscriptionId, + Parameters.resourceGroupName, Parameters.deviceName, Parameters.storageAccountName, - Parameters.containerName, - Parameters.subscriptionId, - Parameters.resourceGroupName - ], - queryParameters: [ - Parameters.apiVersion - ], - headerParameters: [ - Parameters.acceptLanguage + Parameters.containerName ], - requestBody: { - parameterPath: "container", - mapper: { - ...Mappers.Container, - required: true - } - }, + headerParameters: [Parameters.accept], + serializer +}; +const createOrUpdateOperationSpec: coreClient.OperationSpec = { + path: + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/{deviceName}/storageAccounts/{storageAccountName}/containers/{containerName}", + httpMethod: "PUT", responses: { 200: { bodyMapper: Mappers.Container }, - 202: {}, + 201: { + bodyMapper: Mappers.Container + }, + 202: { + bodyMapper: Mappers.Container + }, + 204: { + bodyMapper: Mappers.Container + }, default: { bodyMapper: Mappers.CloudError } }, - serializer -}; - -const beginDeleteMethodOperationSpec: msRest.OperationSpec = { - httpMethod: "DELETE", - path: "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/{deviceName}/storageAccounts/{storageAccountName}/containers/{containerName}", + requestBody: Parameters.container, + queryParameters: [Parameters.apiVersion], urlParameters: [ + Parameters.$host, + Parameters.subscriptionId, + Parameters.resourceGroupName, Parameters.deviceName, Parameters.storageAccountName, - Parameters.containerName, - Parameters.subscriptionId, - Parameters.resourceGroupName - ], - queryParameters: [ - Parameters.apiVersion - ], - headerParameters: [ - Parameters.acceptLanguage + Parameters.containerName ], + headerParameters: [Parameters.accept, Parameters.contentType], + mediaType: "json", + serializer +}; +const deleteOperationSpec: coreClient.OperationSpec = { + path: + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/{deviceName}/storageAccounts/{storageAccountName}/containers/{containerName}", + httpMethod: "DELETE", responses: { + 200: {}, + 201: {}, 202: {}, 204: {}, default: { bodyMapper: Mappers.CloudError } }, - serializer -}; - -const beginRefreshOperationSpec: msRest.OperationSpec = { - httpMethod: "POST", - path: "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/{deviceName}/storageAccounts/{storageAccountName}/containers/{containerName}/refresh", + queryParameters: [Parameters.apiVersion], urlParameters: [ + Parameters.$host, + Parameters.subscriptionId, + Parameters.resourceGroupName, Parameters.deviceName, Parameters.storageAccountName, - Parameters.containerName, - Parameters.subscriptionId, - Parameters.resourceGroupName - ], - queryParameters: [ - Parameters.apiVersion - ], - headerParameters: [ - Parameters.acceptLanguage + Parameters.containerName ], + headerParameters: [Parameters.accept], + serializer +}; +const refreshOperationSpec: coreClient.OperationSpec = { + path: + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/{deviceName}/storageAccounts/{storageAccountName}/containers/{containerName}/refresh", + httpMethod: "POST", responses: { 200: {}, + 201: {}, 202: {}, + 204: {}, default: { bodyMapper: Mappers.CloudError } }, + queryParameters: [Parameters.apiVersion], + urlParameters: [ + Parameters.$host, + Parameters.subscriptionId, + Parameters.resourceGroupName, + Parameters.deviceName, + Parameters.storageAccountName, + Parameters.containerName + ], + headerParameters: [Parameters.accept], serializer }; - -const listByStorageAccountNextOperationSpec: msRest.OperationSpec = { - httpMethod: "GET", - baseUrl: "https://management.azure.com", +const listByStorageAccountNextOperationSpec: coreClient.OperationSpec = { path: "{nextLink}", - urlParameters: [ - Parameters.nextPageLink - ], - headerParameters: [ - Parameters.acceptLanguage - ], + httpMethod: "GET", responses: { 200: { bodyMapper: Mappers.ContainerList @@ -405,5 +633,15 @@ const listByStorageAccountNextOperationSpec: msRest.OperationSpec = { bodyMapper: Mappers.CloudError } }, + queryParameters: [Parameters.apiVersion], + urlParameters: [ + Parameters.$host, + Parameters.nextLink, + Parameters.subscriptionId, + Parameters.resourceGroupName, + Parameters.deviceName, + Parameters.storageAccountName + ], + headerParameters: [Parameters.accept], serializer }; diff --git a/sdk/databoxedge/arm-databoxedge-profile-2020-09-01-hybrid/src/operations/devices.ts b/sdk/databoxedge/arm-databoxedge-profile-2020-09-01-hybrid/src/operations/devices.ts index e90235ad40f6..5d355031057c 100644 --- a/sdk/databoxedge/arm-databoxedge-profile-2020-09-01-hybrid/src/operations/devices.ts +++ b/sdk/databoxedge/arm-databoxedge-profile-2020-09-01-hybrid/src/operations/devices.ts @@ -1,543 +1,830 @@ /* - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for - * license information. + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. * * 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 * 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/devicesMappers"; +import { PagedAsyncIterableIterator } from "@azure/core-paging"; +import { Devices } from "../operationsInterfaces"; +import * as coreClient from "@azure/core-client"; +import * as Mappers from "../models/mappers"; import * as Parameters from "../models/parameters"; -import { DataBoxEdgeManagementClientContext } from "../dataBoxEdgeManagementClientContext"; +import { DataBoxEdgeManagementClient } from "../dataBoxEdgeManagementClient"; +import { PollerLike, PollOperationState, LroEngine } from "@azure/core-lro"; +import { LroImpl } from "../lroImpl"; +import { + DataBoxEdgeDevice, + DevicesListBySubscriptionNextOptionalParams, + DevicesListBySubscriptionOptionalParams, + DevicesListByResourceGroupNextOptionalParams, + DevicesListByResourceGroupOptionalParams, + DevicesListBySubscriptionResponse, + DevicesListByResourceGroupResponse, + DevicesGetOptionalParams, + DevicesGetResponse, + DevicesCreateOrUpdateOptionalParams, + DevicesCreateOrUpdateResponse, + DevicesDeleteOptionalParams, + DataBoxEdgeDevicePatch, + DevicesUpdateOptionalParams, + DevicesUpdateResponse, + DevicesDownloadUpdatesOptionalParams, + DevicesGetExtendedInformationOptionalParams, + DevicesGetExtendedInformationResponse, + DevicesInstallUpdatesOptionalParams, + DevicesGetNetworkSettingsOptionalParams, + DevicesGetNetworkSettingsResponse, + DevicesScanForUpdatesOptionalParams, + SecuritySettings, + DevicesCreateOrUpdateSecuritySettingsOptionalParams, + DevicesGetUpdateSummaryOptionalParams, + DevicesGetUpdateSummaryResponse, + UploadCertificateRequest, + DevicesUploadCertificateOptionalParams, + DevicesUploadCertificateResponse, + DevicesListBySubscriptionNextResponse, + DevicesListByResourceGroupNextResponse +} from "../models"; -/** Class representing a Devices. */ -export class Devices { - private readonly client: DataBoxEdgeManagementClientContext; +/// +/** Class containing Devices operations. */ +export class DevicesImpl implements Devices { + private readonly client: DataBoxEdgeManagementClient; /** - * Create a Devices. - * @param {DataBoxEdgeManagementClientContext} client Reference to the service client. + * Initialize a new instance of the class Devices class. + * @param client Reference to the service client */ - constructor(client: DataBoxEdgeManagementClientContext) { + constructor(client: DataBoxEdgeManagementClient) { this.client = client; } /** * Gets all the Data Box Edge/Data Box Gateway devices in a subscription. - * @param [options] The optional parameters - * @returns Promise + * @param options The options parameters. */ - listBySubscription(options?: Models.DevicesListBySubscriptionOptionalParams): Promise; - /** - * @param callback The callback - */ - listBySubscription(callback: msRest.ServiceCallback): void; - /** - * @param options The optional parameters - * @param callback The callback - */ - listBySubscription(options: Models.DevicesListBySubscriptionOptionalParams, callback: msRest.ServiceCallback): void; - listBySubscription(options?: Models.DevicesListBySubscriptionOptionalParams | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { - return this.client.sendOperationRequest( - { - options + public listBySubscription( + options?: DevicesListBySubscriptionOptionalParams + ): PagedAsyncIterableIterator { + const iter = this.listBySubscriptionPagingAll(options); + return { + next() { + return iter.next(); + }, + [Symbol.asyncIterator]() { + return this; }, - listBySubscriptionOperationSpec, - callback) as Promise; + byPage: () => { + return this.listBySubscriptionPagingPage(options); + } + }; + } + + private async *listBySubscriptionPagingPage( + options?: DevicesListBySubscriptionOptionalParams + ): AsyncIterableIterator { + let result = await this._listBySubscription(options); + yield result.value || []; + let continuationToken = result.nextLink; + while (continuationToken) { + result = await this._listBySubscriptionNext(continuationToken, options); + continuationToken = result.nextLink; + yield result.value || []; + } + } + + private async *listBySubscriptionPagingAll( + options?: DevicesListBySubscriptionOptionalParams + ): AsyncIterableIterator { + for await (const page of this.listBySubscriptionPagingPage(options)) { + yield* page; + } } /** * Gets all the Data Box Edge/Data Box Gateway devices in a resource group. * @param resourceGroupName The resource group name. - * @param [options] The optional parameters - * @returns Promise + * @param options The options parameters. */ - listByResourceGroup(resourceGroupName: string, options?: Models.DevicesListByResourceGroupOptionalParams): Promise; - /** - * @param resourceGroupName The resource group name. - * @param callback The callback - */ - listByResourceGroup(resourceGroupName: string, callback: msRest.ServiceCallback): void; - /** - * @param resourceGroupName The resource group name. - * @param options The optional parameters - * @param callback The callback - */ - listByResourceGroup(resourceGroupName: string, options: Models.DevicesListByResourceGroupOptionalParams, callback: msRest.ServiceCallback): void; - listByResourceGroup(resourceGroupName: string, options?: Models.DevicesListByResourceGroupOptionalParams | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { - return this.client.sendOperationRequest( - { - resourceGroupName, - options + public listByResourceGroup( + resourceGroupName: string, + options?: DevicesListByResourceGroupOptionalParams + ): PagedAsyncIterableIterator { + const iter = this.listByResourceGroupPagingAll(resourceGroupName, options); + return { + next() { + return iter.next(); }, - listByResourceGroupOperationSpec, - callback) as Promise; + [Symbol.asyncIterator]() { + return this; + }, + byPage: () => { + return this.listByResourceGroupPagingPage(resourceGroupName, options); + } + }; } - /** - * Gets the properties of the Data Box Edge/Data Box Gateway device. - * @param deviceName The device name. - * @param resourceGroupName The resource group name. - * @param [options] The optional parameters - * @returns Promise - */ - get(deviceName: string, resourceGroupName: string, options?: msRest.RequestOptionsBase): Promise; - /** - * @param deviceName The device name. - * @param resourceGroupName The resource group name. - * @param callback The callback - */ - get(deviceName: string, resourceGroupName: string, callback: msRest.ServiceCallback): void; - /** - * @param deviceName The device name. - * @param resourceGroupName The resource group name. - * @param options The optional parameters - * @param callback The callback - */ - get(deviceName: string, resourceGroupName: string, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; - get(deviceName: string, resourceGroupName: string, options?: msRest.RequestOptionsBase | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { - return this.client.sendOperationRequest( - { - deviceName, + private async *listByResourceGroupPagingPage( + resourceGroupName: string, + options?: DevicesListByResourceGroupOptionalParams + ): AsyncIterableIterator { + let result = await this._listByResourceGroup(resourceGroupName, options); + yield result.value || []; + let continuationToken = result.nextLink; + while (continuationToken) { + result = await this._listByResourceGroupNext( resourceGroupName, + continuationToken, options - }, - getOperationSpec, - callback) as Promise; + ); + continuationToken = result.nextLink; + yield result.value || []; + } } - /** - * Creates or updates a Data Box Edge/Data Box Gateway resource. - * @param deviceName The device name. - * @param dataBoxEdgeDevice The resource object. - * @param resourceGroupName The resource group name. - * @param [options] The optional parameters - * @returns Promise - */ - createOrUpdate(deviceName: string, dataBoxEdgeDevice: Models.DataBoxEdgeDevice, resourceGroupName: string, options?: msRest.RequestOptionsBase): Promise { - return this.beginCreateOrUpdate(deviceName,dataBoxEdgeDevice,resourceGroupName,options) - .then(lroPoller => lroPoller.pollUntilFinished()) as Promise; + private async *listByResourceGroupPagingAll( + resourceGroupName: string, + options?: DevicesListByResourceGroupOptionalParams + ): AsyncIterableIterator { + for await (const page of this.listByResourceGroupPagingPage( + resourceGroupName, + options + )) { + yield* page; + } } /** - * Deletes the Data Box Edge/Data Box Gateway device. - * @param deviceName The device name. - * @param resourceGroupName The resource group name. - * @param [options] The optional parameters - * @returns Promise + * Gets all the Data Box Edge/Data Box Gateway devices in a subscription. + * @param options The options parameters. */ - deleteMethod(deviceName: string, resourceGroupName: string, options?: msRest.RequestOptionsBase): Promise { - return this.beginDeleteMethod(deviceName,resourceGroupName,options) - .then(lroPoller => lroPoller.pollUntilFinished()); + private _listBySubscription( + options?: DevicesListBySubscriptionOptionalParams + ): Promise { + return this.client.sendOperationRequest( + { options }, + listBySubscriptionOperationSpec + ); } /** - * Modifies a Data Box Edge/Data Box Gateway resource. - * @param deviceName The device name. - * @param parameters The resource parameters. - * @param resourceGroupName The resource group name. - * @param [options] The optional parameters - * @returns Promise - */ - update(deviceName: string, parameters: Models.DataBoxEdgeDevicePatch, resourceGroupName: string, options?: msRest.RequestOptionsBase): Promise; - /** - * @param deviceName The device name. - * @param parameters The resource parameters. - * @param resourceGroupName The resource group name. - * @param callback The callback - */ - update(deviceName: string, parameters: Models.DataBoxEdgeDevicePatch, resourceGroupName: string, callback: msRest.ServiceCallback): void; - /** - * @param deviceName The device name. - * @param parameters The resource parameters. + * Gets all the Data Box Edge/Data Box Gateway devices in a resource group. * @param resourceGroupName The resource group name. - * @param options The optional parameters - * @param callback The callback + * @param options The options parameters. */ - update(deviceName: string, parameters: Models.DataBoxEdgeDevicePatch, resourceGroupName: string, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; - update(deviceName: string, parameters: Models.DataBoxEdgeDevicePatch, resourceGroupName: string, options?: msRest.RequestOptionsBase | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { + private _listByResourceGroup( + resourceGroupName: string, + options?: DevicesListByResourceGroupOptionalParams + ): Promise { return this.client.sendOperationRequest( - { - deviceName, - parameters, - resourceGroupName, - options - }, - updateOperationSpec, - callback) as Promise; + { resourceGroupName, options }, + listByResourceGroupOperationSpec + ); } /** - * @summary Downloads the updates on a Data Box Edge/Data Box Gateway device. + * Gets the properties of the Data Box Edge/Data Box Gateway device. * @param deviceName The device name. * @param resourceGroupName The resource group name. - * @param [options] The optional parameters - * @returns Promise + * @param options The options parameters. */ - downloadUpdates(deviceName: string, resourceGroupName: string, options?: msRest.RequestOptionsBase): Promise { - return this.beginDownloadUpdates(deviceName,resourceGroupName,options) - .then(lroPoller => lroPoller.pollUntilFinished()); + get( + deviceName: string, + resourceGroupName: string, + options?: DevicesGetOptionalParams + ): Promise { + return this.client.sendOperationRequest( + { deviceName, resourceGroupName, options }, + getOperationSpec + ); } /** - * Gets additional information for the specified Data Box Edge/Data Box Gateway device. - * @param deviceName The device name. - * @param resourceGroupName The resource group name. - * @param [options] The optional parameters - * @returns Promise - */ - getExtendedInformation(deviceName: string, resourceGroupName: string, options?: msRest.RequestOptionsBase): Promise; - /** - * @param deviceName The device name. - * @param resourceGroupName The resource group name. - * @param callback The callback - */ - getExtendedInformation(deviceName: string, resourceGroupName: string, callback: msRest.ServiceCallback): void; - /** + * Creates or updates a Data Box Edge/Data Box Gateway resource. * @param deviceName The device name. * @param resourceGroupName The resource group name. - * @param options The optional parameters - * @param callback The callback + * @param dataBoxEdgeDevice The resource object. + * @param options The options parameters. */ - getExtendedInformation(deviceName: string, resourceGroupName: string, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; - getExtendedInformation(deviceName: string, resourceGroupName: string, options?: msRest.RequestOptionsBase | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { - return this.client.sendOperationRequest( - { - deviceName, - resourceGroupName, - options - }, - getExtendedInformationOperationSpec, - callback) as Promise; + async beginCreateOrUpdate( + deviceName: string, + resourceGroupName: string, + dataBoxEdgeDevice: DataBoxEdgeDevice, + options?: DevicesCreateOrUpdateOptionalParams + ): Promise< + PollerLike< + PollOperationState, + DevicesCreateOrUpdateResponse + > + > { + const directSendOperation = async ( + args: coreClient.OperationArguments, + spec: coreClient.OperationSpec + ): Promise => { + return this.client.sendOperationRequest(args, spec); + }; + const sendOperation = async ( + args: coreClient.OperationArguments, + spec: coreClient.OperationSpec + ) => { + let currentRawResponse: + | coreClient.FullOperationResponse + | undefined = undefined; + const providedCallback = args.options?.onResponse; + const callback: coreClient.RawResponseCallback = ( + rawResponse: coreClient.FullOperationResponse, + flatResponse: unknown + ) => { + currentRawResponse = rawResponse; + providedCallback?.(rawResponse, flatResponse); + }; + const updatedArgs = { + ...args, + options: { + ...args.options, + onResponse: callback + } + }; + const flatResponse = await directSendOperation(updatedArgs, spec); + return { + flatResponse, + rawResponse: { + statusCode: currentRawResponse!.status, + body: currentRawResponse!.parsedBody, + headers: currentRawResponse!.headers.toJSON() + } + }; + }; + + const lro = new LroImpl( + sendOperation, + { deviceName, resourceGroupName, dataBoxEdgeDevice, options }, + createOrUpdateOperationSpec + ); + return new LroEngine(lro, { + resumeFrom: options?.resumeFrom, + intervalInMs: options?.updateIntervalInMs + }); } /** - * @summary Installs the updates on the Data Box Edge/Data Box Gateway device. + * Creates or updates a Data Box Edge/Data Box Gateway resource. * @param deviceName The device name. * @param resourceGroupName The resource group name. - * @param [options] The optional parameters - * @returns Promise + * @param dataBoxEdgeDevice The resource object. + * @param options The options parameters. */ - installUpdates(deviceName: string, resourceGroupName: string, options?: msRest.RequestOptionsBase): Promise { - return this.beginInstallUpdates(deviceName,resourceGroupName,options) - .then(lroPoller => lroPoller.pollUntilFinished()); + async beginCreateOrUpdateAndWait( + deviceName: string, + resourceGroupName: string, + dataBoxEdgeDevice: DataBoxEdgeDevice, + options?: DevicesCreateOrUpdateOptionalParams + ): Promise { + const poller = await this.beginCreateOrUpdate( + deviceName, + resourceGroupName, + dataBoxEdgeDevice, + options + ); + return poller.pollUntilDone(); } /** - * Gets the network settings of the specified Data Box Edge/Data Box Gateway device. + * Deletes the Data Box Edge/Data Box Gateway device. * @param deviceName The device name. * @param resourceGroupName The resource group name. - * @param [options] The optional parameters - * @returns Promise + * @param options The options parameters. */ - getNetworkSettings(deviceName: string, resourceGroupName: string, options?: msRest.RequestOptionsBase): Promise; + async beginDelete( + deviceName: string, + resourceGroupName: string, + options?: DevicesDeleteOptionalParams + ): Promise, void>> { + const directSendOperation = async ( + args: coreClient.OperationArguments, + spec: coreClient.OperationSpec + ): Promise => { + return this.client.sendOperationRequest(args, spec); + }; + const sendOperation = async ( + args: coreClient.OperationArguments, + spec: coreClient.OperationSpec + ) => { + let currentRawResponse: + | coreClient.FullOperationResponse + | undefined = undefined; + const providedCallback = args.options?.onResponse; + const callback: coreClient.RawResponseCallback = ( + rawResponse: coreClient.FullOperationResponse, + flatResponse: unknown + ) => { + currentRawResponse = rawResponse; + providedCallback?.(rawResponse, flatResponse); + }; + const updatedArgs = { + ...args, + options: { + ...args.options, + onResponse: callback + } + }; + const flatResponse = await directSendOperation(updatedArgs, spec); + return { + flatResponse, + rawResponse: { + statusCode: currentRawResponse!.status, + body: currentRawResponse!.parsedBody, + headers: currentRawResponse!.headers.toJSON() + } + }; + }; + + const lro = new LroImpl( + sendOperation, + { deviceName, resourceGroupName, options }, + deleteOperationSpec + ); + return new LroEngine(lro, { + resumeFrom: options?.resumeFrom, + intervalInMs: options?.updateIntervalInMs + }); + } + /** + * Deletes the Data Box Edge/Data Box Gateway device. * @param deviceName The device name. * @param resourceGroupName The resource group name. - * @param callback The callback + * @param options The options parameters. */ - getNetworkSettings(deviceName: string, resourceGroupName: string, callback: msRest.ServiceCallback): void; + async beginDeleteAndWait( + deviceName: string, + resourceGroupName: string, + options?: DevicesDeleteOptionalParams + ): Promise { + const poller = await this.beginDelete( + deviceName, + resourceGroupName, + options + ); + return poller.pollUntilDone(); + } + /** + * Modifies a Data Box Edge/Data Box Gateway resource. * @param deviceName The device name. * @param resourceGroupName The resource group name. - * @param options The optional parameters - * @param callback The callback + * @param parameters The resource parameters. + * @param options The options parameters. */ - getNetworkSettings(deviceName: string, resourceGroupName: string, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; - getNetworkSettings(deviceName: string, resourceGroupName: string, options?: msRest.RequestOptionsBase | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { + update( + deviceName: string, + resourceGroupName: string, + parameters: DataBoxEdgeDevicePatch, + options?: DevicesUpdateOptionalParams + ): Promise { return this.client.sendOperationRequest( - { - deviceName, - resourceGroupName, - options - }, - getNetworkSettingsOperationSpec, - callback) as Promise; + { deviceName, resourceGroupName, parameters, options }, + updateOperationSpec + ); } /** - * @summary Scans for updates on a Data Box Edge/Data Box Gateway device. + * Downloads the updates on a Data Box Edge/Data Box Gateway device. * @param deviceName The device name. * @param resourceGroupName The resource group name. - * @param [options] The optional parameters - * @returns Promise + * @param options The options parameters. */ - scanForUpdates(deviceName: string, resourceGroupName: string, options?: msRest.RequestOptionsBase): Promise { - return this.beginScanForUpdates(deviceName,resourceGroupName,options) - .then(lroPoller => lroPoller.pollUntilFinished()); + async beginDownloadUpdates( + deviceName: string, + resourceGroupName: string, + options?: DevicesDownloadUpdatesOptionalParams + ): Promise, void>> { + const directSendOperation = async ( + args: coreClient.OperationArguments, + spec: coreClient.OperationSpec + ): Promise => { + return this.client.sendOperationRequest(args, spec); + }; + const sendOperation = async ( + args: coreClient.OperationArguments, + spec: coreClient.OperationSpec + ) => { + let currentRawResponse: + | coreClient.FullOperationResponse + | undefined = undefined; + const providedCallback = args.options?.onResponse; + const callback: coreClient.RawResponseCallback = ( + rawResponse: coreClient.FullOperationResponse, + flatResponse: unknown + ) => { + currentRawResponse = rawResponse; + providedCallback?.(rawResponse, flatResponse); + }; + const updatedArgs = { + ...args, + options: { + ...args.options, + onResponse: callback + } + }; + const flatResponse = await directSendOperation(updatedArgs, spec); + return { + flatResponse, + rawResponse: { + statusCode: currentRawResponse!.status, + body: currentRawResponse!.parsedBody, + headers: currentRawResponse!.headers.toJSON() + } + }; + }; + + const lro = new LroImpl( + sendOperation, + { deviceName, resourceGroupName, options }, + downloadUpdatesOperationSpec + ); + return new LroEngine(lro, { + resumeFrom: options?.resumeFrom, + intervalInMs: options?.updateIntervalInMs + }); } /** - * Updates the security settings on a Data Box Edge/Data Box Gateway device. + * Downloads the updates on a Data Box Edge/Data Box Gateway device. * @param deviceName The device name. - * @param securitySettings The security settings. * @param resourceGroupName The resource group name. - * @param [options] The optional parameters - * @returns Promise + * @param options The options parameters. */ - createOrUpdateSecuritySettings(deviceName: string, securitySettings: Models.SecuritySettings, resourceGroupName: string, options?: msRest.RequestOptionsBase): Promise { - return this.beginCreateOrUpdateSecuritySettings(deviceName,securitySettings,resourceGroupName,options) - .then(lroPoller => lroPoller.pollUntilFinished()); + async beginDownloadUpdatesAndWait( + deviceName: string, + resourceGroupName: string, + options?: DevicesDownloadUpdatesOptionalParams + ): Promise { + const poller = await this.beginDownloadUpdates( + deviceName, + resourceGroupName, + options + ); + return poller.pollUntilDone(); } /** - * @summary Gets information about the availability of updates based on the last scan of the - * device. It also gets information about any ongoing download or install jobs on the device. - * @param deviceName The device name. - * @param resourceGroupName The resource group name. - * @param [options] The optional parameters - * @returns Promise - */ - getUpdateSummary(deviceName: string, resourceGroupName: string, options?: msRest.RequestOptionsBase): Promise; - /** - * @param deviceName The device name. - * @param resourceGroupName The resource group name. - * @param callback The callback - */ - getUpdateSummary(deviceName: string, resourceGroupName: string, callback: msRest.ServiceCallback): void; - /** + * Gets additional information for the specified Data Box Edge/Data Box Gateway device. * @param deviceName The device name. * @param resourceGroupName The resource group name. - * @param options The optional parameters - * @param callback The callback + * @param options The options parameters. */ - getUpdateSummary(deviceName: string, resourceGroupName: string, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; - getUpdateSummary(deviceName: string, resourceGroupName: string, options?: msRest.RequestOptionsBase | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { + getExtendedInformation( + deviceName: string, + resourceGroupName: string, + options?: DevicesGetExtendedInformationOptionalParams + ): Promise { return this.client.sendOperationRequest( - { - deviceName, - resourceGroupName, - options - }, - getUpdateSummaryOperationSpec, - callback) as Promise; + { deviceName, resourceGroupName, options }, + getExtendedInformationOperationSpec + ); } /** - * Uploads registration certificate for the device. + * Installs the updates on the Data Box Edge/Data Box Gateway device. * @param deviceName The device name. - * @param parameters The upload certificate request. * @param resourceGroupName The resource group name. - * @param [options] The optional parameters - * @returns Promise + * @param options The options parameters. */ - uploadCertificate(deviceName: string, parameters: Models.UploadCertificateRequest, resourceGroupName: string, options?: msRest.RequestOptionsBase): Promise; + async beginInstallUpdates( + deviceName: string, + resourceGroupName: string, + options?: DevicesInstallUpdatesOptionalParams + ): Promise, void>> { + const directSendOperation = async ( + args: coreClient.OperationArguments, + spec: coreClient.OperationSpec + ): Promise => { + return this.client.sendOperationRequest(args, spec); + }; + const sendOperation = async ( + args: coreClient.OperationArguments, + spec: coreClient.OperationSpec + ) => { + let currentRawResponse: + | coreClient.FullOperationResponse + | undefined = undefined; + const providedCallback = args.options?.onResponse; + const callback: coreClient.RawResponseCallback = ( + rawResponse: coreClient.FullOperationResponse, + flatResponse: unknown + ) => { + currentRawResponse = rawResponse; + providedCallback?.(rawResponse, flatResponse); + }; + const updatedArgs = { + ...args, + options: { + ...args.options, + onResponse: callback + } + }; + const flatResponse = await directSendOperation(updatedArgs, spec); + return { + flatResponse, + rawResponse: { + statusCode: currentRawResponse!.status, + body: currentRawResponse!.parsedBody, + headers: currentRawResponse!.headers.toJSON() + } + }; + }; + + const lro = new LroImpl( + sendOperation, + { deviceName, resourceGroupName, options }, + installUpdatesOperationSpec + ); + return new LroEngine(lro, { + resumeFrom: options?.resumeFrom, + intervalInMs: options?.updateIntervalInMs + }); + } + /** + * Installs the updates on the Data Box Edge/Data Box Gateway device. * @param deviceName The device name. - * @param parameters The upload certificate request. * @param resourceGroupName The resource group name. - * @param callback The callback + * @param options The options parameters. */ - uploadCertificate(deviceName: string, parameters: Models.UploadCertificateRequest, resourceGroupName: string, callback: msRest.ServiceCallback): void; + async beginInstallUpdatesAndWait( + deviceName: string, + resourceGroupName: string, + options?: DevicesInstallUpdatesOptionalParams + ): Promise { + const poller = await this.beginInstallUpdates( + deviceName, + resourceGroupName, + options + ); + return poller.pollUntilDone(); + } + /** + * Gets the network settings of the specified Data Box Edge/Data Box Gateway device. * @param deviceName The device name. - * @param parameters The upload certificate request. * @param resourceGroupName The resource group name. - * @param options The optional parameters - * @param callback The callback + * @param options The options parameters. */ - uploadCertificate(deviceName: string, parameters: Models.UploadCertificateRequest, resourceGroupName: string, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; - uploadCertificate(deviceName: string, parameters: Models.UploadCertificateRequest, resourceGroupName: string, options?: msRest.RequestOptionsBase | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { + getNetworkSettings( + deviceName: string, + resourceGroupName: string, + options?: DevicesGetNetworkSettingsOptionalParams + ): Promise { return this.client.sendOperationRequest( - { - deviceName, - parameters, - resourceGroupName, - options - }, - uploadCertificateOperationSpec, - callback) as Promise; + { deviceName, resourceGroupName, options }, + getNetworkSettingsOperationSpec + ); } /** - * Creates or updates a Data Box Edge/Data Box Gateway resource. + * Scans for updates on a Data Box Edge/Data Box Gateway device. * @param deviceName The device name. - * @param dataBoxEdgeDevice The resource object. * @param resourceGroupName The resource group name. - * @param [options] The optional parameters - * @returns Promise + * @param options The options parameters. */ - beginCreateOrUpdate(deviceName: string, dataBoxEdgeDevice: Models.DataBoxEdgeDevice, resourceGroupName: string, options?: msRest.RequestOptionsBase): Promise { - return this.client.sendLRORequest( - { - deviceName, - dataBoxEdgeDevice, - resourceGroupName, - options - }, - beginCreateOrUpdateOperationSpec, - options); + async beginScanForUpdates( + deviceName: string, + resourceGroupName: string, + options?: DevicesScanForUpdatesOptionalParams + ): Promise, void>> { + const directSendOperation = async ( + args: coreClient.OperationArguments, + spec: coreClient.OperationSpec + ): Promise => { + return this.client.sendOperationRequest(args, spec); + }; + const sendOperation = async ( + args: coreClient.OperationArguments, + spec: coreClient.OperationSpec + ) => { + let currentRawResponse: + | coreClient.FullOperationResponse + | undefined = undefined; + const providedCallback = args.options?.onResponse; + const callback: coreClient.RawResponseCallback = ( + rawResponse: coreClient.FullOperationResponse, + flatResponse: unknown + ) => { + currentRawResponse = rawResponse; + providedCallback?.(rawResponse, flatResponse); + }; + const updatedArgs = { + ...args, + options: { + ...args.options, + onResponse: callback + } + }; + const flatResponse = await directSendOperation(updatedArgs, spec); + return { + flatResponse, + rawResponse: { + statusCode: currentRawResponse!.status, + body: currentRawResponse!.parsedBody, + headers: currentRawResponse!.headers.toJSON() + } + }; + }; + + const lro = new LroImpl( + sendOperation, + { deviceName, resourceGroupName, options }, + scanForUpdatesOperationSpec + ); + return new LroEngine(lro, { + resumeFrom: options?.resumeFrom, + intervalInMs: options?.updateIntervalInMs + }); } /** - * Deletes the Data Box Edge/Data Box Gateway device. + * Scans for updates on a Data Box Edge/Data Box Gateway device. * @param deviceName The device name. * @param resourceGroupName The resource group name. - * @param [options] The optional parameters - * @returns Promise + * @param options The options parameters. */ - beginDeleteMethod(deviceName: string, resourceGroupName: string, options?: msRest.RequestOptionsBase): Promise { - return this.client.sendLRORequest( - { - deviceName, - resourceGroupName, - options - }, - beginDeleteMethodOperationSpec, - options); + async beginScanForUpdatesAndWait( + deviceName: string, + resourceGroupName: string, + options?: DevicesScanForUpdatesOptionalParams + ): Promise { + const poller = await this.beginScanForUpdates( + deviceName, + resourceGroupName, + options + ); + return poller.pollUntilDone(); } /** - * @summary Downloads the updates on a Data Box Edge/Data Box Gateway device. + * Updates the security settings on a Data Box Edge/Data Box Gateway device. * @param deviceName The device name. * @param resourceGroupName The resource group name. - * @param [options] The optional parameters - * @returns Promise + * @param securitySettings The security settings. + * @param options The options parameters. */ - beginDownloadUpdates(deviceName: string, resourceGroupName: string, options?: msRest.RequestOptionsBase): Promise { - return this.client.sendLRORequest( - { - deviceName, - resourceGroupName, - options - }, - beginDownloadUpdatesOperationSpec, - options); + async beginCreateOrUpdateSecuritySettings( + deviceName: string, + resourceGroupName: string, + securitySettings: SecuritySettings, + options?: DevicesCreateOrUpdateSecuritySettingsOptionalParams + ): Promise, void>> { + const directSendOperation = async ( + args: coreClient.OperationArguments, + spec: coreClient.OperationSpec + ): Promise => { + return this.client.sendOperationRequest(args, spec); + }; + const sendOperation = async ( + args: coreClient.OperationArguments, + spec: coreClient.OperationSpec + ) => { + let currentRawResponse: + | coreClient.FullOperationResponse + | undefined = undefined; + const providedCallback = args.options?.onResponse; + const callback: coreClient.RawResponseCallback = ( + rawResponse: coreClient.FullOperationResponse, + flatResponse: unknown + ) => { + currentRawResponse = rawResponse; + providedCallback?.(rawResponse, flatResponse); + }; + const updatedArgs = { + ...args, + options: { + ...args.options, + onResponse: callback + } + }; + const flatResponse = await directSendOperation(updatedArgs, spec); + return { + flatResponse, + rawResponse: { + statusCode: currentRawResponse!.status, + body: currentRawResponse!.parsedBody, + headers: currentRawResponse!.headers.toJSON() + } + }; + }; + + const lro = new LroImpl( + sendOperation, + { deviceName, resourceGroupName, securitySettings, options }, + createOrUpdateSecuritySettingsOperationSpec + ); + return new LroEngine(lro, { + resumeFrom: options?.resumeFrom, + intervalInMs: options?.updateIntervalInMs + }); } /** - * @summary Installs the updates on the Data Box Edge/Data Box Gateway device. + * Updates the security settings on a Data Box Edge/Data Box Gateway device. * @param deviceName The device name. * @param resourceGroupName The resource group name. - * @param [options] The optional parameters - * @returns Promise + * @param securitySettings The security settings. + * @param options The options parameters. */ - beginInstallUpdates(deviceName: string, resourceGroupName: string, options?: msRest.RequestOptionsBase): Promise { - return this.client.sendLRORequest( - { - deviceName, - resourceGroupName, - options - }, - beginInstallUpdatesOperationSpec, - options); + async beginCreateOrUpdateSecuritySettingsAndWait( + deviceName: string, + resourceGroupName: string, + securitySettings: SecuritySettings, + options?: DevicesCreateOrUpdateSecuritySettingsOptionalParams + ): Promise { + const poller = await this.beginCreateOrUpdateSecuritySettings( + deviceName, + resourceGroupName, + securitySettings, + options + ); + return poller.pollUntilDone(); } /** - * @summary Scans for updates on a Data Box Edge/Data Box Gateway device. + * Gets information about the availability of updates based on the last scan of the device. It also + * gets information about any ongoing download or install jobs on the device. * @param deviceName The device name. * @param resourceGroupName The resource group name. - * @param [options] The optional parameters - * @returns Promise + * @param options The options parameters. */ - beginScanForUpdates(deviceName: string, resourceGroupName: string, options?: msRest.RequestOptionsBase): Promise { - return this.client.sendLRORequest( - { - deviceName, - resourceGroupName, - options - }, - beginScanForUpdatesOperationSpec, - options); + getUpdateSummary( + deviceName: string, + resourceGroupName: string, + options?: DevicesGetUpdateSummaryOptionalParams + ): Promise { + return this.client.sendOperationRequest( + { deviceName, resourceGroupName, options }, + getUpdateSummaryOperationSpec + ); } /** - * Updates the security settings on a Data Box Edge/Data Box Gateway device. + * Uploads registration certificate for the device. * @param deviceName The device name. - * @param securitySettings The security settings. * @param resourceGroupName The resource group name. - * @param [options] The optional parameters - * @returns Promise + * @param parameters The upload certificate request. + * @param options The options parameters. */ - beginCreateOrUpdateSecuritySettings(deviceName: string, securitySettings: Models.SecuritySettings, resourceGroupName: string, options?: msRest.RequestOptionsBase): Promise { - return this.client.sendLRORequest( - { - deviceName, - securitySettings, - resourceGroupName, - options - }, - beginCreateOrUpdateSecuritySettingsOperationSpec, - options); + uploadCertificate( + deviceName: string, + resourceGroupName: string, + parameters: UploadCertificateRequest, + options?: DevicesUploadCertificateOptionalParams + ): Promise { + return this.client.sendOperationRequest( + { deviceName, resourceGroupName, parameters, options }, + uploadCertificateOperationSpec + ); } /** - * Gets all the Data Box Edge/Data Box Gateway devices in a subscription. - * @param nextPageLink The NextLink from the previous successful call to List operation. - * @param [options] The optional parameters - * @returns Promise - */ - listBySubscriptionNext(nextPageLink: string, options?: msRest.RequestOptionsBase): Promise; - /** - * @param nextPageLink The NextLink from the previous successful call to List operation. - * @param callback The callback - */ - listBySubscriptionNext(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 + * ListBySubscriptionNext + * @param nextLink The nextLink from the previous successful call to the ListBySubscription method. + * @param options The options parameters. */ - listBySubscriptionNext(nextPageLink: string, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; - listBySubscriptionNext(nextPageLink: string, options?: msRest.RequestOptionsBase | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { + private _listBySubscriptionNext( + nextLink: string, + options?: DevicesListBySubscriptionNextOptionalParams + ): Promise { return this.client.sendOperationRequest( - { - nextPageLink, - options - }, - listBySubscriptionNextOperationSpec, - callback) as Promise; + { nextLink, options }, + listBySubscriptionNextOperationSpec + ); } /** - * Gets all the Data Box Edge/Data Box Gateway devices 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 + * @param resourceGroupName The resource group name. + * @param nextLink The nextLink from the previous successful call to the ListByResourceGroup method. + * @param options The options parameters. */ - listByResourceGroupNext(nextPageLink: string, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; - listByResourceGroupNext(nextPageLink: string, options?: msRest.RequestOptionsBase | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { + private _listByResourceGroupNext( + resourceGroupName: string, + nextLink: string, + options?: DevicesListByResourceGroupNextOptionalParams + ): Promise { return this.client.sendOperationRequest( - { - nextPageLink, - options - }, - listByResourceGroupNextOperationSpec, - callback) as Promise; + { resourceGroupName, nextLink, options }, + listByResourceGroupNextOperationSpec + ); } } - // Operation Specifications -const serializer = new msRest.Serializer(Mappers); -const listBySubscriptionOperationSpec: msRest.OperationSpec = { +const serializer = coreClient.createSerializer(Mappers, /* isXml */ false); + +const listBySubscriptionOperationSpec: coreClient.OperationSpec = { + path: + "/subscriptions/{subscriptionId}/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices", httpMethod: "GET", - path: "subscriptions/{subscriptionId}/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices", - urlParameters: [ - Parameters.subscriptionId - ], - queryParameters: [ - Parameters.apiVersion, - Parameters.expand - ], - headerParameters: [ - Parameters.acceptLanguage - ], responses: { 200: { bodyMapper: Mappers.DataBoxEdgeDeviceList @@ -546,23 +833,15 @@ const listBySubscriptionOperationSpec: msRest.OperationSpec = { bodyMapper: Mappers.CloudError } }, + queryParameters: [Parameters.apiVersion, Parameters.expand], + urlParameters: [Parameters.$host, Parameters.subscriptionId], + headerParameters: [Parameters.accept], serializer }; - -const listByResourceGroupOperationSpec: msRest.OperationSpec = { +const listByResourceGroupOperationSpec: coreClient.OperationSpec = { + path: + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices", httpMethod: "GET", - path: "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices", - urlParameters: [ - Parameters.subscriptionId, - Parameters.resourceGroupName - ], - queryParameters: [ - Parameters.apiVersion, - Parameters.expand - ], - headerParameters: [ - Parameters.acceptLanguage - ], responses: { 200: { bodyMapper: Mappers.DataBoxEdgeDeviceList @@ -571,23 +850,19 @@ const listByResourceGroupOperationSpec: msRest.OperationSpec = { bodyMapper: Mappers.CloudError } }, - serializer -}; - -const getOperationSpec: msRest.OperationSpec = { - httpMethod: "GET", - path: "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/{deviceName}", + queryParameters: [Parameters.apiVersion, Parameters.expand], urlParameters: [ - Parameters.deviceName, + Parameters.$host, Parameters.subscriptionId, Parameters.resourceGroupName ], - queryParameters: [ - Parameters.apiVersion - ], - headerParameters: [ - Parameters.acceptLanguage - ], + headerParameters: [Parameters.accept], + serializer +}; +const getOperationSpec: coreClient.OperationSpec = { + path: + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/{deviceName}", + httpMethod: "GET", responses: { 200: { bodyMapper: Mappers.DataBoxEdgeDevice @@ -596,318 +871,283 @@ const getOperationSpec: msRest.OperationSpec = { bodyMapper: Mappers.CloudError } }, - serializer -}; - -const updateOperationSpec: msRest.OperationSpec = { - httpMethod: "PATCH", - path: "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/{deviceName}", + queryParameters: [Parameters.apiVersion], urlParameters: [ - Parameters.deviceName, + Parameters.$host, Parameters.subscriptionId, - Parameters.resourceGroupName - ], - queryParameters: [ - Parameters.apiVersion + Parameters.resourceGroupName, + Parameters.deviceName ], - headerParameters: [ - Parameters.acceptLanguage - ], - requestBody: { - parameterPath: "parameters", - mapper: { - ...Mappers.DataBoxEdgeDevicePatch, - required: true - } - }, + headerParameters: [Parameters.accept], + serializer +}; +const createOrUpdateOperationSpec: coreClient.OperationSpec = { + path: + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/{deviceName}", + httpMethod: "PUT", responses: { 200: { bodyMapper: Mappers.DataBoxEdgeDevice }, + 201: { + bodyMapper: Mappers.DataBoxEdgeDevice + }, + 202: { + bodyMapper: Mappers.DataBoxEdgeDevice + }, + 204: { + bodyMapper: Mappers.DataBoxEdgeDevice + }, default: { bodyMapper: Mappers.CloudError } }, - serializer -}; - -const getExtendedInformationOperationSpec: msRest.OperationSpec = { - httpMethod: "POST", - path: "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/{deviceName}/getExtendedInformation", + requestBody: Parameters.dataBoxEdgeDevice, + queryParameters: [Parameters.apiVersion], urlParameters: [ - Parameters.deviceName, + Parameters.$host, Parameters.subscriptionId, - Parameters.resourceGroupName - ], - queryParameters: [ - Parameters.apiVersion - ], - headerParameters: [ - Parameters.acceptLanguage + Parameters.resourceGroupName, + Parameters.deviceName ], + headerParameters: [Parameters.accept, Parameters.contentType], + mediaType: "json", + serializer +}; +const deleteOperationSpec: coreClient.OperationSpec = { + path: + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/{deviceName}", + httpMethod: "DELETE", responses: { - 200: { - bodyMapper: Mappers.DataBoxEdgeDeviceExtendedInfo - }, + 200: {}, + 201: {}, + 202: {}, + 204: {}, default: { bodyMapper: Mappers.CloudError } }, - serializer -}; - -const getNetworkSettingsOperationSpec: msRest.OperationSpec = { - httpMethod: "GET", - path: "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/{deviceName}/networkSettings/default", + queryParameters: [Parameters.apiVersion], urlParameters: [ - Parameters.deviceName, + Parameters.$host, Parameters.subscriptionId, - Parameters.resourceGroupName - ], - queryParameters: [ - Parameters.apiVersion - ], - headerParameters: [ - Parameters.acceptLanguage + Parameters.resourceGroupName, + Parameters.deviceName ], + headerParameters: [Parameters.accept], + serializer +}; +const updateOperationSpec: coreClient.OperationSpec = { + path: + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/{deviceName}", + httpMethod: "PATCH", responses: { 200: { - bodyMapper: Mappers.NetworkSettings + bodyMapper: Mappers.DataBoxEdgeDevice }, default: { bodyMapper: Mappers.CloudError } }, - serializer -}; - -const getUpdateSummaryOperationSpec: msRest.OperationSpec = { - httpMethod: "GET", - path: "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/{deviceName}/updateSummary/default", + requestBody: Parameters.parameters, + queryParameters: [Parameters.apiVersion], urlParameters: [ - Parameters.deviceName, + Parameters.$host, Parameters.subscriptionId, - Parameters.resourceGroupName + Parameters.resourceGroupName, + Parameters.deviceName ], - queryParameters: [ - Parameters.apiVersion - ], - headerParameters: [ - Parameters.acceptLanguage - ], - responses: { - 200: { - bodyMapper: Mappers.UpdateSummary - }, - default: { - bodyMapper: Mappers.CloudError - } - }, + headerParameters: [Parameters.accept, Parameters.contentType], + mediaType: "json", serializer }; - -const uploadCertificateOperationSpec: msRest.OperationSpec = { +const downloadUpdatesOperationSpec: coreClient.OperationSpec = { + path: + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/{deviceName}/downloadUpdates", httpMethod: "POST", - path: "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/{deviceName}/uploadCertificate", - urlParameters: [ - Parameters.deviceName, - Parameters.subscriptionId, - Parameters.resourceGroupName - ], - queryParameters: [ - Parameters.apiVersion - ], - headerParameters: [ - Parameters.acceptLanguage - ], - requestBody: { - parameterPath: "parameters", - mapper: { - ...Mappers.UploadCertificateRequest, - required: true - } - }, responses: { - 200: { - bodyMapper: Mappers.UploadCertificateResponse - }, + 200: {}, + 201: {}, + 202: {}, + 204: {}, default: { bodyMapper: Mappers.CloudError } }, - serializer -}; - -const beginCreateOrUpdateOperationSpec: msRest.OperationSpec = { - httpMethod: "PUT", - path: "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/{deviceName}", + queryParameters: [Parameters.apiVersion], urlParameters: [ - Parameters.deviceName, + Parameters.$host, Parameters.subscriptionId, - Parameters.resourceGroupName + Parameters.resourceGroupName, + Parameters.deviceName ], - queryParameters: [ - Parameters.apiVersion - ], - headerParameters: [ - Parameters.acceptLanguage - ], - requestBody: { - parameterPath: "dataBoxEdgeDevice", - mapper: { - ...Mappers.DataBoxEdgeDevice, - required: true - } - }, + headerParameters: [Parameters.accept], + serializer +}; +const getExtendedInformationOperationSpec: coreClient.OperationSpec = { + path: + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/{deviceName}/getExtendedInformation", + httpMethod: "POST", responses: { 200: { - bodyMapper: Mappers.DataBoxEdgeDevice + bodyMapper: Mappers.DataBoxEdgeDeviceExtendedInfo }, default: { bodyMapper: Mappers.CloudError } }, - serializer -}; - -const beginDeleteMethodOperationSpec: msRest.OperationSpec = { - httpMethod: "DELETE", - path: "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/{deviceName}", + queryParameters: [Parameters.apiVersion], urlParameters: [ - Parameters.deviceName, + Parameters.$host, Parameters.subscriptionId, - Parameters.resourceGroupName - ], - queryParameters: [ - Parameters.apiVersion - ], - headerParameters: [ - Parameters.acceptLanguage + Parameters.resourceGroupName, + Parameters.deviceName ], + headerParameters: [Parameters.accept], + serializer +}; +const installUpdatesOperationSpec: coreClient.OperationSpec = { + path: + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/{deviceName}/installUpdates", + httpMethod: "POST", responses: { 200: {}, + 201: {}, 202: {}, 204: {}, default: { bodyMapper: Mappers.CloudError } }, - serializer -}; - -const beginDownloadUpdatesOperationSpec: msRest.OperationSpec = { - httpMethod: "POST", - path: "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/{deviceName}/downloadUpdates", + queryParameters: [Parameters.apiVersion], urlParameters: [ - Parameters.deviceName, + Parameters.$host, Parameters.subscriptionId, - Parameters.resourceGroupName - ], - queryParameters: [ - Parameters.apiVersion - ], - headerParameters: [ - Parameters.acceptLanguage + Parameters.resourceGroupName, + Parameters.deviceName ], + headerParameters: [Parameters.accept], + serializer +}; +const getNetworkSettingsOperationSpec: coreClient.OperationSpec = { + path: + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/{deviceName}/networkSettings/default", + httpMethod: "GET", responses: { - 200: {}, - 202: {}, + 200: { + bodyMapper: Mappers.NetworkSettings + }, default: { bodyMapper: Mappers.CloudError } }, - serializer -}; - -const beginInstallUpdatesOperationSpec: msRest.OperationSpec = { - httpMethod: "POST", - path: "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/{deviceName}/installUpdates", + queryParameters: [Parameters.apiVersion], urlParameters: [ - Parameters.deviceName, + Parameters.$host, Parameters.subscriptionId, - Parameters.resourceGroupName - ], - queryParameters: [ - Parameters.apiVersion - ], - headerParameters: [ - Parameters.acceptLanguage + Parameters.resourceGroupName, + Parameters.deviceName ], + headerParameters: [Parameters.accept], + serializer +}; +const scanForUpdatesOperationSpec: coreClient.OperationSpec = { + path: + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/{deviceName}/scanForUpdates", + httpMethod: "POST", responses: { 200: {}, + 201: {}, 202: {}, + 204: {}, default: { bodyMapper: Mappers.CloudError } }, - serializer -}; - -const beginScanForUpdatesOperationSpec: msRest.OperationSpec = { - httpMethod: "POST", - path: "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/{deviceName}/scanForUpdates", + queryParameters: [Parameters.apiVersion], urlParameters: [ - Parameters.deviceName, + Parameters.$host, Parameters.subscriptionId, - Parameters.resourceGroupName - ], - queryParameters: [ - Parameters.apiVersion - ], - headerParameters: [ - Parameters.acceptLanguage + Parameters.resourceGroupName, + Parameters.deviceName ], + headerParameters: [Parameters.accept], + serializer +}; +const createOrUpdateSecuritySettingsOperationSpec: coreClient.OperationSpec = { + path: + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/{deviceName}/securitySettings/default/update", + httpMethod: "POST", responses: { 200: {}, + 201: {}, 202: {}, + 204: {}, default: { bodyMapper: Mappers.CloudError } }, - serializer -}; - -const beginCreateOrUpdateSecuritySettingsOperationSpec: msRest.OperationSpec = { - httpMethod: "POST", - path: "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/{deviceName}/securitySettings/default/update", + requestBody: Parameters.securitySettings, + queryParameters: [Parameters.apiVersion], urlParameters: [ - Parameters.deviceName, + Parameters.$host, Parameters.subscriptionId, - Parameters.resourceGroupName - ], - queryParameters: [ - Parameters.apiVersion - ], - headerParameters: [ - Parameters.acceptLanguage + Parameters.resourceGroupName, + Parameters.deviceName ], - requestBody: { - parameterPath: "securitySettings", - mapper: { - ...Mappers.SecuritySettings, - required: true + headerParameters: [Parameters.accept, Parameters.contentType], + mediaType: "json", + serializer +}; +const getUpdateSummaryOperationSpec: coreClient.OperationSpec = { + path: + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/{deviceName}/updateSummary/default", + httpMethod: "GET", + responses: { + 200: { + bodyMapper: Mappers.UpdateSummary + }, + default: { + bodyMapper: Mappers.CloudError } }, + queryParameters: [Parameters.apiVersion], + urlParameters: [ + Parameters.$host, + Parameters.subscriptionId, + Parameters.resourceGroupName, + Parameters.deviceName + ], + headerParameters: [Parameters.accept], + serializer +}; +const uploadCertificateOperationSpec: coreClient.OperationSpec = { + path: + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/{deviceName}/uploadCertificate", + httpMethod: "POST", responses: { - 202: {}, - 204: {}, + 200: { + bodyMapper: Mappers.UploadCertificateResponse + }, default: { bodyMapper: Mappers.CloudError } }, + requestBody: Parameters.parameters1, + queryParameters: [Parameters.apiVersion], + urlParameters: [ + Parameters.$host, + Parameters.subscriptionId, + Parameters.resourceGroupName, + Parameters.deviceName + ], + headerParameters: [Parameters.accept, Parameters.contentType], + mediaType: "json", serializer }; - -const listBySubscriptionNextOperationSpec: msRest.OperationSpec = { - httpMethod: "GET", - baseUrl: "https://management.azure.com", +const listBySubscriptionNextOperationSpec: coreClient.OperationSpec = { path: "{nextLink}", - urlParameters: [ - Parameters.nextPageLink - ], - headerParameters: [ - Parameters.acceptLanguage - ], + httpMethod: "GET", responses: { 200: { bodyMapper: Mappers.DataBoxEdgeDeviceList @@ -916,19 +1156,18 @@ const listBySubscriptionNextOperationSpec: msRest.OperationSpec = { bodyMapper: Mappers.CloudError } }, + queryParameters: [Parameters.apiVersion, Parameters.expand], + urlParameters: [ + Parameters.$host, + Parameters.nextLink, + Parameters.subscriptionId + ], + headerParameters: [Parameters.accept], serializer }; - -const listByResourceGroupNextOperationSpec: msRest.OperationSpec = { - httpMethod: "GET", - baseUrl: "https://management.azure.com", +const listByResourceGroupNextOperationSpec: coreClient.OperationSpec = { path: "{nextLink}", - urlParameters: [ - Parameters.nextPageLink - ], - headerParameters: [ - Parameters.acceptLanguage - ], + httpMethod: "GET", responses: { 200: { bodyMapper: Mappers.DataBoxEdgeDeviceList @@ -937,5 +1176,13 @@ const listByResourceGroupNextOperationSpec: msRest.OperationSpec = { bodyMapper: Mappers.CloudError } }, + queryParameters: [Parameters.apiVersion, Parameters.expand], + urlParameters: [ + Parameters.$host, + Parameters.nextLink, + Parameters.subscriptionId, + Parameters.resourceGroupName + ], + headerParameters: [Parameters.accept], serializer }; diff --git a/sdk/databoxedge/arm-databoxedge-profile-2020-09-01-hybrid/src/operations/index.ts b/sdk/databoxedge/arm-databoxedge-profile-2020-09-01-hybrid/src/operations/index.ts index 70c72cf33126..6b621283bca4 100644 --- a/sdk/databoxedge/arm-databoxedge-profile-2020-09-01-hybrid/src/operations/index.ts +++ b/sdk/databoxedge/arm-databoxedge-profile-2020-09-01-hybrid/src/operations/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. + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. * * 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 * from "./operations"; diff --git a/sdk/databoxedge/arm-databoxedge-profile-2020-09-01-hybrid/src/operations/jobs.ts b/sdk/databoxedge/arm-databoxedge-profile-2020-09-01-hybrid/src/operations/jobs.ts index c5ce0b5b04bd..391994d335ca 100644 --- a/sdk/databoxedge/arm-databoxedge-profile-2020-09-01-hybrid/src/operations/jobs.ts +++ b/sdk/databoxedge/arm-databoxedge-profile-2020-09-01-hybrid/src/operations/jobs.ts @@ -1,85 +1,56 @@ /* - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for - * license information. + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. * * 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 * as msRest from "@azure/ms-rest-js"; -import * as Models from "../models"; -import * as Mappers from "../models/jobsMappers"; +import { Jobs } from "../operationsInterfaces"; +import * as coreClient from "@azure/core-client"; +import * as Mappers from "../models/mappers"; import * as Parameters from "../models/parameters"; -import { DataBoxEdgeManagementClientContext } from "../dataBoxEdgeManagementClientContext"; +import { DataBoxEdgeManagementClient } from "../dataBoxEdgeManagementClient"; +import { JobsGetOptionalParams, JobsGetResponse } from "../models"; -/** Class representing a Jobs. */ -export class Jobs { - private readonly client: DataBoxEdgeManagementClientContext; +/** Class containing Jobs operations. */ +export class JobsImpl implements Jobs { + private readonly client: DataBoxEdgeManagementClient; /** - * Create a Jobs. - * @param {DataBoxEdgeManagementClientContext} client Reference to the service client. + * Initialize a new instance of the class Jobs class. + * @param client Reference to the service client */ - constructor(client: DataBoxEdgeManagementClientContext) { + constructor(client: DataBoxEdgeManagementClient) { this.client = client; } /** - * @summary Gets the details of a specified job on a Data Box Edge/Data Box Gateway device. + * Gets the details of a specified job on a Data Box Edge/Data Box Gateway device. * @param deviceName The device name. * @param name The job name. * @param resourceGroupName The resource group name. - * @param [options] The optional parameters - * @returns Promise + * @param options The options parameters. */ - get(deviceName: string, name: string, resourceGroupName: string, options?: msRest.RequestOptionsBase): Promise; - /** - * @param deviceName The device name. - * @param name The job name. - * @param resourceGroupName The resource group name. - * @param callback The callback - */ - get(deviceName: string, name: string, resourceGroupName: string, callback: msRest.ServiceCallback): void; - /** - * @param deviceName The device name. - * @param name The job name. - * @param resourceGroupName The resource group name. - * @param options The optional parameters - * @param callback The callback - */ - get(deviceName: string, name: string, resourceGroupName: string, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; - get(deviceName: string, name: string, resourceGroupName: string, options?: msRest.RequestOptionsBase | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { + get( + deviceName: string, + name: string, + resourceGroupName: string, + options?: JobsGetOptionalParams + ): Promise { return this.client.sendOperationRequest( - { - deviceName, - name, - resourceGroupName, - options - }, - getOperationSpec, - callback) as Promise; + { deviceName, name, resourceGroupName, options }, + getOperationSpec + ); } } - // Operation Specifications -const serializer = new msRest.Serializer(Mappers); -const getOperationSpec: msRest.OperationSpec = { +const serializer = coreClient.createSerializer(Mappers, /* isXml */ false); + +const getOperationSpec: coreClient.OperationSpec = { + path: + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/{deviceName}/jobs/{name}", httpMethod: "GET", - path: "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/{deviceName}/jobs/{name}", - urlParameters: [ - Parameters.deviceName, - Parameters.name, - Parameters.subscriptionId, - Parameters.resourceGroupName - ], - queryParameters: [ - Parameters.apiVersion - ], - headerParameters: [ - Parameters.acceptLanguage - ], responses: { 200: { bodyMapper: Mappers.Job @@ -88,5 +59,14 @@ const getOperationSpec: msRest.OperationSpec = { bodyMapper: Mappers.CloudError } }, + queryParameters: [Parameters.apiVersion], + urlParameters: [ + Parameters.$host, + Parameters.subscriptionId, + Parameters.resourceGroupName, + Parameters.deviceName, + Parameters.name + ], + headerParameters: [Parameters.accept], serializer }; diff --git a/sdk/databoxedge/arm-databoxedge-profile-2020-09-01-hybrid/src/operations/nodes.ts b/sdk/databoxedge/arm-databoxedge-profile-2020-09-01-hybrid/src/operations/nodes.ts index 1ec2ea69128f..8aed357d7955 100644 --- a/sdk/databoxedge/arm-databoxedge-profile-2020-09-01-hybrid/src/operations/nodes.ts +++ b/sdk/databoxedge/arm-databoxedge-profile-2020-09-01-hybrid/src/operations/nodes.ts @@ -1,28 +1,33 @@ /* - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for - * license information. + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. * * 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 * as msRest from "@azure/ms-rest-js"; -import * as Models from "../models"; -import * as Mappers from "../models/nodesMappers"; +import { PagedAsyncIterableIterator } from "@azure/core-paging"; +import { Nodes } from "../operationsInterfaces"; +import * as coreClient from "@azure/core-client"; +import * as Mappers from "../models/mappers"; import * as Parameters from "../models/parameters"; -import { DataBoxEdgeManagementClientContext } from "../dataBoxEdgeManagementClientContext"; +import { DataBoxEdgeManagementClient } from "../dataBoxEdgeManagementClient"; +import { + Node, + NodesListByDataBoxEdgeDeviceOptionalParams, + NodesListByDataBoxEdgeDeviceResponse +} from "../models"; -/** Class representing a Nodes. */ -export class Nodes { - private readonly client: DataBoxEdgeManagementClientContext; +/// +/** Class containing Nodes operations. */ +export class NodesImpl implements Nodes { + private readonly client: DataBoxEdgeManagementClient; /** - * Create a Nodes. - * @param {DataBoxEdgeManagementClientContext} client Reference to the service client. + * Initialize a new instance of the class Nodes class. + * @param client Reference to the service client */ - constructor(client: DataBoxEdgeManagementClientContext) { + constructor(client: DataBoxEdgeManagementClient) { this.client = client; } @@ -30,51 +35,86 @@ export class Nodes { * Gets all the nodes currently configured under this Data Box Edge device * @param deviceName The device name. * @param resourceGroupName The resource group name. - * @param [options] The optional parameters - * @returns Promise + * @param options The options parameters. */ - listByDataBoxEdgeDevice(deviceName: string, resourceGroupName: string, options?: msRest.RequestOptionsBase): Promise; - /** - * @param deviceName The device name. - * @param resourceGroupName The resource group name. - * @param callback The callback - */ - listByDataBoxEdgeDevice(deviceName: string, resourceGroupName: string, callback: msRest.ServiceCallback): void; + public listByDataBoxEdgeDevice( + deviceName: string, + resourceGroupName: string, + options?: NodesListByDataBoxEdgeDeviceOptionalParams + ): PagedAsyncIterableIterator { + const iter = this.listByDataBoxEdgeDevicePagingAll( + deviceName, + resourceGroupName, + options + ); + return { + next() { + return iter.next(); + }, + [Symbol.asyncIterator]() { + return this; + }, + byPage: () => { + return this.listByDataBoxEdgeDevicePagingPage( + deviceName, + resourceGroupName, + options + ); + } + }; + } + + private async *listByDataBoxEdgeDevicePagingPage( + deviceName: string, + resourceGroupName: string, + options?: NodesListByDataBoxEdgeDeviceOptionalParams + ): AsyncIterableIterator { + let result = await this._listByDataBoxEdgeDevice( + deviceName, + resourceGroupName, + options + ); + yield result.value || []; + } + + private async *listByDataBoxEdgeDevicePagingAll( + deviceName: string, + resourceGroupName: string, + options?: NodesListByDataBoxEdgeDeviceOptionalParams + ): AsyncIterableIterator { + for await (const page of this.listByDataBoxEdgeDevicePagingPage( + deviceName, + resourceGroupName, + options + )) { + yield* page; + } + } + /** + * Gets all the nodes currently configured under this Data Box Edge device * @param deviceName The device name. * @param resourceGroupName The resource group name. - * @param options The optional parameters - * @param callback The callback + * @param options The options parameters. */ - listByDataBoxEdgeDevice(deviceName: string, resourceGroupName: string, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; - listByDataBoxEdgeDevice(deviceName: string, resourceGroupName: string, options?: msRest.RequestOptionsBase | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { + private _listByDataBoxEdgeDevice( + deviceName: string, + resourceGroupName: string, + options?: NodesListByDataBoxEdgeDeviceOptionalParams + ): Promise { return this.client.sendOperationRequest( - { - deviceName, - resourceGroupName, - options - }, - listByDataBoxEdgeDeviceOperationSpec, - callback) as Promise; + { deviceName, resourceGroupName, options }, + listByDataBoxEdgeDeviceOperationSpec + ); } } - // Operation Specifications -const serializer = new msRest.Serializer(Mappers); -const listByDataBoxEdgeDeviceOperationSpec: msRest.OperationSpec = { +const serializer = coreClient.createSerializer(Mappers, /* isXml */ false); + +const listByDataBoxEdgeDeviceOperationSpec: coreClient.OperationSpec = { + path: + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/{deviceName}/nodes", httpMethod: "GET", - path: "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/{deviceName}/nodes", - urlParameters: [ - Parameters.deviceName, - Parameters.subscriptionId, - Parameters.resourceGroupName - ], - queryParameters: [ - Parameters.apiVersion - ], - headerParameters: [ - Parameters.acceptLanguage - ], responses: { 200: { bodyMapper: Mappers.NodeList @@ -83,5 +123,13 @@ const listByDataBoxEdgeDeviceOperationSpec: msRest.OperationSpec = { bodyMapper: Mappers.CloudError } }, + queryParameters: [Parameters.apiVersion], + urlParameters: [ + Parameters.$host, + Parameters.subscriptionId, + Parameters.resourceGroupName, + Parameters.deviceName + ], + headerParameters: [Parameters.accept], serializer }; diff --git a/sdk/databoxedge/arm-databoxedge-profile-2020-09-01-hybrid/src/operations/operations.ts b/sdk/databoxedge/arm-databoxedge-profile-2020-09-01-hybrid/src/operations/operations.ts index 2b80ef77c415..75e658d5e1e4 100644 --- a/sdk/databoxedge/arm-databoxedge-profile-2020-09-01-hybrid/src/operations/operations.ts +++ b/sdk/databoxedge/arm-databoxedge-profile-2020-09-01-hybrid/src/operations/operations.ts @@ -1,95 +1,111 @@ /* - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for - * license information. + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. * * 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 * as msRest from "@azure/ms-rest-js"; -import * as Models from "../models"; -import * as Mappers from "../models/operationsMappers"; +import { PagedAsyncIterableIterator } from "@azure/core-paging"; +import { Operations } from "../operationsInterfaces"; +import * as coreClient from "@azure/core-client"; +import * as Mappers from "../models/mappers"; import * as Parameters from "../models/parameters"; -import { DataBoxEdgeManagementClientContext } from "../dataBoxEdgeManagementClientContext"; +import { DataBoxEdgeManagementClient } from "../dataBoxEdgeManagementClient"; +import { + Operation, + OperationsListNextOptionalParams, + OperationsListOptionalParams, + OperationsListResponse, + OperationsListNextResponse +} from "../models"; -/** Class representing a Operations. */ -export class Operations { - private readonly client: DataBoxEdgeManagementClientContext; +/// +/** Class containing Operations operations. */ +export class OperationsImpl implements Operations { + private readonly client: DataBoxEdgeManagementClient; /** - * Create a Operations. - * @param {DataBoxEdgeManagementClientContext} client Reference to the service client. + * Initialize a new instance of the class Operations class. + * @param client Reference to the service client */ - constructor(client: DataBoxEdgeManagementClientContext) { + constructor(client: DataBoxEdgeManagementClient) { this.client = client; } /** - * @summary List all the supported operations. - * @param [options] The optional parameters - * @returns Promise + * List all the supported operations. + * @param options The options parameters. */ - 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 + public list( + options?: OperationsListOptionalParams + ): PagedAsyncIterableIterator { + const iter = this.listPagingAll(options); + return { + next() { + return iter.next(); + }, + [Symbol.asyncIterator]() { + return this; }, - listOperationSpec, - callback) as Promise; + byPage: () => { + return this.listPagingPage(options); + } + }; + } + + private async *listPagingPage( + options?: OperationsListOptionalParams + ): AsyncIterableIterator { + let result = await this._list(options); + yield result.value || []; + let continuationToken = result.nextLink; + while (continuationToken) { + result = await this._listNext(continuationToken, options); + continuationToken = result.nextLink; + yield result.value || []; + } + } + + private async *listPagingAll( + options?: OperationsListOptionalParams + ): AsyncIterableIterator { + for await (const page of this.listPagingPage(options)) { + yield* page; + } } /** - * @summary List all the supported operations. - * @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 + * List all the supported operations. + * @param options The options parameters. */ - listNext(nextPageLink: string, callback: msRest.ServiceCallback): void; + private _list( + options?: OperationsListOptionalParams + ): Promise { + return this.client.sendOperationRequest({ options }, listOperationSpec); + } + /** - * @param nextPageLink The NextLink from the previous successful call to List operation. - * @param options The optional parameters - * @param callback The callback + * ListNext + * @param nextLink The nextLink from the previous successful call to the List method. + * @param options The options parameters. */ - listNext(nextPageLink: string, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; - listNext(nextPageLink: string, options?: msRest.RequestOptionsBase | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { + private _listNext( + nextLink: string, + options?: OperationsListNextOptionalParams + ): Promise { return this.client.sendOperationRequest( - { - nextPageLink, - options - }, - listNextOperationSpec, - callback) as Promise; + { nextLink, options }, + listNextOperationSpec + ); } } - // Operation Specifications -const serializer = new msRest.Serializer(Mappers); -const listOperationSpec: msRest.OperationSpec = { +const serializer = coreClient.createSerializer(Mappers, /* isXml */ false); + +const listOperationSpec: coreClient.OperationSpec = { + path: "/providers/Microsoft.DataBoxEdge/operations", httpMethod: "GET", - path: "providers/Microsoft.DataBoxEdge/operations", - queryParameters: [ - Parameters.apiVersion - ], - headerParameters: [ - Parameters.acceptLanguage - ], responses: { 200: { bodyMapper: Mappers.OperationsList @@ -98,19 +114,14 @@ const listOperationSpec: msRest.OperationSpec = { bodyMapper: Mappers.CloudError } }, + queryParameters: [Parameters.apiVersion], + urlParameters: [Parameters.$host], + headerParameters: [Parameters.accept], serializer }; - -const listNextOperationSpec: msRest.OperationSpec = { - httpMethod: "GET", - baseUrl: "https://management.azure.com", +const listNextOperationSpec: coreClient.OperationSpec = { path: "{nextLink}", - urlParameters: [ - Parameters.nextPageLink - ], - headerParameters: [ - Parameters.acceptLanguage - ], + httpMethod: "GET", responses: { 200: { bodyMapper: Mappers.OperationsList @@ -119,5 +130,8 @@ const listNextOperationSpec: msRest.OperationSpec = { bodyMapper: Mappers.CloudError } }, + queryParameters: [Parameters.apiVersion], + urlParameters: [Parameters.$host, Parameters.nextLink], + headerParameters: [Parameters.accept], serializer }; diff --git a/sdk/databoxedge/arm-databoxedge-profile-2020-09-01-hybrid/src/operations/operationsStatus.ts b/sdk/databoxedge/arm-databoxedge-profile-2020-09-01-hybrid/src/operations/operationsStatus.ts index d8a2994ebc5b..6dcfbc331216 100644 --- a/sdk/databoxedge/arm-databoxedge-profile-2020-09-01-hybrid/src/operations/operationsStatus.ts +++ b/sdk/databoxedge/arm-databoxedge-profile-2020-09-01-hybrid/src/operations/operationsStatus.ts @@ -1,85 +1,59 @@ /* - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for - * license information. + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. * * 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 * as msRest from "@azure/ms-rest-js"; -import * as Models from "../models"; -import * as Mappers from "../models/operationsStatusMappers"; +import { OperationsStatus } from "../operationsInterfaces"; +import * as coreClient from "@azure/core-client"; +import * as Mappers from "../models/mappers"; import * as Parameters from "../models/parameters"; -import { DataBoxEdgeManagementClientContext } from "../dataBoxEdgeManagementClientContext"; +import { DataBoxEdgeManagementClient } from "../dataBoxEdgeManagementClient"; +import { + OperationsStatusGetOptionalParams, + OperationsStatusGetResponse +} from "../models"; -/** Class representing a OperationsStatus. */ -export class OperationsStatus { - private readonly client: DataBoxEdgeManagementClientContext; +/** Class containing OperationsStatus operations. */ +export class OperationsStatusImpl implements OperationsStatus { + private readonly client: DataBoxEdgeManagementClient; /** - * Create a OperationsStatus. - * @param {DataBoxEdgeManagementClientContext} client Reference to the service client. + * Initialize a new instance of the class OperationsStatus class. + * @param client Reference to the service client */ - constructor(client: DataBoxEdgeManagementClientContext) { + constructor(client: DataBoxEdgeManagementClient) { this.client = client; } /** - * @summary Gets the details of a specified job on a Data Box Edge/Data Box Gateway device. + * Gets the details of a specified job on a Data Box Edge/Data Box Gateway device. * @param deviceName The device name. * @param name The job name. * @param resourceGroupName The resource group name. - * @param [options] The optional parameters - * @returns Promise + * @param options The options parameters. */ - get(deviceName: string, name: string, resourceGroupName: string, options?: msRest.RequestOptionsBase): Promise; - /** - * @param deviceName The device name. - * @param name The job name. - * @param resourceGroupName The resource group name. - * @param callback The callback - */ - get(deviceName: string, name: string, resourceGroupName: string, callback: msRest.ServiceCallback): void; - /** - * @param deviceName The device name. - * @param name The job name. - * @param resourceGroupName The resource group name. - * @param options The optional parameters - * @param callback The callback - */ - get(deviceName: string, name: string, resourceGroupName: string, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; - get(deviceName: string, name: string, resourceGroupName: string, options?: msRest.RequestOptionsBase | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { + get( + deviceName: string, + name: string, + resourceGroupName: string, + options?: OperationsStatusGetOptionalParams + ): Promise { return this.client.sendOperationRequest( - { - deviceName, - name, - resourceGroupName, - options - }, - getOperationSpec, - callback) as Promise; + { deviceName, name, resourceGroupName, options }, + getOperationSpec + ); } } - // Operation Specifications -const serializer = new msRest.Serializer(Mappers); -const getOperationSpec: msRest.OperationSpec = { +const serializer = coreClient.createSerializer(Mappers, /* isXml */ false); + +const getOperationSpec: coreClient.OperationSpec = { + path: + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/{deviceName}/operationsStatus/{name}", httpMethod: "GET", - path: "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/{deviceName}/operationsStatus/{name}", - urlParameters: [ - Parameters.deviceName, - Parameters.name, - Parameters.subscriptionId, - Parameters.resourceGroupName - ], - queryParameters: [ - Parameters.apiVersion - ], - headerParameters: [ - Parameters.acceptLanguage - ], responses: { 200: { bodyMapper: Mappers.Job @@ -88,5 +62,14 @@ const getOperationSpec: msRest.OperationSpec = { bodyMapper: Mappers.CloudError } }, + queryParameters: [Parameters.apiVersion], + urlParameters: [ + Parameters.$host, + Parameters.subscriptionId, + Parameters.resourceGroupName, + Parameters.deviceName, + Parameters.name + ], + headerParameters: [Parameters.accept], serializer }; diff --git a/sdk/databoxedge/arm-databoxedge-profile-2020-09-01-hybrid/src/operations/orders.ts b/sdk/databoxedge/arm-databoxedge-profile-2020-09-01-hybrid/src/operations/orders.ts index 42da15c6a1d1..d6c6fe026c74 100644 --- a/sdk/databoxedge/arm-databoxedge-profile-2020-09-01-hybrid/src/operations/orders.ts +++ b/sdk/databoxedge/arm-databoxedge-profile-2020-09-01-hybrid/src/operations/orders.ts @@ -1,204 +1,347 @@ /* - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for - * license information. + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. * * 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 * 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/ordersMappers"; +import { PagedAsyncIterableIterator } from "@azure/core-paging"; +import { Orders } from "../operationsInterfaces"; +import * as coreClient from "@azure/core-client"; +import * as Mappers from "../models/mappers"; import * as Parameters from "../models/parameters"; -import { DataBoxEdgeManagementClientContext } from "../dataBoxEdgeManagementClientContext"; +import { DataBoxEdgeManagementClient } from "../dataBoxEdgeManagementClient"; +import { PollerLike, PollOperationState, LroEngine } from "@azure/core-lro"; +import { LroImpl } from "../lroImpl"; +import { + Order, + OrdersListByDataBoxEdgeDeviceNextOptionalParams, + OrdersListByDataBoxEdgeDeviceOptionalParams, + OrdersListByDataBoxEdgeDeviceResponse, + OrdersGetOptionalParams, + OrdersGetResponse, + OrdersCreateOrUpdateOptionalParams, + OrdersCreateOrUpdateResponse, + OrdersDeleteOptionalParams, + OrdersListByDataBoxEdgeDeviceNextResponse +} from "../models"; -/** Class representing a Orders. */ -export class Orders { - private readonly client: DataBoxEdgeManagementClientContext; +/// +/** Class containing Orders operations. */ +export class OrdersImpl implements Orders { + private readonly client: DataBoxEdgeManagementClient; /** - * Create a Orders. - * @param {DataBoxEdgeManagementClientContext} client Reference to the service client. + * Initialize a new instance of the class Orders class. + * @param client Reference to the service client */ - constructor(client: DataBoxEdgeManagementClientContext) { + constructor(client: DataBoxEdgeManagementClient) { this.client = client; } /** - * @summary Lists all the orders related to a Data Box Edge/Data Box Gateway device. + * Lists all the orders related to a Data Box Edge/Data Box Gateway device. * @param deviceName The device name. * @param resourceGroupName The resource group name. - * @param [options] The optional parameters - * @returns Promise + * @param options The options parameters. */ - listByDataBoxEdgeDevice(deviceName: string, resourceGroupName: string, options?: msRest.RequestOptionsBase): Promise; - /** - * @param deviceName The device name. - * @param resourceGroupName The resource group name. - * @param callback The callback - */ - listByDataBoxEdgeDevice(deviceName: string, resourceGroupName: string, callback: msRest.ServiceCallback): void; - /** - * @param deviceName The device name. - * @param resourceGroupName The resource group name. - * @param options The optional parameters - * @param callback The callback - */ - listByDataBoxEdgeDevice(deviceName: string, resourceGroupName: string, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; - listByDataBoxEdgeDevice(deviceName: string, resourceGroupName: string, options?: msRest.RequestOptionsBase | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { - return this.client.sendOperationRequest( - { + public listByDataBoxEdgeDevice( + deviceName: string, + resourceGroupName: string, + options?: OrdersListByDataBoxEdgeDeviceOptionalParams + ): PagedAsyncIterableIterator { + const iter = this.listByDataBoxEdgeDevicePagingAll( + deviceName, + resourceGroupName, + options + ); + return { + next() { + return iter.next(); + }, + [Symbol.asyncIterator]() { + return this; + }, + byPage: () => { + return this.listByDataBoxEdgeDevicePagingPage( + deviceName, + resourceGroupName, + options + ); + } + }; + } + + private async *listByDataBoxEdgeDevicePagingPage( + deviceName: string, + resourceGroupName: string, + options?: OrdersListByDataBoxEdgeDeviceOptionalParams + ): AsyncIterableIterator { + let result = await this._listByDataBoxEdgeDevice( + deviceName, + resourceGroupName, + options + ); + yield result.value || []; + let continuationToken = result.nextLink; + while (continuationToken) { + result = await this._listByDataBoxEdgeDeviceNext( deviceName, resourceGroupName, + continuationToken, options - }, - listByDataBoxEdgeDeviceOperationSpec, - callback) as Promise; + ); + continuationToken = result.nextLink; + yield result.value || []; + } + } + + private async *listByDataBoxEdgeDevicePagingAll( + deviceName: string, + resourceGroupName: string, + options?: OrdersListByDataBoxEdgeDeviceOptionalParams + ): AsyncIterableIterator { + for await (const page of this.listByDataBoxEdgeDevicePagingPage( + deviceName, + resourceGroupName, + options + )) { + yield* page; + } } /** - * @summary Gets a specific order by name. - * @param deviceName The device name. - * @param resourceGroupName The resource group name. - * @param [options] The optional parameters - * @returns Promise - */ - get(deviceName: string, resourceGroupName: string, options?: msRest.RequestOptionsBase): Promise; - /** + * Lists all the orders related to a Data Box Edge/Data Box Gateway device. * @param deviceName The device name. * @param resourceGroupName The resource group name. - * @param callback The callback + * @param options The options parameters. */ - get(deviceName: string, resourceGroupName: string, callback: msRest.ServiceCallback): void; + private _listByDataBoxEdgeDevice( + deviceName: string, + resourceGroupName: string, + options?: OrdersListByDataBoxEdgeDeviceOptionalParams + ): Promise { + return this.client.sendOperationRequest( + { deviceName, resourceGroupName, options }, + listByDataBoxEdgeDeviceOperationSpec + ); + } + /** + * Gets a specific order by name. * @param deviceName The device name. * @param resourceGroupName The resource group name. - * @param options The optional parameters - * @param callback The callback + * @param options The options parameters. */ - get(deviceName: string, resourceGroupName: string, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; - get(deviceName: string, resourceGroupName: string, options?: msRest.RequestOptionsBase | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { + get( + deviceName: string, + resourceGroupName: string, + options?: OrdersGetOptionalParams + ): Promise { return this.client.sendOperationRequest( - { - deviceName, - resourceGroupName, - options - }, - getOperationSpec, - callback) as Promise; + { deviceName, resourceGroupName, options }, + getOperationSpec + ); } /** - * @summary Creates or updates an order. + * Creates or updates an order. * @param deviceName The order details of a device. - * @param order The order to be created or updated. * @param resourceGroupName The resource group name. - * @param [options] The optional parameters - * @returns Promise + * @param order The order to be created or updated. + * @param options The options parameters. */ - createOrUpdate(deviceName: string, order: Models.Order, resourceGroupName: string, options?: msRest.RequestOptionsBase): Promise { - return this.beginCreateOrUpdate(deviceName,order,resourceGroupName,options) - .then(lroPoller => lroPoller.pollUntilFinished()) as Promise; + async beginCreateOrUpdate( + deviceName: string, + resourceGroupName: string, + order: Order, + options?: OrdersCreateOrUpdateOptionalParams + ): Promise< + PollerLike< + PollOperationState, + OrdersCreateOrUpdateResponse + > + > { + const directSendOperation = async ( + args: coreClient.OperationArguments, + spec: coreClient.OperationSpec + ): Promise => { + return this.client.sendOperationRequest(args, spec); + }; + const sendOperation = async ( + args: coreClient.OperationArguments, + spec: coreClient.OperationSpec + ) => { + let currentRawResponse: + | coreClient.FullOperationResponse + | undefined = undefined; + const providedCallback = args.options?.onResponse; + const callback: coreClient.RawResponseCallback = ( + rawResponse: coreClient.FullOperationResponse, + flatResponse: unknown + ) => { + currentRawResponse = rawResponse; + providedCallback?.(rawResponse, flatResponse); + }; + const updatedArgs = { + ...args, + options: { + ...args.options, + onResponse: callback + } + }; + const flatResponse = await directSendOperation(updatedArgs, spec); + return { + flatResponse, + rawResponse: { + statusCode: currentRawResponse!.status, + body: currentRawResponse!.parsedBody, + headers: currentRawResponse!.headers.toJSON() + } + }; + }; + + const lro = new LroImpl( + sendOperation, + { deviceName, resourceGroupName, order, options }, + createOrUpdateOperationSpec + ); + return new LroEngine(lro, { + resumeFrom: options?.resumeFrom, + intervalInMs: options?.updateIntervalInMs + }); } /** - * @summary Deletes the order related to the device. - * @param deviceName The device name. + * Creates or updates an order. + * @param deviceName The order details of a device. * @param resourceGroupName The resource group name. - * @param [options] The optional parameters - * @returns Promise + * @param order The order to be created or updated. + * @param options The options parameters. */ - deleteMethod(deviceName: string, resourceGroupName: string, options?: msRest.RequestOptionsBase): Promise { - return this.beginDeleteMethod(deviceName,resourceGroupName,options) - .then(lroPoller => lroPoller.pollUntilFinished()); + async beginCreateOrUpdateAndWait( + deviceName: string, + resourceGroupName: string, + order: Order, + options?: OrdersCreateOrUpdateOptionalParams + ): Promise { + const poller = await this.beginCreateOrUpdate( + deviceName, + resourceGroupName, + order, + options + ); + return poller.pollUntilDone(); } /** - * @summary Creates or updates an order. - * @param deviceName The order details of a device. - * @param order The order to be created or updated. + * Deletes the order related to the device. + * @param deviceName The device name. * @param resourceGroupName The resource group name. - * @param [options] The optional parameters - * @returns Promise + * @param options The options parameters. */ - beginCreateOrUpdate(deviceName: string, order: Models.Order, resourceGroupName: string, options?: msRest.RequestOptionsBase): Promise { - return this.client.sendLRORequest( - { - deviceName, - order, - resourceGroupName, - options - }, - beginCreateOrUpdateOperationSpec, - options); + async beginDelete( + deviceName: string, + resourceGroupName: string, + options?: OrdersDeleteOptionalParams + ): Promise, void>> { + const directSendOperation = async ( + args: coreClient.OperationArguments, + spec: coreClient.OperationSpec + ): Promise => { + return this.client.sendOperationRequest(args, spec); + }; + const sendOperation = async ( + args: coreClient.OperationArguments, + spec: coreClient.OperationSpec + ) => { + let currentRawResponse: + | coreClient.FullOperationResponse + | undefined = undefined; + const providedCallback = args.options?.onResponse; + const callback: coreClient.RawResponseCallback = ( + rawResponse: coreClient.FullOperationResponse, + flatResponse: unknown + ) => { + currentRawResponse = rawResponse; + providedCallback?.(rawResponse, flatResponse); + }; + const updatedArgs = { + ...args, + options: { + ...args.options, + onResponse: callback + } + }; + const flatResponse = await directSendOperation(updatedArgs, spec); + return { + flatResponse, + rawResponse: { + statusCode: currentRawResponse!.status, + body: currentRawResponse!.parsedBody, + headers: currentRawResponse!.headers.toJSON() + } + }; + }; + + const lro = new LroImpl( + sendOperation, + { deviceName, resourceGroupName, options }, + deleteOperationSpec + ); + return new LroEngine(lro, { + resumeFrom: options?.resumeFrom, + intervalInMs: options?.updateIntervalInMs + }); } /** - * @summary Deletes the order related to the device. + * Deletes the order related to the device. * @param deviceName The device name. * @param resourceGroupName The resource group name. - * @param [options] The optional parameters - * @returns Promise + * @param options The options parameters. */ - beginDeleteMethod(deviceName: string, resourceGroupName: string, options?: msRest.RequestOptionsBase): Promise { - return this.client.sendLRORequest( - { - deviceName, - resourceGroupName, - options - }, - beginDeleteMethodOperationSpec, - options); + async beginDeleteAndWait( + deviceName: string, + resourceGroupName: string, + options?: OrdersDeleteOptionalParams + ): Promise { + const poller = await this.beginDelete( + deviceName, + resourceGroupName, + options + ); + return poller.pollUntilDone(); } /** - * @summary Lists all the orders related to a Data Box Edge/Data Box Gateway device. - * @param nextPageLink The NextLink from the previous successful call to List operation. - * @param [options] The optional parameters - * @returns Promise - */ - listByDataBoxEdgeDeviceNext(nextPageLink: string, options?: msRest.RequestOptionsBase): Promise; - /** - * @param nextPageLink The NextLink from the previous successful call to List operation. - * @param callback The callback - */ - listByDataBoxEdgeDeviceNext(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 + * ListByDataBoxEdgeDeviceNext + * @param deviceName The device name. + * @param resourceGroupName The resource group name. + * @param nextLink The nextLink from the previous successful call to the ListByDataBoxEdgeDevice + * method. + * @param options The options parameters. */ - listByDataBoxEdgeDeviceNext(nextPageLink: string, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; - listByDataBoxEdgeDeviceNext(nextPageLink: string, options?: msRest.RequestOptionsBase | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { + private _listByDataBoxEdgeDeviceNext( + deviceName: string, + resourceGroupName: string, + nextLink: string, + options?: OrdersListByDataBoxEdgeDeviceNextOptionalParams + ): Promise { return this.client.sendOperationRequest( - { - nextPageLink, - options - }, - listByDataBoxEdgeDeviceNextOperationSpec, - callback) as Promise; + { deviceName, resourceGroupName, nextLink, options }, + listByDataBoxEdgeDeviceNextOperationSpec + ); } } - // Operation Specifications -const serializer = new msRest.Serializer(Mappers); -const listByDataBoxEdgeDeviceOperationSpec: msRest.OperationSpec = { +const serializer = coreClient.createSerializer(Mappers, /* isXml */ false); + +const listByDataBoxEdgeDeviceOperationSpec: coreClient.OperationSpec = { + path: + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/{deviceName}/orders", httpMethod: "GET", - path: "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/{deviceName}/orders", - urlParameters: [ - Parameters.deviceName, - Parameters.subscriptionId, - Parameters.resourceGroupName - ], - queryParameters: [ - Parameters.apiVersion - ], - headerParameters: [ - Parameters.acceptLanguage - ], responses: { 200: { bodyMapper: Mappers.OrderList @@ -207,23 +350,20 @@ const listByDataBoxEdgeDeviceOperationSpec: msRest.OperationSpec = { bodyMapper: Mappers.CloudError } }, - serializer -}; - -const getOperationSpec: msRest.OperationSpec = { - httpMethod: "GET", - path: "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/{deviceName}/orders/default", + queryParameters: [Parameters.apiVersion], urlParameters: [ - Parameters.deviceName, + Parameters.$host, Parameters.subscriptionId, - Parameters.resourceGroupName - ], - queryParameters: [ - Parameters.apiVersion - ], - headerParameters: [ - Parameters.acceptLanguage + Parameters.resourceGroupName, + Parameters.deviceName ], + headerParameters: [Parameters.accept], + serializer +}; +const getOperationSpec: coreClient.OperationSpec = { + path: + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/{deviceName}/orders/default", + httpMethod: "GET", responses: { 200: { bodyMapper: Mappers.Order @@ -232,77 +372,75 @@ const getOperationSpec: msRest.OperationSpec = { bodyMapper: Mappers.CloudError } }, - serializer -}; - -const beginCreateOrUpdateOperationSpec: msRest.OperationSpec = { - httpMethod: "PUT", - path: "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/{deviceName}/orders/default", + queryParameters: [Parameters.apiVersion], urlParameters: [ - Parameters.deviceName, + Parameters.$host, Parameters.subscriptionId, - Parameters.resourceGroupName - ], - queryParameters: [ - Parameters.apiVersion + Parameters.resourceGroupName, + Parameters.deviceName ], - headerParameters: [ - Parameters.acceptLanguage - ], - requestBody: { - parameterPath: "order", - mapper: { - ...Mappers.Order, - required: true - } - }, + headerParameters: [Parameters.accept], + serializer +}; +const createOrUpdateOperationSpec: coreClient.OperationSpec = { + path: + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/{deviceName}/orders/default", + httpMethod: "PUT", responses: { 200: { bodyMapper: Mappers.Order }, - 202: {}, + 201: { + bodyMapper: Mappers.Order + }, + 202: { + bodyMapper: Mappers.Order + }, + 204: { + bodyMapper: Mappers.Order + }, default: { bodyMapper: Mappers.CloudError } }, - serializer -}; - -const beginDeleteMethodOperationSpec: msRest.OperationSpec = { - httpMethod: "DELETE", - path: "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/{deviceName}/orders/default", + requestBody: Parameters.order, + queryParameters: [Parameters.apiVersion], urlParameters: [ - Parameters.deviceName, + Parameters.$host, Parameters.subscriptionId, - Parameters.resourceGroupName - ], - queryParameters: [ - Parameters.apiVersion - ], - headerParameters: [ - Parameters.acceptLanguage + Parameters.resourceGroupName, + Parameters.deviceName ], + headerParameters: [Parameters.accept, Parameters.contentType], + mediaType: "json", + serializer +}; +const deleteOperationSpec: coreClient.OperationSpec = { + path: + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/{deviceName}/orders/default", + httpMethod: "DELETE", responses: { 200: {}, + 201: {}, 202: {}, 204: {}, default: { bodyMapper: Mappers.CloudError } }, + queryParameters: [Parameters.apiVersion], + urlParameters: [ + Parameters.$host, + Parameters.subscriptionId, + Parameters.resourceGroupName, + Parameters.deviceName + ], + headerParameters: [Parameters.accept], serializer }; - -const listByDataBoxEdgeDeviceNextOperationSpec: msRest.OperationSpec = { - httpMethod: "GET", - baseUrl: "https://management.azure.com", +const listByDataBoxEdgeDeviceNextOperationSpec: coreClient.OperationSpec = { path: "{nextLink}", - urlParameters: [ - Parameters.nextPageLink - ], - headerParameters: [ - Parameters.acceptLanguage - ], + httpMethod: "GET", responses: { 200: { bodyMapper: Mappers.OrderList @@ -311,5 +449,14 @@ const listByDataBoxEdgeDeviceNextOperationSpec: msRest.OperationSpec = { bodyMapper: Mappers.CloudError } }, + queryParameters: [Parameters.apiVersion], + urlParameters: [ + Parameters.$host, + Parameters.nextLink, + Parameters.subscriptionId, + Parameters.resourceGroupName, + Parameters.deviceName + ], + headerParameters: [Parameters.accept], serializer }; diff --git a/sdk/databoxedge/arm-databoxedge-profile-2020-09-01-hybrid/src/operations/roles.ts b/sdk/databoxedge/arm-databoxedge-profile-2020-09-01-hybrid/src/operations/roles.ts index bbde415fc14f..941c8621ce06 100644 --- a/sdk/databoxedge/arm-databoxedge-profile-2020-09-01-hybrid/src/operations/roles.ts +++ b/sdk/databoxedge/arm-databoxedge-profile-2020-09-01-hybrid/src/operations/roles.ts @@ -1,29 +1,42 @@ /* - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for - * license information. + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. * * 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 * 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/rolesMappers"; +import { PagedAsyncIterableIterator } from "@azure/core-paging"; +import { Roles } from "../operationsInterfaces"; +import * as coreClient from "@azure/core-client"; +import * as Mappers from "../models/mappers"; import * as Parameters from "../models/parameters"; -import { DataBoxEdgeManagementClientContext } from "../dataBoxEdgeManagementClientContext"; +import { DataBoxEdgeManagementClient } from "../dataBoxEdgeManagementClient"; +import { PollerLike, PollOperationState, LroEngine } from "@azure/core-lro"; +import { LroImpl } from "../lroImpl"; +import { + RoleUnion, + RolesListByDataBoxEdgeDeviceNextOptionalParams, + RolesListByDataBoxEdgeDeviceOptionalParams, + RolesListByDataBoxEdgeDeviceResponse, + RolesGetOptionalParams, + RolesGetResponse, + RolesCreateOrUpdateOptionalParams, + RolesCreateOrUpdateResponse, + RolesDeleteOptionalParams, + RolesListByDataBoxEdgeDeviceNextResponse +} from "../models"; -/** Class representing a Roles. */ -export class Roles { - private readonly client: DataBoxEdgeManagementClientContext; +/// +/** Class containing Roles operations. */ +export class RolesImpl implements Roles { + private readonly client: DataBoxEdgeManagementClient; /** - * Create a Roles. - * @param {DataBoxEdgeManagementClientContext} client Reference to the service client. + * Initialize a new instance of the class Roles class. + * @param client Reference to the service client */ - constructor(client: DataBoxEdgeManagementClientContext) { + constructor(client: DataBoxEdgeManagementClient) { this.client = client; } @@ -31,117 +44,265 @@ export class Roles { * Lists all the roles configured in a Data Box Edge/Data Box Gateway device. * @param deviceName The device name. * @param resourceGroupName The resource group name. - * @param [options] The optional parameters - * @returns Promise + * @param options The options parameters. */ - listByDataBoxEdgeDevice(deviceName: string, resourceGroupName: string, options?: msRest.RequestOptionsBase): Promise; - /** - * @param deviceName The device name. - * @param resourceGroupName The resource group name. - * @param callback The callback - */ - listByDataBoxEdgeDevice(deviceName: string, resourceGroupName: string, callback: msRest.ServiceCallback): void; - /** - * @param deviceName The device name. - * @param resourceGroupName The resource group name. - * @param options The optional parameters - * @param callback The callback - */ - listByDataBoxEdgeDevice(deviceName: string, resourceGroupName: string, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; - listByDataBoxEdgeDevice(deviceName: string, resourceGroupName: string, options?: msRest.RequestOptionsBase | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { - return this.client.sendOperationRequest( - { + public listByDataBoxEdgeDevice( + deviceName: string, + resourceGroupName: string, + options?: RolesListByDataBoxEdgeDeviceOptionalParams + ): PagedAsyncIterableIterator { + const iter = this.listByDataBoxEdgeDevicePagingAll( + deviceName, + resourceGroupName, + options + ); + return { + next() { + return iter.next(); + }, + [Symbol.asyncIterator]() { + return this; + }, + byPage: () => { + return this.listByDataBoxEdgeDevicePagingPage( + deviceName, + resourceGroupName, + options + ); + } + }; + } + + private async *listByDataBoxEdgeDevicePagingPage( + deviceName: string, + resourceGroupName: string, + options?: RolesListByDataBoxEdgeDeviceOptionalParams + ): AsyncIterableIterator { + let result = await this._listByDataBoxEdgeDevice( + deviceName, + resourceGroupName, + options + ); + yield result.value || []; + let continuationToken = result.nextLink; + while (continuationToken) { + result = await this._listByDataBoxEdgeDeviceNext( deviceName, resourceGroupName, + continuationToken, options - }, - listByDataBoxEdgeDeviceOperationSpec, - callback) as Promise; + ); + continuationToken = result.nextLink; + yield result.value || []; + } + } + + private async *listByDataBoxEdgeDevicePagingAll( + deviceName: string, + resourceGroupName: string, + options?: RolesListByDataBoxEdgeDeviceOptionalParams + ): AsyncIterableIterator { + for await (const page of this.listByDataBoxEdgeDevicePagingPage( + deviceName, + resourceGroupName, + options + )) { + yield* page; + } } /** - * Gets a specific role by name. - * @param deviceName The device name. - * @param name The role name. - * @param resourceGroupName The resource group name. - * @param [options] The optional parameters - * @returns Promise - */ - get(deviceName: string, name: string, resourceGroupName: string, options?: msRest.RequestOptionsBase): Promise; - /** + * Lists all the roles configured in a Data Box Edge/Data Box Gateway device. * @param deviceName The device name. - * @param name The role name. * @param resourceGroupName The resource group name. - * @param callback The callback + * @param options The options parameters. */ - get(deviceName: string, name: string, resourceGroupName: string, callback: msRest.ServiceCallback): void; + private _listByDataBoxEdgeDevice( + deviceName: string, + resourceGroupName: string, + options?: RolesListByDataBoxEdgeDeviceOptionalParams + ): Promise { + return this.client.sendOperationRequest( + { deviceName, resourceGroupName, options }, + listByDataBoxEdgeDeviceOperationSpec + ); + } + /** + * Gets a specific role by name. * @param deviceName The device name. * @param name The role name. * @param resourceGroupName The resource group name. - * @param options The optional parameters - * @param callback The callback + * @param options The options parameters. */ - get(deviceName: string, name: string, resourceGroupName: string, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; - get(deviceName: string, name: string, resourceGroupName: string, options?: msRest.RequestOptionsBase | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { + get( + deviceName: string, + name: string, + resourceGroupName: string, + options?: RolesGetOptionalParams + ): Promise { return this.client.sendOperationRequest( - { - deviceName, - name, - resourceGroupName, - options - }, - getOperationSpec, - callback) as Promise; + { deviceName, name, resourceGroupName, options }, + getOperationSpec + ); } /** * Create or update a role. * @param deviceName The device name. * @param name The role name. - * @param role The role properties. * @param resourceGroupName The resource group name. - * @param [options] The optional parameters - * @returns Promise + * @param role The role properties. + * @param options The options parameters. */ - createOrUpdate(deviceName: string, name: string, role: Models.RoleUnion, resourceGroupName: string, options?: msRest.RequestOptionsBase): Promise { - return this.beginCreateOrUpdate(deviceName,name,role,resourceGroupName,options) - .then(lroPoller => lroPoller.pollUntilFinished()) as Promise; + async beginCreateOrUpdate( + deviceName: string, + name: string, + resourceGroupName: string, + role: RoleUnion, + options?: RolesCreateOrUpdateOptionalParams + ): Promise< + PollerLike< + PollOperationState, + RolesCreateOrUpdateResponse + > + > { + const directSendOperation = async ( + args: coreClient.OperationArguments, + spec: coreClient.OperationSpec + ): Promise => { + return this.client.sendOperationRequest(args, spec); + }; + const sendOperation = async ( + args: coreClient.OperationArguments, + spec: coreClient.OperationSpec + ) => { + let currentRawResponse: + | coreClient.FullOperationResponse + | undefined = undefined; + const providedCallback = args.options?.onResponse; + const callback: coreClient.RawResponseCallback = ( + rawResponse: coreClient.FullOperationResponse, + flatResponse: unknown + ) => { + currentRawResponse = rawResponse; + providedCallback?.(rawResponse, flatResponse); + }; + const updatedArgs = { + ...args, + options: { + ...args.options, + onResponse: callback + } + }; + const flatResponse = await directSendOperation(updatedArgs, spec); + return { + flatResponse, + rawResponse: { + statusCode: currentRawResponse!.status, + body: currentRawResponse!.parsedBody, + headers: currentRawResponse!.headers.toJSON() + } + }; + }; + + const lro = new LroImpl( + sendOperation, + { deviceName, name, resourceGroupName, role, options }, + createOrUpdateOperationSpec + ); + return new LroEngine(lro, { + resumeFrom: options?.resumeFrom, + intervalInMs: options?.updateIntervalInMs + }); } /** - * Deletes the role on the device. + * Create or update a role. * @param deviceName The device name. * @param name The role name. * @param resourceGroupName The resource group name. - * @param [options] The optional parameters - * @returns Promise + * @param role The role properties. + * @param options The options parameters. */ - deleteMethod(deviceName: string, name: string, resourceGroupName: string, options?: msRest.RequestOptionsBase): Promise { - return this.beginDeleteMethod(deviceName,name,resourceGroupName,options) - .then(lroPoller => lroPoller.pollUntilFinished()); + async beginCreateOrUpdateAndWait( + deviceName: string, + name: string, + resourceGroupName: string, + role: RoleUnion, + options?: RolesCreateOrUpdateOptionalParams + ): Promise { + const poller = await this.beginCreateOrUpdate( + deviceName, + name, + resourceGroupName, + role, + options + ); + return poller.pollUntilDone(); } /** - * Create or update a role. + * Deletes the role on the device. * @param deviceName The device name. * @param name The role name. - * @param role The role properties. * @param resourceGroupName The resource group name. - * @param [options] The optional parameters - * @returns Promise + * @param options The options parameters. */ - beginCreateOrUpdate(deviceName: string, name: string, role: Models.RoleUnion, resourceGroupName: string, options?: msRest.RequestOptionsBase): Promise { - return this.client.sendLRORequest( - { - deviceName, - name, - role, - resourceGroupName, - options - }, - beginCreateOrUpdateOperationSpec, - options); + async beginDelete( + deviceName: string, + name: string, + resourceGroupName: string, + options?: RolesDeleteOptionalParams + ): Promise, void>> { + const directSendOperation = async ( + args: coreClient.OperationArguments, + spec: coreClient.OperationSpec + ): Promise => { + return this.client.sendOperationRequest(args, spec); + }; + const sendOperation = async ( + args: coreClient.OperationArguments, + spec: coreClient.OperationSpec + ) => { + let currentRawResponse: + | coreClient.FullOperationResponse + | undefined = undefined; + const providedCallback = args.options?.onResponse; + const callback: coreClient.RawResponseCallback = ( + rawResponse: coreClient.FullOperationResponse, + flatResponse: unknown + ) => { + currentRawResponse = rawResponse; + providedCallback?.(rawResponse, flatResponse); + }; + const updatedArgs = { + ...args, + options: { + ...args.options, + onResponse: callback + } + }; + const flatResponse = await directSendOperation(updatedArgs, spec); + return { + flatResponse, + rawResponse: { + statusCode: currentRawResponse!.status, + body: currentRawResponse!.parsedBody, + headers: currentRawResponse!.headers.toJSON() + } + }; + }; + + const lro = new LroImpl( + sendOperation, + { deviceName, name, resourceGroupName, options }, + deleteOperationSpec + ); + return new LroEngine(lro, { + resumeFrom: options?.resumeFrom, + intervalInMs: options?.updateIntervalInMs + }); } /** @@ -149,66 +310,50 @@ export class Roles { * @param deviceName The device name. * @param name The role name. * @param resourceGroupName The resource group name. - * @param [options] The optional parameters - * @returns Promise + * @param options The options parameters. */ - beginDeleteMethod(deviceName: string, name: string, resourceGroupName: string, options?: msRest.RequestOptionsBase): Promise { - return this.client.sendLRORequest( - { - deviceName, - name, - resourceGroupName, - options - }, - beginDeleteMethodOperationSpec, - options); + async beginDeleteAndWait( + deviceName: string, + name: string, + resourceGroupName: string, + options?: RolesDeleteOptionalParams + ): Promise { + const poller = await this.beginDelete( + deviceName, + name, + resourceGroupName, + options + ); + return poller.pollUntilDone(); } /** - * Lists all the roles configured in a Data Box Edge/Data Box Gateway device. - * @param nextPageLink The NextLink from the previous successful call to List operation. - * @param [options] The optional parameters - * @returns Promise - */ - listByDataBoxEdgeDeviceNext(nextPageLink: string, options?: msRest.RequestOptionsBase): Promise; - /** - * @param nextPageLink The NextLink from the previous successful call to List operation. - * @param callback The callback - */ - listByDataBoxEdgeDeviceNext(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 + * ListByDataBoxEdgeDeviceNext + * @param deviceName The device name. + * @param resourceGroupName The resource group name. + * @param nextLink The nextLink from the previous successful call to the ListByDataBoxEdgeDevice + * method. + * @param options The options parameters. */ - listByDataBoxEdgeDeviceNext(nextPageLink: string, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; - listByDataBoxEdgeDeviceNext(nextPageLink: string, options?: msRest.RequestOptionsBase | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { + private _listByDataBoxEdgeDeviceNext( + deviceName: string, + resourceGroupName: string, + nextLink: string, + options?: RolesListByDataBoxEdgeDeviceNextOptionalParams + ): Promise { return this.client.sendOperationRequest( - { - nextPageLink, - options - }, - listByDataBoxEdgeDeviceNextOperationSpec, - callback) as Promise; + { deviceName, resourceGroupName, nextLink, options }, + listByDataBoxEdgeDeviceNextOperationSpec + ); } } - // Operation Specifications -const serializer = new msRest.Serializer(Mappers); -const listByDataBoxEdgeDeviceOperationSpec: msRest.OperationSpec = { +const serializer = coreClient.createSerializer(Mappers, /* isXml */ false); + +const listByDataBoxEdgeDeviceOperationSpec: coreClient.OperationSpec = { + path: + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/{deviceName}/roles", httpMethod: "GET", - path: "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/{deviceName}/roles", - urlParameters: [ - Parameters.deviceName, - Parameters.subscriptionId, - Parameters.resourceGroupName - ], - queryParameters: [ - Parameters.apiVersion - ], - headerParameters: [ - Parameters.acceptLanguage - ], responses: { 200: { bodyMapper: Mappers.RoleList @@ -217,24 +362,20 @@ const listByDataBoxEdgeDeviceOperationSpec: msRest.OperationSpec = { bodyMapper: Mappers.CloudError } }, - serializer -}; - -const getOperationSpec: msRest.OperationSpec = { - httpMethod: "GET", - path: "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/{deviceName}/roles/{name}", + queryParameters: [Parameters.apiVersion], urlParameters: [ - Parameters.deviceName, - Parameters.name, + Parameters.$host, Parameters.subscriptionId, - Parameters.resourceGroupName - ], - queryParameters: [ - Parameters.apiVersion - ], - headerParameters: [ - Parameters.acceptLanguage + Parameters.resourceGroupName, + Parameters.deviceName ], + headerParameters: [Parameters.accept], + serializer +}; +const getOperationSpec: coreClient.OperationSpec = { + path: + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/{deviceName}/roles/{name}", + httpMethod: "GET", responses: { 200: { bodyMapper: Mappers.Role @@ -243,79 +384,78 @@ const getOperationSpec: msRest.OperationSpec = { bodyMapper: Mappers.CloudError } }, - serializer -}; - -const beginCreateOrUpdateOperationSpec: msRest.OperationSpec = { - httpMethod: "PUT", - path: "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/{deviceName}/roles/{name}", + queryParameters: [Parameters.apiVersion], urlParameters: [ - Parameters.deviceName, - Parameters.name, + Parameters.$host, Parameters.subscriptionId, - Parameters.resourceGroupName - ], - queryParameters: [ - Parameters.apiVersion - ], - headerParameters: [ - Parameters.acceptLanguage + Parameters.resourceGroupName, + Parameters.deviceName, + Parameters.name ], - requestBody: { - parameterPath: "role", - mapper: { - ...Mappers.Role, - required: true - } - }, + headerParameters: [Parameters.accept], + serializer +}; +const createOrUpdateOperationSpec: coreClient.OperationSpec = { + path: + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/{deviceName}/roles/{name}", + httpMethod: "PUT", responses: { 200: { bodyMapper: Mappers.Role }, - 202: {}, + 201: { + bodyMapper: Mappers.Role + }, + 202: { + bodyMapper: Mappers.Role + }, + 204: { + bodyMapper: Mappers.Role + }, default: { bodyMapper: Mappers.CloudError } }, - serializer -}; - -const beginDeleteMethodOperationSpec: msRest.OperationSpec = { - httpMethod: "DELETE", - path: "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/{deviceName}/roles/{name}", + requestBody: Parameters.role, + queryParameters: [Parameters.apiVersion], urlParameters: [ - Parameters.deviceName, - Parameters.name, + Parameters.$host, Parameters.subscriptionId, - Parameters.resourceGroupName - ], - queryParameters: [ - Parameters.apiVersion - ], - headerParameters: [ - Parameters.acceptLanguage + Parameters.resourceGroupName, + Parameters.deviceName, + Parameters.name ], + headerParameters: [Parameters.accept, Parameters.contentType], + mediaType: "json", + serializer +}; +const deleteOperationSpec: coreClient.OperationSpec = { + path: + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/{deviceName}/roles/{name}", + httpMethod: "DELETE", responses: { 200: {}, + 201: {}, 202: {}, 204: {}, default: { bodyMapper: Mappers.CloudError } }, + queryParameters: [Parameters.apiVersion], + urlParameters: [ + Parameters.$host, + Parameters.subscriptionId, + Parameters.resourceGroupName, + Parameters.deviceName, + Parameters.name + ], + headerParameters: [Parameters.accept], serializer }; - -const listByDataBoxEdgeDeviceNextOperationSpec: msRest.OperationSpec = { - httpMethod: "GET", - baseUrl: "https://management.azure.com", +const listByDataBoxEdgeDeviceNextOperationSpec: coreClient.OperationSpec = { path: "{nextLink}", - urlParameters: [ - Parameters.nextPageLink - ], - headerParameters: [ - Parameters.acceptLanguage - ], + httpMethod: "GET", responses: { 200: { bodyMapper: Mappers.RoleList @@ -324,5 +464,14 @@ const listByDataBoxEdgeDeviceNextOperationSpec: msRest.OperationSpec = { bodyMapper: Mappers.CloudError } }, + queryParameters: [Parameters.apiVersion], + urlParameters: [ + Parameters.$host, + Parameters.nextLink, + Parameters.subscriptionId, + Parameters.resourceGroupName, + Parameters.deviceName + ], + headerParameters: [Parameters.accept], serializer }; diff --git a/sdk/databoxedge/arm-databoxedge-profile-2020-09-01-hybrid/src/operations/shares.ts b/sdk/databoxedge/arm-databoxedge-profile-2020-09-01-hybrid/src/operations/shares.ts index 39d13d53d5b5..77f53bac22c0 100644 --- a/sdk/databoxedge/arm-databoxedge-profile-2020-09-01-hybrid/src/operations/shares.ts +++ b/sdk/databoxedge/arm-databoxedge-profile-2020-09-01-hybrid/src/operations/shares.ts @@ -1,247 +1,445 @@ /* - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for - * license information. + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. * * 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 * 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/sharesMappers"; +import { PagedAsyncIterableIterator } from "@azure/core-paging"; +import { Shares } from "../operationsInterfaces"; +import * as coreClient from "@azure/core-client"; +import * as Mappers from "../models/mappers"; import * as Parameters from "../models/parameters"; -import { DataBoxEdgeManagementClientContext } from "../dataBoxEdgeManagementClientContext"; +import { DataBoxEdgeManagementClient } from "../dataBoxEdgeManagementClient"; +import { PollerLike, PollOperationState, LroEngine } from "@azure/core-lro"; +import { LroImpl } from "../lroImpl"; +import { + Share, + SharesListByDataBoxEdgeDeviceNextOptionalParams, + SharesListByDataBoxEdgeDeviceOptionalParams, + SharesListByDataBoxEdgeDeviceResponse, + SharesGetOptionalParams, + SharesGetResponse, + SharesCreateOrUpdateOptionalParams, + SharesCreateOrUpdateResponse, + SharesDeleteOptionalParams, + SharesRefreshOptionalParams, + SharesListByDataBoxEdgeDeviceNextResponse +} from "../models"; -/** Class representing a Shares. */ -export class Shares { - private readonly client: DataBoxEdgeManagementClientContext; +/// +/** Class containing Shares operations. */ +export class SharesImpl implements Shares { + private readonly client: DataBoxEdgeManagementClient; /** - * Create a Shares. - * @param {DataBoxEdgeManagementClientContext} client Reference to the service client. + * Initialize a new instance of the class Shares class. + * @param client Reference to the service client */ - constructor(client: DataBoxEdgeManagementClientContext) { + constructor(client: DataBoxEdgeManagementClient) { this.client = client; } /** - * @summary Lists all the shares in a Data Box Edge/Data Box Gateway device. + * Lists all the shares in a Data Box Edge/Data Box Gateway device. * @param deviceName The device name. * @param resourceGroupName The resource group name. - * @param [options] The optional parameters - * @returns Promise + * @param options The options parameters. */ - listByDataBoxEdgeDevice(deviceName: string, resourceGroupName: string, options?: msRest.RequestOptionsBase): Promise; - /** - * @param deviceName The device name. - * @param resourceGroupName The resource group name. - * @param callback The callback - */ - listByDataBoxEdgeDevice(deviceName: string, resourceGroupName: string, callback: msRest.ServiceCallback): void; - /** - * @param deviceName The device name. - * @param resourceGroupName The resource group name. - * @param options The optional parameters - * @param callback The callback - */ - listByDataBoxEdgeDevice(deviceName: string, resourceGroupName: string, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; - listByDataBoxEdgeDevice(deviceName: string, resourceGroupName: string, options?: msRest.RequestOptionsBase | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { - return this.client.sendOperationRequest( - { + public listByDataBoxEdgeDevice( + deviceName: string, + resourceGroupName: string, + options?: SharesListByDataBoxEdgeDeviceOptionalParams + ): PagedAsyncIterableIterator { + const iter = this.listByDataBoxEdgeDevicePagingAll( + deviceName, + resourceGroupName, + options + ); + return { + next() { + return iter.next(); + }, + [Symbol.asyncIterator]() { + return this; + }, + byPage: () => { + return this.listByDataBoxEdgeDevicePagingPage( + deviceName, + resourceGroupName, + options + ); + } + }; + } + + private async *listByDataBoxEdgeDevicePagingPage( + deviceName: string, + resourceGroupName: string, + options?: SharesListByDataBoxEdgeDeviceOptionalParams + ): AsyncIterableIterator { + let result = await this._listByDataBoxEdgeDevice( + deviceName, + resourceGroupName, + options + ); + yield result.value || []; + let continuationToken = result.nextLink; + while (continuationToken) { + result = await this._listByDataBoxEdgeDeviceNext( deviceName, resourceGroupName, + continuationToken, options - }, - listByDataBoxEdgeDeviceOperationSpec, - callback) as Promise; + ); + continuationToken = result.nextLink; + yield result.value || []; + } + } + + private async *listByDataBoxEdgeDevicePagingAll( + deviceName: string, + resourceGroupName: string, + options?: SharesListByDataBoxEdgeDeviceOptionalParams + ): AsyncIterableIterator { + for await (const page of this.listByDataBoxEdgeDevicePagingPage( + deviceName, + resourceGroupName, + options + )) { + yield* page; + } } /** - * @summary Gets a share by name. - * @param deviceName The device name. - * @param name The share name. - * @param resourceGroupName The resource group name. - * @param [options] The optional parameters - * @returns Promise - */ - get(deviceName: string, name: string, resourceGroupName: string, options?: msRest.RequestOptionsBase): Promise; - /** + * Lists all the shares in a Data Box Edge/Data Box Gateway device. * @param deviceName The device name. - * @param name The share name. * @param resourceGroupName The resource group name. - * @param callback The callback + * @param options The options parameters. */ - get(deviceName: string, name: string, resourceGroupName: string, callback: msRest.ServiceCallback): void; + private _listByDataBoxEdgeDevice( + deviceName: string, + resourceGroupName: string, + options?: SharesListByDataBoxEdgeDeviceOptionalParams + ): Promise { + return this.client.sendOperationRequest( + { deviceName, resourceGroupName, options }, + listByDataBoxEdgeDeviceOperationSpec + ); + } + /** + * Gets a share by name. * @param deviceName The device name. * @param name The share name. * @param resourceGroupName The resource group name. - * @param options The optional parameters - * @param callback The callback + * @param options The options parameters. */ - get(deviceName: string, name: string, resourceGroupName: string, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; - get(deviceName: string, name: string, resourceGroupName: string, options?: msRest.RequestOptionsBase | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { + get( + deviceName: string, + name: string, + resourceGroupName: string, + options?: SharesGetOptionalParams + ): Promise { return this.client.sendOperationRequest( - { - deviceName, - name, - resourceGroupName, - options - }, - getOperationSpec, - callback) as Promise; + { deviceName, name, resourceGroupName, options }, + getOperationSpec + ); } /** - * @summary Creates a new share or updates an existing share on the device. + * Creates a new share or updates an existing share on the device. * @param deviceName The device name. * @param name The share name. - * @param share The share properties. * @param resourceGroupName The resource group name. - * @param [options] The optional parameters - * @returns Promise + * @param share The share properties. + * @param options The options parameters. */ - createOrUpdate(deviceName: string, name: string, share: Models.Share, resourceGroupName: string, options?: msRest.RequestOptionsBase): Promise { - return this.beginCreateOrUpdate(deviceName,name,share,resourceGroupName,options) - .then(lroPoller => lroPoller.pollUntilFinished()) as Promise; + async beginCreateOrUpdate( + deviceName: string, + name: string, + resourceGroupName: string, + share: Share, + options?: SharesCreateOrUpdateOptionalParams + ): Promise< + PollerLike< + PollOperationState, + SharesCreateOrUpdateResponse + > + > { + const directSendOperation = async ( + args: coreClient.OperationArguments, + spec: coreClient.OperationSpec + ): Promise => { + return this.client.sendOperationRequest(args, spec); + }; + const sendOperation = async ( + args: coreClient.OperationArguments, + spec: coreClient.OperationSpec + ) => { + let currentRawResponse: + | coreClient.FullOperationResponse + | undefined = undefined; + const providedCallback = args.options?.onResponse; + const callback: coreClient.RawResponseCallback = ( + rawResponse: coreClient.FullOperationResponse, + flatResponse: unknown + ) => { + currentRawResponse = rawResponse; + providedCallback?.(rawResponse, flatResponse); + }; + const updatedArgs = { + ...args, + options: { + ...args.options, + onResponse: callback + } + }; + const flatResponse = await directSendOperation(updatedArgs, spec); + return { + flatResponse, + rawResponse: { + statusCode: currentRawResponse!.status, + body: currentRawResponse!.parsedBody, + headers: currentRawResponse!.headers.toJSON() + } + }; + }; + + const lro = new LroImpl( + sendOperation, + { deviceName, name, resourceGroupName, share, options }, + createOrUpdateOperationSpec + ); + return new LroEngine(lro, { + resumeFrom: options?.resumeFrom, + intervalInMs: options?.updateIntervalInMs + }); } /** - * Deletes the share on the Data Box Edge/Data Box Gateway device. + * Creates a new share or updates an existing share on the device. * @param deviceName The device name. * @param name The share name. * @param resourceGroupName The resource group name. - * @param [options] The optional parameters - * @returns Promise + * @param share The share properties. + * @param options The options parameters. */ - deleteMethod(deviceName: string, name: string, resourceGroupName: string, options?: msRest.RequestOptionsBase): Promise { - return this.beginDeleteMethod(deviceName,name,resourceGroupName,options) - .then(lroPoller => lroPoller.pollUntilFinished()); + async beginCreateOrUpdateAndWait( + deviceName: string, + name: string, + resourceGroupName: string, + share: Share, + options?: SharesCreateOrUpdateOptionalParams + ): Promise { + const poller = await this.beginCreateOrUpdate( + deviceName, + name, + resourceGroupName, + share, + options + ); + return poller.pollUntilDone(); } /** - * @summary Refreshes the share metadata with the data from the cloud. + * Deletes the share on the Data Box Edge/Data Box Gateway device. * @param deviceName The device name. * @param name The share name. * @param resourceGroupName The resource group name. - * @param [options] The optional parameters - * @returns Promise + * @param options The options parameters. */ - refresh(deviceName: string, name: string, resourceGroupName: string, options?: msRest.RequestOptionsBase): Promise { - return this.beginRefresh(deviceName,name,resourceGroupName,options) - .then(lroPoller => lroPoller.pollUntilFinished()); + async beginDelete( + deviceName: string, + name: string, + resourceGroupName: string, + options?: SharesDeleteOptionalParams + ): Promise, void>> { + const directSendOperation = async ( + args: coreClient.OperationArguments, + spec: coreClient.OperationSpec + ): Promise => { + return this.client.sendOperationRequest(args, spec); + }; + const sendOperation = async ( + args: coreClient.OperationArguments, + spec: coreClient.OperationSpec + ) => { + let currentRawResponse: + | coreClient.FullOperationResponse + | undefined = undefined; + const providedCallback = args.options?.onResponse; + const callback: coreClient.RawResponseCallback = ( + rawResponse: coreClient.FullOperationResponse, + flatResponse: unknown + ) => { + currentRawResponse = rawResponse; + providedCallback?.(rawResponse, flatResponse); + }; + const updatedArgs = { + ...args, + options: { + ...args.options, + onResponse: callback + } + }; + const flatResponse = await directSendOperation(updatedArgs, spec); + return { + flatResponse, + rawResponse: { + statusCode: currentRawResponse!.status, + body: currentRawResponse!.parsedBody, + headers: currentRawResponse!.headers.toJSON() + } + }; + }; + + const lro = new LroImpl( + sendOperation, + { deviceName, name, resourceGroupName, options }, + deleteOperationSpec + ); + return new LroEngine(lro, { + resumeFrom: options?.resumeFrom, + intervalInMs: options?.updateIntervalInMs + }); } /** - * @summary Creates a new share or updates an existing share on the device. + * Deletes the share on the Data Box Edge/Data Box Gateway device. * @param deviceName The device name. * @param name The share name. - * @param share The share properties. * @param resourceGroupName The resource group name. - * @param [options] The optional parameters - * @returns Promise + * @param options The options parameters. */ - beginCreateOrUpdate(deviceName: string, name: string, share: Models.Share, resourceGroupName: string, options?: msRest.RequestOptionsBase): Promise { - return this.client.sendLRORequest( - { - deviceName, - name, - share, - resourceGroupName, - options - }, - beginCreateOrUpdateOperationSpec, - options); + async beginDeleteAndWait( + deviceName: string, + name: string, + resourceGroupName: string, + options?: SharesDeleteOptionalParams + ): Promise { + const poller = await this.beginDelete( + deviceName, + name, + resourceGroupName, + options + ); + return poller.pollUntilDone(); } /** - * Deletes the share on the Data Box Edge/Data Box Gateway device. + * Refreshes the share metadata with the data from the cloud. * @param deviceName The device name. * @param name The share name. * @param resourceGroupName The resource group name. - * @param [options] The optional parameters - * @returns Promise + * @param options The options parameters. */ - beginDeleteMethod(deviceName: string, name: string, resourceGroupName: string, options?: msRest.RequestOptionsBase): Promise { - return this.client.sendLRORequest( - { - deviceName, - name, - resourceGroupName, - options - }, - beginDeleteMethodOperationSpec, - options); + async beginRefresh( + deviceName: string, + name: string, + resourceGroupName: string, + options?: SharesRefreshOptionalParams + ): Promise, void>> { + const directSendOperation = async ( + args: coreClient.OperationArguments, + spec: coreClient.OperationSpec + ): Promise => { + return this.client.sendOperationRequest(args, spec); + }; + const sendOperation = async ( + args: coreClient.OperationArguments, + spec: coreClient.OperationSpec + ) => { + let currentRawResponse: + | coreClient.FullOperationResponse + | undefined = undefined; + const providedCallback = args.options?.onResponse; + const callback: coreClient.RawResponseCallback = ( + rawResponse: coreClient.FullOperationResponse, + flatResponse: unknown + ) => { + currentRawResponse = rawResponse; + providedCallback?.(rawResponse, flatResponse); + }; + const updatedArgs = { + ...args, + options: { + ...args.options, + onResponse: callback + } + }; + const flatResponse = await directSendOperation(updatedArgs, spec); + return { + flatResponse, + rawResponse: { + statusCode: currentRawResponse!.status, + body: currentRawResponse!.parsedBody, + headers: currentRawResponse!.headers.toJSON() + } + }; + }; + + const lro = new LroImpl( + sendOperation, + { deviceName, name, resourceGroupName, options }, + refreshOperationSpec + ); + return new LroEngine(lro, { + resumeFrom: options?.resumeFrom, + intervalInMs: options?.updateIntervalInMs + }); } /** - * @summary Refreshes the share metadata with the data from the cloud. + * Refreshes the share metadata with the data from the cloud. * @param deviceName The device name. * @param name The share name. * @param resourceGroupName The resource group name. - * @param [options] The optional parameters - * @returns Promise + * @param options The options parameters. */ - beginRefresh(deviceName: string, name: string, resourceGroupName: string, options?: msRest.RequestOptionsBase): Promise { - return this.client.sendLRORequest( - { - deviceName, - name, - resourceGroupName, - options - }, - beginRefreshOperationSpec, - options); + async beginRefreshAndWait( + deviceName: string, + name: string, + resourceGroupName: string, + options?: SharesRefreshOptionalParams + ): Promise { + const poller = await this.beginRefresh( + deviceName, + name, + resourceGroupName, + options + ); + return poller.pollUntilDone(); } /** - * @summary Lists all the shares in a Data Box Edge/Data Box Gateway device. - * @param nextPageLink The NextLink from the previous successful call to List operation. - * @param [options] The optional parameters - * @returns Promise - */ - listByDataBoxEdgeDeviceNext(nextPageLink: string, options?: msRest.RequestOptionsBase): Promise; - /** - * @param nextPageLink The NextLink from the previous successful call to List operation. - * @param callback The callback - */ - listByDataBoxEdgeDeviceNext(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 + * ListByDataBoxEdgeDeviceNext + * @param deviceName The device name. + * @param resourceGroupName The resource group name. + * @param nextLink The nextLink from the previous successful call to the ListByDataBoxEdgeDevice + * method. + * @param options The options parameters. */ - listByDataBoxEdgeDeviceNext(nextPageLink: string, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; - listByDataBoxEdgeDeviceNext(nextPageLink: string, options?: msRest.RequestOptionsBase | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { + private _listByDataBoxEdgeDeviceNext( + deviceName: string, + resourceGroupName: string, + nextLink: string, + options?: SharesListByDataBoxEdgeDeviceNextOptionalParams + ): Promise { return this.client.sendOperationRequest( - { - nextPageLink, - options - }, - listByDataBoxEdgeDeviceNextOperationSpec, - callback) as Promise; + { deviceName, resourceGroupName, nextLink, options }, + listByDataBoxEdgeDeviceNextOperationSpec + ); } } - // Operation Specifications -const serializer = new msRest.Serializer(Mappers); -const listByDataBoxEdgeDeviceOperationSpec: msRest.OperationSpec = { +const serializer = coreClient.createSerializer(Mappers, /* isXml */ false); + +const listByDataBoxEdgeDeviceOperationSpec: coreClient.OperationSpec = { + path: + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/{deviceName}/shares", httpMethod: "GET", - path: "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/{deviceName}/shares", - urlParameters: [ - Parameters.deviceName, - Parameters.subscriptionId, - Parameters.resourceGroupName - ], - queryParameters: [ - Parameters.apiVersion - ], - headerParameters: [ - Parameters.acceptLanguage - ], responses: { 200: { bodyMapper: Mappers.ShareList @@ -250,24 +448,20 @@ const listByDataBoxEdgeDeviceOperationSpec: msRest.OperationSpec = { bodyMapper: Mappers.CloudError } }, - serializer -}; - -const getOperationSpec: msRest.OperationSpec = { - httpMethod: "GET", - path: "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/{deviceName}/shares/{name}", + queryParameters: [Parameters.apiVersion], urlParameters: [ - Parameters.deviceName, - Parameters.name, + Parameters.$host, Parameters.subscriptionId, - Parameters.resourceGroupName - ], - queryParameters: [ - Parameters.apiVersion - ], - headerParameters: [ - Parameters.acceptLanguage + Parameters.resourceGroupName, + Parameters.deviceName ], + headerParameters: [Parameters.accept], + serializer +}; +const getOperationSpec: coreClient.OperationSpec = { + path: + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/{deviceName}/shares/{name}", + httpMethod: "GET", responses: { 200: { bodyMapper: Mappers.Share @@ -276,104 +470,102 @@ const getOperationSpec: msRest.OperationSpec = { bodyMapper: Mappers.CloudError } }, - serializer -}; - -const beginCreateOrUpdateOperationSpec: msRest.OperationSpec = { - httpMethod: "PUT", - path: "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/{deviceName}/shares/{name}", + queryParameters: [Parameters.apiVersion], urlParameters: [ - Parameters.deviceName, - Parameters.name, + Parameters.$host, Parameters.subscriptionId, - Parameters.resourceGroupName - ], - queryParameters: [ - Parameters.apiVersion - ], - headerParameters: [ - Parameters.acceptLanguage + Parameters.resourceGroupName, + Parameters.deviceName, + Parameters.name ], - requestBody: { - parameterPath: "share", - mapper: { - ...Mappers.Share, - required: true - } - }, + headerParameters: [Parameters.accept], + serializer +}; +const createOrUpdateOperationSpec: coreClient.OperationSpec = { + path: + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/{deviceName}/shares/{name}", + httpMethod: "PUT", responses: { 200: { bodyMapper: Mappers.Share }, - 202: {}, + 201: { + bodyMapper: Mappers.Share + }, + 202: { + bodyMapper: Mappers.Share + }, + 204: { + bodyMapper: Mappers.Share + }, default: { bodyMapper: Mappers.CloudError } }, - serializer -}; - -const beginDeleteMethodOperationSpec: msRest.OperationSpec = { - httpMethod: "DELETE", - path: "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/{deviceName}/shares/{name}", + requestBody: Parameters.share, + queryParameters: [Parameters.apiVersion], urlParameters: [ - Parameters.deviceName, - Parameters.name, + Parameters.$host, Parameters.subscriptionId, - Parameters.resourceGroupName - ], - queryParameters: [ - Parameters.apiVersion - ], - headerParameters: [ - Parameters.acceptLanguage + Parameters.resourceGroupName, + Parameters.deviceName, + Parameters.name ], + headerParameters: [Parameters.accept, Parameters.contentType], + mediaType: "json", + serializer +}; +const deleteOperationSpec: coreClient.OperationSpec = { + path: + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/{deviceName}/shares/{name}", + httpMethod: "DELETE", responses: { 200: {}, + 201: {}, 202: {}, 204: {}, default: { bodyMapper: Mappers.CloudError } }, - serializer -}; - -const beginRefreshOperationSpec: msRest.OperationSpec = { - httpMethod: "POST", - path: "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/{deviceName}/shares/{name}/refresh", + queryParameters: [Parameters.apiVersion], urlParameters: [ - Parameters.deviceName, - Parameters.name, + Parameters.$host, Parameters.subscriptionId, - Parameters.resourceGroupName - ], - queryParameters: [ - Parameters.apiVersion - ], - headerParameters: [ - Parameters.acceptLanguage + Parameters.resourceGroupName, + Parameters.deviceName, + Parameters.name ], + headerParameters: [Parameters.accept], + serializer +}; +const refreshOperationSpec: coreClient.OperationSpec = { + path: + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/{deviceName}/shares/{name}/refresh", + httpMethod: "POST", responses: { 200: {}, + 201: {}, 202: {}, + 204: {}, default: { bodyMapper: Mappers.CloudError } }, + queryParameters: [Parameters.apiVersion], + urlParameters: [ + Parameters.$host, + Parameters.subscriptionId, + Parameters.resourceGroupName, + Parameters.deviceName, + Parameters.name + ], + headerParameters: [Parameters.accept], serializer }; - -const listByDataBoxEdgeDeviceNextOperationSpec: msRest.OperationSpec = { - httpMethod: "GET", - baseUrl: "https://management.azure.com", +const listByDataBoxEdgeDeviceNextOperationSpec: coreClient.OperationSpec = { path: "{nextLink}", - urlParameters: [ - Parameters.nextPageLink - ], - headerParameters: [ - Parameters.acceptLanguage - ], + httpMethod: "GET", responses: { 200: { bodyMapper: Mappers.ShareList @@ -382,5 +574,14 @@ const listByDataBoxEdgeDeviceNextOperationSpec: msRest.OperationSpec = { bodyMapper: Mappers.CloudError } }, + queryParameters: [Parameters.apiVersion], + urlParameters: [ + Parameters.$host, + Parameters.nextLink, + Parameters.subscriptionId, + Parameters.resourceGroupName, + Parameters.deviceName + ], + headerParameters: [Parameters.accept], serializer }; diff --git a/sdk/databoxedge/arm-databoxedge-profile-2020-09-01-hybrid/src/operations/skus.ts b/sdk/databoxedge/arm-databoxedge-profile-2020-09-01-hybrid/src/operations/skus.ts index 0978d6df11a6..d03b0428065a 100644 --- a/sdk/databoxedge/arm-databoxedge-profile-2020-09-01-hybrid/src/operations/skus.ts +++ b/sdk/databoxedge/arm-databoxedge-profile-2020-09-01-hybrid/src/operations/skus.ts @@ -1,71 +1,86 @@ /* - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for - * license information. + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. * * 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 * as msRest from "@azure/ms-rest-js"; -import * as Models from "../models"; -import * as Mappers from "../models/skusMappers"; +import { PagedAsyncIterableIterator } from "@azure/core-paging"; +import { Skus } from "../operationsInterfaces"; +import * as coreClient from "@azure/core-client"; +import * as Mappers from "../models/mappers"; import * as Parameters from "../models/parameters"; -import { DataBoxEdgeManagementClientContext } from "../dataBoxEdgeManagementClientContext"; +import { DataBoxEdgeManagementClient } from "../dataBoxEdgeManagementClient"; +import { + ResourceTypeSku, + SkusListOptionalParams, + SkusListResponse +} from "../models"; -/** Class representing a Skus. */ -export class Skus { - private readonly client: DataBoxEdgeManagementClientContext; +/// +/** Class containing Skus operations. */ +export class SkusImpl implements Skus { + private readonly client: DataBoxEdgeManagementClient; /** - * Create a Skus. - * @param {DataBoxEdgeManagementClientContext} client Reference to the service client. + * Initialize a new instance of the class Skus class. + * @param client Reference to the service client */ - constructor(client: DataBoxEdgeManagementClientContext) { + constructor(client: DataBoxEdgeManagementClient) { this.client = client; } /** - * @summary List all the available Skus in the region and information related to them - * @param [options] The optional parameters - * @returns Promise + * List all the available Skus in the region and information related to them + * @param options The options parameters. */ - list(options?: Models.SkusListOptionalParams): Promise; - /** - * @param callback The callback - */ - list(callback: msRest.ServiceCallback): void; + public list( + options?: SkusListOptionalParams + ): PagedAsyncIterableIterator { + const iter = this.listPagingAll(options); + return { + next() { + return iter.next(); + }, + [Symbol.asyncIterator]() { + return this; + }, + byPage: () => { + return this.listPagingPage(options); + } + }; + } + + private async *listPagingPage( + options?: SkusListOptionalParams + ): AsyncIterableIterator { + let result = await this._list(options); + yield result.value || []; + } + + private async *listPagingAll( + options?: SkusListOptionalParams + ): AsyncIterableIterator { + for await (const page of this.listPagingPage(options)) { + yield* page; + } + } + /** - * @param options The optional parameters - * @param callback The callback + * List all the available Skus in the region and information related to them + * @param options The options parameters. */ - list(options: Models.SkusListOptionalParams, callback: msRest.ServiceCallback): void; - list(options?: Models.SkusListOptionalParams | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { - return this.client.sendOperationRequest( - { - options - }, - listOperationSpec, - callback) as Promise; + private _list(options?: SkusListOptionalParams): Promise { + return this.client.sendOperationRequest({ options }, listOperationSpec); } } - // Operation Specifications -const serializer = new msRest.Serializer(Mappers); -const listOperationSpec: msRest.OperationSpec = { +const serializer = coreClient.createSerializer(Mappers, /* isXml */ false); + +const listOperationSpec: coreClient.OperationSpec = { + path: "/subscriptions/{subscriptionId}/providers/Microsoft.DataBoxEdge/skus", httpMethod: "GET", - path: "subscriptions/{subscriptionId}/providers/Microsoft.DataBoxEdge/skus", - urlParameters: [ - Parameters.subscriptionId - ], - queryParameters: [ - Parameters.apiVersion, - Parameters.filter - ], - headerParameters: [ - Parameters.acceptLanguage - ], responses: { 200: { bodyMapper: Mappers.SkuInformationList @@ -74,5 +89,8 @@ const listOperationSpec: msRest.OperationSpec = { bodyMapper: Mappers.CloudError } }, + queryParameters: [Parameters.apiVersion, Parameters.filter], + urlParameters: [Parameters.$host, Parameters.subscriptionId], + headerParameters: [Parameters.accept], serializer }; diff --git a/sdk/databoxedge/arm-databoxedge-profile-2020-09-01-hybrid/src/operations/storageAccountCredentials.ts b/sdk/databoxedge/arm-databoxedge-profile-2020-09-01-hybrid/src/operations/storageAccountCredentials.ts index da22d4710ab4..d34a40623eee 100644 --- a/sdk/databoxedge/arm-databoxedge-profile-2020-09-01-hybrid/src/operations/storageAccountCredentials.ts +++ b/sdk/databoxedge/arm-databoxedge-profile-2020-09-01-hybrid/src/operations/storageAccountCredentials.ts @@ -1,112 +1,252 @@ /* - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for - * license information. + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. * * 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 * 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/storageAccountCredentialsMappers"; +import { PagedAsyncIterableIterator } from "@azure/core-paging"; +import { StorageAccountCredentials } from "../operationsInterfaces"; +import * as coreClient from "@azure/core-client"; +import * as Mappers from "../models/mappers"; import * as Parameters from "../models/parameters"; -import { DataBoxEdgeManagementClientContext } from "../dataBoxEdgeManagementClientContext"; +import { DataBoxEdgeManagementClient } from "../dataBoxEdgeManagementClient"; +import { PollerLike, PollOperationState, LroEngine } from "@azure/core-lro"; +import { LroImpl } from "../lroImpl"; +import { + StorageAccountCredential, + StorageAccountCredentialsListByDataBoxEdgeDeviceNextOptionalParams, + StorageAccountCredentialsListByDataBoxEdgeDeviceOptionalParams, + StorageAccountCredentialsListByDataBoxEdgeDeviceResponse, + StorageAccountCredentialsGetOptionalParams, + StorageAccountCredentialsGetResponse, + StorageAccountCredentialsCreateOrUpdateOptionalParams, + StorageAccountCredentialsCreateOrUpdateResponse, + StorageAccountCredentialsDeleteOptionalParams, + StorageAccountCredentialsListByDataBoxEdgeDeviceNextResponse +} from "../models"; -/** Class representing a StorageAccountCredentials. */ -export class StorageAccountCredentials { - private readonly client: DataBoxEdgeManagementClientContext; +/// +/** Class containing StorageAccountCredentials operations. */ +export class StorageAccountCredentialsImpl + implements StorageAccountCredentials { + private readonly client: DataBoxEdgeManagementClient; /** - * Create a StorageAccountCredentials. - * @param {DataBoxEdgeManagementClientContext} client Reference to the service client. + * Initialize a new instance of the class StorageAccountCredentials class. + * @param client Reference to the service client */ - constructor(client: DataBoxEdgeManagementClientContext) { + constructor(client: DataBoxEdgeManagementClient) { this.client = client; } /** - * @summary Gets all the storage account credentials in a Data Box Edge/Data Box Gateway device. + * Gets all the storage account credentials in a Data Box Edge/Data Box Gateway device. * @param deviceName The device name. * @param resourceGroupName The resource group name. - * @param [options] The optional parameters - * @returns Promise + * @param options The options parameters. */ - listByDataBoxEdgeDevice(deviceName: string, resourceGroupName: string, options?: msRest.RequestOptionsBase): Promise; - /** - * @param deviceName The device name. - * @param resourceGroupName The resource group name. - * @param callback The callback - */ - listByDataBoxEdgeDevice(deviceName: string, resourceGroupName: string, callback: msRest.ServiceCallback): void; - /** - * @param deviceName The device name. - * @param resourceGroupName The resource group name. - * @param options The optional parameters - * @param callback The callback - */ - listByDataBoxEdgeDevice(deviceName: string, resourceGroupName: string, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; - listByDataBoxEdgeDevice(deviceName: string, resourceGroupName: string, options?: msRest.RequestOptionsBase | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { - return this.client.sendOperationRequest( - { + public listByDataBoxEdgeDevice( + deviceName: string, + resourceGroupName: string, + options?: StorageAccountCredentialsListByDataBoxEdgeDeviceOptionalParams + ): PagedAsyncIterableIterator { + const iter = this.listByDataBoxEdgeDevicePagingAll( + deviceName, + resourceGroupName, + options + ); + return { + next() { + return iter.next(); + }, + [Symbol.asyncIterator]() { + return this; + }, + byPage: () => { + return this.listByDataBoxEdgeDevicePagingPage( + deviceName, + resourceGroupName, + options + ); + } + }; + } + + private async *listByDataBoxEdgeDevicePagingPage( + deviceName: string, + resourceGroupName: string, + options?: StorageAccountCredentialsListByDataBoxEdgeDeviceOptionalParams + ): AsyncIterableIterator { + let result = await this._listByDataBoxEdgeDevice( + deviceName, + resourceGroupName, + options + ); + yield result.value || []; + let continuationToken = result.nextLink; + while (continuationToken) { + result = await this._listByDataBoxEdgeDeviceNext( deviceName, resourceGroupName, + continuationToken, options - }, - listByDataBoxEdgeDeviceOperationSpec, - callback) as Promise; + ); + continuationToken = result.nextLink; + yield result.value || []; + } + } + + private async *listByDataBoxEdgeDevicePagingAll( + deviceName: string, + resourceGroupName: string, + options?: StorageAccountCredentialsListByDataBoxEdgeDeviceOptionalParams + ): AsyncIterableIterator { + for await (const page of this.listByDataBoxEdgeDevicePagingPage( + deviceName, + resourceGroupName, + options + )) { + yield* page; + } } /** - * Gets the properties of the specified storage account credential. + * Gets all the storage account credentials in a Data Box Edge/Data Box Gateway device. * @param deviceName The device name. - * @param name The storage account credential name. * @param resourceGroupName The resource group name. - * @param [options] The optional parameters - * @returns Promise + * @param options The options parameters. */ - get(deviceName: string, name: string, resourceGroupName: string, options?: msRest.RequestOptionsBase): Promise; + private _listByDataBoxEdgeDevice( + deviceName: string, + resourceGroupName: string, + options?: StorageAccountCredentialsListByDataBoxEdgeDeviceOptionalParams + ): Promise { + return this.client.sendOperationRequest( + { deviceName, resourceGroupName, options }, + listByDataBoxEdgeDeviceOperationSpec + ); + } + /** + * Gets the properties of the specified storage account credential. * @param deviceName The device name. * @param name The storage account credential name. * @param resourceGroupName The resource group name. - * @param callback The callback + * @param options The options parameters. */ - get(deviceName: string, name: string, resourceGroupName: string, callback: msRest.ServiceCallback): void; + get( + deviceName: string, + name: string, + resourceGroupName: string, + options?: StorageAccountCredentialsGetOptionalParams + ): Promise { + return this.client.sendOperationRequest( + { deviceName, name, resourceGroupName, options }, + getOperationSpec + ); + } + /** + * Creates or updates the storage account credential. * @param deviceName The device name. * @param name The storage account credential name. * @param resourceGroupName The resource group name. - * @param options The optional parameters - * @param callback The callback + * @param storageAccountCredential The storage account credential. + * @param options The options parameters. */ - get(deviceName: string, name: string, resourceGroupName: string, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; - get(deviceName: string, name: string, resourceGroupName: string, options?: msRest.RequestOptionsBase | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { - return this.client.sendOperationRequest( + async beginCreateOrUpdate( + deviceName: string, + name: string, + resourceGroupName: string, + storageAccountCredential: StorageAccountCredential, + options?: StorageAccountCredentialsCreateOrUpdateOptionalParams + ): Promise< + PollerLike< + PollOperationState, + StorageAccountCredentialsCreateOrUpdateResponse + > + > { + const directSendOperation = async ( + args: coreClient.OperationArguments, + spec: coreClient.OperationSpec + ): Promise => { + return this.client.sendOperationRequest(args, spec); + }; + const sendOperation = async ( + args: coreClient.OperationArguments, + spec: coreClient.OperationSpec + ) => { + let currentRawResponse: + | coreClient.FullOperationResponse + | undefined = undefined; + const providedCallback = args.options?.onResponse; + const callback: coreClient.RawResponseCallback = ( + rawResponse: coreClient.FullOperationResponse, + flatResponse: unknown + ) => { + currentRawResponse = rawResponse; + providedCallback?.(rawResponse, flatResponse); + }; + const updatedArgs = { + ...args, + options: { + ...args.options, + onResponse: callback + } + }; + const flatResponse = await directSendOperation(updatedArgs, spec); + return { + flatResponse, + rawResponse: { + statusCode: currentRawResponse!.status, + body: currentRawResponse!.parsedBody, + headers: currentRawResponse!.headers.toJSON() + } + }; + }; + + const lro = new LroImpl( + sendOperation, { deviceName, name, resourceGroupName, + storageAccountCredential, options }, - getOperationSpec, - callback) as Promise; + createOrUpdateOperationSpec + ); + return new LroEngine(lro, { + resumeFrom: options?.resumeFrom, + intervalInMs: options?.updateIntervalInMs + }); } /** * Creates or updates the storage account credential. * @param deviceName The device name. * @param name The storage account credential name. - * @param storageAccountCredential The storage account credential. * @param resourceGroupName The resource group name. - * @param [options] The optional parameters - * @returns Promise + * @param storageAccountCredential The storage account credential. + * @param options The options parameters. */ - createOrUpdate(deviceName: string, name: string, storageAccountCredential: Models.StorageAccountCredential, resourceGroupName: string, options?: msRest.RequestOptionsBase): Promise { - return this.beginCreateOrUpdate(deviceName,name,storageAccountCredential,resourceGroupName,options) - .then(lroPoller => lroPoller.pollUntilFinished()) as Promise; + async beginCreateOrUpdateAndWait( + deviceName: string, + name: string, + resourceGroupName: string, + storageAccountCredential: StorageAccountCredential, + options?: StorageAccountCredentialsCreateOrUpdateOptionalParams + ): Promise { + const poller = await this.beginCreateOrUpdate( + deviceName, + name, + resourceGroupName, + storageAccountCredential, + options + ); + return poller.pollUntilDone(); } /** @@ -114,34 +254,62 @@ export class StorageAccountCredentials { * @param deviceName The device name. * @param name The storage account credential name. * @param resourceGroupName The resource group name. - * @param [options] The optional parameters - * @returns Promise + * @param options The options parameters. */ - deleteMethod(deviceName: string, name: string, resourceGroupName: string, options?: msRest.RequestOptionsBase): Promise { - return this.beginDeleteMethod(deviceName,name,resourceGroupName,options) - .then(lroPoller => lroPoller.pollUntilFinished()); - } + async beginDelete( + deviceName: string, + name: string, + resourceGroupName: string, + options?: StorageAccountCredentialsDeleteOptionalParams + ): Promise, void>> { + const directSendOperation = async ( + args: coreClient.OperationArguments, + spec: coreClient.OperationSpec + ): Promise => { + return this.client.sendOperationRequest(args, spec); + }; + const sendOperation = async ( + args: coreClient.OperationArguments, + spec: coreClient.OperationSpec + ) => { + let currentRawResponse: + | coreClient.FullOperationResponse + | undefined = undefined; + const providedCallback = args.options?.onResponse; + const callback: coreClient.RawResponseCallback = ( + rawResponse: coreClient.FullOperationResponse, + flatResponse: unknown + ) => { + currentRawResponse = rawResponse; + providedCallback?.(rawResponse, flatResponse); + }; + const updatedArgs = { + ...args, + options: { + ...args.options, + onResponse: callback + } + }; + const flatResponse = await directSendOperation(updatedArgs, spec); + return { + flatResponse, + rawResponse: { + statusCode: currentRawResponse!.status, + body: currentRawResponse!.parsedBody, + headers: currentRawResponse!.headers.toJSON() + } + }; + }; - /** - * Creates or updates the storage account credential. - * @param deviceName The device name. - * @param name The storage account credential name. - * @param storageAccountCredential The storage account credential. - * @param resourceGroupName The resource group name. - * @param [options] The optional parameters - * @returns Promise - */ - beginCreateOrUpdate(deviceName: string, name: string, storageAccountCredential: Models.StorageAccountCredential, resourceGroupName: string, options?: msRest.RequestOptionsBase): Promise { - return this.client.sendLRORequest( - { - deviceName, - name, - storageAccountCredential, - resourceGroupName, - options - }, - beginCreateOrUpdateOperationSpec, - options); + const lro = new LroImpl( + sendOperation, + { deviceName, name, resourceGroupName, options }, + deleteOperationSpec + ); + return new LroEngine(lro, { + resumeFrom: options?.resumeFrom, + intervalInMs: options?.updateIntervalInMs + }); } /** @@ -149,66 +317,50 @@ export class StorageAccountCredentials { * @param deviceName The device name. * @param name The storage account credential name. * @param resourceGroupName The resource group name. - * @param [options] The optional parameters - * @returns Promise + * @param options The options parameters. */ - beginDeleteMethod(deviceName: string, name: string, resourceGroupName: string, options?: msRest.RequestOptionsBase): Promise { - return this.client.sendLRORequest( - { - deviceName, - name, - resourceGroupName, - options - }, - beginDeleteMethodOperationSpec, - options); + async beginDeleteAndWait( + deviceName: string, + name: string, + resourceGroupName: string, + options?: StorageAccountCredentialsDeleteOptionalParams + ): Promise { + const poller = await this.beginDelete( + deviceName, + name, + resourceGroupName, + options + ); + return poller.pollUntilDone(); } /** - * @summary Gets all the storage account credentials in a Data Box Edge/Data Box Gateway device. - * @param nextPageLink The NextLink from the previous successful call to List operation. - * @param [options] The optional parameters - * @returns Promise - */ - listByDataBoxEdgeDeviceNext(nextPageLink: string, options?: msRest.RequestOptionsBase): Promise; - /** - * @param nextPageLink The NextLink from the previous successful call to List operation. - * @param callback The callback - */ - listByDataBoxEdgeDeviceNext(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 + * ListByDataBoxEdgeDeviceNext + * @param deviceName The device name. + * @param resourceGroupName The resource group name. + * @param nextLink The nextLink from the previous successful call to the ListByDataBoxEdgeDevice + * method. + * @param options The options parameters. */ - listByDataBoxEdgeDeviceNext(nextPageLink: string, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; - listByDataBoxEdgeDeviceNext(nextPageLink: string, options?: msRest.RequestOptionsBase | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { + private _listByDataBoxEdgeDeviceNext( + deviceName: string, + resourceGroupName: string, + nextLink: string, + options?: StorageAccountCredentialsListByDataBoxEdgeDeviceNextOptionalParams + ): Promise { return this.client.sendOperationRequest( - { - nextPageLink, - options - }, - listByDataBoxEdgeDeviceNextOperationSpec, - callback) as Promise; + { deviceName, resourceGroupName, nextLink, options }, + listByDataBoxEdgeDeviceNextOperationSpec + ); } } - // Operation Specifications -const serializer = new msRest.Serializer(Mappers); -const listByDataBoxEdgeDeviceOperationSpec: msRest.OperationSpec = { +const serializer = coreClient.createSerializer(Mappers, /* isXml */ false); + +const listByDataBoxEdgeDeviceOperationSpec: coreClient.OperationSpec = { + path: + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/{deviceName}/storageAccountCredentials", httpMethod: "GET", - path: "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/{deviceName}/storageAccountCredentials", - urlParameters: [ - Parameters.deviceName, - Parameters.subscriptionId, - Parameters.resourceGroupName - ], - queryParameters: [ - Parameters.apiVersion - ], - headerParameters: [ - Parameters.acceptLanguage - ], responses: { 200: { bodyMapper: Mappers.StorageAccountCredentialList @@ -217,24 +369,20 @@ const listByDataBoxEdgeDeviceOperationSpec: msRest.OperationSpec = { bodyMapper: Mappers.CloudError } }, - serializer -}; - -const getOperationSpec: msRest.OperationSpec = { - httpMethod: "GET", - path: "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/{deviceName}/storageAccountCredentials/{name}", + queryParameters: [Parameters.apiVersion], urlParameters: [ - Parameters.deviceName, - Parameters.name, + Parameters.$host, Parameters.subscriptionId, - Parameters.resourceGroupName - ], - queryParameters: [ - Parameters.apiVersion - ], - headerParameters: [ - Parameters.acceptLanguage + Parameters.resourceGroupName, + Parameters.deviceName ], + headerParameters: [Parameters.accept], + serializer +}; +const getOperationSpec: coreClient.OperationSpec = { + path: + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/{deviceName}/storageAccountCredentials/{name}", + httpMethod: "GET", responses: { 200: { bodyMapper: Mappers.StorageAccountCredential @@ -243,79 +391,78 @@ const getOperationSpec: msRest.OperationSpec = { bodyMapper: Mappers.CloudError } }, - serializer -}; - -const beginCreateOrUpdateOperationSpec: msRest.OperationSpec = { - httpMethod: "PUT", - path: "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/{deviceName}/storageAccountCredentials/{name}", + queryParameters: [Parameters.apiVersion], urlParameters: [ - Parameters.deviceName, - Parameters.name, + Parameters.$host, Parameters.subscriptionId, - Parameters.resourceGroupName - ], - queryParameters: [ - Parameters.apiVersion - ], - headerParameters: [ - Parameters.acceptLanguage + Parameters.resourceGroupName, + Parameters.deviceName, + Parameters.name ], - requestBody: { - parameterPath: "storageAccountCredential", - mapper: { - ...Mappers.StorageAccountCredential, - required: true - } - }, + headerParameters: [Parameters.accept], + serializer +}; +const createOrUpdateOperationSpec: coreClient.OperationSpec = { + path: + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/{deviceName}/storageAccountCredentials/{name}", + httpMethod: "PUT", responses: { 200: { bodyMapper: Mappers.StorageAccountCredential }, - 202: {}, + 201: { + bodyMapper: Mappers.StorageAccountCredential + }, + 202: { + bodyMapper: Mappers.StorageAccountCredential + }, + 204: { + bodyMapper: Mappers.StorageAccountCredential + }, default: { bodyMapper: Mappers.CloudError } }, - serializer -}; - -const beginDeleteMethodOperationSpec: msRest.OperationSpec = { - httpMethod: "DELETE", - path: "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/{deviceName}/storageAccountCredentials/{name}", + requestBody: Parameters.storageAccountCredential, + queryParameters: [Parameters.apiVersion], urlParameters: [ - Parameters.deviceName, - Parameters.name, + Parameters.$host, Parameters.subscriptionId, - Parameters.resourceGroupName - ], - queryParameters: [ - Parameters.apiVersion - ], - headerParameters: [ - Parameters.acceptLanguage + Parameters.resourceGroupName, + Parameters.deviceName, + Parameters.name ], + headerParameters: [Parameters.accept, Parameters.contentType], + mediaType: "json", + serializer +}; +const deleteOperationSpec: coreClient.OperationSpec = { + path: + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/{deviceName}/storageAccountCredentials/{name}", + httpMethod: "DELETE", responses: { 200: {}, + 201: {}, 202: {}, 204: {}, default: { bodyMapper: Mappers.CloudError } }, + queryParameters: [Parameters.apiVersion], + urlParameters: [ + Parameters.$host, + Parameters.subscriptionId, + Parameters.resourceGroupName, + Parameters.deviceName, + Parameters.name + ], + headerParameters: [Parameters.accept], serializer }; - -const listByDataBoxEdgeDeviceNextOperationSpec: msRest.OperationSpec = { - httpMethod: "GET", - baseUrl: "https://management.azure.com", +const listByDataBoxEdgeDeviceNextOperationSpec: coreClient.OperationSpec = { path: "{nextLink}", - urlParameters: [ - Parameters.nextPageLink - ], - headerParameters: [ - Parameters.acceptLanguage - ], + httpMethod: "GET", responses: { 200: { bodyMapper: Mappers.StorageAccountCredentialList @@ -324,5 +471,14 @@ const listByDataBoxEdgeDeviceNextOperationSpec: msRest.OperationSpec = { bodyMapper: Mappers.CloudError } }, + queryParameters: [Parameters.apiVersion], + urlParameters: [ + Parameters.$host, + Parameters.nextLink, + Parameters.subscriptionId, + Parameters.resourceGroupName, + Parameters.deviceName + ], + headerParameters: [Parameters.accept], serializer }; diff --git a/sdk/databoxedge/arm-databoxedge-profile-2020-09-01-hybrid/src/operations/storageAccounts.ts b/sdk/databoxedge/arm-databoxedge-profile-2020-09-01-hybrid/src/operations/storageAccounts.ts index 3bb7576b410c..416e2cfabc07 100644 --- a/sdk/databoxedge/arm-databoxedge-profile-2020-09-01-hybrid/src/operations/storageAccounts.ts +++ b/sdk/databoxedge/arm-databoxedge-profile-2020-09-01-hybrid/src/operations/storageAccounts.ts @@ -1,112 +1,251 @@ /* - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for - * license information. + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. * * 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 * 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/storageAccountsMappers"; +import { PagedAsyncIterableIterator } from "@azure/core-paging"; +import { StorageAccounts } from "../operationsInterfaces"; +import * as coreClient from "@azure/core-client"; +import * as Mappers from "../models/mappers"; import * as Parameters from "../models/parameters"; -import { DataBoxEdgeManagementClientContext } from "../dataBoxEdgeManagementClientContext"; +import { DataBoxEdgeManagementClient } from "../dataBoxEdgeManagementClient"; +import { PollerLike, PollOperationState, LroEngine } from "@azure/core-lro"; +import { LroImpl } from "../lroImpl"; +import { + StorageAccount, + StorageAccountsListByDataBoxEdgeDeviceNextOptionalParams, + StorageAccountsListByDataBoxEdgeDeviceOptionalParams, + StorageAccountsListByDataBoxEdgeDeviceResponse, + StorageAccountsGetOptionalParams, + StorageAccountsGetResponse, + StorageAccountsCreateOrUpdateOptionalParams, + StorageAccountsCreateOrUpdateResponse, + StorageAccountsDeleteOptionalParams, + StorageAccountsListByDataBoxEdgeDeviceNextResponse +} from "../models"; -/** Class representing a StorageAccounts. */ -export class StorageAccounts { - private readonly client: DataBoxEdgeManagementClientContext; +/// +/** Class containing StorageAccounts operations. */ +export class StorageAccountsImpl implements StorageAccounts { + private readonly client: DataBoxEdgeManagementClient; /** - * Create a StorageAccounts. - * @param {DataBoxEdgeManagementClientContext} client Reference to the service client. + * Initialize a new instance of the class StorageAccounts class. + * @param client Reference to the service client */ - constructor(client: DataBoxEdgeManagementClientContext) { + constructor(client: DataBoxEdgeManagementClient) { this.client = client; } /** - * @summary Lists all the storage accounts in a Data Box Edge/Data Box Gateway device. + * Lists all the storage accounts in a Data Box Edge/Data Box Gateway device. * @param deviceName The device name. * @param resourceGroupName The resource group name. - * @param [options] The optional parameters - * @returns Promise + * @param options The options parameters. */ - listByDataBoxEdgeDevice(deviceName: string, resourceGroupName: string, options?: msRest.RequestOptionsBase): Promise; - /** - * @param deviceName The device name. - * @param resourceGroupName The resource group name. - * @param callback The callback - */ - listByDataBoxEdgeDevice(deviceName: string, resourceGroupName: string, callback: msRest.ServiceCallback): void; - /** - * @param deviceName The device name. - * @param resourceGroupName The resource group name. - * @param options The optional parameters - * @param callback The callback - */ - listByDataBoxEdgeDevice(deviceName: string, resourceGroupName: string, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; - listByDataBoxEdgeDevice(deviceName: string, resourceGroupName: string, options?: msRest.RequestOptionsBase | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { - return this.client.sendOperationRequest( - { + public listByDataBoxEdgeDevice( + deviceName: string, + resourceGroupName: string, + options?: StorageAccountsListByDataBoxEdgeDeviceOptionalParams + ): PagedAsyncIterableIterator { + const iter = this.listByDataBoxEdgeDevicePagingAll( + deviceName, + resourceGroupName, + options + ); + return { + next() { + return iter.next(); + }, + [Symbol.asyncIterator]() { + return this; + }, + byPage: () => { + return this.listByDataBoxEdgeDevicePagingPage( + deviceName, + resourceGroupName, + options + ); + } + }; + } + + private async *listByDataBoxEdgeDevicePagingPage( + deviceName: string, + resourceGroupName: string, + options?: StorageAccountsListByDataBoxEdgeDeviceOptionalParams + ): AsyncIterableIterator { + let result = await this._listByDataBoxEdgeDevice( + deviceName, + resourceGroupName, + options + ); + yield result.value || []; + let continuationToken = result.nextLink; + while (continuationToken) { + result = await this._listByDataBoxEdgeDeviceNext( deviceName, resourceGroupName, + continuationToken, options - }, - listByDataBoxEdgeDeviceOperationSpec, - callback) as Promise; + ); + continuationToken = result.nextLink; + yield result.value || []; + } + } + + private async *listByDataBoxEdgeDevicePagingAll( + deviceName: string, + resourceGroupName: string, + options?: StorageAccountsListByDataBoxEdgeDeviceOptionalParams + ): AsyncIterableIterator { + for await (const page of this.listByDataBoxEdgeDevicePagingPage( + deviceName, + resourceGroupName, + options + )) { + yield* page; + } } /** - * @summary Gets a StorageAccount by name. + * Lists all the storage accounts in a Data Box Edge/Data Box Gateway device. * @param deviceName The device name. - * @param storageAccountName The storage account name. * @param resourceGroupName The resource group name. - * @param [options] The optional parameters - * @returns Promise + * @param options The options parameters. */ - get(deviceName: string, storageAccountName: string, resourceGroupName: string, options?: msRest.RequestOptionsBase): Promise; + private _listByDataBoxEdgeDevice( + deviceName: string, + resourceGroupName: string, + options?: StorageAccountsListByDataBoxEdgeDeviceOptionalParams + ): Promise { + return this.client.sendOperationRequest( + { deviceName, resourceGroupName, options }, + listByDataBoxEdgeDeviceOperationSpec + ); + } + /** + * Gets a StorageAccount by name. * @param deviceName The device name. * @param storageAccountName The storage account name. * @param resourceGroupName The resource group name. - * @param callback The callback + * @param options The options parameters. */ - get(deviceName: string, storageAccountName: string, resourceGroupName: string, callback: msRest.ServiceCallback): void; + get( + deviceName: string, + storageAccountName: string, + resourceGroupName: string, + options?: StorageAccountsGetOptionalParams + ): Promise { + return this.client.sendOperationRequest( + { deviceName, storageAccountName, resourceGroupName, options }, + getOperationSpec + ); + } + /** + * Creates a new StorageAccount or updates an existing StorageAccount on the device. * @param deviceName The device name. - * @param storageAccountName The storage account name. + * @param storageAccountName The StorageAccount name. * @param resourceGroupName The resource group name. - * @param options The optional parameters - * @param callback The callback + * @param storageAccount The StorageAccount properties. + * @param options The options parameters. */ - get(deviceName: string, storageAccountName: string, resourceGroupName: string, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; - get(deviceName: string, storageAccountName: string, resourceGroupName: string, options?: msRest.RequestOptionsBase | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { - return this.client.sendOperationRequest( + async beginCreateOrUpdate( + deviceName: string, + storageAccountName: string, + resourceGroupName: string, + storageAccount: StorageAccount, + options?: StorageAccountsCreateOrUpdateOptionalParams + ): Promise< + PollerLike< + PollOperationState, + StorageAccountsCreateOrUpdateResponse + > + > { + const directSendOperation = async ( + args: coreClient.OperationArguments, + spec: coreClient.OperationSpec + ): Promise => { + return this.client.sendOperationRequest(args, spec); + }; + const sendOperation = async ( + args: coreClient.OperationArguments, + spec: coreClient.OperationSpec + ) => { + let currentRawResponse: + | coreClient.FullOperationResponse + | undefined = undefined; + const providedCallback = args.options?.onResponse; + const callback: coreClient.RawResponseCallback = ( + rawResponse: coreClient.FullOperationResponse, + flatResponse: unknown + ) => { + currentRawResponse = rawResponse; + providedCallback?.(rawResponse, flatResponse); + }; + const updatedArgs = { + ...args, + options: { + ...args.options, + onResponse: callback + } + }; + const flatResponse = await directSendOperation(updatedArgs, spec); + return { + flatResponse, + rawResponse: { + statusCode: currentRawResponse!.status, + body: currentRawResponse!.parsedBody, + headers: currentRawResponse!.headers.toJSON() + } + }; + }; + + const lro = new LroImpl( + sendOperation, { deviceName, storageAccountName, resourceGroupName, + storageAccount, options }, - getOperationSpec, - callback) as Promise; + createOrUpdateOperationSpec + ); + return new LroEngine(lro, { + resumeFrom: options?.resumeFrom, + intervalInMs: options?.updateIntervalInMs + }); } /** - * @summary Creates a new StorageAccount or updates an existing StorageAccount on the device. + * Creates a new StorageAccount or updates an existing StorageAccount on the device. * @param deviceName The device name. * @param storageAccountName The StorageAccount name. - * @param storageAccount The StorageAccount properties. * @param resourceGroupName The resource group name. - * @param [options] The optional parameters - * @returns Promise + * @param storageAccount The StorageAccount properties. + * @param options The options parameters. */ - createOrUpdate(deviceName: string, storageAccountName: string, storageAccount: Models.StorageAccount, resourceGroupName: string, options?: msRest.RequestOptionsBase): Promise { - return this.beginCreateOrUpdate(deviceName,storageAccountName,storageAccount,resourceGroupName,options) - .then(lroPoller => lroPoller.pollUntilFinished()) as Promise; + async beginCreateOrUpdateAndWait( + deviceName: string, + storageAccountName: string, + resourceGroupName: string, + storageAccount: StorageAccount, + options?: StorageAccountsCreateOrUpdateOptionalParams + ): Promise { + const poller = await this.beginCreateOrUpdate( + deviceName, + storageAccountName, + resourceGroupName, + storageAccount, + options + ); + return poller.pollUntilDone(); } /** @@ -114,34 +253,62 @@ export class StorageAccounts { * @param deviceName The device name. * @param storageAccountName The StorageAccount name. * @param resourceGroupName The resource group name. - * @param [options] The optional parameters - * @returns Promise + * @param options The options parameters. */ - deleteMethod(deviceName: string, storageAccountName: string, resourceGroupName: string, options?: msRest.RequestOptionsBase): Promise { - return this.beginDeleteMethod(deviceName,storageAccountName,resourceGroupName,options) - .then(lroPoller => lroPoller.pollUntilFinished()); - } + async beginDelete( + deviceName: string, + storageAccountName: string, + resourceGroupName: string, + options?: StorageAccountsDeleteOptionalParams + ): Promise, void>> { + const directSendOperation = async ( + args: coreClient.OperationArguments, + spec: coreClient.OperationSpec + ): Promise => { + return this.client.sendOperationRequest(args, spec); + }; + const sendOperation = async ( + args: coreClient.OperationArguments, + spec: coreClient.OperationSpec + ) => { + let currentRawResponse: + | coreClient.FullOperationResponse + | undefined = undefined; + const providedCallback = args.options?.onResponse; + const callback: coreClient.RawResponseCallback = ( + rawResponse: coreClient.FullOperationResponse, + flatResponse: unknown + ) => { + currentRawResponse = rawResponse; + providedCallback?.(rawResponse, flatResponse); + }; + const updatedArgs = { + ...args, + options: { + ...args.options, + onResponse: callback + } + }; + const flatResponse = await directSendOperation(updatedArgs, spec); + return { + flatResponse, + rawResponse: { + statusCode: currentRawResponse!.status, + body: currentRawResponse!.parsedBody, + headers: currentRawResponse!.headers.toJSON() + } + }; + }; - /** - * @summary Creates a new StorageAccount or updates an existing StorageAccount on the device. - * @param deviceName The device name. - * @param storageAccountName The StorageAccount name. - * @param storageAccount The StorageAccount properties. - * @param resourceGroupName The resource group name. - * @param [options] The optional parameters - * @returns Promise - */ - beginCreateOrUpdate(deviceName: string, storageAccountName: string, storageAccount: Models.StorageAccount, resourceGroupName: string, options?: msRest.RequestOptionsBase): Promise { - return this.client.sendLRORequest( - { - deviceName, - storageAccountName, - storageAccount, - resourceGroupName, - options - }, - beginCreateOrUpdateOperationSpec, - options); + const lro = new LroImpl( + sendOperation, + { deviceName, storageAccountName, resourceGroupName, options }, + deleteOperationSpec + ); + return new LroEngine(lro, { + resumeFrom: options?.resumeFrom, + intervalInMs: options?.updateIntervalInMs + }); } /** @@ -149,66 +316,50 @@ export class StorageAccounts { * @param deviceName The device name. * @param storageAccountName The StorageAccount name. * @param resourceGroupName The resource group name. - * @param [options] The optional parameters - * @returns Promise + * @param options The options parameters. */ - beginDeleteMethod(deviceName: string, storageAccountName: string, resourceGroupName: string, options?: msRest.RequestOptionsBase): Promise { - return this.client.sendLRORequest( - { - deviceName, - storageAccountName, - resourceGroupName, - options - }, - beginDeleteMethodOperationSpec, - options); + async beginDeleteAndWait( + deviceName: string, + storageAccountName: string, + resourceGroupName: string, + options?: StorageAccountsDeleteOptionalParams + ): Promise { + const poller = await this.beginDelete( + deviceName, + storageAccountName, + resourceGroupName, + options + ); + return poller.pollUntilDone(); } /** - * @summary Lists all the storage accounts in a Data Box Edge/Data Box Gateway device. - * @param nextPageLink The NextLink from the previous successful call to List operation. - * @param [options] The optional parameters - * @returns Promise - */ - listByDataBoxEdgeDeviceNext(nextPageLink: string, options?: msRest.RequestOptionsBase): Promise; - /** - * @param nextPageLink The NextLink from the previous successful call to List operation. - * @param callback The callback - */ - listByDataBoxEdgeDeviceNext(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 + * ListByDataBoxEdgeDeviceNext + * @param deviceName The device name. + * @param resourceGroupName The resource group name. + * @param nextLink The nextLink from the previous successful call to the ListByDataBoxEdgeDevice + * method. + * @param options The options parameters. */ - listByDataBoxEdgeDeviceNext(nextPageLink: string, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; - listByDataBoxEdgeDeviceNext(nextPageLink: string, options?: msRest.RequestOptionsBase | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { + private _listByDataBoxEdgeDeviceNext( + deviceName: string, + resourceGroupName: string, + nextLink: string, + options?: StorageAccountsListByDataBoxEdgeDeviceNextOptionalParams + ): Promise { return this.client.sendOperationRequest( - { - nextPageLink, - options - }, - listByDataBoxEdgeDeviceNextOperationSpec, - callback) as Promise; + { deviceName, resourceGroupName, nextLink, options }, + listByDataBoxEdgeDeviceNextOperationSpec + ); } } - // Operation Specifications -const serializer = new msRest.Serializer(Mappers); -const listByDataBoxEdgeDeviceOperationSpec: msRest.OperationSpec = { +const serializer = coreClient.createSerializer(Mappers, /* isXml */ false); + +const listByDataBoxEdgeDeviceOperationSpec: coreClient.OperationSpec = { + path: + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/{deviceName}/storageAccounts", httpMethod: "GET", - path: "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/{deviceName}/storageAccounts", - urlParameters: [ - Parameters.deviceName, - Parameters.subscriptionId, - Parameters.resourceGroupName - ], - queryParameters: [ - Parameters.apiVersion - ], - headerParameters: [ - Parameters.acceptLanguage - ], responses: { 200: { bodyMapper: Mappers.StorageAccountList @@ -217,24 +368,20 @@ const listByDataBoxEdgeDeviceOperationSpec: msRest.OperationSpec = { bodyMapper: Mappers.CloudError } }, - serializer -}; - -const getOperationSpec: msRest.OperationSpec = { - httpMethod: "GET", - path: "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/{deviceName}/storageAccounts/{storageAccountName}", + queryParameters: [Parameters.apiVersion], urlParameters: [ - Parameters.deviceName, - Parameters.storageAccountName, + Parameters.$host, Parameters.subscriptionId, - Parameters.resourceGroupName - ], - queryParameters: [ - Parameters.apiVersion - ], - headerParameters: [ - Parameters.acceptLanguage + Parameters.resourceGroupName, + Parameters.deviceName ], + headerParameters: [Parameters.accept], + serializer +}; +const getOperationSpec: coreClient.OperationSpec = { + path: + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/{deviceName}/storageAccounts/{storageAccountName}", + httpMethod: "GET", responses: { 200: { bodyMapper: Mappers.StorageAccount @@ -243,78 +390,78 @@ const getOperationSpec: msRest.OperationSpec = { bodyMapper: Mappers.CloudError } }, - serializer -}; - -const beginCreateOrUpdateOperationSpec: msRest.OperationSpec = { - httpMethod: "PUT", - path: "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/{deviceName}/storageAccounts/{storageAccountName}", + queryParameters: [Parameters.apiVersion], urlParameters: [ - Parameters.deviceName, - Parameters.storageAccountName, + Parameters.$host, Parameters.subscriptionId, - Parameters.resourceGroupName - ], - queryParameters: [ - Parameters.apiVersion - ], - headerParameters: [ - Parameters.acceptLanguage + Parameters.resourceGroupName, + Parameters.deviceName, + Parameters.storageAccountName ], - requestBody: { - parameterPath: "storageAccount", - mapper: { - ...Mappers.StorageAccount, - required: true - } - }, + headerParameters: [Parameters.accept], + serializer +}; +const createOrUpdateOperationSpec: coreClient.OperationSpec = { + path: + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/{deviceName}/storageAccounts/{storageAccountName}", + httpMethod: "PUT", responses: { 200: { bodyMapper: Mappers.StorageAccount }, - 202: {}, + 201: { + bodyMapper: Mappers.StorageAccount + }, + 202: { + bodyMapper: Mappers.StorageAccount + }, + 204: { + bodyMapper: Mappers.StorageAccount + }, default: { bodyMapper: Mappers.CloudError } }, - serializer -}; - -const beginDeleteMethodOperationSpec: msRest.OperationSpec = { - httpMethod: "DELETE", - path: "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/{deviceName}/storageAccounts/{storageAccountName}", + requestBody: Parameters.storageAccount, + queryParameters: [Parameters.apiVersion], urlParameters: [ - Parameters.deviceName, - Parameters.storageAccountName, + Parameters.$host, Parameters.subscriptionId, - Parameters.resourceGroupName - ], - queryParameters: [ - Parameters.apiVersion - ], - headerParameters: [ - Parameters.acceptLanguage + Parameters.resourceGroupName, + Parameters.deviceName, + Parameters.storageAccountName ], + headerParameters: [Parameters.accept, Parameters.contentType], + mediaType: "json", + serializer +}; +const deleteOperationSpec: coreClient.OperationSpec = { + path: + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/{deviceName}/storageAccounts/{storageAccountName}", + httpMethod: "DELETE", responses: { + 200: {}, + 201: {}, 202: {}, 204: {}, default: { bodyMapper: Mappers.CloudError } }, + queryParameters: [Parameters.apiVersion], + urlParameters: [ + Parameters.$host, + Parameters.subscriptionId, + Parameters.resourceGroupName, + Parameters.deviceName, + Parameters.storageAccountName + ], + headerParameters: [Parameters.accept], serializer }; - -const listByDataBoxEdgeDeviceNextOperationSpec: msRest.OperationSpec = { - httpMethod: "GET", - baseUrl: "https://management.azure.com", +const listByDataBoxEdgeDeviceNextOperationSpec: coreClient.OperationSpec = { path: "{nextLink}", - urlParameters: [ - Parameters.nextPageLink - ], - headerParameters: [ - Parameters.acceptLanguage - ], + httpMethod: "GET", responses: { 200: { bodyMapper: Mappers.StorageAccountList @@ -323,5 +470,14 @@ const listByDataBoxEdgeDeviceNextOperationSpec: msRest.OperationSpec = { bodyMapper: Mappers.CloudError } }, + queryParameters: [Parameters.apiVersion], + urlParameters: [ + Parameters.$host, + Parameters.nextLink, + Parameters.subscriptionId, + Parameters.resourceGroupName, + Parameters.deviceName + ], + headerParameters: [Parameters.accept], serializer }; diff --git a/sdk/databoxedge/arm-databoxedge-profile-2020-09-01-hybrid/src/operations/triggers.ts b/sdk/databoxedge/arm-databoxedge-profile-2020-09-01-hybrid/src/operations/triggers.ts index eac6491364c7..9ffa300cf86e 100644 --- a/sdk/databoxedge/arm-databoxedge-profile-2020-09-01-hybrid/src/operations/triggers.ts +++ b/sdk/databoxedge/arm-databoxedge-profile-2020-09-01-hybrid/src/operations/triggers.ts @@ -1,29 +1,42 @@ /* - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for - * license information. + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. * * 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 * 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/triggersMappers"; +import { PagedAsyncIterableIterator } from "@azure/core-paging"; +import { Triggers } from "../operationsInterfaces"; +import * as coreClient from "@azure/core-client"; +import * as Mappers from "../models/mappers"; import * as Parameters from "../models/parameters"; -import { DataBoxEdgeManagementClientContext } from "../dataBoxEdgeManagementClientContext"; +import { DataBoxEdgeManagementClient } from "../dataBoxEdgeManagementClient"; +import { PollerLike, PollOperationState, LroEngine } from "@azure/core-lro"; +import { LroImpl } from "../lroImpl"; +import { + TriggerUnion, + TriggersListByDataBoxEdgeDeviceNextOptionalParams, + TriggersListByDataBoxEdgeDeviceOptionalParams, + TriggersListByDataBoxEdgeDeviceResponse, + TriggersGetOptionalParams, + TriggersGetResponse, + TriggersCreateOrUpdateOptionalParams, + TriggersCreateOrUpdateResponse, + TriggersDeleteOptionalParams, + TriggersListByDataBoxEdgeDeviceNextResponse +} from "../models"; -/** Class representing a Triggers. */ -export class Triggers { - private readonly client: DataBoxEdgeManagementClientContext; +/// +/** Class containing Triggers operations. */ +export class TriggersImpl implements Triggers { + private readonly client: DataBoxEdgeManagementClient; /** - * Create a Triggers. - * @param {DataBoxEdgeManagementClientContext} client Reference to the service client. + * Initialize a new instance of the class Triggers class. + * @param client Reference to the service client */ - constructor(client: DataBoxEdgeManagementClientContext) { + constructor(client: DataBoxEdgeManagementClient) { this.client = client; } @@ -31,117 +44,265 @@ export class Triggers { * Lists all the triggers configured in the device. * @param deviceName The device name. * @param resourceGroupName The resource group name. - * @param [options] The optional parameters - * @returns Promise + * @param options The options parameters. */ - listByDataBoxEdgeDevice(deviceName: string, resourceGroupName: string, options?: Models.TriggersListByDataBoxEdgeDeviceOptionalParams): Promise; - /** - * @param deviceName The device name. - * @param resourceGroupName The resource group name. - * @param callback The callback - */ - listByDataBoxEdgeDevice(deviceName: string, resourceGroupName: string, callback: msRest.ServiceCallback): void; - /** - * @param deviceName The device name. - * @param resourceGroupName The resource group name. - * @param options The optional parameters - * @param callback The callback - */ - listByDataBoxEdgeDevice(deviceName: string, resourceGroupName: string, options: Models.TriggersListByDataBoxEdgeDeviceOptionalParams, callback: msRest.ServiceCallback): void; - listByDataBoxEdgeDevice(deviceName: string, resourceGroupName: string, options?: Models.TriggersListByDataBoxEdgeDeviceOptionalParams | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { - return this.client.sendOperationRequest( - { + public listByDataBoxEdgeDevice( + deviceName: string, + resourceGroupName: string, + options?: TriggersListByDataBoxEdgeDeviceOptionalParams + ): PagedAsyncIterableIterator { + const iter = this.listByDataBoxEdgeDevicePagingAll( + deviceName, + resourceGroupName, + options + ); + return { + next() { + return iter.next(); + }, + [Symbol.asyncIterator]() { + return this; + }, + byPage: () => { + return this.listByDataBoxEdgeDevicePagingPage( + deviceName, + resourceGroupName, + options + ); + } + }; + } + + private async *listByDataBoxEdgeDevicePagingPage( + deviceName: string, + resourceGroupName: string, + options?: TriggersListByDataBoxEdgeDeviceOptionalParams + ): AsyncIterableIterator { + let result = await this._listByDataBoxEdgeDevice( + deviceName, + resourceGroupName, + options + ); + yield result.value || []; + let continuationToken = result.nextLink; + while (continuationToken) { + result = await this._listByDataBoxEdgeDeviceNext( deviceName, resourceGroupName, + continuationToken, options - }, - listByDataBoxEdgeDeviceOperationSpec, - callback) as Promise; + ); + continuationToken = result.nextLink; + yield result.value || []; + } + } + + private async *listByDataBoxEdgeDevicePagingAll( + deviceName: string, + resourceGroupName: string, + options?: TriggersListByDataBoxEdgeDeviceOptionalParams + ): AsyncIterableIterator { + for await (const page of this.listByDataBoxEdgeDevicePagingPage( + deviceName, + resourceGroupName, + options + )) { + yield* page; + } } /** - * Get a specific trigger by name. - * @param deviceName The device name. - * @param name The trigger name. - * @param resourceGroupName The resource group name. - * @param [options] The optional parameters - * @returns Promise - */ - get(deviceName: string, name: string, resourceGroupName: string, options?: msRest.RequestOptionsBase): Promise; - /** + * Lists all the triggers configured in the device. * @param deviceName The device name. - * @param name The trigger name. * @param resourceGroupName The resource group name. - * @param callback The callback + * @param options The options parameters. */ - get(deviceName: string, name: string, resourceGroupName: string, callback: msRest.ServiceCallback): void; + private _listByDataBoxEdgeDevice( + deviceName: string, + resourceGroupName: string, + options?: TriggersListByDataBoxEdgeDeviceOptionalParams + ): Promise { + return this.client.sendOperationRequest( + { deviceName, resourceGroupName, options }, + listByDataBoxEdgeDeviceOperationSpec + ); + } + /** + * Get a specific trigger by name. * @param deviceName The device name. * @param name The trigger name. * @param resourceGroupName The resource group name. - * @param options The optional parameters - * @param callback The callback + * @param options The options parameters. */ - get(deviceName: string, name: string, resourceGroupName: string, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; - get(deviceName: string, name: string, resourceGroupName: string, options?: msRest.RequestOptionsBase | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { + get( + deviceName: string, + name: string, + resourceGroupName: string, + options?: TriggersGetOptionalParams + ): Promise { return this.client.sendOperationRequest( - { - deviceName, - name, - resourceGroupName, - options - }, - getOperationSpec, - callback) as Promise; + { deviceName, name, resourceGroupName, options }, + getOperationSpec + ); } /** * Creates or updates a trigger. * @param deviceName Creates or updates a trigger * @param name The trigger name. - * @param trigger The trigger. * @param resourceGroupName The resource group name. - * @param [options] The optional parameters - * @returns Promise + * @param trigger The trigger. + * @param options The options parameters. */ - createOrUpdate(deviceName: string, name: string, trigger: Models.TriggerUnion, resourceGroupName: string, options?: msRest.RequestOptionsBase): Promise { - return this.beginCreateOrUpdate(deviceName,name,trigger,resourceGroupName,options) - .then(lroPoller => lroPoller.pollUntilFinished()) as Promise; + async beginCreateOrUpdate( + deviceName: string, + name: string, + resourceGroupName: string, + trigger: TriggerUnion, + options?: TriggersCreateOrUpdateOptionalParams + ): Promise< + PollerLike< + PollOperationState, + TriggersCreateOrUpdateResponse + > + > { + const directSendOperation = async ( + args: coreClient.OperationArguments, + spec: coreClient.OperationSpec + ): Promise => { + return this.client.sendOperationRequest(args, spec); + }; + const sendOperation = async ( + args: coreClient.OperationArguments, + spec: coreClient.OperationSpec + ) => { + let currentRawResponse: + | coreClient.FullOperationResponse + | undefined = undefined; + const providedCallback = args.options?.onResponse; + const callback: coreClient.RawResponseCallback = ( + rawResponse: coreClient.FullOperationResponse, + flatResponse: unknown + ) => { + currentRawResponse = rawResponse; + providedCallback?.(rawResponse, flatResponse); + }; + const updatedArgs = { + ...args, + options: { + ...args.options, + onResponse: callback + } + }; + const flatResponse = await directSendOperation(updatedArgs, spec); + return { + flatResponse, + rawResponse: { + statusCode: currentRawResponse!.status, + body: currentRawResponse!.parsedBody, + headers: currentRawResponse!.headers.toJSON() + } + }; + }; + + const lro = new LroImpl( + sendOperation, + { deviceName, name, resourceGroupName, trigger, options }, + createOrUpdateOperationSpec + ); + return new LroEngine(lro, { + resumeFrom: options?.resumeFrom, + intervalInMs: options?.updateIntervalInMs + }); } /** - * Deletes the trigger on the gateway device. - * @param deviceName The device name. + * Creates or updates a trigger. + * @param deviceName Creates or updates a trigger * @param name The trigger name. * @param resourceGroupName The resource group name. - * @param [options] The optional parameters - * @returns Promise + * @param trigger The trigger. + * @param options The options parameters. */ - deleteMethod(deviceName: string, name: string, resourceGroupName: string, options?: msRest.RequestOptionsBase): Promise { - return this.beginDeleteMethod(deviceName,name,resourceGroupName,options) - .then(lroPoller => lroPoller.pollUntilFinished()); + async beginCreateOrUpdateAndWait( + deviceName: string, + name: string, + resourceGroupName: string, + trigger: TriggerUnion, + options?: TriggersCreateOrUpdateOptionalParams + ): Promise { + const poller = await this.beginCreateOrUpdate( + deviceName, + name, + resourceGroupName, + trigger, + options + ); + return poller.pollUntilDone(); } /** - * Creates or updates a trigger. - * @param deviceName Creates or updates a trigger + * Deletes the trigger on the gateway device. + * @param deviceName The device name. * @param name The trigger name. - * @param trigger The trigger. * @param resourceGroupName The resource group name. - * @param [options] The optional parameters - * @returns Promise + * @param options The options parameters. */ - beginCreateOrUpdate(deviceName: string, name: string, trigger: Models.TriggerUnion, resourceGroupName: string, options?: msRest.RequestOptionsBase): Promise { - return this.client.sendLRORequest( - { - deviceName, - name, - trigger, - resourceGroupName, - options - }, - beginCreateOrUpdateOperationSpec, - options); + async beginDelete( + deviceName: string, + name: string, + resourceGroupName: string, + options?: TriggersDeleteOptionalParams + ): Promise, void>> { + const directSendOperation = async ( + args: coreClient.OperationArguments, + spec: coreClient.OperationSpec + ): Promise => { + return this.client.sendOperationRequest(args, spec); + }; + const sendOperation = async ( + args: coreClient.OperationArguments, + spec: coreClient.OperationSpec + ) => { + let currentRawResponse: + | coreClient.FullOperationResponse + | undefined = undefined; + const providedCallback = args.options?.onResponse; + const callback: coreClient.RawResponseCallback = ( + rawResponse: coreClient.FullOperationResponse, + flatResponse: unknown + ) => { + currentRawResponse = rawResponse; + providedCallback?.(rawResponse, flatResponse); + }; + const updatedArgs = { + ...args, + options: { + ...args.options, + onResponse: callback + } + }; + const flatResponse = await directSendOperation(updatedArgs, spec); + return { + flatResponse, + rawResponse: { + statusCode: currentRawResponse!.status, + body: currentRawResponse!.parsedBody, + headers: currentRawResponse!.headers.toJSON() + } + }; + }; + + const lro = new LroImpl( + sendOperation, + { deviceName, name, resourceGroupName, options }, + deleteOperationSpec + ); + return new LroEngine(lro, { + resumeFrom: options?.resumeFrom, + intervalInMs: options?.updateIntervalInMs + }); } /** @@ -149,67 +310,50 @@ export class Triggers { * @param deviceName The device name. * @param name The trigger name. * @param resourceGroupName The resource group name. - * @param [options] The optional parameters - * @returns Promise + * @param options The options parameters. */ - beginDeleteMethod(deviceName: string, name: string, resourceGroupName: string, options?: msRest.RequestOptionsBase): Promise { - return this.client.sendLRORequest( - { - deviceName, - name, - resourceGroupName, - options - }, - beginDeleteMethodOperationSpec, - options); + async beginDeleteAndWait( + deviceName: string, + name: string, + resourceGroupName: string, + options?: TriggersDeleteOptionalParams + ): Promise { + const poller = await this.beginDelete( + deviceName, + name, + resourceGroupName, + options + ); + return poller.pollUntilDone(); } /** - * Lists all the triggers configured in the device. - * @param nextPageLink The NextLink from the previous successful call to List operation. - * @param [options] The optional parameters - * @returns Promise - */ - listByDataBoxEdgeDeviceNext(nextPageLink: string, options?: msRest.RequestOptionsBase): Promise; - /** - * @param nextPageLink The NextLink from the previous successful call to List operation. - * @param callback The callback - */ - listByDataBoxEdgeDeviceNext(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 + * ListByDataBoxEdgeDeviceNext + * @param deviceName The device name. + * @param resourceGroupName The resource group name. + * @param nextLink The nextLink from the previous successful call to the ListByDataBoxEdgeDevice + * method. + * @param options The options parameters. */ - listByDataBoxEdgeDeviceNext(nextPageLink: string, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; - listByDataBoxEdgeDeviceNext(nextPageLink: string, options?: msRest.RequestOptionsBase | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { + private _listByDataBoxEdgeDeviceNext( + deviceName: string, + resourceGroupName: string, + nextLink: string, + options?: TriggersListByDataBoxEdgeDeviceNextOptionalParams + ): Promise { return this.client.sendOperationRequest( - { - nextPageLink, - options - }, - listByDataBoxEdgeDeviceNextOperationSpec, - callback) as Promise; + { deviceName, resourceGroupName, nextLink, options }, + listByDataBoxEdgeDeviceNextOperationSpec + ); } } - // Operation Specifications -const serializer = new msRest.Serializer(Mappers); -const listByDataBoxEdgeDeviceOperationSpec: msRest.OperationSpec = { +const serializer = coreClient.createSerializer(Mappers, /* isXml */ false); + +const listByDataBoxEdgeDeviceOperationSpec: coreClient.OperationSpec = { + path: + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/{deviceName}/triggers", httpMethod: "GET", - path: "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/{deviceName}/triggers", - urlParameters: [ - Parameters.deviceName, - Parameters.subscriptionId, - Parameters.resourceGroupName - ], - queryParameters: [ - Parameters.apiVersion, - Parameters.filter - ], - headerParameters: [ - Parameters.acceptLanguage - ], responses: { 200: { bodyMapper: Mappers.TriggerList @@ -218,24 +362,20 @@ const listByDataBoxEdgeDeviceOperationSpec: msRest.OperationSpec = { bodyMapper: Mappers.CloudError } }, - serializer -}; - -const getOperationSpec: msRest.OperationSpec = { - httpMethod: "GET", - path: "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/{deviceName}/triggers/{name}", + queryParameters: [Parameters.apiVersion, Parameters.filter], urlParameters: [ - Parameters.deviceName, - Parameters.name, + Parameters.$host, Parameters.subscriptionId, - Parameters.resourceGroupName - ], - queryParameters: [ - Parameters.apiVersion - ], - headerParameters: [ - Parameters.acceptLanguage + Parameters.resourceGroupName, + Parameters.deviceName ], + headerParameters: [Parameters.accept], + serializer +}; +const getOperationSpec: coreClient.OperationSpec = { + path: + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/{deviceName}/triggers/{name}", + httpMethod: "GET", responses: { 200: { bodyMapper: Mappers.Trigger @@ -244,79 +384,78 @@ const getOperationSpec: msRest.OperationSpec = { bodyMapper: Mappers.CloudError } }, - serializer -}; - -const beginCreateOrUpdateOperationSpec: msRest.OperationSpec = { - httpMethod: "PUT", - path: "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/{deviceName}/triggers/{name}", + queryParameters: [Parameters.apiVersion], urlParameters: [ - Parameters.deviceName, - Parameters.name, + Parameters.$host, Parameters.subscriptionId, - Parameters.resourceGroupName - ], - queryParameters: [ - Parameters.apiVersion - ], - headerParameters: [ - Parameters.acceptLanguage + Parameters.resourceGroupName, + Parameters.deviceName, + Parameters.name ], - requestBody: { - parameterPath: "trigger", - mapper: { - ...Mappers.Trigger, - required: true - } - }, + headerParameters: [Parameters.accept], + serializer +}; +const createOrUpdateOperationSpec: coreClient.OperationSpec = { + path: + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/{deviceName}/triggers/{name}", + httpMethod: "PUT", responses: { 200: { bodyMapper: Mappers.Trigger }, - 202: {}, + 201: { + bodyMapper: Mappers.Trigger + }, + 202: { + bodyMapper: Mappers.Trigger + }, + 204: { + bodyMapper: Mappers.Trigger + }, default: { bodyMapper: Mappers.CloudError } }, - serializer -}; - -const beginDeleteMethodOperationSpec: msRest.OperationSpec = { - httpMethod: "DELETE", - path: "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/{deviceName}/triggers/{name}", + requestBody: Parameters.trigger, + queryParameters: [Parameters.apiVersion], urlParameters: [ - Parameters.deviceName, - Parameters.name, + Parameters.$host, Parameters.subscriptionId, - Parameters.resourceGroupName - ], - queryParameters: [ - Parameters.apiVersion - ], - headerParameters: [ - Parameters.acceptLanguage + Parameters.resourceGroupName, + Parameters.deviceName, + Parameters.name ], + headerParameters: [Parameters.accept, Parameters.contentType], + mediaType: "json", + serializer +}; +const deleteOperationSpec: coreClient.OperationSpec = { + path: + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/{deviceName}/triggers/{name}", + httpMethod: "DELETE", responses: { 200: {}, + 201: {}, 202: {}, 204: {}, default: { bodyMapper: Mappers.CloudError } }, + queryParameters: [Parameters.apiVersion], + urlParameters: [ + Parameters.$host, + Parameters.subscriptionId, + Parameters.resourceGroupName, + Parameters.deviceName, + Parameters.name + ], + headerParameters: [Parameters.accept], serializer }; - -const listByDataBoxEdgeDeviceNextOperationSpec: msRest.OperationSpec = { - httpMethod: "GET", - baseUrl: "https://management.azure.com", +const listByDataBoxEdgeDeviceNextOperationSpec: coreClient.OperationSpec = { path: "{nextLink}", - urlParameters: [ - Parameters.nextPageLink - ], - headerParameters: [ - Parameters.acceptLanguage - ], + httpMethod: "GET", responses: { 200: { bodyMapper: Mappers.TriggerList @@ -325,5 +464,14 @@ const listByDataBoxEdgeDeviceNextOperationSpec: msRest.OperationSpec = { bodyMapper: Mappers.CloudError } }, + queryParameters: [Parameters.apiVersion, Parameters.filter], + urlParameters: [ + Parameters.$host, + Parameters.nextLink, + Parameters.subscriptionId, + Parameters.resourceGroupName, + Parameters.deviceName + ], + headerParameters: [Parameters.accept], serializer }; diff --git a/sdk/databoxedge/arm-databoxedge-profile-2020-09-01-hybrid/src/operations/users.ts b/sdk/databoxedge/arm-databoxedge-profile-2020-09-01-hybrid/src/operations/users.ts index 4cb6ad492aa5..d665dc5ecd67 100644 --- a/sdk/databoxedge/arm-databoxedge-profile-2020-09-01-hybrid/src/operations/users.ts +++ b/sdk/databoxedge/arm-databoxedge-profile-2020-09-01-hybrid/src/operations/users.ts @@ -1,29 +1,42 @@ /* - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for - * license information. + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. * * 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 * 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/usersMappers"; +import { PagedAsyncIterableIterator } from "@azure/core-paging"; +import { Users } from "../operationsInterfaces"; +import * as coreClient from "@azure/core-client"; +import * as Mappers from "../models/mappers"; import * as Parameters from "../models/parameters"; -import { DataBoxEdgeManagementClientContext } from "../dataBoxEdgeManagementClientContext"; +import { DataBoxEdgeManagementClient } from "../dataBoxEdgeManagementClient"; +import { PollerLike, PollOperationState, LroEngine } from "@azure/core-lro"; +import { LroImpl } from "../lroImpl"; +import { + User, + UsersListByDataBoxEdgeDeviceNextOptionalParams, + UsersListByDataBoxEdgeDeviceOptionalParams, + UsersListByDataBoxEdgeDeviceResponse, + UsersGetOptionalParams, + UsersGetResponse, + UsersCreateOrUpdateOptionalParams, + UsersCreateOrUpdateResponse, + UsersDeleteOptionalParams, + UsersListByDataBoxEdgeDeviceNextResponse +} from "../models"; -/** Class representing a Users. */ -export class Users { - private readonly client: DataBoxEdgeManagementClientContext; +/// +/** Class containing Users operations. */ +export class UsersImpl implements Users { + private readonly client: DataBoxEdgeManagementClient; /** - * Create a Users. - * @param {DataBoxEdgeManagementClientContext} client Reference to the service client. + * Initialize a new instance of the class Users class. + * @param client Reference to the service client */ - constructor(client: DataBoxEdgeManagementClientContext) { + constructor(client: DataBoxEdgeManagementClient) { this.client = client; } @@ -31,68 +44,107 @@ export class Users { * Gets all the users registered on a Data Box Edge/Data Box Gateway device. * @param deviceName The device name. * @param resourceGroupName The resource group name. - * @param [options] The optional parameters - * @returns Promise + * @param options The options parameters. */ - listByDataBoxEdgeDevice(deviceName: string, resourceGroupName: string, options?: Models.UsersListByDataBoxEdgeDeviceOptionalParams): Promise; - /** - * @param deviceName The device name. - * @param resourceGroupName The resource group name. - * @param callback The callback - */ - listByDataBoxEdgeDevice(deviceName: string, resourceGroupName: string, callback: msRest.ServiceCallback): void; - /** - * @param deviceName The device name. - * @param resourceGroupName The resource group name. - * @param options The optional parameters - * @param callback The callback - */ - listByDataBoxEdgeDevice(deviceName: string, resourceGroupName: string, options: Models.UsersListByDataBoxEdgeDeviceOptionalParams, callback: msRest.ServiceCallback): void; - listByDataBoxEdgeDevice(deviceName: string, resourceGroupName: string, options?: Models.UsersListByDataBoxEdgeDeviceOptionalParams | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { - return this.client.sendOperationRequest( - { + public listByDataBoxEdgeDevice( + deviceName: string, + resourceGroupName: string, + options?: UsersListByDataBoxEdgeDeviceOptionalParams + ): PagedAsyncIterableIterator { + const iter = this.listByDataBoxEdgeDevicePagingAll( + deviceName, + resourceGroupName, + options + ); + return { + next() { + return iter.next(); + }, + [Symbol.asyncIterator]() { + return this; + }, + byPage: () => { + return this.listByDataBoxEdgeDevicePagingPage( + deviceName, + resourceGroupName, + options + ); + } + }; + } + + private async *listByDataBoxEdgeDevicePagingPage( + deviceName: string, + resourceGroupName: string, + options?: UsersListByDataBoxEdgeDeviceOptionalParams + ): AsyncIterableIterator { + let result = await this._listByDataBoxEdgeDevice( + deviceName, + resourceGroupName, + options + ); + yield result.value || []; + let continuationToken = result.nextLink; + while (continuationToken) { + result = await this._listByDataBoxEdgeDeviceNext( deviceName, resourceGroupName, + continuationToken, options - }, - listByDataBoxEdgeDeviceOperationSpec, - callback) as Promise; + ); + continuationToken = result.nextLink; + yield result.value || []; + } + } + + private async *listByDataBoxEdgeDevicePagingAll( + deviceName: string, + resourceGroupName: string, + options?: UsersListByDataBoxEdgeDeviceOptionalParams + ): AsyncIterableIterator { + for await (const page of this.listByDataBoxEdgeDevicePagingPage( + deviceName, + resourceGroupName, + options + )) { + yield* page; + } } /** - * Gets the properties of the specified user. - * @param deviceName The device name. - * @param name The user name. - * @param resourceGroupName The resource group name. - * @param [options] The optional parameters - * @returns Promise - */ - get(deviceName: string, name: string, resourceGroupName: string, options?: msRest.RequestOptionsBase): Promise; - /** + * Gets all the users registered on a Data Box Edge/Data Box Gateway device. * @param deviceName The device name. - * @param name The user name. * @param resourceGroupName The resource group name. - * @param callback The callback + * @param options The options parameters. */ - get(deviceName: string, name: string, resourceGroupName: string, callback: msRest.ServiceCallback): void; + private _listByDataBoxEdgeDevice( + deviceName: string, + resourceGroupName: string, + options?: UsersListByDataBoxEdgeDeviceOptionalParams + ): Promise { + return this.client.sendOperationRequest( + { deviceName, resourceGroupName, options }, + listByDataBoxEdgeDeviceOperationSpec + ); + } + /** + * Gets the properties of the specified user. * @param deviceName The device name. * @param name The user name. * @param resourceGroupName The resource group name. - * @param options The optional parameters - * @param callback The callback + * @param options The options parameters. */ - get(deviceName: string, name: string, resourceGroupName: string, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; - get(deviceName: string, name: string, resourceGroupName: string, options?: msRest.RequestOptionsBase | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { + get( + deviceName: string, + name: string, + resourceGroupName: string, + options?: UsersGetOptionalParams + ): Promise { return this.client.sendOperationRequest( - { - deviceName, - name, - resourceGroupName, - options - }, - getOperationSpec, - callback) as Promise; + { deviceName, name, resourceGroupName, options }, + getOperationSpec + ); } /** @@ -100,50 +152,159 @@ export class Users { * device. * @param deviceName The device name. * @param name The user name. - * @param user The user details. * @param resourceGroupName The resource group name. - * @param [options] The optional parameters - * @returns Promise + * @param user The user details. + * @param options The options parameters. */ - createOrUpdate(deviceName: string, name: string, user: Models.User, resourceGroupName: string, options?: msRest.RequestOptionsBase): Promise { - return this.beginCreateOrUpdate(deviceName,name,user,resourceGroupName,options) - .then(lroPoller => lroPoller.pollUntilFinished()) as Promise; + async beginCreateOrUpdate( + deviceName: string, + name: string, + resourceGroupName: string, + user: User, + options?: UsersCreateOrUpdateOptionalParams + ): Promise< + PollerLike< + PollOperationState, + UsersCreateOrUpdateResponse + > + > { + const directSendOperation = async ( + args: coreClient.OperationArguments, + spec: coreClient.OperationSpec + ): Promise => { + return this.client.sendOperationRequest(args, spec); + }; + const sendOperation = async ( + args: coreClient.OperationArguments, + spec: coreClient.OperationSpec + ) => { + let currentRawResponse: + | coreClient.FullOperationResponse + | undefined = undefined; + const providedCallback = args.options?.onResponse; + const callback: coreClient.RawResponseCallback = ( + rawResponse: coreClient.FullOperationResponse, + flatResponse: unknown + ) => { + currentRawResponse = rawResponse; + providedCallback?.(rawResponse, flatResponse); + }; + const updatedArgs = { + ...args, + options: { + ...args.options, + onResponse: callback + } + }; + const flatResponse = await directSendOperation(updatedArgs, spec); + return { + flatResponse, + rawResponse: { + statusCode: currentRawResponse!.status, + body: currentRawResponse!.parsedBody, + headers: currentRawResponse!.headers.toJSON() + } + }; + }; + + const lro = new LroImpl( + sendOperation, + { deviceName, name, resourceGroupName, user, options }, + createOrUpdateOperationSpec + ); + return new LroEngine(lro, { + resumeFrom: options?.resumeFrom, + intervalInMs: options?.updateIntervalInMs + }); } /** - * Deletes the user on a databox edge/gateway device. + * Creates a new user or updates an existing user's information on a Data Box Edge/Data Box Gateway + * device. * @param deviceName The device name. * @param name The user name. * @param resourceGroupName The resource group name. - * @param [options] The optional parameters - * @returns Promise + * @param user The user details. + * @param options The options parameters. */ - deleteMethod(deviceName: string, name: string, resourceGroupName: string, options?: msRest.RequestOptionsBase): Promise { - return this.beginDeleteMethod(deviceName,name,resourceGroupName,options) - .then(lroPoller => lroPoller.pollUntilFinished()); + async beginCreateOrUpdateAndWait( + deviceName: string, + name: string, + resourceGroupName: string, + user: User, + options?: UsersCreateOrUpdateOptionalParams + ): Promise { + const poller = await this.beginCreateOrUpdate( + deviceName, + name, + resourceGroupName, + user, + options + ); + return poller.pollUntilDone(); } /** - * Creates a new user or updates an existing user's information on a Data Box Edge/Data Box Gateway - * device. + * Deletes the user on a databox edge/gateway device. * @param deviceName The device name. * @param name The user name. - * @param user The user details. * @param resourceGroupName The resource group name. - * @param [options] The optional parameters - * @returns Promise + * @param options The options parameters. */ - beginCreateOrUpdate(deviceName: string, name: string, user: Models.User, resourceGroupName: string, options?: msRest.RequestOptionsBase): Promise { - return this.client.sendLRORequest( - { - deviceName, - name, - user, - resourceGroupName, - options - }, - beginCreateOrUpdateOperationSpec, - options); + async beginDelete( + deviceName: string, + name: string, + resourceGroupName: string, + options?: UsersDeleteOptionalParams + ): Promise, void>> { + const directSendOperation = async ( + args: coreClient.OperationArguments, + spec: coreClient.OperationSpec + ): Promise => { + return this.client.sendOperationRequest(args, spec); + }; + const sendOperation = async ( + args: coreClient.OperationArguments, + spec: coreClient.OperationSpec + ) => { + let currentRawResponse: + | coreClient.FullOperationResponse + | undefined = undefined; + const providedCallback = args.options?.onResponse; + const callback: coreClient.RawResponseCallback = ( + rawResponse: coreClient.FullOperationResponse, + flatResponse: unknown + ) => { + currentRawResponse = rawResponse; + providedCallback?.(rawResponse, flatResponse); + }; + const updatedArgs = { + ...args, + options: { + ...args.options, + onResponse: callback + } + }; + const flatResponse = await directSendOperation(updatedArgs, spec); + return { + flatResponse, + rawResponse: { + statusCode: currentRawResponse!.status, + body: currentRawResponse!.parsedBody, + headers: currentRawResponse!.headers.toJSON() + } + }; + }; + + const lro = new LroImpl( + sendOperation, + { deviceName, name, resourceGroupName, options }, + deleteOperationSpec + ); + return new LroEngine(lro, { + resumeFrom: options?.resumeFrom, + intervalInMs: options?.updateIntervalInMs + }); } /** @@ -151,67 +312,50 @@ export class Users { * @param deviceName The device name. * @param name The user name. * @param resourceGroupName The resource group name. - * @param [options] The optional parameters - * @returns Promise + * @param options The options parameters. */ - beginDeleteMethod(deviceName: string, name: string, resourceGroupName: string, options?: msRest.RequestOptionsBase): Promise { - return this.client.sendLRORequest( - { - deviceName, - name, - resourceGroupName, - options - }, - beginDeleteMethodOperationSpec, - options); + async beginDeleteAndWait( + deviceName: string, + name: string, + resourceGroupName: string, + options?: UsersDeleteOptionalParams + ): Promise { + const poller = await this.beginDelete( + deviceName, + name, + resourceGroupName, + options + ); + return poller.pollUntilDone(); } /** - * Gets all the users registered on a Data Box Edge/Data Box Gateway device. - * @param nextPageLink The NextLink from the previous successful call to List operation. - * @param [options] The optional parameters - * @returns Promise - */ - listByDataBoxEdgeDeviceNext(nextPageLink: string, options?: msRest.RequestOptionsBase): Promise; - /** - * @param nextPageLink The NextLink from the previous successful call to List operation. - * @param callback The callback - */ - listByDataBoxEdgeDeviceNext(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 + * ListByDataBoxEdgeDeviceNext + * @param deviceName The device name. + * @param resourceGroupName The resource group name. + * @param nextLink The nextLink from the previous successful call to the ListByDataBoxEdgeDevice + * method. + * @param options The options parameters. */ - listByDataBoxEdgeDeviceNext(nextPageLink: string, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; - listByDataBoxEdgeDeviceNext(nextPageLink: string, options?: msRest.RequestOptionsBase | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { + private _listByDataBoxEdgeDeviceNext( + deviceName: string, + resourceGroupName: string, + nextLink: string, + options?: UsersListByDataBoxEdgeDeviceNextOptionalParams + ): Promise { return this.client.sendOperationRequest( - { - nextPageLink, - options - }, - listByDataBoxEdgeDeviceNextOperationSpec, - callback) as Promise; + { deviceName, resourceGroupName, nextLink, options }, + listByDataBoxEdgeDeviceNextOperationSpec + ); } } - // Operation Specifications -const serializer = new msRest.Serializer(Mappers); -const listByDataBoxEdgeDeviceOperationSpec: msRest.OperationSpec = { +const serializer = coreClient.createSerializer(Mappers, /* isXml */ false); + +const listByDataBoxEdgeDeviceOperationSpec: coreClient.OperationSpec = { + path: + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/{deviceName}/users", httpMethod: "GET", - path: "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/{deviceName}/users", - urlParameters: [ - Parameters.deviceName, - Parameters.subscriptionId, - Parameters.resourceGroupName - ], - queryParameters: [ - Parameters.apiVersion, - Parameters.filter - ], - headerParameters: [ - Parameters.acceptLanguage - ], responses: { 200: { bodyMapper: Mappers.UserList @@ -220,24 +364,20 @@ const listByDataBoxEdgeDeviceOperationSpec: msRest.OperationSpec = { bodyMapper: Mappers.CloudError } }, - serializer -}; - -const getOperationSpec: msRest.OperationSpec = { - httpMethod: "GET", - path: "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/{deviceName}/users/{name}", + queryParameters: [Parameters.apiVersion, Parameters.filter], urlParameters: [ - Parameters.deviceName, - Parameters.name, + Parameters.$host, Parameters.subscriptionId, - Parameters.resourceGroupName - ], - queryParameters: [ - Parameters.apiVersion - ], - headerParameters: [ - Parameters.acceptLanguage + Parameters.resourceGroupName, + Parameters.deviceName ], + headerParameters: [Parameters.accept], + serializer +}; +const getOperationSpec: coreClient.OperationSpec = { + path: + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/{deviceName}/users/{name}", + httpMethod: "GET", responses: { 200: { bodyMapper: Mappers.User @@ -246,79 +386,78 @@ const getOperationSpec: msRest.OperationSpec = { bodyMapper: Mappers.CloudError } }, - serializer -}; - -const beginCreateOrUpdateOperationSpec: msRest.OperationSpec = { - httpMethod: "PUT", - path: "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/{deviceName}/users/{name}", + queryParameters: [Parameters.apiVersion], urlParameters: [ - Parameters.deviceName, - Parameters.name, + Parameters.$host, Parameters.subscriptionId, - Parameters.resourceGroupName - ], - queryParameters: [ - Parameters.apiVersion - ], - headerParameters: [ - Parameters.acceptLanguage + Parameters.resourceGroupName, + Parameters.deviceName, + Parameters.name ], - requestBody: { - parameterPath: "user", - mapper: { - ...Mappers.User, - required: true - } - }, + headerParameters: [Parameters.accept], + serializer +}; +const createOrUpdateOperationSpec: coreClient.OperationSpec = { + path: + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/{deviceName}/users/{name}", + httpMethod: "PUT", responses: { 200: { bodyMapper: Mappers.User }, - 202: {}, + 201: { + bodyMapper: Mappers.User + }, + 202: { + bodyMapper: Mappers.User + }, + 204: { + bodyMapper: Mappers.User + }, default: { bodyMapper: Mappers.CloudError } }, - serializer -}; - -const beginDeleteMethodOperationSpec: msRest.OperationSpec = { - httpMethod: "DELETE", - path: "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/{deviceName}/users/{name}", + requestBody: Parameters.user, + queryParameters: [Parameters.apiVersion], urlParameters: [ - Parameters.deviceName, - Parameters.name, + Parameters.$host, Parameters.subscriptionId, - Parameters.resourceGroupName - ], - queryParameters: [ - Parameters.apiVersion - ], - headerParameters: [ - Parameters.acceptLanguage + Parameters.resourceGroupName, + Parameters.deviceName, + Parameters.name ], + headerParameters: [Parameters.accept, Parameters.contentType], + mediaType: "json", + serializer +}; +const deleteOperationSpec: coreClient.OperationSpec = { + path: + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/{deviceName}/users/{name}", + httpMethod: "DELETE", responses: { 200: {}, + 201: {}, 202: {}, 204: {}, default: { bodyMapper: Mappers.CloudError } }, + queryParameters: [Parameters.apiVersion], + urlParameters: [ + Parameters.$host, + Parameters.subscriptionId, + Parameters.resourceGroupName, + Parameters.deviceName, + Parameters.name + ], + headerParameters: [Parameters.accept], serializer }; - -const listByDataBoxEdgeDeviceNextOperationSpec: msRest.OperationSpec = { - httpMethod: "GET", - baseUrl: "https://management.azure.com", +const listByDataBoxEdgeDeviceNextOperationSpec: coreClient.OperationSpec = { path: "{nextLink}", - urlParameters: [ - Parameters.nextPageLink - ], - headerParameters: [ - Parameters.acceptLanguage - ], + httpMethod: "GET", responses: { 200: { bodyMapper: Mappers.UserList @@ -327,5 +466,14 @@ const listByDataBoxEdgeDeviceNextOperationSpec: msRest.OperationSpec = { bodyMapper: Mappers.CloudError } }, + queryParameters: [Parameters.apiVersion, Parameters.filter], + urlParameters: [ + Parameters.$host, + Parameters.nextLink, + Parameters.subscriptionId, + Parameters.resourceGroupName, + Parameters.deviceName + ], + headerParameters: [Parameters.accept], serializer }; diff --git a/sdk/databoxedge/arm-databoxedge-profile-2020-09-01-hybrid/src/operationsInterfaces/alerts.ts b/sdk/databoxedge/arm-databoxedge-profile-2020-09-01-hybrid/src/operationsInterfaces/alerts.ts new file mode 100644 index 000000000000..d63bfbecb25c --- /dev/null +++ b/sdk/databoxedge/arm-databoxedge-profile-2020-09-01-hybrid/src/operationsInterfaces/alerts.ts @@ -0,0 +1,44 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +import { PagedAsyncIterableIterator } from "@azure/core-paging"; +import { + Alert, + AlertsListByDataBoxEdgeDeviceOptionalParams, + AlertsGetOptionalParams, + AlertsGetResponse +} from "../models"; + +/// +/** Interface representing a Alerts. */ +export interface Alerts { + /** + * Gets all the alerts for a Data Box Edge/Data Box Gateway device. + * @param deviceName The device name. + * @param resourceGroupName The resource group name. + * @param options The options parameters. + */ + listByDataBoxEdgeDevice( + deviceName: string, + resourceGroupName: string, + options?: AlertsListByDataBoxEdgeDeviceOptionalParams + ): PagedAsyncIterableIterator; + /** + * Gets an alert by name. + * @param deviceName The device name. + * @param name The alert name. + * @param resourceGroupName The resource group name. + * @param options The options parameters. + */ + get( + deviceName: string, + name: string, + resourceGroupName: string, + options?: AlertsGetOptionalParams + ): Promise; +} diff --git a/sdk/databoxedge/arm-databoxedge-profile-2020-09-01-hybrid/src/operationsInterfaces/bandwidthSchedules.ts b/sdk/databoxedge/arm-databoxedge-profile-2020-09-01-hybrid/src/operationsInterfaces/bandwidthSchedules.ts new file mode 100644 index 000000000000..3af876d0745a --- /dev/null +++ b/sdk/databoxedge/arm-databoxedge-profile-2020-09-01-hybrid/src/operationsInterfaces/bandwidthSchedules.ts @@ -0,0 +1,109 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +import { PagedAsyncIterableIterator } from "@azure/core-paging"; +import { PollerLike, PollOperationState } from "@azure/core-lro"; +import { + BandwidthSchedule, + BandwidthSchedulesListByDataBoxEdgeDeviceOptionalParams, + BandwidthSchedulesGetOptionalParams, + BandwidthSchedulesGetResponse, + BandwidthSchedulesCreateOrUpdateOptionalParams, + BandwidthSchedulesCreateOrUpdateResponse, + BandwidthSchedulesDeleteOptionalParams +} from "../models"; + +/// +/** Interface representing a BandwidthSchedules. */ +export interface BandwidthSchedules { + /** + * Gets all the bandwidth schedules for a Data Box Edge/Data Box Gateway device. + * @param deviceName The device name. + * @param resourceGroupName The resource group name. + * @param options The options parameters. + */ + listByDataBoxEdgeDevice( + deviceName: string, + resourceGroupName: string, + options?: BandwidthSchedulesListByDataBoxEdgeDeviceOptionalParams + ): PagedAsyncIterableIterator; + /** + * Gets the properties of the specified bandwidth schedule. + * @param deviceName The device name. + * @param name The bandwidth schedule name. + * @param resourceGroupName The resource group name. + * @param options The options parameters. + */ + get( + deviceName: string, + name: string, + resourceGroupName: string, + options?: BandwidthSchedulesGetOptionalParams + ): Promise; + /** + * Creates or updates a bandwidth schedule. + * @param deviceName The device name. + * @param name The bandwidth schedule name which needs to be added/updated. + * @param resourceGroupName The resource group name. + * @param parameters The bandwidth schedule to be added or updated. + * @param options The options parameters. + */ + beginCreateOrUpdate( + deviceName: string, + name: string, + resourceGroupName: string, + parameters: BandwidthSchedule, + options?: BandwidthSchedulesCreateOrUpdateOptionalParams + ): Promise< + PollerLike< + PollOperationState, + BandwidthSchedulesCreateOrUpdateResponse + > + >; + /** + * Creates or updates a bandwidth schedule. + * @param deviceName The device name. + * @param name The bandwidth schedule name which needs to be added/updated. + * @param resourceGroupName The resource group name. + * @param parameters The bandwidth schedule to be added or updated. + * @param options The options parameters. + */ + beginCreateOrUpdateAndWait( + deviceName: string, + name: string, + resourceGroupName: string, + parameters: BandwidthSchedule, + options?: BandwidthSchedulesCreateOrUpdateOptionalParams + ): Promise; + /** + * Deletes the specified bandwidth schedule. + * @param deviceName The device name. + * @param name The bandwidth schedule name. + * @param resourceGroupName The resource group name. + * @param options The options parameters. + */ + beginDelete( + deviceName: string, + name: string, + resourceGroupName: string, + options?: BandwidthSchedulesDeleteOptionalParams + ): Promise, void>>; + /** + * Deletes the specified bandwidth schedule. + * @param deviceName The device name. + * @param name The bandwidth schedule name. + * @param resourceGroupName The resource group name. + * @param options The options parameters. + */ + beginDeleteAndWait( + deviceName: string, + name: string, + resourceGroupName: string, + options?: BandwidthSchedulesDeleteOptionalParams + ): Promise; +} diff --git a/sdk/databoxedge/arm-databoxedge-profile-2020-09-01-hybrid/src/operationsInterfaces/containers.ts b/sdk/databoxedge/arm-databoxedge-profile-2020-09-01-hybrid/src/operationsInterfaces/containers.ts new file mode 100644 index 000000000000..44b012cd9bbe --- /dev/null +++ b/sdk/databoxedge/arm-databoxedge-profile-2020-09-01-hybrid/src/operationsInterfaces/containers.ts @@ -0,0 +1,152 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +import { PagedAsyncIterableIterator } from "@azure/core-paging"; +import { PollerLike, PollOperationState } from "@azure/core-lro"; +import { + Container, + ContainersListByStorageAccountOptionalParams, + ContainersGetOptionalParams, + ContainersGetResponse, + ContainersCreateOrUpdateOptionalParams, + ContainersCreateOrUpdateResponse, + ContainersDeleteOptionalParams, + ContainersRefreshOptionalParams +} from "../models"; + +/// +/** Interface representing a Containers. */ +export interface Containers { + /** + * Lists all the containers of a storage Account in a Data Box Edge/Data Box Gateway device. + * @param deviceName The device name. + * @param storageAccountName The storage Account name. + * @param resourceGroupName The resource group name. + * @param options The options parameters. + */ + listByStorageAccount( + deviceName: string, + storageAccountName: string, + resourceGroupName: string, + options?: ContainersListByStorageAccountOptionalParams + ): PagedAsyncIterableIterator; + /** + * Gets a container by name. + * @param deviceName The device name. + * @param storageAccountName The Storage Account Name + * @param containerName The container Name + * @param resourceGroupName The resource group name. + * @param options The options parameters. + */ + get( + deviceName: string, + storageAccountName: string, + containerName: string, + resourceGroupName: string, + options?: ContainersGetOptionalParams + ): Promise; + /** + * Creates a new container or updates an existing container on the device. + * @param deviceName The device name. + * @param storageAccountName The Storage Account Name + * @param containerName The container name. + * @param resourceGroupName The resource group name. + * @param container The container properties. + * @param options The options parameters. + */ + beginCreateOrUpdate( + deviceName: string, + storageAccountName: string, + containerName: string, + resourceGroupName: string, + container: Container, + options?: ContainersCreateOrUpdateOptionalParams + ): Promise< + PollerLike< + PollOperationState, + ContainersCreateOrUpdateResponse + > + >; + /** + * Creates a new container or updates an existing container on the device. + * @param deviceName The device name. + * @param storageAccountName The Storage Account Name + * @param containerName The container name. + * @param resourceGroupName The resource group name. + * @param container The container properties. + * @param options The options parameters. + */ + beginCreateOrUpdateAndWait( + deviceName: string, + storageAccountName: string, + containerName: string, + resourceGroupName: string, + container: Container, + options?: ContainersCreateOrUpdateOptionalParams + ): Promise; + /** + * Deletes the container on the Data Box Edge/Data Box Gateway device. + * @param deviceName The device name. + * @param storageAccountName The Storage Account Name + * @param containerName The container name. + * @param resourceGroupName The resource group name. + * @param options The options parameters. + */ + beginDelete( + deviceName: string, + storageAccountName: string, + containerName: string, + resourceGroupName: string, + options?: ContainersDeleteOptionalParams + ): Promise, void>>; + /** + * Deletes the container on the Data Box Edge/Data Box Gateway device. + * @param deviceName The device name. + * @param storageAccountName The Storage Account Name + * @param containerName The container name. + * @param resourceGroupName The resource group name. + * @param options The options parameters. + */ + beginDeleteAndWait( + deviceName: string, + storageAccountName: string, + containerName: string, + resourceGroupName: string, + options?: ContainersDeleteOptionalParams + ): Promise; + /** + * Refreshes the container metadata with the data from the cloud. + * @param deviceName The device name. + * @param storageAccountName The Storage Account Name + * @param containerName The container name. + * @param resourceGroupName The resource group name. + * @param options The options parameters. + */ + beginRefresh( + deviceName: string, + storageAccountName: string, + containerName: string, + resourceGroupName: string, + options?: ContainersRefreshOptionalParams + ): Promise, void>>; + /** + * Refreshes the container metadata with the data from the cloud. + * @param deviceName The device name. + * @param storageAccountName The Storage Account Name + * @param containerName The container name. + * @param resourceGroupName The resource group name. + * @param options The options parameters. + */ + beginRefreshAndWait( + deviceName: string, + storageAccountName: string, + containerName: string, + resourceGroupName: string, + options?: ContainersRefreshOptionalParams + ): Promise; +} diff --git a/sdk/databoxedge/arm-databoxedge-profile-2020-09-01-hybrid/src/operationsInterfaces/devices.ts b/sdk/databoxedge/arm-databoxedge-profile-2020-09-01-hybrid/src/operationsInterfaces/devices.ts new file mode 100644 index 000000000000..5b927c4f36c3 --- /dev/null +++ b/sdk/databoxedge/arm-databoxedge-profile-2020-09-01-hybrid/src/operationsInterfaces/devices.ts @@ -0,0 +1,274 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +import { PagedAsyncIterableIterator } from "@azure/core-paging"; +import { PollerLike, PollOperationState } from "@azure/core-lro"; +import { + DataBoxEdgeDevice, + DevicesListBySubscriptionOptionalParams, + DevicesListByResourceGroupOptionalParams, + DevicesGetOptionalParams, + DevicesGetResponse, + DevicesCreateOrUpdateOptionalParams, + DevicesCreateOrUpdateResponse, + DevicesDeleteOptionalParams, + DataBoxEdgeDevicePatch, + DevicesUpdateOptionalParams, + DevicesUpdateResponse, + DevicesDownloadUpdatesOptionalParams, + DevicesGetExtendedInformationOptionalParams, + DevicesGetExtendedInformationResponse, + DevicesInstallUpdatesOptionalParams, + DevicesGetNetworkSettingsOptionalParams, + DevicesGetNetworkSettingsResponse, + DevicesScanForUpdatesOptionalParams, + SecuritySettings, + DevicesCreateOrUpdateSecuritySettingsOptionalParams, + DevicesGetUpdateSummaryOptionalParams, + DevicesGetUpdateSummaryResponse, + UploadCertificateRequest, + DevicesUploadCertificateOptionalParams, + DevicesUploadCertificateResponse +} from "../models"; + +/// +/** Interface representing a Devices. */ +export interface Devices { + /** + * Gets all the Data Box Edge/Data Box Gateway devices in a subscription. + * @param options The options parameters. + */ + listBySubscription( + options?: DevicesListBySubscriptionOptionalParams + ): PagedAsyncIterableIterator; + /** + * Gets all the Data Box Edge/Data Box Gateway devices in a resource group. + * @param resourceGroupName The resource group name. + * @param options The options parameters. + */ + listByResourceGroup( + resourceGroupName: string, + options?: DevicesListByResourceGroupOptionalParams + ): PagedAsyncIterableIterator; + /** + * Gets the properties of the Data Box Edge/Data Box Gateway device. + * @param deviceName The device name. + * @param resourceGroupName The resource group name. + * @param options The options parameters. + */ + get( + deviceName: string, + resourceGroupName: string, + options?: DevicesGetOptionalParams + ): Promise; + /** + * Creates or updates a Data Box Edge/Data Box Gateway resource. + * @param deviceName The device name. + * @param resourceGroupName The resource group name. + * @param dataBoxEdgeDevice The resource object. + * @param options The options parameters. + */ + beginCreateOrUpdate( + deviceName: string, + resourceGroupName: string, + dataBoxEdgeDevice: DataBoxEdgeDevice, + options?: DevicesCreateOrUpdateOptionalParams + ): Promise< + PollerLike< + PollOperationState, + DevicesCreateOrUpdateResponse + > + >; + /** + * Creates or updates a Data Box Edge/Data Box Gateway resource. + * @param deviceName The device name. + * @param resourceGroupName The resource group name. + * @param dataBoxEdgeDevice The resource object. + * @param options The options parameters. + */ + beginCreateOrUpdateAndWait( + deviceName: string, + resourceGroupName: string, + dataBoxEdgeDevice: DataBoxEdgeDevice, + options?: DevicesCreateOrUpdateOptionalParams + ): Promise; + /** + * Deletes the Data Box Edge/Data Box Gateway device. + * @param deviceName The device name. + * @param resourceGroupName The resource group name. + * @param options The options parameters. + */ + beginDelete( + deviceName: string, + resourceGroupName: string, + options?: DevicesDeleteOptionalParams + ): Promise, void>>; + /** + * Deletes the Data Box Edge/Data Box Gateway device. + * @param deviceName The device name. + * @param resourceGroupName The resource group name. + * @param options The options parameters. + */ + beginDeleteAndWait( + deviceName: string, + resourceGroupName: string, + options?: DevicesDeleteOptionalParams + ): Promise; + /** + * Modifies a Data Box Edge/Data Box Gateway resource. + * @param deviceName The device name. + * @param resourceGroupName The resource group name. + * @param parameters The resource parameters. + * @param options The options parameters. + */ + update( + deviceName: string, + resourceGroupName: string, + parameters: DataBoxEdgeDevicePatch, + options?: DevicesUpdateOptionalParams + ): Promise; + /** + * Downloads the updates on a Data Box Edge/Data Box Gateway device. + * @param deviceName The device name. + * @param resourceGroupName The resource group name. + * @param options The options parameters. + */ + beginDownloadUpdates( + deviceName: string, + resourceGroupName: string, + options?: DevicesDownloadUpdatesOptionalParams + ): Promise, void>>; + /** + * Downloads the updates on a Data Box Edge/Data Box Gateway device. + * @param deviceName The device name. + * @param resourceGroupName The resource group name. + * @param options The options parameters. + */ + beginDownloadUpdatesAndWait( + deviceName: string, + resourceGroupName: string, + options?: DevicesDownloadUpdatesOptionalParams + ): Promise; + /** + * Gets additional information for the specified Data Box Edge/Data Box Gateway device. + * @param deviceName The device name. + * @param resourceGroupName The resource group name. + * @param options The options parameters. + */ + getExtendedInformation( + deviceName: string, + resourceGroupName: string, + options?: DevicesGetExtendedInformationOptionalParams + ): Promise; + /** + * Installs the updates on the Data Box Edge/Data Box Gateway device. + * @param deviceName The device name. + * @param resourceGroupName The resource group name. + * @param options The options parameters. + */ + beginInstallUpdates( + deviceName: string, + resourceGroupName: string, + options?: DevicesInstallUpdatesOptionalParams + ): Promise, void>>; + /** + * Installs the updates on the Data Box Edge/Data Box Gateway device. + * @param deviceName The device name. + * @param resourceGroupName The resource group name. + * @param options The options parameters. + */ + beginInstallUpdatesAndWait( + deviceName: string, + resourceGroupName: string, + options?: DevicesInstallUpdatesOptionalParams + ): Promise; + /** + * Gets the network settings of the specified Data Box Edge/Data Box Gateway device. + * @param deviceName The device name. + * @param resourceGroupName The resource group name. + * @param options The options parameters. + */ + getNetworkSettings( + deviceName: string, + resourceGroupName: string, + options?: DevicesGetNetworkSettingsOptionalParams + ): Promise; + /** + * Scans for updates on a Data Box Edge/Data Box Gateway device. + * @param deviceName The device name. + * @param resourceGroupName The resource group name. + * @param options The options parameters. + */ + beginScanForUpdates( + deviceName: string, + resourceGroupName: string, + options?: DevicesScanForUpdatesOptionalParams + ): Promise, void>>; + /** + * Scans for updates on a Data Box Edge/Data Box Gateway device. + * @param deviceName The device name. + * @param resourceGroupName The resource group name. + * @param options The options parameters. + */ + beginScanForUpdatesAndWait( + deviceName: string, + resourceGroupName: string, + options?: DevicesScanForUpdatesOptionalParams + ): Promise; + /** + * Updates the security settings on a Data Box Edge/Data Box Gateway device. + * @param deviceName The device name. + * @param resourceGroupName The resource group name. + * @param securitySettings The security settings. + * @param options The options parameters. + */ + beginCreateOrUpdateSecuritySettings( + deviceName: string, + resourceGroupName: string, + securitySettings: SecuritySettings, + options?: DevicesCreateOrUpdateSecuritySettingsOptionalParams + ): Promise, void>>; + /** + * Updates the security settings on a Data Box Edge/Data Box Gateway device. + * @param deviceName The device name. + * @param resourceGroupName The resource group name. + * @param securitySettings The security settings. + * @param options The options parameters. + */ + beginCreateOrUpdateSecuritySettingsAndWait( + deviceName: string, + resourceGroupName: string, + securitySettings: SecuritySettings, + options?: DevicesCreateOrUpdateSecuritySettingsOptionalParams + ): Promise; + /** + * Gets information about the availability of updates based on the last scan of the device. It also + * gets information about any ongoing download or install jobs on the device. + * @param deviceName The device name. + * @param resourceGroupName The resource group name. + * @param options The options parameters. + */ + getUpdateSummary( + deviceName: string, + resourceGroupName: string, + options?: DevicesGetUpdateSummaryOptionalParams + ): Promise; + /** + * Uploads registration certificate for the device. + * @param deviceName The device name. + * @param resourceGroupName The resource group name. + * @param parameters The upload certificate request. + * @param options The options parameters. + */ + uploadCertificate( + deviceName: string, + resourceGroupName: string, + parameters: UploadCertificateRequest, + options?: DevicesUploadCertificateOptionalParams + ): Promise; +} diff --git a/sdk/databoxedge/arm-databoxedge-profile-2020-09-01-hybrid/src/operationsInterfaces/index.ts b/sdk/databoxedge/arm-databoxedge-profile-2020-09-01-hybrid/src/operationsInterfaces/index.ts new file mode 100644 index 000000000000..6b621283bca4 --- /dev/null +++ b/sdk/databoxedge/arm-databoxedge-profile-2020-09-01-hybrid/src/operationsInterfaces/index.ts @@ -0,0 +1,24 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +export * from "./operations"; +export * from "./devices"; +export * from "./alerts"; +export * from "./bandwidthSchedules"; +export * from "./jobs"; +export * from "./nodes"; +export * from "./operationsStatus"; +export * from "./orders"; +export * from "./roles"; +export * from "./shares"; +export * from "./storageAccountCredentials"; +export * from "./storageAccounts"; +export * from "./containers"; +export * from "./triggers"; +export * from "./users"; +export * from "./skus"; diff --git a/sdk/databoxedge/arm-databoxedge-profile-2020-09-01-hybrid/src/operationsInterfaces/jobs.ts b/sdk/databoxedge/arm-databoxedge-profile-2020-09-01-hybrid/src/operationsInterfaces/jobs.ts new file mode 100644 index 000000000000..c10701318380 --- /dev/null +++ b/sdk/databoxedge/arm-databoxedge-profile-2020-09-01-hybrid/src/operationsInterfaces/jobs.ts @@ -0,0 +1,26 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +import { JobsGetOptionalParams, JobsGetResponse } from "../models"; + +/** Interface representing a Jobs. */ +export interface Jobs { + /** + * Gets the details of a specified job on a Data Box Edge/Data Box Gateway device. + * @param deviceName The device name. + * @param name The job name. + * @param resourceGroupName The resource group name. + * @param options The options parameters. + */ + get( + deviceName: string, + name: string, + resourceGroupName: string, + options?: JobsGetOptionalParams + ): Promise; +} diff --git a/sdk/databoxedge/arm-databoxedge-profile-2020-09-01-hybrid/src/operationsInterfaces/nodes.ts b/sdk/databoxedge/arm-databoxedge-profile-2020-09-01-hybrid/src/operationsInterfaces/nodes.ts new file mode 100644 index 000000000000..cfa552ffeed8 --- /dev/null +++ b/sdk/databoxedge/arm-databoxedge-profile-2020-09-01-hybrid/src/operationsInterfaces/nodes.ts @@ -0,0 +1,26 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +import { PagedAsyncIterableIterator } from "@azure/core-paging"; +import { Node, NodesListByDataBoxEdgeDeviceOptionalParams } from "../models"; + +/// +/** Interface representing a Nodes. */ +export interface Nodes { + /** + * Gets all the nodes currently configured under this Data Box Edge device + * @param deviceName The device name. + * @param resourceGroupName The resource group name. + * @param options The options parameters. + */ + listByDataBoxEdgeDevice( + deviceName: string, + resourceGroupName: string, + options?: NodesListByDataBoxEdgeDeviceOptionalParams + ): PagedAsyncIterableIterator; +} diff --git a/sdk/databoxedge/arm-databoxedge-profile-2020-09-01-hybrid/src/operationsInterfaces/operations.ts b/sdk/databoxedge/arm-databoxedge-profile-2020-09-01-hybrid/src/operationsInterfaces/operations.ts new file mode 100644 index 000000000000..f528bd71d702 --- /dev/null +++ b/sdk/databoxedge/arm-databoxedge-profile-2020-09-01-hybrid/src/operationsInterfaces/operations.ts @@ -0,0 +1,22 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +import { PagedAsyncIterableIterator } from "@azure/core-paging"; +import { Operation, OperationsListOptionalParams } from "../models"; + +/// +/** Interface representing a Operations. */ +export interface Operations { + /** + * List all the supported operations. + * @param options The options parameters. + */ + list( + options?: OperationsListOptionalParams + ): PagedAsyncIterableIterator; +} diff --git a/sdk/databoxedge/arm-databoxedge-profile-2020-09-01-hybrid/src/operationsInterfaces/operationsStatus.ts b/sdk/databoxedge/arm-databoxedge-profile-2020-09-01-hybrid/src/operationsInterfaces/operationsStatus.ts new file mode 100644 index 000000000000..001e719a50a3 --- /dev/null +++ b/sdk/databoxedge/arm-databoxedge-profile-2020-09-01-hybrid/src/operationsInterfaces/operationsStatus.ts @@ -0,0 +1,29 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +import { + OperationsStatusGetOptionalParams, + OperationsStatusGetResponse +} from "../models"; + +/** Interface representing a OperationsStatus. */ +export interface OperationsStatus { + /** + * Gets the details of a specified job on a Data Box Edge/Data Box Gateway device. + * @param deviceName The device name. + * @param name The job name. + * @param resourceGroupName The resource group name. + * @param options The options parameters. + */ + get( + deviceName: string, + name: string, + resourceGroupName: string, + options?: OperationsStatusGetOptionalParams + ): Promise; +} diff --git a/sdk/databoxedge/arm-databoxedge-profile-2020-09-01-hybrid/src/operationsInterfaces/orders.ts b/sdk/databoxedge/arm-databoxedge-profile-2020-09-01-hybrid/src/operationsInterfaces/orders.ts new file mode 100644 index 000000000000..fc82e8811f80 --- /dev/null +++ b/sdk/databoxedge/arm-databoxedge-profile-2020-09-01-hybrid/src/operationsInterfaces/orders.ts @@ -0,0 +1,99 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +import { PagedAsyncIterableIterator } from "@azure/core-paging"; +import { PollerLike, PollOperationState } from "@azure/core-lro"; +import { + Order, + OrdersListByDataBoxEdgeDeviceOptionalParams, + OrdersGetOptionalParams, + OrdersGetResponse, + OrdersCreateOrUpdateOptionalParams, + OrdersCreateOrUpdateResponse, + OrdersDeleteOptionalParams +} from "../models"; + +/// +/** Interface representing a Orders. */ +export interface Orders { + /** + * Lists all the orders related to a Data Box Edge/Data Box Gateway device. + * @param deviceName The device name. + * @param resourceGroupName The resource group name. + * @param options The options parameters. + */ + listByDataBoxEdgeDevice( + deviceName: string, + resourceGroupName: string, + options?: OrdersListByDataBoxEdgeDeviceOptionalParams + ): PagedAsyncIterableIterator; + /** + * Gets a specific order by name. + * @param deviceName The device name. + * @param resourceGroupName The resource group name. + * @param options The options parameters. + */ + get( + deviceName: string, + resourceGroupName: string, + options?: OrdersGetOptionalParams + ): Promise; + /** + * Creates or updates an order. + * @param deviceName The order details of a device. + * @param resourceGroupName The resource group name. + * @param order The order to be created or updated. + * @param options The options parameters. + */ + beginCreateOrUpdate( + deviceName: string, + resourceGroupName: string, + order: Order, + options?: OrdersCreateOrUpdateOptionalParams + ): Promise< + PollerLike< + PollOperationState, + OrdersCreateOrUpdateResponse + > + >; + /** + * Creates or updates an order. + * @param deviceName The order details of a device. + * @param resourceGroupName The resource group name. + * @param order The order to be created or updated. + * @param options The options parameters. + */ + beginCreateOrUpdateAndWait( + deviceName: string, + resourceGroupName: string, + order: Order, + options?: OrdersCreateOrUpdateOptionalParams + ): Promise; + /** + * Deletes the order related to the device. + * @param deviceName The device name. + * @param resourceGroupName The resource group name. + * @param options The options parameters. + */ + beginDelete( + deviceName: string, + resourceGroupName: string, + options?: OrdersDeleteOptionalParams + ): Promise, void>>; + /** + * Deletes the order related to the device. + * @param deviceName The device name. + * @param resourceGroupName The resource group name. + * @param options The options parameters. + */ + beginDeleteAndWait( + deviceName: string, + resourceGroupName: string, + options?: OrdersDeleteOptionalParams + ): Promise; +} diff --git a/sdk/databoxedge/arm-databoxedge-profile-2020-09-01-hybrid/src/operationsInterfaces/roles.ts b/sdk/databoxedge/arm-databoxedge-profile-2020-09-01-hybrid/src/operationsInterfaces/roles.ts new file mode 100644 index 000000000000..71a4698e81f9 --- /dev/null +++ b/sdk/databoxedge/arm-databoxedge-profile-2020-09-01-hybrid/src/operationsInterfaces/roles.ts @@ -0,0 +1,109 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +import { PagedAsyncIterableIterator } from "@azure/core-paging"; +import { PollerLike, PollOperationState } from "@azure/core-lro"; +import { + RoleUnion, + RolesListByDataBoxEdgeDeviceOptionalParams, + RolesGetOptionalParams, + RolesGetResponse, + RolesCreateOrUpdateOptionalParams, + RolesCreateOrUpdateResponse, + RolesDeleteOptionalParams +} from "../models"; + +/// +/** Interface representing a Roles. */ +export interface Roles { + /** + * Lists all the roles configured in a Data Box Edge/Data Box Gateway device. + * @param deviceName The device name. + * @param resourceGroupName The resource group name. + * @param options The options parameters. + */ + listByDataBoxEdgeDevice( + deviceName: string, + resourceGroupName: string, + options?: RolesListByDataBoxEdgeDeviceOptionalParams + ): PagedAsyncIterableIterator; + /** + * Gets a specific role by name. + * @param deviceName The device name. + * @param name The role name. + * @param resourceGroupName The resource group name. + * @param options The options parameters. + */ + get( + deviceName: string, + name: string, + resourceGroupName: string, + options?: RolesGetOptionalParams + ): Promise; + /** + * Create or update a role. + * @param deviceName The device name. + * @param name The role name. + * @param resourceGroupName The resource group name. + * @param role The role properties. + * @param options The options parameters. + */ + beginCreateOrUpdate( + deviceName: string, + name: string, + resourceGroupName: string, + role: RoleUnion, + options?: RolesCreateOrUpdateOptionalParams + ): Promise< + PollerLike< + PollOperationState, + RolesCreateOrUpdateResponse + > + >; + /** + * Create or update a role. + * @param deviceName The device name. + * @param name The role name. + * @param resourceGroupName The resource group name. + * @param role The role properties. + * @param options The options parameters. + */ + beginCreateOrUpdateAndWait( + deviceName: string, + name: string, + resourceGroupName: string, + role: RoleUnion, + options?: RolesCreateOrUpdateOptionalParams + ): Promise; + /** + * Deletes the role on the device. + * @param deviceName The device name. + * @param name The role name. + * @param resourceGroupName The resource group name. + * @param options The options parameters. + */ + beginDelete( + deviceName: string, + name: string, + resourceGroupName: string, + options?: RolesDeleteOptionalParams + ): Promise, void>>; + /** + * Deletes the role on the device. + * @param deviceName The device name. + * @param name The role name. + * @param resourceGroupName The resource group name. + * @param options The options parameters. + */ + beginDeleteAndWait( + deviceName: string, + name: string, + resourceGroupName: string, + options?: RolesDeleteOptionalParams + ): Promise; +} diff --git a/sdk/databoxedge/arm-databoxedge-profile-2020-09-01-hybrid/src/operationsInterfaces/shares.ts b/sdk/databoxedge/arm-databoxedge-profile-2020-09-01-hybrid/src/operationsInterfaces/shares.ts new file mode 100644 index 000000000000..da6ff331ebc6 --- /dev/null +++ b/sdk/databoxedge/arm-databoxedge-profile-2020-09-01-hybrid/src/operationsInterfaces/shares.ts @@ -0,0 +1,136 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +import { PagedAsyncIterableIterator } from "@azure/core-paging"; +import { PollerLike, PollOperationState } from "@azure/core-lro"; +import { + Share, + SharesListByDataBoxEdgeDeviceOptionalParams, + SharesGetOptionalParams, + SharesGetResponse, + SharesCreateOrUpdateOptionalParams, + SharesCreateOrUpdateResponse, + SharesDeleteOptionalParams, + SharesRefreshOptionalParams +} from "../models"; + +/// +/** Interface representing a Shares. */ +export interface Shares { + /** + * Lists all the shares in a Data Box Edge/Data Box Gateway device. + * @param deviceName The device name. + * @param resourceGroupName The resource group name. + * @param options The options parameters. + */ + listByDataBoxEdgeDevice( + deviceName: string, + resourceGroupName: string, + options?: SharesListByDataBoxEdgeDeviceOptionalParams + ): PagedAsyncIterableIterator; + /** + * Gets a share by name. + * @param deviceName The device name. + * @param name The share name. + * @param resourceGroupName The resource group name. + * @param options The options parameters. + */ + get( + deviceName: string, + name: string, + resourceGroupName: string, + options?: SharesGetOptionalParams + ): Promise; + /** + * Creates a new share or updates an existing share on the device. + * @param deviceName The device name. + * @param name The share name. + * @param resourceGroupName The resource group name. + * @param share The share properties. + * @param options The options parameters. + */ + beginCreateOrUpdate( + deviceName: string, + name: string, + resourceGroupName: string, + share: Share, + options?: SharesCreateOrUpdateOptionalParams + ): Promise< + PollerLike< + PollOperationState, + SharesCreateOrUpdateResponse + > + >; + /** + * Creates a new share or updates an existing share on the device. + * @param deviceName The device name. + * @param name The share name. + * @param resourceGroupName The resource group name. + * @param share The share properties. + * @param options The options parameters. + */ + beginCreateOrUpdateAndWait( + deviceName: string, + name: string, + resourceGroupName: string, + share: Share, + options?: SharesCreateOrUpdateOptionalParams + ): Promise; + /** + * Deletes the share on the Data Box Edge/Data Box Gateway device. + * @param deviceName The device name. + * @param name The share name. + * @param resourceGroupName The resource group name. + * @param options The options parameters. + */ + beginDelete( + deviceName: string, + name: string, + resourceGroupName: string, + options?: SharesDeleteOptionalParams + ): Promise, void>>; + /** + * Deletes the share on the Data Box Edge/Data Box Gateway device. + * @param deviceName The device name. + * @param name The share name. + * @param resourceGroupName The resource group name. + * @param options The options parameters. + */ + beginDeleteAndWait( + deviceName: string, + name: string, + resourceGroupName: string, + options?: SharesDeleteOptionalParams + ): Promise; + /** + * Refreshes the share metadata with the data from the cloud. + * @param deviceName The device name. + * @param name The share name. + * @param resourceGroupName The resource group name. + * @param options The options parameters. + */ + beginRefresh( + deviceName: string, + name: string, + resourceGroupName: string, + options?: SharesRefreshOptionalParams + ): Promise, void>>; + /** + * Refreshes the share metadata with the data from the cloud. + * @param deviceName The device name. + * @param name The share name. + * @param resourceGroupName The resource group name. + * @param options The options parameters. + */ + beginRefreshAndWait( + deviceName: string, + name: string, + resourceGroupName: string, + options?: SharesRefreshOptionalParams + ): Promise; +} diff --git a/sdk/databoxedge/arm-databoxedge-profile-2020-09-01-hybrid/src/operationsInterfaces/skus.ts b/sdk/databoxedge/arm-databoxedge-profile-2020-09-01-hybrid/src/operationsInterfaces/skus.ts new file mode 100644 index 000000000000..00d1b61fb5c1 --- /dev/null +++ b/sdk/databoxedge/arm-databoxedge-profile-2020-09-01-hybrid/src/operationsInterfaces/skus.ts @@ -0,0 +1,22 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +import { PagedAsyncIterableIterator } from "@azure/core-paging"; +import { ResourceTypeSku, SkusListOptionalParams } from "../models"; + +/// +/** Interface representing a Skus. */ +export interface Skus { + /** + * List all the available Skus in the region and information related to them + * @param options The options parameters. + */ + list( + options?: SkusListOptionalParams + ): PagedAsyncIterableIterator; +} diff --git a/sdk/databoxedge/arm-databoxedge-profile-2020-09-01-hybrid/src/operationsInterfaces/storageAccountCredentials.ts b/sdk/databoxedge/arm-databoxedge-profile-2020-09-01-hybrid/src/operationsInterfaces/storageAccountCredentials.ts new file mode 100644 index 000000000000..c5705ff6bc6a --- /dev/null +++ b/sdk/databoxedge/arm-databoxedge-profile-2020-09-01-hybrid/src/operationsInterfaces/storageAccountCredentials.ts @@ -0,0 +1,109 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +import { PagedAsyncIterableIterator } from "@azure/core-paging"; +import { PollerLike, PollOperationState } from "@azure/core-lro"; +import { + StorageAccountCredential, + StorageAccountCredentialsListByDataBoxEdgeDeviceOptionalParams, + StorageAccountCredentialsGetOptionalParams, + StorageAccountCredentialsGetResponse, + StorageAccountCredentialsCreateOrUpdateOptionalParams, + StorageAccountCredentialsCreateOrUpdateResponse, + StorageAccountCredentialsDeleteOptionalParams +} from "../models"; + +/// +/** Interface representing a StorageAccountCredentials. */ +export interface StorageAccountCredentials { + /** + * Gets all the storage account credentials in a Data Box Edge/Data Box Gateway device. + * @param deviceName The device name. + * @param resourceGroupName The resource group name. + * @param options The options parameters. + */ + listByDataBoxEdgeDevice( + deviceName: string, + resourceGroupName: string, + options?: StorageAccountCredentialsListByDataBoxEdgeDeviceOptionalParams + ): PagedAsyncIterableIterator; + /** + * Gets the properties of the specified storage account credential. + * @param deviceName The device name. + * @param name The storage account credential name. + * @param resourceGroupName The resource group name. + * @param options The options parameters. + */ + get( + deviceName: string, + name: string, + resourceGroupName: string, + options?: StorageAccountCredentialsGetOptionalParams + ): Promise; + /** + * Creates or updates the storage account credential. + * @param deviceName The device name. + * @param name The storage account credential name. + * @param resourceGroupName The resource group name. + * @param storageAccountCredential The storage account credential. + * @param options The options parameters. + */ + beginCreateOrUpdate( + deviceName: string, + name: string, + resourceGroupName: string, + storageAccountCredential: StorageAccountCredential, + options?: StorageAccountCredentialsCreateOrUpdateOptionalParams + ): Promise< + PollerLike< + PollOperationState, + StorageAccountCredentialsCreateOrUpdateResponse + > + >; + /** + * Creates or updates the storage account credential. + * @param deviceName The device name. + * @param name The storage account credential name. + * @param resourceGroupName The resource group name. + * @param storageAccountCredential The storage account credential. + * @param options The options parameters. + */ + beginCreateOrUpdateAndWait( + deviceName: string, + name: string, + resourceGroupName: string, + storageAccountCredential: StorageAccountCredential, + options?: StorageAccountCredentialsCreateOrUpdateOptionalParams + ): Promise; + /** + * Deletes the storage account credential. + * @param deviceName The device name. + * @param name The storage account credential name. + * @param resourceGroupName The resource group name. + * @param options The options parameters. + */ + beginDelete( + deviceName: string, + name: string, + resourceGroupName: string, + options?: StorageAccountCredentialsDeleteOptionalParams + ): Promise, void>>; + /** + * Deletes the storage account credential. + * @param deviceName The device name. + * @param name The storage account credential name. + * @param resourceGroupName The resource group name. + * @param options The options parameters. + */ + beginDeleteAndWait( + deviceName: string, + name: string, + resourceGroupName: string, + options?: StorageAccountCredentialsDeleteOptionalParams + ): Promise; +} diff --git a/sdk/databoxedge/arm-databoxedge-profile-2020-09-01-hybrid/src/operationsInterfaces/storageAccounts.ts b/sdk/databoxedge/arm-databoxedge-profile-2020-09-01-hybrid/src/operationsInterfaces/storageAccounts.ts new file mode 100644 index 000000000000..9c914d42cd22 --- /dev/null +++ b/sdk/databoxedge/arm-databoxedge-profile-2020-09-01-hybrid/src/operationsInterfaces/storageAccounts.ts @@ -0,0 +1,109 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +import { PagedAsyncIterableIterator } from "@azure/core-paging"; +import { PollerLike, PollOperationState } from "@azure/core-lro"; +import { + StorageAccount, + StorageAccountsListByDataBoxEdgeDeviceOptionalParams, + StorageAccountsGetOptionalParams, + StorageAccountsGetResponse, + StorageAccountsCreateOrUpdateOptionalParams, + StorageAccountsCreateOrUpdateResponse, + StorageAccountsDeleteOptionalParams +} from "../models"; + +/// +/** Interface representing a StorageAccounts. */ +export interface StorageAccounts { + /** + * Lists all the storage accounts in a Data Box Edge/Data Box Gateway device. + * @param deviceName The device name. + * @param resourceGroupName The resource group name. + * @param options The options parameters. + */ + listByDataBoxEdgeDevice( + deviceName: string, + resourceGroupName: string, + options?: StorageAccountsListByDataBoxEdgeDeviceOptionalParams + ): PagedAsyncIterableIterator; + /** + * Gets a StorageAccount by name. + * @param deviceName The device name. + * @param storageAccountName The storage account name. + * @param resourceGroupName The resource group name. + * @param options The options parameters. + */ + get( + deviceName: string, + storageAccountName: string, + resourceGroupName: string, + options?: StorageAccountsGetOptionalParams + ): Promise; + /** + * Creates a new StorageAccount or updates an existing StorageAccount on the device. + * @param deviceName The device name. + * @param storageAccountName The StorageAccount name. + * @param resourceGroupName The resource group name. + * @param storageAccount The StorageAccount properties. + * @param options The options parameters. + */ + beginCreateOrUpdate( + deviceName: string, + storageAccountName: string, + resourceGroupName: string, + storageAccount: StorageAccount, + options?: StorageAccountsCreateOrUpdateOptionalParams + ): Promise< + PollerLike< + PollOperationState, + StorageAccountsCreateOrUpdateResponse + > + >; + /** + * Creates a new StorageAccount or updates an existing StorageAccount on the device. + * @param deviceName The device name. + * @param storageAccountName The StorageAccount name. + * @param resourceGroupName The resource group name. + * @param storageAccount The StorageAccount properties. + * @param options The options parameters. + */ + beginCreateOrUpdateAndWait( + deviceName: string, + storageAccountName: string, + resourceGroupName: string, + storageAccount: StorageAccount, + options?: StorageAccountsCreateOrUpdateOptionalParams + ): Promise; + /** + * Deletes the StorageAccount on the Data Box Edge/Data Box Gateway device. + * @param deviceName The device name. + * @param storageAccountName The StorageAccount name. + * @param resourceGroupName The resource group name. + * @param options The options parameters. + */ + beginDelete( + deviceName: string, + storageAccountName: string, + resourceGroupName: string, + options?: StorageAccountsDeleteOptionalParams + ): Promise, void>>; + /** + * Deletes the StorageAccount on the Data Box Edge/Data Box Gateway device. + * @param deviceName The device name. + * @param storageAccountName The StorageAccount name. + * @param resourceGroupName The resource group name. + * @param options The options parameters. + */ + beginDeleteAndWait( + deviceName: string, + storageAccountName: string, + resourceGroupName: string, + options?: StorageAccountsDeleteOptionalParams + ): Promise; +} diff --git a/sdk/databoxedge/arm-databoxedge-profile-2020-09-01-hybrid/src/operationsInterfaces/triggers.ts b/sdk/databoxedge/arm-databoxedge-profile-2020-09-01-hybrid/src/operationsInterfaces/triggers.ts new file mode 100644 index 000000000000..b7c138aabc8a --- /dev/null +++ b/sdk/databoxedge/arm-databoxedge-profile-2020-09-01-hybrid/src/operationsInterfaces/triggers.ts @@ -0,0 +1,109 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +import { PagedAsyncIterableIterator } from "@azure/core-paging"; +import { PollerLike, PollOperationState } from "@azure/core-lro"; +import { + TriggerUnion, + TriggersListByDataBoxEdgeDeviceOptionalParams, + TriggersGetOptionalParams, + TriggersGetResponse, + TriggersCreateOrUpdateOptionalParams, + TriggersCreateOrUpdateResponse, + TriggersDeleteOptionalParams +} from "../models"; + +/// +/** Interface representing a Triggers. */ +export interface Triggers { + /** + * Lists all the triggers configured in the device. + * @param deviceName The device name. + * @param resourceGroupName The resource group name. + * @param options The options parameters. + */ + listByDataBoxEdgeDevice( + deviceName: string, + resourceGroupName: string, + options?: TriggersListByDataBoxEdgeDeviceOptionalParams + ): PagedAsyncIterableIterator; + /** + * Get a specific trigger by name. + * @param deviceName The device name. + * @param name The trigger name. + * @param resourceGroupName The resource group name. + * @param options The options parameters. + */ + get( + deviceName: string, + name: string, + resourceGroupName: string, + options?: TriggersGetOptionalParams + ): Promise; + /** + * Creates or updates a trigger. + * @param deviceName Creates or updates a trigger + * @param name The trigger name. + * @param resourceGroupName The resource group name. + * @param trigger The trigger. + * @param options The options parameters. + */ + beginCreateOrUpdate( + deviceName: string, + name: string, + resourceGroupName: string, + trigger: TriggerUnion, + options?: TriggersCreateOrUpdateOptionalParams + ): Promise< + PollerLike< + PollOperationState, + TriggersCreateOrUpdateResponse + > + >; + /** + * Creates or updates a trigger. + * @param deviceName Creates or updates a trigger + * @param name The trigger name. + * @param resourceGroupName The resource group name. + * @param trigger The trigger. + * @param options The options parameters. + */ + beginCreateOrUpdateAndWait( + deviceName: string, + name: string, + resourceGroupName: string, + trigger: TriggerUnion, + options?: TriggersCreateOrUpdateOptionalParams + ): Promise; + /** + * Deletes the trigger on the gateway device. + * @param deviceName The device name. + * @param name The trigger name. + * @param resourceGroupName The resource group name. + * @param options The options parameters. + */ + beginDelete( + deviceName: string, + name: string, + resourceGroupName: string, + options?: TriggersDeleteOptionalParams + ): Promise, void>>; + /** + * Deletes the trigger on the gateway device. + * @param deviceName The device name. + * @param name The trigger name. + * @param resourceGroupName The resource group name. + * @param options The options parameters. + */ + beginDeleteAndWait( + deviceName: string, + name: string, + resourceGroupName: string, + options?: TriggersDeleteOptionalParams + ): Promise; +} diff --git a/sdk/databoxedge/arm-databoxedge-profile-2020-09-01-hybrid/src/operationsInterfaces/users.ts b/sdk/databoxedge/arm-databoxedge-profile-2020-09-01-hybrid/src/operationsInterfaces/users.ts new file mode 100644 index 000000000000..648d6e49d850 --- /dev/null +++ b/sdk/databoxedge/arm-databoxedge-profile-2020-09-01-hybrid/src/operationsInterfaces/users.ts @@ -0,0 +1,111 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +import { PagedAsyncIterableIterator } from "@azure/core-paging"; +import { PollerLike, PollOperationState } from "@azure/core-lro"; +import { + User, + UsersListByDataBoxEdgeDeviceOptionalParams, + UsersGetOptionalParams, + UsersGetResponse, + UsersCreateOrUpdateOptionalParams, + UsersCreateOrUpdateResponse, + UsersDeleteOptionalParams +} from "../models"; + +/// +/** Interface representing a Users. */ +export interface Users { + /** + * Gets all the users registered on a Data Box Edge/Data Box Gateway device. + * @param deviceName The device name. + * @param resourceGroupName The resource group name. + * @param options The options parameters. + */ + listByDataBoxEdgeDevice( + deviceName: string, + resourceGroupName: string, + options?: UsersListByDataBoxEdgeDeviceOptionalParams + ): PagedAsyncIterableIterator; + /** + * Gets the properties of the specified user. + * @param deviceName The device name. + * @param name The user name. + * @param resourceGroupName The resource group name. + * @param options The options parameters. + */ + get( + deviceName: string, + name: string, + resourceGroupName: string, + options?: UsersGetOptionalParams + ): Promise; + /** + * Creates a new user or updates an existing user's information on a Data Box Edge/Data Box Gateway + * device. + * @param deviceName The device name. + * @param name The user name. + * @param resourceGroupName The resource group name. + * @param user The user details. + * @param options The options parameters. + */ + beginCreateOrUpdate( + deviceName: string, + name: string, + resourceGroupName: string, + user: User, + options?: UsersCreateOrUpdateOptionalParams + ): Promise< + PollerLike< + PollOperationState, + UsersCreateOrUpdateResponse + > + >; + /** + * Creates a new user or updates an existing user's information on a Data Box Edge/Data Box Gateway + * device. + * @param deviceName The device name. + * @param name The user name. + * @param resourceGroupName The resource group name. + * @param user The user details. + * @param options The options parameters. + */ + beginCreateOrUpdateAndWait( + deviceName: string, + name: string, + resourceGroupName: string, + user: User, + options?: UsersCreateOrUpdateOptionalParams + ): Promise; + /** + * Deletes the user on a databox edge/gateway device. + * @param deviceName The device name. + * @param name The user name. + * @param resourceGroupName The resource group name. + * @param options The options parameters. + */ + beginDelete( + deviceName: string, + name: string, + resourceGroupName: string, + options?: UsersDeleteOptionalParams + ): Promise, void>>; + /** + * Deletes the user on a databox edge/gateway device. + * @param deviceName The device name. + * @param name The user name. + * @param resourceGroupName The resource group name. + * @param options The options parameters. + */ + beginDeleteAndWait( + deviceName: string, + name: string, + resourceGroupName: string, + options?: UsersDeleteOptionalParams + ): Promise; +} diff --git a/sdk/databoxedge/arm-databoxedge-profile-2020-09-01-hybrid/test/sampleTest.ts b/sdk/databoxedge/arm-databoxedge-profile-2020-09-01-hybrid/test/sampleTest.ts new file mode 100644 index 000000000000..7ed89b043e1b --- /dev/null +++ b/sdk/databoxedge/arm-databoxedge-profile-2020-09-01-hybrid/test/sampleTest.ts @@ -0,0 +1,48 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +import { + env, + record, + RecorderEnvironmentSetup, + Recorder +} from "@azure-tools/test-recorder"; +import * as assert from "assert"; + +const recorderEnvSetup: RecorderEnvironmentSetup = { + replaceableVariables: { + AZURE_CLIENT_ID: "azure_client_id", + AZURE_CLIENT_SECRET: "azure_client_secret", + AZURE_TENANT_ID: "88888888-8888-8888-8888-888888888888", + SUBSCRIPTION_ID: "azure_subscription_id" + }, + customizationsOnRecordings: [ + (recording: any): any => + recording.replace( + /"access_token":"[^"]*"/g, + `"access_token":"access_token"` + ) + ], + queryParametersToSkip: [] +}; + +describe("My test", () => { + let recorder: Recorder; + + beforeEach(async function() { + recorder = record(this, recorderEnvSetup); + }); + + afterEach(async function() { + await recorder.stop(); + }); + + it("sample test", async function() { + console.log("Hi, I'm a test!"); + }); +}); diff --git a/sdk/databoxedge/arm-databoxedge-profile-2020-09-01-hybrid/tsconfig.json b/sdk/databoxedge/arm-databoxedge-profile-2020-09-01-hybrid/tsconfig.json index 422b584abd5e..3e6ae96443f3 100644 --- a/sdk/databoxedge/arm-databoxedge-profile-2020-09-01-hybrid/tsconfig.json +++ b/sdk/databoxedge/arm-databoxedge-profile-2020-09-01-hybrid/tsconfig.json @@ -3,17 +3,25 @@ "module": "es6", "moduleResolution": "node", "strict": true, - "target": "es5", + "target": "es6", "sourceMap": true, "declarationMap": true, "esModuleInterop": true, "allowSyntheticDefaultImports": true, "forceConsistentCasingInFileNames": true, - "lib": ["es6", "dom"], + "lib": [ + "es6", + "dom" + ], "declaration": true, - "outDir": "./esm", + "outDir": "./dist-esm", "importHelpers": true }, - "include": ["./src/**/*.ts"], - "exclude": ["node_modules"] -} + "include": [ + "./src/**/*.ts", + "./test/**/*.ts" + ], + "exclude": [ + "node_modules" + ] +} \ No newline at end of file diff --git a/sdk/databoxedge/ci.mgmt.yml b/sdk/databoxedge/ci.mgmt.yml index b11d4cf82281..2803e80c9365 100644 --- a/sdk/databoxedge/ci.mgmt.yml +++ b/sdk/databoxedge/ci.mgmt.yml @@ -1,5 +1,5 @@ # NOTE: Please refer to https://aka.ms/azsdk/engsys/ci-yaml before editing this file. - + trigger: branches: include: @@ -10,6 +10,7 @@ trigger: include: - sdk/databoxedge/ci.mgmt.yml - sdk/databoxedge/arm-databoxedge/ + - sdk/databoxedge/arm-databoxedge-profile-2020-09-01-hybrid pr: branches: include: @@ -23,11 +24,13 @@ pr: include: - sdk/databoxedge/ci.mgmt.yml - sdk/databoxedge/arm-databoxedge/ - + - sdk/databoxedge/arm-databoxedge-profile-2020-09-01-hybrid extends: template: /eng/pipelines/templates/stages/archetype-sdk-client.yml parameters: ServiceDirectory: databoxedge Artifacts: - name: azure-arm-databoxedge - safeName: azurearmdataboxedge \ No newline at end of file + safeName: azurearmdataboxedge + - name: azure-arm-databoxedge-profile-2020-09-01-hybrid + safeName: azurearmdataboxedgeprofile20200901hybrid