diff --git a/common/config/rush/pnpm-lock.yaml b/common/config/rush/pnpm-lock.yaml index d9bd6f800445..749cc309ada1 100644 --- a/common/config/rush/pnpm-lock.yaml +++ b/common/config/rush/pnpm-lock.yaml @@ -63,6 +63,7 @@ specifiers: '@rush-temp/arm-datamigration': file:./projects/arm-datamigration.tgz '@rush-temp/arm-deploymentmanager': file:./projects/arm-deploymentmanager.tgz '@rush-temp/arm-desktopvirtualization': file:./projects/arm-desktopvirtualization.tgz + '@rush-temp/arm-devcenter': file:./projects/arm-devcenter.tgz '@rush-temp/arm-deviceprovisioningservices': file:./projects/arm-deviceprovisioningservices.tgz '@rush-temp/arm-deviceupdate': file:./projects/arm-deviceupdate.tgz '@rush-temp/arm-devspaces': file:./projects/arm-devspaces.tgz @@ -358,6 +359,7 @@ dependencies: '@rush-temp/arm-datamigration': file:projects/arm-datamigration.tgz '@rush-temp/arm-deploymentmanager': file:projects/arm-deploymentmanager.tgz '@rush-temp/arm-desktopvirtualization': file:projects/arm-desktopvirtualization.tgz + '@rush-temp/arm-devcenter': file:projects/arm-devcenter.tgz '@rush-temp/arm-deviceprovisioningservices': file:projects/arm-deviceprovisioningservices.tgz '@rush-temp/arm-deviceupdate': file:projects/arm-deviceupdate.tgz '@rush-temp/arm-devspaces': file:projects/arm-devspaces.tgz @@ -11084,6 +11086,30 @@ packages: - supports-color dev: false + file:projects/arm-devcenter.tgz: + resolution: {integrity: sha512-4qANh0XbxoEUkr7etASuwy3/wCzMAj6xXc81OzInVfXDjOCCU9geMWlrlp3lKN1+tcX9yowdjHvQepJiNg+CvQ==, tarball: file:projects/arm-devcenter.tgz} + name: '@rush-temp/arm-devcenter' + version: 0.0.0 + dependencies: + '@azure/core-lro': 2.2.4 + '@microsoft/api-extractor': 7.18.11 + '@rollup/plugin-commonjs': 21.1.0_rollup@2.77.0 + '@rollup/plugin-json': 4.1.0_rollup@2.77.0 + '@rollup/plugin-multi-entry': 4.1.0_rollup@2.77.0 + '@rollup/plugin-node-resolve': 13.3.0_rollup@2.77.0 + cross-env: 7.0.3 + mkdirp: 1.0.4 + mocha: 7.2.0 + rimraf: 3.0.2 + rollup: 2.77.0 + rollup-plugin-sourcemaps: 0.6.3_rollup@2.77.0 + tslib: 2.4.0 + typescript: 4.2.4 + uglify-js: 3.16.2 + transitivePeerDependencies: + - '@types/node' + dev: false + file:projects/arm-deviceprovisioningservices.tgz: resolution: {integrity: sha512-ZrnaUN4vBTkd1wJ3g4EMV788FCG6nYXjqd9U5MVhbkzjy5cG4agTC5+bt0h8YnC2K6YhPpf59SnT691Iv+RdBQ==, tarball: file:projects/arm-deviceprovisioningservices.tgz} name: '@rush-temp/arm-deviceprovisioningservices' diff --git a/rush.json b/rush.json index 57c4665d7e4e..465d3a165494 100644 --- a/rush.json +++ b/rush.json @@ -375,7 +375,8 @@ "packageName": "@azure/ai-text-analytics", "projectFolder": "sdk/textanalytics/ai-text-analytics", "versionPolicyName": "client" - }, { + }, + { "packageName": "@azure/ai-language-text", "projectFolder": "sdk/cognitivelanguage/ai-language-text", "versionPolicyName": "client" @@ -1784,6 +1785,11 @@ "packageName": "@azure/arm-fluidrelay", "projectFolder": "sdk/fluidrelay/arm-fluidrelay", "versionPolicyName": "management" + }, + { + "packageName": "@azure/arm-devcenter", + "projectFolder": "sdk/devcenter/arm-devcenter", + "versionPolicyName": "management" } ] } \ No newline at end of file diff --git a/sdk/devcenter/arm-devcenter/CHANGELOG.md b/sdk/devcenter/arm-devcenter/CHANGELOG.md new file mode 100644 index 000000000000..3070389cb7b3 --- /dev/null +++ b/sdk/devcenter/arm-devcenter/CHANGELOG.md @@ -0,0 +1,5 @@ +# Release History + +## 1.0.0-beta.1 (2022-07-22) + +The package of @azure/arm-devcenter 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/devcenter/arm-devcenter/LICENSE b/sdk/devcenter/arm-devcenter/LICENSE new file mode 100644 index 000000000000..5d1d36e0af80 --- /dev/null +++ b/sdk/devcenter/arm-devcenter/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/devcenter/arm-devcenter/README.md b/sdk/devcenter/arm-devcenter/README.md new file mode 100644 index 000000000000..c967abd59f45 --- /dev/null +++ b/sdk/devcenter/arm-devcenter/README.md @@ -0,0 +1,109 @@ +# Azure DevCenter client library for JavaScript + +This package contains an isomorphic SDK (runs both in Node.js and in browsers) for Azure DevCenter client. + +DevCenter Management API + +[Source code](https://github.com/Azure/azure-sdk-for-js/tree/main/sdk/devcenter/arm-devcenter) | +[Package (NPM)](https://www.npmjs.com/package/@azure/arm-devcenter) | +[API reference documentation](https://docs.microsoft.com/javascript/api/@azure/arm-devcenter?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-devcenter` package + +Install the Azure DevCenter client library for JavaScript with `npm`: + +```bash +npm install @azure/arm-devcenter +``` + +### Create and authenticate a `DevCenterClient` + +To create a client object to access the Azure DevCenter API, you will need the `endpoint` of your Azure DevCenter resource and a `credential`. The Azure DevCenter client can use Azure Active Directory credentials to authenticate. +You can find the endpoint for your Azure DevCenter 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 DevCenter** 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 { DevCenterClient } = require("@azure/arm-devcenter"); +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 DevCenterClient(new DefaultAzureCredential(), subscriptionId); + +// For client-side applications running in the browser, use this code instead: +// const credential = new InteractiveBrowserCredential({ +// tenantId: "", +// clientId: "" +// }); +// const client = new DevCenterClient(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 + +### DevCenterClient + +`DevCenterClient` is the primary interface for developers using the Azure DevCenter client library. Explore the methods on this client object to understand the different features of the Azure DevCenter 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%2Fdevcenter%2Farm-devcenter%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/devcenter/arm-devcenter/_meta.json b/sdk/devcenter/arm-devcenter/_meta.json new file mode 100644 index 000000000000..fb9b93f70ed0 --- /dev/null +++ b/sdk/devcenter/arm-devcenter/_meta.json @@ -0,0 +1,8 @@ +{ + "commit": "43ca5ba8c01eafc595f418a66adb6c3c09d9b965", + "readme": "specification/devcenter/resource-manager/readme.md", + "autorest_command": "autorest --version=3.7.3 --typescript --modelerfour.lenient-model-deduplication --azure-arm --head-as-boolean=true --license-header=MICROSOFT_MIT_NO_VERSION --generate-test --typescript-sdks-folder=/mnt/vss/_work/1/s/azure-sdk-for-js ../azure-rest-api-specs/specification/devcenter/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.4.0", + "use": "@autorest/typescript@6.0.0-alpha.19.20220425.1" +} \ No newline at end of file diff --git a/sdk/devcenter/arm-devcenter/api-extractor.json b/sdk/devcenter/arm-devcenter/api-extractor.json new file mode 100644 index 000000000000..2c6a07bf4f1a --- /dev/null +++ b/sdk/devcenter/arm-devcenter/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-devcenter.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/devcenter/arm-devcenter/package.json b/sdk/devcenter/arm-devcenter/package.json new file mode 100644 index 000000000000..884a5721a8f1 --- /dev/null +++ b/sdk/devcenter/arm-devcenter/package.json @@ -0,0 +1,112 @@ +{ + "name": "@azure/arm-devcenter", + "sdk-type": "mgmt", + "author": "Microsoft Corporation", + "description": "A generated SDK for DevCenterClient.", + "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-devcenter.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/devcenter/arm-devcenter", + "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/devCenterClient.ts", + "prefix": "packageDetails" + } + ] + }, + "autoPublish": true +} \ No newline at end of file diff --git a/sdk/devcenter/arm-devcenter/review/arm-devcenter.api.md b/sdk/devcenter/arm-devcenter/review/arm-devcenter.api.md new file mode 100644 index 000000000000..26096a15c18a --- /dev/null +++ b/sdk/devcenter/arm-devcenter/review/arm-devcenter.api.md @@ -0,0 +1,1726 @@ +## API Report File for "@azure/arm-devcenter" + +> 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 ActionType = string; + +// @public +export type AttachedNetworkConnection = Resource & { + readonly provisioningState?: string; + networkConnectionId?: string; + readonly networkConnectionLocation?: string; + readonly healthCheckStatus?: HealthCheckStatus; + readonly domainJoinType?: DomainJoinType; +}; + +// @public +export interface AttachedNetworkListResult { + readonly nextLink?: string; + readonly value?: AttachedNetworkConnection[]; +} + +// @public +export interface AttachedNetworks { + beginCreateOrUpdate(resourceGroupName: string, devCenterName: string, attachedNetworkConnectionName: string, body: AttachedNetworkConnection, options?: AttachedNetworksCreateOrUpdateOptionalParams): Promise, AttachedNetworksCreateOrUpdateResponse>>; + beginCreateOrUpdateAndWait(resourceGroupName: string, devCenterName: string, attachedNetworkConnectionName: string, body: AttachedNetworkConnection, options?: AttachedNetworksCreateOrUpdateOptionalParams): Promise; + beginDelete(resourceGroupName: string, devCenterName: string, attachedNetworkConnectionName: string, options?: AttachedNetworksDeleteOptionalParams): Promise, void>>; + beginDeleteAndWait(resourceGroupName: string, devCenterName: string, attachedNetworkConnectionName: string, options?: AttachedNetworksDeleteOptionalParams): Promise; + getByDevCenter(resourceGroupName: string, devCenterName: string, attachedNetworkConnectionName: string, options?: AttachedNetworksGetByDevCenterOptionalParams): Promise; + getByProject(resourceGroupName: string, projectName: string, attachedNetworkConnectionName: string, options?: AttachedNetworksGetByProjectOptionalParams): Promise; + listByDevCenter(resourceGroupName: string, devCenterName: string, options?: AttachedNetworksListByDevCenterOptionalParams): PagedAsyncIterableIterator; + listByProject(resourceGroupName: string, projectName: string, options?: AttachedNetworksListByProjectOptionalParams): PagedAsyncIterableIterator; +} + +// @public +export interface AttachedNetworksCreateOrUpdateOptionalParams extends coreClient.OperationOptions { + resumeFrom?: string; + updateIntervalInMs?: number; +} + +// @public +export type AttachedNetworksCreateOrUpdateResponse = AttachedNetworkConnection; + +// @public +export interface AttachedNetworksDeleteOptionalParams extends coreClient.OperationOptions { + resumeFrom?: string; + updateIntervalInMs?: number; +} + +// @public +export interface AttachedNetworksGetByDevCenterOptionalParams extends coreClient.OperationOptions { +} + +// @public +export type AttachedNetworksGetByDevCenterResponse = AttachedNetworkConnection; + +// @public +export interface AttachedNetworksGetByProjectOptionalParams extends coreClient.OperationOptions { +} + +// @public +export type AttachedNetworksGetByProjectResponse = AttachedNetworkConnection; + +// @public +export interface AttachedNetworksListByDevCenterNextOptionalParams extends coreClient.OperationOptions { + top?: number; +} + +// @public +export type AttachedNetworksListByDevCenterNextResponse = AttachedNetworkListResult; + +// @public +export interface AttachedNetworksListByDevCenterOptionalParams extends coreClient.OperationOptions { + top?: number; +} + +// @public +export type AttachedNetworksListByDevCenterResponse = AttachedNetworkListResult; + +// @public +export interface AttachedNetworksListByProjectNextOptionalParams extends coreClient.OperationOptions { + top?: number; +} + +// @public +export type AttachedNetworksListByProjectNextResponse = AttachedNetworkListResult; + +// @public +export interface AttachedNetworksListByProjectOptionalParams extends coreClient.OperationOptions { + top?: number; +} + +// @public +export type AttachedNetworksListByProjectResponse = AttachedNetworkListResult; + +// @public +export interface Capability { + readonly name?: string; + readonly value?: string; +} + +// @public +export type Catalog = Resource & { + gitHub?: GitCatalog; + adoGit?: GitCatalog; + readonly provisioningState?: string; + readonly lastSyncTime?: Date; +}; + +// @public +export interface CatalogListResult { + readonly nextLink?: string; + readonly value?: Catalog[]; +} + +// @public +export type CatalogProperties = CatalogUpdateProperties & { + readonly provisioningState?: string; + readonly lastSyncTime?: Date; +}; + +// @public +export interface Catalogs { + beginCreateOrUpdate(resourceGroupName: string, devCenterName: string, catalogName: string, body: Catalog, options?: CatalogsCreateOrUpdateOptionalParams): Promise, CatalogsCreateOrUpdateResponse>>; + beginCreateOrUpdateAndWait(resourceGroupName: string, devCenterName: string, catalogName: string, body: Catalog, options?: CatalogsCreateOrUpdateOptionalParams): Promise; + beginDelete(resourceGroupName: string, devCenterName: string, catalogName: string, options?: CatalogsDeleteOptionalParams): Promise, void>>; + beginDeleteAndWait(resourceGroupName: string, devCenterName: string, catalogName: string, options?: CatalogsDeleteOptionalParams): Promise; + beginSync(resourceGroupName: string, devCenterName: string, catalogName: string, options?: CatalogsSyncOptionalParams): Promise, void>>; + beginSyncAndWait(resourceGroupName: string, devCenterName: string, catalogName: string, options?: CatalogsSyncOptionalParams): Promise; + beginUpdate(resourceGroupName: string, devCenterName: string, catalogName: string, body: CatalogUpdate, options?: CatalogsUpdateOptionalParams): Promise, CatalogsUpdateResponse>>; + beginUpdateAndWait(resourceGroupName: string, devCenterName: string, catalogName: string, body: CatalogUpdate, options?: CatalogsUpdateOptionalParams): Promise; + get(resourceGroupName: string, devCenterName: string, catalogName: string, options?: CatalogsGetOptionalParams): Promise; + listByDevCenter(resourceGroupName: string, devCenterName: string, options?: CatalogsListByDevCenterOptionalParams): PagedAsyncIterableIterator; +} + +// @public +export interface CatalogsCreateOrUpdateOptionalParams extends coreClient.OperationOptions { + resumeFrom?: string; + updateIntervalInMs?: number; +} + +// @public +export type CatalogsCreateOrUpdateResponse = Catalog; + +// @public +export interface CatalogsDeleteOptionalParams extends coreClient.OperationOptions { + resumeFrom?: string; + updateIntervalInMs?: number; +} + +// @public +export interface CatalogsGetOptionalParams extends coreClient.OperationOptions { +} + +// @public +export type CatalogsGetResponse = Catalog; + +// @public +export interface CatalogsListByDevCenterNextOptionalParams extends coreClient.OperationOptions { + top?: number; +} + +// @public +export type CatalogsListByDevCenterNextResponse = CatalogListResult; + +// @public +export interface CatalogsListByDevCenterOptionalParams extends coreClient.OperationOptions { + top?: number; +} + +// @public +export type CatalogsListByDevCenterResponse = CatalogListResult; + +// @public +export interface CatalogsSyncOptionalParams extends coreClient.OperationOptions { + resumeFrom?: string; + updateIntervalInMs?: number; +} + +// @public +export interface CatalogsUpdateOptionalParams extends coreClient.OperationOptions { + resumeFrom?: string; + updateIntervalInMs?: number; +} + +// @public +export type CatalogsUpdateResponse = Catalog; + +// @public +export interface CatalogUpdate { + adoGit?: GitCatalog; + gitHub?: GitCatalog; + tags?: { + [propertyName: string]: string; + }; +} + +// @public +export interface CatalogUpdateProperties { + adoGit?: GitCatalog; + gitHub?: GitCatalog; +} + +// @public +export interface CloudError { + error: CloudErrorBody; +} + +// @public +export interface CloudErrorBody { + code: string; + details?: CloudErrorBody[]; + message: string; + target?: string; +} + +// @public +export type CreatedByType = string; + +// @public +export type DevBoxDefinition = TrackedResource & { + imageReference?: ImageReference; + sku?: Sku; + osStorageType?: string; + readonly provisioningState?: string; + readonly imageValidationStatus?: ImageValidationStatus; + readonly imageValidationErrorDetails?: ImageValidationErrorDetails; + readonly activeImageReference?: ImageReference; +}; + +// @public +export interface DevBoxDefinitionListResult { + readonly nextLink?: string; + readonly value?: DevBoxDefinition[]; +} + +// @public +export type DevBoxDefinitionProperties = DevBoxDefinitionUpdateProperties & { + readonly provisioningState?: string; + readonly imageValidationStatus?: ImageValidationStatus; + readonly imageValidationErrorDetails?: ImageValidationErrorDetails; + readonly activeImageReference?: ImageReference; +}; + +// @public +export interface DevBoxDefinitions { + beginCreateOrUpdate(resourceGroupName: string, devCenterName: string, devBoxDefinitionName: string, body: DevBoxDefinition, options?: DevBoxDefinitionsCreateOrUpdateOptionalParams): Promise, DevBoxDefinitionsCreateOrUpdateResponse>>; + beginCreateOrUpdateAndWait(resourceGroupName: string, devCenterName: string, devBoxDefinitionName: string, body: DevBoxDefinition, options?: DevBoxDefinitionsCreateOrUpdateOptionalParams): Promise; + beginDelete(resourceGroupName: string, devCenterName: string, devBoxDefinitionName: string, options?: DevBoxDefinitionsDeleteOptionalParams): Promise, void>>; + beginDeleteAndWait(resourceGroupName: string, devCenterName: string, devBoxDefinitionName: string, options?: DevBoxDefinitionsDeleteOptionalParams): Promise; + beginUpdate(resourceGroupName: string, devCenterName: string, devBoxDefinitionName: string, body: DevBoxDefinitionUpdate, options?: DevBoxDefinitionsUpdateOptionalParams): Promise, DevBoxDefinitionsUpdateResponse>>; + beginUpdateAndWait(resourceGroupName: string, devCenterName: string, devBoxDefinitionName: string, body: DevBoxDefinitionUpdate, options?: DevBoxDefinitionsUpdateOptionalParams): Promise; + get(resourceGroupName: string, devCenterName: string, devBoxDefinitionName: string, options?: DevBoxDefinitionsGetOptionalParams): Promise; + getByProject(resourceGroupName: string, projectName: string, devBoxDefinitionName: string, options?: DevBoxDefinitionsGetByProjectOptionalParams): Promise; + listByDevCenter(resourceGroupName: string, devCenterName: string, options?: DevBoxDefinitionsListByDevCenterOptionalParams): PagedAsyncIterableIterator; + listByProject(resourceGroupName: string, projectName: string, options?: DevBoxDefinitionsListByProjectOptionalParams): PagedAsyncIterableIterator; +} + +// @public +export interface DevBoxDefinitionsCreateOrUpdateOptionalParams extends coreClient.OperationOptions { + resumeFrom?: string; + updateIntervalInMs?: number; +} + +// @public +export type DevBoxDefinitionsCreateOrUpdateResponse = DevBoxDefinition; + +// @public +export interface DevBoxDefinitionsDeleteOptionalParams extends coreClient.OperationOptions { + resumeFrom?: string; + updateIntervalInMs?: number; +} + +// @public +export interface DevBoxDefinitionsGetByProjectOptionalParams extends coreClient.OperationOptions { +} + +// @public +export type DevBoxDefinitionsGetByProjectResponse = DevBoxDefinition; + +// @public +export interface DevBoxDefinitionsGetOptionalParams extends coreClient.OperationOptions { +} + +// @public +export type DevBoxDefinitionsGetResponse = DevBoxDefinition; + +// @public +export interface DevBoxDefinitionsListByDevCenterNextOptionalParams extends coreClient.OperationOptions { + top?: number; +} + +// @public +export type DevBoxDefinitionsListByDevCenterNextResponse = DevBoxDefinitionListResult; + +// @public +export interface DevBoxDefinitionsListByDevCenterOptionalParams extends coreClient.OperationOptions { + top?: number; +} + +// @public +export type DevBoxDefinitionsListByDevCenterResponse = DevBoxDefinitionListResult; + +// @public +export interface DevBoxDefinitionsListByProjectNextOptionalParams extends coreClient.OperationOptions { + top?: number; +} + +// @public +export type DevBoxDefinitionsListByProjectNextResponse = DevBoxDefinitionListResult; + +// @public +export interface DevBoxDefinitionsListByProjectOptionalParams extends coreClient.OperationOptions { + top?: number; +} + +// @public +export type DevBoxDefinitionsListByProjectResponse = DevBoxDefinitionListResult; + +// @public +export interface DevBoxDefinitionsUpdateOptionalParams extends coreClient.OperationOptions { + resumeFrom?: string; + updateIntervalInMs?: number; +} + +// @public +export type DevBoxDefinitionsUpdateResponse = DevBoxDefinition; + +// @public +export type DevBoxDefinitionUpdate = TrackedResourceUpdate & { + imageReference?: ImageReference; + sku?: Sku; + osStorageType?: string; +}; + +// @public +export interface DevBoxDefinitionUpdateProperties { + imageReference?: ImageReference; + osStorageType?: string; + sku?: Sku; +} + +// @public +export type DevCenter = TrackedResource & { + identity?: ManagedServiceIdentity; + readonly provisioningState?: string; +}; + +// @public (undocumented) +export class DevCenterClient extends coreClient.ServiceClient { + // (undocumented) + $host: string; + constructor(credentials: coreAuth.TokenCredential, subscriptionId: string, options?: DevCenterClientOptionalParams); + // (undocumented) + apiVersion: string; + // (undocumented) + attachedNetworks: AttachedNetworks; + // (undocumented) + catalogs: Catalogs; + // (undocumented) + devBoxDefinitions: DevBoxDefinitions; + // (undocumented) + devCenters: DevCenters; + // (undocumented) + environmentTypes: EnvironmentTypes; + // (undocumented) + galleries: Galleries; + // (undocumented) + images: Images; + // (undocumented) + imageVersions: ImageVersions; + // (undocumented) + networkConnections: NetworkConnections; + // (undocumented) + operations: Operations; + // (undocumented) + operationStatuses: OperationStatuses; + // (undocumented) + pools: Pools; + // (undocumented) + projectEnvironmentTypes: ProjectEnvironmentTypes; + // (undocumented) + projects: Projects; + // (undocumented) + schedules: Schedules; + // (undocumented) + skus: Skus; + // (undocumented) + subscriptionId: string; + // (undocumented) + usages: Usages; +} + +// @public +export interface DevCenterClientOptionalParams extends coreClient.ServiceClientOptions { + $host?: string; + apiVersion?: string; + endpoint?: string; +} + +// @public +export interface DevCenterListResult { + readonly nextLink?: string; + readonly value?: DevCenter[]; +} + +// @public +export interface DevCenters { + beginCreateOrUpdate(resourceGroupName: string, devCenterName: string, body: DevCenter, options?: DevCentersCreateOrUpdateOptionalParams): Promise, DevCentersCreateOrUpdateResponse>>; + beginCreateOrUpdateAndWait(resourceGroupName: string, devCenterName: string, body: DevCenter, options?: DevCentersCreateOrUpdateOptionalParams): Promise; + beginDelete(resourceGroupName: string, devCenterName: string, options?: DevCentersDeleteOptionalParams): Promise, void>>; + beginDeleteAndWait(resourceGroupName: string, devCenterName: string, options?: DevCentersDeleteOptionalParams): Promise; + beginUpdate(resourceGroupName: string, devCenterName: string, body: DevCenterUpdate, options?: DevCentersUpdateOptionalParams): Promise, DevCentersUpdateResponse>>; + beginUpdateAndWait(resourceGroupName: string, devCenterName: string, body: DevCenterUpdate, options?: DevCentersUpdateOptionalParams): Promise; + get(resourceGroupName: string, devCenterName: string, options?: DevCentersGetOptionalParams): Promise; + listByResourceGroup(resourceGroupName: string, options?: DevCentersListByResourceGroupOptionalParams): PagedAsyncIterableIterator; + listBySubscription(options?: DevCentersListBySubscriptionOptionalParams): PagedAsyncIterableIterator; +} + +// @public +export interface DevCentersCreateOrUpdateOptionalParams extends coreClient.OperationOptions { + resumeFrom?: string; + updateIntervalInMs?: number; +} + +// @public +export type DevCentersCreateOrUpdateResponse = DevCenter; + +// @public +export interface DevCentersDeleteOptionalParams extends coreClient.OperationOptions { + resumeFrom?: string; + updateIntervalInMs?: number; +} + +// @public +export interface DevCentersGetOptionalParams extends coreClient.OperationOptions { +} + +// @public +export type DevCentersGetResponse = DevCenter; + +// @public +export type DevCenterSku = Sku & { + readonly resourceType?: string; + readonly locations?: string[]; + readonly capabilities?: Capability[]; +}; + +// @public +export interface DevCentersListByResourceGroupNextOptionalParams extends coreClient.OperationOptions { + top?: number; +} + +// @public +export type DevCentersListByResourceGroupNextResponse = DevCenterListResult; + +// @public +export interface DevCentersListByResourceGroupOptionalParams extends coreClient.OperationOptions { + top?: number; +} + +// @public +export type DevCentersListByResourceGroupResponse = DevCenterListResult; + +// @public +export interface DevCentersListBySubscriptionNextOptionalParams extends coreClient.OperationOptions { + top?: number; +} + +// @public +export type DevCentersListBySubscriptionNextResponse = DevCenterListResult; + +// @public +export interface DevCentersListBySubscriptionOptionalParams extends coreClient.OperationOptions { + top?: number; +} + +// @public +export type DevCentersListBySubscriptionResponse = DevCenterListResult; + +// @public +export interface DevCentersUpdateOptionalParams extends coreClient.OperationOptions { + resumeFrom?: string; + updateIntervalInMs?: number; +} + +// @public +export type DevCentersUpdateResponse = DevCenter; + +// @public +export type DevCenterUpdate = TrackedResourceUpdate & { + identity?: ManagedServiceIdentity; +}; + +// @public +export type DomainJoinType = string; + +// @public +export type EnableStatus = string; + +// @public +export interface EnvironmentRole { + readonly description?: string; + readonly roleName?: string; +} + +// @public +export type EnvironmentType = Resource & { + tags?: { + [propertyName: string]: string; + }; + readonly provisioningState?: string; +}; + +// @public +export interface EnvironmentTypeListResult { + readonly nextLink?: string; + readonly value?: EnvironmentType[]; +} + +// @public +export interface EnvironmentTypes { + createOrUpdate(resourceGroupName: string, devCenterName: string, environmentTypeName: string, body: EnvironmentType, options?: EnvironmentTypesCreateOrUpdateOptionalParams): Promise; + delete(resourceGroupName: string, devCenterName: string, environmentTypeName: string, options?: EnvironmentTypesDeleteOptionalParams): Promise; + get(resourceGroupName: string, devCenterName: string, environmentTypeName: string, options?: EnvironmentTypesGetOptionalParams): Promise; + listByDevCenter(resourceGroupName: string, devCenterName: string, options?: EnvironmentTypesListByDevCenterOptionalParams): PagedAsyncIterableIterator; + update(resourceGroupName: string, devCenterName: string, environmentTypeName: string, body: EnvironmentTypeUpdate, options?: EnvironmentTypesUpdateOptionalParams): Promise; +} + +// @public +export interface EnvironmentTypesCreateOrUpdateOptionalParams extends coreClient.OperationOptions { +} + +// @public +export type EnvironmentTypesCreateOrUpdateResponse = EnvironmentType; + +// @public +export interface EnvironmentTypesDeleteOptionalParams extends coreClient.OperationOptions { +} + +// @public +export interface EnvironmentTypesGetOptionalParams extends coreClient.OperationOptions { +} + +// @public +export type EnvironmentTypesGetResponse = EnvironmentType; + +// @public +export interface EnvironmentTypesListByDevCenterNextOptionalParams extends coreClient.OperationOptions { + top?: number; +} + +// @public +export type EnvironmentTypesListByDevCenterNextResponse = EnvironmentTypeListResult; + +// @public +export interface EnvironmentTypesListByDevCenterOptionalParams extends coreClient.OperationOptions { + top?: number; +} + +// @public +export type EnvironmentTypesListByDevCenterResponse = EnvironmentTypeListResult; + +// @public +export interface EnvironmentTypesUpdateOptionalParams extends coreClient.OperationOptions { +} + +// @public +export type EnvironmentTypesUpdateResponse = EnvironmentType; + +// @public +export interface EnvironmentTypeUpdate { + tags?: { + [propertyName: string]: string; + }; +} + +// @public +export interface Galleries { + beginCreateOrUpdate(resourceGroupName: string, devCenterName: string, galleryName: string, body: Gallery, options?: GalleriesCreateOrUpdateOptionalParams): Promise, GalleriesCreateOrUpdateResponse>>; + beginCreateOrUpdateAndWait(resourceGroupName: string, devCenterName: string, galleryName: string, body: Gallery, options?: GalleriesCreateOrUpdateOptionalParams): Promise; + beginDelete(resourceGroupName: string, devCenterName: string, galleryName: string, options?: GalleriesDeleteOptionalParams): Promise, void>>; + beginDeleteAndWait(resourceGroupName: string, devCenterName: string, galleryName: string, options?: GalleriesDeleteOptionalParams): Promise; + get(resourceGroupName: string, devCenterName: string, galleryName: string, options?: GalleriesGetOptionalParams): Promise; + listByDevCenter(resourceGroupName: string, devCenterName: string, options?: GalleriesListByDevCenterOptionalParams): PagedAsyncIterableIterator; +} + +// @public +export interface GalleriesCreateOrUpdateOptionalParams extends coreClient.OperationOptions { + resumeFrom?: string; + updateIntervalInMs?: number; +} + +// @public +export type GalleriesCreateOrUpdateResponse = Gallery; + +// @public +export interface GalleriesDeleteOptionalParams extends coreClient.OperationOptions { + resumeFrom?: string; + updateIntervalInMs?: number; +} + +// @public +export interface GalleriesGetOptionalParams extends coreClient.OperationOptions { +} + +// @public +export type GalleriesGetResponse = Gallery; + +// @public +export interface GalleriesListByDevCenterNextOptionalParams extends coreClient.OperationOptions { + top?: number; +} + +// @public +export type GalleriesListByDevCenterNextResponse = GalleryListResult; + +// @public +export interface GalleriesListByDevCenterOptionalParams extends coreClient.OperationOptions { + top?: number; +} + +// @public +export type GalleriesListByDevCenterResponse = GalleryListResult; + +// @public +export type Gallery = Resource & { + readonly provisioningState?: string; + galleryResourceId?: string; +}; + +// @public +export interface GalleryListResult { + readonly nextLink?: string; + readonly value?: Gallery[]; +} + +// @public +export interface GitCatalog { + branch?: string; + path?: string; + secretIdentifier?: string; + uri?: string; +} + +// @public +export interface HealthCheck { + readonly additionalDetails?: string; + readonly displayName?: string; + readonly endDateTime?: Date; + readonly errorType?: string; + readonly recommendedAction?: string; + readonly startDateTime?: Date; + readonly status?: HealthCheckStatus; +} + +// @public +export type HealthCheckStatus = string; + +// @public +export type HealthCheckStatusDetails = Resource & { + readonly startDateTime?: Date; + readonly endDateTime?: Date; + readonly healthChecks?: HealthCheck[]; +}; + +// @public +export interface HealthCheckStatusDetailsListResult { + readonly nextLink?: string; + readonly value?: HealthCheckStatusDetails[]; +} + +// @public +type Image_2 = ProxyResource & { + readonly description?: string; + readonly publisher?: string; + readonly offer?: string; + readonly sku?: string; + readonly recommendedMachineConfiguration?: RecommendedMachineConfiguration; + readonly provisioningState?: string; +}; +export { Image_2 as Image } + +// @public +export interface ImageListResult { + readonly nextLink?: string; + readonly value?: Image_2[]; +} + +// @public +export interface ImageReference { + readonly exactVersion?: string; + id?: string; + offer?: string; + publisher?: string; + sku?: string; +} + +// @public +export interface Images { + get(resourceGroupName: string, devCenterName: string, galleryName: string, imageName: string, options?: ImagesGetOptionalParams): Promise; + listByDevCenter(resourceGroupName: string, devCenterName: string, options?: ImagesListByDevCenterOptionalParams): PagedAsyncIterableIterator; + listByGallery(resourceGroupName: string, devCenterName: string, galleryName: string, options?: ImagesListByGalleryOptionalParams): PagedAsyncIterableIterator; +} + +// @public +export interface ImagesGetOptionalParams extends coreClient.OperationOptions { +} + +// @public +export type ImagesGetResponse = Image_2; + +// @public +export interface ImagesListByDevCenterNextOptionalParams extends coreClient.OperationOptions { + top?: number; +} + +// @public +export type ImagesListByDevCenterNextResponse = ImageListResult; + +// @public +export interface ImagesListByDevCenterOptionalParams extends coreClient.OperationOptions { + top?: number; +} + +// @public +export type ImagesListByDevCenterResponse = ImageListResult; + +// @public +export interface ImagesListByGalleryNextOptionalParams extends coreClient.OperationOptions { + top?: number; +} + +// @public +export type ImagesListByGalleryNextResponse = ImageListResult; + +// @public +export interface ImagesListByGalleryOptionalParams extends coreClient.OperationOptions { + top?: number; +} + +// @public +export type ImagesListByGalleryResponse = ImageListResult; + +// @public +export interface ImageValidationErrorDetails { + code?: string; + message?: string; +} + +// @public +export type ImageValidationStatus = string; + +// @public +export type ImageVersion = ProxyResource & { + readonly namePropertiesName?: string; + readonly publishedDate?: Date; + readonly excludeFromLatest?: boolean; + readonly osDiskImageSizeInGb?: number; + readonly provisioningState?: string; +}; + +// @public +export interface ImageVersionListResult { + readonly nextLink?: string; + readonly value?: ImageVersion[]; +} + +// @public +export interface ImageVersions { + get(resourceGroupName: string, devCenterName: string, galleryName: string, imageName: string, versionName: string, options?: ImageVersionsGetOptionalParams): Promise; + listByImage(resourceGroupName: string, devCenterName: string, galleryName: string, imageName: string, options?: ImageVersionsListByImageOptionalParams): PagedAsyncIterableIterator; +} + +// @public +export interface ImageVersionsGetOptionalParams extends coreClient.OperationOptions { +} + +// @public +export type ImageVersionsGetResponse = ImageVersion; + +// @public +export interface ImageVersionsListByImageNextOptionalParams extends coreClient.OperationOptions { +} + +// @public +export type ImageVersionsListByImageNextResponse = ImageVersionListResult; + +// @public +export interface ImageVersionsListByImageOptionalParams extends coreClient.OperationOptions { +} + +// @public +export type ImageVersionsListByImageResponse = ImageVersionListResult; + +// @public +export enum KnownActionType { + // (undocumented) + Internal = "Internal" +} + +// @public +export enum KnownCreatedByType { + // (undocumented) + Application = "Application", + // (undocumented) + Key = "Key", + // (undocumented) + ManagedIdentity = "ManagedIdentity", + // (undocumented) + User = "User" +} + +// @public +export enum KnownDomainJoinType { + // (undocumented) + AzureADJoin = "AzureADJoin", + // (undocumented) + HybridAzureADJoin = "HybridAzureADJoin" +} + +// @public +export enum KnownEnableStatus { + // (undocumented) + Disabled = "Disabled", + // (undocumented) + Enabled = "Enabled" +} + +// @public +export enum KnownHealthCheckStatus { + // (undocumented) + Failed = "Failed", + // (undocumented) + Passed = "Passed", + // (undocumented) + Pending = "Pending", + // (undocumented) + Running = "Running", + // (undocumented) + Unknown = "Unknown", + // (undocumented) + Warning = "Warning" +} + +// @public +export enum KnownImageValidationStatus { + // (undocumented) + Failed = "Failed", + // (undocumented) + Pending = "Pending", + // (undocumented) + Succeeded = "Succeeded", + // (undocumented) + TimedOut = "TimedOut", + // (undocumented) + Unknown = "Unknown" +} + +// @public +export enum KnownLicenseType { + // (undocumented) + WindowsClient = "Windows_Client" +} + +// @public +export enum KnownLocalAdminStatus { + // (undocumented) + Disabled = "Disabled", + // (undocumented) + Enabled = "Enabled" +} + +// @public +export enum KnownManagedServiceIdentityType { + // (undocumented) + None = "None", + // (undocumented) + SystemAssigned = "SystemAssigned", + // (undocumented) + SystemAssignedUserAssigned = "SystemAssigned, UserAssigned", + // (undocumented) + UserAssigned = "UserAssigned" +} + +// @public +export enum KnownOrigin { + // (undocumented) + System = "system", + // (undocumented) + User = "user", + // (undocumented) + UserSystem = "user,system" +} + +// @public +export enum KnownScheduledFrequency { + // (undocumented) + Daily = "Daily" +} + +// @public +export enum KnownScheduledType { + // (undocumented) + StopDevBox = "StopDevBox" +} + +// @public +export enum KnownUsageUnit { + // (undocumented) + Count = "Count" +} + +// @public +export type LicenseType = string; + +// @public +export interface ListUsagesResult { + readonly nextLink?: string; + readonly value?: Usage[]; +} + +// @public +export type LocalAdminStatus = string; + +// @public +export interface ManagedServiceIdentity { + readonly principalId?: string; + readonly tenantId?: string; + type: ManagedServiceIdentityType; + userAssignedIdentities?: { + [propertyName: string]: UserAssignedIdentity; + }; +} + +// @public +export type ManagedServiceIdentityType = string; + +// @public +export type NetworkConnection = TrackedResource & { + subnetId?: string; + domainName?: string; + organizationUnit?: string; + domainUsername?: string; + domainPassword?: string; + readonly provisioningState?: string; + readonly healthCheckStatus?: HealthCheckStatus; + networkingResourceGroupName?: string; + domainJoinType?: DomainJoinType; +}; + +// @public +export interface NetworkConnectionListResult { + readonly nextLink?: string; + readonly value?: NetworkConnection[]; +} + +// @public +export interface NetworkConnections { + beginCreateOrUpdate(resourceGroupName: string, networkConnectionName: string, body: NetworkConnection, options?: NetworkConnectionsCreateOrUpdateOptionalParams): Promise, NetworkConnectionsCreateOrUpdateResponse>>; + beginCreateOrUpdateAndWait(resourceGroupName: string, networkConnectionName: string, body: NetworkConnection, options?: NetworkConnectionsCreateOrUpdateOptionalParams): Promise; + beginDelete(resourceGroupName: string, networkConnectionName: string, options?: NetworkConnectionsDeleteOptionalParams): Promise, void>>; + beginDeleteAndWait(resourceGroupName: string, networkConnectionName: string, options?: NetworkConnectionsDeleteOptionalParams): Promise; + beginUpdate(resourceGroupName: string, networkConnectionName: string, body: NetworkConnectionUpdate, options?: NetworkConnectionsUpdateOptionalParams): Promise, NetworkConnectionsUpdateResponse>>; + beginUpdateAndWait(resourceGroupName: string, networkConnectionName: string, body: NetworkConnectionUpdate, options?: NetworkConnectionsUpdateOptionalParams): Promise; + get(resourceGroupName: string, networkConnectionName: string, options?: NetworkConnectionsGetOptionalParams): Promise; + getHealthDetails(resourceGroupName: string, networkConnectionName: string, options?: NetworkConnectionsGetHealthDetailsOptionalParams): Promise; + listByResourceGroup(resourceGroupName: string, options?: NetworkConnectionsListByResourceGroupOptionalParams): PagedAsyncIterableIterator; + listBySubscription(options?: NetworkConnectionsListBySubscriptionOptionalParams): PagedAsyncIterableIterator; + listHealthDetails(resourceGroupName: string, networkConnectionName: string, options?: NetworkConnectionsListHealthDetailsOptionalParams): PagedAsyncIterableIterator; + runHealthChecks(resourceGroupName: string, networkConnectionName: string, options?: NetworkConnectionsRunHealthChecksOptionalParams): Promise; +} + +// @public +export interface NetworkConnectionsCreateOrUpdateOptionalParams extends coreClient.OperationOptions { + resumeFrom?: string; + updateIntervalInMs?: number; +} + +// @public +export type NetworkConnectionsCreateOrUpdateResponse = NetworkConnection; + +// @public +export interface NetworkConnectionsDeleteOptionalParams extends coreClient.OperationOptions { + resumeFrom?: string; + updateIntervalInMs?: number; +} + +// @public +export interface NetworkConnectionsGetHealthDetailsOptionalParams extends coreClient.OperationOptions { +} + +// @public +export type NetworkConnectionsGetHealthDetailsResponse = HealthCheckStatusDetails; + +// @public +export interface NetworkConnectionsGetOptionalParams extends coreClient.OperationOptions { +} + +// @public +export type NetworkConnectionsGetResponse = NetworkConnection; + +// @public +export interface NetworkConnectionsListByResourceGroupNextOptionalParams extends coreClient.OperationOptions { + top?: number; +} + +// @public +export type NetworkConnectionsListByResourceGroupNextResponse = NetworkConnectionListResult; + +// @public +export interface NetworkConnectionsListByResourceGroupOptionalParams extends coreClient.OperationOptions { + top?: number; +} + +// @public +export type NetworkConnectionsListByResourceGroupResponse = NetworkConnectionListResult; + +// @public +export interface NetworkConnectionsListBySubscriptionNextOptionalParams extends coreClient.OperationOptions { + top?: number; +} + +// @public +export type NetworkConnectionsListBySubscriptionNextResponse = NetworkConnectionListResult; + +// @public +export interface NetworkConnectionsListBySubscriptionOptionalParams extends coreClient.OperationOptions { + top?: number; +} + +// @public +export type NetworkConnectionsListBySubscriptionResponse = NetworkConnectionListResult; + +// @public +export interface NetworkConnectionsListHealthDetailsNextOptionalParams extends coreClient.OperationOptions { + top?: number; +} + +// @public +export type NetworkConnectionsListHealthDetailsNextResponse = HealthCheckStatusDetailsListResult; + +// @public +export interface NetworkConnectionsListHealthDetailsOptionalParams extends coreClient.OperationOptions { + top?: number; +} + +// @public +export type NetworkConnectionsListHealthDetailsResponse = HealthCheckStatusDetailsListResult; + +// @public +export interface NetworkConnectionsRunHealthChecksOptionalParams extends coreClient.OperationOptions { +} + +// @public +export interface NetworkConnectionsUpdateOptionalParams extends coreClient.OperationOptions { + resumeFrom?: string; + updateIntervalInMs?: number; +} + +// @public +export type NetworkConnectionsUpdateResponse = NetworkConnection; + +// @public +export type NetworkConnectionUpdate = TrackedResourceUpdate & { + subnetId?: string; + domainName?: string; + organizationUnit?: string; + domainUsername?: string; + domainPassword?: string; +}; + +// @public +export interface NetworkConnectionUpdateProperties { + domainName?: string; + domainPassword?: string; + domainUsername?: string; + organizationUnit?: string; + subnetId?: string; +} + +// @public +export type NetworkProperties = NetworkConnectionUpdateProperties & { + readonly provisioningState?: string; + readonly healthCheckStatus?: HealthCheckStatus; + networkingResourceGroupName?: string; + domainJoinType: DomainJoinType; +}; + +// @public +export interface Operation { + readonly actionType?: ActionType; + display?: OperationDisplay; + readonly isDataAction?: boolean; + readonly name?: string; + readonly origin?: Origin; +} + +// @public +export interface OperationDisplay { + readonly description?: string; + readonly operation?: string; + readonly provider?: string; + readonly resource?: string; +} + +// @public +export interface OperationListResult { + readonly nextLink?: string; + readonly 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 OperationStatus { + readonly endTime?: Date; + error?: OperationStatusError; + readonly id?: string; + readonly name?: string; + readonly percentComplete?: number; + readonly properties?: Record; + readonly startTime?: Date; + readonly status?: string; +} + +// @public +export interface OperationStatusError { + readonly code?: string; + readonly message?: string; +} + +// @public +export interface OperationStatuses { + get(location: string, operationId: string, options?: OperationStatusesGetOptionalParams): Promise; +} + +// @public +export interface OperationStatusesGetOptionalParams extends coreClient.OperationOptions { +} + +// @public +export type OperationStatusesGetResponse = OperationStatus; + +// @public +export type Origin = string; + +// @public +export type Pool = TrackedResource & { + devBoxDefinitionName?: string; + networkConnectionName?: string; + licenseType?: LicenseType; + localAdministrator?: LocalAdminStatus; + readonly provisioningState?: string; +}; + +// @public +export interface PoolListResult { + readonly nextLink?: string; + readonly value?: Pool[]; +} + +// @public +export type PoolProperties = PoolUpdateProperties & { + readonly provisioningState?: string; +}; + +// @public +export interface Pools { + beginCreateOrUpdate(resourceGroupName: string, projectName: string, poolName: string, body: Pool, options?: PoolsCreateOrUpdateOptionalParams): Promise, PoolsCreateOrUpdateResponse>>; + beginCreateOrUpdateAndWait(resourceGroupName: string, projectName: string, poolName: string, body: Pool, options?: PoolsCreateOrUpdateOptionalParams): Promise; + beginDelete(resourceGroupName: string, projectName: string, poolName: string, options?: PoolsDeleteOptionalParams): Promise, void>>; + beginDeleteAndWait(resourceGroupName: string, projectName: string, poolName: string, options?: PoolsDeleteOptionalParams): Promise; + beginUpdate(resourceGroupName: string, projectName: string, poolName: string, body: PoolUpdate, options?: PoolsUpdateOptionalParams): Promise, PoolsUpdateResponse>>; + beginUpdateAndWait(resourceGroupName: string, projectName: string, poolName: string, body: PoolUpdate, options?: PoolsUpdateOptionalParams): Promise; + get(resourceGroupName: string, projectName: string, poolName: string, options?: PoolsGetOptionalParams): Promise; + listByProject(resourceGroupName: string, projectName: string, options?: PoolsListByProjectOptionalParams): PagedAsyncIterableIterator; +} + +// @public +export interface PoolsCreateOrUpdateOptionalParams extends coreClient.OperationOptions { + resumeFrom?: string; + updateIntervalInMs?: number; +} + +// @public +export type PoolsCreateOrUpdateResponse = Pool; + +// @public +export interface PoolsDeleteOptionalParams extends coreClient.OperationOptions { + resumeFrom?: string; + updateIntervalInMs?: number; +} + +// @public +export interface PoolsGetOptionalParams extends coreClient.OperationOptions { +} + +// @public +export type PoolsGetResponse = Pool; + +// @public +export interface PoolsListByProjectNextOptionalParams extends coreClient.OperationOptions { + top?: number; +} + +// @public +export type PoolsListByProjectNextResponse = PoolListResult; + +// @public +export interface PoolsListByProjectOptionalParams extends coreClient.OperationOptions { + top?: number; +} + +// @public +export type PoolsListByProjectResponse = PoolListResult; + +// @public +export interface PoolsUpdateOptionalParams extends coreClient.OperationOptions { + resumeFrom?: string; + updateIntervalInMs?: number; +} + +// @public +export type PoolsUpdateResponse = Pool; + +// @public +export type PoolUpdate = TrackedResourceUpdate & { + devBoxDefinitionName?: string; + networkConnectionName?: string; + licenseType?: LicenseType; + localAdministrator?: LocalAdminStatus; +}; + +// @public +export interface PoolUpdateProperties { + devBoxDefinitionName?: string; + licenseType?: LicenseType; + localAdministrator?: LocalAdminStatus; + networkConnectionName?: string; +} + +// @public +export type Project = TrackedResource & { + devCenterId?: string; + description?: string; + readonly provisioningState?: string; +}; + +// @public +export type ProjectEnvironmentType = Resource & { + tags?: { + [propertyName: string]: string; + }; + identity?: ManagedServiceIdentity; + location?: string; + deploymentTargetId?: string; + status?: EnableStatus; + creatorRoleAssignment?: ProjectEnvironmentTypeUpdatePropertiesCreatorRoleAssignment; + userRoleAssignments?: { + [propertyName: string]: UserRoleAssignmentValue; + }; + readonly provisioningState?: string; +}; + +// @public +export interface ProjectEnvironmentTypeListResult { + readonly nextLink?: string; + readonly value?: ProjectEnvironmentType[]; +} + +// @public +export type ProjectEnvironmentTypeProperties = ProjectEnvironmentTypeUpdateProperties & { + readonly provisioningState?: string; +}; + +// @public +export interface ProjectEnvironmentTypes { + createOrUpdate(resourceGroupName: string, projectName: string, environmentTypeName: string, body: ProjectEnvironmentType, options?: ProjectEnvironmentTypesCreateOrUpdateOptionalParams): Promise; + delete(resourceGroupName: string, projectName: string, environmentTypeName: string, options?: ProjectEnvironmentTypesDeleteOptionalParams): Promise; + get(resourceGroupName: string, projectName: string, environmentTypeName: string, options?: ProjectEnvironmentTypesGetOptionalParams): Promise; + list(resourceGroupName: string, projectName: string, options?: ProjectEnvironmentTypesListOptionalParams): PagedAsyncIterableIterator; + update(resourceGroupName: string, projectName: string, environmentTypeName: string, body: ProjectEnvironmentTypeUpdate, options?: ProjectEnvironmentTypesUpdateOptionalParams): Promise; +} + +// @public +export interface ProjectEnvironmentTypesCreateOrUpdateOptionalParams extends coreClient.OperationOptions { +} + +// @public +export type ProjectEnvironmentTypesCreateOrUpdateResponse = ProjectEnvironmentType; + +// @public +export interface ProjectEnvironmentTypesDeleteOptionalParams extends coreClient.OperationOptions { +} + +// @public +export interface ProjectEnvironmentTypesGetOptionalParams extends coreClient.OperationOptions { +} + +// @public +export type ProjectEnvironmentTypesGetResponse = ProjectEnvironmentType; + +// @public +export interface ProjectEnvironmentTypesListNextOptionalParams extends coreClient.OperationOptions { + top?: number; +} + +// @public +export type ProjectEnvironmentTypesListNextResponse = ProjectEnvironmentTypeListResult; + +// @public +export interface ProjectEnvironmentTypesListOptionalParams extends coreClient.OperationOptions { + top?: number; +} + +// @public +export type ProjectEnvironmentTypesListResponse = ProjectEnvironmentTypeListResult; + +// @public +export interface ProjectEnvironmentTypesUpdateOptionalParams extends coreClient.OperationOptions { +} + +// @public +export type ProjectEnvironmentTypesUpdateResponse = ProjectEnvironmentType; + +// @public +export interface ProjectEnvironmentTypeUpdate { + creatorRoleAssignment?: ProjectEnvironmentTypeUpdatePropertiesCreatorRoleAssignment; + deploymentTargetId?: string; + identity?: ManagedServiceIdentity; + status?: EnableStatus; + tags?: { + [propertyName: string]: string; + }; + userRoleAssignments?: { + [propertyName: string]: UserRoleAssignmentValue; + }; +} + +// @public +export interface ProjectEnvironmentTypeUpdateProperties { + creatorRoleAssignment?: ProjectEnvironmentTypeUpdatePropertiesCreatorRoleAssignment; + deploymentTargetId?: string; + status?: EnableStatus; + userRoleAssignments?: { + [propertyName: string]: UserRoleAssignmentValue; + }; +} + +// @public +export interface ProjectEnvironmentTypeUpdatePropertiesCreatorRoleAssignment { + roles?: { + [propertyName: string]: EnvironmentRole; + }; +} + +// @public +export interface ProjectListResult { + readonly nextLink?: string; + readonly value?: Project[]; +} + +// @public +export type ProjectProperties = ProjectUpdateProperties & { + readonly provisioningState?: string; +}; + +// @public +export interface Projects { + beginCreateOrUpdate(resourceGroupName: string, projectName: string, body: Project, options?: ProjectsCreateOrUpdateOptionalParams): Promise, ProjectsCreateOrUpdateResponse>>; + beginCreateOrUpdateAndWait(resourceGroupName: string, projectName: string, body: Project, options?: ProjectsCreateOrUpdateOptionalParams): Promise; + beginDelete(resourceGroupName: string, projectName: string, options?: ProjectsDeleteOptionalParams): Promise, void>>; + beginDeleteAndWait(resourceGroupName: string, projectName: string, options?: ProjectsDeleteOptionalParams): Promise; + beginUpdate(resourceGroupName: string, projectName: string, body: ProjectUpdate, options?: ProjectsUpdateOptionalParams): Promise, ProjectsUpdateResponse>>; + beginUpdateAndWait(resourceGroupName: string, projectName: string, body: ProjectUpdate, options?: ProjectsUpdateOptionalParams): Promise; + get(resourceGroupName: string, projectName: string, options?: ProjectsGetOptionalParams): Promise; + listByResourceGroup(resourceGroupName: string, options?: ProjectsListByResourceGroupOptionalParams): PagedAsyncIterableIterator; + listBySubscription(options?: ProjectsListBySubscriptionOptionalParams): PagedAsyncIterableIterator; +} + +// @public +export interface ProjectsCreateOrUpdateOptionalParams extends coreClient.OperationOptions { + resumeFrom?: string; + updateIntervalInMs?: number; +} + +// @public +export type ProjectsCreateOrUpdateResponse = Project; + +// @public +export interface ProjectsDeleteOptionalParams extends coreClient.OperationOptions { + resumeFrom?: string; + updateIntervalInMs?: number; +} + +// @public +export interface ProjectsGetOptionalParams extends coreClient.OperationOptions { +} + +// @public +export type ProjectsGetResponse = Project; + +// @public +export interface ProjectsListByResourceGroupNextOptionalParams extends coreClient.OperationOptions { + top?: number; +} + +// @public +export type ProjectsListByResourceGroupNextResponse = ProjectListResult; + +// @public +export interface ProjectsListByResourceGroupOptionalParams extends coreClient.OperationOptions { + top?: number; +} + +// @public +export type ProjectsListByResourceGroupResponse = ProjectListResult; + +// @public +export interface ProjectsListBySubscriptionNextOptionalParams extends coreClient.OperationOptions { + top?: number; +} + +// @public +export type ProjectsListBySubscriptionNextResponse = ProjectListResult; + +// @public +export interface ProjectsListBySubscriptionOptionalParams extends coreClient.OperationOptions { + top?: number; +} + +// @public +export type ProjectsListBySubscriptionResponse = ProjectListResult; + +// @public +export interface ProjectsUpdateOptionalParams extends coreClient.OperationOptions { + resumeFrom?: string; + updateIntervalInMs?: number; +} + +// @public +export type ProjectsUpdateResponse = Project; + +// @public +export type ProjectUpdate = TrackedResourceUpdate & { + devCenterId?: string; + description?: string; +}; + +// @public +export interface ProjectUpdateProperties { + description?: string; + devCenterId?: string; +} + +// @public +export type ProxyResource = Resource & {}; + +// @public +export interface RecommendedMachineConfiguration { + readonly memory?: ResourceRange; + readonly vCPUs?: ResourceRange; +} + +// @public +export interface Resource { + readonly id?: string; + readonly name?: string; + readonly systemData?: SystemData; + readonly type?: string; +} + +// @public +export interface ResourceRange { + readonly max?: number; + readonly min?: number; +} + +// @public +export type Schedule = Resource & { + typePropertiesType?: ScheduledType; + frequency?: ScheduledFrequency; + time?: string; + timeZone?: string; + state?: EnableStatus; + readonly provisioningState?: string; +}; + +// @public +export type ScheduledFrequency = string; + +// @public +export type ScheduledType = string; + +// @public +export interface ScheduleListResult { + readonly nextLink?: string; + readonly value?: Schedule[]; +} + +// @public +export type ScheduleProperties = ScheduleUpdateProperties & { + readonly provisioningState?: string; +}; + +// @public +export interface Schedules { + beginCreateOrUpdate(resourceGroupName: string, projectName: string, poolName: string, scheduleName: string, body: Schedule, options?: SchedulesCreateOrUpdateOptionalParams): Promise, SchedulesCreateOrUpdateResponse>>; + beginCreateOrUpdateAndWait(resourceGroupName: string, projectName: string, poolName: string, scheduleName: string, body: Schedule, options?: SchedulesCreateOrUpdateOptionalParams): Promise; + beginDelete(resourceGroupName: string, projectName: string, poolName: string, scheduleName: string, options?: SchedulesDeleteOptionalParams): Promise, void>>; + beginDeleteAndWait(resourceGroupName: string, projectName: string, poolName: string, scheduleName: string, options?: SchedulesDeleteOptionalParams): Promise; + beginUpdate(resourceGroupName: string, projectName: string, poolName: string, scheduleName: string, body: ScheduleUpdate, options?: SchedulesUpdateOptionalParams): Promise, void>>; + beginUpdateAndWait(resourceGroupName: string, projectName: string, poolName: string, scheduleName: string, body: ScheduleUpdate, options?: SchedulesUpdateOptionalParams): Promise; + get(resourceGroupName: string, projectName: string, poolName: string, scheduleName: string, options?: SchedulesGetOptionalParams): Promise; + listByPool(resourceGroupName: string, projectName: string, poolName: string, options?: SchedulesListByPoolOptionalParams): PagedAsyncIterableIterator; +} + +// @public +export interface SchedulesCreateOrUpdateOptionalParams extends coreClient.OperationOptions { + resumeFrom?: string; + top?: number; + updateIntervalInMs?: number; +} + +// @public +export type SchedulesCreateOrUpdateResponse = Schedule; + +// @public +export interface SchedulesDeleteOptionalParams extends coreClient.OperationOptions { + resumeFrom?: string; + top?: number; + updateIntervalInMs?: number; +} + +// @public +export interface SchedulesGetOptionalParams extends coreClient.OperationOptions { + top?: number; +} + +// @public +export type SchedulesGetResponse = Schedule; + +// @public +export interface SchedulesListByPoolNextOptionalParams extends coreClient.OperationOptions { + top?: number; +} + +// @public +export type SchedulesListByPoolNextResponse = ScheduleListResult; + +// @public +export interface SchedulesListByPoolOptionalParams extends coreClient.OperationOptions { + top?: number; +} + +// @public +export type SchedulesListByPoolResponse = ScheduleListResult; + +// @public +export interface SchedulesUpdateOptionalParams extends coreClient.OperationOptions { + resumeFrom?: string; + top?: number; + updateIntervalInMs?: number; +} + +// @public +export type ScheduleUpdate = TrackedResourceUpdate & { + type?: ScheduledType; + frequency?: ScheduledFrequency; + time?: string; + timeZone?: string; + state?: EnableStatus; +}; + +// @public +export interface ScheduleUpdateProperties { + frequency?: ScheduledFrequency; + state?: EnableStatus; + time?: string; + timeZone?: string; + type?: ScheduledType; +} + +// @public +export interface Sku { + capacity?: number; + family?: string; + name: string; + size?: string; + tier?: SkuTier; +} + +// @public +export interface SkuListResult { + readonly nextLink?: string; + readonly value?: DevCenterSku[]; +} + +// @public +export interface Skus { + listBySubscription(options?: SkusListBySubscriptionOptionalParams): PagedAsyncIterableIterator; +} + +// @public +export interface SkusListBySubscriptionNextOptionalParams extends coreClient.OperationOptions { + top?: number; +} + +// @public +export type SkusListBySubscriptionNextResponse = SkuListResult; + +// @public +export interface SkusListBySubscriptionOptionalParams extends coreClient.OperationOptions { + top?: number; +} + +// @public +export type SkusListBySubscriptionResponse = SkuListResult; + +// @public +export type SkuTier = "Free" | "Basic" | "Standard" | "Premium"; + +// @public +export interface SystemData { + createdAt?: Date; + createdBy?: string; + createdByType?: CreatedByType; + lastModifiedAt?: Date; + lastModifiedBy?: string; + lastModifiedByType?: CreatedByType; +} + +// @public +export type TrackedResource = Resource & { + tags?: { + [propertyName: string]: string; + }; + location: string; +}; + +// @public +export interface TrackedResourceUpdate { + location?: string; + tags?: { + [propertyName: string]: string; + }; +} + +// @public +export interface Usage { + currentValue?: number; + limit?: number; + name?: UsageName; + unit?: UsageUnit; +} + +// @public +export interface UsageName { + localizedValue?: string; + value?: string; +} + +// @public +export interface Usages { + listByLocation(location: string, options?: UsagesListByLocationOptionalParams): PagedAsyncIterableIterator; +} + +// @public +export interface UsagesListByLocationNextOptionalParams extends coreClient.OperationOptions { +} + +// @public +export type UsagesListByLocationNextResponse = ListUsagesResult; + +// @public +export interface UsagesListByLocationOptionalParams extends coreClient.OperationOptions { +} + +// @public +export type UsagesListByLocationResponse = ListUsagesResult; + +// @public +export type UsageUnit = string; + +// @public +export interface UserAssignedIdentity { + readonly clientId?: string; + readonly principalId?: string; +} + +// @public +export interface UserRoleAssignmentValue { + roles?: { + [propertyName: string]: EnvironmentRole; + }; +} + +// (No @packageDocumentation comment for this package) + +``` diff --git a/sdk/devcenter/arm-devcenter/rollup.config.js b/sdk/devcenter/arm-devcenter/rollup.config.js new file mode 100644 index 000000000000..3f89d7309da5 --- /dev/null +++ b/sdk/devcenter/arm-devcenter/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/devcenter/arm-devcenter/src/devCenterClient.ts b/sdk/devcenter/arm-devcenter/src/devCenterClient.ts new file mode 100644 index 000000000000..8e5c77a38ac6 --- /dev/null +++ b/sdk/devcenter/arm-devcenter/src/devCenterClient.ts @@ -0,0 +1,203 @@ +/* + * 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 { + DevCentersImpl, + ProjectsImpl, + AttachedNetworksImpl, + GalleriesImpl, + ImagesImpl, + ImageVersionsImpl, + CatalogsImpl, + EnvironmentTypesImpl, + ProjectEnvironmentTypesImpl, + DevBoxDefinitionsImpl, + OperationsImpl, + OperationStatusesImpl, + UsagesImpl, + SkusImpl, + PoolsImpl, + SchedulesImpl, + NetworkConnectionsImpl +} from "./operations"; +import { + DevCenters, + Projects, + AttachedNetworks, + Galleries, + Images, + ImageVersions, + Catalogs, + EnvironmentTypes, + ProjectEnvironmentTypes, + DevBoxDefinitions, + Operations, + OperationStatuses, + Usages, + Skus, + Pools, + Schedules, + NetworkConnections +} from "./operationsInterfaces"; +import { DevCenterClientOptionalParams } from "./models"; + +export class DevCenterClient extends coreClient.ServiceClient { + $host: string; + apiVersion: string; + subscriptionId: string; + + /** + * Initializes a new instance of the DevCenterClient class. + * @param credentials Subscription credentials which uniquely identify client subscription. + * @param subscriptionId Unique identifier of the Azure subscription. This is a GUID-formatted string + * (e.g. 00000000-0000-0000-0000-000000000000). + * @param options The parameter options + */ + constructor( + credentials: coreAuth.TokenCredential, + subscriptionId: string, + options?: DevCenterClientOptionalParams + ) { + 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: DevCenterClientOptionalParams = { + requestContentType: "application/json; charset=utf-8", + credential: credentials + }; + + const packageDetails = `azsdk-js-arm-devcenter/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-08-01-preview"; + this.devCenters = new DevCentersImpl(this); + this.projects = new ProjectsImpl(this); + this.attachedNetworks = new AttachedNetworksImpl(this); + this.galleries = new GalleriesImpl(this); + this.images = new ImagesImpl(this); + this.imageVersions = new ImageVersionsImpl(this); + this.catalogs = new CatalogsImpl(this); + this.environmentTypes = new EnvironmentTypesImpl(this); + this.projectEnvironmentTypes = new ProjectEnvironmentTypesImpl(this); + this.devBoxDefinitions = new DevBoxDefinitionsImpl(this); + this.operations = new OperationsImpl(this); + this.operationStatuses = new OperationStatusesImpl(this); + this.usages = new UsagesImpl(this); + this.skus = new SkusImpl(this); + this.pools = new PoolsImpl(this); + this.schedules = new SchedulesImpl(this); + this.networkConnections = new NetworkConnectionsImpl(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); + } + + devCenters: DevCenters; + projects: Projects; + attachedNetworks: AttachedNetworks; + galleries: Galleries; + images: Images; + imageVersions: ImageVersions; + catalogs: Catalogs; + environmentTypes: EnvironmentTypes; + projectEnvironmentTypes: ProjectEnvironmentTypes; + devBoxDefinitions: DevBoxDefinitions; + operations: Operations; + operationStatuses: OperationStatuses; + usages: Usages; + skus: Skus; + pools: Pools; + schedules: Schedules; + networkConnections: NetworkConnections; +} diff --git a/sdk/devcenter/arm-devcenter/src/index.ts b/sdk/devcenter/arm-devcenter/src/index.ts new file mode 100644 index 000000000000..0b387956b1f0 --- /dev/null +++ b/sdk/devcenter/arm-devcenter/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 { DevCenterClient } from "./devCenterClient"; +export * from "./operationsInterfaces"; diff --git a/sdk/devcenter/arm-devcenter/src/lroImpl.ts b/sdk/devcenter/arm-devcenter/src/lroImpl.ts new file mode 100644 index 000000000000..518d5f053b4e --- /dev/null +++ b/sdk/devcenter/arm-devcenter/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/devcenter/arm-devcenter/src/models/index.ts b/sdk/devcenter/arm-devcenter/src/models/index.ts new file mode 100644 index 000000000000..c1e24e9da350 --- /dev/null +++ b/sdk/devcenter/arm-devcenter/src/models/index.ts @@ -0,0 +1,2333 @@ +/* + * 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"; + +/** Result of the list devcenters operation */ +export interface DevCenterListResult { + /** + * Current page of results. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly value?: DevCenter[]; + /** + * URL to get the next set of results if there are any. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly nextLink?: string; +} + +/** Managed service identity (system assigned and/or user assigned identities) */ +export interface ManagedServiceIdentity { + /** + * The service principal ID of the system assigned identity. This property will only be provided for a system assigned identity. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly principalId?: string; + /** + * The tenant ID of the system assigned identity. This property will only be provided for a system assigned identity. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly tenantId?: string; + /** Type of managed service identity (where both SystemAssigned and UserAssigned types are allowed). */ + type: ManagedServiceIdentityType; + /** The set of user assigned identities associated with the resource. The userAssignedIdentities dictionary keys will be ARM resource ids in the form: '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedIdentity/userAssignedIdentities/{identityName}. The dictionary values can be empty objects ({}) in requests. */ + userAssignedIdentities?: { [propertyName: string]: UserAssignedIdentity }; +} + +/** User assigned identity properties */ +export interface UserAssignedIdentity { + /** + * The principal ID of the assigned identity. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly principalId?: string; + /** + * The client ID of the assigned identity. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly clientId?: string; +} + +/** Common fields that are returned in the response for all Azure Resource Manager resources */ +export interface Resource { + /** + * Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly id?: string; + /** + * The name of the resource + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly name?: string; + /** + * The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts" + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly type?: string; + /** + * Azure Resource Manager metadata containing createdBy and modifiedBy information. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly systemData?: SystemData; +} + +/** Metadata pertaining to creation and last modification of the resource. */ +export interface SystemData { + /** The identity that created the resource. */ + createdBy?: string; + /** The type of identity that created the resource. */ + createdByType?: CreatedByType; + /** The timestamp of resource creation (UTC). */ + createdAt?: Date; + /** The identity that last modified the resource. */ + lastModifiedBy?: string; + /** The type of identity that last modified the resource. */ + lastModifiedByType?: CreatedByType; + /** The timestamp of resource last modification (UTC) */ + lastModifiedAt?: Date; +} + +/** An error response from the DevCenter service. */ +export interface CloudError { + /** Error body */ + error: CloudErrorBody; +} + +/** An error response from the DevCenter service. */ +export interface CloudErrorBody { + /** An identifier for the error. Codes are invariant and are intended to be consumed programmatically. */ + code: string; + /** A message describing the error, intended to be suitable for display in a user interface. */ + message: string; + /** The target of the particular error. For example, the name of the property in error. */ + target?: string; + /** A list of additional details about the error. */ + details?: CloudErrorBody[]; +} + +/** Base tracked resource type for PATCH updates */ +export interface TrackedResourceUpdate { + /** Resource tags. */ + tags?: { [propertyName: string]: string }; + /** The geo-location where the resource lives */ + location?: string; +} + +/** Results of the project list operation. */ +export interface ProjectListResult { + /** + * Current page of results. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly value?: Project[]; + /** + * URL to get the next set of results if there are any. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly nextLink?: string; +} + +/** Properties of a project. These properties can be updated after the resource has been created. */ +export interface ProjectUpdateProperties { + /** Resource Id of an associated DevCenter */ + devCenterId?: string; + /** Description of the project. */ + description?: string; +} + +/** Results of the Attached Networks list operation. */ +export interface AttachedNetworkListResult { + /** + * Current page of results. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly value?: AttachedNetworkConnection[]; + /** + * URL to get the next set of results if there are any. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly nextLink?: string; +} + +/** Results of the gallery list operation. */ +export interface GalleryListResult { + /** + * Current page of results. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly value?: Gallery[]; + /** + * URL to get the next set of results if there are any. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly nextLink?: string; +} + +/** Results of the image list operation. */ +export interface ImageListResult { + /** + * Current page of results. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly value?: Image[]; + /** + * URL to get the next set of results if there are any. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly nextLink?: string; +} + +/** Properties for a recommended machine configuration. */ +export interface RecommendedMachineConfiguration { + /** + * Recommended memory range. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly memory?: ResourceRange; + /** + * Recommended vCPU range. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly vCPUs?: ResourceRange; +} + +/** Properties for a range of values. */ +export interface ResourceRange { + /** + * Minimum value. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly min?: number; + /** + * Maximum value. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly max?: number; +} + +/** Results of the image version list operation. */ +export interface ImageVersionListResult { + /** + * Current page of results. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly value?: ImageVersion[]; + /** + * URL to get the next set of results if there are any. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly nextLink?: string; +} + +/** Results of the catalog list operation. */ +export interface CatalogListResult { + /** + * Current page of results. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly value?: Catalog[]; + /** + * URL to get the next set of results if there are any. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly nextLink?: string; +} + +/** Properties of a catalog. These properties can be updated after the resource has been created. */ +export interface CatalogUpdateProperties { + /** Properties for a GitHub catalog type. */ + gitHub?: GitCatalog; + /** Properties for an Azure DevOps catalog type. */ + adoGit?: GitCatalog; +} + +/** Properties for a Git repository catalog. */ +export interface GitCatalog { + /** Git URI. */ + uri?: string; + /** Git branch. */ + branch?: string; + /** A reference to the Key Vault secret containing a security token to authenticate to a Git repository. */ + secretIdentifier?: string; + /** The folder where the catalog items can be found inside the repository. */ + path?: string; +} + +/** The catalog's properties for partial update. Properties not provided in the update request will not be changed. */ +export interface CatalogUpdate { + /** Resource tags. */ + tags?: { [propertyName: string]: string }; + /** Properties for a GitHub catalog type. */ + gitHub?: GitCatalog; + /** Properties for an Azure DevOps catalog type. */ + adoGit?: GitCatalog; +} + +/** Result of the environment type list operation. */ +export interface EnvironmentTypeListResult { + /** + * Current page of results. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly value?: EnvironmentType[]; + /** + * URL to get the next set of results if there are any. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly nextLink?: string; +} + +/** The environment type for partial update. Properties not provided in the update request will not be changed. */ +export interface EnvironmentTypeUpdate { + /** Resource tags. */ + tags?: { [propertyName: string]: string }; +} + +/** Result of the project environment type list operation. */ +export interface ProjectEnvironmentTypeListResult { + /** + * Current page of results. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly value?: ProjectEnvironmentType[]; + /** + * URL to get the next set of results if there are any. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly nextLink?: string; +} + +/** Properties of a project environment type. These properties can be updated after the resource has been created. */ +export interface ProjectEnvironmentTypeUpdateProperties { + /** Id of a subscription that the environment type will be mapped to. The environment's resources will be deployed into this subscription. */ + deploymentTargetId?: string; + /** Defines whether this Environment Type can be used in this Project. */ + status?: EnableStatus; + /** The role definition assigned to the environment creator on backing resources. */ + creatorRoleAssignment?: ProjectEnvironmentTypeUpdatePropertiesCreatorRoleAssignment; + /** Role Assignments created on environment backing resources. This is a mapping from a user object ID to an object of role definition IDs. */ + userRoleAssignments?: { [propertyName: string]: UserRoleAssignmentValue }; +} + +/** The role definition assigned to the environment creator on backing resources. */ +export interface ProjectEnvironmentTypeUpdatePropertiesCreatorRoleAssignment { + /** A map of roles to assign to the environment creator. */ + roles?: { [propertyName: string]: EnvironmentRole }; +} + +/** A role that can be assigned to a user. */ +export interface EnvironmentRole { + /** + * The common name of the Role Assignment. This is a descriptive name such as 'AcrPush'. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly roleName?: string; + /** + * This is a description of the Role Assignment. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly description?: string; +} + +/** Mapping of user object ID to role assignments. */ +export interface UserRoleAssignmentValue { + /** A map of roles to assign to the parent user. */ + roles?: { [propertyName: string]: EnvironmentRole }; +} + +/** The project environment type for partial update. Properties not provided in the update request will not be changed. */ +export interface ProjectEnvironmentTypeUpdate { + /** Resource tags. */ + tags?: { [propertyName: string]: string }; + /** Managed identity properties */ + identity?: ManagedServiceIdentity; + /** Id of a subscription that the environment type will be mapped to. The environment's resources will be deployed into this subscription. */ + deploymentTargetId?: string; + /** Defines whether this Environment Type can be used in this Project. */ + status?: EnableStatus; + /** The role definition assigned to the environment creator on backing resources. */ + creatorRoleAssignment?: ProjectEnvironmentTypeUpdatePropertiesCreatorRoleAssignment; + /** Role Assignments created on environment backing resources. This is a mapping from a user object ID to an object of role definition IDs. */ + userRoleAssignments?: { [propertyName: string]: UserRoleAssignmentValue }; +} + +/** Results of the Dev Box definition list operation. */ +export interface DevBoxDefinitionListResult { + /** + * Current page of results. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly value?: DevBoxDefinition[]; + /** + * URL to get the next set of results if there are any. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly nextLink?: string; +} + +/** Image validation error details */ +export interface ImageValidationErrorDetails { + /** An identifier for the error. */ + code?: string; + /** A message describing the error. */ + message?: string; +} + +/** Image reference information */ +export interface ImageReference { + /** Image ID, or Image version ID. When Image ID is provided, its latest version will be used. */ + id?: string; + /** + * The actual version of the image after use. When id references a gallery image latest version, this will indicate the actual version in use. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly exactVersion?: string; + /** The image publisher. */ + publisher?: string; + /** The image offer. */ + offer?: string; + /** The image sku. */ + sku?: string; +} + +/** Properties of a Dev Box definition. These properties can be updated after the resource has been created. */ +export interface DevBoxDefinitionUpdateProperties { + /** Image reference information. */ + imageReference?: ImageReference; + /** The SKU for Dev Boxes created using this definition. */ + sku?: Sku; + /** The storage type used for the Operating System disk of Dev Boxes created using this definition. */ + osStorageType?: string; +} + +/** The resource model definition representing SKU */ +export interface Sku { + /** The name of the SKU. Ex - P3. It is typically a letter+number code */ + name: string; + /** This field is required to be implemented by the Resource Provider if the service has more than one tier, but is not required on a PUT. */ + tier?: SkuTier; + /** The SKU size. When the name field is the combination of tier and some other value, this would be the standalone code. */ + size?: string; + /** If the service has different generations of hardware, for the same SKU, then that can be captured here. */ + family?: string; + /** If the SKU supports scale out/in then the capacity integer should be included. If scale out/in is not possible for the resource this may be omitted. */ + capacity?: number; +} + +/** A list of REST API operations supported by an Azure Resource Provider. It contains an URL link to get the next set of results. */ +export interface OperationListResult { + /** + * List of operations supported by the resource provider + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly 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; +} + +/** Details of a REST API operation, returned from the Resource Provider Operations API */ +export interface Operation { + /** + * The name of the operation, as per Resource-Based Access Control (RBAC). Examples: "Microsoft.Compute/virtualMachines/write", "Microsoft.Compute/virtualMachines/capture/action" + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly name?: string; + /** + * Whether the operation applies to data-plane. This is "true" for data-plane operations and "false" for ARM/control-plane operations. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly isDataAction?: boolean; + /** Localized display information for this particular operation. */ + display?: OperationDisplay; + /** + * The intended executor of the operation; as in Resource Based Access Control (RBAC) and audit logs UX. Default value is "user,system" + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly origin?: Origin; + /** + * Enum. Indicates the action type. "Internal" refers to actions that are for internal only APIs. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly actionType?: ActionType; +} + +/** Localized display information for this particular operation. */ +export interface OperationDisplay { + /** + * The localized friendly form of the resource provider name, e.g. "Microsoft Monitoring Insights" or "Microsoft Compute". + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly provider?: string; + /** + * The localized friendly name of the resource type related to this operation. E.g. "Virtual Machines" or "Job Schedule Collections". + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly resource?: string; + /** + * The concise, localized friendly name for the operation; suitable for dropdowns. E.g. "Create or Update Virtual Machine", "Restart Virtual Machine". + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly operation?: string; + /** + * The short, localized friendly description of the operation; suitable for tool tips and detailed views. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly description?: string; +} + +/** The current status of an async operation */ +export interface OperationStatus { + /** + * Fully qualified ID for the operation status. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly id?: string; + /** + * The operation id name + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly name?: string; + /** + * Provisioning state of the resource. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly status?: string; + /** + * The start time of the operation + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly startTime?: Date; + /** + * The end time of the operation + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly endTime?: Date; + /** + * Percent of the operation that is complete + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly percentComplete?: number; + /** + * Custom operation properties, populated only for a successful operation. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly properties?: Record; + /** Operation Error message */ + error?: OperationStatusError; +} + +/** Operation Error message */ +export interface OperationStatusError { + /** + * 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; +} + +/** List of Core Usages. */ +export interface ListUsagesResult { + /** + * The array page of Usages. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly value?: Usage[]; + /** + * The link to get the next page of Usage result. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly nextLink?: string; +} + +/** The core usage details. */ +export interface Usage { + /** The current usage. */ + currentValue?: number; + /** The limit integer. */ + limit?: number; + /** The unit details. */ + unit?: UsageUnit; + /** The name. */ + name?: UsageName; +} + +/** The Usage Names. */ +export interface UsageName { + /** The localized name of the resource. */ + localizedValue?: string; + /** The name of the resource. */ + value?: string; +} + +/** Results of the Microsoft.DevCenter SKU list operation. */ +export interface SkuListResult { + /** + * Current page of results. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly value?: DevCenterSku[]; + /** + * URL to get the next set of results if there are any. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly nextLink?: string; +} + +/** A name/value pair to describe a capability. */ +export interface Capability { + /** + * Name of the capability. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly name?: string; + /** + * Value of the capability. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly value?: string; +} + +/** Results of the machine pool list operation. */ +export interface PoolListResult { + /** + * Current page of results. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly value?: Pool[]; + /** + * URL to get the next set of results if there are any. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly nextLink?: string; +} + +/** Properties of a Pool. These properties can be updated after the resource has been created. */ +export interface PoolUpdateProperties { + /** Name of a Dev Box definition in parent Project of this Pool */ + devBoxDefinitionName?: string; + /** Name of a Network Connection in parent Project of this Pool */ + networkConnectionName?: string; + /** Specifies the license type indicating the caller has already acquired licenses for the Dev Boxes that will be created. */ + licenseType?: LicenseType; + /** Indicates whether owners of Dev Boxes in this pool are added as local administrators on the Dev Box. */ + localAdministrator?: LocalAdminStatus; +} + +/** Result of the schedule list operation. */ +export interface ScheduleListResult { + /** + * Current page of results. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly value?: Schedule[]; + /** + * URL to get the next set of results if there are any. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly nextLink?: string; +} + +/** Updatable properties of a Schedule. */ +export interface ScheduleUpdateProperties { + /** Supported type this scheduled task represents. */ + type?: ScheduledType; + /** The frequency of this scheduled task. */ + frequency?: ScheduledFrequency; + /** The target time to trigger the action. The format is HH:MM. */ + time?: string; + /** The IANA timezone id at which the schedule should execute. */ + timeZone?: string; + /** Indicates whether or not this scheduled task is enabled. */ + state?: EnableStatus; +} + +/** Result of the network connection list operation. */ +export interface NetworkConnectionListResult { + /** + * Current page of results. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly value?: NetworkConnection[]; + /** + * URL to get the next set of results if there are any. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly nextLink?: string; +} + +/** Properties of network connection. These properties can be updated after the resource has been created. */ +export interface NetworkConnectionUpdateProperties { + /** The subnet to attach Virtual Machines to */ + subnetId?: string; + /** Active Directory domain name */ + domainName?: string; + /** Active Directory domain Organization Unit (OU) */ + organizationUnit?: string; + /** The username of an Active Directory account (user or service account) that has permissions to create computer objects in Active Directory. Required format: admin@contoso.com. */ + domainUsername?: string; + /** The password for the account used to join domain */ + domainPassword?: string; +} + +/** Result of the network health check list operation. */ +export interface HealthCheckStatusDetailsListResult { + /** + * Current page of results. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly value?: HealthCheckStatusDetails[]; + /** + * URL to get the next set of results if there are any. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly nextLink?: string; +} + +/** An individual health check item */ +export interface HealthCheck { + /** + * The status of the health check item. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly status?: HealthCheckStatus; + /** + * The display name of this health check item. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly displayName?: string; + /** + * Start time of health check item. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly startDateTime?: Date; + /** + * End time of the health check item. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly endDateTime?: Date; + /** + * The type of error that occurred during this health check. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly errorType?: string; + /** + * The recommended action to fix the corresponding error. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly recommendedAction?: string; + /** + * Additional details about the health check or the recommended action. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly additionalDetails?: string; +} + +/** The resource model definition for an Azure Resource Manager tracked top level resource which has 'tags' and a 'location' */ +export type TrackedResource = Resource & { + /** Resource tags. */ + tags?: { [propertyName: string]: string }; + /** The geo-location where the resource lives */ + location: string; +}; + +/** Represents an attached NetworkConnection. */ +export type AttachedNetworkConnection = Resource & { + /** + * The provisioning state of the resource. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly provisioningState?: string; + /** The resource ID of the NetworkConnection you want to attach. */ + networkConnectionId?: string; + /** + * The geo-location where the NetworkConnection resource specified in 'networkConnectionResourceId' property lives. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly networkConnectionLocation?: string; + /** + * Health check status values + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly healthCheckStatus?: HealthCheckStatus; + /** + * AAD Join type of the network. This is populated based on the referenced Network Connection. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly domainJoinType?: DomainJoinType; +}; + +/** Represents a gallery. */ +export type Gallery = Resource & { + /** + * The provisioning state of the resource. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly provisioningState?: string; + /** The resource ID of the backing Azure Compute Gallery. */ + galleryResourceId?: string; +}; + +/** The resource model definition for a Azure Resource Manager proxy resource. It will not have tags and a location */ +export type ProxyResource = Resource & {}; + +/** Represents a catalog. */ +export type Catalog = Resource & { + /** Properties for a GitHub catalog type. */ + gitHub?: GitCatalog; + /** Properties for an Azure DevOps catalog type. */ + adoGit?: GitCatalog; + /** + * The provisioning state of the resource. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly provisioningState?: string; + /** + * When the catalog was last synced. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly lastSyncTime?: Date; +}; + +/** Represents an environment type. */ +export type EnvironmentType = Resource & { + /** Resource tags. */ + tags?: { [propertyName: string]: string }; + /** + * The provisioning state of the resource. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly provisioningState?: string; +}; + +/** Represents an environment type. */ +export type ProjectEnvironmentType = Resource & { + /** Resource tags. */ + tags?: { [propertyName: string]: string }; + /** Managed identity properties */ + identity?: ManagedServiceIdentity; + /** The geo-location for the environment type */ + location?: string; + /** Id of a subscription that the environment type will be mapped to. The environment's resources will be deployed into this subscription. */ + deploymentTargetId?: string; + /** Defines whether this Environment Type can be used in this Project. */ + status?: EnableStatus; + /** The role definition assigned to the environment creator on backing resources. */ + creatorRoleAssignment?: ProjectEnvironmentTypeUpdatePropertiesCreatorRoleAssignment; + /** Role Assignments created on environment backing resources. This is a mapping from a user object ID to an object of role definition IDs. */ + userRoleAssignments?: { [propertyName: string]: UserRoleAssignmentValue }; + /** + * The provisioning state of the resource. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly provisioningState?: string; +}; + +/** Represents a Schedule to execute a task. */ +export type Schedule = Resource & { + /** Supported type this scheduled task represents. */ + typePropertiesType?: ScheduledType; + /** The frequency of this scheduled task. */ + frequency?: ScheduledFrequency; + /** The target time to trigger the action. The format is HH:MM. */ + time?: string; + /** The IANA timezone id at which the schedule should execute. */ + timeZone?: string; + /** Indicates whether or not this scheduled task is enabled. */ + state?: EnableStatus; + /** + * The provisioning state of the resource. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly provisioningState?: string; +}; + +/** Health Check details. */ +export type HealthCheckStatusDetails = Resource & { + /** + * Start time of last execution of the health checks. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly startDateTime?: Date; + /** + * End time of last execution of the health checks. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly endDateTime?: Date; + /** + * Details for each health check item. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly healthChecks?: HealthCheck[]; +}; + +/** The devcenter resource for partial updates. Properties not provided in the update request will not be changed. */ +export type DevCenterUpdate = TrackedResourceUpdate & { + /** Managed identity properties */ + identity?: ManagedServiceIdentity; +}; + +/** The project properties for partial update. Properties not provided in the update request will not be changed. */ +export type ProjectUpdate = TrackedResourceUpdate & { + /** Resource Id of an associated DevCenter */ + devCenterId?: string; + /** Description of the project. */ + description?: string; +}; + +/** Partial update of a Dev Box definition resource. */ +export type DevBoxDefinitionUpdate = TrackedResourceUpdate & { + /** Image reference information. */ + imageReference?: ImageReference; + /** The SKU for Dev Boxes created using this definition. */ + sku?: Sku; + /** The storage type used for the Operating System disk of Dev Boxes created using this definition. */ + osStorageType?: string; +}; + +/** The pool properties for partial update. Properties not provided in the update request will not be changed. */ +export type PoolUpdate = TrackedResourceUpdate & { + /** Name of a Dev Box definition in parent Project of this Pool */ + devBoxDefinitionName?: string; + /** Name of a Network Connection in parent Project of this Pool */ + networkConnectionName?: string; + /** Specifies the license type indicating the caller has already acquired licenses for the Dev Boxes that will be created. */ + licenseType?: LicenseType; + /** Indicates whether owners of Dev Boxes in this pool are added as local administrators on the Dev Box. */ + localAdministrator?: LocalAdminStatus; +}; + +/** The schedule properties for partial update. Properties not provided in the update request will not be changed. */ +export type ScheduleUpdate = TrackedResourceUpdate & { + /** Supported type this scheduled task represents. */ + type?: ScheduledType; + /** The frequency of this scheduled task. */ + frequency?: ScheduledFrequency; + /** The target time to trigger the action. The format is HH:MM. */ + time?: string; + /** The IANA timezone id at which the schedule should execute. */ + timeZone?: string; + /** Indicates whether or not this scheduled task is enabled. */ + state?: EnableStatus; +}; + +/** The network connection properties for partial update. Properties not provided in the update request will not be changed. */ +export type NetworkConnectionUpdate = TrackedResourceUpdate & { + /** The subnet to attach Virtual Machines to */ + subnetId?: string; + /** Active Directory domain name */ + domainName?: string; + /** Active Directory domain Organization Unit (OU) */ + organizationUnit?: string; + /** The username of an Active Directory account (user or service account) that has permissions to create computer objects in Active Directory. Required format: admin@contoso.com. */ + domainUsername?: string; + /** The password for the account used to join domain */ + domainPassword?: string; +}; + +/** Properties of a project. */ +export type ProjectProperties = ProjectUpdateProperties & { + /** + * The provisioning state of the resource. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly provisioningState?: string; +}; + +/** Properties of a catalog. */ +export type CatalogProperties = CatalogUpdateProperties & { + /** + * The provisioning state of the resource. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly provisioningState?: string; + /** + * When the catalog was last synced. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly lastSyncTime?: Date; +}; + +/** Properties of a project environment type. */ +export type ProjectEnvironmentTypeProperties = ProjectEnvironmentTypeUpdateProperties & { + /** + * The provisioning state of the resource. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly provisioningState?: string; +}; + +/** Properties of a Dev Box definition. */ +export type DevBoxDefinitionProperties = DevBoxDefinitionUpdateProperties & { + /** + * The provisioning state of the resource. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly provisioningState?: string; + /** + * Validation status of the configured image. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly imageValidationStatus?: ImageValidationStatus; + /** + * Details for image validator error. Populated when the image validation is not successful. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly imageValidationErrorDetails?: ImageValidationErrorDetails; + /** + * Image reference information for the currently active image (only populated during updates). + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly activeImageReference?: ImageReference; +}; + +/** The resource model definition representing SKU for DevCenter resources */ +export type DevCenterSku = Sku & { + /** + * The name of the resource type + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly resourceType?: string; + /** + * SKU supported locations. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly locations?: string[]; + /** + * Collection of name/value pairs to describe the SKU capabilities. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly capabilities?: Capability[]; +}; + +/** Properties of a Pool */ +export type PoolProperties = PoolUpdateProperties & { + /** + * The provisioning state of the resource. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly provisioningState?: string; +}; + +/** The Schedule properties defining when and what to execute. */ +export type ScheduleProperties = ScheduleUpdateProperties & { + /** + * The provisioning state of the resource. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly provisioningState?: string; +}; + +/** Network properties */ +export type NetworkProperties = NetworkConnectionUpdateProperties & { + /** + * The provisioning state of the resource. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly provisioningState?: string; + /** + * Overall health status of the network connection. Health checks are run on creation, update, and periodically to validate the network connection. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly healthCheckStatus?: HealthCheckStatus; + /** The name for resource group where NICs will be placed. */ + networkingResourceGroupName?: string; + /** AAD Join type. */ + domainJoinType: DomainJoinType; +}; + +/** Represents a devcenter resource. */ +export type DevCenter = TrackedResource & { + /** Managed identity properties */ + identity?: ManagedServiceIdentity; + /** + * The provisioning state of the resource. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly provisioningState?: string; +}; + +/** Represents a project resource. */ +export type Project = TrackedResource & { + /** Resource Id of an associated DevCenter */ + devCenterId?: string; + /** Description of the project. */ + description?: string; + /** + * The provisioning state of the resource. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly provisioningState?: string; +}; + +/** Represents a definition for a Developer Machine. */ +export type DevBoxDefinition = TrackedResource & { + /** Image reference information. */ + imageReference?: ImageReference; + /** The SKU for Dev Boxes created using this definition. */ + sku?: Sku; + /** The storage type used for the Operating System disk of Dev Boxes created using this definition. */ + osStorageType?: string; + /** + * The provisioning state of the resource. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly provisioningState?: string; + /** + * Validation status of the configured image. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly imageValidationStatus?: ImageValidationStatus; + /** + * Details for image validator error. Populated when the image validation is not successful. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly imageValidationErrorDetails?: ImageValidationErrorDetails; + /** + * Image reference information for the currently active image (only populated during updates). + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly activeImageReference?: ImageReference; +}; + +/** A pool of Virtual Machines. */ +export type Pool = TrackedResource & { + /** Name of a Dev Box definition in parent Project of this Pool */ + devBoxDefinitionName?: string; + /** Name of a Network Connection in parent Project of this Pool */ + networkConnectionName?: string; + /** Specifies the license type indicating the caller has already acquired licenses for the Dev Boxes that will be created. */ + licenseType?: LicenseType; + /** Indicates whether owners of Dev Boxes in this pool are added as local administrators on the Dev Box. */ + localAdministrator?: LocalAdminStatus; + /** + * The provisioning state of the resource. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly provisioningState?: string; +}; + +/** Network related settings */ +export type NetworkConnection = TrackedResource & { + /** The subnet to attach Virtual Machines to */ + subnetId?: string; + /** Active Directory domain name */ + domainName?: string; + /** Active Directory domain Organization Unit (OU) */ + organizationUnit?: string; + /** The username of an Active Directory account (user or service account) that has permissions to create computer objects in Active Directory. Required format: admin@contoso.com. */ + domainUsername?: string; + /** The password for the account used to join domain */ + domainPassword?: string; + /** + * The provisioning state of the resource. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly provisioningState?: string; + /** + * Overall health status of the network connection. Health checks are run on creation, update, and periodically to validate the network connection. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly healthCheckStatus?: HealthCheckStatus; + /** The name for resource group where NICs will be placed. */ + networkingResourceGroupName?: string; + /** AAD Join type. */ + domainJoinType?: DomainJoinType; +}; + +/** Represents an image. */ +export type Image = ProxyResource & { + /** + * The description of the image. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly description?: string; + /** + * The publisher of the image. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly publisher?: string; + /** + * The name of the image offer. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly offer?: string; + /** + * The SKU name for the image. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly sku?: string; + /** + * The recommended machine configuration to use with the image. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly recommendedMachineConfiguration?: RecommendedMachineConfiguration; + /** + * The provisioning state of the resource. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly provisioningState?: string; +}; + +/** Represents an image version. */ +export type ImageVersion = ProxyResource & { + /** + * The semantic version string. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly namePropertiesName?: string; + /** + * The datetime that the backing image version was published. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly publishedDate?: Date; + /** + * If the version should be excluded from being treated as the latest version. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly excludeFromLatest?: boolean; + /** + * The size of the OS disk image, in GB. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly osDiskImageSizeInGb?: number; + /** + * The provisioning state of the resource. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly provisioningState?: string; +}; + +/** Known values of {@link ManagedServiceIdentityType} that the service accepts. */ +export enum KnownManagedServiceIdentityType { + None = "None", + SystemAssigned = "SystemAssigned", + UserAssigned = "UserAssigned", + SystemAssignedUserAssigned = "SystemAssigned, UserAssigned" +} + +/** + * Defines values for ManagedServiceIdentityType. \ + * {@link KnownManagedServiceIdentityType} can be used interchangeably with ManagedServiceIdentityType, + * this enum contains the known values that the service supports. + * ### Known values supported by the service + * **None** \ + * **SystemAssigned** \ + * **UserAssigned** \ + * **SystemAssigned, UserAssigned** + */ +export type ManagedServiceIdentityType = 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 HealthCheckStatus} that the service accepts. */ +export enum KnownHealthCheckStatus { + Pending = "Pending", + Running = "Running", + Passed = "Passed", + Failed = "Failed", + Warning = "Warning", + Unknown = "Unknown" +} + +/** + * Defines values for HealthCheckStatus. \ + * {@link KnownHealthCheckStatus} can be used interchangeably with HealthCheckStatus, + * this enum contains the known values that the service supports. + * ### Known values supported by the service + * **Pending** \ + * **Running** \ + * **Passed** \ + * **Failed** \ + * **Warning** \ + * **Unknown** + */ +export type HealthCheckStatus = string; + +/** Known values of {@link DomainJoinType} that the service accepts. */ +export enum KnownDomainJoinType { + HybridAzureADJoin = "HybridAzureADJoin", + AzureADJoin = "AzureADJoin" +} + +/** + * Defines values for DomainJoinType. \ + * {@link KnownDomainJoinType} can be used interchangeably with DomainJoinType, + * this enum contains the known values that the service supports. + * ### Known values supported by the service + * **HybridAzureADJoin** \ + * **AzureADJoin** + */ +export type DomainJoinType = string; + +/** Known values of {@link EnableStatus} that the service accepts. */ +export enum KnownEnableStatus { + Enabled = "Enabled", + Disabled = "Disabled" +} + +/** + * Defines values for EnableStatus. \ + * {@link KnownEnableStatus} can be used interchangeably with EnableStatus, + * this enum contains the known values that the service supports. + * ### Known values supported by the service + * **Enabled** \ + * **Disabled** + */ +export type EnableStatus = string; + +/** Known values of {@link ImageValidationStatus} that the service accepts. */ +export enum KnownImageValidationStatus { + Unknown = "Unknown", + Pending = "Pending", + Succeeded = "Succeeded", + Failed = "Failed", + TimedOut = "TimedOut" +} + +/** + * Defines values for ImageValidationStatus. \ + * {@link KnownImageValidationStatus} can be used interchangeably with ImageValidationStatus, + * this enum contains the known values that the service supports. + * ### Known values supported by the service + * **Unknown** \ + * **Pending** \ + * **Succeeded** \ + * **Failed** \ + * **TimedOut** + */ +export type ImageValidationStatus = string; + +/** Known values of {@link Origin} that the service accepts. */ +export enum KnownOrigin { + User = "user", + System = "system", + UserSystem = "user,system" +} + +/** + * Defines values for Origin. \ + * {@link KnownOrigin} can be used interchangeably with Origin, + * this enum contains the known values that the service supports. + * ### Known values supported by the service + * **user** \ + * **system** \ + * **user,system** + */ +export type Origin = string; + +/** Known values of {@link ActionType} that the service accepts. */ +export enum KnownActionType { + Internal = "Internal" +} + +/** + * Defines values for ActionType. \ + * {@link KnownActionType} can be used interchangeably with ActionType, + * this enum contains the known values that the service supports. + * ### Known values supported by the service + * **Internal** + */ +export type ActionType = string; + +/** Known values of {@link UsageUnit} that the service accepts. */ +export enum KnownUsageUnit { + Count = "Count" +} + +/** + * Defines values for UsageUnit. \ + * {@link KnownUsageUnit} can be used interchangeably with UsageUnit, + * this enum contains the known values that the service supports. + * ### Known values supported by the service + * **Count** + */ +export type UsageUnit = string; + +/** Known values of {@link LicenseType} that the service accepts. */ +export enum KnownLicenseType { + WindowsClient = "Windows_Client" +} + +/** + * Defines values for LicenseType. \ + * {@link KnownLicenseType} can be used interchangeably with LicenseType, + * this enum contains the known values that the service supports. + * ### Known values supported by the service + * **Windows_Client** + */ +export type LicenseType = string; + +/** Known values of {@link LocalAdminStatus} that the service accepts. */ +export enum KnownLocalAdminStatus { + Disabled = "Disabled", + Enabled = "Enabled" +} + +/** + * Defines values for LocalAdminStatus. \ + * {@link KnownLocalAdminStatus} can be used interchangeably with LocalAdminStatus, + * this enum contains the known values that the service supports. + * ### Known values supported by the service + * **Disabled** \ + * **Enabled** + */ +export type LocalAdminStatus = string; + +/** Known values of {@link ScheduledType} that the service accepts. */ +export enum KnownScheduledType { + StopDevBox = "StopDevBox" +} + +/** + * Defines values for ScheduledType. \ + * {@link KnownScheduledType} can be used interchangeably with ScheduledType, + * this enum contains the known values that the service supports. + * ### Known values supported by the service + * **StopDevBox** + */ +export type ScheduledType = string; + +/** Known values of {@link ScheduledFrequency} that the service accepts. */ +export enum KnownScheduledFrequency { + Daily = "Daily" +} + +/** + * Defines values for ScheduledFrequency. \ + * {@link KnownScheduledFrequency} can be used interchangeably with ScheduledFrequency, + * this enum contains the known values that the service supports. + * ### Known values supported by the service + * **Daily** + */ +export type ScheduledFrequency = string; +/** Defines values for SkuTier. */ +export type SkuTier = "Free" | "Basic" | "Standard" | "Premium"; + +/** Optional parameters. */ +export interface DevCentersListBySubscriptionOptionalParams + extends coreClient.OperationOptions { + /** The maximum number of resources to return from the operation. Example: '$top=10'. */ + top?: number; +} + +/** Contains response data for the listBySubscription operation. */ +export type DevCentersListBySubscriptionResponse = DevCenterListResult; + +/** Optional parameters. */ +export interface DevCentersListByResourceGroupOptionalParams + extends coreClient.OperationOptions { + /** The maximum number of resources to return from the operation. Example: '$top=10'. */ + top?: number; +} + +/** Contains response data for the listByResourceGroup operation. */ +export type DevCentersListByResourceGroupResponse = DevCenterListResult; + +/** Optional parameters. */ +export interface DevCentersGetOptionalParams + extends coreClient.OperationOptions {} + +/** Contains response data for the get operation. */ +export type DevCentersGetResponse = DevCenter; + +/** Optional parameters. */ +export interface DevCentersCreateOrUpdateOptionalParams + 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 createOrUpdate operation. */ +export type DevCentersCreateOrUpdateResponse = DevCenter; + +/** Optional parameters. */ +export interface DevCentersUpdateOptionalParams + 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 DevCentersUpdateResponse = DevCenter; + +/** Optional parameters. */ +export interface DevCentersDeleteOptionalParams + 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 DevCentersListBySubscriptionNextOptionalParams + extends coreClient.OperationOptions { + /** The maximum number of resources to return from the operation. Example: '$top=10'. */ + top?: number; +} + +/** Contains response data for the listBySubscriptionNext operation. */ +export type DevCentersListBySubscriptionNextResponse = DevCenterListResult; + +/** Optional parameters. */ +export interface DevCentersListByResourceGroupNextOptionalParams + extends coreClient.OperationOptions { + /** The maximum number of resources to return from the operation. Example: '$top=10'. */ + top?: number; +} + +/** Contains response data for the listByResourceGroupNext operation. */ +export type DevCentersListByResourceGroupNextResponse = DevCenterListResult; + +/** Optional parameters. */ +export interface ProjectsListBySubscriptionOptionalParams + extends coreClient.OperationOptions { + /** The maximum number of resources to return from the operation. Example: '$top=10'. */ + top?: number; +} + +/** Contains response data for the listBySubscription operation. */ +export type ProjectsListBySubscriptionResponse = ProjectListResult; + +/** Optional parameters. */ +export interface ProjectsListByResourceGroupOptionalParams + extends coreClient.OperationOptions { + /** The maximum number of resources to return from the operation. Example: '$top=10'. */ + top?: number; +} + +/** Contains response data for the listByResourceGroup operation. */ +export type ProjectsListByResourceGroupResponse = ProjectListResult; + +/** Optional parameters. */ +export interface ProjectsGetOptionalParams + extends coreClient.OperationOptions {} + +/** Contains response data for the get operation. */ +export type ProjectsGetResponse = Project; + +/** Optional parameters. */ +export interface ProjectsCreateOrUpdateOptionalParams + 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 createOrUpdate operation. */ +export type ProjectsCreateOrUpdateResponse = Project; + +/** Optional parameters. */ +export interface ProjectsUpdateOptionalParams + 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 ProjectsUpdateResponse = Project; + +/** Optional parameters. */ +export interface ProjectsDeleteOptionalParams + 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 ProjectsListBySubscriptionNextOptionalParams + extends coreClient.OperationOptions { + /** The maximum number of resources to return from the operation. Example: '$top=10'. */ + top?: number; +} + +/** Contains response data for the listBySubscriptionNext operation. */ +export type ProjectsListBySubscriptionNextResponse = ProjectListResult; + +/** Optional parameters. */ +export interface ProjectsListByResourceGroupNextOptionalParams + extends coreClient.OperationOptions { + /** The maximum number of resources to return from the operation. Example: '$top=10'. */ + top?: number; +} + +/** Contains response data for the listByResourceGroupNext operation. */ +export type ProjectsListByResourceGroupNextResponse = ProjectListResult; + +/** Optional parameters. */ +export interface AttachedNetworksListByProjectOptionalParams + extends coreClient.OperationOptions { + /** The maximum number of resources to return from the operation. Example: '$top=10'. */ + top?: number; +} + +/** Contains response data for the listByProject operation. */ +export type AttachedNetworksListByProjectResponse = AttachedNetworkListResult; + +/** Optional parameters. */ +export interface AttachedNetworksGetByProjectOptionalParams + extends coreClient.OperationOptions {} + +/** Contains response data for the getByProject operation. */ +export type AttachedNetworksGetByProjectResponse = AttachedNetworkConnection; + +/** Optional parameters. */ +export interface AttachedNetworksListByDevCenterOptionalParams + extends coreClient.OperationOptions { + /** The maximum number of resources to return from the operation. Example: '$top=10'. */ + top?: number; +} + +/** Contains response data for the listByDevCenter operation. */ +export type AttachedNetworksListByDevCenterResponse = AttachedNetworkListResult; + +/** Optional parameters. */ +export interface AttachedNetworksGetByDevCenterOptionalParams + extends coreClient.OperationOptions {} + +/** Contains response data for the getByDevCenter operation. */ +export type AttachedNetworksGetByDevCenterResponse = AttachedNetworkConnection; + +/** Optional parameters. */ +export interface AttachedNetworksCreateOrUpdateOptionalParams + 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 createOrUpdate operation. */ +export type AttachedNetworksCreateOrUpdateResponse = AttachedNetworkConnection; + +/** Optional parameters. */ +export interface AttachedNetworksDeleteOptionalParams + 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 AttachedNetworksListByProjectNextOptionalParams + extends coreClient.OperationOptions { + /** The maximum number of resources to return from the operation. Example: '$top=10'. */ + top?: number; +} + +/** Contains response data for the listByProjectNext operation. */ +export type AttachedNetworksListByProjectNextResponse = AttachedNetworkListResult; + +/** Optional parameters. */ +export interface AttachedNetworksListByDevCenterNextOptionalParams + extends coreClient.OperationOptions { + /** The maximum number of resources to return from the operation. Example: '$top=10'. */ + top?: number; +} + +/** Contains response data for the listByDevCenterNext operation. */ +export type AttachedNetworksListByDevCenterNextResponse = AttachedNetworkListResult; + +/** Optional parameters. */ +export interface GalleriesListByDevCenterOptionalParams + extends coreClient.OperationOptions { + /** The maximum number of resources to return from the operation. Example: '$top=10'. */ + top?: number; +} + +/** Contains response data for the listByDevCenter operation. */ +export type GalleriesListByDevCenterResponse = GalleryListResult; + +/** Optional parameters. */ +export interface GalleriesGetOptionalParams + extends coreClient.OperationOptions {} + +/** Contains response data for the get operation. */ +export type GalleriesGetResponse = Gallery; + +/** Optional parameters. */ +export interface GalleriesCreateOrUpdateOptionalParams + 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 createOrUpdate operation. */ +export type GalleriesCreateOrUpdateResponse = Gallery; + +/** Optional parameters. */ +export interface GalleriesDeleteOptionalParams + 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 GalleriesListByDevCenterNextOptionalParams + extends coreClient.OperationOptions { + /** The maximum number of resources to return from the operation. Example: '$top=10'. */ + top?: number; +} + +/** Contains response data for the listByDevCenterNext operation. */ +export type GalleriesListByDevCenterNextResponse = GalleryListResult; + +/** Optional parameters. */ +export interface ImagesListByDevCenterOptionalParams + extends coreClient.OperationOptions { + /** The maximum number of resources to return from the operation. Example: '$top=10'. */ + top?: number; +} + +/** Contains response data for the listByDevCenter operation. */ +export type ImagesListByDevCenterResponse = ImageListResult; + +/** Optional parameters. */ +export interface ImagesListByGalleryOptionalParams + extends coreClient.OperationOptions { + /** The maximum number of resources to return from the operation. Example: '$top=10'. */ + top?: number; +} + +/** Contains response data for the listByGallery operation. */ +export type ImagesListByGalleryResponse = ImageListResult; + +/** Optional parameters. */ +export interface ImagesGetOptionalParams extends coreClient.OperationOptions {} + +/** Contains response data for the get operation. */ +export type ImagesGetResponse = Image; + +/** Optional parameters. */ +export interface ImagesListByDevCenterNextOptionalParams + extends coreClient.OperationOptions { + /** The maximum number of resources to return from the operation. Example: '$top=10'. */ + top?: number; +} + +/** Contains response data for the listByDevCenterNext operation. */ +export type ImagesListByDevCenterNextResponse = ImageListResult; + +/** Optional parameters. */ +export interface ImagesListByGalleryNextOptionalParams + extends coreClient.OperationOptions { + /** The maximum number of resources to return from the operation. Example: '$top=10'. */ + top?: number; +} + +/** Contains response data for the listByGalleryNext operation. */ +export type ImagesListByGalleryNextResponse = ImageListResult; + +/** Optional parameters. */ +export interface ImageVersionsListByImageOptionalParams + extends coreClient.OperationOptions {} + +/** Contains response data for the listByImage operation. */ +export type ImageVersionsListByImageResponse = ImageVersionListResult; + +/** Optional parameters. */ +export interface ImageVersionsGetOptionalParams + extends coreClient.OperationOptions {} + +/** Contains response data for the get operation. */ +export type ImageVersionsGetResponse = ImageVersion; + +/** Optional parameters. */ +export interface ImageVersionsListByImageNextOptionalParams + extends coreClient.OperationOptions {} + +/** Contains response data for the listByImageNext operation. */ +export type ImageVersionsListByImageNextResponse = ImageVersionListResult; + +/** Optional parameters. */ +export interface CatalogsListByDevCenterOptionalParams + extends coreClient.OperationOptions { + /** The maximum number of resources to return from the operation. Example: '$top=10'. */ + top?: number; +} + +/** Contains response data for the listByDevCenter operation. */ +export type CatalogsListByDevCenterResponse = CatalogListResult; + +/** Optional parameters. */ +export interface CatalogsGetOptionalParams + extends coreClient.OperationOptions {} + +/** Contains response data for the get operation. */ +export type CatalogsGetResponse = Catalog; + +/** Optional parameters. */ +export interface CatalogsCreateOrUpdateOptionalParams + 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 createOrUpdate operation. */ +export type CatalogsCreateOrUpdateResponse = Catalog; + +/** Optional parameters. */ +export interface CatalogsUpdateOptionalParams + 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 CatalogsUpdateResponse = Catalog; + +/** Optional parameters. */ +export interface CatalogsDeleteOptionalParams + 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 CatalogsSyncOptionalParams + 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 CatalogsListByDevCenterNextOptionalParams + extends coreClient.OperationOptions { + /** The maximum number of resources to return from the operation. Example: '$top=10'. */ + top?: number; +} + +/** Contains response data for the listByDevCenterNext operation. */ +export type CatalogsListByDevCenterNextResponse = CatalogListResult; + +/** Optional parameters. */ +export interface EnvironmentTypesListByDevCenterOptionalParams + extends coreClient.OperationOptions { + /** The maximum number of resources to return from the operation. Example: '$top=10'. */ + top?: number; +} + +/** Contains response data for the listByDevCenter operation. */ +export type EnvironmentTypesListByDevCenterResponse = EnvironmentTypeListResult; + +/** Optional parameters. */ +export interface EnvironmentTypesGetOptionalParams + extends coreClient.OperationOptions {} + +/** Contains response data for the get operation. */ +export type EnvironmentTypesGetResponse = EnvironmentType; + +/** Optional parameters. */ +export interface EnvironmentTypesCreateOrUpdateOptionalParams + extends coreClient.OperationOptions {} + +/** Contains response data for the createOrUpdate operation. */ +export type EnvironmentTypesCreateOrUpdateResponse = EnvironmentType; + +/** Optional parameters. */ +export interface EnvironmentTypesUpdateOptionalParams + extends coreClient.OperationOptions {} + +/** Contains response data for the update operation. */ +export type EnvironmentTypesUpdateResponse = EnvironmentType; + +/** Optional parameters. */ +export interface EnvironmentTypesDeleteOptionalParams + extends coreClient.OperationOptions {} + +/** Optional parameters. */ +export interface EnvironmentTypesListByDevCenterNextOptionalParams + extends coreClient.OperationOptions { + /** The maximum number of resources to return from the operation. Example: '$top=10'. */ + top?: number; +} + +/** Contains response data for the listByDevCenterNext operation. */ +export type EnvironmentTypesListByDevCenterNextResponse = EnvironmentTypeListResult; + +/** Optional parameters. */ +export interface ProjectEnvironmentTypesListOptionalParams + extends coreClient.OperationOptions { + /** The maximum number of resources to return from the operation. Example: '$top=10'. */ + top?: number; +} + +/** Contains response data for the list operation. */ +export type ProjectEnvironmentTypesListResponse = ProjectEnvironmentTypeListResult; + +/** Optional parameters. */ +export interface ProjectEnvironmentTypesGetOptionalParams + extends coreClient.OperationOptions {} + +/** Contains response data for the get operation. */ +export type ProjectEnvironmentTypesGetResponse = ProjectEnvironmentType; + +/** Optional parameters. */ +export interface ProjectEnvironmentTypesCreateOrUpdateOptionalParams + extends coreClient.OperationOptions {} + +/** Contains response data for the createOrUpdate operation. */ +export type ProjectEnvironmentTypesCreateOrUpdateResponse = ProjectEnvironmentType; + +/** Optional parameters. */ +export interface ProjectEnvironmentTypesUpdateOptionalParams + extends coreClient.OperationOptions {} + +/** Contains response data for the update operation. */ +export type ProjectEnvironmentTypesUpdateResponse = ProjectEnvironmentType; + +/** Optional parameters. */ +export interface ProjectEnvironmentTypesDeleteOptionalParams + extends coreClient.OperationOptions {} + +/** Optional parameters. */ +export interface ProjectEnvironmentTypesListNextOptionalParams + extends coreClient.OperationOptions { + /** The maximum number of resources to return from the operation. Example: '$top=10'. */ + top?: number; +} + +/** Contains response data for the listNext operation. */ +export type ProjectEnvironmentTypesListNextResponse = ProjectEnvironmentTypeListResult; + +/** Optional parameters. */ +export interface DevBoxDefinitionsListByDevCenterOptionalParams + extends coreClient.OperationOptions { + /** The maximum number of resources to return from the operation. Example: '$top=10'. */ + top?: number; +} + +/** Contains response data for the listByDevCenter operation. */ +export type DevBoxDefinitionsListByDevCenterResponse = DevBoxDefinitionListResult; + +/** Optional parameters. */ +export interface DevBoxDefinitionsGetOptionalParams + extends coreClient.OperationOptions {} + +/** Contains response data for the get operation. */ +export type DevBoxDefinitionsGetResponse = DevBoxDefinition; + +/** Optional parameters. */ +export interface DevBoxDefinitionsCreateOrUpdateOptionalParams + 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 createOrUpdate operation. */ +export type DevBoxDefinitionsCreateOrUpdateResponse = DevBoxDefinition; + +/** Optional parameters. */ +export interface DevBoxDefinitionsUpdateOptionalParams + 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 DevBoxDefinitionsUpdateResponse = DevBoxDefinition; + +/** Optional parameters. */ +export interface DevBoxDefinitionsDeleteOptionalParams + 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 DevBoxDefinitionsListByProjectOptionalParams + extends coreClient.OperationOptions { + /** The maximum number of resources to return from the operation. Example: '$top=10'. */ + top?: number; +} + +/** Contains response data for the listByProject operation. */ +export type DevBoxDefinitionsListByProjectResponse = DevBoxDefinitionListResult; + +/** Optional parameters. */ +export interface DevBoxDefinitionsGetByProjectOptionalParams + extends coreClient.OperationOptions {} + +/** Contains response data for the getByProject operation. */ +export type DevBoxDefinitionsGetByProjectResponse = DevBoxDefinition; + +/** Optional parameters. */ +export interface DevBoxDefinitionsListByDevCenterNextOptionalParams + extends coreClient.OperationOptions { + /** The maximum number of resources to return from the operation. Example: '$top=10'. */ + top?: number; +} + +/** Contains response data for the listByDevCenterNext operation. */ +export type DevBoxDefinitionsListByDevCenterNextResponse = DevBoxDefinitionListResult; + +/** Optional parameters. */ +export interface DevBoxDefinitionsListByProjectNextOptionalParams + extends coreClient.OperationOptions { + /** The maximum number of resources to return from the operation. Example: '$top=10'. */ + top?: number; +} + +/** Contains response data for the listByProjectNext operation. */ +export type DevBoxDefinitionsListByProjectNextResponse = DevBoxDefinitionListResult; + +/** 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 OperationStatusesGetOptionalParams + extends coreClient.OperationOptions {} + +/** Contains response data for the get operation. */ +export type OperationStatusesGetResponse = OperationStatus; + +/** Optional parameters. */ +export interface UsagesListByLocationOptionalParams + extends coreClient.OperationOptions {} + +/** Contains response data for the listByLocation operation. */ +export type UsagesListByLocationResponse = ListUsagesResult; + +/** Optional parameters. */ +export interface UsagesListByLocationNextOptionalParams + extends coreClient.OperationOptions {} + +/** Contains response data for the listByLocationNext operation. */ +export type UsagesListByLocationNextResponse = ListUsagesResult; + +/** Optional parameters. */ +export interface SkusListBySubscriptionOptionalParams + extends coreClient.OperationOptions { + /** The maximum number of resources to return from the operation. Example: '$top=10'. */ + top?: number; +} + +/** Contains response data for the listBySubscription operation. */ +export type SkusListBySubscriptionResponse = SkuListResult; + +/** Optional parameters. */ +export interface SkusListBySubscriptionNextOptionalParams + extends coreClient.OperationOptions { + /** The maximum number of resources to return from the operation. Example: '$top=10'. */ + top?: number; +} + +/** Contains response data for the listBySubscriptionNext operation. */ +export type SkusListBySubscriptionNextResponse = SkuListResult; + +/** Optional parameters. */ +export interface PoolsListByProjectOptionalParams + extends coreClient.OperationOptions { + /** The maximum number of resources to return from the operation. Example: '$top=10'. */ + top?: number; +} + +/** Contains response data for the listByProject operation. */ +export type PoolsListByProjectResponse = PoolListResult; + +/** Optional parameters. */ +export interface PoolsGetOptionalParams extends coreClient.OperationOptions {} + +/** Contains response data for the get operation. */ +export type PoolsGetResponse = Pool; + +/** Optional parameters. */ +export interface PoolsCreateOrUpdateOptionalParams + 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 createOrUpdate operation. */ +export type PoolsCreateOrUpdateResponse = Pool; + +/** Optional parameters. */ +export interface PoolsUpdateOptionalParams 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 PoolsUpdateResponse = Pool; + +/** Optional parameters. */ +export interface PoolsDeleteOptionalParams 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 PoolsListByProjectNextOptionalParams + extends coreClient.OperationOptions { + /** The maximum number of resources to return from the operation. Example: '$top=10'. */ + top?: number; +} + +/** Contains response data for the listByProjectNext operation. */ +export type PoolsListByProjectNextResponse = PoolListResult; + +/** Optional parameters. */ +export interface SchedulesListByPoolOptionalParams + extends coreClient.OperationOptions { + /** The maximum number of resources to return from the operation. Example: '$top=10'. */ + top?: number; +} + +/** Contains response data for the listByPool operation. */ +export type SchedulesListByPoolResponse = ScheduleListResult; + +/** Optional parameters. */ +export interface SchedulesGetOptionalParams + extends coreClient.OperationOptions { + /** The maximum number of resources to return from the operation. Example: '$top=10'. */ + top?: number; +} + +/** Contains response data for the get operation. */ +export type SchedulesGetResponse = Schedule; + +/** Optional parameters. */ +export interface SchedulesCreateOrUpdateOptionalParams + extends coreClient.OperationOptions { + /** The maximum number of resources to return from the operation. Example: '$top=10'. */ + top?: number; + /** Delay to wait until next poll, in milliseconds. */ + updateIntervalInMs?: number; + /** A serialized poller which can be used to resume an existing paused Long-Running-Operation. */ + resumeFrom?: string; +} + +/** Contains response data for the createOrUpdate operation. */ +export type SchedulesCreateOrUpdateResponse = Schedule; + +/** Optional parameters. */ +export interface SchedulesUpdateOptionalParams + extends coreClient.OperationOptions { + /** The maximum number of resources to return from the operation. Example: '$top=10'. */ + top?: number; + /** 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 SchedulesDeleteOptionalParams + extends coreClient.OperationOptions { + /** The maximum number of resources to return from the operation. Example: '$top=10'. */ + top?: number; + /** 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 SchedulesListByPoolNextOptionalParams + extends coreClient.OperationOptions { + /** The maximum number of resources to return from the operation. Example: '$top=10'. */ + top?: number; +} + +/** Contains response data for the listByPoolNext operation. */ +export type SchedulesListByPoolNextResponse = ScheduleListResult; + +/** Optional parameters. */ +export interface NetworkConnectionsListBySubscriptionOptionalParams + extends coreClient.OperationOptions { + /** The maximum number of resources to return from the operation. Example: '$top=10'. */ + top?: number; +} + +/** Contains response data for the listBySubscription operation. */ +export type NetworkConnectionsListBySubscriptionResponse = NetworkConnectionListResult; + +/** Optional parameters. */ +export interface NetworkConnectionsListByResourceGroupOptionalParams + extends coreClient.OperationOptions { + /** The maximum number of resources to return from the operation. Example: '$top=10'. */ + top?: number; +} + +/** Contains response data for the listByResourceGroup operation. */ +export type NetworkConnectionsListByResourceGroupResponse = NetworkConnectionListResult; + +/** Optional parameters. */ +export interface NetworkConnectionsGetOptionalParams + extends coreClient.OperationOptions {} + +/** Contains response data for the get operation. */ +export type NetworkConnectionsGetResponse = NetworkConnection; + +/** Optional parameters. */ +export interface NetworkConnectionsCreateOrUpdateOptionalParams + 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 createOrUpdate operation. */ +export type NetworkConnectionsCreateOrUpdateResponse = NetworkConnection; + +/** Optional parameters. */ +export interface NetworkConnectionsUpdateOptionalParams + 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 NetworkConnectionsUpdateResponse = NetworkConnection; + +/** Optional parameters. */ +export interface NetworkConnectionsDeleteOptionalParams + 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 NetworkConnectionsListHealthDetailsOptionalParams + extends coreClient.OperationOptions { + /** The maximum number of resources to return from the operation. Example: '$top=10'. */ + top?: number; +} + +/** Contains response data for the listHealthDetails operation. */ +export type NetworkConnectionsListHealthDetailsResponse = HealthCheckStatusDetailsListResult; + +/** Optional parameters. */ +export interface NetworkConnectionsGetHealthDetailsOptionalParams + extends coreClient.OperationOptions {} + +/** Contains response data for the getHealthDetails operation. */ +export type NetworkConnectionsGetHealthDetailsResponse = HealthCheckStatusDetails; + +/** Optional parameters. */ +export interface NetworkConnectionsRunHealthChecksOptionalParams + extends coreClient.OperationOptions {} + +/** Optional parameters. */ +export interface NetworkConnectionsListBySubscriptionNextOptionalParams + extends coreClient.OperationOptions { + /** The maximum number of resources to return from the operation. Example: '$top=10'. */ + top?: number; +} + +/** Contains response data for the listBySubscriptionNext operation. */ +export type NetworkConnectionsListBySubscriptionNextResponse = NetworkConnectionListResult; + +/** Optional parameters. */ +export interface NetworkConnectionsListByResourceGroupNextOptionalParams + extends coreClient.OperationOptions { + /** The maximum number of resources to return from the operation. Example: '$top=10'. */ + top?: number; +} + +/** Contains response data for the listByResourceGroupNext operation. */ +export type NetworkConnectionsListByResourceGroupNextResponse = NetworkConnectionListResult; + +/** Optional parameters. */ +export interface NetworkConnectionsListHealthDetailsNextOptionalParams + extends coreClient.OperationOptions { + /** The maximum number of resources to return from the operation. Example: '$top=10'. */ + top?: number; +} + +/** Contains response data for the listHealthDetailsNext operation. */ +export type NetworkConnectionsListHealthDetailsNextResponse = HealthCheckStatusDetailsListResult; + +/** Optional parameters. */ +export interface DevCenterClientOptionalParams + extends coreClient.ServiceClientOptions { + /** server parameter */ + $host?: string; + /** Api Version */ + apiVersion?: string; + /** Overrides client endpoint. */ + endpoint?: string; +} diff --git a/sdk/devcenter/arm-devcenter/src/models/mappers.ts b/sdk/devcenter/arm-devcenter/src/models/mappers.ts new file mode 100644 index 000000000000..ccf9f3a14124 --- /dev/null +++ b/sdk/devcenter/arm-devcenter/src/models/mappers.ts @@ -0,0 +1,2611 @@ +/* + * 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 DevCenterListResult: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "DevCenterListResult", + modelProperties: { + value: { + serializedName: "value", + readOnly: true, + type: { + name: "Sequence", + element: { + type: { + name: "Composite", + className: "DevCenter" + } + } + } + }, + nextLink: { + serializedName: "nextLink", + readOnly: true, + type: { + name: "String" + } + } + } + } +}; + +export const ManagedServiceIdentity: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "ManagedServiceIdentity", + modelProperties: { + principalId: { + serializedName: "principalId", + readOnly: true, + type: { + name: "Uuid" + } + }, + tenantId: { + serializedName: "tenantId", + readOnly: true, + type: { + name: "Uuid" + } + }, + type: { + serializedName: "type", + required: true, + type: { + name: "String" + } + }, + userAssignedIdentities: { + serializedName: "userAssignedIdentities", + type: { + name: "Dictionary", + value: { + type: { name: "Composite", className: "UserAssignedIdentity" } + } + } + } + } + } +}; + +export const UserAssignedIdentity: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "UserAssignedIdentity", + modelProperties: { + principalId: { + serializedName: "principalId", + readOnly: true, + type: { + name: "Uuid" + } + }, + clientId: { + serializedName: "clientId", + readOnly: true, + type: { + name: "Uuid" + } + } + } + } +}; + +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" + } + }, + systemData: { + serializedName: "systemData", + type: { + name: "Composite", + className: "SystemData" + } + } + } + } +}; + +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 CloudError: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "CloudError", + modelProperties: { + error: { + serializedName: "error", + type: { + name: "Composite", + className: "CloudErrorBody" + } + } + } + } +}; + +export const CloudErrorBody: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "CloudErrorBody", + modelProperties: { + code: { + serializedName: "code", + required: true, + type: { + name: "String" + } + }, + message: { + serializedName: "message", + required: true, + type: { + name: "String" + } + }, + target: { + serializedName: "target", + type: { + name: "String" + } + }, + details: { + serializedName: "details", + type: { + name: "Sequence", + element: { + type: { + name: "Composite", + className: "CloudErrorBody" + } + } + } + } + } + } +}; + +export const TrackedResourceUpdate: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "TrackedResourceUpdate", + modelProperties: { + tags: { + serializedName: "tags", + type: { + name: "Dictionary", + value: { type: { name: "String" } } + } + }, + location: { + serializedName: "location", + type: { + name: "String" + } + } + } + } +}; + +export const ProjectListResult: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "ProjectListResult", + modelProperties: { + value: { + serializedName: "value", + readOnly: true, + type: { + name: "Sequence", + element: { + type: { + name: "Composite", + className: "Project" + } + } + } + }, + nextLink: { + serializedName: "nextLink", + readOnly: true, + type: { + name: "String" + } + } + } + } +}; + +export const ProjectUpdateProperties: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "ProjectUpdateProperties", + modelProperties: { + devCenterId: { + serializedName: "devCenterId", + type: { + name: "String" + } + }, + description: { + serializedName: "description", + type: { + name: "String" + } + } + } + } +}; + +export const AttachedNetworkListResult: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "AttachedNetworkListResult", + modelProperties: { + value: { + serializedName: "value", + readOnly: true, + type: { + name: "Sequence", + element: { + type: { + name: "Composite", + className: "AttachedNetworkConnection" + } + } + } + }, + nextLink: { + serializedName: "nextLink", + readOnly: true, + type: { + name: "String" + } + } + } + } +}; + +export const GalleryListResult: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "GalleryListResult", + modelProperties: { + value: { + serializedName: "value", + readOnly: true, + type: { + name: "Sequence", + element: { + type: { + name: "Composite", + className: "Gallery" + } + } + } + }, + nextLink: { + serializedName: "nextLink", + readOnly: true, + type: { + name: "String" + } + } + } + } +}; + +export const ImageListResult: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "ImageListResult", + modelProperties: { + value: { + serializedName: "value", + readOnly: true, + type: { + name: "Sequence", + element: { + type: { + name: "Composite", + className: "Image" + } + } + } + }, + nextLink: { + serializedName: "nextLink", + readOnly: true, + type: { + name: "String" + } + } + } + } +}; + +export const RecommendedMachineConfiguration: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "RecommendedMachineConfiguration", + modelProperties: { + memory: { + serializedName: "memory", + type: { + name: "Composite", + className: "ResourceRange" + } + }, + vCPUs: { + serializedName: "vCPUs", + type: { + name: "Composite", + className: "ResourceRange" + } + } + } + } +}; + +export const ResourceRange: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "ResourceRange", + modelProperties: { + min: { + serializedName: "min", + readOnly: true, + type: { + name: "Number" + } + }, + max: { + serializedName: "max", + readOnly: true, + type: { + name: "Number" + } + } + } + } +}; + +export const ImageVersionListResult: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "ImageVersionListResult", + modelProperties: { + value: { + serializedName: "value", + readOnly: true, + type: { + name: "Sequence", + element: { + type: { + name: "Composite", + className: "ImageVersion" + } + } + } + }, + nextLink: { + serializedName: "nextLink", + readOnly: true, + type: { + name: "String" + } + } + } + } +}; + +export const CatalogListResult: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "CatalogListResult", + modelProperties: { + value: { + serializedName: "value", + readOnly: true, + type: { + name: "Sequence", + element: { + type: { + name: "Composite", + className: "Catalog" + } + } + } + }, + nextLink: { + serializedName: "nextLink", + readOnly: true, + type: { + name: "String" + } + } + } + } +}; + +export const CatalogUpdateProperties: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "CatalogUpdateProperties", + modelProperties: { + gitHub: { + serializedName: "gitHub", + type: { + name: "Composite", + className: "GitCatalog" + } + }, + adoGit: { + serializedName: "adoGit", + type: { + name: "Composite", + className: "GitCatalog" + } + } + } + } +}; + +export const GitCatalog: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "GitCatalog", + modelProperties: { + uri: { + serializedName: "uri", + type: { + name: "String" + } + }, + branch: { + serializedName: "branch", + type: { + name: "String" + } + }, + secretIdentifier: { + serializedName: "secretIdentifier", + type: { + name: "String" + } + }, + path: { + serializedName: "path", + type: { + name: "String" + } + } + } + } +}; + +export const CatalogUpdate: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "CatalogUpdate", + modelProperties: { + tags: { + serializedName: "tags", + type: { + name: "Dictionary", + value: { type: { name: "String" } } + } + }, + gitHub: { + serializedName: "properties.gitHub", + type: { + name: "Composite", + className: "GitCatalog" + } + }, + adoGit: { + serializedName: "properties.adoGit", + type: { + name: "Composite", + className: "GitCatalog" + } + } + } + } +}; + +export const EnvironmentTypeListResult: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "EnvironmentTypeListResult", + modelProperties: { + value: { + serializedName: "value", + readOnly: true, + type: { + name: "Sequence", + element: { + type: { + name: "Composite", + className: "EnvironmentType" + } + } + } + }, + nextLink: { + serializedName: "nextLink", + readOnly: true, + type: { + name: "String" + } + } + } + } +}; + +export const EnvironmentTypeUpdate: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "EnvironmentTypeUpdate", + modelProperties: { + tags: { + serializedName: "tags", + type: { + name: "Dictionary", + value: { type: { name: "String" } } + } + } + } + } +}; + +export const ProjectEnvironmentTypeListResult: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "ProjectEnvironmentTypeListResult", + modelProperties: { + value: { + serializedName: "value", + readOnly: true, + type: { + name: "Sequence", + element: { + type: { + name: "Composite", + className: "ProjectEnvironmentType" + } + } + } + }, + nextLink: { + serializedName: "nextLink", + readOnly: true, + type: { + name: "String" + } + } + } + } +}; + +export const ProjectEnvironmentTypeUpdateProperties: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "ProjectEnvironmentTypeUpdateProperties", + modelProperties: { + deploymentTargetId: { + serializedName: "deploymentTargetId", + type: { + name: "String" + } + }, + status: { + serializedName: "status", + type: { + name: "String" + } + }, + creatorRoleAssignment: { + serializedName: "creatorRoleAssignment", + type: { + name: "Composite", + className: + "ProjectEnvironmentTypeUpdatePropertiesCreatorRoleAssignment" + } + }, + userRoleAssignments: { + serializedName: "userRoleAssignments", + type: { + name: "Dictionary", + value: { + type: { name: "Composite", className: "UserRoleAssignmentValue" } + } + } + } + } + } +}; + +export const ProjectEnvironmentTypeUpdatePropertiesCreatorRoleAssignment: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "ProjectEnvironmentTypeUpdatePropertiesCreatorRoleAssignment", + modelProperties: { + roles: { + serializedName: "roles", + type: { + name: "Dictionary", + value: { type: { name: "Composite", className: "EnvironmentRole" } } + } + } + } + } +}; + +export const EnvironmentRole: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "EnvironmentRole", + modelProperties: { + roleName: { + serializedName: "roleName", + readOnly: true, + type: { + name: "String" + } + }, + description: { + serializedName: "description", + readOnly: true, + type: { + name: "String" + } + } + } + } +}; + +export const UserRoleAssignmentValue: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "UserRoleAssignmentValue", + modelProperties: { + roles: { + serializedName: "roles", + type: { + name: "Dictionary", + value: { type: { name: "Composite", className: "EnvironmentRole" } } + } + } + } + } +}; + +export const ProjectEnvironmentTypeUpdate: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "ProjectEnvironmentTypeUpdate", + modelProperties: { + tags: { + serializedName: "tags", + type: { + name: "Dictionary", + value: { type: { name: "String" } } + } + }, + identity: { + serializedName: "identity", + type: { + name: "Composite", + className: "ManagedServiceIdentity" + } + }, + deploymentTargetId: { + serializedName: "properties.deploymentTargetId", + type: { + name: "String" + } + }, + status: { + serializedName: "properties.status", + type: { + name: "String" + } + }, + creatorRoleAssignment: { + serializedName: "properties.creatorRoleAssignment", + type: { + name: "Composite", + className: + "ProjectEnvironmentTypeUpdatePropertiesCreatorRoleAssignment" + } + }, + userRoleAssignments: { + serializedName: "properties.userRoleAssignments", + type: { + name: "Dictionary", + value: { + type: { name: "Composite", className: "UserRoleAssignmentValue" } + } + } + } + } + } +}; + +export const DevBoxDefinitionListResult: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "DevBoxDefinitionListResult", + modelProperties: { + value: { + serializedName: "value", + readOnly: true, + type: { + name: "Sequence", + element: { + type: { + name: "Composite", + className: "DevBoxDefinition" + } + } + } + }, + nextLink: { + serializedName: "nextLink", + readOnly: true, + type: { + name: "String" + } + } + } + } +}; + +export const ImageValidationErrorDetails: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "ImageValidationErrorDetails", + modelProperties: { + code: { + serializedName: "code", + type: { + name: "String" + } + }, + message: { + serializedName: "message", + type: { + name: "String" + } + } + } + } +}; + +export const ImageReference: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "ImageReference", + modelProperties: { + id: { + serializedName: "id", + type: { + name: "String" + } + }, + exactVersion: { + serializedName: "exactVersion", + readOnly: true, + type: { + name: "String" + } + }, + publisher: { + serializedName: "publisher", + type: { + name: "String" + } + }, + offer: { + serializedName: "offer", + type: { + name: "String" + } + }, + sku: { + serializedName: "sku", + type: { + name: "String" + } + } + } + } +}; + +export const DevBoxDefinitionUpdateProperties: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "DevBoxDefinitionUpdateProperties", + modelProperties: { + imageReference: { + serializedName: "imageReference", + type: { + name: "Composite", + className: "ImageReference" + } + }, + sku: { + serializedName: "sku", + type: { + name: "Composite", + className: "Sku" + } + }, + osStorageType: { + serializedName: "osStorageType", + type: { + name: "String" + } + } + } + } +}; + +export const Sku: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "Sku", + modelProperties: { + name: { + serializedName: "name", + required: true, + type: { + name: "String" + } + }, + tier: { + serializedName: "tier", + type: { + name: "Enum", + allowedValues: ["Free", "Basic", "Standard", "Premium"] + } + }, + size: { + serializedName: "size", + type: { + name: "String" + } + }, + family: { + serializedName: "family", + type: { + name: "String" + } + }, + capacity: { + serializedName: "capacity", + type: { + name: "Number" + } + } + } + } +}; + +export const OperationListResult: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "OperationListResult", + modelProperties: { + value: { + serializedName: "value", + readOnly: true, + 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" + } + }, + display: { + serializedName: "display", + type: { + name: "Composite", + className: "OperationDisplay" + } + }, + origin: { + serializedName: "origin", + readOnly: true, + type: { + name: "String" + } + }, + actionType: { + serializedName: "actionType", + readOnly: true, + type: { + name: "String" + } + } + } + } +}; + +export const OperationDisplay: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "OperationDisplay", + modelProperties: { + provider: { + serializedName: "provider", + readOnly: true, + type: { + name: "String" + } + }, + resource: { + serializedName: "resource", + readOnly: true, + type: { + name: "String" + } + }, + operation: { + serializedName: "operation", + readOnly: true, + type: { + name: "String" + } + }, + description: { + serializedName: "description", + readOnly: true, + type: { + name: "String" + } + } + } + } +}; + +export const OperationStatus: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "OperationStatus", + modelProperties: { + id: { + serializedName: "id", + readOnly: true, + type: { + name: "String" + } + }, + name: { + serializedName: "name", + readOnly: true, + type: { + name: "String" + } + }, + status: { + serializedName: "status", + readOnly: true, + type: { + name: "String" + } + }, + startTime: { + serializedName: "startTime", + readOnly: true, + type: { + name: "DateTime" + } + }, + endTime: { + serializedName: "endTime", + readOnly: true, + type: { + name: "DateTime" + } + }, + percentComplete: { + constraints: { + InclusiveMaximum: 100, + InclusiveMinimum: 0 + }, + serializedName: "percentComplete", + readOnly: true, + type: { + name: "Number" + } + }, + properties: { + serializedName: "properties", + readOnly: true, + type: { + name: "Dictionary", + value: { type: { name: "any" } } + } + }, + error: { + serializedName: "error", + type: { + name: "Composite", + className: "OperationStatusError" + } + } + } + } +}; + +export const OperationStatusError: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "OperationStatusError", + modelProperties: { + code: { + serializedName: "code", + readOnly: true, + type: { + name: "String" + } + }, + message: { + serializedName: "message", + readOnly: true, + type: { + name: "String" + } + } + } + } +}; + +export const ListUsagesResult: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "ListUsagesResult", + modelProperties: { + value: { + serializedName: "value", + readOnly: true, + type: { + name: "Sequence", + element: { + type: { + name: "Composite", + className: "Usage" + } + } + } + }, + nextLink: { + serializedName: "nextLink", + readOnly: true, + type: { + name: "String" + } + } + } + } +}; + +export const Usage: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "Usage", + modelProperties: { + currentValue: { + serializedName: "currentValue", + type: { + name: "Number" + } + }, + limit: { + serializedName: "limit", + type: { + name: "Number" + } + }, + unit: { + serializedName: "unit", + type: { + name: "String" + } + }, + name: { + serializedName: "name", + type: { + name: "Composite", + className: "UsageName" + } + } + } + } +}; + +export const UsageName: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "UsageName", + modelProperties: { + localizedValue: { + serializedName: "localizedValue", + type: { + name: "String" + } + }, + value: { + serializedName: "value", + type: { + name: "String" + } + } + } + } +}; + +export const SkuListResult: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "SkuListResult", + modelProperties: { + value: { + serializedName: "value", + readOnly: true, + type: { + name: "Sequence", + element: { + type: { + name: "Composite", + className: "DevCenterSku" + } + } + } + }, + nextLink: { + serializedName: "nextLink", + readOnly: true, + type: { + name: "String" + } + } + } + } +}; + +export const Capability: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "Capability", + modelProperties: { + name: { + serializedName: "name", + readOnly: true, + type: { + name: "String" + } + }, + value: { + serializedName: "value", + readOnly: true, + type: { + name: "String" + } + } + } + } +}; + +export const PoolListResult: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "PoolListResult", + modelProperties: { + value: { + serializedName: "value", + readOnly: true, + type: { + name: "Sequence", + element: { + type: { + name: "Composite", + className: "Pool" + } + } + } + }, + nextLink: { + serializedName: "nextLink", + readOnly: true, + type: { + name: "String" + } + } + } + } +}; + +export const PoolUpdateProperties: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "PoolUpdateProperties", + modelProperties: { + devBoxDefinitionName: { + serializedName: "devBoxDefinitionName", + type: { + name: "String" + } + }, + networkConnectionName: { + serializedName: "networkConnectionName", + type: { + name: "String" + } + }, + licenseType: { + serializedName: "licenseType", + type: { + name: "String" + } + }, + localAdministrator: { + serializedName: "localAdministrator", + type: { + name: "String" + } + } + } + } +}; + +export const ScheduleListResult: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "ScheduleListResult", + modelProperties: { + value: { + serializedName: "value", + readOnly: true, + type: { + name: "Sequence", + element: { + type: { + name: "Composite", + className: "Schedule" + } + } + } + }, + nextLink: { + serializedName: "nextLink", + readOnly: true, + type: { + name: "String" + } + } + } + } +}; + +export const ScheduleUpdateProperties: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "ScheduleUpdateProperties", + modelProperties: { + type: { + serializedName: "type", + type: { + name: "String" + } + }, + frequency: { + serializedName: "frequency", + type: { + name: "String" + } + }, + time: { + serializedName: "time", + type: { + name: "String" + } + }, + timeZone: { + serializedName: "timeZone", + type: { + name: "String" + } + }, + state: { + serializedName: "state", + type: { + name: "String" + } + } + } + } +}; + +export const NetworkConnectionListResult: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "NetworkConnectionListResult", + modelProperties: { + value: { + serializedName: "value", + readOnly: true, + type: { + name: "Sequence", + element: { + type: { + name: "Composite", + className: "NetworkConnection" + } + } + } + }, + nextLink: { + serializedName: "nextLink", + readOnly: true, + type: { + name: "String" + } + } + } + } +}; + +export const NetworkConnectionUpdateProperties: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "NetworkConnectionUpdateProperties", + modelProperties: { + subnetId: { + serializedName: "subnetId", + type: { + name: "String" + } + }, + domainName: { + serializedName: "domainName", + type: { + name: "String" + } + }, + organizationUnit: { + serializedName: "organizationUnit", + type: { + name: "String" + } + }, + domainUsername: { + serializedName: "domainUsername", + type: { + name: "String" + } + }, + domainPassword: { + serializedName: "domainPassword", + type: { + name: "String" + } + } + } + } +}; + +export const HealthCheckStatusDetailsListResult: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "HealthCheckStatusDetailsListResult", + modelProperties: { + value: { + serializedName: "value", + readOnly: true, + type: { + name: "Sequence", + element: { + type: { + name: "Composite", + className: "HealthCheckStatusDetails" + } + } + } + }, + nextLink: { + serializedName: "nextLink", + readOnly: true, + type: { + name: "String" + } + } + } + } +}; + +export const HealthCheck: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "HealthCheck", + modelProperties: { + status: { + serializedName: "status", + readOnly: true, + type: { + name: "String" + } + }, + displayName: { + serializedName: "displayName", + readOnly: true, + type: { + name: "String" + } + }, + startDateTime: { + serializedName: "startDateTime", + readOnly: true, + type: { + name: "DateTime" + } + }, + endDateTime: { + serializedName: "endDateTime", + readOnly: true, + type: { + name: "DateTime" + } + }, + errorType: { + serializedName: "errorType", + readOnly: true, + type: { + name: "String" + } + }, + recommendedAction: { + serializedName: "recommendedAction", + readOnly: true, + type: { + name: "String" + } + }, + additionalDetails: { + serializedName: "additionalDetails", + readOnly: true, + type: { + name: "String" + } + } + } + } +}; + +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" + } + } + } + } +}; + +export const AttachedNetworkConnection: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "AttachedNetworkConnection", + modelProperties: { + ...Resource.type.modelProperties, + provisioningState: { + serializedName: "properties.provisioningState", + readOnly: true, + type: { + name: "String" + } + }, + networkConnectionId: { + serializedName: "properties.networkConnectionId", + type: { + name: "String" + } + }, + networkConnectionLocation: { + serializedName: "properties.networkConnectionLocation", + readOnly: true, + type: { + name: "String" + } + }, + healthCheckStatus: { + serializedName: "properties.healthCheckStatus", + readOnly: true, + type: { + name: "String" + } + }, + domainJoinType: { + serializedName: "properties.domainJoinType", + readOnly: true, + type: { + name: "String" + } + } + } + } +}; + +export const Gallery: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "Gallery", + modelProperties: { + ...Resource.type.modelProperties, + provisioningState: { + serializedName: "properties.provisioningState", + readOnly: true, + type: { + name: "String" + } + }, + galleryResourceId: { + serializedName: "properties.galleryResourceId", + type: { + name: "String" + } + } + } + } +}; + +export const ProxyResource: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "ProxyResource", + modelProperties: { + ...Resource.type.modelProperties + } + } +}; + +export const Catalog: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "Catalog", + modelProperties: { + ...Resource.type.modelProperties, + gitHub: { + serializedName: "properties.gitHub", + type: { + name: "Composite", + className: "GitCatalog" + } + }, + adoGit: { + serializedName: "properties.adoGit", + type: { + name: "Composite", + className: "GitCatalog" + } + }, + provisioningState: { + serializedName: "properties.provisioningState", + readOnly: true, + type: { + name: "String" + } + }, + lastSyncTime: { + serializedName: "properties.lastSyncTime", + readOnly: true, + type: { + name: "DateTime" + } + } + } + } +}; + +export const EnvironmentType: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "EnvironmentType", + modelProperties: { + ...Resource.type.modelProperties, + tags: { + serializedName: "tags", + type: { + name: "Dictionary", + value: { type: { name: "String" } } + } + }, + provisioningState: { + serializedName: "properties.provisioningState", + readOnly: true, + type: { + name: "String" + } + } + } + } +}; + +export const ProjectEnvironmentType: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "ProjectEnvironmentType", + modelProperties: { + ...Resource.type.modelProperties, + tags: { + serializedName: "tags", + type: { + name: "Dictionary", + value: { type: { name: "String" } } + } + }, + identity: { + serializedName: "identity", + type: { + name: "Composite", + className: "ManagedServiceIdentity" + } + }, + location: { + serializedName: "location", + type: { + name: "String" + } + }, + deploymentTargetId: { + serializedName: "properties.deploymentTargetId", + type: { + name: "String" + } + }, + status: { + serializedName: "properties.status", + type: { + name: "String" + } + }, + creatorRoleAssignment: { + serializedName: "properties.creatorRoleAssignment", + type: { + name: "Composite", + className: + "ProjectEnvironmentTypeUpdatePropertiesCreatorRoleAssignment" + } + }, + userRoleAssignments: { + serializedName: "properties.userRoleAssignments", + type: { + name: "Dictionary", + value: { + type: { name: "Composite", className: "UserRoleAssignmentValue" } + } + } + }, + provisioningState: { + serializedName: "properties.provisioningState", + readOnly: true, + type: { + name: "String" + } + } + } + } +}; + +export const Schedule: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "Schedule", + modelProperties: { + ...Resource.type.modelProperties, + typePropertiesType: { + serializedName: "properties.type", + type: { + name: "String" + } + }, + frequency: { + serializedName: "properties.frequency", + type: { + name: "String" + } + }, + time: { + serializedName: "properties.time", + type: { + name: "String" + } + }, + timeZone: { + serializedName: "properties.timeZone", + type: { + name: "String" + } + }, + state: { + serializedName: "properties.state", + type: { + name: "String" + } + }, + provisioningState: { + serializedName: "properties.provisioningState", + readOnly: true, + type: { + name: "String" + } + } + } + } +}; + +export const HealthCheckStatusDetails: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "HealthCheckStatusDetails", + modelProperties: { + ...Resource.type.modelProperties, + startDateTime: { + serializedName: "properties.startDateTime", + readOnly: true, + type: { + name: "DateTime" + } + }, + endDateTime: { + serializedName: "properties.endDateTime", + readOnly: true, + type: { + name: "DateTime" + } + }, + healthChecks: { + serializedName: "properties.healthChecks", + readOnly: true, + type: { + name: "Sequence", + element: { + type: { + name: "Composite", + className: "HealthCheck" + } + } + } + } + } + } +}; + +export const DevCenterUpdate: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "DevCenterUpdate", + modelProperties: { + ...TrackedResourceUpdate.type.modelProperties, + identity: { + serializedName: "identity", + type: { + name: "Composite", + className: "ManagedServiceIdentity" + } + } + } + } +}; + +export const ProjectUpdate: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "ProjectUpdate", + modelProperties: { + ...TrackedResourceUpdate.type.modelProperties, + devCenterId: { + serializedName: "properties.devCenterId", + type: { + name: "String" + } + }, + description: { + serializedName: "properties.description", + type: { + name: "String" + } + } + } + } +}; + +export const DevBoxDefinitionUpdate: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "DevBoxDefinitionUpdate", + modelProperties: { + ...TrackedResourceUpdate.type.modelProperties, + imageReference: { + serializedName: "properties.imageReference", + type: { + name: "Composite", + className: "ImageReference" + } + }, + sku: { + serializedName: "properties.sku", + type: { + name: "Composite", + className: "Sku" + } + }, + osStorageType: { + serializedName: "properties.osStorageType", + type: { + name: "String" + } + } + } + } +}; + +export const PoolUpdate: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "PoolUpdate", + modelProperties: { + ...TrackedResourceUpdate.type.modelProperties, + devBoxDefinitionName: { + serializedName: "properties.devBoxDefinitionName", + type: { + name: "String" + } + }, + networkConnectionName: { + serializedName: "properties.networkConnectionName", + type: { + name: "String" + } + }, + licenseType: { + serializedName: "properties.licenseType", + type: { + name: "String" + } + }, + localAdministrator: { + serializedName: "properties.localAdministrator", + type: { + name: "String" + } + } + } + } +}; + +export const ScheduleUpdate: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "ScheduleUpdate", + modelProperties: { + ...TrackedResourceUpdate.type.modelProperties, + type: { + serializedName: "properties.type", + type: { + name: "String" + } + }, + frequency: { + serializedName: "properties.frequency", + type: { + name: "String" + } + }, + time: { + serializedName: "properties.time", + type: { + name: "String" + } + }, + timeZone: { + serializedName: "properties.timeZone", + type: { + name: "String" + } + }, + state: { + serializedName: "properties.state", + type: { + name: "String" + } + } + } + } +}; + +export const NetworkConnectionUpdate: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "NetworkConnectionUpdate", + modelProperties: { + ...TrackedResourceUpdate.type.modelProperties, + subnetId: { + serializedName: "properties.subnetId", + type: { + name: "String" + } + }, + domainName: { + serializedName: "properties.domainName", + type: { + name: "String" + } + }, + organizationUnit: { + serializedName: "properties.organizationUnit", + type: { + name: "String" + } + }, + domainUsername: { + serializedName: "properties.domainUsername", + type: { + name: "String" + } + }, + domainPassword: { + serializedName: "properties.domainPassword", + type: { + name: "String" + } + } + } + } +}; + +export const ProjectProperties: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "ProjectProperties", + modelProperties: { + ...ProjectUpdateProperties.type.modelProperties, + provisioningState: { + serializedName: "provisioningState", + readOnly: true, + type: { + name: "String" + } + } + } + } +}; + +export const CatalogProperties: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "CatalogProperties", + modelProperties: { + ...CatalogUpdateProperties.type.modelProperties, + provisioningState: { + serializedName: "provisioningState", + readOnly: true, + type: { + name: "String" + } + }, + lastSyncTime: { + serializedName: "lastSyncTime", + readOnly: true, + type: { + name: "DateTime" + } + } + } + } +}; + +export const ProjectEnvironmentTypeProperties: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "ProjectEnvironmentTypeProperties", + modelProperties: { + ...ProjectEnvironmentTypeUpdateProperties.type.modelProperties, + provisioningState: { + serializedName: "provisioningState", + readOnly: true, + type: { + name: "String" + } + } + } + } +}; + +export const DevBoxDefinitionProperties: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "DevBoxDefinitionProperties", + modelProperties: { + ...DevBoxDefinitionUpdateProperties.type.modelProperties, + provisioningState: { + serializedName: "provisioningState", + readOnly: true, + type: { + name: "String" + } + }, + imageValidationStatus: { + serializedName: "imageValidationStatus", + readOnly: true, + type: { + name: "String" + } + }, + imageValidationErrorDetails: { + serializedName: "imageValidationErrorDetails", + type: { + name: "Composite", + className: "ImageValidationErrorDetails" + } + }, + activeImageReference: { + serializedName: "activeImageReference", + type: { + name: "Composite", + className: "ImageReference" + } + } + } + } +}; + +export const DevCenterSku: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "DevCenterSku", + modelProperties: { + ...Sku.type.modelProperties, + resourceType: { + serializedName: "resourceType", + readOnly: true, + type: { + name: "String" + } + }, + locations: { + serializedName: "locations", + readOnly: true, + type: { + name: "Sequence", + element: { + type: { + name: "String" + } + } + } + }, + capabilities: { + serializedName: "capabilities", + readOnly: true, + type: { + name: "Sequence", + element: { + type: { + name: "Composite", + className: "Capability" + } + } + } + } + } + } +}; + +export const PoolProperties: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "PoolProperties", + modelProperties: { + ...PoolUpdateProperties.type.modelProperties, + provisioningState: { + serializedName: "provisioningState", + readOnly: true, + type: { + name: "String" + } + } + } + } +}; + +export const ScheduleProperties: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "ScheduleProperties", + modelProperties: { + ...ScheduleUpdateProperties.type.modelProperties, + provisioningState: { + serializedName: "provisioningState", + readOnly: true, + type: { + name: "String" + } + } + } + } +}; + +export const NetworkProperties: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "NetworkProperties", + modelProperties: { + ...NetworkConnectionUpdateProperties.type.modelProperties, + provisioningState: { + serializedName: "provisioningState", + readOnly: true, + type: { + name: "String" + } + }, + healthCheckStatus: { + serializedName: "healthCheckStatus", + readOnly: true, + type: { + name: "String" + } + }, + networkingResourceGroupName: { + serializedName: "networkingResourceGroupName", + type: { + name: "String" + } + }, + domainJoinType: { + serializedName: "domainJoinType", + required: true, + type: { + name: "String" + } + } + } + } +}; + +export const DevCenter: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "DevCenter", + modelProperties: { + ...TrackedResource.type.modelProperties, + identity: { + serializedName: "identity", + type: { + name: "Composite", + className: "ManagedServiceIdentity" + } + }, + provisioningState: { + serializedName: "properties.provisioningState", + readOnly: true, + type: { + name: "String" + } + } + } + } +}; + +export const Project: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "Project", + modelProperties: { + ...TrackedResource.type.modelProperties, + devCenterId: { + serializedName: "properties.devCenterId", + type: { + name: "String" + } + }, + description: { + serializedName: "properties.description", + type: { + name: "String" + } + }, + provisioningState: { + serializedName: "properties.provisioningState", + readOnly: true, + type: { + name: "String" + } + } + } + } +}; + +export const DevBoxDefinition: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "DevBoxDefinition", + modelProperties: { + ...TrackedResource.type.modelProperties, + imageReference: { + serializedName: "properties.imageReference", + type: { + name: "Composite", + className: "ImageReference" + } + }, + sku: { + serializedName: "properties.sku", + type: { + name: "Composite", + className: "Sku" + } + }, + osStorageType: { + serializedName: "properties.osStorageType", + type: { + name: "String" + } + }, + provisioningState: { + serializedName: "properties.provisioningState", + readOnly: true, + type: { + name: "String" + } + }, + imageValidationStatus: { + serializedName: "properties.imageValidationStatus", + readOnly: true, + type: { + name: "String" + } + }, + imageValidationErrorDetails: { + serializedName: "properties.imageValidationErrorDetails", + type: { + name: "Composite", + className: "ImageValidationErrorDetails" + } + }, + activeImageReference: { + serializedName: "properties.activeImageReference", + type: { + name: "Composite", + className: "ImageReference" + } + } + } + } +}; + +export const Pool: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "Pool", + modelProperties: { + ...TrackedResource.type.modelProperties, + devBoxDefinitionName: { + serializedName: "properties.devBoxDefinitionName", + type: { + name: "String" + } + }, + networkConnectionName: { + serializedName: "properties.networkConnectionName", + type: { + name: "String" + } + }, + licenseType: { + serializedName: "properties.licenseType", + type: { + name: "String" + } + }, + localAdministrator: { + serializedName: "properties.localAdministrator", + type: { + name: "String" + } + }, + provisioningState: { + serializedName: "properties.provisioningState", + readOnly: true, + type: { + name: "String" + } + } + } + } +}; + +export const NetworkConnection: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "NetworkConnection", + modelProperties: { + ...TrackedResource.type.modelProperties, + subnetId: { + serializedName: "properties.subnetId", + type: { + name: "String" + } + }, + domainName: { + serializedName: "properties.domainName", + type: { + name: "String" + } + }, + organizationUnit: { + serializedName: "properties.organizationUnit", + type: { + name: "String" + } + }, + domainUsername: { + serializedName: "properties.domainUsername", + type: { + name: "String" + } + }, + domainPassword: { + serializedName: "properties.domainPassword", + type: { + name: "String" + } + }, + provisioningState: { + serializedName: "properties.provisioningState", + readOnly: true, + type: { + name: "String" + } + }, + healthCheckStatus: { + serializedName: "properties.healthCheckStatus", + readOnly: true, + type: { + name: "String" + } + }, + networkingResourceGroupName: { + serializedName: "properties.networkingResourceGroupName", + type: { + name: "String" + } + }, + domainJoinType: { + serializedName: "properties.domainJoinType", + type: { + name: "String" + } + } + } + } +}; + +export const Image: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "Image", + modelProperties: { + ...ProxyResource.type.modelProperties, + description: { + serializedName: "properties.description", + readOnly: true, + type: { + name: "String" + } + }, + publisher: { + serializedName: "properties.publisher", + readOnly: true, + type: { + name: "String" + } + }, + offer: { + serializedName: "properties.offer", + readOnly: true, + type: { + name: "String" + } + }, + sku: { + serializedName: "properties.sku", + readOnly: true, + type: { + name: "String" + } + }, + recommendedMachineConfiguration: { + serializedName: "properties.recommendedMachineConfiguration", + type: { + name: "Composite", + className: "RecommendedMachineConfiguration" + } + }, + provisioningState: { + serializedName: "properties.provisioningState", + readOnly: true, + type: { + name: "String" + } + } + } + } +}; + +export const ImageVersion: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "ImageVersion", + modelProperties: { + ...ProxyResource.type.modelProperties, + namePropertiesName: { + serializedName: "properties.name", + readOnly: true, + type: { + name: "String" + } + }, + publishedDate: { + serializedName: "properties.publishedDate", + readOnly: true, + type: { + name: "DateTime" + } + }, + excludeFromLatest: { + serializedName: "properties.excludeFromLatest", + readOnly: true, + type: { + name: "Boolean" + } + }, + osDiskImageSizeInGb: { + serializedName: "properties.osDiskImageSizeInGb", + readOnly: true, + type: { + name: "Number" + } + }, + provisioningState: { + serializedName: "properties.provisioningState", + readOnly: true, + type: { + name: "String" + } + } + } + } +}; diff --git a/sdk/devcenter/arm-devcenter/src/models/parameters.ts b/sdk/devcenter/arm-devcenter/src/models/parameters.ts new file mode 100644 index 000000000000..5f3273174f19 --- /dev/null +++ b/sdk/devcenter/arm-devcenter/src/models/parameters.ts @@ -0,0 +1,386 @@ +/* + * 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 { + DevCenter as DevCenterMapper, + DevCenterUpdate as DevCenterUpdateMapper, + Project as ProjectMapper, + ProjectUpdate as ProjectUpdateMapper, + AttachedNetworkConnection as AttachedNetworkConnectionMapper, + Gallery as GalleryMapper, + Catalog as CatalogMapper, + CatalogUpdate as CatalogUpdateMapper, + EnvironmentType as EnvironmentTypeMapper, + EnvironmentTypeUpdate as EnvironmentTypeUpdateMapper, + ProjectEnvironmentType as ProjectEnvironmentTypeMapper, + ProjectEnvironmentTypeUpdate as ProjectEnvironmentTypeUpdateMapper, + DevBoxDefinition as DevBoxDefinitionMapper, + DevBoxDefinitionUpdate as DevBoxDefinitionUpdateMapper, + Pool as PoolMapper, + PoolUpdate as PoolUpdateMapper, + Schedule as ScheduleMapper, + ScheduleUpdate as ScheduleUpdateMapper, + NetworkConnection as NetworkConnectionMapper, + NetworkConnectionUpdate as NetworkConnectionUpdateMapper +} from "../models/mappers"; + +export const accept: OperationParameter = { + parameterPath: "accept", + mapper: { + defaultValue: "application/json", + isConstant: true, + serializedName: "Accept", + type: { + name: "String" + } + } +}; + +export const $host: OperationURLParameter = { + parameterPath: "$host", + mapper: { + serializedName: "$host", + required: true, + type: { + name: "String" + } + }, + skipEncoding: true +}; + +export const apiVersion: OperationQueryParameter = { + parameterPath: "apiVersion", + mapper: { + defaultValue: "2022-08-01-preview", + isConstant: true, + serializedName: "api-version", + type: { + name: "String" + } + } +}; + +export const subscriptionId: OperationURLParameter = { + parameterPath: "subscriptionId", + mapper: { + serializedName: "subscriptionId", + required: true, + type: { + name: "String" + } + } +}; + +export const top: OperationQueryParameter = { + parameterPath: ["options", "top"], + mapper: { + serializedName: "$top", + type: { + name: "Number" + } + } +}; + +export const resourceGroupName: OperationURLParameter = { + parameterPath: "resourceGroupName", + mapper: { + serializedName: "resourceGroupName", + required: true, + type: { + name: "String" + } + } +}; + +export const devCenterName: OperationURLParameter = { + parameterPath: "devCenterName", + mapper: { + serializedName: "devCenterName", + required: true, + type: { + name: "String" + } + } +}; + +export const contentType: OperationParameter = { + parameterPath: ["options", "contentType"], + mapper: { + defaultValue: "application/json", + isConstant: true, + serializedName: "Content-Type", + type: { + name: "String" + } + } +}; + +export const body: OperationParameter = { + parameterPath: "body", + mapper: DevCenterMapper +}; + +export const body1: OperationParameter = { + parameterPath: "body", + mapper: DevCenterUpdateMapper +}; + +export const nextLink: OperationURLParameter = { + parameterPath: "nextLink", + mapper: { + serializedName: "nextLink", + required: true, + type: { + name: "String" + } + }, + skipEncoding: true +}; + +export const projectName: OperationURLParameter = { + parameterPath: "projectName", + mapper: { + serializedName: "projectName", + required: true, + type: { + name: "String" + } + } +}; + +export const body2: OperationParameter = { + parameterPath: "body", + mapper: ProjectMapper +}; + +export const body3: OperationParameter = { + parameterPath: "body", + mapper: ProjectUpdateMapper +}; + +export const attachedNetworkConnectionName: OperationURLParameter = { + parameterPath: "attachedNetworkConnectionName", + mapper: { + serializedName: "attachedNetworkConnectionName", + required: true, + type: { + name: "String" + } + } +}; + +export const body4: OperationParameter = { + parameterPath: "body", + mapper: AttachedNetworkConnectionMapper +}; + +export const galleryName: OperationURLParameter = { + parameterPath: "galleryName", + mapper: { + serializedName: "galleryName", + required: true, + type: { + name: "String" + } + } +}; + +export const body5: OperationParameter = { + parameterPath: "body", + mapper: GalleryMapper +}; + +export const imageName: OperationURLParameter = { + parameterPath: "imageName", + mapper: { + serializedName: "imageName", + required: true, + type: { + name: "String" + } + } +}; + +export const versionName: OperationURLParameter = { + parameterPath: "versionName", + mapper: { + serializedName: "versionName", + required: true, + type: { + name: "String" + } + } +}; + +export const catalogName: OperationURLParameter = { + parameterPath: "catalogName", + mapper: { + serializedName: "catalogName", + required: true, + type: { + name: "String" + } + } +}; + +export const body6: OperationParameter = { + parameterPath: "body", + mapper: CatalogMapper +}; + +export const body7: OperationParameter = { + parameterPath: "body", + mapper: CatalogUpdateMapper +}; + +export const environmentTypeName: OperationURLParameter = { + parameterPath: "environmentTypeName", + mapper: { + serializedName: "environmentTypeName", + required: true, + type: { + name: "String" + } + } +}; + +export const body8: OperationParameter = { + parameterPath: "body", + mapper: EnvironmentTypeMapper +}; + +export const body9: OperationParameter = { + parameterPath: "body", + mapper: EnvironmentTypeUpdateMapper +}; + +export const body10: OperationParameter = { + parameterPath: "body", + mapper: ProjectEnvironmentTypeMapper +}; + +export const body11: OperationParameter = { + parameterPath: "body", + mapper: ProjectEnvironmentTypeUpdateMapper +}; + +export const devBoxDefinitionName: OperationURLParameter = { + parameterPath: "devBoxDefinitionName", + mapper: { + serializedName: "devBoxDefinitionName", + required: true, + type: { + name: "String" + } + } +}; + +export const body12: OperationParameter = { + parameterPath: "body", + mapper: DevBoxDefinitionMapper +}; + +export const body13: OperationParameter = { + parameterPath: "body", + mapper: DevBoxDefinitionUpdateMapper +}; + +export const location: OperationURLParameter = { + parameterPath: "location", + mapper: { + serializedName: "location", + required: true, + type: { + name: "String" + } + } +}; + +export const operationId: OperationURLParameter = { + parameterPath: "operationId", + mapper: { + serializedName: "operationId", + required: true, + type: { + name: "String" + } + } +}; + +export const poolName: OperationURLParameter = { + parameterPath: "poolName", + mapper: { + serializedName: "poolName", + required: true, + type: { + name: "String" + } + } +}; + +export const body14: OperationParameter = { + parameterPath: "body", + mapper: PoolMapper +}; + +export const body15: OperationParameter = { + parameterPath: "body", + mapper: PoolUpdateMapper +}; + +export const scheduleName: OperationURLParameter = { + parameterPath: "scheduleName", + mapper: { + constraints: { + Pattern: new RegExp("^[-\\w]+$"), + MaxLength: 100, + MinLength: 1 + }, + serializedName: "scheduleName", + required: true, + type: { + name: "String" + } + } +}; + +export const body16: OperationParameter = { + parameterPath: "body", + mapper: ScheduleMapper +}; + +export const body17: OperationParameter = { + parameterPath: "body", + mapper: ScheduleUpdateMapper +}; + +export const networkConnectionName: OperationURLParameter = { + parameterPath: "networkConnectionName", + mapper: { + serializedName: "networkConnectionName", + required: true, + type: { + name: "String" + } + } +}; + +export const body18: OperationParameter = { + parameterPath: "body", + mapper: NetworkConnectionMapper +}; + +export const body19: OperationParameter = { + parameterPath: "body", + mapper: NetworkConnectionUpdateMapper +}; diff --git a/sdk/devcenter/arm-devcenter/src/operations/attachedNetworks.ts b/sdk/devcenter/arm-devcenter/src/operations/attachedNetworks.ts new file mode 100644 index 000000000000..e5da82e31856 --- /dev/null +++ b/sdk/devcenter/arm-devcenter/src/operations/attachedNetworks.ts @@ -0,0 +1,702 @@ +/* + * 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 { AttachedNetworks } from "../operationsInterfaces"; +import * as coreClient from "@azure/core-client"; +import * as Mappers from "../models/mappers"; +import * as Parameters from "../models/parameters"; +import { DevCenterClient } from "../devCenterClient"; +import { PollerLike, PollOperationState, LroEngine } from "@azure/core-lro"; +import { LroImpl } from "../lroImpl"; +import { + AttachedNetworkConnection, + AttachedNetworksListByProjectNextOptionalParams, + AttachedNetworksListByProjectOptionalParams, + AttachedNetworksListByDevCenterNextOptionalParams, + AttachedNetworksListByDevCenterOptionalParams, + AttachedNetworksListByProjectResponse, + AttachedNetworksGetByProjectOptionalParams, + AttachedNetworksGetByProjectResponse, + AttachedNetworksListByDevCenterResponse, + AttachedNetworksGetByDevCenterOptionalParams, + AttachedNetworksGetByDevCenterResponse, + AttachedNetworksCreateOrUpdateOptionalParams, + AttachedNetworksCreateOrUpdateResponse, + AttachedNetworksDeleteOptionalParams, + AttachedNetworksListByProjectNextResponse, + AttachedNetworksListByDevCenterNextResponse +} from "../models"; + +/// +/** Class containing AttachedNetworks operations. */ +export class AttachedNetworksImpl implements AttachedNetworks { + private readonly client: DevCenterClient; + + /** + * Initialize a new instance of the class AttachedNetworks class. + * @param client Reference to the service client + */ + constructor(client: DevCenterClient) { + this.client = client; + } + + /** + * Lists the attached NetworkConnections for a Project. + * @param resourceGroupName Name of the resource group within the Azure subscription. + * @param projectName The name of the project. + * @param options The options parameters. + */ + public listByProject( + resourceGroupName: string, + projectName: string, + options?: AttachedNetworksListByProjectOptionalParams + ): PagedAsyncIterableIterator { + const iter = this.listByProjectPagingAll( + resourceGroupName, + projectName, + options + ); + return { + next() { + return iter.next(); + }, + [Symbol.asyncIterator]() { + return this; + }, + byPage: () => { + return this.listByProjectPagingPage( + resourceGroupName, + projectName, + options + ); + } + }; + } + + private async *listByProjectPagingPage( + resourceGroupName: string, + projectName: string, + options?: AttachedNetworksListByProjectOptionalParams + ): AsyncIterableIterator { + let result = await this._listByProject( + resourceGroupName, + projectName, + options + ); + yield result.value || []; + let continuationToken = result.nextLink; + while (continuationToken) { + result = await this._listByProjectNext( + resourceGroupName, + projectName, + continuationToken, + options + ); + continuationToken = result.nextLink; + yield result.value || []; + } + } + + private async *listByProjectPagingAll( + resourceGroupName: string, + projectName: string, + options?: AttachedNetworksListByProjectOptionalParams + ): AsyncIterableIterator { + for await (const page of this.listByProjectPagingPage( + resourceGroupName, + projectName, + options + )) { + yield* page; + } + } + + /** + * Lists the attached NetworkConnections for a DevCenter. + * @param resourceGroupName Name of the resource group within the Azure subscription. + * @param devCenterName The name of the devcenter. + * @param options The options parameters. + */ + public listByDevCenter( + resourceGroupName: string, + devCenterName: string, + options?: AttachedNetworksListByDevCenterOptionalParams + ): PagedAsyncIterableIterator { + const iter = this.listByDevCenterPagingAll( + resourceGroupName, + devCenterName, + options + ); + return { + next() { + return iter.next(); + }, + [Symbol.asyncIterator]() { + return this; + }, + byPage: () => { + return this.listByDevCenterPagingPage( + resourceGroupName, + devCenterName, + options + ); + } + }; + } + + private async *listByDevCenterPagingPage( + resourceGroupName: string, + devCenterName: string, + options?: AttachedNetworksListByDevCenterOptionalParams + ): AsyncIterableIterator { + let result = await this._listByDevCenter( + resourceGroupName, + devCenterName, + options + ); + yield result.value || []; + let continuationToken = result.nextLink; + while (continuationToken) { + result = await this._listByDevCenterNext( + resourceGroupName, + devCenterName, + continuationToken, + options + ); + continuationToken = result.nextLink; + yield result.value || []; + } + } + + private async *listByDevCenterPagingAll( + resourceGroupName: string, + devCenterName: string, + options?: AttachedNetworksListByDevCenterOptionalParams + ): AsyncIterableIterator { + for await (const page of this.listByDevCenterPagingPage( + resourceGroupName, + devCenterName, + options + )) { + yield* page; + } + } + + /** + * Lists the attached NetworkConnections for a Project. + * @param resourceGroupName Name of the resource group within the Azure subscription. + * @param projectName The name of the project. + * @param options The options parameters. + */ + private _listByProject( + resourceGroupName: string, + projectName: string, + options?: AttachedNetworksListByProjectOptionalParams + ): Promise { + return this.client.sendOperationRequest( + { resourceGroupName, projectName, options }, + listByProjectOperationSpec + ); + } + + /** + * Gets an attached NetworkConnection. + * @param resourceGroupName Name of the resource group within the Azure subscription. + * @param projectName The name of the project. + * @param attachedNetworkConnectionName The name of the attached NetworkConnection. + * @param options The options parameters. + */ + getByProject( + resourceGroupName: string, + projectName: string, + attachedNetworkConnectionName: string, + options?: AttachedNetworksGetByProjectOptionalParams + ): Promise { + return this.client.sendOperationRequest( + { + resourceGroupName, + projectName, + attachedNetworkConnectionName, + options + }, + getByProjectOperationSpec + ); + } + + /** + * Lists the attached NetworkConnections for a DevCenter. + * @param resourceGroupName Name of the resource group within the Azure subscription. + * @param devCenterName The name of the devcenter. + * @param options The options parameters. + */ + private _listByDevCenter( + resourceGroupName: string, + devCenterName: string, + options?: AttachedNetworksListByDevCenterOptionalParams + ): Promise { + return this.client.sendOperationRequest( + { resourceGroupName, devCenterName, options }, + listByDevCenterOperationSpec + ); + } + + /** + * Gets an attached NetworkConnection. + * @param resourceGroupName Name of the resource group within the Azure subscription. + * @param devCenterName The name of the devcenter. + * @param attachedNetworkConnectionName The name of the attached NetworkConnection. + * @param options The options parameters. + */ + getByDevCenter( + resourceGroupName: string, + devCenterName: string, + attachedNetworkConnectionName: string, + options?: AttachedNetworksGetByDevCenterOptionalParams + ): Promise { + return this.client.sendOperationRequest( + { + resourceGroupName, + devCenterName, + attachedNetworkConnectionName, + options + }, + getByDevCenterOperationSpec + ); + } + + /** + * Creates or updates an attached NetworkConnection. + * @param resourceGroupName Name of the resource group within the Azure subscription. + * @param devCenterName The name of the devcenter. + * @param attachedNetworkConnectionName The name of the attached NetworkConnection. + * @param body Represents an attached NetworkConnection. + * @param options The options parameters. + */ + async beginCreateOrUpdate( + resourceGroupName: string, + devCenterName: string, + attachedNetworkConnectionName: string, + body: AttachedNetworkConnection, + options?: AttachedNetworksCreateOrUpdateOptionalParams + ): Promise< + PollerLike< + PollOperationState, + AttachedNetworksCreateOrUpdateResponse + > + > { + 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, + devCenterName, + attachedNetworkConnectionName, + body, + options + }, + createOrUpdateOperationSpec + ); + const poller = new LroEngine(lro, { + resumeFrom: options?.resumeFrom, + intervalInMs: options?.updateIntervalInMs, + lroResourceLocationConfig: "azure-async-operation" + }); + await poller.poll(); + return poller; + } + + /** + * Creates or updates an attached NetworkConnection. + * @param resourceGroupName Name of the resource group within the Azure subscription. + * @param devCenterName The name of the devcenter. + * @param attachedNetworkConnectionName The name of the attached NetworkConnection. + * @param body Represents an attached NetworkConnection. + * @param options The options parameters. + */ + async beginCreateOrUpdateAndWait( + resourceGroupName: string, + devCenterName: string, + attachedNetworkConnectionName: string, + body: AttachedNetworkConnection, + options?: AttachedNetworksCreateOrUpdateOptionalParams + ): Promise { + const poller = await this.beginCreateOrUpdate( + resourceGroupName, + devCenterName, + attachedNetworkConnectionName, + body, + options + ); + return poller.pollUntilDone(); + } + + /** + * Un-attach a NetworkConnection. + * @param resourceGroupName Name of the resource group within the Azure subscription. + * @param devCenterName The name of the devcenter. + * @param attachedNetworkConnectionName The name of the attached NetworkConnection. + * @param options The options parameters. + */ + async beginDelete( + resourceGroupName: string, + devCenterName: string, + attachedNetworkConnectionName: string, + options?: AttachedNetworksDeleteOptionalParams + ): 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, + devCenterName, + attachedNetworkConnectionName, + options + }, + deleteOperationSpec + ); + const poller = new LroEngine(lro, { + resumeFrom: options?.resumeFrom, + intervalInMs: options?.updateIntervalInMs, + lroResourceLocationConfig: "azure-async-operation" + }); + await poller.poll(); + return poller; + } + + /** + * Un-attach a NetworkConnection. + * @param resourceGroupName Name of the resource group within the Azure subscription. + * @param devCenterName The name of the devcenter. + * @param attachedNetworkConnectionName The name of the attached NetworkConnection. + * @param options The options parameters. + */ + async beginDeleteAndWait( + resourceGroupName: string, + devCenterName: string, + attachedNetworkConnectionName: string, + options?: AttachedNetworksDeleteOptionalParams + ): Promise { + const poller = await this.beginDelete( + resourceGroupName, + devCenterName, + attachedNetworkConnectionName, + options + ); + return poller.pollUntilDone(); + } + + /** + * ListByProjectNext + * @param resourceGroupName Name of the resource group within the Azure subscription. + * @param projectName The name of the project. + * @param nextLink The nextLink from the previous successful call to the ListByProject method. + * @param options The options parameters. + */ + private _listByProjectNext( + resourceGroupName: string, + projectName: string, + nextLink: string, + options?: AttachedNetworksListByProjectNextOptionalParams + ): Promise { + return this.client.sendOperationRequest( + { resourceGroupName, projectName, nextLink, options }, + listByProjectNextOperationSpec + ); + } + + /** + * ListByDevCenterNext + * @param resourceGroupName Name of the resource group within the Azure subscription. + * @param devCenterName The name of the devcenter. + * @param nextLink The nextLink from the previous successful call to the ListByDevCenter method. + * @param options The options parameters. + */ + private _listByDevCenterNext( + resourceGroupName: string, + devCenterName: string, + nextLink: string, + options?: AttachedNetworksListByDevCenterNextOptionalParams + ): Promise { + return this.client.sendOperationRequest( + { resourceGroupName, devCenterName, nextLink, options }, + listByDevCenterNextOperationSpec + ); + } +} +// Operation Specifications +const serializer = coreClient.createSerializer(Mappers, /* isXml */ false); + +const listByProjectOperationSpec: coreClient.OperationSpec = { + path: + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DevCenter/projects/{projectName}/attachednetworks", + httpMethod: "GET", + responses: { + 200: { + bodyMapper: Mappers.AttachedNetworkListResult + }, + default: { + bodyMapper: Mappers.CloudError + } + }, + queryParameters: [Parameters.apiVersion, Parameters.top], + urlParameters: [ + Parameters.$host, + Parameters.subscriptionId, + Parameters.resourceGroupName, + Parameters.projectName + ], + headerParameters: [Parameters.accept], + serializer +}; +const getByProjectOperationSpec: coreClient.OperationSpec = { + path: + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DevCenter/projects/{projectName}/attachednetworks/{attachedNetworkConnectionName}", + httpMethod: "GET", + responses: { + 200: { + bodyMapper: Mappers.AttachedNetworkConnection + }, + default: { + bodyMapper: Mappers.CloudError + } + }, + queryParameters: [Parameters.apiVersion], + urlParameters: [ + Parameters.$host, + Parameters.subscriptionId, + Parameters.resourceGroupName, + Parameters.projectName, + Parameters.attachedNetworkConnectionName + ], + headerParameters: [Parameters.accept], + serializer +}; +const listByDevCenterOperationSpec: coreClient.OperationSpec = { + path: + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DevCenter/devcenters/{devCenterName}/attachednetworks", + httpMethod: "GET", + responses: { + 200: { + bodyMapper: Mappers.AttachedNetworkListResult + }, + default: { + bodyMapper: Mappers.CloudError + } + }, + queryParameters: [Parameters.apiVersion, Parameters.top], + urlParameters: [ + Parameters.$host, + Parameters.subscriptionId, + Parameters.resourceGroupName, + Parameters.devCenterName + ], + headerParameters: [Parameters.accept], + serializer +}; +const getByDevCenterOperationSpec: coreClient.OperationSpec = { + path: + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DevCenter/devcenters/{devCenterName}/attachednetworks/{attachedNetworkConnectionName}", + httpMethod: "GET", + responses: { + 200: { + bodyMapper: Mappers.AttachedNetworkConnection + }, + default: { + bodyMapper: Mappers.CloudError + } + }, + queryParameters: [Parameters.apiVersion], + urlParameters: [ + Parameters.$host, + Parameters.subscriptionId, + Parameters.resourceGroupName, + Parameters.devCenterName, + Parameters.attachedNetworkConnectionName + ], + headerParameters: [Parameters.accept], + serializer +}; +const createOrUpdateOperationSpec: coreClient.OperationSpec = { + path: + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DevCenter/devcenters/{devCenterName}/attachednetworks/{attachedNetworkConnectionName}", + httpMethod: "PUT", + responses: { + 200: { + bodyMapper: Mappers.AttachedNetworkConnection + }, + 201: { + bodyMapper: Mappers.AttachedNetworkConnection + }, + 202: { + bodyMapper: Mappers.AttachedNetworkConnection + }, + 204: { + bodyMapper: Mappers.AttachedNetworkConnection + }, + default: { + bodyMapper: Mappers.CloudError + } + }, + requestBody: Parameters.body4, + queryParameters: [Parameters.apiVersion], + urlParameters: [ + Parameters.$host, + Parameters.subscriptionId, + Parameters.resourceGroupName, + Parameters.devCenterName, + Parameters.attachedNetworkConnectionName + ], + headerParameters: [Parameters.accept, Parameters.contentType], + mediaType: "json", + serializer +}; +const deleteOperationSpec: coreClient.OperationSpec = { + path: + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DevCenter/devcenters/{devCenterName}/attachednetworks/{attachedNetworkConnectionName}", + httpMethod: "DELETE", + responses: { + 200: {}, + 201: {}, + 202: {}, + 204: {}, + default: { + bodyMapper: Mappers.CloudError + } + }, + queryParameters: [Parameters.apiVersion], + urlParameters: [ + Parameters.$host, + Parameters.subscriptionId, + Parameters.resourceGroupName, + Parameters.devCenterName, + Parameters.attachedNetworkConnectionName + ], + headerParameters: [Parameters.accept], + serializer +}; +const listByProjectNextOperationSpec: coreClient.OperationSpec = { + path: "{nextLink}", + httpMethod: "GET", + responses: { + 200: { + bodyMapper: Mappers.AttachedNetworkListResult + }, + default: { + bodyMapper: Mappers.CloudError + } + }, + queryParameters: [Parameters.apiVersion, Parameters.top], + urlParameters: [ + Parameters.$host, + Parameters.subscriptionId, + Parameters.resourceGroupName, + Parameters.nextLink, + Parameters.projectName + ], + headerParameters: [Parameters.accept], + serializer +}; +const listByDevCenterNextOperationSpec: coreClient.OperationSpec = { + path: "{nextLink}", + httpMethod: "GET", + responses: { + 200: { + bodyMapper: Mappers.AttachedNetworkListResult + }, + default: { + bodyMapper: Mappers.CloudError + } + }, + queryParameters: [Parameters.apiVersion, Parameters.top], + urlParameters: [ + Parameters.$host, + Parameters.subscriptionId, + Parameters.resourceGroupName, + Parameters.devCenterName, + Parameters.nextLink + ], + headerParameters: [Parameters.accept], + serializer +}; diff --git a/sdk/devcenter/arm-devcenter/src/operations/catalogs.ts b/sdk/devcenter/arm-devcenter/src/operations/catalogs.ts new file mode 100644 index 000000000000..3c7bde4bbc1a --- /dev/null +++ b/sdk/devcenter/arm-devcenter/src/operations/catalogs.ts @@ -0,0 +1,730 @@ +/* + * 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 { Catalogs } from "../operationsInterfaces"; +import * as coreClient from "@azure/core-client"; +import * as Mappers from "../models/mappers"; +import * as Parameters from "../models/parameters"; +import { DevCenterClient } from "../devCenterClient"; +import { PollerLike, PollOperationState, LroEngine } from "@azure/core-lro"; +import { LroImpl } from "../lroImpl"; +import { + Catalog, + CatalogsListByDevCenterNextOptionalParams, + CatalogsListByDevCenterOptionalParams, + CatalogsListByDevCenterResponse, + CatalogsGetOptionalParams, + CatalogsGetResponse, + CatalogsCreateOrUpdateOptionalParams, + CatalogsCreateOrUpdateResponse, + CatalogUpdate, + CatalogsUpdateOptionalParams, + CatalogsUpdateResponse, + CatalogsDeleteOptionalParams, + CatalogsSyncOptionalParams, + CatalogsListByDevCenterNextResponse +} from "../models"; + +/// +/** Class containing Catalogs operations. */ +export class CatalogsImpl implements Catalogs { + private readonly client: DevCenterClient; + + /** + * Initialize a new instance of the class Catalogs class. + * @param client Reference to the service client + */ + constructor(client: DevCenterClient) { + this.client = client; + } + + /** + * Lists catalogs for a devcenter. + * @param resourceGroupName Name of the resource group within the Azure subscription. + * @param devCenterName The name of the devcenter. + * @param options The options parameters. + */ + public listByDevCenter( + resourceGroupName: string, + devCenterName: string, + options?: CatalogsListByDevCenterOptionalParams + ): PagedAsyncIterableIterator { + const iter = this.listByDevCenterPagingAll( + resourceGroupName, + devCenterName, + options + ); + return { + next() { + return iter.next(); + }, + [Symbol.asyncIterator]() { + return this; + }, + byPage: () => { + return this.listByDevCenterPagingPage( + resourceGroupName, + devCenterName, + options + ); + } + }; + } + + private async *listByDevCenterPagingPage( + resourceGroupName: string, + devCenterName: string, + options?: CatalogsListByDevCenterOptionalParams + ): AsyncIterableIterator { + let result = await this._listByDevCenter( + resourceGroupName, + devCenterName, + options + ); + yield result.value || []; + let continuationToken = result.nextLink; + while (continuationToken) { + result = await this._listByDevCenterNext( + resourceGroupName, + devCenterName, + continuationToken, + options + ); + continuationToken = result.nextLink; + yield result.value || []; + } + } + + private async *listByDevCenterPagingAll( + resourceGroupName: string, + devCenterName: string, + options?: CatalogsListByDevCenterOptionalParams + ): AsyncIterableIterator { + for await (const page of this.listByDevCenterPagingPage( + resourceGroupName, + devCenterName, + options + )) { + yield* page; + } + } + + /** + * Lists catalogs for a devcenter. + * @param resourceGroupName Name of the resource group within the Azure subscription. + * @param devCenterName The name of the devcenter. + * @param options The options parameters. + */ + private _listByDevCenter( + resourceGroupName: string, + devCenterName: string, + options?: CatalogsListByDevCenterOptionalParams + ): Promise { + return this.client.sendOperationRequest( + { resourceGroupName, devCenterName, options }, + listByDevCenterOperationSpec + ); + } + + /** + * Gets a catalog + * @param resourceGroupName Name of the resource group within the Azure subscription. + * @param devCenterName The name of the devcenter. + * @param catalogName The name of the Catalog. + * @param options The options parameters. + */ + get( + resourceGroupName: string, + devCenterName: string, + catalogName: string, + options?: CatalogsGetOptionalParams + ): Promise { + return this.client.sendOperationRequest( + { resourceGroupName, devCenterName, catalogName, options }, + getOperationSpec + ); + } + + /** + * Creates or updates a catalog. + * @param resourceGroupName Name of the resource group within the Azure subscription. + * @param devCenterName The name of the devcenter. + * @param catalogName The name of the Catalog. + * @param body Represents a catalog. + * @param options The options parameters. + */ + async beginCreateOrUpdate( + resourceGroupName: string, + devCenterName: string, + catalogName: string, + body: Catalog, + options?: CatalogsCreateOrUpdateOptionalParams + ): Promise< + PollerLike< + PollOperationState, + CatalogsCreateOrUpdateResponse + > + > { + 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, devCenterName, catalogName, body, options }, + createOrUpdateOperationSpec + ); + const poller = new LroEngine(lro, { + resumeFrom: options?.resumeFrom, + intervalInMs: options?.updateIntervalInMs, + lroResourceLocationConfig: "azure-async-operation" + }); + await poller.poll(); + return poller; + } + + /** + * Creates or updates a catalog. + * @param resourceGroupName Name of the resource group within the Azure subscription. + * @param devCenterName The name of the devcenter. + * @param catalogName The name of the Catalog. + * @param body Represents a catalog. + * @param options The options parameters. + */ + async beginCreateOrUpdateAndWait( + resourceGroupName: string, + devCenterName: string, + catalogName: string, + body: Catalog, + options?: CatalogsCreateOrUpdateOptionalParams + ): Promise { + const poller = await this.beginCreateOrUpdate( + resourceGroupName, + devCenterName, + catalogName, + body, + options + ); + return poller.pollUntilDone(); + } + + /** + * Partially updates a catalog. + * @param resourceGroupName Name of the resource group within the Azure subscription. + * @param devCenterName The name of the devcenter. + * @param catalogName The name of the Catalog. + * @param body Updatable catalog properties. + * @param options The options parameters. + */ + async beginUpdate( + resourceGroupName: string, + devCenterName: string, + catalogName: string, + body: CatalogUpdate, + options?: CatalogsUpdateOptionalParams + ): Promise< + PollerLike< + PollOperationState, + CatalogsUpdateResponse + > + > { + 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, devCenterName, catalogName, body, options }, + updateOperationSpec + ); + const poller = new LroEngine(lro, { + resumeFrom: options?.resumeFrom, + intervalInMs: options?.updateIntervalInMs, + lroResourceLocationConfig: "azure-async-operation" + }); + await poller.poll(); + return poller; + } + + /** + * Partially updates a catalog. + * @param resourceGroupName Name of the resource group within the Azure subscription. + * @param devCenterName The name of the devcenter. + * @param catalogName The name of the Catalog. + * @param body Updatable catalog properties. + * @param options The options parameters. + */ + async beginUpdateAndWait( + resourceGroupName: string, + devCenterName: string, + catalogName: string, + body: CatalogUpdate, + options?: CatalogsUpdateOptionalParams + ): Promise { + const poller = await this.beginUpdate( + resourceGroupName, + devCenterName, + catalogName, + body, + options + ); + return poller.pollUntilDone(); + } + + /** + * Deletes a catalog resource. + * @param resourceGroupName Name of the resource group within the Azure subscription. + * @param devCenterName The name of the devcenter. + * @param catalogName The name of the Catalog. + * @param options The options parameters. + */ + async beginDelete( + resourceGroupName: string, + devCenterName: string, + catalogName: string, + options?: CatalogsDeleteOptionalParams + ): 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, devCenterName, catalogName, options }, + deleteOperationSpec + ); + const poller = new LroEngine(lro, { + resumeFrom: options?.resumeFrom, + intervalInMs: options?.updateIntervalInMs, + lroResourceLocationConfig: "azure-async-operation" + }); + await poller.poll(); + return poller; + } + + /** + * Deletes a catalog resource. + * @param resourceGroupName Name of the resource group within the Azure subscription. + * @param devCenterName The name of the devcenter. + * @param catalogName The name of the Catalog. + * @param options The options parameters. + */ + async beginDeleteAndWait( + resourceGroupName: string, + devCenterName: string, + catalogName: string, + options?: CatalogsDeleteOptionalParams + ): Promise { + const poller = await this.beginDelete( + resourceGroupName, + devCenterName, + catalogName, + options + ); + return poller.pollUntilDone(); + } + + /** + * Syncs templates for a template source. + * @param resourceGroupName Name of the resource group within the Azure subscription. + * @param devCenterName The name of the devcenter. + * @param catalogName The name of the Catalog. + * @param options The options parameters. + */ + async beginSync( + resourceGroupName: string, + devCenterName: string, + catalogName: string, + options?: CatalogsSyncOptionalParams + ): 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, devCenterName, catalogName, options }, + syncOperationSpec + ); + const poller = new LroEngine(lro, { + resumeFrom: options?.resumeFrom, + intervalInMs: options?.updateIntervalInMs, + lroResourceLocationConfig: "location" + }); + await poller.poll(); + return poller; + } + + /** + * Syncs templates for a template source. + * @param resourceGroupName Name of the resource group within the Azure subscription. + * @param devCenterName The name of the devcenter. + * @param catalogName The name of the Catalog. + * @param options The options parameters. + */ + async beginSyncAndWait( + resourceGroupName: string, + devCenterName: string, + catalogName: string, + options?: CatalogsSyncOptionalParams + ): Promise { + const poller = await this.beginSync( + resourceGroupName, + devCenterName, + catalogName, + options + ); + return poller.pollUntilDone(); + } + + /** + * ListByDevCenterNext + * @param resourceGroupName Name of the resource group within the Azure subscription. + * @param devCenterName The name of the devcenter. + * @param nextLink The nextLink from the previous successful call to the ListByDevCenter method. + * @param options The options parameters. + */ + private _listByDevCenterNext( + resourceGroupName: string, + devCenterName: string, + nextLink: string, + options?: CatalogsListByDevCenterNextOptionalParams + ): Promise { + return this.client.sendOperationRequest( + { resourceGroupName, devCenterName, nextLink, options }, + listByDevCenterNextOperationSpec + ); + } +} +// Operation Specifications +const serializer = coreClient.createSerializer(Mappers, /* isXml */ false); + +const listByDevCenterOperationSpec: coreClient.OperationSpec = { + path: + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DevCenter/devcenters/{devCenterName}/catalogs", + httpMethod: "GET", + responses: { + 200: { + bodyMapper: Mappers.CatalogListResult + }, + default: { + bodyMapper: Mappers.CloudError + } + }, + queryParameters: [Parameters.apiVersion, Parameters.top], + urlParameters: [ + Parameters.$host, + Parameters.subscriptionId, + Parameters.resourceGroupName, + Parameters.devCenterName + ], + headerParameters: [Parameters.accept], + serializer +}; +const getOperationSpec: coreClient.OperationSpec = { + path: + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DevCenter/devcenters/{devCenterName}/catalogs/{catalogName}", + httpMethod: "GET", + responses: { + 200: { + bodyMapper: Mappers.Catalog + }, + default: { + bodyMapper: Mappers.CloudError + } + }, + queryParameters: [Parameters.apiVersion], + urlParameters: [ + Parameters.$host, + Parameters.subscriptionId, + Parameters.resourceGroupName, + Parameters.devCenterName, + Parameters.catalogName + ], + headerParameters: [Parameters.accept], + serializer +}; +const createOrUpdateOperationSpec: coreClient.OperationSpec = { + path: + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DevCenter/devcenters/{devCenterName}/catalogs/{catalogName}", + httpMethod: "PUT", + responses: { + 200: { + bodyMapper: Mappers.Catalog + }, + 201: { + bodyMapper: Mappers.Catalog + }, + 202: { + bodyMapper: Mappers.Catalog + }, + 204: { + bodyMapper: Mappers.Catalog + }, + default: { + bodyMapper: Mappers.CloudError + } + }, + requestBody: Parameters.body6, + queryParameters: [Parameters.apiVersion], + urlParameters: [ + Parameters.$host, + Parameters.subscriptionId, + Parameters.resourceGroupName, + Parameters.devCenterName, + Parameters.catalogName + ], + headerParameters: [Parameters.accept, Parameters.contentType], + mediaType: "json", + serializer +}; +const updateOperationSpec: coreClient.OperationSpec = { + path: + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DevCenter/devcenters/{devCenterName}/catalogs/{catalogName}", + httpMethod: "PATCH", + responses: { + 200: { + bodyMapper: Mappers.Catalog + }, + 201: { + bodyMapper: Mappers.Catalog + }, + 202: { + bodyMapper: Mappers.Catalog + }, + 204: { + bodyMapper: Mappers.Catalog + }, + default: { + bodyMapper: Mappers.CloudError + } + }, + requestBody: Parameters.body7, + queryParameters: [Parameters.apiVersion], + urlParameters: [ + Parameters.$host, + Parameters.subscriptionId, + Parameters.resourceGroupName, + Parameters.devCenterName, + Parameters.catalogName + ], + headerParameters: [Parameters.accept, Parameters.contentType], + mediaType: "json", + serializer +}; +const deleteOperationSpec: coreClient.OperationSpec = { + path: + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DevCenter/devcenters/{devCenterName}/catalogs/{catalogName}", + httpMethod: "DELETE", + responses: { + 200: {}, + 201: {}, + 202: {}, + 204: {}, + default: { + bodyMapper: Mappers.CloudError + } + }, + queryParameters: [Parameters.apiVersion], + urlParameters: [ + Parameters.$host, + Parameters.subscriptionId, + Parameters.resourceGroupName, + Parameters.devCenterName, + Parameters.catalogName + ], + headerParameters: [Parameters.accept], + serializer +}; +const syncOperationSpec: coreClient.OperationSpec = { + path: + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DevCenter/devcenters/{devCenterName}/catalogs/{catalogName}/sync", + httpMethod: "POST", + responses: { + 200: {}, + 201: {}, + 202: {}, + 204: {}, + default: { + bodyMapper: Mappers.CloudError + } + }, + queryParameters: [Parameters.apiVersion], + urlParameters: [ + Parameters.$host, + Parameters.subscriptionId, + Parameters.resourceGroupName, + Parameters.devCenterName, + Parameters.catalogName + ], + headerParameters: [Parameters.accept], + serializer +}; +const listByDevCenterNextOperationSpec: coreClient.OperationSpec = { + path: "{nextLink}", + httpMethod: "GET", + responses: { + 200: { + bodyMapper: Mappers.CatalogListResult + }, + default: { + bodyMapper: Mappers.CloudError + } + }, + queryParameters: [Parameters.apiVersion, Parameters.top], + urlParameters: [ + Parameters.$host, + Parameters.subscriptionId, + Parameters.resourceGroupName, + Parameters.devCenterName, + Parameters.nextLink + ], + headerParameters: [Parameters.accept], + serializer +}; diff --git a/sdk/devcenter/arm-devcenter/src/operations/devBoxDefinitions.ts b/sdk/devcenter/arm-devcenter/src/operations/devBoxDefinitions.ts new file mode 100644 index 000000000000..4944869d8693 --- /dev/null +++ b/sdk/devcenter/arm-devcenter/src/operations/devBoxDefinitions.ts @@ -0,0 +1,816 @@ +/* + * 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 { DevBoxDefinitions } from "../operationsInterfaces"; +import * as coreClient from "@azure/core-client"; +import * as Mappers from "../models/mappers"; +import * as Parameters from "../models/parameters"; +import { DevCenterClient } from "../devCenterClient"; +import { PollerLike, PollOperationState, LroEngine } from "@azure/core-lro"; +import { LroImpl } from "../lroImpl"; +import { + DevBoxDefinition, + DevBoxDefinitionsListByDevCenterNextOptionalParams, + DevBoxDefinitionsListByDevCenterOptionalParams, + DevBoxDefinitionsListByProjectNextOptionalParams, + DevBoxDefinitionsListByProjectOptionalParams, + DevBoxDefinitionsListByDevCenterResponse, + DevBoxDefinitionsGetOptionalParams, + DevBoxDefinitionsGetResponse, + DevBoxDefinitionsCreateOrUpdateOptionalParams, + DevBoxDefinitionsCreateOrUpdateResponse, + DevBoxDefinitionUpdate, + DevBoxDefinitionsUpdateOptionalParams, + DevBoxDefinitionsUpdateResponse, + DevBoxDefinitionsDeleteOptionalParams, + DevBoxDefinitionsListByProjectResponse, + DevBoxDefinitionsGetByProjectOptionalParams, + DevBoxDefinitionsGetByProjectResponse, + DevBoxDefinitionsListByDevCenterNextResponse, + DevBoxDefinitionsListByProjectNextResponse +} from "../models"; + +/// +/** Class containing DevBoxDefinitions operations. */ +export class DevBoxDefinitionsImpl implements DevBoxDefinitions { + private readonly client: DevCenterClient; + + /** + * Initialize a new instance of the class DevBoxDefinitions class. + * @param client Reference to the service client + */ + constructor(client: DevCenterClient) { + this.client = client; + } + + /** + * List Dev Box definitions for a devcenter. + * @param resourceGroupName Name of the resource group within the Azure subscription. + * @param devCenterName The name of the devcenter. + * @param options The options parameters. + */ + public listByDevCenter( + resourceGroupName: string, + devCenterName: string, + options?: DevBoxDefinitionsListByDevCenterOptionalParams + ): PagedAsyncIterableIterator { + const iter = this.listByDevCenterPagingAll( + resourceGroupName, + devCenterName, + options + ); + return { + next() { + return iter.next(); + }, + [Symbol.asyncIterator]() { + return this; + }, + byPage: () => { + return this.listByDevCenterPagingPage( + resourceGroupName, + devCenterName, + options + ); + } + }; + } + + private async *listByDevCenterPagingPage( + resourceGroupName: string, + devCenterName: string, + options?: DevBoxDefinitionsListByDevCenterOptionalParams + ): AsyncIterableIterator { + let result = await this._listByDevCenter( + resourceGroupName, + devCenterName, + options + ); + yield result.value || []; + let continuationToken = result.nextLink; + while (continuationToken) { + result = await this._listByDevCenterNext( + resourceGroupName, + devCenterName, + continuationToken, + options + ); + continuationToken = result.nextLink; + yield result.value || []; + } + } + + private async *listByDevCenterPagingAll( + resourceGroupName: string, + devCenterName: string, + options?: DevBoxDefinitionsListByDevCenterOptionalParams + ): AsyncIterableIterator { + for await (const page of this.listByDevCenterPagingPage( + resourceGroupName, + devCenterName, + options + )) { + yield* page; + } + } + + /** + * List Dev Box definitions configured for a project. + * @param resourceGroupName Name of the resource group within the Azure subscription. + * @param projectName The name of the project. + * @param options The options parameters. + */ + public listByProject( + resourceGroupName: string, + projectName: string, + options?: DevBoxDefinitionsListByProjectOptionalParams + ): PagedAsyncIterableIterator { + const iter = this.listByProjectPagingAll( + resourceGroupName, + projectName, + options + ); + return { + next() { + return iter.next(); + }, + [Symbol.asyncIterator]() { + return this; + }, + byPage: () => { + return this.listByProjectPagingPage( + resourceGroupName, + projectName, + options + ); + } + }; + } + + private async *listByProjectPagingPage( + resourceGroupName: string, + projectName: string, + options?: DevBoxDefinitionsListByProjectOptionalParams + ): AsyncIterableIterator { + let result = await this._listByProject( + resourceGroupName, + projectName, + options + ); + yield result.value || []; + let continuationToken = result.nextLink; + while (continuationToken) { + result = await this._listByProjectNext( + resourceGroupName, + projectName, + continuationToken, + options + ); + continuationToken = result.nextLink; + yield result.value || []; + } + } + + private async *listByProjectPagingAll( + resourceGroupName: string, + projectName: string, + options?: DevBoxDefinitionsListByProjectOptionalParams + ): AsyncIterableIterator { + for await (const page of this.listByProjectPagingPage( + resourceGroupName, + projectName, + options + )) { + yield* page; + } + } + + /** + * List Dev Box definitions for a devcenter. + * @param resourceGroupName Name of the resource group within the Azure subscription. + * @param devCenterName The name of the devcenter. + * @param options The options parameters. + */ + private _listByDevCenter( + resourceGroupName: string, + devCenterName: string, + options?: DevBoxDefinitionsListByDevCenterOptionalParams + ): Promise { + return this.client.sendOperationRequest( + { resourceGroupName, devCenterName, options }, + listByDevCenterOperationSpec + ); + } + + /** + * Gets a Dev Box definition + * @param resourceGroupName Name of the resource group within the Azure subscription. + * @param devCenterName The name of the devcenter. + * @param devBoxDefinitionName The name of the Dev Box definition. + * @param options The options parameters. + */ + get( + resourceGroupName: string, + devCenterName: string, + devBoxDefinitionName: string, + options?: DevBoxDefinitionsGetOptionalParams + ): Promise { + return this.client.sendOperationRequest( + { resourceGroupName, devCenterName, devBoxDefinitionName, options }, + getOperationSpec + ); + } + + /** + * Creates or updates a Dev Box definition. + * @param resourceGroupName Name of the resource group within the Azure subscription. + * @param devCenterName The name of the devcenter. + * @param devBoxDefinitionName The name of the Dev Box definition. + * @param body Represents a Dev Box definition. + * @param options The options parameters. + */ + async beginCreateOrUpdate( + resourceGroupName: string, + devCenterName: string, + devBoxDefinitionName: string, + body: DevBoxDefinition, + options?: DevBoxDefinitionsCreateOrUpdateOptionalParams + ): Promise< + PollerLike< + PollOperationState, + DevBoxDefinitionsCreateOrUpdateResponse + > + > { + 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, devCenterName, devBoxDefinitionName, body, options }, + createOrUpdateOperationSpec + ); + const poller = new LroEngine(lro, { + resumeFrom: options?.resumeFrom, + intervalInMs: options?.updateIntervalInMs, + lroResourceLocationConfig: "azure-async-operation" + }); + await poller.poll(); + return poller; + } + + /** + * Creates or updates a Dev Box definition. + * @param resourceGroupName Name of the resource group within the Azure subscription. + * @param devCenterName The name of the devcenter. + * @param devBoxDefinitionName The name of the Dev Box definition. + * @param body Represents a Dev Box definition. + * @param options The options parameters. + */ + async beginCreateOrUpdateAndWait( + resourceGroupName: string, + devCenterName: string, + devBoxDefinitionName: string, + body: DevBoxDefinition, + options?: DevBoxDefinitionsCreateOrUpdateOptionalParams + ): Promise { + const poller = await this.beginCreateOrUpdate( + resourceGroupName, + devCenterName, + devBoxDefinitionName, + body, + options + ); + return poller.pollUntilDone(); + } + + /** + * Partially updates a Dev Box definition. + * @param resourceGroupName Name of the resource group within the Azure subscription. + * @param devCenterName The name of the devcenter. + * @param devBoxDefinitionName The name of the Dev Box definition. + * @param body Represents a Dev Box definition. + * @param options The options parameters. + */ + async beginUpdate( + resourceGroupName: string, + devCenterName: string, + devBoxDefinitionName: string, + body: DevBoxDefinitionUpdate, + options?: DevBoxDefinitionsUpdateOptionalParams + ): Promise< + PollerLike< + PollOperationState, + DevBoxDefinitionsUpdateResponse + > + > { + 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, devCenterName, devBoxDefinitionName, body, options }, + updateOperationSpec + ); + const poller = new LroEngine(lro, { + resumeFrom: options?.resumeFrom, + intervalInMs: options?.updateIntervalInMs, + lroResourceLocationConfig: "azure-async-operation" + }); + await poller.poll(); + return poller; + } + + /** + * Partially updates a Dev Box definition. + * @param resourceGroupName Name of the resource group within the Azure subscription. + * @param devCenterName The name of the devcenter. + * @param devBoxDefinitionName The name of the Dev Box definition. + * @param body Represents a Dev Box definition. + * @param options The options parameters. + */ + async beginUpdateAndWait( + resourceGroupName: string, + devCenterName: string, + devBoxDefinitionName: string, + body: DevBoxDefinitionUpdate, + options?: DevBoxDefinitionsUpdateOptionalParams + ): Promise { + const poller = await this.beginUpdate( + resourceGroupName, + devCenterName, + devBoxDefinitionName, + body, + options + ); + return poller.pollUntilDone(); + } + + /** + * Deletes a Dev Box definition + * @param resourceGroupName Name of the resource group within the Azure subscription. + * @param devCenterName The name of the devcenter. + * @param devBoxDefinitionName The name of the Dev Box definition. + * @param options The options parameters. + */ + async beginDelete( + resourceGroupName: string, + devCenterName: string, + devBoxDefinitionName: string, + options?: DevBoxDefinitionsDeleteOptionalParams + ): 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, devCenterName, devBoxDefinitionName, options }, + deleteOperationSpec + ); + const poller = new LroEngine(lro, { + resumeFrom: options?.resumeFrom, + intervalInMs: options?.updateIntervalInMs, + lroResourceLocationConfig: "azure-async-operation" + }); + await poller.poll(); + return poller; + } + + /** + * Deletes a Dev Box definition + * @param resourceGroupName Name of the resource group within the Azure subscription. + * @param devCenterName The name of the devcenter. + * @param devBoxDefinitionName The name of the Dev Box definition. + * @param options The options parameters. + */ + async beginDeleteAndWait( + resourceGroupName: string, + devCenterName: string, + devBoxDefinitionName: string, + options?: DevBoxDefinitionsDeleteOptionalParams + ): Promise { + const poller = await this.beginDelete( + resourceGroupName, + devCenterName, + devBoxDefinitionName, + options + ); + return poller.pollUntilDone(); + } + + /** + * List Dev Box definitions configured for a project. + * @param resourceGroupName Name of the resource group within the Azure subscription. + * @param projectName The name of the project. + * @param options The options parameters. + */ + private _listByProject( + resourceGroupName: string, + projectName: string, + options?: DevBoxDefinitionsListByProjectOptionalParams + ): Promise { + return this.client.sendOperationRequest( + { resourceGroupName, projectName, options }, + listByProjectOperationSpec + ); + } + + /** + * Gets a Dev Box definition configured for a project + * @param resourceGroupName Name of the resource group within the Azure subscription. + * @param projectName The name of the project. + * @param devBoxDefinitionName The name of the Dev Box definition. + * @param options The options parameters. + */ + getByProject( + resourceGroupName: string, + projectName: string, + devBoxDefinitionName: string, + options?: DevBoxDefinitionsGetByProjectOptionalParams + ): Promise { + return this.client.sendOperationRequest( + { resourceGroupName, projectName, devBoxDefinitionName, options }, + getByProjectOperationSpec + ); + } + + /** + * ListByDevCenterNext + * @param resourceGroupName Name of the resource group within the Azure subscription. + * @param devCenterName The name of the devcenter. + * @param nextLink The nextLink from the previous successful call to the ListByDevCenter method. + * @param options The options parameters. + */ + private _listByDevCenterNext( + resourceGroupName: string, + devCenterName: string, + nextLink: string, + options?: DevBoxDefinitionsListByDevCenterNextOptionalParams + ): Promise { + return this.client.sendOperationRequest( + { resourceGroupName, devCenterName, nextLink, options }, + listByDevCenterNextOperationSpec + ); + } + + /** + * ListByProjectNext + * @param resourceGroupName Name of the resource group within the Azure subscription. + * @param projectName The name of the project. + * @param nextLink The nextLink from the previous successful call to the ListByProject method. + * @param options The options parameters. + */ + private _listByProjectNext( + resourceGroupName: string, + projectName: string, + nextLink: string, + options?: DevBoxDefinitionsListByProjectNextOptionalParams + ): Promise { + return this.client.sendOperationRequest( + { resourceGroupName, projectName, nextLink, options }, + listByProjectNextOperationSpec + ); + } +} +// Operation Specifications +const serializer = coreClient.createSerializer(Mappers, /* isXml */ false); + +const listByDevCenterOperationSpec: coreClient.OperationSpec = { + path: + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DevCenter/devcenters/{devCenterName}/devboxdefinitions", + httpMethod: "GET", + responses: { + 200: { + bodyMapper: Mappers.DevBoxDefinitionListResult + }, + default: { + bodyMapper: Mappers.CloudError + } + }, + queryParameters: [Parameters.apiVersion, Parameters.top], + urlParameters: [ + Parameters.$host, + Parameters.subscriptionId, + Parameters.resourceGroupName, + Parameters.devCenterName + ], + headerParameters: [Parameters.accept], + serializer +}; +const getOperationSpec: coreClient.OperationSpec = { + path: + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DevCenter/devcenters/{devCenterName}/devboxdefinitions/{devBoxDefinitionName}", + httpMethod: "GET", + responses: { + 200: { + bodyMapper: Mappers.DevBoxDefinition + }, + default: { + bodyMapper: Mappers.CloudError + } + }, + queryParameters: [Parameters.apiVersion], + urlParameters: [ + Parameters.$host, + Parameters.subscriptionId, + Parameters.resourceGroupName, + Parameters.devCenterName, + Parameters.devBoxDefinitionName + ], + headerParameters: [Parameters.accept], + serializer +}; +const createOrUpdateOperationSpec: coreClient.OperationSpec = { + path: + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DevCenter/devcenters/{devCenterName}/devboxdefinitions/{devBoxDefinitionName}", + httpMethod: "PUT", + responses: { + 200: { + bodyMapper: Mappers.DevBoxDefinition + }, + 201: { + bodyMapper: Mappers.DevBoxDefinition + }, + 202: { + bodyMapper: Mappers.DevBoxDefinition + }, + 204: { + bodyMapper: Mappers.DevBoxDefinition + }, + default: { + bodyMapper: Mappers.CloudError + } + }, + requestBody: Parameters.body12, + queryParameters: [Parameters.apiVersion], + urlParameters: [ + Parameters.$host, + Parameters.subscriptionId, + Parameters.resourceGroupName, + Parameters.devCenterName, + Parameters.devBoxDefinitionName + ], + headerParameters: [Parameters.accept, Parameters.contentType], + mediaType: "json", + serializer +}; +const updateOperationSpec: coreClient.OperationSpec = { + path: + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DevCenter/devcenters/{devCenterName}/devboxdefinitions/{devBoxDefinitionName}", + httpMethod: "PATCH", + responses: { + 200: { + bodyMapper: Mappers.DevBoxDefinition + }, + 201: { + bodyMapper: Mappers.DevBoxDefinition + }, + 202: { + bodyMapper: Mappers.DevBoxDefinition + }, + 204: { + bodyMapper: Mappers.DevBoxDefinition + }, + default: { + bodyMapper: Mappers.CloudError + } + }, + requestBody: Parameters.body13, + queryParameters: [Parameters.apiVersion], + urlParameters: [ + Parameters.$host, + Parameters.subscriptionId, + Parameters.resourceGroupName, + Parameters.devCenterName, + Parameters.devBoxDefinitionName + ], + headerParameters: [Parameters.accept, Parameters.contentType], + mediaType: "json", + serializer +}; +const deleteOperationSpec: coreClient.OperationSpec = { + path: + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DevCenter/devcenters/{devCenterName}/devboxdefinitions/{devBoxDefinitionName}", + httpMethod: "DELETE", + responses: { + 200: {}, + 201: {}, + 202: {}, + 204: {}, + default: { + bodyMapper: Mappers.CloudError + } + }, + queryParameters: [Parameters.apiVersion], + urlParameters: [ + Parameters.$host, + Parameters.subscriptionId, + Parameters.resourceGroupName, + Parameters.devCenterName, + Parameters.devBoxDefinitionName + ], + headerParameters: [Parameters.accept], + serializer +}; +const listByProjectOperationSpec: coreClient.OperationSpec = { + path: + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DevCenter/projects/{projectName}/devboxdefinitions", + httpMethod: "GET", + responses: { + 200: { + bodyMapper: Mappers.DevBoxDefinitionListResult + }, + default: { + bodyMapper: Mappers.CloudError + } + }, + queryParameters: [Parameters.apiVersion, Parameters.top], + urlParameters: [ + Parameters.$host, + Parameters.subscriptionId, + Parameters.resourceGroupName, + Parameters.projectName + ], + headerParameters: [Parameters.accept], + serializer +}; +const getByProjectOperationSpec: coreClient.OperationSpec = { + path: + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DevCenter/projects/{projectName}/devboxdefinitions/{devBoxDefinitionName}", + httpMethod: "GET", + responses: { + 200: { + bodyMapper: Mappers.DevBoxDefinition + }, + default: { + bodyMapper: Mappers.CloudError + } + }, + queryParameters: [Parameters.apiVersion], + urlParameters: [ + Parameters.$host, + Parameters.subscriptionId, + Parameters.resourceGroupName, + Parameters.projectName, + Parameters.devBoxDefinitionName + ], + headerParameters: [Parameters.accept], + serializer +}; +const listByDevCenterNextOperationSpec: coreClient.OperationSpec = { + path: "{nextLink}", + httpMethod: "GET", + responses: { + 200: { + bodyMapper: Mappers.DevBoxDefinitionListResult + }, + default: { + bodyMapper: Mappers.CloudError + } + }, + queryParameters: [Parameters.apiVersion, Parameters.top], + urlParameters: [ + Parameters.$host, + Parameters.subscriptionId, + Parameters.resourceGroupName, + Parameters.devCenterName, + Parameters.nextLink + ], + headerParameters: [Parameters.accept], + serializer +}; +const listByProjectNextOperationSpec: coreClient.OperationSpec = { + path: "{nextLink}", + httpMethod: "GET", + responses: { + 200: { + bodyMapper: Mappers.DevBoxDefinitionListResult + }, + default: { + bodyMapper: Mappers.CloudError + } + }, + queryParameters: [Parameters.apiVersion, Parameters.top], + urlParameters: [ + Parameters.$host, + Parameters.subscriptionId, + Parameters.resourceGroupName, + Parameters.nextLink, + Parameters.projectName + ], + headerParameters: [Parameters.accept], + serializer +}; diff --git a/sdk/devcenter/arm-devcenter/src/operations/devCenters.ts b/sdk/devcenter/arm-devcenter/src/operations/devCenters.ts new file mode 100644 index 000000000000..bbdf4899d371 --- /dev/null +++ b/sdk/devcenter/arm-devcenter/src/operations/devCenters.ts @@ -0,0 +1,683 @@ +/* + * 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 { DevCenters } from "../operationsInterfaces"; +import * as coreClient from "@azure/core-client"; +import * as Mappers from "../models/mappers"; +import * as Parameters from "../models/parameters"; +import { DevCenterClient } from "../devCenterClient"; +import { PollerLike, PollOperationState, LroEngine } from "@azure/core-lro"; +import { LroImpl } from "../lroImpl"; +import { + DevCenter, + DevCentersListBySubscriptionNextOptionalParams, + DevCentersListBySubscriptionOptionalParams, + DevCentersListByResourceGroupNextOptionalParams, + DevCentersListByResourceGroupOptionalParams, + DevCentersListBySubscriptionResponse, + DevCentersListByResourceGroupResponse, + DevCentersGetOptionalParams, + DevCentersGetResponse, + DevCentersCreateOrUpdateOptionalParams, + DevCentersCreateOrUpdateResponse, + DevCenterUpdate, + DevCentersUpdateOptionalParams, + DevCentersUpdateResponse, + DevCentersDeleteOptionalParams, + DevCentersListBySubscriptionNextResponse, + DevCentersListByResourceGroupNextResponse +} from "../models"; + +/// +/** Class containing DevCenters operations. */ +export class DevCentersImpl implements DevCenters { + private readonly client: DevCenterClient; + + /** + * Initialize a new instance of the class DevCenters class. + * @param client Reference to the service client + */ + constructor(client: DevCenterClient) { + this.client = client; + } + + /** + * Lists all devcenters in a subscription. + * @param options The options parameters. + */ + public listBySubscription( + options?: DevCentersListBySubscriptionOptionalParams + ): PagedAsyncIterableIterator { + const iter = this.listBySubscriptionPagingAll(options); + return { + next() { + return iter.next(); + }, + [Symbol.asyncIterator]() { + return this; + }, + byPage: () => { + return this.listBySubscriptionPagingPage(options); + } + }; + } + + private async *listBySubscriptionPagingPage( + options?: DevCentersListBySubscriptionOptionalParams + ): 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?: DevCentersListBySubscriptionOptionalParams + ): AsyncIterableIterator { + for await (const page of this.listBySubscriptionPagingPage(options)) { + yield* page; + } + } + + /** + * Lists all devcenters in a resource group. + * @param resourceGroupName Name of the resource group within the Azure subscription. + * @param options The options parameters. + */ + public listByResourceGroup( + resourceGroupName: string, + options?: DevCentersListByResourceGroupOptionalParams + ): 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?: DevCentersListByResourceGroupOptionalParams + ): 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?: DevCentersListByResourceGroupOptionalParams + ): AsyncIterableIterator { + for await (const page of this.listByResourceGroupPagingPage( + resourceGroupName, + options + )) { + yield* page; + } + } + + /** + * Lists all devcenters in a subscription. + * @param options The options parameters. + */ + private _listBySubscription( + options?: DevCentersListBySubscriptionOptionalParams + ): Promise { + return this.client.sendOperationRequest( + { options }, + listBySubscriptionOperationSpec + ); + } + + /** + * Lists all devcenters in a resource group. + * @param resourceGroupName Name of the resource group within the Azure subscription. + * @param options The options parameters. + */ + private _listByResourceGroup( + resourceGroupName: string, + options?: DevCentersListByResourceGroupOptionalParams + ): Promise { + return this.client.sendOperationRequest( + { resourceGroupName, options }, + listByResourceGroupOperationSpec + ); + } + + /** + * Gets a devcenter. + * @param resourceGroupName Name of the resource group within the Azure subscription. + * @param devCenterName The name of the devcenter. + * @param options The options parameters. + */ + get( + resourceGroupName: string, + devCenterName: string, + options?: DevCentersGetOptionalParams + ): Promise { + return this.client.sendOperationRequest( + { resourceGroupName, devCenterName, options }, + getOperationSpec + ); + } + + /** + * Creates or updates a devcenter resource + * @param resourceGroupName Name of the resource group within the Azure subscription. + * @param devCenterName The name of the devcenter. + * @param body Represents a devcenter. + * @param options The options parameters. + */ + async beginCreateOrUpdate( + resourceGroupName: string, + devCenterName: string, + body: DevCenter, + options?: DevCentersCreateOrUpdateOptionalParams + ): Promise< + PollerLike< + PollOperationState, + DevCentersCreateOrUpdateResponse + > + > { + 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, devCenterName, body, options }, + createOrUpdateOperationSpec + ); + const poller = new LroEngine(lro, { + resumeFrom: options?.resumeFrom, + intervalInMs: options?.updateIntervalInMs, + lroResourceLocationConfig: "azure-async-operation" + }); + await poller.poll(); + return poller; + } + + /** + * Creates or updates a devcenter resource + * @param resourceGroupName Name of the resource group within the Azure subscription. + * @param devCenterName The name of the devcenter. + * @param body Represents a devcenter. + * @param options The options parameters. + */ + async beginCreateOrUpdateAndWait( + resourceGroupName: string, + devCenterName: string, + body: DevCenter, + options?: DevCentersCreateOrUpdateOptionalParams + ): Promise { + const poller = await this.beginCreateOrUpdate( + resourceGroupName, + devCenterName, + body, + options + ); + return poller.pollUntilDone(); + } + + /** + * Partially updates a devcenter. + * @param resourceGroupName Name of the resource group within the Azure subscription. + * @param devCenterName The name of the devcenter. + * @param body Updatable devcenter properties. + * @param options The options parameters. + */ + async beginUpdate( + resourceGroupName: string, + devCenterName: string, + body: DevCenterUpdate, + options?: DevCentersUpdateOptionalParams + ): Promise< + PollerLike< + PollOperationState, + DevCentersUpdateResponse + > + > { + 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, devCenterName, body, options }, + updateOperationSpec + ); + const poller = new LroEngine(lro, { + resumeFrom: options?.resumeFrom, + intervalInMs: options?.updateIntervalInMs, + lroResourceLocationConfig: "azure-async-operation" + }); + await poller.poll(); + return poller; + } + + /** + * Partially updates a devcenter. + * @param resourceGroupName Name of the resource group within the Azure subscription. + * @param devCenterName The name of the devcenter. + * @param body Updatable devcenter properties. + * @param options The options parameters. + */ + async beginUpdateAndWait( + resourceGroupName: string, + devCenterName: string, + body: DevCenterUpdate, + options?: DevCentersUpdateOptionalParams + ): Promise { + const poller = await this.beginUpdate( + resourceGroupName, + devCenterName, + body, + options + ); + return poller.pollUntilDone(); + } + + /** + * Deletes a devcenter + * @param resourceGroupName Name of the resource group within the Azure subscription. + * @param devCenterName The name of the devcenter. + * @param options The options parameters. + */ + async beginDelete( + resourceGroupName: string, + devCenterName: string, + options?: DevCentersDeleteOptionalParams + ): 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, devCenterName, options }, + deleteOperationSpec + ); + const poller = new LroEngine(lro, { + resumeFrom: options?.resumeFrom, + intervalInMs: options?.updateIntervalInMs, + lroResourceLocationConfig: "azure-async-operation" + }); + await poller.poll(); + return poller; + } + + /** + * Deletes a devcenter + * @param resourceGroupName Name of the resource group within the Azure subscription. + * @param devCenterName The name of the devcenter. + * @param options The options parameters. + */ + async beginDeleteAndWait( + resourceGroupName: string, + devCenterName: string, + options?: DevCentersDeleteOptionalParams + ): Promise { + const poller = await this.beginDelete( + resourceGroupName, + devCenterName, + options + ); + return poller.pollUntilDone(); + } + + /** + * ListBySubscriptionNext + * @param nextLink The nextLink from the previous successful call to the ListBySubscription method. + * @param options The options parameters. + */ + private _listBySubscriptionNext( + nextLink: string, + options?: DevCentersListBySubscriptionNextOptionalParams + ): Promise { + return this.client.sendOperationRequest( + { nextLink, options }, + listBySubscriptionNextOperationSpec + ); + } + + /** + * ListByResourceGroupNext + * @param resourceGroupName Name of the resource group within the Azure subscription. + * @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?: DevCentersListByResourceGroupNextOptionalParams + ): 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.DevCenter/devcenters", + httpMethod: "GET", + responses: { + 200: { + bodyMapper: Mappers.DevCenterListResult + }, + default: { + bodyMapper: Mappers.CloudError + } + }, + queryParameters: [Parameters.apiVersion, Parameters.top], + urlParameters: [Parameters.$host, Parameters.subscriptionId], + headerParameters: [Parameters.accept], + serializer +}; +const listByResourceGroupOperationSpec: coreClient.OperationSpec = { + path: + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DevCenter/devcenters", + httpMethod: "GET", + responses: { + 200: { + bodyMapper: Mappers.DevCenterListResult + }, + default: { + bodyMapper: Mappers.CloudError + } + }, + queryParameters: [Parameters.apiVersion, Parameters.top], + urlParameters: [ + Parameters.$host, + Parameters.subscriptionId, + Parameters.resourceGroupName + ], + headerParameters: [Parameters.accept], + serializer +}; +const getOperationSpec: coreClient.OperationSpec = { + path: + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DevCenter/devcenters/{devCenterName}", + httpMethod: "GET", + responses: { + 200: { + bodyMapper: Mappers.DevCenter + }, + default: { + bodyMapper: Mappers.CloudError + } + }, + queryParameters: [Parameters.apiVersion], + urlParameters: [ + Parameters.$host, + Parameters.subscriptionId, + Parameters.resourceGroupName, + Parameters.devCenterName + ], + headerParameters: [Parameters.accept], + serializer +}; +const createOrUpdateOperationSpec: coreClient.OperationSpec = { + path: + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DevCenter/devcenters/{devCenterName}", + httpMethod: "PUT", + responses: { + 200: { + bodyMapper: Mappers.DevCenter + }, + 201: { + bodyMapper: Mappers.DevCenter + }, + 202: { + bodyMapper: Mappers.DevCenter + }, + 204: { + bodyMapper: Mappers.DevCenter + }, + default: { + bodyMapper: Mappers.CloudError + } + }, + requestBody: Parameters.body, + queryParameters: [Parameters.apiVersion], + urlParameters: [ + Parameters.$host, + Parameters.subscriptionId, + Parameters.resourceGroupName, + Parameters.devCenterName + ], + headerParameters: [Parameters.accept, Parameters.contentType], + mediaType: "json", + serializer +}; +const updateOperationSpec: coreClient.OperationSpec = { + path: + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DevCenter/devcenters/{devCenterName}", + httpMethod: "PATCH", + responses: { + 200: { + bodyMapper: Mappers.DevCenter + }, + 201: { + bodyMapper: Mappers.DevCenter + }, + 202: { + bodyMapper: Mappers.DevCenter + }, + 204: { + bodyMapper: Mappers.DevCenter + }, + default: { + bodyMapper: Mappers.CloudError + } + }, + requestBody: Parameters.body1, + queryParameters: [Parameters.apiVersion], + urlParameters: [ + Parameters.$host, + Parameters.subscriptionId, + Parameters.resourceGroupName, + Parameters.devCenterName + ], + headerParameters: [Parameters.accept, Parameters.contentType], + mediaType: "json", + serializer +}; +const deleteOperationSpec: coreClient.OperationSpec = { + path: + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DevCenter/devcenters/{devCenterName}", + httpMethod: "DELETE", + responses: { + 200: {}, + 201: {}, + 202: {}, + 204: {}, + default: { + bodyMapper: Mappers.CloudError + } + }, + queryParameters: [Parameters.apiVersion], + urlParameters: [ + Parameters.$host, + Parameters.subscriptionId, + Parameters.resourceGroupName, + Parameters.devCenterName + ], + headerParameters: [Parameters.accept], + serializer +}; +const listBySubscriptionNextOperationSpec: coreClient.OperationSpec = { + path: "{nextLink}", + httpMethod: "GET", + responses: { + 200: { + bodyMapper: Mappers.DevCenterListResult + }, + default: { + bodyMapper: Mappers.CloudError + } + }, + queryParameters: [Parameters.apiVersion, Parameters.top], + urlParameters: [ + Parameters.$host, + Parameters.subscriptionId, + Parameters.nextLink + ], + headerParameters: [Parameters.accept], + serializer +}; +const listByResourceGroupNextOperationSpec: coreClient.OperationSpec = { + path: "{nextLink}", + httpMethod: "GET", + responses: { + 200: { + bodyMapper: Mappers.DevCenterListResult + }, + default: { + bodyMapper: Mappers.CloudError + } + }, + queryParameters: [Parameters.apiVersion, Parameters.top], + urlParameters: [ + Parameters.$host, + Parameters.subscriptionId, + Parameters.resourceGroupName, + Parameters.nextLink + ], + headerParameters: [Parameters.accept], + serializer +}; diff --git a/sdk/devcenter/arm-devcenter/src/operations/environmentTypes.ts b/sdk/devcenter/arm-devcenter/src/operations/environmentTypes.ts new file mode 100644 index 000000000000..31ba251cf226 --- /dev/null +++ b/sdk/devcenter/arm-devcenter/src/operations/environmentTypes.ts @@ -0,0 +1,372 @@ +/* + * 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 { EnvironmentTypes } from "../operationsInterfaces"; +import * as coreClient from "@azure/core-client"; +import * as Mappers from "../models/mappers"; +import * as Parameters from "../models/parameters"; +import { DevCenterClient } from "../devCenterClient"; +import { + EnvironmentType, + EnvironmentTypesListByDevCenterNextOptionalParams, + EnvironmentTypesListByDevCenterOptionalParams, + EnvironmentTypesListByDevCenterResponse, + EnvironmentTypesGetOptionalParams, + EnvironmentTypesGetResponse, + EnvironmentTypesCreateOrUpdateOptionalParams, + EnvironmentTypesCreateOrUpdateResponse, + EnvironmentTypeUpdate, + EnvironmentTypesUpdateOptionalParams, + EnvironmentTypesUpdateResponse, + EnvironmentTypesDeleteOptionalParams, + EnvironmentTypesListByDevCenterNextResponse +} from "../models"; + +/// +/** Class containing EnvironmentTypes operations. */ +export class EnvironmentTypesImpl implements EnvironmentTypes { + private readonly client: DevCenterClient; + + /** + * Initialize a new instance of the class EnvironmentTypes class. + * @param client Reference to the service client + */ + constructor(client: DevCenterClient) { + this.client = client; + } + + /** + * Lists environment types for the devcenter. + * @param resourceGroupName Name of the resource group within the Azure subscription. + * @param devCenterName The name of the devcenter. + * @param options The options parameters. + */ + public listByDevCenter( + resourceGroupName: string, + devCenterName: string, + options?: EnvironmentTypesListByDevCenterOptionalParams + ): PagedAsyncIterableIterator { + const iter = this.listByDevCenterPagingAll( + resourceGroupName, + devCenterName, + options + ); + return { + next() { + return iter.next(); + }, + [Symbol.asyncIterator]() { + return this; + }, + byPage: () => { + return this.listByDevCenterPagingPage( + resourceGroupName, + devCenterName, + options + ); + } + }; + } + + private async *listByDevCenterPagingPage( + resourceGroupName: string, + devCenterName: string, + options?: EnvironmentTypesListByDevCenterOptionalParams + ): AsyncIterableIterator { + let result = await this._listByDevCenter( + resourceGroupName, + devCenterName, + options + ); + yield result.value || []; + let continuationToken = result.nextLink; + while (continuationToken) { + result = await this._listByDevCenterNext( + resourceGroupName, + devCenterName, + continuationToken, + options + ); + continuationToken = result.nextLink; + yield result.value || []; + } + } + + private async *listByDevCenterPagingAll( + resourceGroupName: string, + devCenterName: string, + options?: EnvironmentTypesListByDevCenterOptionalParams + ): AsyncIterableIterator { + for await (const page of this.listByDevCenterPagingPage( + resourceGroupName, + devCenterName, + options + )) { + yield* page; + } + } + + /** + * Lists environment types for the devcenter. + * @param resourceGroupName Name of the resource group within the Azure subscription. + * @param devCenterName The name of the devcenter. + * @param options The options parameters. + */ + private _listByDevCenter( + resourceGroupName: string, + devCenterName: string, + options?: EnvironmentTypesListByDevCenterOptionalParams + ): Promise { + return this.client.sendOperationRequest( + { resourceGroupName, devCenterName, options }, + listByDevCenterOperationSpec + ); + } + + /** + * Gets an environment type. + * @param resourceGroupName Name of the resource group within the Azure subscription. + * @param devCenterName The name of the devcenter. + * @param environmentTypeName The name of the environment type. + * @param options The options parameters. + */ + get( + resourceGroupName: string, + devCenterName: string, + environmentTypeName: string, + options?: EnvironmentTypesGetOptionalParams + ): Promise { + return this.client.sendOperationRequest( + { resourceGroupName, devCenterName, environmentTypeName, options }, + getOperationSpec + ); + } + + /** + * Creates or updates an environment type. + * @param resourceGroupName Name of the resource group within the Azure subscription. + * @param devCenterName The name of the devcenter. + * @param environmentTypeName The name of the environment type. + * @param body Represents an Environment Type. + * @param options The options parameters. + */ + createOrUpdate( + resourceGroupName: string, + devCenterName: string, + environmentTypeName: string, + body: EnvironmentType, + options?: EnvironmentTypesCreateOrUpdateOptionalParams + ): Promise { + return this.client.sendOperationRequest( + { resourceGroupName, devCenterName, environmentTypeName, body, options }, + createOrUpdateOperationSpec + ); + } + + /** + * Partially updates an environment type. + * @param resourceGroupName Name of the resource group within the Azure subscription. + * @param devCenterName The name of the devcenter. + * @param environmentTypeName The name of the environment type. + * @param body Updatable environment type properties. + * @param options The options parameters. + */ + update( + resourceGroupName: string, + devCenterName: string, + environmentTypeName: string, + body: EnvironmentTypeUpdate, + options?: EnvironmentTypesUpdateOptionalParams + ): Promise { + return this.client.sendOperationRequest( + { resourceGroupName, devCenterName, environmentTypeName, body, options }, + updateOperationSpec + ); + } + + /** + * Deletes an environment type. + * @param resourceGroupName Name of the resource group within the Azure subscription. + * @param devCenterName The name of the devcenter. + * @param environmentTypeName The name of the environment type. + * @param options The options parameters. + */ + delete( + resourceGroupName: string, + devCenterName: string, + environmentTypeName: string, + options?: EnvironmentTypesDeleteOptionalParams + ): Promise { + return this.client.sendOperationRequest( + { resourceGroupName, devCenterName, environmentTypeName, options }, + deleteOperationSpec + ); + } + + /** + * ListByDevCenterNext + * @param resourceGroupName Name of the resource group within the Azure subscription. + * @param devCenterName The name of the devcenter. + * @param nextLink The nextLink from the previous successful call to the ListByDevCenter method. + * @param options The options parameters. + */ + private _listByDevCenterNext( + resourceGroupName: string, + devCenterName: string, + nextLink: string, + options?: EnvironmentTypesListByDevCenterNextOptionalParams + ): Promise { + return this.client.sendOperationRequest( + { resourceGroupName, devCenterName, nextLink, options }, + listByDevCenterNextOperationSpec + ); + } +} +// Operation Specifications +const serializer = coreClient.createSerializer(Mappers, /* isXml */ false); + +const listByDevCenterOperationSpec: coreClient.OperationSpec = { + path: + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DevCenter/devcenters/{devCenterName}/environmentTypes", + httpMethod: "GET", + responses: { + 200: { + bodyMapper: Mappers.EnvironmentTypeListResult + }, + default: { + bodyMapper: Mappers.CloudError + } + }, + queryParameters: [Parameters.apiVersion, Parameters.top], + urlParameters: [ + Parameters.$host, + Parameters.subscriptionId, + Parameters.resourceGroupName, + Parameters.devCenterName + ], + headerParameters: [Parameters.accept], + serializer +}; +const getOperationSpec: coreClient.OperationSpec = { + path: + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DevCenter/devcenters/{devCenterName}/environmentTypes/{environmentTypeName}", + httpMethod: "GET", + responses: { + 200: { + bodyMapper: Mappers.EnvironmentType + }, + default: { + bodyMapper: Mappers.CloudError + } + }, + queryParameters: [Parameters.apiVersion], + urlParameters: [ + Parameters.$host, + Parameters.subscriptionId, + Parameters.resourceGroupName, + Parameters.devCenterName, + Parameters.environmentTypeName + ], + headerParameters: [Parameters.accept], + serializer +}; +const createOrUpdateOperationSpec: coreClient.OperationSpec = { + path: + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DevCenter/devcenters/{devCenterName}/environmentTypes/{environmentTypeName}", + httpMethod: "PUT", + responses: { + 200: { + bodyMapper: Mappers.EnvironmentType + }, + default: { + bodyMapper: Mappers.CloudError + } + }, + requestBody: Parameters.body8, + queryParameters: [Parameters.apiVersion], + urlParameters: [ + Parameters.$host, + Parameters.subscriptionId, + Parameters.resourceGroupName, + Parameters.devCenterName, + Parameters.environmentTypeName + ], + headerParameters: [Parameters.accept, Parameters.contentType], + mediaType: "json", + serializer +}; +const updateOperationSpec: coreClient.OperationSpec = { + path: + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DevCenter/devcenters/{devCenterName}/environmentTypes/{environmentTypeName}", + httpMethod: "PATCH", + responses: { + 200: { + bodyMapper: Mappers.EnvironmentType + }, + default: { + bodyMapper: Mappers.CloudError + } + }, + requestBody: Parameters.body9, + queryParameters: [Parameters.apiVersion], + urlParameters: [ + Parameters.$host, + Parameters.subscriptionId, + Parameters.resourceGroupName, + Parameters.devCenterName, + Parameters.environmentTypeName + ], + headerParameters: [Parameters.accept, Parameters.contentType], + mediaType: "json", + serializer +}; +const deleteOperationSpec: coreClient.OperationSpec = { + path: + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DevCenter/devcenters/{devCenterName}/environmentTypes/{environmentTypeName}", + httpMethod: "DELETE", + responses: { + 200: {}, + 204: {}, + default: { + bodyMapper: Mappers.CloudError + } + }, + queryParameters: [Parameters.apiVersion], + urlParameters: [ + Parameters.$host, + Parameters.subscriptionId, + Parameters.resourceGroupName, + Parameters.devCenterName, + Parameters.environmentTypeName + ], + headerParameters: [Parameters.accept], + serializer +}; +const listByDevCenterNextOperationSpec: coreClient.OperationSpec = { + path: "{nextLink}", + httpMethod: "GET", + responses: { + 200: { + bodyMapper: Mappers.EnvironmentTypeListResult + }, + default: { + bodyMapper: Mappers.CloudError + } + }, + queryParameters: [Parameters.apiVersion, Parameters.top], + urlParameters: [ + Parameters.$host, + Parameters.subscriptionId, + Parameters.resourceGroupName, + Parameters.devCenterName, + Parameters.nextLink + ], + headerParameters: [Parameters.accept], + serializer +}; diff --git a/sdk/devcenter/arm-devcenter/src/operations/galleries.ts b/sdk/devcenter/arm-devcenter/src/operations/galleries.ts new file mode 100644 index 000000000000..225ed2026f39 --- /dev/null +++ b/sdk/devcenter/arm-devcenter/src/operations/galleries.ts @@ -0,0 +1,482 @@ +/* + * 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 { Galleries } from "../operationsInterfaces"; +import * as coreClient from "@azure/core-client"; +import * as Mappers from "../models/mappers"; +import * as Parameters from "../models/parameters"; +import { DevCenterClient } from "../devCenterClient"; +import { PollerLike, PollOperationState, LroEngine } from "@azure/core-lro"; +import { LroImpl } from "../lroImpl"; +import { + Gallery, + GalleriesListByDevCenterNextOptionalParams, + GalleriesListByDevCenterOptionalParams, + GalleriesListByDevCenterResponse, + GalleriesGetOptionalParams, + GalleriesGetResponse, + GalleriesCreateOrUpdateOptionalParams, + GalleriesCreateOrUpdateResponse, + GalleriesDeleteOptionalParams, + GalleriesListByDevCenterNextResponse +} from "../models"; + +/// +/** Class containing Galleries operations. */ +export class GalleriesImpl implements Galleries { + private readonly client: DevCenterClient; + + /** + * Initialize a new instance of the class Galleries class. + * @param client Reference to the service client + */ + constructor(client: DevCenterClient) { + this.client = client; + } + + /** + * Lists galleries for a devcenter. + * @param resourceGroupName Name of the resource group within the Azure subscription. + * @param devCenterName The name of the devcenter. + * @param options The options parameters. + */ + public listByDevCenter( + resourceGroupName: string, + devCenterName: string, + options?: GalleriesListByDevCenterOptionalParams + ): PagedAsyncIterableIterator { + const iter = this.listByDevCenterPagingAll( + resourceGroupName, + devCenterName, + options + ); + return { + next() { + return iter.next(); + }, + [Symbol.asyncIterator]() { + return this; + }, + byPage: () => { + return this.listByDevCenterPagingPage( + resourceGroupName, + devCenterName, + options + ); + } + }; + } + + private async *listByDevCenterPagingPage( + resourceGroupName: string, + devCenterName: string, + options?: GalleriesListByDevCenterOptionalParams + ): AsyncIterableIterator { + let result = await this._listByDevCenter( + resourceGroupName, + devCenterName, + options + ); + yield result.value || []; + let continuationToken = result.nextLink; + while (continuationToken) { + result = await this._listByDevCenterNext( + resourceGroupName, + devCenterName, + continuationToken, + options + ); + continuationToken = result.nextLink; + yield result.value || []; + } + } + + private async *listByDevCenterPagingAll( + resourceGroupName: string, + devCenterName: string, + options?: GalleriesListByDevCenterOptionalParams + ): AsyncIterableIterator { + for await (const page of this.listByDevCenterPagingPage( + resourceGroupName, + devCenterName, + options + )) { + yield* page; + } + } + + /** + * Lists galleries for a devcenter. + * @param resourceGroupName Name of the resource group within the Azure subscription. + * @param devCenterName The name of the devcenter. + * @param options The options parameters. + */ + private _listByDevCenter( + resourceGroupName: string, + devCenterName: string, + options?: GalleriesListByDevCenterOptionalParams + ): Promise { + return this.client.sendOperationRequest( + { resourceGroupName, devCenterName, options }, + listByDevCenterOperationSpec + ); + } + + /** + * Gets a gallery + * @param resourceGroupName Name of the resource group within the Azure subscription. + * @param devCenterName The name of the devcenter. + * @param galleryName The name of the gallery. + * @param options The options parameters. + */ + get( + resourceGroupName: string, + devCenterName: string, + galleryName: string, + options?: GalleriesGetOptionalParams + ): Promise { + return this.client.sendOperationRequest( + { resourceGroupName, devCenterName, galleryName, options }, + getOperationSpec + ); + } + + /** + * Creates or updates a gallery. + * @param resourceGroupName Name of the resource group within the Azure subscription. + * @param devCenterName The name of the devcenter. + * @param galleryName The name of the gallery. + * @param body Represents a gallery. + * @param options The options parameters. + */ + async beginCreateOrUpdate( + resourceGroupName: string, + devCenterName: string, + galleryName: string, + body: Gallery, + options?: GalleriesCreateOrUpdateOptionalParams + ): Promise< + PollerLike< + PollOperationState, + GalleriesCreateOrUpdateResponse + > + > { + 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, devCenterName, galleryName, body, options }, + createOrUpdateOperationSpec + ); + const poller = new LroEngine(lro, { + resumeFrom: options?.resumeFrom, + intervalInMs: options?.updateIntervalInMs, + lroResourceLocationConfig: "azure-async-operation" + }); + await poller.poll(); + return poller; + } + + /** + * Creates or updates a gallery. + * @param resourceGroupName Name of the resource group within the Azure subscription. + * @param devCenterName The name of the devcenter. + * @param galleryName The name of the gallery. + * @param body Represents a gallery. + * @param options The options parameters. + */ + async beginCreateOrUpdateAndWait( + resourceGroupName: string, + devCenterName: string, + galleryName: string, + body: Gallery, + options?: GalleriesCreateOrUpdateOptionalParams + ): Promise { + const poller = await this.beginCreateOrUpdate( + resourceGroupName, + devCenterName, + galleryName, + body, + options + ); + return poller.pollUntilDone(); + } + + /** + * Deletes a gallery resource. + * @param resourceGroupName Name of the resource group within the Azure subscription. + * @param devCenterName The name of the devcenter. + * @param galleryName The name of the gallery. + * @param options The options parameters. + */ + async beginDelete( + resourceGroupName: string, + devCenterName: string, + galleryName: string, + options?: GalleriesDeleteOptionalParams + ): 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, devCenterName, galleryName, options }, + deleteOperationSpec + ); + const poller = new LroEngine(lro, { + resumeFrom: options?.resumeFrom, + intervalInMs: options?.updateIntervalInMs, + lroResourceLocationConfig: "azure-async-operation" + }); + await poller.poll(); + return poller; + } + + /** + * Deletes a gallery resource. + * @param resourceGroupName Name of the resource group within the Azure subscription. + * @param devCenterName The name of the devcenter. + * @param galleryName The name of the gallery. + * @param options The options parameters. + */ + async beginDeleteAndWait( + resourceGroupName: string, + devCenterName: string, + galleryName: string, + options?: GalleriesDeleteOptionalParams + ): Promise { + const poller = await this.beginDelete( + resourceGroupName, + devCenterName, + galleryName, + options + ); + return poller.pollUntilDone(); + } + + /** + * ListByDevCenterNext + * @param resourceGroupName Name of the resource group within the Azure subscription. + * @param devCenterName The name of the devcenter. + * @param nextLink The nextLink from the previous successful call to the ListByDevCenter method. + * @param options The options parameters. + */ + private _listByDevCenterNext( + resourceGroupName: string, + devCenterName: string, + nextLink: string, + options?: GalleriesListByDevCenterNextOptionalParams + ): Promise { + return this.client.sendOperationRequest( + { resourceGroupName, devCenterName, nextLink, options }, + listByDevCenterNextOperationSpec + ); + } +} +// Operation Specifications +const serializer = coreClient.createSerializer(Mappers, /* isXml */ false); + +const listByDevCenterOperationSpec: coreClient.OperationSpec = { + path: + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DevCenter/devcenters/{devCenterName}/galleries", + httpMethod: "GET", + responses: { + 200: { + bodyMapper: Mappers.GalleryListResult + }, + default: { + bodyMapper: Mappers.CloudError + } + }, + queryParameters: [Parameters.apiVersion, Parameters.top], + urlParameters: [ + Parameters.$host, + Parameters.subscriptionId, + Parameters.resourceGroupName, + Parameters.devCenterName + ], + headerParameters: [Parameters.accept], + serializer +}; +const getOperationSpec: coreClient.OperationSpec = { + path: + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DevCenter/devcenters/{devCenterName}/galleries/{galleryName}", + httpMethod: "GET", + responses: { + 200: { + bodyMapper: Mappers.Gallery + }, + default: { + bodyMapper: Mappers.CloudError + } + }, + queryParameters: [Parameters.apiVersion], + urlParameters: [ + Parameters.$host, + Parameters.subscriptionId, + Parameters.resourceGroupName, + Parameters.devCenterName, + Parameters.galleryName + ], + headerParameters: [Parameters.accept], + serializer +}; +const createOrUpdateOperationSpec: coreClient.OperationSpec = { + path: + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DevCenter/devcenters/{devCenterName}/galleries/{galleryName}", + httpMethod: "PUT", + responses: { + 200: { + bodyMapper: Mappers.Gallery + }, + 201: { + bodyMapper: Mappers.Gallery + }, + 202: { + bodyMapper: Mappers.Gallery + }, + 204: { + bodyMapper: Mappers.Gallery + }, + default: { + bodyMapper: Mappers.CloudError + } + }, + requestBody: Parameters.body5, + queryParameters: [Parameters.apiVersion], + urlParameters: [ + Parameters.$host, + Parameters.subscriptionId, + Parameters.resourceGroupName, + Parameters.devCenterName, + Parameters.galleryName + ], + headerParameters: [Parameters.accept, Parameters.contentType], + mediaType: "json", + serializer +}; +const deleteOperationSpec: coreClient.OperationSpec = { + path: + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DevCenter/devcenters/{devCenterName}/galleries/{galleryName}", + httpMethod: "DELETE", + responses: { + 200: {}, + 201: {}, + 202: {}, + 204: {}, + default: { + bodyMapper: Mappers.CloudError + } + }, + queryParameters: [Parameters.apiVersion], + urlParameters: [ + Parameters.$host, + Parameters.subscriptionId, + Parameters.resourceGroupName, + Parameters.devCenterName, + Parameters.galleryName + ], + headerParameters: [Parameters.accept], + serializer +}; +const listByDevCenterNextOperationSpec: coreClient.OperationSpec = { + path: "{nextLink}", + httpMethod: "GET", + responses: { + 200: { + bodyMapper: Mappers.GalleryListResult + }, + default: { + bodyMapper: Mappers.CloudError + } + }, + queryParameters: [Parameters.apiVersion, Parameters.top], + urlParameters: [ + Parameters.$host, + Parameters.subscriptionId, + Parameters.resourceGroupName, + Parameters.devCenterName, + Parameters.nextLink + ], + headerParameters: [Parameters.accept], + serializer +}; diff --git a/sdk/devcenter/arm-devcenter/src/operations/imageVersions.ts b/sdk/devcenter/arm-devcenter/src/operations/imageVersions.ts new file mode 100644 index 000000000000..71d9b5b28ff2 --- /dev/null +++ b/sdk/devcenter/arm-devcenter/src/operations/imageVersions.ts @@ -0,0 +1,283 @@ +/* + * 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 { ImageVersions } from "../operationsInterfaces"; +import * as coreClient from "@azure/core-client"; +import * as Mappers from "../models/mappers"; +import * as Parameters from "../models/parameters"; +import { DevCenterClient } from "../devCenterClient"; +import { + ImageVersion, + ImageVersionsListByImageNextOptionalParams, + ImageVersionsListByImageOptionalParams, + ImageVersionsListByImageResponse, + ImageVersionsGetOptionalParams, + ImageVersionsGetResponse, + ImageVersionsListByImageNextResponse +} from "../models"; + +/// +/** Class containing ImageVersions operations. */ +export class ImageVersionsImpl implements ImageVersions { + private readonly client: DevCenterClient; + + /** + * Initialize a new instance of the class ImageVersions class. + * @param client Reference to the service client + */ + constructor(client: DevCenterClient) { + this.client = client; + } + + /** + * Lists versions for an image. + * @param resourceGroupName Name of the resource group within the Azure subscription. + * @param devCenterName The name of the devcenter. + * @param galleryName The name of the gallery. + * @param imageName The name of the image. + * @param options The options parameters. + */ + public listByImage( + resourceGroupName: string, + devCenterName: string, + galleryName: string, + imageName: string, + options?: ImageVersionsListByImageOptionalParams + ): PagedAsyncIterableIterator { + const iter = this.listByImagePagingAll( + resourceGroupName, + devCenterName, + galleryName, + imageName, + options + ); + return { + next() { + return iter.next(); + }, + [Symbol.asyncIterator]() { + return this; + }, + byPage: () => { + return this.listByImagePagingPage( + resourceGroupName, + devCenterName, + galleryName, + imageName, + options + ); + } + }; + } + + private async *listByImagePagingPage( + resourceGroupName: string, + devCenterName: string, + galleryName: string, + imageName: string, + options?: ImageVersionsListByImageOptionalParams + ): AsyncIterableIterator { + let result = await this._listByImage( + resourceGroupName, + devCenterName, + galleryName, + imageName, + options + ); + yield result.value || []; + let continuationToken = result.nextLink; + while (continuationToken) { + result = await this._listByImageNext( + resourceGroupName, + devCenterName, + galleryName, + imageName, + continuationToken, + options + ); + continuationToken = result.nextLink; + yield result.value || []; + } + } + + private async *listByImagePagingAll( + resourceGroupName: string, + devCenterName: string, + galleryName: string, + imageName: string, + options?: ImageVersionsListByImageOptionalParams + ): AsyncIterableIterator { + for await (const page of this.listByImagePagingPage( + resourceGroupName, + devCenterName, + galleryName, + imageName, + options + )) { + yield* page; + } + } + + /** + * Lists versions for an image. + * @param resourceGroupName Name of the resource group within the Azure subscription. + * @param devCenterName The name of the devcenter. + * @param galleryName The name of the gallery. + * @param imageName The name of the image. + * @param options The options parameters. + */ + private _listByImage( + resourceGroupName: string, + devCenterName: string, + galleryName: string, + imageName: string, + options?: ImageVersionsListByImageOptionalParams + ): Promise { + return this.client.sendOperationRequest( + { resourceGroupName, devCenterName, galleryName, imageName, options }, + listByImageOperationSpec + ); + } + + /** + * Gets an image version. + * @param resourceGroupName Name of the resource group within the Azure subscription. + * @param devCenterName The name of the devcenter. + * @param galleryName The name of the gallery. + * @param imageName The name of the image. + * @param versionName The version of the image. + * @param options The options parameters. + */ + get( + resourceGroupName: string, + devCenterName: string, + galleryName: string, + imageName: string, + versionName: string, + options?: ImageVersionsGetOptionalParams + ): Promise { + return this.client.sendOperationRequest( + { + resourceGroupName, + devCenterName, + galleryName, + imageName, + versionName, + options + }, + getOperationSpec + ); + } + + /** + * ListByImageNext + * @param resourceGroupName Name of the resource group within the Azure subscription. + * @param devCenterName The name of the devcenter. + * @param galleryName The name of the gallery. + * @param imageName The name of the image. + * @param nextLink The nextLink from the previous successful call to the ListByImage method. + * @param options The options parameters. + */ + private _listByImageNext( + resourceGroupName: string, + devCenterName: string, + galleryName: string, + imageName: string, + nextLink: string, + options?: ImageVersionsListByImageNextOptionalParams + ): Promise { + return this.client.sendOperationRequest( + { + resourceGroupName, + devCenterName, + galleryName, + imageName, + nextLink, + options + }, + listByImageNextOperationSpec + ); + } +} +// Operation Specifications +const serializer = coreClient.createSerializer(Mappers, /* isXml */ false); + +const listByImageOperationSpec: coreClient.OperationSpec = { + path: + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DevCenter/devcenters/{devCenterName}/galleries/{galleryName}/images/{imageName}/versions", + httpMethod: "GET", + responses: { + 200: { + bodyMapper: Mappers.ImageVersionListResult + }, + default: { + bodyMapper: Mappers.CloudError + } + }, + queryParameters: [Parameters.apiVersion], + urlParameters: [ + Parameters.$host, + Parameters.subscriptionId, + Parameters.resourceGroupName, + Parameters.devCenterName, + Parameters.galleryName, + Parameters.imageName + ], + headerParameters: [Parameters.accept], + serializer +}; +const getOperationSpec: coreClient.OperationSpec = { + path: + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DevCenter/devcenters/{devCenterName}/galleries/{galleryName}/images/{imageName}/versions/{versionName}", + httpMethod: "GET", + responses: { + 200: { + bodyMapper: Mappers.ImageVersion + }, + default: { + bodyMapper: Mappers.CloudError + } + }, + queryParameters: [Parameters.apiVersion], + urlParameters: [ + Parameters.$host, + Parameters.subscriptionId, + Parameters.resourceGroupName, + Parameters.devCenterName, + Parameters.galleryName, + Parameters.imageName, + Parameters.versionName + ], + headerParameters: [Parameters.accept], + serializer +}; +const listByImageNextOperationSpec: coreClient.OperationSpec = { + path: "{nextLink}", + httpMethod: "GET", + responses: { + 200: { + bodyMapper: Mappers.ImageVersionListResult + }, + default: { + bodyMapper: Mappers.CloudError + } + }, + queryParameters: [Parameters.apiVersion], + urlParameters: [ + Parameters.$host, + Parameters.subscriptionId, + Parameters.resourceGroupName, + Parameters.devCenterName, + Parameters.nextLink, + Parameters.galleryName, + Parameters.imageName + ], + headerParameters: [Parameters.accept], + serializer +}; diff --git a/sdk/devcenter/arm-devcenter/src/operations/images.ts b/sdk/devcenter/arm-devcenter/src/operations/images.ts new file mode 100644 index 000000000000..1a4fe1febd13 --- /dev/null +++ b/sdk/devcenter/arm-devcenter/src/operations/images.ts @@ -0,0 +1,406 @@ +/* + * 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 { Images } from "../operationsInterfaces"; +import * as coreClient from "@azure/core-client"; +import * as Mappers from "../models/mappers"; +import * as Parameters from "../models/parameters"; +import { DevCenterClient } from "../devCenterClient"; +import { + Image, + ImagesListByDevCenterNextOptionalParams, + ImagesListByDevCenterOptionalParams, + ImagesListByGalleryNextOptionalParams, + ImagesListByGalleryOptionalParams, + ImagesListByDevCenterResponse, + ImagesListByGalleryResponse, + ImagesGetOptionalParams, + ImagesGetResponse, + ImagesListByDevCenterNextResponse, + ImagesListByGalleryNextResponse +} from "../models"; + +/// +/** Class containing Images operations. */ +export class ImagesImpl implements Images { + private readonly client: DevCenterClient; + + /** + * Initialize a new instance of the class Images class. + * @param client Reference to the service client + */ + constructor(client: DevCenterClient) { + this.client = client; + } + + /** + * Lists images for a devcenter. + * @param resourceGroupName Name of the resource group within the Azure subscription. + * @param devCenterName The name of the devcenter. + * @param options The options parameters. + */ + public listByDevCenter( + resourceGroupName: string, + devCenterName: string, + options?: ImagesListByDevCenterOptionalParams + ): PagedAsyncIterableIterator { + const iter = this.listByDevCenterPagingAll( + resourceGroupName, + devCenterName, + options + ); + return { + next() { + return iter.next(); + }, + [Symbol.asyncIterator]() { + return this; + }, + byPage: () => { + return this.listByDevCenterPagingPage( + resourceGroupName, + devCenterName, + options + ); + } + }; + } + + private async *listByDevCenterPagingPage( + resourceGroupName: string, + devCenterName: string, + options?: ImagesListByDevCenterOptionalParams + ): AsyncIterableIterator { + let result = await this._listByDevCenter( + resourceGroupName, + devCenterName, + options + ); + yield result.value || []; + let continuationToken = result.nextLink; + while (continuationToken) { + result = await this._listByDevCenterNext( + resourceGroupName, + devCenterName, + continuationToken, + options + ); + continuationToken = result.nextLink; + yield result.value || []; + } + } + + private async *listByDevCenterPagingAll( + resourceGroupName: string, + devCenterName: string, + options?: ImagesListByDevCenterOptionalParams + ): AsyncIterableIterator { + for await (const page of this.listByDevCenterPagingPage( + resourceGroupName, + devCenterName, + options + )) { + yield* page; + } + } + + /** + * Lists images for a gallery. + * @param resourceGroupName Name of the resource group within the Azure subscription. + * @param devCenterName The name of the devcenter. + * @param galleryName The name of the gallery. + * @param options The options parameters. + */ + public listByGallery( + resourceGroupName: string, + devCenterName: string, + galleryName: string, + options?: ImagesListByGalleryOptionalParams + ): PagedAsyncIterableIterator { + const iter = this.listByGalleryPagingAll( + resourceGroupName, + devCenterName, + galleryName, + options + ); + return { + next() { + return iter.next(); + }, + [Symbol.asyncIterator]() { + return this; + }, + byPage: () => { + return this.listByGalleryPagingPage( + resourceGroupName, + devCenterName, + galleryName, + options + ); + } + }; + } + + private async *listByGalleryPagingPage( + resourceGroupName: string, + devCenterName: string, + galleryName: string, + options?: ImagesListByGalleryOptionalParams + ): AsyncIterableIterator { + let result = await this._listByGallery( + resourceGroupName, + devCenterName, + galleryName, + options + ); + yield result.value || []; + let continuationToken = result.nextLink; + while (continuationToken) { + result = await this._listByGalleryNext( + resourceGroupName, + devCenterName, + galleryName, + continuationToken, + options + ); + continuationToken = result.nextLink; + yield result.value || []; + } + } + + private async *listByGalleryPagingAll( + resourceGroupName: string, + devCenterName: string, + galleryName: string, + options?: ImagesListByGalleryOptionalParams + ): AsyncIterableIterator { + for await (const page of this.listByGalleryPagingPage( + resourceGroupName, + devCenterName, + galleryName, + options + )) { + yield* page; + } + } + + /** + * Lists images for a devcenter. + * @param resourceGroupName Name of the resource group within the Azure subscription. + * @param devCenterName The name of the devcenter. + * @param options The options parameters. + */ + private _listByDevCenter( + resourceGroupName: string, + devCenterName: string, + options?: ImagesListByDevCenterOptionalParams + ): Promise { + return this.client.sendOperationRequest( + { resourceGroupName, devCenterName, options }, + listByDevCenterOperationSpec + ); + } + + /** + * Lists images for a gallery. + * @param resourceGroupName Name of the resource group within the Azure subscription. + * @param devCenterName The name of the devcenter. + * @param galleryName The name of the gallery. + * @param options The options parameters. + */ + private _listByGallery( + resourceGroupName: string, + devCenterName: string, + galleryName: string, + options?: ImagesListByGalleryOptionalParams + ): Promise { + return this.client.sendOperationRequest( + { resourceGroupName, devCenterName, galleryName, options }, + listByGalleryOperationSpec + ); + } + + /** + * Gets a gallery image. + * @param resourceGroupName Name of the resource group within the Azure subscription. + * @param devCenterName The name of the devcenter. + * @param galleryName The name of the gallery. + * @param imageName The name of the image. + * @param options The options parameters. + */ + get( + resourceGroupName: string, + devCenterName: string, + galleryName: string, + imageName: string, + options?: ImagesGetOptionalParams + ): Promise { + return this.client.sendOperationRequest( + { resourceGroupName, devCenterName, galleryName, imageName, options }, + getOperationSpec + ); + } + + /** + * ListByDevCenterNext + * @param resourceGroupName Name of the resource group within the Azure subscription. + * @param devCenterName The name of the devcenter. + * @param nextLink The nextLink from the previous successful call to the ListByDevCenter method. + * @param options The options parameters. + */ + private _listByDevCenterNext( + resourceGroupName: string, + devCenterName: string, + nextLink: string, + options?: ImagesListByDevCenterNextOptionalParams + ): Promise { + return this.client.sendOperationRequest( + { resourceGroupName, devCenterName, nextLink, options }, + listByDevCenterNextOperationSpec + ); + } + + /** + * ListByGalleryNext + * @param resourceGroupName Name of the resource group within the Azure subscription. + * @param devCenterName The name of the devcenter. + * @param galleryName The name of the gallery. + * @param nextLink The nextLink from the previous successful call to the ListByGallery method. + * @param options The options parameters. + */ + private _listByGalleryNext( + resourceGroupName: string, + devCenterName: string, + galleryName: string, + nextLink: string, + options?: ImagesListByGalleryNextOptionalParams + ): Promise { + return this.client.sendOperationRequest( + { resourceGroupName, devCenterName, galleryName, nextLink, options }, + listByGalleryNextOperationSpec + ); + } +} +// Operation Specifications +const serializer = coreClient.createSerializer(Mappers, /* isXml */ false); + +const listByDevCenterOperationSpec: coreClient.OperationSpec = { + path: + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DevCenter/devcenters/{devCenterName}/images", + httpMethod: "GET", + responses: { + 200: { + bodyMapper: Mappers.ImageListResult + }, + default: { + bodyMapper: Mappers.CloudError + } + }, + queryParameters: [Parameters.apiVersion, Parameters.top], + urlParameters: [ + Parameters.$host, + Parameters.subscriptionId, + Parameters.resourceGroupName, + Parameters.devCenterName + ], + headerParameters: [Parameters.accept], + serializer +}; +const listByGalleryOperationSpec: coreClient.OperationSpec = { + path: + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DevCenter/devcenters/{devCenterName}/galleries/{galleryName}/images", + httpMethod: "GET", + responses: { + 200: { + bodyMapper: Mappers.ImageListResult + }, + default: { + bodyMapper: Mappers.CloudError + } + }, + queryParameters: [Parameters.apiVersion, Parameters.top], + urlParameters: [ + Parameters.$host, + Parameters.subscriptionId, + Parameters.resourceGroupName, + Parameters.devCenterName, + Parameters.galleryName + ], + headerParameters: [Parameters.accept], + serializer +}; +const getOperationSpec: coreClient.OperationSpec = { + path: + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DevCenter/devcenters/{devCenterName}/galleries/{galleryName}/images/{imageName}", + httpMethod: "GET", + responses: { + 200: { + bodyMapper: Mappers.Image + }, + default: { + bodyMapper: Mappers.CloudError + } + }, + queryParameters: [Parameters.apiVersion], + urlParameters: [ + Parameters.$host, + Parameters.subscriptionId, + Parameters.resourceGroupName, + Parameters.devCenterName, + Parameters.galleryName, + Parameters.imageName + ], + headerParameters: [Parameters.accept], + serializer +}; +const listByDevCenterNextOperationSpec: coreClient.OperationSpec = { + path: "{nextLink}", + httpMethod: "GET", + responses: { + 200: { + bodyMapper: Mappers.ImageListResult + }, + default: { + bodyMapper: Mappers.CloudError + } + }, + queryParameters: [Parameters.apiVersion, Parameters.top], + urlParameters: [ + Parameters.$host, + Parameters.subscriptionId, + Parameters.resourceGroupName, + Parameters.devCenterName, + Parameters.nextLink + ], + headerParameters: [Parameters.accept], + serializer +}; +const listByGalleryNextOperationSpec: coreClient.OperationSpec = { + path: "{nextLink}", + httpMethod: "GET", + responses: { + 200: { + bodyMapper: Mappers.ImageListResult + }, + default: { + bodyMapper: Mappers.CloudError + } + }, + queryParameters: [Parameters.apiVersion, Parameters.top], + urlParameters: [ + Parameters.$host, + Parameters.subscriptionId, + Parameters.resourceGroupName, + Parameters.devCenterName, + Parameters.nextLink, + Parameters.galleryName + ], + headerParameters: [Parameters.accept], + serializer +}; diff --git a/sdk/devcenter/arm-devcenter/src/operations/index.ts b/sdk/devcenter/arm-devcenter/src/operations/index.ts new file mode 100644 index 000000000000..769e93dedc14 --- /dev/null +++ b/sdk/devcenter/arm-devcenter/src/operations/index.ts @@ -0,0 +1,25 @@ +/* + * 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 "./devCenters"; +export * from "./projects"; +export * from "./attachedNetworks"; +export * from "./galleries"; +export * from "./images"; +export * from "./imageVersions"; +export * from "./catalogs"; +export * from "./environmentTypes"; +export * from "./projectEnvironmentTypes"; +export * from "./devBoxDefinitions"; +export * from "./operations"; +export * from "./operationStatuses"; +export * from "./usages"; +export * from "./skus"; +export * from "./pools"; +export * from "./schedules"; +export * from "./networkConnections"; diff --git a/sdk/devcenter/arm-devcenter/src/operations/networkConnections.ts b/sdk/devcenter/arm-devcenter/src/operations/networkConnections.ts new file mode 100644 index 000000000000..f5e83c342f5d --- /dev/null +++ b/sdk/devcenter/arm-devcenter/src/operations/networkConnections.ts @@ -0,0 +1,919 @@ +/* + * 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 { NetworkConnections } from "../operationsInterfaces"; +import * as coreClient from "@azure/core-client"; +import * as Mappers from "../models/mappers"; +import * as Parameters from "../models/parameters"; +import { DevCenterClient } from "../devCenterClient"; +import { PollerLike, PollOperationState, LroEngine } from "@azure/core-lro"; +import { LroImpl } from "../lroImpl"; +import { + NetworkConnection, + NetworkConnectionsListBySubscriptionNextOptionalParams, + NetworkConnectionsListBySubscriptionOptionalParams, + NetworkConnectionsListByResourceGroupNextOptionalParams, + NetworkConnectionsListByResourceGroupOptionalParams, + HealthCheckStatusDetails, + NetworkConnectionsListHealthDetailsNextOptionalParams, + NetworkConnectionsListHealthDetailsOptionalParams, + NetworkConnectionsListBySubscriptionResponse, + NetworkConnectionsListByResourceGroupResponse, + NetworkConnectionsGetOptionalParams, + NetworkConnectionsGetResponse, + NetworkConnectionsCreateOrUpdateOptionalParams, + NetworkConnectionsCreateOrUpdateResponse, + NetworkConnectionUpdate, + NetworkConnectionsUpdateOptionalParams, + NetworkConnectionsUpdateResponse, + NetworkConnectionsDeleteOptionalParams, + NetworkConnectionsListHealthDetailsResponse, + NetworkConnectionsGetHealthDetailsOptionalParams, + NetworkConnectionsGetHealthDetailsResponse, + NetworkConnectionsRunHealthChecksOptionalParams, + NetworkConnectionsListBySubscriptionNextResponse, + NetworkConnectionsListByResourceGroupNextResponse, + NetworkConnectionsListHealthDetailsNextResponse +} from "../models"; + +/// +/** Class containing NetworkConnections operations. */ +export class NetworkConnectionsImpl implements NetworkConnections { + private readonly client: DevCenterClient; + + /** + * Initialize a new instance of the class NetworkConnections class. + * @param client Reference to the service client + */ + constructor(client: DevCenterClient) { + this.client = client; + } + + /** + * Lists network connections in a subscription + * @param options The options parameters. + */ + public listBySubscription( + options?: NetworkConnectionsListBySubscriptionOptionalParams + ): PagedAsyncIterableIterator { + const iter = this.listBySubscriptionPagingAll(options); + return { + next() { + return iter.next(); + }, + [Symbol.asyncIterator]() { + return this; + }, + byPage: () => { + return this.listBySubscriptionPagingPage(options); + } + }; + } + + private async *listBySubscriptionPagingPage( + options?: NetworkConnectionsListBySubscriptionOptionalParams + ): 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?: NetworkConnectionsListBySubscriptionOptionalParams + ): AsyncIterableIterator { + for await (const page of this.listBySubscriptionPagingPage(options)) { + yield* page; + } + } + + /** + * Lists network connections in a resource group + * @param resourceGroupName Name of the resource group within the Azure subscription. + * @param options The options parameters. + */ + public listByResourceGroup( + resourceGroupName: string, + options?: NetworkConnectionsListByResourceGroupOptionalParams + ): 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?: NetworkConnectionsListByResourceGroupOptionalParams + ): 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?: NetworkConnectionsListByResourceGroupOptionalParams + ): AsyncIterableIterator { + for await (const page of this.listByResourceGroupPagingPage( + resourceGroupName, + options + )) { + yield* page; + } + } + + /** + * Lists health check status details + * @param resourceGroupName Name of the resource group within the Azure subscription. + * @param networkConnectionName Name of the Network Connection that can be applied to a Pool. + * @param options The options parameters. + */ + public listHealthDetails( + resourceGroupName: string, + networkConnectionName: string, + options?: NetworkConnectionsListHealthDetailsOptionalParams + ): PagedAsyncIterableIterator { + const iter = this.listHealthDetailsPagingAll( + resourceGroupName, + networkConnectionName, + options + ); + return { + next() { + return iter.next(); + }, + [Symbol.asyncIterator]() { + return this; + }, + byPage: () => { + return this.listHealthDetailsPagingPage( + resourceGroupName, + networkConnectionName, + options + ); + } + }; + } + + private async *listHealthDetailsPagingPage( + resourceGroupName: string, + networkConnectionName: string, + options?: NetworkConnectionsListHealthDetailsOptionalParams + ): AsyncIterableIterator { + let result = await this._listHealthDetails( + resourceGroupName, + networkConnectionName, + options + ); + yield result.value || []; + let continuationToken = result.nextLink; + while (continuationToken) { + result = await this._listHealthDetailsNext( + resourceGroupName, + networkConnectionName, + continuationToken, + options + ); + continuationToken = result.nextLink; + yield result.value || []; + } + } + + private async *listHealthDetailsPagingAll( + resourceGroupName: string, + networkConnectionName: string, + options?: NetworkConnectionsListHealthDetailsOptionalParams + ): AsyncIterableIterator { + for await (const page of this.listHealthDetailsPagingPage( + resourceGroupName, + networkConnectionName, + options + )) { + yield* page; + } + } + + /** + * Lists network connections in a subscription + * @param options The options parameters. + */ + private _listBySubscription( + options?: NetworkConnectionsListBySubscriptionOptionalParams + ): Promise { + return this.client.sendOperationRequest( + { options }, + listBySubscriptionOperationSpec + ); + } + + /** + * Lists network connections in a resource group + * @param resourceGroupName Name of the resource group within the Azure subscription. + * @param options The options parameters. + */ + private _listByResourceGroup( + resourceGroupName: string, + options?: NetworkConnectionsListByResourceGroupOptionalParams + ): Promise { + return this.client.sendOperationRequest( + { resourceGroupName, options }, + listByResourceGroupOperationSpec + ); + } + + /** + * Gets a network connection resource + * @param resourceGroupName Name of the resource group within the Azure subscription. + * @param networkConnectionName Name of the Network Connection that can be applied to a Pool. + * @param options The options parameters. + */ + get( + resourceGroupName: string, + networkConnectionName: string, + options?: NetworkConnectionsGetOptionalParams + ): Promise { + return this.client.sendOperationRequest( + { resourceGroupName, networkConnectionName, options }, + getOperationSpec + ); + } + + /** + * Creates or updates a Network Connections resource + * @param resourceGroupName Name of the resource group within the Azure subscription. + * @param networkConnectionName Name of the Network Connection that can be applied to a Pool. + * @param body Represents network connection + * @param options The options parameters. + */ + async beginCreateOrUpdate( + resourceGroupName: string, + networkConnectionName: string, + body: NetworkConnection, + options?: NetworkConnectionsCreateOrUpdateOptionalParams + ): Promise< + PollerLike< + PollOperationState, + NetworkConnectionsCreateOrUpdateResponse + > + > { + 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, networkConnectionName, body, options }, + createOrUpdateOperationSpec + ); + const poller = new LroEngine(lro, { + resumeFrom: options?.resumeFrom, + intervalInMs: options?.updateIntervalInMs, + lroResourceLocationConfig: "azure-async-operation" + }); + await poller.poll(); + return poller; + } + + /** + * Creates or updates a Network Connections resource + * @param resourceGroupName Name of the resource group within the Azure subscription. + * @param networkConnectionName Name of the Network Connection that can be applied to a Pool. + * @param body Represents network connection + * @param options The options parameters. + */ + async beginCreateOrUpdateAndWait( + resourceGroupName: string, + networkConnectionName: string, + body: NetworkConnection, + options?: NetworkConnectionsCreateOrUpdateOptionalParams + ): Promise { + const poller = await this.beginCreateOrUpdate( + resourceGroupName, + networkConnectionName, + body, + options + ); + return poller.pollUntilDone(); + } + + /** + * Partially updates a Network Connection + * @param resourceGroupName Name of the resource group within the Azure subscription. + * @param networkConnectionName Name of the Network Connection that can be applied to a Pool. + * @param body Represents network connection + * @param options The options parameters. + */ + async beginUpdate( + resourceGroupName: string, + networkConnectionName: string, + body: NetworkConnectionUpdate, + options?: NetworkConnectionsUpdateOptionalParams + ): Promise< + PollerLike< + PollOperationState, + NetworkConnectionsUpdateResponse + > + > { + 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, networkConnectionName, body, options }, + updateOperationSpec + ); + const poller = new LroEngine(lro, { + resumeFrom: options?.resumeFrom, + intervalInMs: options?.updateIntervalInMs, + lroResourceLocationConfig: "azure-async-operation" + }); + await poller.poll(); + return poller; + } + + /** + * Partially updates a Network Connection + * @param resourceGroupName Name of the resource group within the Azure subscription. + * @param networkConnectionName Name of the Network Connection that can be applied to a Pool. + * @param body Represents network connection + * @param options The options parameters. + */ + async beginUpdateAndWait( + resourceGroupName: string, + networkConnectionName: string, + body: NetworkConnectionUpdate, + options?: NetworkConnectionsUpdateOptionalParams + ): Promise { + const poller = await this.beginUpdate( + resourceGroupName, + networkConnectionName, + body, + options + ); + return poller.pollUntilDone(); + } + + /** + * Deletes a Network Connections resource + * @param resourceGroupName Name of the resource group within the Azure subscription. + * @param networkConnectionName Name of the Network Connection that can be applied to a Pool. + * @param options The options parameters. + */ + async beginDelete( + resourceGroupName: string, + networkConnectionName: string, + options?: NetworkConnectionsDeleteOptionalParams + ): 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, networkConnectionName, options }, + deleteOperationSpec + ); + const poller = new LroEngine(lro, { + resumeFrom: options?.resumeFrom, + intervalInMs: options?.updateIntervalInMs, + lroResourceLocationConfig: "azure-async-operation" + }); + await poller.poll(); + return poller; + } + + /** + * Deletes a Network Connections resource + * @param resourceGroupName Name of the resource group within the Azure subscription. + * @param networkConnectionName Name of the Network Connection that can be applied to a Pool. + * @param options The options parameters. + */ + async beginDeleteAndWait( + resourceGroupName: string, + networkConnectionName: string, + options?: NetworkConnectionsDeleteOptionalParams + ): Promise { + const poller = await this.beginDelete( + resourceGroupName, + networkConnectionName, + options + ); + return poller.pollUntilDone(); + } + + /** + * Lists health check status details + * @param resourceGroupName Name of the resource group within the Azure subscription. + * @param networkConnectionName Name of the Network Connection that can be applied to a Pool. + * @param options The options parameters. + */ + private _listHealthDetails( + resourceGroupName: string, + networkConnectionName: string, + options?: NetworkConnectionsListHealthDetailsOptionalParams + ): Promise { + return this.client.sendOperationRequest( + { resourceGroupName, networkConnectionName, options }, + listHealthDetailsOperationSpec + ); + } + + /** + * Gets health check status details. + * @param resourceGroupName Name of the resource group within the Azure subscription. + * @param networkConnectionName Name of the Network Connection that can be applied to a Pool. + * @param options The options parameters. + */ + getHealthDetails( + resourceGroupName: string, + networkConnectionName: string, + options?: NetworkConnectionsGetHealthDetailsOptionalParams + ): Promise { + return this.client.sendOperationRequest( + { resourceGroupName, networkConnectionName, options }, + getHealthDetailsOperationSpec + ); + } + + /** + * Triggers a new health check run. The execution and health check result can be tracked via the + * network Connection health check details + * @param resourceGroupName Name of the resource group within the Azure subscription. + * @param networkConnectionName Name of the Network Connection that can be applied to a Pool. + * @param options The options parameters. + */ + runHealthChecks( + resourceGroupName: string, + networkConnectionName: string, + options?: NetworkConnectionsRunHealthChecksOptionalParams + ): Promise { + return this.client.sendOperationRequest( + { resourceGroupName, networkConnectionName, options }, + runHealthChecksOperationSpec + ); + } + + /** + * ListBySubscriptionNext + * @param nextLink The nextLink from the previous successful call to the ListBySubscription method. + * @param options The options parameters. + */ + private _listBySubscriptionNext( + nextLink: string, + options?: NetworkConnectionsListBySubscriptionNextOptionalParams + ): Promise { + return this.client.sendOperationRequest( + { nextLink, options }, + listBySubscriptionNextOperationSpec + ); + } + + /** + * ListByResourceGroupNext + * @param resourceGroupName Name of the resource group within the Azure subscription. + * @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?: NetworkConnectionsListByResourceGroupNextOptionalParams + ): Promise { + return this.client.sendOperationRequest( + { resourceGroupName, nextLink, options }, + listByResourceGroupNextOperationSpec + ); + } + + /** + * ListHealthDetailsNext + * @param resourceGroupName Name of the resource group within the Azure subscription. + * @param networkConnectionName Name of the Network Connection that can be applied to a Pool. + * @param nextLink The nextLink from the previous successful call to the ListHealthDetails method. + * @param options The options parameters. + */ + private _listHealthDetailsNext( + resourceGroupName: string, + networkConnectionName: string, + nextLink: string, + options?: NetworkConnectionsListHealthDetailsNextOptionalParams + ): Promise { + return this.client.sendOperationRequest( + { resourceGroupName, networkConnectionName, nextLink, options }, + listHealthDetailsNextOperationSpec + ); + } +} +// Operation Specifications +const serializer = coreClient.createSerializer(Mappers, /* isXml */ false); + +const listBySubscriptionOperationSpec: coreClient.OperationSpec = { + path: + "/subscriptions/{subscriptionId}/providers/Microsoft.DevCenter/networkConnections", + httpMethod: "GET", + responses: { + 200: { + bodyMapper: Mappers.NetworkConnectionListResult + }, + default: { + bodyMapper: Mappers.CloudError + } + }, + queryParameters: [Parameters.apiVersion, Parameters.top], + urlParameters: [Parameters.$host, Parameters.subscriptionId], + headerParameters: [Parameters.accept], + serializer +}; +const listByResourceGroupOperationSpec: coreClient.OperationSpec = { + path: + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DevCenter/networkConnections", + httpMethod: "GET", + responses: { + 200: { + bodyMapper: Mappers.NetworkConnectionListResult + }, + default: { + bodyMapper: Mappers.CloudError + } + }, + queryParameters: [Parameters.apiVersion, Parameters.top], + urlParameters: [ + Parameters.$host, + Parameters.subscriptionId, + Parameters.resourceGroupName + ], + headerParameters: [Parameters.accept], + serializer +}; +const getOperationSpec: coreClient.OperationSpec = { + path: + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DevCenter/networkConnections/{networkConnectionName}", + httpMethod: "GET", + responses: { + 200: { + bodyMapper: Mappers.NetworkConnection + }, + default: { + bodyMapper: Mappers.CloudError + } + }, + queryParameters: [Parameters.apiVersion], + urlParameters: [ + Parameters.$host, + Parameters.subscriptionId, + Parameters.resourceGroupName, + Parameters.networkConnectionName + ], + headerParameters: [Parameters.accept], + serializer +}; +const createOrUpdateOperationSpec: coreClient.OperationSpec = { + path: + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DevCenter/networkConnections/{networkConnectionName}", + httpMethod: "PUT", + responses: { + 200: { + bodyMapper: Mappers.NetworkConnection + }, + 201: { + bodyMapper: Mappers.NetworkConnection + }, + 202: { + bodyMapper: Mappers.NetworkConnection + }, + 204: { + bodyMapper: Mappers.NetworkConnection + }, + default: { + bodyMapper: Mappers.CloudError + } + }, + requestBody: Parameters.body18, + queryParameters: [Parameters.apiVersion], + urlParameters: [ + Parameters.$host, + Parameters.subscriptionId, + Parameters.resourceGroupName, + Parameters.networkConnectionName + ], + headerParameters: [Parameters.accept, Parameters.contentType], + mediaType: "json", + serializer +}; +const updateOperationSpec: coreClient.OperationSpec = { + path: + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DevCenter/networkConnections/{networkConnectionName}", + httpMethod: "PATCH", + responses: { + 200: { + bodyMapper: Mappers.NetworkConnection + }, + 201: { + bodyMapper: Mappers.NetworkConnection + }, + 202: { + bodyMapper: Mappers.NetworkConnection + }, + 204: { + bodyMapper: Mappers.NetworkConnection + }, + default: { + bodyMapper: Mappers.CloudError + } + }, + requestBody: Parameters.body19, + queryParameters: [Parameters.apiVersion], + urlParameters: [ + Parameters.$host, + Parameters.subscriptionId, + Parameters.resourceGroupName, + Parameters.networkConnectionName + ], + headerParameters: [Parameters.accept, Parameters.contentType], + mediaType: "json", + serializer +}; +const deleteOperationSpec: coreClient.OperationSpec = { + path: + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DevCenter/networkConnections/{networkConnectionName}", + httpMethod: "DELETE", + responses: { + 200: {}, + 201: {}, + 202: {}, + 204: {}, + default: { + bodyMapper: Mappers.CloudError + } + }, + queryParameters: [Parameters.apiVersion], + urlParameters: [ + Parameters.$host, + Parameters.subscriptionId, + Parameters.resourceGroupName, + Parameters.networkConnectionName + ], + headerParameters: [Parameters.accept], + serializer +}; +const listHealthDetailsOperationSpec: coreClient.OperationSpec = { + path: + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DevCenter/networkConnections/{networkConnectionName}/healthChecks", + httpMethod: "GET", + responses: { + 200: { + bodyMapper: Mappers.HealthCheckStatusDetailsListResult + }, + default: { + bodyMapper: Mappers.CloudError + } + }, + queryParameters: [Parameters.apiVersion, Parameters.top], + urlParameters: [ + Parameters.$host, + Parameters.subscriptionId, + Parameters.resourceGroupName, + Parameters.networkConnectionName + ], + headerParameters: [Parameters.accept], + serializer +}; +const getHealthDetailsOperationSpec: coreClient.OperationSpec = { + path: + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DevCenter/networkConnections/{networkConnectionName}/healthChecks/latest", + httpMethod: "GET", + responses: { + 200: { + bodyMapper: Mappers.HealthCheckStatusDetails + }, + default: { + bodyMapper: Mappers.CloudError + } + }, + queryParameters: [Parameters.apiVersion], + urlParameters: [ + Parameters.$host, + Parameters.subscriptionId, + Parameters.resourceGroupName, + Parameters.networkConnectionName + ], + headerParameters: [Parameters.accept], + serializer +}; +const runHealthChecksOperationSpec: coreClient.OperationSpec = { + path: + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DevCenter/networkConnections/{networkConnectionName}/runHealthChecks", + httpMethod: "POST", + responses: { + 200: {}, + default: { + bodyMapper: Mappers.CloudError + } + }, + queryParameters: [Parameters.apiVersion], + urlParameters: [ + Parameters.$host, + Parameters.subscriptionId, + Parameters.resourceGroupName, + Parameters.networkConnectionName + ], + headerParameters: [Parameters.accept], + serializer +}; +const listBySubscriptionNextOperationSpec: coreClient.OperationSpec = { + path: "{nextLink}", + httpMethod: "GET", + responses: { + 200: { + bodyMapper: Mappers.NetworkConnectionListResult + }, + default: { + bodyMapper: Mappers.CloudError + } + }, + queryParameters: [Parameters.apiVersion, Parameters.top], + urlParameters: [ + Parameters.$host, + Parameters.subscriptionId, + Parameters.nextLink + ], + headerParameters: [Parameters.accept], + serializer +}; +const listByResourceGroupNextOperationSpec: coreClient.OperationSpec = { + path: "{nextLink}", + httpMethod: "GET", + responses: { + 200: { + bodyMapper: Mappers.NetworkConnectionListResult + }, + default: { + bodyMapper: Mappers.CloudError + } + }, + queryParameters: [Parameters.apiVersion, Parameters.top], + urlParameters: [ + Parameters.$host, + Parameters.subscriptionId, + Parameters.resourceGroupName, + Parameters.nextLink + ], + headerParameters: [Parameters.accept], + serializer +}; +const listHealthDetailsNextOperationSpec: coreClient.OperationSpec = { + path: "{nextLink}", + httpMethod: "GET", + responses: { + 200: { + bodyMapper: Mappers.HealthCheckStatusDetailsListResult + }, + default: { + bodyMapper: Mappers.CloudError + } + }, + queryParameters: [Parameters.apiVersion, Parameters.top], + urlParameters: [ + Parameters.$host, + Parameters.subscriptionId, + Parameters.resourceGroupName, + Parameters.nextLink, + Parameters.networkConnectionName + ], + headerParameters: [Parameters.accept], + serializer +}; diff --git a/sdk/devcenter/arm-devcenter/src/operations/operationStatuses.ts b/sdk/devcenter/arm-devcenter/src/operations/operationStatuses.ts new file mode 100644 index 000000000000..48af070684d4 --- /dev/null +++ b/sdk/devcenter/arm-devcenter/src/operations/operationStatuses.ts @@ -0,0 +1,75 @@ +/* + * 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 { OperationStatuses } from "../operationsInterfaces"; +import * as coreClient from "@azure/core-client"; +import * as Mappers from "../models/mappers"; +import * as Parameters from "../models/parameters"; +import { DevCenterClient } from "../devCenterClient"; +import { + OperationStatusesGetOptionalParams, + OperationStatusesGetResponse +} from "../models"; + +/** Class containing OperationStatuses operations. */ +export class OperationStatusesImpl implements OperationStatuses { + private readonly client: DevCenterClient; + + /** + * Initialize a new instance of the class OperationStatuses class. + * @param client Reference to the service client + */ + constructor(client: DevCenterClient) { + this.client = client; + } + + /** + * Gets the current status of an async operation. + * @param location The Azure region + * @param operationId The ID of an ongoing async operation + * @param options The options parameters. + */ + get( + location: string, + operationId: string, + options?: OperationStatusesGetOptionalParams + ): Promise { + return this.client.sendOperationRequest( + { location, operationId, options }, + getOperationSpec + ); + } +} +// Operation Specifications +const serializer = coreClient.createSerializer(Mappers, /* isXml */ false); + +const getOperationSpec: coreClient.OperationSpec = { + path: + "/subscriptions/{subscriptionId}/providers/Microsoft.DevCenter/locations/{location}/operationStatuses/{operationId}", + httpMethod: "GET", + responses: { + 200: { + bodyMapper: Mappers.OperationStatus + }, + 202: { + bodyMapper: Mappers.OperationStatus + }, + default: { + bodyMapper: Mappers.CloudError + } + }, + queryParameters: [Parameters.apiVersion], + urlParameters: [ + Parameters.$host, + Parameters.subscriptionId, + Parameters.location, + Parameters.operationId + ], + headerParameters: [Parameters.accept], + serializer +}; diff --git a/sdk/devcenter/arm-devcenter/src/operations/operations.ts b/sdk/devcenter/arm-devcenter/src/operations/operations.ts new file mode 100644 index 000000000000..6fa81a71aeed --- /dev/null +++ b/sdk/devcenter/arm-devcenter/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 { DevCenterClient } from "../devCenterClient"; +import { + Operation, + OperationsListNextOptionalParams, + OperationsListOptionalParams, + OperationsListResponse, + OperationsListNextResponse +} from "../models"; + +/// +/** Class containing Operations operations. */ +export class OperationsImpl implements Operations { + private readonly client: DevCenterClient; + + /** + * Initialize a new instance of the class Operations class. + * @param client Reference to the service client + */ + constructor(client: DevCenterClient) { + this.client = client; + } + + /** + * Lists all of the available resource provider operations. + * @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 resource provider operations. + * @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.DevCenter/operations", + httpMethod: "GET", + responses: { + 200: { + bodyMapper: Mappers.OperationListResult + }, + default: { + bodyMapper: Mappers.CloudError + } + }, + 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.CloudError + } + }, + queryParameters: [Parameters.apiVersion], + urlParameters: [Parameters.$host, Parameters.nextLink], + headerParameters: [Parameters.accept], + serializer +}; diff --git a/sdk/devcenter/arm-devcenter/src/operations/pools.ts b/sdk/devcenter/arm-devcenter/src/operations/pools.ts new file mode 100644 index 000000000000..98aad3d9e6a4 --- /dev/null +++ b/sdk/devcenter/arm-devcenter/src/operations/pools.ts @@ -0,0 +1,614 @@ +/* + * 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 { Pools } from "../operationsInterfaces"; +import * as coreClient from "@azure/core-client"; +import * as Mappers from "../models/mappers"; +import * as Parameters from "../models/parameters"; +import { DevCenterClient } from "../devCenterClient"; +import { PollerLike, PollOperationState, LroEngine } from "@azure/core-lro"; +import { LroImpl } from "../lroImpl"; +import { + Pool, + PoolsListByProjectNextOptionalParams, + PoolsListByProjectOptionalParams, + PoolsListByProjectResponse, + PoolsGetOptionalParams, + PoolsGetResponse, + PoolsCreateOrUpdateOptionalParams, + PoolsCreateOrUpdateResponse, + PoolUpdate, + PoolsUpdateOptionalParams, + PoolsUpdateResponse, + PoolsDeleteOptionalParams, + PoolsListByProjectNextResponse +} from "../models"; + +/// +/** Class containing Pools operations. */ +export class PoolsImpl implements Pools { + private readonly client: DevCenterClient; + + /** + * Initialize a new instance of the class Pools class. + * @param client Reference to the service client + */ + constructor(client: DevCenterClient) { + this.client = client; + } + + /** + * Lists pools for a project + * @param resourceGroupName Name of the resource group within the Azure subscription. + * @param projectName The name of the project. + * @param options The options parameters. + */ + public listByProject( + resourceGroupName: string, + projectName: string, + options?: PoolsListByProjectOptionalParams + ): PagedAsyncIterableIterator { + const iter = this.listByProjectPagingAll( + resourceGroupName, + projectName, + options + ); + return { + next() { + return iter.next(); + }, + [Symbol.asyncIterator]() { + return this; + }, + byPage: () => { + return this.listByProjectPagingPage( + resourceGroupName, + projectName, + options + ); + } + }; + } + + private async *listByProjectPagingPage( + resourceGroupName: string, + projectName: string, + options?: PoolsListByProjectOptionalParams + ): AsyncIterableIterator { + let result = await this._listByProject( + resourceGroupName, + projectName, + options + ); + yield result.value || []; + let continuationToken = result.nextLink; + while (continuationToken) { + result = await this._listByProjectNext( + resourceGroupName, + projectName, + continuationToken, + options + ); + continuationToken = result.nextLink; + yield result.value || []; + } + } + + private async *listByProjectPagingAll( + resourceGroupName: string, + projectName: string, + options?: PoolsListByProjectOptionalParams + ): AsyncIterableIterator { + for await (const page of this.listByProjectPagingPage( + resourceGroupName, + projectName, + options + )) { + yield* page; + } + } + + /** + * Lists pools for a project + * @param resourceGroupName Name of the resource group within the Azure subscription. + * @param projectName The name of the project. + * @param options The options parameters. + */ + private _listByProject( + resourceGroupName: string, + projectName: string, + options?: PoolsListByProjectOptionalParams + ): Promise { + return this.client.sendOperationRequest( + { resourceGroupName, projectName, options }, + listByProjectOperationSpec + ); + } + + /** + * Gets a machine pool + * @param resourceGroupName Name of the resource group within the Azure subscription. + * @param projectName The name of the project. + * @param poolName Name of the pool. + * @param options The options parameters. + */ + get( + resourceGroupName: string, + projectName: string, + poolName: string, + options?: PoolsGetOptionalParams + ): Promise { + return this.client.sendOperationRequest( + { resourceGroupName, projectName, poolName, options }, + getOperationSpec + ); + } + + /** + * Creates or updates a machine pool + * @param resourceGroupName Name of the resource group within the Azure subscription. + * @param projectName The name of the project. + * @param poolName Name of the pool. + * @param body Represents a machine pool + * @param options The options parameters. + */ + async beginCreateOrUpdate( + resourceGroupName: string, + projectName: string, + poolName: string, + body: Pool, + options?: PoolsCreateOrUpdateOptionalParams + ): Promise< + PollerLike< + PollOperationState, + PoolsCreateOrUpdateResponse + > + > { + 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, projectName, poolName, body, options }, + createOrUpdateOperationSpec + ); + const poller = new LroEngine(lro, { + resumeFrom: options?.resumeFrom, + intervalInMs: options?.updateIntervalInMs, + lroResourceLocationConfig: "azure-async-operation" + }); + await poller.poll(); + return poller; + } + + /** + * Creates or updates a machine pool + * @param resourceGroupName Name of the resource group within the Azure subscription. + * @param projectName The name of the project. + * @param poolName Name of the pool. + * @param body Represents a machine pool + * @param options The options parameters. + */ + async beginCreateOrUpdateAndWait( + resourceGroupName: string, + projectName: string, + poolName: string, + body: Pool, + options?: PoolsCreateOrUpdateOptionalParams + ): Promise { + const poller = await this.beginCreateOrUpdate( + resourceGroupName, + projectName, + poolName, + body, + options + ); + return poller.pollUntilDone(); + } + + /** + * Partially updates a machine pool + * @param resourceGroupName Name of the resource group within the Azure subscription. + * @param projectName The name of the project. + * @param poolName Name of the pool. + * @param body Represents a machine pool + * @param options The options parameters. + */ + async beginUpdate( + resourceGroupName: string, + projectName: string, + poolName: string, + body: PoolUpdate, + options?: PoolsUpdateOptionalParams + ): Promise< + PollerLike, PoolsUpdateResponse> + > { + 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, projectName, poolName, body, options }, + updateOperationSpec + ); + const poller = new LroEngine(lro, { + resumeFrom: options?.resumeFrom, + intervalInMs: options?.updateIntervalInMs, + lroResourceLocationConfig: "azure-async-operation" + }); + await poller.poll(); + return poller; + } + + /** + * Partially updates a machine pool + * @param resourceGroupName Name of the resource group within the Azure subscription. + * @param projectName The name of the project. + * @param poolName Name of the pool. + * @param body Represents a machine pool + * @param options The options parameters. + */ + async beginUpdateAndWait( + resourceGroupName: string, + projectName: string, + poolName: string, + body: PoolUpdate, + options?: PoolsUpdateOptionalParams + ): Promise { + const poller = await this.beginUpdate( + resourceGroupName, + projectName, + poolName, + body, + options + ); + return poller.pollUntilDone(); + } + + /** + * Deletes a machine pool + * @param resourceGroupName Name of the resource group within the Azure subscription. + * @param projectName The name of the project. + * @param poolName Name of the pool. + * @param options The options parameters. + */ + async beginDelete( + resourceGroupName: string, + projectName: string, + poolName: string, + options?: PoolsDeleteOptionalParams + ): 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, projectName, poolName, options }, + deleteOperationSpec + ); + const poller = new LroEngine(lro, { + resumeFrom: options?.resumeFrom, + intervalInMs: options?.updateIntervalInMs, + lroResourceLocationConfig: "azure-async-operation" + }); + await poller.poll(); + return poller; + } + + /** + * Deletes a machine pool + * @param resourceGroupName Name of the resource group within the Azure subscription. + * @param projectName The name of the project. + * @param poolName Name of the pool. + * @param options The options parameters. + */ + async beginDeleteAndWait( + resourceGroupName: string, + projectName: string, + poolName: string, + options?: PoolsDeleteOptionalParams + ): Promise { + const poller = await this.beginDelete( + resourceGroupName, + projectName, + poolName, + options + ); + return poller.pollUntilDone(); + } + + /** + * ListByProjectNext + * @param resourceGroupName Name of the resource group within the Azure subscription. + * @param projectName The name of the project. + * @param nextLink The nextLink from the previous successful call to the ListByProject method. + * @param options The options parameters. + */ + private _listByProjectNext( + resourceGroupName: string, + projectName: string, + nextLink: string, + options?: PoolsListByProjectNextOptionalParams + ): Promise { + return this.client.sendOperationRequest( + { resourceGroupName, projectName, nextLink, options }, + listByProjectNextOperationSpec + ); + } +} +// Operation Specifications +const serializer = coreClient.createSerializer(Mappers, /* isXml */ false); + +const listByProjectOperationSpec: coreClient.OperationSpec = { + path: + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DevCenter/projects/{projectName}/pools", + httpMethod: "GET", + responses: { + 200: { + bodyMapper: Mappers.PoolListResult + }, + default: { + bodyMapper: Mappers.CloudError + } + }, + queryParameters: [Parameters.apiVersion, Parameters.top], + urlParameters: [ + Parameters.$host, + Parameters.subscriptionId, + Parameters.resourceGroupName, + Parameters.projectName + ], + headerParameters: [Parameters.accept], + serializer +}; +const getOperationSpec: coreClient.OperationSpec = { + path: + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DevCenter/projects/{projectName}/pools/{poolName}", + httpMethod: "GET", + responses: { + 200: { + bodyMapper: Mappers.Pool + }, + default: { + bodyMapper: Mappers.CloudError + } + }, + queryParameters: [Parameters.apiVersion], + urlParameters: [ + Parameters.$host, + Parameters.subscriptionId, + Parameters.resourceGroupName, + Parameters.projectName, + Parameters.poolName + ], + headerParameters: [Parameters.accept], + serializer +}; +const createOrUpdateOperationSpec: coreClient.OperationSpec = { + path: + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DevCenter/projects/{projectName}/pools/{poolName}", + httpMethod: "PUT", + responses: { + 200: { + bodyMapper: Mappers.Pool + }, + 201: { + bodyMapper: Mappers.Pool + }, + 202: { + bodyMapper: Mappers.Pool + }, + 204: { + bodyMapper: Mappers.Pool + }, + default: { + bodyMapper: Mappers.CloudError + } + }, + requestBody: Parameters.body14, + queryParameters: [Parameters.apiVersion], + urlParameters: [ + Parameters.$host, + Parameters.subscriptionId, + Parameters.resourceGroupName, + Parameters.projectName, + Parameters.poolName + ], + headerParameters: [Parameters.accept, Parameters.contentType], + mediaType: "json", + serializer +}; +const updateOperationSpec: coreClient.OperationSpec = { + path: + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DevCenter/projects/{projectName}/pools/{poolName}", + httpMethod: "PATCH", + responses: { + 200: { + bodyMapper: Mappers.Pool + }, + 201: { + bodyMapper: Mappers.Pool + }, + 202: { + bodyMapper: Mappers.Pool + }, + 204: { + bodyMapper: Mappers.Pool + }, + default: { + bodyMapper: Mappers.CloudError + } + }, + requestBody: Parameters.body15, + queryParameters: [Parameters.apiVersion], + urlParameters: [ + Parameters.$host, + Parameters.subscriptionId, + Parameters.resourceGroupName, + Parameters.projectName, + Parameters.poolName + ], + headerParameters: [Parameters.accept, Parameters.contentType], + mediaType: "json", + serializer +}; +const deleteOperationSpec: coreClient.OperationSpec = { + path: + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DevCenter/projects/{projectName}/pools/{poolName}", + httpMethod: "DELETE", + responses: { + 200: {}, + 201: {}, + 202: {}, + 204: {}, + default: { + bodyMapper: Mappers.CloudError + } + }, + queryParameters: [Parameters.apiVersion], + urlParameters: [ + Parameters.$host, + Parameters.subscriptionId, + Parameters.resourceGroupName, + Parameters.projectName, + Parameters.poolName + ], + headerParameters: [Parameters.accept], + serializer +}; +const listByProjectNextOperationSpec: coreClient.OperationSpec = { + path: "{nextLink}", + httpMethod: "GET", + responses: { + 200: { + bodyMapper: Mappers.PoolListResult + }, + default: { + bodyMapper: Mappers.CloudError + } + }, + queryParameters: [Parameters.apiVersion, Parameters.top], + urlParameters: [ + Parameters.$host, + Parameters.subscriptionId, + Parameters.resourceGroupName, + Parameters.nextLink, + Parameters.projectName + ], + headerParameters: [Parameters.accept], + serializer +}; diff --git a/sdk/devcenter/arm-devcenter/src/operations/projectEnvironmentTypes.ts b/sdk/devcenter/arm-devcenter/src/operations/projectEnvironmentTypes.ts new file mode 100644 index 000000000000..3236647c67e0 --- /dev/null +++ b/sdk/devcenter/arm-devcenter/src/operations/projectEnvironmentTypes.ts @@ -0,0 +1,360 @@ +/* + * 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 { ProjectEnvironmentTypes } from "../operationsInterfaces"; +import * as coreClient from "@azure/core-client"; +import * as Mappers from "../models/mappers"; +import * as Parameters from "../models/parameters"; +import { DevCenterClient } from "../devCenterClient"; +import { + ProjectEnvironmentType, + ProjectEnvironmentTypesListNextOptionalParams, + ProjectEnvironmentTypesListOptionalParams, + ProjectEnvironmentTypesListResponse, + ProjectEnvironmentTypesGetOptionalParams, + ProjectEnvironmentTypesGetResponse, + ProjectEnvironmentTypesCreateOrUpdateOptionalParams, + ProjectEnvironmentTypesCreateOrUpdateResponse, + ProjectEnvironmentTypeUpdate, + ProjectEnvironmentTypesUpdateOptionalParams, + ProjectEnvironmentTypesUpdateResponse, + ProjectEnvironmentTypesDeleteOptionalParams, + ProjectEnvironmentTypesListNextResponse +} from "../models"; + +/// +/** Class containing ProjectEnvironmentTypes operations. */ +export class ProjectEnvironmentTypesImpl implements ProjectEnvironmentTypes { + private readonly client: DevCenterClient; + + /** + * Initialize a new instance of the class ProjectEnvironmentTypes class. + * @param client Reference to the service client + */ + constructor(client: DevCenterClient) { + this.client = client; + } + + /** + * Lists environment types for a project. + * @param resourceGroupName Name of the resource group within the Azure subscription. + * @param projectName The name of the project. + * @param options The options parameters. + */ + public list( + resourceGroupName: string, + projectName: string, + options?: ProjectEnvironmentTypesListOptionalParams + ): PagedAsyncIterableIterator { + const iter = this.listPagingAll(resourceGroupName, projectName, options); + return { + next() { + return iter.next(); + }, + [Symbol.asyncIterator]() { + return this; + }, + byPage: () => { + return this.listPagingPage(resourceGroupName, projectName, options); + } + }; + } + + private async *listPagingPage( + resourceGroupName: string, + projectName: string, + options?: ProjectEnvironmentTypesListOptionalParams + ): AsyncIterableIterator { + let result = await this._list(resourceGroupName, projectName, options); + yield result.value || []; + let continuationToken = result.nextLink; + while (continuationToken) { + result = await this._listNext( + resourceGroupName, + projectName, + continuationToken, + options + ); + continuationToken = result.nextLink; + yield result.value || []; + } + } + + private async *listPagingAll( + resourceGroupName: string, + projectName: string, + options?: ProjectEnvironmentTypesListOptionalParams + ): AsyncIterableIterator { + for await (const page of this.listPagingPage( + resourceGroupName, + projectName, + options + )) { + yield* page; + } + } + + /** + * Lists environment types for a project. + * @param resourceGroupName Name of the resource group within the Azure subscription. + * @param projectName The name of the project. + * @param options The options parameters. + */ + private _list( + resourceGroupName: string, + projectName: string, + options?: ProjectEnvironmentTypesListOptionalParams + ): Promise { + return this.client.sendOperationRequest( + { resourceGroupName, projectName, options }, + listOperationSpec + ); + } + + /** + * Gets a project environment type. + * @param resourceGroupName Name of the resource group within the Azure subscription. + * @param projectName The name of the project. + * @param environmentTypeName The name of the environment type. + * @param options The options parameters. + */ + get( + resourceGroupName: string, + projectName: string, + environmentTypeName: string, + options?: ProjectEnvironmentTypesGetOptionalParams + ): Promise { + return this.client.sendOperationRequest( + { resourceGroupName, projectName, environmentTypeName, options }, + getOperationSpec + ); + } + + /** + * Creates or updates a project environment type. + * @param resourceGroupName Name of the resource group within the Azure subscription. + * @param projectName The name of the project. + * @param environmentTypeName The name of the environment type. + * @param body Represents a Project Environment Type. + * @param options The options parameters. + */ + createOrUpdate( + resourceGroupName: string, + projectName: string, + environmentTypeName: string, + body: ProjectEnvironmentType, + options?: ProjectEnvironmentTypesCreateOrUpdateOptionalParams + ): Promise { + return this.client.sendOperationRequest( + { resourceGroupName, projectName, environmentTypeName, body, options }, + createOrUpdateOperationSpec + ); + } + + /** + * Partially updates a project environment type. + * @param resourceGroupName Name of the resource group within the Azure subscription. + * @param projectName The name of the project. + * @param environmentTypeName The name of the environment type. + * @param body Updatable project environment type properties. + * @param options The options parameters. + */ + update( + resourceGroupName: string, + projectName: string, + environmentTypeName: string, + body: ProjectEnvironmentTypeUpdate, + options?: ProjectEnvironmentTypesUpdateOptionalParams + ): Promise { + return this.client.sendOperationRequest( + { resourceGroupName, projectName, environmentTypeName, body, options }, + updateOperationSpec + ); + } + + /** + * Deletes a project environment type. + * @param resourceGroupName Name of the resource group within the Azure subscription. + * @param projectName The name of the project. + * @param environmentTypeName The name of the environment type. + * @param options The options parameters. + */ + delete( + resourceGroupName: string, + projectName: string, + environmentTypeName: string, + options?: ProjectEnvironmentTypesDeleteOptionalParams + ): Promise { + return this.client.sendOperationRequest( + { resourceGroupName, projectName, environmentTypeName, options }, + deleteOperationSpec + ); + } + + /** + * ListNext + * @param resourceGroupName Name of the resource group within the Azure subscription. + * @param projectName The name of the project. + * @param nextLink The nextLink from the previous successful call to the List method. + * @param options The options parameters. + */ + private _listNext( + resourceGroupName: string, + projectName: string, + nextLink: string, + options?: ProjectEnvironmentTypesListNextOptionalParams + ): Promise { + return this.client.sendOperationRequest( + { resourceGroupName, projectName, nextLink, options }, + listNextOperationSpec + ); + } +} +// Operation Specifications +const serializer = coreClient.createSerializer(Mappers, /* isXml */ false); + +const listOperationSpec: coreClient.OperationSpec = { + path: + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DevCenter/projects/{projectName}/environmentTypes", + httpMethod: "GET", + responses: { + 200: { + bodyMapper: Mappers.ProjectEnvironmentTypeListResult + }, + default: { + bodyMapper: Mappers.CloudError + } + }, + queryParameters: [Parameters.apiVersion, Parameters.top], + urlParameters: [ + Parameters.$host, + Parameters.subscriptionId, + Parameters.resourceGroupName, + Parameters.projectName + ], + headerParameters: [Parameters.accept], + serializer +}; +const getOperationSpec: coreClient.OperationSpec = { + path: + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DevCenter/projects/{projectName}/environmentTypes/{environmentTypeName}", + httpMethod: "GET", + responses: { + 200: { + bodyMapper: Mappers.ProjectEnvironmentType + }, + default: { + bodyMapper: Mappers.CloudError + } + }, + queryParameters: [Parameters.apiVersion], + urlParameters: [ + Parameters.$host, + Parameters.subscriptionId, + Parameters.resourceGroupName, + Parameters.projectName, + Parameters.environmentTypeName + ], + headerParameters: [Parameters.accept], + serializer +}; +const createOrUpdateOperationSpec: coreClient.OperationSpec = { + path: + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DevCenter/projects/{projectName}/environmentTypes/{environmentTypeName}", + httpMethod: "PUT", + responses: { + 200: { + bodyMapper: Mappers.ProjectEnvironmentType + }, + default: { + bodyMapper: Mappers.CloudError + } + }, + requestBody: Parameters.body10, + queryParameters: [Parameters.apiVersion], + urlParameters: [ + Parameters.$host, + Parameters.subscriptionId, + Parameters.resourceGroupName, + Parameters.projectName, + Parameters.environmentTypeName + ], + headerParameters: [Parameters.accept, Parameters.contentType], + mediaType: "json", + serializer +}; +const updateOperationSpec: coreClient.OperationSpec = { + path: + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DevCenter/projects/{projectName}/environmentTypes/{environmentTypeName}", + httpMethod: "PATCH", + responses: { + 200: { + bodyMapper: Mappers.ProjectEnvironmentType + }, + default: { + bodyMapper: Mappers.CloudError + } + }, + requestBody: Parameters.body11, + queryParameters: [Parameters.apiVersion], + urlParameters: [ + Parameters.$host, + Parameters.subscriptionId, + Parameters.resourceGroupName, + Parameters.projectName, + Parameters.environmentTypeName + ], + headerParameters: [Parameters.accept, Parameters.contentType], + mediaType: "json", + serializer +}; +const deleteOperationSpec: coreClient.OperationSpec = { + path: + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DevCenter/projects/{projectName}/environmentTypes/{environmentTypeName}", + httpMethod: "DELETE", + responses: { + 200: {}, + 204: {}, + default: { + bodyMapper: Mappers.CloudError + } + }, + queryParameters: [Parameters.apiVersion], + urlParameters: [ + Parameters.$host, + Parameters.subscriptionId, + Parameters.resourceGroupName, + Parameters.projectName, + Parameters.environmentTypeName + ], + headerParameters: [Parameters.accept], + serializer +}; +const listNextOperationSpec: coreClient.OperationSpec = { + path: "{nextLink}", + httpMethod: "GET", + responses: { + 200: { + bodyMapper: Mappers.ProjectEnvironmentTypeListResult + }, + default: { + bodyMapper: Mappers.CloudError + } + }, + queryParameters: [Parameters.apiVersion, Parameters.top], + urlParameters: [ + Parameters.$host, + Parameters.subscriptionId, + Parameters.resourceGroupName, + Parameters.nextLink, + Parameters.projectName + ], + headerParameters: [Parameters.accept], + serializer +}; diff --git a/sdk/devcenter/arm-devcenter/src/operations/projects.ts b/sdk/devcenter/arm-devcenter/src/operations/projects.ts new file mode 100644 index 000000000000..4a867bdc27e1 --- /dev/null +++ b/sdk/devcenter/arm-devcenter/src/operations/projects.ts @@ -0,0 +1,683 @@ +/* + * 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 { Projects } from "../operationsInterfaces"; +import * as coreClient from "@azure/core-client"; +import * as Mappers from "../models/mappers"; +import * as Parameters from "../models/parameters"; +import { DevCenterClient } from "../devCenterClient"; +import { PollerLike, PollOperationState, LroEngine } from "@azure/core-lro"; +import { LroImpl } from "../lroImpl"; +import { + Project, + ProjectsListBySubscriptionNextOptionalParams, + ProjectsListBySubscriptionOptionalParams, + ProjectsListByResourceGroupNextOptionalParams, + ProjectsListByResourceGroupOptionalParams, + ProjectsListBySubscriptionResponse, + ProjectsListByResourceGroupResponse, + ProjectsGetOptionalParams, + ProjectsGetResponse, + ProjectsCreateOrUpdateOptionalParams, + ProjectsCreateOrUpdateResponse, + ProjectUpdate, + ProjectsUpdateOptionalParams, + ProjectsUpdateResponse, + ProjectsDeleteOptionalParams, + ProjectsListBySubscriptionNextResponse, + ProjectsListByResourceGroupNextResponse +} from "../models"; + +/// +/** Class containing Projects operations. */ +export class ProjectsImpl implements Projects { + private readonly client: DevCenterClient; + + /** + * Initialize a new instance of the class Projects class. + * @param client Reference to the service client + */ + constructor(client: DevCenterClient) { + this.client = client; + } + + /** + * Lists all projects in the subscription. + * @param options The options parameters. + */ + public listBySubscription( + options?: ProjectsListBySubscriptionOptionalParams + ): PagedAsyncIterableIterator { + const iter = this.listBySubscriptionPagingAll(options); + return { + next() { + return iter.next(); + }, + [Symbol.asyncIterator]() { + return this; + }, + byPage: () => { + return this.listBySubscriptionPagingPage(options); + } + }; + } + + private async *listBySubscriptionPagingPage( + options?: ProjectsListBySubscriptionOptionalParams + ): 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?: ProjectsListBySubscriptionOptionalParams + ): AsyncIterableIterator { + for await (const page of this.listBySubscriptionPagingPage(options)) { + yield* page; + } + } + + /** + * Lists all projects in the resource group. + * @param resourceGroupName Name of the resource group within the Azure subscription. + * @param options The options parameters. + */ + public listByResourceGroup( + resourceGroupName: string, + options?: ProjectsListByResourceGroupOptionalParams + ): 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?: ProjectsListByResourceGroupOptionalParams + ): 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?: ProjectsListByResourceGroupOptionalParams + ): AsyncIterableIterator { + for await (const page of this.listByResourceGroupPagingPage( + resourceGroupName, + options + )) { + yield* page; + } + } + + /** + * Lists all projects in the subscription. + * @param options The options parameters. + */ + private _listBySubscription( + options?: ProjectsListBySubscriptionOptionalParams + ): Promise { + return this.client.sendOperationRequest( + { options }, + listBySubscriptionOperationSpec + ); + } + + /** + * Lists all projects in the resource group. + * @param resourceGroupName Name of the resource group within the Azure subscription. + * @param options The options parameters. + */ + private _listByResourceGroup( + resourceGroupName: string, + options?: ProjectsListByResourceGroupOptionalParams + ): Promise { + return this.client.sendOperationRequest( + { resourceGroupName, options }, + listByResourceGroupOperationSpec + ); + } + + /** + * Gets a specific project. + * @param resourceGroupName Name of the resource group within the Azure subscription. + * @param projectName The name of the project. + * @param options The options parameters. + */ + get( + resourceGroupName: string, + projectName: string, + options?: ProjectsGetOptionalParams + ): Promise { + return this.client.sendOperationRequest( + { resourceGroupName, projectName, options }, + getOperationSpec + ); + } + + /** + * Creates or updates a project. + * @param resourceGroupName Name of the resource group within the Azure subscription. + * @param projectName The name of the project. + * @param body Represents a project. + * @param options The options parameters. + */ + async beginCreateOrUpdate( + resourceGroupName: string, + projectName: string, + body: Project, + options?: ProjectsCreateOrUpdateOptionalParams + ): Promise< + PollerLike< + PollOperationState, + ProjectsCreateOrUpdateResponse + > + > { + 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, projectName, body, options }, + createOrUpdateOperationSpec + ); + const poller = new LroEngine(lro, { + resumeFrom: options?.resumeFrom, + intervalInMs: options?.updateIntervalInMs, + lroResourceLocationConfig: "azure-async-operation" + }); + await poller.poll(); + return poller; + } + + /** + * Creates or updates a project. + * @param resourceGroupName Name of the resource group within the Azure subscription. + * @param projectName The name of the project. + * @param body Represents a project. + * @param options The options parameters. + */ + async beginCreateOrUpdateAndWait( + resourceGroupName: string, + projectName: string, + body: Project, + options?: ProjectsCreateOrUpdateOptionalParams + ): Promise { + const poller = await this.beginCreateOrUpdate( + resourceGroupName, + projectName, + body, + options + ); + return poller.pollUntilDone(); + } + + /** + * Partially updates a project. + * @param resourceGroupName Name of the resource group within the Azure subscription. + * @param projectName The name of the project. + * @param body Updatable project properties. + * @param options The options parameters. + */ + async beginUpdate( + resourceGroupName: string, + projectName: string, + body: ProjectUpdate, + options?: ProjectsUpdateOptionalParams + ): Promise< + PollerLike< + PollOperationState, + ProjectsUpdateResponse + > + > { + 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, projectName, body, options }, + updateOperationSpec + ); + const poller = new LroEngine(lro, { + resumeFrom: options?.resumeFrom, + intervalInMs: options?.updateIntervalInMs, + lroResourceLocationConfig: "azure-async-operation" + }); + await poller.poll(); + return poller; + } + + /** + * Partially updates a project. + * @param resourceGroupName Name of the resource group within the Azure subscription. + * @param projectName The name of the project. + * @param body Updatable project properties. + * @param options The options parameters. + */ + async beginUpdateAndWait( + resourceGroupName: string, + projectName: string, + body: ProjectUpdate, + options?: ProjectsUpdateOptionalParams + ): Promise { + const poller = await this.beginUpdate( + resourceGroupName, + projectName, + body, + options + ); + return poller.pollUntilDone(); + } + + /** + * Deletes a project resource. + * @param resourceGroupName Name of the resource group within the Azure subscription. + * @param projectName The name of the project. + * @param options The options parameters. + */ + async beginDelete( + resourceGroupName: string, + projectName: string, + options?: ProjectsDeleteOptionalParams + ): 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, projectName, options }, + deleteOperationSpec + ); + const poller = new LroEngine(lro, { + resumeFrom: options?.resumeFrom, + intervalInMs: options?.updateIntervalInMs, + lroResourceLocationConfig: "azure-async-operation" + }); + await poller.poll(); + return poller; + } + + /** + * Deletes a project resource. + * @param resourceGroupName Name of the resource group within the Azure subscription. + * @param projectName The name of the project. + * @param options The options parameters. + */ + async beginDeleteAndWait( + resourceGroupName: string, + projectName: string, + options?: ProjectsDeleteOptionalParams + ): Promise { + const poller = await this.beginDelete( + resourceGroupName, + projectName, + options + ); + return poller.pollUntilDone(); + } + + /** + * ListBySubscriptionNext + * @param nextLink The nextLink from the previous successful call to the ListBySubscription method. + * @param options The options parameters. + */ + private _listBySubscriptionNext( + nextLink: string, + options?: ProjectsListBySubscriptionNextOptionalParams + ): Promise { + return this.client.sendOperationRequest( + { nextLink, options }, + listBySubscriptionNextOperationSpec + ); + } + + /** + * ListByResourceGroupNext + * @param resourceGroupName Name of the resource group within the Azure subscription. + * @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?: ProjectsListByResourceGroupNextOptionalParams + ): 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.DevCenter/projects", + httpMethod: "GET", + responses: { + 200: { + bodyMapper: Mappers.ProjectListResult + }, + default: { + bodyMapper: Mappers.CloudError + } + }, + queryParameters: [Parameters.apiVersion, Parameters.top], + urlParameters: [Parameters.$host, Parameters.subscriptionId], + headerParameters: [Parameters.accept], + serializer +}; +const listByResourceGroupOperationSpec: coreClient.OperationSpec = { + path: + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DevCenter/projects", + httpMethod: "GET", + responses: { + 200: { + bodyMapper: Mappers.ProjectListResult + }, + default: { + bodyMapper: Mappers.CloudError + } + }, + queryParameters: [Parameters.apiVersion, Parameters.top], + urlParameters: [ + Parameters.$host, + Parameters.subscriptionId, + Parameters.resourceGroupName + ], + headerParameters: [Parameters.accept], + serializer +}; +const getOperationSpec: coreClient.OperationSpec = { + path: + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DevCenter/projects/{projectName}", + httpMethod: "GET", + responses: { + 200: { + bodyMapper: Mappers.Project + }, + default: { + bodyMapper: Mappers.CloudError + } + }, + queryParameters: [Parameters.apiVersion], + urlParameters: [ + Parameters.$host, + Parameters.subscriptionId, + Parameters.resourceGroupName, + Parameters.projectName + ], + headerParameters: [Parameters.accept], + serializer +}; +const createOrUpdateOperationSpec: coreClient.OperationSpec = { + path: + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DevCenter/projects/{projectName}", + httpMethod: "PUT", + responses: { + 200: { + bodyMapper: Mappers.Project + }, + 201: { + bodyMapper: Mappers.Project + }, + 202: { + bodyMapper: Mappers.Project + }, + 204: { + bodyMapper: Mappers.Project + }, + default: { + bodyMapper: Mappers.CloudError + } + }, + requestBody: Parameters.body2, + queryParameters: [Parameters.apiVersion], + urlParameters: [ + Parameters.$host, + Parameters.subscriptionId, + Parameters.resourceGroupName, + Parameters.projectName + ], + headerParameters: [Parameters.accept, Parameters.contentType], + mediaType: "json", + serializer +}; +const updateOperationSpec: coreClient.OperationSpec = { + path: + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DevCenter/projects/{projectName}", + httpMethod: "PATCH", + responses: { + 200: { + bodyMapper: Mappers.Project + }, + 201: { + bodyMapper: Mappers.Project + }, + 202: { + bodyMapper: Mappers.Project + }, + 204: { + bodyMapper: Mappers.Project + }, + default: { + bodyMapper: Mappers.CloudError + } + }, + requestBody: Parameters.body3, + queryParameters: [Parameters.apiVersion], + urlParameters: [ + Parameters.$host, + Parameters.subscriptionId, + Parameters.resourceGroupName, + Parameters.projectName + ], + headerParameters: [Parameters.accept, Parameters.contentType], + mediaType: "json", + serializer +}; +const deleteOperationSpec: coreClient.OperationSpec = { + path: + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DevCenter/projects/{projectName}", + httpMethod: "DELETE", + responses: { + 200: {}, + 201: {}, + 202: {}, + 204: {}, + default: { + bodyMapper: Mappers.CloudError + } + }, + queryParameters: [Parameters.apiVersion], + urlParameters: [ + Parameters.$host, + Parameters.subscriptionId, + Parameters.resourceGroupName, + Parameters.projectName + ], + headerParameters: [Parameters.accept], + serializer +}; +const listBySubscriptionNextOperationSpec: coreClient.OperationSpec = { + path: "{nextLink}", + httpMethod: "GET", + responses: { + 200: { + bodyMapper: Mappers.ProjectListResult + }, + default: { + bodyMapper: Mappers.CloudError + } + }, + queryParameters: [Parameters.apiVersion, Parameters.top], + urlParameters: [ + Parameters.$host, + Parameters.subscriptionId, + Parameters.nextLink + ], + headerParameters: [Parameters.accept], + serializer +}; +const listByResourceGroupNextOperationSpec: coreClient.OperationSpec = { + path: "{nextLink}", + httpMethod: "GET", + responses: { + 200: { + bodyMapper: Mappers.ProjectListResult + }, + default: { + bodyMapper: Mappers.CloudError + } + }, + queryParameters: [Parameters.apiVersion, Parameters.top], + urlParameters: [ + Parameters.$host, + Parameters.subscriptionId, + Parameters.resourceGroupName, + Parameters.nextLink + ], + headerParameters: [Parameters.accept], + serializer +}; diff --git a/sdk/devcenter/arm-devcenter/src/operations/schedules.ts b/sdk/devcenter/arm-devcenter/src/operations/schedules.ts new file mode 100644 index 000000000000..a018317edf9e --- /dev/null +++ b/sdk/devcenter/arm-devcenter/src/operations/schedules.ts @@ -0,0 +1,639 @@ +/* + * 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 { Schedules } from "../operationsInterfaces"; +import * as coreClient from "@azure/core-client"; +import * as Mappers from "../models/mappers"; +import * as Parameters from "../models/parameters"; +import { DevCenterClient } from "../devCenterClient"; +import { PollerLike, PollOperationState, LroEngine } from "@azure/core-lro"; +import { LroImpl } from "../lroImpl"; +import { + Schedule, + SchedulesListByPoolNextOptionalParams, + SchedulesListByPoolOptionalParams, + SchedulesListByPoolResponse, + SchedulesGetOptionalParams, + SchedulesGetResponse, + SchedulesCreateOrUpdateOptionalParams, + SchedulesCreateOrUpdateResponse, + ScheduleUpdate, + SchedulesUpdateOptionalParams, + SchedulesDeleteOptionalParams, + SchedulesListByPoolNextResponse +} from "../models"; + +/// +/** Class containing Schedules operations. */ +export class SchedulesImpl implements Schedules { + private readonly client: DevCenterClient; + + /** + * Initialize a new instance of the class Schedules class. + * @param client Reference to the service client + */ + constructor(client: DevCenterClient) { + this.client = client; + } + + /** + * Lists schedules for a pool + * @param resourceGroupName Name of the resource group within the Azure subscription. + * @param projectName The name of the project. + * @param poolName Name of the pool. + * @param options The options parameters. + */ + public listByPool( + resourceGroupName: string, + projectName: string, + poolName: string, + options?: SchedulesListByPoolOptionalParams + ): PagedAsyncIterableIterator { + const iter = this.listByPoolPagingAll( + resourceGroupName, + projectName, + poolName, + options + ); + return { + next() { + return iter.next(); + }, + [Symbol.asyncIterator]() { + return this; + }, + byPage: () => { + return this.listByPoolPagingPage( + resourceGroupName, + projectName, + poolName, + options + ); + } + }; + } + + private async *listByPoolPagingPage( + resourceGroupName: string, + projectName: string, + poolName: string, + options?: SchedulesListByPoolOptionalParams + ): AsyncIterableIterator { + let result = await this._listByPool( + resourceGroupName, + projectName, + poolName, + options + ); + yield result.value || []; + let continuationToken = result.nextLink; + while (continuationToken) { + result = await this._listByPoolNext( + resourceGroupName, + projectName, + poolName, + continuationToken, + options + ); + continuationToken = result.nextLink; + yield result.value || []; + } + } + + private async *listByPoolPagingAll( + resourceGroupName: string, + projectName: string, + poolName: string, + options?: SchedulesListByPoolOptionalParams + ): AsyncIterableIterator { + for await (const page of this.listByPoolPagingPage( + resourceGroupName, + projectName, + poolName, + options + )) { + yield* page; + } + } + + /** + * Lists schedules for a pool + * @param resourceGroupName Name of the resource group within the Azure subscription. + * @param projectName The name of the project. + * @param poolName Name of the pool. + * @param options The options parameters. + */ + private _listByPool( + resourceGroupName: string, + projectName: string, + poolName: string, + options?: SchedulesListByPoolOptionalParams + ): Promise { + return this.client.sendOperationRequest( + { resourceGroupName, projectName, poolName, options }, + listByPoolOperationSpec + ); + } + + /** + * Gets a schedule resource. + * @param resourceGroupName Name of the resource group within the Azure subscription. + * @param projectName The name of the project. + * @param poolName Name of the pool. + * @param scheduleName The name of the schedule that uniquely identifies it. + * @param options The options parameters. + */ + get( + resourceGroupName: string, + projectName: string, + poolName: string, + scheduleName: string, + options?: SchedulesGetOptionalParams + ): Promise { + return this.client.sendOperationRequest( + { resourceGroupName, projectName, poolName, scheduleName, options }, + getOperationSpec + ); + } + + /** + * Creates or updates a Schedule. + * @param resourceGroupName Name of the resource group within the Azure subscription. + * @param projectName The name of the project. + * @param poolName Name of the pool. + * @param scheduleName The name of the schedule that uniquely identifies it. + * @param body Represents a scheduled task + * @param options The options parameters. + */ + async beginCreateOrUpdate( + resourceGroupName: string, + projectName: string, + poolName: string, + scheduleName: string, + body: Schedule, + options?: SchedulesCreateOrUpdateOptionalParams + ): Promise< + PollerLike< + PollOperationState, + SchedulesCreateOrUpdateResponse + > + > { + 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, projectName, poolName, scheduleName, body, options }, + createOrUpdateOperationSpec + ); + const poller = new LroEngine(lro, { + resumeFrom: options?.resumeFrom, + intervalInMs: options?.updateIntervalInMs, + lroResourceLocationConfig: "azure-async-operation" + }); + await poller.poll(); + return poller; + } + + /** + * Creates or updates a Schedule. + * @param resourceGroupName Name of the resource group within the Azure subscription. + * @param projectName The name of the project. + * @param poolName Name of the pool. + * @param scheduleName The name of the schedule that uniquely identifies it. + * @param body Represents a scheduled task + * @param options The options parameters. + */ + async beginCreateOrUpdateAndWait( + resourceGroupName: string, + projectName: string, + poolName: string, + scheduleName: string, + body: Schedule, + options?: SchedulesCreateOrUpdateOptionalParams + ): Promise { + const poller = await this.beginCreateOrUpdate( + resourceGroupName, + projectName, + poolName, + scheduleName, + body, + options + ); + return poller.pollUntilDone(); + } + + /** + * Partially updates a Scheduled. + * @param resourceGroupName Name of the resource group within the Azure subscription. + * @param projectName The name of the project. + * @param poolName Name of the pool. + * @param scheduleName The name of the schedule that uniquely identifies it. + * @param body Represents a scheduled task. + * @param options The options parameters. + */ + async beginUpdate( + resourceGroupName: string, + projectName: string, + poolName: string, + scheduleName: string, + body: ScheduleUpdate, + options?: SchedulesUpdateOptionalParams + ): 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, projectName, poolName, scheduleName, body, options }, + updateOperationSpec + ); + const poller = new LroEngine(lro, { + resumeFrom: options?.resumeFrom, + intervalInMs: options?.updateIntervalInMs, + lroResourceLocationConfig: "azure-async-operation" + }); + await poller.poll(); + return poller; + } + + /** + * Partially updates a Scheduled. + * @param resourceGroupName Name of the resource group within the Azure subscription. + * @param projectName The name of the project. + * @param poolName Name of the pool. + * @param scheduleName The name of the schedule that uniquely identifies it. + * @param body Represents a scheduled task. + * @param options The options parameters. + */ + async beginUpdateAndWait( + resourceGroupName: string, + projectName: string, + poolName: string, + scheduleName: string, + body: ScheduleUpdate, + options?: SchedulesUpdateOptionalParams + ): Promise { + const poller = await this.beginUpdate( + resourceGroupName, + projectName, + poolName, + scheduleName, + body, + options + ); + return poller.pollUntilDone(); + } + + /** + * Deletes a Scheduled. + * @param resourceGroupName Name of the resource group within the Azure subscription. + * @param projectName The name of the project. + * @param poolName Name of the pool. + * @param scheduleName The name of the schedule that uniquely identifies it. + * @param options The options parameters. + */ + async beginDelete( + resourceGroupName: string, + projectName: string, + poolName: string, + scheduleName: string, + options?: SchedulesDeleteOptionalParams + ): 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, projectName, poolName, scheduleName, options }, + deleteOperationSpec + ); + const poller = new LroEngine(lro, { + resumeFrom: options?.resumeFrom, + intervalInMs: options?.updateIntervalInMs, + lroResourceLocationConfig: "azure-async-operation" + }); + await poller.poll(); + return poller; + } + + /** + * Deletes a Scheduled. + * @param resourceGroupName Name of the resource group within the Azure subscription. + * @param projectName The name of the project. + * @param poolName Name of the pool. + * @param scheduleName The name of the schedule that uniquely identifies it. + * @param options The options parameters. + */ + async beginDeleteAndWait( + resourceGroupName: string, + projectName: string, + poolName: string, + scheduleName: string, + options?: SchedulesDeleteOptionalParams + ): Promise { + const poller = await this.beginDelete( + resourceGroupName, + projectName, + poolName, + scheduleName, + options + ); + return poller.pollUntilDone(); + } + + /** + * ListByPoolNext + * @param resourceGroupName Name of the resource group within the Azure subscription. + * @param projectName The name of the project. + * @param poolName Name of the pool. + * @param nextLink The nextLink from the previous successful call to the ListByPool method. + * @param options The options parameters. + */ + private _listByPoolNext( + resourceGroupName: string, + projectName: string, + poolName: string, + nextLink: string, + options?: SchedulesListByPoolNextOptionalParams + ): Promise { + return this.client.sendOperationRequest( + { resourceGroupName, projectName, poolName, nextLink, options }, + listByPoolNextOperationSpec + ); + } +} +// Operation Specifications +const serializer = coreClient.createSerializer(Mappers, /* isXml */ false); + +const listByPoolOperationSpec: coreClient.OperationSpec = { + path: + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DevCenter/projects/{projectName}/pools/{poolName}/schedules", + httpMethod: "GET", + responses: { + 200: { + bodyMapper: Mappers.ScheduleListResult + }, + default: { + bodyMapper: Mappers.CloudError + } + }, + queryParameters: [Parameters.apiVersion, Parameters.top], + urlParameters: [ + Parameters.$host, + Parameters.subscriptionId, + Parameters.resourceGroupName, + Parameters.projectName, + Parameters.poolName + ], + headerParameters: [Parameters.accept], + serializer +}; +const getOperationSpec: coreClient.OperationSpec = { + path: + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DevCenter/projects/{projectName}/pools/{poolName}/schedules/{scheduleName}", + httpMethod: "GET", + responses: { + 200: { + bodyMapper: Mappers.Schedule + }, + default: { + bodyMapper: Mappers.CloudError + } + }, + queryParameters: [Parameters.apiVersion, Parameters.top], + urlParameters: [ + Parameters.$host, + Parameters.subscriptionId, + Parameters.resourceGroupName, + Parameters.projectName, + Parameters.poolName, + Parameters.scheduleName + ], + headerParameters: [Parameters.accept], + serializer +}; +const createOrUpdateOperationSpec: coreClient.OperationSpec = { + path: + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DevCenter/projects/{projectName}/pools/{poolName}/schedules/{scheduleName}", + httpMethod: "PUT", + responses: { + 200: { + bodyMapper: Mappers.Schedule + }, + 201: { + bodyMapper: Mappers.Schedule + }, + 202: { + bodyMapper: Mappers.Schedule + }, + 204: { + bodyMapper: Mappers.Schedule + }, + default: { + bodyMapper: Mappers.CloudError + } + }, + requestBody: Parameters.body16, + queryParameters: [Parameters.apiVersion, Parameters.top], + urlParameters: [ + Parameters.$host, + Parameters.subscriptionId, + Parameters.resourceGroupName, + Parameters.projectName, + Parameters.poolName, + Parameters.scheduleName + ], + headerParameters: [Parameters.accept, Parameters.contentType], + mediaType: "json", + serializer +}; +const updateOperationSpec: coreClient.OperationSpec = { + path: + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DevCenter/projects/{projectName}/pools/{poolName}/schedules/{scheduleName}", + httpMethod: "PATCH", + responses: { + 200: {}, + 201: {}, + 202: {}, + 204: {}, + default: { + bodyMapper: Mappers.CloudError + } + }, + requestBody: Parameters.body17, + queryParameters: [Parameters.apiVersion, Parameters.top], + urlParameters: [ + Parameters.$host, + Parameters.subscriptionId, + Parameters.resourceGroupName, + Parameters.projectName, + Parameters.poolName, + Parameters.scheduleName + ], + headerParameters: [Parameters.accept, Parameters.contentType], + mediaType: "json", + serializer +}; +const deleteOperationSpec: coreClient.OperationSpec = { + path: + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DevCenter/projects/{projectName}/pools/{poolName}/schedules/{scheduleName}", + httpMethod: "DELETE", + responses: { + 200: {}, + 201: {}, + 202: {}, + 204: {}, + default: { + bodyMapper: Mappers.CloudError + } + }, + queryParameters: [Parameters.apiVersion, Parameters.top], + urlParameters: [ + Parameters.$host, + Parameters.subscriptionId, + Parameters.resourceGroupName, + Parameters.projectName, + Parameters.poolName, + Parameters.scheduleName + ], + headerParameters: [Parameters.accept], + serializer +}; +const listByPoolNextOperationSpec: coreClient.OperationSpec = { + path: "{nextLink}", + httpMethod: "GET", + responses: { + 200: { + bodyMapper: Mappers.ScheduleListResult + }, + default: { + bodyMapper: Mappers.CloudError + } + }, + queryParameters: [Parameters.apiVersion, Parameters.top], + urlParameters: [ + Parameters.$host, + Parameters.subscriptionId, + Parameters.resourceGroupName, + Parameters.nextLink, + Parameters.projectName, + Parameters.poolName + ], + headerParameters: [Parameters.accept], + serializer +}; diff --git a/sdk/devcenter/arm-devcenter/src/operations/skus.ts b/sdk/devcenter/arm-devcenter/src/operations/skus.ts new file mode 100644 index 000000000000..2b16df885f36 --- /dev/null +++ b/sdk/devcenter/arm-devcenter/src/operations/skus.ts @@ -0,0 +1,144 @@ +/* + * 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 { DevCenterClient } from "../devCenterClient"; +import { + DevCenterSku, + SkusListBySubscriptionNextOptionalParams, + SkusListBySubscriptionOptionalParams, + SkusListBySubscriptionResponse, + SkusListBySubscriptionNextResponse +} from "../models"; + +/// +/** Class containing Skus operations. */ +export class SkusImpl implements Skus { + private readonly client: DevCenterClient; + + /** + * Initialize a new instance of the class Skus class. + * @param client Reference to the service client + */ + constructor(client: DevCenterClient) { + this.client = client; + } + + /** + * Lists the Microsoft.DevCenter SKUs available in a subscription + * @param options The options parameters. + */ + public listBySubscription( + options?: SkusListBySubscriptionOptionalParams + ): PagedAsyncIterableIterator { + const iter = this.listBySubscriptionPagingAll(options); + return { + next() { + return iter.next(); + }, + [Symbol.asyncIterator]() { + return this; + }, + byPage: () => { + return this.listBySubscriptionPagingPage(options); + } + }; + } + + private async *listBySubscriptionPagingPage( + options?: SkusListBySubscriptionOptionalParams + ): 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?: SkusListBySubscriptionOptionalParams + ): AsyncIterableIterator { + for await (const page of this.listBySubscriptionPagingPage(options)) { + yield* page; + } + } + + /** + * Lists the Microsoft.DevCenter SKUs available in a subscription + * @param options The options parameters. + */ + private _listBySubscription( + options?: SkusListBySubscriptionOptionalParams + ): Promise { + return this.client.sendOperationRequest( + { options }, + listBySubscriptionOperationSpec + ); + } + + /** + * ListBySubscriptionNext + * @param nextLink The nextLink from the previous successful call to the ListBySubscription method. + * @param options The options parameters. + */ + private _listBySubscriptionNext( + nextLink: string, + options?: SkusListBySubscriptionNextOptionalParams + ): Promise { + return this.client.sendOperationRequest( + { nextLink, options }, + listBySubscriptionNextOperationSpec + ); + } +} +// Operation Specifications +const serializer = coreClient.createSerializer(Mappers, /* isXml */ false); + +const listBySubscriptionOperationSpec: coreClient.OperationSpec = { + path: "/subscriptions/{subscriptionId}/providers/Microsoft.DevCenter/skus", + httpMethod: "GET", + responses: { + 200: { + bodyMapper: Mappers.SkuListResult + }, + default: { + bodyMapper: Mappers.CloudError + } + }, + queryParameters: [Parameters.apiVersion, Parameters.top], + urlParameters: [Parameters.$host, Parameters.subscriptionId], + headerParameters: [Parameters.accept], + serializer +}; +const listBySubscriptionNextOperationSpec: coreClient.OperationSpec = { + path: "{nextLink}", + httpMethod: "GET", + responses: { + 200: { + bodyMapper: Mappers.SkuListResult + }, + default: { + bodyMapper: Mappers.CloudError + } + }, + queryParameters: [Parameters.apiVersion, Parameters.top], + urlParameters: [ + Parameters.$host, + Parameters.subscriptionId, + Parameters.nextLink + ], + headerParameters: [Parameters.accept], + serializer +}; diff --git a/sdk/devcenter/arm-devcenter/src/operations/usages.ts b/sdk/devcenter/arm-devcenter/src/operations/usages.ts new file mode 100644 index 000000000000..3d07c5b6f6fc --- /dev/null +++ b/sdk/devcenter/arm-devcenter/src/operations/usages.ts @@ -0,0 +1,162 @@ +/* + * 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 { Usages } from "../operationsInterfaces"; +import * as coreClient from "@azure/core-client"; +import * as Mappers from "../models/mappers"; +import * as Parameters from "../models/parameters"; +import { DevCenterClient } from "../devCenterClient"; +import { + Usage, + UsagesListByLocationNextOptionalParams, + UsagesListByLocationOptionalParams, + UsagesListByLocationResponse, + UsagesListByLocationNextResponse +} from "../models"; + +/// +/** Class containing Usages operations. */ +export class UsagesImpl implements Usages { + private readonly client: DevCenterClient; + + /** + * Initialize a new instance of the class Usages class. + * @param client Reference to the service client + */ + constructor(client: DevCenterClient) { + this.client = client; + } + + /** + * Lists the current usages and limits in this location for the provided subscription. + * @param location The Azure region + * @param options The options parameters. + */ + public listByLocation( + location: string, + options?: UsagesListByLocationOptionalParams + ): PagedAsyncIterableIterator { + const iter = this.listByLocationPagingAll(location, options); + return { + next() { + return iter.next(); + }, + [Symbol.asyncIterator]() { + return this; + }, + byPage: () => { + return this.listByLocationPagingPage(location, options); + } + }; + } + + private async *listByLocationPagingPage( + location: string, + options?: UsagesListByLocationOptionalParams + ): AsyncIterableIterator { + let result = await this._listByLocation(location, options); + yield result.value || []; + let continuationToken = result.nextLink; + while (continuationToken) { + result = await this._listByLocationNext( + location, + continuationToken, + options + ); + continuationToken = result.nextLink; + yield result.value || []; + } + } + + private async *listByLocationPagingAll( + location: string, + options?: UsagesListByLocationOptionalParams + ): AsyncIterableIterator { + for await (const page of this.listByLocationPagingPage(location, options)) { + yield* page; + } + } + + /** + * Lists the current usages and limits in this location for the provided subscription. + * @param location The Azure region + * @param options The options parameters. + */ + private _listByLocation( + location: string, + options?: UsagesListByLocationOptionalParams + ): Promise { + return this.client.sendOperationRequest( + { location, options }, + listByLocationOperationSpec + ); + } + + /** + * ListByLocationNext + * @param location The Azure region + * @param nextLink The nextLink from the previous successful call to the ListByLocation method. + * @param options The options parameters. + */ + private _listByLocationNext( + location: string, + nextLink: string, + options?: UsagesListByLocationNextOptionalParams + ): Promise { + return this.client.sendOperationRequest( + { location, nextLink, options }, + listByLocationNextOperationSpec + ); + } +} +// Operation Specifications +const serializer = coreClient.createSerializer(Mappers, /* isXml */ false); + +const listByLocationOperationSpec: coreClient.OperationSpec = { + path: + "/subscriptions/{subscriptionId}/providers/Microsoft.DevCenter/locations/{location}/usages", + httpMethod: "GET", + responses: { + 200: { + bodyMapper: Mappers.ListUsagesResult + }, + default: { + bodyMapper: Mappers.CloudError + } + }, + queryParameters: [Parameters.apiVersion], + urlParameters: [ + Parameters.$host, + Parameters.subscriptionId, + Parameters.location + ], + headerParameters: [Parameters.accept], + serializer +}; +const listByLocationNextOperationSpec: coreClient.OperationSpec = { + path: "{nextLink}", + httpMethod: "GET", + responses: { + 200: { + bodyMapper: Mappers.ListUsagesResult + }, + default: { + bodyMapper: Mappers.CloudError + } + }, + queryParameters: [Parameters.apiVersion], + urlParameters: [ + Parameters.$host, + Parameters.subscriptionId, + Parameters.nextLink, + Parameters.location + ], + headerParameters: [Parameters.accept], + serializer +}; diff --git a/sdk/devcenter/arm-devcenter/src/operationsInterfaces/attachedNetworks.ts b/sdk/devcenter/arm-devcenter/src/operationsInterfaces/attachedNetworks.ts new file mode 100644 index 000000000000..829a642f992b --- /dev/null +++ b/sdk/devcenter/arm-devcenter/src/operationsInterfaces/attachedNetworks.ts @@ -0,0 +1,136 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +import { PagedAsyncIterableIterator } from "@azure/core-paging"; +import { PollerLike, PollOperationState } from "@azure/core-lro"; +import { + AttachedNetworkConnection, + AttachedNetworksListByProjectOptionalParams, + AttachedNetworksListByDevCenterOptionalParams, + AttachedNetworksGetByProjectOptionalParams, + AttachedNetworksGetByProjectResponse, + AttachedNetworksGetByDevCenterOptionalParams, + AttachedNetworksGetByDevCenterResponse, + AttachedNetworksCreateOrUpdateOptionalParams, + AttachedNetworksCreateOrUpdateResponse, + AttachedNetworksDeleteOptionalParams +} from "../models"; + +/// +/** Interface representing a AttachedNetworks. */ +export interface AttachedNetworks { + /** + * Lists the attached NetworkConnections for a Project. + * @param resourceGroupName Name of the resource group within the Azure subscription. + * @param projectName The name of the project. + * @param options The options parameters. + */ + listByProject( + resourceGroupName: string, + projectName: string, + options?: AttachedNetworksListByProjectOptionalParams + ): PagedAsyncIterableIterator; + /** + * Lists the attached NetworkConnections for a DevCenter. + * @param resourceGroupName Name of the resource group within the Azure subscription. + * @param devCenterName The name of the devcenter. + * @param options The options parameters. + */ + listByDevCenter( + resourceGroupName: string, + devCenterName: string, + options?: AttachedNetworksListByDevCenterOptionalParams + ): PagedAsyncIterableIterator; + /** + * Gets an attached NetworkConnection. + * @param resourceGroupName Name of the resource group within the Azure subscription. + * @param projectName The name of the project. + * @param attachedNetworkConnectionName The name of the attached NetworkConnection. + * @param options The options parameters. + */ + getByProject( + resourceGroupName: string, + projectName: string, + attachedNetworkConnectionName: string, + options?: AttachedNetworksGetByProjectOptionalParams + ): Promise; + /** + * Gets an attached NetworkConnection. + * @param resourceGroupName Name of the resource group within the Azure subscription. + * @param devCenterName The name of the devcenter. + * @param attachedNetworkConnectionName The name of the attached NetworkConnection. + * @param options The options parameters. + */ + getByDevCenter( + resourceGroupName: string, + devCenterName: string, + attachedNetworkConnectionName: string, + options?: AttachedNetworksGetByDevCenterOptionalParams + ): Promise; + /** + * Creates or updates an attached NetworkConnection. + * @param resourceGroupName Name of the resource group within the Azure subscription. + * @param devCenterName The name of the devcenter. + * @param attachedNetworkConnectionName The name of the attached NetworkConnection. + * @param body Represents an attached NetworkConnection. + * @param options The options parameters. + */ + beginCreateOrUpdate( + resourceGroupName: string, + devCenterName: string, + attachedNetworkConnectionName: string, + body: AttachedNetworkConnection, + options?: AttachedNetworksCreateOrUpdateOptionalParams + ): Promise< + PollerLike< + PollOperationState, + AttachedNetworksCreateOrUpdateResponse + > + >; + /** + * Creates or updates an attached NetworkConnection. + * @param resourceGroupName Name of the resource group within the Azure subscription. + * @param devCenterName The name of the devcenter. + * @param attachedNetworkConnectionName The name of the attached NetworkConnection. + * @param body Represents an attached NetworkConnection. + * @param options The options parameters. + */ + beginCreateOrUpdateAndWait( + resourceGroupName: string, + devCenterName: string, + attachedNetworkConnectionName: string, + body: AttachedNetworkConnection, + options?: AttachedNetworksCreateOrUpdateOptionalParams + ): Promise; + /** + * Un-attach a NetworkConnection. + * @param resourceGroupName Name of the resource group within the Azure subscription. + * @param devCenterName The name of the devcenter. + * @param attachedNetworkConnectionName The name of the attached NetworkConnection. + * @param options The options parameters. + */ + beginDelete( + resourceGroupName: string, + devCenterName: string, + attachedNetworkConnectionName: string, + options?: AttachedNetworksDeleteOptionalParams + ): Promise, void>>; + /** + * Un-attach a NetworkConnection. + * @param resourceGroupName Name of the resource group within the Azure subscription. + * @param devCenterName The name of the devcenter. + * @param attachedNetworkConnectionName The name of the attached NetworkConnection. + * @param options The options parameters. + */ + beginDeleteAndWait( + resourceGroupName: string, + devCenterName: string, + attachedNetworkConnectionName: string, + options?: AttachedNetworksDeleteOptionalParams + ): Promise; +} diff --git a/sdk/devcenter/arm-devcenter/src/operationsInterfaces/catalogs.ts b/sdk/devcenter/arm-devcenter/src/operationsInterfaces/catalogs.ts new file mode 100644 index 000000000000..a6a5cfca2e37 --- /dev/null +++ b/sdk/devcenter/arm-devcenter/src/operationsInterfaces/catalogs.ts @@ -0,0 +1,174 @@ +/* + * 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 { + Catalog, + CatalogsListByDevCenterOptionalParams, + CatalogsGetOptionalParams, + CatalogsGetResponse, + CatalogsCreateOrUpdateOptionalParams, + CatalogsCreateOrUpdateResponse, + CatalogUpdate, + CatalogsUpdateOptionalParams, + CatalogsUpdateResponse, + CatalogsDeleteOptionalParams, + CatalogsSyncOptionalParams +} from "../models"; + +/// +/** Interface representing a Catalogs. */ +export interface Catalogs { + /** + * Lists catalogs for a devcenter. + * @param resourceGroupName Name of the resource group within the Azure subscription. + * @param devCenterName The name of the devcenter. + * @param options The options parameters. + */ + listByDevCenter( + resourceGroupName: string, + devCenterName: string, + options?: CatalogsListByDevCenterOptionalParams + ): PagedAsyncIterableIterator; + /** + * Gets a catalog + * @param resourceGroupName Name of the resource group within the Azure subscription. + * @param devCenterName The name of the devcenter. + * @param catalogName The name of the Catalog. + * @param options The options parameters. + */ + get( + resourceGroupName: string, + devCenterName: string, + catalogName: string, + options?: CatalogsGetOptionalParams + ): Promise; + /** + * Creates or updates a catalog. + * @param resourceGroupName Name of the resource group within the Azure subscription. + * @param devCenterName The name of the devcenter. + * @param catalogName The name of the Catalog. + * @param body Represents a catalog. + * @param options The options parameters. + */ + beginCreateOrUpdate( + resourceGroupName: string, + devCenterName: string, + catalogName: string, + body: Catalog, + options?: CatalogsCreateOrUpdateOptionalParams + ): Promise< + PollerLike< + PollOperationState, + CatalogsCreateOrUpdateResponse + > + >; + /** + * Creates or updates a catalog. + * @param resourceGroupName Name of the resource group within the Azure subscription. + * @param devCenterName The name of the devcenter. + * @param catalogName The name of the Catalog. + * @param body Represents a catalog. + * @param options The options parameters. + */ + beginCreateOrUpdateAndWait( + resourceGroupName: string, + devCenterName: string, + catalogName: string, + body: Catalog, + options?: CatalogsCreateOrUpdateOptionalParams + ): Promise; + /** + * Partially updates a catalog. + * @param resourceGroupName Name of the resource group within the Azure subscription. + * @param devCenterName The name of the devcenter. + * @param catalogName The name of the Catalog. + * @param body Updatable catalog properties. + * @param options The options parameters. + */ + beginUpdate( + resourceGroupName: string, + devCenterName: string, + catalogName: string, + body: CatalogUpdate, + options?: CatalogsUpdateOptionalParams + ): Promise< + PollerLike< + PollOperationState, + CatalogsUpdateResponse + > + >; + /** + * Partially updates a catalog. + * @param resourceGroupName Name of the resource group within the Azure subscription. + * @param devCenterName The name of the devcenter. + * @param catalogName The name of the Catalog. + * @param body Updatable catalog properties. + * @param options The options parameters. + */ + beginUpdateAndWait( + resourceGroupName: string, + devCenterName: string, + catalogName: string, + body: CatalogUpdate, + options?: CatalogsUpdateOptionalParams + ): Promise; + /** + * Deletes a catalog resource. + * @param resourceGroupName Name of the resource group within the Azure subscription. + * @param devCenterName The name of the devcenter. + * @param catalogName The name of the Catalog. + * @param options The options parameters. + */ + beginDelete( + resourceGroupName: string, + devCenterName: string, + catalogName: string, + options?: CatalogsDeleteOptionalParams + ): Promise, void>>; + /** + * Deletes a catalog resource. + * @param resourceGroupName Name of the resource group within the Azure subscription. + * @param devCenterName The name of the devcenter. + * @param catalogName The name of the Catalog. + * @param options The options parameters. + */ + beginDeleteAndWait( + resourceGroupName: string, + devCenterName: string, + catalogName: string, + options?: CatalogsDeleteOptionalParams + ): Promise; + /** + * Syncs templates for a template source. + * @param resourceGroupName Name of the resource group within the Azure subscription. + * @param devCenterName The name of the devcenter. + * @param catalogName The name of the Catalog. + * @param options The options parameters. + */ + beginSync( + resourceGroupName: string, + devCenterName: string, + catalogName: string, + options?: CatalogsSyncOptionalParams + ): Promise, void>>; + /** + * Syncs templates for a template source. + * @param resourceGroupName Name of the resource group within the Azure subscription. + * @param devCenterName The name of the devcenter. + * @param catalogName The name of the Catalog. + * @param options The options parameters. + */ + beginSyncAndWait( + resourceGroupName: string, + devCenterName: string, + catalogName: string, + options?: CatalogsSyncOptionalParams + ): Promise; +} diff --git a/sdk/devcenter/arm-devcenter/src/operationsInterfaces/devBoxDefinitions.ts b/sdk/devcenter/arm-devcenter/src/operationsInterfaces/devBoxDefinitions.ts new file mode 100644 index 000000000000..fdbe4ce60783 --- /dev/null +++ b/sdk/devcenter/arm-devcenter/src/operationsInterfaces/devBoxDefinitions.ts @@ -0,0 +1,174 @@ +/* + * 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 { + DevBoxDefinition, + DevBoxDefinitionsListByDevCenterOptionalParams, + DevBoxDefinitionsListByProjectOptionalParams, + DevBoxDefinitionsGetOptionalParams, + DevBoxDefinitionsGetResponse, + DevBoxDefinitionsCreateOrUpdateOptionalParams, + DevBoxDefinitionsCreateOrUpdateResponse, + DevBoxDefinitionUpdate, + DevBoxDefinitionsUpdateOptionalParams, + DevBoxDefinitionsUpdateResponse, + DevBoxDefinitionsDeleteOptionalParams, + DevBoxDefinitionsGetByProjectOptionalParams, + DevBoxDefinitionsGetByProjectResponse +} from "../models"; + +/// +/** Interface representing a DevBoxDefinitions. */ +export interface DevBoxDefinitions { + /** + * List Dev Box definitions for a devcenter. + * @param resourceGroupName Name of the resource group within the Azure subscription. + * @param devCenterName The name of the devcenter. + * @param options The options parameters. + */ + listByDevCenter( + resourceGroupName: string, + devCenterName: string, + options?: DevBoxDefinitionsListByDevCenterOptionalParams + ): PagedAsyncIterableIterator; + /** + * List Dev Box definitions configured for a project. + * @param resourceGroupName Name of the resource group within the Azure subscription. + * @param projectName The name of the project. + * @param options The options parameters. + */ + listByProject( + resourceGroupName: string, + projectName: string, + options?: DevBoxDefinitionsListByProjectOptionalParams + ): PagedAsyncIterableIterator; + /** + * Gets a Dev Box definition + * @param resourceGroupName Name of the resource group within the Azure subscription. + * @param devCenterName The name of the devcenter. + * @param devBoxDefinitionName The name of the Dev Box definition. + * @param options The options parameters. + */ + get( + resourceGroupName: string, + devCenterName: string, + devBoxDefinitionName: string, + options?: DevBoxDefinitionsGetOptionalParams + ): Promise; + /** + * Creates or updates a Dev Box definition. + * @param resourceGroupName Name of the resource group within the Azure subscription. + * @param devCenterName The name of the devcenter. + * @param devBoxDefinitionName The name of the Dev Box definition. + * @param body Represents a Dev Box definition. + * @param options The options parameters. + */ + beginCreateOrUpdate( + resourceGroupName: string, + devCenterName: string, + devBoxDefinitionName: string, + body: DevBoxDefinition, + options?: DevBoxDefinitionsCreateOrUpdateOptionalParams + ): Promise< + PollerLike< + PollOperationState, + DevBoxDefinitionsCreateOrUpdateResponse + > + >; + /** + * Creates or updates a Dev Box definition. + * @param resourceGroupName Name of the resource group within the Azure subscription. + * @param devCenterName The name of the devcenter. + * @param devBoxDefinitionName The name of the Dev Box definition. + * @param body Represents a Dev Box definition. + * @param options The options parameters. + */ + beginCreateOrUpdateAndWait( + resourceGroupName: string, + devCenterName: string, + devBoxDefinitionName: string, + body: DevBoxDefinition, + options?: DevBoxDefinitionsCreateOrUpdateOptionalParams + ): Promise; + /** + * Partially updates a Dev Box definition. + * @param resourceGroupName Name of the resource group within the Azure subscription. + * @param devCenterName The name of the devcenter. + * @param devBoxDefinitionName The name of the Dev Box definition. + * @param body Represents a Dev Box definition. + * @param options The options parameters. + */ + beginUpdate( + resourceGroupName: string, + devCenterName: string, + devBoxDefinitionName: string, + body: DevBoxDefinitionUpdate, + options?: DevBoxDefinitionsUpdateOptionalParams + ): Promise< + PollerLike< + PollOperationState, + DevBoxDefinitionsUpdateResponse + > + >; + /** + * Partially updates a Dev Box definition. + * @param resourceGroupName Name of the resource group within the Azure subscription. + * @param devCenterName The name of the devcenter. + * @param devBoxDefinitionName The name of the Dev Box definition. + * @param body Represents a Dev Box definition. + * @param options The options parameters. + */ + beginUpdateAndWait( + resourceGroupName: string, + devCenterName: string, + devBoxDefinitionName: string, + body: DevBoxDefinitionUpdate, + options?: DevBoxDefinitionsUpdateOptionalParams + ): Promise; + /** + * Deletes a Dev Box definition + * @param resourceGroupName Name of the resource group within the Azure subscription. + * @param devCenterName The name of the devcenter. + * @param devBoxDefinitionName The name of the Dev Box definition. + * @param options The options parameters. + */ + beginDelete( + resourceGroupName: string, + devCenterName: string, + devBoxDefinitionName: string, + options?: DevBoxDefinitionsDeleteOptionalParams + ): Promise, void>>; + /** + * Deletes a Dev Box definition + * @param resourceGroupName Name of the resource group within the Azure subscription. + * @param devCenterName The name of the devcenter. + * @param devBoxDefinitionName The name of the Dev Box definition. + * @param options The options parameters. + */ + beginDeleteAndWait( + resourceGroupName: string, + devCenterName: string, + devBoxDefinitionName: string, + options?: DevBoxDefinitionsDeleteOptionalParams + ): Promise; + /** + * Gets a Dev Box definition configured for a project + * @param resourceGroupName Name of the resource group within the Azure subscription. + * @param projectName The name of the project. + * @param devBoxDefinitionName The name of the Dev Box definition. + * @param options The options parameters. + */ + getByProject( + resourceGroupName: string, + projectName: string, + devBoxDefinitionName: string, + options?: DevBoxDefinitionsGetByProjectOptionalParams + ): Promise; +} diff --git a/sdk/devcenter/arm-devcenter/src/operationsInterfaces/devCenters.ts b/sdk/devcenter/arm-devcenter/src/operationsInterfaces/devCenters.ts new file mode 100644 index 000000000000..4df9b915cac7 --- /dev/null +++ b/sdk/devcenter/arm-devcenter/src/operationsInterfaces/devCenters.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 { PollerLike, PollOperationState } from "@azure/core-lro"; +import { + DevCenter, + DevCentersListBySubscriptionOptionalParams, + DevCentersListByResourceGroupOptionalParams, + DevCentersGetOptionalParams, + DevCentersGetResponse, + DevCentersCreateOrUpdateOptionalParams, + DevCentersCreateOrUpdateResponse, + DevCenterUpdate, + DevCentersUpdateOptionalParams, + DevCentersUpdateResponse, + DevCentersDeleteOptionalParams +} from "../models"; + +/// +/** Interface representing a DevCenters. */ +export interface DevCenters { + /** + * Lists all devcenters in a subscription. + * @param options The options parameters. + */ + listBySubscription( + options?: DevCentersListBySubscriptionOptionalParams + ): PagedAsyncIterableIterator; + /** + * Lists all devcenters in a resource group. + * @param resourceGroupName Name of the resource group within the Azure subscription. + * @param options The options parameters. + */ + listByResourceGroup( + resourceGroupName: string, + options?: DevCentersListByResourceGroupOptionalParams + ): PagedAsyncIterableIterator; + /** + * Gets a devcenter. + * @param resourceGroupName Name of the resource group within the Azure subscription. + * @param devCenterName The name of the devcenter. + * @param options The options parameters. + */ + get( + resourceGroupName: string, + devCenterName: string, + options?: DevCentersGetOptionalParams + ): Promise; + /** + * Creates or updates a devcenter resource + * @param resourceGroupName Name of the resource group within the Azure subscription. + * @param devCenterName The name of the devcenter. + * @param body Represents a devcenter. + * @param options The options parameters. + */ + beginCreateOrUpdate( + resourceGroupName: string, + devCenterName: string, + body: DevCenter, + options?: DevCentersCreateOrUpdateOptionalParams + ): Promise< + PollerLike< + PollOperationState, + DevCentersCreateOrUpdateResponse + > + >; + /** + * Creates or updates a devcenter resource + * @param resourceGroupName Name of the resource group within the Azure subscription. + * @param devCenterName The name of the devcenter. + * @param body Represents a devcenter. + * @param options The options parameters. + */ + beginCreateOrUpdateAndWait( + resourceGroupName: string, + devCenterName: string, + body: DevCenter, + options?: DevCentersCreateOrUpdateOptionalParams + ): Promise; + /** + * Partially updates a devcenter. + * @param resourceGroupName Name of the resource group within the Azure subscription. + * @param devCenterName The name of the devcenter. + * @param body Updatable devcenter properties. + * @param options The options parameters. + */ + beginUpdate( + resourceGroupName: string, + devCenterName: string, + body: DevCenterUpdate, + options?: DevCentersUpdateOptionalParams + ): Promise< + PollerLike< + PollOperationState, + DevCentersUpdateResponse + > + >; + /** + * Partially updates a devcenter. + * @param resourceGroupName Name of the resource group within the Azure subscription. + * @param devCenterName The name of the devcenter. + * @param body Updatable devcenter properties. + * @param options The options parameters. + */ + beginUpdateAndWait( + resourceGroupName: string, + devCenterName: string, + body: DevCenterUpdate, + options?: DevCentersUpdateOptionalParams + ): Promise; + /** + * Deletes a devcenter + * @param resourceGroupName Name of the resource group within the Azure subscription. + * @param devCenterName The name of the devcenter. + * @param options The options parameters. + */ + beginDelete( + resourceGroupName: string, + devCenterName: string, + options?: DevCentersDeleteOptionalParams + ): Promise, void>>; + /** + * Deletes a devcenter + * @param resourceGroupName Name of the resource group within the Azure subscription. + * @param devCenterName The name of the devcenter. + * @param options The options parameters. + */ + beginDeleteAndWait( + resourceGroupName: string, + devCenterName: string, + options?: DevCentersDeleteOptionalParams + ): Promise; +} diff --git a/sdk/devcenter/arm-devcenter/src/operationsInterfaces/environmentTypes.ts b/sdk/devcenter/arm-devcenter/src/operationsInterfaces/environmentTypes.ts new file mode 100644 index 000000000000..e67357a9f794 --- /dev/null +++ b/sdk/devcenter/arm-devcenter/src/operationsInterfaces/environmentTypes.ts @@ -0,0 +1,93 @@ +/* + * 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 { + EnvironmentType, + EnvironmentTypesListByDevCenterOptionalParams, + EnvironmentTypesGetOptionalParams, + EnvironmentTypesGetResponse, + EnvironmentTypesCreateOrUpdateOptionalParams, + EnvironmentTypesCreateOrUpdateResponse, + EnvironmentTypeUpdate, + EnvironmentTypesUpdateOptionalParams, + EnvironmentTypesUpdateResponse, + EnvironmentTypesDeleteOptionalParams +} from "../models"; + +/// +/** Interface representing a EnvironmentTypes. */ +export interface EnvironmentTypes { + /** + * Lists environment types for the devcenter. + * @param resourceGroupName Name of the resource group within the Azure subscription. + * @param devCenterName The name of the devcenter. + * @param options The options parameters. + */ + listByDevCenter( + resourceGroupName: string, + devCenterName: string, + options?: EnvironmentTypesListByDevCenterOptionalParams + ): PagedAsyncIterableIterator; + /** + * Gets an environment type. + * @param resourceGroupName Name of the resource group within the Azure subscription. + * @param devCenterName The name of the devcenter. + * @param environmentTypeName The name of the environment type. + * @param options The options parameters. + */ + get( + resourceGroupName: string, + devCenterName: string, + environmentTypeName: string, + options?: EnvironmentTypesGetOptionalParams + ): Promise; + /** + * Creates or updates an environment type. + * @param resourceGroupName Name of the resource group within the Azure subscription. + * @param devCenterName The name of the devcenter. + * @param environmentTypeName The name of the environment type. + * @param body Represents an Environment Type. + * @param options The options parameters. + */ + createOrUpdate( + resourceGroupName: string, + devCenterName: string, + environmentTypeName: string, + body: EnvironmentType, + options?: EnvironmentTypesCreateOrUpdateOptionalParams + ): Promise; + /** + * Partially updates an environment type. + * @param resourceGroupName Name of the resource group within the Azure subscription. + * @param devCenterName The name of the devcenter. + * @param environmentTypeName The name of the environment type. + * @param body Updatable environment type properties. + * @param options The options parameters. + */ + update( + resourceGroupName: string, + devCenterName: string, + environmentTypeName: string, + body: EnvironmentTypeUpdate, + options?: EnvironmentTypesUpdateOptionalParams + ): Promise; + /** + * Deletes an environment type. + * @param resourceGroupName Name of the resource group within the Azure subscription. + * @param devCenterName The name of the devcenter. + * @param environmentTypeName The name of the environment type. + * @param options The options parameters. + */ + delete( + resourceGroupName: string, + devCenterName: string, + environmentTypeName: string, + options?: EnvironmentTypesDeleteOptionalParams + ): Promise; +} diff --git a/sdk/devcenter/arm-devcenter/src/operationsInterfaces/galleries.ts b/sdk/devcenter/arm-devcenter/src/operationsInterfaces/galleries.ts new file mode 100644 index 000000000000..8bf2c36e0889 --- /dev/null +++ b/sdk/devcenter/arm-devcenter/src/operationsInterfaces/galleries.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 { + Gallery, + GalleriesListByDevCenterOptionalParams, + GalleriesGetOptionalParams, + GalleriesGetResponse, + GalleriesCreateOrUpdateOptionalParams, + GalleriesCreateOrUpdateResponse, + GalleriesDeleteOptionalParams +} from "../models"; + +/// +/** Interface representing a Galleries. */ +export interface Galleries { + /** + * Lists galleries for a devcenter. + * @param resourceGroupName Name of the resource group within the Azure subscription. + * @param devCenterName The name of the devcenter. + * @param options The options parameters. + */ + listByDevCenter( + resourceGroupName: string, + devCenterName: string, + options?: GalleriesListByDevCenterOptionalParams + ): PagedAsyncIterableIterator; + /** + * Gets a gallery + * @param resourceGroupName Name of the resource group within the Azure subscription. + * @param devCenterName The name of the devcenter. + * @param galleryName The name of the gallery. + * @param options The options parameters. + */ + get( + resourceGroupName: string, + devCenterName: string, + galleryName: string, + options?: GalleriesGetOptionalParams + ): Promise; + /** + * Creates or updates a gallery. + * @param resourceGroupName Name of the resource group within the Azure subscription. + * @param devCenterName The name of the devcenter. + * @param galleryName The name of the gallery. + * @param body Represents a gallery. + * @param options The options parameters. + */ + beginCreateOrUpdate( + resourceGroupName: string, + devCenterName: string, + galleryName: string, + body: Gallery, + options?: GalleriesCreateOrUpdateOptionalParams + ): Promise< + PollerLike< + PollOperationState, + GalleriesCreateOrUpdateResponse + > + >; + /** + * Creates or updates a gallery. + * @param resourceGroupName Name of the resource group within the Azure subscription. + * @param devCenterName The name of the devcenter. + * @param galleryName The name of the gallery. + * @param body Represents a gallery. + * @param options The options parameters. + */ + beginCreateOrUpdateAndWait( + resourceGroupName: string, + devCenterName: string, + galleryName: string, + body: Gallery, + options?: GalleriesCreateOrUpdateOptionalParams + ): Promise; + /** + * Deletes a gallery resource. + * @param resourceGroupName Name of the resource group within the Azure subscription. + * @param devCenterName The name of the devcenter. + * @param galleryName The name of the gallery. + * @param options The options parameters. + */ + beginDelete( + resourceGroupName: string, + devCenterName: string, + galleryName: string, + options?: GalleriesDeleteOptionalParams + ): Promise, void>>; + /** + * Deletes a gallery resource. + * @param resourceGroupName Name of the resource group within the Azure subscription. + * @param devCenterName The name of the devcenter. + * @param galleryName The name of the gallery. + * @param options The options parameters. + */ + beginDeleteAndWait( + resourceGroupName: string, + devCenterName: string, + galleryName: string, + options?: GalleriesDeleteOptionalParams + ): Promise; +} diff --git a/sdk/devcenter/arm-devcenter/src/operationsInterfaces/imageVersions.ts b/sdk/devcenter/arm-devcenter/src/operationsInterfaces/imageVersions.ts new file mode 100644 index 000000000000..d75d99a40176 --- /dev/null +++ b/sdk/devcenter/arm-devcenter/src/operationsInterfaces/imageVersions.ts @@ -0,0 +1,52 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +import { PagedAsyncIterableIterator } from "@azure/core-paging"; +import { + ImageVersion, + ImageVersionsListByImageOptionalParams, + ImageVersionsGetOptionalParams, + ImageVersionsGetResponse +} from "../models"; + +/// +/** Interface representing a ImageVersions. */ +export interface ImageVersions { + /** + * Lists versions for an image. + * @param resourceGroupName Name of the resource group within the Azure subscription. + * @param devCenterName The name of the devcenter. + * @param galleryName The name of the gallery. + * @param imageName The name of the image. + * @param options The options parameters. + */ + listByImage( + resourceGroupName: string, + devCenterName: string, + galleryName: string, + imageName: string, + options?: ImageVersionsListByImageOptionalParams + ): PagedAsyncIterableIterator; + /** + * Gets an image version. + * @param resourceGroupName Name of the resource group within the Azure subscription. + * @param devCenterName The name of the devcenter. + * @param galleryName The name of the gallery. + * @param imageName The name of the image. + * @param versionName The version of the image. + * @param options The options parameters. + */ + get( + resourceGroupName: string, + devCenterName: string, + galleryName: string, + imageName: string, + versionName: string, + options?: ImageVersionsGetOptionalParams + ): Promise; +} diff --git a/sdk/devcenter/arm-devcenter/src/operationsInterfaces/images.ts b/sdk/devcenter/arm-devcenter/src/operationsInterfaces/images.ts new file mode 100644 index 000000000000..70f256304ebd --- /dev/null +++ b/sdk/devcenter/arm-devcenter/src/operationsInterfaces/images.ts @@ -0,0 +1,60 @@ +/* + * 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 { + Image, + ImagesListByDevCenterOptionalParams, + ImagesListByGalleryOptionalParams, + ImagesGetOptionalParams, + ImagesGetResponse +} from "../models"; + +/// +/** Interface representing a Images. */ +export interface Images { + /** + * Lists images for a devcenter. + * @param resourceGroupName Name of the resource group within the Azure subscription. + * @param devCenterName The name of the devcenter. + * @param options The options parameters. + */ + listByDevCenter( + resourceGroupName: string, + devCenterName: string, + options?: ImagesListByDevCenterOptionalParams + ): PagedAsyncIterableIterator; + /** + * Lists images for a gallery. + * @param resourceGroupName Name of the resource group within the Azure subscription. + * @param devCenterName The name of the devcenter. + * @param galleryName The name of the gallery. + * @param options The options parameters. + */ + listByGallery( + resourceGroupName: string, + devCenterName: string, + galleryName: string, + options?: ImagesListByGalleryOptionalParams + ): PagedAsyncIterableIterator; + /** + * Gets a gallery image. + * @param resourceGroupName Name of the resource group within the Azure subscription. + * @param devCenterName The name of the devcenter. + * @param galleryName The name of the gallery. + * @param imageName The name of the image. + * @param options The options parameters. + */ + get( + resourceGroupName: string, + devCenterName: string, + galleryName: string, + imageName: string, + options?: ImagesGetOptionalParams + ): Promise; +} diff --git a/sdk/devcenter/arm-devcenter/src/operationsInterfaces/index.ts b/sdk/devcenter/arm-devcenter/src/operationsInterfaces/index.ts new file mode 100644 index 000000000000..769e93dedc14 --- /dev/null +++ b/sdk/devcenter/arm-devcenter/src/operationsInterfaces/index.ts @@ -0,0 +1,25 @@ +/* + * 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 "./devCenters"; +export * from "./projects"; +export * from "./attachedNetworks"; +export * from "./galleries"; +export * from "./images"; +export * from "./imageVersions"; +export * from "./catalogs"; +export * from "./environmentTypes"; +export * from "./projectEnvironmentTypes"; +export * from "./devBoxDefinitions"; +export * from "./operations"; +export * from "./operationStatuses"; +export * from "./usages"; +export * from "./skus"; +export * from "./pools"; +export * from "./schedules"; +export * from "./networkConnections"; diff --git a/sdk/devcenter/arm-devcenter/src/operationsInterfaces/networkConnections.ts b/sdk/devcenter/arm-devcenter/src/operationsInterfaces/networkConnections.ts new file mode 100644 index 000000000000..fa96f29869d8 --- /dev/null +++ b/sdk/devcenter/arm-devcenter/src/operationsInterfaces/networkConnections.ts @@ -0,0 +1,178 @@ +/* + * 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 { + NetworkConnection, + NetworkConnectionsListBySubscriptionOptionalParams, + NetworkConnectionsListByResourceGroupOptionalParams, + HealthCheckStatusDetails, + NetworkConnectionsListHealthDetailsOptionalParams, + NetworkConnectionsGetOptionalParams, + NetworkConnectionsGetResponse, + NetworkConnectionsCreateOrUpdateOptionalParams, + NetworkConnectionsCreateOrUpdateResponse, + NetworkConnectionUpdate, + NetworkConnectionsUpdateOptionalParams, + NetworkConnectionsUpdateResponse, + NetworkConnectionsDeleteOptionalParams, + NetworkConnectionsGetHealthDetailsOptionalParams, + NetworkConnectionsGetHealthDetailsResponse, + NetworkConnectionsRunHealthChecksOptionalParams +} from "../models"; + +/// +/** Interface representing a NetworkConnections. */ +export interface NetworkConnections { + /** + * Lists network connections in a subscription + * @param options The options parameters. + */ + listBySubscription( + options?: NetworkConnectionsListBySubscriptionOptionalParams + ): PagedAsyncIterableIterator; + /** + * Lists network connections in a resource group + * @param resourceGroupName Name of the resource group within the Azure subscription. + * @param options The options parameters. + */ + listByResourceGroup( + resourceGroupName: string, + options?: NetworkConnectionsListByResourceGroupOptionalParams + ): PagedAsyncIterableIterator; + /** + * Lists health check status details + * @param resourceGroupName Name of the resource group within the Azure subscription. + * @param networkConnectionName Name of the Network Connection that can be applied to a Pool. + * @param options The options parameters. + */ + listHealthDetails( + resourceGroupName: string, + networkConnectionName: string, + options?: NetworkConnectionsListHealthDetailsOptionalParams + ): PagedAsyncIterableIterator; + /** + * Gets a network connection resource + * @param resourceGroupName Name of the resource group within the Azure subscription. + * @param networkConnectionName Name of the Network Connection that can be applied to a Pool. + * @param options The options parameters. + */ + get( + resourceGroupName: string, + networkConnectionName: string, + options?: NetworkConnectionsGetOptionalParams + ): Promise; + /** + * Creates or updates a Network Connections resource + * @param resourceGroupName Name of the resource group within the Azure subscription. + * @param networkConnectionName Name of the Network Connection that can be applied to a Pool. + * @param body Represents network connection + * @param options The options parameters. + */ + beginCreateOrUpdate( + resourceGroupName: string, + networkConnectionName: string, + body: NetworkConnection, + options?: NetworkConnectionsCreateOrUpdateOptionalParams + ): Promise< + PollerLike< + PollOperationState, + NetworkConnectionsCreateOrUpdateResponse + > + >; + /** + * Creates or updates a Network Connections resource + * @param resourceGroupName Name of the resource group within the Azure subscription. + * @param networkConnectionName Name of the Network Connection that can be applied to a Pool. + * @param body Represents network connection + * @param options The options parameters. + */ + beginCreateOrUpdateAndWait( + resourceGroupName: string, + networkConnectionName: string, + body: NetworkConnection, + options?: NetworkConnectionsCreateOrUpdateOptionalParams + ): Promise; + /** + * Partially updates a Network Connection + * @param resourceGroupName Name of the resource group within the Azure subscription. + * @param networkConnectionName Name of the Network Connection that can be applied to a Pool. + * @param body Represents network connection + * @param options The options parameters. + */ + beginUpdate( + resourceGroupName: string, + networkConnectionName: string, + body: NetworkConnectionUpdate, + options?: NetworkConnectionsUpdateOptionalParams + ): Promise< + PollerLike< + PollOperationState, + NetworkConnectionsUpdateResponse + > + >; + /** + * Partially updates a Network Connection + * @param resourceGroupName Name of the resource group within the Azure subscription. + * @param networkConnectionName Name of the Network Connection that can be applied to a Pool. + * @param body Represents network connection + * @param options The options parameters. + */ + beginUpdateAndWait( + resourceGroupName: string, + networkConnectionName: string, + body: NetworkConnectionUpdate, + options?: NetworkConnectionsUpdateOptionalParams + ): Promise; + /** + * Deletes a Network Connections resource + * @param resourceGroupName Name of the resource group within the Azure subscription. + * @param networkConnectionName Name of the Network Connection that can be applied to a Pool. + * @param options The options parameters. + */ + beginDelete( + resourceGroupName: string, + networkConnectionName: string, + options?: NetworkConnectionsDeleteOptionalParams + ): Promise, void>>; + /** + * Deletes a Network Connections resource + * @param resourceGroupName Name of the resource group within the Azure subscription. + * @param networkConnectionName Name of the Network Connection that can be applied to a Pool. + * @param options The options parameters. + */ + beginDeleteAndWait( + resourceGroupName: string, + networkConnectionName: string, + options?: NetworkConnectionsDeleteOptionalParams + ): Promise; + /** + * Gets health check status details. + * @param resourceGroupName Name of the resource group within the Azure subscription. + * @param networkConnectionName Name of the Network Connection that can be applied to a Pool. + * @param options The options parameters. + */ + getHealthDetails( + resourceGroupName: string, + networkConnectionName: string, + options?: NetworkConnectionsGetHealthDetailsOptionalParams + ): Promise; + /** + * Triggers a new health check run. The execution and health check result can be tracked via the + * network Connection health check details + * @param resourceGroupName Name of the resource group within the Azure subscription. + * @param networkConnectionName Name of the Network Connection that can be applied to a Pool. + * @param options The options parameters. + */ + runHealthChecks( + resourceGroupName: string, + networkConnectionName: string, + options?: NetworkConnectionsRunHealthChecksOptionalParams + ): Promise; +} diff --git a/sdk/devcenter/arm-devcenter/src/operationsInterfaces/operationStatuses.ts b/sdk/devcenter/arm-devcenter/src/operationsInterfaces/operationStatuses.ts new file mode 100644 index 000000000000..e7f1affbe6a6 --- /dev/null +++ b/sdk/devcenter/arm-devcenter/src/operationsInterfaces/operationStatuses.ts @@ -0,0 +1,27 @@ +/* + * 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 { + OperationStatusesGetOptionalParams, + OperationStatusesGetResponse +} from "../models"; + +/** Interface representing a OperationStatuses. */ +export interface OperationStatuses { + /** + * Gets the current status of an async operation. + * @param location The Azure region + * @param operationId The ID of an ongoing async operation + * @param options The options parameters. + */ + get( + location: string, + operationId: string, + options?: OperationStatusesGetOptionalParams + ): Promise; +} diff --git a/sdk/devcenter/arm-devcenter/src/operationsInterfaces/operations.ts b/sdk/devcenter/arm-devcenter/src/operationsInterfaces/operations.ts new file mode 100644 index 000000000000..45f50291c7b3 --- /dev/null +++ b/sdk/devcenter/arm-devcenter/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 resource provider operations. + * @param options The options parameters. + */ + list( + options?: OperationsListOptionalParams + ): PagedAsyncIterableIterator; +} diff --git a/sdk/devcenter/arm-devcenter/src/operationsInterfaces/pools.ts b/sdk/devcenter/arm-devcenter/src/operationsInterfaces/pools.ts new file mode 100644 index 000000000000..9bd362651e1a --- /dev/null +++ b/sdk/devcenter/arm-devcenter/src/operationsInterfaces/pools.ts @@ -0,0 +1,144 @@ +/* + * 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 { + Pool, + PoolsListByProjectOptionalParams, + PoolsGetOptionalParams, + PoolsGetResponse, + PoolsCreateOrUpdateOptionalParams, + PoolsCreateOrUpdateResponse, + PoolUpdate, + PoolsUpdateOptionalParams, + PoolsUpdateResponse, + PoolsDeleteOptionalParams +} from "../models"; + +/// +/** Interface representing a Pools. */ +export interface Pools { + /** + * Lists pools for a project + * @param resourceGroupName Name of the resource group within the Azure subscription. + * @param projectName The name of the project. + * @param options The options parameters. + */ + listByProject( + resourceGroupName: string, + projectName: string, + options?: PoolsListByProjectOptionalParams + ): PagedAsyncIterableIterator; + /** + * Gets a machine pool + * @param resourceGroupName Name of the resource group within the Azure subscription. + * @param projectName The name of the project. + * @param poolName Name of the pool. + * @param options The options parameters. + */ + get( + resourceGroupName: string, + projectName: string, + poolName: string, + options?: PoolsGetOptionalParams + ): Promise; + /** + * Creates or updates a machine pool + * @param resourceGroupName Name of the resource group within the Azure subscription. + * @param projectName The name of the project. + * @param poolName Name of the pool. + * @param body Represents a machine pool + * @param options The options parameters. + */ + beginCreateOrUpdate( + resourceGroupName: string, + projectName: string, + poolName: string, + body: Pool, + options?: PoolsCreateOrUpdateOptionalParams + ): Promise< + PollerLike< + PollOperationState, + PoolsCreateOrUpdateResponse + > + >; + /** + * Creates or updates a machine pool + * @param resourceGroupName Name of the resource group within the Azure subscription. + * @param projectName The name of the project. + * @param poolName Name of the pool. + * @param body Represents a machine pool + * @param options The options parameters. + */ + beginCreateOrUpdateAndWait( + resourceGroupName: string, + projectName: string, + poolName: string, + body: Pool, + options?: PoolsCreateOrUpdateOptionalParams + ): Promise; + /** + * Partially updates a machine pool + * @param resourceGroupName Name of the resource group within the Azure subscription. + * @param projectName The name of the project. + * @param poolName Name of the pool. + * @param body Represents a machine pool + * @param options The options parameters. + */ + beginUpdate( + resourceGroupName: string, + projectName: string, + poolName: string, + body: PoolUpdate, + options?: PoolsUpdateOptionalParams + ): Promise< + PollerLike, PoolsUpdateResponse> + >; + /** + * Partially updates a machine pool + * @param resourceGroupName Name of the resource group within the Azure subscription. + * @param projectName The name of the project. + * @param poolName Name of the pool. + * @param body Represents a machine pool + * @param options The options parameters. + */ + beginUpdateAndWait( + resourceGroupName: string, + projectName: string, + poolName: string, + body: PoolUpdate, + options?: PoolsUpdateOptionalParams + ): Promise; + /** + * Deletes a machine pool + * @param resourceGroupName Name of the resource group within the Azure subscription. + * @param projectName The name of the project. + * @param poolName Name of the pool. + * @param options The options parameters. + */ + beginDelete( + resourceGroupName: string, + projectName: string, + poolName: string, + options?: PoolsDeleteOptionalParams + ): Promise, void>>; + /** + * Deletes a machine pool + * @param resourceGroupName Name of the resource group within the Azure subscription. + * @param projectName The name of the project. + * @param poolName Name of the pool. + * @param options The options parameters. + */ + beginDeleteAndWait( + resourceGroupName: string, + projectName: string, + poolName: string, + options?: PoolsDeleteOptionalParams + ): Promise; +} diff --git a/sdk/devcenter/arm-devcenter/src/operationsInterfaces/projectEnvironmentTypes.ts b/sdk/devcenter/arm-devcenter/src/operationsInterfaces/projectEnvironmentTypes.ts new file mode 100644 index 000000000000..0859e968cd22 --- /dev/null +++ b/sdk/devcenter/arm-devcenter/src/operationsInterfaces/projectEnvironmentTypes.ts @@ -0,0 +1,93 @@ +/* + * 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 { + ProjectEnvironmentType, + ProjectEnvironmentTypesListOptionalParams, + ProjectEnvironmentTypesGetOptionalParams, + ProjectEnvironmentTypesGetResponse, + ProjectEnvironmentTypesCreateOrUpdateOptionalParams, + ProjectEnvironmentTypesCreateOrUpdateResponse, + ProjectEnvironmentTypeUpdate, + ProjectEnvironmentTypesUpdateOptionalParams, + ProjectEnvironmentTypesUpdateResponse, + ProjectEnvironmentTypesDeleteOptionalParams +} from "../models"; + +/// +/** Interface representing a ProjectEnvironmentTypes. */ +export interface ProjectEnvironmentTypes { + /** + * Lists environment types for a project. + * @param resourceGroupName Name of the resource group within the Azure subscription. + * @param projectName The name of the project. + * @param options The options parameters. + */ + list( + resourceGroupName: string, + projectName: string, + options?: ProjectEnvironmentTypesListOptionalParams + ): PagedAsyncIterableIterator; + /** + * Gets a project environment type. + * @param resourceGroupName Name of the resource group within the Azure subscription. + * @param projectName The name of the project. + * @param environmentTypeName The name of the environment type. + * @param options The options parameters. + */ + get( + resourceGroupName: string, + projectName: string, + environmentTypeName: string, + options?: ProjectEnvironmentTypesGetOptionalParams + ): Promise; + /** + * Creates or updates a project environment type. + * @param resourceGroupName Name of the resource group within the Azure subscription. + * @param projectName The name of the project. + * @param environmentTypeName The name of the environment type. + * @param body Represents a Project Environment Type. + * @param options The options parameters. + */ + createOrUpdate( + resourceGroupName: string, + projectName: string, + environmentTypeName: string, + body: ProjectEnvironmentType, + options?: ProjectEnvironmentTypesCreateOrUpdateOptionalParams + ): Promise; + /** + * Partially updates a project environment type. + * @param resourceGroupName Name of the resource group within the Azure subscription. + * @param projectName The name of the project. + * @param environmentTypeName The name of the environment type. + * @param body Updatable project environment type properties. + * @param options The options parameters. + */ + update( + resourceGroupName: string, + projectName: string, + environmentTypeName: string, + body: ProjectEnvironmentTypeUpdate, + options?: ProjectEnvironmentTypesUpdateOptionalParams + ): Promise; + /** + * Deletes a project environment type. + * @param resourceGroupName Name of the resource group within the Azure subscription. + * @param projectName The name of the project. + * @param environmentTypeName The name of the environment type. + * @param options The options parameters. + */ + delete( + resourceGroupName: string, + projectName: string, + environmentTypeName: string, + options?: ProjectEnvironmentTypesDeleteOptionalParams + ): Promise; +} diff --git a/sdk/devcenter/arm-devcenter/src/operationsInterfaces/projects.ts b/sdk/devcenter/arm-devcenter/src/operationsInterfaces/projects.ts new file mode 100644 index 000000000000..bba8332c21ae --- /dev/null +++ b/sdk/devcenter/arm-devcenter/src/operationsInterfaces/projects.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 { PollerLike, PollOperationState } from "@azure/core-lro"; +import { + Project, + ProjectsListBySubscriptionOptionalParams, + ProjectsListByResourceGroupOptionalParams, + ProjectsGetOptionalParams, + ProjectsGetResponse, + ProjectsCreateOrUpdateOptionalParams, + ProjectsCreateOrUpdateResponse, + ProjectUpdate, + ProjectsUpdateOptionalParams, + ProjectsUpdateResponse, + ProjectsDeleteOptionalParams +} from "../models"; + +/// +/** Interface representing a Projects. */ +export interface Projects { + /** + * Lists all projects in the subscription. + * @param options The options parameters. + */ + listBySubscription( + options?: ProjectsListBySubscriptionOptionalParams + ): PagedAsyncIterableIterator; + /** + * Lists all projects in the resource group. + * @param resourceGroupName Name of the resource group within the Azure subscription. + * @param options The options parameters. + */ + listByResourceGroup( + resourceGroupName: string, + options?: ProjectsListByResourceGroupOptionalParams + ): PagedAsyncIterableIterator; + /** + * Gets a specific project. + * @param resourceGroupName Name of the resource group within the Azure subscription. + * @param projectName The name of the project. + * @param options The options parameters. + */ + get( + resourceGroupName: string, + projectName: string, + options?: ProjectsGetOptionalParams + ): Promise; + /** + * Creates or updates a project. + * @param resourceGroupName Name of the resource group within the Azure subscription. + * @param projectName The name of the project. + * @param body Represents a project. + * @param options The options parameters. + */ + beginCreateOrUpdate( + resourceGroupName: string, + projectName: string, + body: Project, + options?: ProjectsCreateOrUpdateOptionalParams + ): Promise< + PollerLike< + PollOperationState, + ProjectsCreateOrUpdateResponse + > + >; + /** + * Creates or updates a project. + * @param resourceGroupName Name of the resource group within the Azure subscription. + * @param projectName The name of the project. + * @param body Represents a project. + * @param options The options parameters. + */ + beginCreateOrUpdateAndWait( + resourceGroupName: string, + projectName: string, + body: Project, + options?: ProjectsCreateOrUpdateOptionalParams + ): Promise; + /** + * Partially updates a project. + * @param resourceGroupName Name of the resource group within the Azure subscription. + * @param projectName The name of the project. + * @param body Updatable project properties. + * @param options The options parameters. + */ + beginUpdate( + resourceGroupName: string, + projectName: string, + body: ProjectUpdate, + options?: ProjectsUpdateOptionalParams + ): Promise< + PollerLike< + PollOperationState, + ProjectsUpdateResponse + > + >; + /** + * Partially updates a project. + * @param resourceGroupName Name of the resource group within the Azure subscription. + * @param projectName The name of the project. + * @param body Updatable project properties. + * @param options The options parameters. + */ + beginUpdateAndWait( + resourceGroupName: string, + projectName: string, + body: ProjectUpdate, + options?: ProjectsUpdateOptionalParams + ): Promise; + /** + * Deletes a project resource. + * @param resourceGroupName Name of the resource group within the Azure subscription. + * @param projectName The name of the project. + * @param options The options parameters. + */ + beginDelete( + resourceGroupName: string, + projectName: string, + options?: ProjectsDeleteOptionalParams + ): Promise, void>>; + /** + * Deletes a project resource. + * @param resourceGroupName Name of the resource group within the Azure subscription. + * @param projectName The name of the project. + * @param options The options parameters. + */ + beginDeleteAndWait( + resourceGroupName: string, + projectName: string, + options?: ProjectsDeleteOptionalParams + ): Promise; +} diff --git a/sdk/devcenter/arm-devcenter/src/operationsInterfaces/schedules.ts b/sdk/devcenter/arm-devcenter/src/operationsInterfaces/schedules.ts new file mode 100644 index 000000000000..eda812cd36d7 --- /dev/null +++ b/sdk/devcenter/arm-devcenter/src/operationsInterfaces/schedules.ts @@ -0,0 +1,157 @@ +/* + * 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 { + Schedule, + SchedulesListByPoolOptionalParams, + SchedulesGetOptionalParams, + SchedulesGetResponse, + SchedulesCreateOrUpdateOptionalParams, + SchedulesCreateOrUpdateResponse, + ScheduleUpdate, + SchedulesUpdateOptionalParams, + SchedulesDeleteOptionalParams +} from "../models"; + +/// +/** Interface representing a Schedules. */ +export interface Schedules { + /** + * Lists schedules for a pool + * @param resourceGroupName Name of the resource group within the Azure subscription. + * @param projectName The name of the project. + * @param poolName Name of the pool. + * @param options The options parameters. + */ + listByPool( + resourceGroupName: string, + projectName: string, + poolName: string, + options?: SchedulesListByPoolOptionalParams + ): PagedAsyncIterableIterator; + /** + * Gets a schedule resource. + * @param resourceGroupName Name of the resource group within the Azure subscription. + * @param projectName The name of the project. + * @param poolName Name of the pool. + * @param scheduleName The name of the schedule that uniquely identifies it. + * @param options The options parameters. + */ + get( + resourceGroupName: string, + projectName: string, + poolName: string, + scheduleName: string, + options?: SchedulesGetOptionalParams + ): Promise; + /** + * Creates or updates a Schedule. + * @param resourceGroupName Name of the resource group within the Azure subscription. + * @param projectName The name of the project. + * @param poolName Name of the pool. + * @param scheduleName The name of the schedule that uniquely identifies it. + * @param body Represents a scheduled task + * @param options The options parameters. + */ + beginCreateOrUpdate( + resourceGroupName: string, + projectName: string, + poolName: string, + scheduleName: string, + body: Schedule, + options?: SchedulesCreateOrUpdateOptionalParams + ): Promise< + PollerLike< + PollOperationState, + SchedulesCreateOrUpdateResponse + > + >; + /** + * Creates or updates a Schedule. + * @param resourceGroupName Name of the resource group within the Azure subscription. + * @param projectName The name of the project. + * @param poolName Name of the pool. + * @param scheduleName The name of the schedule that uniquely identifies it. + * @param body Represents a scheduled task + * @param options The options parameters. + */ + beginCreateOrUpdateAndWait( + resourceGroupName: string, + projectName: string, + poolName: string, + scheduleName: string, + body: Schedule, + options?: SchedulesCreateOrUpdateOptionalParams + ): Promise; + /** + * Partially updates a Scheduled. + * @param resourceGroupName Name of the resource group within the Azure subscription. + * @param projectName The name of the project. + * @param poolName Name of the pool. + * @param scheduleName The name of the schedule that uniquely identifies it. + * @param body Represents a scheduled task. + * @param options The options parameters. + */ + beginUpdate( + resourceGroupName: string, + projectName: string, + poolName: string, + scheduleName: string, + body: ScheduleUpdate, + options?: SchedulesUpdateOptionalParams + ): Promise, void>>; + /** + * Partially updates a Scheduled. + * @param resourceGroupName Name of the resource group within the Azure subscription. + * @param projectName The name of the project. + * @param poolName Name of the pool. + * @param scheduleName The name of the schedule that uniquely identifies it. + * @param body Represents a scheduled task. + * @param options The options parameters. + */ + beginUpdateAndWait( + resourceGroupName: string, + projectName: string, + poolName: string, + scheduleName: string, + body: ScheduleUpdate, + options?: SchedulesUpdateOptionalParams + ): Promise; + /** + * Deletes a Scheduled. + * @param resourceGroupName Name of the resource group within the Azure subscription. + * @param projectName The name of the project. + * @param poolName Name of the pool. + * @param scheduleName The name of the schedule that uniquely identifies it. + * @param options The options parameters. + */ + beginDelete( + resourceGroupName: string, + projectName: string, + poolName: string, + scheduleName: string, + options?: SchedulesDeleteOptionalParams + ): Promise, void>>; + /** + * Deletes a Scheduled. + * @param resourceGroupName Name of the resource group within the Azure subscription. + * @param projectName The name of the project. + * @param poolName Name of the pool. + * @param scheduleName The name of the schedule that uniquely identifies it. + * @param options The options parameters. + */ + beginDeleteAndWait( + resourceGroupName: string, + projectName: string, + poolName: string, + scheduleName: string, + options?: SchedulesDeleteOptionalParams + ): Promise; +} diff --git a/sdk/devcenter/arm-devcenter/src/operationsInterfaces/skus.ts b/sdk/devcenter/arm-devcenter/src/operationsInterfaces/skus.ts new file mode 100644 index 000000000000..732bfaad17de --- /dev/null +++ b/sdk/devcenter/arm-devcenter/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 { DevCenterSku, SkusListBySubscriptionOptionalParams } from "../models"; + +/// +/** Interface representing a Skus. */ +export interface Skus { + /** + * Lists the Microsoft.DevCenter SKUs available in a subscription + * @param options The options parameters. + */ + listBySubscription( + options?: SkusListBySubscriptionOptionalParams + ): PagedAsyncIterableIterator; +} diff --git a/sdk/devcenter/arm-devcenter/src/operationsInterfaces/usages.ts b/sdk/devcenter/arm-devcenter/src/operationsInterfaces/usages.ts new file mode 100644 index 000000000000..3a3153fa79d2 --- /dev/null +++ b/sdk/devcenter/arm-devcenter/src/operationsInterfaces/usages.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. + */ + +import { PagedAsyncIterableIterator } from "@azure/core-paging"; +import { Usage, UsagesListByLocationOptionalParams } from "../models"; + +/// +/** Interface representing a Usages. */ +export interface Usages { + /** + * Lists the current usages and limits in this location for the provided subscription. + * @param location The Azure region + * @param options The options parameters. + */ + listByLocation( + location: string, + options?: UsagesListByLocationOptionalParams + ): PagedAsyncIterableIterator; +} diff --git a/sdk/devcenter/arm-devcenter/test/sampleTest.ts b/sdk/devcenter/arm-devcenter/test/sampleTest.ts new file mode 100644 index 000000000000..25aeb3ebcc36 --- /dev/null +++ b/sdk/devcenter/arm-devcenter/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/devcenter/arm-devcenter/tsconfig.json b/sdk/devcenter/arm-devcenter/tsconfig.json new file mode 100644 index 000000000000..3e6ae96443f3 --- /dev/null +++ b/sdk/devcenter/arm-devcenter/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/devcenter/ci.mgmt.yml b/sdk/devcenter/ci.mgmt.yml new file mode 100644 index 000000000000..51ce2ea925a0 --- /dev/null +++ b/sdk/devcenter/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/devcenter/arm-devcenter + - sdk/devcenter/ci.mgmt.yml + +pr: + branches: + include: + - main + - feature/* + - release/* + - hotfix/* + exclude: + - feature/v4 + paths: + include: + - sdk/devcenter/arm-devcenter + - sdk/devcenter/ci.mgmt.yml + +extends: + template: /eng/pipelines/templates/stages/archetype-sdk-client.yml + parameters: + ServiceDirectory: devcenter + Artifacts: + - name: azure-arm-devcenter + safeName: azurearmdevcenter + \ No newline at end of file