From 6d76da1abc416a24c392c7ac8152dce7680b868b Mon Sep 17 00:00:00 2001 From: SDKAuto Date: Wed, 15 Jun 2022 10:57:35 +0000 Subject: [PATCH] CodeGen from PR 19419 in Azure/azure-rest-api-specs TestBase 2022-04-01-preview (from RPaaSMaster) (#19419) * copy 2022-04-01-preview from rpaasmaster * sdk md file change * modify subscription id --- common/config/rush/pnpm-lock.yaml | 63 +- rush.json | 9 +- sdk/testbase/arm-testbase/CHANGELOG.md | 5 + sdk/testbase/arm-testbase/LICENSE | 21 + sdk/testbase/arm-testbase/README.md | 109 + sdk/testbase/arm-testbase/_meta.json | 8 + sdk/testbase/arm-testbase/api-extractor.json | 31 + sdk/testbase/arm-testbase/package.json | 112 + .../arm-testbase/review/arm-testbase.api.md | 1784 +++++++++ sdk/testbase/arm-testbase/rollup.config.js | 122 + sdk/testbase/arm-testbase/src/index.ts | 12 + sdk/testbase/arm-testbase/src/lroImpl.ts | 34 + sdk/testbase/arm-testbase/src/models/index.ts | 2181 +++++++++++ .../arm-testbase/src/models/mappers.ts | 3451 +++++++++++++++++ .../arm-testbase/src/models/parameters.ts | 347 ++ .../src/operations/analysisResults.ts | 235 ++ .../src/operations/availableOS.ts | 258 ++ .../src/operations/billingHubService.ts | 113 + .../src/operations/customerEvents.ts | 488 +++ .../src/operations/emailEvents.ts | 238 ++ .../src/operations/favoriteProcesses.ts | 378 ++ .../src/operations/flightingRings.ts | 238 ++ .../arm-testbase/src/operations/index.ts | 24 + .../arm-testbase/src/operations/oSUpdates.ts | 284 ++ .../arm-testbase/src/operations/operations.ts | 137 + .../arm-testbase/src/operations/packages.ts | 834 ++++ .../arm-testbase/src/operations/skus.ts | 139 + .../src/operations/testBaseAccounts.ts | 881 +++++ .../src/operations/testResults.ts | 459 +++ .../src/operations/testSummaries.ts | 234 ++ .../arm-testbase/src/operations/testTypes.ts | 233 ++ .../arm-testbase/src/operations/usage.ts | 189 + .../operationsInterfaces/analysisResults.ts | 57 + .../src/operationsInterfaces/availableOS.ts | 47 + .../operationsInterfaces/billingHubService.ts | 38 + .../operationsInterfaces/customerEvents.ts | 109 + .../src/operationsInterfaces/emailEvents.ts | 44 + .../operationsInterfaces/favoriteProcesses.ts | 89 + .../operationsInterfaces/flightingRings.ts | 44 + .../src/operationsInterfaces/index.ts | 24 + .../src/operationsInterfaces/oSUpdates.ts | 51 + .../src/operationsInterfaces/operations.ts | 22 + .../src/operationsInterfaces/packages.ts | 204 + .../src/operationsInterfaces/skus.ts | 22 + .../operationsInterfaces/testBaseAccounts.ts | 193 + .../src/operationsInterfaces/testResults.ts | 106 + .../src/operationsInterfaces/testSummaries.ts | 45 + .../src/operationsInterfaces/testTypes.ts | 44 + .../src/operationsInterfaces/usage.ts | 26 + sdk/testbase/arm-testbase/src/testBase.ts | 198 + sdk/testbase/arm-testbase/test/sampleTest.ts | 43 + sdk/testbase/arm-testbase/tsconfig.json | 27 + sdk/testbase/ci.mgmt.yml | 38 + 53 files changed, 15103 insertions(+), 19 deletions(-) create mode 100644 sdk/testbase/arm-testbase/CHANGELOG.md create mode 100644 sdk/testbase/arm-testbase/LICENSE create mode 100644 sdk/testbase/arm-testbase/README.md create mode 100644 sdk/testbase/arm-testbase/_meta.json create mode 100644 sdk/testbase/arm-testbase/api-extractor.json create mode 100644 sdk/testbase/arm-testbase/package.json create mode 100644 sdk/testbase/arm-testbase/review/arm-testbase.api.md create mode 100644 sdk/testbase/arm-testbase/rollup.config.js create mode 100644 sdk/testbase/arm-testbase/src/index.ts create mode 100644 sdk/testbase/arm-testbase/src/lroImpl.ts create mode 100644 sdk/testbase/arm-testbase/src/models/index.ts create mode 100644 sdk/testbase/arm-testbase/src/models/mappers.ts create mode 100644 sdk/testbase/arm-testbase/src/models/parameters.ts create mode 100644 sdk/testbase/arm-testbase/src/operations/analysisResults.ts create mode 100644 sdk/testbase/arm-testbase/src/operations/availableOS.ts create mode 100644 sdk/testbase/arm-testbase/src/operations/billingHubService.ts create mode 100644 sdk/testbase/arm-testbase/src/operations/customerEvents.ts create mode 100644 sdk/testbase/arm-testbase/src/operations/emailEvents.ts create mode 100644 sdk/testbase/arm-testbase/src/operations/favoriteProcesses.ts create mode 100644 sdk/testbase/arm-testbase/src/operations/flightingRings.ts create mode 100644 sdk/testbase/arm-testbase/src/operations/index.ts create mode 100644 sdk/testbase/arm-testbase/src/operations/oSUpdates.ts create mode 100644 sdk/testbase/arm-testbase/src/operations/operations.ts create mode 100644 sdk/testbase/arm-testbase/src/operations/packages.ts create mode 100644 sdk/testbase/arm-testbase/src/operations/skus.ts create mode 100644 sdk/testbase/arm-testbase/src/operations/testBaseAccounts.ts create mode 100644 sdk/testbase/arm-testbase/src/operations/testResults.ts create mode 100644 sdk/testbase/arm-testbase/src/operations/testSummaries.ts create mode 100644 sdk/testbase/arm-testbase/src/operations/testTypes.ts create mode 100644 sdk/testbase/arm-testbase/src/operations/usage.ts create mode 100644 sdk/testbase/arm-testbase/src/operationsInterfaces/analysisResults.ts create mode 100644 sdk/testbase/arm-testbase/src/operationsInterfaces/availableOS.ts create mode 100644 sdk/testbase/arm-testbase/src/operationsInterfaces/billingHubService.ts create mode 100644 sdk/testbase/arm-testbase/src/operationsInterfaces/customerEvents.ts create mode 100644 sdk/testbase/arm-testbase/src/operationsInterfaces/emailEvents.ts create mode 100644 sdk/testbase/arm-testbase/src/operationsInterfaces/favoriteProcesses.ts create mode 100644 sdk/testbase/arm-testbase/src/operationsInterfaces/flightingRings.ts create mode 100644 sdk/testbase/arm-testbase/src/operationsInterfaces/index.ts create mode 100644 sdk/testbase/arm-testbase/src/operationsInterfaces/oSUpdates.ts create mode 100644 sdk/testbase/arm-testbase/src/operationsInterfaces/operations.ts create mode 100644 sdk/testbase/arm-testbase/src/operationsInterfaces/packages.ts create mode 100644 sdk/testbase/arm-testbase/src/operationsInterfaces/skus.ts create mode 100644 sdk/testbase/arm-testbase/src/operationsInterfaces/testBaseAccounts.ts create mode 100644 sdk/testbase/arm-testbase/src/operationsInterfaces/testResults.ts create mode 100644 sdk/testbase/arm-testbase/src/operationsInterfaces/testSummaries.ts create mode 100644 sdk/testbase/arm-testbase/src/operationsInterfaces/testTypes.ts create mode 100644 sdk/testbase/arm-testbase/src/operationsInterfaces/usage.ts create mode 100644 sdk/testbase/arm-testbase/src/testBase.ts create mode 100644 sdk/testbase/arm-testbase/test/sampleTest.ts create mode 100644 sdk/testbase/arm-testbase/tsconfig.json create mode 100644 sdk/testbase/ci.mgmt.yml diff --git a/common/config/rush/pnpm-lock.yaml b/common/config/rush/pnpm-lock.yaml index 638751ca00b3..68cee5dcc4fa 100644 --- a/common/config/rush/pnpm-lock.yaml +++ b/common/config/rush/pnpm-lock.yaml @@ -176,6 +176,7 @@ specifiers: '@rush-temp/arm-support': file:./projects/arm-support.tgz '@rush-temp/arm-synapse': file:./projects/arm-synapse.tgz '@rush-temp/arm-templatespecs': file:./projects/arm-templatespecs.tgz + '@rush-temp/arm-testbase': file:./projects/arm-testbase.tgz '@rush-temp/arm-timeseriesinsights': file:./projects/arm-timeseriesinsights.tgz '@rush-temp/arm-trafficmanager': file:./projects/arm-trafficmanager.tgz '@rush-temp/arm-videoanalyzer': file:./projects/arm-videoanalyzer.tgz @@ -462,6 +463,7 @@ dependencies: '@rush-temp/arm-support': file:projects/arm-support.tgz '@rush-temp/arm-synapse': file:projects/arm-synapse.tgz '@rush-temp/arm-templatespecs': file:projects/arm-templatespecs.tgz + '@rush-temp/arm-testbase': file:projects/arm-testbase.tgz '@rush-temp/arm-timeseriesinsights': file:projects/arm-timeseriesinsights.tgz '@rush-temp/arm-trafficmanager': file:projects/arm-trafficmanager.tgz '@rush-temp/arm-videoanalyzer': file:projects/arm-videoanalyzer.tgz @@ -3043,7 +3045,7 @@ packages: dev: false /array-flatten/1.1.1: - resolution: {integrity: sha1-ml9pkFGx5wczKPKgCJaLZOopVdI=} + resolution: {integrity: sha512-PCVAQswWemu6UdxsDFFX/+gVeYqKAod3D3UVm91jHwynguOwAvYPhx8nNlM++NqRcK6CxxpUafjmhIdKiHibqg==} dev: false /array-includes/3.1.5: @@ -3296,7 +3298,7 @@ packages: dev: false /buffer-equal-constant-time/1.0.1: - resolution: {integrity: sha1-+OcRMvf/5uAaXJaXpMbz5I1cyBk=} + resolution: {integrity: sha512-zRpUiDwd/xk6ADqPMATG8vc9VPrkck7T07OIx0gnjmJAnHnTVXNQG3vfvWNuiZIkwu9KrKdA1iJKfsfTVxE6NA==} dev: false /buffer-from/1.1.2: @@ -3437,7 +3439,7 @@ packages: dev: false /charenc/0.0.2: - resolution: {integrity: sha1-wKHS86cJLgN3S/qD8UwPxXkKhmc=} + resolution: {integrity: sha512-yrLQ/yVUFXkzg7EDQsPieE/53+0RlaWTs+wBrvW36cyilJ2SaDWfl4Yj7MtLTXleV9uEKefbAGUPv2/iWSooRA==} dev: false /check-error/1.0.2: @@ -3558,7 +3560,7 @@ packages: dev: false /concat-map/0.0.1: - resolution: {integrity: sha1-2Klr13/Wjfd5OnMDajug1UBdR3s=} + resolution: {integrity: sha512-/Srv4dswyQNBfohGpz9o6Yb3Gz3SrUDqBH5rTuhGR7ahtlbYKnVxw2bCFMRljaA7EXHaXZ8wsHdodFvbkhKmqg==} dev: false /concurrently/6.5.1: @@ -3625,7 +3627,7 @@ packages: dev: false /cookie-signature/1.0.6: - resolution: {integrity: sha1-4wOogrNCzD7oylE6eZmXNNqzriw=} + resolution: {integrity: sha512-QADzlaHc8icV8I7vbaJXJwod9HWYp8uCqf1xa4OfNu1T7JVxQIrUgOWtHdNDtPiywmFbiS12VjotIXLrKM3orQ==} dev: false /cookie/0.4.2: @@ -3727,7 +3729,7 @@ packages: dev: false /crypt/0.0.2: - resolution: {integrity: sha1-iNf/fsDfuG9xPch7u0LQRNPmxBs=} + resolution: {integrity: sha512-mCxBlsHFYh9C+HVpiEacem8FEBnMXgU9gy4zmNC+SXAZNB/1idgp/aulFJ4FgCi7GPEVbfyng092GqL2k2rmow==} dev: false /csv-parse/5.0.4: @@ -3951,7 +3953,7 @@ packages: dependencies: semver: 7.3.7 shelljs: 0.8.5 - typescript: 4.8.0-dev.20220614 + typescript: 4.8.0-dev.20220615 dev: false /downlevel-dts/0.4.0: @@ -3978,11 +3980,11 @@ packages: dev: false /edge-launcher/1.2.2: - resolution: {integrity: sha1-60Cq+9Bnpup27/+rBke81VCbN7I=} + resolution: {integrity: sha512-JcD5WBi3BHZXXVSSeEhl6sYO8g5cuynk/hifBzds2Bp4JdzCGLNMHgMCKu5DvrO1yatMgF0goFsxXRGus0yh1g==} dev: false /ee-first/1.1.1: - resolution: {integrity: sha1-WQxhFWsK4vTwJVcyoViyZrxWsh0=} + resolution: {integrity: sha512-WMwm9LhRUo+WUaRN+vRuETqG89IgZphVSNkdFgeb6sS/E4OrDIN7t48CAewSHXc6C8lefD8KKfr5vY61brQlow==} dev: false /electron-to-chromium/1.4.137: @@ -4831,7 +4833,7 @@ packages: dev: false /fresh/0.5.2: - resolution: {integrity: sha1-PYyt2Q2XZWn6g1qx+OSyOhBWBac=} + resolution: {integrity: sha512-zJ2mQYM18rEFOudeV4GShTGIQ7RbzA7ozbU9I/XBpm7kqgMywgmylMwXHxZJmkVoYkna9d2pVXVXPdYTP9ej8Q==} engines: {node: '>= 0.6'} dev: false @@ -4984,7 +4986,7 @@ packages: dev: false /github-from-package/0.0.0: - resolution: {integrity: sha1-l/tdlr/eiXMxPyDoKI75oWf6ZM4=} + resolution: {integrity: sha512-SyHy3T1v2NUXn29OsWdxmK6RwHD+vkj3v8en8AOBZ1wBQ/hCAQ5bAQTD02kW4W9tUp/3Qh6J8r9EvntiyCmOOw==} dev: false /glob-parent/5.1.2: @@ -6369,7 +6371,7 @@ packages: dev: false /media-typer/0.3.0: - resolution: {integrity: sha1-hxDXrwqmJvj/+hzgAWhUUmMlV0g=} + resolution: {integrity: sha512-dq+qelQ9akHpcOl/gUVRTxVIOkAJ1wR3QAvb4RsVjS8oVoFjDGTc679wJYmUmknUF5HwMLOgb5O+a3KxfWapPQ==} engines: {node: '>= 0.6'} dev: false @@ -6379,7 +6381,7 @@ packages: dev: false /merge-descriptors/1.0.1: - resolution: {integrity: sha1-sAqqVW3YtEVoFQ7J0blT8/kMu2E=} + resolution: {integrity: sha512-cCi6g3/Zr1iqQi6ySbseM1Xvooa98N0w31jzUYrXPX2xqObmFGHJ0tQ5u74H3mVh7wLouTseZyYIq39g8cNp1w==} dev: false /merge-source-map/1.1.0: @@ -6734,7 +6736,7 @@ packages: dev: false /noms/0.0.0: - resolution: {integrity: sha1-2o69nzr51nYJGbJ9nNyAkqczKFk=} + resolution: {integrity: sha512-lNDU9VJaOPxUmXcLb+HQFeUgQQPtMI24Gt6hgfuMHRJgMRHMF/qZ4HJD3GDru4sSw9IQl2jPjAYnQrdIeLbwow==} dependencies: inherits: 2.0.4 readable-stream: 1.0.34 @@ -8755,8 +8757,8 @@ packages: hasBin: true dev: false - /typescript/4.8.0-dev.20220614: - resolution: {integrity: sha512-pZVLT8Li6ZCYmyv6F+xEJ+nZ947uRE7el5OloggrPZdhjDJpBBBn/CK5YCgnXcmZFgwO6WMbco1GwfsR23CsxA==} + /typescript/4.8.0-dev.20220615: + resolution: {integrity: sha512-Is/gGrlFdQdT4GA/FEz4tMnDy78lNVxCxtZule9Xv5LRSwLgbgLwJQBMqpLWXd/KJO6u66F2EFmfXU1g3MCVZA==} engines: {node: '>=4.2.0'} hasBin: true dev: false @@ -8860,7 +8862,7 @@ packages: dev: false /utils-merge/1.0.1: - resolution: {integrity: sha1-n5VxD1CiZ5R7LMwSR0HBAoQn5xM=} + resolution: {integrity: sha512-pMZTvIkT1d+TFGvDOqodOclx0QWkkgi6Tdoa8gC8ffGAAqz9pzPTZWAybbsHHoED/ztMtkv/VoYTYyShUn81hA==} engines: {node: '>= 0.4.0'} dev: false @@ -14464,6 +14466,33 @@ packages: - supports-color dev: false + file:projects/arm-testbase.tgz: + resolution: {integrity: sha512-qEZZmB4OFOByae9ZUSVT6NFYzWJwuac3oIf43hgoRd6I9yvrnmeE7l9SACwCDpM+MW5MCWbQSkwQz1qoS0wB3A==, tarball: file:projects/arm-testbase.tgz} + name: '@rush-temp/arm-testbase' + version: 0.0.0 + dependencies: + '@azure/core-lro': 2.2.4 + '@azure/identity': 2.0.4 + '@microsoft/api-extractor': 7.18.11 + '@rollup/plugin-commonjs': 21.1.0_rollup@2.73.0 + '@rollup/plugin-json': 4.1.0_rollup@2.73.0 + '@rollup/plugin-multi-entry': 4.1.0_rollup@2.73.0 + '@rollup/plugin-node-resolve': 13.3.0_rollup@2.73.0 + cross-env: 7.0.3 + mkdirp: 1.0.4 + mocha: 7.2.0 + rimraf: 3.0.2 + rollup: 2.73.0 + rollup-plugin-sourcemaps: 0.6.3_rollup@2.73.0 + tslib: 2.4.0 + typescript: 4.2.4 + uglify-js: 3.15.5 + transitivePeerDependencies: + - '@types/node' + - debug + - supports-color + dev: false + file:projects/arm-timeseriesinsights.tgz: resolution: {integrity: sha512-bFLPtyEEVklYAPw8jQzgwwMpXhwV4ueKcFH/nemMY4EkS1gSVfs6wfMzsjJHZfyJjsw0D03yzxpSESVJ3OpRDA==, tarball: file:projects/arm-timeseriesinsights.tgz} name: '@rush-temp/arm-timeseriesinsights' diff --git a/rush.json b/rush.json index cdfc696c00fa..22048405f815 100644 --- a/rush.json +++ b/rush.json @@ -1,7 +1,7 @@ /** * This is the main configuration file for Rush. * For full documentation, please see https://rushjs.io - */ { + */{ "$schema": "https://developer.microsoft.com/json-schemas/rush/v5/rush.schema.json", /** * (Required) This specifies the version of the Rush engine to be used in this repo. @@ -1740,6 +1740,11 @@ "packageName": "@azure/arm-confidentialledger", "projectFolder": "sdk/confidentialledger/arm-confidentialledger", "versionPolicyName": "management" + }, + { + "packageName": "@azure/arm-testbase", + "projectFolder": "sdk/testbase/arm-testbase", + "versionPolicyName": "management" } ] -} +} \ No newline at end of file diff --git a/sdk/testbase/arm-testbase/CHANGELOG.md b/sdk/testbase/arm-testbase/CHANGELOG.md new file mode 100644 index 000000000000..34b54e9378ec --- /dev/null +++ b/sdk/testbase/arm-testbase/CHANGELOG.md @@ -0,0 +1,5 @@ +# Release History + +## 1.0.0-beta.1 (2022-06-15) + +The package of @azure/arm-testbase 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/testbase/arm-testbase/LICENSE b/sdk/testbase/arm-testbase/LICENSE new file mode 100644 index 000000000000..5d1d36e0af80 --- /dev/null +++ b/sdk/testbase/arm-testbase/LICENSE @@ -0,0 +1,21 @@ +The MIT License (MIT) + +Copyright (c) 2022 Microsoft + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. \ No newline at end of file diff --git a/sdk/testbase/arm-testbase/README.md b/sdk/testbase/arm-testbase/README.md new file mode 100644 index 000000000000..dc269706842a --- /dev/null +++ b/sdk/testbase/arm-testbase/README.md @@ -0,0 +1,109 @@ +# Azure Service client library for JavaScript + +This package contains an isomorphic SDK (runs both in Node.js and in browsers) for Azure Service client. + +Test Base + +[Source code](https://github.com/Azure/azure-sdk-for-js/tree/main/sdk/testbase/arm-testbase) | +[Package (NPM)](https://www.npmjs.com/package/@azure/arm-testbase) | +[API reference documentation](https://docs.microsoft.com/javascript/api/@azure/arm-testbase?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://nodejs.org/about/releases/) +- 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-testbase` package + +Install the Azure Service client library for JavaScript with `npm`: + +```bash +npm install @azure/arm-testbase +``` + +### Create and authenticate a `TestBase` + +To create a client object to access the Azure Service API, you will need the `endpoint` of your Azure Service resource and a `credential`. The Azure Service client can use Azure Active Directory credentials to authenticate. +You can find the endpoint for your Azure Service 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 Service** 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 { TestBase } = require("@azure/arm-testbase"); +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 TestBase(new DefaultAzureCredential(), subscriptionId); + +// For client-side applications running in the browser, use this code instead: +// const credential = new InteractiveBrowserCredential({ +// tenantId: "", +// clientId: "" +// }); +// const client = new TestBase(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 + +### TestBase + +`TestBase` is the primary interface for developers using the Azure Service client library. Explore the methods on this client object to understand the different features of the Azure Service 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%2Ftestbase%2Farm-testbase%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/testbase/arm-testbase/_meta.json b/sdk/testbase/arm-testbase/_meta.json new file mode 100644 index 000000000000..e3d341ac65fe --- /dev/null +++ b/sdk/testbase/arm-testbase/_meta.json @@ -0,0 +1,8 @@ +{ + "commit": "2139e4c0f3a5df27ed4b08008c20d76410a58f91", + "readme": "specification/testbase/resource-manager/readme.md", + "autorest_command": "autorest --version=3.7.3 --typescript --modelerfour.lenient-model-deduplication --head-as-boolean=true --license-header=MICROSOFT_MIT_NO_VERSION --generate-test --typescript-sdks-folder=/mnt/vss/_work/1/s/azure-sdk-for-js ../azure-rest-api-specs/specification/testbase/resource-manager/readme.md --use=@autorest/typescript@6.0.0-alpha.19.20220425.1", + "repository_url": "https://github.com/Azure/azure-rest-api-specs.git", + "release_tool": "@azure-tools/js-sdk-release-tools@2.3.2", + "use": "@autorest/typescript@6.0.0-alpha.19.20220425.1" +} \ No newline at end of file diff --git a/sdk/testbase/arm-testbase/api-extractor.json b/sdk/testbase/arm-testbase/api-extractor.json new file mode 100644 index 000000000000..72c592a4c194 --- /dev/null +++ b/sdk/testbase/arm-testbase/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-testbase.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/testbase/arm-testbase/package.json b/sdk/testbase/arm-testbase/package.json new file mode 100644 index 000000000000..02abc44d7917 --- /dev/null +++ b/sdk/testbase/arm-testbase/package.json @@ -0,0 +1,112 @@ +{ + "name": "@azure/arm-testbase", + "sdk-type": "mgmt", + "author": "Microsoft Corporation", + "description": "A generated SDK for TestBase.", + "version": "1.0.0-beta.1", + "engines": { + "node": ">=12.0.0" + }, + "dependencies": { + "@azure/core-lro": "^2.2.0", + "@azure/abort-controller": "^1.0.0", + "@azure/core-paging": "^1.2.0", + "@azure/core-client": "^1.5.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-testbase.d.ts", + "devDependencies": { + "@microsoft/api-extractor": "7.18.11", + "@rollup/plugin-commonjs": "^21.0.1", + "@rollup/plugin-json": "^4.1.0", + "@rollup/plugin-multi-entry": "^4.1.0", + "@rollup/plugin-node-resolve": "^13.1.3", + "mkdirp": "^1.0.4", + "rollup": "^2.66.1", + "rollup-plugin-sourcemaps": "^0.6.3", + "typescript": "~4.2.0", + "uglify-js": "^3.4.9", + "rimraf": "^3.0.0", + "@azure/identity": "^2.0.1", + "@azure-tools/test-recorder": "^2.0.0", + "@azure-tools/test-credential": "^1.0.0", + "mocha": "^7.1.1", + "cross-env": "^7.0.2", + "@azure/dev-tool": "^1.0.0" + }, + "homepage": "https://github.com/Azure/azure-sdk-for-js/tree/main/sdk/testbase/arm-testbase", + "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", + "docs": "echo skipped" + }, + "sideEffects": false, + "//metadata": { + "constantPaths": [ + { + "path": "src/testBase.ts", + "prefix": "packageDetails" + } + ] + }, + "autoPublish": true +} \ No newline at end of file diff --git a/sdk/testbase/arm-testbase/review/arm-testbase.api.md b/sdk/testbase/arm-testbase/review/arm-testbase.api.md new file mode 100644 index 000000000000..5d9834fd2fe2 --- /dev/null +++ b/sdk/testbase/arm-testbase/review/arm-testbase.api.md @@ -0,0 +1,1784 @@ +## API Report File for "@azure/arm-testbase" + +> Do not edit this file. It is a report generated by [API Extractor](https://api-extractor.com/). + +```ts + +import * as coreAuth from '@azure/core-auth'; +import * as coreClient from '@azure/core-client'; +import { PagedAsyncIterableIterator } from '@azure/core-paging'; +import { PollerLike } from '@azure/core-lro'; +import { PollOperationState } from '@azure/core-lro'; + +// @public +export type Action = string; + +// @public +export interface AnalysisResultListResult { + readonly nextLink?: string; + value?: AnalysisResultSingletonResource[]; +} + +// @public +export type AnalysisResultName = string; + +// @public +export interface AnalysisResults { + get(resourceGroupName: string, testBaseAccountName: string, packageName: string, testResultName: string, analysisResultName: AnalysisResultName, options?: AnalysisResultsGetOptionalParams): Promise; + list(resourceGroupName: string, testBaseAccountName: string, packageName: string, testResultName: string, analysisResultType: AnalysisResultType, options?: AnalysisResultsListOptionalParams): PagedAsyncIterableIterator; +} + +// @public +export interface AnalysisResultsGetOptionalParams extends coreClient.OperationOptions { +} + +// @public +export type AnalysisResultsGetResponse = AnalysisResultSingletonResource; + +// @public +export type AnalysisResultSingletonResource = ProxyResource & { + readonly systemData?: SystemData; + grade?: Grade; + analysisResultType?: AnalysisResultType; +}; + +// @public +export interface AnalysisResultSingletonResourceProperties { + analysisResultType: "ScriptExecution" | "Reliability" | "CPUUtilization" | "MemoryUtilization" | "CPURegression" | "MemoryRegression" | "TestAnalysis"; + grade?: Grade; +} + +// @public (undocumented) +export type AnalysisResultSingletonResourcePropertiesUnion = AnalysisResultSingletonResourceProperties | ScriptExecutionResultSingletonResourceProperties | ReliabilityResultSingletonResourceProperties | CPUUtilizationResultSingletonResourceProperties | MemoryUtilizationResultSingletonResourceProperties | CPURegressionResultSingletonResourceProperties | MemoryRegressionResultSingletonResourceProperties | TestAnalysisResultSingletonResourceProperties; + +// @public +export interface AnalysisResultsListOptionalParams extends coreClient.OperationOptions { +} + +// @public +export type AnalysisResultsListResponse = AnalysisResultListResult; + +// @public +export type AnalysisResultType = string; + +// @public +export type AnalysisStatus = string; + +// @public +export interface AvailableOS { + get(resourceGroupName: string, testBaseAccountName: string, availableOSResourceName: string, options?: AvailableOSGetOptionalParams): Promise; + list(resourceGroupName: string, testBaseAccountName: string, osUpdateType: OsUpdateType, options?: AvailableOSListOptionalParams): PagedAsyncIterableIterator; +} + +// @public +export interface AvailableOSGetOptionalParams extends coreClient.OperationOptions { +} + +// @public +export type AvailableOSGetResponse = AvailableOSResource; + +// @public +export interface AvailableOSListNextOptionalParams extends coreClient.OperationOptions { +} + +// @public +export type AvailableOSListNextResponse = AvailableOSListResult; + +// @public +export interface AvailableOSListOptionalParams extends coreClient.OperationOptions { +} + +// @public +export type AvailableOSListResponse = AvailableOSListResult; + +// @public +export interface AvailableOSListResult { + readonly nextLink?: string; + value?: AvailableOSResource[]; +} + +// @public +export type AvailableOSResource = ProxyResource & { + readonly systemData?: SystemData; + osId?: string; + osName?: string; + osVersion?: string; + insiderChannel?: string; + osUpdateType?: string; + osPlatform?: string; +}; + +// @public (undocumented) +export interface BillingHubExecutionUsageDetail { + // (undocumented) + applicationName?: string; + // (undocumented) + applicationVersion?: string; + // (undocumented) + billedCharges?: number; + // (undocumented) + endTimeStamp?: Date; + // (undocumented) + executionRequestId?: string; + // (undocumented) + meterId?: string; + // (undocumented) + osBuild?: string; + // (undocumented) + release?: string; + // (undocumented) + sku?: string; + // (undocumented) + startTimeStamp?: Date; + // (undocumented) + testType?: string; + // (undocumented) + updateType?: string; + // (undocumented) + usedBillableHours?: number; + // (undocumented) + usedFreeHours?: number; +} + +// @public (undocumented) +export interface BillingHubFreeHourIncrementEntry { + // (undocumented) + createTimeStamp?: Date; + // (undocumented) + expirationTimeStamp?: Date; + // (undocumented) + incrementalFreeHours?: number; + // (undocumented) + remainingFreeHours?: number; +} + +// @public (undocumented) +export interface BillingHubGetFreeHourBalanceResponse { + // (undocumented) + incrementEntries?: BillingHubFreeHourIncrementEntry[]; + // (undocumented) + totalRemainingFreeHours?: number; +} + +// @public (undocumented) +export interface BillingHubGetUsageRequest { + // (undocumented) + endTimeStamp: Date; + // (undocumented) + pageIndex?: number; + // (undocumented) + pageSize?: number; + // (undocumented) + startTimeStamp: Date; +} + +// @public (undocumented) +export interface BillingHubGetUsageResponse { + // (undocumented) + nextRequest?: BillingHubGetUsageRequest; + // (undocumented) + packageUsageEntries?: BillingHubPackageUsage[]; + // (undocumented) + totalCharges?: number; + // (undocumented) + totalUsedBillableHours?: number; + // (undocumented) + totalUsedFreeHours?: number; +} + +// @public (undocumented) +export interface BillingHubPackageUsage { + // (undocumented) + applicationName?: string; + // (undocumented) + applicationVersion?: string; + // (undocumented) + azureResourceUri?: string; + // (undocumented) + totalCharges?: number; + // (undocumented) + totalUsedBillableHours?: number; + // (undocumented) + totalUsedFreeHours?: number; + // (undocumented) + usageEntriesGroupedByUpdateType?: BillingHubUsageGroupedByUpdateType[]; +} + +// @public +export interface BillingHubService { + // (undocumented) + getFreeHourBalance(resourceGroupName: string, testBaseAccountName: string, options?: BillingHubServiceGetFreeHourBalanceOptionalParams): Promise; + // (undocumented) + getUsage(resourceGroupName: string, testBaseAccountName: string, options?: BillingHubServiceGetUsageOptionalParams): Promise; +} + +// @public +export interface BillingHubServiceGetFreeHourBalanceOptionalParams extends coreClient.OperationOptions { +} + +// @public +export type BillingHubServiceGetFreeHourBalanceResponse = BillingHubGetFreeHourBalanceResponse; + +// @public +export interface BillingHubServiceGetUsageOptionalParams extends coreClient.OperationOptions { + // (undocumented) + getUsageRequest?: BillingHubGetUsageRequest; +} + +// @public +export type BillingHubServiceGetUsageResponse = BillingHubGetUsageResponse; + +// @public (undocumented) +export interface BillingHubUsage { + // (undocumented) + applicationName?: string; + // (undocumented) + applicationVersion?: string; + // (undocumented) + azureResourceUri?: string; + // (undocumented) + totalCharges?: number; + // (undocumented) + totalUsedBillableHours?: number; + // (undocumented) + totalUsedFreeHours?: number; + // (undocumented) + usageGroups?: BillingHubUsageGroup[]; +} + +// @public (undocumented) +export interface BillingHubUsageGroup { + // (undocumented) + executionUsageDetails?: BillingHubExecutionUsageDetail[]; + // (undocumented) + osBuild?: string; + // (undocumented) + productFamily?: string; + // (undocumented) + release?: string; + // (undocumented) + releaseBuildDate?: Date; + // (undocumented) + releaseBuildNumber?: number; + // (undocumented) + releaseBuildRevision?: number; + // (undocumented) + testType?: string; + // (undocumented) + totalCharges?: number; + // (undocumented) + totalUsedBillableHours?: number; + // (undocumented) + totalUsedFreeHours?: number; +} + +// @public (undocumented) +export interface BillingHubUsageGroupedByUpdateType { + // (undocumented) + totalCharges?: number; + // (undocumented) + totalUsedBillableHours?: number; + // (undocumented) + totalUsedFreeHours?: number; + // (undocumented) + updateType?: string; + // (undocumented) + usageGroups?: BillingHubUsageGroup[]; +} + +// @public +export type Category = string; + +// @public +export interface CheckNameAvailabilityResult { + readonly message?: string; + nameAvailable?: boolean; + reason?: Reason; +} + +// @public +export interface Command { + action: Action; + alwaysRun?: boolean; + applyUpdateBefore?: boolean; + content: string; + contentType: ContentType; + maxRunTime?: number; + name: string; + restartAfter?: boolean; + runAsInteractive?: boolean; + runElevated?: boolean; +} + +// @public +export type ContentType = string; + +// @public +export type CPURegressionResultSingletonResourceProperties = AnalysisResultSingletonResourceProperties & { + analysisResultType: "CPURegression"; + cpuRegressionResults?: RegressionResult[]; +}; + +// @public +export type CPUUtilizationResultSingletonResourceProperties = AnalysisResultSingletonResourceProperties & { + analysisResultType: "CPUUtilization"; + cpuUtilizationResults?: UtilizationResult[]; +}; + +// @public +export type CreatedByType = string; + +// @public +export interface CustomerEventListResult { + readonly nextLink?: string; + value?: CustomerEventResource[]; +} + +// @public +export type CustomerEventResource = ProxyResource & { + readonly systemData?: SystemData; + eventName?: string; + receivers?: NotificationEventReceiver[]; +}; + +// @public +export interface CustomerEvents { + beginCreate(resourceGroupName: string, testBaseAccountName: string, customerEventName: string, parameters: CustomerEventResource, options?: CustomerEventsCreateOptionalParams): Promise, CustomerEventsCreateResponse>>; + beginCreateAndWait(resourceGroupName: string, testBaseAccountName: string, customerEventName: string, parameters: CustomerEventResource, options?: CustomerEventsCreateOptionalParams): Promise; + beginDelete(resourceGroupName: string, testBaseAccountName: string, customerEventName: string, options?: CustomerEventsDeleteOptionalParams): Promise, void>>; + beginDeleteAndWait(resourceGroupName: string, testBaseAccountName: string, customerEventName: string, options?: CustomerEventsDeleteOptionalParams): Promise; + get(resourceGroupName: string, testBaseAccountName: string, customerEventName: string, options?: CustomerEventsGetOptionalParams): Promise; + listByTestBaseAccount(resourceGroupName: string, testBaseAccountName: string, options?: CustomerEventsListByTestBaseAccountOptionalParams): PagedAsyncIterableIterator; +} + +// @public +export interface CustomerEventsCreateHeaders { + azureAsyncOperation?: string; +} + +// @public +export interface CustomerEventsCreateOptionalParams extends coreClient.OperationOptions { + resumeFrom?: string; + updateIntervalInMs?: number; +} + +// @public +export type CustomerEventsCreateResponse = CustomerEventResource; + +// @public +export interface CustomerEventsDeleteHeaders { + azureAsyncOperation?: string; + location?: string; +} + +// @public +export interface CustomerEventsDeleteOptionalParams extends coreClient.OperationOptions { + resumeFrom?: string; + updateIntervalInMs?: number; +} + +// @public +export interface CustomerEventsGetOptionalParams extends coreClient.OperationOptions { +} + +// @public +export type CustomerEventsGetResponse = CustomerEventResource; + +// @public +export interface CustomerEventsListByTestBaseAccountNextOptionalParams extends coreClient.OperationOptions { +} + +// @public +export type CustomerEventsListByTestBaseAccountNextResponse = CustomerEventListResult; + +// @public +export interface CustomerEventsListByTestBaseAccountOptionalParams extends coreClient.OperationOptions { +} + +// @public +export type CustomerEventsListByTestBaseAccountResponse = CustomerEventListResult; + +// @public +export interface DistributionGroupListReceiverValue { + distributionGroups?: string[]; +} + +// @public +export interface DownloadURLResponse { + readonly downloadUrl?: string; + readonly expirationTime?: Date; +} + +// @public +export interface EmailEventListResult { + readonly nextLink?: string; + value?: EmailEventResource[]; +} + +// @public +export type EmailEventResource = ProxyResource & { + readonly systemData?: SystemData; + eventId?: string; + eventName?: string; + displayName?: string; +}; + +// @public +export interface EmailEvents { + get(resourceGroupName: string, testBaseAccountName: string, emailEventResourceName: string, options?: EmailEventsGetOptionalParams): Promise; + list(resourceGroupName: string, testBaseAccountName: string, options?: EmailEventsListOptionalParams): PagedAsyncIterableIterator; +} + +// @public +export interface EmailEventsGetOptionalParams extends coreClient.OperationOptions { +} + +// @public +export type EmailEventsGetResponse = EmailEventResource; + +// @public +export interface EmailEventsListNextOptionalParams extends coreClient.OperationOptions { +} + +// @public +export type EmailEventsListNextResponse = EmailEventListResult; + +// @public +export interface EmailEventsListOptionalParams extends coreClient.OperationOptions { +} + +// @public +export type EmailEventsListResponse = EmailEventListResult; + +// @public +export interface ErrorDefinition { + readonly code?: string; + readonly details?: ErrorDefinition[]; + readonly message?: string; + readonly target?: string; +} + +// @public +export interface ErrorResponse { + error?: ErrorDefinition; +} + +// @public +export type ExecutionStatus = string; + +// @public +export interface FavoriteProcesses { + create(resourceGroupName: string, testBaseAccountName: string, packageName: string, favoriteProcessResourceName: string, parameters: FavoriteProcessResource, options?: FavoriteProcessesCreateOptionalParams): Promise; + delete(resourceGroupName: string, testBaseAccountName: string, packageName: string, favoriteProcessResourceName: string, options?: FavoriteProcessesDeleteOptionalParams): Promise; + get(resourceGroupName: string, testBaseAccountName: string, packageName: string, favoriteProcessResourceName: string, options?: FavoriteProcessesGetOptionalParams): Promise; + list(resourceGroupName: string, testBaseAccountName: string, packageName: string, options?: FavoriteProcessesListOptionalParams): PagedAsyncIterableIterator; +} + +// @public +export interface FavoriteProcessesCreateOptionalParams extends coreClient.OperationOptions { +} + +// @public +export type FavoriteProcessesCreateResponse = FavoriteProcessResource; + +// @public +export interface FavoriteProcessesDeleteOptionalParams extends coreClient.OperationOptions { +} + +// @public +export interface FavoriteProcessesGetOptionalParams extends coreClient.OperationOptions { +} + +// @public +export type FavoriteProcessesGetResponse = FavoriteProcessResource; + +// @public +export interface FavoriteProcessesListNextOptionalParams extends coreClient.OperationOptions { +} + +// @public +export type FavoriteProcessesListNextResponse = FavoriteProcessListResult; + +// @public +export interface FavoriteProcessesListOptionalParams extends coreClient.OperationOptions { +} + +// @public +export type FavoriteProcessesListResponse = FavoriteProcessListResult; + +// @public +export interface FavoriteProcessListResult { + readonly nextLink?: string; + value?: FavoriteProcessResource[]; +} + +// @public +export type FavoriteProcessResource = ProxyResource & { + readonly systemData?: SystemData; + actualProcessName?: string; +}; + +// @public +export interface FileUploadURLResponse { + readonly blobPath?: string; + readonly uploadUrl?: string; +} + +// @public +export interface FlightingRingListResult { + readonly nextLink?: string; + value?: FlightingRingResource[]; +} + +// @public +export type FlightingRingResource = ProxyResource & { + readonly systemData?: SystemData; + actualFlightingRingName?: string; +}; + +// @public +export interface FlightingRings { + get(resourceGroupName: string, testBaseAccountName: string, flightingRingResourceName: string, options?: FlightingRingsGetOptionalParams): Promise; + list(resourceGroupName: string, testBaseAccountName: string, options?: FlightingRingsListOptionalParams): PagedAsyncIterableIterator; +} + +// @public +export interface FlightingRingsGetOptionalParams extends coreClient.OperationOptions { +} + +// @public +export type FlightingRingsGetResponse = FlightingRingResource; + +// @public +export interface FlightingRingsListNextOptionalParams extends coreClient.OperationOptions { +} + +// @public +export type FlightingRingsListNextResponse = FlightingRingListResult; + +// @public +export interface FlightingRingsListOptionalParams extends coreClient.OperationOptions { +} + +// @public +export type FlightingRingsListResponse = FlightingRingListResult; + +// @public +export interface GetFileUploadURLParameters { + blobName?: string; +} + +// @public +export type Grade = string; + +// @public +export interface IdentifiedFailure { + category?: Category; + errorMessage?: string; + failureId?: string; + guidance?: string; +} + +// @public +export enum KnownAction { + // (undocumented) + Close = "Close", + // (undocumented) + Custom = "Custom", + // (undocumented) + Install = "Install", + // (undocumented) + Launch = "Launch", + // (undocumented) + Uninstall = "Uninstall" +} + +// @public +export enum KnownAnalysisResultName { + // (undocumented) + CpuRegression = "cpuRegression", + // (undocumented) + CpuUtilization = "cpuUtilization", + // (undocumented) + MemoryRegression = "memoryRegression", + // (undocumented) + MemoryUtilization = "memoryUtilization", + // (undocumented) + Reliability = "reliability", + // (undocumented) + ScriptExecution = "scriptExecution", + // (undocumented) + TestAnalysis = "testAnalysis" +} + +// @public +export enum KnownAnalysisResultType { + // (undocumented) + CPURegression = "CPURegression", + // (undocumented) + CPUUtilization = "CPUUtilization", + // (undocumented) + MemoryRegression = "MemoryRegression", + // (undocumented) + MemoryUtilization = "MemoryUtilization", + // (undocumented) + Reliability = "Reliability", + // (undocumented) + ScriptExecution = "ScriptExecution", + // (undocumented) + TestAnalysis = "TestAnalysis" +} + +// @public +export enum KnownAnalysisStatus { + // (undocumented) + Available = "Available", + // (undocumented) + Completed = "Completed", + // (undocumented) + Failed = "Failed", + // (undocumented) + InProgress = "InProgress", + // (undocumented) + None = "None", + // (undocumented) + NotAvailable = "NotAvailable", + // (undocumented) + Succeeded = "Succeeded" +} + +// @public +export enum KnownCategory { + // (undocumented) + Infrastructure = "Infrastructure", + // (undocumented) + None = "None", + // (undocumented) + OSUpdate = "OSUpdate", + // (undocumented) + Package = "Package", + // (undocumented) + Unidentified = "Unidentified" +} + +// @public +export enum KnownContentType { + // (undocumented) + File = "File", + // (undocumented) + Inline = "Inline", + // (undocumented) + Path = "Path" +} + +// @public +export enum KnownCreatedByType { + // (undocumented) + Application = "Application", + // (undocumented) + Key = "Key", + // (undocumented) + ManagedIdentity = "ManagedIdentity", + // (undocumented) + User = "User" +} + +// @public +export enum KnownExecutionStatus { + // (undocumented) + Completed = "Completed", + // (undocumented) + Failed = "Failed", + // (undocumented) + Incomplete = "Incomplete", + // (undocumented) + InProgress = "InProgress", + // (undocumented) + None = "None", + // (undocumented) + NotExecuted = "NotExecuted", + // (undocumented) + Processing = "Processing", + // (undocumented) + Succeeded = "Succeeded" +} + +// @public +export enum KnownGrade { + // (undocumented) + Fail = "Fail", + // (undocumented) + None = "None", + // (undocumented) + NotAvailable = "NotAvailable", + // (undocumented) + Pass = "Pass" +} + +// @public +export enum KnownOsUpdateType { + // (undocumented) + FeatureUpdate = "FeatureUpdate", + // (undocumented) + SecurityUpdate = "SecurityUpdate" +} + +// @public +export enum KnownPackageStatus { + // (undocumented) + Deleted = "Deleted", + // (undocumented) + Error = "Error", + // (undocumented) + PreValidationCheckPass = "PreValidationCheckPass", + // (undocumented) + Ready = "Ready", + // (undocumented) + Registered = "Registered", + // (undocumented) + Unknown = "Unknown", + // (undocumented) + ValidatingPackage = "ValidatingPackage", + // (undocumented) + ValidationLongerThanUsual = "ValidationLongerThanUsual", + // (undocumented) + VerifyingPackage = "VerifyingPackage" +} + +// @public +export enum KnownProvisioningState { + // (undocumented) + Cancelled = "Cancelled", + // (undocumented) + Creating = "Creating", + // (undocumented) + Deleting = "Deleting", + // (undocumented) + Failed = "Failed", + // (undocumented) + Succeeded = "Succeeded", + // (undocumented) + Updating = "Updating" +} + +// @public +export enum KnownReason { + // (undocumented) + AlreadyExists = "AlreadyExists", + // (undocumented) + Invalid = "Invalid" +} + +// @public +export enum KnownTestAnalysisStatus { + // (undocumented) + Analyzing = "Analyzing", + // (undocumented) + Completed = "Completed", + // (undocumented) + Failed = "Failed", + // (undocumented) + None = "None" +} + +// @public +export enum KnownTestStatus { + // (undocumented) + Completed = "Completed", + // (undocumented) + DataProcessing = "DataProcessing", + // (undocumented) + InfrastructureFailure = "InfrastructureFailure", + // (undocumented) + None = "None", + // (undocumented) + TestAndUpdateFailure = "TestAndUpdateFailure", + // (undocumented) + TestExecutionInProgress = "TestExecutionInProgress", + // (undocumented) + TestFailure = "TestFailure", + // (undocumented) + UpdateFailure = "UpdateFailure" +} + +// @public +export enum KnownTestType { + // (undocumented) + FunctionalTest = "FunctionalTest", + // (undocumented) + OutOfBoxTest = "OutOfBoxTest" +} + +// @public +export enum KnownTier { + // (undocumented) + Standard = "Standard" +} + +// @public +export enum KnownType { + // (undocumented) + FeatureUpdate = "FeatureUpdate", + // (undocumented) + SecurityUpdate = "SecurityUpdate" +} + +// @public +export enum KnownValidationRunStatus { + // (undocumented) + Failed = "Failed", + // (undocumented) + Passed = "Passed", + // (undocumented) + Pending = "Pending", + // (undocumented) + Unknown = "Unknown" +} + +// @public +export type MemoryRegressionResultSingletonResourceProperties = AnalysisResultSingletonResourceProperties & { + analysisResultType: "MemoryRegression"; + memoryRegressionResults?: RegressionResult[]; +}; + +// @public +export type MemoryUtilizationResultSingletonResourceProperties = AnalysisResultSingletonResourceProperties & { + analysisResultType: "MemoryUtilization"; + memoryUtilizationResults?: UtilizationResult[]; +}; + +// @public +export interface NotificationEventReceiver { + receiverType?: string; + receiverValue?: NotificationReceiverValue; +} + +// @public +export interface NotificationReceiverValue { + distributionGroupListReceiverValue?: DistributionGroupListReceiverValue; + subscriptionReceiverValue?: SubscriptionReceiverValue; + userObjectReceiverValue?: UserObjectReceiverValue; +} + +// @public +export interface Operation { + display?: OperationDisplay; + readonly isDataAction?: boolean; + readonly name?: string; + readonly origin?: string; + properties?: Record; +} + +// @public +export interface OperationDisplay { + readonly description?: string; + readonly operation?: string; + readonly provider?: string; + readonly resource?: string; +} + +// @public +export interface OperationListResult { + readonly nextLink?: string; + value?: Operation[]; +} + +// @public +export interface Operations { + list(options?: OperationsListOptionalParams): PagedAsyncIterableIterator; +} + +// @public +export interface OperationsListNextOptionalParams extends coreClient.OperationOptions { +} + +// @public +export type OperationsListNextResponse = OperationListResult; + +// @public +export interface OperationsListOptionalParams extends coreClient.OperationOptions { +} + +// @public +export type OperationsListResponse = OperationListResult; + +// @public +export interface OSUpdateListResult { + readonly nextLink?: string; + value?: OSUpdateResource[]; +} + +// @public +export type OSUpdateResource = ProxyResource & { + readonly systemData?: SystemData; + osName?: string; + release?: string; + flightingRing?: string; + buildVersion?: string; + buildRevision?: string; + typePropertiesType?: Type; + releaseVersionDate?: Date; +}; + +// @public +export interface OSUpdates { + get(resourceGroupName: string, testBaseAccountName: string, packageName: string, osUpdateResourceName: string, options?: OSUpdatesGetOptionalParams): Promise; + list(resourceGroupName: string, testBaseAccountName: string, packageName: string, osUpdateType: OsUpdateType, options?: OSUpdatesListOptionalParams): PagedAsyncIterableIterator; +} + +// @public +export interface OSUpdatesGetOptionalParams extends coreClient.OperationOptions { +} + +// @public +export type OSUpdatesGetResponse = OSUpdateResource; + +// @public +export interface OSUpdatesListNextOptionalParams extends coreClient.OperationOptions { +} + +// @public +export type OSUpdatesListNextResponse = OSUpdateListResult; + +// @public +export interface OSUpdatesListOptionalParams extends coreClient.OperationOptions { +} + +// @public +export type OSUpdatesListResponse = OSUpdateListResult; + +// @public +export interface OSUpdatesTestSummary { + executionStatus?: ExecutionStatus; + grade?: Grade; + osUpdateTestSummaries?: OSUpdateTestSummary[]; + testRunTime?: string; + testStatus?: TestStatus; +} + +// @public +export interface OSUpdateTestSummary { + buildRevision?: string; + buildVersion?: string; + executionStatus?: ExecutionStatus; + flightingRing?: string; + grade?: Grade; + osName?: string; + releaseName?: string; + releaseVersionDate?: Date; + testRunTime?: string; + testStatus?: TestStatus; + testType?: string; +} + +// @public +export type OsUpdateType = string; + +// @public +export interface PackageCheckNameAvailabilityParameters { + applicationName: string; + name: string; + type?: string; + version: string; +} + +// @public +export interface PackageListResult { + readonly nextLink?: string; + value?: PackageResource[]; +} + +// @public +export type PackageResource = TrackedResource & { + readonly systemData?: SystemData; + readonly provisioningState?: ProvisioningState; + applicationName?: string; + version?: string; + readonly testTypes?: TestType[]; + targetOSList?: TargetOSInfo[]; + readonly packageStatus?: PackageStatus; + readonly lastModifiedTime?: Date; + flightingRing?: string; + readonly isEnabled?: boolean; + blobPath?: string; + readonly validationResults?: PackageValidationResult[]; + tests?: Test[]; +}; + +// @public +export interface PackageRunTestParameters { + flightingRing?: string; + osName: string; + osUpdateType?: OsUpdateType; + releaseName?: string; + testType: TestType; +} + +// @public +export interface Packages { + beginCreate(resourceGroupName: string, testBaseAccountName: string, packageName: string, parameters: PackageResource, options?: PackagesCreateOptionalParams): Promise, PackagesCreateResponse>>; + beginCreateAndWait(resourceGroupName: string, testBaseAccountName: string, packageName: string, parameters: PackageResource, options?: PackagesCreateOptionalParams): Promise; + beginDelete(resourceGroupName: string, testBaseAccountName: string, packageName: string, options?: PackagesDeleteOptionalParams): Promise, void>>; + beginDeleteAndWait(resourceGroupName: string, testBaseAccountName: string, packageName: string, options?: PackagesDeleteOptionalParams): Promise; + beginHardDelete(resourceGroupName: string, testBaseAccountName: string, packageName: string, options?: PackagesHardDeleteOptionalParams): Promise, void>>; + beginHardDeleteAndWait(resourceGroupName: string, testBaseAccountName: string, packageName: string, options?: PackagesHardDeleteOptionalParams): Promise; + beginUpdate(resourceGroupName: string, testBaseAccountName: string, packageName: string, parameters: PackageUpdateParameters, options?: PackagesUpdateOptionalParams): Promise, PackagesUpdateResponse>>; + beginUpdateAndWait(resourceGroupName: string, testBaseAccountName: string, packageName: string, parameters: PackageUpdateParameters, options?: PackagesUpdateOptionalParams): Promise; + get(resourceGroupName: string, testBaseAccountName: string, packageName: string, options?: PackagesGetOptionalParams): Promise; + getDownloadURL(resourceGroupName: string, testBaseAccountName: string, packageName: string, options?: PackagesGetDownloadURLOptionalParams): Promise; + listByTestBaseAccount(resourceGroupName: string, testBaseAccountName: string, options?: PackagesListByTestBaseAccountOptionalParams): PagedAsyncIterableIterator; + runTest(resourceGroupName: string, testBaseAccountName: string, packageName: string, options?: PackagesRunTestOptionalParams): Promise; +} + +// @public +export interface PackagesCreateHeaders { + azureAsyncOperation?: string; +} + +// @public +export interface PackagesCreateOptionalParams extends coreClient.OperationOptions { + resumeFrom?: string; + updateIntervalInMs?: number; +} + +// @public +export type PackagesCreateResponse = PackageResource; + +// @public +export interface PackagesDeleteHeaders { + azureAsyncOperation?: string; + location?: string; +} + +// @public +export interface PackagesDeleteOptionalParams extends coreClient.OperationOptions { + resumeFrom?: string; + updateIntervalInMs?: number; +} + +// @public +export interface PackagesGetDownloadURLOptionalParams extends coreClient.OperationOptions { +} + +// @public +export type PackagesGetDownloadURLResponse = DownloadURLResponse; + +// @public +export interface PackagesGetOptionalParams extends coreClient.OperationOptions { +} + +// @public +export type PackagesGetResponse = PackageResource; + +// @public +export interface PackagesHardDeleteHeaders { + azureAsyncOperation?: string; + location?: string; +} + +// @public +export interface PackagesHardDeleteOptionalParams extends coreClient.OperationOptions { + resumeFrom?: string; + updateIntervalInMs?: number; +} + +// @public +export interface PackagesListByTestBaseAccountNextOptionalParams extends coreClient.OperationOptions { +} + +// @public +export type PackagesListByTestBaseAccountNextResponse = PackageListResult; + +// @public +export interface PackagesListByTestBaseAccountOptionalParams extends coreClient.OperationOptions { +} + +// @public +export type PackagesListByTestBaseAccountResponse = PackageListResult; + +// @public +export interface PackagesRunTestHeaders { + azureAsyncOperation?: string; + location?: string; +} + +// @public +export interface PackagesRunTestOptionalParams extends coreClient.OperationOptions { + parameters?: PackageRunTestParameters; +} + +// @public +export type PackagesRunTestResponse = PackagesRunTestHeaders; + +// @public +export type PackageStatus = string; + +// @public +export interface PackagesUpdateHeaders { + azureAsyncOperation?: string; + location?: string; +} + +// @public +export interface PackagesUpdateOptionalParams extends coreClient.OperationOptions { + resumeFrom?: string; + updateIntervalInMs?: number; +} + +// @public +export type PackagesUpdateResponse = PackageResource; + +// @public +export interface PackageUpdateParameters { + blobPath?: string; + flightingRing?: string; + isEnabled?: boolean; + tags?: { + [propertyName: string]: string; + }; + targetOSList?: TargetOSInfo[]; + tests?: Test[]; +} + +// @public +export interface PackageValidationResult { + readonly errors?: string[]; + readonly isValid?: boolean; + readonly validationName?: string; +} + +// @public +export type ProvisioningState = string; + +// @public +export type ProxyResource = Resource & {}; + +// @public +export type Reason = string; + +// @public +export interface RegressionResult { + details?: string; + diff?: number; + fileName?: string; + grade?: Grade; + isRegressed?: boolean; +} + +// @public +export interface RegressionTestDetails { + diff?: number; + isRegressed?: boolean; +} + +// @public +export interface ReliabilityResult { + crashCount?: number; + crashRegressionGrade?: Grade; + crashRegressionTestDetails?: RegressionTestDetails; + fileName?: string; + hangCount?: number; + hangRegressionGrade?: Grade; + hangRegressionTestDetails?: RegressionTestDetails; + launchCount?: number; + regressionGrade?: Grade; +} + +// @public +export type ReliabilityResultSingletonResourceProperties = AnalysisResultSingletonResourceProperties & { + analysisResultType: "Reliability"; + reliabilityResults?: ReliabilityResult[]; +}; + +// @public +export interface Resource { + readonly id?: string; + readonly name?: string; + readonly type?: string; +} + +// @public +export interface ScriptExecutionResult { + endTime?: Date; + exitCode?: number; + scriptName?: string; + startTime?: Date; + stderrLogFileName?: string; + stdoutLogFileName?: string; + timedOut?: boolean; +} + +// @public +export type ScriptExecutionResultSingletonResourceProperties = AnalysisResultSingletonResourceProperties & { + analysisResultType: "ScriptExecution"; + scriptExecutionResults?: ScriptExecutionResult[]; +}; + +// @public +export interface Skus { + list(options?: SkusListOptionalParams): PagedAsyncIterableIterator; +} + +// @public +export interface SkusListNextOptionalParams extends coreClient.OperationOptions { +} + +// @public +export type SkusListNextResponse = TestBaseAccountSKUListResult; + +// @public +export interface SkusListOptionalParams extends coreClient.OperationOptions { +} + +// @public +export type SkusListResponse = TestBaseAccountSKUListResult; + +// @public +export interface SubscriptionReceiverValue { + role?: string; + subscriptionId?: string; + subscriptionName?: string; +} + +// @public +export interface SystemData { + createdAt?: Date; + createdBy?: string; + createdByType?: CreatedByType; + lastModifiedAt?: Date; + lastModifiedBy?: string; + lastModifiedByType?: CreatedByType; +} + +// @public +export interface TargetOSInfo { + baselineOSs?: string[]; + osUpdateType: string; + targetOSs: string[]; +} + +// @public +export interface Test { + commands: Command[]; + isActive?: boolean; + testType: TestType; + readonly validationResultId?: string; + readonly validationRunStatus?: ValidationRunStatus; +} + +// @public +export interface TestAnalysisResult { + blobData?: string; + identifiedFailures?: IdentifiedFailure[]; + testAnalysisStatus?: TestAnalysisStatus; +} + +// @public +export type TestAnalysisResultSingletonResourceProperties = AnalysisResultSingletonResourceProperties & { + analysisResultType: "TestAnalysis"; + testAnalysisResult?: TestAnalysisResult; +}; + +// @public +export type TestAnalysisStatus = string; + +// @public (undocumented) +export class TestBase extends coreClient.ServiceClient { + // (undocumented) + $host: string; + constructor(credentials: coreAuth.TokenCredential, subscriptionId: string, options?: TestBaseOptionalParams); + // (undocumented) + analysisResults: AnalysisResults; + // (undocumented) + apiVersion: string; + // (undocumented) + availableOS: AvailableOS; + // (undocumented) + billingHubService: BillingHubService; + // (undocumented) + customerEvents: CustomerEvents; + // (undocumented) + emailEvents: EmailEvents; + // (undocumented) + favoriteProcesses: FavoriteProcesses; + // (undocumented) + flightingRings: FlightingRings; + // (undocumented) + operations: Operations; + // (undocumented) + oSUpdates: OSUpdates; + // (undocumented) + packages: Packages; + // (undocumented) + skus: Skus; + // (undocumented) + subscriptionId: string; + // (undocumented) + testBaseAccounts: TestBaseAccounts; + // (undocumented) + testResults: TestResults; + // (undocumented) + testSummaries: TestSummaries; + // (undocumented) + testTypes: TestTypes; + // (undocumented) + usage: Usage; +} + +// @public +export interface TestBaseAccountListResult { + readonly nextLink?: string; + value?: TestBaseAccountResource[]; +} + +// @public +export type TestBaseAccountResource = TrackedResource & { + readonly systemData?: SystemData; + readonly provisioningState?: ProvisioningState; + sku?: TestBaseAccountSKU; + readonly accessLevel?: string; +}; + +// @public +export interface TestBaseAccounts { + beginCreate(resourceGroupName: string, testBaseAccountName: string, parameters: TestBaseAccountResource, options?: TestBaseAccountsCreateOptionalParams): Promise, TestBaseAccountsCreateResponse>>; + beginCreateAndWait(resourceGroupName: string, testBaseAccountName: string, parameters: TestBaseAccountResource, options?: TestBaseAccountsCreateOptionalParams): Promise; + beginDelete(resourceGroupName: string, testBaseAccountName: string, options?: TestBaseAccountsDeleteOptionalParams): Promise, void>>; + beginDeleteAndWait(resourceGroupName: string, testBaseAccountName: string, options?: TestBaseAccountsDeleteOptionalParams): Promise; + beginOffboard(resourceGroupName: string, testBaseAccountName: string, options?: TestBaseAccountsOffboardOptionalParams): Promise, void>>; + beginOffboardAndWait(resourceGroupName: string, testBaseAccountName: string, options?: TestBaseAccountsOffboardOptionalParams): Promise; + beginUpdate(resourceGroupName: string, testBaseAccountName: string, parameters: TestBaseAccountUpdateParameters, options?: TestBaseAccountsUpdateOptionalParams): Promise, TestBaseAccountsUpdateResponse>>; + beginUpdateAndWait(resourceGroupName: string, testBaseAccountName: string, parameters: TestBaseAccountUpdateParameters, options?: TestBaseAccountsUpdateOptionalParams): Promise; + checkPackageNameAvailability(resourceGroupName: string, testBaseAccountName: string, parameters: PackageCheckNameAvailabilityParameters, options?: TestBaseAccountsCheckPackageNameAvailabilityOptionalParams): Promise; + get(resourceGroupName: string, testBaseAccountName: string, options?: TestBaseAccountsGetOptionalParams): Promise; + getFileUploadUrl(resourceGroupName: string, testBaseAccountName: string, options?: TestBaseAccountsGetFileUploadUrlOptionalParams): Promise; + listByResourceGroup(resourceGroupName: string, options?: TestBaseAccountsListByResourceGroupOptionalParams): PagedAsyncIterableIterator; + listBySubscription(options?: TestBaseAccountsListBySubscriptionOptionalParams): PagedAsyncIterableIterator; +} + +// @public +export interface TestBaseAccountsCheckPackageNameAvailabilityOptionalParams extends coreClient.OperationOptions { +} + +// @public +export type TestBaseAccountsCheckPackageNameAvailabilityResponse = CheckNameAvailabilityResult; + +// @public +export interface TestBaseAccountsCreateHeaders { + azureAsyncOperation?: string; +} + +// @public +export interface TestBaseAccountsCreateOptionalParams extends coreClient.OperationOptions { + restore?: boolean; + resumeFrom?: string; + updateIntervalInMs?: number; +} + +// @public +export type TestBaseAccountsCreateResponse = TestBaseAccountResource; + +// @public +export interface TestBaseAccountsDeleteHeaders { + azureAsyncOperation?: string; + location?: string; +} + +// @public +export interface TestBaseAccountsDeleteOptionalParams extends coreClient.OperationOptions { + resumeFrom?: string; + updateIntervalInMs?: number; +} + +// @public +export interface TestBaseAccountsGetFileUploadUrlOptionalParams extends coreClient.OperationOptions { + parameters?: GetFileUploadURLParameters; +} + +// @public +export type TestBaseAccountsGetFileUploadUrlResponse = FileUploadURLResponse; + +// @public +export interface TestBaseAccountsGetOptionalParams extends coreClient.OperationOptions { +} + +// @public +export type TestBaseAccountsGetResponse = TestBaseAccountResource; + +// @public +export interface TestBaseAccountSKU { + readonly capabilities?: TestBaseAccountSKUCapability[]; + locations?: string[]; + name: string; + resourceType?: string; + tier: Tier; +} + +// @public +export interface TestBaseAccountSKUCapability { + name: string; + value: string; +} + +// @public +export interface TestBaseAccountSKUListResult { + readonly nextLink?: string; + value?: TestBaseAccountSKU[]; +} + +// @public +export interface TestBaseAccountsListByResourceGroupNextOptionalParams extends coreClient.OperationOptions { + getDeleted?: boolean; +} + +// @public +export type TestBaseAccountsListByResourceGroupNextResponse = TestBaseAccountListResult; + +// @public +export interface TestBaseAccountsListByResourceGroupOptionalParams extends coreClient.OperationOptions { + getDeleted?: boolean; +} + +// @public +export type TestBaseAccountsListByResourceGroupResponse = TestBaseAccountListResult; + +// @public +export interface TestBaseAccountsListBySubscriptionNextOptionalParams extends coreClient.OperationOptions { + getDeleted?: boolean; +} + +// @public +export type TestBaseAccountsListBySubscriptionNextResponse = TestBaseAccountListResult; + +// @public +export interface TestBaseAccountsListBySubscriptionOptionalParams extends coreClient.OperationOptions { + getDeleted?: boolean; +} + +// @public +export type TestBaseAccountsListBySubscriptionResponse = TestBaseAccountListResult; + +// @public +export interface TestBaseAccountsOffboardHeaders { + azureAsyncOperation?: string; + location?: string; +} + +// @public +export interface TestBaseAccountsOffboardOptionalParams extends coreClient.OperationOptions { + resumeFrom?: string; + updateIntervalInMs?: number; +} + +// @public +export interface TestBaseAccountsUpdateHeaders { + azureAsyncOperation?: string; + location?: string; +} + +// @public +export interface TestBaseAccountsUpdateOptionalParams extends coreClient.OperationOptions { + resumeFrom?: string; + updateIntervalInMs?: number; +} + +// @public +export type TestBaseAccountsUpdateResponse = TestBaseAccountResource; + +// @public +export interface TestBaseAccountUpdateParameters { + sku?: TestBaseAccountSKU; + tags?: { + [propertyName: string]: string; + }; +} + +// @public +export interface TestBaseAccountUsageData { + currentValue?: number; + id?: string; + limit?: number; + name?: TestBaseAccountUsageName; + unit?: string; +} + +// @public +export interface TestBaseAccountUsageDataList { + readonly nextLink?: string; + value?: TestBaseAccountUsageData[]; +} + +// @public +export interface TestBaseAccountUsageName { + localizedValue?: string; + value?: string; +} + +// @public +export interface TestBaseOptionalParams extends coreClient.ServiceClientOptions { + $host?: string; + apiVersion?: string; + endpoint?: string; +} + +// @public +export interface TestResultAnalysisSummary { + analysisStatus?: AnalysisStatus; + grade?: Grade; + name?: string; +} + +// @public +export interface TestResultConsoleLogDownloadURLParameters { + logFileName: string; +} + +// @public +export interface TestResultListResult { + readonly nextLink?: string; + value?: TestResultResource[]; +} + +// @public +export type TestResultResource = ProxyResource & { + readonly systemData?: SystemData; + baselineTestResultId?: string; + packageId?: string; + applicationName?: string; + applicationVersion?: string; + osName?: string; + releaseName?: string; + releaseVersionDate?: Date; + flightingRing?: string; + buildVersion?: string; + buildRevision?: string; + testType?: string; + testRunTime?: string; + isDownloadDataAvailable?: boolean; + isVideoAvailable?: boolean; + executionStatus?: ExecutionStatus; + testStatus?: TestStatus; + grade?: Grade; + kbNumber?: string; + interopMediaType?: string; + interopMediaVersion?: string; + packageVersion?: string; + analysisSummaries?: TestResultAnalysisSummary[]; +}; + +// @public +export interface TestResults { + get(resourceGroupName: string, testBaseAccountName: string, packageName: string, testResultName: string, options?: TestResultsGetOptionalParams): Promise; + getConsoleLogDownloadURL(resourceGroupName: string, testBaseAccountName: string, packageName: string, testResultName: string, parameters: TestResultConsoleLogDownloadURLParameters, options?: TestResultsGetConsoleLogDownloadURLOptionalParams): Promise; + getDownloadURL(resourceGroupName: string, testBaseAccountName: string, packageName: string, testResultName: string, options?: TestResultsGetDownloadURLOptionalParams): Promise; + getVideoDownloadURL(resourceGroupName: string, testBaseAccountName: string, packageName: string, testResultName: string, options?: TestResultsGetVideoDownloadURLOptionalParams): Promise; + list(resourceGroupName: string, testBaseAccountName: string, packageName: string, osUpdateType: OsUpdateType, options?: TestResultsListOptionalParams): PagedAsyncIterableIterator; +} + +// @public +export interface TestResultsGetConsoleLogDownloadURLOptionalParams extends coreClient.OperationOptions { +} + +// @public +export type TestResultsGetConsoleLogDownloadURLResponse = DownloadURLResponse; + +// @public +export interface TestResultsGetDownloadURLOptionalParams extends coreClient.OperationOptions { +} + +// @public +export type TestResultsGetDownloadURLResponse = DownloadURLResponse; + +// @public +export interface TestResultsGetOptionalParams extends coreClient.OperationOptions { +} + +// @public +export type TestResultsGetResponse = TestResultResource; + +// @public +export interface TestResultsGetVideoDownloadURLOptionalParams extends coreClient.OperationOptions { +} + +// @public +export type TestResultsGetVideoDownloadURLResponse = DownloadURLResponse; + +// @public +export interface TestResultsListNextOptionalParams extends coreClient.OperationOptions { + filter?: string; +} + +// @public +export type TestResultsListNextResponse = TestResultListResult; + +// @public +export interface TestResultsListOptionalParams extends coreClient.OperationOptions { + filter?: string; +} + +// @public +export type TestResultsListResponse = TestResultListResult; + +// @public +export type TestStatus = string; + +// @public +export interface TestSummaries { + get(resourceGroupName: string, testBaseAccountName: string, testSummaryName: string, options?: TestSummariesGetOptionalParams): Promise; + list(resourceGroupName: string, testBaseAccountName: string, options?: TestSummariesListOptionalParams): PagedAsyncIterableIterator; +} + +// @public +export interface TestSummariesGetOptionalParams extends coreClient.OperationOptions { +} + +// @public +export type TestSummariesGetResponse = TestSummaryResource; + +// @public +export interface TestSummariesListNextOptionalParams extends coreClient.OperationOptions { +} + +// @public +export type TestSummariesListNextResponse = TestSummaryListResult; + +// @public +export interface TestSummariesListOptionalParams extends coreClient.OperationOptions { +} + +// @public +export type TestSummariesListResponse = TestSummaryListResult; + +// @public +export interface TestSummaryListResult { + readonly nextLink?: string; + value?: TestSummaryResource[]; +} + +// @public +export type TestSummaryResource = ProxyResource & { + readonly systemData?: SystemData; + testSummaryId?: string; + packageId?: string; + applicationName?: string; + applicationVersion?: string; + executionStatus?: ExecutionStatus; + testStatus?: TestStatus; + grade?: Grade; + testRunTime?: string; + featureUpdatesTestSummary?: OSUpdatesTestSummary; + securityUpdatesTestSummary?: OSUpdatesTestSummary; + packageTags?: { + [propertyName: string]: string; + }; +}; + +// @public +export type TestType = string; + +// @public +export interface TestTypeListResult { + readonly nextLink?: string; + value?: TestTypeResource[]; +} + +// @public +export type TestTypeResource = ProxyResource & { + readonly systemData?: SystemData; + actualTestTypeName?: string; +}; + +// @public +export interface TestTypes { + get(resourceGroupName: string, testBaseAccountName: string, testTypeResourceName: string, options?: TestTypesGetOptionalParams): Promise; + list(resourceGroupName: string, testBaseAccountName: string, options?: TestTypesListOptionalParams): PagedAsyncIterableIterator; +} + +// @public +export interface TestTypesGetOptionalParams extends coreClient.OperationOptions { +} + +// @public +export type TestTypesGetResponse = TestTypeResource; + +// @public +export interface TestTypesListNextOptionalParams extends coreClient.OperationOptions { +} + +// @public +export type TestTypesListNextResponse = TestTypeListResult; + +// @public +export interface TestTypesListOptionalParams extends coreClient.OperationOptions { +} + +// @public +export type TestTypesListResponse = TestTypeListResult; + +// @public +export type Tier = string; + +// @public +export type TrackedResource = Resource & { + tags?: { + [propertyName: string]: string; + }; + location: string; + readonly etag?: string; +}; + +// @public +export type Type = string; + +// @public +export interface Usage { + list(resourceGroupName: string, testBaseAccountName: string, options?: UsageListOptionalParams): PagedAsyncIterableIterator; +} + +// @public +export interface UsageListNextOptionalParams extends coreClient.OperationOptions { + filter?: string; +} + +// @public +export type UsageListNextResponse = TestBaseAccountUsageDataList; + +// @public +export interface UsageListOptionalParams extends coreClient.OperationOptions { + filter?: string; +} + +// @public +export type UsageListResponse = TestBaseAccountUsageDataList; + +// @public +export interface UserObjectReceiverValue { + userObjectIds?: string[]; +} + +// @public +export interface UtilizationBound { + percentile?: number; + value?: number; +} + +// @public +export interface UtilizationEntry { + timestamp?: Date; + value?: number; +} + +// @public +export interface UtilizationResult { + lowerBound?: UtilizationBound; + process?: string; + upperBound?: UtilizationBound; + utilization?: UtilizationEntry[]; +} + +// @public +export type ValidationRunStatus = string; + +// (No @packageDocumentation comment for this package) + +``` diff --git a/sdk/testbase/arm-testbase/rollup.config.js b/sdk/testbase/arm-testbase/rollup.config.js new file mode 100644 index 000000000000..3f89d7309da5 --- /dev/null +++ b/sdk/testbase/arm-testbase/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/testbase/arm-testbase/src/index.ts b/sdk/testbase/arm-testbase/src/index.ts new file mode 100644 index 000000000000..8f2a472e0e31 --- /dev/null +++ b/sdk/testbase/arm-testbase/src/index.ts @@ -0,0 +1,12 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +/// +export * from "./models"; +export { TestBase } from "./testBase"; +export * from "./operationsInterfaces"; diff --git a/sdk/testbase/arm-testbase/src/lroImpl.ts b/sdk/testbase/arm-testbase/src/lroImpl.ts new file mode 100644 index 000000000000..518d5f053b4e --- /dev/null +++ b/sdk/testbase/arm-testbase/src/lroImpl.ts @@ -0,0 +1,34 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +import { LongRunningOperation, LroResponse } from "@azure/core-lro"; + +export class LroImpl implements LongRunningOperation { + constructor( + private sendOperationFn: (args: any, spec: any) => Promise>, + private args: Record, + private spec: { + readonly requestBody?: unknown; + readonly path?: string; + readonly httpMethod: string; + } & Record, + public requestPath: string = spec.path!, + public requestMethod: string = spec.httpMethod + ) {} + public async sendInitialRequest(): Promise> { + return this.sendOperationFn(this.args, this.spec); + } + public async sendPollRequest(path: string): Promise> { + const { requestBody, ...restSpec } = this.spec; + return this.sendOperationFn(this.args, { + ...restSpec, + path, + httpMethod: "GET" + }); + } +} diff --git a/sdk/testbase/arm-testbase/src/models/index.ts b/sdk/testbase/arm-testbase/src/models/index.ts new file mode 100644 index 000000000000..969cca7d47f4 --- /dev/null +++ b/sdk/testbase/arm-testbase/src/models/index.ts @@ -0,0 +1,2181 @@ +/* + * 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 type AnalysisResultSingletonResourcePropertiesUnion = + | AnalysisResultSingletonResourceProperties + | ScriptExecutionResultSingletonResourceProperties + | ReliabilityResultSingletonResourceProperties + | CPUUtilizationResultSingletonResourceProperties + | MemoryUtilizationResultSingletonResourceProperties + | CPURegressionResultSingletonResourceProperties + | MemoryRegressionResultSingletonResourceProperties + | TestAnalysisResultSingletonResourceProperties; + +/** A list of Test Base Account SKUs. */ +export interface TestBaseAccountSKUListResult { + /** The list of Test Base Account SKUs. */ + value?: TestBaseAccountSKU[]; + /** + * Link to the next set of results. Not empty if value contains incomplete list of results. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly nextLink?: string; +} + +/** Describes a Test Base Account SKU. */ +export interface TestBaseAccountSKU { + /** The type of resource the SKU applies to. */ + resourceType?: string; + /** The name of the SKU. This is typically a letter + number code, such as B0 or S0. */ + name: string; + /** The tier of this particular SKU. */ + tier: Tier; + /** + * The capabilities of a SKU. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly capabilities?: TestBaseAccountSKUCapability[]; + /** The locations that the SKU is available. */ + locations?: string[]; +} + +/** Properties of the Test Base Account SKU Capability. */ +export interface TestBaseAccountSKUCapability { + /** An invariant to describe the feature, such as 'SLA'. */ + name: string; + /** An invariant if the feature is measured by quantity, such as 99.9%. */ + value: string; +} + +/** The error response send when an operation fails. */ +export interface ErrorResponse { + /** The error details. */ + error?: ErrorDefinition; +} + +/** Error definition. */ +export interface ErrorDefinition { + /** + * 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 target of the particular error. + * 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?: ErrorDefinition[]; +} + +/** A list of Test Base Accounts. */ +export interface TestBaseAccountListResult { + /** The list of Test Base Accounts. */ + value?: TestBaseAccountResource[]; + /** + * Link to the next set of results. Not empty if value contains incomplete list of results. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly nextLink?: 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 type of identity that last modified the resource. */ + lastModifiedAt?: Date; +} + +/** The Resource definition. */ +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; +} + +/** Parameters supplied to update a Test Base Account. */ +export interface TestBaseAccountUpdateParameters { + /** The tags of the Test Base Account. */ + tags?: { [propertyName: string]: string }; + /** The SKU of the Test Base Account. */ + sku?: TestBaseAccountSKU; +} + +/** A list of Test Base Account usage data. */ +export interface TestBaseAccountUsageDataList { + /** The list of Test Base Account usage data. */ + value?: TestBaseAccountUsageData[]; + /** + * Link to the next set of results. Not empty if value contains incomplete list of results. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly nextLink?: string; +} + +/** The usage data of a Test Base Account. */ +export interface TestBaseAccountUsageData { + /** Fully qualified ARM resource id */ + id?: string; + /** Localizable String object containing the name and a localized value. */ + name?: TestBaseAccountUsageName; + /** Representing the units of the usage quota. Possible values are: Count, Bytes, Seconds, Percent, CountPerSecond, BytesPerSecond. */ + unit?: string; + /** The maximum permitted value for the usage quota. If there is no limit, this value will be -1. */ + limit?: number; + /** Current value for the usage quota. */ + currentValue?: number; +} + +/** Localizable String object containing the name and a localized value. */ +export interface TestBaseAccountUsageName { + /** The identifier of the usage. */ + value?: string; + /** Localized name of the usage. */ + localizedValue?: string; +} + +/** The parameters supplied to the Test Base Account GetFileUploadURL action. */ +export interface GetFileUploadURLParameters { + /** The custom file name of the uploaded blob. */ + blobName?: string; +} + +/** The URL response */ +export interface FileUploadURLResponse { + /** + * The URL used for uploading the package. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly uploadUrl?: string; + /** + * The blob path of the uploaded package. It will be used as the 'blobPath' property of PackageResource. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly blobPath?: string; +} + +/** A list of available OSs. */ +export interface AvailableOSListResult { + /** The list of available OSs. */ + value?: AvailableOSResource[]; + /** + * Link to the next set of results. Not empty if value contains incomplete list of results. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly nextLink?: string; +} + +/** A list of flighting rings. */ +export interface FlightingRingListResult { + /** The list of flighting rings. */ + value?: FlightingRingResource[]; + /** + * Link to the next set of results. Not empty if value contains incomplete list of results. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly nextLink?: string; +} + +/** A list of test types. */ +export interface TestTypeListResult { + /** The list of test types. */ + value?: TestTypeResource[]; + /** + * Link to the next set of results. Not empty if value contains incomplete list of results. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly nextLink?: string; +} + +/** Parameters body to pass for Test Base Package name availability check. */ +export interface PackageCheckNameAvailabilityParameters { + /** Resource name to verify. */ + name: string; + /** Application name to verify. */ + applicationName: string; + /** Version name to verify. */ + version: string; + /** fully qualified resource type which includes provider namespace. */ + type?: string; +} + +/** Description of a Check Name availability response properties. */ +export interface CheckNameAvailabilityResult { + /** Value indicating the availability of the name: true if the name is available; otherwise, false. */ + nameAvailable?: boolean; + /** The reason for unavailability of a name. Required if nameAvailable == false. */ + reason?: Reason; + /** + * The detailed info regarding the reason associated with the name. Required if nameAvailable == false. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly message?: string; +} + +/** A list of Test Base Packages. */ +export interface PackageListResult { + /** The list of Test Base Packages. */ + value?: PackageResource[]; + /** + * Link to the next set of results. Not empty if value contains incomplete list of results. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly nextLink?: string; +} + +/** The information of the target OS to be tested. */ +export interface TargetOSInfo { + /** Specifies the OS update type to test against, e.g., 'Security updates' or 'Feature updates'. */ + osUpdateType: string; + /** Specifies the target OSs to be tested. */ + targetOSs: string[]; + /** Specifies the baseline OSs to be tested. */ + baselineOSs?: string[]; +} + +/** The validation results. There's validation on package when it's created or updated. */ +export interface PackageValidationResult { + /** + * Validation name. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly validationName?: string; + /** + * Indicates whether the package passed the validation. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly isValid?: boolean; + /** + * Error information. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly errors?: string[]; +} + +/** The definition of a Test. */ +export interface Test { + /** The type of the test. */ + testType: TestType; + /** + * The status of the validation run of the package. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly validationRunStatus?: ValidationRunStatus; + /** + * Resource identifier of the validation test result. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly validationResultId?: string; + /** Indicates if this test is active.It doesn't schedule test for not active Test. */ + isActive?: boolean; + /** The commands used in the test. */ + commands: Command[]; +} + +/** The command used in the test */ +export interface Command { + /** The name of the command. */ + name: string; + /** The action of the command. */ + action: Action; + /** The type of command content. */ + contentType: ContentType; + /** The content of the command. The content depends on source type. */ + content: string; + /** Specifies whether to run the command as administrator. */ + runElevated?: boolean; + /** Specifies whether to restart the VM after the command executed. */ + restartAfter?: boolean; + /** Specifies the max run time of the command. */ + maxRunTime?: number; + /** Specifies whether to run the command in interactive mode. */ + runAsInteractive?: boolean; + /** Specifies whether to run the command even if a previous command is failed. */ + alwaysRun?: boolean; + /** Specifies whether to apply update before the command. */ + applyUpdateBefore?: boolean; +} + +/** Parameters supplied to update a Test Base Package. */ +export interface PackageUpdateParameters { + /** The tags of the Package. */ + tags?: { [propertyName: string]: string }; + /** Specifies the target OSs of specific OS Update types. */ + targetOSList?: TargetOSInfo[]; + /** The flighting ring for feature update. */ + flightingRing?: string; + /** Specifies whether the package is enabled. It doesn't schedule test for package which is not enabled. */ + isEnabled?: boolean; + /** The file name of the package. */ + blobPath?: string; + /** The detailed test information. */ + tests?: Test[]; +} + +/** The response of getting a download URL. */ +export interface DownloadURLResponse { + /** + * The download URL. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly downloadUrl?: string; + /** + * Expiry date of the download URL. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly expirationTime?: Date; +} + +/** The parameters supplied to the Test Base Package to start a Test Run. */ +export interface PackageRunTestParameters { + /** The type of the test. */ + testType: TestType; + /** Specifies the OS update type to test against. */ + osUpdateType?: OsUpdateType; + /** The operating system name. e.g. Windows 10 1809. */ + osName: string; + /** The name of the tested release (OS update). */ + releaseName?: string; + /** The flighting ring, only for release of feature updates. */ + flightingRing?: string; +} + +/** A list of Test Summaries. */ +export interface TestSummaryListResult { + /** The list of Test Summaries. */ + value?: TestSummaryResource[]; + /** + * Link to the next set of results. Not empty if value contains incomplete list of results. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly nextLink?: string; +} + +/** The summary of some tests. */ +export interface OSUpdatesTestSummary { + /** The status of the last test. */ + executionStatus?: ExecutionStatus; + /** The status of last test. */ + testStatus?: TestStatus; + /** The grade of last test. */ + grade?: Grade; + /** The run time of the last test. */ + testRunTime?: string; + /** Detailed summary for each OS update */ + osUpdateTestSummaries?: OSUpdateTestSummary[]; +} + +/** The summary of a test. */ +export interface OSUpdateTestSummary { + /** The operating system name. e.g. Windows 10 1809. */ + osName?: string; + /** The name of the tested release (OS update). */ + releaseName?: string; + /** The build version of the tested release (OS update) */ + buildVersion?: string; + /** The build revision of the tested release (OS update) */ + buildRevision?: string; + /** The release version date. */ + releaseVersionDate?: Date; + /** The flighting ring, only for release of feature updates. */ + flightingRing?: string; + /** The execution status of the test. */ + executionStatus?: ExecutionStatus; + /** The status of the test. */ + testStatus?: TestStatus; + /** The grade of the test. */ + grade?: Grade; + /** The run time of the test. */ + testRunTime?: string; + /** The test type of the package */ + testType?: string; +} + +/** A list of Test Results. */ +export interface TestResultListResult { + /** The list of Test Results. */ + value?: TestResultResource[]; + /** + * Link to the next set of results. Not empty if value contains incomplete list of results. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly nextLink?: string; +} + +/** The summary of a Test Analysis Result. */ +export interface TestResultAnalysisSummary { + /** Metric name */ + name?: string; + /** The analysis status. */ + analysisStatus?: AnalysisStatus; + /** The grade of the test result. */ + grade?: Grade; +} + +/** A list of OS Updates. */ +export interface OSUpdateListResult { + /** The list of OS Updates. */ + value?: OSUpdateResource[]; + /** + * Link to the next set of results. Not empty if value contains incomplete list of results. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly nextLink?: string; +} + +/** A list of favorite processes for a package. */ +export interface FavoriteProcessListResult { + /** The list of favorite processes for a package. */ + value?: FavoriteProcessResource[]; + /** + * Link to the next set of results. Not empty if value contains incomplete list of results. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly nextLink?: string; +} + +/** A list of Analysis Results. It will only contain one element as all the data will be nested in a singleton object. */ +export interface AnalysisResultListResult { + /** The list of Analysis Results. */ + value?: AnalysisResultSingletonResource[]; + /** + * Link to the next set of results. Not empty if value contains incomplete list of results. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly nextLink?: string; +} + +/** The properties of Analysis Result resource. */ +export interface AnalysisResultSingletonResourceProperties { + /** Polymorphic discriminator, which specifies the different types this object can be */ + analysisResultType: + | "ScriptExecution" + | "Reliability" + | "CPUUtilization" + | "MemoryUtilization" + | "CPURegression" + | "MemoryRegression" + | "TestAnalysis"; + /** The grade of the test. */ + grade?: Grade; +} + +/** Parameters body to pass for getting the download URL of the test execution console log file. */ +export interface TestResultConsoleLogDownloadURLParameters { + /** The log file name corresponding to the download URL. */ + logFileName: string; +} + +/** A list of email events. */ +export interface EmailEventListResult { + /** The list of email events. */ + value?: EmailEventResource[]; + /** + * Link to the next set of results. Not empty if value contains incomplete list of results. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly nextLink?: string; +} + +/** A list of Test Base Customer Events. */ +export interface CustomerEventListResult { + /** The list of Test Base Customer Events. */ + value?: CustomerEventResource[]; + /** + * Link to the next set of results. Not empty if value contains incomplete list of results. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly nextLink?: string; +} + +/** A notification event receivers. */ +export interface NotificationEventReceiver { + /** The type of the notification event receiver. */ + receiverType?: string; + /** The notification event receiver value. */ + receiverValue?: NotificationReceiverValue; +} + +/** A notification event receiver value. */ +export interface NotificationReceiverValue { + /** The user object receiver value. */ + userObjectReceiverValue?: UserObjectReceiverValue; + /** The user object receiver value. */ + subscriptionReceiverValue?: SubscriptionReceiverValue; + /** The user object receiver value. */ + distributionGroupListReceiverValue?: DistributionGroupListReceiverValue; +} + +/** The user object receiver value. */ +export interface UserObjectReceiverValue { + /** user object ids. */ + userObjectIds?: string[]; +} + +/** The subscription role receiver value. */ +export interface SubscriptionReceiverValue { + /** The subscription id of the notification receiver. */ + subscriptionId?: string; + /** The subscription name of the notification receiver. */ + subscriptionName?: string; + /** The role of the notification receiver. */ + role?: string; +} + +/** The user object receiver value. */ +export interface DistributionGroupListReceiverValue { + /** The list of distribution groups. */ + distributionGroups?: string[]; +} + +/** A list of operations supported by the resource provider. */ +export interface OperationListResult { + /** List of operations supported by the Test Base resource provider. */ + value?: Operation[]; + /** + * URL to get the next set of operation list results if there are any. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly nextLink?: string; +} + +/** REST API operation */ +export interface Operation { + /** + * Operation name: {provider}/{resource}/{operation}. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly name?: string; + /** + * Indicates whether the operation is a data action + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly isDataAction?: boolean; + /** + * Origin of the operation + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly origin?: string; + /** The object that describes the operation. */ + display?: OperationDisplay; + /** Extra properties of the operation. */ + properties?: Record; +} + +/** The object that describes the operation. */ +export interface OperationDisplay { + /** + * The resource provider name: Microsoft.TestBase. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly provider?: string; + /** + * Operation type: read, write, delete, listPackages, etc. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly operation?: string; + /** + * Resource type on which the operation is performed. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly resource?: string; + /** + * Friendly name of the operation. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly description?: string; +} + +export interface BillingHubGetFreeHourBalanceResponse { + totalRemainingFreeHours?: number; + incrementEntries?: BillingHubFreeHourIncrementEntry[]; +} + +export interface BillingHubFreeHourIncrementEntry { + createTimeStamp?: Date; + expirationTimeStamp?: Date; + incrementalFreeHours?: number; + remainingFreeHours?: number; +} + +export interface BillingHubGetUsageRequest { + startTimeStamp: Date; + endTimeStamp: Date; + pageSize?: number; + pageIndex?: number; +} + +export interface BillingHubGetUsageResponse { + totalUsedFreeHours?: number; + totalUsedBillableHours?: number; + totalCharges?: number; + packageUsageEntries?: BillingHubPackageUsage[]; + nextRequest?: BillingHubGetUsageRequest; +} + +export interface BillingHubPackageUsage { + applicationName?: string; + applicationVersion?: string; + azureResourceUri?: string; + totalUsedFreeHours?: number; + totalUsedBillableHours?: number; + totalCharges?: number; + usageEntriesGroupedByUpdateType?: BillingHubUsageGroupedByUpdateType[]; +} + +export interface BillingHubUsageGroupedByUpdateType { + updateType?: string; + totalUsedFreeHours?: number; + totalUsedBillableHours?: number; + totalCharges?: number; + usageGroups?: BillingHubUsageGroup[]; +} + +export interface BillingHubUsageGroup { + totalUsedFreeHours?: number; + totalUsedBillableHours?: number; + totalCharges?: number; + releaseBuildRevision?: number; + releaseBuildNumber?: number; + releaseBuildDate?: Date; + osBuild?: string; + release?: string; + testType?: string; + productFamily?: string; + executionUsageDetails?: BillingHubExecutionUsageDetail[]; +} + +export interface BillingHubExecutionUsageDetail { + applicationName?: string; + applicationVersion?: string; + executionRequestId?: string; + sku?: string; + meterId?: string; + startTimeStamp?: Date; + endTimeStamp?: Date; + osBuild?: string; + release?: string; + testType?: string; + updateType?: string; + usedFreeHours?: number; + usedBillableHours?: number; + billedCharges?: number; +} + +/** The Script Execution Result. */ +export interface ScriptExecutionResult { + /** Name of script. */ + scriptName?: string; + /** Start time of script execution. */ + startTime?: Date; + /** End time of script execution. */ + endTime?: Date; + /** Exit code. */ + exitCode?: number; + /** Whether the script execution is timed out. */ + timedOut?: boolean; + /** The stdout log file name. */ + stdoutLogFileName?: string; + /** The stderr log file name. */ + stderrLogFileName?: string; +} + +/** The Reliability Result. */ +export interface ReliabilityResult { + /** File name. */ + fileName?: string; + /** Count of number of launches. */ + launchCount?: number; + /** Count of number of crashes. */ + crashCount?: number; + /** Count of number of hangs. */ + hangCount?: number; + /** The regression grade. */ + regressionGrade?: Grade; + /** The statistic regression grade for crash signal. */ + crashRegressionGrade?: Grade; + /** Details related to the crash regression analysis. */ + crashRegressionTestDetails?: RegressionTestDetails; + /** The statistic regression grade for hang signal. */ + hangRegressionGrade?: Grade; + /** Details related to the hang regression analysis. */ + hangRegressionTestDetails?: RegressionTestDetails; +} + +/** The details of a regression test. */ +export interface RegressionTestDetails { + /** Difference between the two datasets being analyzed. */ + diff?: number; + /** Indicates if a regression was inferred. */ + isRegressed?: boolean; +} + +/** The Utilization Result. */ +export interface UtilizationResult { + /** Process name, or '_total' for all processes */ + process?: string; + /** Upper bound */ + upperBound?: UtilizationBound; + /** Lower bound */ + lowerBound?: UtilizationBound; + /** Utilization data */ + utilization?: UtilizationEntry[]; +} + +/** The bound of a utilization result. */ +export interface UtilizationBound { + /** The percentile of the bound. */ + percentile?: number; + /** The value of the bound. */ + value?: number; +} + +/** The utilization entry. */ +export interface UtilizationEntry { + /** The timestamp. */ + timestamp?: Date; + /** The value. */ + value?: number; +} + +/** The regression result. */ +export interface RegressionResult { + /** FileName of the binary being analyzed. */ + fileName?: string; + /** The grade of the test. */ + grade?: Grade; + /** Message that facilitates debugging a particular regression, if any was inferred. */ + details?: string; + /** Difference between the two datasets being analyzed. */ + diff?: number; + /** Indicates if a regression was inferred. */ + isRegressed?: boolean; +} + +/** The test analysis result. */ +export interface TestAnalysisResult { + /** The data to provide more failure analysis information. */ + blobData?: string; + /** The status of the analysis. */ + testAnalysisStatus?: TestAnalysisStatus; + /** The array of identified failures. */ + identifiedFailures?: IdentifiedFailure[]; +} + +/** The failure identified. */ +export interface IdentifiedFailure { + /** The Failure Id. */ + failureId?: string; + /** The category of the failure. */ + category?: Category; + /** Message that shows information about the failure. */ + errorMessage?: string; + /** Guidance that shows what the customer needs to do for this failure. */ + guidance?: string; +} + +export interface BillingHubUsage { + applicationName?: string; + applicationVersion?: string; + azureResourceUri?: string; + totalUsedFreeHours?: number; + totalUsedBillableHours?: number; + totalCharges?: number; + usageGroups?: BillingHubUsageGroup[]; +} + +/** The resource model definition for an ARM tracked top level resource */ +export type TrackedResource = Resource & { + /** The tags of the resource. */ + tags?: { [propertyName: string]: string }; + /** The geo-location where the resource lives */ + location: string; + /** + * Resource Etag. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly etag?: string; +}; + +/** The resource model definition for an ARM proxy resource. It will have everything other than required location and tags */ +export type ProxyResource = Resource & {}; + +/** The properties of Script Execution Result. */ +export type ScriptExecutionResultSingletonResourceProperties = AnalysisResultSingletonResourceProperties & { + /** Polymorphic discriminator, which specifies the different types this object can be */ + analysisResultType: "ScriptExecution"; + /** The result array data. */ + scriptExecutionResults?: ScriptExecutionResult[]; +}; + +/** The properties of Reliability Result. */ +export type ReliabilityResultSingletonResourceProperties = AnalysisResultSingletonResourceProperties & { + /** Polymorphic discriminator, which specifies the different types this object can be */ + analysisResultType: "Reliability"; + /** The result array data. */ + reliabilityResults?: ReliabilityResult[]; +}; + +/** The properties of CPU Utilization Result. */ +export type CPUUtilizationResultSingletonResourceProperties = AnalysisResultSingletonResourceProperties & { + /** Polymorphic discriminator, which specifies the different types this object can be */ + analysisResultType: "CPUUtilization"; + /** The result array data. */ + cpuUtilizationResults?: UtilizationResult[]; +}; + +/** The properties of Memory Utilization Result. */ +export type MemoryUtilizationResultSingletonResourceProperties = AnalysisResultSingletonResourceProperties & { + /** Polymorphic discriminator, which specifies the different types this object can be */ + analysisResultType: "MemoryUtilization"; + /** The result array data. */ + memoryUtilizationResults?: UtilizationResult[]; +}; + +/** The properties of CPU Regression Result. */ +export type CPURegressionResultSingletonResourceProperties = AnalysisResultSingletonResourceProperties & { + /** Polymorphic discriminator, which specifies the different types this object can be */ + analysisResultType: "CPURegression"; + /** The result array data. */ + cpuRegressionResults?: RegressionResult[]; +}; + +/** The properties of Memory Regression Result. */ +export type MemoryRegressionResultSingletonResourceProperties = AnalysisResultSingletonResourceProperties & { + /** Polymorphic discriminator, which specifies the different types this object can be */ + analysisResultType: "MemoryRegression"; + /** The result array data. */ + memoryRegressionResults?: RegressionResult[]; +}; + +/** The properties of Test Analysis Result. */ +export type TestAnalysisResultSingletonResourceProperties = AnalysisResultSingletonResourceProperties & { + /** Polymorphic discriminator, which specifies the different types this object can be */ + analysisResultType: "TestAnalysis"; + /** The result of test analysis. */ + testAnalysisResult?: TestAnalysisResult; +}; + +/** The Test Base Account resource. */ +export type TestBaseAccountResource = TrackedResource & { + /** + * The system metadata relating to this resource + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly systemData?: SystemData; + /** + * The provisioning state of the resource. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly provisioningState?: ProvisioningState; + /** The SKU of the Test Base Account. */ + sku?: TestBaseAccountSKU; + /** + * The access level of the Test Base Account. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly accessLevel?: string; +}; + +/** The Test Base Package resource. */ +export type PackageResource = TrackedResource & { + /** + * The system metadata relating to this resource + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly systemData?: SystemData; + /** + * The provisioning state of the resource. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly provisioningState?: ProvisioningState; + /** Application name */ + applicationName?: string; + /** Application version */ + version?: string; + /** + * OOB, functional or both. Mapped to the data in 'tests' property. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly testTypes?: TestType[]; + /** Specifies the target OSs of specific OS Update types. */ + targetOSList?: TargetOSInfo[]; + /** + * The status of the package. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly packageStatus?: PackageStatus; + /** + * The UTC timestamp when the package was last modified. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly lastModifiedTime?: Date; + /** The flighting ring for feature update. */ + flightingRing?: string; + /** + * Flag showing that whether the package is enabled. It doesn't schedule test for package which is not enabled. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly isEnabled?: boolean; + /** The file path of the package. */ + blobPath?: string; + /** + * The validation results. There's validation on package when it's created or updated. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly validationResults?: PackageValidationResult[]; + /** The detailed test information. */ + tests?: Test[]; +}; + +/** The Available OS resource. */ +export type AvailableOSResource = ProxyResource & { + /** + * The system metadata relating to this resource + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly systemData?: SystemData; + /** The Id of an Available OS of a Test Base Account. */ + osId?: string; + /** The name of an Available OS of a Test Base Account. */ + osName?: string; + /** The version of an Available OS of a Test Base Account. */ + osVersion?: string; + /** The insider channel of an Available OS of a Test Base Account. */ + insiderChannel?: string; + /** The OS update type of an Available OS of a Test Base Account. */ + osUpdateType?: string; + /** The Platform of an Available OS of a Test Base Account. */ + osPlatform?: string; +}; + +/** The flighting ring resource. */ +export type FlightingRingResource = ProxyResource & { + /** + * The system metadata relating to this resource + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly systemData?: SystemData; + /** The actual name of a flighting ring of a Test Base Account. */ + actualFlightingRingName?: string; +}; + +/** The test type resource. */ +export type TestTypeResource = ProxyResource & { + /** + * The system metadata relating to this resource + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly systemData?: SystemData; + /** The actual name of a test type of a Test Base Account. */ + actualTestTypeName?: string; +}; + +/** Summary of a Test. */ +export type TestSummaryResource = ProxyResource & { + /** + * The system metadata relating to this resource + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly systemData?: SystemData; + /** The Id of the current Test Summary. */ + testSummaryId?: string; + /** The Azure resource Id of package. */ + packageId?: string; + /** Application name. */ + applicationName?: string; + /** Application version. */ + applicationVersion?: string; + /** The execution status of last test. */ + executionStatus?: ExecutionStatus; + /** The status of last test. */ + testStatus?: TestStatus; + /** The grade of the test. */ + grade?: Grade; + /** The run time of the last test. */ + testRunTime?: string; + /** The result summary of tests triggered by feature updates */ + featureUpdatesTestSummary?: OSUpdatesTestSummary; + /** The result summary of tests triggered by security updates */ + securityUpdatesTestSummary?: OSUpdatesTestSummary; + /** The tags of Package resource that are associated with the testSummary */ + packageTags?: { [propertyName: string]: string }; +}; + +/** The Test Result Resource. */ +export type TestResultResource = ProxyResource & { + /** + * The system metadata relating to this resource + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly systemData?: SystemData; + /** Azure Id of the baseline test result. */ + baselineTestResultId?: string; + /** Resource Id of the package. */ + packageId?: string; + /** Application name. */ + applicationName?: string; + /** Application version. */ + applicationVersion?: string; + /** The operating system name, e.g. Windows 10 1809. */ + osName?: string; + /** The name of the tested release (OS update). */ + releaseName?: string; + /** The release version date of the tested release. */ + releaseVersionDate?: Date; + /** The flighting ring, only for release of feature updates. */ + flightingRing?: string; + /** The build version of the tested release (OS update). */ + buildVersion?: string; + /** The build revision of the tested release (OS update). */ + buildRevision?: string; + /** Test type. E.g. 'Out of box test' or 'Functional test'. */ + testType?: string; + /** The run time of the test. */ + testRunTime?: string; + /** Whether download data is available. */ + isDownloadDataAvailable?: boolean; + /** Whether video data is available. */ + isVideoAvailable?: boolean; + /** The execution status of the test. */ + executionStatus?: ExecutionStatus; + /** The status of the test. */ + testStatus?: TestStatus; + /** The grade of the test. */ + grade?: Grade; + /** KB number. */ + kbNumber?: string; + /** Interop media type. */ + interopMediaType?: string; + /** Interop media version. */ + interopMediaVersion?: string; + /** The version of the Windows update package. */ + packageVersion?: string; + /** List of analysis summaries. */ + analysisSummaries?: TestResultAnalysisSummary[]; +}; + +/** An OS Update. */ +export type OSUpdateResource = ProxyResource & { + /** + * The system metadata relating to this resource + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly systemData?: SystemData; + /** The name of the OS. */ + osName?: string; + /** The name of tested release. */ + release?: string; + /** The flighting ring, only for release of feature updates. */ + flightingRing?: string; + /** The build version of the tested release (OS update). */ + buildVersion?: string; + /** The build revision of the tested release (OS update) */ + buildRevision?: string; + /** The type of this release (OS update). */ + typePropertiesType?: Type; + /** The release version date the tested release (OS update) */ + releaseVersionDate?: Date; +}; + +/** A favorite process identifier. */ +export type FavoriteProcessResource = ProxyResource & { + /** + * The system metadata relating to this resource + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly systemData?: SystemData; + /** The actual name of the favorite process. It will be equal to resource name except for the scenario that the process name contains characters that are not allowed in the resource name. */ + actualProcessName?: string; +}; + +/** The Analysis Result Singleton Resource. */ +export type AnalysisResultSingletonResource = ProxyResource & { + /** + * The system metadata relating to this resource + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly systemData?: SystemData; + /** The grade of the test. */ + grade?: Grade; + /** Type of the Analysis Result. */ + analysisResultType?: AnalysisResultType; +}; + +/** The email event resource. */ +export type EmailEventResource = ProxyResource & { + /** + * The system metadata relating to this resource + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly systemData?: SystemData; + /** The identifier of the email event. */ + eventId?: string; + /** The name of the email event. */ + eventName?: string; + /** The display name of the email event. */ + displayName?: string; +}; + +/** The Customer Notification Event resource. */ +export type CustomerEventResource = ProxyResource & { + /** + * The system metadata relating to this resource + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly systemData?: SystemData; + /** The name of the event subscribed to. */ + eventName?: string; + /** The notification event receivers. */ + receivers?: NotificationEventReceiver[]; +}; + +/** Defines headers for TestBaseAccounts_create operation. */ +export interface TestBaseAccountsCreateHeaders { + /** URL to query for status of the operation. */ + azureAsyncOperation?: string; +} + +/** Defines headers for TestBaseAccounts_update operation. */ +export interface TestBaseAccountsUpdateHeaders { + /** URL to query for status of the operation. */ + azureAsyncOperation?: string; + /** URL to query for status of the operation. */ + location?: string; +} + +/** Defines headers for TestBaseAccounts_delete operation. */ +export interface TestBaseAccountsDeleteHeaders { + /** URL to query for status of the operation. */ + azureAsyncOperation?: string; + /** URL to query for status of the operation. */ + location?: string; +} + +/** Defines headers for TestBaseAccounts_offboard operation. */ +export interface TestBaseAccountsOffboardHeaders { + /** URL to query for status of the operation. */ + azureAsyncOperation?: string; + /** URL to query for status of the operation. */ + location?: string; +} + +/** Defines headers for Packages_create operation. */ +export interface PackagesCreateHeaders { + /** URL to query for status of the operation. */ + azureAsyncOperation?: string; +} + +/** Defines headers for Packages_update operation. */ +export interface PackagesUpdateHeaders { + /** URL to query for status of the operation. */ + azureAsyncOperation?: string; + /** URL to query for status of the operation. */ + location?: string; +} + +/** Defines headers for Packages_delete operation. */ +export interface PackagesDeleteHeaders { + /** URL to query for status of the operation. */ + azureAsyncOperation?: string; + /** URL to query for status of the operation. */ + location?: string; +} + +/** Defines headers for Packages_hardDelete operation. */ +export interface PackagesHardDeleteHeaders { + /** URL to query for status of the operation. */ + azureAsyncOperation?: string; + /** URL to query for status of the operation. */ + location?: string; +} + +/** Defines headers for Packages_runTest operation. */ +export interface PackagesRunTestHeaders { + /** URL to query for status of the operation. */ + azureAsyncOperation?: string; + /** URL to query for status of the operation. */ + location?: string; +} + +/** Defines headers for CustomerEvents_create operation. */ +export interface CustomerEventsCreateHeaders { + /** URL to query for status of the operation. */ + azureAsyncOperation?: string; +} + +/** Defines headers for CustomerEvents_delete operation. */ +export interface CustomerEventsDeleteHeaders { + /** URL to query for status of the operation. */ + azureAsyncOperation?: string; + /** URL to query for status of the operation. */ + location?: string; +} + +/** Known values of {@link Tier} that the service accepts. */ +export enum KnownTier { + Standard = "Standard" +} + +/** + * Defines values for Tier. \ + * {@link KnownTier} can be used interchangeably with Tier, + * this enum contains the known values that the service supports. + * ### Known values supported by the service + * **Standard** + */ +export type Tier = string; + +/** Known values of {@link CreatedByType} that the service accepts. */ +export enum KnownCreatedByType { + User = "User", + Application = "Application", + ManagedIdentity = "ManagedIdentity", + 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 ProvisioningState} that the service accepts. */ +export enum KnownProvisioningState { + Succeeded = "Succeeded", + Failed = "Failed", + Cancelled = "Cancelled", + Creating = "Creating", + Deleting = "Deleting", + Updating = "Updating" +} + +/** + * 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 + * **Succeeded** \ + * **Failed** \ + * **Cancelled** \ + * **Creating** \ + * **Deleting** \ + * **Updating** + */ +export type ProvisioningState = string; + +/** Known values of {@link OsUpdateType} that the service accepts. */ +export enum KnownOsUpdateType { + SecurityUpdate = "SecurityUpdate", + FeatureUpdate = "FeatureUpdate" +} + +/** + * Defines values for OsUpdateType. \ + * {@link KnownOsUpdateType} can be used interchangeably with OsUpdateType, + * this enum contains the known values that the service supports. + * ### Known values supported by the service + * **SecurityUpdate** \ + * **FeatureUpdate** + */ +export type OsUpdateType = string; + +/** Known values of {@link Reason} that the service accepts. */ +export enum KnownReason { + Invalid = "Invalid", + AlreadyExists = "AlreadyExists" +} + +/** + * Defines values for Reason. \ + * {@link KnownReason} can be used interchangeably with Reason, + * this enum contains the known values that the service supports. + * ### Known values supported by the service + * **Invalid** \ + * **AlreadyExists** + */ +export type Reason = string; + +/** Known values of {@link TestType} that the service accepts. */ +export enum KnownTestType { + OutOfBoxTest = "OutOfBoxTest", + FunctionalTest = "FunctionalTest" +} + +/** + * Defines values for TestType. \ + * {@link KnownTestType} can be used interchangeably with TestType, + * this enum contains the known values that the service supports. + * ### Known values supported by the service + * **OutOfBoxTest** \ + * **FunctionalTest** + */ +export type TestType = string; + +/** Known values of {@link PackageStatus} that the service accepts. */ +export enum KnownPackageStatus { + Unknown = "Unknown", + Registered = "Registered", + Ready = "Ready", + Error = "Error", + ValidatingPackage = "ValidatingPackage", + PreValidationCheckPass = "PreValidationCheckPass", + Deleted = "Deleted", + ValidationLongerThanUsual = "ValidationLongerThanUsual", + VerifyingPackage = "VerifyingPackage" +} + +/** + * Defines values for PackageStatus. \ + * {@link KnownPackageStatus} can be used interchangeably with PackageStatus, + * this enum contains the known values that the service supports. + * ### Known values supported by the service + * **Unknown** \ + * **Registered** \ + * **Ready** \ + * **Error** \ + * **ValidatingPackage** \ + * **PreValidationCheckPass** \ + * **Deleted** \ + * **ValidationLongerThanUsual** \ + * **VerifyingPackage** + */ +export type PackageStatus = string; + +/** Known values of {@link ValidationRunStatus} that the service accepts. */ +export enum KnownValidationRunStatus { + Unknown = "Unknown", + Pending = "Pending", + Passed = "Passed", + Failed = "Failed" +} + +/** + * Defines values for ValidationRunStatus. \ + * {@link KnownValidationRunStatus} can be used interchangeably with ValidationRunStatus, + * this enum contains the known values that the service supports. + * ### Known values supported by the service + * **Unknown** \ + * **Pending** \ + * **Passed** \ + * **Failed** + */ +export type ValidationRunStatus = string; + +/** Known values of {@link Action} that the service accepts. */ +export enum KnownAction { + Install = "Install", + Launch = "Launch", + Close = "Close", + Uninstall = "Uninstall", + Custom = "Custom" +} + +/** + * 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 + * **Install** \ + * **Launch** \ + * **Close** \ + * **Uninstall** \ + * **Custom** + */ +export type Action = string; + +/** Known values of {@link ContentType} that the service accepts. */ +export enum KnownContentType { + Inline = "Inline", + File = "File", + Path = "Path" +} + +/** + * Defines values for ContentType. \ + * {@link KnownContentType} can be used interchangeably with ContentType, + * this enum contains the known values that the service supports. + * ### Known values supported by the service + * **Inline** \ + * **File** \ + * **Path** + */ +export type ContentType = string; + +/** Known values of {@link ExecutionStatus} that the service accepts. */ +export enum KnownExecutionStatus { + None = "None", + InProgress = "InProgress", + Processing = "Processing", + Completed = "Completed", + NotExecuted = "NotExecuted", + Incomplete = "Incomplete", + Failed = "Failed", + Succeeded = "Succeeded" +} + +/** + * Defines values for ExecutionStatus. \ + * {@link KnownExecutionStatus} can be used interchangeably with ExecutionStatus, + * this enum contains the known values that the service supports. + * ### Known values supported by the service + * **None** \ + * **InProgress** \ + * **Processing** \ + * **Completed** \ + * **NotExecuted** \ + * **Incomplete** \ + * **Failed** \ + * **Succeeded** + */ +export type ExecutionStatus = string; + +/** Known values of {@link TestStatus} that the service accepts. */ +export enum KnownTestStatus { + None = "None", + TestExecutionInProgress = "TestExecutionInProgress", + DataProcessing = "DataProcessing", + TestFailure = "TestFailure", + UpdateFailure = "UpdateFailure", + TestAndUpdateFailure = "TestAndUpdateFailure", + InfrastructureFailure = "InfrastructureFailure", + Completed = "Completed" +} + +/** + * Defines values for TestStatus. \ + * {@link KnownTestStatus} can be used interchangeably with TestStatus, + * this enum contains the known values that the service supports. + * ### Known values supported by the service + * **None** \ + * **TestExecutionInProgress** \ + * **DataProcessing** \ + * **TestFailure** \ + * **UpdateFailure** \ + * **TestAndUpdateFailure** \ + * **InfrastructureFailure** \ + * **Completed** + */ +export type TestStatus = string; + +/** Known values of {@link Grade} that the service accepts. */ +export enum KnownGrade { + None = "None", + NotAvailable = "NotAvailable", + Pass = "Pass", + Fail = "Fail" +} + +/** + * Defines values for Grade. \ + * {@link KnownGrade} can be used interchangeably with Grade, + * this enum contains the known values that the service supports. + * ### Known values supported by the service + * **None** \ + * **NotAvailable** \ + * **Pass** \ + * **Fail** + */ +export type Grade = string; + +/** Known values of {@link AnalysisStatus} that the service accepts. */ +export enum KnownAnalysisStatus { + None = "None", + Completed = "Completed", + InProgress = "InProgress", + Failed = "Failed", + Succeeded = "Succeeded", + Available = "Available", + NotAvailable = "NotAvailable" +} + +/** + * Defines values for AnalysisStatus. \ + * {@link KnownAnalysisStatus} can be used interchangeably with AnalysisStatus, + * this enum contains the known values that the service supports. + * ### Known values supported by the service + * **None** \ + * **Completed** \ + * **InProgress** \ + * **Failed** \ + * **Succeeded** \ + * **Available** \ + * **NotAvailable** + */ +export type AnalysisStatus = string; + +/** Known values of {@link Type} that the service accepts. */ +export enum KnownType { + SecurityUpdate = "SecurityUpdate", + FeatureUpdate = "FeatureUpdate" +} + +/** + * Defines values for Type. \ + * {@link KnownType} can be used interchangeably with Type, + * this enum contains the known values that the service supports. + * ### Known values supported by the service + * **SecurityUpdate** \ + * **FeatureUpdate** + */ +export type Type = string; + +/** Known values of {@link AnalysisResultType} that the service accepts. */ +export enum KnownAnalysisResultType { + ScriptExecution = "ScriptExecution", + Reliability = "Reliability", + CPUUtilization = "CPUUtilization", + MemoryUtilization = "MemoryUtilization", + CPURegression = "CPURegression", + MemoryRegression = "MemoryRegression", + TestAnalysis = "TestAnalysis" +} + +/** + * Defines values for AnalysisResultType. \ + * {@link KnownAnalysisResultType} can be used interchangeably with AnalysisResultType, + * this enum contains the known values that the service supports. + * ### Known values supported by the service + * **ScriptExecution** \ + * **Reliability** \ + * **CPUUtilization** \ + * **MemoryUtilization** \ + * **CPURegression** \ + * **MemoryRegression** \ + * **TestAnalysis** + */ +export type AnalysisResultType = string; + +/** Known values of {@link AnalysisResultName} that the service accepts. */ +export enum KnownAnalysisResultName { + ScriptExecution = "scriptExecution", + Reliability = "reliability", + MemoryUtilization = "memoryUtilization", + CpuUtilization = "cpuUtilization", + MemoryRegression = "memoryRegression", + CpuRegression = "cpuRegression", + TestAnalysis = "testAnalysis" +} + +/** + * Defines values for AnalysisResultName. \ + * {@link KnownAnalysisResultName} can be used interchangeably with AnalysisResultName, + * this enum contains the known values that the service supports. + * ### Known values supported by the service + * **scriptExecution** \ + * **reliability** \ + * **memoryUtilization** \ + * **cpuUtilization** \ + * **memoryRegression** \ + * **cpuRegression** \ + * **testAnalysis** + */ +export type AnalysisResultName = string; + +/** Known values of {@link TestAnalysisStatus} that the service accepts. */ +export enum KnownTestAnalysisStatus { + None = "None", + Analyzing = "Analyzing", + Completed = "Completed", + Failed = "Failed" +} + +/** + * Defines values for TestAnalysisStatus. \ + * {@link KnownTestAnalysisStatus} can be used interchangeably with TestAnalysisStatus, + * this enum contains the known values that the service supports. + * ### Known values supported by the service + * **None** \ + * **Analyzing** \ + * **Completed** \ + * **Failed** + */ +export type TestAnalysisStatus = string; + +/** Known values of {@link Category} that the service accepts. */ +export enum KnownCategory { + None = "None", + Unidentified = "Unidentified", + Package = "Package", + OSUpdate = "OSUpdate", + Infrastructure = "Infrastructure" +} + +/** + * Defines values for Category. \ + * {@link KnownCategory} can be used interchangeably with Category, + * this enum contains the known values that the service supports. + * ### Known values supported by the service + * **None** \ + * **Unidentified** \ + * **Package** \ + * **OSUpdate** \ + * **Infrastructure** + */ +export type Category = string; + +/** Optional parameters. */ +export interface SkusListOptionalParams extends coreClient.OperationOptions {} + +/** Contains response data for the list operation. */ +export type SkusListResponse = TestBaseAccountSKUListResult; + +/** Optional parameters. */ +export interface SkusListNextOptionalParams + extends coreClient.OperationOptions {} + +/** Contains response data for the listNext operation. */ +export type SkusListNextResponse = TestBaseAccountSKUListResult; + +/** Optional parameters. */ +export interface TestBaseAccountsListBySubscriptionOptionalParams + extends coreClient.OperationOptions { + /** The flag indicating if we need to include the Test Base Accounts which were soft deleted before. */ + getDeleted?: boolean; +} + +/** Contains response data for the listBySubscription operation. */ +export type TestBaseAccountsListBySubscriptionResponse = TestBaseAccountListResult; + +/** Optional parameters. */ +export interface TestBaseAccountsListByResourceGroupOptionalParams + extends coreClient.OperationOptions { + /** The flag indicating if we need to include the Test Base Accounts which were soft deleted before. */ + getDeleted?: boolean; +} + +/** Contains response data for the listByResourceGroup operation. */ +export type TestBaseAccountsListByResourceGroupResponse = TestBaseAccountListResult; + +/** Optional parameters. */ +export interface TestBaseAccountsCreateOptionalParams + extends coreClient.OperationOptions { + /** The flag indicating if we would like to restore the Test Base Accounts which were soft deleted before. */ + restore?: boolean; + /** 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 create operation. */ +export type TestBaseAccountsCreateResponse = TestBaseAccountResource; + +/** Optional parameters. */ +export interface TestBaseAccountsUpdateOptionalParams + 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 update operation. */ +export type TestBaseAccountsUpdateResponse = TestBaseAccountResource; + +/** Optional parameters. */ +export interface TestBaseAccountsDeleteOptionalParams + 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 TestBaseAccountsGetOptionalParams + extends coreClient.OperationOptions {} + +/** Contains response data for the get operation. */ +export type TestBaseAccountsGetResponse = TestBaseAccountResource; + +/** Optional parameters. */ +export interface TestBaseAccountsOffboardOptionalParams + 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 TestBaseAccountsGetFileUploadUrlOptionalParams + extends coreClient.OperationOptions { + /** Parameters supplied to the Test Base Account GetFileUploadURL operation. */ + parameters?: GetFileUploadURLParameters; +} + +/** Contains response data for the getFileUploadUrl operation. */ +export type TestBaseAccountsGetFileUploadUrlResponse = FileUploadURLResponse; + +/** Optional parameters. */ +export interface TestBaseAccountsCheckPackageNameAvailabilityOptionalParams + extends coreClient.OperationOptions {} + +/** Contains response data for the checkPackageNameAvailability operation. */ +export type TestBaseAccountsCheckPackageNameAvailabilityResponse = CheckNameAvailabilityResult; + +/** Optional parameters. */ +export interface TestBaseAccountsListBySubscriptionNextOptionalParams + extends coreClient.OperationOptions { + /** The flag indicating if we need to include the Test Base Accounts which were soft deleted before. */ + getDeleted?: boolean; +} + +/** Contains response data for the listBySubscriptionNext operation. */ +export type TestBaseAccountsListBySubscriptionNextResponse = TestBaseAccountListResult; + +/** Optional parameters. */ +export interface TestBaseAccountsListByResourceGroupNextOptionalParams + extends coreClient.OperationOptions { + /** The flag indicating if we need to include the Test Base Accounts which were soft deleted before. */ + getDeleted?: boolean; +} + +/** Contains response data for the listByResourceGroupNext operation. */ +export type TestBaseAccountsListByResourceGroupNextResponse = TestBaseAccountListResult; + +/** Optional parameters. */ +export interface UsageListOptionalParams extends coreClient.OperationOptions { + /** Odata filter */ + filter?: string; +} + +/** Contains response data for the list operation. */ +export type UsageListResponse = TestBaseAccountUsageDataList; + +/** Optional parameters. */ +export interface UsageListNextOptionalParams + extends coreClient.OperationOptions { + /** Odata filter */ + filter?: string; +} + +/** Contains response data for the listNext operation. */ +export type UsageListNextResponse = TestBaseAccountUsageDataList; + +/** Optional parameters. */ +export interface AvailableOSListOptionalParams + extends coreClient.OperationOptions {} + +/** Contains response data for the list operation. */ +export type AvailableOSListResponse = AvailableOSListResult; + +/** Optional parameters. */ +export interface AvailableOSGetOptionalParams + extends coreClient.OperationOptions {} + +/** Contains response data for the get operation. */ +export type AvailableOSGetResponse = AvailableOSResource; + +/** Optional parameters. */ +export interface AvailableOSListNextOptionalParams + extends coreClient.OperationOptions {} + +/** Contains response data for the listNext operation. */ +export type AvailableOSListNextResponse = AvailableOSListResult; + +/** Optional parameters. */ +export interface FlightingRingsListOptionalParams + extends coreClient.OperationOptions {} + +/** Contains response data for the list operation. */ +export type FlightingRingsListResponse = FlightingRingListResult; + +/** Optional parameters. */ +export interface FlightingRingsGetOptionalParams + extends coreClient.OperationOptions {} + +/** Contains response data for the get operation. */ +export type FlightingRingsGetResponse = FlightingRingResource; + +/** Optional parameters. */ +export interface FlightingRingsListNextOptionalParams + extends coreClient.OperationOptions {} + +/** Contains response data for the listNext operation. */ +export type FlightingRingsListNextResponse = FlightingRingListResult; + +/** Optional parameters. */ +export interface TestTypesListOptionalParams + extends coreClient.OperationOptions {} + +/** Contains response data for the list operation. */ +export type TestTypesListResponse = TestTypeListResult; + +/** Optional parameters. */ +export interface TestTypesGetOptionalParams + extends coreClient.OperationOptions {} + +/** Contains response data for the get operation. */ +export type TestTypesGetResponse = TestTypeResource; + +/** Optional parameters. */ +export interface TestTypesListNextOptionalParams + extends coreClient.OperationOptions {} + +/** Contains response data for the listNext operation. */ +export type TestTypesListNextResponse = TestTypeListResult; + +/** Optional parameters. */ +export interface PackagesListByTestBaseAccountOptionalParams + extends coreClient.OperationOptions {} + +/** Contains response data for the listByTestBaseAccount operation. */ +export type PackagesListByTestBaseAccountResponse = PackageListResult; + +/** Optional parameters. */ +export interface PackagesCreateOptionalParams + 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 create operation. */ +export type PackagesCreateResponse = PackageResource; + +/** Optional parameters. */ +export interface PackagesUpdateOptionalParams + 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 update operation. */ +export type PackagesUpdateResponse = PackageResource; + +/** Optional parameters. */ +export interface PackagesDeleteOptionalParams + 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 PackagesGetOptionalParams + extends coreClient.OperationOptions {} + +/** Contains response data for the get operation. */ +export type PackagesGetResponse = PackageResource; + +/** Optional parameters. */ +export interface PackagesHardDeleteOptionalParams + 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 PackagesGetDownloadURLOptionalParams + extends coreClient.OperationOptions {} + +/** Contains response data for the getDownloadURL operation. */ +export type PackagesGetDownloadURLResponse = DownloadURLResponse; + +/** Optional parameters. */ +export interface PackagesRunTestOptionalParams + extends coreClient.OperationOptions { + /** The parameters supplied to the Test Base Package to start a Test Run. */ + parameters?: PackageRunTestParameters; +} + +/** Contains response data for the runTest operation. */ +export type PackagesRunTestResponse = PackagesRunTestHeaders; + +/** Optional parameters. */ +export interface PackagesListByTestBaseAccountNextOptionalParams + extends coreClient.OperationOptions {} + +/** Contains response data for the listByTestBaseAccountNext operation. */ +export type PackagesListByTestBaseAccountNextResponse = PackageListResult; + +/** Optional parameters. */ +export interface TestSummariesListOptionalParams + extends coreClient.OperationOptions {} + +/** Contains response data for the list operation. */ +export type TestSummariesListResponse = TestSummaryListResult; + +/** Optional parameters. */ +export interface TestSummariesGetOptionalParams + extends coreClient.OperationOptions {} + +/** Contains response data for the get operation. */ +export type TestSummariesGetResponse = TestSummaryResource; + +/** Optional parameters. */ +export interface TestSummariesListNextOptionalParams + extends coreClient.OperationOptions {} + +/** Contains response data for the listNext operation. */ +export type TestSummariesListNextResponse = TestSummaryListResult; + +/** Optional parameters. */ +export interface TestResultsListOptionalParams + extends coreClient.OperationOptions { + /** Odata filter */ + filter?: string; +} + +/** Contains response data for the list operation. */ +export type TestResultsListResponse = TestResultListResult; + +/** Optional parameters. */ +export interface TestResultsGetOptionalParams + extends coreClient.OperationOptions {} + +/** Contains response data for the get operation. */ +export type TestResultsGetResponse = TestResultResource; + +/** Optional parameters. */ +export interface TestResultsGetDownloadURLOptionalParams + extends coreClient.OperationOptions {} + +/** Contains response data for the getDownloadURL operation. */ +export type TestResultsGetDownloadURLResponse = DownloadURLResponse; + +/** Optional parameters. */ +export interface TestResultsGetVideoDownloadURLOptionalParams + extends coreClient.OperationOptions {} + +/** Contains response data for the getVideoDownloadURL operation. */ +export type TestResultsGetVideoDownloadURLResponse = DownloadURLResponse; + +/** Optional parameters. */ +export interface TestResultsGetConsoleLogDownloadURLOptionalParams + extends coreClient.OperationOptions {} + +/** Contains response data for the getConsoleLogDownloadURL operation. */ +export type TestResultsGetConsoleLogDownloadURLResponse = DownloadURLResponse; + +/** Optional parameters. */ +export interface TestResultsListNextOptionalParams + extends coreClient.OperationOptions { + /** Odata filter */ + filter?: string; +} + +/** Contains response data for the listNext operation. */ +export type TestResultsListNextResponse = TestResultListResult; + +/** Optional parameters. */ +export interface OSUpdatesListOptionalParams + extends coreClient.OperationOptions {} + +/** Contains response data for the list operation. */ +export type OSUpdatesListResponse = OSUpdateListResult; + +/** Optional parameters. */ +export interface OSUpdatesGetOptionalParams + extends coreClient.OperationOptions {} + +/** Contains response data for the get operation. */ +export type OSUpdatesGetResponse = OSUpdateResource; + +/** Optional parameters. */ +export interface OSUpdatesListNextOptionalParams + extends coreClient.OperationOptions {} + +/** Contains response data for the listNext operation. */ +export type OSUpdatesListNextResponse = OSUpdateListResult; + +/** Optional parameters. */ +export interface FavoriteProcessesListOptionalParams + extends coreClient.OperationOptions {} + +/** Contains response data for the list operation. */ +export type FavoriteProcessesListResponse = FavoriteProcessListResult; + +/** Optional parameters. */ +export interface FavoriteProcessesCreateOptionalParams + extends coreClient.OperationOptions {} + +/** Contains response data for the create operation. */ +export type FavoriteProcessesCreateResponse = FavoriteProcessResource; + +/** Optional parameters. */ +export interface FavoriteProcessesDeleteOptionalParams + extends coreClient.OperationOptions {} + +/** Optional parameters. */ +export interface FavoriteProcessesGetOptionalParams + extends coreClient.OperationOptions {} + +/** Contains response data for the get operation. */ +export type FavoriteProcessesGetResponse = FavoriteProcessResource; + +/** Optional parameters. */ +export interface FavoriteProcessesListNextOptionalParams + extends coreClient.OperationOptions {} + +/** Contains response data for the listNext operation. */ +export type FavoriteProcessesListNextResponse = FavoriteProcessListResult; + +/** Optional parameters. */ +export interface AnalysisResultsListOptionalParams + extends coreClient.OperationOptions {} + +/** Contains response data for the list operation. */ +export type AnalysisResultsListResponse = AnalysisResultListResult; + +/** Optional parameters. */ +export interface AnalysisResultsGetOptionalParams + extends coreClient.OperationOptions {} + +/** Contains response data for the get operation. */ +export type AnalysisResultsGetResponse = AnalysisResultSingletonResource; + +/** Optional parameters. */ +export interface EmailEventsListOptionalParams + extends coreClient.OperationOptions {} + +/** Contains response data for the list operation. */ +export type EmailEventsListResponse = EmailEventListResult; + +/** Optional parameters. */ +export interface EmailEventsGetOptionalParams + extends coreClient.OperationOptions {} + +/** Contains response data for the get operation. */ +export type EmailEventsGetResponse = EmailEventResource; + +/** Optional parameters. */ +export interface EmailEventsListNextOptionalParams + extends coreClient.OperationOptions {} + +/** Contains response data for the listNext operation. */ +export type EmailEventsListNextResponse = EmailEventListResult; + +/** Optional parameters. */ +export interface CustomerEventsListByTestBaseAccountOptionalParams + extends coreClient.OperationOptions {} + +/** Contains response data for the listByTestBaseAccount operation. */ +export type CustomerEventsListByTestBaseAccountResponse = CustomerEventListResult; + +/** Optional parameters. */ +export interface CustomerEventsCreateOptionalParams + 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 create operation. */ +export type CustomerEventsCreateResponse = CustomerEventResource; + +/** Optional parameters. */ +export interface CustomerEventsDeleteOptionalParams + 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 CustomerEventsGetOptionalParams + extends coreClient.OperationOptions {} + +/** Contains response data for the get operation. */ +export type CustomerEventsGetResponse = CustomerEventResource; + +/** Optional parameters. */ +export interface CustomerEventsListByTestBaseAccountNextOptionalParams + extends coreClient.OperationOptions {} + +/** Contains response data for the listByTestBaseAccountNext operation. */ +export type CustomerEventsListByTestBaseAccountNextResponse = CustomerEventListResult; + +/** Optional parameters. */ +export interface OperationsListOptionalParams + extends coreClient.OperationOptions {} + +/** Contains response data for the list operation. */ +export type OperationsListResponse = OperationListResult; + +/** Optional parameters. */ +export interface OperationsListNextOptionalParams + extends coreClient.OperationOptions {} + +/** Contains response data for the listNext operation. */ +export type OperationsListNextResponse = OperationListResult; + +/** Optional parameters. */ +export interface BillingHubServiceGetFreeHourBalanceOptionalParams + extends coreClient.OperationOptions {} + +/** Contains response data for the getFreeHourBalance operation. */ +export type BillingHubServiceGetFreeHourBalanceResponse = BillingHubGetFreeHourBalanceResponse; + +/** Optional parameters. */ +export interface BillingHubServiceGetUsageOptionalParams + extends coreClient.OperationOptions { + getUsageRequest?: BillingHubGetUsageRequest; +} + +/** Contains response data for the getUsage operation. */ +export type BillingHubServiceGetUsageResponse = BillingHubGetUsageResponse; + +/** Optional parameters. */ +export interface TestBaseOptionalParams + extends coreClient.ServiceClientOptions { + /** server parameter */ + $host?: string; + /** Api Version */ + apiVersion?: string; + /** Overrides client endpoint. */ + endpoint?: string; +} diff --git a/sdk/testbase/arm-testbase/src/models/mappers.ts b/sdk/testbase/arm-testbase/src/models/mappers.ts new file mode 100644 index 000000000000..0ef6e25e5ba3 --- /dev/null +++ b/sdk/testbase/arm-testbase/src/models/mappers.ts @@ -0,0 +1,3451 @@ +/* + * 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 TestBaseAccountSKUListResult: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "TestBaseAccountSKUListResult", + modelProperties: { + value: { + serializedName: "value", + type: { + name: "Sequence", + element: { + type: { + name: "Composite", + className: "TestBaseAccountSKU" + } + } + } + }, + nextLink: { + serializedName: "nextLink", + readOnly: true, + type: { + name: "String" + } + } + } + } +}; + +export const TestBaseAccountSKU: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "TestBaseAccountSKU", + modelProperties: { + resourceType: { + serializedName: "resourceType", + type: { + name: "String" + } + }, + name: { + serializedName: "name", + required: true, + type: { + name: "String" + } + }, + tier: { + serializedName: "tier", + required: true, + type: { + name: "String" + } + }, + capabilities: { + serializedName: "capabilities", + readOnly: true, + type: { + name: "Sequence", + element: { + type: { + name: "Composite", + className: "TestBaseAccountSKUCapability" + } + } + } + }, + locations: { + serializedName: "locations", + type: { + name: "Sequence", + element: { + type: { + name: "String" + } + } + } + } + } + } +}; + +export const TestBaseAccountSKUCapability: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "TestBaseAccountSKUCapability", + modelProperties: { + name: { + serializedName: "name", + required: true, + type: { + name: "String" + } + }, + value: { + serializedName: "value", + required: true, + type: { + name: "String" + } + } + } + } +}; + +export const ErrorResponse: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "ErrorResponse", + modelProperties: { + error: { + serializedName: "error", + type: { + name: "Composite", + className: "ErrorDefinition" + } + } + } + } +}; + +export const ErrorDefinition: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "ErrorDefinition", + 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: "ErrorDefinition" + } + } + } + } + } + } +}; + +export const TestBaseAccountListResult: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "TestBaseAccountListResult", + modelProperties: { + value: { + serializedName: "value", + type: { + name: "Sequence", + element: { + type: { + name: "Composite", + className: "TestBaseAccountResource" + } + } + } + }, + nextLink: { + serializedName: "nextLink", + readOnly: true, + 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 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" + } + } + } + } +}; + +export const TestBaseAccountUpdateParameters: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "TestBaseAccountUpdateParameters", + modelProperties: { + tags: { + serializedName: "tags", + type: { + name: "Dictionary", + value: { type: { name: "String" } } + } + }, + sku: { + serializedName: "properties.sku", + type: { + name: "Composite", + className: "TestBaseAccountSKU" + } + } + } + } +}; + +export const TestBaseAccountUsageDataList: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "TestBaseAccountUsageDataList", + modelProperties: { + value: { + serializedName: "value", + type: { + name: "Sequence", + element: { + type: { + name: "Composite", + className: "TestBaseAccountUsageData" + } + } + } + }, + nextLink: { + serializedName: "nextLink", + readOnly: true, + type: { + name: "String" + } + } + } + } +}; + +export const TestBaseAccountUsageData: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "TestBaseAccountUsageData", + modelProperties: { + id: { + serializedName: "id", + type: { + name: "String" + } + }, + name: { + serializedName: "name", + type: { + name: "Composite", + className: "TestBaseAccountUsageName" + } + }, + unit: { + serializedName: "unit", + type: { + name: "String" + } + }, + limit: { + serializedName: "limit", + type: { + name: "Number" + } + }, + currentValue: { + serializedName: "currentValue", + type: { + name: "Number" + } + } + } + } +}; + +export const TestBaseAccountUsageName: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "TestBaseAccountUsageName", + modelProperties: { + value: { + serializedName: "value", + type: { + name: "String" + } + }, + localizedValue: { + serializedName: "localizedValue", + type: { + name: "String" + } + } + } + } +}; + +export const GetFileUploadURLParameters: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "GetFileUploadURLParameters", + modelProperties: { + blobName: { + serializedName: "blobName", + type: { + name: "String" + } + } + } + } +}; + +export const FileUploadURLResponse: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "FileUploadURLResponse", + modelProperties: { + uploadUrl: { + serializedName: "uploadUrl", + readOnly: true, + type: { + name: "String" + } + }, + blobPath: { + serializedName: "blobPath", + readOnly: true, + type: { + name: "String" + } + } + } + } +}; + +export const AvailableOSListResult: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "AvailableOSListResult", + modelProperties: { + value: { + serializedName: "value", + type: { + name: "Sequence", + element: { + type: { + name: "Composite", + className: "AvailableOSResource" + } + } + } + }, + nextLink: { + serializedName: "nextLink", + readOnly: true, + type: { + name: "String" + } + } + } + } +}; + +export const FlightingRingListResult: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "FlightingRingListResult", + modelProperties: { + value: { + serializedName: "value", + type: { + name: "Sequence", + element: { + type: { + name: "Composite", + className: "FlightingRingResource" + } + } + } + }, + nextLink: { + serializedName: "nextLink", + readOnly: true, + type: { + name: "String" + } + } + } + } +}; + +export const TestTypeListResult: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "TestTypeListResult", + modelProperties: { + value: { + serializedName: "value", + type: { + name: "Sequence", + element: { + type: { + name: "Composite", + className: "TestTypeResource" + } + } + } + }, + nextLink: { + serializedName: "nextLink", + readOnly: true, + type: { + name: "String" + } + } + } + } +}; + +export const PackageCheckNameAvailabilityParameters: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "PackageCheckNameAvailabilityParameters", + modelProperties: { + name: { + serializedName: "name", + required: true, + type: { + name: "String" + } + }, + applicationName: { + serializedName: "applicationName", + required: true, + type: { + name: "String" + } + }, + version: { + serializedName: "version", + required: true, + type: { + name: "String" + } + }, + type: { + serializedName: "type", + type: { + name: "String" + } + } + } + } +}; + +export const CheckNameAvailabilityResult: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "CheckNameAvailabilityResult", + modelProperties: { + nameAvailable: { + serializedName: "nameAvailable", + type: { + name: "Boolean" + } + }, + reason: { + serializedName: "reason", + type: { + name: "String" + } + }, + message: { + serializedName: "message", + readOnly: true, + type: { + name: "String" + } + } + } + } +}; + +export const PackageListResult: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "PackageListResult", + modelProperties: { + value: { + serializedName: "value", + type: { + name: "Sequence", + element: { + type: { + name: "Composite", + className: "PackageResource" + } + } + } + }, + nextLink: { + serializedName: "nextLink", + readOnly: true, + type: { + name: "String" + } + } + } + } +}; + +export const TargetOSInfo: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "TargetOSInfo", + modelProperties: { + osUpdateType: { + serializedName: "osUpdateType", + required: true, + type: { + name: "String" + } + }, + targetOSs: { + serializedName: "targetOSs", + required: true, + type: { + name: "Sequence", + element: { + type: { + name: "String" + } + } + } + }, + baselineOSs: { + serializedName: "baselineOSs", + type: { + name: "Sequence", + element: { + type: { + name: "String" + } + } + } + } + } + } +}; + +export const PackageValidationResult: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "PackageValidationResult", + modelProperties: { + validationName: { + serializedName: "validationName", + readOnly: true, + type: { + name: "String" + } + }, + isValid: { + serializedName: "isValid", + readOnly: true, + type: { + name: "Boolean" + } + }, + errors: { + serializedName: "errors", + readOnly: true, + type: { + name: "Sequence", + element: { + type: { + name: "String" + } + } + } + } + } + } +}; + +export const Test: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "Test", + modelProperties: { + testType: { + serializedName: "testType", + required: true, + type: { + name: "String" + } + }, + validationRunStatus: { + serializedName: "validationRunStatus", + readOnly: true, + type: { + name: "String" + } + }, + validationResultId: { + serializedName: "validationResultId", + readOnly: true, + type: { + name: "String" + } + }, + isActive: { + serializedName: "isActive", + type: { + name: "Boolean" + } + }, + commands: { + serializedName: "commands", + required: true, + type: { + name: "Sequence", + element: { + type: { + name: "Composite", + className: "Command" + } + } + } + } + } + } +}; + +export const Command: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "Command", + modelProperties: { + name: { + serializedName: "name", + required: true, + type: { + name: "String" + } + }, + action: { + serializedName: "action", + required: true, + type: { + name: "String" + } + }, + contentType: { + serializedName: "contentType", + required: true, + type: { + name: "String" + } + }, + content: { + serializedName: "content", + required: true, + type: { + name: "String" + } + }, + runElevated: { + serializedName: "runElevated", + type: { + name: "Boolean" + } + }, + restartAfter: { + serializedName: "restartAfter", + type: { + name: "Boolean" + } + }, + maxRunTime: { + serializedName: "maxRunTime", + type: { + name: "Number" + } + }, + runAsInteractive: { + serializedName: "runAsInteractive", + type: { + name: "Boolean" + } + }, + alwaysRun: { + serializedName: "alwaysRun", + type: { + name: "Boolean" + } + }, + applyUpdateBefore: { + serializedName: "applyUpdateBefore", + type: { + name: "Boolean" + } + } + } + } +}; + +export const PackageUpdateParameters: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "PackageUpdateParameters", + modelProperties: { + tags: { + serializedName: "tags", + type: { + name: "Dictionary", + value: { type: { name: "String" } } + } + }, + targetOSList: { + serializedName: "properties.targetOSList", + type: { + name: "Sequence", + element: { + type: { + name: "Composite", + className: "TargetOSInfo" + } + } + } + }, + flightingRing: { + serializedName: "properties.flightingRing", + type: { + name: "String" + } + }, + isEnabled: { + serializedName: "properties.isEnabled", + type: { + name: "Boolean" + } + }, + blobPath: { + serializedName: "properties.blobPath", + type: { + name: "String" + } + }, + tests: { + serializedName: "properties.tests", + type: { + name: "Sequence", + element: { + type: { + name: "Composite", + className: "Test" + } + } + } + } + } + } +}; + +export const DownloadURLResponse: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "DownloadURLResponse", + modelProperties: { + downloadUrl: { + serializedName: "downloadUrl", + readOnly: true, + type: { + name: "String" + } + }, + expirationTime: { + serializedName: "expirationTime", + readOnly: true, + type: { + name: "DateTime" + } + } + } + } +}; + +export const PackageRunTestParameters: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "PackageRunTestParameters", + modelProperties: { + testType: { + serializedName: "testType", + required: true, + type: { + name: "String" + } + }, + osUpdateType: { + serializedName: "osUpdateType", + type: { + name: "String" + } + }, + osName: { + serializedName: "osName", + required: true, + type: { + name: "String" + } + }, + releaseName: { + serializedName: "releaseName", + type: { + name: "String" + } + }, + flightingRing: { + serializedName: "flightingRing", + type: { + name: "String" + } + } + } + } +}; + +export const TestSummaryListResult: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "TestSummaryListResult", + modelProperties: { + value: { + serializedName: "value", + type: { + name: "Sequence", + element: { + type: { + name: "Composite", + className: "TestSummaryResource" + } + } + } + }, + nextLink: { + serializedName: "nextLink", + readOnly: true, + type: { + name: "String" + } + } + } + } +}; + +export const OSUpdatesTestSummary: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "OSUpdatesTestSummary", + modelProperties: { + executionStatus: { + serializedName: "executionStatus", + type: { + name: "String" + } + }, + testStatus: { + serializedName: "testStatus", + type: { + name: "String" + } + }, + grade: { + serializedName: "grade", + type: { + name: "String" + } + }, + testRunTime: { + serializedName: "testRunTime", + type: { + name: "String" + } + }, + osUpdateTestSummaries: { + serializedName: "osUpdateTestSummaries", + type: { + name: "Sequence", + element: { + type: { + name: "Composite", + className: "OSUpdateTestSummary" + } + } + } + } + } + } +}; + +export const OSUpdateTestSummary: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "OSUpdateTestSummary", + modelProperties: { + osName: { + serializedName: "osName", + type: { + name: "String" + } + }, + releaseName: { + serializedName: "releaseName", + type: { + name: "String" + } + }, + buildVersion: { + serializedName: "buildVersion", + type: { + name: "String" + } + }, + buildRevision: { + serializedName: "buildRevision", + type: { + name: "String" + } + }, + releaseVersionDate: { + serializedName: "releaseVersionDate", + type: { + name: "DateTime" + } + }, + flightingRing: { + serializedName: "flightingRing", + type: { + name: "String" + } + }, + executionStatus: { + serializedName: "executionStatus", + type: { + name: "String" + } + }, + testStatus: { + serializedName: "testStatus", + type: { + name: "String" + } + }, + grade: { + serializedName: "grade", + type: { + name: "String" + } + }, + testRunTime: { + serializedName: "testRunTime", + type: { + name: "String" + } + }, + testType: { + serializedName: "testType", + type: { + name: "String" + } + } + } + } +}; + +export const TestResultListResult: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "TestResultListResult", + modelProperties: { + value: { + serializedName: "value", + type: { + name: "Sequence", + element: { + type: { + name: "Composite", + className: "TestResultResource" + } + } + } + }, + nextLink: { + serializedName: "nextLink", + readOnly: true, + type: { + name: "String" + } + } + } + } +}; + +export const TestResultAnalysisSummary: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "TestResultAnalysisSummary", + modelProperties: { + name: { + serializedName: "name", + type: { + name: "String" + } + }, + analysisStatus: { + serializedName: "analysisStatus", + type: { + name: "String" + } + }, + grade: { + serializedName: "grade", + type: { + name: "String" + } + } + } + } +}; + +export const OSUpdateListResult: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "OSUpdateListResult", + modelProperties: { + value: { + serializedName: "value", + type: { + name: "Sequence", + element: { + type: { + name: "Composite", + className: "OSUpdateResource" + } + } + } + }, + nextLink: { + serializedName: "nextLink", + readOnly: true, + type: { + name: "String" + } + } + } + } +}; + +export const FavoriteProcessListResult: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "FavoriteProcessListResult", + modelProperties: { + value: { + serializedName: "value", + type: { + name: "Sequence", + element: { + type: { + name: "Composite", + className: "FavoriteProcessResource" + } + } + } + }, + nextLink: { + serializedName: "nextLink", + readOnly: true, + type: { + name: "String" + } + } + } + } +}; + +export const AnalysisResultListResult: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "AnalysisResultListResult", + modelProperties: { + value: { + serializedName: "value", + type: { + name: "Sequence", + element: { + type: { + name: "Composite", + className: "AnalysisResultSingletonResource" + } + } + } + }, + nextLink: { + serializedName: "nextLink", + readOnly: true, + type: { + name: "String" + } + } + } + } +}; + +export const AnalysisResultSingletonResourceProperties: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "AnalysisResultSingletonResourceProperties", + uberParent: "AnalysisResultSingletonResourceProperties", + polymorphicDiscriminator: { + serializedName: "analysisResultType", + clientName: "analysisResultType" + }, + modelProperties: { + grade: { + serializedName: "grade", + type: { + name: "String" + } + }, + analysisResultType: { + serializedName: "analysisResultType", + required: true, + type: { + name: "String" + } + } + } + } +}; + +export const TestResultConsoleLogDownloadURLParameters: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "TestResultConsoleLogDownloadURLParameters", + modelProperties: { + logFileName: { + serializedName: "logFileName", + required: true, + type: { + name: "String" + } + } + } + } +}; + +export const EmailEventListResult: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "EmailEventListResult", + modelProperties: { + value: { + serializedName: "value", + type: { + name: "Sequence", + element: { + type: { + name: "Composite", + className: "EmailEventResource" + } + } + } + }, + nextLink: { + serializedName: "nextLink", + readOnly: true, + type: { + name: "String" + } + } + } + } +}; + +export const CustomerEventListResult: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "CustomerEventListResult", + modelProperties: { + value: { + serializedName: "value", + type: { + name: "Sequence", + element: { + type: { + name: "Composite", + className: "CustomerEventResource" + } + } + } + }, + nextLink: { + serializedName: "nextLink", + readOnly: true, + type: { + name: "String" + } + } + } + } +}; + +export const NotificationEventReceiver: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "NotificationEventReceiver", + modelProperties: { + receiverType: { + serializedName: "receiverType", + type: { + name: "String" + } + }, + receiverValue: { + serializedName: "receiverValue", + type: { + name: "Composite", + className: "NotificationReceiverValue" + } + } + } + } +}; + +export const NotificationReceiverValue: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "NotificationReceiverValue", + modelProperties: { + userObjectReceiverValue: { + serializedName: "userObjectReceiverValue", + type: { + name: "Composite", + className: "UserObjectReceiverValue" + } + }, + subscriptionReceiverValue: { + serializedName: "subscriptionReceiverValue", + type: { + name: "Composite", + className: "SubscriptionReceiverValue" + } + }, + distributionGroupListReceiverValue: { + serializedName: "distributionGroupListReceiverValue", + type: { + name: "Composite", + className: "DistributionGroupListReceiverValue" + } + } + } + } +}; + +export const UserObjectReceiverValue: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "UserObjectReceiverValue", + modelProperties: { + userObjectIds: { + serializedName: "userObjectIds", + type: { + name: "Sequence", + element: { + type: { + name: "String" + } + } + } + } + } + } +}; + +export const SubscriptionReceiverValue: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "SubscriptionReceiverValue", + modelProperties: { + subscriptionId: { + serializedName: "subscriptionId", + type: { + name: "String" + } + }, + subscriptionName: { + serializedName: "subscriptionName", + type: { + name: "String" + } + }, + role: { + serializedName: "role", + type: { + name: "String" + } + } + } + } +}; + +export const DistributionGroupListReceiverValue: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "DistributionGroupListReceiverValue", + modelProperties: { + distributionGroups: { + serializedName: "distributionGroups", + type: { + name: "Sequence", + element: { + type: { + name: "String" + } + } + } + } + } + } +}; + +export const OperationListResult: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "OperationListResult", + modelProperties: { + value: { + serializedName: "value", + type: { + name: "Sequence", + element: { + type: { + name: "Composite", + className: "Operation" + } + } + } + }, + nextLink: { + serializedName: "nextLink", + readOnly: true, + type: { + name: "String" + } + } + } + } +}; + +export const Operation: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "Operation", + modelProperties: { + name: { + serializedName: "name", + readOnly: true, + type: { + name: "String" + } + }, + isDataAction: { + serializedName: "isDataAction", + readOnly: true, + type: { + name: "Boolean" + } + }, + origin: { + serializedName: "origin", + readOnly: true, + type: { + name: "String" + } + }, + display: { + serializedName: "display", + type: { + name: "Composite", + className: "OperationDisplay" + } + }, + properties: { + serializedName: "properties", + type: { + name: "Dictionary", + value: { type: { name: "any" } } + } + } + } + } +}; + +export const OperationDisplay: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "OperationDisplay", + modelProperties: { + provider: { + serializedName: "provider", + readOnly: true, + type: { + name: "String" + } + }, + operation: { + serializedName: "operation", + readOnly: true, + type: { + name: "String" + } + }, + resource: { + serializedName: "resource", + readOnly: true, + type: { + name: "String" + } + }, + description: { + serializedName: "description", + readOnly: true, + type: { + name: "String" + } + } + } + } +}; + +export const BillingHubGetFreeHourBalanceResponse: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "BillingHubGetFreeHourBalanceResponse", + modelProperties: { + totalRemainingFreeHours: { + serializedName: "totalRemainingFreeHours", + type: { + name: "Number" + } + }, + incrementEntries: { + serializedName: "incrementEntries", + type: { + name: "Sequence", + element: { + type: { + name: "Composite", + className: "BillingHubFreeHourIncrementEntry" + } + } + } + } + } + } +}; + +export const BillingHubFreeHourIncrementEntry: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "BillingHubFreeHourIncrementEntry", + modelProperties: { + createTimeStamp: { + serializedName: "createTimeStamp", + type: { + name: "DateTime" + } + }, + expirationTimeStamp: { + serializedName: "expirationTimeStamp", + type: { + name: "DateTime" + } + }, + incrementalFreeHours: { + serializedName: "incrementalFreeHours", + type: { + name: "Number" + } + }, + remainingFreeHours: { + serializedName: "remainingFreeHours", + type: { + name: "Number" + } + } + } + } +}; + +export const BillingHubGetUsageRequest: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "BillingHubGetUsageRequest", + modelProperties: { + startTimeStamp: { + serializedName: "startTimeStamp", + required: true, + type: { + name: "DateTime" + } + }, + endTimeStamp: { + serializedName: "endTimeStamp", + required: true, + type: { + name: "DateTime" + } + }, + pageSize: { + serializedName: "pageSize", + type: { + name: "Number" + } + }, + pageIndex: { + serializedName: "pageIndex", + type: { + name: "Number" + } + } + } + } +}; + +export const BillingHubGetUsageResponse: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "BillingHubGetUsageResponse", + modelProperties: { + totalUsedFreeHours: { + serializedName: "totalUsedFreeHours", + type: { + name: "Number" + } + }, + totalUsedBillableHours: { + serializedName: "totalUsedBillableHours", + type: { + name: "Number" + } + }, + totalCharges: { + serializedName: "totalCharges", + type: { + name: "Number" + } + }, + packageUsageEntries: { + serializedName: "packageUsageEntries", + type: { + name: "Sequence", + element: { + type: { + name: "Composite", + className: "BillingHubPackageUsage" + } + } + } + }, + nextRequest: { + serializedName: "nextRequest", + type: { + name: "Composite", + className: "BillingHubGetUsageRequest" + } + } + } + } +}; + +export const BillingHubPackageUsage: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "BillingHubPackageUsage", + modelProperties: { + applicationName: { + serializedName: "applicationName", + type: { + name: "String" + } + }, + applicationVersion: { + serializedName: "applicationVersion", + type: { + name: "String" + } + }, + azureResourceUri: { + serializedName: "azureResourceUri", + type: { + name: "String" + } + }, + totalUsedFreeHours: { + serializedName: "totalUsedFreeHours", + type: { + name: "Number" + } + }, + totalUsedBillableHours: { + serializedName: "totalUsedBillableHours", + type: { + name: "Number" + } + }, + totalCharges: { + serializedName: "totalCharges", + type: { + name: "Number" + } + }, + usageEntriesGroupedByUpdateType: { + serializedName: "usageEntriesGroupedByUpdateType", + type: { + name: "Sequence", + element: { + type: { + name: "Composite", + className: "BillingHubUsageGroupedByUpdateType" + } + } + } + } + } + } +}; + +export const BillingHubUsageGroupedByUpdateType: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "BillingHubUsageGroupedByUpdateType", + modelProperties: { + updateType: { + serializedName: "updateType", + type: { + name: "String" + } + }, + totalUsedFreeHours: { + serializedName: "totalUsedFreeHours", + type: { + name: "Number" + } + }, + totalUsedBillableHours: { + serializedName: "totalUsedBillableHours", + type: { + name: "Number" + } + }, + totalCharges: { + serializedName: "totalCharges", + type: { + name: "Number" + } + }, + usageGroups: { + serializedName: "usageGroups", + type: { + name: "Sequence", + element: { + type: { + name: "Composite", + className: "BillingHubUsageGroup" + } + } + } + } + } + } +}; + +export const BillingHubUsageGroup: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "BillingHubUsageGroup", + modelProperties: { + totalUsedFreeHours: { + serializedName: "totalUsedFreeHours", + type: { + name: "Number" + } + }, + totalUsedBillableHours: { + serializedName: "totalUsedBillableHours", + type: { + name: "Number" + } + }, + totalCharges: { + serializedName: "totalCharges", + type: { + name: "Number" + } + }, + releaseBuildRevision: { + serializedName: "releaseBuildRevision", + type: { + name: "Number" + } + }, + releaseBuildNumber: { + serializedName: "releaseBuildNumber", + type: { + name: "Number" + } + }, + releaseBuildDate: { + serializedName: "releaseBuildDate", + type: { + name: "DateTime" + } + }, + osBuild: { + serializedName: "osBuild", + type: { + name: "String" + } + }, + release: { + serializedName: "release", + type: { + name: "String" + } + }, + testType: { + serializedName: "testType", + type: { + name: "String" + } + }, + productFamily: { + serializedName: "productFamily", + type: { + name: "String" + } + }, + executionUsageDetails: { + serializedName: "executionUsageDetails", + type: { + name: "Sequence", + element: { + type: { + name: "Composite", + className: "BillingHubExecutionUsageDetail" + } + } + } + } + } + } +}; + +export const BillingHubExecutionUsageDetail: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "BillingHubExecutionUsageDetail", + modelProperties: { + applicationName: { + serializedName: "applicationName", + type: { + name: "String" + } + }, + applicationVersion: { + serializedName: "applicationVersion", + type: { + name: "String" + } + }, + executionRequestId: { + serializedName: "executionRequestId", + type: { + name: "String" + } + }, + sku: { + serializedName: "sku", + type: { + name: "String" + } + }, + meterId: { + serializedName: "meterId", + type: { + name: "String" + } + }, + startTimeStamp: { + serializedName: "startTimeStamp", + type: { + name: "DateTime" + } + }, + endTimeStamp: { + serializedName: "endTimeStamp", + type: { + name: "DateTime" + } + }, + osBuild: { + serializedName: "osBuild", + type: { + name: "String" + } + }, + release: { + serializedName: "release", + type: { + name: "String" + } + }, + testType: { + serializedName: "testType", + type: { + name: "String" + } + }, + updateType: { + serializedName: "updateType", + type: { + name: "String" + } + }, + usedFreeHours: { + serializedName: "usedFreeHours", + type: { + name: "Number" + } + }, + usedBillableHours: { + serializedName: "usedBillableHours", + type: { + name: "Number" + } + }, + billedCharges: { + serializedName: "billedCharges", + type: { + name: "Number" + } + } + } + } +}; + +export const ScriptExecutionResult: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "ScriptExecutionResult", + modelProperties: { + scriptName: { + serializedName: "scriptName", + type: { + name: "String" + } + }, + startTime: { + serializedName: "startTime", + type: { + name: "DateTime" + } + }, + endTime: { + serializedName: "endTime", + type: { + name: "DateTime" + } + }, + exitCode: { + serializedName: "exitCode", + type: { + name: "Number" + } + }, + timedOut: { + serializedName: "timedOut", + type: { + name: "Boolean" + } + }, + stdoutLogFileName: { + serializedName: "stdoutLogFileName", + type: { + name: "String" + } + }, + stderrLogFileName: { + serializedName: "stderrLogFileName", + type: { + name: "String" + } + } + } + } +}; + +export const ReliabilityResult: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "ReliabilityResult", + modelProperties: { + fileName: { + serializedName: "fileName", + type: { + name: "String" + } + }, + launchCount: { + serializedName: "launchCount", + type: { + name: "Number" + } + }, + crashCount: { + serializedName: "crashCount", + type: { + name: "Number" + } + }, + hangCount: { + serializedName: "hangCount", + type: { + name: "Number" + } + }, + regressionGrade: { + serializedName: "regressionGrade", + type: { + name: "String" + } + }, + crashRegressionGrade: { + serializedName: "crashRegressionGrade", + type: { + name: "String" + } + }, + crashRegressionTestDetails: { + serializedName: "crashRegressionTestDetails", + type: { + name: "Composite", + className: "RegressionTestDetails" + } + }, + hangRegressionGrade: { + serializedName: "hangRegressionGrade", + type: { + name: "String" + } + }, + hangRegressionTestDetails: { + serializedName: "hangRegressionTestDetails", + type: { + name: "Composite", + className: "RegressionTestDetails" + } + } + } + } +}; + +export const RegressionTestDetails: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "RegressionTestDetails", + modelProperties: { + diff: { + serializedName: "diff", + type: { + name: "Number" + } + }, + isRegressed: { + serializedName: "isRegressed", + type: { + name: "Boolean" + } + } + } + } +}; + +export const UtilizationResult: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "UtilizationResult", + modelProperties: { + process: { + serializedName: "process", + type: { + name: "String" + } + }, + upperBound: { + serializedName: "upperBound", + type: { + name: "Composite", + className: "UtilizationBound" + } + }, + lowerBound: { + serializedName: "lowerBound", + type: { + name: "Composite", + className: "UtilizationBound" + } + }, + utilization: { + serializedName: "utilization", + type: { + name: "Sequence", + element: { + type: { + name: "Composite", + className: "UtilizationEntry" + } + } + } + } + } + } +}; + +export const UtilizationBound: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "UtilizationBound", + modelProperties: { + percentile: { + serializedName: "percentile", + type: { + name: "Number" + } + }, + value: { + serializedName: "value", + type: { + name: "Number" + } + } + } + } +}; + +export const UtilizationEntry: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "UtilizationEntry", + modelProperties: { + timestamp: { + serializedName: "timestamp", + type: { + name: "DateTime" + } + }, + value: { + serializedName: "value", + type: { + name: "Number" + } + } + } + } +}; + +export const RegressionResult: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "RegressionResult", + modelProperties: { + fileName: { + serializedName: "fileName", + type: { + name: "String" + } + }, + grade: { + serializedName: "grade", + type: { + name: "String" + } + }, + details: { + serializedName: "details", + type: { + name: "String" + } + }, + diff: { + serializedName: "diff", + type: { + name: "Number" + } + }, + isRegressed: { + serializedName: "isRegressed", + type: { + name: "Boolean" + } + } + } + } +}; + +export const TestAnalysisResult: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "TestAnalysisResult", + modelProperties: { + blobData: { + serializedName: "blobData", + type: { + name: "String" + } + }, + testAnalysisStatus: { + serializedName: "testAnalysisStatus", + type: { + name: "String" + } + }, + identifiedFailures: { + serializedName: "identifiedFailures", + type: { + name: "Sequence", + element: { + type: { + name: "Composite", + className: "IdentifiedFailure" + } + } + } + } + } + } +}; + +export const IdentifiedFailure: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "IdentifiedFailure", + modelProperties: { + failureId: { + serializedName: "failureId", + type: { + name: "String" + } + }, + category: { + serializedName: "category", + type: { + name: "String" + } + }, + errorMessage: { + serializedName: "errorMessage", + type: { + name: "String" + } + }, + guidance: { + serializedName: "guidance", + type: { + name: "String" + } + } + } + } +}; + +export const BillingHubUsage: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "BillingHubUsage", + modelProperties: { + applicationName: { + serializedName: "applicationName", + type: { + name: "String" + } + }, + applicationVersion: { + serializedName: "applicationVersion", + type: { + name: "String" + } + }, + azureResourceUri: { + serializedName: "azureResourceUri", + type: { + name: "String" + } + }, + totalUsedFreeHours: { + serializedName: "totalUsedFreeHours", + type: { + name: "Number" + } + }, + totalUsedBillableHours: { + serializedName: "totalUsedBillableHours", + type: { + name: "Number" + } + }, + totalCharges: { + serializedName: "totalCharges", + type: { + name: "Number" + } + }, + usageGroups: { + serializedName: "usageGroups", + type: { + name: "Sequence", + element: { + type: { + name: "Composite", + className: "BillingHubUsageGroup" + } + } + } + } + } + } +}; + +export const TrackedResource: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "TrackedResource", + modelProperties: { + ...Resource.type.modelProperties, + tags: { + serializedName: "tags", + type: { + name: "Dictionary", + value: { type: { name: "String" } } + } + }, + location: { + serializedName: "location", + required: true, + type: { + name: "String" + } + }, + etag: { + serializedName: "etag", + readOnly: true, + type: { + name: "String" + } + } + } + } +}; + +export const ProxyResource: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "ProxyResource", + modelProperties: { + ...Resource.type.modelProperties + } + } +}; + +export const ScriptExecutionResultSingletonResourceProperties: coreClient.CompositeMapper = { + serializedName: "ScriptExecution", + type: { + name: "Composite", + className: "ScriptExecutionResultSingletonResourceProperties", + uberParent: "AnalysisResultSingletonResourceProperties", + polymorphicDiscriminator: + AnalysisResultSingletonResourceProperties.type.polymorphicDiscriminator, + modelProperties: { + ...AnalysisResultSingletonResourceProperties.type.modelProperties, + scriptExecutionResults: { + serializedName: "scriptExecutionResults", + type: { + name: "Sequence", + element: { + type: { + name: "Composite", + className: "ScriptExecutionResult" + } + } + } + } + } + } +}; + +export const ReliabilityResultSingletonResourceProperties: coreClient.CompositeMapper = { + serializedName: "Reliability", + type: { + name: "Composite", + className: "ReliabilityResultSingletonResourceProperties", + uberParent: "AnalysisResultSingletonResourceProperties", + polymorphicDiscriminator: + AnalysisResultSingletonResourceProperties.type.polymorphicDiscriminator, + modelProperties: { + ...AnalysisResultSingletonResourceProperties.type.modelProperties, + reliabilityResults: { + serializedName: "reliabilityResults", + type: { + name: "Sequence", + element: { + type: { + name: "Composite", + className: "ReliabilityResult" + } + } + } + } + } + } +}; + +export const CPUUtilizationResultSingletonResourceProperties: coreClient.CompositeMapper = { + serializedName: "CPUUtilization", + type: { + name: "Composite", + className: "CPUUtilizationResultSingletonResourceProperties", + uberParent: "AnalysisResultSingletonResourceProperties", + polymorphicDiscriminator: + AnalysisResultSingletonResourceProperties.type.polymorphicDiscriminator, + modelProperties: { + ...AnalysisResultSingletonResourceProperties.type.modelProperties, + cpuUtilizationResults: { + serializedName: "cpuUtilizationResults", + type: { + name: "Sequence", + element: { + type: { + name: "Composite", + className: "UtilizationResult" + } + } + } + } + } + } +}; + +export const MemoryUtilizationResultSingletonResourceProperties: coreClient.CompositeMapper = { + serializedName: "MemoryUtilization", + type: { + name: "Composite", + className: "MemoryUtilizationResultSingletonResourceProperties", + uberParent: "AnalysisResultSingletonResourceProperties", + polymorphicDiscriminator: + AnalysisResultSingletonResourceProperties.type.polymorphicDiscriminator, + modelProperties: { + ...AnalysisResultSingletonResourceProperties.type.modelProperties, + memoryUtilizationResults: { + serializedName: "memoryUtilizationResults", + type: { + name: "Sequence", + element: { + type: { + name: "Composite", + className: "UtilizationResult" + } + } + } + } + } + } +}; + +export const CPURegressionResultSingletonResourceProperties: coreClient.CompositeMapper = { + serializedName: "CPURegression", + type: { + name: "Composite", + className: "CPURegressionResultSingletonResourceProperties", + uberParent: "AnalysisResultSingletonResourceProperties", + polymorphicDiscriminator: + AnalysisResultSingletonResourceProperties.type.polymorphicDiscriminator, + modelProperties: { + ...AnalysisResultSingletonResourceProperties.type.modelProperties, + cpuRegressionResults: { + serializedName: "cpuRegressionResults", + type: { + name: "Sequence", + element: { + type: { + name: "Composite", + className: "RegressionResult" + } + } + } + } + } + } +}; + +export const MemoryRegressionResultSingletonResourceProperties: coreClient.CompositeMapper = { + serializedName: "MemoryRegression", + type: { + name: "Composite", + className: "MemoryRegressionResultSingletonResourceProperties", + uberParent: "AnalysisResultSingletonResourceProperties", + polymorphicDiscriminator: + AnalysisResultSingletonResourceProperties.type.polymorphicDiscriminator, + modelProperties: { + ...AnalysisResultSingletonResourceProperties.type.modelProperties, + memoryRegressionResults: { + serializedName: "memoryRegressionResults", + type: { + name: "Sequence", + element: { + type: { + name: "Composite", + className: "RegressionResult" + } + } + } + } + } + } +}; + +export const TestAnalysisResultSingletonResourceProperties: coreClient.CompositeMapper = { + serializedName: "TestAnalysis", + type: { + name: "Composite", + className: "TestAnalysisResultSingletonResourceProperties", + uberParent: "AnalysisResultSingletonResourceProperties", + polymorphicDiscriminator: + AnalysisResultSingletonResourceProperties.type.polymorphicDiscriminator, + modelProperties: { + ...AnalysisResultSingletonResourceProperties.type.modelProperties, + testAnalysisResult: { + serializedName: "testAnalysisResult", + type: { + name: "Composite", + className: "TestAnalysisResult" + } + } + } + } +}; + +export const TestBaseAccountResource: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "TestBaseAccountResource", + modelProperties: { + ...TrackedResource.type.modelProperties, + systemData: { + serializedName: "systemData", + type: { + name: "Composite", + className: "SystemData" + } + }, + provisioningState: { + serializedName: "properties.provisioningState", + readOnly: true, + type: { + name: "String" + } + }, + sku: { + serializedName: "properties.sku", + type: { + name: "Composite", + className: "TestBaseAccountSKU" + } + }, + accessLevel: { + serializedName: "properties.accessLevel", + readOnly: true, + type: { + name: "String" + } + } + } + } +}; + +export const PackageResource: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "PackageResource", + modelProperties: { + ...TrackedResource.type.modelProperties, + systemData: { + serializedName: "systemData", + type: { + name: "Composite", + className: "SystemData" + } + }, + provisioningState: { + serializedName: "properties.provisioningState", + readOnly: true, + type: { + name: "String" + } + }, + applicationName: { + serializedName: "properties.applicationName", + type: { + name: "String" + } + }, + version: { + serializedName: "properties.version", + type: { + name: "String" + } + }, + testTypes: { + serializedName: "properties.testTypes", + readOnly: true, + type: { + name: "Sequence", + element: { + type: { + name: "String" + } + } + } + }, + targetOSList: { + serializedName: "properties.targetOSList", + type: { + name: "Sequence", + element: { + type: { + name: "Composite", + className: "TargetOSInfo" + } + } + } + }, + packageStatus: { + serializedName: "properties.packageStatus", + readOnly: true, + type: { + name: "String" + } + }, + lastModifiedTime: { + serializedName: "properties.lastModifiedTime", + readOnly: true, + type: { + name: "DateTime" + } + }, + flightingRing: { + serializedName: "properties.flightingRing", + type: { + name: "String" + } + }, + isEnabled: { + serializedName: "properties.isEnabled", + readOnly: true, + type: { + name: "Boolean" + } + }, + blobPath: { + serializedName: "properties.blobPath", + type: { + name: "String" + } + }, + validationResults: { + serializedName: "properties.validationResults", + readOnly: true, + type: { + name: "Sequence", + element: { + type: { + name: "Composite", + className: "PackageValidationResult" + } + } + } + }, + tests: { + serializedName: "properties.tests", + type: { + name: "Sequence", + element: { + type: { + name: "Composite", + className: "Test" + } + } + } + } + } + } +}; + +export const AvailableOSResource: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "AvailableOSResource", + modelProperties: { + ...ProxyResource.type.modelProperties, + systemData: { + serializedName: "systemData", + type: { + name: "Composite", + className: "SystemData" + } + }, + osId: { + serializedName: "properties.osId", + type: { + name: "String" + } + }, + osName: { + serializedName: "properties.osName", + type: { + name: "String" + } + }, + osVersion: { + serializedName: "properties.osVersion", + type: { + name: "String" + } + }, + insiderChannel: { + serializedName: "properties.insiderChannel", + type: { + name: "String" + } + }, + osUpdateType: { + serializedName: "properties.osUpdateType", + type: { + name: "String" + } + }, + osPlatform: { + serializedName: "properties.osPlatform", + type: { + name: "String" + } + } + } + } +}; + +export const FlightingRingResource: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "FlightingRingResource", + modelProperties: { + ...ProxyResource.type.modelProperties, + systemData: { + serializedName: "systemData", + type: { + name: "Composite", + className: "SystemData" + } + }, + actualFlightingRingName: { + serializedName: "properties.actualFlightingRingName", + type: { + name: "String" + } + } + } + } +}; + +export const TestTypeResource: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "TestTypeResource", + modelProperties: { + ...ProxyResource.type.modelProperties, + systemData: { + serializedName: "systemData", + type: { + name: "Composite", + className: "SystemData" + } + }, + actualTestTypeName: { + serializedName: "properties.actualTestTypeName", + type: { + name: "String" + } + } + } + } +}; + +export const TestSummaryResource: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "TestSummaryResource", + modelProperties: { + ...ProxyResource.type.modelProperties, + systemData: { + serializedName: "systemData", + type: { + name: "Composite", + className: "SystemData" + } + }, + testSummaryId: { + serializedName: "properties.testSummaryId", + type: { + name: "String" + } + }, + packageId: { + serializedName: "properties.packageId", + type: { + name: "String" + } + }, + applicationName: { + serializedName: "properties.applicationName", + type: { + name: "String" + } + }, + applicationVersion: { + serializedName: "properties.applicationVersion", + type: { + name: "String" + } + }, + executionStatus: { + serializedName: "properties.executionStatus", + type: { + name: "String" + } + }, + testStatus: { + serializedName: "properties.testStatus", + type: { + name: "String" + } + }, + grade: { + serializedName: "properties.grade", + type: { + name: "String" + } + }, + testRunTime: { + serializedName: "properties.testRunTime", + type: { + name: "String" + } + }, + featureUpdatesTestSummary: { + serializedName: "properties.featureUpdatesTestSummary", + type: { + name: "Composite", + className: "OSUpdatesTestSummary" + } + }, + securityUpdatesTestSummary: { + serializedName: "properties.securityUpdatesTestSummary", + type: { + name: "Composite", + className: "OSUpdatesTestSummary" + } + }, + packageTags: { + serializedName: "properties.packageTags", + type: { + name: "Dictionary", + value: { type: { name: "String" } } + } + } + } + } +}; + +export const TestResultResource: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "TestResultResource", + modelProperties: { + ...ProxyResource.type.modelProperties, + systemData: { + serializedName: "systemData", + type: { + name: "Composite", + className: "SystemData" + } + }, + baselineTestResultId: { + serializedName: "properties.baselineTestResultId", + type: { + name: "String" + } + }, + packageId: { + serializedName: "properties.packageId", + type: { + name: "String" + } + }, + applicationName: { + serializedName: "properties.applicationName", + type: { + name: "String" + } + }, + applicationVersion: { + serializedName: "properties.applicationVersion", + type: { + name: "String" + } + }, + osName: { + serializedName: "properties.osName", + type: { + name: "String" + } + }, + releaseName: { + serializedName: "properties.releaseName", + type: { + name: "String" + } + }, + releaseVersionDate: { + serializedName: "properties.releaseVersionDate", + type: { + name: "DateTime" + } + }, + flightingRing: { + serializedName: "properties.flightingRing", + type: { + name: "String" + } + }, + buildVersion: { + serializedName: "properties.buildVersion", + type: { + name: "String" + } + }, + buildRevision: { + serializedName: "properties.buildRevision", + type: { + name: "String" + } + }, + testType: { + serializedName: "properties.testType", + type: { + name: "String" + } + }, + testRunTime: { + serializedName: "properties.testRunTime", + type: { + name: "String" + } + }, + isDownloadDataAvailable: { + serializedName: "properties.isDownloadDataAvailable", + type: { + name: "Boolean" + } + }, + isVideoAvailable: { + serializedName: "properties.isVideoAvailable", + type: { + name: "Boolean" + } + }, + executionStatus: { + serializedName: "properties.executionStatus", + type: { + name: "String" + } + }, + testStatus: { + serializedName: "properties.testStatus", + type: { + name: "String" + } + }, + grade: { + serializedName: "properties.grade", + type: { + name: "String" + } + }, + kbNumber: { + serializedName: "properties.kbNumber", + type: { + name: "String" + } + }, + interopMediaType: { + serializedName: "properties.interopMediaType", + type: { + name: "String" + } + }, + interopMediaVersion: { + serializedName: "properties.interopMediaVersion", + type: { + name: "String" + } + }, + packageVersion: { + serializedName: "properties.packageVersion", + type: { + name: "String" + } + }, + analysisSummaries: { + serializedName: "properties.analysisSummaries", + type: { + name: "Sequence", + element: { + type: { + name: "Composite", + className: "TestResultAnalysisSummary" + } + } + } + } + } + } +}; + +export const OSUpdateResource: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "OSUpdateResource", + modelProperties: { + ...ProxyResource.type.modelProperties, + systemData: { + serializedName: "systemData", + type: { + name: "Composite", + className: "SystemData" + } + }, + osName: { + serializedName: "properties.osName", + type: { + name: "String" + } + }, + release: { + serializedName: "properties.release", + type: { + name: "String" + } + }, + flightingRing: { + serializedName: "properties.flightingRing", + type: { + name: "String" + } + }, + buildVersion: { + serializedName: "properties.buildVersion", + type: { + name: "String" + } + }, + buildRevision: { + serializedName: "properties.buildRevision", + type: { + name: "String" + } + }, + typePropertiesType: { + serializedName: "properties.type", + type: { + name: "String" + } + }, + releaseVersionDate: { + serializedName: "properties.releaseVersionDate", + type: { + name: "DateTime" + } + } + } + } +}; + +export const FavoriteProcessResource: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "FavoriteProcessResource", + modelProperties: { + ...ProxyResource.type.modelProperties, + systemData: { + serializedName: "systemData", + type: { + name: "Composite", + className: "SystemData" + } + }, + actualProcessName: { + serializedName: "properties.actualProcessName", + type: { + name: "String" + } + } + } + } +}; + +export const AnalysisResultSingletonResource: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "AnalysisResultSingletonResource", + modelProperties: { + ...ProxyResource.type.modelProperties, + systemData: { + serializedName: "systemData", + type: { + name: "Composite", + className: "SystemData" + } + }, + grade: { + serializedName: "properties.grade", + type: { + name: "String" + } + }, + analysisResultType: { + serializedName: "properties.analysisResultType", + type: { + name: "String" + } + } + } + } +}; + +export const EmailEventResource: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "EmailEventResource", + modelProperties: { + ...ProxyResource.type.modelProperties, + systemData: { + serializedName: "systemData", + type: { + name: "Composite", + className: "SystemData" + } + }, + eventId: { + serializedName: "properties.eventId", + type: { + name: "String" + } + }, + eventName: { + serializedName: "properties.eventName", + type: { + name: "String" + } + }, + displayName: { + serializedName: "properties.displayName", + type: { + name: "String" + } + } + } + } +}; + +export const CustomerEventResource: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "CustomerEventResource", + modelProperties: { + ...ProxyResource.type.modelProperties, + systemData: { + serializedName: "systemData", + type: { + name: "Composite", + className: "SystemData" + } + }, + eventName: { + serializedName: "properties.eventName", + type: { + name: "String" + } + }, + receivers: { + serializedName: "properties.receivers", + type: { + name: "Sequence", + element: { + type: { + name: "Composite", + className: "NotificationEventReceiver" + } + } + } + } + } + } +}; + +export const TestBaseAccountsCreateHeaders: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "TestBaseAccountsCreateHeaders", + modelProperties: { + azureAsyncOperation: { + serializedName: "azure-asyncoperation", + type: { + name: "String" + } + } + } + } +}; + +export const TestBaseAccountsUpdateHeaders: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "TestBaseAccountsUpdateHeaders", + modelProperties: { + azureAsyncOperation: { + serializedName: "azure-asyncoperation", + type: { + name: "String" + } + }, + location: { + serializedName: "location", + type: { + name: "String" + } + } + } + } +}; + +export const TestBaseAccountsDeleteHeaders: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "TestBaseAccountsDeleteHeaders", + modelProperties: { + azureAsyncOperation: { + serializedName: "azure-asyncoperation", + type: { + name: "String" + } + }, + location: { + serializedName: "location", + type: { + name: "String" + } + } + } + } +}; + +export const TestBaseAccountsOffboardHeaders: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "TestBaseAccountsOffboardHeaders", + modelProperties: { + azureAsyncOperation: { + serializedName: "azure-asyncoperation", + type: { + name: "String" + } + }, + location: { + serializedName: "location", + type: { + name: "String" + } + } + } + } +}; + +export const PackagesCreateHeaders: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "PackagesCreateHeaders", + modelProperties: { + azureAsyncOperation: { + serializedName: "azure-asyncoperation", + type: { + name: "String" + } + } + } + } +}; + +export const PackagesUpdateHeaders: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "PackagesUpdateHeaders", + modelProperties: { + azureAsyncOperation: { + serializedName: "azure-asyncoperation", + type: { + name: "String" + } + }, + location: { + serializedName: "location", + type: { + name: "String" + } + } + } + } +}; + +export const PackagesDeleteHeaders: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "PackagesDeleteHeaders", + modelProperties: { + azureAsyncOperation: { + serializedName: "azure-asyncoperation", + type: { + name: "String" + } + }, + location: { + serializedName: "location", + type: { + name: "String" + } + } + } + } +}; + +export const PackagesHardDeleteHeaders: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "PackagesHardDeleteHeaders", + modelProperties: { + azureAsyncOperation: { + serializedName: "azure-asyncoperation", + type: { + name: "String" + } + }, + location: { + serializedName: "location", + type: { + name: "String" + } + } + } + } +}; + +export const PackagesRunTestHeaders: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "PackagesRunTestHeaders", + modelProperties: { + azureAsyncOperation: { + serializedName: "azure-asyncoperation", + type: { + name: "String" + } + }, + location: { + serializedName: "location", + type: { + name: "String" + } + } + } + } +}; + +export const CustomerEventsCreateHeaders: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "CustomerEventsCreateHeaders", + modelProperties: { + azureAsyncOperation: { + serializedName: "azure-asyncoperation", + type: { + name: "String" + } + } + } + } +}; + +export const CustomerEventsDeleteHeaders: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "CustomerEventsDeleteHeaders", + modelProperties: { + azureAsyncOperation: { + serializedName: "azure-asyncoperation", + type: { + name: "String" + } + }, + location: { + serializedName: "location", + type: { + name: "String" + } + } + } + } +}; + +export let discriminators = { + AnalysisResultSingletonResourceProperties: AnalysisResultSingletonResourceProperties, + "AnalysisResultSingletonResourceProperties.ScriptExecution": ScriptExecutionResultSingletonResourceProperties, + "AnalysisResultSingletonResourceProperties.Reliability": ReliabilityResultSingletonResourceProperties, + "AnalysisResultSingletonResourceProperties.CPUUtilization": CPUUtilizationResultSingletonResourceProperties, + "AnalysisResultSingletonResourceProperties.MemoryUtilization": MemoryUtilizationResultSingletonResourceProperties, + "AnalysisResultSingletonResourceProperties.CPURegression": CPURegressionResultSingletonResourceProperties, + "AnalysisResultSingletonResourceProperties.MemoryRegression": MemoryRegressionResultSingletonResourceProperties, + "AnalysisResultSingletonResourceProperties.TestAnalysis": TestAnalysisResultSingletonResourceProperties +}; diff --git a/sdk/testbase/arm-testbase/src/models/parameters.ts b/sdk/testbase/arm-testbase/src/models/parameters.ts new file mode 100644 index 000000000000..2b896ba1d534 --- /dev/null +++ b/sdk/testbase/arm-testbase/src/models/parameters.ts @@ -0,0 +1,347 @@ +/* + * 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 { + TestBaseAccountResource as TestBaseAccountResourceMapper, + TestBaseAccountUpdateParameters as TestBaseAccountUpdateParametersMapper, + GetFileUploadURLParameters as GetFileUploadURLParametersMapper, + PackageCheckNameAvailabilityParameters as PackageCheckNameAvailabilityParametersMapper, + PackageResource as PackageResourceMapper, + PackageUpdateParameters as PackageUpdateParametersMapper, + PackageRunTestParameters as PackageRunTestParametersMapper, + TestResultConsoleLogDownloadURLParameters as TestResultConsoleLogDownloadURLParametersMapper, + FavoriteProcessResource as FavoriteProcessResourceMapper, + CustomerEventResource as CustomerEventResourceMapper, + BillingHubGetUsageRequest as BillingHubGetUsageRequestMapper +} 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 subscriptionId: OperationURLParameter = { + parameterPath: "subscriptionId", + mapper: { + serializedName: "subscriptionId", + required: true, + type: { + name: "String" + } + } +}; + +export const apiVersion: OperationQueryParameter = { + parameterPath: "apiVersion", + mapper: { + defaultValue: "2022-04-01-preview", + isConstant: true, + serializedName: "api-version", + type: { + name: "String" + } + } +}; + +export const nextLink: OperationURLParameter = { + parameterPath: "nextLink", + mapper: { + serializedName: "nextLink", + required: true, + type: { + name: "String" + } + }, + skipEncoding: true +}; + +export const getDeleted: OperationQueryParameter = { + parameterPath: ["options", "getDeleted"], + mapper: { + serializedName: "getDeleted", + type: { + name: "Boolean" + } + } +}; + +export const resourceGroupName: OperationURLParameter = { + parameterPath: "resourceGroupName", + mapper: { + serializedName: "resourceGroupName", + 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 parameters: OperationParameter = { + parameterPath: "parameters", + mapper: TestBaseAccountResourceMapper +}; + +export const testBaseAccountName: OperationURLParameter = { + parameterPath: "testBaseAccountName", + mapper: { + serializedName: "testBaseAccountName", + required: true, + type: { + name: "String" + } + } +}; + +export const restore: OperationQueryParameter = { + parameterPath: ["options", "restore"], + mapper: { + serializedName: "restore", + type: { + name: "Boolean" + } + } +}; + +export const parameters1: OperationParameter = { + parameterPath: "parameters", + mapper: TestBaseAccountUpdateParametersMapper +}; + +export const parameters2: OperationParameter = { + parameterPath: ["options", "parameters"], + mapper: GetFileUploadURLParametersMapper +}; + +export const parameters3: OperationParameter = { + parameterPath: "parameters", + mapper: PackageCheckNameAvailabilityParametersMapper +}; + +export const filter: OperationQueryParameter = { + parameterPath: ["options", "filter"], + mapper: { + serializedName: "$filter", + type: { + name: "String" + } + } +}; + +export const osUpdateType: OperationQueryParameter = { + parameterPath: "osUpdateType", + mapper: { + serializedName: "osUpdateType", + required: true, + type: { + name: "String" + } + } +}; + +export const availableOSResourceName: OperationURLParameter = { + parameterPath: "availableOSResourceName", + mapper: { + serializedName: "availableOSResourceName", + required: true, + type: { + name: "String" + } + } +}; + +export const flightingRingResourceName: OperationURLParameter = { + parameterPath: "flightingRingResourceName", + mapper: { + serializedName: "flightingRingResourceName", + required: true, + type: { + name: "String" + } + } +}; + +export const testTypeResourceName: OperationURLParameter = { + parameterPath: "testTypeResourceName", + mapper: { + serializedName: "testTypeResourceName", + required: true, + type: { + name: "String" + } + } +}; + +export const parameters4: OperationParameter = { + parameterPath: "parameters", + mapper: PackageResourceMapper +}; + +export const packageName: OperationURLParameter = { + parameterPath: "packageName", + mapper: { + serializedName: "packageName", + required: true, + type: { + name: "String" + } + } +}; + +export const parameters5: OperationParameter = { + parameterPath: "parameters", + mapper: PackageUpdateParametersMapper +}; + +export const parameters6: OperationParameter = { + parameterPath: ["options", "parameters"], + mapper: PackageRunTestParametersMapper +}; + +export const testSummaryName: OperationURLParameter = { + parameterPath: "testSummaryName", + mapper: { + serializedName: "testSummaryName", + required: true, + type: { + name: "String" + } + } +}; + +export const testResultName: OperationURLParameter = { + parameterPath: "testResultName", + mapper: { + serializedName: "testResultName", + required: true, + type: { + name: "String" + } + } +}; + +export const parameters7: OperationParameter = { + parameterPath: "parameters", + mapper: TestResultConsoleLogDownloadURLParametersMapper +}; + +export const osUpdateResourceName: OperationURLParameter = { + parameterPath: "osUpdateResourceName", + mapper: { + serializedName: "osUpdateResourceName", + required: true, + type: { + name: "String" + } + } +}; + +export const parameters8: OperationParameter = { + parameterPath: "parameters", + mapper: FavoriteProcessResourceMapper +}; + +export const favoriteProcessResourceName: OperationURLParameter = { + parameterPath: "favoriteProcessResourceName", + mapper: { + serializedName: "favoriteProcessResourceName", + required: true, + type: { + name: "String" + } + } +}; + +export const analysisResultType: OperationQueryParameter = { + parameterPath: "analysisResultType", + mapper: { + serializedName: "analysisResultType", + required: true, + type: { + name: "String" + } + } +}; + +export const analysisResultName: OperationURLParameter = { + parameterPath: "analysisResultName", + mapper: { + serializedName: "analysisResultName", + required: true, + type: { + name: "String" + } + } +}; + +export const emailEventResourceName: OperationURLParameter = { + parameterPath: "emailEventResourceName", + mapper: { + serializedName: "emailEventResourceName", + required: true, + type: { + name: "String" + } + } +}; + +export const parameters9: OperationParameter = { + parameterPath: "parameters", + mapper: CustomerEventResourceMapper +}; + +export const customerEventName: OperationURLParameter = { + parameterPath: "customerEventName", + mapper: { + serializedName: "customerEventName", + required: true, + type: { + name: "String" + } + } +}; + +export const getUsageRequest: OperationParameter = { + parameterPath: ["options", "getUsageRequest"], + mapper: BillingHubGetUsageRequestMapper +}; diff --git a/sdk/testbase/arm-testbase/src/operations/analysisResults.ts b/sdk/testbase/arm-testbase/src/operations/analysisResults.ts new file mode 100644 index 000000000000..40527aa254b4 --- /dev/null +++ b/sdk/testbase/arm-testbase/src/operations/analysisResults.ts @@ -0,0 +1,235 @@ +/* + * 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 { AnalysisResults } from "../operationsInterfaces"; +import * as coreClient from "@azure/core-client"; +import * as Mappers from "../models/mappers"; +import * as Parameters from "../models/parameters"; +import { TestBase } from "../testBase"; +import { + AnalysisResultSingletonResource, + AnalysisResultType, + AnalysisResultsListOptionalParams, + AnalysisResultsListResponse, + AnalysisResultName, + AnalysisResultsGetOptionalParams, + AnalysisResultsGetResponse +} from "../models"; + +/// +/** Class containing AnalysisResults operations. */ +export class AnalysisResultsImpl implements AnalysisResults { + private readonly client: TestBase; + + /** + * Initialize a new instance of the class AnalysisResults class. + * @param client Reference to the service client + */ + constructor(client: TestBase) { + this.client = client; + } + + /** + * Lists the Analysis Results of a Test Result. The result collection will only contain one element as + * all the data will be nested in a singleton object. + * @param resourceGroupName The name of the resource group that contains the resource. + * @param testBaseAccountName The resource name of the Test Base Account. + * @param packageName The resource name of the Test Base Package. + * @param testResultName The Test Result Name. It equals to TestResult-{TestResultId} string. + * @param analysisResultType The type of the Analysis Result of a Test Result. + * @param options The options parameters. + */ + public list( + resourceGroupName: string, + testBaseAccountName: string, + packageName: string, + testResultName: string, + analysisResultType: AnalysisResultType, + options?: AnalysisResultsListOptionalParams + ): PagedAsyncIterableIterator { + const iter = this.listPagingAll( + resourceGroupName, + testBaseAccountName, + packageName, + testResultName, + analysisResultType, + options + ); + return { + next() { + return iter.next(); + }, + [Symbol.asyncIterator]() { + return this; + }, + byPage: () => { + return this.listPagingPage( + resourceGroupName, + testBaseAccountName, + packageName, + testResultName, + analysisResultType, + options + ); + } + }; + } + + private async *listPagingPage( + resourceGroupName: string, + testBaseAccountName: string, + packageName: string, + testResultName: string, + analysisResultType: AnalysisResultType, + options?: AnalysisResultsListOptionalParams + ): AsyncIterableIterator { + let result = await this._list( + resourceGroupName, + testBaseAccountName, + packageName, + testResultName, + analysisResultType, + options + ); + yield result.value || []; + } + + private async *listPagingAll( + resourceGroupName: string, + testBaseAccountName: string, + packageName: string, + testResultName: string, + analysisResultType: AnalysisResultType, + options?: AnalysisResultsListOptionalParams + ): AsyncIterableIterator { + for await (const page of this.listPagingPage( + resourceGroupName, + testBaseAccountName, + packageName, + testResultName, + analysisResultType, + options + )) { + yield* page; + } + } + + /** + * Lists the Analysis Results of a Test Result. The result collection will only contain one element as + * all the data will be nested in a singleton object. + * @param resourceGroupName The name of the resource group that contains the resource. + * @param testBaseAccountName The resource name of the Test Base Account. + * @param packageName The resource name of the Test Base Package. + * @param testResultName The Test Result Name. It equals to TestResult-{TestResultId} string. + * @param analysisResultType The type of the Analysis Result of a Test Result. + * @param options The options parameters. + */ + private _list( + resourceGroupName: string, + testBaseAccountName: string, + packageName: string, + testResultName: string, + analysisResultType: AnalysisResultType, + options?: AnalysisResultsListOptionalParams + ): Promise { + return this.client.sendOperationRequest( + { + resourceGroupName, + testBaseAccountName, + packageName, + testResultName, + analysisResultType, + options + }, + listOperationSpec + ); + } + + /** + * Gets an Analysis Result of a Test Result by name. + * @param resourceGroupName The name of the resource group that contains the resource. + * @param testBaseAccountName The resource name of the Test Base Account. + * @param packageName The resource name of the Test Base Package. + * @param testResultName The Test Result Name. It equals to TestResult-{TestResultId} string. + * @param analysisResultName The name of the Analysis Result of a Test Result. + * @param options The options parameters. + */ + get( + resourceGroupName: string, + testBaseAccountName: string, + packageName: string, + testResultName: string, + analysisResultName: AnalysisResultName, + options?: AnalysisResultsGetOptionalParams + ): Promise { + return this.client.sendOperationRequest( + { + resourceGroupName, + testBaseAccountName, + packageName, + testResultName, + analysisResultName, + options + }, + getOperationSpec + ); + } +} +// Operation Specifications +const serializer = coreClient.createSerializer(Mappers, /* isXml */ false); + +const listOperationSpec: coreClient.OperationSpec = { + path: + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.TestBase/testBaseAccounts/{testBaseAccountName}/packages/{packageName}/testResults/{testResultName}/analysisResults", + httpMethod: "GET", + responses: { + 200: { + bodyMapper: Mappers.AnalysisResultListResult + }, + default: { + bodyMapper: Mappers.ErrorResponse + } + }, + queryParameters: [Parameters.apiVersion, Parameters.analysisResultType], + urlParameters: [ + Parameters.$host, + Parameters.subscriptionId, + Parameters.resourceGroupName, + Parameters.testBaseAccountName, + Parameters.packageName, + Parameters.testResultName + ], + headerParameters: [Parameters.accept], + serializer +}; +const getOperationSpec: coreClient.OperationSpec = { + path: + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.TestBase/testBaseAccounts/{testBaseAccountName}/packages/{packageName}/testResults/{testResultName}/analysisResults/{analysisResultName}", + httpMethod: "GET", + responses: { + 200: { + bodyMapper: Mappers.AnalysisResultSingletonResource + }, + default: { + bodyMapper: Mappers.ErrorResponse + } + }, + queryParameters: [Parameters.apiVersion], + urlParameters: [ + Parameters.$host, + Parameters.subscriptionId, + Parameters.resourceGroupName, + Parameters.testBaseAccountName, + Parameters.packageName, + Parameters.testResultName, + Parameters.analysisResultName + ], + headerParameters: [Parameters.accept], + serializer +}; diff --git a/sdk/testbase/arm-testbase/src/operations/availableOS.ts b/sdk/testbase/arm-testbase/src/operations/availableOS.ts new file mode 100644 index 000000000000..b828319a6253 --- /dev/null +++ b/sdk/testbase/arm-testbase/src/operations/availableOS.ts @@ -0,0 +1,258 @@ +/* + * 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 { AvailableOS } from "../operationsInterfaces"; +import * as coreClient from "@azure/core-client"; +import * as Mappers from "../models/mappers"; +import * as Parameters from "../models/parameters"; +import { TestBase } from "../testBase"; +import { + AvailableOSResource, + OsUpdateType, + AvailableOSListNextOptionalParams, + AvailableOSListOptionalParams, + AvailableOSListResponse, + AvailableOSGetOptionalParams, + AvailableOSGetResponse, + AvailableOSListNextResponse +} from "../models"; + +/// +/** Class containing AvailableOS operations. */ +export class AvailableOSImpl implements AvailableOS { + private readonly client: TestBase; + + /** + * Initialize a new instance of the class AvailableOS class. + * @param client Reference to the service client + */ + constructor(client: TestBase) { + this.client = client; + } + + /** + * Lists all the available OSs to run a package under a Test Base Account. + * @param resourceGroupName The name of the resource group that contains the resource. + * @param testBaseAccountName The resource name of the Test Base Account. + * @param osUpdateType The type of the OS Update. + * @param options The options parameters. + */ + public list( + resourceGroupName: string, + testBaseAccountName: string, + osUpdateType: OsUpdateType, + options?: AvailableOSListOptionalParams + ): PagedAsyncIterableIterator { + const iter = this.listPagingAll( + resourceGroupName, + testBaseAccountName, + osUpdateType, + options + ); + return { + next() { + return iter.next(); + }, + [Symbol.asyncIterator]() { + return this; + }, + byPage: () => { + return this.listPagingPage( + resourceGroupName, + testBaseAccountName, + osUpdateType, + options + ); + } + }; + } + + private async *listPagingPage( + resourceGroupName: string, + testBaseAccountName: string, + osUpdateType: OsUpdateType, + options?: AvailableOSListOptionalParams + ): AsyncIterableIterator { + let result = await this._list( + resourceGroupName, + testBaseAccountName, + osUpdateType, + options + ); + yield result.value || []; + let continuationToken = result.nextLink; + while (continuationToken) { + result = await this._listNext( + resourceGroupName, + testBaseAccountName, + osUpdateType, + continuationToken, + options + ); + continuationToken = result.nextLink; + yield result.value || []; + } + } + + private async *listPagingAll( + resourceGroupName: string, + testBaseAccountName: string, + osUpdateType: OsUpdateType, + options?: AvailableOSListOptionalParams + ): AsyncIterableIterator { + for await (const page of this.listPagingPage( + resourceGroupName, + testBaseAccountName, + osUpdateType, + options + )) { + yield* page; + } + } + + /** + * Lists all the available OSs to run a package under a Test Base Account. + * @param resourceGroupName The name of the resource group that contains the resource. + * @param testBaseAccountName The resource name of the Test Base Account. + * @param osUpdateType The type of the OS Update. + * @param options The options parameters. + */ + private _list( + resourceGroupName: string, + testBaseAccountName: string, + osUpdateType: OsUpdateType, + options?: AvailableOSListOptionalParams + ): Promise { + return this.client.sendOperationRequest( + { resourceGroupName, testBaseAccountName, osUpdateType, options }, + listOperationSpec + ); + } + + /** + * Gets an available OS to run a package under a Test Base Account. + * @param resourceGroupName The name of the resource group that contains the resource. + * @param testBaseAccountName The resource name of the Test Base Account. + * @param availableOSResourceName The resource name of an Available OS. + * @param options The options parameters. + */ + get( + resourceGroupName: string, + testBaseAccountName: string, + availableOSResourceName: string, + options?: AvailableOSGetOptionalParams + ): Promise { + return this.client.sendOperationRequest( + { + resourceGroupName, + testBaseAccountName, + availableOSResourceName, + options + }, + getOperationSpec + ); + } + + /** + * ListNext + * @param resourceGroupName The name of the resource group that contains the resource. + * @param testBaseAccountName The resource name of the Test Base Account. + * @param osUpdateType The type of the OS Update. + * @param nextLink The nextLink from the previous successful call to the List method. + * @param options The options parameters. + */ + private _listNext( + resourceGroupName: string, + testBaseAccountName: string, + osUpdateType: OsUpdateType, + nextLink: string, + options?: AvailableOSListNextOptionalParams + ): Promise { + return this.client.sendOperationRequest( + { + resourceGroupName, + testBaseAccountName, + osUpdateType, + nextLink, + options + }, + listNextOperationSpec + ); + } +} +// Operation Specifications +const serializer = coreClient.createSerializer(Mappers, /* isXml */ false); + +const listOperationSpec: coreClient.OperationSpec = { + path: + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.TestBase/testBaseAccounts/{testBaseAccountName}/availableOSs", + httpMethod: "GET", + responses: { + 200: { + bodyMapper: Mappers.AvailableOSListResult + }, + default: { + bodyMapper: Mappers.ErrorResponse + } + }, + queryParameters: [Parameters.apiVersion, Parameters.osUpdateType], + urlParameters: [ + Parameters.$host, + Parameters.subscriptionId, + Parameters.resourceGroupName, + Parameters.testBaseAccountName + ], + headerParameters: [Parameters.accept], + serializer +}; +const getOperationSpec: coreClient.OperationSpec = { + path: + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.TestBase/testBaseAccounts/{testBaseAccountName}/availableOSs/{availableOSResourceName}", + httpMethod: "GET", + responses: { + 200: { + bodyMapper: Mappers.AvailableOSResource + }, + default: { + bodyMapper: Mappers.ErrorResponse + } + }, + queryParameters: [Parameters.apiVersion], + urlParameters: [ + Parameters.$host, + Parameters.subscriptionId, + Parameters.resourceGroupName, + Parameters.testBaseAccountName, + Parameters.availableOSResourceName + ], + headerParameters: [Parameters.accept], + serializer +}; +const listNextOperationSpec: coreClient.OperationSpec = { + path: "{nextLink}", + httpMethod: "GET", + responses: { + 200: { + bodyMapper: Mappers.AvailableOSListResult + }, + default: { + bodyMapper: Mappers.ErrorResponse + } + }, + queryParameters: [Parameters.apiVersion, Parameters.osUpdateType], + urlParameters: [ + Parameters.$host, + Parameters.subscriptionId, + Parameters.nextLink, + Parameters.resourceGroupName, + Parameters.testBaseAccountName + ], + headerParameters: [Parameters.accept], + serializer +}; diff --git a/sdk/testbase/arm-testbase/src/operations/billingHubService.ts b/sdk/testbase/arm-testbase/src/operations/billingHubService.ts new file mode 100644 index 000000000000..5504940df4fc --- /dev/null +++ b/sdk/testbase/arm-testbase/src/operations/billingHubService.ts @@ -0,0 +1,113 @@ +/* + * 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 { BillingHubService } from "../operationsInterfaces"; +import * as coreClient from "@azure/core-client"; +import * as Mappers from "../models/mappers"; +import * as Parameters from "../models/parameters"; +import { TestBase } from "../testBase"; +import { + BillingHubServiceGetFreeHourBalanceOptionalParams, + BillingHubServiceGetFreeHourBalanceResponse, + BillingHubServiceGetUsageOptionalParams, + BillingHubServiceGetUsageResponse +} from "../models"; + +/** Class containing BillingHubService operations. */ +export class BillingHubServiceImpl implements BillingHubService { + private readonly client: TestBase; + + /** + * Initialize a new instance of the class BillingHubService class. + * @param client Reference to the service client + */ + constructor(client: TestBase) { + this.client = client; + } + + /** + * @param resourceGroupName The name of the resource group that contains the resource. + * @param testBaseAccountName The resource name of the Test Base Account. + * @param options The options parameters. + */ + getFreeHourBalance( + resourceGroupName: string, + testBaseAccountName: string, + options?: BillingHubServiceGetFreeHourBalanceOptionalParams + ): Promise { + return this.client.sendOperationRequest( + { resourceGroupName, testBaseAccountName, options }, + getFreeHourBalanceOperationSpec + ); + } + + /** + * @param resourceGroupName The name of the resource group that contains the resource. + * @param testBaseAccountName The resource name of the Test Base Account. + * @param options The options parameters. + */ + getUsage( + resourceGroupName: string, + testBaseAccountName: string, + options?: BillingHubServiceGetUsageOptionalParams + ): Promise { + return this.client.sendOperationRequest( + { resourceGroupName, testBaseAccountName, options }, + getUsageOperationSpec + ); + } +} +// Operation Specifications +const serializer = coreClient.createSerializer(Mappers, /* isXml */ false); + +const getFreeHourBalanceOperationSpec: coreClient.OperationSpec = { + path: + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.TestBase/testBaseAccounts/{testBaseAccountName}/getFreeHourBalance", + httpMethod: "POST", + responses: { + 200: { + bodyMapper: Mappers.BillingHubGetFreeHourBalanceResponse + }, + default: { + bodyMapper: Mappers.ErrorResponse + } + }, + queryParameters: [Parameters.apiVersion], + urlParameters: [ + Parameters.$host, + Parameters.subscriptionId, + Parameters.resourceGroupName, + Parameters.testBaseAccountName + ], + headerParameters: [Parameters.accept], + serializer +}; +const getUsageOperationSpec: coreClient.OperationSpec = { + path: + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.TestBase/testBaseAccounts/{testBaseAccountName}/getUsage", + httpMethod: "POST", + responses: { + 200: { + bodyMapper: Mappers.BillingHubGetUsageResponse + }, + default: { + bodyMapper: Mappers.ErrorResponse + } + }, + requestBody: Parameters.getUsageRequest, + queryParameters: [Parameters.apiVersion], + urlParameters: [ + Parameters.$host, + Parameters.subscriptionId, + Parameters.resourceGroupName, + Parameters.testBaseAccountName + ], + headerParameters: [Parameters.accept, Parameters.contentType], + mediaType: "json", + serializer +}; diff --git a/sdk/testbase/arm-testbase/src/operations/customerEvents.ts b/sdk/testbase/arm-testbase/src/operations/customerEvents.ts new file mode 100644 index 000000000000..089ae7d835ee --- /dev/null +++ b/sdk/testbase/arm-testbase/src/operations/customerEvents.ts @@ -0,0 +1,488 @@ +/* + * 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 { CustomerEvents } from "../operationsInterfaces"; +import * as coreClient from "@azure/core-client"; +import * as Mappers from "../models/mappers"; +import * as Parameters from "../models/parameters"; +import { TestBase } from "../testBase"; +import { PollerLike, PollOperationState, LroEngine } from "@azure/core-lro"; +import { LroImpl } from "../lroImpl"; +import { + CustomerEventResource, + CustomerEventsListByTestBaseAccountNextOptionalParams, + CustomerEventsListByTestBaseAccountOptionalParams, + CustomerEventsListByTestBaseAccountResponse, + CustomerEventsCreateOptionalParams, + CustomerEventsCreateResponse, + CustomerEventsDeleteOptionalParams, + CustomerEventsGetOptionalParams, + CustomerEventsGetResponse, + CustomerEventsListByTestBaseAccountNextResponse +} from "../models"; + +/// +/** Class containing CustomerEvents operations. */ +export class CustomerEventsImpl implements CustomerEvents { + private readonly client: TestBase; + + /** + * Initialize a new instance of the class CustomerEvents class. + * @param client Reference to the service client + */ + constructor(client: TestBase) { + this.client = client; + } + + /** + * Lists all notification events subscribed under a Test Base Account. + * @param resourceGroupName The name of the resource group that contains the resource. + * @param testBaseAccountName The resource name of the Test Base Account. + * @param options The options parameters. + */ + public listByTestBaseAccount( + resourceGroupName: string, + testBaseAccountName: string, + options?: CustomerEventsListByTestBaseAccountOptionalParams + ): PagedAsyncIterableIterator { + const iter = this.listByTestBaseAccountPagingAll( + resourceGroupName, + testBaseAccountName, + options + ); + return { + next() { + return iter.next(); + }, + [Symbol.asyncIterator]() { + return this; + }, + byPage: () => { + return this.listByTestBaseAccountPagingPage( + resourceGroupName, + testBaseAccountName, + options + ); + } + }; + } + + private async *listByTestBaseAccountPagingPage( + resourceGroupName: string, + testBaseAccountName: string, + options?: CustomerEventsListByTestBaseAccountOptionalParams + ): AsyncIterableIterator { + let result = await this._listByTestBaseAccount( + resourceGroupName, + testBaseAccountName, + options + ); + yield result.value || []; + let continuationToken = result.nextLink; + while (continuationToken) { + result = await this._listByTestBaseAccountNext( + resourceGroupName, + testBaseAccountName, + continuationToken, + options + ); + continuationToken = result.nextLink; + yield result.value || []; + } + } + + private async *listByTestBaseAccountPagingAll( + resourceGroupName: string, + testBaseAccountName: string, + options?: CustomerEventsListByTestBaseAccountOptionalParams + ): AsyncIterableIterator { + for await (const page of this.listByTestBaseAccountPagingPage( + resourceGroupName, + testBaseAccountName, + options + )) { + yield* page; + } + } + + /** + * Lists all notification events subscribed under a Test Base Account. + * @param resourceGroupName The name of the resource group that contains the resource. + * @param testBaseAccountName The resource name of the Test Base Account. + * @param options The options parameters. + */ + private _listByTestBaseAccount( + resourceGroupName: string, + testBaseAccountName: string, + options?: CustomerEventsListByTestBaseAccountOptionalParams + ): Promise { + return this.client.sendOperationRequest( + { resourceGroupName, testBaseAccountName, options }, + listByTestBaseAccountOperationSpec + ); + } + + /** + * Create or replace a Test Base Customer Event. + * @param resourceGroupName The name of the resource group that contains the resource. + * @param testBaseAccountName The resource name of the Test Base Account. + * @param customerEventName The resource name of the Test Base Customer event. + * @param parameters Parameters supplied to create a Test Base CustomerEvent. + * @param options The options parameters. + */ + async beginCreate( + resourceGroupName: string, + testBaseAccountName: string, + customerEventName: string, + parameters: CustomerEventResource, + options?: CustomerEventsCreateOptionalParams + ): Promise< + PollerLike< + PollOperationState, + CustomerEventsCreateResponse + > + > { + const directSendOperation = async ( + args: coreClient.OperationArguments, + spec: coreClient.OperationSpec + ): Promise => { + return this.client.sendOperationRequest(args, spec); + }; + const sendOperation = async ( + args: coreClient.OperationArguments, + spec: coreClient.OperationSpec + ) => { + let currentRawResponse: + | coreClient.FullOperationResponse + | undefined = undefined; + const providedCallback = args.options?.onResponse; + const callback: coreClient.RawResponseCallback = ( + rawResponse: coreClient.FullOperationResponse, + flatResponse: unknown + ) => { + currentRawResponse = rawResponse; + providedCallback?.(rawResponse, flatResponse); + }; + const updatedArgs = { + ...args, + options: { + ...args.options, + onResponse: callback + } + }; + const flatResponse = await directSendOperation(updatedArgs, spec); + return { + flatResponse, + rawResponse: { + statusCode: currentRawResponse!.status, + body: currentRawResponse!.parsedBody, + headers: currentRawResponse!.headers.toJSON() + } + }; + }; + + const lro = new LroImpl( + sendOperation, + { + resourceGroupName, + testBaseAccountName, + customerEventName, + parameters, + options + }, + createOperationSpec + ); + const poller = new LroEngine(lro, { + resumeFrom: options?.resumeFrom, + intervalInMs: options?.updateIntervalInMs, + lroResourceLocationConfig: "azure-async-operation" + }); + await poller.poll(); + return poller; + } + + /** + * Create or replace a Test Base Customer Event. + * @param resourceGroupName The name of the resource group that contains the resource. + * @param testBaseAccountName The resource name of the Test Base Account. + * @param customerEventName The resource name of the Test Base Customer event. + * @param parameters Parameters supplied to create a Test Base CustomerEvent. + * @param options The options parameters. + */ + async beginCreateAndWait( + resourceGroupName: string, + testBaseAccountName: string, + customerEventName: string, + parameters: CustomerEventResource, + options?: CustomerEventsCreateOptionalParams + ): Promise { + const poller = await this.beginCreate( + resourceGroupName, + testBaseAccountName, + customerEventName, + parameters, + options + ); + return poller.pollUntilDone(); + } + + /** + * Deletes a Test Base Customer Event. + * @param resourceGroupName The name of the resource group that contains the resource. + * @param testBaseAccountName The resource name of the Test Base Account. + * @param customerEventName The resource name of the Test Base Customer event. + * @param options The options parameters. + */ + async beginDelete( + resourceGroupName: string, + testBaseAccountName: string, + customerEventName: string, + options?: CustomerEventsDeleteOptionalParams + ): Promise, void>> { + const directSendOperation = async ( + args: coreClient.OperationArguments, + spec: coreClient.OperationSpec + ): Promise => { + return this.client.sendOperationRequest(args, spec); + }; + const sendOperation = async ( + args: coreClient.OperationArguments, + spec: coreClient.OperationSpec + ) => { + let currentRawResponse: + | coreClient.FullOperationResponse + | undefined = undefined; + const providedCallback = args.options?.onResponse; + const callback: coreClient.RawResponseCallback = ( + rawResponse: coreClient.FullOperationResponse, + flatResponse: unknown + ) => { + currentRawResponse = rawResponse; + providedCallback?.(rawResponse, flatResponse); + }; + const updatedArgs = { + ...args, + options: { + ...args.options, + onResponse: callback + } + }; + const flatResponse = await directSendOperation(updatedArgs, spec); + return { + flatResponse, + rawResponse: { + statusCode: currentRawResponse!.status, + body: currentRawResponse!.parsedBody, + headers: currentRawResponse!.headers.toJSON() + } + }; + }; + + const lro = new LroImpl( + sendOperation, + { resourceGroupName, testBaseAccountName, customerEventName, options }, + deleteOperationSpec + ); + const poller = new LroEngine(lro, { + resumeFrom: options?.resumeFrom, + intervalInMs: options?.updateIntervalInMs, + lroResourceLocationConfig: "azure-async-operation" + }); + await poller.poll(); + return poller; + } + + /** + * Deletes a Test Base Customer Event. + * @param resourceGroupName The name of the resource group that contains the resource. + * @param testBaseAccountName The resource name of the Test Base Account. + * @param customerEventName The resource name of the Test Base Customer event. + * @param options The options parameters. + */ + async beginDeleteAndWait( + resourceGroupName: string, + testBaseAccountName: string, + customerEventName: string, + options?: CustomerEventsDeleteOptionalParams + ): Promise { + const poller = await this.beginDelete( + resourceGroupName, + testBaseAccountName, + customerEventName, + options + ); + return poller.pollUntilDone(); + } + + /** + * Gets a Test Base CustomerEvent. + * @param resourceGroupName The name of the resource group that contains the resource. + * @param testBaseAccountName The resource name of the Test Base Account. + * @param customerEventName The resource name of the Test Base Customer event. + * @param options The options parameters. + */ + get( + resourceGroupName: string, + testBaseAccountName: string, + customerEventName: string, + options?: CustomerEventsGetOptionalParams + ): Promise { + return this.client.sendOperationRequest( + { resourceGroupName, testBaseAccountName, customerEventName, options }, + getOperationSpec + ); + } + + /** + * ListByTestBaseAccountNext + * @param resourceGroupName The name of the resource group that contains the resource. + * @param testBaseAccountName The resource name of the Test Base Account. + * @param nextLink The nextLink from the previous successful call to the ListByTestBaseAccount method. + * @param options The options parameters. + */ + private _listByTestBaseAccountNext( + resourceGroupName: string, + testBaseAccountName: string, + nextLink: string, + options?: CustomerEventsListByTestBaseAccountNextOptionalParams + ): Promise { + return this.client.sendOperationRequest( + { resourceGroupName, testBaseAccountName, nextLink, options }, + listByTestBaseAccountNextOperationSpec + ); + } +} +// Operation Specifications +const serializer = coreClient.createSerializer(Mappers, /* isXml */ false); + +const listByTestBaseAccountOperationSpec: coreClient.OperationSpec = { + path: + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.TestBase/testBaseAccounts/{testBaseAccountName}/customerEvents", + httpMethod: "GET", + responses: { + 200: { + bodyMapper: Mappers.CustomerEventListResult + }, + default: { + bodyMapper: Mappers.ErrorResponse + } + }, + queryParameters: [Parameters.apiVersion], + urlParameters: [ + Parameters.$host, + Parameters.subscriptionId, + Parameters.resourceGroupName, + Parameters.testBaseAccountName + ], + headerParameters: [Parameters.accept], + serializer +}; +const createOperationSpec: coreClient.OperationSpec = { + path: + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.TestBase/testBaseAccounts/{testBaseAccountName}/customerEvents/{customerEventName}", + httpMethod: "PUT", + responses: { + 200: { + bodyMapper: Mappers.CustomerEventResource + }, + 201: { + bodyMapper: Mappers.CustomerEventResource + }, + 202: { + bodyMapper: Mappers.CustomerEventResource + }, + 204: { + bodyMapper: Mappers.CustomerEventResource + }, + default: { + bodyMapper: Mappers.ErrorResponse + } + }, + requestBody: Parameters.parameters9, + queryParameters: [Parameters.apiVersion], + urlParameters: [ + Parameters.$host, + Parameters.subscriptionId, + Parameters.resourceGroupName, + Parameters.testBaseAccountName, + Parameters.customerEventName + ], + headerParameters: [Parameters.accept, Parameters.contentType], + mediaType: "json", + serializer +}; +const deleteOperationSpec: coreClient.OperationSpec = { + path: + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.TestBase/testBaseAccounts/{testBaseAccountName}/customerEvents/{customerEventName}", + httpMethod: "DELETE", + responses: { + 200: {}, + 201: {}, + 202: {}, + 204: {}, + default: { + bodyMapper: Mappers.ErrorResponse + } + }, + queryParameters: [Parameters.apiVersion], + urlParameters: [ + Parameters.$host, + Parameters.subscriptionId, + Parameters.resourceGroupName, + Parameters.testBaseAccountName, + Parameters.customerEventName + ], + headerParameters: [Parameters.accept], + serializer +}; +const getOperationSpec: coreClient.OperationSpec = { + path: + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.TestBase/testBaseAccounts/{testBaseAccountName}/customerEvents/{customerEventName}", + httpMethod: "GET", + responses: { + 200: { + bodyMapper: Mappers.CustomerEventResource + }, + default: { + bodyMapper: Mappers.ErrorResponse + } + }, + queryParameters: [Parameters.apiVersion], + urlParameters: [ + Parameters.$host, + Parameters.subscriptionId, + Parameters.resourceGroupName, + Parameters.testBaseAccountName, + Parameters.customerEventName + ], + headerParameters: [Parameters.accept], + serializer +}; +const listByTestBaseAccountNextOperationSpec: coreClient.OperationSpec = { + path: "{nextLink}", + httpMethod: "GET", + responses: { + 200: { + bodyMapper: Mappers.CustomerEventListResult + }, + default: { + bodyMapper: Mappers.ErrorResponse + } + }, + queryParameters: [Parameters.apiVersion], + urlParameters: [ + Parameters.$host, + Parameters.subscriptionId, + Parameters.nextLink, + Parameters.resourceGroupName, + Parameters.testBaseAccountName + ], + headerParameters: [Parameters.accept], + serializer +}; diff --git a/sdk/testbase/arm-testbase/src/operations/emailEvents.ts b/sdk/testbase/arm-testbase/src/operations/emailEvents.ts new file mode 100644 index 000000000000..64daf908c5ba --- /dev/null +++ b/sdk/testbase/arm-testbase/src/operations/emailEvents.ts @@ -0,0 +1,238 @@ +/* + * 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 { EmailEvents } from "../operationsInterfaces"; +import * as coreClient from "@azure/core-client"; +import * as Mappers from "../models/mappers"; +import * as Parameters from "../models/parameters"; +import { TestBase } from "../testBase"; +import { + EmailEventResource, + EmailEventsListNextOptionalParams, + EmailEventsListOptionalParams, + EmailEventsListResponse, + EmailEventsGetOptionalParams, + EmailEventsGetResponse, + EmailEventsListNextResponse +} from "../models"; + +/// +/** Class containing EmailEvents operations. */ +export class EmailEventsImpl implements EmailEvents { + private readonly client: TestBase; + + /** + * Initialize a new instance of the class EmailEvents class. + * @param client Reference to the service client + */ + constructor(client: TestBase) { + this.client = client; + } + + /** + * Lists all the email events of a Test Base Account. + * @param resourceGroupName The name of the resource group that contains the resource. + * @param testBaseAccountName The resource name of the Test Base Account. + * @param options The options parameters. + */ + public list( + resourceGroupName: string, + testBaseAccountName: string, + options?: EmailEventsListOptionalParams + ): PagedAsyncIterableIterator { + const iter = this.listPagingAll( + resourceGroupName, + testBaseAccountName, + options + ); + return { + next() { + return iter.next(); + }, + [Symbol.asyncIterator]() { + return this; + }, + byPage: () => { + return this.listPagingPage( + resourceGroupName, + testBaseAccountName, + options + ); + } + }; + } + + private async *listPagingPage( + resourceGroupName: string, + testBaseAccountName: string, + options?: EmailEventsListOptionalParams + ): AsyncIterableIterator { + let result = await this._list( + resourceGroupName, + testBaseAccountName, + options + ); + yield result.value || []; + let continuationToken = result.nextLink; + while (continuationToken) { + result = await this._listNext( + resourceGroupName, + testBaseAccountName, + continuationToken, + options + ); + continuationToken = result.nextLink; + yield result.value || []; + } + } + + private async *listPagingAll( + resourceGroupName: string, + testBaseAccountName: string, + options?: EmailEventsListOptionalParams + ): AsyncIterableIterator { + for await (const page of this.listPagingPage( + resourceGroupName, + testBaseAccountName, + options + )) { + yield* page; + } + } + + /** + * Lists all the email events of a Test Base Account. + * @param resourceGroupName The name of the resource group that contains the resource. + * @param testBaseAccountName The resource name of the Test Base Account. + * @param options The options parameters. + */ + private _list( + resourceGroupName: string, + testBaseAccountName: string, + options?: EmailEventsListOptionalParams + ): Promise { + return this.client.sendOperationRequest( + { resourceGroupName, testBaseAccountName, options }, + listOperationSpec + ); + } + + /** + * Gets a email event of a Test Base Account. + * @param resourceGroupName The name of the resource group that contains the resource. + * @param testBaseAccountName The resource name of the Test Base Account. + * @param emailEventResourceName The resource name of an email event. + * @param options The options parameters. + */ + get( + resourceGroupName: string, + testBaseAccountName: string, + emailEventResourceName: string, + options?: EmailEventsGetOptionalParams + ): Promise { + return this.client.sendOperationRequest( + { + resourceGroupName, + testBaseAccountName, + emailEventResourceName, + options + }, + getOperationSpec + ); + } + + /** + * ListNext + * @param resourceGroupName The name of the resource group that contains the resource. + * @param testBaseAccountName The resource name of the Test Base Account. + * @param nextLink The nextLink from the previous successful call to the List method. + * @param options The options parameters. + */ + private _listNext( + resourceGroupName: string, + testBaseAccountName: string, + nextLink: string, + options?: EmailEventsListNextOptionalParams + ): Promise { + return this.client.sendOperationRequest( + { resourceGroupName, testBaseAccountName, nextLink, options }, + listNextOperationSpec + ); + } +} +// Operation Specifications +const serializer = coreClient.createSerializer(Mappers, /* isXml */ false); + +const listOperationSpec: coreClient.OperationSpec = { + path: + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.TestBase/testBaseAccounts/{testBaseAccountName}/emailEvents", + httpMethod: "GET", + responses: { + 200: { + bodyMapper: Mappers.EmailEventListResult + }, + default: { + bodyMapper: Mappers.ErrorResponse + } + }, + queryParameters: [Parameters.apiVersion], + urlParameters: [ + Parameters.$host, + Parameters.subscriptionId, + Parameters.resourceGroupName, + Parameters.testBaseAccountName + ], + headerParameters: [Parameters.accept], + serializer +}; +const getOperationSpec: coreClient.OperationSpec = { + path: + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.TestBase/testBaseAccounts/{testBaseAccountName}/emailEvents/{emailEventResourceName}", + httpMethod: "GET", + responses: { + 200: { + bodyMapper: Mappers.EmailEventResource + }, + default: { + bodyMapper: Mappers.ErrorResponse + } + }, + queryParameters: [Parameters.apiVersion], + urlParameters: [ + Parameters.$host, + Parameters.subscriptionId, + Parameters.resourceGroupName, + Parameters.testBaseAccountName, + Parameters.emailEventResourceName + ], + headerParameters: [Parameters.accept], + serializer +}; +const listNextOperationSpec: coreClient.OperationSpec = { + path: "{nextLink}", + httpMethod: "GET", + responses: { + 200: { + bodyMapper: Mappers.EmailEventListResult + }, + default: { + bodyMapper: Mappers.ErrorResponse + } + }, + queryParameters: [Parameters.apiVersion], + urlParameters: [ + Parameters.$host, + Parameters.subscriptionId, + Parameters.nextLink, + Parameters.resourceGroupName, + Parameters.testBaseAccountName + ], + headerParameters: [Parameters.accept], + serializer +}; diff --git a/sdk/testbase/arm-testbase/src/operations/favoriteProcesses.ts b/sdk/testbase/arm-testbase/src/operations/favoriteProcesses.ts new file mode 100644 index 000000000000..4f94112c20c2 --- /dev/null +++ b/sdk/testbase/arm-testbase/src/operations/favoriteProcesses.ts @@ -0,0 +1,378 @@ +/* + * 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 { FavoriteProcesses } from "../operationsInterfaces"; +import * as coreClient from "@azure/core-client"; +import * as Mappers from "../models/mappers"; +import * as Parameters from "../models/parameters"; +import { TestBase } from "../testBase"; +import { + FavoriteProcessResource, + FavoriteProcessesListNextOptionalParams, + FavoriteProcessesListOptionalParams, + FavoriteProcessesListResponse, + FavoriteProcessesCreateOptionalParams, + FavoriteProcessesCreateResponse, + FavoriteProcessesDeleteOptionalParams, + FavoriteProcessesGetOptionalParams, + FavoriteProcessesGetResponse, + FavoriteProcessesListNextResponse +} from "../models"; + +/// +/** Class containing FavoriteProcesses operations. */ +export class FavoriteProcessesImpl implements FavoriteProcesses { + private readonly client: TestBase; + + /** + * Initialize a new instance of the class FavoriteProcesses class. + * @param client Reference to the service client + */ + constructor(client: TestBase) { + this.client = client; + } + + /** + * Lists the favorite processes for a specific package. + * @param resourceGroupName The name of the resource group that contains the resource. + * @param testBaseAccountName The resource name of the Test Base Account. + * @param packageName The resource name of the Test Base Package. + * @param options The options parameters. + */ + public list( + resourceGroupName: string, + testBaseAccountName: string, + packageName: string, + options?: FavoriteProcessesListOptionalParams + ): PagedAsyncIterableIterator { + const iter = this.listPagingAll( + resourceGroupName, + testBaseAccountName, + packageName, + options + ); + return { + next() { + return iter.next(); + }, + [Symbol.asyncIterator]() { + return this; + }, + byPage: () => { + return this.listPagingPage( + resourceGroupName, + testBaseAccountName, + packageName, + options + ); + } + }; + } + + private async *listPagingPage( + resourceGroupName: string, + testBaseAccountName: string, + packageName: string, + options?: FavoriteProcessesListOptionalParams + ): AsyncIterableIterator { + let result = await this._list( + resourceGroupName, + testBaseAccountName, + packageName, + options + ); + yield result.value || []; + let continuationToken = result.nextLink; + while (continuationToken) { + result = await this._listNext( + resourceGroupName, + testBaseAccountName, + packageName, + continuationToken, + options + ); + continuationToken = result.nextLink; + yield result.value || []; + } + } + + private async *listPagingAll( + resourceGroupName: string, + testBaseAccountName: string, + packageName: string, + options?: FavoriteProcessesListOptionalParams + ): AsyncIterableIterator { + for await (const page of this.listPagingPage( + resourceGroupName, + testBaseAccountName, + packageName, + options + )) { + yield* page; + } + } + + /** + * Lists the favorite processes for a specific package. + * @param resourceGroupName The name of the resource group that contains the resource. + * @param testBaseAccountName The resource name of the Test Base Account. + * @param packageName The resource name of the Test Base Package. + * @param options The options parameters. + */ + private _list( + resourceGroupName: string, + testBaseAccountName: string, + packageName: string, + options?: FavoriteProcessesListOptionalParams + ): Promise { + return this.client.sendOperationRequest( + { resourceGroupName, testBaseAccountName, packageName, options }, + listOperationSpec + ); + } + + /** + * Create or replace a favorite process for a Test Base Package. + * @param resourceGroupName The name of the resource group that contains the resource. + * @param testBaseAccountName The resource name of the Test Base Account. + * @param packageName The resource name of the Test Base Package. + * @param favoriteProcessResourceName The resource name of a favorite process in a package. If the + * process name contains characters that are not allowed in Azure Resource Name, we use + * 'actualProcessName' in request body to submit the name. + * @param parameters Parameters supplied to create a favorite process in a package. + * @param options The options parameters. + */ + create( + resourceGroupName: string, + testBaseAccountName: string, + packageName: string, + favoriteProcessResourceName: string, + parameters: FavoriteProcessResource, + options?: FavoriteProcessesCreateOptionalParams + ): Promise { + return this.client.sendOperationRequest( + { + resourceGroupName, + testBaseAccountName, + packageName, + favoriteProcessResourceName, + parameters, + options + }, + createOperationSpec + ); + } + + /** + * Deletes a favorite process for a specific package. + * @param resourceGroupName The name of the resource group that contains the resource. + * @param testBaseAccountName The resource name of the Test Base Account. + * @param packageName The resource name of the Test Base Package. + * @param favoriteProcessResourceName The resource name of a favorite process in a package. If the + * process name contains characters that are not allowed in Azure Resource Name, we use + * 'actualProcessName' in request body to submit the name. + * @param options The options parameters. + */ + delete( + resourceGroupName: string, + testBaseAccountName: string, + packageName: string, + favoriteProcessResourceName: string, + options?: FavoriteProcessesDeleteOptionalParams + ): Promise { + return this.client.sendOperationRequest( + { + resourceGroupName, + testBaseAccountName, + packageName, + favoriteProcessResourceName, + options + }, + deleteOperationSpec + ); + } + + /** + * Gets a favorite process for a Test Base Package. + * @param resourceGroupName The name of the resource group that contains the resource. + * @param testBaseAccountName The resource name of the Test Base Account. + * @param packageName The resource name of the Test Base Package. + * @param favoriteProcessResourceName The resource name of a favorite process in a package. If the + * process name contains characters that are not allowed in Azure Resource Name, we use + * 'actualProcessName' in request body to submit the name. + * @param options The options parameters. + */ + get( + resourceGroupName: string, + testBaseAccountName: string, + packageName: string, + favoriteProcessResourceName: string, + options?: FavoriteProcessesGetOptionalParams + ): Promise { + return this.client.sendOperationRequest( + { + resourceGroupName, + testBaseAccountName, + packageName, + favoriteProcessResourceName, + options + }, + getOperationSpec + ); + } + + /** + * ListNext + * @param resourceGroupName The name of the resource group that contains the resource. + * @param testBaseAccountName The resource name of the Test Base Account. + * @param packageName The resource name of the Test Base Package. + * @param nextLink The nextLink from the previous successful call to the List method. + * @param options The options parameters. + */ + private _listNext( + resourceGroupName: string, + testBaseAccountName: string, + packageName: string, + nextLink: string, + options?: FavoriteProcessesListNextOptionalParams + ): Promise { + return this.client.sendOperationRequest( + { + resourceGroupName, + testBaseAccountName, + packageName, + nextLink, + options + }, + listNextOperationSpec + ); + } +} +// Operation Specifications +const serializer = coreClient.createSerializer(Mappers, /* isXml */ false); + +const listOperationSpec: coreClient.OperationSpec = { + path: + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.TestBase/testBaseAccounts/{testBaseAccountName}/packages/{packageName}/favoriteProcesses", + httpMethod: "GET", + responses: { + 200: { + bodyMapper: Mappers.FavoriteProcessListResult + }, + default: { + bodyMapper: Mappers.ErrorResponse + } + }, + queryParameters: [Parameters.apiVersion], + urlParameters: [ + Parameters.$host, + Parameters.subscriptionId, + Parameters.resourceGroupName, + Parameters.testBaseAccountName, + Parameters.packageName + ], + headerParameters: [Parameters.accept], + serializer +}; +const createOperationSpec: coreClient.OperationSpec = { + path: + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.TestBase/testBaseAccounts/{testBaseAccountName}/packages/{packageName}/favoriteProcesses/{favoriteProcessResourceName}", + httpMethod: "PUT", + responses: { + 200: { + bodyMapper: Mappers.FavoriteProcessResource + }, + default: { + bodyMapper: Mappers.ErrorResponse + } + }, + requestBody: Parameters.parameters8, + queryParameters: [Parameters.apiVersion], + urlParameters: [ + Parameters.$host, + Parameters.subscriptionId, + Parameters.resourceGroupName, + Parameters.testBaseAccountName, + Parameters.packageName, + Parameters.favoriteProcessResourceName + ], + headerParameters: [Parameters.accept, Parameters.contentType], + mediaType: "json", + serializer +}; +const deleteOperationSpec: coreClient.OperationSpec = { + path: + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.TestBase/testBaseAccounts/{testBaseAccountName}/packages/{packageName}/favoriteProcesses/{favoriteProcessResourceName}", + httpMethod: "DELETE", + responses: { + 200: {}, + 204: {}, + default: { + bodyMapper: Mappers.ErrorResponse + } + }, + queryParameters: [Parameters.apiVersion], + urlParameters: [ + Parameters.$host, + Parameters.subscriptionId, + Parameters.resourceGroupName, + Parameters.testBaseAccountName, + Parameters.packageName, + Parameters.favoriteProcessResourceName + ], + headerParameters: [Parameters.accept], + serializer +}; +const getOperationSpec: coreClient.OperationSpec = { + path: + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.TestBase/testBaseAccounts/{testBaseAccountName}/packages/{packageName}/favoriteProcesses/{favoriteProcessResourceName}", + httpMethod: "GET", + responses: { + 200: { + bodyMapper: Mappers.FavoriteProcessResource + }, + default: { + bodyMapper: Mappers.ErrorResponse + } + }, + queryParameters: [Parameters.apiVersion], + urlParameters: [ + Parameters.$host, + Parameters.subscriptionId, + Parameters.resourceGroupName, + Parameters.testBaseAccountName, + Parameters.packageName, + Parameters.favoriteProcessResourceName + ], + headerParameters: [Parameters.accept], + serializer +}; +const listNextOperationSpec: coreClient.OperationSpec = { + path: "{nextLink}", + httpMethod: "GET", + responses: { + 200: { + bodyMapper: Mappers.FavoriteProcessListResult + }, + default: { + bodyMapper: Mappers.ErrorResponse + } + }, + queryParameters: [Parameters.apiVersion], + urlParameters: [ + Parameters.$host, + Parameters.subscriptionId, + Parameters.nextLink, + Parameters.resourceGroupName, + Parameters.testBaseAccountName, + Parameters.packageName + ], + headerParameters: [Parameters.accept], + serializer +}; diff --git a/sdk/testbase/arm-testbase/src/operations/flightingRings.ts b/sdk/testbase/arm-testbase/src/operations/flightingRings.ts new file mode 100644 index 000000000000..71661ada98e3 --- /dev/null +++ b/sdk/testbase/arm-testbase/src/operations/flightingRings.ts @@ -0,0 +1,238 @@ +/* + * 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 { FlightingRings } from "../operationsInterfaces"; +import * as coreClient from "@azure/core-client"; +import * as Mappers from "../models/mappers"; +import * as Parameters from "../models/parameters"; +import { TestBase } from "../testBase"; +import { + FlightingRingResource, + FlightingRingsListNextOptionalParams, + FlightingRingsListOptionalParams, + FlightingRingsListResponse, + FlightingRingsGetOptionalParams, + FlightingRingsGetResponse, + FlightingRingsListNextResponse +} from "../models"; + +/// +/** Class containing FlightingRings operations. */ +export class FlightingRingsImpl implements FlightingRings { + private readonly client: TestBase; + + /** + * Initialize a new instance of the class FlightingRings class. + * @param client Reference to the service client + */ + constructor(client: TestBase) { + this.client = client; + } + + /** + * Lists all the flighting rings of a Test Base Account. + * @param resourceGroupName The name of the resource group that contains the resource. + * @param testBaseAccountName The resource name of the Test Base Account. + * @param options The options parameters. + */ + public list( + resourceGroupName: string, + testBaseAccountName: string, + options?: FlightingRingsListOptionalParams + ): PagedAsyncIterableIterator { + const iter = this.listPagingAll( + resourceGroupName, + testBaseAccountName, + options + ); + return { + next() { + return iter.next(); + }, + [Symbol.asyncIterator]() { + return this; + }, + byPage: () => { + return this.listPagingPage( + resourceGroupName, + testBaseAccountName, + options + ); + } + }; + } + + private async *listPagingPage( + resourceGroupName: string, + testBaseAccountName: string, + options?: FlightingRingsListOptionalParams + ): AsyncIterableIterator { + let result = await this._list( + resourceGroupName, + testBaseAccountName, + options + ); + yield result.value || []; + let continuationToken = result.nextLink; + while (continuationToken) { + result = await this._listNext( + resourceGroupName, + testBaseAccountName, + continuationToken, + options + ); + continuationToken = result.nextLink; + yield result.value || []; + } + } + + private async *listPagingAll( + resourceGroupName: string, + testBaseAccountName: string, + options?: FlightingRingsListOptionalParams + ): AsyncIterableIterator { + for await (const page of this.listPagingPage( + resourceGroupName, + testBaseAccountName, + options + )) { + yield* page; + } + } + + /** + * Lists all the flighting rings of a Test Base Account. + * @param resourceGroupName The name of the resource group that contains the resource. + * @param testBaseAccountName The resource name of the Test Base Account. + * @param options The options parameters. + */ + private _list( + resourceGroupName: string, + testBaseAccountName: string, + options?: FlightingRingsListOptionalParams + ): Promise { + return this.client.sendOperationRequest( + { resourceGroupName, testBaseAccountName, options }, + listOperationSpec + ); + } + + /** + * Gets a flighting ring of a Test Base Account. + * @param resourceGroupName The name of the resource group that contains the resource. + * @param testBaseAccountName The resource name of the Test Base Account. + * @param flightingRingResourceName The resource name of a flighting ring. + * @param options The options parameters. + */ + get( + resourceGroupName: string, + testBaseAccountName: string, + flightingRingResourceName: string, + options?: FlightingRingsGetOptionalParams + ): Promise { + return this.client.sendOperationRequest( + { + resourceGroupName, + testBaseAccountName, + flightingRingResourceName, + options + }, + getOperationSpec + ); + } + + /** + * ListNext + * @param resourceGroupName The name of the resource group that contains the resource. + * @param testBaseAccountName The resource name of the Test Base Account. + * @param nextLink The nextLink from the previous successful call to the List method. + * @param options The options parameters. + */ + private _listNext( + resourceGroupName: string, + testBaseAccountName: string, + nextLink: string, + options?: FlightingRingsListNextOptionalParams + ): Promise { + return this.client.sendOperationRequest( + { resourceGroupName, testBaseAccountName, nextLink, options }, + listNextOperationSpec + ); + } +} +// Operation Specifications +const serializer = coreClient.createSerializer(Mappers, /* isXml */ false); + +const listOperationSpec: coreClient.OperationSpec = { + path: + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.TestBase/testBaseAccounts/{testBaseAccountName}/flightingRings", + httpMethod: "GET", + responses: { + 200: { + bodyMapper: Mappers.FlightingRingListResult + }, + default: { + bodyMapper: Mappers.ErrorResponse + } + }, + queryParameters: [Parameters.apiVersion], + urlParameters: [ + Parameters.$host, + Parameters.subscriptionId, + Parameters.resourceGroupName, + Parameters.testBaseAccountName + ], + headerParameters: [Parameters.accept], + serializer +}; +const getOperationSpec: coreClient.OperationSpec = { + path: + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.TestBase/testBaseAccounts/{testBaseAccountName}/flightingRings/{flightingRingResourceName}", + httpMethod: "GET", + responses: { + 200: { + bodyMapper: Mappers.FlightingRingResource + }, + default: { + bodyMapper: Mappers.ErrorResponse + } + }, + queryParameters: [Parameters.apiVersion], + urlParameters: [ + Parameters.$host, + Parameters.subscriptionId, + Parameters.resourceGroupName, + Parameters.testBaseAccountName, + Parameters.flightingRingResourceName + ], + headerParameters: [Parameters.accept], + serializer +}; +const listNextOperationSpec: coreClient.OperationSpec = { + path: "{nextLink}", + httpMethod: "GET", + responses: { + 200: { + bodyMapper: Mappers.FlightingRingListResult + }, + default: { + bodyMapper: Mappers.ErrorResponse + } + }, + queryParameters: [Parameters.apiVersion], + urlParameters: [ + Parameters.$host, + Parameters.subscriptionId, + Parameters.nextLink, + Parameters.resourceGroupName, + Parameters.testBaseAccountName + ], + headerParameters: [Parameters.accept], + serializer +}; diff --git a/sdk/testbase/arm-testbase/src/operations/index.ts b/sdk/testbase/arm-testbase/src/operations/index.ts new file mode 100644 index 000000000000..f1501f513537 --- /dev/null +++ b/sdk/testbase/arm-testbase/src/operations/index.ts @@ -0,0 +1,24 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +export * from "./skus"; +export * from "./testBaseAccounts"; +export * from "./usage"; +export * from "./availableOS"; +export * from "./flightingRings"; +export * from "./testTypes"; +export * from "./packages"; +export * from "./testSummaries"; +export * from "./testResults"; +export * from "./oSUpdates"; +export * from "./favoriteProcesses"; +export * from "./analysisResults"; +export * from "./emailEvents"; +export * from "./customerEvents"; +export * from "./operations"; +export * from "./billingHubService"; diff --git a/sdk/testbase/arm-testbase/src/operations/oSUpdates.ts b/sdk/testbase/arm-testbase/src/operations/oSUpdates.ts new file mode 100644 index 000000000000..95cae517ab11 --- /dev/null +++ b/sdk/testbase/arm-testbase/src/operations/oSUpdates.ts @@ -0,0 +1,284 @@ +/* + * 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 { OSUpdates } from "../operationsInterfaces"; +import * as coreClient from "@azure/core-client"; +import * as Mappers from "../models/mappers"; +import * as Parameters from "../models/parameters"; +import { TestBase } from "../testBase"; +import { + OSUpdateResource, + OsUpdateType, + OSUpdatesListNextOptionalParams, + OSUpdatesListOptionalParams, + OSUpdatesListResponse, + OSUpdatesGetOptionalParams, + OSUpdatesGetResponse, + OSUpdatesListNextResponse +} from "../models"; + +/// +/** Class containing OSUpdates operations. */ +export class OSUpdatesImpl implements OSUpdates { + private readonly client: TestBase; + + /** + * Initialize a new instance of the class OSUpdates class. + * @param client Reference to the service client + */ + constructor(client: TestBase) { + this.client = client; + } + + /** + * Lists the OS Updates in which the package were tested before. + * @param resourceGroupName The name of the resource group that contains the resource. + * @param testBaseAccountName The resource name of the Test Base Account. + * @param packageName The resource name of the Test Base Package. + * @param osUpdateType The type of the OS Update. + * @param options The options parameters. + */ + public list( + resourceGroupName: string, + testBaseAccountName: string, + packageName: string, + osUpdateType: OsUpdateType, + options?: OSUpdatesListOptionalParams + ): PagedAsyncIterableIterator { + const iter = this.listPagingAll( + resourceGroupName, + testBaseAccountName, + packageName, + osUpdateType, + options + ); + return { + next() { + return iter.next(); + }, + [Symbol.asyncIterator]() { + return this; + }, + byPage: () => { + return this.listPagingPage( + resourceGroupName, + testBaseAccountName, + packageName, + osUpdateType, + options + ); + } + }; + } + + private async *listPagingPage( + resourceGroupName: string, + testBaseAccountName: string, + packageName: string, + osUpdateType: OsUpdateType, + options?: OSUpdatesListOptionalParams + ): AsyncIterableIterator { + let result = await this._list( + resourceGroupName, + testBaseAccountName, + packageName, + osUpdateType, + options + ); + yield result.value || []; + let continuationToken = result.nextLink; + while (continuationToken) { + result = await this._listNext( + resourceGroupName, + testBaseAccountName, + packageName, + osUpdateType, + continuationToken, + options + ); + continuationToken = result.nextLink; + yield result.value || []; + } + } + + private async *listPagingAll( + resourceGroupName: string, + testBaseAccountName: string, + packageName: string, + osUpdateType: OsUpdateType, + options?: OSUpdatesListOptionalParams + ): AsyncIterableIterator { + for await (const page of this.listPagingPage( + resourceGroupName, + testBaseAccountName, + packageName, + osUpdateType, + options + )) { + yield* page; + } + } + + /** + * Lists the OS Updates in which the package were tested before. + * @param resourceGroupName The name of the resource group that contains the resource. + * @param testBaseAccountName The resource name of the Test Base Account. + * @param packageName The resource name of the Test Base Package. + * @param osUpdateType The type of the OS Update. + * @param options The options parameters. + */ + private _list( + resourceGroupName: string, + testBaseAccountName: string, + packageName: string, + osUpdateType: OsUpdateType, + options?: OSUpdatesListOptionalParams + ): Promise { + return this.client.sendOperationRequest( + { + resourceGroupName, + testBaseAccountName, + packageName, + osUpdateType, + options + }, + listOperationSpec + ); + } + + /** + * Gets an OS Update by name in which the package was tested before. + * @param resourceGroupName The name of the resource group that contains the resource. + * @param testBaseAccountName The resource name of the Test Base Account. + * @param packageName The resource name of the Test Base Package. + * @param osUpdateResourceName The resource name of an OS Update. + * @param options The options parameters. + */ + get( + resourceGroupName: string, + testBaseAccountName: string, + packageName: string, + osUpdateResourceName: string, + options?: OSUpdatesGetOptionalParams + ): Promise { + return this.client.sendOperationRequest( + { + resourceGroupName, + testBaseAccountName, + packageName, + osUpdateResourceName, + options + }, + getOperationSpec + ); + } + + /** + * ListNext + * @param resourceGroupName The name of the resource group that contains the resource. + * @param testBaseAccountName The resource name of the Test Base Account. + * @param packageName The resource name of the Test Base Package. + * @param osUpdateType The type of the OS Update. + * @param nextLink The nextLink from the previous successful call to the List method. + * @param options The options parameters. + */ + private _listNext( + resourceGroupName: string, + testBaseAccountName: string, + packageName: string, + osUpdateType: OsUpdateType, + nextLink: string, + options?: OSUpdatesListNextOptionalParams + ): Promise { + return this.client.sendOperationRequest( + { + resourceGroupName, + testBaseAccountName, + packageName, + osUpdateType, + nextLink, + options + }, + listNextOperationSpec + ); + } +} +// Operation Specifications +const serializer = coreClient.createSerializer(Mappers, /* isXml */ false); + +const listOperationSpec: coreClient.OperationSpec = { + path: + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.TestBase/testBaseAccounts/{testBaseAccountName}/packages/{packageName}/osUpdates", + httpMethod: "GET", + responses: { + 200: { + bodyMapper: Mappers.OSUpdateListResult + }, + default: { + bodyMapper: Mappers.ErrorResponse + } + }, + queryParameters: [Parameters.apiVersion, Parameters.osUpdateType], + urlParameters: [ + Parameters.$host, + Parameters.subscriptionId, + Parameters.resourceGroupName, + Parameters.testBaseAccountName, + Parameters.packageName + ], + headerParameters: [Parameters.accept], + serializer +}; +const getOperationSpec: coreClient.OperationSpec = { + path: + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.TestBase/testBaseAccounts/{testBaseAccountName}/packages/{packageName}/osUpdates/{osUpdateResourceName}", + httpMethod: "GET", + responses: { + 200: { + bodyMapper: Mappers.OSUpdateResource + }, + default: { + bodyMapper: Mappers.ErrorResponse + } + }, + queryParameters: [Parameters.apiVersion], + urlParameters: [ + Parameters.$host, + Parameters.subscriptionId, + Parameters.resourceGroupName, + Parameters.testBaseAccountName, + Parameters.packageName, + Parameters.osUpdateResourceName + ], + headerParameters: [Parameters.accept], + serializer +}; +const listNextOperationSpec: coreClient.OperationSpec = { + path: "{nextLink}", + httpMethod: "GET", + responses: { + 200: { + bodyMapper: Mappers.OSUpdateListResult + }, + default: { + bodyMapper: Mappers.ErrorResponse + } + }, + queryParameters: [Parameters.apiVersion, Parameters.osUpdateType], + urlParameters: [ + Parameters.$host, + Parameters.subscriptionId, + Parameters.nextLink, + Parameters.resourceGroupName, + Parameters.testBaseAccountName, + Parameters.packageName + ], + headerParameters: [Parameters.accept], + serializer +}; diff --git a/sdk/testbase/arm-testbase/src/operations/operations.ts b/sdk/testbase/arm-testbase/src/operations/operations.ts new file mode 100644 index 000000000000..bbdbe18e690c --- /dev/null +++ b/sdk/testbase/arm-testbase/src/operations/operations.ts @@ -0,0 +1,137 @@ +/* + * 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 { Operations } from "../operationsInterfaces"; +import * as coreClient from "@azure/core-client"; +import * as Mappers from "../models/mappers"; +import * as Parameters from "../models/parameters"; +import { TestBase } from "../testBase"; +import { + Operation, + OperationsListNextOptionalParams, + OperationsListOptionalParams, + OperationsListResponse, + OperationsListNextResponse +} from "../models"; + +/// +/** Class containing Operations operations. */ +export class OperationsImpl implements Operations { + private readonly client: TestBase; + + /** + * Initialize a new instance of the class Operations class. + * @param client Reference to the service client + */ + constructor(client: TestBase) { + this.client = client; + } + + /** + * Lists all of the available REST API operations of the Microsoft.TestBase provider. + * @param options The options parameters. + */ + public list( + options?: OperationsListOptionalParams + ): PagedAsyncIterableIterator { + const iter = this.listPagingAll(options); + return { + next() { + return iter.next(); + }, + [Symbol.asyncIterator]() { + return this; + }, + byPage: () => { + return this.listPagingPage(options); + } + }; + } + + private async *listPagingPage( + options?: OperationsListOptionalParams + ): AsyncIterableIterator { + let result = await this._list(options); + yield result.value || []; + let continuationToken = result.nextLink; + while (continuationToken) { + result = await this._listNext(continuationToken, options); + continuationToken = result.nextLink; + yield result.value || []; + } + } + + private async *listPagingAll( + options?: OperationsListOptionalParams + ): AsyncIterableIterator { + for await (const page of this.listPagingPage(options)) { + yield* page; + } + } + + /** + * Lists all of the available REST API operations of the Microsoft.TestBase provider. + * @param options The options parameters. + */ + private _list( + options?: OperationsListOptionalParams + ): Promise { + return this.client.sendOperationRequest({ options }, listOperationSpec); + } + + /** + * ListNext + * @param nextLink The nextLink from the previous successful call to the List method. + * @param options The options parameters. + */ + private _listNext( + nextLink: string, + options?: OperationsListNextOptionalParams + ): Promise { + return this.client.sendOperationRequest( + { nextLink, options }, + listNextOperationSpec + ); + } +} +// Operation Specifications +const serializer = coreClient.createSerializer(Mappers, /* isXml */ false); + +const listOperationSpec: coreClient.OperationSpec = { + path: "/providers/Microsoft.TestBase/operations", + httpMethod: "GET", + responses: { + 200: { + bodyMapper: Mappers.OperationListResult + }, + default: { + bodyMapper: Mappers.ErrorResponse + } + }, + queryParameters: [Parameters.apiVersion], + urlParameters: [Parameters.$host], + headerParameters: [Parameters.accept], + serializer +}; +const listNextOperationSpec: coreClient.OperationSpec = { + path: "{nextLink}", + httpMethod: "GET", + responses: { + 200: { + bodyMapper: Mappers.OperationListResult + }, + default: { + bodyMapper: Mappers.ErrorResponse + } + }, + queryParameters: [Parameters.apiVersion], + urlParameters: [Parameters.$host, Parameters.nextLink], + headerParameters: [Parameters.accept], + serializer +}; diff --git a/sdk/testbase/arm-testbase/src/operations/packages.ts b/sdk/testbase/arm-testbase/src/operations/packages.ts new file mode 100644 index 000000000000..a02af9f98e4f --- /dev/null +++ b/sdk/testbase/arm-testbase/src/operations/packages.ts @@ -0,0 +1,834 @@ +/* + * 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 { Packages } from "../operationsInterfaces"; +import * as coreClient from "@azure/core-client"; +import * as Mappers from "../models/mappers"; +import * as Parameters from "../models/parameters"; +import { TestBase } from "../testBase"; +import { PollerLike, PollOperationState, LroEngine } from "@azure/core-lro"; +import { LroImpl } from "../lroImpl"; +import { + PackageResource, + PackagesListByTestBaseAccountNextOptionalParams, + PackagesListByTestBaseAccountOptionalParams, + PackagesListByTestBaseAccountResponse, + PackagesCreateOptionalParams, + PackagesCreateResponse, + PackageUpdateParameters, + PackagesUpdateOptionalParams, + PackagesUpdateResponse, + PackagesDeleteOptionalParams, + PackagesGetOptionalParams, + PackagesGetResponse, + PackagesHardDeleteOptionalParams, + PackagesGetDownloadURLOptionalParams, + PackagesGetDownloadURLResponse, + PackagesRunTestOptionalParams, + PackagesRunTestResponse, + PackagesListByTestBaseAccountNextResponse +} from "../models"; + +/// +/** Class containing Packages operations. */ +export class PackagesImpl implements Packages { + private readonly client: TestBase; + + /** + * Initialize a new instance of the class Packages class. + * @param client Reference to the service client + */ + constructor(client: TestBase) { + this.client = client; + } + + /** + * Lists all the packages under a Test Base Account. + * @param resourceGroupName The name of the resource group that contains the resource. + * @param testBaseAccountName The resource name of the Test Base Account. + * @param options The options parameters. + */ + public listByTestBaseAccount( + resourceGroupName: string, + testBaseAccountName: string, + options?: PackagesListByTestBaseAccountOptionalParams + ): PagedAsyncIterableIterator { + const iter = this.listByTestBaseAccountPagingAll( + resourceGroupName, + testBaseAccountName, + options + ); + return { + next() { + return iter.next(); + }, + [Symbol.asyncIterator]() { + return this; + }, + byPage: () => { + return this.listByTestBaseAccountPagingPage( + resourceGroupName, + testBaseAccountName, + options + ); + } + }; + } + + private async *listByTestBaseAccountPagingPage( + resourceGroupName: string, + testBaseAccountName: string, + options?: PackagesListByTestBaseAccountOptionalParams + ): AsyncIterableIterator { + let result = await this._listByTestBaseAccount( + resourceGroupName, + testBaseAccountName, + options + ); + yield result.value || []; + let continuationToken = result.nextLink; + while (continuationToken) { + result = await this._listByTestBaseAccountNext( + resourceGroupName, + testBaseAccountName, + continuationToken, + options + ); + continuationToken = result.nextLink; + yield result.value || []; + } + } + + private async *listByTestBaseAccountPagingAll( + resourceGroupName: string, + testBaseAccountName: string, + options?: PackagesListByTestBaseAccountOptionalParams + ): AsyncIterableIterator { + for await (const page of this.listByTestBaseAccountPagingPage( + resourceGroupName, + testBaseAccountName, + options + )) { + yield* page; + } + } + + /** + * Lists all the packages under a Test Base Account. + * @param resourceGroupName The name of the resource group that contains the resource. + * @param testBaseAccountName The resource name of the Test Base Account. + * @param options The options parameters. + */ + private _listByTestBaseAccount( + resourceGroupName: string, + testBaseAccountName: string, + options?: PackagesListByTestBaseAccountOptionalParams + ): Promise { + return this.client.sendOperationRequest( + { resourceGroupName, testBaseAccountName, options }, + listByTestBaseAccountOperationSpec + ); + } + + /** + * Create or replace (overwrite/recreate, with potential downtime) a Test Base Package. + * @param resourceGroupName The name of the resource group that contains the resource. + * @param testBaseAccountName The resource name of the Test Base Account. + * @param packageName The resource name of the Test Base Package. + * @param parameters Parameters supplied to create a Test Base Package. + * @param options The options parameters. + */ + async beginCreate( + resourceGroupName: string, + testBaseAccountName: string, + packageName: string, + parameters: PackageResource, + options?: PackagesCreateOptionalParams + ): Promise< + PollerLike< + PollOperationState, + PackagesCreateResponse + > + > { + const directSendOperation = async ( + args: coreClient.OperationArguments, + spec: coreClient.OperationSpec + ): Promise => { + return this.client.sendOperationRequest(args, spec); + }; + const sendOperation = async ( + args: coreClient.OperationArguments, + spec: coreClient.OperationSpec + ) => { + let currentRawResponse: + | coreClient.FullOperationResponse + | undefined = undefined; + const providedCallback = args.options?.onResponse; + const callback: coreClient.RawResponseCallback = ( + rawResponse: coreClient.FullOperationResponse, + flatResponse: unknown + ) => { + currentRawResponse = rawResponse; + providedCallback?.(rawResponse, flatResponse); + }; + const updatedArgs = { + ...args, + options: { + ...args.options, + onResponse: callback + } + }; + const flatResponse = await directSendOperation(updatedArgs, spec); + return { + flatResponse, + rawResponse: { + statusCode: currentRawResponse!.status, + body: currentRawResponse!.parsedBody, + headers: currentRawResponse!.headers.toJSON() + } + }; + }; + + const lro = new LroImpl( + sendOperation, + { + resourceGroupName, + testBaseAccountName, + packageName, + parameters, + options + }, + createOperationSpec + ); + const poller = new LroEngine(lro, { + resumeFrom: options?.resumeFrom, + intervalInMs: options?.updateIntervalInMs, + lroResourceLocationConfig: "azure-async-operation" + }); + await poller.poll(); + return poller; + } + + /** + * Create or replace (overwrite/recreate, with potential downtime) a Test Base Package. + * @param resourceGroupName The name of the resource group that contains the resource. + * @param testBaseAccountName The resource name of the Test Base Account. + * @param packageName The resource name of the Test Base Package. + * @param parameters Parameters supplied to create a Test Base Package. + * @param options The options parameters. + */ + async beginCreateAndWait( + resourceGroupName: string, + testBaseAccountName: string, + packageName: string, + parameters: PackageResource, + options?: PackagesCreateOptionalParams + ): Promise { + const poller = await this.beginCreate( + resourceGroupName, + testBaseAccountName, + packageName, + parameters, + options + ); + return poller.pollUntilDone(); + } + + /** + * Update an existing Test Base Package. + * @param resourceGroupName The name of the resource group that contains the resource. + * @param testBaseAccountName The resource name of the Test Base Account. + * @param packageName The resource name of the Test Base Package. + * @param parameters Parameters supplied to update a Test Base Package. + * @param options The options parameters. + */ + async beginUpdate( + resourceGroupName: string, + testBaseAccountName: string, + packageName: string, + parameters: PackageUpdateParameters, + options?: PackagesUpdateOptionalParams + ): Promise< + PollerLike< + PollOperationState, + PackagesUpdateResponse + > + > { + const directSendOperation = async ( + args: coreClient.OperationArguments, + spec: coreClient.OperationSpec + ): Promise => { + return this.client.sendOperationRequest(args, spec); + }; + const sendOperation = async ( + args: coreClient.OperationArguments, + spec: coreClient.OperationSpec + ) => { + let currentRawResponse: + | coreClient.FullOperationResponse + | undefined = undefined; + const providedCallback = args.options?.onResponse; + const callback: coreClient.RawResponseCallback = ( + rawResponse: coreClient.FullOperationResponse, + flatResponse: unknown + ) => { + currentRawResponse = rawResponse; + providedCallback?.(rawResponse, flatResponse); + }; + const updatedArgs = { + ...args, + options: { + ...args.options, + onResponse: callback + } + }; + const flatResponse = await directSendOperation(updatedArgs, spec); + return { + flatResponse, + rawResponse: { + statusCode: currentRawResponse!.status, + body: currentRawResponse!.parsedBody, + headers: currentRawResponse!.headers.toJSON() + } + }; + }; + + const lro = new LroImpl( + sendOperation, + { + resourceGroupName, + testBaseAccountName, + packageName, + parameters, + options + }, + updateOperationSpec + ); + const poller = new LroEngine(lro, { + resumeFrom: options?.resumeFrom, + intervalInMs: options?.updateIntervalInMs, + lroResourceLocationConfig: "azure-async-operation" + }); + await poller.poll(); + return poller; + } + + /** + * Update an existing Test Base Package. + * @param resourceGroupName The name of the resource group that contains the resource. + * @param testBaseAccountName The resource name of the Test Base Account. + * @param packageName The resource name of the Test Base Package. + * @param parameters Parameters supplied to update a Test Base Package. + * @param options The options parameters. + */ + async beginUpdateAndWait( + resourceGroupName: string, + testBaseAccountName: string, + packageName: string, + parameters: PackageUpdateParameters, + options?: PackagesUpdateOptionalParams + ): Promise { + const poller = await this.beginUpdate( + resourceGroupName, + testBaseAccountName, + packageName, + parameters, + options + ); + return poller.pollUntilDone(); + } + + /** + * Deletes a Test Base Package. + * @param resourceGroupName The name of the resource group that contains the resource. + * @param testBaseAccountName The resource name of the Test Base Account. + * @param packageName The resource name of the Test Base Package. + * @param options The options parameters. + */ + async beginDelete( + resourceGroupName: string, + testBaseAccountName: string, + packageName: string, + options?: PackagesDeleteOptionalParams + ): Promise, void>> { + const directSendOperation = async ( + args: coreClient.OperationArguments, + spec: coreClient.OperationSpec + ): Promise => { + return this.client.sendOperationRequest(args, spec); + }; + const sendOperation = async ( + args: coreClient.OperationArguments, + spec: coreClient.OperationSpec + ) => { + let currentRawResponse: + | coreClient.FullOperationResponse + | undefined = undefined; + const providedCallback = args.options?.onResponse; + const callback: coreClient.RawResponseCallback = ( + rawResponse: coreClient.FullOperationResponse, + flatResponse: unknown + ) => { + currentRawResponse = rawResponse; + providedCallback?.(rawResponse, flatResponse); + }; + const updatedArgs = { + ...args, + options: { + ...args.options, + onResponse: callback + } + }; + const flatResponse = await directSendOperation(updatedArgs, spec); + return { + flatResponse, + rawResponse: { + statusCode: currentRawResponse!.status, + body: currentRawResponse!.parsedBody, + headers: currentRawResponse!.headers.toJSON() + } + }; + }; + + const lro = new LroImpl( + sendOperation, + { resourceGroupName, testBaseAccountName, packageName, options }, + deleteOperationSpec + ); + const poller = new LroEngine(lro, { + resumeFrom: options?.resumeFrom, + intervalInMs: options?.updateIntervalInMs, + lroResourceLocationConfig: "azure-async-operation" + }); + await poller.poll(); + return poller; + } + + /** + * Deletes a Test Base Package. + * @param resourceGroupName The name of the resource group that contains the resource. + * @param testBaseAccountName The resource name of the Test Base Account. + * @param packageName The resource name of the Test Base Package. + * @param options The options parameters. + */ + async beginDeleteAndWait( + resourceGroupName: string, + testBaseAccountName: string, + packageName: string, + options?: PackagesDeleteOptionalParams + ): Promise { + const poller = await this.beginDelete( + resourceGroupName, + testBaseAccountName, + packageName, + options + ); + return poller.pollUntilDone(); + } + + /** + * Gets a Test Base Package. + * @param resourceGroupName The name of the resource group that contains the resource. + * @param testBaseAccountName The resource name of the Test Base Account. + * @param packageName The resource name of the Test Base Package. + * @param options The options parameters. + */ + get( + resourceGroupName: string, + testBaseAccountName: string, + packageName: string, + options?: PackagesGetOptionalParams + ): Promise { + return this.client.sendOperationRequest( + { resourceGroupName, testBaseAccountName, packageName, options }, + getOperationSpec + ); + } + + /** + * Hard Delete a Test Base Package. + * @param resourceGroupName The name of the resource group that contains the resource. + * @param testBaseAccountName The resource name of the Test Base Account. + * @param packageName The resource name of the Test Base Package. + * @param options The options parameters. + */ + async beginHardDelete( + resourceGroupName: string, + testBaseAccountName: string, + packageName: string, + options?: PackagesHardDeleteOptionalParams + ): Promise, void>> { + const directSendOperation = async ( + args: coreClient.OperationArguments, + spec: coreClient.OperationSpec + ): Promise => { + return this.client.sendOperationRequest(args, spec); + }; + const sendOperation = async ( + args: coreClient.OperationArguments, + spec: coreClient.OperationSpec + ) => { + let currentRawResponse: + | coreClient.FullOperationResponse + | undefined = undefined; + const providedCallback = args.options?.onResponse; + const callback: coreClient.RawResponseCallback = ( + rawResponse: coreClient.FullOperationResponse, + flatResponse: unknown + ) => { + currentRawResponse = rawResponse; + providedCallback?.(rawResponse, flatResponse); + }; + const updatedArgs = { + ...args, + options: { + ...args.options, + onResponse: callback + } + }; + const flatResponse = await directSendOperation(updatedArgs, spec); + return { + flatResponse, + rawResponse: { + statusCode: currentRawResponse!.status, + body: currentRawResponse!.parsedBody, + headers: currentRawResponse!.headers.toJSON() + } + }; + }; + + const lro = new LroImpl( + sendOperation, + { resourceGroupName, testBaseAccountName, packageName, options }, + hardDeleteOperationSpec + ); + const poller = new LroEngine(lro, { + resumeFrom: options?.resumeFrom, + intervalInMs: options?.updateIntervalInMs, + lroResourceLocationConfig: "azure-async-operation" + }); + await poller.poll(); + return poller; + } + + /** + * Hard Delete a Test Base Package. + * @param resourceGroupName The name of the resource group that contains the resource. + * @param testBaseAccountName The resource name of the Test Base Account. + * @param packageName The resource name of the Test Base Package. + * @param options The options parameters. + */ + async beginHardDeleteAndWait( + resourceGroupName: string, + testBaseAccountName: string, + packageName: string, + options?: PackagesHardDeleteOptionalParams + ): Promise { + const poller = await this.beginHardDelete( + resourceGroupName, + testBaseAccountName, + packageName, + options + ); + return poller.pollUntilDone(); + } + + /** + * Gets the download URL of a package. + * @param resourceGroupName The name of the resource group that contains the resource. + * @param testBaseAccountName The resource name of the Test Base Account. + * @param packageName The resource name of the Test Base Package. + * @param options The options parameters. + */ + getDownloadURL( + resourceGroupName: string, + testBaseAccountName: string, + packageName: string, + options?: PackagesGetDownloadURLOptionalParams + ): Promise { + return this.client.sendOperationRequest( + { resourceGroupName, testBaseAccountName, packageName, options }, + getDownloadURLOperationSpec + ); + } + + /** + * Trigger a test run on the package. + * @param resourceGroupName The name of the resource group that contains the resource. + * @param testBaseAccountName The resource name of the Test Base Account. + * @param packageName The resource name of the Test Base Package. + * @param options The options parameters. + */ + runTest( + resourceGroupName: string, + testBaseAccountName: string, + packageName: string, + options?: PackagesRunTestOptionalParams + ): Promise { + return this.client.sendOperationRequest( + { resourceGroupName, testBaseAccountName, packageName, options }, + runTestOperationSpec + ); + } + + /** + * ListByTestBaseAccountNext + * @param resourceGroupName The name of the resource group that contains the resource. + * @param testBaseAccountName The resource name of the Test Base Account. + * @param nextLink The nextLink from the previous successful call to the ListByTestBaseAccount method. + * @param options The options parameters. + */ + private _listByTestBaseAccountNext( + resourceGroupName: string, + testBaseAccountName: string, + nextLink: string, + options?: PackagesListByTestBaseAccountNextOptionalParams + ): Promise { + return this.client.sendOperationRequest( + { resourceGroupName, testBaseAccountName, nextLink, options }, + listByTestBaseAccountNextOperationSpec + ); + } +} +// Operation Specifications +const serializer = coreClient.createSerializer(Mappers, /* isXml */ false); + +const listByTestBaseAccountOperationSpec: coreClient.OperationSpec = { + path: + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.TestBase/testBaseAccounts/{testBaseAccountName}/packages", + httpMethod: "GET", + responses: { + 200: { + bodyMapper: Mappers.PackageListResult + }, + default: { + bodyMapper: Mappers.ErrorResponse + } + }, + queryParameters: [Parameters.apiVersion], + urlParameters: [ + Parameters.$host, + Parameters.subscriptionId, + Parameters.resourceGroupName, + Parameters.testBaseAccountName + ], + headerParameters: [Parameters.accept], + serializer +}; +const createOperationSpec: coreClient.OperationSpec = { + path: + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.TestBase/testBaseAccounts/{testBaseAccountName}/packages/{packageName}", + httpMethod: "PUT", + responses: { + 200: { + bodyMapper: Mappers.PackageResource + }, + 201: { + bodyMapper: Mappers.PackageResource + }, + 202: { + bodyMapper: Mappers.PackageResource + }, + 204: { + bodyMapper: Mappers.PackageResource + }, + default: { + bodyMapper: Mappers.ErrorResponse + } + }, + requestBody: Parameters.parameters4, + queryParameters: [Parameters.apiVersion], + urlParameters: [ + Parameters.$host, + Parameters.subscriptionId, + Parameters.resourceGroupName, + Parameters.testBaseAccountName, + Parameters.packageName + ], + headerParameters: [Parameters.accept, Parameters.contentType], + mediaType: "json", + serializer +}; +const updateOperationSpec: coreClient.OperationSpec = { + path: + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.TestBase/testBaseAccounts/{testBaseAccountName}/packages/{packageName}", + httpMethod: "PATCH", + responses: { + 200: { + bodyMapper: Mappers.PackageResource + }, + 201: { + bodyMapper: Mappers.PackageResource + }, + 202: { + bodyMapper: Mappers.PackageResource + }, + 204: { + bodyMapper: Mappers.PackageResource + }, + default: { + bodyMapper: Mappers.ErrorResponse + } + }, + requestBody: Parameters.parameters5, + queryParameters: [Parameters.apiVersion], + urlParameters: [ + Parameters.$host, + Parameters.subscriptionId, + Parameters.resourceGroupName, + Parameters.testBaseAccountName, + Parameters.packageName + ], + headerParameters: [Parameters.accept, Parameters.contentType], + mediaType: "json", + serializer +}; +const deleteOperationSpec: coreClient.OperationSpec = { + path: + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.TestBase/testBaseAccounts/{testBaseAccountName}/packages/{packageName}", + httpMethod: "DELETE", + responses: { + 200: {}, + 201: {}, + 202: {}, + 204: {}, + default: { + bodyMapper: Mappers.ErrorResponse + } + }, + queryParameters: [Parameters.apiVersion], + urlParameters: [ + Parameters.$host, + Parameters.subscriptionId, + Parameters.resourceGroupName, + Parameters.testBaseAccountName, + Parameters.packageName + ], + headerParameters: [Parameters.accept], + serializer +}; +const getOperationSpec: coreClient.OperationSpec = { + path: + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.TestBase/testBaseAccounts/{testBaseAccountName}/packages/{packageName}", + httpMethod: "GET", + responses: { + 200: { + bodyMapper: Mappers.PackageResource + }, + default: { + bodyMapper: Mappers.ErrorResponse + } + }, + queryParameters: [Parameters.apiVersion], + urlParameters: [ + Parameters.$host, + Parameters.subscriptionId, + Parameters.resourceGroupName, + Parameters.testBaseAccountName, + Parameters.packageName + ], + headerParameters: [Parameters.accept], + serializer +}; +const hardDeleteOperationSpec: coreClient.OperationSpec = { + path: + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.TestBase/testBaseAccounts/{testBaseAccountName}/packages/{packageName}/hardDelete", + httpMethod: "POST", + responses: { + 200: {}, + 201: {}, + 202: {}, + 204: {}, + default: { + bodyMapper: Mappers.ErrorResponse + } + }, + queryParameters: [Parameters.apiVersion], + urlParameters: [ + Parameters.$host, + Parameters.subscriptionId, + Parameters.resourceGroupName, + Parameters.testBaseAccountName, + Parameters.packageName + ], + headerParameters: [Parameters.accept], + serializer +}; +const getDownloadURLOperationSpec: coreClient.OperationSpec = { + path: + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.TestBase/testBaseAccounts/{testBaseAccountName}/packages/{packageName}/getDownloadUrl", + httpMethod: "POST", + responses: { + 200: { + bodyMapper: Mappers.DownloadURLResponse + }, + default: { + bodyMapper: Mappers.ErrorResponse + } + }, + queryParameters: [Parameters.apiVersion], + urlParameters: [ + Parameters.$host, + Parameters.subscriptionId, + Parameters.resourceGroupName, + Parameters.testBaseAccountName, + Parameters.packageName + ], + headerParameters: [Parameters.accept], + serializer +}; +const runTestOperationSpec: coreClient.OperationSpec = { + path: + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.TestBase/testBaseAccounts/{testBaseAccountName}/packages/{packageName}/runTest", + httpMethod: "POST", + responses: { + 200: {}, + 202: { + headersMapper: Mappers.PackagesRunTestHeaders + }, + 204: {}, + default: { + bodyMapper: Mappers.ErrorResponse + } + }, + requestBody: Parameters.parameters6, + queryParameters: [Parameters.apiVersion], + urlParameters: [ + Parameters.$host, + Parameters.subscriptionId, + Parameters.resourceGroupName, + Parameters.testBaseAccountName, + Parameters.packageName + ], + headerParameters: [Parameters.accept, Parameters.contentType], + mediaType: "json", + serializer +}; +const listByTestBaseAccountNextOperationSpec: coreClient.OperationSpec = { + path: "{nextLink}", + httpMethod: "GET", + responses: { + 200: { + bodyMapper: Mappers.PackageListResult + }, + default: { + bodyMapper: Mappers.ErrorResponse + } + }, + queryParameters: [Parameters.apiVersion], + urlParameters: [ + Parameters.$host, + Parameters.subscriptionId, + Parameters.nextLink, + Parameters.resourceGroupName, + Parameters.testBaseAccountName + ], + headerParameters: [Parameters.accept], + serializer +}; diff --git a/sdk/testbase/arm-testbase/src/operations/skus.ts b/sdk/testbase/arm-testbase/src/operations/skus.ts new file mode 100644 index 000000000000..5f67133c89bb --- /dev/null +++ b/sdk/testbase/arm-testbase/src/operations/skus.ts @@ -0,0 +1,139 @@ +/* + * 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 { Skus } from "../operationsInterfaces"; +import * as coreClient from "@azure/core-client"; +import * as Mappers from "../models/mappers"; +import * as Parameters from "../models/parameters"; +import { TestBase } from "../testBase"; +import { + TestBaseAccountSKU, + SkusListNextOptionalParams, + SkusListOptionalParams, + SkusListResponse, + SkusListNextResponse +} from "../models"; + +/// +/** Class containing Skus operations. */ +export class SkusImpl implements Skus { + private readonly client: TestBase; + + /** + * Initialize a new instance of the class Skus class. + * @param client Reference to the service client + */ + constructor(client: TestBase) { + this.client = client; + } + + /** + * Lists the available SKUs of Test Base Account in a subscription. + * @param options The options parameters. + */ + public list( + options?: SkusListOptionalParams + ): PagedAsyncIterableIterator { + const iter = this.listPagingAll(options); + return { + next() { + return iter.next(); + }, + [Symbol.asyncIterator]() { + return this; + }, + byPage: () => { + return this.listPagingPage(options); + } + }; + } + + private async *listPagingPage( + options?: SkusListOptionalParams + ): AsyncIterableIterator { + let result = await this._list(options); + yield result.value || []; + let continuationToken = result.nextLink; + while (continuationToken) { + result = await this._listNext(continuationToken, options); + continuationToken = result.nextLink; + yield result.value || []; + } + } + + private async *listPagingAll( + options?: SkusListOptionalParams + ): AsyncIterableIterator { + for await (const page of this.listPagingPage(options)) { + yield* page; + } + } + + /** + * Lists the available SKUs of Test Base Account in a subscription. + * @param options The options parameters. + */ + private _list(options?: SkusListOptionalParams): Promise { + return this.client.sendOperationRequest({ options }, listOperationSpec); + } + + /** + * ListNext + * @param nextLink The nextLink from the previous successful call to the List method. + * @param options The options parameters. + */ + private _listNext( + nextLink: string, + options?: SkusListNextOptionalParams + ): Promise { + return this.client.sendOperationRequest( + { nextLink, options }, + listNextOperationSpec + ); + } +} +// Operation Specifications +const serializer = coreClient.createSerializer(Mappers, /* isXml */ false); + +const listOperationSpec: coreClient.OperationSpec = { + path: "/subscriptions/{subscriptionId}/providers/Microsoft.TestBase/skus", + httpMethod: "GET", + responses: { + 200: { + bodyMapper: Mappers.TestBaseAccountSKUListResult + }, + default: { + bodyMapper: Mappers.ErrorResponse + } + }, + queryParameters: [Parameters.apiVersion], + urlParameters: [Parameters.$host, Parameters.subscriptionId], + headerParameters: [Parameters.accept], + serializer +}; +const listNextOperationSpec: coreClient.OperationSpec = { + path: "{nextLink}", + httpMethod: "GET", + responses: { + 200: { + bodyMapper: Mappers.TestBaseAccountSKUListResult + }, + default: { + bodyMapper: Mappers.ErrorResponse + } + }, + queryParameters: [Parameters.apiVersion], + urlParameters: [ + Parameters.$host, + Parameters.subscriptionId, + Parameters.nextLink + ], + headerParameters: [Parameters.accept], + serializer +}; diff --git a/sdk/testbase/arm-testbase/src/operations/testBaseAccounts.ts b/sdk/testbase/arm-testbase/src/operations/testBaseAccounts.ts new file mode 100644 index 000000000000..40ecaec2fad5 --- /dev/null +++ b/sdk/testbase/arm-testbase/src/operations/testBaseAccounts.ts @@ -0,0 +1,881 @@ +/* + * 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 { TestBaseAccounts } from "../operationsInterfaces"; +import * as coreClient from "@azure/core-client"; +import * as Mappers from "../models/mappers"; +import * as Parameters from "../models/parameters"; +import { TestBase } from "../testBase"; +import { PollerLike, PollOperationState, LroEngine } from "@azure/core-lro"; +import { LroImpl } from "../lroImpl"; +import { + TestBaseAccountResource, + TestBaseAccountsListBySubscriptionNextOptionalParams, + TestBaseAccountsListBySubscriptionOptionalParams, + TestBaseAccountsListByResourceGroupNextOptionalParams, + TestBaseAccountsListByResourceGroupOptionalParams, + TestBaseAccountsListBySubscriptionResponse, + TestBaseAccountsListByResourceGroupResponse, + TestBaseAccountsCreateOptionalParams, + TestBaseAccountsCreateResponse, + TestBaseAccountUpdateParameters, + TestBaseAccountsUpdateOptionalParams, + TestBaseAccountsUpdateResponse, + TestBaseAccountsDeleteOptionalParams, + TestBaseAccountsGetOptionalParams, + TestBaseAccountsGetResponse, + TestBaseAccountsOffboardOptionalParams, + TestBaseAccountsGetFileUploadUrlOptionalParams, + TestBaseAccountsGetFileUploadUrlResponse, + PackageCheckNameAvailabilityParameters, + TestBaseAccountsCheckPackageNameAvailabilityOptionalParams, + TestBaseAccountsCheckPackageNameAvailabilityResponse, + TestBaseAccountsListBySubscriptionNextResponse, + TestBaseAccountsListByResourceGroupNextResponse +} from "../models"; + +/// +/** Class containing TestBaseAccounts operations. */ +export class TestBaseAccountsImpl implements TestBaseAccounts { + private readonly client: TestBase; + + /** + * Initialize a new instance of the class TestBaseAccounts class. + * @param client Reference to the service client + */ + constructor(client: TestBase) { + this.client = client; + } + + /** + * Lists all the Test Base Accounts in a subscription. This API is required by ARM guidelines. + * @param options The options parameters. + */ + public listBySubscription( + options?: TestBaseAccountsListBySubscriptionOptionalParams + ): PagedAsyncIterableIterator { + const iter = this.listBySubscriptionPagingAll(options); + return { + next() { + return iter.next(); + }, + [Symbol.asyncIterator]() { + return this; + }, + byPage: () => { + return this.listBySubscriptionPagingPage(options); + } + }; + } + + private async *listBySubscriptionPagingPage( + options?: TestBaseAccountsListBySubscriptionOptionalParams + ): AsyncIterableIterator { + let result = await this._listBySubscription(options); + yield result.value || []; + let continuationToken = result.nextLink; + while (continuationToken) { + result = await this._listBySubscriptionNext(continuationToken, options); + continuationToken = result.nextLink; + yield result.value || []; + } + } + + private async *listBySubscriptionPagingAll( + options?: TestBaseAccountsListBySubscriptionOptionalParams + ): AsyncIterableIterator { + for await (const page of this.listBySubscriptionPagingPage(options)) { + yield* page; + } + } + + /** + * Lists all the Test Base Accounts in a resource group. + * @param resourceGroupName The name of the resource group that contains the resource. + * @param options The options parameters. + */ + public listByResourceGroup( + resourceGroupName: string, + options?: TestBaseAccountsListByResourceGroupOptionalParams + ): PagedAsyncIterableIterator { + const iter = this.listByResourceGroupPagingAll(resourceGroupName, options); + return { + next() { + return iter.next(); + }, + [Symbol.asyncIterator]() { + return this; + }, + byPage: () => { + return this.listByResourceGroupPagingPage(resourceGroupName, options); + } + }; + } + + private async *listByResourceGroupPagingPage( + resourceGroupName: string, + options?: TestBaseAccountsListByResourceGroupOptionalParams + ): AsyncIterableIterator { + let result = await this._listByResourceGroup(resourceGroupName, options); + yield result.value || []; + let continuationToken = result.nextLink; + while (continuationToken) { + result = await this._listByResourceGroupNext( + resourceGroupName, + continuationToken, + options + ); + continuationToken = result.nextLink; + yield result.value || []; + } + } + + private async *listByResourceGroupPagingAll( + resourceGroupName: string, + options?: TestBaseAccountsListByResourceGroupOptionalParams + ): AsyncIterableIterator { + for await (const page of this.listByResourceGroupPagingPage( + resourceGroupName, + options + )) { + yield* page; + } + } + + /** + * Lists all the Test Base Accounts in a subscription. This API is required by ARM guidelines. + * @param options The options parameters. + */ + private _listBySubscription( + options?: TestBaseAccountsListBySubscriptionOptionalParams + ): Promise { + return this.client.sendOperationRequest( + { options }, + listBySubscriptionOperationSpec + ); + } + + /** + * Lists all the Test Base Accounts in a resource group. + * @param resourceGroupName The name of the resource group that contains the resource. + * @param options The options parameters. + */ + private _listByResourceGroup( + resourceGroupName: string, + options?: TestBaseAccountsListByResourceGroupOptionalParams + ): Promise { + return this.client.sendOperationRequest( + { resourceGroupName, options }, + listByResourceGroupOperationSpec + ); + } + + /** + * Create or replace (overwrite/recreate, with potential downtime) a Test Base Account in the specified + * subscription. + * @param resourceGroupName The name of the resource group that contains the resource. + * @param testBaseAccountName The resource name of the Test Base Account. + * @param parameters Parameters supplied to create a Test Base Account. + * @param options The options parameters. + */ + async beginCreate( + resourceGroupName: string, + testBaseAccountName: string, + parameters: TestBaseAccountResource, + options?: TestBaseAccountsCreateOptionalParams + ): Promise< + PollerLike< + PollOperationState, + TestBaseAccountsCreateResponse + > + > { + const directSendOperation = async ( + args: coreClient.OperationArguments, + spec: coreClient.OperationSpec + ): Promise => { + return this.client.sendOperationRequest(args, spec); + }; + const sendOperation = async ( + args: coreClient.OperationArguments, + spec: coreClient.OperationSpec + ) => { + let currentRawResponse: + | coreClient.FullOperationResponse + | undefined = undefined; + const providedCallback = args.options?.onResponse; + const callback: coreClient.RawResponseCallback = ( + rawResponse: coreClient.FullOperationResponse, + flatResponse: unknown + ) => { + currentRawResponse = rawResponse; + providedCallback?.(rawResponse, flatResponse); + }; + const updatedArgs = { + ...args, + options: { + ...args.options, + onResponse: callback + } + }; + const flatResponse = await directSendOperation(updatedArgs, spec); + return { + flatResponse, + rawResponse: { + statusCode: currentRawResponse!.status, + body: currentRawResponse!.parsedBody, + headers: currentRawResponse!.headers.toJSON() + } + }; + }; + + const lro = new LroImpl( + sendOperation, + { resourceGroupName, testBaseAccountName, parameters, options }, + createOperationSpec + ); + const poller = new LroEngine(lro, { + resumeFrom: options?.resumeFrom, + intervalInMs: options?.updateIntervalInMs, + lroResourceLocationConfig: "azure-async-operation" + }); + await poller.poll(); + return poller; + } + + /** + * Create or replace (overwrite/recreate, with potential downtime) a Test Base Account in the specified + * subscription. + * @param resourceGroupName The name of the resource group that contains the resource. + * @param testBaseAccountName The resource name of the Test Base Account. + * @param parameters Parameters supplied to create a Test Base Account. + * @param options The options parameters. + */ + async beginCreateAndWait( + resourceGroupName: string, + testBaseAccountName: string, + parameters: TestBaseAccountResource, + options?: TestBaseAccountsCreateOptionalParams + ): Promise { + const poller = await this.beginCreate( + resourceGroupName, + testBaseAccountName, + parameters, + options + ); + return poller.pollUntilDone(); + } + + /** + * Update an existing Test Base Account. + * @param resourceGroupName The name of the resource group that contains the resource. + * @param testBaseAccountName The resource name of the Test Base Account. + * @param parameters Parameters supplied to update a Test Base Account. + * @param options The options parameters. + */ + async beginUpdate( + resourceGroupName: string, + testBaseAccountName: string, + parameters: TestBaseAccountUpdateParameters, + options?: TestBaseAccountsUpdateOptionalParams + ): Promise< + PollerLike< + PollOperationState, + TestBaseAccountsUpdateResponse + > + > { + const directSendOperation = async ( + args: coreClient.OperationArguments, + spec: coreClient.OperationSpec + ): Promise => { + return this.client.sendOperationRequest(args, spec); + }; + const sendOperation = async ( + args: coreClient.OperationArguments, + spec: coreClient.OperationSpec + ) => { + let currentRawResponse: + | coreClient.FullOperationResponse + | undefined = undefined; + const providedCallback = args.options?.onResponse; + const callback: coreClient.RawResponseCallback = ( + rawResponse: coreClient.FullOperationResponse, + flatResponse: unknown + ) => { + currentRawResponse = rawResponse; + providedCallback?.(rawResponse, flatResponse); + }; + const updatedArgs = { + ...args, + options: { + ...args.options, + onResponse: callback + } + }; + const flatResponse = await directSendOperation(updatedArgs, spec); + return { + flatResponse, + rawResponse: { + statusCode: currentRawResponse!.status, + body: currentRawResponse!.parsedBody, + headers: currentRawResponse!.headers.toJSON() + } + }; + }; + + const lro = new LroImpl( + sendOperation, + { resourceGroupName, testBaseAccountName, parameters, options }, + updateOperationSpec + ); + const poller = new LroEngine(lro, { + resumeFrom: options?.resumeFrom, + intervalInMs: options?.updateIntervalInMs, + lroResourceLocationConfig: "azure-async-operation" + }); + await poller.poll(); + return poller; + } + + /** + * Update an existing Test Base Account. + * @param resourceGroupName The name of the resource group that contains the resource. + * @param testBaseAccountName The resource name of the Test Base Account. + * @param parameters Parameters supplied to update a Test Base Account. + * @param options The options parameters. + */ + async beginUpdateAndWait( + resourceGroupName: string, + testBaseAccountName: string, + parameters: TestBaseAccountUpdateParameters, + options?: TestBaseAccountsUpdateOptionalParams + ): Promise { + const poller = await this.beginUpdate( + resourceGroupName, + testBaseAccountName, + parameters, + options + ); + return poller.pollUntilDone(); + } + + /** + * Deletes a Test Base Account. + * @param resourceGroupName The name of the resource group that contains the resource. + * @param testBaseAccountName The resource name of the Test Base Account. + * @param options The options parameters. + */ + async beginDelete( + resourceGroupName: string, + testBaseAccountName: string, + options?: TestBaseAccountsDeleteOptionalParams + ): Promise, void>> { + const directSendOperation = async ( + args: coreClient.OperationArguments, + spec: coreClient.OperationSpec + ): Promise => { + return this.client.sendOperationRequest(args, spec); + }; + const sendOperation = async ( + args: coreClient.OperationArguments, + spec: coreClient.OperationSpec + ) => { + let currentRawResponse: + | coreClient.FullOperationResponse + | undefined = undefined; + const providedCallback = args.options?.onResponse; + const callback: coreClient.RawResponseCallback = ( + rawResponse: coreClient.FullOperationResponse, + flatResponse: unknown + ) => { + currentRawResponse = rawResponse; + providedCallback?.(rawResponse, flatResponse); + }; + const updatedArgs = { + ...args, + options: { + ...args.options, + onResponse: callback + } + }; + const flatResponse = await directSendOperation(updatedArgs, spec); + return { + flatResponse, + rawResponse: { + statusCode: currentRawResponse!.status, + body: currentRawResponse!.parsedBody, + headers: currentRawResponse!.headers.toJSON() + } + }; + }; + + const lro = new LroImpl( + sendOperation, + { resourceGroupName, testBaseAccountName, options }, + deleteOperationSpec + ); + const poller = new LroEngine(lro, { + resumeFrom: options?.resumeFrom, + intervalInMs: options?.updateIntervalInMs, + lroResourceLocationConfig: "azure-async-operation" + }); + await poller.poll(); + return poller; + } + + /** + * Deletes a Test Base Account. + * @param resourceGroupName The name of the resource group that contains the resource. + * @param testBaseAccountName The resource name of the Test Base Account. + * @param options The options parameters. + */ + async beginDeleteAndWait( + resourceGroupName: string, + testBaseAccountName: string, + options?: TestBaseAccountsDeleteOptionalParams + ): Promise { + const poller = await this.beginDelete( + resourceGroupName, + testBaseAccountName, + options + ); + return poller.pollUntilDone(); + } + + /** + * Gets a Test Base Account. + * @param resourceGroupName The name of the resource group that contains the resource. + * @param testBaseAccountName The resource name of the Test Base Account. + * @param options The options parameters. + */ + get( + resourceGroupName: string, + testBaseAccountName: string, + options?: TestBaseAccountsGetOptionalParams + ): Promise { + return this.client.sendOperationRequest( + { resourceGroupName, testBaseAccountName, options }, + getOperationSpec + ); + } + + /** + * Offboard a Test Base Account. + * @param resourceGroupName The name of the resource group that contains the resource. + * @param testBaseAccountName The resource name of the Test Base Account. + * @param options The options parameters. + */ + async beginOffboard( + resourceGroupName: string, + testBaseAccountName: string, + options?: TestBaseAccountsOffboardOptionalParams + ): Promise, void>> { + const directSendOperation = async ( + args: coreClient.OperationArguments, + spec: coreClient.OperationSpec + ): Promise => { + return this.client.sendOperationRequest(args, spec); + }; + const sendOperation = async ( + args: coreClient.OperationArguments, + spec: coreClient.OperationSpec + ) => { + let currentRawResponse: + | coreClient.FullOperationResponse + | undefined = undefined; + const providedCallback = args.options?.onResponse; + const callback: coreClient.RawResponseCallback = ( + rawResponse: coreClient.FullOperationResponse, + flatResponse: unknown + ) => { + currentRawResponse = rawResponse; + providedCallback?.(rawResponse, flatResponse); + }; + const updatedArgs = { + ...args, + options: { + ...args.options, + onResponse: callback + } + }; + const flatResponse = await directSendOperation(updatedArgs, spec); + return { + flatResponse, + rawResponse: { + statusCode: currentRawResponse!.status, + body: currentRawResponse!.parsedBody, + headers: currentRawResponse!.headers.toJSON() + } + }; + }; + + const lro = new LroImpl( + sendOperation, + { resourceGroupName, testBaseAccountName, options }, + offboardOperationSpec + ); + const poller = new LroEngine(lro, { + resumeFrom: options?.resumeFrom, + intervalInMs: options?.updateIntervalInMs, + lroResourceLocationConfig: "azure-async-operation" + }); + await poller.poll(); + return poller; + } + + /** + * Offboard a Test Base Account. + * @param resourceGroupName The name of the resource group that contains the resource. + * @param testBaseAccountName The resource name of the Test Base Account. + * @param options The options parameters. + */ + async beginOffboardAndWait( + resourceGroupName: string, + testBaseAccountName: string, + options?: TestBaseAccountsOffboardOptionalParams + ): Promise { + const poller = await this.beginOffboard( + resourceGroupName, + testBaseAccountName, + options + ); + return poller.pollUntilDone(); + } + + /** + * Gets the file upload URL of a Test Base Account. + * @param resourceGroupName The name of the resource group that contains the resource. + * @param testBaseAccountName The resource name of the Test Base Account. + * @param options The options parameters. + */ + getFileUploadUrl( + resourceGroupName: string, + testBaseAccountName: string, + options?: TestBaseAccountsGetFileUploadUrlOptionalParams + ): Promise { + return this.client.sendOperationRequest( + { resourceGroupName, testBaseAccountName, options }, + getFileUploadUrlOperationSpec + ); + } + + /** + * Checks that the Test Base Package name and version is valid and is not already in use. + * @param resourceGroupName The name of the resource group that contains the resource. + * @param testBaseAccountName The resource name of the Test Base Account. + * @param parameters Parameters supplied to the Test Base Package CheckNameAvailability operation. + * @param options The options parameters. + */ + checkPackageNameAvailability( + resourceGroupName: string, + testBaseAccountName: string, + parameters: PackageCheckNameAvailabilityParameters, + options?: TestBaseAccountsCheckPackageNameAvailabilityOptionalParams + ): Promise { + return this.client.sendOperationRequest( + { resourceGroupName, testBaseAccountName, parameters, options }, + checkPackageNameAvailabilityOperationSpec + ); + } + + /** + * ListBySubscriptionNext + * @param nextLink The nextLink from the previous successful call to the ListBySubscription method. + * @param options The options parameters. + */ + private _listBySubscriptionNext( + nextLink: string, + options?: TestBaseAccountsListBySubscriptionNextOptionalParams + ): Promise { + return this.client.sendOperationRequest( + { nextLink, options }, + listBySubscriptionNextOperationSpec + ); + } + + /** + * ListByResourceGroupNext + * @param resourceGroupName The name of the resource group that contains the resource. + * @param nextLink The nextLink from the previous successful call to the ListByResourceGroup method. + * @param options The options parameters. + */ + private _listByResourceGroupNext( + resourceGroupName: string, + nextLink: string, + options?: TestBaseAccountsListByResourceGroupNextOptionalParams + ): Promise { + return this.client.sendOperationRequest( + { resourceGroupName, nextLink, options }, + listByResourceGroupNextOperationSpec + ); + } +} +// Operation Specifications +const serializer = coreClient.createSerializer(Mappers, /* isXml */ false); + +const listBySubscriptionOperationSpec: coreClient.OperationSpec = { + path: + "/subscriptions/{subscriptionId}/providers/Microsoft.TestBase/testBaseAccounts", + httpMethod: "GET", + responses: { + 200: { + bodyMapper: Mappers.TestBaseAccountListResult + }, + default: { + bodyMapper: Mappers.ErrorResponse + } + }, + queryParameters: [Parameters.apiVersion, Parameters.getDeleted], + urlParameters: [Parameters.$host, Parameters.subscriptionId], + headerParameters: [Parameters.accept], + serializer +}; +const listByResourceGroupOperationSpec: coreClient.OperationSpec = { + path: + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.TestBase/testBaseAccounts", + httpMethod: "GET", + responses: { + 200: { + bodyMapper: Mappers.TestBaseAccountListResult + }, + default: { + bodyMapper: Mappers.ErrorResponse + } + }, + queryParameters: [Parameters.apiVersion, Parameters.getDeleted], + urlParameters: [ + Parameters.$host, + Parameters.subscriptionId, + Parameters.resourceGroupName + ], + headerParameters: [Parameters.accept], + serializer +}; +const createOperationSpec: coreClient.OperationSpec = { + path: + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.TestBase/testBaseAccounts/{testBaseAccountName}", + httpMethod: "PUT", + responses: { + 200: { + bodyMapper: Mappers.TestBaseAccountResource + }, + 201: { + bodyMapper: Mappers.TestBaseAccountResource + }, + 202: { + bodyMapper: Mappers.TestBaseAccountResource + }, + 204: { + bodyMapper: Mappers.TestBaseAccountResource + }, + default: { + bodyMapper: Mappers.ErrorResponse + } + }, + requestBody: Parameters.parameters, + queryParameters: [Parameters.apiVersion, Parameters.restore], + urlParameters: [ + Parameters.$host, + Parameters.subscriptionId, + Parameters.resourceGroupName, + Parameters.testBaseAccountName + ], + headerParameters: [Parameters.accept, Parameters.contentType], + mediaType: "json", + serializer +}; +const updateOperationSpec: coreClient.OperationSpec = { + path: + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.TestBase/testBaseAccounts/{testBaseAccountName}", + httpMethod: "PATCH", + responses: { + 200: { + bodyMapper: Mappers.TestBaseAccountResource + }, + 201: { + bodyMapper: Mappers.TestBaseAccountResource + }, + 202: { + bodyMapper: Mappers.TestBaseAccountResource + }, + 204: { + bodyMapper: Mappers.TestBaseAccountResource + }, + default: { + bodyMapper: Mappers.ErrorResponse + } + }, + requestBody: Parameters.parameters1, + queryParameters: [Parameters.apiVersion], + urlParameters: [ + Parameters.$host, + Parameters.subscriptionId, + Parameters.resourceGroupName, + Parameters.testBaseAccountName + ], + headerParameters: [Parameters.accept, Parameters.contentType], + mediaType: "json", + serializer +}; +const deleteOperationSpec: coreClient.OperationSpec = { + path: + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.TestBase/testBaseAccounts/{testBaseAccountName}", + httpMethod: "DELETE", + responses: { + 200: {}, + 201: {}, + 202: {}, + 204: {}, + default: { + bodyMapper: Mappers.ErrorResponse + } + }, + queryParameters: [Parameters.apiVersion], + urlParameters: [ + Parameters.$host, + Parameters.subscriptionId, + Parameters.resourceGroupName, + Parameters.testBaseAccountName + ], + headerParameters: [Parameters.accept], + serializer +}; +const getOperationSpec: coreClient.OperationSpec = { + path: + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.TestBase/testBaseAccounts/{testBaseAccountName}", + httpMethod: "GET", + responses: { + 200: { + bodyMapper: Mappers.TestBaseAccountResource + }, + default: { + bodyMapper: Mappers.ErrorResponse + } + }, + queryParameters: [Parameters.apiVersion], + urlParameters: [ + Parameters.$host, + Parameters.subscriptionId, + Parameters.resourceGroupName, + Parameters.testBaseAccountName + ], + headerParameters: [Parameters.accept], + serializer +}; +const offboardOperationSpec: coreClient.OperationSpec = { + path: + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.TestBase/testBaseAccounts/{testBaseAccountName}/offboard", + httpMethod: "POST", + responses: { + 200: {}, + 201: {}, + 202: {}, + 204: {}, + default: { + bodyMapper: Mappers.ErrorResponse + } + }, + queryParameters: [Parameters.apiVersion], + urlParameters: [ + Parameters.$host, + Parameters.subscriptionId, + Parameters.resourceGroupName, + Parameters.testBaseAccountName + ], + headerParameters: [Parameters.accept], + serializer +}; +const getFileUploadUrlOperationSpec: coreClient.OperationSpec = { + path: + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.TestBase/testBaseAccounts/{testBaseAccountName}/getFileUploadUrl", + httpMethod: "POST", + responses: { + 200: { + bodyMapper: Mappers.FileUploadURLResponse + }, + default: { + bodyMapper: Mappers.ErrorResponse + } + }, + requestBody: Parameters.parameters2, + queryParameters: [Parameters.apiVersion], + urlParameters: [ + Parameters.$host, + Parameters.subscriptionId, + Parameters.resourceGroupName, + Parameters.testBaseAccountName + ], + headerParameters: [Parameters.accept, Parameters.contentType], + mediaType: "json", + serializer +}; +const checkPackageNameAvailabilityOperationSpec: coreClient.OperationSpec = { + path: + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.TestBase/testBaseAccounts/{testBaseAccountName}/checkPackageNameAvailability", + httpMethod: "POST", + responses: { + 200: { + bodyMapper: Mappers.CheckNameAvailabilityResult + }, + default: { + bodyMapper: Mappers.ErrorResponse + } + }, + requestBody: Parameters.parameters3, + queryParameters: [Parameters.apiVersion], + urlParameters: [ + Parameters.$host, + Parameters.subscriptionId, + Parameters.resourceGroupName, + Parameters.testBaseAccountName + ], + headerParameters: [Parameters.accept, Parameters.contentType], + mediaType: "json", + serializer +}; +const listBySubscriptionNextOperationSpec: coreClient.OperationSpec = { + path: "{nextLink}", + httpMethod: "GET", + responses: { + 200: { + bodyMapper: Mappers.TestBaseAccountListResult + }, + default: { + bodyMapper: Mappers.ErrorResponse + } + }, + queryParameters: [Parameters.apiVersion, Parameters.getDeleted], + urlParameters: [ + Parameters.$host, + Parameters.subscriptionId, + Parameters.nextLink + ], + headerParameters: [Parameters.accept], + serializer +}; +const listByResourceGroupNextOperationSpec: coreClient.OperationSpec = { + path: "{nextLink}", + httpMethod: "GET", + responses: { + 200: { + bodyMapper: Mappers.TestBaseAccountListResult + }, + default: { + bodyMapper: Mappers.ErrorResponse + } + }, + queryParameters: [Parameters.apiVersion, Parameters.getDeleted], + urlParameters: [ + Parameters.$host, + Parameters.subscriptionId, + Parameters.nextLink, + Parameters.resourceGroupName + ], + headerParameters: [Parameters.accept], + serializer +}; diff --git a/sdk/testbase/arm-testbase/src/operations/testResults.ts b/sdk/testbase/arm-testbase/src/operations/testResults.ts new file mode 100644 index 000000000000..5c8d9d799df9 --- /dev/null +++ b/sdk/testbase/arm-testbase/src/operations/testResults.ts @@ -0,0 +1,459 @@ +/* + * 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 { TestResults } from "../operationsInterfaces"; +import * as coreClient from "@azure/core-client"; +import * as Mappers from "../models/mappers"; +import * as Parameters from "../models/parameters"; +import { TestBase } from "../testBase"; +import { + TestResultResource, + OsUpdateType, + TestResultsListNextOptionalParams, + TestResultsListOptionalParams, + TestResultsListResponse, + TestResultsGetOptionalParams, + TestResultsGetResponse, + TestResultsGetDownloadURLOptionalParams, + TestResultsGetDownloadURLResponse, + TestResultsGetVideoDownloadURLOptionalParams, + TestResultsGetVideoDownloadURLResponse, + TestResultConsoleLogDownloadURLParameters, + TestResultsGetConsoleLogDownloadURLOptionalParams, + TestResultsGetConsoleLogDownloadURLResponse, + TestResultsListNextResponse +} from "../models"; + +/// +/** Class containing TestResults operations. */ +export class TestResultsImpl implements TestResults { + private readonly client: TestBase; + + /** + * Initialize a new instance of the class TestResults class. + * @param client Reference to the service client + */ + constructor(client: TestBase) { + this.client = client; + } + + /** + * Lists all the Test Results with specified OS Update type for a Test Base Package. Can be filtered by + * osName, releaseName, flightingRing, buildVersion, buildRevision. + * @param resourceGroupName The name of the resource group that contains the resource. + * @param testBaseAccountName The resource name of the Test Base Account. + * @param packageName The resource name of the Test Base Package. + * @param osUpdateType The type of the OS Update. + * @param options The options parameters. + */ + public list( + resourceGroupName: string, + testBaseAccountName: string, + packageName: string, + osUpdateType: OsUpdateType, + options?: TestResultsListOptionalParams + ): PagedAsyncIterableIterator { + const iter = this.listPagingAll( + resourceGroupName, + testBaseAccountName, + packageName, + osUpdateType, + options + ); + return { + next() { + return iter.next(); + }, + [Symbol.asyncIterator]() { + return this; + }, + byPage: () => { + return this.listPagingPage( + resourceGroupName, + testBaseAccountName, + packageName, + osUpdateType, + options + ); + } + }; + } + + private async *listPagingPage( + resourceGroupName: string, + testBaseAccountName: string, + packageName: string, + osUpdateType: OsUpdateType, + options?: TestResultsListOptionalParams + ): AsyncIterableIterator { + let result = await this._list( + resourceGroupName, + testBaseAccountName, + packageName, + osUpdateType, + options + ); + yield result.value || []; + let continuationToken = result.nextLink; + while (continuationToken) { + result = await this._listNext( + resourceGroupName, + testBaseAccountName, + packageName, + osUpdateType, + continuationToken, + options + ); + continuationToken = result.nextLink; + yield result.value || []; + } + } + + private async *listPagingAll( + resourceGroupName: string, + testBaseAccountName: string, + packageName: string, + osUpdateType: OsUpdateType, + options?: TestResultsListOptionalParams + ): AsyncIterableIterator { + for await (const page of this.listPagingPage( + resourceGroupName, + testBaseAccountName, + packageName, + osUpdateType, + options + )) { + yield* page; + } + } + + /** + * Lists all the Test Results with specified OS Update type for a Test Base Package. Can be filtered by + * osName, releaseName, flightingRing, buildVersion, buildRevision. + * @param resourceGroupName The name of the resource group that contains the resource. + * @param testBaseAccountName The resource name of the Test Base Account. + * @param packageName The resource name of the Test Base Package. + * @param osUpdateType The type of the OS Update. + * @param options The options parameters. + */ + private _list( + resourceGroupName: string, + testBaseAccountName: string, + packageName: string, + osUpdateType: OsUpdateType, + options?: TestResultsListOptionalParams + ): Promise { + return this.client.sendOperationRequest( + { + resourceGroupName, + testBaseAccountName, + packageName, + osUpdateType, + options + }, + listOperationSpec + ); + } + + /** + * Get the Test Result by Id with specified OS Update type for a Test Base Package. + * @param resourceGroupName The name of the resource group that contains the resource. + * @param testBaseAccountName The resource name of the Test Base Account. + * @param packageName The resource name of the Test Base Package. + * @param testResultName The Test Result Name. It equals to TestResult-{TestResultId} string. + * @param options The options parameters. + */ + get( + resourceGroupName: string, + testBaseAccountName: string, + packageName: string, + testResultName: string, + options?: TestResultsGetOptionalParams + ): Promise { + return this.client.sendOperationRequest( + { + resourceGroupName, + testBaseAccountName, + packageName, + testResultName, + options + }, + getOperationSpec + ); + } + + /** + * Gets the download URL of the test result. + * @param resourceGroupName The name of the resource group that contains the resource. + * @param testBaseAccountName The resource name of the Test Base Account. + * @param packageName The resource name of the Test Base Package. + * @param testResultName The Test Result Name. It equals to TestResult-{TestResultId} string. + * @param options The options parameters. + */ + getDownloadURL( + resourceGroupName: string, + testBaseAccountName: string, + packageName: string, + testResultName: string, + options?: TestResultsGetDownloadURLOptionalParams + ): Promise { + return this.client.sendOperationRequest( + { + resourceGroupName, + testBaseAccountName, + packageName, + testResultName, + options + }, + getDownloadURLOperationSpec + ); + } + + /** + * Gets the download URL of the test execution screen recording. + * @param resourceGroupName The name of the resource group that contains the resource. + * @param testBaseAccountName The resource name of the Test Base Account. + * @param packageName The resource name of the Test Base Package. + * @param testResultName The Test Result Name. It equals to TestResult-{TestResultId} string. + * @param options The options parameters. + */ + getVideoDownloadURL( + resourceGroupName: string, + testBaseAccountName: string, + packageName: string, + testResultName: string, + options?: TestResultsGetVideoDownloadURLOptionalParams + ): Promise { + return this.client.sendOperationRequest( + { + resourceGroupName, + testBaseAccountName, + packageName, + testResultName, + options + }, + getVideoDownloadURLOperationSpec + ); + } + + /** + * Gets the download URL of the test execution console log file. + * @param resourceGroupName The name of the resource group that contains the resource. + * @param testBaseAccountName The resource name of the Test Base Account. + * @param packageName The resource name of the Test Base Package. + * @param testResultName The Test Result Name. It equals to TestResult-{TestResultId} string. + * @param parameters Parameters supplied to the Test Result GetConsoleLogDownloadUrl operation. + * @param options The options parameters. + */ + getConsoleLogDownloadURL( + resourceGroupName: string, + testBaseAccountName: string, + packageName: string, + testResultName: string, + parameters: TestResultConsoleLogDownloadURLParameters, + options?: TestResultsGetConsoleLogDownloadURLOptionalParams + ): Promise { + return this.client.sendOperationRequest( + { + resourceGroupName, + testBaseAccountName, + packageName, + testResultName, + parameters, + options + }, + getConsoleLogDownloadURLOperationSpec + ); + } + + /** + * ListNext + * @param resourceGroupName The name of the resource group that contains the resource. + * @param testBaseAccountName The resource name of the Test Base Account. + * @param packageName The resource name of the Test Base Package. + * @param osUpdateType The type of the OS Update. + * @param nextLink The nextLink from the previous successful call to the List method. + * @param options The options parameters. + */ + private _listNext( + resourceGroupName: string, + testBaseAccountName: string, + packageName: string, + osUpdateType: OsUpdateType, + nextLink: string, + options?: TestResultsListNextOptionalParams + ): Promise { + return this.client.sendOperationRequest( + { + resourceGroupName, + testBaseAccountName, + packageName, + osUpdateType, + nextLink, + options + }, + listNextOperationSpec + ); + } +} +// Operation Specifications +const serializer = coreClient.createSerializer(Mappers, /* isXml */ false); + +const listOperationSpec: coreClient.OperationSpec = { + path: + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.TestBase/testBaseAccounts/{testBaseAccountName}/packages/{packageName}/testResults", + httpMethod: "GET", + responses: { + 200: { + bodyMapper: Mappers.TestResultListResult + }, + default: { + bodyMapper: Mappers.ErrorResponse + } + }, + queryParameters: [ + Parameters.apiVersion, + Parameters.filter, + Parameters.osUpdateType + ], + urlParameters: [ + Parameters.$host, + Parameters.subscriptionId, + Parameters.resourceGroupName, + Parameters.testBaseAccountName, + Parameters.packageName + ], + headerParameters: [Parameters.accept], + serializer +}; +const getOperationSpec: coreClient.OperationSpec = { + path: + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.TestBase/testBaseAccounts/{testBaseAccountName}/packages/{packageName}/testResults/{testResultName}", + httpMethod: "GET", + responses: { + 200: { + bodyMapper: Mappers.TestResultResource + }, + default: { + bodyMapper: Mappers.ErrorResponse + } + }, + queryParameters: [Parameters.apiVersion], + urlParameters: [ + Parameters.$host, + Parameters.subscriptionId, + Parameters.resourceGroupName, + Parameters.testBaseAccountName, + Parameters.packageName, + Parameters.testResultName + ], + headerParameters: [Parameters.accept], + serializer +}; +const getDownloadURLOperationSpec: coreClient.OperationSpec = { + path: + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.TestBase/testBaseAccounts/{testBaseAccountName}/packages/{packageName}/testResults/{testResultName}/getDownloadUrl", + httpMethod: "POST", + responses: { + 200: { + bodyMapper: Mappers.DownloadURLResponse + }, + default: { + bodyMapper: Mappers.ErrorResponse + } + }, + queryParameters: [Parameters.apiVersion], + urlParameters: [ + Parameters.$host, + Parameters.subscriptionId, + Parameters.resourceGroupName, + Parameters.testBaseAccountName, + Parameters.packageName, + Parameters.testResultName + ], + headerParameters: [Parameters.accept], + serializer +}; +const getVideoDownloadURLOperationSpec: coreClient.OperationSpec = { + path: + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.TestBase/testBaseAccounts/{testBaseAccountName}/packages/{packageName}/testResults/{testResultName}/getVideoDownloadUrl", + httpMethod: "POST", + responses: { + 200: { + bodyMapper: Mappers.DownloadURLResponse + }, + default: { + bodyMapper: Mappers.ErrorResponse + } + }, + queryParameters: [Parameters.apiVersion], + urlParameters: [ + Parameters.$host, + Parameters.subscriptionId, + Parameters.resourceGroupName, + Parameters.testBaseAccountName, + Parameters.packageName, + Parameters.testResultName + ], + headerParameters: [Parameters.accept], + serializer +}; +const getConsoleLogDownloadURLOperationSpec: coreClient.OperationSpec = { + path: + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.TestBase/testBaseAccounts/{testBaseAccountName}/packages/{packageName}/testResults/{testResultName}/getConsoleLogDownloadUrl", + httpMethod: "POST", + responses: { + 200: { + bodyMapper: Mappers.DownloadURLResponse + }, + default: { + bodyMapper: Mappers.ErrorResponse + } + }, + requestBody: Parameters.parameters7, + queryParameters: [Parameters.apiVersion], + urlParameters: [ + Parameters.$host, + Parameters.subscriptionId, + Parameters.resourceGroupName, + Parameters.testBaseAccountName, + Parameters.packageName, + Parameters.testResultName + ], + headerParameters: [Parameters.accept, Parameters.contentType], + mediaType: "json", + serializer +}; +const listNextOperationSpec: coreClient.OperationSpec = { + path: "{nextLink}", + httpMethod: "GET", + responses: { + 200: { + bodyMapper: Mappers.TestResultListResult + }, + default: { + bodyMapper: Mappers.ErrorResponse + } + }, + queryParameters: [ + Parameters.apiVersion, + Parameters.filter, + Parameters.osUpdateType + ], + urlParameters: [ + Parameters.$host, + Parameters.subscriptionId, + Parameters.nextLink, + Parameters.resourceGroupName, + Parameters.testBaseAccountName, + Parameters.packageName + ], + headerParameters: [Parameters.accept], + serializer +}; diff --git a/sdk/testbase/arm-testbase/src/operations/testSummaries.ts b/sdk/testbase/arm-testbase/src/operations/testSummaries.ts new file mode 100644 index 000000000000..6dba2114b166 --- /dev/null +++ b/sdk/testbase/arm-testbase/src/operations/testSummaries.ts @@ -0,0 +1,234 @@ +/* + * 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 { TestSummaries } from "../operationsInterfaces"; +import * as coreClient from "@azure/core-client"; +import * as Mappers from "../models/mappers"; +import * as Parameters from "../models/parameters"; +import { TestBase } from "../testBase"; +import { + TestSummaryResource, + TestSummariesListNextOptionalParams, + TestSummariesListOptionalParams, + TestSummariesListResponse, + TestSummariesGetOptionalParams, + TestSummariesGetResponse, + TestSummariesListNextResponse +} from "../models"; + +/// +/** Class containing TestSummaries operations. */ +export class TestSummariesImpl implements TestSummaries { + private readonly client: TestBase; + + /** + * Initialize a new instance of the class TestSummaries class. + * @param client Reference to the service client + */ + constructor(client: TestBase) { + this.client = client; + } + + /** + * Lists the Test Summaries of all the packages under a Test Base Account. + * @param resourceGroupName The name of the resource group that contains the resource. + * @param testBaseAccountName The resource name of the Test Base Account. + * @param options The options parameters. + */ + public list( + resourceGroupName: string, + testBaseAccountName: string, + options?: TestSummariesListOptionalParams + ): PagedAsyncIterableIterator { + const iter = this.listPagingAll( + resourceGroupName, + testBaseAccountName, + options + ); + return { + next() { + return iter.next(); + }, + [Symbol.asyncIterator]() { + return this; + }, + byPage: () => { + return this.listPagingPage( + resourceGroupName, + testBaseAccountName, + options + ); + } + }; + } + + private async *listPagingPage( + resourceGroupName: string, + testBaseAccountName: string, + options?: TestSummariesListOptionalParams + ): AsyncIterableIterator { + let result = await this._list( + resourceGroupName, + testBaseAccountName, + options + ); + yield result.value || []; + let continuationToken = result.nextLink; + while (continuationToken) { + result = await this._listNext( + resourceGroupName, + testBaseAccountName, + continuationToken, + options + ); + continuationToken = result.nextLink; + yield result.value || []; + } + } + + private async *listPagingAll( + resourceGroupName: string, + testBaseAccountName: string, + options?: TestSummariesListOptionalParams + ): AsyncIterableIterator { + for await (const page of this.listPagingPage( + resourceGroupName, + testBaseAccountName, + options + )) { + yield* page; + } + } + + /** + * Lists the Test Summaries of all the packages under a Test Base Account. + * @param resourceGroupName The name of the resource group that contains the resource. + * @param testBaseAccountName The resource name of the Test Base Account. + * @param options The options parameters. + */ + private _list( + resourceGroupName: string, + testBaseAccountName: string, + options?: TestSummariesListOptionalParams + ): Promise { + return this.client.sendOperationRequest( + { resourceGroupName, testBaseAccountName, options }, + listOperationSpec + ); + } + + /** + * Gets a Test Summary with specific name from all the Test Summaries of all the packages under a Test + * Base Account. + * @param resourceGroupName The name of the resource group that contains the resource. + * @param testBaseAccountName The resource name of the Test Base Account. + * @param testSummaryName The name of the Test Summary. + * @param options The options parameters. + */ + get( + resourceGroupName: string, + testBaseAccountName: string, + testSummaryName: string, + options?: TestSummariesGetOptionalParams + ): Promise { + return this.client.sendOperationRequest( + { resourceGroupName, testBaseAccountName, testSummaryName, options }, + getOperationSpec + ); + } + + /** + * ListNext + * @param resourceGroupName The name of the resource group that contains the resource. + * @param testBaseAccountName The resource name of the Test Base Account. + * @param nextLink The nextLink from the previous successful call to the List method. + * @param options The options parameters. + */ + private _listNext( + resourceGroupName: string, + testBaseAccountName: string, + nextLink: string, + options?: TestSummariesListNextOptionalParams + ): Promise { + return this.client.sendOperationRequest( + { resourceGroupName, testBaseAccountName, nextLink, options }, + listNextOperationSpec + ); + } +} +// Operation Specifications +const serializer = coreClient.createSerializer(Mappers, /* isXml */ false); + +const listOperationSpec: coreClient.OperationSpec = { + path: + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.TestBase/testBaseAccounts/{testBaseAccountName}/testSummaries", + httpMethod: "GET", + responses: { + 200: { + bodyMapper: Mappers.TestSummaryListResult + }, + default: { + bodyMapper: Mappers.ErrorResponse + } + }, + queryParameters: [Parameters.apiVersion], + urlParameters: [ + Parameters.$host, + Parameters.subscriptionId, + Parameters.resourceGroupName, + Parameters.testBaseAccountName + ], + headerParameters: [Parameters.accept], + serializer +}; +const getOperationSpec: coreClient.OperationSpec = { + path: + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.TestBase/testBaseAccounts/{testBaseAccountName}/testSummaries/{testSummaryName}", + httpMethod: "GET", + responses: { + 200: { + bodyMapper: Mappers.TestSummaryResource + }, + default: { + bodyMapper: Mappers.ErrorResponse + } + }, + queryParameters: [Parameters.apiVersion], + urlParameters: [ + Parameters.$host, + Parameters.subscriptionId, + Parameters.resourceGroupName, + Parameters.testBaseAccountName, + Parameters.testSummaryName + ], + headerParameters: [Parameters.accept], + serializer +}; +const listNextOperationSpec: coreClient.OperationSpec = { + path: "{nextLink}", + httpMethod: "GET", + responses: { + 200: { + bodyMapper: Mappers.TestSummaryListResult + }, + default: { + bodyMapper: Mappers.ErrorResponse + } + }, + queryParameters: [Parameters.apiVersion], + urlParameters: [ + Parameters.$host, + Parameters.subscriptionId, + Parameters.nextLink, + Parameters.resourceGroupName, + Parameters.testBaseAccountName + ], + headerParameters: [Parameters.accept], + serializer +}; diff --git a/sdk/testbase/arm-testbase/src/operations/testTypes.ts b/sdk/testbase/arm-testbase/src/operations/testTypes.ts new file mode 100644 index 000000000000..4d7410b3b493 --- /dev/null +++ b/sdk/testbase/arm-testbase/src/operations/testTypes.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 { TestTypes } from "../operationsInterfaces"; +import * as coreClient from "@azure/core-client"; +import * as Mappers from "../models/mappers"; +import * as Parameters from "../models/parameters"; +import { TestBase } from "../testBase"; +import { + TestTypeResource, + TestTypesListNextOptionalParams, + TestTypesListOptionalParams, + TestTypesListResponse, + TestTypesGetOptionalParams, + TestTypesGetResponse, + TestTypesListNextResponse +} from "../models"; + +/// +/** Class containing TestTypes operations. */ +export class TestTypesImpl implements TestTypes { + private readonly client: TestBase; + + /** + * Initialize a new instance of the class TestTypes class. + * @param client Reference to the service client + */ + constructor(client: TestBase) { + this.client = client; + } + + /** + * Lists all the test types of a Test Base Account. + * @param resourceGroupName The name of the resource group that contains the resource. + * @param testBaseAccountName The resource name of the Test Base Account. + * @param options The options parameters. + */ + public list( + resourceGroupName: string, + testBaseAccountName: string, + options?: TestTypesListOptionalParams + ): PagedAsyncIterableIterator { + const iter = this.listPagingAll( + resourceGroupName, + testBaseAccountName, + options + ); + return { + next() { + return iter.next(); + }, + [Symbol.asyncIterator]() { + return this; + }, + byPage: () => { + return this.listPagingPage( + resourceGroupName, + testBaseAccountName, + options + ); + } + }; + } + + private async *listPagingPage( + resourceGroupName: string, + testBaseAccountName: string, + options?: TestTypesListOptionalParams + ): AsyncIterableIterator { + let result = await this._list( + resourceGroupName, + testBaseAccountName, + options + ); + yield result.value || []; + let continuationToken = result.nextLink; + while (continuationToken) { + result = await this._listNext( + resourceGroupName, + testBaseAccountName, + continuationToken, + options + ); + continuationToken = result.nextLink; + yield result.value || []; + } + } + + private async *listPagingAll( + resourceGroupName: string, + testBaseAccountName: string, + options?: TestTypesListOptionalParams + ): AsyncIterableIterator { + for await (const page of this.listPagingPage( + resourceGroupName, + testBaseAccountName, + options + )) { + yield* page; + } + } + + /** + * Lists all the test types of a Test Base Account. + * @param resourceGroupName The name of the resource group that contains the resource. + * @param testBaseAccountName The resource name of the Test Base Account. + * @param options The options parameters. + */ + private _list( + resourceGroupName: string, + testBaseAccountName: string, + options?: TestTypesListOptionalParams + ): Promise { + return this.client.sendOperationRequest( + { resourceGroupName, testBaseAccountName, options }, + listOperationSpec + ); + } + + /** + * Gets a test type of a Test Base Account. + * @param resourceGroupName The name of the resource group that contains the resource. + * @param testBaseAccountName The resource name of the Test Base Account. + * @param testTypeResourceName The resource name of a test type. + * @param options The options parameters. + */ + get( + resourceGroupName: string, + testBaseAccountName: string, + testTypeResourceName: string, + options?: TestTypesGetOptionalParams + ): Promise { + return this.client.sendOperationRequest( + { resourceGroupName, testBaseAccountName, testTypeResourceName, options }, + getOperationSpec + ); + } + + /** + * ListNext + * @param resourceGroupName The name of the resource group that contains the resource. + * @param testBaseAccountName The resource name of the Test Base Account. + * @param nextLink The nextLink from the previous successful call to the List method. + * @param options The options parameters. + */ + private _listNext( + resourceGroupName: string, + testBaseAccountName: string, + nextLink: string, + options?: TestTypesListNextOptionalParams + ): Promise { + return this.client.sendOperationRequest( + { resourceGroupName, testBaseAccountName, nextLink, options }, + listNextOperationSpec + ); + } +} +// Operation Specifications +const serializer = coreClient.createSerializer(Mappers, /* isXml */ false); + +const listOperationSpec: coreClient.OperationSpec = { + path: + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.TestBase/testBaseAccounts/{testBaseAccountName}/testTypes", + httpMethod: "GET", + responses: { + 200: { + bodyMapper: Mappers.TestTypeListResult + }, + default: { + bodyMapper: Mappers.ErrorResponse + } + }, + queryParameters: [Parameters.apiVersion], + urlParameters: [ + Parameters.$host, + Parameters.subscriptionId, + Parameters.resourceGroupName, + Parameters.testBaseAccountName + ], + headerParameters: [Parameters.accept], + serializer +}; +const getOperationSpec: coreClient.OperationSpec = { + path: + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.TestBase/testBaseAccounts/{testBaseAccountName}/testTypes/{testTypeResourceName}", + httpMethod: "GET", + responses: { + 200: { + bodyMapper: Mappers.TestTypeResource + }, + default: { + bodyMapper: Mappers.ErrorResponse + } + }, + queryParameters: [Parameters.apiVersion], + urlParameters: [ + Parameters.$host, + Parameters.subscriptionId, + Parameters.resourceGroupName, + Parameters.testBaseAccountName, + Parameters.testTypeResourceName + ], + headerParameters: [Parameters.accept], + serializer +}; +const listNextOperationSpec: coreClient.OperationSpec = { + path: "{nextLink}", + httpMethod: "GET", + responses: { + 200: { + bodyMapper: Mappers.TestTypeListResult + }, + default: { + bodyMapper: Mappers.ErrorResponse + } + }, + queryParameters: [Parameters.apiVersion], + urlParameters: [ + Parameters.$host, + Parameters.subscriptionId, + Parameters.nextLink, + Parameters.resourceGroupName, + Parameters.testBaseAccountName + ], + headerParameters: [Parameters.accept], + serializer +}; diff --git a/sdk/testbase/arm-testbase/src/operations/usage.ts b/sdk/testbase/arm-testbase/src/operations/usage.ts new file mode 100644 index 000000000000..ad16ab661c08 --- /dev/null +++ b/sdk/testbase/arm-testbase/src/operations/usage.ts @@ -0,0 +1,189 @@ +/* + * 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 { Usage } from "../operationsInterfaces"; +import * as coreClient from "@azure/core-client"; +import * as Mappers from "../models/mappers"; +import * as Parameters from "../models/parameters"; +import { TestBase } from "../testBase"; +import { + TestBaseAccountUsageData, + UsageListNextOptionalParams, + UsageListOptionalParams, + UsageListResponse, + UsageListNextResponse +} from "../models"; + +/// +/** Class containing Usage operations. */ +export class UsageImpl implements Usage { + private readonly client: TestBase; + + /** + * Initialize a new instance of the class Usage class. + * @param client Reference to the service client + */ + constructor(client: TestBase) { + this.client = client; + } + + /** + * Lists the usage data of a Test Base Account. + * @param resourceGroupName The name of the resource group that contains the resource. + * @param testBaseAccountName The resource name of the Test Base Account. + * @param options The options parameters. + */ + public list( + resourceGroupName: string, + testBaseAccountName: string, + options?: UsageListOptionalParams + ): PagedAsyncIterableIterator { + const iter = this.listPagingAll( + resourceGroupName, + testBaseAccountName, + options + ); + return { + next() { + return iter.next(); + }, + [Symbol.asyncIterator]() { + return this; + }, + byPage: () => { + return this.listPagingPage( + resourceGroupName, + testBaseAccountName, + options + ); + } + }; + } + + private async *listPagingPage( + resourceGroupName: string, + testBaseAccountName: string, + options?: UsageListOptionalParams + ): AsyncIterableIterator { + let result = await this._list( + resourceGroupName, + testBaseAccountName, + options + ); + yield result.value || []; + let continuationToken = result.nextLink; + while (continuationToken) { + result = await this._listNext( + resourceGroupName, + testBaseAccountName, + continuationToken, + options + ); + continuationToken = result.nextLink; + yield result.value || []; + } + } + + private async *listPagingAll( + resourceGroupName: string, + testBaseAccountName: string, + options?: UsageListOptionalParams + ): AsyncIterableIterator { + for await (const page of this.listPagingPage( + resourceGroupName, + testBaseAccountName, + options + )) { + yield* page; + } + } + + /** + * Lists the usage data of a Test Base Account. + * @param resourceGroupName The name of the resource group that contains the resource. + * @param testBaseAccountName The resource name of the Test Base Account. + * @param options The options parameters. + */ + private _list( + resourceGroupName: string, + testBaseAccountName: string, + options?: UsageListOptionalParams + ): Promise { + return this.client.sendOperationRequest( + { resourceGroupName, testBaseAccountName, options }, + listOperationSpec + ); + } + + /** + * ListNext + * @param resourceGroupName The name of the resource group that contains the resource. + * @param testBaseAccountName The resource name of the Test Base Account. + * @param nextLink The nextLink from the previous successful call to the List method. + * @param options The options parameters. + */ + private _listNext( + resourceGroupName: string, + testBaseAccountName: string, + nextLink: string, + options?: UsageListNextOptionalParams + ): Promise { + return this.client.sendOperationRequest( + { resourceGroupName, testBaseAccountName, nextLink, options }, + listNextOperationSpec + ); + } +} +// Operation Specifications +const serializer = coreClient.createSerializer(Mappers, /* isXml */ false); + +const listOperationSpec: coreClient.OperationSpec = { + path: + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.TestBase/testBaseAccounts/{testBaseAccountName}/usages", + httpMethod: "GET", + responses: { + 200: { + bodyMapper: Mappers.TestBaseAccountUsageDataList + }, + default: { + bodyMapper: Mappers.ErrorResponse + } + }, + queryParameters: [Parameters.apiVersion, Parameters.filter], + urlParameters: [ + Parameters.$host, + Parameters.subscriptionId, + Parameters.resourceGroupName, + Parameters.testBaseAccountName + ], + headerParameters: [Parameters.accept], + serializer +}; +const listNextOperationSpec: coreClient.OperationSpec = { + path: "{nextLink}", + httpMethod: "GET", + responses: { + 200: { + bodyMapper: Mappers.TestBaseAccountUsageDataList + }, + default: { + bodyMapper: Mappers.ErrorResponse + } + }, + queryParameters: [Parameters.apiVersion, Parameters.filter], + urlParameters: [ + Parameters.$host, + Parameters.subscriptionId, + Parameters.nextLink, + Parameters.resourceGroupName, + Parameters.testBaseAccountName + ], + headerParameters: [Parameters.accept], + serializer +}; diff --git a/sdk/testbase/arm-testbase/src/operationsInterfaces/analysisResults.ts b/sdk/testbase/arm-testbase/src/operationsInterfaces/analysisResults.ts new file mode 100644 index 000000000000..cdfaf8f4b0ac --- /dev/null +++ b/sdk/testbase/arm-testbase/src/operationsInterfaces/analysisResults.ts @@ -0,0 +1,57 @@ +/* + * 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 { + AnalysisResultSingletonResource, + AnalysisResultType, + AnalysisResultsListOptionalParams, + AnalysisResultName, + AnalysisResultsGetOptionalParams, + AnalysisResultsGetResponse +} from "../models"; + +/// +/** Interface representing a AnalysisResults. */ +export interface AnalysisResults { + /** + * Lists the Analysis Results of a Test Result. The result collection will only contain one element as + * all the data will be nested in a singleton object. + * @param resourceGroupName The name of the resource group that contains the resource. + * @param testBaseAccountName The resource name of the Test Base Account. + * @param packageName The resource name of the Test Base Package. + * @param testResultName The Test Result Name. It equals to TestResult-{TestResultId} string. + * @param analysisResultType The type of the Analysis Result of a Test Result. + * @param options The options parameters. + */ + list( + resourceGroupName: string, + testBaseAccountName: string, + packageName: string, + testResultName: string, + analysisResultType: AnalysisResultType, + options?: AnalysisResultsListOptionalParams + ): PagedAsyncIterableIterator; + /** + * Gets an Analysis Result of a Test Result by name. + * @param resourceGroupName The name of the resource group that contains the resource. + * @param testBaseAccountName The resource name of the Test Base Account. + * @param packageName The resource name of the Test Base Package. + * @param testResultName The Test Result Name. It equals to TestResult-{TestResultId} string. + * @param analysisResultName The name of the Analysis Result of a Test Result. + * @param options The options parameters. + */ + get( + resourceGroupName: string, + testBaseAccountName: string, + packageName: string, + testResultName: string, + analysisResultName: AnalysisResultName, + options?: AnalysisResultsGetOptionalParams + ): Promise; +} diff --git a/sdk/testbase/arm-testbase/src/operationsInterfaces/availableOS.ts b/sdk/testbase/arm-testbase/src/operationsInterfaces/availableOS.ts new file mode 100644 index 000000000000..43a7067f7811 --- /dev/null +++ b/sdk/testbase/arm-testbase/src/operationsInterfaces/availableOS.ts @@ -0,0 +1,47 @@ +/* + * 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 { + AvailableOSResource, + OsUpdateType, + AvailableOSListOptionalParams, + AvailableOSGetOptionalParams, + AvailableOSGetResponse +} from "../models"; + +/// +/** Interface representing a AvailableOS. */ +export interface AvailableOS { + /** + * Lists all the available OSs to run a package under a Test Base Account. + * @param resourceGroupName The name of the resource group that contains the resource. + * @param testBaseAccountName The resource name of the Test Base Account. + * @param osUpdateType The type of the OS Update. + * @param options The options parameters. + */ + list( + resourceGroupName: string, + testBaseAccountName: string, + osUpdateType: OsUpdateType, + options?: AvailableOSListOptionalParams + ): PagedAsyncIterableIterator; + /** + * Gets an available OS to run a package under a Test Base Account. + * @param resourceGroupName The name of the resource group that contains the resource. + * @param testBaseAccountName The resource name of the Test Base Account. + * @param availableOSResourceName The resource name of an Available OS. + * @param options The options parameters. + */ + get( + resourceGroupName: string, + testBaseAccountName: string, + availableOSResourceName: string, + options?: AvailableOSGetOptionalParams + ): Promise; +} diff --git a/sdk/testbase/arm-testbase/src/operationsInterfaces/billingHubService.ts b/sdk/testbase/arm-testbase/src/operationsInterfaces/billingHubService.ts new file mode 100644 index 000000000000..24ab9d1ff4fe --- /dev/null +++ b/sdk/testbase/arm-testbase/src/operationsInterfaces/billingHubService.ts @@ -0,0 +1,38 @@ +/* + * 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 { + BillingHubServiceGetFreeHourBalanceOptionalParams, + BillingHubServiceGetFreeHourBalanceResponse, + BillingHubServiceGetUsageOptionalParams, + BillingHubServiceGetUsageResponse +} from "../models"; + +/** Interface representing a BillingHubService. */ +export interface BillingHubService { + /** + * @param resourceGroupName The name of the resource group that contains the resource. + * @param testBaseAccountName The resource name of the Test Base Account. + * @param options The options parameters. + */ + getFreeHourBalance( + resourceGroupName: string, + testBaseAccountName: string, + options?: BillingHubServiceGetFreeHourBalanceOptionalParams + ): Promise; + /** + * @param resourceGroupName The name of the resource group that contains the resource. + * @param testBaseAccountName The resource name of the Test Base Account. + * @param options The options parameters. + */ + getUsage( + resourceGroupName: string, + testBaseAccountName: string, + options?: BillingHubServiceGetUsageOptionalParams + ): Promise; +} diff --git a/sdk/testbase/arm-testbase/src/operationsInterfaces/customerEvents.ts b/sdk/testbase/arm-testbase/src/operationsInterfaces/customerEvents.ts new file mode 100644 index 000000000000..c1d71d3b3776 --- /dev/null +++ b/sdk/testbase/arm-testbase/src/operationsInterfaces/customerEvents.ts @@ -0,0 +1,109 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +import { PagedAsyncIterableIterator } from "@azure/core-paging"; +import { PollerLike, PollOperationState } from "@azure/core-lro"; +import { + CustomerEventResource, + CustomerEventsListByTestBaseAccountOptionalParams, + CustomerEventsCreateOptionalParams, + CustomerEventsCreateResponse, + CustomerEventsDeleteOptionalParams, + CustomerEventsGetOptionalParams, + CustomerEventsGetResponse +} from "../models"; + +/// +/** Interface representing a CustomerEvents. */ +export interface CustomerEvents { + /** + * Lists all notification events subscribed under a Test Base Account. + * @param resourceGroupName The name of the resource group that contains the resource. + * @param testBaseAccountName The resource name of the Test Base Account. + * @param options The options parameters. + */ + listByTestBaseAccount( + resourceGroupName: string, + testBaseAccountName: string, + options?: CustomerEventsListByTestBaseAccountOptionalParams + ): PagedAsyncIterableIterator; + /** + * Create or replace a Test Base Customer Event. + * @param resourceGroupName The name of the resource group that contains the resource. + * @param testBaseAccountName The resource name of the Test Base Account. + * @param customerEventName The resource name of the Test Base Customer event. + * @param parameters Parameters supplied to create a Test Base CustomerEvent. + * @param options The options parameters. + */ + beginCreate( + resourceGroupName: string, + testBaseAccountName: string, + customerEventName: string, + parameters: CustomerEventResource, + options?: CustomerEventsCreateOptionalParams + ): Promise< + PollerLike< + PollOperationState, + CustomerEventsCreateResponse + > + >; + /** + * Create or replace a Test Base Customer Event. + * @param resourceGroupName The name of the resource group that contains the resource. + * @param testBaseAccountName The resource name of the Test Base Account. + * @param customerEventName The resource name of the Test Base Customer event. + * @param parameters Parameters supplied to create a Test Base CustomerEvent. + * @param options The options parameters. + */ + beginCreateAndWait( + resourceGroupName: string, + testBaseAccountName: string, + customerEventName: string, + parameters: CustomerEventResource, + options?: CustomerEventsCreateOptionalParams + ): Promise; + /** + * Deletes a Test Base Customer Event. + * @param resourceGroupName The name of the resource group that contains the resource. + * @param testBaseAccountName The resource name of the Test Base Account. + * @param customerEventName The resource name of the Test Base Customer event. + * @param options The options parameters. + */ + beginDelete( + resourceGroupName: string, + testBaseAccountName: string, + customerEventName: string, + options?: CustomerEventsDeleteOptionalParams + ): Promise, void>>; + /** + * Deletes a Test Base Customer Event. + * @param resourceGroupName The name of the resource group that contains the resource. + * @param testBaseAccountName The resource name of the Test Base Account. + * @param customerEventName The resource name of the Test Base Customer event. + * @param options The options parameters. + */ + beginDeleteAndWait( + resourceGroupName: string, + testBaseAccountName: string, + customerEventName: string, + options?: CustomerEventsDeleteOptionalParams + ): Promise; + /** + * Gets a Test Base CustomerEvent. + * @param resourceGroupName The name of the resource group that contains the resource. + * @param testBaseAccountName The resource name of the Test Base Account. + * @param customerEventName The resource name of the Test Base Customer event. + * @param options The options parameters. + */ + get( + resourceGroupName: string, + testBaseAccountName: string, + customerEventName: string, + options?: CustomerEventsGetOptionalParams + ): Promise; +} diff --git a/sdk/testbase/arm-testbase/src/operationsInterfaces/emailEvents.ts b/sdk/testbase/arm-testbase/src/operationsInterfaces/emailEvents.ts new file mode 100644 index 000000000000..8b5ac18875f8 --- /dev/null +++ b/sdk/testbase/arm-testbase/src/operationsInterfaces/emailEvents.ts @@ -0,0 +1,44 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +import { PagedAsyncIterableIterator } from "@azure/core-paging"; +import { + EmailEventResource, + EmailEventsListOptionalParams, + EmailEventsGetOptionalParams, + EmailEventsGetResponse +} from "../models"; + +/// +/** Interface representing a EmailEvents. */ +export interface EmailEvents { + /** + * Lists all the email events of a Test Base Account. + * @param resourceGroupName The name of the resource group that contains the resource. + * @param testBaseAccountName The resource name of the Test Base Account. + * @param options The options parameters. + */ + list( + resourceGroupName: string, + testBaseAccountName: string, + options?: EmailEventsListOptionalParams + ): PagedAsyncIterableIterator; + /** + * Gets a email event of a Test Base Account. + * @param resourceGroupName The name of the resource group that contains the resource. + * @param testBaseAccountName The resource name of the Test Base Account. + * @param emailEventResourceName The resource name of an email event. + * @param options The options parameters. + */ + get( + resourceGroupName: string, + testBaseAccountName: string, + emailEventResourceName: string, + options?: EmailEventsGetOptionalParams + ): Promise; +} diff --git a/sdk/testbase/arm-testbase/src/operationsInterfaces/favoriteProcesses.ts b/sdk/testbase/arm-testbase/src/operationsInterfaces/favoriteProcesses.ts new file mode 100644 index 000000000000..4a40fd0128bb --- /dev/null +++ b/sdk/testbase/arm-testbase/src/operationsInterfaces/favoriteProcesses.ts @@ -0,0 +1,89 @@ +/* + * 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 { + FavoriteProcessResource, + FavoriteProcessesListOptionalParams, + FavoriteProcessesCreateOptionalParams, + FavoriteProcessesCreateResponse, + FavoriteProcessesDeleteOptionalParams, + FavoriteProcessesGetOptionalParams, + FavoriteProcessesGetResponse +} from "../models"; + +/// +/** Interface representing a FavoriteProcesses. */ +export interface FavoriteProcesses { + /** + * Lists the favorite processes for a specific package. + * @param resourceGroupName The name of the resource group that contains the resource. + * @param testBaseAccountName The resource name of the Test Base Account. + * @param packageName The resource name of the Test Base Package. + * @param options The options parameters. + */ + list( + resourceGroupName: string, + testBaseAccountName: string, + packageName: string, + options?: FavoriteProcessesListOptionalParams + ): PagedAsyncIterableIterator; + /** + * Create or replace a favorite process for a Test Base Package. + * @param resourceGroupName The name of the resource group that contains the resource. + * @param testBaseAccountName The resource name of the Test Base Account. + * @param packageName The resource name of the Test Base Package. + * @param favoriteProcessResourceName The resource name of a favorite process in a package. If the + * process name contains characters that are not allowed in Azure Resource Name, we use + * 'actualProcessName' in request body to submit the name. + * @param parameters Parameters supplied to create a favorite process in a package. + * @param options The options parameters. + */ + create( + resourceGroupName: string, + testBaseAccountName: string, + packageName: string, + favoriteProcessResourceName: string, + parameters: FavoriteProcessResource, + options?: FavoriteProcessesCreateOptionalParams + ): Promise; + /** + * Deletes a favorite process for a specific package. + * @param resourceGroupName The name of the resource group that contains the resource. + * @param testBaseAccountName The resource name of the Test Base Account. + * @param packageName The resource name of the Test Base Package. + * @param favoriteProcessResourceName The resource name of a favorite process in a package. If the + * process name contains characters that are not allowed in Azure Resource Name, we use + * 'actualProcessName' in request body to submit the name. + * @param options The options parameters. + */ + delete( + resourceGroupName: string, + testBaseAccountName: string, + packageName: string, + favoriteProcessResourceName: string, + options?: FavoriteProcessesDeleteOptionalParams + ): Promise; + /** + * Gets a favorite process for a Test Base Package. + * @param resourceGroupName The name of the resource group that contains the resource. + * @param testBaseAccountName The resource name of the Test Base Account. + * @param packageName The resource name of the Test Base Package. + * @param favoriteProcessResourceName The resource name of a favorite process in a package. If the + * process name contains characters that are not allowed in Azure Resource Name, we use + * 'actualProcessName' in request body to submit the name. + * @param options The options parameters. + */ + get( + resourceGroupName: string, + testBaseAccountName: string, + packageName: string, + favoriteProcessResourceName: string, + options?: FavoriteProcessesGetOptionalParams + ): Promise; +} diff --git a/sdk/testbase/arm-testbase/src/operationsInterfaces/flightingRings.ts b/sdk/testbase/arm-testbase/src/operationsInterfaces/flightingRings.ts new file mode 100644 index 000000000000..c51c0312321c --- /dev/null +++ b/sdk/testbase/arm-testbase/src/operationsInterfaces/flightingRings.ts @@ -0,0 +1,44 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +import { PagedAsyncIterableIterator } from "@azure/core-paging"; +import { + FlightingRingResource, + FlightingRingsListOptionalParams, + FlightingRingsGetOptionalParams, + FlightingRingsGetResponse +} from "../models"; + +/// +/** Interface representing a FlightingRings. */ +export interface FlightingRings { + /** + * Lists all the flighting rings of a Test Base Account. + * @param resourceGroupName The name of the resource group that contains the resource. + * @param testBaseAccountName The resource name of the Test Base Account. + * @param options The options parameters. + */ + list( + resourceGroupName: string, + testBaseAccountName: string, + options?: FlightingRingsListOptionalParams + ): PagedAsyncIterableIterator; + /** + * Gets a flighting ring of a Test Base Account. + * @param resourceGroupName The name of the resource group that contains the resource. + * @param testBaseAccountName The resource name of the Test Base Account. + * @param flightingRingResourceName The resource name of a flighting ring. + * @param options The options parameters. + */ + get( + resourceGroupName: string, + testBaseAccountName: string, + flightingRingResourceName: string, + options?: FlightingRingsGetOptionalParams + ): Promise; +} diff --git a/sdk/testbase/arm-testbase/src/operationsInterfaces/index.ts b/sdk/testbase/arm-testbase/src/operationsInterfaces/index.ts new file mode 100644 index 000000000000..f1501f513537 --- /dev/null +++ b/sdk/testbase/arm-testbase/src/operationsInterfaces/index.ts @@ -0,0 +1,24 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +export * from "./skus"; +export * from "./testBaseAccounts"; +export * from "./usage"; +export * from "./availableOS"; +export * from "./flightingRings"; +export * from "./testTypes"; +export * from "./packages"; +export * from "./testSummaries"; +export * from "./testResults"; +export * from "./oSUpdates"; +export * from "./favoriteProcesses"; +export * from "./analysisResults"; +export * from "./emailEvents"; +export * from "./customerEvents"; +export * from "./operations"; +export * from "./billingHubService"; diff --git a/sdk/testbase/arm-testbase/src/operationsInterfaces/oSUpdates.ts b/sdk/testbase/arm-testbase/src/operationsInterfaces/oSUpdates.ts new file mode 100644 index 000000000000..d6d3730ad37e --- /dev/null +++ b/sdk/testbase/arm-testbase/src/operationsInterfaces/oSUpdates.ts @@ -0,0 +1,51 @@ +/* + * 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 { + OSUpdateResource, + OsUpdateType, + OSUpdatesListOptionalParams, + OSUpdatesGetOptionalParams, + OSUpdatesGetResponse +} from "../models"; + +/// +/** Interface representing a OSUpdates. */ +export interface OSUpdates { + /** + * Lists the OS Updates in which the package were tested before. + * @param resourceGroupName The name of the resource group that contains the resource. + * @param testBaseAccountName The resource name of the Test Base Account. + * @param packageName The resource name of the Test Base Package. + * @param osUpdateType The type of the OS Update. + * @param options The options parameters. + */ + list( + resourceGroupName: string, + testBaseAccountName: string, + packageName: string, + osUpdateType: OsUpdateType, + options?: OSUpdatesListOptionalParams + ): PagedAsyncIterableIterator; + /** + * Gets an OS Update by name in which the package was tested before. + * @param resourceGroupName The name of the resource group that contains the resource. + * @param testBaseAccountName The resource name of the Test Base Account. + * @param packageName The resource name of the Test Base Package. + * @param osUpdateResourceName The resource name of an OS Update. + * @param options The options parameters. + */ + get( + resourceGroupName: string, + testBaseAccountName: string, + packageName: string, + osUpdateResourceName: string, + options?: OSUpdatesGetOptionalParams + ): Promise; +} diff --git a/sdk/testbase/arm-testbase/src/operationsInterfaces/operations.ts b/sdk/testbase/arm-testbase/src/operationsInterfaces/operations.ts new file mode 100644 index 000000000000..cb454d771e16 --- /dev/null +++ b/sdk/testbase/arm-testbase/src/operationsInterfaces/operations.ts @@ -0,0 +1,22 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +import { PagedAsyncIterableIterator } from "@azure/core-paging"; +import { Operation, OperationsListOptionalParams } from "../models"; + +/// +/** Interface representing a Operations. */ +export interface Operations { + /** + * Lists all of the available REST API operations of the Microsoft.TestBase provider. + * @param options The options parameters. + */ + list( + options?: OperationsListOptionalParams + ): PagedAsyncIterableIterator; +} diff --git a/sdk/testbase/arm-testbase/src/operationsInterfaces/packages.ts b/sdk/testbase/arm-testbase/src/operationsInterfaces/packages.ts new file mode 100644 index 000000000000..ca3967e347b0 --- /dev/null +++ b/sdk/testbase/arm-testbase/src/operationsInterfaces/packages.ts @@ -0,0 +1,204 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +import { PagedAsyncIterableIterator } from "@azure/core-paging"; +import { PollerLike, PollOperationState } from "@azure/core-lro"; +import { + PackageResource, + PackagesListByTestBaseAccountOptionalParams, + PackagesCreateOptionalParams, + PackagesCreateResponse, + PackageUpdateParameters, + PackagesUpdateOptionalParams, + PackagesUpdateResponse, + PackagesDeleteOptionalParams, + PackagesGetOptionalParams, + PackagesGetResponse, + PackagesHardDeleteOptionalParams, + PackagesGetDownloadURLOptionalParams, + PackagesGetDownloadURLResponse, + PackagesRunTestOptionalParams, + PackagesRunTestResponse +} from "../models"; + +/// +/** Interface representing a Packages. */ +export interface Packages { + /** + * Lists all the packages under a Test Base Account. + * @param resourceGroupName The name of the resource group that contains the resource. + * @param testBaseAccountName The resource name of the Test Base Account. + * @param options The options parameters. + */ + listByTestBaseAccount( + resourceGroupName: string, + testBaseAccountName: string, + options?: PackagesListByTestBaseAccountOptionalParams + ): PagedAsyncIterableIterator; + /** + * Create or replace (overwrite/recreate, with potential downtime) a Test Base Package. + * @param resourceGroupName The name of the resource group that contains the resource. + * @param testBaseAccountName The resource name of the Test Base Account. + * @param packageName The resource name of the Test Base Package. + * @param parameters Parameters supplied to create a Test Base Package. + * @param options The options parameters. + */ + beginCreate( + resourceGroupName: string, + testBaseAccountName: string, + packageName: string, + parameters: PackageResource, + options?: PackagesCreateOptionalParams + ): Promise< + PollerLike< + PollOperationState, + PackagesCreateResponse + > + >; + /** + * Create or replace (overwrite/recreate, with potential downtime) a Test Base Package. + * @param resourceGroupName The name of the resource group that contains the resource. + * @param testBaseAccountName The resource name of the Test Base Account. + * @param packageName The resource name of the Test Base Package. + * @param parameters Parameters supplied to create a Test Base Package. + * @param options The options parameters. + */ + beginCreateAndWait( + resourceGroupName: string, + testBaseAccountName: string, + packageName: string, + parameters: PackageResource, + options?: PackagesCreateOptionalParams + ): Promise; + /** + * Update an existing Test Base Package. + * @param resourceGroupName The name of the resource group that contains the resource. + * @param testBaseAccountName The resource name of the Test Base Account. + * @param packageName The resource name of the Test Base Package. + * @param parameters Parameters supplied to update a Test Base Package. + * @param options The options parameters. + */ + beginUpdate( + resourceGroupName: string, + testBaseAccountName: string, + packageName: string, + parameters: PackageUpdateParameters, + options?: PackagesUpdateOptionalParams + ): Promise< + PollerLike< + PollOperationState, + PackagesUpdateResponse + > + >; + /** + * Update an existing Test Base Package. + * @param resourceGroupName The name of the resource group that contains the resource. + * @param testBaseAccountName The resource name of the Test Base Account. + * @param packageName The resource name of the Test Base Package. + * @param parameters Parameters supplied to update a Test Base Package. + * @param options The options parameters. + */ + beginUpdateAndWait( + resourceGroupName: string, + testBaseAccountName: string, + packageName: string, + parameters: PackageUpdateParameters, + options?: PackagesUpdateOptionalParams + ): Promise; + /** + * Deletes a Test Base Package. + * @param resourceGroupName The name of the resource group that contains the resource. + * @param testBaseAccountName The resource name of the Test Base Account. + * @param packageName The resource name of the Test Base Package. + * @param options The options parameters. + */ + beginDelete( + resourceGroupName: string, + testBaseAccountName: string, + packageName: string, + options?: PackagesDeleteOptionalParams + ): Promise, void>>; + /** + * Deletes a Test Base Package. + * @param resourceGroupName The name of the resource group that contains the resource. + * @param testBaseAccountName The resource name of the Test Base Account. + * @param packageName The resource name of the Test Base Package. + * @param options The options parameters. + */ + beginDeleteAndWait( + resourceGroupName: string, + testBaseAccountName: string, + packageName: string, + options?: PackagesDeleteOptionalParams + ): Promise; + /** + * Gets a Test Base Package. + * @param resourceGroupName The name of the resource group that contains the resource. + * @param testBaseAccountName The resource name of the Test Base Account. + * @param packageName The resource name of the Test Base Package. + * @param options The options parameters. + */ + get( + resourceGroupName: string, + testBaseAccountName: string, + packageName: string, + options?: PackagesGetOptionalParams + ): Promise; + /** + * Hard Delete a Test Base Package. + * @param resourceGroupName The name of the resource group that contains the resource. + * @param testBaseAccountName The resource name of the Test Base Account. + * @param packageName The resource name of the Test Base Package. + * @param options The options parameters. + */ + beginHardDelete( + resourceGroupName: string, + testBaseAccountName: string, + packageName: string, + options?: PackagesHardDeleteOptionalParams + ): Promise, void>>; + /** + * Hard Delete a Test Base Package. + * @param resourceGroupName The name of the resource group that contains the resource. + * @param testBaseAccountName The resource name of the Test Base Account. + * @param packageName The resource name of the Test Base Package. + * @param options The options parameters. + */ + beginHardDeleteAndWait( + resourceGroupName: string, + testBaseAccountName: string, + packageName: string, + options?: PackagesHardDeleteOptionalParams + ): Promise; + /** + * Gets the download URL of a package. + * @param resourceGroupName The name of the resource group that contains the resource. + * @param testBaseAccountName The resource name of the Test Base Account. + * @param packageName The resource name of the Test Base Package. + * @param options The options parameters. + */ + getDownloadURL( + resourceGroupName: string, + testBaseAccountName: string, + packageName: string, + options?: PackagesGetDownloadURLOptionalParams + ): Promise; + /** + * Trigger a test run on the package. + * @param resourceGroupName The name of the resource group that contains the resource. + * @param testBaseAccountName The resource name of the Test Base Account. + * @param packageName The resource name of the Test Base Package. + * @param options The options parameters. + */ + runTest( + resourceGroupName: string, + testBaseAccountName: string, + packageName: string, + options?: PackagesRunTestOptionalParams + ): Promise; +} diff --git a/sdk/testbase/arm-testbase/src/operationsInterfaces/skus.ts b/sdk/testbase/arm-testbase/src/operationsInterfaces/skus.ts new file mode 100644 index 000000000000..16f8ff71772f --- /dev/null +++ b/sdk/testbase/arm-testbase/src/operationsInterfaces/skus.ts @@ -0,0 +1,22 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +import { PagedAsyncIterableIterator } from "@azure/core-paging"; +import { TestBaseAccountSKU, SkusListOptionalParams } from "../models"; + +/// +/** Interface representing a Skus. */ +export interface Skus { + /** + * Lists the available SKUs of Test Base Account in a subscription. + * @param options The options parameters. + */ + list( + options?: SkusListOptionalParams + ): PagedAsyncIterableIterator; +} diff --git a/sdk/testbase/arm-testbase/src/operationsInterfaces/testBaseAccounts.ts b/sdk/testbase/arm-testbase/src/operationsInterfaces/testBaseAccounts.ts new file mode 100644 index 000000000000..72c4b1a5a18c --- /dev/null +++ b/sdk/testbase/arm-testbase/src/operationsInterfaces/testBaseAccounts.ts @@ -0,0 +1,193 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +import { PagedAsyncIterableIterator } from "@azure/core-paging"; +import { PollerLike, PollOperationState } from "@azure/core-lro"; +import { + TestBaseAccountResource, + TestBaseAccountsListBySubscriptionOptionalParams, + TestBaseAccountsListByResourceGroupOptionalParams, + TestBaseAccountsCreateOptionalParams, + TestBaseAccountsCreateResponse, + TestBaseAccountUpdateParameters, + TestBaseAccountsUpdateOptionalParams, + TestBaseAccountsUpdateResponse, + TestBaseAccountsDeleteOptionalParams, + TestBaseAccountsGetOptionalParams, + TestBaseAccountsGetResponse, + TestBaseAccountsOffboardOptionalParams, + TestBaseAccountsGetFileUploadUrlOptionalParams, + TestBaseAccountsGetFileUploadUrlResponse, + PackageCheckNameAvailabilityParameters, + TestBaseAccountsCheckPackageNameAvailabilityOptionalParams, + TestBaseAccountsCheckPackageNameAvailabilityResponse +} from "../models"; + +/// +/** Interface representing a TestBaseAccounts. */ +export interface TestBaseAccounts { + /** + * Lists all the Test Base Accounts in a subscription. This API is required by ARM guidelines. + * @param options The options parameters. + */ + listBySubscription( + options?: TestBaseAccountsListBySubscriptionOptionalParams + ): PagedAsyncIterableIterator; + /** + * Lists all the Test Base Accounts in a resource group. + * @param resourceGroupName The name of the resource group that contains the resource. + * @param options The options parameters. + */ + listByResourceGroup( + resourceGroupName: string, + options?: TestBaseAccountsListByResourceGroupOptionalParams + ): PagedAsyncIterableIterator; + /** + * Create or replace (overwrite/recreate, with potential downtime) a Test Base Account in the specified + * subscription. + * @param resourceGroupName The name of the resource group that contains the resource. + * @param testBaseAccountName The resource name of the Test Base Account. + * @param parameters Parameters supplied to create a Test Base Account. + * @param options The options parameters. + */ + beginCreate( + resourceGroupName: string, + testBaseAccountName: string, + parameters: TestBaseAccountResource, + options?: TestBaseAccountsCreateOptionalParams + ): Promise< + PollerLike< + PollOperationState, + TestBaseAccountsCreateResponse + > + >; + /** + * Create or replace (overwrite/recreate, with potential downtime) a Test Base Account in the specified + * subscription. + * @param resourceGroupName The name of the resource group that contains the resource. + * @param testBaseAccountName The resource name of the Test Base Account. + * @param parameters Parameters supplied to create a Test Base Account. + * @param options The options parameters. + */ + beginCreateAndWait( + resourceGroupName: string, + testBaseAccountName: string, + parameters: TestBaseAccountResource, + options?: TestBaseAccountsCreateOptionalParams + ): Promise; + /** + * Update an existing Test Base Account. + * @param resourceGroupName The name of the resource group that contains the resource. + * @param testBaseAccountName The resource name of the Test Base Account. + * @param parameters Parameters supplied to update a Test Base Account. + * @param options The options parameters. + */ + beginUpdate( + resourceGroupName: string, + testBaseAccountName: string, + parameters: TestBaseAccountUpdateParameters, + options?: TestBaseAccountsUpdateOptionalParams + ): Promise< + PollerLike< + PollOperationState, + TestBaseAccountsUpdateResponse + > + >; + /** + * Update an existing Test Base Account. + * @param resourceGroupName The name of the resource group that contains the resource. + * @param testBaseAccountName The resource name of the Test Base Account. + * @param parameters Parameters supplied to update a Test Base Account. + * @param options The options parameters. + */ + beginUpdateAndWait( + resourceGroupName: string, + testBaseAccountName: string, + parameters: TestBaseAccountUpdateParameters, + options?: TestBaseAccountsUpdateOptionalParams + ): Promise; + /** + * Deletes a Test Base Account. + * @param resourceGroupName The name of the resource group that contains the resource. + * @param testBaseAccountName The resource name of the Test Base Account. + * @param options The options parameters. + */ + beginDelete( + resourceGroupName: string, + testBaseAccountName: string, + options?: TestBaseAccountsDeleteOptionalParams + ): Promise, void>>; + /** + * Deletes a Test Base Account. + * @param resourceGroupName The name of the resource group that contains the resource. + * @param testBaseAccountName The resource name of the Test Base Account. + * @param options The options parameters. + */ + beginDeleteAndWait( + resourceGroupName: string, + testBaseAccountName: string, + options?: TestBaseAccountsDeleteOptionalParams + ): Promise; + /** + * Gets a Test Base Account. + * @param resourceGroupName The name of the resource group that contains the resource. + * @param testBaseAccountName The resource name of the Test Base Account. + * @param options The options parameters. + */ + get( + resourceGroupName: string, + testBaseAccountName: string, + options?: TestBaseAccountsGetOptionalParams + ): Promise; + /** + * Offboard a Test Base Account. + * @param resourceGroupName The name of the resource group that contains the resource. + * @param testBaseAccountName The resource name of the Test Base Account. + * @param options The options parameters. + */ + beginOffboard( + resourceGroupName: string, + testBaseAccountName: string, + options?: TestBaseAccountsOffboardOptionalParams + ): Promise, void>>; + /** + * Offboard a Test Base Account. + * @param resourceGroupName The name of the resource group that contains the resource. + * @param testBaseAccountName The resource name of the Test Base Account. + * @param options The options parameters. + */ + beginOffboardAndWait( + resourceGroupName: string, + testBaseAccountName: string, + options?: TestBaseAccountsOffboardOptionalParams + ): Promise; + /** + * Gets the file upload URL of a Test Base Account. + * @param resourceGroupName The name of the resource group that contains the resource. + * @param testBaseAccountName The resource name of the Test Base Account. + * @param options The options parameters. + */ + getFileUploadUrl( + resourceGroupName: string, + testBaseAccountName: string, + options?: TestBaseAccountsGetFileUploadUrlOptionalParams + ): Promise; + /** + * Checks that the Test Base Package name and version is valid and is not already in use. + * @param resourceGroupName The name of the resource group that contains the resource. + * @param testBaseAccountName The resource name of the Test Base Account. + * @param parameters Parameters supplied to the Test Base Package CheckNameAvailability operation. + * @param options The options parameters. + */ + checkPackageNameAvailability( + resourceGroupName: string, + testBaseAccountName: string, + parameters: PackageCheckNameAvailabilityParameters, + options?: TestBaseAccountsCheckPackageNameAvailabilityOptionalParams + ): Promise; +} diff --git a/sdk/testbase/arm-testbase/src/operationsInterfaces/testResults.ts b/sdk/testbase/arm-testbase/src/operationsInterfaces/testResults.ts new file mode 100644 index 000000000000..b77faa650a8d --- /dev/null +++ b/sdk/testbase/arm-testbase/src/operationsInterfaces/testResults.ts @@ -0,0 +1,106 @@ +/* + * 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 { + TestResultResource, + OsUpdateType, + TestResultsListOptionalParams, + TestResultsGetOptionalParams, + TestResultsGetResponse, + TestResultsGetDownloadURLOptionalParams, + TestResultsGetDownloadURLResponse, + TestResultsGetVideoDownloadURLOptionalParams, + TestResultsGetVideoDownloadURLResponse, + TestResultConsoleLogDownloadURLParameters, + TestResultsGetConsoleLogDownloadURLOptionalParams, + TestResultsGetConsoleLogDownloadURLResponse +} from "../models"; + +/// +/** Interface representing a TestResults. */ +export interface TestResults { + /** + * Lists all the Test Results with specified OS Update type for a Test Base Package. Can be filtered by + * osName, releaseName, flightingRing, buildVersion, buildRevision. + * @param resourceGroupName The name of the resource group that contains the resource. + * @param testBaseAccountName The resource name of the Test Base Account. + * @param packageName The resource name of the Test Base Package. + * @param osUpdateType The type of the OS Update. + * @param options The options parameters. + */ + list( + resourceGroupName: string, + testBaseAccountName: string, + packageName: string, + osUpdateType: OsUpdateType, + options?: TestResultsListOptionalParams + ): PagedAsyncIterableIterator; + /** + * Get the Test Result by Id with specified OS Update type for a Test Base Package. + * @param resourceGroupName The name of the resource group that contains the resource. + * @param testBaseAccountName The resource name of the Test Base Account. + * @param packageName The resource name of the Test Base Package. + * @param testResultName The Test Result Name. It equals to TestResult-{TestResultId} string. + * @param options The options parameters. + */ + get( + resourceGroupName: string, + testBaseAccountName: string, + packageName: string, + testResultName: string, + options?: TestResultsGetOptionalParams + ): Promise; + /** + * Gets the download URL of the test result. + * @param resourceGroupName The name of the resource group that contains the resource. + * @param testBaseAccountName The resource name of the Test Base Account. + * @param packageName The resource name of the Test Base Package. + * @param testResultName The Test Result Name. It equals to TestResult-{TestResultId} string. + * @param options The options parameters. + */ + getDownloadURL( + resourceGroupName: string, + testBaseAccountName: string, + packageName: string, + testResultName: string, + options?: TestResultsGetDownloadURLOptionalParams + ): Promise; + /** + * Gets the download URL of the test execution screen recording. + * @param resourceGroupName The name of the resource group that contains the resource. + * @param testBaseAccountName The resource name of the Test Base Account. + * @param packageName The resource name of the Test Base Package. + * @param testResultName The Test Result Name. It equals to TestResult-{TestResultId} string. + * @param options The options parameters. + */ + getVideoDownloadURL( + resourceGroupName: string, + testBaseAccountName: string, + packageName: string, + testResultName: string, + options?: TestResultsGetVideoDownloadURLOptionalParams + ): Promise; + /** + * Gets the download URL of the test execution console log file. + * @param resourceGroupName The name of the resource group that contains the resource. + * @param testBaseAccountName The resource name of the Test Base Account. + * @param packageName The resource name of the Test Base Package. + * @param testResultName The Test Result Name. It equals to TestResult-{TestResultId} string. + * @param parameters Parameters supplied to the Test Result GetConsoleLogDownloadUrl operation. + * @param options The options parameters. + */ + getConsoleLogDownloadURL( + resourceGroupName: string, + testBaseAccountName: string, + packageName: string, + testResultName: string, + parameters: TestResultConsoleLogDownloadURLParameters, + options?: TestResultsGetConsoleLogDownloadURLOptionalParams + ): Promise; +} diff --git a/sdk/testbase/arm-testbase/src/operationsInterfaces/testSummaries.ts b/sdk/testbase/arm-testbase/src/operationsInterfaces/testSummaries.ts new file mode 100644 index 000000000000..e737dd9c0511 --- /dev/null +++ b/sdk/testbase/arm-testbase/src/operationsInterfaces/testSummaries.ts @@ -0,0 +1,45 @@ +/* + * 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 { + TestSummaryResource, + TestSummariesListOptionalParams, + TestSummariesGetOptionalParams, + TestSummariesGetResponse +} from "../models"; + +/// +/** Interface representing a TestSummaries. */ +export interface TestSummaries { + /** + * Lists the Test Summaries of all the packages under a Test Base Account. + * @param resourceGroupName The name of the resource group that contains the resource. + * @param testBaseAccountName The resource name of the Test Base Account. + * @param options The options parameters. + */ + list( + resourceGroupName: string, + testBaseAccountName: string, + options?: TestSummariesListOptionalParams + ): PagedAsyncIterableIterator; + /** + * Gets a Test Summary with specific name from all the Test Summaries of all the packages under a Test + * Base Account. + * @param resourceGroupName The name of the resource group that contains the resource. + * @param testBaseAccountName The resource name of the Test Base Account. + * @param testSummaryName The name of the Test Summary. + * @param options The options parameters. + */ + get( + resourceGroupName: string, + testBaseAccountName: string, + testSummaryName: string, + options?: TestSummariesGetOptionalParams + ): Promise; +} diff --git a/sdk/testbase/arm-testbase/src/operationsInterfaces/testTypes.ts b/sdk/testbase/arm-testbase/src/operationsInterfaces/testTypes.ts new file mode 100644 index 000000000000..6292820722a1 --- /dev/null +++ b/sdk/testbase/arm-testbase/src/operationsInterfaces/testTypes.ts @@ -0,0 +1,44 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +import { PagedAsyncIterableIterator } from "@azure/core-paging"; +import { + TestTypeResource, + TestTypesListOptionalParams, + TestTypesGetOptionalParams, + TestTypesGetResponse +} from "../models"; + +/// +/** Interface representing a TestTypes. */ +export interface TestTypes { + /** + * Lists all the test types of a Test Base Account. + * @param resourceGroupName The name of the resource group that contains the resource. + * @param testBaseAccountName The resource name of the Test Base Account. + * @param options The options parameters. + */ + list( + resourceGroupName: string, + testBaseAccountName: string, + options?: TestTypesListOptionalParams + ): PagedAsyncIterableIterator; + /** + * Gets a test type of a Test Base Account. + * @param resourceGroupName The name of the resource group that contains the resource. + * @param testBaseAccountName The resource name of the Test Base Account. + * @param testTypeResourceName The resource name of a test type. + * @param options The options parameters. + */ + get( + resourceGroupName: string, + testBaseAccountName: string, + testTypeResourceName: string, + options?: TestTypesGetOptionalParams + ): Promise; +} diff --git a/sdk/testbase/arm-testbase/src/operationsInterfaces/usage.ts b/sdk/testbase/arm-testbase/src/operationsInterfaces/usage.ts new file mode 100644 index 000000000000..9c13bfc05f62 --- /dev/null +++ b/sdk/testbase/arm-testbase/src/operationsInterfaces/usage.ts @@ -0,0 +1,26 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +import { PagedAsyncIterableIterator } from "@azure/core-paging"; +import { TestBaseAccountUsageData, UsageListOptionalParams } from "../models"; + +/// +/** Interface representing a Usage. */ +export interface Usage { + /** + * Lists the usage data of a Test Base Account. + * @param resourceGroupName The name of the resource group that contains the resource. + * @param testBaseAccountName The resource name of the Test Base Account. + * @param options The options parameters. + */ + list( + resourceGroupName: string, + testBaseAccountName: string, + options?: UsageListOptionalParams + ): PagedAsyncIterableIterator; +} diff --git a/sdk/testbase/arm-testbase/src/testBase.ts b/sdk/testbase/arm-testbase/src/testBase.ts new file mode 100644 index 000000000000..58e5afb911a1 --- /dev/null +++ b/sdk/testbase/arm-testbase/src/testBase.ts @@ -0,0 +1,198 @@ +/* + * 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 { + SkusImpl, + TestBaseAccountsImpl, + UsageImpl, + AvailableOSImpl, + FlightingRingsImpl, + TestTypesImpl, + PackagesImpl, + TestSummariesImpl, + TestResultsImpl, + OSUpdatesImpl, + FavoriteProcessesImpl, + AnalysisResultsImpl, + EmailEventsImpl, + CustomerEventsImpl, + OperationsImpl, + BillingHubServiceImpl +} from "./operations"; +import { + Skus, + TestBaseAccounts, + Usage, + AvailableOS, + FlightingRings, + TestTypes, + Packages, + TestSummaries, + TestResults, + OSUpdates, + FavoriteProcesses, + AnalysisResults, + EmailEvents, + CustomerEvents, + Operations, + BillingHubService +} from "./operationsInterfaces"; +import { TestBaseOptionalParams } from "./models"; + +export class TestBase extends coreClient.ServiceClient { + $host: string; + subscriptionId: string; + apiVersion: string; + + /** + * Initializes a new instance of the TestBase class. + * @param credentials Subscription credentials which uniquely identify client subscription. + * @param subscriptionId The Azure subscription ID. This is a GUID-formatted string. + * @param options The parameter options + */ + constructor( + credentials: coreAuth.TokenCredential, + subscriptionId: string, + options?: TestBaseOptionalParams + ) { + 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: TestBaseOptionalParams = { + requestContentType: "application/json; charset=utf-8", + credential: credentials + }; + + const packageDetails = `azsdk-js-arm-testbase/1.0.0-beta.1`; + const userAgentPrefix = + options.userAgentOptions && options.userAgentOptions.userAgentPrefix + ? `${options.userAgentOptions.userAgentPrefix} ${packageDetails}` + : `${packageDetails}`; + + if (!options.credentialScopes) { + options.credentialScopes = ["https://management.azure.com/.default"]; + } + const optionsWithDefaults = { + ...defaults, + ...options, + userAgentOptions: { + userAgentPrefix + }, + baseUri: + options.endpoint ?? options.baseUri ?? "https://management.azure.com" + }; + super(optionsWithDefaults); + + if (options?.pipeline && options.pipeline.getOrderedPolicies().length > 0) { + const pipelinePolicies: coreRestPipeline.PipelinePolicy[] = options.pipeline.getOrderedPolicies(); + const bearerTokenAuthenticationPolicyFound = pipelinePolicies.some( + (pipelinePolicy) => + pipelinePolicy.name === + coreRestPipeline.bearerTokenAuthenticationPolicyName + ); + if (!bearerTokenAuthenticationPolicyFound) { + this.pipeline.removePolicy({ + name: coreRestPipeline.bearerTokenAuthenticationPolicyName + }); + this.pipeline.addPolicy( + coreRestPipeline.bearerTokenAuthenticationPolicy({ + scopes: `${optionsWithDefaults.baseUri}/.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 || "2022-04-01-preview"; + this.skus = new SkusImpl(this); + this.testBaseAccounts = new TestBaseAccountsImpl(this); + this.usage = new UsageImpl(this); + this.availableOS = new AvailableOSImpl(this); + this.flightingRings = new FlightingRingsImpl(this); + this.testTypes = new TestTypesImpl(this); + this.packages = new PackagesImpl(this); + this.testSummaries = new TestSummariesImpl(this); + this.testResults = new TestResultsImpl(this); + this.oSUpdates = new OSUpdatesImpl(this); + this.favoriteProcesses = new FavoriteProcessesImpl(this); + this.analysisResults = new AnalysisResultsImpl(this); + this.emailEvents = new EmailEventsImpl(this); + this.customerEvents = new CustomerEventsImpl(this); + this.operations = new OperationsImpl(this); + this.billingHubService = new BillingHubServiceImpl(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 item.replace(/(?<==).*$/, apiVersion); + } else { + return item; + } + }); + request.url = param[0] + "?" + newParams.join("&"); + } + return next(request); + } + }; + this.pipeline.addPolicy(apiVersionPolicy); + } + + skus: Skus; + testBaseAccounts: TestBaseAccounts; + usage: Usage; + availableOS: AvailableOS; + flightingRings: FlightingRings; + testTypes: TestTypes; + packages: Packages; + testSummaries: TestSummaries; + testResults: TestResults; + oSUpdates: OSUpdates; + favoriteProcesses: FavoriteProcesses; + analysisResults: AnalysisResults; + emailEvents: EmailEvents; + customerEvents: CustomerEvents; + operations: Operations; + billingHubService: BillingHubService; +} diff --git a/sdk/testbase/arm-testbase/test/sampleTest.ts b/sdk/testbase/arm-testbase/test/sampleTest.ts new file mode 100644 index 000000000000..25aeb3ebcc36 --- /dev/null +++ b/sdk/testbase/arm-testbase/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/testbase/arm-testbase/tsconfig.json b/sdk/testbase/arm-testbase/tsconfig.json new file mode 100644 index 000000000000..3e6ae96443f3 --- /dev/null +++ b/sdk/testbase/arm-testbase/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/testbase/ci.mgmt.yml b/sdk/testbase/ci.mgmt.yml new file mode 100644 index 000000000000..c70c71923e7d --- /dev/null +++ b/sdk/testbase/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/testbase/arm-testbase + - sdk/testbase/ci.mgmt.yml + +pr: + branches: + include: + - main + - feature/* + - release/* + - hotfix/* + exclude: + - feature/v4 + paths: + include: + - sdk/testbase/arm-testbase + - sdk/testbase/ci.mgmt.yml + +extends: + template: /eng/pipelines/templates/stages/archetype-sdk-client.yml + parameters: + ServiceDirectory: testbase + Artifacts: + - name: azure-arm-testbase + safeName: azurearmtestbase + \ No newline at end of file