From bbd8536bffc14bd041bf8a3090c9079e5b231e50 Mon Sep 17 00:00:00 2001 From: SDKAuto Date: Fri, 10 Mar 2023 22:39:47 +0000 Subject: [PATCH] CodeGen from PR 23023 in Azure/azure-rest-api-specs Merge d756611240ebfa1b64fe94aab4dee270e1121192 into a80de12c16d6d9c3545bdc3e2b6c1d4ca6739876 --- common/config/rush/pnpm-lock.yaml | 54 +- rush.json | 7 +- .../arm-modsimworkbench/CHANGELOG.md | 5 + .../arm-modsimworkbench/LICENSE | 21 + .../arm-modsimworkbench/README.md | 109 ++ .../arm-modsimworkbench/_meta.json | 8 + .../arm-modsimworkbench/api-extractor.json | 31 + .../arm-modsimworkbench/package.json | 115 ++ .../review/arm-modsimworkbench.api.md | 1135 ++++++++++++ .../arm-modsimworkbench/rollup.config.js | 122 ++ .../arm-modsimworkbench/sample.env | 4 + .../arm-modsimworkbench/src/index.ts | 13 + .../arm-modsimworkbench/src/lroImpl.ts | 42 + .../src/microsoftModSimWorkbench.ts | 180 ++ .../arm-modsimworkbench/src/models/index.ts | 1404 ++++++++++++++ .../arm-modsimworkbench/src/models/mappers.ts | 1627 +++++++++++++++++ .../src/models/parameters.ts | 287 +++ .../src/operations/chambers.ts | 1170 ++++++++++++ .../src/operations/connectors.ts | 1092 +++++++++++ .../src/operations/fileOperations.ts | 175 ++ .../src/operations/fileRequest.ts | 179 ++ .../src/operations/fileRequests.ts | 414 +++++ .../src/operations/files.ts | 414 +++++ .../src/operations/index.ts | 18 + .../src/operations/operations.ts | 52 + .../src/operations/storages.ts | 593 ++++++ .../src/operations/workbenches.ts | 717 ++++++++ .../src/operations/workloads.ts | 965 ++++++++++ .../src/operationsInterfaces/chambers.ts | 276 +++ .../src/operationsInterfaces/connectors.ts | 269 +++ .../operationsInterfaces/fileOperations.ts | 46 + .../src/operationsInterfaces/fileRequest.ts | 52 + .../src/operationsInterfaces/fileRequests.ts | 86 + .../src/operationsInterfaces/files.ts | 86 + .../src/operationsInterfaces/index.ts | 18 + .../src/operationsInterfaces/operations.ts | 18 + .../src/operationsInterfaces/storages.ts | 140 ++ .../src/operationsInterfaces/workbenches.ts | 136 ++ .../src/operationsInterfaces/workloads.ts | 233 +++ .../arm-modsimworkbench/src/pagingHelper.ts | 39 + .../arm-modsimworkbench/test/sampleTest.ts | 43 + .../arm-modsimworkbench/tsconfig.json | 27 + sdk/modsimworkbench/ci.mgmt.yml | 38 + 43 files changed, 12448 insertions(+), 12 deletions(-) create mode 100644 sdk/modsimworkbench/arm-modsimworkbench/CHANGELOG.md create mode 100644 sdk/modsimworkbench/arm-modsimworkbench/LICENSE create mode 100644 sdk/modsimworkbench/arm-modsimworkbench/README.md create mode 100644 sdk/modsimworkbench/arm-modsimworkbench/_meta.json create mode 100644 sdk/modsimworkbench/arm-modsimworkbench/api-extractor.json create mode 100644 sdk/modsimworkbench/arm-modsimworkbench/package.json create mode 100644 sdk/modsimworkbench/arm-modsimworkbench/review/arm-modsimworkbench.api.md create mode 100644 sdk/modsimworkbench/arm-modsimworkbench/rollup.config.js create mode 100644 sdk/modsimworkbench/arm-modsimworkbench/sample.env create mode 100644 sdk/modsimworkbench/arm-modsimworkbench/src/index.ts create mode 100644 sdk/modsimworkbench/arm-modsimworkbench/src/lroImpl.ts create mode 100644 sdk/modsimworkbench/arm-modsimworkbench/src/microsoftModSimWorkbench.ts create mode 100644 sdk/modsimworkbench/arm-modsimworkbench/src/models/index.ts create mode 100644 sdk/modsimworkbench/arm-modsimworkbench/src/models/mappers.ts create mode 100644 sdk/modsimworkbench/arm-modsimworkbench/src/models/parameters.ts create mode 100644 sdk/modsimworkbench/arm-modsimworkbench/src/operations/chambers.ts create mode 100644 sdk/modsimworkbench/arm-modsimworkbench/src/operations/connectors.ts create mode 100644 sdk/modsimworkbench/arm-modsimworkbench/src/operations/fileOperations.ts create mode 100644 sdk/modsimworkbench/arm-modsimworkbench/src/operations/fileRequest.ts create mode 100644 sdk/modsimworkbench/arm-modsimworkbench/src/operations/fileRequests.ts create mode 100644 sdk/modsimworkbench/arm-modsimworkbench/src/operations/files.ts create mode 100644 sdk/modsimworkbench/arm-modsimworkbench/src/operations/index.ts create mode 100644 sdk/modsimworkbench/arm-modsimworkbench/src/operations/operations.ts create mode 100644 sdk/modsimworkbench/arm-modsimworkbench/src/operations/storages.ts create mode 100644 sdk/modsimworkbench/arm-modsimworkbench/src/operations/workbenches.ts create mode 100644 sdk/modsimworkbench/arm-modsimworkbench/src/operations/workloads.ts create mode 100644 sdk/modsimworkbench/arm-modsimworkbench/src/operationsInterfaces/chambers.ts create mode 100644 sdk/modsimworkbench/arm-modsimworkbench/src/operationsInterfaces/connectors.ts create mode 100644 sdk/modsimworkbench/arm-modsimworkbench/src/operationsInterfaces/fileOperations.ts create mode 100644 sdk/modsimworkbench/arm-modsimworkbench/src/operationsInterfaces/fileRequest.ts create mode 100644 sdk/modsimworkbench/arm-modsimworkbench/src/operationsInterfaces/fileRequests.ts create mode 100644 sdk/modsimworkbench/arm-modsimworkbench/src/operationsInterfaces/files.ts create mode 100644 sdk/modsimworkbench/arm-modsimworkbench/src/operationsInterfaces/index.ts create mode 100644 sdk/modsimworkbench/arm-modsimworkbench/src/operationsInterfaces/operations.ts create mode 100644 sdk/modsimworkbench/arm-modsimworkbench/src/operationsInterfaces/storages.ts create mode 100644 sdk/modsimworkbench/arm-modsimworkbench/src/operationsInterfaces/workbenches.ts create mode 100644 sdk/modsimworkbench/arm-modsimworkbench/src/operationsInterfaces/workloads.ts create mode 100644 sdk/modsimworkbench/arm-modsimworkbench/src/pagingHelper.ts create mode 100644 sdk/modsimworkbench/arm-modsimworkbench/test/sampleTest.ts create mode 100644 sdk/modsimworkbench/arm-modsimworkbench/tsconfig.json create mode 100644 sdk/modsimworkbench/ci.mgmt.yml diff --git a/common/config/rush/pnpm-lock.yaml b/common/config/rush/pnpm-lock.yaml index be2a29a5007b..61b74fc84f43 100644 --- a/common/config/rush/pnpm-lock.yaml +++ b/common/config/rush/pnpm-lock.yaml @@ -132,6 +132,7 @@ specifiers: '@rush-temp/arm-migrate': file:./projects/arm-migrate.tgz '@rush-temp/arm-mixedreality': file:./projects/arm-mixedreality.tgz '@rush-temp/arm-mobilenetwork': file:./projects/arm-mobilenetwork.tgz + '@rush-temp/arm-modsimworkbench': file:./projects/arm-modsimworkbench.tgz '@rush-temp/arm-monitor': file:./projects/arm-monitor.tgz '@rush-temp/arm-monitor-profile-2020-09-01-hybrid': file:./projects/arm-monitor-profile-2020-09-01-hybrid.tgz '@rush-temp/arm-msi': file:./projects/arm-msi.tgz @@ -466,6 +467,7 @@ dependencies: '@rush-temp/arm-migrate': file:projects/arm-migrate.tgz '@rush-temp/arm-mixedreality': file:projects/arm-mixedreality.tgz '@rush-temp/arm-mobilenetwork': file:projects/arm-mobilenetwork.tgz + '@rush-temp/arm-modsimworkbench': file:projects/arm-modsimworkbench.tgz '@rush-temp/arm-monitor': file:projects/arm-monitor.tgz '@rush-temp/arm-monitor-profile-2020-09-01-hybrid': file:projects/arm-monitor-profile-2020-09-01-hybrid.tgz '@rush-temp/arm-msi': file:projects/arm-msi.tgz @@ -4032,7 +4034,7 @@ packages: dependencies: semver: 7.3.8 shelljs: 0.8.5 - typescript: 5.1.0-dev.20230309 + typescript: 5.1.0-dev.20230310 dev: false /ecdsa-sig-formatter/1.0.11: @@ -8963,9 +8965,9 @@ packages: hasBin: true dev: false - /typescript/5.1.0-dev.20230309: - resolution: {integrity: sha512-pCqgzbHDsuACtq0v+pjNY6Zf7cdWZstY38Jq7FfD1HqAeEGnFKhrZgSRh7kS/QE5UOctGAqbp1ynTGdVI7s4Mw==} - engines: {node: '>=4.2.0'} + /typescript/5.1.0-dev.20230310: + resolution: {integrity: sha512-k1UQtwPDMigLne5sft4o1xhm83S/oZvZmaNyJB9/iuxnZ6Blpje3GFeFC5qEYH04cXmjLnHg4s0He1ACrS25DA==} + engines: {node: '>=12.20'} hasBin: true dev: false @@ -10054,7 +10056,7 @@ packages: dev: false file:projects/app-configuration.tgz: - resolution: {integrity: sha512-11s7ELWUeURBhvG90Ip9QP+D7uTS5DHZn7dZutSnzjDw4dBouxuHwLTuxXxEWx/SN30pCbc52inHwNVVb6RufA==, tarball: file:projects/app-configuration.tgz} + resolution: {integrity: sha512-CLn6BAgagKUJw0cSu2Ku91Zxkk7GoUYJ4z++Nu0D2QPN7hymevKMong9VGUFrCp9WomQF1+qW7qNzxyOXuWrdA==, tarball: file:projects/app-configuration.tgz} name: '@rush-temp/app-configuration' version: 0.0.0 dependencies: @@ -13398,6 +13400,36 @@ packages: - supports-color dev: false + file:projects/arm-modsimworkbench.tgz: + resolution: {integrity: sha512-Y6X68ekXaGXeRhr2MpJoUvSZ3PBcvxcHWCzENmzKDYw2FxIM6jFh8c5deUdSfIFOJK+l++8E3b7qVW8zLJJing==, tarball: file:projects/arm-modsimworkbench.tgz} + name: '@rush-temp/arm-modsimworkbench' + version: 0.0.0 + dependencies: + '@azure-tools/test-recorder': 2.0.0 + '@azure/identity': 2.1.0 + '@microsoft/api-extractor': 7.34.4_@types+node@14.18.37 + '@rollup/plugin-commonjs': 24.0.1_rollup@2.79.1 + '@rollup/plugin-json': 6.0.0_rollup@2.79.1 + '@rollup/plugin-multi-entry': 6.0.0_rollup@2.79.1 + '@rollup/plugin-node-resolve': 13.3.0_rollup@2.79.1 + '@types/chai': 4.3.4 + '@types/node': 14.18.37 + chai: 4.3.7 + cross-env: 7.0.3 + dotenv: 16.0.3 + mkdirp: 2.1.5 + mocha: 7.2.0 + rimraf: 3.0.2 + rollup: 2.79.1 + rollup-plugin-sourcemaps: 0.6.3_uvqxrz6xmh6o32kxhfeqlqrt5q + tslib: 2.5.0 + typescript: 4.8.4 + uglify-js: 3.17.4 + transitivePeerDependencies: + - encoding + - supports-color + dev: false + file:projects/arm-monitor-profile-2020-09-01-hybrid.tgz: resolution: {integrity: sha512-R9gupOJMRguovdYEoGI+O/k8DfsjRyKtfSgK20BbXPntHrRsnGaLMDSZFsWH4a40jsj7/B6H/hY16BZIpMOmzA==, tarball: file:projects/arm-monitor-profile-2020-09-01-hybrid.tgz} name: '@rush-temp/arm-monitor-profile-2020-09-01-hybrid' @@ -17510,7 +17542,7 @@ packages: dev: false file:projects/identity.tgz: - resolution: {integrity: sha512-PNVGSQgrV74ZaOtZm6TtRIFPjkRsml2P7B7UhyT9EiQ0F1WLTv4nvg5VO0o74HN4qK0ZDLXxjg3CNEgxqd5LTg==, tarball: file:projects/identity.tgz} + resolution: {integrity: sha512-D6xmkAXr5zwZ2B2DbCiC9wxYe0i7auXwa/E5SMB7/Amy9mnzJDRuO9dNDdHM6Ib0VjRzZ45rf1eGwBs+eOBjqA==, tarball: file:projects/identity.tgz} name: '@rush-temp/identity' version: 0.0.0 dependencies: @@ -17660,7 +17692,7 @@ packages: dev: false file:projects/keyvault-admin.tgz: - resolution: {integrity: sha512-1aR1s+cEC5T8rkebkJA2gFgWPwR5RVR7qOAyWvslFGqg4Up4bqVNI6q8YhpL/15gPijjjk5RTcUOT22wqfwnJw==, tarball: file:projects/keyvault-admin.tgz} + resolution: {integrity: sha512-WSclv7y5aWDIF6263syupSa4w9fyPmNlcZjQeBB3XBVyxBDuxAJz/aX4UR2NRJcJ5ki96kD6vdaLoAIbzlNj1A==, tarball: file:projects/keyvault-admin.tgz} name: '@rush-temp/keyvault-admin' version: 0.0.0 dependencies: @@ -17690,7 +17722,7 @@ packages: dev: false file:projects/keyvault-certificates.tgz: - resolution: {integrity: sha512-g8Wgna15TiEQooet1FkrlWzfZDl1cUueV0s3kd3y+g55OuL34cOTY5k0Q7Jc6lpQ8aB629YDfkDw6L7zgFdj7Q==, tarball: file:projects/keyvault-certificates.tgz} + resolution: {integrity: sha512-+TlMG/tyYlPFevmmP/XKl8hABuotZg+XSUSZnIhczwq8aXNvblynbltH8USbhX9UWIBTH4CqIYQUUVxXpM2psw==, tarball: file:projects/keyvault-certificates.tgz} name: '@rush-temp/keyvault-certificates' version: 0.0.0 dependencies: @@ -18714,7 +18746,7 @@ packages: dev: false file:projects/perf-keyvault-certificates.tgz: - resolution: {integrity: sha512-VRd1Fnp27eLm8oKYYFQCcXvnz2trIEutUMv6Ii6/DAUdPCzQm5yXJZmEO07bxwXKv1vSdMDZknW62M/nDQ+Dag==, tarball: file:projects/perf-keyvault-certificates.tgz} + resolution: {integrity: sha512-y0b7TFibUwxWIft7IQU79eCCYEEjeDQpLM3naIAbL5kd0OoY4FbGeweB1vbG2vqtmqUQLWQxdFkxzUNsOVjEYw==, tarball: file:projects/perf-keyvault-certificates.tgz} name: '@rush-temp/perf-keyvault-certificates' version: 0.0.0 dependencies: @@ -18737,7 +18769,7 @@ packages: dev: false file:projects/perf-keyvault-keys.tgz: - resolution: {integrity: sha512-ueAWRbfdi9lmOGge9FsNKesnXqDFeZVEzpEx0oTDYZK2vhIKaEvJjlysfzxUe3eyNPIsUsi30wa2jHrOk9g5qQ==, tarball: file:projects/perf-keyvault-keys.tgz} + resolution: {integrity: sha512-hA+SW0QnCcnQtEuOYvyXBVQnbMy373bLX/wVDpzcWqMSipB79qJZqccf4idCdMsdqLyLyNq+rgpYvVrYp5s+hA==, tarball: file:projects/perf-keyvault-keys.tgz} name: '@rush-temp/perf-keyvault-keys' version: 0.0.0 dependencies: @@ -18760,7 +18792,7 @@ packages: dev: false file:projects/perf-keyvault-secrets.tgz: - resolution: {integrity: sha512-uNewvxAIj7J9/amvOLrSo6/ofWG8sbxRz55gPJjJxPSpuk4iYjM+jETM7sE9XW+qI6Jr4gGDqDs9rBpLwHtfnA==, tarball: file:projects/perf-keyvault-secrets.tgz} + resolution: {integrity: sha512-QEpuPQgCBR4qGDKkWOzbCN+z0jOsboUOvPuel0wImAEprlJcsnpzEHrR2MRb9oPy/ZiJDnuJaobp2ysdnUXzUw==, tarball: file:projects/perf-keyvault-secrets.tgz} name: '@rush-temp/perf-keyvault-secrets' version: 0.0.0 dependencies: diff --git a/rush.json b/rush.json index 977c7c5e9937..1a5a87b4fce7 100644 --- a/rush.json +++ b/rush.json @@ -1947,6 +1947,11 @@ "packageName": "@azure/web-pubsub-client-protobuf", "projectFolder": "sdk/web-pubsub/web-pubsub-client-protobuf", "versionPolicyName": "client" + }, + { + "packageName": "@azure/arm-modsimworkbench", + "projectFolder": "sdk/modsimworkbench/arm-modsimworkbench", + "versionPolicyName": "management" } ] -} +} \ No newline at end of file diff --git a/sdk/modsimworkbench/arm-modsimworkbench/CHANGELOG.md b/sdk/modsimworkbench/arm-modsimworkbench/CHANGELOG.md new file mode 100644 index 000000000000..8e75397fa740 --- /dev/null +++ b/sdk/modsimworkbench/arm-modsimworkbench/CHANGELOG.md @@ -0,0 +1,5 @@ +# Release History + +## 1.0.0-beta.1 (2023-03-10) + +The package of @azure/arm-modsimworkbench is using our next generation design principles. To learn more, please refer to our documentation [Quick Start](https://aka.ms/js-track2-quickstart). diff --git a/sdk/modsimworkbench/arm-modsimworkbench/LICENSE b/sdk/modsimworkbench/arm-modsimworkbench/LICENSE new file mode 100644 index 000000000000..3a1d9b6f24f7 --- /dev/null +++ b/sdk/modsimworkbench/arm-modsimworkbench/LICENSE @@ -0,0 +1,21 @@ +The MIT License (MIT) + +Copyright (c) 2023 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/modsimworkbench/arm-modsimworkbench/README.md b/sdk/modsimworkbench/arm-modsimworkbench/README.md new file mode 100644 index 000000000000..9757a26e08f5 --- /dev/null +++ b/sdk/modsimworkbench/arm-modsimworkbench/README.md @@ -0,0 +1,109 @@ +# Azure MicrosoftModSimWorkbench client library for JavaScript + +This package contains an isomorphic SDK (runs both in Node.js and in browsers) for Azure MicrosoftModSimWorkbench client. + +Microsoft.ModSimWorkbench resource provider OpenAPI Spec + +[Source code](https://github.com/Azure/azure-sdk-for-js/tree/main/sdk/modsimworkbench/arm-modsimworkbench) | +[Package (NPM)](https://www.npmjs.com/package/@azure/arm-modsimworkbench) | +[API reference documentation](https://docs.microsoft.com/javascript/api/@azure/arm-modsimworkbench?view=azure-node-preview) | +[Samples](https://github.com/Azure-Samples/azure-samples-js-management) + +## Getting started + +### Currently supported environments + +- [LTS versions of Node.js](https://github.com/nodejs/release#release-schedule) +- 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 + +- An [Azure subscription][azure_sub]. + +### Install the `@azure/arm-modsimworkbench` package + +Install the Azure MicrosoftModSimWorkbench client library for JavaScript with `npm`: + +```bash +npm install @azure/arm-modsimworkbench +``` + +### Create and authenticate a `MicrosoftModSimWorkbench` + +To create a client object to access the Azure MicrosoftModSimWorkbench API, you will need the `endpoint` of your Azure MicrosoftModSimWorkbench resource and a `credential`. The Azure MicrosoftModSimWorkbench client can use Azure Active Directory credentials to authenticate. +You can find the endpoint for your Azure MicrosoftModSimWorkbench resource in the [Azure Portal][azure_portal]. + +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). + +To use the [DefaultAzureCredential][defaultazurecredential] provider shown below, or other credential providers provided with the Azure SDK, please install the `@azure/identity` package: + +```bash +npm install @azure/identity +``` + +You will also need to **register a new AAD application and grant access to Azure MicrosoftModSimWorkbench** 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`. + +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 { MicrosoftModSimWorkbench } = require("@azure/arm-modsimworkbench"); +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 MicrosoftModSimWorkbench(new DefaultAzureCredential(), subscriptionId); + +// For client-side applications running in the browser, use this code instead: +// const credential = new InteractiveBrowserCredential({ +// tenantId: "", +// clientId: "" +// }); +// const client = new MicrosoftModSimWorkbench(credential, subscriptionId); +``` + + +### 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 + +### MicrosoftModSimWorkbench + +`MicrosoftModSimWorkbench` is the primary interface for developers using the Azure MicrosoftModSimWorkbench client library. Explore the methods on this client object to understand the different features of the Azure MicrosoftModSimWorkbench 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) + +![Impressions](https://azure-sdk-impressions.azurewebsites.net/api/impressions/azure-sdk-for-js%2Fsdk%2Fmodsimworkbench%2Farm-modsimworkbench%2FREADME.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/modsimworkbench/arm-modsimworkbench/_meta.json b/sdk/modsimworkbench/arm-modsimworkbench/_meta.json new file mode 100644 index 000000000000..3c2f593d1dbc --- /dev/null +++ b/sdk/modsimworkbench/arm-modsimworkbench/_meta.json @@ -0,0 +1,8 @@ +{ + "commit": "fd5d8e3f56efc8b6b4e7351a5b0395139bdf79d5", + "readme": "specification/modsimworkbench/resource-manager/readme.md", + "autorest_command": "autorest --version=3.9.3 --typescript --modelerfour.lenient-model-deduplication --azure-arm --head-as-boolean=true --license-header=MICROSOFT_MIT_NO_VERSION --generate-test --typescript-sdks-folder=/mnt/vss/_work/1/s/azure-sdk-for-js ../azure-rest-api-specs/specification/modsimworkbench/resource-manager/readme.md --use=@autorest/typescript@6.0.0-rc.9", + "repository_url": "https://github.com/Azure/azure-rest-api-specs.git", + "release_tool": "@azure-tools/js-sdk-release-tools@2.6.2", + "use": "@autorest/typescript@6.0.0-rc.9" +} \ No newline at end of file diff --git a/sdk/modsimworkbench/arm-modsimworkbench/api-extractor.json b/sdk/modsimworkbench/arm-modsimworkbench/api-extractor.json new file mode 100644 index 000000000000..fa5d5f4e80b8 --- /dev/null +++ b/sdk/modsimworkbench/arm-modsimworkbench/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-modsimworkbench.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/modsimworkbench/arm-modsimworkbench/package.json b/sdk/modsimworkbench/arm-modsimworkbench/package.json new file mode 100644 index 000000000000..65f15df08b3f --- /dev/null +++ b/sdk/modsimworkbench/arm-modsimworkbench/package.json @@ -0,0 +1,115 @@ +{ + "name": "@azure/arm-modsimworkbench", + "sdk-type": "mgmt", + "author": "Microsoft Corporation", + "description": "A generated SDK for MicrosoftModSimWorkbench.", + "version": "1.0.0-beta.1", + "engines": { + "node": ">=14.0.0" + }, + "dependencies": { + "@azure/core-lro": "^2.5.0", + "@azure/abort-controller": "^1.0.0", + "@azure/core-paging": "^1.2.0", + "@azure/core-client": "^1.7.0", + "@azure/core-auth": "^1.3.0", + "@azure/core-rest-pipeline": "^1.8.0", + "tslib": "^2.2.0" + }, + "keywords": [ + "node", + "azure", + "typescript", + "browser", + "isomorphic" + ], + "license": "MIT", + "main": "./dist/index.js", + "module": "./dist-esm/src/index.js", + "types": "./types/arm-modsimworkbench.d.ts", + "devDependencies": { + "@microsoft/api-extractor": "^7.31.1", + "@rollup/plugin-commonjs": "^24.0.0", + "@rollup/plugin-json": "^6.0.0", + "@rollup/plugin-multi-entry": "^6.0.0", + "@rollup/plugin-node-resolve": "^13.1.3", + "mkdirp": "^2.1.2", + "rollup": "^2.66.1", + "rollup-plugin-sourcemaps": "^0.6.3", + "typescript": "~4.8.0", + "uglify-js": "^3.4.9", + "rimraf": "^3.0.0", + "dotenv": "^16.0.0", + "@azure/identity": "^2.0.1", + "@azure-tools/test-recorder": "^2.0.0", + "@azure-tools/test-credential": "^1.0.0", + "mocha": "^7.1.1", + "@types/chai": "^4.2.8", + "chai": "^4.2.0", + "cross-env": "^7.0.2", + "@types/node": "^14.0.0", + "@azure/dev-tool": "^1.0.0" + }, + "repository": { + "type": "git", + "url": "https://github.com/Azure/azure-sdk-for-js.git" + }, + "bugs": { + "url": "https://github.com/Azure/azure-sdk-for-js/issues" + }, + "files": [ + "dist/**/*.js", + "dist/**/*.js.map", + "dist/**/*.d.ts", + "dist/**/*.d.ts.map", + "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", + "review/*", + "CHANGELOG.md", + "types/*" + ], + "scripts": { + "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": "dev-tool run test:node-ts-input -- --timeout 1200000 'test/*.ts'", + "integration-test:browser": "echo skipped" + }, + "sideEffects": false, + "//metadata": { + "constantPaths": [ + { + "path": "src/microsoftModSimWorkbench.ts", + "prefix": "packageDetails" + } + ] + }, + "autoPublish": true, + "homepage": "https://github.com/Azure/azure-sdk-for-js/tree/main/sdk/modsimworkbench/arm-modsimworkbench" +} \ No newline at end of file diff --git a/sdk/modsimworkbench/arm-modsimworkbench/review/arm-modsimworkbench.api.md b/sdk/modsimworkbench/arm-modsimworkbench/review/arm-modsimworkbench.api.md new file mode 100644 index 000000000000..6ab1f6b000b0 --- /dev/null +++ b/sdk/modsimworkbench/arm-modsimworkbench/review/arm-modsimworkbench.api.md @@ -0,0 +1,1135 @@ +## API Report File for "@azure/arm-modsimworkbench" + +> 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 { OperationState } from '@azure/core-lro'; +import { PagedAsyncIterableIterator } from '@azure/core-paging'; +import { SimplePollerLike } from '@azure/core-lro'; + +// @public +export interface AccessConfiguration { + readonly accessType?: AccessType; + readonly accessUrl?: string; + gatewayType?: GatewayType; + gatewayVnetId?: string; + readonly ipAddress?: string; +} + +// @public +export type AccessType = string; + +// @public +export type Action = string; + +// @public +export interface AppOidc { + clientId?: string; + secretUri?: string; +} + +// @public +export interface Chamber extends Resource { + enablePropertiesLicenseServicesAnsysEnable?: boolean; + enablePropertiesLicenseServicesCadenceEnable?: boolean; + enablePropertiesLicenseServicesSiemensEnable?: boolean; + enablePropertiesLicenseServicesSynopsysEnable?: boolean; + lmhostIdPropertiesLicenseServicesAnsysLmhostId?: string[]; + lmhostIdPropertiesLicenseServicesCadenceLmhostId?: string[]; + lmhostIdPropertiesLicenseServicesSiemensLmhostId?: string[]; + mfp?: string[]; + readonly provisioningState?: ProvisioningState; + serverPropertiesLicenseServicesAnsysServer?: string; + serverPropertiesLicenseServicesCadenceServer?: string; + serverPropertiesLicenseServicesSiemensServer?: string; + serverPropertiesLicenseServicesSynopsysServer?: string; + vmUuid?: string[]; +} + +// @public +export interface ChamberPageableList { + nextLink?: string; + value?: Chamber[]; +} + +// @public +export interface Chambers { + beginCreateOrUpdate(resourceGroup: string, workbenchName: string, chamberName: string, options?: ChambersCreateOrUpdateOptionalParams): Promise, ChambersCreateOrUpdateResponse>>; + beginCreateOrUpdateAndWait(resourceGroup: string, workbenchName: string, chamberName: string, options?: ChambersCreateOrUpdateOptionalParams): Promise; + beginDelete(resourceGroup: string, workbenchName: string, chamberName: string, options?: ChambersDeleteOptionalParams): Promise, ChambersDeleteResponse>>; + beginDeleteAndWait(resourceGroup: string, workbenchName: string, chamberName: string, options?: ChambersDeleteOptionalParams): Promise; + beginLicenseRestart(resourceGroup: string, workbenchName: string, name: string, options?: ChambersLicenseRestartOptionalParams): Promise, void>>; + beginLicenseRestartAndWait(resourceGroup: string, workbenchName: string, name: string, options?: ChambersLicenseRestartOptionalParams): Promise; + beginLicenseUpdate(resourceGroup: string, workbenchName: string, name: string, options?: ChambersLicenseUpdateOptionalParams): Promise, void>>; + beginLicenseUpdateAndWait(resourceGroup: string, workbenchName: string, name: string, options?: ChambersLicenseUpdateOptionalParams): Promise; + beginRestart(resourceGroup: string, workbenchName: string, name: string, options?: ChambersRestartOptionalParams): Promise, void>>; + beginRestartAndWait(resourceGroup: string, workbenchName: string, name: string, options?: ChambersRestartOptionalParams): Promise; + beginStart(resourceGroup: string, workbenchName: string, name: string, options?: ChambersStartOptionalParams): Promise, void>>; + beginStartAndWait(resourceGroup: string, workbenchName: string, name: string, options?: ChambersStartOptionalParams): Promise; + beginStop(resourceGroup: string, workbenchName: string, name: string, options?: ChambersStopOptionalParams): Promise, void>>; + beginStopAndWait(resourceGroup: string, workbenchName: string, name: string, options?: ChambersStopOptionalParams): Promise; + get(resourceGroup: string, workbenchName: string, chamberName: string, options?: ChambersGetOptionalParams): Promise; + getUploadUri(resourceGroup: string, workbenchName: string, name: string, options?: ChambersGetUploadUriOptionalParams): Promise; + list(resourceGroup: string, workbenchName: string, options?: ChambersListOptionalParams): PagedAsyncIterableIterator; + update(resourceGroup: string, workbenchName: string, chamberName: string, options?: ChambersUpdateOptionalParams): Promise; +} + +// @public +export interface ChambersCreateOrUpdateOptionalParams extends coreClient.OperationOptions { + parameters?: Chamber; + resumeFrom?: string; + updateIntervalInMs?: number; +} + +// @public +export type ChambersCreateOrUpdateResponse = Chamber; + +// @public +export interface ChambersDeleteHeaders { + // (undocumented) + location?: string; +} + +// @public +export interface ChambersDeleteOptionalParams extends coreClient.OperationOptions { + resumeFrom?: string; + updateIntervalInMs?: number; +} + +// @public +export type ChambersDeleteResponse = Chamber; + +// @public +export interface ChambersGetOptionalParams extends coreClient.OperationOptions { +} + +// @public +export type ChambersGetResponse = Chamber; + +// @public +export interface ChambersGetUploadUriOptionalParams extends coreClient.OperationOptions { + body?: FileUploadParameters; +} + +// @public +export type ChambersGetUploadUriResponse = GetUploadUri; + +// @public +export interface ChambersLicenseRestartHeaders { + // (undocumented) + location?: string; +} + +// @public +export interface ChambersLicenseRestartOptionalParams extends coreClient.OperationOptions { + body?: RestartLicenseParameters; + resumeFrom?: string; + updateIntervalInMs?: number; +} + +// @public +export interface ChambersLicenseUpdateHeaders { + // (undocumented) + location?: string; +} + +// @public +export interface ChambersLicenseUpdateOptionalParams extends coreClient.OperationOptions { + body?: UpdateLicenseParameters; + resumeFrom?: string; + updateIntervalInMs?: number; +} + +// @public +export interface ChambersListNextOptionalParams extends coreClient.OperationOptions { +} + +// @public +export type ChambersListNextResponse = ChamberPageableList; + +// @public +export interface ChambersListOptionalParams extends coreClient.OperationOptions { +} + +// @public +export type ChambersListResponse = ChamberPageableList; + +// @public +export interface ChambersRestartHeaders { + // (undocumented) + location?: string; +} + +// @public +export interface ChambersRestartOptionalParams extends coreClient.OperationOptions { + resumeFrom?: string; + updateIntervalInMs?: number; +} + +// @public +export interface ChambersStartHeaders { + // (undocumented) + location?: string; +} + +// @public +export interface ChambersStartOptionalParams extends coreClient.OperationOptions { + resumeFrom?: string; + updateIntervalInMs?: number; +} + +// @public +export interface ChambersStopHeaders { + // (undocumented) + location?: string; +} + +// @public +export interface ChambersStopOptionalParams extends coreClient.OperationOptions { + resumeFrom?: string; + updateIntervalInMs?: number; +} + +// @public +export interface ChambersUpdateOptionalParams extends coreClient.OperationOptions { + parameters?: Chamber; +} + +// @public +export type ChambersUpdateResponse = Chamber; + +// @public +export interface Connector extends Resource { + accessConfigurations?: Record; + networkAcls?: Record; + readonly provisioningState?: ProvisioningState; + remoteDesktop?: Record; +} + +// @public +export interface ConnectorPageableList { + nextLink?: string; + value?: Connector[]; +} + +// @public +export interface Connectors { + beginCreateOrUpdate(resourceGroup: string, workbenchName: string, chamberName: string, connectorName: string, options?: ConnectorsCreateOrUpdateOptionalParams): Promise, ConnectorsCreateOrUpdateResponse>>; + beginCreateOrUpdateAndWait(resourceGroup: string, workbenchName: string, chamberName: string, connectorName: string, options?: ConnectorsCreateOrUpdateOptionalParams): Promise; + beginDelete(resourceGroup: string, workbenchName: string, chamberName: string, connectorName: string, options?: ConnectorsDeleteOptionalParams): Promise, ConnectorsDeleteResponse>>; + beginDeleteAndWait(resourceGroup: string, workbenchName: string, chamberName: string, connectorName: string, options?: ConnectorsDeleteOptionalParams): Promise; + beginLicenseAdd(resourceGroup: string, workbenchName: string, chamberName: string, name: string, body: LicenseKeyParameters, options?: ConnectorsLicenseAddOptionalParams): Promise, void>>; + beginLicenseAddAndWait(resourceGroup: string, workbenchName: string, chamberName: string, name: string, body: LicenseKeyParameters, options?: ConnectorsLicenseAddOptionalParams): Promise; + beginRestart(resourceGroup: string, workbenchName: string, chamberName: string, name: string, options?: ConnectorsRestartOptionalParams): Promise, void>>; + beginRestartAndWait(resourceGroup: string, workbenchName: string, chamberName: string, name: string, options?: ConnectorsRestartOptionalParams): Promise; + beginStart(resourceGroup: string, workbenchName: string, chamberName: string, name: string, options?: ConnectorsStartOptionalParams): Promise, void>>; + beginStartAndWait(resourceGroup: string, workbenchName: string, chamberName: string, name: string, options?: ConnectorsStartOptionalParams): Promise; + beginStop(resourceGroup: string, workbenchName: string, chamberName: string, name: string, options?: ConnectorsStopOptionalParams): Promise, void>>; + beginStopAndWait(resourceGroup: string, workbenchName: string, chamberName: string, name: string, options?: ConnectorsStopOptionalParams): Promise; + get(resourceGroup: string, workbenchName: string, chamberName: string, connectorName: string, options?: ConnectorsGetOptionalParams): Promise; + list(resourceGroup: string, workbenchName: string, chamberName: string, options?: ConnectorsListOptionalParams): PagedAsyncIterableIterator; + update(resourceGroup: string, workbenchName: string, chamberName: string, connectorName: string, options?: ConnectorsUpdateOptionalParams): Promise; +} + +// @public +export interface ConnectorsCreateOrUpdateOptionalParams extends coreClient.OperationOptions { + parameters?: Connector; + resumeFrom?: string; + updateIntervalInMs?: number; +} + +// @public +export type ConnectorsCreateOrUpdateResponse = Connector; + +// @public +export interface ConnectorsDeleteHeaders { + // (undocumented) + location?: string; +} + +// @public +export interface ConnectorsDeleteOptionalParams extends coreClient.OperationOptions { + resumeFrom?: string; + updateIntervalInMs?: number; +} + +// @public +export type ConnectorsDeleteResponse = Connector; + +// @public +export interface ConnectorsGetOptionalParams extends coreClient.OperationOptions { +} + +// @public +export type ConnectorsGetResponse = Connector; + +// @public +export interface ConnectorsLicenseAddHeaders { + // (undocumented) + location?: string; +} + +// @public +export interface ConnectorsLicenseAddOptionalParams extends coreClient.OperationOptions { + resumeFrom?: string; + updateIntervalInMs?: number; +} + +// @public +export interface ConnectorsListNextOptionalParams extends coreClient.OperationOptions { +} + +// @public +export type ConnectorsListNextResponse = ConnectorPageableList; + +// @public +export interface ConnectorsListOptionalParams extends coreClient.OperationOptions { +} + +// @public +export type ConnectorsListResponse = ConnectorPageableList; + +// @public +export interface ConnectorsRestartHeaders { + // (undocumented) + location?: string; +} + +// @public +export interface ConnectorsRestartOptionalParams extends coreClient.OperationOptions { + resumeFrom?: string; + updateIntervalInMs?: number; +} + +// @public +export interface ConnectorsStartHeaders { + // (undocumented) + location?: string; +} + +// @public +export interface ConnectorsStartOptionalParams extends coreClient.OperationOptions { + resumeFrom?: string; + updateIntervalInMs?: number; +} + +// @public +export interface ConnectorsStopHeaders { + // (undocumented) + location?: string; +} + +// @public +export interface ConnectorsStopOptionalParams extends coreClient.OperationOptions { + resumeFrom?: string; + updateIntervalInMs?: number; +} + +// @public +export interface ConnectorsUpdateOptionalParams extends coreClient.OperationOptions { + parameters?: Connector; +} + +// @public +export type ConnectorsUpdateResponse = Connector; + +// @public +export type CreatedByType = string; + +// @public +export type DataPipeline = string; + +// @public +export interface DownloadRequest { + result?: string; +} + +// @public +export interface ErrorAdditionalInfo { + readonly info?: Record; + readonly type?: string; +} + +// @public +export interface ErrorDetail { + readonly additionalInfo?: ErrorAdditionalInfo[]; + readonly code?: string; + readonly details?: ErrorDetail[]; + readonly message?: string; + readonly target?: string; +} + +// @public +export interface ErrorDetailAutoGenerated { + readonly additionalInfo?: ErrorAdditionalInfo[]; + readonly code?: string; + readonly details?: ErrorDetailAutoGenerated[]; + readonly message?: string; + readonly target?: string; +} + +// @public +export interface ErrorResponse { + error?: ErrorDetail; +} + +// @public +export interface ErrorResponseAutoGenerated { + error?: ErrorDetailAutoGenerated; +} + +// @public +export interface Etx { + readonly connectionNodeCount?: number; + readonly licenseActivated?: LicenseActivated; + licenseKeyUri?: string; + readonly replyUrlEtx?: string; + readonly replyUrlOtds?: string; +} + +// @public +interface File_2 extends Resource { + checksum?: string; + dataPipeline?: string; + filePath?: string; + readonly provisioningState?: ProvisioningState; + requestId?: string; + size?: number; + timestamp?: Date; +} +export { File_2 as File } + +// @public +export interface FileDownloadSasUri { + result?: string; +} + +// @public +export interface FileManageHeaders { + // (undocumented) + location?: string; +} + +// @public +export interface FileManageOptionalParams extends coreClient.OperationOptions { + body?: FilesManageParameters; + resumeFrom?: string; + updateIntervalInMs?: number; +} + +// @public +export type FileManageResponse = FilesManage; + +// @public +export interface FileOperations { + beginManage(resourceGroupName: string, workbenchName: string, chamberName: string, fileName: string, options?: FileManageOptionalParams): Promise, FileManageResponse>>; + beginManageAndWait(resourceGroupName: string, workbenchName: string, chamberName: string, fileName: string, options?: FileManageOptionalParams): Promise; +} + +// @public +export interface FilePageableList { + nextLink?: string; + value?: File_2[]; +} + +// @public +export interface FileRequest { + beginGetDownloadUri(resourceGroupName: string, workbenchName: string, chamberName: string, requestName: string, options?: FileRequestGetDownloadUriOptionalParams): Promise, FileRequestGetDownloadUriResponse>>; + beginGetDownloadUriAndWait(resourceGroupName: string, workbenchName: string, chamberName: string, requestName: string, options?: FileRequestGetDownloadUriOptionalParams): Promise; +} + +// @public +export interface FileRequestGetDownloadUriHeaders { + // (undocumented) + location?: string; +} + +// @public +export interface FileRequestGetDownloadUriOptionalParams extends coreClient.OperationOptions { + resumeFrom?: string; + updateIntervalInMs?: number; +} + +// @public +export type FileRequestGetDownloadUriResponse = FileDownloadSasUri; + +// @public +export interface FileRequests { + beginManage(resourceGroupName: string, workbenchName: string, chamberName: string, requestName: string, options?: FileRequestsManageOptionalParams): Promise, FileRequestsManageResponse>>; + beginManageAndWait(resourceGroupName: string, workbenchName: string, chamberName: string, requestName: string, options?: FileRequestsManageOptionalParams): Promise; + get(resourceGroupName: string, workbenchName: string, chamberName: string, requestName: string, options?: FileRequestsGetOptionalParams): Promise; + list(resourceGroupName: string, workbenchName: string, chamberName: string, options?: FileRequestsListOptionalParams): PagedAsyncIterableIterator; +} + +// @public +export type FileRequestsAction = string; + +// @public +export interface FileRequestsGetOptionalParams extends coreClient.OperationOptions { +} + +// @public +export type FileRequestsGetResponse = Request_2; + +// @public +export interface FileRequestsListNextOptionalParams extends coreClient.OperationOptions { +} + +// @public +export type FileRequestsListNextResponse = RequestPageableList; + +// @public +export interface FileRequestsListOptionalParams extends coreClient.OperationOptions { +} + +// @public +export type FileRequestsListResponse = RequestPageableList; + +// @public +export interface FileRequestsManage { + result?: string; +} + +// @public +export interface FileRequestsManageHeaders { + // (undocumented) + location?: string; +} + +// @public +export interface FileRequestsManageOptionalParams extends coreClient.OperationOptions { + body?: FileRequestsManageParameters; + resumeFrom?: string; + updateIntervalInMs?: number; +} + +// @public +export interface FileRequestsManageParameters { + action?: FileRequestsAction; + description?: string; +} + +// @public +export type FileRequestsManageResponse = FileRequestsManage; + +// @public +export interface Files { + beginDownloadRequest(resourceGroupName: string, workbenchName: string, chamberName: string, fileName: string, options?: FilesDownloadRequestOptionalParams): Promise, FilesDownloadRequestResponse>>; + beginDownloadRequestAndWait(resourceGroupName: string, workbenchName: string, chamberName: string, fileName: string, options?: FilesDownloadRequestOptionalParams): Promise; + get(resourceGroupName: string, workbenchName: string, chamberName: string, fileName: string, options?: FilesGetOptionalParams): Promise; + list(resourceGroupName: string, workbenchName: string, chamberName: string, options?: FilesListOptionalParams): PagedAsyncIterableIterator; +} + +// @public +export interface FilesDownloadRequestHeaders { + // (undocumented) + location?: string; +} + +// @public +export interface FilesDownloadRequestOptionalParams extends coreClient.OperationOptions { + body?: FilesDownloadRequestParameters; + resumeFrom?: string; + updateIntervalInMs?: number; +} + +// @public +export interface FilesDownloadRequestParameters { + description?: string; +} + +// @public +export type FilesDownloadRequestResponse = DownloadRequest; + +// @public +export interface FilesGetOptionalParams extends coreClient.OperationOptions { +} + +// @public +export type FilesGetResponse = File_2; + +// @public +export interface FilesListNextOptionalParams extends coreClient.OperationOptions { +} + +// @public +export type FilesListNextResponse = FilePageableList; + +// @public +export interface FilesListOptionalParams extends coreClient.OperationOptions { +} + +// @public +export type FilesListResponse = FilePageableList; + +// @public +export interface FilesManage { + result?: string; +} + +// @public +export interface FilesManageParameters { + action?: Action; + dataPipeline?: DataPipeline; + force?: Force; +} + +// @public +export interface FileUploadParameters { + fileSize?: number; +} + +// @public +export type Force = string; + +// @public +export type GatewayType = string; + +// @public +export function getContinuationToken(page: unknown): string | undefined; + +// @public +export interface GetUploadUri { + result?: string; +} + +// @public +export enum KnownAccessType { + GUI = "GUI" +} + +// @public +export enum KnownAction { + Archive = "Archive", + Delete = "Delete" +} + +// @public +export enum KnownCreatedByType { + Application = "Application", + Key = "Key", + ManagedIdentity = "ManagedIdentity", + User = "User" +} + +// @public +export enum KnownDataPipeline { + Inbound = "Inbound", + Outbound = "Outbound" +} + +// @public +export enum KnownFileRequestsAction { + Approve = "Approve", + Reject = "Reject" +} + +// @public +export enum KnownForce { + False = "False", + True = "True" +} + +// @public +export enum KnownGatewayType { + ExpressRoute = "ExpressRoute", + None = "None", + Vpn = "Vpn" +} + +// @public +export enum KnownLicenseActivated { + False = "False", + True = "True" +} + +// @public +export enum KnownLicenseService { + Ansys = "ansys", + Cadence = "cadence", + Siemens = "siemens", + Synopsys = "synopsys" +} + +// @public +export enum KnownPerformanceTier { + Premium = "Premium", + Standard = "Standard", + Ultra = "Ultra" +} + +// @public +export enum KnownProvisioningState { + Accepted = "Accepted", + Canceled = "Canceled", + Completed = "Completed", + Deleted = "Deleted", + Deleting = "Deleting", + Failed = "Failed", + Processing = "Processing", + Succeeded = "Succeeded", + Unknown = "Unknown", + Validating = "Validating" +} + +// @public +export type LicenseActivated = string; + +// @public +export interface LicenseKeyParameters { + licenseKey?: string; +} + +// @public +export type LicenseService = string; + +// @public (undocumented) +export class MicrosoftModSimWorkbench extends coreClient.ServiceClient { + // (undocumented) + $host: string; + constructor(credentials: coreAuth.TokenCredential, subscriptionId: string, options?: MicrosoftModSimWorkbenchOptionalParams); + // (undocumented) + apiVersion: string; + // (undocumented) + chambers: Chambers; + // (undocumented) + connectors: Connectors; + // (undocumented) + fileOperations: FileOperations; + // (undocumented) + fileRequest: FileRequest; + // (undocumented) + fileRequests: FileRequests; + // (undocumented) + files: Files; + // (undocumented) + operations: Operations; + // (undocumented) + storages: Storages; + // (undocumented) + subscriptionId: string; + // (undocumented) + workbenches: Workbenches; + // (undocumented) + workloads: Workloads; +} + +// @public +export interface MicrosoftModSimWorkbenchOptionalParams extends coreClient.ServiceClientOptions { + $host?: string; + apiVersion?: string; + endpoint?: string; +} + +// @public +export interface NetworkAcls { + allowedAddressSpaces?: string[]; +} + +// @public +export interface Operations { + list(options?: OperationsListOptionalParams): Promise; +} + +// @public +export interface OperationsListOptionalParams extends coreClient.OperationOptions { +} + +// @public +export type PerformanceTier = string; + +// @public +export type ProvisioningState = string; + +// @public +export interface RemoteDesktop { + etx?: Etx; +} + +// @public +interface Request_2 extends Resource { + // (undocumented) + approve?: RequestPropertiesFormatApprove; + description?: string; + // (undocumented) + download?: RequestPropertiesFormatDownload; + fileId?: string; + // (undocumented) + internalMetadata?: RequestPropertiesFormatInternalMetadata; + linuxUsername?: string; + readonly provisioningState?: ProvisioningState; + requestUserId?: string; + status?: string; + timestamp?: Date; +} +export { Request_2 as Request } + +// @public +export interface RequestPageableList { + nextLink?: string; + value?: Request_2[]; +} + +// @public (undocumented) +export interface RequestPropertiesFormatApprove { + description?: string; + id?: string; + timestamp?: Date; + userId?: string; +} + +// @public (undocumented) +export interface RequestPropertiesFormatDownload { + completeTime?: Date; + location?: string; + startTime?: Date; +} + +// @public (undocumented) +export interface RequestPropertiesFormatInternalMetadata { + sasUriId?: string; +} + +// @public +export interface Resource { + readonly id?: string; + location?: string; + readonly name?: string; + sku?: string; + readonly systemData?: SystemData; + tags?: { + [propertyName: string]: string; + }; + readonly type?: string; +} + +// @public +export interface RestartLicenseParameters { + licenseService?: LicenseService; +} + +// @public +interface Storage_2 extends Resource { + capacityAllocated?: number; + capacityUsed?: number; + dataPipelineInboundPath?: string; + dataPipelineOutboundPath?: string; + localMountPath?: string; + performanceTier?: PerformanceTier; + readonly provisioningState?: ProvisioningState; +} +export { Storage_2 as Storage } + +// @public +export interface StoragePageableList { + nextLink?: string; + value?: Storage_2[]; +} + +// @public +export interface Storages { + beginCreateOrUpdate(resourceGroup: string, workbenchName: string, chamberName: string, storageName: string, options?: StoragesCreateOrUpdateOptionalParams): Promise, StoragesCreateOrUpdateResponse>>; + beginCreateOrUpdateAndWait(resourceGroup: string, workbenchName: string, chamberName: string, storageName: string, options?: StoragesCreateOrUpdateOptionalParams): Promise; + beginDelete(resourceGroup: string, workbenchName: string, chamberName: string, storageName: string, options?: StoragesDeleteOptionalParams): Promise, StoragesDeleteResponse>>; + beginDeleteAndWait(resourceGroup: string, workbenchName: string, chamberName: string, storageName: string, options?: StoragesDeleteOptionalParams): Promise; + get(resourceGroup: string, workbenchName: string, chamberName: string, storageName: string, options?: StoragesGetOptionalParams): Promise; + list(resourceGroup: string, workbenchName: string, chamberName: string, options?: StoragesListOptionalParams): PagedAsyncIterableIterator; + update(resourceGroup: string, workbenchName: string, chamberName: string, storageName: string, options?: StoragesUpdateOptionalParams): Promise; +} + +// @public +export interface StoragesCreateOrUpdateOptionalParams extends coreClient.OperationOptions { + parameters?: Storage_2; + resumeFrom?: string; + updateIntervalInMs?: number; +} + +// @public +export type StoragesCreateOrUpdateResponse = Storage_2; + +// @public +export interface StoragesDeleteOptionalParams extends coreClient.OperationOptions { + resumeFrom?: string; + updateIntervalInMs?: number; +} + +// @public +export type StoragesDeleteResponse = Storage_2; + +// @public +export interface StoragesGetOptionalParams extends coreClient.OperationOptions { +} + +// @public +export type StoragesGetResponse = Storage_2; + +// @public +export interface StoragesListNextOptionalParams extends coreClient.OperationOptions { +} + +// @public +export type StoragesListNextResponse = StoragePageableList; + +// @public +export interface StoragesListOptionalParams extends coreClient.OperationOptions { +} + +// @public +export type StoragesListResponse = StoragePageableList; + +// @public +export interface StoragesUpdateOptionalParams extends coreClient.OperationOptions { + parameters?: Storage_2; +} + +// @public +export type StoragesUpdateResponse = Storage_2; + +// @public +export interface SystemData { + createdAt?: Date; + createdBy?: string; + createdByType?: CreatedByType; + lastModifiedAt?: Date; + lastModifiedBy?: string; + lastModifiedByType?: CreatedByType; +} + +// @public +export interface UpdateLicenseParameters { + enable?: boolean; + licenseKey?: string; + licenseService?: LicenseService; +} + +// @public +export interface Workbench extends Resource { + addressSpace?: string; + appOidc?: AppOidc; + readonly provisioningState?: ProvisioningState; + skuPropertiesSku?: string; +} + +// @public +export interface Workbenches { + beginCreateOrUpdate(resourceGroup: string, name: string, options?: WorkbenchesCreateOrUpdateOptionalParams): Promise, WorkbenchesCreateOrUpdateResponse>>; + beginCreateOrUpdateAndWait(resourceGroup: string, name: string, options?: WorkbenchesCreateOrUpdateOptionalParams): Promise; + beginDelete(resourceGroup: string, name: string, options?: WorkbenchesDeleteOptionalParams): Promise, WorkbenchesDeleteResponse>>; + beginDeleteAndWait(resourceGroup: string, name: string, options?: WorkbenchesDeleteOptionalParams): Promise; + beginGet(resourceGroup: string, name: string, options?: WorkbenchesGetOptionalParams): Promise, WorkbenchesGetResponse>>; + beginGetAndWait(resourceGroup: string, name: string, options?: WorkbenchesGetOptionalParams): Promise; + listByResourceGroup(resourceGroup: string, options?: WorkbenchesListByResourceGroupOptionalParams): PagedAsyncIterableIterator; + listBySubscription(options?: WorkbenchesListBySubscriptionOptionalParams): PagedAsyncIterableIterator; + update(resourceGroup: string, name: string, options?: WorkbenchesUpdateOptionalParams): Promise; +} + +// @public +export interface WorkbenchesCreateOrUpdateOptionalParams extends coreClient.OperationOptions { + body?: Workbench; + resumeFrom?: string; + updateIntervalInMs?: number; +} + +// @public +export type WorkbenchesCreateOrUpdateResponse = Workbench; + +// @public +export interface WorkbenchesDeleteHeaders { + // (undocumented) + location?: string; +} + +// @public +export interface WorkbenchesDeleteOptionalParams extends coreClient.OperationOptions { + resumeFrom?: string; + updateIntervalInMs?: number; +} + +// @public +export type WorkbenchesDeleteResponse = Workbench; + +// @public +export interface WorkbenchesGetHeaders { + // (undocumented) + location?: string; +} + +// @public +export interface WorkbenchesGetOptionalParams extends coreClient.OperationOptions { + resumeFrom?: string; + updateIntervalInMs?: number; +} + +// @public +export type WorkbenchesGetResponse = Workbench; + +// @public +export interface WorkbenchesListByResourceGroupNextOptionalParams extends coreClient.OperationOptions { +} + +// @public +export type WorkbenchesListByResourceGroupNextResponse = WorkbenchPageableList; + +// @public +export interface WorkbenchesListByResourceGroupOptionalParams extends coreClient.OperationOptions { +} + +// @public +export type WorkbenchesListByResourceGroupResponse = WorkbenchPageableList; + +// @public +export interface WorkbenchesListBySubscriptionNextOptionalParams extends coreClient.OperationOptions { +} + +// @public +export type WorkbenchesListBySubscriptionNextResponse = WorkbenchPageableList; + +// @public +export interface WorkbenchesListBySubscriptionOptionalParams extends coreClient.OperationOptions { +} + +// @public +export type WorkbenchesListBySubscriptionResponse = WorkbenchPageableList; + +// @public +export interface WorkbenchesUpdateOptionalParams extends coreClient.OperationOptions { + body?: Workbench; +} + +// @public +export type WorkbenchesUpdateResponse = Workbench; + +// @public +export interface WorkbenchPageableList { + nextLink?: string; + value?: Workbench[]; +} + +// @public +export interface Workload extends Resource { + edaType?: string; + readonly privateIP?: string; + readonly provisioningState?: ProvisioningState; + readonly status?: string; + vmSize?: string; +} + +// @public +export interface WorkloadPageableList { + nextLink?: string; + value?: Workload[]; +} + +// @public +export interface Workloads { + beginCreateOrUpdate(resourceGroup: string, workbenchName: string, chamberName: string, workloadName: string, options?: WorkloadsCreateOrUpdateOptionalParams): Promise, WorkloadsCreateOrUpdateResponse>>; + beginCreateOrUpdateAndWait(resourceGroup: string, workbenchName: string, chamberName: string, workloadName: string, options?: WorkloadsCreateOrUpdateOptionalParams): Promise; + beginDelete(resourceGroup: string, workbenchName: string, chamberName: string, workloadName: string, options?: WorkloadsDeleteOptionalParams): Promise, WorkloadsDeleteResponse>>; + beginDeleteAndWait(resourceGroup: string, workbenchName: string, chamberName: string, workloadName: string, options?: WorkloadsDeleteOptionalParams): Promise; + beginRestart(resourceGroup: string, workbenchName: string, chamberName: string, name: string, options?: WorkloadsRestartOptionalParams): Promise, void>>; + beginRestartAndWait(resourceGroup: string, workbenchName: string, chamberName: string, name: string, options?: WorkloadsRestartOptionalParams): Promise; + beginStart(resourceGroup: string, workbenchName: string, chamberName: string, name: string, options?: WorkloadsStartOptionalParams): Promise, void>>; + beginStartAndWait(resourceGroup: string, workbenchName: string, chamberName: string, name: string, options?: WorkloadsStartOptionalParams): Promise; + beginStop(resourceGroup: string, workbenchName: string, chamberName: string, name: string, options?: WorkloadsStopOptionalParams): Promise, void>>; + beginStopAndWait(resourceGroup: string, workbenchName: string, chamberName: string, name: string, options?: WorkloadsStopOptionalParams): Promise; + get(resourceGroup: string, workbenchName: string, chamberName: string, workloadName: string, options?: WorkloadsGetOptionalParams): Promise; + list(resourceGroup: string, workbenchName: string, chamberName: string, options?: WorkloadsListOptionalParams): PagedAsyncIterableIterator; + update(resourceGroup: string, workbenchName: string, chamberName: string, workloadName: string, options?: WorkloadsUpdateOptionalParams): Promise; +} + +// @public +export interface WorkloadsCreateOrUpdateOptionalParams extends coreClient.OperationOptions { + parameters?: Workload; + resumeFrom?: string; + updateIntervalInMs?: number; +} + +// @public +export type WorkloadsCreateOrUpdateResponse = Workload; + +// @public +export interface WorkloadsDeleteHeaders { + // (undocumented) + location?: string; +} + +// @public +export interface WorkloadsDeleteOptionalParams extends coreClient.OperationOptions { + resumeFrom?: string; + updateIntervalInMs?: number; +} + +// @public +export type WorkloadsDeleteResponse = Workload; + +// @public +export interface WorkloadsGetOptionalParams extends coreClient.OperationOptions { +} + +// @public +export type WorkloadsGetResponse = Workload; + +// @public +export interface WorkloadsListNextOptionalParams extends coreClient.OperationOptions { +} + +// @public +export type WorkloadsListNextResponse = WorkloadPageableList; + +// @public +export interface WorkloadsListOptionalParams extends coreClient.OperationOptions { +} + +// @public +export type WorkloadsListResponse = WorkloadPageableList; + +// @public +export interface WorkloadsRestartHeaders { + // (undocumented) + location?: string; +} + +// @public +export interface WorkloadsRestartOptionalParams extends coreClient.OperationOptions { + resumeFrom?: string; + updateIntervalInMs?: number; +} + +// @public +export interface WorkloadsStartHeaders { + // (undocumented) + location?: string; +} + +// @public +export interface WorkloadsStartOptionalParams extends coreClient.OperationOptions { + resumeFrom?: string; + updateIntervalInMs?: number; +} + +// @public +export interface WorkloadsStopHeaders { + // (undocumented) + location?: string; +} + +// @public +export interface WorkloadsStopOptionalParams extends coreClient.OperationOptions { + resumeFrom?: string; + updateIntervalInMs?: number; +} + +// @public +export interface WorkloadsUpdateOptionalParams extends coreClient.OperationOptions { + parameters?: Workload; +} + +// @public +export type WorkloadsUpdateResponse = Workload; + +// (No @packageDocumentation comment for this package) + +``` diff --git a/sdk/modsimworkbench/arm-modsimworkbench/rollup.config.js b/sdk/modsimworkbench/arm-modsimworkbench/rollup.config.js new file mode 100644 index 000000000000..3f89d7309da5 --- /dev/null +++ b/sdk/modsimworkbench/arm-modsimworkbench/rollup.config.js @@ -0,0 +1,122 @@ +/* + * 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]; + +/** + * Construct a warning handler for the shared rollup configuration + * that ignores certain warnings that are not relevant to testing. + */ +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/**"] + }, + 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 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/modsimworkbench/arm-modsimworkbench/sample.env b/sdk/modsimworkbench/arm-modsimworkbench/sample.env new file mode 100644 index 000000000000..672847a3fea0 --- /dev/null +++ b/sdk/modsimworkbench/arm-modsimworkbench/sample.env @@ -0,0 +1,4 @@ +# App registration secret for AAD authentication +AZURE_CLIENT_SECRET= +AZURE_CLIENT_ID= +AZURE_TENANT_ID= \ No newline at end of file diff --git a/sdk/modsimworkbench/arm-modsimworkbench/src/index.ts b/sdk/modsimworkbench/arm-modsimworkbench/src/index.ts new file mode 100644 index 000000000000..16f844d0bcdc --- /dev/null +++ b/sdk/modsimworkbench/arm-modsimworkbench/src/index.ts @@ -0,0 +1,13 @@ +/* + * 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 { getContinuationToken } from "./pagingHelper"; +export * from "./models"; +export { MicrosoftModSimWorkbench } from "./microsoftModSimWorkbench"; +export * from "./operationsInterfaces"; diff --git a/sdk/modsimworkbench/arm-modsimworkbench/src/lroImpl.ts b/sdk/modsimworkbench/arm-modsimworkbench/src/lroImpl.ts new file mode 100644 index 000000000000..dd803cd5e28c --- /dev/null +++ b/sdk/modsimworkbench/arm-modsimworkbench/src/lroImpl.ts @@ -0,0 +1,42 @@ +/* + * 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. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT license. + +import { AbortSignalLike } from "@azure/abort-controller"; +import { LongRunningOperation, LroResponse } from "@azure/core-lro"; + +export function createLroSpec(inputs: { + sendOperationFn: (args: any, spec: any) => Promise>; + args: Record; + spec: { + readonly requestBody?: unknown; + readonly path?: string; + readonly httpMethod: string; + } & Record; +}): LongRunningOperation { + const { args, spec, sendOperationFn } = inputs; + return { + requestMethod: spec.httpMethod, + requestPath: spec.path!, + sendInitialRequest: () => sendOperationFn(args, spec), + sendPollRequest: ( + path: string, + options?: { abortSignal?: AbortSignalLike } + ) => { + const { requestBody, ...restSpec } = spec; + return sendOperationFn(args, { + ...restSpec, + httpMethod: "GET", + path, + abortSignal: options?.abortSignal + }); + } + }; +} diff --git a/sdk/modsimworkbench/arm-modsimworkbench/src/microsoftModSimWorkbench.ts b/sdk/modsimworkbench/arm-modsimworkbench/src/microsoftModSimWorkbench.ts new file mode 100644 index 000000000000..c1a952da87c9 --- /dev/null +++ b/sdk/modsimworkbench/arm-modsimworkbench/src/microsoftModSimWorkbench.ts @@ -0,0 +1,180 @@ +/* + * 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 * as coreClient from "@azure/core-client"; +import * as coreRestPipeline from "@azure/core-rest-pipeline"; +import { + PipelineRequest, + PipelineResponse, + SendRequest +} from "@azure/core-rest-pipeline"; +import * as coreAuth from "@azure/core-auth"; +import { + OperationsImpl, + WorkbenchesImpl, + ConnectorsImpl, + ChambersImpl, + WorkloadsImpl, + StoragesImpl, + FilesImpl, + FileOperationsImpl, + FileRequestsImpl, + FileRequestImpl +} from "./operations"; +import { + Operations, + Workbenches, + Connectors, + Chambers, + Workloads, + Storages, + Files, + FileOperations, + FileRequests, + FileRequest +} from "./operationsInterfaces"; +import { MicrosoftModSimWorkbenchOptionalParams } from "./models"; + +export class MicrosoftModSimWorkbench extends coreClient.ServiceClient { + $host: string; + apiVersion: string; + subscriptionId: string; + + /** + * Initializes a new instance of the MicrosoftModSimWorkbench class. + * @param credentials Subscription credentials which uniquely identify client subscription. + * @param subscriptionId The ID of the target subscription. + * @param options The parameter options + */ + constructor( + credentials: coreAuth.TokenCredential, + subscriptionId: string, + options?: MicrosoftModSimWorkbenchOptionalParams + ) { + 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: MicrosoftModSimWorkbenchOptionalParams = { + requestContentType: "application/json; charset=utf-8", + credential: credentials + }; + + const packageDetails = `azsdk-js-arm-modsimworkbench/1.0.0-beta.1`; + const userAgentPrefix = + options.userAgentOptions && options.userAgentOptions.userAgentPrefix + ? `${options.userAgentOptions.userAgentPrefix} ${packageDetails}` + : `${packageDetails}`; + + const optionsWithDefaults = { + ...defaults, + ...options, + userAgentOptions: { + userAgentPrefix + }, + endpoint: + options.endpoint ?? options.baseUri ?? "https://management.azure.com" + }; + super(optionsWithDefaults); + + let bearerTokenAuthenticationPolicyFound: boolean = false; + if (options?.pipeline && options.pipeline.getOrderedPolicies().length > 0) { + const pipelinePolicies: coreRestPipeline.PipelinePolicy[] = options.pipeline.getOrderedPolicies(); + bearerTokenAuthenticationPolicyFound = pipelinePolicies.some( + (pipelinePolicy) => + pipelinePolicy.name === + coreRestPipeline.bearerTokenAuthenticationPolicyName + ); + } + if ( + !options || + !options.pipeline || + options.pipeline.getOrderedPolicies().length == 0 || + !bearerTokenAuthenticationPolicyFound + ) { + this.pipeline.removePolicy({ + name: coreRestPipeline.bearerTokenAuthenticationPolicyName + }); + this.pipeline.addPolicy( + coreRestPipeline.bearerTokenAuthenticationPolicy({ + credential: credentials, + scopes: + optionsWithDefaults.credentialScopes ?? + `${optionsWithDefaults.endpoint}/.default`, + challengeCallbacks: { + authorizeRequestOnChallenge: + coreClient.authorizeRequestOnClaimChallenge + } + }) + ); + } + // Parameter assignments + this.subscriptionId = subscriptionId; + + // Assigning values to Constant parameters + this.$host = options.$host || "https://management.azure.com"; + this.apiVersion = options.apiVersion || "2021-03-01-preview"; + this.operations = new OperationsImpl(this); + this.workbenches = new WorkbenchesImpl(this); + this.connectors = new ConnectorsImpl(this); + this.chambers = new ChambersImpl(this); + this.workloads = new WorkloadsImpl(this); + this.storages = new StoragesImpl(this); + this.files = new FilesImpl(this); + this.fileOperations = new FileOperationsImpl(this); + this.fileRequests = new FileRequestsImpl(this); + this.fileRequest = new FileRequestImpl(this); + this.addCustomApiVersionPolicy(options.apiVersion); + } + + /** A function that adds a policy that sets the api-version (or equivalent) to reflect the library version. */ + private addCustomApiVersionPolicy(apiVersion?: string) { + if (!apiVersion) { + return; + } + const apiVersionPolicy = { + name: "CustomApiVersionPolicy", + async sendRequest( + request: PipelineRequest, + next: SendRequest + ): Promise { + const param = request.url.split("?"); + if (param.length > 1) { + const newParams = param[1].split("&").map((item) => { + if (item.indexOf("api-version") > -1) { + return "api-version=" + apiVersion; + } else { + return item; + } + }); + request.url = param[0] + "?" + newParams.join("&"); + } + return next(request); + } + }; + this.pipeline.addPolicy(apiVersionPolicy); + } + + operations: Operations; + workbenches: Workbenches; + connectors: Connectors; + chambers: Chambers; + workloads: Workloads; + storages: Storages; + files: Files; + fileOperations: FileOperations; + fileRequests: FileRequests; + fileRequest: FileRequest; +} diff --git a/sdk/modsimworkbench/arm-modsimworkbench/src/models/index.ts b/sdk/modsimworkbench/arm-modsimworkbench/src/models/index.ts new file mode 100644 index 000000000000..943a3ac78110 --- /dev/null +++ b/sdk/modsimworkbench/arm-modsimworkbench/src/models/index.ts @@ -0,0 +1,1404 @@ +/* + * 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 * as coreClient from "@azure/core-client"; + +/** Common error response for all Azure Resource Manager APIs to return error details for failed operations. (This also follows the OData error response format.). */ +export interface ErrorResponse { + /** The error object. */ + error?: ErrorDetail; +} + +/** The error detail. */ +export interface ErrorDetail { + /** + * The error code. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly code?: string; + /** + * The error message. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly message?: string; + /** + * The error target. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly target?: string; + /** + * The error details. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly details?: ErrorDetail[]; + /** + * The error additional info. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly additionalInfo?: ErrorAdditionalInfo[]; +} + +/** The resource management error additional info. */ +export interface ErrorAdditionalInfo { + /** + * The additional info type. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly type?: string; + /** + * The additional info. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly info?: Record; +} + +/** Microsoft.Sdw.Core.ResourceMetadata.PageableList implementation specific to pageable lists of Microsoft.Sdw.Core.ResourceMetadata.AzureResource`1. */ +export interface WorkbenchPageableList { + /** Gets or sets the URL (link) to the next result set. */ + nextLink?: string; + /** Gets or sets the values to emit from this list. */ + value?: Workbench[]; +} + +/** Workbench properties. */ +export interface AppOidc { + /** Client Id */ + clientId?: string; + /** Client secret */ + secretUri?: string; +} + +/** Common resource representation. */ +export interface Resource { + /** + * Resource ID. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly id?: string; + /** + * Resource name. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly name?: string; + /** + * Resource type. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly type?: string; + /** Resource location. */ + location?: string; + /** Resource tags. */ + tags?: { [propertyName: string]: string }; + /** + * system data + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly systemData?: SystemData; + /** Name of SKU. */ + sku?: string; +} + +/** Metadata pertaining to creation and last modification of the resource. */ +export interface SystemData { + /** The identity that created the resource. */ + createdBy?: string; + /** The type of identity that created the resource. */ + createdByType?: CreatedByType; + /** The timestamp of resource creation (UTC). */ + createdAt?: Date; + /** The identity that last modified the resource. */ + lastModifiedBy?: string; + /** The type of identity that last modified the resource. */ + lastModifiedByType?: CreatedByType; + /** The timestamp of resource last modification (UTC) */ + lastModifiedAt?: Date; +} + +/** Microsoft.Sdw.Core.ResourceMetadata.PageableList implementation specific to pageable lists of Microsoft.Sdw.Core.ResourceMetadata.AzureResource`1. */ +export interface ConnectorPageableList { + /** Gets or sets the URL (link) to the next result set. */ + nextLink?: string; + /** Gets or sets the values to emit from this list. */ + value?: Connector[]; +} + +/** License Key Parameters */ +export interface LicenseKeyParameters { + /** Value of License Key */ + licenseKey?: string; +} + +/** File Upload Parameters DTO. */ +export interface FileUploadParameters { + /** Gets or sets the size of the file being uploaded. */ + fileSize?: number; +} + +/** Datasync file upload SAS token */ +export interface GetUploadUri { + /** Datasync file upload SAS token */ + result?: string; +} + +/** File Upload Parameters DTO. */ +export interface UpdateLicenseParameters { + /** Gets or sets the license service to update. */ + licenseService?: LicenseService; + /** Switch to show if License Service is activated. */ + enable?: boolean; + /** EDA License file contents */ + licenseKey?: string; +} + +/** File Upload Parameters DTO. */ +export interface RestartLicenseParameters { + /** Gets or sets the license service to update. */ + licenseService?: LicenseService; +} + +/** Microsoft.Sdw.Core.ResourceMetadata.PageableList implementation specific to pageable lists of Microsoft.Sdw.Core.ResourceMetadata.AzureResource`1. */ +export interface ChamberPageableList { + /** Gets or sets the URL (link) to the next result set. */ + nextLink?: string; + /** Gets or sets the values to emit from this list. */ + value?: Chamber[]; +} + +/** Microsoft.Sdw.Core.ResourceMetadata.PageableList implementation specific to pageable lists of Microsoft.Sdw.Core.ResourceMetadata.AzureResource`1. */ +export interface WorkloadPageableList { + /** Gets or sets the URL (link) to the next result set. */ + nextLink?: string; + /** Gets or sets the values to emit from this list. */ + value?: Workload[]; +} + +/** Common error response for all Azure Resource Manager APIs to return error details for failed operations. (This also follows the OData error response format.). */ +export interface ErrorResponseAutoGenerated { + /** The error object. */ + error?: ErrorDetailAutoGenerated; +} + +/** The error detail. */ +export interface ErrorDetailAutoGenerated { + /** + * The error code. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly code?: string; + /** + * The error message. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly message?: string; + /** + * The error target. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly target?: string; + /** + * The error details. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly details?: ErrorDetailAutoGenerated[]; + /** + * The error additional info. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly additionalInfo?: ErrorAdditionalInfo[]; +} + +/** Microsoft.Sdw.Core.ResourceMetadata.PageableList implementation specific to pageable lists of Microsoft.Sdw.Core.ResourceMetadata.AzureResource`1. */ +export interface StoragePageableList { + /** Gets or sets the URL (link) to the next result set. */ + nextLink?: string; + /** Gets or sets the values to emit from this list. */ + value?: Storage[]; +} + +/** Manage files in an ModSim Workbench chamber data pipeline. */ +export interface FilesManageParameters { + /** Inbound or outbound of the ModSim Workbench chamber Data pipeline. */ + dataPipeline?: DataPipeline; + /** Specifies the file management action. */ + action?: Action; + /** Specifies whether to force delete. Works if action is Delete */ + force?: Force; +} + +/** Manage files in an chamber data pipeline. */ +export interface FilesManage { + /** Manage files in an ModSim Workbench chamber data pipeline action */ + result?: string; +} + +/** Request to download files from an ModSim Workbench chamber data pipeline. */ +export interface FilesDownloadRequestParameters { + /** Specifies the reason for the download request. */ + description?: string; +} + +/** Request to download files from an chamber data pipeline. */ +export interface DownloadRequest { + /** Request to download files from an ModSim Workbench chamber data pipeline action */ + result?: string; +} + +/** Microsoft.Sdw.Core.ResourceMetadata.PageableList implementation specific to pageable lists of Microsoft.Sdw.Core.ResourceMetadata.AzureResource`1. */ +export interface FilePageableList { + /** Gets or sets the URL (link) to the next result set. */ + nextLink?: string; + /** Gets or sets the values to emit from this list. */ + value?: File[]; +} + +export interface RequestPropertiesFormatApprove { + /** The globally unique identifier for the approval. */ + id?: string; + /** Description of approval */ + description?: string; + /** Specifies the principal ID of Azure Active Directory User who approved to download. */ + userId?: string; + /** The timestamp for the approval */ + timestamp?: Date; +} + +export interface RequestPropertiesFormatDownload { + /** Download destination location. */ + location?: string; + /** The timestamp for the start of download. */ + startTime?: Date; + /** The timestamp for the completion of download. */ + completeTime?: Date; +} + +export interface RequestPropertiesFormatInternalMetadata { + /** sas uri id */ + sasUriId?: string; +} + +/** Manage files in an ModSim Workbench chamber data pipeline. */ +export interface FileRequestsManageParameters { + /** Specifies the file management action. */ + action?: FileRequestsAction; + /** Specifies the reason for the action. */ + description?: string; +} + +/** Manage download file requests in an chamber Data pipeline. */ +export interface FileRequestsManage { + /** Manage download file requests in an chamber Data pipeline action */ + result?: string; +} + +/** Get SAS URI to download a file from an chamber data pipeline. */ +export interface FileDownloadSasUri { + /** Get SAS URI to download a file action */ + result?: string; +} + +/** Microsoft.Sdw.Core.ResourceMetadata.PageableList implementation specific to pageable lists of Microsoft.Sdw.Core.ResourceMetadata.AzureResource`1. */ +export interface RequestPageableList { + /** Gets or sets the URL (link) to the next result set. */ + nextLink?: string; + /** Gets or sets the values to emit from this list. */ + value?: Request[]; +} + +/** Remote Desktop properties. */ +export interface RemoteDesktop { + /** The etx object. */ + etx?: Etx; +} + +/** Etx properties. */ +export interface Etx { + /** + * The connection node count. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly connectionNodeCount?: number; + /** + * The license activated. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly licenseActivated?: LicenseActivated; + /** + * The reply URL of ETX Server for Azure AD app. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly replyUrlEtx?: string; + /** + * The reply URL of OTDS for Azure AD app. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly replyUrlOtds?: string; + /** The license key uri. */ + licenseKeyUri?: string; +} + +/** Access configuration properties. */ +export interface AccessConfiguration { + /** + * Gets or sets the AccessType. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly accessType?: AccessType; + /** Gets or sets the GatewayType. */ + gatewayType?: GatewayType; + /** Gets or sets the GatewayVnetId. */ + gatewayVnetId?: string; + /** + * Gets or sets the AccessUrl. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly accessUrl?: string; + /** + * Gets or sets the IpAddress. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly ipAddress?: string; +} + +/** Access configuration properties. */ +export interface NetworkAcls { + /** Gets or sets the AllowedAddressSpaces. */ + allowedAddressSpaces?: string[]; +} + +/** Workbench resource */ +export interface Workbench extends Resource { + /** + * this is an extension of IPAddress which includes logic related to Classes Interdomain Routing (CIDR) formatted IP Addresses. + * E.g. 192.168.0.0/24, most people's default class C RFC 1918 IP space for their home router + */ + addressSpace?: string; + /** Workbench properties. */ + appOidc?: AppOidc; + /** Name of SKU. */ + skuPropertiesSku?: string; + /** + * Gets the status of the workbench at the time the operation was called + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly provisioningState?: ProvisioningState; +} + +/** Connector resource */ +export interface Connector extends Resource { + /** Gets or sets the Access Configuration. */ + accessConfigurations?: Record; + /** Gets or sets the Remote Desktop. */ + remoteDesktop?: Record; + /** Specifies set of source IP address ranges to allow access the ModSim Workbench workbench. */ + networkAcls?: Record; + /** + * Gets the status of the connector at the time the operation was called + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly provisioningState?: ProvisioningState; +} + +/** Chamber resource */ +export interface Chamber extends Resource { + /** + * Gets the status of the Chamber at the time the operation was called + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly provisioningState?: ProvisioningState; + /** Switch to show if License Service is activated. */ + enablePropertiesLicenseServicesSynopsysEnable?: boolean; + /** License Service server. */ + serverPropertiesLicenseServicesSynopsysServer?: string; + /** Virtual machine universal unique identifier of ModSim Workbench chamber license servers used by FlexNet Licensing Service. */ + vmUuid?: string[]; + /** Switch to show if License Service is activated. */ + enablePropertiesLicenseServicesSiemensEnable?: boolean; + /** License Service server. */ + serverPropertiesLicenseServicesSiemensServer?: string; + /** Unique identifier of ModSim Workbench chamber license servers used by FlexNet Licensing Service. */ + lmhostIdPropertiesLicenseServicesSiemensLmhostId?: string[]; + /** Switch to show if License Service is activated. */ + enablePropertiesLicenseServicesAnsysEnable?: boolean; + /** License Service server. */ + serverPropertiesLicenseServicesAnsysServer?: string; + /** Unique identifier of ModSim Workbench chamber license servers used by FlexNet Licensing Service. */ + lmhostIdPropertiesLicenseServicesAnsysLmhostId?: string[]; + /** Switch to show if License Service is activated. */ + enablePropertiesLicenseServicesCadenceEnable?: boolean; + /** License Service server. */ + serverPropertiesLicenseServicesCadenceServer?: string; + /** Unique identifier of ModSim Workbench chamber license servers used by FlexNet Licensing Service. */ + lmhostIdPropertiesLicenseServicesCadenceLmhostId?: string[]; + /** License server information for Cadence License Manager. */ + mfp?: string[]; +} + +/** Workload resource */ +export interface Workload extends Resource { + /** + * Gets the status of the workload at the time the operation was called + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly provisioningState?: ProvisioningState; + /** Gets or sets the VmSize. */ + vmSize?: string; + /** Gets or sets the edaType. */ + edaType?: string; + /** + * Gets or sets the status. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly status?: string; + /** + * Gets or sets the private IpAddress of workload. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly privateIP?: string; +} + +/** Storage resource */ +export interface Storage extends Resource { + /** + * Gets the status of the storage at the time the operation was called + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly provisioningState?: ProvisioningState; + /** Provisioned size of the ModSim Workbench chamber storage in terabytes */ + capacityAllocated?: number; + /** Specifies performance tier of the ModSim Workbench chamber storage. */ + performanceTier?: PerformanceTier; + /** Directory where the SDW Private Storage volume mounted. */ + localMountPath?: string; + /** Directory for the ModSim Workbench chamber data pipeline inbound. */ + dataPipelineInboundPath?: string; + /** Directory for the ModSim Workbench chamber data pipeline outbound. */ + dataPipelineOutboundPath?: string; + /** Capacity used in the SDW Private Storage volume in gigabytes. */ + capacityUsed?: number; +} + +/** File resource */ +export interface File extends Resource { + /** + * Gets the status of the file at the time the operation was called + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly provisioningState?: ProvisioningState; + /** The modified timestamp of the file. */ + timestamp?: Date; + /** The direction of ModSim Workbench chamber data pipeline where the file located. */ + dataPipeline?: string; + /** The resource ID of ModSim Workbench chamber data pipeline request Works and required only if requested is true. */ + requestId?: string; + /** The Linux File System path for the ModSim Workbench chamber data pipeline file. */ + filePath?: string; + /** The size of the file. */ + size?: number; + /** The MD5 hash of the file. */ + checksum?: string; +} + +/** Request resource */ +export interface Request extends Resource { + /** The timestamp for the resource creation. */ + timestamp?: Date; + /** FileId for the operation */ + fileId?: string; + /** Specifies the principal ID of Azure Active Directory User who requested to download. */ + requestUserId?: string; + /** The ModSim Workbench chamber workloads local username used when login. */ + linuxUsername?: string; + /** The status of ModSim Workbench chamber data pipeline request. */ + status?: string; + /** Description for the operation */ + description?: string; + approve?: RequestPropertiesFormatApprove; + download?: RequestPropertiesFormatDownload; + internalMetadata?: RequestPropertiesFormatInternalMetadata; + /** + * Gets the status of the request at the time the operation was called + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly provisioningState?: ProvisioningState; +} + +/** Defines headers for Workbenches_get operation. */ +export interface WorkbenchesGetHeaders { + location?: string; +} + +/** Defines headers for Workbenches_delete operation. */ +export interface WorkbenchesDeleteHeaders { + location?: string; +} + +/** Defines headers for Connectors_start operation. */ +export interface ConnectorsStartHeaders { + location?: string; +} + +/** Defines headers for Connectors_stop operation. */ +export interface ConnectorsStopHeaders { + location?: string; +} + +/** Defines headers for Connectors_restart operation. */ +export interface ConnectorsRestartHeaders { + location?: string; +} + +/** Defines headers for Connectors_delete operation. */ +export interface ConnectorsDeleteHeaders { + location?: string; +} + +/** Defines headers for Connectors_licenseAdd operation. */ +export interface ConnectorsLicenseAddHeaders { + location?: string; +} + +/** Defines headers for Chambers_start operation. */ +export interface ChambersStartHeaders { + location?: string; +} + +/** Defines headers for Chambers_stop operation. */ +export interface ChambersStopHeaders { + location?: string; +} + +/** Defines headers for Chambers_restart operation. */ +export interface ChambersRestartHeaders { + location?: string; +} + +/** Defines headers for Chambers_licenseUpdate operation. */ +export interface ChambersLicenseUpdateHeaders { + location?: string; +} + +/** Defines headers for Chambers_licenseRestart operation. */ +export interface ChambersLicenseRestartHeaders { + location?: string; +} + +/** Defines headers for Chambers_delete operation. */ +export interface ChambersDeleteHeaders { + location?: string; +} + +/** Defines headers for Workloads_start operation. */ +export interface WorkloadsStartHeaders { + location?: string; +} + +/** Defines headers for Workloads_stop operation. */ +export interface WorkloadsStopHeaders { + location?: string; +} + +/** Defines headers for Workloads_restart operation. */ +export interface WorkloadsRestartHeaders { + location?: string; +} + +/** Defines headers for Workloads_delete operation. */ +export interface WorkloadsDeleteHeaders { + location?: string; +} + +/** Defines headers for Files_downloadRequest operation. */ +export interface FilesDownloadRequestHeaders { + location?: string; +} + +/** Defines headers for File_manage operation. */ +export interface FileManageHeaders { + location?: string; +} + +/** Defines headers for FileRequests_manage operation. */ +export interface FileRequestsManageHeaders { + location?: string; +} + +/** Defines headers for FileRequest_getDownloadUri operation. */ +export interface FileRequestGetDownloadUriHeaders { + location?: string; +} + +/** Known values of {@link ProvisioningState} that the service accepts. */ +export enum KnownProvisioningState { + /** Unknown */ + Unknown = "Unknown", + /** Validating */ + Validating = "Validating", + /** Processing */ + Processing = "Processing", + /** Deleting */ + Deleting = "Deleting", + /** Accepted */ + Accepted = "Accepted", + /** Canceled */ + Canceled = "Canceled", + /** Completed */ + Completed = "Completed", + /** Succeeded */ + Succeeded = "Succeeded", + /** Failed */ + Failed = "Failed", + /** Deleted */ + Deleted = "Deleted" +} + +/** + * Defines values for ProvisioningState. \ + * {@link KnownProvisioningState} can be used interchangeably with ProvisioningState, + * this enum contains the known values that the service supports. + * ### Known values supported by the service + * **Unknown** \ + * **Validating** \ + * **Processing** \ + * **Deleting** \ + * **Accepted** \ + * **Canceled** \ + * **Completed** \ + * **Succeeded** \ + * **Failed** \ + * **Deleted** + */ +export type ProvisioningState = string; + +/** Known values of {@link CreatedByType} that the service accepts. */ +export enum KnownCreatedByType { + /** User */ + User = "User", + /** Application */ + Application = "Application", + /** ManagedIdentity */ + ManagedIdentity = "ManagedIdentity", + /** Key */ + Key = "Key" +} + +/** + * Defines values for CreatedByType. \ + * {@link KnownCreatedByType} can be used interchangeably with CreatedByType, + * this enum contains the known values that the service supports. + * ### Known values supported by the service + * **User** \ + * **Application** \ + * **ManagedIdentity** \ + * **Key** + */ +export type CreatedByType = string; + +/** Known values of {@link LicenseService} that the service accepts. */ +export enum KnownLicenseService { + /** Ansys */ + Ansys = "ansys", + /** Cadence */ + Cadence = "cadence", + /** Siemens */ + Siemens = "siemens", + /** Synopsys */ + Synopsys = "synopsys" +} + +/** + * Defines values for LicenseService. \ + * {@link KnownLicenseService} can be used interchangeably with LicenseService, + * this enum contains the known values that the service supports. + * ### Known values supported by the service + * **ansys** \ + * **cadence** \ + * **siemens** \ + * **synopsys** + */ +export type LicenseService = string; + +/** Known values of {@link PerformanceTier} that the service accepts. */ +export enum KnownPerformanceTier { + /** Standard */ + Standard = "Standard", + /** Premium */ + Premium = "Premium", + /** Ultra */ + Ultra = "Ultra" +} + +/** + * Defines values for PerformanceTier. \ + * {@link KnownPerformanceTier} can be used interchangeably with PerformanceTier, + * this enum contains the known values that the service supports. + * ### Known values supported by the service + * **Standard** \ + * **Premium** \ + * **Ultra** + */ +export type PerformanceTier = string; + +/** Known values of {@link DataPipeline} that the service accepts. */ +export enum KnownDataPipeline { + /** Inbound */ + Inbound = "Inbound", + /** Outbound */ + Outbound = "Outbound" +} + +/** + * Defines values for DataPipeline. \ + * {@link KnownDataPipeline} can be used interchangeably with DataPipeline, + * this enum contains the known values that the service supports. + * ### Known values supported by the service + * **Inbound** \ + * **Outbound** + */ +export type DataPipeline = string; + +/** Known values of {@link Action} that the service accepts. */ +export enum KnownAction { + /** Delete */ + Delete = "Delete", + /** Archive */ + Archive = "Archive" +} + +/** + * Defines values for Action. \ + * {@link KnownAction} can be used interchangeably with Action, + * this enum contains the known values that the service supports. + * ### Known values supported by the service + * **Delete** \ + * **Archive** + */ +export type Action = string; + +/** Known values of {@link Force} that the service accepts. */ +export enum KnownForce { + /** True */ + True = "True", + /** False */ + False = "False" +} + +/** + * Defines values for Force. \ + * {@link KnownForce} can be used interchangeably with Force, + * this enum contains the known values that the service supports. + * ### Known values supported by the service + * **True** \ + * **False** + */ +export type Force = string; + +/** Known values of {@link FileRequestsAction} that the service accepts. */ +export enum KnownFileRequestsAction { + /** Approve */ + Approve = "Approve", + /** Reject */ + Reject = "Reject" +} + +/** + * Defines values for FileRequestsAction. \ + * {@link KnownFileRequestsAction} can be used interchangeably with FileRequestsAction, + * this enum contains the known values that the service supports. + * ### Known values supported by the service + * **Approve** \ + * **Reject** + */ +export type FileRequestsAction = string; + +/** Known values of {@link LicenseActivated} that the service accepts. */ +export enum KnownLicenseActivated { + /** True */ + True = "True", + /** False */ + False = "False" +} + +/** + * Defines values for LicenseActivated. \ + * {@link KnownLicenseActivated} can be used interchangeably with LicenseActivated, + * this enum contains the known values that the service supports. + * ### Known values supported by the service + * **True** \ + * **False** + */ +export type LicenseActivated = string; + +/** Known values of {@link AccessType} that the service accepts. */ +export enum KnownAccessType { + /** GUI */ + GUI = "GUI" +} + +/** + * Defines values for AccessType. \ + * {@link KnownAccessType} can be used interchangeably with AccessType, + * this enum contains the known values that the service supports. + * ### Known values supported by the service + * **GUI** + */ +export type AccessType = string; + +/** Known values of {@link GatewayType} that the service accepts. */ +export enum KnownGatewayType { + /** ExpressRoute */ + ExpressRoute = "ExpressRoute", + /** None */ + None = "None", + /** Vpn */ + Vpn = "Vpn" +} + +/** + * Defines values for GatewayType. \ + * {@link KnownGatewayType} can be used interchangeably with GatewayType, + * this enum contains the known values that the service supports. + * ### Known values supported by the service + * **ExpressRoute** \ + * **None** \ + * **Vpn** + */ +export type GatewayType = string; + +/** Optional parameters. */ +export interface OperationsListOptionalParams + extends coreClient.OperationOptions {} + +/** Optional parameters. */ +export interface WorkbenchesListBySubscriptionOptionalParams + extends coreClient.OperationOptions {} + +/** Contains response data for the listBySubscription operation. */ +export type WorkbenchesListBySubscriptionResponse = WorkbenchPageableList; + +/** Optional parameters. */ +export interface WorkbenchesListByResourceGroupOptionalParams + extends coreClient.OperationOptions {} + +/** Contains response data for the listByResourceGroup operation. */ +export type WorkbenchesListByResourceGroupResponse = WorkbenchPageableList; + +/** Optional parameters. */ +export interface WorkbenchesGetOptionalParams + 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 WorkbenchesGetResponse = Workbench; + +/** Optional parameters. */ +export interface WorkbenchesCreateOrUpdateOptionalParams + extends coreClient.OperationOptions { + /** Parameters supplied to the create or update workbench operation. */ + body?: Workbench; + /** 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 createOrUpdate operation. */ +export type WorkbenchesCreateOrUpdateResponse = Workbench; + +/** Optional parameters. */ +export interface WorkbenchesUpdateOptionalParams + extends coreClient.OperationOptions { + /** Parameters supplied to the create or update chamber operation. */ + body?: Workbench; +} + +/** Contains response data for the update operation. */ +export type WorkbenchesUpdateResponse = Workbench; + +/** Optional parameters. */ +export interface WorkbenchesDeleteOptionalParams + 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 delete operation. */ +export type WorkbenchesDeleteResponse = Workbench; + +/** Optional parameters. */ +export interface WorkbenchesListBySubscriptionNextOptionalParams + extends coreClient.OperationOptions {} + +/** Contains response data for the listBySubscriptionNext operation. */ +export type WorkbenchesListBySubscriptionNextResponse = WorkbenchPageableList; + +/** Optional parameters. */ +export interface WorkbenchesListByResourceGroupNextOptionalParams + extends coreClient.OperationOptions {} + +/** Contains response data for the listByResourceGroupNext operation. */ +export type WorkbenchesListByResourceGroupNextResponse = WorkbenchPageableList; + +/** Optional parameters. */ +export interface ConnectorsStartOptionalParams + 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; +} + +/** Optional parameters. */ +export interface ConnectorsStopOptionalParams + 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; +} + +/** Optional parameters. */ +export interface ConnectorsRestartOptionalParams + 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; +} + +/** Optional parameters. */ +export interface ConnectorsCreateOrUpdateOptionalParams + extends coreClient.OperationOptions { + /** Parameters supplied to the create or update connector operation. */ + parameters?: Connector; + /** 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 createOrUpdate operation. */ +export type ConnectorsCreateOrUpdateResponse = Connector; + +/** Optional parameters. */ +export interface ConnectorsUpdateOptionalParams + extends coreClient.OperationOptions { + /** Parameters supplied to the create or update connector operation. */ + parameters?: Connector; +} + +/** Contains response data for the update operation. */ +export type ConnectorsUpdateResponse = Connector; + +/** Optional parameters. */ +export interface ConnectorsGetOptionalParams + extends coreClient.OperationOptions {} + +/** Contains response data for the get operation. */ +export type ConnectorsGetResponse = Connector; + +/** Optional parameters. */ +export interface ConnectorsDeleteOptionalParams + 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 delete operation. */ +export type ConnectorsDeleteResponse = Connector; + +/** Optional parameters. */ +export interface ConnectorsListOptionalParams + extends coreClient.OperationOptions {} + +/** Contains response data for the list operation. */ +export type ConnectorsListResponse = ConnectorPageableList; + +/** Optional parameters. */ +export interface ConnectorsLicenseAddOptionalParams + 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; +} + +/** Optional parameters. */ +export interface ConnectorsListNextOptionalParams + extends coreClient.OperationOptions {} + +/** Contains response data for the listNext operation. */ +export type ConnectorsListNextResponse = ConnectorPageableList; + +/** Optional parameters. */ +export interface ChambersGetUploadUriOptionalParams + extends coreClient.OperationOptions { + /** the file upload parameters. */ + body?: FileUploadParameters; +} + +/** Contains response data for the getUploadUri operation. */ +export type ChambersGetUploadUriResponse = GetUploadUri; + +/** Optional parameters. */ +export interface ChambersStartOptionalParams + 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; +} + +/** Optional parameters. */ +export interface ChambersStopOptionalParams + 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; +} + +/** Optional parameters. */ +export interface ChambersRestartOptionalParams + 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; +} + +/** Optional parameters. */ +export interface ChambersLicenseUpdateOptionalParams + extends coreClient.OperationOptions { + /** the update license services parameters. */ + body?: UpdateLicenseParameters; + /** 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; +} + +/** Optional parameters. */ +export interface ChambersLicenseRestartOptionalParams + extends coreClient.OperationOptions { + /** Restart License body */ + body?: RestartLicenseParameters; + /** 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; +} + +/** Optional parameters. */ +export interface ChambersCreateOrUpdateOptionalParams + extends coreClient.OperationOptions { + /** Parameters supplied to the create or update chamber operation. */ + parameters?: Chamber; + /** 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 createOrUpdate operation. */ +export type ChambersCreateOrUpdateResponse = Chamber; + +/** Optional parameters. */ +export interface ChambersUpdateOptionalParams + extends coreClient.OperationOptions { + /** Parameters supplied to the create or update Chamber operation. */ + parameters?: Chamber; +} + +/** Contains response data for the update operation. */ +export type ChambersUpdateResponse = Chamber; + +/** Optional parameters. */ +export interface ChambersGetOptionalParams + extends coreClient.OperationOptions {} + +/** Contains response data for the get operation. */ +export type ChambersGetResponse = Chamber; + +/** Optional parameters. */ +export interface ChambersDeleteOptionalParams + 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 delete operation. */ +export type ChambersDeleteResponse = Chamber; + +/** Optional parameters. */ +export interface ChambersListOptionalParams + extends coreClient.OperationOptions {} + +/** Contains response data for the list operation. */ +export type ChambersListResponse = ChamberPageableList; + +/** Optional parameters. */ +export interface ChambersListNextOptionalParams + extends coreClient.OperationOptions {} + +/** Contains response data for the listNext operation. */ +export type ChambersListNextResponse = ChamberPageableList; + +/** Optional parameters. */ +export interface WorkloadsStartOptionalParams + 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; +} + +/** Optional parameters. */ +export interface WorkloadsStopOptionalParams + 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; +} + +/** Optional parameters. */ +export interface WorkloadsRestartOptionalParams + 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; +} + +/** Optional parameters. */ +export interface WorkloadsCreateOrUpdateOptionalParams + extends coreClient.OperationOptions { + /** Parameters supplied to the create or update workload operation. */ + parameters?: Workload; + /** 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 createOrUpdate operation. */ +export type WorkloadsCreateOrUpdateResponse = Workload; + +/** Optional parameters. */ +export interface WorkloadsUpdateOptionalParams + extends coreClient.OperationOptions { + /** Parameters supplied to the create or update workload operation. */ + parameters?: Workload; +} + +/** Contains response data for the update operation. */ +export type WorkloadsUpdateResponse = Workload; + +/** Optional parameters. */ +export interface WorkloadsGetOptionalParams + extends coreClient.OperationOptions {} + +/** Contains response data for the get operation. */ +export type WorkloadsGetResponse = Workload; + +/** Optional parameters. */ +export interface WorkloadsDeleteOptionalParams + 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 delete operation. */ +export type WorkloadsDeleteResponse = Workload; + +/** Optional parameters. */ +export interface WorkloadsListOptionalParams + extends coreClient.OperationOptions {} + +/** Contains response data for the list operation. */ +export type WorkloadsListResponse = WorkloadPageableList; + +/** Optional parameters. */ +export interface WorkloadsListNextOptionalParams + extends coreClient.OperationOptions {} + +/** Contains response data for the listNext operation. */ +export type WorkloadsListNextResponse = WorkloadPageableList; + +/** Optional parameters. */ +export interface StoragesCreateOrUpdateOptionalParams + extends coreClient.OperationOptions { + /** Parameters supplied to the create or update storage resource. */ + parameters?: Storage; + /** 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 createOrUpdate operation. */ +export type StoragesCreateOrUpdateResponse = Storage; + +/** Optional parameters. */ +export interface StoragesUpdateOptionalParams + extends coreClient.OperationOptions { + /** Parameters supplied to the create or update storage resource. */ + parameters?: Storage; +} + +/** Contains response data for the update operation. */ +export type StoragesUpdateResponse = Storage; + +/** Optional parameters. */ +export interface StoragesGetOptionalParams + extends coreClient.OperationOptions {} + +/** Contains response data for the get operation. */ +export type StoragesGetResponse = Storage; + +/** Optional parameters. */ +export interface StoragesDeleteOptionalParams + 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 delete operation. */ +export type StoragesDeleteResponse = Storage; + +/** Optional parameters. */ +export interface StoragesListOptionalParams + extends coreClient.OperationOptions {} + +/** Contains response data for the list operation. */ +export type StoragesListResponse = StoragePageableList; + +/** Optional parameters. */ +export interface StoragesListNextOptionalParams + extends coreClient.OperationOptions {} + +/** Contains response data for the listNext operation. */ +export type StoragesListNextResponse = StoragePageableList; + +/** Optional parameters. */ +export interface FilesGetOptionalParams extends coreClient.OperationOptions {} + +/** Contains response data for the get operation. */ +export type FilesGetResponse = File; + +/** Optional parameters. */ +export interface FilesDownloadRequestOptionalParams + extends coreClient.OperationOptions { + /** the file download request parameters. */ + body?: FilesDownloadRequestParameters; + /** 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 downloadRequest operation. */ +export type FilesDownloadRequestResponse = DownloadRequest; + +/** Optional parameters. */ +export interface FilesListOptionalParams extends coreClient.OperationOptions {} + +/** Contains response data for the list operation. */ +export type FilesListResponse = FilePageableList; + +/** Optional parameters. */ +export interface FilesListNextOptionalParams + extends coreClient.OperationOptions {} + +/** Contains response data for the listNext operation. */ +export type FilesListNextResponse = FilePageableList; + +/** Optional parameters. */ +export interface FileManageOptionalParams extends coreClient.OperationOptions { + /** Manage download file parameters. */ + body?: FilesManageParameters; + /** 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 manage operation. */ +export type FileManageResponse = FilesManage; + +/** Optional parameters. */ +export interface FileRequestsGetOptionalParams + extends coreClient.OperationOptions {} + +/** Contains response data for the get operation. */ +export type FileRequestsGetResponse = Request; + +/** Optional parameters. */ +export interface FileRequestsManageOptionalParams + extends coreClient.OperationOptions { + /** Manage download file requests parameters. */ + body?: FileRequestsManageParameters; + /** 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 manage operation. */ +export type FileRequestsManageResponse = FileRequestsManage; + +/** Optional parameters. */ +export interface FileRequestsListOptionalParams + extends coreClient.OperationOptions {} + +/** Contains response data for the list operation. */ +export type FileRequestsListResponse = RequestPageableList; + +/** Optional parameters. */ +export interface FileRequestsListNextOptionalParams + extends coreClient.OperationOptions {} + +/** Contains response data for the listNext operation. */ +export type FileRequestsListNextResponse = RequestPageableList; + +/** Optional parameters. */ +export interface FileRequestGetDownloadUriOptionalParams + 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 getDownloadUri operation. */ +export type FileRequestGetDownloadUriResponse = FileDownloadSasUri; + +/** Optional parameters. */ +export interface MicrosoftModSimWorkbenchOptionalParams + extends coreClient.ServiceClientOptions { + /** server parameter */ + $host?: string; + /** Api Version */ + apiVersion?: string; + /** Overrides client endpoint. */ + endpoint?: string; +} diff --git a/sdk/modsimworkbench/arm-modsimworkbench/src/models/mappers.ts b/sdk/modsimworkbench/arm-modsimworkbench/src/models/mappers.ts new file mode 100644 index 000000000000..23557aad08c7 --- /dev/null +++ b/sdk/modsimworkbench/arm-modsimworkbench/src/models/mappers.ts @@ -0,0 +1,1627 @@ +/* + * 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 * as coreClient from "@azure/core-client"; + +export const ErrorResponse: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "ErrorResponse", + modelProperties: { + error: { + serializedName: "error", + type: { + name: "Composite", + className: "ErrorDetail" + } + } + } + } +}; + +export const ErrorDetail: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "ErrorDetail", + modelProperties: { + code: { + serializedName: "code", + readOnly: true, + type: { + name: "String" + } + }, + message: { + serializedName: "message", + readOnly: true, + type: { + name: "String" + } + }, + target: { + serializedName: "target", + readOnly: true, + type: { + name: "String" + } + }, + details: { + serializedName: "details", + readOnly: true, + type: { + name: "Sequence", + element: { + type: { + name: "Composite", + className: "ErrorDetail" + } + } + } + }, + additionalInfo: { + serializedName: "additionalInfo", + readOnly: true, + type: { + name: "Sequence", + element: { + type: { + name: "Composite", + className: "ErrorAdditionalInfo" + } + } + } + } + } + } +}; + +export const ErrorAdditionalInfo: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "ErrorAdditionalInfo", + modelProperties: { + type: { + serializedName: "type", + readOnly: true, + type: { + name: "String" + } + }, + info: { + serializedName: "info", + readOnly: true, + type: { + name: "Dictionary", + value: { type: { name: "any" } } + } + } + } + } +}; + +export const WorkbenchPageableList: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "WorkbenchPageableList", + modelProperties: { + nextLink: { + serializedName: "nextLink", + type: { + name: "String" + } + }, + value: { + serializedName: "value", + type: { + name: "Sequence", + element: { + type: { + name: "Composite", + className: "Workbench" + } + } + } + } + } + } +}; + +export const AppOidc: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "AppOidc", + modelProperties: { + clientId: { + serializedName: "clientId", + type: { + name: "String" + } + }, + secretUri: { + serializedName: "secretUri", + type: { + name: "String" + } + } + } + } +}; + +export const Resource: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "Resource", + modelProperties: { + id: { + serializedName: "id", + readOnly: true, + type: { + name: "String" + } + }, + name: { + serializedName: "name", + readOnly: true, + type: { + name: "String" + } + }, + type: { + serializedName: "type", + readOnly: true, + type: { + name: "String" + } + }, + location: { + serializedName: "location", + type: { + name: "String" + } + }, + tags: { + serializedName: "tags", + type: { + name: "Dictionary", + value: { type: { name: "String" } } + } + }, + systemData: { + serializedName: "systemData", + type: { + name: "Composite", + className: "SystemData" + } + }, + sku: { + serializedName: "sku", + type: { + name: "String" + } + } + } + } +}; + +export const SystemData: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "SystemData", + modelProperties: { + createdBy: { + serializedName: "createdBy", + type: { + name: "String" + } + }, + createdByType: { + serializedName: "createdByType", + type: { + name: "String" + } + }, + createdAt: { + serializedName: "createdAt", + type: { + name: "DateTime" + } + }, + lastModifiedBy: { + serializedName: "lastModifiedBy", + type: { + name: "String" + } + }, + lastModifiedByType: { + serializedName: "lastModifiedByType", + type: { + name: "String" + } + }, + lastModifiedAt: { + serializedName: "lastModifiedAt", + type: { + name: "DateTime" + } + } + } + } +}; + +export const ConnectorPageableList: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "ConnectorPageableList", + modelProperties: { + nextLink: { + serializedName: "nextLink", + type: { + name: "String" + } + }, + value: { + serializedName: "value", + type: { + name: "Sequence", + element: { + type: { + name: "Composite", + className: "Connector" + } + } + } + } + } + } +}; + +export const LicenseKeyParameters: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "LicenseKeyParameters", + modelProperties: { + licenseKey: { + serializedName: "licenseKey", + type: { + name: "String" + } + } + } + } +}; + +export const FileUploadParameters: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "FileUploadParameters", + modelProperties: { + fileSize: { + serializedName: "fileSize", + type: { + name: "Number" + } + } + } + } +}; + +export const GetUploadUri: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "GetUploadUri", + modelProperties: { + result: { + serializedName: "result", + type: { + name: "String" + } + } + } + } +}; + +export const UpdateLicenseParameters: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "UpdateLicenseParameters", + modelProperties: { + licenseService: { + serializedName: "licenseService", + type: { + name: "String" + } + }, + enable: { + serializedName: "enable", + type: { + name: "Boolean" + } + }, + licenseKey: { + serializedName: "licenseKey", + type: { + name: "String" + } + } + } + } +}; + +export const RestartLicenseParameters: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "RestartLicenseParameters", + modelProperties: { + licenseService: { + serializedName: "licenseService", + type: { + name: "String" + } + } + } + } +}; + +export const ChamberPageableList: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "ChamberPageableList", + modelProperties: { + nextLink: { + serializedName: "nextLink", + type: { + name: "String" + } + }, + value: { + serializedName: "value", + type: { + name: "Sequence", + element: { + type: { + name: "Composite", + className: "Chamber" + } + } + } + } + } + } +}; + +export const WorkloadPageableList: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "WorkloadPageableList", + modelProperties: { + nextLink: { + serializedName: "nextLink", + type: { + name: "String" + } + }, + value: { + serializedName: "value", + type: { + name: "Sequence", + element: { + type: { + name: "Composite", + className: "Workload" + } + } + } + } + } + } +}; + +export const ErrorResponseAutoGenerated: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "ErrorResponseAutoGenerated", + modelProperties: { + error: { + serializedName: "error", + type: { + name: "Composite", + className: "ErrorDetailAutoGenerated" + } + } + } + } +}; + +export const ErrorDetailAutoGenerated: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "ErrorDetailAutoGenerated", + modelProperties: { + code: { + serializedName: "code", + readOnly: true, + type: { + name: "String" + } + }, + message: { + serializedName: "message", + readOnly: true, + type: { + name: "String" + } + }, + target: { + serializedName: "target", + readOnly: true, + type: { + name: "String" + } + }, + details: { + serializedName: "details", + readOnly: true, + type: { + name: "Sequence", + element: { + type: { + name: "Composite", + className: "ErrorDetailAutoGenerated" + } + } + } + }, + additionalInfo: { + serializedName: "additionalInfo", + readOnly: true, + type: { + name: "Sequence", + element: { + type: { + name: "Composite", + className: "ErrorAdditionalInfo" + } + } + } + } + } + } +}; + +export const StoragePageableList: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "StoragePageableList", + modelProperties: { + nextLink: { + serializedName: "nextLink", + type: { + name: "String" + } + }, + value: { + serializedName: "value", + type: { + name: "Sequence", + element: { + type: { + name: "Composite", + className: "Storage" + } + } + } + } + } + } +}; + +export const FilesManageParameters: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "FilesManageParameters", + modelProperties: { + dataPipeline: { + serializedName: "dataPipeline", + type: { + name: "String" + } + }, + action: { + serializedName: "action", + type: { + name: "String" + } + }, + force: { + serializedName: "force", + type: { + name: "String" + } + } + } + } +}; + +export const FilesManage: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "FilesManage", + modelProperties: { + result: { + serializedName: "result", + type: { + name: "String" + } + } + } + } +}; + +export const FilesDownloadRequestParameters: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "FilesDownloadRequestParameters", + modelProperties: { + description: { + serializedName: "description", + type: { + name: "String" + } + } + } + } +}; + +export const DownloadRequest: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "DownloadRequest", + modelProperties: { + result: { + serializedName: "result", + type: { + name: "String" + } + } + } + } +}; + +export const FilePageableList: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "FilePageableList", + modelProperties: { + nextLink: { + serializedName: "nextLink", + type: { + name: "String" + } + }, + value: { + serializedName: "value", + type: { + name: "Sequence", + element: { + type: { + name: "Composite", + className: "File" + } + } + } + } + } + } +}; + +export const RequestPropertiesFormatApprove: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "RequestPropertiesFormatApprove", + modelProperties: { + id: { + serializedName: "id", + type: { + name: "String" + } + }, + description: { + serializedName: "description", + type: { + name: "String" + } + }, + userId: { + serializedName: "userId", + type: { + name: "String" + } + }, + timestamp: { + serializedName: "timestamp", + type: { + name: "DateTime" + } + } + } + } +}; + +export const RequestPropertiesFormatDownload: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "RequestPropertiesFormatDownload", + modelProperties: { + location: { + serializedName: "location", + type: { + name: "String" + } + }, + startTime: { + serializedName: "startTime", + type: { + name: "DateTime" + } + }, + completeTime: { + serializedName: "completeTime", + type: { + name: "DateTime" + } + } + } + } +}; + +export const RequestPropertiesFormatInternalMetadata: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "RequestPropertiesFormatInternalMetadata", + modelProperties: { + sasUriId: { + serializedName: "sasUriId", + type: { + name: "String" + } + } + } + } +}; + +export const FileRequestsManageParameters: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "FileRequestsManageParameters", + modelProperties: { + action: { + serializedName: "action", + type: { + name: "String" + } + }, + description: { + serializedName: "description", + type: { + name: "String" + } + } + } + } +}; + +export const FileRequestsManage: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "FileRequestsManage", + modelProperties: { + result: { + serializedName: "result", + type: { + name: "String" + } + } + } + } +}; + +export const FileDownloadSasUri: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "FileDownloadSasUri", + modelProperties: { + result: { + serializedName: "result", + type: { + name: "String" + } + } + } + } +}; + +export const RequestPageableList: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "RequestPageableList", + modelProperties: { + nextLink: { + serializedName: "nextLink", + type: { + name: "String" + } + }, + value: { + serializedName: "value", + type: { + name: "Sequence", + element: { + type: { + name: "Composite", + className: "Request" + } + } + } + } + } + } +}; + +export const RemoteDesktop: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "RemoteDesktop", + modelProperties: { + etx: { + serializedName: "etx", + type: { + name: "Composite", + className: "Etx" + } + } + } + } +}; + +export const Etx: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "Etx", + modelProperties: { + connectionNodeCount: { + serializedName: "connectionNodeCount", + readOnly: true, + type: { + name: "Number" + } + }, + licenseActivated: { + serializedName: "licenseActivated", + readOnly: true, + type: { + name: "String" + } + }, + replyUrlEtx: { + serializedName: "replyUrlEtx", + readOnly: true, + type: { + name: "String" + } + }, + replyUrlOtds: { + serializedName: "replyUrlOtds", + readOnly: true, + type: { + name: "String" + } + }, + licenseKeyUri: { + serializedName: "licenseKeyUri", + type: { + name: "String" + } + } + } + } +}; + +export const AccessConfiguration: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "AccessConfiguration", + modelProperties: { + accessType: { + serializedName: "accessType", + readOnly: true, + type: { + name: "String" + } + }, + gatewayType: { + serializedName: "gatewayType", + type: { + name: "String" + } + }, + gatewayVnetId: { + serializedName: "gatewayVnetId", + type: { + name: "String" + } + }, + accessUrl: { + serializedName: "accessUrl", + readOnly: true, + type: { + name: "String" + } + }, + ipAddress: { + serializedName: "ipAddress", + readOnly: true, + type: { + name: "String" + } + } + } + } +}; + +export const NetworkAcls: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "NetworkAcls", + modelProperties: { + allowedAddressSpaces: { + serializedName: "allowedAddressSpaces", + type: { + name: "Sequence", + element: { + type: { + name: "String" + } + } + } + } + } + } +}; + +export const Workbench: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "Workbench", + modelProperties: { + ...Resource.type.modelProperties, + addressSpace: { + serializedName: "properties.addressSpace", + type: { + name: "String" + } + }, + appOidc: { + serializedName: "properties.appOidc", + type: { + name: "Composite", + className: "AppOidc" + } + }, + skuPropertiesSku: { + serializedName: "properties.sku", + type: { + name: "String" + } + }, + provisioningState: { + serializedName: "properties.provisioningState", + readOnly: true, + type: { + name: "String" + } + } + } + } +}; + +export const Connector: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "Connector", + modelProperties: { + ...Resource.type.modelProperties, + accessConfigurations: { + serializedName: "properties.accessConfigurations", + type: { + name: "Dictionary", + value: { type: { name: "any" } } + } + }, + remoteDesktop: { + serializedName: "properties.remoteDesktop", + type: { + name: "Dictionary", + value: { type: { name: "any" } } + } + }, + networkAcls: { + serializedName: "properties.networkAcls", + type: { + name: "Dictionary", + value: { type: { name: "any" } } + } + }, + provisioningState: { + serializedName: "properties.provisioningState", + readOnly: true, + type: { + name: "String" + } + } + } + } +}; + +export const Chamber: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "Chamber", + modelProperties: { + ...Resource.type.modelProperties, + provisioningState: { + serializedName: "properties.provisioningState", + readOnly: true, + type: { + name: "String" + } + }, + enablePropertiesLicenseServicesSynopsysEnable: { + serializedName: "properties.licenseServices.synopsys.enable", + type: { + name: "Boolean" + } + }, + serverPropertiesLicenseServicesSynopsysServer: { + serializedName: "properties.licenseServices.synopsys.server", + type: { + name: "String" + } + }, + vmUuid: { + serializedName: "properties.licenseServices.synopsys.vmUuid", + type: { + name: "Sequence", + element: { + type: { + name: "String" + } + } + } + }, + enablePropertiesLicenseServicesSiemensEnable: { + serializedName: "properties.licenseServices.siemens.enable", + type: { + name: "Boolean" + } + }, + serverPropertiesLicenseServicesSiemensServer: { + serializedName: "properties.licenseServices.siemens.server", + type: { + name: "String" + } + }, + lmhostIdPropertiesLicenseServicesSiemensLmhostId: { + serializedName: "properties.licenseServices.siemens.lmhostId", + type: { + name: "Sequence", + element: { + type: { + name: "String" + } + } + } + }, + enablePropertiesLicenseServicesAnsysEnable: { + serializedName: "properties.licenseServices.ansys.enable", + type: { + name: "Boolean" + } + }, + serverPropertiesLicenseServicesAnsysServer: { + serializedName: "properties.licenseServices.ansys.server", + type: { + name: "String" + } + }, + lmhostIdPropertiesLicenseServicesAnsysLmhostId: { + serializedName: "properties.licenseServices.ansys.lmhostId", + type: { + name: "Sequence", + element: { + type: { + name: "String" + } + } + } + }, + enablePropertiesLicenseServicesCadenceEnable: { + serializedName: "properties.licenseServices.cadence.enable", + type: { + name: "Boolean" + } + }, + serverPropertiesLicenseServicesCadenceServer: { + serializedName: "properties.licenseServices.cadence.server", + type: { + name: "String" + } + }, + lmhostIdPropertiesLicenseServicesCadenceLmhostId: { + serializedName: "properties.licenseServices.cadence.lmhostId", + type: { + name: "Sequence", + element: { + type: { + name: "String" + } + } + } + }, + mfp: { + serializedName: "properties.licenseServices.cadence.mfp", + type: { + name: "Sequence", + element: { + type: { + name: "String" + } + } + } + } + } + } +}; + +export const Workload: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "Workload", + modelProperties: { + ...Resource.type.modelProperties, + provisioningState: { + serializedName: "properties.provisioningState", + readOnly: true, + type: { + name: "String" + } + }, + vmSize: { + serializedName: "properties.vmSize", + type: { + name: "String" + } + }, + edaType: { + serializedName: "properties.edaType", + type: { + name: "String" + } + }, + status: { + serializedName: "properties.status", + readOnly: true, + type: { + name: "String" + } + }, + privateIP: { + serializedName: "properties.privateIP", + readOnly: true, + type: { + name: "String" + } + } + } + } +}; + +export const Storage: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "Storage", + modelProperties: { + ...Resource.type.modelProperties, + provisioningState: { + serializedName: "properties.provisioningState", + readOnly: true, + type: { + name: "String" + } + }, + capacityAllocated: { + serializedName: "properties.capacityAllocated", + type: { + name: "Number" + } + }, + performanceTier: { + defaultValue: "Premium", + serializedName: "properties.performanceTier", + type: { + name: "String" + } + }, + localMountPath: { + serializedName: "properties.localMountPath", + type: { + name: "String" + } + }, + dataPipelineInboundPath: { + serializedName: "properties.dataPipelineInboundPath", + type: { + name: "String" + } + }, + dataPipelineOutboundPath: { + serializedName: "properties.dataPipelineOutboundPath", + type: { + name: "String" + } + }, + capacityUsed: { + serializedName: "properties.capacityUsed", + type: { + name: "Number" + } + } + } + } +}; + +export const File: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "File", + modelProperties: { + ...Resource.type.modelProperties, + provisioningState: { + serializedName: "properties.provisioningState", + readOnly: true, + type: { + name: "String" + } + }, + timestamp: { + serializedName: "properties.timestamp", + type: { + name: "DateTime" + } + }, + dataPipeline: { + serializedName: "properties.dataPipeline", + type: { + name: "String" + } + }, + requestId: { + serializedName: "properties.requestId", + type: { + name: "String" + } + }, + filePath: { + serializedName: "properties.filePath", + type: { + name: "String" + } + }, + size: { + serializedName: "properties.size", + type: { + name: "Number" + } + }, + checksum: { + serializedName: "properties.checksum", + type: { + name: "String" + } + } + } + } +}; + +export const Request: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "Request", + modelProperties: { + ...Resource.type.modelProperties, + timestamp: { + serializedName: "properties.timestamp", + type: { + name: "DateTime" + } + }, + fileId: { + serializedName: "properties.fileId", + type: { + name: "String" + } + }, + requestUserId: { + serializedName: "properties.requestUserId", + type: { + name: "String" + } + }, + linuxUsername: { + serializedName: "properties.linuxUsername", + type: { + name: "String" + } + }, + status: { + serializedName: "properties.status", + type: { + name: "String" + } + }, + description: { + serializedName: "properties.description", + type: { + name: "String" + } + }, + approve: { + serializedName: "properties.approve", + type: { + name: "Composite", + className: "RequestPropertiesFormatApprove" + } + }, + download: { + serializedName: "properties.download", + type: { + name: "Composite", + className: "RequestPropertiesFormatDownload" + } + }, + internalMetadata: { + serializedName: "properties.internalMetadata", + type: { + name: "Composite", + className: "RequestPropertiesFormatInternalMetadata" + } + }, + provisioningState: { + serializedName: "properties.provisioningState", + readOnly: true, + type: { + name: "String" + } + } + } + } +}; + +export const WorkbenchesGetHeaders: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "WorkbenchesGetHeaders", + modelProperties: { + location: { + serializedName: "location", + type: { + name: "String" + } + } + } + } +}; + +export const WorkbenchesDeleteHeaders: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "WorkbenchesDeleteHeaders", + modelProperties: { + location: { + serializedName: "location", + type: { + name: "String" + } + } + } + } +}; + +export const ConnectorsStartHeaders: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "ConnectorsStartHeaders", + modelProperties: { + location: { + serializedName: "location", + type: { + name: "String" + } + } + } + } +}; + +export const ConnectorsStopHeaders: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "ConnectorsStopHeaders", + modelProperties: { + location: { + serializedName: "location", + type: { + name: "String" + } + } + } + } +}; + +export const ConnectorsRestartHeaders: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "ConnectorsRestartHeaders", + modelProperties: { + location: { + serializedName: "location", + type: { + name: "String" + } + } + } + } +}; + +export const ConnectorsDeleteHeaders: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "ConnectorsDeleteHeaders", + modelProperties: { + location: { + serializedName: "location", + type: { + name: "String" + } + } + } + } +}; + +export const ConnectorsLicenseAddHeaders: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "ConnectorsLicenseAddHeaders", + modelProperties: { + location: { + serializedName: "location", + type: { + name: "String" + } + } + } + } +}; + +export const ChambersStartHeaders: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "ChambersStartHeaders", + modelProperties: { + location: { + serializedName: "location", + type: { + name: "String" + } + } + } + } +}; + +export const ChambersStopHeaders: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "ChambersStopHeaders", + modelProperties: { + location: { + serializedName: "location", + type: { + name: "String" + } + } + } + } +}; + +export const ChambersRestartHeaders: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "ChambersRestartHeaders", + modelProperties: { + location: { + serializedName: "location", + type: { + name: "String" + } + } + } + } +}; + +export const ChambersLicenseUpdateHeaders: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "ChambersLicenseUpdateHeaders", + modelProperties: { + location: { + serializedName: "location", + type: { + name: "String" + } + } + } + } +}; + +export const ChambersLicenseRestartHeaders: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "ChambersLicenseRestartHeaders", + modelProperties: { + location: { + serializedName: "location", + type: { + name: "String" + } + } + } + } +}; + +export const ChambersDeleteHeaders: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "ChambersDeleteHeaders", + modelProperties: { + location: { + serializedName: "location", + type: { + name: "String" + } + } + } + } +}; + +export const WorkloadsStartHeaders: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "WorkloadsStartHeaders", + modelProperties: { + location: { + serializedName: "location", + type: { + name: "String" + } + } + } + } +}; + +export const WorkloadsStopHeaders: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "WorkloadsStopHeaders", + modelProperties: { + location: { + serializedName: "location", + type: { + name: "String" + } + } + } + } +}; + +export const WorkloadsRestartHeaders: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "WorkloadsRestartHeaders", + modelProperties: { + location: { + serializedName: "location", + type: { + name: "String" + } + } + } + } +}; + +export const WorkloadsDeleteHeaders: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "WorkloadsDeleteHeaders", + modelProperties: { + location: { + serializedName: "location", + type: { + name: "String" + } + } + } + } +}; + +export const FilesDownloadRequestHeaders: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "FilesDownloadRequestHeaders", + modelProperties: { + location: { + serializedName: "location", + type: { + name: "String" + } + } + } + } +}; + +export const FileManageHeaders: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "FileManageHeaders", + modelProperties: { + location: { + serializedName: "location", + type: { + name: "String" + } + } + } + } +}; + +export const FileRequestsManageHeaders: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "FileRequestsManageHeaders", + modelProperties: { + location: { + serializedName: "location", + type: { + name: "String" + } + } + } + } +}; + +export const FileRequestGetDownloadUriHeaders: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "FileRequestGetDownloadUriHeaders", + modelProperties: { + location: { + serializedName: "location", + type: { + name: "String" + } + } + } + } +}; diff --git a/sdk/modsimworkbench/arm-modsimworkbench/src/models/parameters.ts b/sdk/modsimworkbench/arm-modsimworkbench/src/models/parameters.ts new file mode 100644 index 000000000000..5bf0292cec9f --- /dev/null +++ b/sdk/modsimworkbench/arm-modsimworkbench/src/models/parameters.ts @@ -0,0 +1,287 @@ +/* + * 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 { + OperationParameter, + OperationURLParameter, + OperationQueryParameter +} from "@azure/core-client"; +import { + Workbench as WorkbenchMapper, + Connector as ConnectorMapper, + LicenseKeyParameters as LicenseKeyParametersMapper, + FileUploadParameters as FileUploadParametersMapper, + UpdateLicenseParameters as UpdateLicenseParametersMapper, + RestartLicenseParameters as RestartLicenseParametersMapper, + Chamber as ChamberMapper, + Workload as WorkloadMapper, + Storage as StorageMapper, + FilesDownloadRequestParameters as FilesDownloadRequestParametersMapper, + FilesManageParameters as FilesManageParametersMapper, + FileRequestsManageParameters as FileRequestsManageParametersMapper +} from "../models/mappers"; + +export const accept: OperationParameter = { + parameterPath: "accept", + mapper: { + defaultValue: "application/json", + isConstant: true, + serializedName: "Accept", + type: { + name: "String" + } + } +}; + +export const $host: OperationURLParameter = { + parameterPath: "$host", + mapper: { + serializedName: "$host", + required: true, + type: { + name: "String" + } + }, + skipEncoding: true +}; + +export const apiVersion: OperationQueryParameter = { + parameterPath: "apiVersion", + mapper: { + defaultValue: "2021-03-01-preview", + isConstant: true, + serializedName: "api-version", + type: { + name: "String" + } + } +}; + +export const subscriptionId: OperationURLParameter = { + parameterPath: "subscriptionId", + mapper: { + constraints: { + MinLength: 1 + }, + serializedName: "subscriptionId", + required: true, + type: { + name: "String" + } + } +}; + +export const resourceGroup: OperationURLParameter = { + parameterPath: "resourceGroup", + mapper: { + serializedName: "resourceGroup", + required: true, + type: { + name: "String" + } + } +}; + +export const name: OperationURLParameter = { + parameterPath: "name", + mapper: { + serializedName: "name", + required: true, + type: { + name: "String" + } + } +}; + +export const contentType: OperationParameter = { + parameterPath: ["options", "contentType"], + mapper: { + defaultValue: "application/json", + isConstant: true, + serializedName: "Content-Type", + type: { + name: "String" + } + } +}; + +export const body: OperationParameter = { + parameterPath: ["options", "body"], + mapper: WorkbenchMapper +}; + +export const nextLink: OperationURLParameter = { + parameterPath: "nextLink", + mapper: { + serializedName: "nextLink", + required: true, + type: { + name: "String" + } + }, + skipEncoding: true +}; + +export const workbenchName: OperationURLParameter = { + parameterPath: "workbenchName", + mapper: { + serializedName: "workbenchName", + required: true, + type: { + name: "String" + } + } +}; + +export const chamberName: OperationURLParameter = { + parameterPath: "chamberName", + mapper: { + serializedName: "chamberName", + required: true, + type: { + name: "String" + } + } +}; + +export const parameters: OperationParameter = { + parameterPath: ["options", "parameters"], + mapper: ConnectorMapper +}; + +export const connectorName: OperationURLParameter = { + parameterPath: "connectorName", + mapper: { + serializedName: "connectorName", + required: true, + type: { + name: "String" + } + } +}; + +export const body1: OperationParameter = { + parameterPath: "body", + mapper: LicenseKeyParametersMapper +}; + +export const body2: OperationParameter = { + parameterPath: ["options", "body"], + mapper: FileUploadParametersMapper +}; + +export const body3: OperationParameter = { + parameterPath: ["options", "body"], + mapper: UpdateLicenseParametersMapper +}; + +export const body4: OperationParameter = { + parameterPath: ["options", "body"], + mapper: RestartLicenseParametersMapper +}; + +export const parameters1: OperationParameter = { + parameterPath: ["options", "parameters"], + mapper: ChamberMapper +}; + +export const contentType1: OperationParameter = { + parameterPath: ["options", "contentType"], + mapper: { + defaultValue: "application/merge-patch+json", + isConstant: true, + serializedName: "Content-Type", + type: { + name: "String" + } + } +}; + +export const parameters2: OperationParameter = { + parameterPath: ["options", "parameters"], + mapper: WorkloadMapper +}; + +export const workloadName: OperationURLParameter = { + parameterPath: "workloadName", + mapper: { + serializedName: "workloadName", + required: true, + type: { + name: "String" + } + } +}; + +export const parameters3: OperationParameter = { + parameterPath: ["options", "parameters"], + mapper: StorageMapper +}; + +export const storageName: OperationURLParameter = { + parameterPath: "storageName", + mapper: { + serializedName: "storageName", + required: true, + type: { + name: "String" + } + } +}; + +export const resourceGroupName: OperationURLParameter = { + parameterPath: "resourceGroupName", + mapper: { + constraints: { + MaxLength: 90, + MinLength: 1 + }, + serializedName: "resourceGroupName", + required: true, + type: { + name: "String" + } + } +}; + +export const fileName: OperationURLParameter = { + parameterPath: "fileName", + mapper: { + serializedName: "fileName", + required: true, + type: { + name: "String" + } + } +}; + +export const body5: OperationParameter = { + parameterPath: ["options", "body"], + mapper: FilesDownloadRequestParametersMapper +}; + +export const body6: OperationParameter = { + parameterPath: ["options", "body"], + mapper: FilesManageParametersMapper +}; + +export const requestName: OperationURLParameter = { + parameterPath: "requestName", + mapper: { + serializedName: "requestName", + required: true, + type: { + name: "String" + } + } +}; + +export const body7: OperationParameter = { + parameterPath: ["options", "body"], + mapper: FileRequestsManageParametersMapper +}; diff --git a/sdk/modsimworkbench/arm-modsimworkbench/src/operations/chambers.ts b/sdk/modsimworkbench/arm-modsimworkbench/src/operations/chambers.ts new file mode 100644 index 000000000000..5b8d6dee0e48 --- /dev/null +++ b/sdk/modsimworkbench/arm-modsimworkbench/src/operations/chambers.ts @@ -0,0 +1,1170 @@ +/* + * 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, PageSettings } from "@azure/core-paging"; +import { setContinuationToken } from "../pagingHelper"; +import { Chambers } from "../operationsInterfaces"; +import * as coreClient from "@azure/core-client"; +import * as Mappers from "../models/mappers"; +import * as Parameters from "../models/parameters"; +import { MicrosoftModSimWorkbench } from "../microsoftModSimWorkbench"; +import { + SimplePollerLike, + OperationState, + createHttpPoller +} from "@azure/core-lro"; +import { createLroSpec } from "../lroImpl"; +import { + Chamber, + ChambersListNextOptionalParams, + ChambersListOptionalParams, + ChambersListResponse, + ChambersGetUploadUriOptionalParams, + ChambersGetUploadUriResponse, + ChambersStartOptionalParams, + ChambersStopOptionalParams, + ChambersRestartOptionalParams, + ChambersLicenseUpdateOptionalParams, + ChambersLicenseRestartOptionalParams, + ChambersCreateOrUpdateOptionalParams, + ChambersCreateOrUpdateResponse, + ChambersUpdateOptionalParams, + ChambersUpdateResponse, + ChambersGetOptionalParams, + ChambersGetResponse, + ChambersDeleteOptionalParams, + ChambersDeleteResponse, + ChambersListNextResponse +} from "../models"; + +/// +/** Class containing Chambers operations. */ +export class ChambersImpl implements Chambers { + private readonly client: MicrosoftModSimWorkbench; + + /** + * Initialize a new instance of the class Chambers class. + * @param client Reference to the service client + */ + constructor(client: MicrosoftModSimWorkbench) { + this.client = client; + } + + /** + * Lists all Chambers. + * @param resourceGroup The name of the resource group. + * @param workbenchName The name of the workbench. + * @param options The options parameters. + */ + public list( + resourceGroup: string, + workbenchName: string, + options?: ChambersListOptionalParams + ): PagedAsyncIterableIterator { + const iter = this.listPagingAll(resourceGroup, workbenchName, options); + return { + next() { + return iter.next(); + }, + [Symbol.asyncIterator]() { + return this; + }, + byPage: (settings?: PageSettings) => { + if (settings?.maxPageSize) { + throw new Error("maxPageSize is not supported by this operation."); + } + return this.listPagingPage( + resourceGroup, + workbenchName, + options, + settings + ); + } + }; + } + + private async *listPagingPage( + resourceGroup: string, + workbenchName: string, + options?: ChambersListOptionalParams, + settings?: PageSettings + ): AsyncIterableIterator { + let result: ChambersListResponse; + let continuationToken = settings?.continuationToken; + if (!continuationToken) { + result = await this._list(resourceGroup, workbenchName, options); + let page = result.value || []; + continuationToken = result.nextLink; + setContinuationToken(page, continuationToken); + yield page; + } + while (continuationToken) { + result = await this._listNext( + resourceGroup, + workbenchName, + continuationToken, + options + ); + continuationToken = result.nextLink; + let page = result.value || []; + setContinuationToken(page, continuationToken); + yield page; + } + } + + private async *listPagingAll( + resourceGroup: string, + workbenchName: string, + options?: ChambersListOptionalParams + ): AsyncIterableIterator { + for await (const page of this.listPagingPage( + resourceGroup, + workbenchName, + options + )) { + yield* page; + } + } + + /** + * Gets a URI to upload files to the specified Chamber resource. + * @param resourceGroup the resource group. + * @param workbenchName the workbench name. + * @param name the chamber name. + * @param options The options parameters. + */ + getUploadUri( + resourceGroup: string, + workbenchName: string, + name: string, + options?: ChambersGetUploadUriOptionalParams + ): Promise { + return this.client.sendOperationRequest( + { resourceGroup, workbenchName, name, options }, + getUploadUriOperationSpec + ); + } + + /** + * Perform Start operation. + * @param resourceGroup the resource group. + * @param workbenchName the workbench name. + * @param name the chamber name. + * @param options The options parameters. + */ + async beginStart( + resourceGroup: string, + workbenchName: string, + name: string, + options?: ChambersStartOptionalParams + ): Promise, void>> { + const directSendOperation = async ( + args: coreClient.OperationArguments, + spec: coreClient.OperationSpec + ): Promise => { + return this.client.sendOperationRequest(args, spec); + }; + const sendOperationFn = 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 = createLroSpec({ + sendOperationFn, + args: { resourceGroup, workbenchName, name, options }, + spec: startOperationSpec + }); + const poller = await createHttpPoller>(lro, { + restoreFrom: options?.resumeFrom, + intervalInMs: options?.updateIntervalInMs, + resourceLocationConfig: "location" + }); + await poller.poll(); + return poller; + } + + /** + * Perform Start operation. + * @param resourceGroup the resource group. + * @param workbenchName the workbench name. + * @param name the chamber name. + * @param options The options parameters. + */ + async beginStartAndWait( + resourceGroup: string, + workbenchName: string, + name: string, + options?: ChambersStartOptionalParams + ): Promise { + const poller = await this.beginStart( + resourceGroup, + workbenchName, + name, + options + ); + return poller.pollUntilDone(); + } + + /** + * Perform Stop operation. + * @param resourceGroup the resource group. + * @param workbenchName the workbench name. + * @param name the chamber name. + * @param options The options parameters. + */ + async beginStop( + resourceGroup: string, + workbenchName: string, + name: string, + options?: ChambersStopOptionalParams + ): Promise, void>> { + const directSendOperation = async ( + args: coreClient.OperationArguments, + spec: coreClient.OperationSpec + ): Promise => { + return this.client.sendOperationRequest(args, spec); + }; + const sendOperationFn = 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 = createLroSpec({ + sendOperationFn, + args: { resourceGroup, workbenchName, name, options }, + spec: stopOperationSpec + }); + const poller = await createHttpPoller>(lro, { + restoreFrom: options?.resumeFrom, + intervalInMs: options?.updateIntervalInMs, + resourceLocationConfig: "location" + }); + await poller.poll(); + return poller; + } + + /** + * Perform Stop operation. + * @param resourceGroup the resource group. + * @param workbenchName the workbench name. + * @param name the chamber name. + * @param options The options parameters. + */ + async beginStopAndWait( + resourceGroup: string, + workbenchName: string, + name: string, + options?: ChambersStopOptionalParams + ): Promise { + const poller = await this.beginStop( + resourceGroup, + workbenchName, + name, + options + ); + return poller.pollUntilDone(); + } + + /** + * Perform Restart operation. + * @param resourceGroup the resource group. + * @param workbenchName the workbench name. + * @param name the chamber name. + * @param options The options parameters. + */ + async beginRestart( + resourceGroup: string, + workbenchName: string, + name: string, + options?: ChambersRestartOptionalParams + ): Promise, void>> { + const directSendOperation = async ( + args: coreClient.OperationArguments, + spec: coreClient.OperationSpec + ): Promise => { + return this.client.sendOperationRequest(args, spec); + }; + const sendOperationFn = 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 = createLroSpec({ + sendOperationFn, + args: { resourceGroup, workbenchName, name, options }, + spec: restartOperationSpec + }); + const poller = await createHttpPoller>(lro, { + restoreFrom: options?.resumeFrom, + intervalInMs: options?.updateIntervalInMs, + resourceLocationConfig: "location" + }); + await poller.poll(); + return poller; + } + + /** + * Perform Restart operation. + * @param resourceGroup the resource group. + * @param workbenchName the workbench name. + * @param name the chamber name. + * @param options The options parameters. + */ + async beginRestartAndWait( + resourceGroup: string, + workbenchName: string, + name: string, + options?: ChambersRestartOptionalParams + ): Promise { + const poller = await this.beginRestart( + resourceGroup, + workbenchName, + name, + options + ); + return poller.pollUntilDone(); + } + + /** + * Perform Update LicenseServices operation. + * @param resourceGroup the resource group. + * @param workbenchName the workbench name. + * @param name the chamber name. + * @param options The options parameters. + */ + async beginLicenseUpdate( + resourceGroup: string, + workbenchName: string, + name: string, + options?: ChambersLicenseUpdateOptionalParams + ): Promise, void>> { + const directSendOperation = async ( + args: coreClient.OperationArguments, + spec: coreClient.OperationSpec + ): Promise => { + return this.client.sendOperationRequest(args, spec); + }; + const sendOperationFn = 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 = createLroSpec({ + sendOperationFn, + args: { resourceGroup, workbenchName, name, options }, + spec: licenseUpdateOperationSpec + }); + const poller = await createHttpPoller>(lro, { + restoreFrom: options?.resumeFrom, + intervalInMs: options?.updateIntervalInMs, + resourceLocationConfig: "location" + }); + await poller.poll(); + return poller; + } + + /** + * Perform Update LicenseServices operation. + * @param resourceGroup the resource group. + * @param workbenchName the workbench name. + * @param name the chamber name. + * @param options The options parameters. + */ + async beginLicenseUpdateAndWait( + resourceGroup: string, + workbenchName: string, + name: string, + options?: ChambersLicenseUpdateOptionalParams + ): Promise { + const poller = await this.beginLicenseUpdate( + resourceGroup, + workbenchName, + name, + options + ); + return poller.pollUntilDone(); + } + + /** + * Perform License Restart operation. + * @param resourceGroup the resource group. + * @param workbenchName the workbench name. + * @param name the chamber name. + * @param options The options parameters. + */ + async beginLicenseRestart( + resourceGroup: string, + workbenchName: string, + name: string, + options?: ChambersLicenseRestartOptionalParams + ): Promise, void>> { + const directSendOperation = async ( + args: coreClient.OperationArguments, + spec: coreClient.OperationSpec + ): Promise => { + return this.client.sendOperationRequest(args, spec); + }; + const sendOperationFn = 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 = createLroSpec({ + sendOperationFn, + args: { resourceGroup, workbenchName, name, options }, + spec: licenseRestartOperationSpec + }); + const poller = await createHttpPoller>(lro, { + restoreFrom: options?.resumeFrom, + intervalInMs: options?.updateIntervalInMs, + resourceLocationConfig: "location" + }); + await poller.poll(); + return poller; + } + + /** + * Perform License Restart operation. + * @param resourceGroup the resource group. + * @param workbenchName the workbench name. + * @param name the chamber name. + * @param options The options parameters. + */ + async beginLicenseRestartAndWait( + resourceGroup: string, + workbenchName: string, + name: string, + options?: ChambersLicenseRestartOptionalParams + ): Promise { + const poller = await this.beginLicenseRestart( + resourceGroup, + workbenchName, + name, + options + ); + return poller.pollUntilDone(); + } + + /** + * Creates or updates the specified Chamber. + * @param resourceGroup The name of the resource group. + * @param workbenchName The name of the workbench. + * @param chamberName The name of the chamber. + * @param options The options parameters. + */ + async beginCreateOrUpdate( + resourceGroup: string, + workbenchName: string, + chamberName: string, + options?: ChambersCreateOrUpdateOptionalParams + ): Promise< + SimplePollerLike< + OperationState, + ChambersCreateOrUpdateResponse + > + > { + const directSendOperation = async ( + args: coreClient.OperationArguments, + spec: coreClient.OperationSpec + ): Promise => { + return this.client.sendOperationRequest(args, spec); + }; + const sendOperationFn = 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 = createLroSpec({ + sendOperationFn, + args: { resourceGroup, workbenchName, chamberName, options }, + spec: createOrUpdateOperationSpec + }); + const poller = await createHttpPoller< + ChambersCreateOrUpdateResponse, + OperationState + >(lro, { + restoreFrom: options?.resumeFrom, + intervalInMs: options?.updateIntervalInMs, + resourceLocationConfig: "azure-async-operation" + }); + await poller.poll(); + return poller; + } + + /** + * Creates or updates the specified Chamber. + * @param resourceGroup The name of the resource group. + * @param workbenchName The name of the workbench. + * @param chamberName The name of the chamber. + * @param options The options parameters. + */ + async beginCreateOrUpdateAndWait( + resourceGroup: string, + workbenchName: string, + chamberName: string, + options?: ChambersCreateOrUpdateOptionalParams + ): Promise { + const poller = await this.beginCreateOrUpdate( + resourceGroup, + workbenchName, + chamberName, + options + ); + return poller.pollUntilDone(); + } + + /** + * Updates the specified Chamber. + * @param resourceGroup The name of the resource group. + * @param workbenchName The name of the workbench. + * @param chamberName The name of the chamber. + * @param options The options parameters. + */ + update( + resourceGroup: string, + workbenchName: string, + chamberName: string, + options?: ChambersUpdateOptionalParams + ): Promise { + return this.client.sendOperationRequest( + { resourceGroup, workbenchName, chamberName, options }, + updateOperationSpec + ); + } + + /** + * Gets information about the specified Chamber. + * @param resourceGroup The name of the resource group. + * @param workbenchName The name of the workbench. + * @param chamberName The name of the chamber. + * @param options The options parameters. + */ + get( + resourceGroup: string, + workbenchName: string, + chamberName: string, + options?: ChambersGetOptionalParams + ): Promise { + return this.client.sendOperationRequest( + { resourceGroup, workbenchName, chamberName, options }, + getOperationSpec + ); + } + + /** + * Deletes the specified Chamber. + * @param resourceGroup The name of the resource group. + * @param workbenchName The name of the workbench. + * @param chamberName The name of the chamber. + * @param options The options parameters. + */ + async beginDelete( + resourceGroup: string, + workbenchName: string, + chamberName: string, + options?: ChambersDeleteOptionalParams + ): Promise< + SimplePollerLike< + OperationState, + ChambersDeleteResponse + > + > { + const directSendOperation = async ( + args: coreClient.OperationArguments, + spec: coreClient.OperationSpec + ): Promise => { + return this.client.sendOperationRequest(args, spec); + }; + const sendOperationFn = 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 = createLroSpec({ + sendOperationFn, + args: { resourceGroup, workbenchName, chamberName, options }, + spec: deleteOperationSpec + }); + const poller = await createHttpPoller< + ChambersDeleteResponse, + OperationState + >(lro, { + restoreFrom: options?.resumeFrom, + intervalInMs: options?.updateIntervalInMs, + resourceLocationConfig: "location" + }); + await poller.poll(); + return poller; + } + + /** + * Deletes the specified Chamber. + * @param resourceGroup The name of the resource group. + * @param workbenchName The name of the workbench. + * @param chamberName The name of the chamber. + * @param options The options parameters. + */ + async beginDeleteAndWait( + resourceGroup: string, + workbenchName: string, + chamberName: string, + options?: ChambersDeleteOptionalParams + ): Promise { + const poller = await this.beginDelete( + resourceGroup, + workbenchName, + chamberName, + options + ); + return poller.pollUntilDone(); + } + + /** + * Lists all Chambers. + * @param resourceGroup The name of the resource group. + * @param workbenchName The name of the workbench. + * @param options The options parameters. + */ + private _list( + resourceGroup: string, + workbenchName: string, + options?: ChambersListOptionalParams + ): Promise { + return this.client.sendOperationRequest( + { resourceGroup, workbenchName, options }, + listOperationSpec + ); + } + + /** + * ListNext + * @param resourceGroup The name of the resource group. + * @param workbenchName The name of the workbench. + * @param nextLink The nextLink from the previous successful call to the List method. + * @param options The options parameters. + */ + private _listNext( + resourceGroup: string, + workbenchName: string, + nextLink: string, + options?: ChambersListNextOptionalParams + ): Promise { + return this.client.sendOperationRequest( + { resourceGroup, workbenchName, nextLink, options }, + listNextOperationSpec + ); + } +} +// Operation Specifications +const serializer = coreClient.createSerializer(Mappers, /* isXml */ false); + +const getUploadUriOperationSpec: coreClient.OperationSpec = { + path: + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroup}/providers/Microsoft.ModSimWorkbench/workbenches/{workbenchName}/chambers/{name}/getUploadUri", + httpMethod: "POST", + responses: { + 200: { + bodyMapper: Mappers.GetUploadUri + }, + default: { + bodyMapper: Mappers.ErrorResponse + } + }, + requestBody: Parameters.body2, + queryParameters: [Parameters.apiVersion], + urlParameters: [ + Parameters.$host, + Parameters.subscriptionId, + Parameters.resourceGroup, + Parameters.name, + Parameters.workbenchName + ], + headerParameters: [Parameters.accept, Parameters.contentType], + mediaType: "json", + serializer +}; +const startOperationSpec: coreClient.OperationSpec = { + path: + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroup}/providers/Microsoft.ModSimWorkbench/workbenches/{workbenchName}/chambers/{name}/start", + httpMethod: "POST", + responses: { + 200: {}, + 201: {}, + 202: {}, + 204: {}, + default: { + bodyMapper: Mappers.ErrorResponse + } + }, + queryParameters: [Parameters.apiVersion], + urlParameters: [ + Parameters.$host, + Parameters.subscriptionId, + Parameters.resourceGroup, + Parameters.name, + Parameters.workbenchName + ], + headerParameters: [Parameters.accept], + serializer +}; +const stopOperationSpec: coreClient.OperationSpec = { + path: + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroup}/providers/Microsoft.ModSimWorkbench/workbenches/{workbenchName}/chambers/{name}/stop", + httpMethod: "POST", + responses: { + 200: {}, + 201: {}, + 202: {}, + 204: {}, + default: { + bodyMapper: Mappers.ErrorResponse + } + }, + queryParameters: [Parameters.apiVersion], + urlParameters: [ + Parameters.$host, + Parameters.subscriptionId, + Parameters.resourceGroup, + Parameters.name, + Parameters.workbenchName + ], + headerParameters: [Parameters.accept], + serializer +}; +const restartOperationSpec: coreClient.OperationSpec = { + path: + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroup}/providers/Microsoft.ModSimWorkbench/workbenches/{workbenchName}/chambers/{name}/restart", + httpMethod: "POST", + responses: { + 200: {}, + 201: {}, + 202: {}, + 204: {}, + default: { + bodyMapper: Mappers.ErrorResponse + } + }, + queryParameters: [Parameters.apiVersion], + urlParameters: [ + Parameters.$host, + Parameters.subscriptionId, + Parameters.resourceGroup, + Parameters.name, + Parameters.workbenchName + ], + headerParameters: [Parameters.accept], + serializer +}; +const licenseUpdateOperationSpec: coreClient.OperationSpec = { + path: + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroup}/providers/Microsoft.ModSimWorkbench/workbenches/{workbenchName}/chambers/{name}/licenseUpdate", + httpMethod: "POST", + responses: { + 200: {}, + 201: {}, + 202: {}, + 204: {}, + default: { + bodyMapper: Mappers.ErrorResponse + } + }, + requestBody: Parameters.body3, + queryParameters: [Parameters.apiVersion], + urlParameters: [ + Parameters.$host, + Parameters.subscriptionId, + Parameters.resourceGroup, + Parameters.name, + Parameters.workbenchName + ], + headerParameters: [Parameters.accept, Parameters.contentType], + mediaType: "json", + serializer +}; +const licenseRestartOperationSpec: coreClient.OperationSpec = { + path: + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroup}/providers/Microsoft.ModSimWorkbench/workbenches/{workbenchName}/chambers/{name}/licenseRestart", + httpMethod: "POST", + responses: { + 200: {}, + 201: {}, + 202: {}, + 204: {}, + default: { + bodyMapper: Mappers.ErrorResponse + } + }, + requestBody: Parameters.body4, + queryParameters: [Parameters.apiVersion], + urlParameters: [ + Parameters.$host, + Parameters.subscriptionId, + Parameters.resourceGroup, + Parameters.name, + Parameters.workbenchName + ], + headerParameters: [Parameters.accept, Parameters.contentType], + mediaType: "json", + serializer +}; +const createOrUpdateOperationSpec: coreClient.OperationSpec = { + path: + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroup}/providers/Microsoft.ModSimWorkbench/workbenches/{workbenchName}/chambers/{chamberName}", + httpMethod: "PUT", + responses: { + 200: { + bodyMapper: Mappers.Chamber + }, + 201: { + bodyMapper: Mappers.Chamber + }, + 202: { + bodyMapper: Mappers.Chamber + }, + 204: { + bodyMapper: Mappers.Chamber + }, + default: { + bodyMapper: Mappers.ErrorResponse + } + }, + requestBody: Parameters.parameters1, + queryParameters: [Parameters.apiVersion], + urlParameters: [ + Parameters.$host, + Parameters.subscriptionId, + Parameters.resourceGroup, + Parameters.workbenchName, + Parameters.chamberName + ], + headerParameters: [Parameters.accept, Parameters.contentType], + mediaType: "json", + serializer +}; +const updateOperationSpec: coreClient.OperationSpec = { + path: + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroup}/providers/Microsoft.ModSimWorkbench/workbenches/{workbenchName}/chambers/{chamberName}", + httpMethod: "PATCH", + responses: { + 200: { + bodyMapper: Mappers.Chamber + }, + 201: { + bodyMapper: Mappers.Chamber + }, + default: { + bodyMapper: Mappers.ErrorResponse + } + }, + requestBody: Parameters.parameters1, + queryParameters: [Parameters.apiVersion], + urlParameters: [ + Parameters.$host, + Parameters.subscriptionId, + Parameters.resourceGroup, + Parameters.workbenchName, + Parameters.chamberName + ], + headerParameters: [Parameters.accept, Parameters.contentType1], + mediaType: "json", + serializer +}; +const getOperationSpec: coreClient.OperationSpec = { + path: + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroup}/providers/Microsoft.ModSimWorkbench/workbenches/{workbenchName}/chambers/{chamberName}", + httpMethod: "GET", + responses: { + 200: { + bodyMapper: Mappers.Chamber + }, + default: { + bodyMapper: Mappers.ErrorResponse + } + }, + queryParameters: [Parameters.apiVersion], + urlParameters: [ + Parameters.$host, + Parameters.subscriptionId, + Parameters.resourceGroup, + Parameters.workbenchName, + Parameters.chamberName + ], + headerParameters: [Parameters.accept], + serializer +}; +const deleteOperationSpec: coreClient.OperationSpec = { + path: + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroup}/providers/Microsoft.ModSimWorkbench/workbenches/{workbenchName}/chambers/{chamberName}", + httpMethod: "DELETE", + responses: { + 200: { + bodyMapper: Mappers.Chamber + }, + 201: { + bodyMapper: Mappers.Chamber + }, + 202: { + bodyMapper: Mappers.Chamber + }, + 204: { + bodyMapper: Mappers.Chamber + }, + default: { + bodyMapper: Mappers.ErrorResponse + } + }, + queryParameters: [Parameters.apiVersion], + urlParameters: [ + Parameters.$host, + Parameters.subscriptionId, + Parameters.resourceGroup, + Parameters.workbenchName, + Parameters.chamberName + ], + headerParameters: [Parameters.accept], + serializer +}; +const listOperationSpec: coreClient.OperationSpec = { + path: + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroup}/providers/Microsoft.ModSimWorkbench/workbenches/{workbenchName}/chambers", + httpMethod: "GET", + responses: { + 200: { + bodyMapper: Mappers.ChamberPageableList + }, + default: { + bodyMapper: Mappers.ErrorResponse + } + }, + queryParameters: [Parameters.apiVersion], + urlParameters: [ + Parameters.$host, + Parameters.subscriptionId, + Parameters.resourceGroup, + Parameters.workbenchName + ], + headerParameters: [Parameters.accept], + serializer +}; +const listNextOperationSpec: coreClient.OperationSpec = { + path: "{nextLink}", + httpMethod: "GET", + responses: { + 200: { + bodyMapper: Mappers.ChamberPageableList + }, + default: { + bodyMapper: Mappers.ErrorResponse + } + }, + urlParameters: [ + Parameters.$host, + Parameters.subscriptionId, + Parameters.resourceGroup, + Parameters.nextLink, + Parameters.workbenchName + ], + headerParameters: [Parameters.accept], + serializer +}; diff --git a/sdk/modsimworkbench/arm-modsimworkbench/src/operations/connectors.ts b/sdk/modsimworkbench/arm-modsimworkbench/src/operations/connectors.ts new file mode 100644 index 000000000000..208212217be8 --- /dev/null +++ b/sdk/modsimworkbench/arm-modsimworkbench/src/operations/connectors.ts @@ -0,0 +1,1092 @@ +/* + * 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, PageSettings } from "@azure/core-paging"; +import { setContinuationToken } from "../pagingHelper"; +import { Connectors } from "../operationsInterfaces"; +import * as coreClient from "@azure/core-client"; +import * as Mappers from "../models/mappers"; +import * as Parameters from "../models/parameters"; +import { MicrosoftModSimWorkbench } from "../microsoftModSimWorkbench"; +import { + SimplePollerLike, + OperationState, + createHttpPoller +} from "@azure/core-lro"; +import { createLroSpec } from "../lroImpl"; +import { + Connector, + ConnectorsListNextOptionalParams, + ConnectorsListOptionalParams, + ConnectorsListResponse, + ConnectorsStartOptionalParams, + ConnectorsStopOptionalParams, + ConnectorsRestartOptionalParams, + ConnectorsCreateOrUpdateOptionalParams, + ConnectorsCreateOrUpdateResponse, + ConnectorsUpdateOptionalParams, + ConnectorsUpdateResponse, + ConnectorsGetOptionalParams, + ConnectorsGetResponse, + ConnectorsDeleteOptionalParams, + ConnectorsDeleteResponse, + LicenseKeyParameters, + ConnectorsLicenseAddOptionalParams, + ConnectorsListNextResponse +} from "../models"; + +/// +/** Class containing Connectors operations. */ +export class ConnectorsImpl implements Connectors { + private readonly client: MicrosoftModSimWorkbench; + + /** + * Initialize a new instance of the class Connectors class. + * @param client Reference to the service client + */ + constructor(client: MicrosoftModSimWorkbench) { + this.client = client; + } + + /** + * Lists all connectors. + * @param resourceGroup The name of the resource group. + * @param workbenchName The name of the workbench. + * @param chamberName The name of the chamber. + * @param options The options parameters. + */ + public list( + resourceGroup: string, + workbenchName: string, + chamberName: string, + options?: ConnectorsListOptionalParams + ): PagedAsyncIterableIterator { + const iter = this.listPagingAll( + resourceGroup, + workbenchName, + chamberName, + options + ); + return { + next() { + return iter.next(); + }, + [Symbol.asyncIterator]() { + return this; + }, + byPage: (settings?: PageSettings) => { + if (settings?.maxPageSize) { + throw new Error("maxPageSize is not supported by this operation."); + } + return this.listPagingPage( + resourceGroup, + workbenchName, + chamberName, + options, + settings + ); + } + }; + } + + private async *listPagingPage( + resourceGroup: string, + workbenchName: string, + chamberName: string, + options?: ConnectorsListOptionalParams, + settings?: PageSettings + ): AsyncIterableIterator { + let result: ConnectorsListResponse; + let continuationToken = settings?.continuationToken; + if (!continuationToken) { + result = await this._list( + resourceGroup, + workbenchName, + chamberName, + options + ); + let page = result.value || []; + continuationToken = result.nextLink; + setContinuationToken(page, continuationToken); + yield page; + } + while (continuationToken) { + result = await this._listNext( + resourceGroup, + workbenchName, + chamberName, + continuationToken, + options + ); + continuationToken = result.nextLink; + let page = result.value || []; + setContinuationToken(page, continuationToken); + yield page; + } + } + + private async *listPagingAll( + resourceGroup: string, + workbenchName: string, + chamberName: string, + options?: ConnectorsListOptionalParams + ): AsyncIterableIterator { + for await (const page of this.listPagingPage( + resourceGroup, + workbenchName, + chamberName, + options + )) { + yield* page; + } + } + + /** + * Perform Start operation. + * @param resourceGroup Name of the resource group + * @param workbenchName Name of the workbench + * @param chamberName the chamber name. + * @param name Name of the connector + * @param options The options parameters. + */ + async beginStart( + resourceGroup: string, + workbenchName: string, + chamberName: string, + name: string, + options?: ConnectorsStartOptionalParams + ): Promise, void>> { + const directSendOperation = async ( + args: coreClient.OperationArguments, + spec: coreClient.OperationSpec + ): Promise => { + return this.client.sendOperationRequest(args, spec); + }; + const sendOperationFn = 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 = createLroSpec({ + sendOperationFn, + args: { resourceGroup, workbenchName, chamberName, name, options }, + spec: startOperationSpec + }); + const poller = await createHttpPoller>(lro, { + restoreFrom: options?.resumeFrom, + intervalInMs: options?.updateIntervalInMs, + resourceLocationConfig: "location" + }); + await poller.poll(); + return poller; + } + + /** + * Perform Start operation. + * @param resourceGroup Name of the resource group + * @param workbenchName Name of the workbench + * @param chamberName the chamber name. + * @param name Name of the connector + * @param options The options parameters. + */ + async beginStartAndWait( + resourceGroup: string, + workbenchName: string, + chamberName: string, + name: string, + options?: ConnectorsStartOptionalParams + ): Promise { + const poller = await this.beginStart( + resourceGroup, + workbenchName, + chamberName, + name, + options + ); + return poller.pollUntilDone(); + } + + /** + * Perform Stop operation. + * @param resourceGroup the resource group. + * @param workbenchName the workbench name. + * @param chamberName the chamber name. + * @param name the connector name. + * @param options The options parameters. + */ + async beginStop( + resourceGroup: string, + workbenchName: string, + chamberName: string, + name: string, + options?: ConnectorsStopOptionalParams + ): Promise, void>> { + const directSendOperation = async ( + args: coreClient.OperationArguments, + spec: coreClient.OperationSpec + ): Promise => { + return this.client.sendOperationRequest(args, spec); + }; + const sendOperationFn = 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 = createLroSpec({ + sendOperationFn, + args: { resourceGroup, workbenchName, chamberName, name, options }, + spec: stopOperationSpec + }); + const poller = await createHttpPoller>(lro, { + restoreFrom: options?.resumeFrom, + intervalInMs: options?.updateIntervalInMs, + resourceLocationConfig: "location" + }); + await poller.poll(); + return poller; + } + + /** + * Perform Stop operation. + * @param resourceGroup the resource group. + * @param workbenchName the workbench name. + * @param chamberName the chamber name. + * @param name the connector name. + * @param options The options parameters. + */ + async beginStopAndWait( + resourceGroup: string, + workbenchName: string, + chamberName: string, + name: string, + options?: ConnectorsStopOptionalParams + ): Promise { + const poller = await this.beginStop( + resourceGroup, + workbenchName, + chamberName, + name, + options + ); + return poller.pollUntilDone(); + } + + /** + * Perform Restart operation. + * @param resourceGroup the resource group. + * @param workbenchName the workbench name. + * @param chamberName the chamber name. + * @param name the connector name. + * @param options The options parameters. + */ + async beginRestart( + resourceGroup: string, + workbenchName: string, + chamberName: string, + name: string, + options?: ConnectorsRestartOptionalParams + ): Promise, void>> { + const directSendOperation = async ( + args: coreClient.OperationArguments, + spec: coreClient.OperationSpec + ): Promise => { + return this.client.sendOperationRequest(args, spec); + }; + const sendOperationFn = 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 = createLroSpec({ + sendOperationFn, + args: { resourceGroup, workbenchName, chamberName, name, options }, + spec: restartOperationSpec + }); + const poller = await createHttpPoller>(lro, { + restoreFrom: options?.resumeFrom, + intervalInMs: options?.updateIntervalInMs, + resourceLocationConfig: "location" + }); + await poller.poll(); + return poller; + } + + /** + * Perform Restart operation. + * @param resourceGroup the resource group. + * @param workbenchName the workbench name. + * @param chamberName the chamber name. + * @param name the connector name. + * @param options The options parameters. + */ + async beginRestartAndWait( + resourceGroup: string, + workbenchName: string, + chamberName: string, + name: string, + options?: ConnectorsRestartOptionalParams + ): Promise { + const poller = await this.beginRestart( + resourceGroup, + workbenchName, + chamberName, + name, + options + ); + return poller.pollUntilDone(); + } + + /** + * Creates or updates the specified connector. + * @param resourceGroup The name of the resource group. + * @param workbenchName The name of the workbench. + * @param chamberName The name of the chamber. + * @param connectorName The name of the connector. + * @param options The options parameters. + */ + async beginCreateOrUpdate( + resourceGroup: string, + workbenchName: string, + chamberName: string, + connectorName: string, + options?: ConnectorsCreateOrUpdateOptionalParams + ): Promise< + SimplePollerLike< + OperationState, + ConnectorsCreateOrUpdateResponse + > + > { + const directSendOperation = async ( + args: coreClient.OperationArguments, + spec: coreClient.OperationSpec + ): Promise => { + return this.client.sendOperationRequest(args, spec); + }; + const sendOperationFn = 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 = createLroSpec({ + sendOperationFn, + args: { + resourceGroup, + workbenchName, + chamberName, + connectorName, + options + }, + spec: createOrUpdateOperationSpec + }); + const poller = await createHttpPoller< + ConnectorsCreateOrUpdateResponse, + OperationState + >(lro, { + restoreFrom: options?.resumeFrom, + intervalInMs: options?.updateIntervalInMs, + resourceLocationConfig: "azure-async-operation" + }); + await poller.poll(); + return poller; + } + + /** + * Creates or updates the specified connector. + * @param resourceGroup The name of the resource group. + * @param workbenchName The name of the workbench. + * @param chamberName The name of the chamber. + * @param connectorName The name of the connector. + * @param options The options parameters. + */ + async beginCreateOrUpdateAndWait( + resourceGroup: string, + workbenchName: string, + chamberName: string, + connectorName: string, + options?: ConnectorsCreateOrUpdateOptionalParams + ): Promise { + const poller = await this.beginCreateOrUpdate( + resourceGroup, + workbenchName, + chamberName, + connectorName, + options + ); + return poller.pollUntilDone(); + } + + /** + * Updates the specified connectors. + * @param resourceGroup The name of the resource group. + * @param workbenchName The name of the workbench. + * @param chamberName The name of the chamber. + * @param connectorName The name of the connector. + * @param options The options parameters. + */ + update( + resourceGroup: string, + workbenchName: string, + chamberName: string, + connectorName: string, + options?: ConnectorsUpdateOptionalParams + ): Promise { + return this.client.sendOperationRequest( + { resourceGroup, workbenchName, chamberName, connectorName, options }, + updateOperationSpec + ); + } + + /** + * Gets information about the specified connector. + * @param resourceGroup The name of the resource group. + * @param workbenchName The name of the workbench. + * @param chamberName The name of the chamber. + * @param connectorName The name of the connector. + * @param options The options parameters. + */ + get( + resourceGroup: string, + workbenchName: string, + chamberName: string, + connectorName: string, + options?: ConnectorsGetOptionalParams + ): Promise { + return this.client.sendOperationRequest( + { resourceGroup, workbenchName, chamberName, connectorName, options }, + getOperationSpec + ); + } + + /** + * Deletes the specified connector. + * @param resourceGroup The name of the resource group. + * @param workbenchName The name of the workbench. + * @param chamberName The name of the chamber. + * @param connectorName The name of the connector. + * @param options The options parameters. + */ + async beginDelete( + resourceGroup: string, + workbenchName: string, + chamberName: string, + connectorName: string, + options?: ConnectorsDeleteOptionalParams + ): Promise< + SimplePollerLike< + OperationState, + ConnectorsDeleteResponse + > + > { + const directSendOperation = async ( + args: coreClient.OperationArguments, + spec: coreClient.OperationSpec + ): Promise => { + return this.client.sendOperationRequest(args, spec); + }; + const sendOperationFn = 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 = createLroSpec({ + sendOperationFn, + args: { + resourceGroup, + workbenchName, + chamberName, + connectorName, + options + }, + spec: deleteOperationSpec + }); + const poller = await createHttpPoller< + ConnectorsDeleteResponse, + OperationState + >(lro, { + restoreFrom: options?.resumeFrom, + intervalInMs: options?.updateIntervalInMs, + resourceLocationConfig: "location" + }); + await poller.poll(); + return poller; + } + + /** + * Deletes the specified connector. + * @param resourceGroup The name of the resource group. + * @param workbenchName The name of the workbench. + * @param chamberName The name of the chamber. + * @param connectorName The name of the connector. + * @param options The options parameters. + */ + async beginDeleteAndWait( + resourceGroup: string, + workbenchName: string, + chamberName: string, + connectorName: string, + options?: ConnectorsDeleteOptionalParams + ): Promise { + const poller = await this.beginDelete( + resourceGroup, + workbenchName, + chamberName, + connectorName, + options + ); + return poller.pollUntilDone(); + } + + /** + * Lists all connectors. + * @param resourceGroup The name of the resource group. + * @param workbenchName The name of the workbench. + * @param chamberName The name of the chamber. + * @param options The options parameters. + */ + private _list( + resourceGroup: string, + workbenchName: string, + chamberName: string, + options?: ConnectorsListOptionalParams + ): Promise { + return this.client.sendOperationRequest( + { resourceGroup, workbenchName, chamberName, options }, + listOperationSpec + ); + } + + /** + * Add license to an ModSim Workbench connector. + * @param resourceGroup The name of the resource group + * @param workbenchName The name of the workbench + * @param chamberName The name of the chamber. + * @param name The name of the connector. + * @param body License key parameters + * @param options The options parameters. + */ + async beginLicenseAdd( + resourceGroup: string, + workbenchName: string, + chamberName: string, + name: string, + body: LicenseKeyParameters, + options?: ConnectorsLicenseAddOptionalParams + ): Promise, void>> { + const directSendOperation = async ( + args: coreClient.OperationArguments, + spec: coreClient.OperationSpec + ): Promise => { + return this.client.sendOperationRequest(args, spec); + }; + const sendOperationFn = 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 = createLroSpec({ + sendOperationFn, + args: { resourceGroup, workbenchName, chamberName, name, body, options }, + spec: licenseAddOperationSpec + }); + const poller = await createHttpPoller>(lro, { + restoreFrom: options?.resumeFrom, + intervalInMs: options?.updateIntervalInMs, + resourceLocationConfig: "location" + }); + await poller.poll(); + return poller; + } + + /** + * Add license to an ModSim Workbench connector. + * @param resourceGroup The name of the resource group + * @param workbenchName The name of the workbench + * @param chamberName The name of the chamber. + * @param name The name of the connector. + * @param body License key parameters + * @param options The options parameters. + */ + async beginLicenseAddAndWait( + resourceGroup: string, + workbenchName: string, + chamberName: string, + name: string, + body: LicenseKeyParameters, + options?: ConnectorsLicenseAddOptionalParams + ): Promise { + const poller = await this.beginLicenseAdd( + resourceGroup, + workbenchName, + chamberName, + name, + body, + options + ); + return poller.pollUntilDone(); + } + + /** + * ListNext + * @param resourceGroup The name of the resource group. + * @param workbenchName The name of the workbench. + * @param chamberName The name of the chamber. + * @param nextLink The nextLink from the previous successful call to the List method. + * @param options The options parameters. + */ + private _listNext( + resourceGroup: string, + workbenchName: string, + chamberName: string, + nextLink: string, + options?: ConnectorsListNextOptionalParams + ): Promise { + return this.client.sendOperationRequest( + { resourceGroup, workbenchName, chamberName, nextLink, options }, + listNextOperationSpec + ); + } +} +// Operation Specifications +const serializer = coreClient.createSerializer(Mappers, /* isXml */ false); + +const startOperationSpec: coreClient.OperationSpec = { + path: + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroup}/providers/Microsoft.ModSimWorkbench/workbenches/{workbenchName}/chambers/{chamberName}/connectors/{name}/start", + httpMethod: "POST", + responses: { + 200: {}, + 201: {}, + 202: {}, + 204: {}, + default: { + bodyMapper: Mappers.ErrorResponse + } + }, + queryParameters: [Parameters.apiVersion], + urlParameters: [ + Parameters.$host, + Parameters.subscriptionId, + Parameters.resourceGroup, + Parameters.name, + Parameters.workbenchName, + Parameters.chamberName + ], + headerParameters: [Parameters.accept], + serializer +}; +const stopOperationSpec: coreClient.OperationSpec = { + path: + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroup}/providers/Microsoft.ModSimWorkbench/workbenches/{workbenchName}/chambers/{chamberName}/connectors/{name}/stop", + httpMethod: "POST", + responses: { + 200: {}, + 201: {}, + 202: {}, + 204: {}, + default: { + bodyMapper: Mappers.ErrorResponse + } + }, + queryParameters: [Parameters.apiVersion], + urlParameters: [ + Parameters.$host, + Parameters.subscriptionId, + Parameters.resourceGroup, + Parameters.name, + Parameters.workbenchName, + Parameters.chamberName + ], + headerParameters: [Parameters.accept], + serializer +}; +const restartOperationSpec: coreClient.OperationSpec = { + path: + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroup}/providers/Microsoft.ModSimWorkbench/workbenches/{workbenchName}/chambers/{chamberName}/connectors/{name}/restart", + httpMethod: "POST", + responses: { + 200: {}, + 201: {}, + 202: {}, + 204: {}, + default: { + bodyMapper: Mappers.ErrorResponse + } + }, + queryParameters: [Parameters.apiVersion], + urlParameters: [ + Parameters.$host, + Parameters.subscriptionId, + Parameters.resourceGroup, + Parameters.name, + Parameters.workbenchName, + Parameters.chamberName + ], + headerParameters: [Parameters.accept], + serializer +}; +const createOrUpdateOperationSpec: coreClient.OperationSpec = { + path: + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroup}/providers/Microsoft.ModSimWorkbench/workbenches/{workbenchName}/chambers/{chamberName}/connectors/{connectorName}", + httpMethod: "PUT", + responses: { + 200: { + bodyMapper: Mappers.Connector + }, + 201: { + bodyMapper: Mappers.Connector + }, + 202: { + bodyMapper: Mappers.Connector + }, + 204: { + bodyMapper: Mappers.Connector + }, + default: { + bodyMapper: Mappers.ErrorResponse + } + }, + requestBody: Parameters.parameters, + queryParameters: [Parameters.apiVersion], + urlParameters: [ + Parameters.$host, + Parameters.subscriptionId, + Parameters.resourceGroup, + Parameters.workbenchName, + Parameters.chamberName, + Parameters.connectorName + ], + headerParameters: [Parameters.accept, Parameters.contentType], + mediaType: "json", + serializer +}; +const updateOperationSpec: coreClient.OperationSpec = { + path: + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroup}/providers/Microsoft.ModSimWorkbench/workbenches/{workbenchName}/chambers/{chamberName}/connectors/{connectorName}", + httpMethod: "PATCH", + responses: { + 200: { + bodyMapper: Mappers.Connector + }, + 201: { + bodyMapper: Mappers.Connector + }, + default: { + bodyMapper: Mappers.ErrorResponse + } + }, + requestBody: Parameters.parameters, + queryParameters: [Parameters.apiVersion], + urlParameters: [ + Parameters.$host, + Parameters.subscriptionId, + Parameters.resourceGroup, + Parameters.workbenchName, + Parameters.chamberName, + Parameters.connectorName + ], + headerParameters: [Parameters.accept, Parameters.contentType], + mediaType: "json", + serializer +}; +const getOperationSpec: coreClient.OperationSpec = { + path: + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroup}/providers/Microsoft.ModSimWorkbench/workbenches/{workbenchName}/chambers/{chamberName}/connectors/{connectorName}", + httpMethod: "GET", + responses: { + 200: { + bodyMapper: Mappers.Connector + }, + default: { + bodyMapper: Mappers.ErrorResponse + } + }, + queryParameters: [Parameters.apiVersion], + urlParameters: [ + Parameters.$host, + Parameters.subscriptionId, + Parameters.resourceGroup, + Parameters.workbenchName, + Parameters.chamberName, + Parameters.connectorName + ], + headerParameters: [Parameters.accept], + serializer +}; +const deleteOperationSpec: coreClient.OperationSpec = { + path: + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroup}/providers/Microsoft.ModSimWorkbench/workbenches/{workbenchName}/chambers/{chamberName}/connectors/{connectorName}", + httpMethod: "DELETE", + responses: { + 200: { + bodyMapper: Mappers.Connector + }, + 201: { + bodyMapper: Mappers.Connector + }, + 202: { + bodyMapper: Mappers.Connector + }, + 204: { + bodyMapper: Mappers.Connector + }, + default: { + bodyMapper: Mappers.ErrorResponse + } + }, + queryParameters: [Parameters.apiVersion], + urlParameters: [ + Parameters.$host, + Parameters.subscriptionId, + Parameters.resourceGroup, + Parameters.workbenchName, + Parameters.chamberName, + Parameters.connectorName + ], + headerParameters: [Parameters.accept], + serializer +}; +const listOperationSpec: coreClient.OperationSpec = { + path: + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroup}/providers/Microsoft.ModSimWorkbench/workbenches/{workbenchName}/chambers/{chamberName}/connectors", + httpMethod: "GET", + responses: { + 200: { + bodyMapper: Mappers.ConnectorPageableList + }, + default: { + bodyMapper: Mappers.ErrorResponse + } + }, + queryParameters: [Parameters.apiVersion], + urlParameters: [ + Parameters.$host, + Parameters.subscriptionId, + Parameters.resourceGroup, + Parameters.workbenchName, + Parameters.chamberName + ], + headerParameters: [Parameters.accept], + serializer +}; +const licenseAddOperationSpec: coreClient.OperationSpec = { + path: + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroup}/providers/Microsoft.ModSimWorkbench/workbenches/{workbenchName}/chambers/{chamberName}/connectors/{name}/licenseAdd", + httpMethod: "POST", + responses: { + 200: {}, + 201: {}, + 202: {}, + 204: {}, + default: { + bodyMapper: Mappers.ErrorResponse + } + }, + requestBody: Parameters.body1, + queryParameters: [Parameters.apiVersion], + urlParameters: [ + Parameters.$host, + Parameters.subscriptionId, + Parameters.resourceGroup, + Parameters.name, + Parameters.workbenchName, + Parameters.chamberName + ], + headerParameters: [Parameters.accept, Parameters.contentType], + mediaType: "json", + serializer +}; +const listNextOperationSpec: coreClient.OperationSpec = { + path: "{nextLink}", + httpMethod: "GET", + responses: { + 200: { + bodyMapper: Mappers.ConnectorPageableList + }, + default: { + bodyMapper: Mappers.ErrorResponse + } + }, + urlParameters: [ + Parameters.$host, + Parameters.subscriptionId, + Parameters.resourceGroup, + Parameters.nextLink, + Parameters.workbenchName, + Parameters.chamberName + ], + headerParameters: [Parameters.accept], + serializer +}; diff --git a/sdk/modsimworkbench/arm-modsimworkbench/src/operations/fileOperations.ts b/sdk/modsimworkbench/arm-modsimworkbench/src/operations/fileOperations.ts new file mode 100644 index 000000000000..4f2b63cbdbc2 --- /dev/null +++ b/sdk/modsimworkbench/arm-modsimworkbench/src/operations/fileOperations.ts @@ -0,0 +1,175 @@ +/* + * 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 { FileOperations } from "../operationsInterfaces"; +import * as coreClient from "@azure/core-client"; +import * as Mappers from "../models/mappers"; +import * as Parameters from "../models/parameters"; +import { MicrosoftModSimWorkbench } from "../microsoftModSimWorkbench"; +import { + SimplePollerLike, + OperationState, + createHttpPoller +} from "@azure/core-lro"; +import { createLroSpec } from "../lroImpl"; +import { FileManageOptionalParams, FileManageResponse } from "../models"; + +/** Class containing FileOperations operations. */ +export class FileOperationsImpl implements FileOperations { + private readonly client: MicrosoftModSimWorkbench; + + /** + * Initialize a new instance of the class FileOperations class. + * @param client Reference to the service client + */ + constructor(client: MicrosoftModSimWorkbench) { + this.client = client; + } + + /** + * Manage files in an ModSim Workbench chamber data pipeline. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workbenchName the workbench name. + * @param chamberName the chamber name. + * @param fileName the file name. + * @param options The options parameters. + */ + async beginManage( + resourceGroupName: string, + workbenchName: string, + chamberName: string, + fileName: string, + options?: FileManageOptionalParams + ): Promise< + SimplePollerLike, FileManageResponse> + > { + const directSendOperation = async ( + args: coreClient.OperationArguments, + spec: coreClient.OperationSpec + ): Promise => { + return this.client.sendOperationRequest(args, spec); + }; + const sendOperationFn = 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 = createLroSpec({ + sendOperationFn, + args: { + resourceGroupName, + workbenchName, + chamberName, + fileName, + options + }, + spec: manageOperationSpec + }); + const poller = await createHttpPoller< + FileManageResponse, + OperationState + >(lro, { + restoreFrom: options?.resumeFrom, + intervalInMs: options?.updateIntervalInMs, + resourceLocationConfig: "location" + }); + await poller.poll(); + return poller; + } + + /** + * Manage files in an ModSim Workbench chamber data pipeline. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workbenchName the workbench name. + * @param chamberName the chamber name. + * @param fileName the file name. + * @param options The options parameters. + */ + async beginManageAndWait( + resourceGroupName: string, + workbenchName: string, + chamberName: string, + fileName: string, + options?: FileManageOptionalParams + ): Promise { + const poller = await this.beginManage( + resourceGroupName, + workbenchName, + chamberName, + fileName, + options + ); + return poller.pollUntilDone(); + } +} +// Operation Specifications +const serializer = coreClient.createSerializer(Mappers, /* isXml */ false); + +const manageOperationSpec: coreClient.OperationSpec = { + path: + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ModSimWorkbench/workbenches/{workbenchName}/chambers/{chamberName}/files/{fileName}/manage", + httpMethod: "POST", + responses: { + 200: { + bodyMapper: Mappers.FilesManage + }, + 201: { + bodyMapper: Mappers.FilesManage + }, + 202: { + bodyMapper: Mappers.FilesManage + }, + 204: { + bodyMapper: Mappers.FilesManage + }, + default: { + bodyMapper: Mappers.ErrorResponse + } + }, + requestBody: Parameters.body6, + queryParameters: [Parameters.apiVersion], + urlParameters: [ + Parameters.$host, + Parameters.subscriptionId, + Parameters.workbenchName, + Parameters.chamberName, + Parameters.resourceGroupName, + Parameters.fileName + ], + headerParameters: [Parameters.accept, Parameters.contentType], + mediaType: "json", + serializer +}; diff --git a/sdk/modsimworkbench/arm-modsimworkbench/src/operations/fileRequest.ts b/sdk/modsimworkbench/arm-modsimworkbench/src/operations/fileRequest.ts new file mode 100644 index 000000000000..331c5c0b6a25 --- /dev/null +++ b/sdk/modsimworkbench/arm-modsimworkbench/src/operations/fileRequest.ts @@ -0,0 +1,179 @@ +/* + * 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 { FileRequest } from "../operationsInterfaces"; +import * as coreClient from "@azure/core-client"; +import * as Mappers from "../models/mappers"; +import * as Parameters from "../models/parameters"; +import { MicrosoftModSimWorkbench } from "../microsoftModSimWorkbench"; +import { + SimplePollerLike, + OperationState, + createHttpPoller +} from "@azure/core-lro"; +import { createLroSpec } from "../lroImpl"; +import { + FileRequestGetDownloadUriOptionalParams, + FileRequestGetDownloadUriResponse +} from "../models"; + +/** Class containing FileRequest operations. */ +export class FileRequestImpl implements FileRequest { + private readonly client: MicrosoftModSimWorkbench; + + /** + * Initialize a new instance of the class FileRequest class. + * @param client Reference to the service client + */ + constructor(client: MicrosoftModSimWorkbench) { + this.client = client; + } + + /** + * Get SAS URI to download a file from an ModSim Workbench chamber data pipeline. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workbenchName the workbench name. + * @param chamberName the chamber name. + * @param requestName the file request name. + * @param options The options parameters. + */ + async beginGetDownloadUri( + resourceGroupName: string, + workbenchName: string, + chamberName: string, + requestName: string, + options?: FileRequestGetDownloadUriOptionalParams + ): Promise< + SimplePollerLike< + OperationState, + FileRequestGetDownloadUriResponse + > + > { + const directSendOperation = async ( + args: coreClient.OperationArguments, + spec: coreClient.OperationSpec + ): Promise => { + return this.client.sendOperationRequest(args, spec); + }; + const sendOperationFn = 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 = createLroSpec({ + sendOperationFn, + args: { + resourceGroupName, + workbenchName, + chamberName, + requestName, + options + }, + spec: getDownloadUriOperationSpec + }); + const poller = await createHttpPoller< + FileRequestGetDownloadUriResponse, + OperationState + >(lro, { + restoreFrom: options?.resumeFrom, + intervalInMs: options?.updateIntervalInMs, + resourceLocationConfig: "location" + }); + await poller.poll(); + return poller; + } + + /** + * Get SAS URI to download a file from an ModSim Workbench chamber data pipeline. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workbenchName the workbench name. + * @param chamberName the chamber name. + * @param requestName the file request name. + * @param options The options parameters. + */ + async beginGetDownloadUriAndWait( + resourceGroupName: string, + workbenchName: string, + chamberName: string, + requestName: string, + options?: FileRequestGetDownloadUriOptionalParams + ): Promise { + const poller = await this.beginGetDownloadUri( + resourceGroupName, + workbenchName, + chamberName, + requestName, + options + ); + return poller.pollUntilDone(); + } +} +// Operation Specifications +const serializer = coreClient.createSerializer(Mappers, /* isXml */ false); + +const getDownloadUriOperationSpec: coreClient.OperationSpec = { + path: + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ModSimWorkbench/workbenches/{workbenchName}/chambers/{chamberName}/fileRequests/{requestName}/getDownloadUri", + httpMethod: "POST", + responses: { + 200: { + bodyMapper: Mappers.FileDownloadSasUri + }, + 201: { + bodyMapper: Mappers.FileDownloadSasUri + }, + 202: { + bodyMapper: Mappers.FileDownloadSasUri + }, + 204: { + bodyMapper: Mappers.FileDownloadSasUri + }, + default: { + bodyMapper: Mappers.ErrorResponse + } + }, + queryParameters: [Parameters.apiVersion], + urlParameters: [ + Parameters.$host, + Parameters.subscriptionId, + Parameters.workbenchName, + Parameters.chamberName, + Parameters.resourceGroupName, + Parameters.requestName + ], + headerParameters: [Parameters.accept], + serializer +}; diff --git a/sdk/modsimworkbench/arm-modsimworkbench/src/operations/fileRequests.ts b/sdk/modsimworkbench/arm-modsimworkbench/src/operations/fileRequests.ts new file mode 100644 index 000000000000..9d0e60e61f2e --- /dev/null +++ b/sdk/modsimworkbench/arm-modsimworkbench/src/operations/fileRequests.ts @@ -0,0 +1,414 @@ +/* + * 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, PageSettings } from "@azure/core-paging"; +import { setContinuationToken } from "../pagingHelper"; +import { FileRequests } from "../operationsInterfaces"; +import * as coreClient from "@azure/core-client"; +import * as Mappers from "../models/mappers"; +import * as Parameters from "../models/parameters"; +import { MicrosoftModSimWorkbench } from "../microsoftModSimWorkbench"; +import { + SimplePollerLike, + OperationState, + createHttpPoller +} from "@azure/core-lro"; +import { createLroSpec } from "../lroImpl"; +import { + Request, + FileRequestsListNextOptionalParams, + FileRequestsListOptionalParams, + FileRequestsListResponse, + FileRequestsGetOptionalParams, + FileRequestsGetResponse, + FileRequestsManageOptionalParams, + FileRequestsManageResponse, + FileRequestsListNextResponse +} from "../models"; + +/// +/** Class containing FileRequests operations. */ +export class FileRequestsImpl implements FileRequests { + private readonly client: MicrosoftModSimWorkbench; + + /** + * Initialize a new instance of the class FileRequests class. + * @param client Reference to the service client + */ + constructor(client: MicrosoftModSimWorkbench) { + this.client = client; + } + + /** + * Get ModSim Workbench chamber data pipeline file request resource collection. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workbenchName The name of the workbench. + * @param chamberName The name of the chamber. + * @param options The options parameters. + */ + public list( + resourceGroupName: string, + workbenchName: string, + chamberName: string, + options?: FileRequestsListOptionalParams + ): PagedAsyncIterableIterator { + const iter = this.listPagingAll( + resourceGroupName, + workbenchName, + chamberName, + options + ); + return { + next() { + return iter.next(); + }, + [Symbol.asyncIterator]() { + return this; + }, + byPage: (settings?: PageSettings) => { + if (settings?.maxPageSize) { + throw new Error("maxPageSize is not supported by this operation."); + } + return this.listPagingPage( + resourceGroupName, + workbenchName, + chamberName, + options, + settings + ); + } + }; + } + + private async *listPagingPage( + resourceGroupName: string, + workbenchName: string, + chamberName: string, + options?: FileRequestsListOptionalParams, + settings?: PageSettings + ): AsyncIterableIterator { + let result: FileRequestsListResponse; + let continuationToken = settings?.continuationToken; + if (!continuationToken) { + result = await this._list( + resourceGroupName, + workbenchName, + chamberName, + options + ); + let page = result.value || []; + continuationToken = result.nextLink; + setContinuationToken(page, continuationToken); + yield page; + } + while (continuationToken) { + result = await this._listNext( + resourceGroupName, + workbenchName, + chamberName, + continuationToken, + options + ); + continuationToken = result.nextLink; + let page = result.value || []; + setContinuationToken(page, continuationToken); + yield page; + } + } + + private async *listPagingAll( + resourceGroupName: string, + workbenchName: string, + chamberName: string, + options?: FileRequestsListOptionalParams + ): AsyncIterableIterator { + for await (const page of this.listPagingPage( + resourceGroupName, + workbenchName, + chamberName, + options + )) { + yield* page; + } + } + + /** + * Get a specific ModSim Workbench chamber data pipeline file request resource. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workbenchName the workbench name. + * @param chamberName the chamber name. + * @param requestName the request name. + * @param options The options parameters. + */ + get( + resourceGroupName: string, + workbenchName: string, + chamberName: string, + requestName: string, + options?: FileRequestsGetOptionalParams + ): Promise { + return this.client.sendOperationRequest( + { resourceGroupName, workbenchName, chamberName, requestName, options }, + getOperationSpec + ); + } + + /** + * Manage download file requests in an ModSim Workbench chamber Data pipeline. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workbenchName the workbench name. + * @param chamberName the chamber name. + * @param requestName the file request name. + * @param options The options parameters. + */ + async beginManage( + resourceGroupName: string, + workbenchName: string, + chamberName: string, + requestName: string, + options?: FileRequestsManageOptionalParams + ): Promise< + SimplePollerLike< + OperationState, + FileRequestsManageResponse + > + > { + const directSendOperation = async ( + args: coreClient.OperationArguments, + spec: coreClient.OperationSpec + ): Promise => { + return this.client.sendOperationRequest(args, spec); + }; + const sendOperationFn = 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 = createLroSpec({ + sendOperationFn, + args: { + resourceGroupName, + workbenchName, + chamberName, + requestName, + options + }, + spec: manageOperationSpec + }); + const poller = await createHttpPoller< + FileRequestsManageResponse, + OperationState + >(lro, { + restoreFrom: options?.resumeFrom, + intervalInMs: options?.updateIntervalInMs, + resourceLocationConfig: "location" + }); + await poller.poll(); + return poller; + } + + /** + * Manage download file requests in an ModSim Workbench chamber Data pipeline. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workbenchName the workbench name. + * @param chamberName the chamber name. + * @param requestName the file request name. + * @param options The options parameters. + */ + async beginManageAndWait( + resourceGroupName: string, + workbenchName: string, + chamberName: string, + requestName: string, + options?: FileRequestsManageOptionalParams + ): Promise { + const poller = await this.beginManage( + resourceGroupName, + workbenchName, + chamberName, + requestName, + options + ); + return poller.pollUntilDone(); + } + + /** + * Get ModSim Workbench chamber data pipeline file request resource collection. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workbenchName The name of the workbench. + * @param chamberName The name of the chamber. + * @param options The options parameters. + */ + private _list( + resourceGroupName: string, + workbenchName: string, + chamberName: string, + options?: FileRequestsListOptionalParams + ): Promise { + return this.client.sendOperationRequest( + { resourceGroupName, workbenchName, chamberName, options }, + listOperationSpec + ); + } + + /** + * ListNext + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workbenchName The name of the workbench. + * @param chamberName The name of the chamber. + * @param nextLink The nextLink from the previous successful call to the List method. + * @param options The options parameters. + */ + private _listNext( + resourceGroupName: string, + workbenchName: string, + chamberName: string, + nextLink: string, + options?: FileRequestsListNextOptionalParams + ): Promise { + return this.client.sendOperationRequest( + { resourceGroupName, workbenchName, chamberName, nextLink, options }, + listNextOperationSpec + ); + } +} +// Operation Specifications +const serializer = coreClient.createSerializer(Mappers, /* isXml */ false); + +const getOperationSpec: coreClient.OperationSpec = { + path: + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ModSimWorkbench/workbenches/{workbenchName}/chambers/{chamberName}/fileRequests/{requestName}", + httpMethod: "GET", + responses: { + 200: { + bodyMapper: Mappers.Request + }, + default: { + bodyMapper: Mappers.ErrorResponse + } + }, + queryParameters: [Parameters.apiVersion], + urlParameters: [ + Parameters.$host, + Parameters.subscriptionId, + Parameters.workbenchName, + Parameters.chamberName, + Parameters.resourceGroupName, + Parameters.requestName + ], + headerParameters: [Parameters.accept], + serializer +}; +const manageOperationSpec: coreClient.OperationSpec = { + path: + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ModSimWorkbench/workbenches/{workbenchName}/chambers/{chamberName}/fileRequests/{requestName}/manage", + httpMethod: "POST", + responses: { + 200: { + bodyMapper: Mappers.FileRequestsManage + }, + 201: { + bodyMapper: Mappers.FileRequestsManage + }, + 202: { + bodyMapper: Mappers.FileRequestsManage + }, + 204: { + bodyMapper: Mappers.FileRequestsManage + }, + default: { + bodyMapper: Mappers.ErrorResponse + } + }, + requestBody: Parameters.body7, + queryParameters: [Parameters.apiVersion], + urlParameters: [ + Parameters.$host, + Parameters.subscriptionId, + Parameters.workbenchName, + Parameters.chamberName, + Parameters.resourceGroupName, + Parameters.requestName + ], + headerParameters: [Parameters.accept, Parameters.contentType], + mediaType: "json", + serializer +}; +const listOperationSpec: coreClient.OperationSpec = { + path: + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ModSimWorkbench/workbenches/{workbenchName}/chambers/{chamberName}/fileRequests", + httpMethod: "GET", + responses: { + 200: { + bodyMapper: Mappers.RequestPageableList + }, + default: { + bodyMapper: Mappers.ErrorResponse + } + }, + queryParameters: [Parameters.apiVersion], + urlParameters: [ + Parameters.$host, + Parameters.subscriptionId, + Parameters.workbenchName, + Parameters.chamberName, + Parameters.resourceGroupName + ], + headerParameters: [Parameters.accept], + serializer +}; +const listNextOperationSpec: coreClient.OperationSpec = { + path: "{nextLink}", + httpMethod: "GET", + responses: { + 200: { + bodyMapper: Mappers.RequestPageableList + }, + default: { + bodyMapper: Mappers.ErrorResponse + } + }, + urlParameters: [ + Parameters.$host, + Parameters.subscriptionId, + Parameters.nextLink, + Parameters.workbenchName, + Parameters.chamberName, + Parameters.resourceGroupName + ], + headerParameters: [Parameters.accept], + serializer +}; diff --git a/sdk/modsimworkbench/arm-modsimworkbench/src/operations/files.ts b/sdk/modsimworkbench/arm-modsimworkbench/src/operations/files.ts new file mode 100644 index 000000000000..df5fe9a65af1 --- /dev/null +++ b/sdk/modsimworkbench/arm-modsimworkbench/src/operations/files.ts @@ -0,0 +1,414 @@ +/* + * 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, PageSettings } from "@azure/core-paging"; +import { setContinuationToken } from "../pagingHelper"; +import { Files } from "../operationsInterfaces"; +import * as coreClient from "@azure/core-client"; +import * as Mappers from "../models/mappers"; +import * as Parameters from "../models/parameters"; +import { MicrosoftModSimWorkbench } from "../microsoftModSimWorkbench"; +import { + SimplePollerLike, + OperationState, + createHttpPoller +} from "@azure/core-lro"; +import { createLroSpec } from "../lroImpl"; +import { + File, + FilesListNextOptionalParams, + FilesListOptionalParams, + FilesListResponse, + FilesGetOptionalParams, + FilesGetResponse, + FilesDownloadRequestOptionalParams, + FilesDownloadRequestResponse, + FilesListNextResponse +} from "../models"; + +/// +/** Class containing Files operations. */ +export class FilesImpl implements Files { + private readonly client: MicrosoftModSimWorkbench; + + /** + * Initialize a new instance of the class Files class. + * @param client Reference to the service client + */ + constructor(client: MicrosoftModSimWorkbench) { + this.client = client; + } + + /** + * Lists all files. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workbenchName The name of the workbench. + * @param chamberName The name of the chamber. + * @param options The options parameters. + */ + public list( + resourceGroupName: string, + workbenchName: string, + chamberName: string, + options?: FilesListOptionalParams + ): PagedAsyncIterableIterator { + const iter = this.listPagingAll( + resourceGroupName, + workbenchName, + chamberName, + options + ); + return { + next() { + return iter.next(); + }, + [Symbol.asyncIterator]() { + return this; + }, + byPage: (settings?: PageSettings) => { + if (settings?.maxPageSize) { + throw new Error("maxPageSize is not supported by this operation."); + } + return this.listPagingPage( + resourceGroupName, + workbenchName, + chamberName, + options, + settings + ); + } + }; + } + + private async *listPagingPage( + resourceGroupName: string, + workbenchName: string, + chamberName: string, + options?: FilesListOptionalParams, + settings?: PageSettings + ): AsyncIterableIterator { + let result: FilesListResponse; + let continuationToken = settings?.continuationToken; + if (!continuationToken) { + result = await this._list( + resourceGroupName, + workbenchName, + chamberName, + options + ); + let page = result.value || []; + continuationToken = result.nextLink; + setContinuationToken(page, continuationToken); + yield page; + } + while (continuationToken) { + result = await this._listNext( + resourceGroupName, + workbenchName, + chamberName, + continuationToken, + options + ); + continuationToken = result.nextLink; + let page = result.value || []; + setContinuationToken(page, continuationToken); + yield page; + } + } + + private async *listPagingAll( + resourceGroupName: string, + workbenchName: string, + chamberName: string, + options?: FilesListOptionalParams + ): AsyncIterableIterator { + for await (const page of this.listPagingPage( + resourceGroupName, + workbenchName, + chamberName, + options + )) { + yield* page; + } + } + + /** + * Get a specific ModSim Workbench chamber data pipeline file resource. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workbenchName the workbench name. + * @param chamberName the chamber name. + * @param fileName the file name. + * @param options The options parameters. + */ + get( + resourceGroupName: string, + workbenchName: string, + chamberName: string, + fileName: string, + options?: FilesGetOptionalParams + ): Promise { + return this.client.sendOperationRequest( + { resourceGroupName, workbenchName, chamberName, fileName, options }, + getOperationSpec + ); + } + + /** + * Request to download files from an ModSim Workbench chamber data pipeline. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workbenchName the workbench name. + * @param chamberName the chamber name. + * @param fileName the file name. + * @param options The options parameters. + */ + async beginDownloadRequest( + resourceGroupName: string, + workbenchName: string, + chamberName: string, + fileName: string, + options?: FilesDownloadRequestOptionalParams + ): Promise< + SimplePollerLike< + OperationState, + FilesDownloadRequestResponse + > + > { + const directSendOperation = async ( + args: coreClient.OperationArguments, + spec: coreClient.OperationSpec + ): Promise => { + return this.client.sendOperationRequest(args, spec); + }; + const sendOperationFn = 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 = createLroSpec({ + sendOperationFn, + args: { + resourceGroupName, + workbenchName, + chamberName, + fileName, + options + }, + spec: downloadRequestOperationSpec + }); + const poller = await createHttpPoller< + FilesDownloadRequestResponse, + OperationState + >(lro, { + restoreFrom: options?.resumeFrom, + intervalInMs: options?.updateIntervalInMs, + resourceLocationConfig: "location" + }); + await poller.poll(); + return poller; + } + + /** + * Request to download files from an ModSim Workbench chamber data pipeline. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workbenchName the workbench name. + * @param chamberName the chamber name. + * @param fileName the file name. + * @param options The options parameters. + */ + async beginDownloadRequestAndWait( + resourceGroupName: string, + workbenchName: string, + chamberName: string, + fileName: string, + options?: FilesDownloadRequestOptionalParams + ): Promise { + const poller = await this.beginDownloadRequest( + resourceGroupName, + workbenchName, + chamberName, + fileName, + options + ); + return poller.pollUntilDone(); + } + + /** + * Lists all files. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workbenchName The name of the workbench. + * @param chamberName The name of the chamber. + * @param options The options parameters. + */ + private _list( + resourceGroupName: string, + workbenchName: string, + chamberName: string, + options?: FilesListOptionalParams + ): Promise { + return this.client.sendOperationRequest( + { resourceGroupName, workbenchName, chamberName, options }, + listOperationSpec + ); + } + + /** + * ListNext + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workbenchName The name of the workbench. + * @param chamberName The name of the chamber. + * @param nextLink The nextLink from the previous successful call to the List method. + * @param options The options parameters. + */ + private _listNext( + resourceGroupName: string, + workbenchName: string, + chamberName: string, + nextLink: string, + options?: FilesListNextOptionalParams + ): Promise { + return this.client.sendOperationRequest( + { resourceGroupName, workbenchName, chamberName, nextLink, options }, + listNextOperationSpec + ); + } +} +// Operation Specifications +const serializer = coreClient.createSerializer(Mappers, /* isXml */ false); + +const getOperationSpec: coreClient.OperationSpec = { + path: + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ModSimWorkbench/workbenches/{workbenchName}/chambers/{chamberName}/files/{fileName}", + httpMethod: "GET", + responses: { + 200: { + bodyMapper: Mappers.File + }, + default: { + bodyMapper: Mappers.ErrorResponse + } + }, + queryParameters: [Parameters.apiVersion], + urlParameters: [ + Parameters.$host, + Parameters.subscriptionId, + Parameters.workbenchName, + Parameters.chamberName, + Parameters.resourceGroupName, + Parameters.fileName + ], + headerParameters: [Parameters.accept], + serializer +}; +const downloadRequestOperationSpec: coreClient.OperationSpec = { + path: + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ModSimWorkbench/workbenches/{workbenchName}/chambers/{chamberName}/files/{fileName}/downloadRequest", + httpMethod: "POST", + responses: { + 200: { + bodyMapper: Mappers.DownloadRequest + }, + 201: { + bodyMapper: Mappers.DownloadRequest + }, + 202: { + bodyMapper: Mappers.DownloadRequest + }, + 204: { + bodyMapper: Mappers.DownloadRequest + }, + default: { + bodyMapper: Mappers.ErrorResponse + } + }, + requestBody: Parameters.body5, + queryParameters: [Parameters.apiVersion], + urlParameters: [ + Parameters.$host, + Parameters.subscriptionId, + Parameters.workbenchName, + Parameters.chamberName, + Parameters.resourceGroupName, + Parameters.fileName + ], + headerParameters: [Parameters.accept, Parameters.contentType], + mediaType: "json", + serializer +}; +const listOperationSpec: coreClient.OperationSpec = { + path: + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ModSimWorkbench/workbenches/{workbenchName}/chambers/{chamberName}/files", + httpMethod: "GET", + responses: { + 200: { + bodyMapper: Mappers.FilePageableList + }, + default: { + bodyMapper: Mappers.ErrorResponse + } + }, + queryParameters: [Parameters.apiVersion], + urlParameters: [ + Parameters.$host, + Parameters.subscriptionId, + Parameters.workbenchName, + Parameters.chamberName, + Parameters.resourceGroupName + ], + headerParameters: [Parameters.accept], + serializer +}; +const listNextOperationSpec: coreClient.OperationSpec = { + path: "{nextLink}", + httpMethod: "GET", + responses: { + 200: { + bodyMapper: Mappers.FilePageableList + }, + default: { + bodyMapper: Mappers.ErrorResponse + } + }, + urlParameters: [ + Parameters.$host, + Parameters.subscriptionId, + Parameters.nextLink, + Parameters.workbenchName, + Parameters.chamberName, + Parameters.resourceGroupName + ], + headerParameters: [Parameters.accept], + serializer +}; diff --git a/sdk/modsimworkbench/arm-modsimworkbench/src/operations/index.ts b/sdk/modsimworkbench/arm-modsimworkbench/src/operations/index.ts new file mode 100644 index 000000000000..c8f3b5d199f3 --- /dev/null +++ b/sdk/modsimworkbench/arm-modsimworkbench/src/operations/index.ts @@ -0,0 +1,18 @@ +/* + * 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 "./workbenches"; +export * from "./connectors"; +export * from "./chambers"; +export * from "./workloads"; +export * from "./storages"; +export * from "./files"; +export * from "./fileOperations"; +export * from "./fileRequests"; +export * from "./fileRequest"; diff --git a/sdk/modsimworkbench/arm-modsimworkbench/src/operations/operations.ts b/sdk/modsimworkbench/arm-modsimworkbench/src/operations/operations.ts new file mode 100644 index 000000000000..28736a130779 --- /dev/null +++ b/sdk/modsimworkbench/arm-modsimworkbench/src/operations/operations.ts @@ -0,0 +1,52 @@ +/* + * 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 { Operations } from "../operationsInterfaces"; +import * as coreClient from "@azure/core-client"; +import * as Mappers from "../models/mappers"; +import * as Parameters from "../models/parameters"; +import { MicrosoftModSimWorkbench } from "../microsoftModSimWorkbench"; +import { OperationsListOptionalParams } from "../models"; + +/** Class containing Operations operations. */ +export class OperationsImpl implements Operations { + private readonly client: MicrosoftModSimWorkbench; + + /** + * Initialize a new instance of the class Operations class. + * @param client Reference to the service client + */ + constructor(client: MicrosoftModSimWorkbench) { + this.client = client; + } + + /** + * Lists Operations. + * @param options The options parameters. + */ + list(options?: OperationsListOptionalParams): Promise { + return this.client.sendOperationRequest({ options }, listOperationSpec); + } +} +// Operation Specifications +const serializer = coreClient.createSerializer(Mappers, /* isXml */ false); + +const listOperationSpec: coreClient.OperationSpec = { + path: "/providers/Microsoft.ModSimWorkbench/operations", + httpMethod: "GET", + responses: { + 200: {}, + default: { + bodyMapper: Mappers.ErrorResponse + } + }, + queryParameters: [Parameters.apiVersion], + urlParameters: [Parameters.$host], + headerParameters: [Parameters.accept], + serializer +}; diff --git a/sdk/modsimworkbench/arm-modsimworkbench/src/operations/storages.ts b/sdk/modsimworkbench/arm-modsimworkbench/src/operations/storages.ts new file mode 100644 index 000000000000..d8f7b68df92c --- /dev/null +++ b/sdk/modsimworkbench/arm-modsimworkbench/src/operations/storages.ts @@ -0,0 +1,593 @@ +/* + * 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, PageSettings } from "@azure/core-paging"; +import { setContinuationToken } from "../pagingHelper"; +import { Storages } from "../operationsInterfaces"; +import * as coreClient from "@azure/core-client"; +import * as Mappers from "../models/mappers"; +import * as Parameters from "../models/parameters"; +import { MicrosoftModSimWorkbench } from "../microsoftModSimWorkbench"; +import { + SimplePollerLike, + OperationState, + createHttpPoller +} from "@azure/core-lro"; +import { createLroSpec } from "../lroImpl"; +import { + Storage, + StoragesListNextOptionalParams, + StoragesListOptionalParams, + StoragesListResponse, + StoragesCreateOrUpdateOptionalParams, + StoragesCreateOrUpdateResponse, + StoragesUpdateOptionalParams, + StoragesUpdateResponse, + StoragesGetOptionalParams, + StoragesGetResponse, + StoragesDeleteOptionalParams, + StoragesDeleteResponse, + StoragesListNextResponse +} from "../models"; + +/// +/** Class containing Storages operations. */ +export class StoragesImpl implements Storages { + private readonly client: MicrosoftModSimWorkbench; + + /** + * Initialize a new instance of the class Storages class. + * @param client Reference to the service client + */ + constructor(client: MicrosoftModSimWorkbench) { + this.client = client; + } + + /** + * Lists all storages. + * @param resourceGroup The name of the resource group. + * @param workbenchName The name of the workbench. + * @param chamberName The name of the chamber. + * @param options The options parameters. + */ + public list( + resourceGroup: string, + workbenchName: string, + chamberName: string, + options?: StoragesListOptionalParams + ): PagedAsyncIterableIterator { + const iter = this.listPagingAll( + resourceGroup, + workbenchName, + chamberName, + options + ); + return { + next() { + return iter.next(); + }, + [Symbol.asyncIterator]() { + return this; + }, + byPage: (settings?: PageSettings) => { + if (settings?.maxPageSize) { + throw new Error("maxPageSize is not supported by this operation."); + } + return this.listPagingPage( + resourceGroup, + workbenchName, + chamberName, + options, + settings + ); + } + }; + } + + private async *listPagingPage( + resourceGroup: string, + workbenchName: string, + chamberName: string, + options?: StoragesListOptionalParams, + settings?: PageSettings + ): AsyncIterableIterator { + let result: StoragesListResponse; + let continuationToken = settings?.continuationToken; + if (!continuationToken) { + result = await this._list( + resourceGroup, + workbenchName, + chamberName, + options + ); + let page = result.value || []; + continuationToken = result.nextLink; + setContinuationToken(page, continuationToken); + yield page; + } + while (continuationToken) { + result = await this._listNext( + resourceGroup, + workbenchName, + chamberName, + continuationToken, + options + ); + continuationToken = result.nextLink; + let page = result.value || []; + setContinuationToken(page, continuationToken); + yield page; + } + } + + private async *listPagingAll( + resourceGroup: string, + workbenchName: string, + chamberName: string, + options?: StoragesListOptionalParams + ): AsyncIterableIterator { + for await (const page of this.listPagingPage( + resourceGroup, + workbenchName, + chamberName, + options + )) { + yield* page; + } + } + + /** + * Creates or updates the storage. + * @param resourceGroup The name of the resource group. + * @param workbenchName The name of the workbench. + * @param chamberName The name of the chamber. + * @param storageName The name of the storage. + * @param options The options parameters. + */ + async beginCreateOrUpdate( + resourceGroup: string, + workbenchName: string, + chamberName: string, + storageName: string, + options?: StoragesCreateOrUpdateOptionalParams + ): Promise< + SimplePollerLike< + OperationState, + StoragesCreateOrUpdateResponse + > + > { + const directSendOperation = async ( + args: coreClient.OperationArguments, + spec: coreClient.OperationSpec + ): Promise => { + return this.client.sendOperationRequest(args, spec); + }; + const sendOperationFn = 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 = createLroSpec({ + sendOperationFn, + args: { resourceGroup, workbenchName, chamberName, storageName, options }, + spec: createOrUpdateOperationSpec + }); + const poller = await createHttpPoller< + StoragesCreateOrUpdateResponse, + OperationState + >(lro, { + restoreFrom: options?.resumeFrom, + intervalInMs: options?.updateIntervalInMs, + resourceLocationConfig: "azure-async-operation" + }); + await poller.poll(); + return poller; + } + + /** + * Creates or updates the storage. + * @param resourceGroup The name of the resource group. + * @param workbenchName The name of the workbench. + * @param chamberName The name of the chamber. + * @param storageName The name of the storage. + * @param options The options parameters. + */ + async beginCreateOrUpdateAndWait( + resourceGroup: string, + workbenchName: string, + chamberName: string, + storageName: string, + options?: StoragesCreateOrUpdateOptionalParams + ): Promise { + const poller = await this.beginCreateOrUpdate( + resourceGroup, + workbenchName, + chamberName, + storageName, + options + ); + return poller.pollUntilDone(); + } + + /** + * Updates the storage. + * @param resourceGroup The name of the resource group. + * @param workbenchName The name of the workbench. + * @param chamberName The name of the chamber. + * @param storageName The name of the storage. + * @param options The options parameters. + */ + update( + resourceGroup: string, + workbenchName: string, + chamberName: string, + storageName: string, + options?: StoragesUpdateOptionalParams + ): Promise { + return this.client.sendOperationRequest( + { resourceGroup, workbenchName, chamberName, storageName, options }, + updateOperationSpec + ); + } + + /** + * Gets information about the storage. + * @param resourceGroup The name of the resource group. + * @param workbenchName The name of the workbench. + * @param chamberName The name of the chamber. + * @param storageName The name of the storage. + * @param options The options parameters. + */ + get( + resourceGroup: string, + workbenchName: string, + chamberName: string, + storageName: string, + options?: StoragesGetOptionalParams + ): Promise { + return this.client.sendOperationRequest( + { resourceGroup, workbenchName, chamberName, storageName, options }, + getOperationSpec + ); + } + + /** + * Deletes the storage. + * @param resourceGroup The name of the resource group. + * @param workbenchName The name of the workbench. + * @param chamberName The name of the chamber. + * @param storageName The name of the storage. + * @param options The options parameters. + */ + async beginDelete( + resourceGroup: string, + workbenchName: string, + chamberName: string, + storageName: string, + options?: StoragesDeleteOptionalParams + ): Promise< + SimplePollerLike< + OperationState, + StoragesDeleteResponse + > + > { + const directSendOperation = async ( + args: coreClient.OperationArguments, + spec: coreClient.OperationSpec + ): Promise => { + return this.client.sendOperationRequest(args, spec); + }; + const sendOperationFn = 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 = createLroSpec({ + sendOperationFn, + args: { resourceGroup, workbenchName, chamberName, storageName, options }, + spec: deleteOperationSpec + }); + const poller = await createHttpPoller< + StoragesDeleteResponse, + OperationState + >(lro, { + restoreFrom: options?.resumeFrom, + intervalInMs: options?.updateIntervalInMs, + resourceLocationConfig: "location" + }); + await poller.poll(); + return poller; + } + + /** + * Deletes the storage. + * @param resourceGroup The name of the resource group. + * @param workbenchName The name of the workbench. + * @param chamberName The name of the chamber. + * @param storageName The name of the storage. + * @param options The options parameters. + */ + async beginDeleteAndWait( + resourceGroup: string, + workbenchName: string, + chamberName: string, + storageName: string, + options?: StoragesDeleteOptionalParams + ): Promise { + const poller = await this.beginDelete( + resourceGroup, + workbenchName, + chamberName, + storageName, + options + ); + return poller.pollUntilDone(); + } + + /** + * Lists all storages. + * @param resourceGroup The name of the resource group. + * @param workbenchName The name of the workbench. + * @param chamberName The name of the chamber. + * @param options The options parameters. + */ + private _list( + resourceGroup: string, + workbenchName: string, + chamberName: string, + options?: StoragesListOptionalParams + ): Promise { + return this.client.sendOperationRequest( + { resourceGroup, workbenchName, chamberName, options }, + listOperationSpec + ); + } + + /** + * ListNext + * @param resourceGroup The name of the resource group. + * @param workbenchName The name of the workbench. + * @param chamberName The name of the chamber. + * @param nextLink The nextLink from the previous successful call to the List method. + * @param options The options parameters. + */ + private _listNext( + resourceGroup: string, + workbenchName: string, + chamberName: string, + nextLink: string, + options?: StoragesListNextOptionalParams + ): Promise { + return this.client.sendOperationRequest( + { resourceGroup, workbenchName, chamberName, nextLink, options }, + listNextOperationSpec + ); + } +} +// Operation Specifications +const serializer = coreClient.createSerializer(Mappers, /* isXml */ false); + +const createOrUpdateOperationSpec: coreClient.OperationSpec = { + path: + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroup}/providers/Microsoft.ModSimWorkbench/workbenches/{workbenchName}/chambers/{chamberName}/storages/{storageName}", + httpMethod: "PUT", + responses: { + 200: { + bodyMapper: Mappers.Storage + }, + 201: { + bodyMapper: Mappers.Storage + }, + 202: { + bodyMapper: Mappers.Storage + }, + 204: { + bodyMapper: Mappers.Storage + }, + default: { + bodyMapper: Mappers.ErrorResponseAutoGenerated + } + }, + requestBody: Parameters.parameters3, + queryParameters: [Parameters.apiVersion], + urlParameters: [ + Parameters.$host, + Parameters.subscriptionId, + Parameters.resourceGroup, + Parameters.workbenchName, + Parameters.chamberName, + Parameters.storageName + ], + headerParameters: [Parameters.accept, Parameters.contentType], + mediaType: "json", + serializer +}; +const updateOperationSpec: coreClient.OperationSpec = { + path: + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroup}/providers/Microsoft.ModSimWorkbench/workbenches/{workbenchName}/chambers/{chamberName}/storages/{storageName}", + httpMethod: "PATCH", + responses: { + 200: { + bodyMapper: Mappers.Storage + }, + default: { + bodyMapper: Mappers.ErrorResponseAutoGenerated + } + }, + requestBody: Parameters.parameters3, + queryParameters: [Parameters.apiVersion], + urlParameters: [ + Parameters.$host, + Parameters.subscriptionId, + Parameters.resourceGroup, + Parameters.workbenchName, + Parameters.chamberName, + Parameters.storageName + ], + headerParameters: [Parameters.accept, Parameters.contentType1], + mediaType: "json", + serializer +}; +const getOperationSpec: coreClient.OperationSpec = { + path: + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroup}/providers/Microsoft.ModSimWorkbench/workbenches/{workbenchName}/chambers/{chamberName}/storages/{storageName}", + httpMethod: "GET", + responses: { + 200: { + bodyMapper: Mappers.Storage + }, + default: { + bodyMapper: Mappers.ErrorResponseAutoGenerated + } + }, + queryParameters: [Parameters.apiVersion], + urlParameters: [ + Parameters.$host, + Parameters.subscriptionId, + Parameters.resourceGroup, + Parameters.workbenchName, + Parameters.chamberName, + Parameters.storageName + ], + headerParameters: [Parameters.accept], + serializer +}; +const deleteOperationSpec: coreClient.OperationSpec = { + path: + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroup}/providers/Microsoft.ModSimWorkbench/workbenches/{workbenchName}/chambers/{chamberName}/storages/{storageName}", + httpMethod: "DELETE", + responses: { + 200: { + bodyMapper: Mappers.Storage + }, + 201: { + bodyMapper: Mappers.Storage + }, + 202: { + bodyMapper: Mappers.Storage + }, + 204: { + bodyMapper: Mappers.Storage + }, + default: { + bodyMapper: Mappers.ErrorResponseAutoGenerated + } + }, + queryParameters: [Parameters.apiVersion], + urlParameters: [ + Parameters.$host, + Parameters.subscriptionId, + Parameters.resourceGroup, + Parameters.workbenchName, + Parameters.chamberName, + Parameters.storageName + ], + headerParameters: [Parameters.accept], + serializer +}; +const listOperationSpec: coreClient.OperationSpec = { + path: + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroup}/providers/Microsoft.ModSimWorkbench/workbenches/{workbenchName}/chambers/{chamberName}/storages", + httpMethod: "GET", + responses: { + 200: { + bodyMapper: Mappers.StoragePageableList + }, + default: { + bodyMapper: Mappers.ErrorResponse + } + }, + queryParameters: [Parameters.apiVersion], + urlParameters: [ + Parameters.$host, + Parameters.subscriptionId, + Parameters.resourceGroup, + Parameters.workbenchName, + Parameters.chamberName + ], + headerParameters: [Parameters.accept], + serializer +}; +const listNextOperationSpec: coreClient.OperationSpec = { + path: "{nextLink}", + httpMethod: "GET", + responses: { + 200: { + bodyMapper: Mappers.StoragePageableList + }, + default: { + bodyMapper: Mappers.ErrorResponse + } + }, + urlParameters: [ + Parameters.$host, + Parameters.subscriptionId, + Parameters.resourceGroup, + Parameters.nextLink, + Parameters.workbenchName, + Parameters.chamberName + ], + headerParameters: [Parameters.accept], + serializer +}; diff --git a/sdk/modsimworkbench/arm-modsimworkbench/src/operations/workbenches.ts b/sdk/modsimworkbench/arm-modsimworkbench/src/operations/workbenches.ts new file mode 100644 index 000000000000..552758063ea7 --- /dev/null +++ b/sdk/modsimworkbench/arm-modsimworkbench/src/operations/workbenches.ts @@ -0,0 +1,717 @@ +/* + * 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, PageSettings } from "@azure/core-paging"; +import { setContinuationToken } from "../pagingHelper"; +import { Workbenches } from "../operationsInterfaces"; +import * as coreClient from "@azure/core-client"; +import * as Mappers from "../models/mappers"; +import * as Parameters from "../models/parameters"; +import { MicrosoftModSimWorkbench } from "../microsoftModSimWorkbench"; +import { + SimplePollerLike, + OperationState, + createHttpPoller +} from "@azure/core-lro"; +import { createLroSpec } from "../lroImpl"; +import { + Workbench, + WorkbenchesListBySubscriptionNextOptionalParams, + WorkbenchesListBySubscriptionOptionalParams, + WorkbenchesListBySubscriptionResponse, + WorkbenchesListByResourceGroupNextOptionalParams, + WorkbenchesListByResourceGroupOptionalParams, + WorkbenchesListByResourceGroupResponse, + WorkbenchesGetOptionalParams, + WorkbenchesGetResponse, + WorkbenchesCreateOrUpdateOptionalParams, + WorkbenchesCreateOrUpdateResponse, + WorkbenchesUpdateOptionalParams, + WorkbenchesUpdateResponse, + WorkbenchesDeleteOptionalParams, + WorkbenchesDeleteResponse, + WorkbenchesListBySubscriptionNextResponse, + WorkbenchesListByResourceGroupNextResponse +} from "../models"; + +/// +/** Class containing Workbenches operations. */ +export class WorkbenchesImpl implements Workbenches { + private readonly client: MicrosoftModSimWorkbench; + + /** + * Initialize a new instance of the class Workbenches class. + * @param client Reference to the service client + */ + constructor(client: MicrosoftModSimWorkbench) { + this.client = client; + } + + /** + * Lists Workbenches by subscription. + * @param options The options parameters. + */ + public listBySubscription( + options?: WorkbenchesListBySubscriptionOptionalParams + ): PagedAsyncIterableIterator { + const iter = this.listBySubscriptionPagingAll(options); + return { + next() { + return iter.next(); + }, + [Symbol.asyncIterator]() { + return this; + }, + byPage: (settings?: PageSettings) => { + if (settings?.maxPageSize) { + throw new Error("maxPageSize is not supported by this operation."); + } + return this.listBySubscriptionPagingPage(options, settings); + } + }; + } + + private async *listBySubscriptionPagingPage( + options?: WorkbenchesListBySubscriptionOptionalParams, + settings?: PageSettings + ): AsyncIterableIterator { + let result: WorkbenchesListBySubscriptionResponse; + let continuationToken = settings?.continuationToken; + if (!continuationToken) { + result = await this._listBySubscription(options); + let page = result.value || []; + continuationToken = result.nextLink; + setContinuationToken(page, continuationToken); + yield page; + } + while (continuationToken) { + result = await this._listBySubscriptionNext(continuationToken, options); + continuationToken = result.nextLink; + let page = result.value || []; + setContinuationToken(page, continuationToken); + yield page; + } + } + + private async *listBySubscriptionPagingAll( + options?: WorkbenchesListBySubscriptionOptionalParams + ): AsyncIterableIterator { + for await (const page of this.listBySubscriptionPagingPage(options)) { + yield* page; + } + } + + /** + * Lists workbenches by resource group. + * @param resourceGroup the workbench name. + * @param options The options parameters. + */ + public listByResourceGroup( + resourceGroup: string, + options?: WorkbenchesListByResourceGroupOptionalParams + ): PagedAsyncIterableIterator { + const iter = this.listByResourceGroupPagingAll(resourceGroup, options); + return { + next() { + return iter.next(); + }, + [Symbol.asyncIterator]() { + return this; + }, + byPage: (settings?: PageSettings) => { + if (settings?.maxPageSize) { + throw new Error("maxPageSize is not supported by this operation."); + } + return this.listByResourceGroupPagingPage( + resourceGroup, + options, + settings + ); + } + }; + } + + private async *listByResourceGroupPagingPage( + resourceGroup: string, + options?: WorkbenchesListByResourceGroupOptionalParams, + settings?: PageSettings + ): AsyncIterableIterator { + let result: WorkbenchesListByResourceGroupResponse; + let continuationToken = settings?.continuationToken; + if (!continuationToken) { + result = await this._listByResourceGroup(resourceGroup, options); + let page = result.value || []; + continuationToken = result.nextLink; + setContinuationToken(page, continuationToken); + yield page; + } + while (continuationToken) { + result = await this._listByResourceGroupNext( + resourceGroup, + continuationToken, + options + ); + continuationToken = result.nextLink; + let page = result.value || []; + setContinuationToken(page, continuationToken); + yield page; + } + } + + private async *listByResourceGroupPagingAll( + resourceGroup: string, + options?: WorkbenchesListByResourceGroupOptionalParams + ): AsyncIterableIterator { + for await (const page of this.listByResourceGroupPagingPage( + resourceGroup, + options + )) { + yield* page; + } + } + + /** + * Lists Workbenches by subscription. + * @param options The options parameters. + */ + private _listBySubscription( + options?: WorkbenchesListBySubscriptionOptionalParams + ): Promise { + return this.client.sendOperationRequest( + { options }, + listBySubscriptionOperationSpec + ); + } + + /** + * Lists workbenches by resource group. + * @param resourceGroup the workbench name. + * @param options The options parameters. + */ + private _listByResourceGroup( + resourceGroup: string, + options?: WorkbenchesListByResourceGroupOptionalParams + ): Promise { + return this.client.sendOperationRequest( + { resourceGroup, options }, + listByResourceGroupOperationSpec + ); + } + + /** + * Lists workbenches. + * @param resourceGroup the resource group. + * @param name the workbench name. + * @param options The options parameters. + */ + async beginGet( + resourceGroup: string, + name: string, + options?: WorkbenchesGetOptionalParams + ): Promise< + SimplePollerLike< + OperationState, + WorkbenchesGetResponse + > + > { + const directSendOperation = async ( + args: coreClient.OperationArguments, + spec: coreClient.OperationSpec + ): Promise => { + return this.client.sendOperationRequest(args, spec); + }; + const sendOperationFn = 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 = createLroSpec({ + sendOperationFn, + args: { resourceGroup, name, options }, + spec: getOperationSpec + }); + const poller = await createHttpPoller< + WorkbenchesGetResponse, + OperationState + >(lro, { + restoreFrom: options?.resumeFrom, + intervalInMs: options?.updateIntervalInMs, + resourceLocationConfig: "location" + }); + await poller.poll(); + return poller; + } + + /** + * Lists workbenches. + * @param resourceGroup the resource group. + * @param name the workbench name. + * @param options The options parameters. + */ + async beginGetAndWait( + resourceGroup: string, + name: string, + options?: WorkbenchesGetOptionalParams + ): Promise { + const poller = await this.beginGet(resourceGroup, name, options); + return poller.pollUntilDone(); + } + + /** + * Create workbenches. + * @param resourceGroup the resource group. + * @param name the workbench name. + * @param options The options parameters. + */ + async beginCreateOrUpdate( + resourceGroup: string, + name: string, + options?: WorkbenchesCreateOrUpdateOptionalParams + ): Promise< + SimplePollerLike< + OperationState, + WorkbenchesCreateOrUpdateResponse + > + > { + const directSendOperation = async ( + args: coreClient.OperationArguments, + spec: coreClient.OperationSpec + ): Promise => { + return this.client.sendOperationRequest(args, spec); + }; + const sendOperationFn = 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 = createLroSpec({ + sendOperationFn, + args: { resourceGroup, name, options }, + spec: createOrUpdateOperationSpec + }); + const poller = await createHttpPoller< + WorkbenchesCreateOrUpdateResponse, + OperationState + >(lro, { + restoreFrom: options?.resumeFrom, + intervalInMs: options?.updateIntervalInMs, + resourceLocationConfig: "azure-async-operation" + }); + await poller.poll(); + return poller; + } + + /** + * Create workbenches. + * @param resourceGroup the resource group. + * @param name the workbench name. + * @param options The options parameters. + */ + async beginCreateOrUpdateAndWait( + resourceGroup: string, + name: string, + options?: WorkbenchesCreateOrUpdateOptionalParams + ): Promise { + const poller = await this.beginCreateOrUpdate(resourceGroup, name, options); + return poller.pollUntilDone(); + } + + /** + * Update workbenches. + * @param resourceGroup the resource group. + * @param name the workbench name. + * @param options The options parameters. + */ + update( + resourceGroup: string, + name: string, + options?: WorkbenchesUpdateOptionalParams + ): Promise { + return this.client.sendOperationRequest( + { resourceGroup, name, options }, + updateOperationSpec + ); + } + + /** + * Delete workbenches. + * @param resourceGroup the resource group. + * @param name the workbench name. + * @param options The options parameters. + */ + async beginDelete( + resourceGroup: string, + name: string, + options?: WorkbenchesDeleteOptionalParams + ): Promise< + SimplePollerLike< + OperationState, + WorkbenchesDeleteResponse + > + > { + const directSendOperation = async ( + args: coreClient.OperationArguments, + spec: coreClient.OperationSpec + ): Promise => { + return this.client.sendOperationRequest(args, spec); + }; + const sendOperationFn = 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 = createLroSpec({ + sendOperationFn, + args: { resourceGroup, name, options }, + spec: deleteOperationSpec + }); + const poller = await createHttpPoller< + WorkbenchesDeleteResponse, + OperationState + >(lro, { + restoreFrom: options?.resumeFrom, + intervalInMs: options?.updateIntervalInMs, + resourceLocationConfig: "location" + }); + await poller.poll(); + return poller; + } + + /** + * Delete workbenches. + * @param resourceGroup the resource group. + * @param name the workbench name. + * @param options The options parameters. + */ + async beginDeleteAndWait( + resourceGroup: string, + name: string, + options?: WorkbenchesDeleteOptionalParams + ): Promise { + const poller = await this.beginDelete(resourceGroup, name, options); + return poller.pollUntilDone(); + } + + /** + * ListBySubscriptionNext + * @param nextLink The nextLink from the previous successful call to the ListBySubscription method. + * @param options The options parameters. + */ + private _listBySubscriptionNext( + nextLink: string, + options?: WorkbenchesListBySubscriptionNextOptionalParams + ): Promise { + return this.client.sendOperationRequest( + { nextLink, options }, + listBySubscriptionNextOperationSpec + ); + } + + /** + * ListByResourceGroupNext + * @param resourceGroup the workbench name. + * @param nextLink The nextLink from the previous successful call to the ListByResourceGroup method. + * @param options The options parameters. + */ + private _listByResourceGroupNext( + resourceGroup: string, + nextLink: string, + options?: WorkbenchesListByResourceGroupNextOptionalParams + ): Promise { + return this.client.sendOperationRequest( + { resourceGroup, nextLink, options }, + listByResourceGroupNextOperationSpec + ); + } +} +// Operation Specifications +const serializer = coreClient.createSerializer(Mappers, /* isXml */ false); + +const listBySubscriptionOperationSpec: coreClient.OperationSpec = { + path: + "/subscriptions/{subscriptionId}/providers/Microsoft.ModSimWorkbench/workbenches", + httpMethod: "GET", + responses: { + 200: { + bodyMapper: Mappers.WorkbenchPageableList + }, + default: { + bodyMapper: Mappers.ErrorResponse + } + }, + queryParameters: [Parameters.apiVersion], + urlParameters: [Parameters.$host, Parameters.subscriptionId], + headerParameters: [Parameters.accept], + serializer +}; +const listByResourceGroupOperationSpec: coreClient.OperationSpec = { + path: + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroup}/providers/Microsoft.ModSimWorkbench/workbenches", + httpMethod: "GET", + responses: { + 200: { + bodyMapper: Mappers.WorkbenchPageableList + }, + default: { + bodyMapper: Mappers.ErrorResponse + } + }, + queryParameters: [Parameters.apiVersion], + urlParameters: [ + Parameters.$host, + Parameters.subscriptionId, + Parameters.resourceGroup + ], + headerParameters: [Parameters.accept], + serializer +}; +const getOperationSpec: coreClient.OperationSpec = { + path: + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroup}/providers/Microsoft.ModSimWorkbench/workbenches/{name}", + httpMethod: "GET", + responses: { + 200: { + bodyMapper: Mappers.Workbench + }, + 201: { + bodyMapper: Mappers.Workbench + }, + 202: { + bodyMapper: Mappers.Workbench + }, + 204: { + bodyMapper: Mappers.Workbench + }, + default: { + bodyMapper: Mappers.ErrorResponse + } + }, + queryParameters: [Parameters.apiVersion], + urlParameters: [ + Parameters.$host, + Parameters.subscriptionId, + Parameters.resourceGroup, + Parameters.name + ], + headerParameters: [Parameters.accept], + serializer +}; +const createOrUpdateOperationSpec: coreClient.OperationSpec = { + path: + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroup}/providers/Microsoft.ModSimWorkbench/workbenches/{name}", + httpMethod: "PUT", + responses: { + 200: { + bodyMapper: Mappers.Workbench + }, + 201: { + bodyMapper: Mappers.Workbench + }, + 202: { + bodyMapper: Mappers.Workbench + }, + 204: { + bodyMapper: Mappers.Workbench + }, + default: { + bodyMapper: Mappers.ErrorResponse + } + }, + requestBody: Parameters.body, + queryParameters: [Parameters.apiVersion], + urlParameters: [ + Parameters.$host, + Parameters.subscriptionId, + Parameters.resourceGroup, + Parameters.name + ], + headerParameters: [Parameters.accept, Parameters.contentType], + mediaType: "json", + serializer +}; +const updateOperationSpec: coreClient.OperationSpec = { + path: + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroup}/providers/Microsoft.ModSimWorkbench/workbenches/{name}", + httpMethod: "PATCH", + responses: { + 200: { + bodyMapper: Mappers.Workbench + }, + 201: { + bodyMapper: Mappers.Workbench + }, + default: { + bodyMapper: Mappers.ErrorResponse + } + }, + requestBody: Parameters.body, + queryParameters: [Parameters.apiVersion], + urlParameters: [ + Parameters.$host, + Parameters.subscriptionId, + Parameters.resourceGroup, + Parameters.name + ], + headerParameters: [Parameters.accept, Parameters.contentType], + mediaType: "json", + serializer +}; +const deleteOperationSpec: coreClient.OperationSpec = { + path: + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroup}/providers/Microsoft.ModSimWorkbench/workbenches/{name}", + httpMethod: "DELETE", + responses: { + 200: { + bodyMapper: Mappers.Workbench + }, + 201: { + bodyMapper: Mappers.Workbench + }, + 202: { + bodyMapper: Mappers.Workbench + }, + 204: { + bodyMapper: Mappers.Workbench + }, + default: { + bodyMapper: Mappers.ErrorResponse + } + }, + queryParameters: [Parameters.apiVersion], + urlParameters: [ + Parameters.$host, + Parameters.subscriptionId, + Parameters.resourceGroup, + Parameters.name + ], + headerParameters: [Parameters.accept], + serializer +}; +const listBySubscriptionNextOperationSpec: coreClient.OperationSpec = { + path: "{nextLink}", + httpMethod: "GET", + responses: { + 200: { + bodyMapper: Mappers.WorkbenchPageableList + }, + default: { + bodyMapper: Mappers.ErrorResponse + } + }, + urlParameters: [ + Parameters.$host, + Parameters.subscriptionId, + Parameters.nextLink + ], + headerParameters: [Parameters.accept], + serializer +}; +const listByResourceGroupNextOperationSpec: coreClient.OperationSpec = { + path: "{nextLink}", + httpMethod: "GET", + responses: { + 200: { + bodyMapper: Mappers.WorkbenchPageableList + }, + default: { + bodyMapper: Mappers.ErrorResponse + } + }, + urlParameters: [ + Parameters.$host, + Parameters.subscriptionId, + Parameters.resourceGroup, + Parameters.nextLink + ], + headerParameters: [Parameters.accept], + serializer +}; diff --git a/sdk/modsimworkbench/arm-modsimworkbench/src/operations/workloads.ts b/sdk/modsimworkbench/arm-modsimworkbench/src/operations/workloads.ts new file mode 100644 index 000000000000..8d6aabd66c9f --- /dev/null +++ b/sdk/modsimworkbench/arm-modsimworkbench/src/operations/workloads.ts @@ -0,0 +1,965 @@ +/* + * 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, PageSettings } from "@azure/core-paging"; +import { setContinuationToken } from "../pagingHelper"; +import { Workloads } from "../operationsInterfaces"; +import * as coreClient from "@azure/core-client"; +import * as Mappers from "../models/mappers"; +import * as Parameters from "../models/parameters"; +import { MicrosoftModSimWorkbench } from "../microsoftModSimWorkbench"; +import { + SimplePollerLike, + OperationState, + createHttpPoller +} from "@azure/core-lro"; +import { createLroSpec } from "../lroImpl"; +import { + Workload, + WorkloadsListNextOptionalParams, + WorkloadsListOptionalParams, + WorkloadsListResponse, + WorkloadsStartOptionalParams, + WorkloadsStopOptionalParams, + WorkloadsRestartOptionalParams, + WorkloadsCreateOrUpdateOptionalParams, + WorkloadsCreateOrUpdateResponse, + WorkloadsUpdateOptionalParams, + WorkloadsUpdateResponse, + WorkloadsGetOptionalParams, + WorkloadsGetResponse, + WorkloadsDeleteOptionalParams, + WorkloadsDeleteResponse, + WorkloadsListNextResponse +} from "../models"; + +/// +/** Class containing Workloads operations. */ +export class WorkloadsImpl implements Workloads { + private readonly client: MicrosoftModSimWorkbench; + + /** + * Initialize a new instance of the class Workloads class. + * @param client Reference to the service client + */ + constructor(client: MicrosoftModSimWorkbench) { + this.client = client; + } + + /** + * Lists all workloads. + * @param resourceGroup The name of the resource group. + * @param workbenchName The name of the workbench. + * @param chamberName The name of the chamber. + * @param options The options parameters. + */ + public list( + resourceGroup: string, + workbenchName: string, + chamberName: string, + options?: WorkloadsListOptionalParams + ): PagedAsyncIterableIterator { + const iter = this.listPagingAll( + resourceGroup, + workbenchName, + chamberName, + options + ); + return { + next() { + return iter.next(); + }, + [Symbol.asyncIterator]() { + return this; + }, + byPage: (settings?: PageSettings) => { + if (settings?.maxPageSize) { + throw new Error("maxPageSize is not supported by this operation."); + } + return this.listPagingPage( + resourceGroup, + workbenchName, + chamberName, + options, + settings + ); + } + }; + } + + private async *listPagingPage( + resourceGroup: string, + workbenchName: string, + chamberName: string, + options?: WorkloadsListOptionalParams, + settings?: PageSettings + ): AsyncIterableIterator { + let result: WorkloadsListResponse; + let continuationToken = settings?.continuationToken; + if (!continuationToken) { + result = await this._list( + resourceGroup, + workbenchName, + chamberName, + options + ); + let page = result.value || []; + continuationToken = result.nextLink; + setContinuationToken(page, continuationToken); + yield page; + } + while (continuationToken) { + result = await this._listNext( + resourceGroup, + workbenchName, + chamberName, + continuationToken, + options + ); + continuationToken = result.nextLink; + let page = result.value || []; + setContinuationToken(page, continuationToken); + yield page; + } + } + + private async *listPagingAll( + resourceGroup: string, + workbenchName: string, + chamberName: string, + options?: WorkloadsListOptionalParams + ): AsyncIterableIterator { + for await (const page of this.listPagingPage( + resourceGroup, + workbenchName, + chamberName, + options + )) { + yield* page; + } + } + + /** + * Perform Start operation. + * @param resourceGroup the resource group. + * @param workbenchName the workbench name. + * @param chamberName the chamber name. + * @param name the workload name. + * @param options The options parameters. + */ + async beginStart( + resourceGroup: string, + workbenchName: string, + chamberName: string, + name: string, + options?: WorkloadsStartOptionalParams + ): Promise, void>> { + const directSendOperation = async ( + args: coreClient.OperationArguments, + spec: coreClient.OperationSpec + ): Promise => { + return this.client.sendOperationRequest(args, spec); + }; + const sendOperationFn = 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 = createLroSpec({ + sendOperationFn, + args: { resourceGroup, workbenchName, chamberName, name, options }, + spec: startOperationSpec + }); + const poller = await createHttpPoller>(lro, { + restoreFrom: options?.resumeFrom, + intervalInMs: options?.updateIntervalInMs, + resourceLocationConfig: "location" + }); + await poller.poll(); + return poller; + } + + /** + * Perform Start operation. + * @param resourceGroup the resource group. + * @param workbenchName the workbench name. + * @param chamberName the chamber name. + * @param name the workload name. + * @param options The options parameters. + */ + async beginStartAndWait( + resourceGroup: string, + workbenchName: string, + chamberName: string, + name: string, + options?: WorkloadsStartOptionalParams + ): Promise { + const poller = await this.beginStart( + resourceGroup, + workbenchName, + chamberName, + name, + options + ); + return poller.pollUntilDone(); + } + + /** + * Perform Stop operation. + * @param resourceGroup the resource group. + * @param workbenchName the workbench name. + * @param chamberName the chamber name. + * @param name the workload name. + * @param options The options parameters. + */ + async beginStop( + resourceGroup: string, + workbenchName: string, + chamberName: string, + name: string, + options?: WorkloadsStopOptionalParams + ): Promise, void>> { + const directSendOperation = async ( + args: coreClient.OperationArguments, + spec: coreClient.OperationSpec + ): Promise => { + return this.client.sendOperationRequest(args, spec); + }; + const sendOperationFn = 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 = createLroSpec({ + sendOperationFn, + args: { resourceGroup, workbenchName, chamberName, name, options }, + spec: stopOperationSpec + }); + const poller = await createHttpPoller>(lro, { + restoreFrom: options?.resumeFrom, + intervalInMs: options?.updateIntervalInMs, + resourceLocationConfig: "location" + }); + await poller.poll(); + return poller; + } + + /** + * Perform Stop operation. + * @param resourceGroup the resource group. + * @param workbenchName the workbench name. + * @param chamberName the chamber name. + * @param name the workload name. + * @param options The options parameters. + */ + async beginStopAndWait( + resourceGroup: string, + workbenchName: string, + chamberName: string, + name: string, + options?: WorkloadsStopOptionalParams + ): Promise { + const poller = await this.beginStop( + resourceGroup, + workbenchName, + chamberName, + name, + options + ); + return poller.pollUntilDone(); + } + + /** + * Perform Restart operation. + * @param resourceGroup the resource group. + * @param workbenchName the workbench name. + * @param chamberName the chamber name. + * @param name the workload name. + * @param options The options parameters. + */ + async beginRestart( + resourceGroup: string, + workbenchName: string, + chamberName: string, + name: string, + options?: WorkloadsRestartOptionalParams + ): Promise, void>> { + const directSendOperation = async ( + args: coreClient.OperationArguments, + spec: coreClient.OperationSpec + ): Promise => { + return this.client.sendOperationRequest(args, spec); + }; + const sendOperationFn = 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 = createLroSpec({ + sendOperationFn, + args: { resourceGroup, workbenchName, chamberName, name, options }, + spec: restartOperationSpec + }); + const poller = await createHttpPoller>(lro, { + restoreFrom: options?.resumeFrom, + intervalInMs: options?.updateIntervalInMs, + resourceLocationConfig: "location" + }); + await poller.poll(); + return poller; + } + + /** + * Perform Restart operation. + * @param resourceGroup the resource group. + * @param workbenchName the workbench name. + * @param chamberName the chamber name. + * @param name the workload name. + * @param options The options parameters. + */ + async beginRestartAndWait( + resourceGroup: string, + workbenchName: string, + chamberName: string, + name: string, + options?: WorkloadsRestartOptionalParams + ): Promise { + const poller = await this.beginRestart( + resourceGroup, + workbenchName, + chamberName, + name, + options + ); + return poller.pollUntilDone(); + } + + /** + * Creates or updates the specified workload. + * @param resourceGroup The name of the resource group. + * @param workbenchName The name of the workbench. + * @param chamberName The name of the chamber. + * @param workloadName The name of the workload. + * @param options The options parameters. + */ + async beginCreateOrUpdate( + resourceGroup: string, + workbenchName: string, + chamberName: string, + workloadName: string, + options?: WorkloadsCreateOrUpdateOptionalParams + ): Promise< + SimplePollerLike< + OperationState, + WorkloadsCreateOrUpdateResponse + > + > { + const directSendOperation = async ( + args: coreClient.OperationArguments, + spec: coreClient.OperationSpec + ): Promise => { + return this.client.sendOperationRequest(args, spec); + }; + const sendOperationFn = 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 = createLroSpec({ + sendOperationFn, + args: { + resourceGroup, + workbenchName, + chamberName, + workloadName, + options + }, + spec: createOrUpdateOperationSpec + }); + const poller = await createHttpPoller< + WorkloadsCreateOrUpdateResponse, + OperationState + >(lro, { + restoreFrom: options?.resumeFrom, + intervalInMs: options?.updateIntervalInMs, + resourceLocationConfig: "azure-async-operation" + }); + await poller.poll(); + return poller; + } + + /** + * Creates or updates the specified workload. + * @param resourceGroup The name of the resource group. + * @param workbenchName The name of the workbench. + * @param chamberName The name of the chamber. + * @param workloadName The name of the workload. + * @param options The options parameters. + */ + async beginCreateOrUpdateAndWait( + resourceGroup: string, + workbenchName: string, + chamberName: string, + workloadName: string, + options?: WorkloadsCreateOrUpdateOptionalParams + ): Promise { + const poller = await this.beginCreateOrUpdate( + resourceGroup, + workbenchName, + chamberName, + workloadName, + options + ); + return poller.pollUntilDone(); + } + + /** + * Updates the specified workload. + * @param resourceGroup The name of the resource group. + * @param workbenchName The name of the workbench. + * @param chamberName The name of the chamber. + * @param workloadName The name of the workload. + * @param options The options parameters. + */ + update( + resourceGroup: string, + workbenchName: string, + chamberName: string, + workloadName: string, + options?: WorkloadsUpdateOptionalParams + ): Promise { + return this.client.sendOperationRequest( + { resourceGroup, workbenchName, chamberName, workloadName, options }, + updateOperationSpec + ); + } + + /** + * Gets information about the specified workload. + * @param resourceGroup The name of the resource group. + * @param workbenchName The name of the workbench. + * @param chamberName The name of the chamber. + * @param workloadName The name of the workload. + * @param options The options parameters. + */ + get( + resourceGroup: string, + workbenchName: string, + chamberName: string, + workloadName: string, + options?: WorkloadsGetOptionalParams + ): Promise { + return this.client.sendOperationRequest( + { resourceGroup, workbenchName, chamberName, workloadName, options }, + getOperationSpec + ); + } + + /** + * Deletes the specified workload. + * @param resourceGroup The name of the resource group. + * @param workbenchName The name of the workbench. + * @param chamberName The name of the chamber. + * @param workloadName The name of the workload. + * @param options The options parameters. + */ + async beginDelete( + resourceGroup: string, + workbenchName: string, + chamberName: string, + workloadName: string, + options?: WorkloadsDeleteOptionalParams + ): Promise< + SimplePollerLike< + OperationState, + WorkloadsDeleteResponse + > + > { + const directSendOperation = async ( + args: coreClient.OperationArguments, + spec: coreClient.OperationSpec + ): Promise => { + return this.client.sendOperationRequest(args, spec); + }; + const sendOperationFn = 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 = createLroSpec({ + sendOperationFn, + args: { + resourceGroup, + workbenchName, + chamberName, + workloadName, + options + }, + spec: deleteOperationSpec + }); + const poller = await createHttpPoller< + WorkloadsDeleteResponse, + OperationState + >(lro, { + restoreFrom: options?.resumeFrom, + intervalInMs: options?.updateIntervalInMs, + resourceLocationConfig: "location" + }); + await poller.poll(); + return poller; + } + + /** + * Deletes the specified workload. + * @param resourceGroup The name of the resource group. + * @param workbenchName The name of the workbench. + * @param chamberName The name of the chamber. + * @param workloadName The name of the workload. + * @param options The options parameters. + */ + async beginDeleteAndWait( + resourceGroup: string, + workbenchName: string, + chamberName: string, + workloadName: string, + options?: WorkloadsDeleteOptionalParams + ): Promise { + const poller = await this.beginDelete( + resourceGroup, + workbenchName, + chamberName, + workloadName, + options + ); + return poller.pollUntilDone(); + } + + /** + * Lists all workloads. + * @param resourceGroup The name of the resource group. + * @param workbenchName The name of the workbench. + * @param chamberName The name of the chamber. + * @param options The options parameters. + */ + private _list( + resourceGroup: string, + workbenchName: string, + chamberName: string, + options?: WorkloadsListOptionalParams + ): Promise { + return this.client.sendOperationRequest( + { resourceGroup, workbenchName, chamberName, options }, + listOperationSpec + ); + } + + /** + * ListNext + * @param resourceGroup The name of the resource group. + * @param workbenchName The name of the workbench. + * @param chamberName The name of the chamber. + * @param nextLink The nextLink from the previous successful call to the List method. + * @param options The options parameters. + */ + private _listNext( + resourceGroup: string, + workbenchName: string, + chamberName: string, + nextLink: string, + options?: WorkloadsListNextOptionalParams + ): Promise { + return this.client.sendOperationRequest( + { resourceGroup, workbenchName, chamberName, nextLink, options }, + listNextOperationSpec + ); + } +} +// Operation Specifications +const serializer = coreClient.createSerializer(Mappers, /* isXml */ false); + +const startOperationSpec: coreClient.OperationSpec = { + path: + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroup}/providers/Microsoft.ModSimWorkbench/workbenches/{workbenchName}/chambers/{chamberName}/workloads/{name}/start", + httpMethod: "POST", + responses: { + 200: {}, + 201: {}, + 202: {}, + 204: {}, + default: { + bodyMapper: Mappers.ErrorResponse + } + }, + queryParameters: [Parameters.apiVersion], + urlParameters: [ + Parameters.$host, + Parameters.subscriptionId, + Parameters.resourceGroup, + Parameters.name, + Parameters.workbenchName, + Parameters.chamberName + ], + headerParameters: [Parameters.accept], + serializer +}; +const stopOperationSpec: coreClient.OperationSpec = { + path: + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroup}/providers/Microsoft.ModSimWorkbench/workbenches/{workbenchName}/chambers/{chamberName}/workloads/{name}/stop", + httpMethod: "POST", + responses: { + 200: {}, + 201: {}, + 202: {}, + 204: {}, + default: { + bodyMapper: Mappers.ErrorResponse + } + }, + queryParameters: [Parameters.apiVersion], + urlParameters: [ + Parameters.$host, + Parameters.subscriptionId, + Parameters.resourceGroup, + Parameters.name, + Parameters.workbenchName, + Parameters.chamberName + ], + headerParameters: [Parameters.accept], + serializer +}; +const restartOperationSpec: coreClient.OperationSpec = { + path: + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroup}/providers/Microsoft.ModSimWorkbench/workbenches/{workbenchName}/chambers/{chamberName}/workloads/{name}/restart", + httpMethod: "POST", + responses: { + 200: {}, + 201: {}, + 202: {}, + 204: {}, + default: { + bodyMapper: Mappers.ErrorResponse + } + }, + queryParameters: [Parameters.apiVersion], + urlParameters: [ + Parameters.$host, + Parameters.subscriptionId, + Parameters.resourceGroup, + Parameters.name, + Parameters.workbenchName, + Parameters.chamberName + ], + headerParameters: [Parameters.accept], + serializer +}; +const createOrUpdateOperationSpec: coreClient.OperationSpec = { + path: + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroup}/providers/Microsoft.ModSimWorkbench/workbenches/{workbenchName}/chambers/{chamberName}/workloads/{workloadName}", + httpMethod: "PUT", + responses: { + 200: { + bodyMapper: Mappers.Workload + }, + 201: { + bodyMapper: Mappers.Workload + }, + 202: { + bodyMapper: Mappers.Workload + }, + 204: { + bodyMapper: Mappers.Workload + }, + default: { + bodyMapper: Mappers.ErrorResponse + } + }, + requestBody: Parameters.parameters2, + queryParameters: [Parameters.apiVersion], + urlParameters: [ + Parameters.$host, + Parameters.subscriptionId, + Parameters.resourceGroup, + Parameters.workbenchName, + Parameters.chamberName, + Parameters.workloadName + ], + headerParameters: [Parameters.accept, Parameters.contentType], + mediaType: "json", + serializer +}; +const updateOperationSpec: coreClient.OperationSpec = { + path: + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroup}/providers/Microsoft.ModSimWorkbench/workbenches/{workbenchName}/chambers/{chamberName}/workloads/{workloadName}", + httpMethod: "PATCH", + responses: { + 200: { + bodyMapper: Mappers.Workload + }, + 201: { + bodyMapper: Mappers.Workload + }, + default: { + bodyMapper: Mappers.ErrorResponse + } + }, + requestBody: Parameters.parameters2, + queryParameters: [Parameters.apiVersion], + urlParameters: [ + Parameters.$host, + Parameters.subscriptionId, + Parameters.resourceGroup, + Parameters.workbenchName, + Parameters.chamberName, + Parameters.workloadName + ], + headerParameters: [Parameters.accept, Parameters.contentType1], + mediaType: "json", + serializer +}; +const getOperationSpec: coreClient.OperationSpec = { + path: + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroup}/providers/Microsoft.ModSimWorkbench/workbenches/{workbenchName}/chambers/{chamberName}/workloads/{workloadName}", + httpMethod: "GET", + responses: { + 200: { + bodyMapper: Mappers.Workload + }, + default: { + bodyMapper: Mappers.ErrorResponse + } + }, + queryParameters: [Parameters.apiVersion], + urlParameters: [ + Parameters.$host, + Parameters.subscriptionId, + Parameters.resourceGroup, + Parameters.workbenchName, + Parameters.chamberName, + Parameters.workloadName + ], + headerParameters: [Parameters.accept], + serializer +}; +const deleteOperationSpec: coreClient.OperationSpec = { + path: + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroup}/providers/Microsoft.ModSimWorkbench/workbenches/{workbenchName}/chambers/{chamberName}/workloads/{workloadName}", + httpMethod: "DELETE", + responses: { + 200: { + bodyMapper: Mappers.Workload + }, + 201: { + bodyMapper: Mappers.Workload + }, + 202: { + bodyMapper: Mappers.Workload + }, + 204: { + bodyMapper: Mappers.Workload + }, + default: { + bodyMapper: Mappers.ErrorResponse + } + }, + queryParameters: [Parameters.apiVersion], + urlParameters: [ + Parameters.$host, + Parameters.subscriptionId, + Parameters.resourceGroup, + Parameters.workbenchName, + Parameters.chamberName, + Parameters.workloadName + ], + headerParameters: [Parameters.accept], + serializer +}; +const listOperationSpec: coreClient.OperationSpec = { + path: + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroup}/providers/Microsoft.ModSimWorkbench/workbenches/{workbenchName}/chambers/{chamberName}/workloads", + httpMethod: "GET", + responses: { + 200: { + bodyMapper: Mappers.WorkloadPageableList + }, + default: { + bodyMapper: Mappers.ErrorResponse + } + }, + queryParameters: [Parameters.apiVersion], + urlParameters: [ + Parameters.$host, + Parameters.subscriptionId, + Parameters.resourceGroup, + Parameters.workbenchName, + Parameters.chamberName + ], + headerParameters: [Parameters.accept], + serializer +}; +const listNextOperationSpec: coreClient.OperationSpec = { + path: "{nextLink}", + httpMethod: "GET", + responses: { + 200: { + bodyMapper: Mappers.WorkloadPageableList + }, + default: { + bodyMapper: Mappers.ErrorResponse + } + }, + urlParameters: [ + Parameters.$host, + Parameters.subscriptionId, + Parameters.resourceGroup, + Parameters.nextLink, + Parameters.workbenchName, + Parameters.chamberName + ], + headerParameters: [Parameters.accept], + serializer +}; diff --git a/sdk/modsimworkbench/arm-modsimworkbench/src/operationsInterfaces/chambers.ts b/sdk/modsimworkbench/arm-modsimworkbench/src/operationsInterfaces/chambers.ts new file mode 100644 index 000000000000..958016cdff9d --- /dev/null +++ b/sdk/modsimworkbench/arm-modsimworkbench/src/operationsInterfaces/chambers.ts @@ -0,0 +1,276 @@ +/* + * 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 { SimplePollerLike, OperationState } from "@azure/core-lro"; +import { + Chamber, + ChambersListOptionalParams, + ChambersGetUploadUriOptionalParams, + ChambersGetUploadUriResponse, + ChambersStartOptionalParams, + ChambersStopOptionalParams, + ChambersRestartOptionalParams, + ChambersLicenseUpdateOptionalParams, + ChambersLicenseRestartOptionalParams, + ChambersCreateOrUpdateOptionalParams, + ChambersCreateOrUpdateResponse, + ChambersUpdateOptionalParams, + ChambersUpdateResponse, + ChambersGetOptionalParams, + ChambersGetResponse, + ChambersDeleteOptionalParams, + ChambersDeleteResponse +} from "../models"; + +/// +/** Interface representing a Chambers. */ +export interface Chambers { + /** + * Lists all Chambers. + * @param resourceGroup The name of the resource group. + * @param workbenchName The name of the workbench. + * @param options The options parameters. + */ + list( + resourceGroup: string, + workbenchName: string, + options?: ChambersListOptionalParams + ): PagedAsyncIterableIterator; + /** + * Gets a URI to upload files to the specified Chamber resource. + * @param resourceGroup the resource group. + * @param workbenchName the workbench name. + * @param name the chamber name. + * @param options The options parameters. + */ + getUploadUri( + resourceGroup: string, + workbenchName: string, + name: string, + options?: ChambersGetUploadUriOptionalParams + ): Promise; + /** + * Perform Start operation. + * @param resourceGroup the resource group. + * @param workbenchName the workbench name. + * @param name the chamber name. + * @param options The options parameters. + */ + beginStart( + resourceGroup: string, + workbenchName: string, + name: string, + options?: ChambersStartOptionalParams + ): Promise, void>>; + /** + * Perform Start operation. + * @param resourceGroup the resource group. + * @param workbenchName the workbench name. + * @param name the chamber name. + * @param options The options parameters. + */ + beginStartAndWait( + resourceGroup: string, + workbenchName: string, + name: string, + options?: ChambersStartOptionalParams + ): Promise; + /** + * Perform Stop operation. + * @param resourceGroup the resource group. + * @param workbenchName the workbench name. + * @param name the chamber name. + * @param options The options parameters. + */ + beginStop( + resourceGroup: string, + workbenchName: string, + name: string, + options?: ChambersStopOptionalParams + ): Promise, void>>; + /** + * Perform Stop operation. + * @param resourceGroup the resource group. + * @param workbenchName the workbench name. + * @param name the chamber name. + * @param options The options parameters. + */ + beginStopAndWait( + resourceGroup: string, + workbenchName: string, + name: string, + options?: ChambersStopOptionalParams + ): Promise; + /** + * Perform Restart operation. + * @param resourceGroup the resource group. + * @param workbenchName the workbench name. + * @param name the chamber name. + * @param options The options parameters. + */ + beginRestart( + resourceGroup: string, + workbenchName: string, + name: string, + options?: ChambersRestartOptionalParams + ): Promise, void>>; + /** + * Perform Restart operation. + * @param resourceGroup the resource group. + * @param workbenchName the workbench name. + * @param name the chamber name. + * @param options The options parameters. + */ + beginRestartAndWait( + resourceGroup: string, + workbenchName: string, + name: string, + options?: ChambersRestartOptionalParams + ): Promise; + /** + * Perform Update LicenseServices operation. + * @param resourceGroup the resource group. + * @param workbenchName the workbench name. + * @param name the chamber name. + * @param options The options parameters. + */ + beginLicenseUpdate( + resourceGroup: string, + workbenchName: string, + name: string, + options?: ChambersLicenseUpdateOptionalParams + ): Promise, void>>; + /** + * Perform Update LicenseServices operation. + * @param resourceGroup the resource group. + * @param workbenchName the workbench name. + * @param name the chamber name. + * @param options The options parameters. + */ + beginLicenseUpdateAndWait( + resourceGroup: string, + workbenchName: string, + name: string, + options?: ChambersLicenseUpdateOptionalParams + ): Promise; + /** + * Perform License Restart operation. + * @param resourceGroup the resource group. + * @param workbenchName the workbench name. + * @param name the chamber name. + * @param options The options parameters. + */ + beginLicenseRestart( + resourceGroup: string, + workbenchName: string, + name: string, + options?: ChambersLicenseRestartOptionalParams + ): Promise, void>>; + /** + * Perform License Restart operation. + * @param resourceGroup the resource group. + * @param workbenchName the workbench name. + * @param name the chamber name. + * @param options The options parameters. + */ + beginLicenseRestartAndWait( + resourceGroup: string, + workbenchName: string, + name: string, + options?: ChambersLicenseRestartOptionalParams + ): Promise; + /** + * Creates or updates the specified Chamber. + * @param resourceGroup The name of the resource group. + * @param workbenchName The name of the workbench. + * @param chamberName The name of the chamber. + * @param options The options parameters. + */ + beginCreateOrUpdate( + resourceGroup: string, + workbenchName: string, + chamberName: string, + options?: ChambersCreateOrUpdateOptionalParams + ): Promise< + SimplePollerLike< + OperationState, + ChambersCreateOrUpdateResponse + > + >; + /** + * Creates or updates the specified Chamber. + * @param resourceGroup The name of the resource group. + * @param workbenchName The name of the workbench. + * @param chamberName The name of the chamber. + * @param options The options parameters. + */ + beginCreateOrUpdateAndWait( + resourceGroup: string, + workbenchName: string, + chamberName: string, + options?: ChambersCreateOrUpdateOptionalParams + ): Promise; + /** + * Updates the specified Chamber. + * @param resourceGroup The name of the resource group. + * @param workbenchName The name of the workbench. + * @param chamberName The name of the chamber. + * @param options The options parameters. + */ + update( + resourceGroup: string, + workbenchName: string, + chamberName: string, + options?: ChambersUpdateOptionalParams + ): Promise; + /** + * Gets information about the specified Chamber. + * @param resourceGroup The name of the resource group. + * @param workbenchName The name of the workbench. + * @param chamberName The name of the chamber. + * @param options The options parameters. + */ + get( + resourceGroup: string, + workbenchName: string, + chamberName: string, + options?: ChambersGetOptionalParams + ): Promise; + /** + * Deletes the specified Chamber. + * @param resourceGroup The name of the resource group. + * @param workbenchName The name of the workbench. + * @param chamberName The name of the chamber. + * @param options The options parameters. + */ + beginDelete( + resourceGroup: string, + workbenchName: string, + chamberName: string, + options?: ChambersDeleteOptionalParams + ): Promise< + SimplePollerLike< + OperationState, + ChambersDeleteResponse + > + >; + /** + * Deletes the specified Chamber. + * @param resourceGroup The name of the resource group. + * @param workbenchName The name of the workbench. + * @param chamberName The name of the chamber. + * @param options The options parameters. + */ + beginDeleteAndWait( + resourceGroup: string, + workbenchName: string, + chamberName: string, + options?: ChambersDeleteOptionalParams + ): Promise; +} diff --git a/sdk/modsimworkbench/arm-modsimworkbench/src/operationsInterfaces/connectors.ts b/sdk/modsimworkbench/arm-modsimworkbench/src/operationsInterfaces/connectors.ts new file mode 100644 index 000000000000..1a756894b7cc --- /dev/null +++ b/sdk/modsimworkbench/arm-modsimworkbench/src/operationsInterfaces/connectors.ts @@ -0,0 +1,269 @@ +/* + * 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 { SimplePollerLike, OperationState } from "@azure/core-lro"; +import { + Connector, + ConnectorsListOptionalParams, + ConnectorsStartOptionalParams, + ConnectorsStopOptionalParams, + ConnectorsRestartOptionalParams, + ConnectorsCreateOrUpdateOptionalParams, + ConnectorsCreateOrUpdateResponse, + ConnectorsUpdateOptionalParams, + ConnectorsUpdateResponse, + ConnectorsGetOptionalParams, + ConnectorsGetResponse, + ConnectorsDeleteOptionalParams, + ConnectorsDeleteResponse, + LicenseKeyParameters, + ConnectorsLicenseAddOptionalParams +} from "../models"; + +/// +/** Interface representing a Connectors. */ +export interface Connectors { + /** + * Lists all connectors. + * @param resourceGroup The name of the resource group. + * @param workbenchName The name of the workbench. + * @param chamberName The name of the chamber. + * @param options The options parameters. + */ + list( + resourceGroup: string, + workbenchName: string, + chamberName: string, + options?: ConnectorsListOptionalParams + ): PagedAsyncIterableIterator; + /** + * Perform Start operation. + * @param resourceGroup Name of the resource group + * @param workbenchName Name of the workbench + * @param chamberName the chamber name. + * @param name Name of the connector + * @param options The options parameters. + */ + beginStart( + resourceGroup: string, + workbenchName: string, + chamberName: string, + name: string, + options?: ConnectorsStartOptionalParams + ): Promise, void>>; + /** + * Perform Start operation. + * @param resourceGroup Name of the resource group + * @param workbenchName Name of the workbench + * @param chamberName the chamber name. + * @param name Name of the connector + * @param options The options parameters. + */ + beginStartAndWait( + resourceGroup: string, + workbenchName: string, + chamberName: string, + name: string, + options?: ConnectorsStartOptionalParams + ): Promise; + /** + * Perform Stop operation. + * @param resourceGroup the resource group. + * @param workbenchName the workbench name. + * @param chamberName the chamber name. + * @param name the connector name. + * @param options The options parameters. + */ + beginStop( + resourceGroup: string, + workbenchName: string, + chamberName: string, + name: string, + options?: ConnectorsStopOptionalParams + ): Promise, void>>; + /** + * Perform Stop operation. + * @param resourceGroup the resource group. + * @param workbenchName the workbench name. + * @param chamberName the chamber name. + * @param name the connector name. + * @param options The options parameters. + */ + beginStopAndWait( + resourceGroup: string, + workbenchName: string, + chamberName: string, + name: string, + options?: ConnectorsStopOptionalParams + ): Promise; + /** + * Perform Restart operation. + * @param resourceGroup the resource group. + * @param workbenchName the workbench name. + * @param chamberName the chamber name. + * @param name the connector name. + * @param options The options parameters. + */ + beginRestart( + resourceGroup: string, + workbenchName: string, + chamberName: string, + name: string, + options?: ConnectorsRestartOptionalParams + ): Promise, void>>; + /** + * Perform Restart operation. + * @param resourceGroup the resource group. + * @param workbenchName the workbench name. + * @param chamberName the chamber name. + * @param name the connector name. + * @param options The options parameters. + */ + beginRestartAndWait( + resourceGroup: string, + workbenchName: string, + chamberName: string, + name: string, + options?: ConnectorsRestartOptionalParams + ): Promise; + /** + * Creates or updates the specified connector. + * @param resourceGroup The name of the resource group. + * @param workbenchName The name of the workbench. + * @param chamberName The name of the chamber. + * @param connectorName The name of the connector. + * @param options The options parameters. + */ + beginCreateOrUpdate( + resourceGroup: string, + workbenchName: string, + chamberName: string, + connectorName: string, + options?: ConnectorsCreateOrUpdateOptionalParams + ): Promise< + SimplePollerLike< + OperationState, + ConnectorsCreateOrUpdateResponse + > + >; + /** + * Creates or updates the specified connector. + * @param resourceGroup The name of the resource group. + * @param workbenchName The name of the workbench. + * @param chamberName The name of the chamber. + * @param connectorName The name of the connector. + * @param options The options parameters. + */ + beginCreateOrUpdateAndWait( + resourceGroup: string, + workbenchName: string, + chamberName: string, + connectorName: string, + options?: ConnectorsCreateOrUpdateOptionalParams + ): Promise; + /** + * Updates the specified connectors. + * @param resourceGroup The name of the resource group. + * @param workbenchName The name of the workbench. + * @param chamberName The name of the chamber. + * @param connectorName The name of the connector. + * @param options The options parameters. + */ + update( + resourceGroup: string, + workbenchName: string, + chamberName: string, + connectorName: string, + options?: ConnectorsUpdateOptionalParams + ): Promise; + /** + * Gets information about the specified connector. + * @param resourceGroup The name of the resource group. + * @param workbenchName The name of the workbench. + * @param chamberName The name of the chamber. + * @param connectorName The name of the connector. + * @param options The options parameters. + */ + get( + resourceGroup: string, + workbenchName: string, + chamberName: string, + connectorName: string, + options?: ConnectorsGetOptionalParams + ): Promise; + /** + * Deletes the specified connector. + * @param resourceGroup The name of the resource group. + * @param workbenchName The name of the workbench. + * @param chamberName The name of the chamber. + * @param connectorName The name of the connector. + * @param options The options parameters. + */ + beginDelete( + resourceGroup: string, + workbenchName: string, + chamberName: string, + connectorName: string, + options?: ConnectorsDeleteOptionalParams + ): Promise< + SimplePollerLike< + OperationState, + ConnectorsDeleteResponse + > + >; + /** + * Deletes the specified connector. + * @param resourceGroup The name of the resource group. + * @param workbenchName The name of the workbench. + * @param chamberName The name of the chamber. + * @param connectorName The name of the connector. + * @param options The options parameters. + */ + beginDeleteAndWait( + resourceGroup: string, + workbenchName: string, + chamberName: string, + connectorName: string, + options?: ConnectorsDeleteOptionalParams + ): Promise; + /** + * Add license to an ModSim Workbench connector. + * @param resourceGroup The name of the resource group + * @param workbenchName The name of the workbench + * @param chamberName The name of the chamber. + * @param name The name of the connector. + * @param body License key parameters + * @param options The options parameters. + */ + beginLicenseAdd( + resourceGroup: string, + workbenchName: string, + chamberName: string, + name: string, + body: LicenseKeyParameters, + options?: ConnectorsLicenseAddOptionalParams + ): Promise, void>>; + /** + * Add license to an ModSim Workbench connector. + * @param resourceGroup The name of the resource group + * @param workbenchName The name of the workbench + * @param chamberName The name of the chamber. + * @param name The name of the connector. + * @param body License key parameters + * @param options The options parameters. + */ + beginLicenseAddAndWait( + resourceGroup: string, + workbenchName: string, + chamberName: string, + name: string, + body: LicenseKeyParameters, + options?: ConnectorsLicenseAddOptionalParams + ): Promise; +} diff --git a/sdk/modsimworkbench/arm-modsimworkbench/src/operationsInterfaces/fileOperations.ts b/sdk/modsimworkbench/arm-modsimworkbench/src/operationsInterfaces/fileOperations.ts new file mode 100644 index 000000000000..e609b0c76d68 --- /dev/null +++ b/sdk/modsimworkbench/arm-modsimworkbench/src/operationsInterfaces/fileOperations.ts @@ -0,0 +1,46 @@ +/* + * 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 { SimplePollerLike, OperationState } from "@azure/core-lro"; +import { FileManageOptionalParams, FileManageResponse } from "../models"; + +/** Interface representing a FileOperations. */ +export interface FileOperations { + /** + * Manage files in an ModSim Workbench chamber data pipeline. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workbenchName the workbench name. + * @param chamberName the chamber name. + * @param fileName the file name. + * @param options The options parameters. + */ + beginManage( + resourceGroupName: string, + workbenchName: string, + chamberName: string, + fileName: string, + options?: FileManageOptionalParams + ): Promise< + SimplePollerLike, FileManageResponse> + >; + /** + * Manage files in an ModSim Workbench chamber data pipeline. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workbenchName the workbench name. + * @param chamberName the chamber name. + * @param fileName the file name. + * @param options The options parameters. + */ + beginManageAndWait( + resourceGroupName: string, + workbenchName: string, + chamberName: string, + fileName: string, + options?: FileManageOptionalParams + ): Promise; +} diff --git a/sdk/modsimworkbench/arm-modsimworkbench/src/operationsInterfaces/fileRequest.ts b/sdk/modsimworkbench/arm-modsimworkbench/src/operationsInterfaces/fileRequest.ts new file mode 100644 index 000000000000..0d5c18ecc313 --- /dev/null +++ b/sdk/modsimworkbench/arm-modsimworkbench/src/operationsInterfaces/fileRequest.ts @@ -0,0 +1,52 @@ +/* + * 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 { SimplePollerLike, OperationState } from "@azure/core-lro"; +import { + FileRequestGetDownloadUriOptionalParams, + FileRequestGetDownloadUriResponse +} from "../models"; + +/** Interface representing a FileRequest. */ +export interface FileRequest { + /** + * Get SAS URI to download a file from an ModSim Workbench chamber data pipeline. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workbenchName the workbench name. + * @param chamberName the chamber name. + * @param requestName the file request name. + * @param options The options parameters. + */ + beginGetDownloadUri( + resourceGroupName: string, + workbenchName: string, + chamberName: string, + requestName: string, + options?: FileRequestGetDownloadUriOptionalParams + ): Promise< + SimplePollerLike< + OperationState, + FileRequestGetDownloadUriResponse + > + >; + /** + * Get SAS URI to download a file from an ModSim Workbench chamber data pipeline. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workbenchName the workbench name. + * @param chamberName the chamber name. + * @param requestName the file request name. + * @param options The options parameters. + */ + beginGetDownloadUriAndWait( + resourceGroupName: string, + workbenchName: string, + chamberName: string, + requestName: string, + options?: FileRequestGetDownloadUriOptionalParams + ): Promise; +} diff --git a/sdk/modsimworkbench/arm-modsimworkbench/src/operationsInterfaces/fileRequests.ts b/sdk/modsimworkbench/arm-modsimworkbench/src/operationsInterfaces/fileRequests.ts new file mode 100644 index 000000000000..db233384889a --- /dev/null +++ b/sdk/modsimworkbench/arm-modsimworkbench/src/operationsInterfaces/fileRequests.ts @@ -0,0 +1,86 @@ +/* + * 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 { SimplePollerLike, OperationState } from "@azure/core-lro"; +import { + Request, + FileRequestsListOptionalParams, + FileRequestsGetOptionalParams, + FileRequestsGetResponse, + FileRequestsManageOptionalParams, + FileRequestsManageResponse +} from "../models"; + +/// +/** Interface representing a FileRequests. */ +export interface FileRequests { + /** + * Get ModSim Workbench chamber data pipeline file request resource collection. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workbenchName The name of the workbench. + * @param chamberName The name of the chamber. + * @param options The options parameters. + */ + list( + resourceGroupName: string, + workbenchName: string, + chamberName: string, + options?: FileRequestsListOptionalParams + ): PagedAsyncIterableIterator; + /** + * Get a specific ModSim Workbench chamber data pipeline file request resource. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workbenchName the workbench name. + * @param chamberName the chamber name. + * @param requestName the request name. + * @param options The options parameters. + */ + get( + resourceGroupName: string, + workbenchName: string, + chamberName: string, + requestName: string, + options?: FileRequestsGetOptionalParams + ): Promise; + /** + * Manage download file requests in an ModSim Workbench chamber Data pipeline. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workbenchName the workbench name. + * @param chamberName the chamber name. + * @param requestName the file request name. + * @param options The options parameters. + */ + beginManage( + resourceGroupName: string, + workbenchName: string, + chamberName: string, + requestName: string, + options?: FileRequestsManageOptionalParams + ): Promise< + SimplePollerLike< + OperationState, + FileRequestsManageResponse + > + >; + /** + * Manage download file requests in an ModSim Workbench chamber Data pipeline. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workbenchName the workbench name. + * @param chamberName the chamber name. + * @param requestName the file request name. + * @param options The options parameters. + */ + beginManageAndWait( + resourceGroupName: string, + workbenchName: string, + chamberName: string, + requestName: string, + options?: FileRequestsManageOptionalParams + ): Promise; +} diff --git a/sdk/modsimworkbench/arm-modsimworkbench/src/operationsInterfaces/files.ts b/sdk/modsimworkbench/arm-modsimworkbench/src/operationsInterfaces/files.ts new file mode 100644 index 000000000000..4a5329e69b68 --- /dev/null +++ b/sdk/modsimworkbench/arm-modsimworkbench/src/operationsInterfaces/files.ts @@ -0,0 +1,86 @@ +/* + * 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 { SimplePollerLike, OperationState } from "@azure/core-lro"; +import { + File, + FilesListOptionalParams, + FilesGetOptionalParams, + FilesGetResponse, + FilesDownloadRequestOptionalParams, + FilesDownloadRequestResponse +} from "../models"; + +/// +/** Interface representing a Files. */ +export interface Files { + /** + * Lists all files. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workbenchName The name of the workbench. + * @param chamberName The name of the chamber. + * @param options The options parameters. + */ + list( + resourceGroupName: string, + workbenchName: string, + chamberName: string, + options?: FilesListOptionalParams + ): PagedAsyncIterableIterator; + /** + * Get a specific ModSim Workbench chamber data pipeline file resource. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workbenchName the workbench name. + * @param chamberName the chamber name. + * @param fileName the file name. + * @param options The options parameters. + */ + get( + resourceGroupName: string, + workbenchName: string, + chamberName: string, + fileName: string, + options?: FilesGetOptionalParams + ): Promise; + /** + * Request to download files from an ModSim Workbench chamber data pipeline. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workbenchName the workbench name. + * @param chamberName the chamber name. + * @param fileName the file name. + * @param options The options parameters. + */ + beginDownloadRequest( + resourceGroupName: string, + workbenchName: string, + chamberName: string, + fileName: string, + options?: FilesDownloadRequestOptionalParams + ): Promise< + SimplePollerLike< + OperationState, + FilesDownloadRequestResponse + > + >; + /** + * Request to download files from an ModSim Workbench chamber data pipeline. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workbenchName the workbench name. + * @param chamberName the chamber name. + * @param fileName the file name. + * @param options The options parameters. + */ + beginDownloadRequestAndWait( + resourceGroupName: string, + workbenchName: string, + chamberName: string, + fileName: string, + options?: FilesDownloadRequestOptionalParams + ): Promise; +} diff --git a/sdk/modsimworkbench/arm-modsimworkbench/src/operationsInterfaces/index.ts b/sdk/modsimworkbench/arm-modsimworkbench/src/operationsInterfaces/index.ts new file mode 100644 index 000000000000..c8f3b5d199f3 --- /dev/null +++ b/sdk/modsimworkbench/arm-modsimworkbench/src/operationsInterfaces/index.ts @@ -0,0 +1,18 @@ +/* + * 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 "./workbenches"; +export * from "./connectors"; +export * from "./chambers"; +export * from "./workloads"; +export * from "./storages"; +export * from "./files"; +export * from "./fileOperations"; +export * from "./fileRequests"; +export * from "./fileRequest"; diff --git a/sdk/modsimworkbench/arm-modsimworkbench/src/operationsInterfaces/operations.ts b/sdk/modsimworkbench/arm-modsimworkbench/src/operationsInterfaces/operations.ts new file mode 100644 index 000000000000..9f0e01e93d66 --- /dev/null +++ b/sdk/modsimworkbench/arm-modsimworkbench/src/operationsInterfaces/operations.ts @@ -0,0 +1,18 @@ +/* + * 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 { OperationsListOptionalParams } from "../models"; + +/** Interface representing a Operations. */ +export interface Operations { + /** + * Lists Operations. + * @param options The options parameters. + */ + list(options?: OperationsListOptionalParams): Promise; +} diff --git a/sdk/modsimworkbench/arm-modsimworkbench/src/operationsInterfaces/storages.ts b/sdk/modsimworkbench/arm-modsimworkbench/src/operationsInterfaces/storages.ts new file mode 100644 index 000000000000..00760c664901 --- /dev/null +++ b/sdk/modsimworkbench/arm-modsimworkbench/src/operationsInterfaces/storages.ts @@ -0,0 +1,140 @@ +/* + * 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 { SimplePollerLike, OperationState } from "@azure/core-lro"; +import { + Storage, + StoragesListOptionalParams, + StoragesCreateOrUpdateOptionalParams, + StoragesCreateOrUpdateResponse, + StoragesUpdateOptionalParams, + StoragesUpdateResponse, + StoragesGetOptionalParams, + StoragesGetResponse, + StoragesDeleteOptionalParams, + StoragesDeleteResponse +} from "../models"; + +/// +/** Interface representing a Storages. */ +export interface Storages { + /** + * Lists all storages. + * @param resourceGroup The name of the resource group. + * @param workbenchName The name of the workbench. + * @param chamberName The name of the chamber. + * @param options The options parameters. + */ + list( + resourceGroup: string, + workbenchName: string, + chamberName: string, + options?: StoragesListOptionalParams + ): PagedAsyncIterableIterator; + /** + * Creates or updates the storage. + * @param resourceGroup The name of the resource group. + * @param workbenchName The name of the workbench. + * @param chamberName The name of the chamber. + * @param storageName The name of the storage. + * @param options The options parameters. + */ + beginCreateOrUpdate( + resourceGroup: string, + workbenchName: string, + chamberName: string, + storageName: string, + options?: StoragesCreateOrUpdateOptionalParams + ): Promise< + SimplePollerLike< + OperationState, + StoragesCreateOrUpdateResponse + > + >; + /** + * Creates or updates the storage. + * @param resourceGroup The name of the resource group. + * @param workbenchName The name of the workbench. + * @param chamberName The name of the chamber. + * @param storageName The name of the storage. + * @param options The options parameters. + */ + beginCreateOrUpdateAndWait( + resourceGroup: string, + workbenchName: string, + chamberName: string, + storageName: string, + options?: StoragesCreateOrUpdateOptionalParams + ): Promise; + /** + * Updates the storage. + * @param resourceGroup The name of the resource group. + * @param workbenchName The name of the workbench. + * @param chamberName The name of the chamber. + * @param storageName The name of the storage. + * @param options The options parameters. + */ + update( + resourceGroup: string, + workbenchName: string, + chamberName: string, + storageName: string, + options?: StoragesUpdateOptionalParams + ): Promise; + /** + * Gets information about the storage. + * @param resourceGroup The name of the resource group. + * @param workbenchName The name of the workbench. + * @param chamberName The name of the chamber. + * @param storageName The name of the storage. + * @param options The options parameters. + */ + get( + resourceGroup: string, + workbenchName: string, + chamberName: string, + storageName: string, + options?: StoragesGetOptionalParams + ): Promise; + /** + * Deletes the storage. + * @param resourceGroup The name of the resource group. + * @param workbenchName The name of the workbench. + * @param chamberName The name of the chamber. + * @param storageName The name of the storage. + * @param options The options parameters. + */ + beginDelete( + resourceGroup: string, + workbenchName: string, + chamberName: string, + storageName: string, + options?: StoragesDeleteOptionalParams + ): Promise< + SimplePollerLike< + OperationState, + StoragesDeleteResponse + > + >; + /** + * Deletes the storage. + * @param resourceGroup The name of the resource group. + * @param workbenchName The name of the workbench. + * @param chamberName The name of the chamber. + * @param storageName The name of the storage. + * @param options The options parameters. + */ + beginDeleteAndWait( + resourceGroup: string, + workbenchName: string, + chamberName: string, + storageName: string, + options?: StoragesDeleteOptionalParams + ): Promise; +} diff --git a/sdk/modsimworkbench/arm-modsimworkbench/src/operationsInterfaces/workbenches.ts b/sdk/modsimworkbench/arm-modsimworkbench/src/operationsInterfaces/workbenches.ts new file mode 100644 index 000000000000..6c3a97c29523 --- /dev/null +++ b/sdk/modsimworkbench/arm-modsimworkbench/src/operationsInterfaces/workbenches.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 { SimplePollerLike, OperationState } from "@azure/core-lro"; +import { + Workbench, + WorkbenchesListBySubscriptionOptionalParams, + WorkbenchesListByResourceGroupOptionalParams, + WorkbenchesGetOptionalParams, + WorkbenchesGetResponse, + WorkbenchesCreateOrUpdateOptionalParams, + WorkbenchesCreateOrUpdateResponse, + WorkbenchesUpdateOptionalParams, + WorkbenchesUpdateResponse, + WorkbenchesDeleteOptionalParams, + WorkbenchesDeleteResponse +} from "../models"; + +/// +/** Interface representing a Workbenches. */ +export interface Workbenches { + /** + * Lists Workbenches by subscription. + * @param options The options parameters. + */ + listBySubscription( + options?: WorkbenchesListBySubscriptionOptionalParams + ): PagedAsyncIterableIterator; + /** + * Lists workbenches by resource group. + * @param resourceGroup the workbench name. + * @param options The options parameters. + */ + listByResourceGroup( + resourceGroup: string, + options?: WorkbenchesListByResourceGroupOptionalParams + ): PagedAsyncIterableIterator; + /** + * Lists workbenches. + * @param resourceGroup the resource group. + * @param name the workbench name. + * @param options The options parameters. + */ + beginGet( + resourceGroup: string, + name: string, + options?: WorkbenchesGetOptionalParams + ): Promise< + SimplePollerLike< + OperationState, + WorkbenchesGetResponse + > + >; + /** + * Lists workbenches. + * @param resourceGroup the resource group. + * @param name the workbench name. + * @param options The options parameters. + */ + beginGetAndWait( + resourceGroup: string, + name: string, + options?: WorkbenchesGetOptionalParams + ): Promise; + /** + * Create workbenches. + * @param resourceGroup the resource group. + * @param name the workbench name. + * @param options The options parameters. + */ + beginCreateOrUpdate( + resourceGroup: string, + name: string, + options?: WorkbenchesCreateOrUpdateOptionalParams + ): Promise< + SimplePollerLike< + OperationState, + WorkbenchesCreateOrUpdateResponse + > + >; + /** + * Create workbenches. + * @param resourceGroup the resource group. + * @param name the workbench name. + * @param options The options parameters. + */ + beginCreateOrUpdateAndWait( + resourceGroup: string, + name: string, + options?: WorkbenchesCreateOrUpdateOptionalParams + ): Promise; + /** + * Update workbenches. + * @param resourceGroup the resource group. + * @param name the workbench name. + * @param options The options parameters. + */ + update( + resourceGroup: string, + name: string, + options?: WorkbenchesUpdateOptionalParams + ): Promise; + /** + * Delete workbenches. + * @param resourceGroup the resource group. + * @param name the workbench name. + * @param options The options parameters. + */ + beginDelete( + resourceGroup: string, + name: string, + options?: WorkbenchesDeleteOptionalParams + ): Promise< + SimplePollerLike< + OperationState, + WorkbenchesDeleteResponse + > + >; + /** + * Delete workbenches. + * @param resourceGroup the resource group. + * @param name the workbench name. + * @param options The options parameters. + */ + beginDeleteAndWait( + resourceGroup: string, + name: string, + options?: WorkbenchesDeleteOptionalParams + ): Promise; +} diff --git a/sdk/modsimworkbench/arm-modsimworkbench/src/operationsInterfaces/workloads.ts b/sdk/modsimworkbench/arm-modsimworkbench/src/operationsInterfaces/workloads.ts new file mode 100644 index 000000000000..317f33fa3566 --- /dev/null +++ b/sdk/modsimworkbench/arm-modsimworkbench/src/operationsInterfaces/workloads.ts @@ -0,0 +1,233 @@ +/* + * 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 { SimplePollerLike, OperationState } from "@azure/core-lro"; +import { + Workload, + WorkloadsListOptionalParams, + WorkloadsStartOptionalParams, + WorkloadsStopOptionalParams, + WorkloadsRestartOptionalParams, + WorkloadsCreateOrUpdateOptionalParams, + WorkloadsCreateOrUpdateResponse, + WorkloadsUpdateOptionalParams, + WorkloadsUpdateResponse, + WorkloadsGetOptionalParams, + WorkloadsGetResponse, + WorkloadsDeleteOptionalParams, + WorkloadsDeleteResponse +} from "../models"; + +/// +/** Interface representing a Workloads. */ +export interface Workloads { + /** + * Lists all workloads. + * @param resourceGroup The name of the resource group. + * @param workbenchName The name of the workbench. + * @param chamberName The name of the chamber. + * @param options The options parameters. + */ + list( + resourceGroup: string, + workbenchName: string, + chamberName: string, + options?: WorkloadsListOptionalParams + ): PagedAsyncIterableIterator; + /** + * Perform Start operation. + * @param resourceGroup the resource group. + * @param workbenchName the workbench name. + * @param chamberName the chamber name. + * @param name the workload name. + * @param options The options parameters. + */ + beginStart( + resourceGroup: string, + workbenchName: string, + chamberName: string, + name: string, + options?: WorkloadsStartOptionalParams + ): Promise, void>>; + /** + * Perform Start operation. + * @param resourceGroup the resource group. + * @param workbenchName the workbench name. + * @param chamberName the chamber name. + * @param name the workload name. + * @param options The options parameters. + */ + beginStartAndWait( + resourceGroup: string, + workbenchName: string, + chamberName: string, + name: string, + options?: WorkloadsStartOptionalParams + ): Promise; + /** + * Perform Stop operation. + * @param resourceGroup the resource group. + * @param workbenchName the workbench name. + * @param chamberName the chamber name. + * @param name the workload name. + * @param options The options parameters. + */ + beginStop( + resourceGroup: string, + workbenchName: string, + chamberName: string, + name: string, + options?: WorkloadsStopOptionalParams + ): Promise, void>>; + /** + * Perform Stop operation. + * @param resourceGroup the resource group. + * @param workbenchName the workbench name. + * @param chamberName the chamber name. + * @param name the workload name. + * @param options The options parameters. + */ + beginStopAndWait( + resourceGroup: string, + workbenchName: string, + chamberName: string, + name: string, + options?: WorkloadsStopOptionalParams + ): Promise; + /** + * Perform Restart operation. + * @param resourceGroup the resource group. + * @param workbenchName the workbench name. + * @param chamberName the chamber name. + * @param name the workload name. + * @param options The options parameters. + */ + beginRestart( + resourceGroup: string, + workbenchName: string, + chamberName: string, + name: string, + options?: WorkloadsRestartOptionalParams + ): Promise, void>>; + /** + * Perform Restart operation. + * @param resourceGroup the resource group. + * @param workbenchName the workbench name. + * @param chamberName the chamber name. + * @param name the workload name. + * @param options The options parameters. + */ + beginRestartAndWait( + resourceGroup: string, + workbenchName: string, + chamberName: string, + name: string, + options?: WorkloadsRestartOptionalParams + ): Promise; + /** + * Creates or updates the specified workload. + * @param resourceGroup The name of the resource group. + * @param workbenchName The name of the workbench. + * @param chamberName The name of the chamber. + * @param workloadName The name of the workload. + * @param options The options parameters. + */ + beginCreateOrUpdate( + resourceGroup: string, + workbenchName: string, + chamberName: string, + workloadName: string, + options?: WorkloadsCreateOrUpdateOptionalParams + ): Promise< + SimplePollerLike< + OperationState, + WorkloadsCreateOrUpdateResponse + > + >; + /** + * Creates or updates the specified workload. + * @param resourceGroup The name of the resource group. + * @param workbenchName The name of the workbench. + * @param chamberName The name of the chamber. + * @param workloadName The name of the workload. + * @param options The options parameters. + */ + beginCreateOrUpdateAndWait( + resourceGroup: string, + workbenchName: string, + chamberName: string, + workloadName: string, + options?: WorkloadsCreateOrUpdateOptionalParams + ): Promise; + /** + * Updates the specified workload. + * @param resourceGroup The name of the resource group. + * @param workbenchName The name of the workbench. + * @param chamberName The name of the chamber. + * @param workloadName The name of the workload. + * @param options The options parameters. + */ + update( + resourceGroup: string, + workbenchName: string, + chamberName: string, + workloadName: string, + options?: WorkloadsUpdateOptionalParams + ): Promise; + /** + * Gets information about the specified workload. + * @param resourceGroup The name of the resource group. + * @param workbenchName The name of the workbench. + * @param chamberName The name of the chamber. + * @param workloadName The name of the workload. + * @param options The options parameters. + */ + get( + resourceGroup: string, + workbenchName: string, + chamberName: string, + workloadName: string, + options?: WorkloadsGetOptionalParams + ): Promise; + /** + * Deletes the specified workload. + * @param resourceGroup The name of the resource group. + * @param workbenchName The name of the workbench. + * @param chamberName The name of the chamber. + * @param workloadName The name of the workload. + * @param options The options parameters. + */ + beginDelete( + resourceGroup: string, + workbenchName: string, + chamberName: string, + workloadName: string, + options?: WorkloadsDeleteOptionalParams + ): Promise< + SimplePollerLike< + OperationState, + WorkloadsDeleteResponse + > + >; + /** + * Deletes the specified workload. + * @param resourceGroup The name of the resource group. + * @param workbenchName The name of the workbench. + * @param chamberName The name of the chamber. + * @param workloadName The name of the workload. + * @param options The options parameters. + */ + beginDeleteAndWait( + resourceGroup: string, + workbenchName: string, + chamberName: string, + workloadName: string, + options?: WorkloadsDeleteOptionalParams + ): Promise; +} diff --git a/sdk/modsimworkbench/arm-modsimworkbench/src/pagingHelper.ts b/sdk/modsimworkbench/arm-modsimworkbench/src/pagingHelper.ts new file mode 100644 index 000000000000..269a2b9814b5 --- /dev/null +++ b/sdk/modsimworkbench/arm-modsimworkbench/src/pagingHelper.ts @@ -0,0 +1,39 @@ +/* + * 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 interface PageInfo { + continuationToken?: string; +} + +const pageMap = new WeakMap(); + +/** + * Given the last `.value` produced by the `byPage` iterator, + * returns a continuation token that can be used to begin paging from + * that point later. + * @param page An object from accessing `value` on the IteratorResult from a `byPage` iterator. + * @returns The continuation token that can be passed into byPage() during future calls. + */ +export function getContinuationToken(page: unknown): string | undefined { + if (typeof page !== "object" || page === null) { + return undefined; + } + return pageMap.get(page)?.continuationToken; +} + +export function setContinuationToken( + page: unknown, + continuationToken: string | undefined +): void { + if (typeof page !== "object" || page === null || !continuationToken) { + return; + } + const pageInfo = pageMap.get(page) ?? {}; + pageInfo.continuationToken = continuationToken; + pageMap.set(page, pageInfo); +} diff --git a/sdk/modsimworkbench/arm-modsimworkbench/test/sampleTest.ts b/sdk/modsimworkbench/arm-modsimworkbench/test/sampleTest.ts new file mode 100644 index 000000000000..25aeb3ebcc36 --- /dev/null +++ b/sdk/modsimworkbench/arm-modsimworkbench/test/sampleTest.ts @@ -0,0 +1,43 @@ +/* + * 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 { + Recorder, + RecorderStartOptions, + env +} from "@azure-tools/test-recorder"; +import { assert } from "chai"; +import { Context } from "mocha"; + +const replaceableVariables: Record = { + 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" +}; + +const recorderOptions: RecorderStartOptions = { + envSetupForPlayback: replaceableVariables +}; + +describe("My test", () => { + let recorder: Recorder; + + beforeEach(async function(this: Context) { + recorder = new Recorder(this.currentTest); + await recorder.start(recorderOptions); + }); + + afterEach(async function() { + await recorder.stop(); + }); + + it("sample test", async function() { + console.log("Hi, I'm a test!"); + }); +}); diff --git a/sdk/modsimworkbench/arm-modsimworkbench/tsconfig.json b/sdk/modsimworkbench/arm-modsimworkbench/tsconfig.json new file mode 100644 index 000000000000..3e6ae96443f3 --- /dev/null +++ b/sdk/modsimworkbench/arm-modsimworkbench/tsconfig.json @@ -0,0 +1,27 @@ +{ + "compilerOptions": { + "module": "es6", + "moduleResolution": "node", + "strict": true, + "target": "es6", + "sourceMap": true, + "declarationMap": true, + "esModuleInterop": true, + "allowSyntheticDefaultImports": true, + "forceConsistentCasingInFileNames": true, + "lib": [ + "es6", + "dom" + ], + "declaration": true, + "outDir": "./dist-esm", + "importHelpers": true + }, + "include": [ + "./src/**/*.ts", + "./test/**/*.ts" + ], + "exclude": [ + "node_modules" + ] +} \ No newline at end of file diff --git a/sdk/modsimworkbench/ci.mgmt.yml b/sdk/modsimworkbench/ci.mgmt.yml new file mode 100644 index 000000000000..39ac5d919a8a --- /dev/null +++ b/sdk/modsimworkbench/ci.mgmt.yml @@ -0,0 +1,38 @@ +# NOTE: Please refer to https://aka.ms/azsdk/engsys/ci-yaml before editing this file. + +trigger: + branches: + include: + - main + - feature/* + - release/* + - hotfix/* + exclude: + - feature/v4 + paths: + include: + - sdk/modsimworkbench/arm-modsimworkbench + - sdk/modsimworkbench/ci.mgmt.yml + +pr: + branches: + include: + - main + - feature/* + - release/* + - hotfix/* + exclude: + - feature/v4 + paths: + include: + - sdk/modsimworkbench/arm-modsimworkbench + - sdk/modsimworkbench/ci.mgmt.yml + +extends: + template: /eng/pipelines/templates/stages/archetype-sdk-client.yml + parameters: + ServiceDirectory: modsimworkbench + Artifacts: + - name: azure-arm-modsimworkbench + safeName: azurearmmodsimworkbench + \ No newline at end of file