From 2f19d0e1dcf2dfecb13395809e03f8f40e923a28 Mon Sep 17 00:00:00 2001 From: SDKAuto Date: Tue, 26 Nov 2024 03:26:32 +0000 Subject: [PATCH] CodeGen from PR 31422 in Azure/azure-rest-api-specs Merge 542c252d0ef13668bac0f11a035554854e98bc87 into 836e5f8f4b344700f1b6d35c3ec50ce2c2b176bf --- common/config/rush/pnpm-lock.yaml | 30 +- .../arm-devopsinfrastructure/CHANGELOG.md | 15 - .../arm-devopsinfrastructure/README.md | 39 +- .../arm-devopsinfrastructure/_meta.json | 8 - .../api-extractor.json | 27 +- .../arm-devopsinfrastructure/assets.json | 6 - .../eslint.config.mjs | 17 + .../arm-devopsinfrastructure/package.json | 166 +- .../review/arm-devopsinfrastructure.api.md | 828 ------- .../arm-devopsinfrastructure/sample.env | 5 +- .../imageVersionsListByImageSample.ts | 46 - .../samples-dev/operationsListSample.ts | 40 - .../samples-dev/poolsCreateOrUpdateSample.ts | 71 - .../samples-dev/poolsDeleteSample.ts | 43 - .../samples-dev/poolsGetSample.ts | 40 - .../poolsListByResourceGroupSample.ts | 42 - .../poolsListBySubscriptionSample.ts | 40 - .../samples-dev/poolsUpdateSample.ts | 48 - .../resourceDetailsListByPoolSample.ts | 46 - .../samples-dev/skuListByLocationSample.ts | 41 - .../subscriptionUsagesListByLocationSample.ts | 43 - .../samples/v1-beta/javascript/README.md | 70 - .../imageVersionsListByImageSample.js | 40 - .../javascript/operationsListSample.js | 37 - .../samples/v1-beta/javascript/package.json | 32 - .../javascript/poolsCreateOrUpdateSample.js | 63 - .../v1-beta/javascript/poolsDeleteSample.js | 36 - .../v1-beta/javascript/poolsGetSample.js | 36 - .../poolsListByResourceGroupSample.js | 38 - .../poolsListBySubscriptionSample.js | 37 - .../v1-beta/javascript/poolsUpdateSample.js | 37 - .../resourceDetailsListByPoolSample.js | 40 - .../samples/v1-beta/javascript/sample.env | 4 - .../javascript/skuListByLocationSample.js | 38 - .../subscriptionUsagesListByLocationSample.js | 38 - .../samples/v1-beta/typescript/README.md | 83 - .../samples/v1-beta/typescript/package.json | 41 - .../samples/v1-beta/typescript/sample.env | 4 - .../src/imageVersionsListByImageSample.ts | 46 - .../typescript/src/operationsListSample.ts | 40 - .../src/poolsCreateOrUpdateSample.ts | 71 - .../typescript/src/poolsDeleteSample.ts | 43 - .../v1-beta/typescript/src/poolsGetSample.ts | 40 - .../src/poolsListByResourceGroupSample.ts | 42 - .../src/poolsListBySubscriptionSample.ts | 40 - .../typescript/src/poolsUpdateSample.ts | 48 - .../src/resourceDetailsListByPoolSample.ts | 46 - .../typescript/src/skuListByLocationSample.ts | 41 - .../subscriptionUsagesListByLocationSample.ts | 43 - .../samples/v1-beta/typescript/tsconfig.json | 17 - .../src/api/devOpsInfrastructureContext.ts | 57 + .../src/api/imageVersions/index.ts | 74 + .../arm-devopsinfrastructure/src/api/index.ts | 36 + .../src/api/operations/index.ts | 56 + .../src/api/options.ts | 55 + .../src/api/pools/index.ts | 395 +++ .../src/api/resourceDetails/index.ts | 74 + .../src/api/sku/index.ts | 65 + .../src/api/subscriptionUsages/index.ts | 65 + .../src/classic/imageVersions/index.ts | 47 + .../src/classic/index.ts | 9 + .../src/classic/operations/index.ts | 31 + .../src/classic/pools/index.ts | 153 ++ .../src/classic/resourceDetails/index.ts | 47 + .../src/classic/sku/index.ts | 38 + .../src/classic/subscriptionUsages/index.ts | 38 + .../src/devOpsInfrastructureClient.ts | 80 + .../src/helpers/serializerHelpers.ts | 40 + .../arm-devopsinfrastructure/src/index.ts | 141 +- .../arm-devopsinfrastructure/src/logger.ts | 5 + .../arm-devopsinfrastructure/src/lroImpl.ts | 42 - .../src/managedDevOpsInfrastructure.ts | 165 -- .../src/models/index.ts | 1295 +--------- .../src/models/mappers.ts | 1899 -------------- .../src/models/models.ts | 2180 +++++++++++++++++ .../src/models/parameters.ts | 155 -- .../src/operations/imageVersions.ts | 197 -- .../src/operations/index.ts | 14 - .../src/operations/operations.ts | 149 -- .../src/operations/pools.ts | 718 ------ .../src/operations/resourceDetails.ts | 193 -- .../src/operations/sku.ts | 176 -- .../src/operations/subscriptionUsages.ts | 176 -- .../src/operationsInterfaces/imageVersions.ts | 29 - .../src/operationsInterfaces/index.ts | 14 - .../src/operationsInterfaces/operations.ts | 22 - .../src/operationsInterfaces/pools.ts | 139 -- .../operationsInterfaces/resourceDetails.ts | 29 - .../src/operationsInterfaces/sku.ts | 24 - .../subscriptionUsages.ts | 27 - .../src/pagingHelper.ts | 39 - .../src/restorePollerHelpers.ts | 177 ++ .../src/static-helpers/pagingHelpers.ts | 277 +++ .../src/static-helpers/pollingHelpers.ts | 140 ++ ...vopsinfrastructure_operations_test.spec.ts | 69 - .../test/public/sampleTest.spec.ts | 21 + .../test/public/utils/recordedClient.ts | 29 + .../tsconfig.browser.config.json | 10 + .../arm-devopsinfrastructure/tsconfig.json | 39 +- .../tsp-location.yaml | 4 + .../vitest.browser.config.ts | 38 + .../arm-devopsinfrastructure/vitest.config.ts | 34 + 102 files changed, 4661 insertions(+), 8197 deletions(-) delete mode 100644 sdk/devopsinfrastructure/arm-devopsinfrastructure/CHANGELOG.md delete mode 100644 sdk/devopsinfrastructure/arm-devopsinfrastructure/_meta.json delete mode 100644 sdk/devopsinfrastructure/arm-devopsinfrastructure/assets.json create mode 100644 sdk/devopsinfrastructure/arm-devopsinfrastructure/eslint.config.mjs delete mode 100644 sdk/devopsinfrastructure/arm-devopsinfrastructure/review/arm-devopsinfrastructure.api.md delete mode 100644 sdk/devopsinfrastructure/arm-devopsinfrastructure/samples-dev/imageVersionsListByImageSample.ts delete mode 100644 sdk/devopsinfrastructure/arm-devopsinfrastructure/samples-dev/operationsListSample.ts delete mode 100644 sdk/devopsinfrastructure/arm-devopsinfrastructure/samples-dev/poolsCreateOrUpdateSample.ts delete mode 100644 sdk/devopsinfrastructure/arm-devopsinfrastructure/samples-dev/poolsDeleteSample.ts delete mode 100644 sdk/devopsinfrastructure/arm-devopsinfrastructure/samples-dev/poolsGetSample.ts delete mode 100644 sdk/devopsinfrastructure/arm-devopsinfrastructure/samples-dev/poolsListByResourceGroupSample.ts delete mode 100644 sdk/devopsinfrastructure/arm-devopsinfrastructure/samples-dev/poolsListBySubscriptionSample.ts delete mode 100644 sdk/devopsinfrastructure/arm-devopsinfrastructure/samples-dev/poolsUpdateSample.ts delete mode 100644 sdk/devopsinfrastructure/arm-devopsinfrastructure/samples-dev/resourceDetailsListByPoolSample.ts delete mode 100644 sdk/devopsinfrastructure/arm-devopsinfrastructure/samples-dev/skuListByLocationSample.ts delete mode 100644 sdk/devopsinfrastructure/arm-devopsinfrastructure/samples-dev/subscriptionUsagesListByLocationSample.ts delete mode 100644 sdk/devopsinfrastructure/arm-devopsinfrastructure/samples/v1-beta/javascript/README.md delete mode 100644 sdk/devopsinfrastructure/arm-devopsinfrastructure/samples/v1-beta/javascript/imageVersionsListByImageSample.js delete mode 100644 sdk/devopsinfrastructure/arm-devopsinfrastructure/samples/v1-beta/javascript/operationsListSample.js delete mode 100644 sdk/devopsinfrastructure/arm-devopsinfrastructure/samples/v1-beta/javascript/package.json delete mode 100644 sdk/devopsinfrastructure/arm-devopsinfrastructure/samples/v1-beta/javascript/poolsCreateOrUpdateSample.js delete mode 100644 sdk/devopsinfrastructure/arm-devopsinfrastructure/samples/v1-beta/javascript/poolsDeleteSample.js delete mode 100644 sdk/devopsinfrastructure/arm-devopsinfrastructure/samples/v1-beta/javascript/poolsGetSample.js delete mode 100644 sdk/devopsinfrastructure/arm-devopsinfrastructure/samples/v1-beta/javascript/poolsListByResourceGroupSample.js delete mode 100644 sdk/devopsinfrastructure/arm-devopsinfrastructure/samples/v1-beta/javascript/poolsListBySubscriptionSample.js delete mode 100644 sdk/devopsinfrastructure/arm-devopsinfrastructure/samples/v1-beta/javascript/poolsUpdateSample.js delete mode 100644 sdk/devopsinfrastructure/arm-devopsinfrastructure/samples/v1-beta/javascript/resourceDetailsListByPoolSample.js delete mode 100644 sdk/devopsinfrastructure/arm-devopsinfrastructure/samples/v1-beta/javascript/sample.env delete mode 100644 sdk/devopsinfrastructure/arm-devopsinfrastructure/samples/v1-beta/javascript/skuListByLocationSample.js delete mode 100644 sdk/devopsinfrastructure/arm-devopsinfrastructure/samples/v1-beta/javascript/subscriptionUsagesListByLocationSample.js delete mode 100644 sdk/devopsinfrastructure/arm-devopsinfrastructure/samples/v1-beta/typescript/README.md delete mode 100644 sdk/devopsinfrastructure/arm-devopsinfrastructure/samples/v1-beta/typescript/package.json delete mode 100644 sdk/devopsinfrastructure/arm-devopsinfrastructure/samples/v1-beta/typescript/sample.env delete mode 100644 sdk/devopsinfrastructure/arm-devopsinfrastructure/samples/v1-beta/typescript/src/imageVersionsListByImageSample.ts delete mode 100644 sdk/devopsinfrastructure/arm-devopsinfrastructure/samples/v1-beta/typescript/src/operationsListSample.ts delete mode 100644 sdk/devopsinfrastructure/arm-devopsinfrastructure/samples/v1-beta/typescript/src/poolsCreateOrUpdateSample.ts delete mode 100644 sdk/devopsinfrastructure/arm-devopsinfrastructure/samples/v1-beta/typescript/src/poolsDeleteSample.ts delete mode 100644 sdk/devopsinfrastructure/arm-devopsinfrastructure/samples/v1-beta/typescript/src/poolsGetSample.ts delete mode 100644 sdk/devopsinfrastructure/arm-devopsinfrastructure/samples/v1-beta/typescript/src/poolsListByResourceGroupSample.ts delete mode 100644 sdk/devopsinfrastructure/arm-devopsinfrastructure/samples/v1-beta/typescript/src/poolsListBySubscriptionSample.ts delete mode 100644 sdk/devopsinfrastructure/arm-devopsinfrastructure/samples/v1-beta/typescript/src/poolsUpdateSample.ts delete mode 100644 sdk/devopsinfrastructure/arm-devopsinfrastructure/samples/v1-beta/typescript/src/resourceDetailsListByPoolSample.ts delete mode 100644 sdk/devopsinfrastructure/arm-devopsinfrastructure/samples/v1-beta/typescript/src/skuListByLocationSample.ts delete mode 100644 sdk/devopsinfrastructure/arm-devopsinfrastructure/samples/v1-beta/typescript/src/subscriptionUsagesListByLocationSample.ts delete mode 100644 sdk/devopsinfrastructure/arm-devopsinfrastructure/samples/v1-beta/typescript/tsconfig.json create mode 100644 sdk/devopsinfrastructure/arm-devopsinfrastructure/src/api/devOpsInfrastructureContext.ts create mode 100644 sdk/devopsinfrastructure/arm-devopsinfrastructure/src/api/imageVersions/index.ts create mode 100644 sdk/devopsinfrastructure/arm-devopsinfrastructure/src/api/index.ts create mode 100644 sdk/devopsinfrastructure/arm-devopsinfrastructure/src/api/operations/index.ts create mode 100644 sdk/devopsinfrastructure/arm-devopsinfrastructure/src/api/options.ts create mode 100644 sdk/devopsinfrastructure/arm-devopsinfrastructure/src/api/pools/index.ts create mode 100644 sdk/devopsinfrastructure/arm-devopsinfrastructure/src/api/resourceDetails/index.ts create mode 100644 sdk/devopsinfrastructure/arm-devopsinfrastructure/src/api/sku/index.ts create mode 100644 sdk/devopsinfrastructure/arm-devopsinfrastructure/src/api/subscriptionUsages/index.ts create mode 100644 sdk/devopsinfrastructure/arm-devopsinfrastructure/src/classic/imageVersions/index.ts create mode 100644 sdk/devopsinfrastructure/arm-devopsinfrastructure/src/classic/index.ts create mode 100644 sdk/devopsinfrastructure/arm-devopsinfrastructure/src/classic/operations/index.ts create mode 100644 sdk/devopsinfrastructure/arm-devopsinfrastructure/src/classic/pools/index.ts create mode 100644 sdk/devopsinfrastructure/arm-devopsinfrastructure/src/classic/resourceDetails/index.ts create mode 100644 sdk/devopsinfrastructure/arm-devopsinfrastructure/src/classic/sku/index.ts create mode 100644 sdk/devopsinfrastructure/arm-devopsinfrastructure/src/classic/subscriptionUsages/index.ts create mode 100644 sdk/devopsinfrastructure/arm-devopsinfrastructure/src/devOpsInfrastructureClient.ts create mode 100644 sdk/devopsinfrastructure/arm-devopsinfrastructure/src/helpers/serializerHelpers.ts create mode 100644 sdk/devopsinfrastructure/arm-devopsinfrastructure/src/logger.ts delete mode 100644 sdk/devopsinfrastructure/arm-devopsinfrastructure/src/lroImpl.ts delete mode 100644 sdk/devopsinfrastructure/arm-devopsinfrastructure/src/managedDevOpsInfrastructure.ts delete mode 100644 sdk/devopsinfrastructure/arm-devopsinfrastructure/src/models/mappers.ts create mode 100644 sdk/devopsinfrastructure/arm-devopsinfrastructure/src/models/models.ts delete mode 100644 sdk/devopsinfrastructure/arm-devopsinfrastructure/src/models/parameters.ts delete mode 100644 sdk/devopsinfrastructure/arm-devopsinfrastructure/src/operations/imageVersions.ts delete mode 100644 sdk/devopsinfrastructure/arm-devopsinfrastructure/src/operations/index.ts delete mode 100644 sdk/devopsinfrastructure/arm-devopsinfrastructure/src/operations/operations.ts delete mode 100644 sdk/devopsinfrastructure/arm-devopsinfrastructure/src/operations/pools.ts delete mode 100644 sdk/devopsinfrastructure/arm-devopsinfrastructure/src/operations/resourceDetails.ts delete mode 100644 sdk/devopsinfrastructure/arm-devopsinfrastructure/src/operations/sku.ts delete mode 100644 sdk/devopsinfrastructure/arm-devopsinfrastructure/src/operations/subscriptionUsages.ts delete mode 100644 sdk/devopsinfrastructure/arm-devopsinfrastructure/src/operationsInterfaces/imageVersions.ts delete mode 100644 sdk/devopsinfrastructure/arm-devopsinfrastructure/src/operationsInterfaces/index.ts delete mode 100644 sdk/devopsinfrastructure/arm-devopsinfrastructure/src/operationsInterfaces/operations.ts delete mode 100644 sdk/devopsinfrastructure/arm-devopsinfrastructure/src/operationsInterfaces/pools.ts delete mode 100644 sdk/devopsinfrastructure/arm-devopsinfrastructure/src/operationsInterfaces/resourceDetails.ts delete mode 100644 sdk/devopsinfrastructure/arm-devopsinfrastructure/src/operationsInterfaces/sku.ts delete mode 100644 sdk/devopsinfrastructure/arm-devopsinfrastructure/src/operationsInterfaces/subscriptionUsages.ts delete mode 100644 sdk/devopsinfrastructure/arm-devopsinfrastructure/src/pagingHelper.ts create mode 100644 sdk/devopsinfrastructure/arm-devopsinfrastructure/src/restorePollerHelpers.ts create mode 100644 sdk/devopsinfrastructure/arm-devopsinfrastructure/src/static-helpers/pagingHelpers.ts create mode 100644 sdk/devopsinfrastructure/arm-devopsinfrastructure/src/static-helpers/pollingHelpers.ts delete mode 100644 sdk/devopsinfrastructure/arm-devopsinfrastructure/test/devopsinfrastructure_operations_test.spec.ts create mode 100644 sdk/devopsinfrastructure/arm-devopsinfrastructure/test/public/sampleTest.spec.ts create mode 100644 sdk/devopsinfrastructure/arm-devopsinfrastructure/test/public/utils/recordedClient.ts create mode 100644 sdk/devopsinfrastructure/arm-devopsinfrastructure/tsconfig.browser.config.json create mode 100644 sdk/devopsinfrastructure/arm-devopsinfrastructure/tsp-location.yaml create mode 100644 sdk/devopsinfrastructure/arm-devopsinfrastructure/vitest.browser.config.ts create mode 100644 sdk/devopsinfrastructure/arm-devopsinfrastructure/vitest.config.ts diff --git a/common/config/rush/pnpm-lock.yaml b/common/config/rush/pnpm-lock.yaml index 8aa853f5162e..a747f3582a9d 100644 --- a/common/config/rush/pnpm-lock.yaml +++ b/common/config/rush/pnpm-lock.yaml @@ -10684,7 +10684,7 @@ packages: resolve-import: 1.4.6 rimraf: 5.0.10 sync-content: 1.0.2 - typescript: 5.6.3 + typescript: 5.7.2 walk-up-path: 3.0.1 dev: false @@ -14347,7 +14347,7 @@ packages: dev: false file:projects/arm-devopsinfrastructure.tgz: - resolution: {integrity: sha512-zm1zJUacHQHrVisNSNKl6fuuO1JO3qpkdcnAIv2TeISXJYJFxIkSTyv70j+TIUa0C/c9MWgtNaCNp35yGhnc0g==, tarball: file:projects/arm-devopsinfrastructure.tgz} + resolution: {integrity: sha512-26NUbY9nDuqLqDF06QZFrMoNdmuI3nmYfTx5FjpwRcMR+jJobCAbvrAD5AKLz8AM1cdbls6LoEXEEd9XmsgALA==, tarball: file:projects/arm-devopsinfrastructure.tgz} name: '@rush-temp/arm-devopsinfrastructure' version: 0.0.0 dependencies: @@ -14355,20 +14355,42 @@ packages: '@azure-tools/test-recorder': 3.5.2 '@azure/abort-controller': 1.1.0 '@azure/core-lro': 2.7.2 + '@microsoft/api-extractor': 7.48.0(@types/node@18.19.66) '@types/chai': 4.3.20 '@types/mocha': 10.0.10 '@types/node': 18.19.66 + '@vitest/browser': 2.1.5(@types/node@18.19.66)(playwright@1.49.0)(typescript@5.6.3)(vitest@2.1.5) + '@vitest/coverage-istanbul': 2.1.5(vitest@2.1.5) chai: 4.3.10 dotenv: 16.4.5 + eslint: 8.57.1 esm: 3.2.25 mocha: 10.8.2 + playwright: 1.49.0 ts-node: 10.9.2(@types/node@18.19.66)(typescript@5.6.3) + tshy: 2.0.1 tslib: 2.8.1 typescript: 5.6.3 + vitest: 2.1.5(@types/node@18.19.66)(@vitest/browser@2.1.5) transitivePeerDependencies: - - '@swc/core' - - '@swc/wasm' + - '@edge-runtime/vm' + - '@vitest/ui' + - bufferutil + - happy-dom + - jsdom + - less + - lightningcss + - msw + - safaridriver + - sass + - sass-embedded + - stylus + - sugarss - supports-color + - terser + - utf-8-validate + - vite + - webdriverio dev: false file:projects/arm-devspaces.tgz: diff --git a/sdk/devopsinfrastructure/arm-devopsinfrastructure/CHANGELOG.md b/sdk/devopsinfrastructure/arm-devopsinfrastructure/CHANGELOG.md deleted file mode 100644 index 89f216f08d4a..000000000000 --- a/sdk/devopsinfrastructure/arm-devopsinfrastructure/CHANGELOG.md +++ /dev/null @@ -1,15 +0,0 @@ -# Release History - -## 1.0.0-beta.2 (Unreleased) - -### Features Added - -### Breaking Changes - -### Bugs Fixed - -### Other Changes - -## 1.0.0-beta.1 (2024-05-09) - -The package of @azure/arm-devopsinfrastructure is using our next generation design principles. To learn more, please refer to our documentation [Quick Start](https://aka.ms/azsdk/js/mgmt/quickstart). diff --git a/sdk/devopsinfrastructure/arm-devopsinfrastructure/README.md b/sdk/devopsinfrastructure/arm-devopsinfrastructure/README.md index 7b11f3e2df42..99adad5079d8 100644 --- a/sdk/devopsinfrastructure/arm-devopsinfrastructure/README.md +++ b/sdk/devopsinfrastructure/arm-devopsinfrastructure/README.md @@ -1,13 +1,13 @@ -# Azure ManagedDevOpsInfrastructure client library for JavaScript +# Azure DevOpsInfrastructure client library for JavaScript -This package contains an isomorphic SDK (runs both in Node.js and in browsers) for Azure ManagedDevOpsInfrastructure client. +This package contains an isomorphic SDK (runs both in Node.js and in browsers) for Azure DevOpsInfrastructure client. -[Source code](https://github.com/Azure/azure-sdk-for-js/tree/main/sdk/devopsinfrastructure/arm-devopsinfrastructure) | -[Package (NPM)](https://www.npmjs.com/package/@azure/arm-devopsinfrastructure) | -[API reference documentation](https://docs.microsoft.com/javascript/api/@azure/arm-devopsinfrastructure?view=azure-node-preview) | -[Samples](https://github.com/Azure-Samples/azure-samples-js-management) +Key links: + +- [Package (NPM)](https://www.npmjs.com/package/@azure/arm-devopsinfrastructure) +- [API reference documentation](https://docs.microsoft.com/javascript/api/@azure/arm-devopsinfrastructure?view=azure-node-preview) ## Getting started @@ -24,16 +24,16 @@ See our [support policy](https://github.com/Azure/azure-sdk-for-js/blob/main/SUP ### Install the `@azure/arm-devopsinfrastructure` package -Install the Azure ManagedDevOpsInfrastructure client library for JavaScript with `npm`: +Install the Azure DevOpsInfrastructure client library for JavaScript with `npm`: ```bash npm install @azure/arm-devopsinfrastructure ``` -### Create and authenticate a `ManagedDevOpsInfrastructure` +### Create and authenticate a `DevOpsInfrastructureClient` -To create a client object to access the Azure ManagedDevOpsInfrastructure API, you will need the `endpoint` of your Azure ManagedDevOpsInfrastructure resource and a `credential`. The Azure ManagedDevOpsInfrastructure client can use Azure Active Directory credentials to authenticate. -You can find the endpoint for your Azure ManagedDevOpsInfrastructure resource in the [Azure Portal][azure_portal]. +To create a client object to access the Azure DevOpsInfrastructure API, you will need the `endpoint` of your Azure DevOpsInfrastructure resource and a `credential`. The Azure DevOpsInfrastructure client can use Azure Active Directory credentials to authenticate. +You can find the endpoint for your Azure DevOpsInfrastructure 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). @@ -43,25 +43,25 @@ To use the [DefaultAzureCredential][defaultazurecredential] provider shown below npm install @azure/identity ``` -You will also need to **register a new AAD application and grant access to Azure ManagedDevOpsInfrastructure** by assigning the suitable role to your service principal (note: roles such as `"Owner"` will not grant the necessary permissions). +You will also need to **register a new AAD application and grant access to Azure DevOpsInfrastructure** 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 { ManagedDevOpsInfrastructure } = require("@azure/arm-devopsinfrastructure"); +const { DevOpsInfrastructureClient } = require("@azure/arm-devopsinfrastructure"); 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 ManagedDevOpsInfrastructure(new DefaultAzureCredential(), subscriptionId); +const client = new DevOpsInfrastructureClient(new DefaultAzureCredential(), subscriptionId); // For client-side applications running in the browser, use this code instead: // const credential = new InteractiveBrowserCredential({ // tenantId: "", // clientId: "" // }); -// const client = new ManagedDevOpsInfrastructure(credential, subscriptionId); +// const client = new DevOpsInfrastructureClient(credential, subscriptionId); ``` @@ -70,9 +70,9 @@ To use this client library in the browser, first you need to use a bundler. For ## Key concepts -### ManagedDevOpsInfrastructure +### DevOpsInfrastructureClient -`ManagedDevOpsInfrastructure` is the primary interface for developers using the Azure ManagedDevOpsInfrastructure client library. Explore the methods on this client object to understand the different features of the Azure ManagedDevOpsInfrastructure service that you can access. +`DevOpsInfrastructureClient` is the primary interface for developers using the Azure DevOpsInfrastructure client library. Explore the methods on this client object to understand the different features of the Azure DevOpsInfrastructure service that you can access. ## Troubleshooting @@ -87,9 +87,6 @@ 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 @@ -99,10 +96,6 @@ If you'd like to contribute to this library, please read the [contributing guide - [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%2Fdevopsinfrastructure%2Farm-devopsinfrastructure%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 diff --git a/sdk/devopsinfrastructure/arm-devopsinfrastructure/_meta.json b/sdk/devopsinfrastructure/arm-devopsinfrastructure/_meta.json deleted file mode 100644 index 787d16c08e4c..000000000000 --- a/sdk/devopsinfrastructure/arm-devopsinfrastructure/_meta.json +++ /dev/null @@ -1,8 +0,0 @@ -{ - "commit": "185960b80913e3300b96afd0f902f80a973b8da9", - "readme": "specification/devopsinfrastructure/resource-manager/readme.md", - "autorest_command": "autorest --version=3.9.7 --typescript --modelerfour.lenient-model-deduplication --azure-arm --head-as-boolean=true --license-header=MICROSOFT_MIT_NO_VERSION --generate-test --typescript-sdks-folder=D:\\Git\\azure-sdk-for-js ..\\azure-rest-api-specs\\specification\\devopsinfrastructure\\resource-manager\\readme.md --use=@autorest/typescript@6.0.21 --generate-sample=true", - "repository_url": "https://github.com/Azure/azure-rest-api-specs.git", - "release_tool": "@azure-tools/js-sdk-release-tools@2.7.7", - "use": "@autorest/typescript@6.0.21" -} \ No newline at end of file diff --git a/sdk/devopsinfrastructure/arm-devopsinfrastructure/api-extractor.json b/sdk/devopsinfrastructure/arm-devopsinfrastructure/api-extractor.json index 9bcb91290276..893efe8891ee 100644 --- a/sdk/devopsinfrastructure/arm-devopsinfrastructure/api-extractor.json +++ b/sdk/devopsinfrastructure/arm-devopsinfrastructure/api-extractor.json @@ -1,31 +1,18 @@ { "$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" - }, + "mainEntryPointFilePath": "./dist/esm/index.d.ts", + "docModel": { "enabled": true }, + "apiReport": { "enabled": true, "reportFolder": "./review" }, "dtsRollup": { "enabled": true, "untrimmedFilePath": "", "publicTrimmedFilePath": "./types/arm-devopsinfrastructure.d.ts" }, "messages": { - "tsdocMessageReporting": { - "default": { - "logLevel": "none" - } - }, + "tsdocMessageReporting": { "default": { "logLevel": "none" } }, "extractorMessageReporting": { - "ae-missing-release-tag": { - "logLevel": "none" - }, - "ae-unresolved-link": { - "logLevel": "none" - } + "ae-missing-release-tag": { "logLevel": "none" }, + "ae-unresolved-link": { "logLevel": "none" } } } -} \ No newline at end of file +} diff --git a/sdk/devopsinfrastructure/arm-devopsinfrastructure/assets.json b/sdk/devopsinfrastructure/arm-devopsinfrastructure/assets.json deleted file mode 100644 index e11a517d671c..000000000000 --- a/sdk/devopsinfrastructure/arm-devopsinfrastructure/assets.json +++ /dev/null @@ -1,6 +0,0 @@ -{ - "AssetsRepo": "Azure/azure-sdk-assets", - "AssetsRepoPrefixPath": "js", - "TagPrefix": "js/devopsinfrastructure/arm-devopsinfrastructure", - "Tag": "js/devopsinfrastructure/arm-devopsinfrastructure_b94eee1eb5" -} diff --git a/sdk/devopsinfrastructure/arm-devopsinfrastructure/eslint.config.mjs b/sdk/devopsinfrastructure/arm-devopsinfrastructure/eslint.config.mjs new file mode 100644 index 000000000000..113bdc3eaf5f --- /dev/null +++ b/sdk/devopsinfrastructure/arm-devopsinfrastructure/eslint.config.mjs @@ -0,0 +1,17 @@ +import azsdkEslint from "@azure/eslint-plugin-azure-sdk"; + +export default [ + ...azsdkEslint.configs.recommended, + { + rules: { + "@azure/azure-sdk/ts-modules-only-named": "warn", + "@azure/azure-sdk/ts-apiextractor-json-types": "warn", + "@azure/azure-sdk/ts-package-json-types": "warn", + "@azure/azure-sdk/ts-package-json-engine-is-present": "warn", + "@azure/azure-sdk/ts-package-json-module": "off", + "@azure/azure-sdk/ts-package-json-files-required": "off", + "@azure/azure-sdk/ts-package-json-main-is-cjs": "off", + "tsdoc/syntax": "warn" + } + } +]; diff --git a/sdk/devopsinfrastructure/arm-devopsinfrastructure/package.json b/sdk/devopsinfrastructure/arm-devopsinfrastructure/package.json index d44a17219ca2..0d8be13ee994 100644 --- a/sdk/devopsinfrastructure/arm-devopsinfrastructure/package.json +++ b/sdk/devopsinfrastructure/arm-devopsinfrastructure/package.json @@ -1,114 +1,110 @@ { "name": "@azure/arm-devopsinfrastructure", - "sdk-type": "mgmt", - "author": "Microsoft Corporation", - "description": "A generated SDK for ManagedDevOpsInfrastructure.", "version": "1.0.0-beta.2", + "description": "A generated SDK for DevOpsInfrastructureClient.", "engines": { "node": ">=18.0.0" }, - "dependencies": { - "@azure/abort-controller": "^1.0.0", - "@azure/core-auth": "^1.6.0", - "@azure/core-client": "^1.7.0", - "@azure/core-lro": "^2.5.4", - "@azure/core-paging": "^1.2.0", - "@azure/core-rest-pipeline": "^1.14.0", - "tslib": "^2.2.0" + "sideEffects": false, + "autoPublish": false, + "tshy": { + "exports": { + "./package.json": "./package.json", + ".": "./src/index.ts", + "./models": "./src/models/index.ts" + }, + "dialects": [ + "esm", + "commonjs" + ], + "esmDialects": [ + "browser", + "react-native" + ], + "selfLink": false }, + "type": "module", "keywords": [ "node", "azure", + "cloud", "typescript", "browser", "isomorphic" ], + "author": "Microsoft Corporation", "license": "MIT", - "main": "./dist/index.js", - "module": "./dist-esm/src/index.js", - "types": "./types/arm-devopsinfrastructure.d.ts", - "devDependencies": { - "@azure-tools/test-credential": "^1.1.0", - "@azure-tools/test-recorder": "^3.0.0", - "@azure/dev-tool": "^1.0.0", - "@azure/identity": "^4.0.1", - "@types/chai": "^4.2.8", - "@types/mocha": "^10.0.0", - "@types/node": "^18.0.0", - "chai": "^4.2.0", - "dotenv": "^16.0.0", - "esm": "^3.2.18", - "mocha": "^10.0.0", - "ts-node": "^10.0.0", - "typescript": "~5.6.2" - }, - "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", + "dist", "README.md", "LICENSE", - "tsconfig.json", "review/*", - "CHANGELOG.md", - "types/*" + "CHANGELOG.md" ], - "scripts": { - "build": "npm run clean && tsc && dev-tool run bundle && npm run minify && dev-tool run vendored mkdirp ./review && npm run extract-api", - "build:browser": "echo skipped", - "build:node": "echo skipped", - "build:samples": "echo skipped.", - "build:test": "echo skipped", - "check-format": "echo skipped", - "clean": "dev-tool run vendored rimraf --glob dist dist-browser dist-esm test-dist temp types *.tgz *.log", - "execute:samples": "echo skipped", - "extract-api": "dev-tool run extract-api", - "format": "echo skipped", - "integration-test": "npm run integration-test:node && npm run integration-test:browser", - "integration-test:browser": "echo skipped", - "integration-test:node": "dev-tool run test:node-ts-input -- --timeout 1200000 'test/*.ts'", - "lint": "echo skipped", - "minify": "dev-tool run vendored uglifyjs -c -m --comments --source-map \"content='./dist/index.js.map'\" -o ./dist/index.min.js ./dist/index.js", - "pack": "npm pack 2>&1", - "prepack": "npm run build", - "test": "npm run integration-test", - "test:browser": "echo skipped", - "test:node": "echo skipped", - "unit-test": "npm run unit-test:node && npm run unit-test:browser", - "unit-test:browser": "echo skipped", - "unit-test:node": "dev-tool run vendored cross-env TEST_MODE=playback npm run integration-test:node", - "update-snippets": "echo skipped" + "sdk-type": "mgmt", + "repository": "github:Azure/azure-sdk-for-js", + "bugs": { + "url": "https://github.com/Azure/azure-sdk-for-js/issues" }, - "sideEffects": false, + "prettier": "@azure/eslint-plugin-azure-sdk/prettier.json", "//metadata": { "constantPaths": [ { - "path": "src/managedDevOpsInfrastructure.ts", - "prefix": "packageDetails" + "path": "src/api/devOpsInfrastructureContext.ts", + "prefix": "userAgentInfo" } ] }, - "autoPublish": true, - "homepage": "https://github.com/Azure/azure-sdk-for-js/tree/main/sdk/devopsinfrastructure/arm-devopsinfrastructure", - "//sampleConfiguration": { - "productName": "", - "productSlugs": [ - "azure" - ], - "disableDocsMs": true, - "apiRefLink": "https://docs.microsoft.com/javascript/api/@azure/arm-devopsinfrastructure?view=azure-node-preview" + "dependencies": { + "@azure/core-util": "^1.9.2", + "@azure-rest/core-client": "^2.3.1", + "@azure/core-auth": "^1.6.0", + "@azure/core-rest-pipeline": "^1.5.0", + "@azure/logger": "^1.0.0", + "tslib": "^2.6.2", + "@azure/core-lro": "^3.1.0", + "@azure/abort-controller": "^2.1.2" + }, + "devDependencies": { + "dotenv": "^16.0.0", + "@microsoft/api-extractor": "^7.40.3", + "@types/node": "^18.0.0", + "eslint": "^8.55.0", + "typescript": "~5.6.2", + "tshy": "^2.0.0", + "@azure/identity": "^4.2.1", + "@vitest/browser": "^2.0.5", + "@vitest/coverage-istanbul": "^2.0.5", + "playwright": "^1.41.2", + "vitest": "^2.0.5", + "@azure-tools/test-credential": "^2.0.0", + "@azure-tools/test-recorder": "^4.0.0", + "@azure/dev-tool": "^1.0.0", + "@azure/eslint-plugin-azure-sdk": "^3.0.0" + }, + "scripts": { + "clean": "dev-tool run vendored rimraf --glob dist dist-browser dist-esm test-dist temp types *.tgz *.log", + "extract-api": "dev-tool run vendored rimraf review && dev-tool run vendored mkdirp ./review && dev-tool run extract-api", + "pack": "npm pack 2>&1", + "lint": "eslint package.json api-extractor.json src test", + "lint:fix": "eslint package.json api-extractor.json src test --fix --fix-type [problem,suggestion]", + "unit-test": "npm run unit-test:node && npm run unit-test:browser", + "unit-test:browser": "npm run build:test && dev-tool run test:vitest --browser", + "unit-test:node": "dev-tool run test:vitest", + "integration-test": "npm run integration-test:node && npm run integration-test:browser", + "integration-test:browser": "echo skipped", + "integration-test:node": "echo skipped", + "build:samples": "echo skipped", + "check-format": "dev-tool run vendored prettier --list-different --config ../../../.prettierrc.json --ignore-path ../../../.prettierignore \"src/**/*.{ts,cts,mts}\" \"test/**/*.{ts,cts,mts}\" \"*.{js,cjs,mjs,json}\" ", + "execute:samples": "echo skipped", + "format": "dev-tool run vendored prettier --write --config ../../../.prettierrc.json --ignore-path ../../../.prettierignore \"src/**/*.{ts,cts,mts}\" \"test/**/*.{ts,cts,mts}\" \"*.{js,cjs,mjs,json}\" ", + "generate:client": "echo skipped", + "test:browser": "npm run clean && npm run build:test && npm run unit-test:browser && npm run integration-test:browser", + "minify": "dev-tool run vendored uglifyjs -c -m --comments --source-map \"content='./dist/index.js.map'\" -o ./dist/index.min.js ./dist/index.js", + "build:test": "npm run clean && dev-tool run build-package && dev-tool run build-test", + "build": "npm run clean && dev-tool run build-package && dev-tool run vendored mkdirp ./review && dev-tool run extract-api", + "test:node": "npm run clean && dev-tool run build-package && npm run unit-test:node && npm run integration-test:node", + "test": "npm run clean && dev-tool run build-package && npm run unit-test:node && dev-tool run bundle && npm run unit-test:browser && npm run integration-test", + "update-snippets": "echo skipped" } } diff --git a/sdk/devopsinfrastructure/arm-devopsinfrastructure/review/arm-devopsinfrastructure.api.md b/sdk/devopsinfrastructure/arm-devopsinfrastructure/review/arm-devopsinfrastructure.api.md deleted file mode 100644 index 4388eada01ce..000000000000 --- a/sdk/devopsinfrastructure/arm-devopsinfrastructure/review/arm-devopsinfrastructure.api.md +++ /dev/null @@ -1,828 +0,0 @@ -## API Report File for "@azure/arm-devopsinfrastructure" - -> Do not edit this file. It is a report generated by [API Extractor](https://api-extractor.com/). - -```ts - -import * as coreAuth from '@azure/core-auth'; -import * as coreClient from '@azure/core-client'; -import { OperationState } from '@azure/core-lro'; -import { PagedAsyncIterableIterator } from '@azure/core-paging'; -import { SimplePollerLike } from '@azure/core-lro'; - -// @public -export type ActionType = string; - -// @public -export interface AgentProfile { - kind: "Stateful" | "Stateless"; - resourcePredictions?: Record; - resourcePredictionsProfile?: ResourcePredictionsProfileUnion; -} - -// @public (undocumented) -export type AgentProfileUnion = AgentProfile | Stateful | StatelessAgentProfile; - -// @public -export interface AgentProfileUpdate { - kind: "Stateful" | "Stateless"; - resourcePredictions?: Record; - resourcePredictionsProfile?: ResourcePredictionsProfileUpdateUnion; -} - -// @public (undocumented) -export type AgentProfileUpdateUnion = AgentProfileUpdate | StatefulUpdate | StatelessAgentProfileUpdate; - -// @public -export interface AutomaticResourcePredictionsProfile extends ResourcePredictionsProfile { - kind: "Automatic"; - predictionPreference?: PredictionPreference; -} - -// @public -export interface AutomaticResourcePredictionsProfileUpdate extends ResourcePredictionsProfileUpdate { - kind: "Automatic"; - predictionPreference?: PredictionPreference; -} - -// @public -export interface AzureDevOpsOrganizationProfile extends OrganizationProfile { - kind: "AzureDevOps"; - organizations: Organization[]; - permissionProfile?: AzureDevOpsPermissionProfile; -} - -// @public -export interface AzureDevOpsPermissionProfile { - groups?: string[]; - kind: AzureDevOpsPermissionType; - users?: string[]; -} - -// @public -export type AzureDevOpsPermissionType = string; - -// @public -export type CachingType = string; - -// @public -export type CreatedByType = string; - -// @public -export interface DataDisk { - caching?: CachingType; - diskSizeGiB?: number; - driveLetter?: string; - storageAccountType?: StorageAccountType; -} - -// @public -export interface DevOpsAzureSku { - name: string; -} - -// @public -export interface ErrorAdditionalInfo { - readonly info?: Record; - readonly type?: string; -} - -// @public -export interface ErrorDetail { - readonly additionalInfo?: ErrorAdditionalInfo[]; - readonly code?: string; - readonly details?: ErrorDetail[]; - readonly message?: string; - readonly target?: string; -} - -// @public -export interface ErrorResponse { - error?: ErrorDetail; -} - -// @public -export interface FabricProfile { - kind: "Vmss"; -} - -// @public (undocumented) -export type FabricProfileUnion = FabricProfile | VmssFabricProfile; - -// @public -export function getContinuationToken(page: unknown): string | undefined; - -// @public -export interface GitHubOrganization { - repositories?: string[]; - url: string; -} - -// @public -export interface GitHubOrganizationProfile extends OrganizationProfile { - kind: "GitHub"; - organizations: GitHubOrganization[]; -} - -// @public -export interface ImageVersion extends ProxyResource { - properties?: ImageVersionProperties; -} - -// @public -export interface ImageVersionListResult { - nextLink?: string; - value: ImageVersion[]; -} - -// @public -export interface ImageVersionProperties { - version: string; -} - -// @public -export interface ImageVersions { - listByImage(resourceGroupName: string, imageName: string, options?: ImageVersionsListByImageOptionalParams): PagedAsyncIterableIterator; -} - -// @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 { - Internal = "Internal" -} - -// @public -export enum KnownAzureDevOpsPermissionType { - CreatorOnly = "CreatorOnly", - Inherit = "Inherit", - SpecificAccounts = "SpecificAccounts" -} - -// @public -export enum KnownCachingType { - None = "None", - ReadOnly = "ReadOnly", - ReadWrite = "ReadWrite" -} - -// @public -export enum KnownCreatedByType { - Application = "Application", - Key = "Key", - ManagedIdentity = "ManagedIdentity", - User = "User" -} - -// @public -export enum KnownLogonType { - Interactive = "Interactive", - Service = "Service" -} - -// @public -export enum KnownManagedServiceIdentityType { - None = "None", - SystemAssigned = "SystemAssigned", - SystemAssignedUserAssigned = "SystemAssigned,UserAssigned", - UserAssigned = "UserAssigned" -} - -// @public -export enum KnownOrigin { - System = "system", - User = "user", - UserSystem = "user,system" -} - -// @public -export enum KnownOsDiskStorageAccountType { - Premium = "Premium", - Standard = "Standard", - StandardSSD = "StandardSSD" -} - -// @public -export enum KnownPredictionPreference { - Balanced = "Balanced", - BestPerformance = "BestPerformance", - MoreCostEffective = "MoreCostEffective", - MorePerformance = "MorePerformance", - MostCostEffective = "MostCostEffective" -} - -// @public -export enum KnownProvisioningState { - Accepted = "Accepted", - Canceled = "Canceled", - Deleting = "Deleting", - Failed = "Failed", - Provisioning = "Provisioning", - Succeeded = "Succeeded", - Updating = "Updating" -} - -// @public -export enum KnownResourcePredictionsProfileType { - Automatic = "Automatic", - Manual = "Manual" -} - -// @public -export enum KnownResourceSkuRestrictionsReasonCode { - NotAvailableForSubscription = "NotAvailableForSubscription", - QuotaId = "QuotaId" -} - -// @public -export enum KnownResourceSkuRestrictionsType { - Location = "Location", - Zone = "Zone" -} - -// @public -export enum KnownResourceStatus { - Allocated = "Allocated", - Leased = "Leased", - NotReady = "NotReady", - PendingReimage = "PendingReimage", - PendingReturn = "PendingReturn", - Provisioning = "Provisioning", - Ready = "Ready", - Reimaging = "Reimaging", - Returned = "Returned", - Starting = "Starting", - Updating = "Updating" -} - -// @public -export enum KnownStorageAccountType { - PremiumLRS = "Premium_LRS", - PremiumZRS = "Premium_ZRS", - StandardLRS = "Standard_LRS", - StandardSsdlrs = "StandardSSD_LRS", - StandardSsdzrs = "StandardSSD_ZRS" -} - -// @public -export type LogonType = string; - -// @public (undocumented) -export class ManagedDevOpsInfrastructure extends coreClient.ServiceClient { - // (undocumented) - $host: string; - constructor(credentials: coreAuth.TokenCredential, subscriptionId: string, options?: ManagedDevOpsInfrastructureOptionalParams); - // (undocumented) - apiVersion: string; - // (undocumented) - imageVersions: ImageVersions; - // (undocumented) - operations: Operations; - // (undocumented) - pools: Pools; - // (undocumented) - resourceDetails: ResourceDetails; - // (undocumented) - sku: Sku; - // (undocumented) - subscriptionId: string; - // (undocumented) - subscriptionUsages: SubscriptionUsages; -} - -// @public -export interface ManagedDevOpsInfrastructureOptionalParams extends coreClient.ServiceClientOptions { - $host?: string; - apiVersion?: string; - endpoint?: string; -} - -// @public -export interface ManagedServiceIdentity { - readonly principalId?: string; - readonly tenantId?: string; - type: ManagedServiceIdentityType; - userAssignedIdentities?: { - [propertyName: string]: UserAssignedIdentity | null; - }; -} - -// @public -export type ManagedServiceIdentityType = string; - -// @public -export interface ManualResourcePredictionsProfile extends ResourcePredictionsProfile { - kind: "Manual"; -} - -// @public -export interface ManualResourcePredictionsProfileUpdate extends ResourcePredictionsProfileUpdate { - kind: "Manual"; -} - -// @public -export interface NetworkProfile { - subnetId: string; -} - -// @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 Organization { - parallelism?: number; - projects?: string[]; - url: string; -} - -// @public -export interface OrganizationProfile { - kind: "AzureDevOps" | "GitHub"; -} - -// @public (undocumented) -export type OrganizationProfileUnion = OrganizationProfile | AzureDevOpsOrganizationProfile | GitHubOrganizationProfile; - -// @public -export type Origin = string; - -// @public -export type OsDiskStorageAccountType = string; - -// @public -export interface OsProfile { - logonType?: LogonType; - secretsManagementSettings?: SecretsManagementSettings; -} - -// @public -export interface Pool extends TrackedResource { - identity?: ManagedServiceIdentity; - properties?: PoolProperties; -} - -// @public -export interface PoolImage { - aliases?: string[]; - buffer?: string; - resourceId?: string; - wellKnownImageName?: string; -} - -// @public -export interface PoolListResult { - nextLink?: string; - value: Pool[]; -} - -// @public -export interface PoolProperties { - agentProfile: AgentProfileUnion; - devCenterProjectResourceId: string; - fabricProfile: FabricProfileUnion; - maximumConcurrency: number; - organizationProfile: OrganizationProfileUnion; - provisioningState?: ProvisioningState; -} - -// @public -export interface Pools { - beginCreateOrUpdate(resourceGroupName: string, poolName: string, resource: Pool, options?: PoolsCreateOrUpdateOptionalParams): Promise, PoolsCreateOrUpdateResponse>>; - beginCreateOrUpdateAndWait(resourceGroupName: string, poolName: string, resource: Pool, options?: PoolsCreateOrUpdateOptionalParams): Promise; - beginDelete(resourceGroupName: string, poolName: string, options?: PoolsDeleteOptionalParams): Promise, PoolsDeleteResponse>>; - beginDeleteAndWait(resourceGroupName: string, poolName: string, options?: PoolsDeleteOptionalParams): Promise; - beginUpdate(resourceGroupName: string, poolName: string, properties: PoolUpdate, options?: PoolsUpdateOptionalParams): Promise, PoolsUpdateResponse>>; - beginUpdateAndWait(resourceGroupName: string, poolName: string, properties: PoolUpdate, options?: PoolsUpdateOptionalParams): Promise; - get(resourceGroupName: string, poolName: string, options?: PoolsGetOptionalParams): Promise; - listByResourceGroup(resourceGroupName: string, options?: PoolsListByResourceGroupOptionalParams): PagedAsyncIterableIterator; - listBySubscription(options?: PoolsListBySubscriptionOptionalParams): PagedAsyncIterableIterator; -} - -// @public -export interface PoolsCreateOrUpdateHeaders { - retryAfter?: number; -} - -// @public -export interface PoolsCreateOrUpdateOptionalParams extends coreClient.OperationOptions { - resumeFrom?: string; - updateIntervalInMs?: number; -} - -// @public -export type PoolsCreateOrUpdateResponse = Pool; - -// @public -export interface PoolsDeleteHeaders { - location?: string; - retryAfter?: number; -} - -// @public -export interface PoolsDeleteOptionalParams extends coreClient.OperationOptions { - resumeFrom?: string; - updateIntervalInMs?: number; -} - -// @public -export type PoolsDeleteResponse = PoolsDeleteHeaders; - -// @public -export interface PoolsGetOptionalParams extends coreClient.OperationOptions { -} - -// @public -export type PoolsGetResponse = Pool; - -// @public -export interface PoolsListByResourceGroupNextOptionalParams extends coreClient.OperationOptions { -} - -// @public -export type PoolsListByResourceGroupNextResponse = PoolListResult; - -// @public -export interface PoolsListByResourceGroupOptionalParams extends coreClient.OperationOptions { -} - -// @public -export type PoolsListByResourceGroupResponse = PoolListResult; - -// @public -export interface PoolsListBySubscriptionNextOptionalParams extends coreClient.OperationOptions { -} - -// @public -export type PoolsListBySubscriptionNextResponse = PoolListResult; - -// @public -export interface PoolsListBySubscriptionOptionalParams extends coreClient.OperationOptions { -} - -// @public -export type PoolsListBySubscriptionResponse = PoolListResult; - -// @public -export interface PoolsUpdateHeaders { - location?: string; - retryAfter?: number; -} - -// @public -export interface PoolsUpdateOptionalParams extends coreClient.OperationOptions { - resumeFrom?: string; - updateIntervalInMs?: number; -} - -// @public -export type PoolsUpdateResponse = Pool; - -// @public -export interface PoolUpdate { - identity?: ManagedServiceIdentity; - properties?: PoolUpdateProperties; - tags?: { - [propertyName: string]: string; - }; -} - -// @public -export interface PoolUpdateProperties { - agentProfile?: AgentProfileUpdateUnion; - devCenterProjectResourceId?: string; - fabricProfile?: FabricProfileUnion; - maximumConcurrency?: number; - organizationProfile?: OrganizationProfileUnion; - provisioningState?: ProvisioningState; -} - -// @public -export type PredictionPreference = string; - -// @public -export type ProvisioningState = string; - -// @public -export interface ProxyResource extends Resource { -} - -// @public -export interface Quota extends ProxyResource { - properties?: QuotaProperties; -} - -// @public -export interface QuotaListResult { - nextLink?: string; - value: Quota[]; -} - -// @public -export interface QuotaName { - localizedValue?: string; - value?: string; -} - -// @public -export interface QuotaProperties { - currentValue: number; - limit: number; - name: QuotaName; - unit: string; -} - -// @public -export interface Resource { - readonly id?: string; - readonly name?: string; - readonly systemData?: SystemData; - readonly type?: string; -} - -// @public -export interface ResourceDetails { - listByPool(resourceGroupName: string, poolName: string, options?: ResourceDetailsListByPoolOptionalParams): PagedAsyncIterableIterator; -} - -// @public -export interface ResourceDetailsListByPoolNextOptionalParams extends coreClient.OperationOptions { -} - -// @public -export type ResourceDetailsListByPoolNextResponse = ResourceDetailsObjectListResult; - -// @public -export interface ResourceDetailsListByPoolOptionalParams extends coreClient.OperationOptions { -} - -// @public -export type ResourceDetailsListByPoolResponse = ResourceDetailsObjectListResult; - -// @public -export interface ResourceDetailsObject extends ProxyResource { - properties?: ResourceDetailsObjectProperties; -} - -// @public -export interface ResourceDetailsObjectListResult { - nextLink?: string; - value: ResourceDetailsObject[]; -} - -// @public -export interface ResourceDetailsObjectProperties { - image: string; - imageVersion: string; - status: ResourceStatus; -} - -// @public -export interface ResourcePredictionsProfile { - kind: "Automatic" | "Manual"; -} - -// @public -export type ResourcePredictionsProfileType = string; - -// @public (undocumented) -export type ResourcePredictionsProfileUnion = ResourcePredictionsProfile | AutomaticResourcePredictionsProfile | ManualResourcePredictionsProfile; - -// @public -export interface ResourcePredictionsProfileUpdate { - kind: "Automatic" | "Manual"; -} - -// @public (undocumented) -export type ResourcePredictionsProfileUpdateUnion = ResourcePredictionsProfileUpdate | AutomaticResourcePredictionsProfileUpdate | ManualResourcePredictionsProfileUpdate; - -// @public -export interface ResourceSku extends ProxyResource { - properties?: ResourceSkuProperties; -} - -// @public -export interface ResourceSkuCapabilities { - name: string; - value: string; -} - -// @public -export interface ResourceSkuListResult { - nextLink?: string; - value: ResourceSku[]; -} - -// @public -export interface ResourceSkuLocationInfo { - location: string; - zoneDetails: ResourceSkuZoneDetails[]; - zones: string[]; -} - -// @public -export interface ResourceSkuProperties { - capabilities: ResourceSkuCapabilities[]; - family: string; - locationInfo: ResourceSkuLocationInfo[]; - locations: string[]; - resourceType: string; - restrictions: ResourceSkuRestrictions[]; - size: string; - tier: string; -} - -// @public -export interface ResourceSkuRestrictionInfo { - locations?: string[]; - zones?: string[]; -} - -// @public -export interface ResourceSkuRestrictions { - reasonCode?: ResourceSkuRestrictionsReasonCode; - restrictionInfo: ResourceSkuRestrictionInfo; - type?: ResourceSkuRestrictionsType; - values: string[]; -} - -// @public -export type ResourceSkuRestrictionsReasonCode = string; - -// @public -export type ResourceSkuRestrictionsType = string; - -// @public -export interface ResourceSkuZoneDetails { - capabilities: ResourceSkuCapabilities[]; - name: string[]; -} - -// @public -export type ResourceStatus = string; - -// @public -export interface SecretsManagementSettings { - certificateStoreLocation?: string; - keyExportable: boolean; - observedCertificates: string[]; -} - -// @public -export interface Sku { - listByLocation(locationName: string, options?: SkuListByLocationOptionalParams): PagedAsyncIterableIterator; -} - -// @public -export interface SkuListByLocationNextOptionalParams extends coreClient.OperationOptions { -} - -// @public -export type SkuListByLocationNextResponse = ResourceSkuListResult; - -// @public -export interface SkuListByLocationOptionalParams extends coreClient.OperationOptions { -} - -// @public -export type SkuListByLocationResponse = ResourceSkuListResult; - -// @public -export interface Stateful extends AgentProfile { - gracePeriodTimeSpan?: string; - kind: "Stateful"; - maxAgentLifetime?: string; -} - -// @public -export interface StatefulUpdate extends AgentProfileUpdate { - gracePeriodTimeSpan?: string; - kind: "Stateful"; - maxAgentLifetime?: string; -} - -// @public -export interface StatelessAgentProfile extends AgentProfile { - kind: "Stateless"; -} - -// @public -export interface StatelessAgentProfileUpdate extends AgentProfileUpdate { - kind: "Stateless"; -} - -// @public -export type StorageAccountType = string; - -// @public -export interface StorageProfile { - dataDisks?: DataDisk[]; - osDiskStorageAccountType?: OsDiskStorageAccountType; -} - -// @public -export interface SubscriptionUsages { - listByLocation(locationName: string, options?: SubscriptionUsagesListByLocationOptionalParams): PagedAsyncIterableIterator; -} - -// @public -export interface SubscriptionUsagesListByLocationNextOptionalParams extends coreClient.OperationOptions { -} - -// @public -export type SubscriptionUsagesListByLocationNextResponse = QuotaListResult; - -// @public -export interface SubscriptionUsagesListByLocationOptionalParams extends coreClient.OperationOptions { -} - -// @public -export type SubscriptionUsagesListByLocationResponse = QuotaListResult; - -// @public -export interface SystemData { - createdAt?: Date; - createdBy?: string; - createdByType?: CreatedByType; - lastModifiedAt?: Date; - lastModifiedBy?: string; - lastModifiedByType?: CreatedByType; -} - -// @public -export interface TrackedResource extends Resource { - location: string; - tags?: { - [propertyName: string]: string; - }; -} - -// @public -export interface UserAssignedIdentity { - readonly clientId?: string; - readonly principalId?: string; -} - -// @public -export interface VmssFabricProfile extends FabricProfile { - images: PoolImage[]; - kind: "Vmss"; - networkProfile?: NetworkProfile; - osProfile?: OsProfile; - sku: DevOpsAzureSku; - storageProfile?: StorageProfile; -} - -// (No @packageDocumentation comment for this package) - -``` diff --git a/sdk/devopsinfrastructure/arm-devopsinfrastructure/sample.env b/sdk/devopsinfrastructure/arm-devopsinfrastructure/sample.env index 672847a3fea0..508439fc7d62 100644 --- a/sdk/devopsinfrastructure/arm-devopsinfrastructure/sample.env +++ b/sdk/devopsinfrastructure/arm-devopsinfrastructure/sample.env @@ -1,4 +1 @@ -# App registration secret for AAD authentication -AZURE_CLIENT_SECRET= -AZURE_CLIENT_ID= -AZURE_TENANT_ID= \ No newline at end of file +# Feel free to add your own environment variables. \ No newline at end of file diff --git a/sdk/devopsinfrastructure/arm-devopsinfrastructure/samples-dev/imageVersionsListByImageSample.ts b/sdk/devopsinfrastructure/arm-devopsinfrastructure/samples-dev/imageVersionsListByImageSample.ts deleted file mode 100644 index a7c2d0df1e33..000000000000 --- a/sdk/devopsinfrastructure/arm-devopsinfrastructure/samples-dev/imageVersionsListByImageSample.ts +++ /dev/null @@ -1,46 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -import { ManagedDevOpsInfrastructure } from "@azure/arm-devopsinfrastructure"; -import { DefaultAzureCredential } from "@azure/identity"; -import * as dotenv from "dotenv"; - -dotenv.config(); - -/** - * This sample demonstrates how to List ImageVersion resources by Image - * - * @summary List ImageVersion resources by Image - * x-ms-original-file: specification/devopsinfrastructure/resource-manager/Microsoft.DevOpsInfrastructure/preview/2024-04-04-preview/examples/ImageVersions_ListByImage.json - */ -async function imageVersionsListByImage() { - const subscriptionId = - process.env["DEVOPSINFRASTRUCTURE_SUBSCRIPTION_ID"] || - "a2e95d27-c161-4b61-bda4-11512c14c2c2"; - const resourceGroupName = - process.env["DEVOPSINFRASTRUCTURE_RESOURCE_GROUP"] || "my-resource-group"; - const imageName = "windows-2022"; - const credential = new DefaultAzureCredential(); - const client = new ManagedDevOpsInfrastructure(credential, subscriptionId); - const resArray = new Array(); - for await (let item of client.imageVersions.listByImage( - resourceGroupName, - imageName, - )) { - resArray.push(item); - } - console.log(resArray); -} - -async function main() { - imageVersionsListByImage(); -} - -main().catch(console.error); diff --git a/sdk/devopsinfrastructure/arm-devopsinfrastructure/samples-dev/operationsListSample.ts b/sdk/devopsinfrastructure/arm-devopsinfrastructure/samples-dev/operationsListSample.ts deleted file mode 100644 index 846ffb10bf1d..000000000000 --- a/sdk/devopsinfrastructure/arm-devopsinfrastructure/samples-dev/operationsListSample.ts +++ /dev/null @@ -1,40 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -import { ManagedDevOpsInfrastructure } from "@azure/arm-devopsinfrastructure"; -import { DefaultAzureCredential } from "@azure/identity"; -import * as dotenv from "dotenv"; - -dotenv.config(); - -/** - * This sample demonstrates how to List the operations for the provider - * - * @summary List the operations for the provider - * x-ms-original-file: specification/devopsinfrastructure/resource-manager/Microsoft.DevOpsInfrastructure/preview/2024-04-04-preview/examples/ListOperations.json - */ -async function operationsList() { - const subscriptionId = - process.env["DEVOPSINFRASTRUCTURE_SUBSCRIPTION_ID"] || - "00000000-0000-0000-0000-000000000000"; - const credential = new DefaultAzureCredential(); - const client = new ManagedDevOpsInfrastructure(credential, subscriptionId); - const resArray = new Array(); - for await (let item of client.operations.list()) { - resArray.push(item); - } - console.log(resArray); -} - -async function main() { - operationsList(); -} - -main().catch(console.error); diff --git a/sdk/devopsinfrastructure/arm-devopsinfrastructure/samples-dev/poolsCreateOrUpdateSample.ts b/sdk/devopsinfrastructure/arm-devopsinfrastructure/samples-dev/poolsCreateOrUpdateSample.ts deleted file mode 100644 index 42520866fe49..000000000000 --- a/sdk/devopsinfrastructure/arm-devopsinfrastructure/samples-dev/poolsCreateOrUpdateSample.ts +++ /dev/null @@ -1,71 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -import { - Pool, - ManagedDevOpsInfrastructure, -} from "@azure/arm-devopsinfrastructure"; -import { DefaultAzureCredential } from "@azure/identity"; -import * as dotenv from "dotenv"; - -dotenv.config(); - -/** - * This sample demonstrates how to Create a Pool - * - * @summary Create a Pool - * x-ms-original-file: specification/devopsinfrastructure/resource-manager/Microsoft.DevOpsInfrastructure/preview/2024-04-04-preview/examples/CreateOrUpdatePool.json - */ -async function poolsCreateOrUpdate() { - const subscriptionId = - process.env["DEVOPSINFRASTRUCTURE_SUBSCRIPTION_ID"] || - "a2e95d27-c161-4b61-bda4-11512c14c2c2"; - const resourceGroupName = - process.env["DEVOPSINFRASTRUCTURE_RESOURCE_GROUP"] || "rg"; - const poolName = "pool"; - const resource: Pool = { - location: "eastus", - properties: { - agentProfile: { kind: "Stateless" }, - devCenterProjectResourceId: - "/subscriptions/222e81d0-cf38-4dab-baa5-289bf16baaa4/resourceGroups/rg-1es-devcenter/providers/Microsoft.DevCenter/projects/1ES", - fabricProfile: { - images: [ - { - resourceId: - "/MicrosoftWindowsServer/WindowsServer/2019-Datacenter/latest", - }, - ], - kind: "Vmss", - sku: { name: "Standard_D4ads_v5" }, - }, - maximumConcurrency: 10, - organizationProfile: { - kind: "AzureDevOps", - organizations: [{ url: "https://mseng.visualstudio.com" }], - }, - provisioningState: "Succeeded", - }, - }; - const credential = new DefaultAzureCredential(); - const client = new ManagedDevOpsInfrastructure(credential, subscriptionId); - const result = await client.pools.beginCreateOrUpdateAndWait( - resourceGroupName, - poolName, - resource, - ); - console.log(result); -} - -async function main() { - poolsCreateOrUpdate(); -} - -main().catch(console.error); diff --git a/sdk/devopsinfrastructure/arm-devopsinfrastructure/samples-dev/poolsDeleteSample.ts b/sdk/devopsinfrastructure/arm-devopsinfrastructure/samples-dev/poolsDeleteSample.ts deleted file mode 100644 index 44d67f65c6c5..000000000000 --- a/sdk/devopsinfrastructure/arm-devopsinfrastructure/samples-dev/poolsDeleteSample.ts +++ /dev/null @@ -1,43 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -import { ManagedDevOpsInfrastructure } from "@azure/arm-devopsinfrastructure"; -import { DefaultAzureCredential } from "@azure/identity"; -import * as dotenv from "dotenv"; - -dotenv.config(); - -/** - * This sample demonstrates how to Delete a Pool - * - * @summary Delete a Pool - * x-ms-original-file: specification/devopsinfrastructure/resource-manager/Microsoft.DevOpsInfrastructure/preview/2024-04-04-preview/examples/DeletePool.json - */ -async function poolsDelete() { - const subscriptionId = - process.env["DEVOPSINFRASTRUCTURE_SUBSCRIPTION_ID"] || - "a2e95d27-c161-4b61-bda4-11512c14c2c2"; - const resourceGroupName = - process.env["DEVOPSINFRASTRUCTURE_RESOURCE_GROUP"] || "rg"; - const poolName = "pool"; - const credential = new DefaultAzureCredential(); - const client = new ManagedDevOpsInfrastructure(credential, subscriptionId); - const result = await client.pools.beginDeleteAndWait( - resourceGroupName, - poolName, - ); - console.log(result); -} - -async function main() { - poolsDelete(); -} - -main().catch(console.error); diff --git a/sdk/devopsinfrastructure/arm-devopsinfrastructure/samples-dev/poolsGetSample.ts b/sdk/devopsinfrastructure/arm-devopsinfrastructure/samples-dev/poolsGetSample.ts deleted file mode 100644 index 084268dadec2..000000000000 --- a/sdk/devopsinfrastructure/arm-devopsinfrastructure/samples-dev/poolsGetSample.ts +++ /dev/null @@ -1,40 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -import { ManagedDevOpsInfrastructure } from "@azure/arm-devopsinfrastructure"; -import { DefaultAzureCredential } from "@azure/identity"; -import * as dotenv from "dotenv"; - -dotenv.config(); - -/** - * This sample demonstrates how to Get a Pool - * - * @summary Get a Pool - * x-ms-original-file: specification/devopsinfrastructure/resource-manager/Microsoft.DevOpsInfrastructure/preview/2024-04-04-preview/examples/GetPool.json - */ -async function poolsGet() { - const subscriptionId = - process.env["DEVOPSINFRASTRUCTURE_SUBSCRIPTION_ID"] || - "a2e95d27-c161-4b61-bda4-11512c14c2c2"; - const resourceGroupName = - process.env["DEVOPSINFRASTRUCTURE_RESOURCE_GROUP"] || "rg"; - const poolName = "pool"; - const credential = new DefaultAzureCredential(); - const client = new ManagedDevOpsInfrastructure(credential, subscriptionId); - const result = await client.pools.get(resourceGroupName, poolName); - console.log(result); -} - -async function main() { - poolsGet(); -} - -main().catch(console.error); diff --git a/sdk/devopsinfrastructure/arm-devopsinfrastructure/samples-dev/poolsListByResourceGroupSample.ts b/sdk/devopsinfrastructure/arm-devopsinfrastructure/samples-dev/poolsListByResourceGroupSample.ts deleted file mode 100644 index 7b6581b337e5..000000000000 --- a/sdk/devopsinfrastructure/arm-devopsinfrastructure/samples-dev/poolsListByResourceGroupSample.ts +++ /dev/null @@ -1,42 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -import { ManagedDevOpsInfrastructure } from "@azure/arm-devopsinfrastructure"; -import { DefaultAzureCredential } from "@azure/identity"; -import * as dotenv from "dotenv"; - -dotenv.config(); - -/** - * This sample demonstrates how to List Pool resources by resource group - * - * @summary List Pool resources by resource group - * x-ms-original-file: specification/devopsinfrastructure/resource-manager/Microsoft.DevOpsInfrastructure/preview/2024-04-04-preview/examples/ListPoolsBySubscriptionAndResourceGroup.json - */ -async function poolsListByResourceGroup() { - const subscriptionId = - process.env["DEVOPSINFRASTRUCTURE_SUBSCRIPTION_ID"] || - "a2e95d27-c161-4b61-bda4-11512c14c2c2"; - const resourceGroupName = - process.env["DEVOPSINFRASTRUCTURE_RESOURCE_GROUP"] || "rg"; - const credential = new DefaultAzureCredential(); - const client = new ManagedDevOpsInfrastructure(credential, subscriptionId); - const resArray = new Array(); - for await (let item of client.pools.listByResourceGroup(resourceGroupName)) { - resArray.push(item); - } - console.log(resArray); -} - -async function main() { - poolsListByResourceGroup(); -} - -main().catch(console.error); diff --git a/sdk/devopsinfrastructure/arm-devopsinfrastructure/samples-dev/poolsListBySubscriptionSample.ts b/sdk/devopsinfrastructure/arm-devopsinfrastructure/samples-dev/poolsListBySubscriptionSample.ts deleted file mode 100644 index c6d553e58304..000000000000 --- a/sdk/devopsinfrastructure/arm-devopsinfrastructure/samples-dev/poolsListBySubscriptionSample.ts +++ /dev/null @@ -1,40 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -import { ManagedDevOpsInfrastructure } from "@azure/arm-devopsinfrastructure"; -import { DefaultAzureCredential } from "@azure/identity"; -import * as dotenv from "dotenv"; - -dotenv.config(); - -/** - * This sample demonstrates how to List Pool resources by subscription ID - * - * @summary List Pool resources by subscription ID - * x-ms-original-file: specification/devopsinfrastructure/resource-manager/Microsoft.DevOpsInfrastructure/preview/2024-04-04-preview/examples/ListPoolsBySubscription.json - */ -async function poolsListBySubscription() { - const subscriptionId = - process.env["DEVOPSINFRASTRUCTURE_SUBSCRIPTION_ID"] || - "a2e95d27-c161-4b61-bda4-11512c14c2c2"; - const credential = new DefaultAzureCredential(); - const client = new ManagedDevOpsInfrastructure(credential, subscriptionId); - const resArray = new Array(); - for await (let item of client.pools.listBySubscription()) { - resArray.push(item); - } - console.log(resArray); -} - -async function main() { - poolsListBySubscription(); -} - -main().catch(console.error); diff --git a/sdk/devopsinfrastructure/arm-devopsinfrastructure/samples-dev/poolsUpdateSample.ts b/sdk/devopsinfrastructure/arm-devopsinfrastructure/samples-dev/poolsUpdateSample.ts deleted file mode 100644 index 29706aa1d3a8..000000000000 --- a/sdk/devopsinfrastructure/arm-devopsinfrastructure/samples-dev/poolsUpdateSample.ts +++ /dev/null @@ -1,48 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -import { - PoolUpdate, - ManagedDevOpsInfrastructure, -} from "@azure/arm-devopsinfrastructure"; -import { DefaultAzureCredential } from "@azure/identity"; -import * as dotenv from "dotenv"; - -dotenv.config(); - -/** - * This sample demonstrates how to Update a Pool - * - * @summary Update a Pool - * x-ms-original-file: specification/devopsinfrastructure/resource-manager/Microsoft.DevOpsInfrastructure/preview/2024-04-04-preview/examples/UpdatePool.json - */ -async function poolsUpdate() { - const subscriptionId = - process.env["DEVOPSINFRASTRUCTURE_SUBSCRIPTION_ID"] || - "a2e95d27-c161-4b61-bda4-11512c14c2c2"; - const resourceGroupName = - process.env["DEVOPSINFRASTRUCTURE_RESOURCE_GROUP"] || "rg"; - const poolName = "pool"; - const properties: PoolUpdate = {}; - const credential = new DefaultAzureCredential(); - const client = new ManagedDevOpsInfrastructure(credential, subscriptionId); - const result = await client.pools.beginUpdateAndWait( - resourceGroupName, - poolName, - properties, - ); - console.log(result); -} - -async function main() { - poolsUpdate(); -} - -main().catch(console.error); diff --git a/sdk/devopsinfrastructure/arm-devopsinfrastructure/samples-dev/resourceDetailsListByPoolSample.ts b/sdk/devopsinfrastructure/arm-devopsinfrastructure/samples-dev/resourceDetailsListByPoolSample.ts deleted file mode 100644 index eb551fd80ed8..000000000000 --- a/sdk/devopsinfrastructure/arm-devopsinfrastructure/samples-dev/resourceDetailsListByPoolSample.ts +++ /dev/null @@ -1,46 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -import { ManagedDevOpsInfrastructure } from "@azure/arm-devopsinfrastructure"; -import { DefaultAzureCredential } from "@azure/identity"; -import * as dotenv from "dotenv"; - -dotenv.config(); - -/** - * This sample demonstrates how to List ResourceDetailsObject resources by Pool - * - * @summary List ResourceDetailsObject resources by Pool - * x-ms-original-file: specification/devopsinfrastructure/resource-manager/Microsoft.DevOpsInfrastructure/preview/2024-04-04-preview/examples/ResourceDetails_ListByPool.json - */ -async function resourceDetailsListByPool() { - const subscriptionId = - process.env["DEVOPSINFRASTRUCTURE_SUBSCRIPTION_ID"] || - "a2e95d27-c161-4b61-bda4-11512c14c2c2"; - const resourceGroupName = - process.env["DEVOPSINFRASTRUCTURE_RESOURCE_GROUP"] || "my-resource-group"; - const poolName = "my-dev-ops-pool"; - const credential = new DefaultAzureCredential(); - const client = new ManagedDevOpsInfrastructure(credential, subscriptionId); - const resArray = new Array(); - for await (let item of client.resourceDetails.listByPool( - resourceGroupName, - poolName, - )) { - resArray.push(item); - } - console.log(resArray); -} - -async function main() { - resourceDetailsListByPool(); -} - -main().catch(console.error); diff --git a/sdk/devopsinfrastructure/arm-devopsinfrastructure/samples-dev/skuListByLocationSample.ts b/sdk/devopsinfrastructure/arm-devopsinfrastructure/samples-dev/skuListByLocationSample.ts deleted file mode 100644 index 3d74e7f9c164..000000000000 --- a/sdk/devopsinfrastructure/arm-devopsinfrastructure/samples-dev/skuListByLocationSample.ts +++ /dev/null @@ -1,41 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -import { ManagedDevOpsInfrastructure } from "@azure/arm-devopsinfrastructure"; -import { DefaultAzureCredential } from "@azure/identity"; -import * as dotenv from "dotenv"; - -dotenv.config(); - -/** - * This sample demonstrates how to List ResourceSku resources by subscription ID - * - * @summary List ResourceSku resources by subscription ID - * x-ms-original-file: specification/devopsinfrastructure/resource-manager/Microsoft.DevOpsInfrastructure/preview/2024-04-04-preview/examples/Sku_ListByLocation.json - */ -async function skuListByLocation() { - const subscriptionId = - process.env["DEVOPSINFRASTRUCTURE_SUBSCRIPTION_ID"] || - "a2e95d27-c161-4b61-bda4-11512c14c2c2"; - const locationName = "eastus"; - const credential = new DefaultAzureCredential(); - const client = new ManagedDevOpsInfrastructure(credential, subscriptionId); - const resArray = new Array(); - for await (let item of client.sku.listByLocation(locationName)) { - resArray.push(item); - } - console.log(resArray); -} - -async function main() { - skuListByLocation(); -} - -main().catch(console.error); diff --git a/sdk/devopsinfrastructure/arm-devopsinfrastructure/samples-dev/subscriptionUsagesListByLocationSample.ts b/sdk/devopsinfrastructure/arm-devopsinfrastructure/samples-dev/subscriptionUsagesListByLocationSample.ts deleted file mode 100644 index 1e49a721ca07..000000000000 --- a/sdk/devopsinfrastructure/arm-devopsinfrastructure/samples-dev/subscriptionUsagesListByLocationSample.ts +++ /dev/null @@ -1,43 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -import { ManagedDevOpsInfrastructure } from "@azure/arm-devopsinfrastructure"; -import { DefaultAzureCredential } from "@azure/identity"; -import * as dotenv from "dotenv"; - -dotenv.config(); - -/** - * This sample demonstrates how to List Quota resources by subscription ID - * - * @summary List Quota resources by subscription ID - * x-ms-original-file: specification/devopsinfrastructure/resource-manager/Microsoft.DevOpsInfrastructure/preview/2024-04-04-preview/examples/SubscriptionUsages_ListByLocation.json - */ -async function subscriptionUsagesListByLocation() { - const subscriptionId = - process.env["DEVOPSINFRASTRUCTURE_SUBSCRIPTION_ID"] || - "a2e95d27-c161-4b61-bda4-11512c14c2c2"; - const locationName = "eastus"; - const credential = new DefaultAzureCredential(); - const client = new ManagedDevOpsInfrastructure(credential, subscriptionId); - const resArray = new Array(); - for await (let item of client.subscriptionUsages.listByLocation( - locationName, - )) { - resArray.push(item); - } - console.log(resArray); -} - -async function main() { - subscriptionUsagesListByLocation(); -} - -main().catch(console.error); diff --git a/sdk/devopsinfrastructure/arm-devopsinfrastructure/samples/v1-beta/javascript/README.md b/sdk/devopsinfrastructure/arm-devopsinfrastructure/samples/v1-beta/javascript/README.md deleted file mode 100644 index f814895bce7d..000000000000 --- a/sdk/devopsinfrastructure/arm-devopsinfrastructure/samples/v1-beta/javascript/README.md +++ /dev/null @@ -1,70 +0,0 @@ -# client library samples for JavaScript (Beta) - -These sample programs show how to use the JavaScript client libraries for in some common scenarios. - -| **File Name** | **Description** | -| ----------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -| [imageVersionsListByImageSample.js][imageversionslistbyimagesample] | List ImageVersion resources by Image x-ms-original-file: specification/devopsinfrastructure/resource-manager/Microsoft.DevOpsInfrastructure/preview/2024-04-04-preview/examples/ImageVersions_ListByImage.json | -| [operationsListSample.js][operationslistsample] | List the operations for the provider x-ms-original-file: specification/devopsinfrastructure/resource-manager/Microsoft.DevOpsInfrastructure/preview/2024-04-04-preview/examples/ListOperations.json | -| [poolsCreateOrUpdateSample.js][poolscreateorupdatesample] | Create a Pool x-ms-original-file: specification/devopsinfrastructure/resource-manager/Microsoft.DevOpsInfrastructure/preview/2024-04-04-preview/examples/CreateOrUpdatePool.json | -| [poolsDeleteSample.js][poolsdeletesample] | Delete a Pool x-ms-original-file: specification/devopsinfrastructure/resource-manager/Microsoft.DevOpsInfrastructure/preview/2024-04-04-preview/examples/DeletePool.json | -| [poolsGetSample.js][poolsgetsample] | Get a Pool x-ms-original-file: specification/devopsinfrastructure/resource-manager/Microsoft.DevOpsInfrastructure/preview/2024-04-04-preview/examples/GetPool.json | -| [poolsListByResourceGroupSample.js][poolslistbyresourcegroupsample] | List Pool resources by resource group x-ms-original-file: specification/devopsinfrastructure/resource-manager/Microsoft.DevOpsInfrastructure/preview/2024-04-04-preview/examples/ListPoolsBySubscriptionAndResourceGroup.json | -| [poolsListBySubscriptionSample.js][poolslistbysubscriptionsample] | List Pool resources by subscription ID x-ms-original-file: specification/devopsinfrastructure/resource-manager/Microsoft.DevOpsInfrastructure/preview/2024-04-04-preview/examples/ListPoolsBySubscription.json | -| [poolsUpdateSample.js][poolsupdatesample] | Update a Pool x-ms-original-file: specification/devopsinfrastructure/resource-manager/Microsoft.DevOpsInfrastructure/preview/2024-04-04-preview/examples/UpdatePool.json | -| [resourceDetailsListByPoolSample.js][resourcedetailslistbypoolsample] | List ResourceDetailsObject resources by Pool x-ms-original-file: specification/devopsinfrastructure/resource-manager/Microsoft.DevOpsInfrastructure/preview/2024-04-04-preview/examples/ResourceDetails_ListByPool.json | -| [skuListByLocationSample.js][skulistbylocationsample] | List ResourceSku resources by subscription ID x-ms-original-file: specification/devopsinfrastructure/resource-manager/Microsoft.DevOpsInfrastructure/preview/2024-04-04-preview/examples/Sku_ListByLocation.json | -| [subscriptionUsagesListByLocationSample.js][subscriptionusageslistbylocationsample] | List Quota resources by subscription ID x-ms-original-file: specification/devopsinfrastructure/resource-manager/Microsoft.DevOpsInfrastructure/preview/2024-04-04-preview/examples/SubscriptionUsages_ListByLocation.json | - -## Prerequisites - -The sample programs are compatible with [LTS versions of Node.js](https://github.com/nodejs/release#release-schedule). - -You need [an Azure subscription][freesub] to run these sample programs. - -Samples retrieve credentials to access the service endpoint from environment variables. Alternatively, edit the source code to include the appropriate credentials. See each individual sample for details on which environment variables/credentials it requires to function. - -Adapting the samples to run in the browser may require some additional consideration. For details, please see the [package README][package]. - -## Setup - -To run the samples using the published version of the package: - -1. Install the dependencies using `npm`: - -```bash -npm install -``` - -2. Edit the file `sample.env`, adding the correct credentials to access the Azure service and run the samples. Then rename the file from `sample.env` to just `.env`. The sample programs will read this file automatically. - -3. Run whichever samples you like (note that some samples may require additional setup, see the table above): - -```bash -node imageVersionsListByImageSample.js -``` - -Alternatively, run a single sample with the correct environment variables set (setting up the `.env` file is not required if you do this), for example (cross-platform): - -```bash -npx dev-tool run vendored cross-env DEVOPSINFRASTRUCTURE_SUBSCRIPTION_ID="" DEVOPSINFRASTRUCTURE_RESOURCE_GROUP="" node imageVersionsListByImageSample.js -``` - -## Next Steps - -Take a look at our [API Documentation][apiref] for more information about the APIs that are available in the clients. - -[imageversionslistbyimagesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/devopsinfrastructure/arm-devopsinfrastructure/samples/v1-beta/javascript/imageVersionsListByImageSample.js -[operationslistsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/devopsinfrastructure/arm-devopsinfrastructure/samples/v1-beta/javascript/operationsListSample.js -[poolscreateorupdatesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/devopsinfrastructure/arm-devopsinfrastructure/samples/v1-beta/javascript/poolsCreateOrUpdateSample.js -[poolsdeletesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/devopsinfrastructure/arm-devopsinfrastructure/samples/v1-beta/javascript/poolsDeleteSample.js -[poolsgetsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/devopsinfrastructure/arm-devopsinfrastructure/samples/v1-beta/javascript/poolsGetSample.js -[poolslistbyresourcegroupsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/devopsinfrastructure/arm-devopsinfrastructure/samples/v1-beta/javascript/poolsListByResourceGroupSample.js -[poolslistbysubscriptionsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/devopsinfrastructure/arm-devopsinfrastructure/samples/v1-beta/javascript/poolsListBySubscriptionSample.js -[poolsupdatesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/devopsinfrastructure/arm-devopsinfrastructure/samples/v1-beta/javascript/poolsUpdateSample.js -[resourcedetailslistbypoolsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/devopsinfrastructure/arm-devopsinfrastructure/samples/v1-beta/javascript/resourceDetailsListByPoolSample.js -[skulistbylocationsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/devopsinfrastructure/arm-devopsinfrastructure/samples/v1-beta/javascript/skuListByLocationSample.js -[subscriptionusageslistbylocationsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/devopsinfrastructure/arm-devopsinfrastructure/samples/v1-beta/javascript/subscriptionUsagesListByLocationSample.js -[apiref]: https://docs.microsoft.com/javascript/api/@azure/arm-devopsinfrastructure?view=azure-node-preview -[freesub]: https://azure.microsoft.com/free/ -[package]: https://github.com/Azure/azure-sdk-for-js/tree/main/sdk/devopsinfrastructure/arm-devopsinfrastructure/README.md diff --git a/sdk/devopsinfrastructure/arm-devopsinfrastructure/samples/v1-beta/javascript/imageVersionsListByImageSample.js b/sdk/devopsinfrastructure/arm-devopsinfrastructure/samples/v1-beta/javascript/imageVersionsListByImageSample.js deleted file mode 100644 index bd3e938e7541..000000000000 --- a/sdk/devopsinfrastructure/arm-devopsinfrastructure/samples/v1-beta/javascript/imageVersionsListByImageSample.js +++ /dev/null @@ -1,40 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -const { ManagedDevOpsInfrastructure } = require("@azure/arm-devopsinfrastructure"); -const { DefaultAzureCredential } = require("@azure/identity"); -require("dotenv").config(); - -/** - * This sample demonstrates how to List ImageVersion resources by Image - * - * @summary List ImageVersion resources by Image - * x-ms-original-file: specification/devopsinfrastructure/resource-manager/Microsoft.DevOpsInfrastructure/preview/2024-04-04-preview/examples/ImageVersions_ListByImage.json - */ -async function imageVersionsListByImage() { - const subscriptionId = - process.env["DEVOPSINFRASTRUCTURE_SUBSCRIPTION_ID"] || "a2e95d27-c161-4b61-bda4-11512c14c2c2"; - const resourceGroupName = - process.env["DEVOPSINFRASTRUCTURE_RESOURCE_GROUP"] || "my-resource-group"; - const imageName = "windows-2022"; - const credential = new DefaultAzureCredential(); - const client = new ManagedDevOpsInfrastructure(credential, subscriptionId); - const resArray = new Array(); - for await (let item of client.imageVersions.listByImage(resourceGroupName, imageName)) { - resArray.push(item); - } - console.log(resArray); -} - -async function main() { - imageVersionsListByImage(); -} - -main().catch(console.error); diff --git a/sdk/devopsinfrastructure/arm-devopsinfrastructure/samples/v1-beta/javascript/operationsListSample.js b/sdk/devopsinfrastructure/arm-devopsinfrastructure/samples/v1-beta/javascript/operationsListSample.js deleted file mode 100644 index 5ca6398534a7..000000000000 --- a/sdk/devopsinfrastructure/arm-devopsinfrastructure/samples/v1-beta/javascript/operationsListSample.js +++ /dev/null @@ -1,37 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -const { ManagedDevOpsInfrastructure } = require("@azure/arm-devopsinfrastructure"); -const { DefaultAzureCredential } = require("@azure/identity"); -require("dotenv").config(); - -/** - * This sample demonstrates how to List the operations for the provider - * - * @summary List the operations for the provider - * x-ms-original-file: specification/devopsinfrastructure/resource-manager/Microsoft.DevOpsInfrastructure/preview/2024-04-04-preview/examples/ListOperations.json - */ -async function operationsList() { - const subscriptionId = - process.env["DEVOPSINFRASTRUCTURE_SUBSCRIPTION_ID"] || "00000000-0000-0000-0000-000000000000"; - const credential = new DefaultAzureCredential(); - const client = new ManagedDevOpsInfrastructure(credential, subscriptionId); - const resArray = new Array(); - for await (let item of client.operations.list()) { - resArray.push(item); - } - console.log(resArray); -} - -async function main() { - operationsList(); -} - -main().catch(console.error); diff --git a/sdk/devopsinfrastructure/arm-devopsinfrastructure/samples/v1-beta/javascript/package.json b/sdk/devopsinfrastructure/arm-devopsinfrastructure/samples/v1-beta/javascript/package.json deleted file mode 100644 index 4dc6ffdfe514..000000000000 --- a/sdk/devopsinfrastructure/arm-devopsinfrastructure/samples/v1-beta/javascript/package.json +++ /dev/null @@ -1,32 +0,0 @@ -{ - "name": "@azure-samples/arm-devopsinfrastructure-js-beta", - "private": true, - "version": "1.0.0", - "description": " client library samples for JavaScript (Beta)", - "engines": { - "node": ">=18.0.0" - }, - "repository": { - "type": "git", - "url": "git+https://github.com/Azure/azure-sdk-for-js.git", - "directory": "sdk/devopsinfrastructure/arm-devopsinfrastructure" - }, - "keywords": [ - "node", - "azure", - "typescript", - "browser", - "isomorphic" - ], - "author": "Microsoft Corporation", - "license": "MIT", - "bugs": { - "url": "https://github.com/Azure/azure-sdk-for-js/issues" - }, - "homepage": "https://github.com/Azure/azure-sdk-for-js/tree/main/sdk/devopsinfrastructure/arm-devopsinfrastructure", - "dependencies": { - "@azure/arm-devopsinfrastructure": "next", - "dotenv": "latest", - "@azure/identity": "^4.2.1" - } -} diff --git a/sdk/devopsinfrastructure/arm-devopsinfrastructure/samples/v1-beta/javascript/poolsCreateOrUpdateSample.js b/sdk/devopsinfrastructure/arm-devopsinfrastructure/samples/v1-beta/javascript/poolsCreateOrUpdateSample.js deleted file mode 100644 index 8dd4de26181a..000000000000 --- a/sdk/devopsinfrastructure/arm-devopsinfrastructure/samples/v1-beta/javascript/poolsCreateOrUpdateSample.js +++ /dev/null @@ -1,63 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -const { ManagedDevOpsInfrastructure } = require("@azure/arm-devopsinfrastructure"); -const { DefaultAzureCredential } = require("@azure/identity"); -require("dotenv").config(); - -/** - * This sample demonstrates how to Create a Pool - * - * @summary Create a Pool - * x-ms-original-file: specification/devopsinfrastructure/resource-manager/Microsoft.DevOpsInfrastructure/preview/2024-04-04-preview/examples/CreateOrUpdatePool.json - */ -async function poolsCreateOrUpdate() { - const subscriptionId = - process.env["DEVOPSINFRASTRUCTURE_SUBSCRIPTION_ID"] || "a2e95d27-c161-4b61-bda4-11512c14c2c2"; - const resourceGroupName = process.env["DEVOPSINFRASTRUCTURE_RESOURCE_GROUP"] || "rg"; - const poolName = "pool"; - const resource = { - location: "eastus", - properties: { - agentProfile: { kind: "Stateless" }, - devCenterProjectResourceId: - "/subscriptions/222e81d0-cf38-4dab-baa5-289bf16baaa4/resourceGroups/rg-1es-devcenter/providers/Microsoft.DevCenter/projects/1ES", - fabricProfile: { - images: [ - { - resourceId: "/MicrosoftWindowsServer/WindowsServer/2019-Datacenter/latest", - }, - ], - kind: "Vmss", - sku: { name: "Standard_D4ads_v5" }, - }, - maximumConcurrency: 10, - organizationProfile: { - kind: "AzureDevOps", - organizations: [{ url: "https://mseng.visualstudio.com" }], - }, - provisioningState: "Succeeded", - }, - }; - const credential = new DefaultAzureCredential(); - const client = new ManagedDevOpsInfrastructure(credential, subscriptionId); - const result = await client.pools.beginCreateOrUpdateAndWait( - resourceGroupName, - poolName, - resource, - ); - console.log(result); -} - -async function main() { - poolsCreateOrUpdate(); -} - -main().catch(console.error); diff --git a/sdk/devopsinfrastructure/arm-devopsinfrastructure/samples/v1-beta/javascript/poolsDeleteSample.js b/sdk/devopsinfrastructure/arm-devopsinfrastructure/samples/v1-beta/javascript/poolsDeleteSample.js deleted file mode 100644 index 18e1ab7ec39b..000000000000 --- a/sdk/devopsinfrastructure/arm-devopsinfrastructure/samples/v1-beta/javascript/poolsDeleteSample.js +++ /dev/null @@ -1,36 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -const { ManagedDevOpsInfrastructure } = require("@azure/arm-devopsinfrastructure"); -const { DefaultAzureCredential } = require("@azure/identity"); -require("dotenv").config(); - -/** - * This sample demonstrates how to Delete a Pool - * - * @summary Delete a Pool - * x-ms-original-file: specification/devopsinfrastructure/resource-manager/Microsoft.DevOpsInfrastructure/preview/2024-04-04-preview/examples/DeletePool.json - */ -async function poolsDelete() { - const subscriptionId = - process.env["DEVOPSINFRASTRUCTURE_SUBSCRIPTION_ID"] || "a2e95d27-c161-4b61-bda4-11512c14c2c2"; - const resourceGroupName = process.env["DEVOPSINFRASTRUCTURE_RESOURCE_GROUP"] || "rg"; - const poolName = "pool"; - const credential = new DefaultAzureCredential(); - const client = new ManagedDevOpsInfrastructure(credential, subscriptionId); - const result = await client.pools.beginDeleteAndWait(resourceGroupName, poolName); - console.log(result); -} - -async function main() { - poolsDelete(); -} - -main().catch(console.error); diff --git a/sdk/devopsinfrastructure/arm-devopsinfrastructure/samples/v1-beta/javascript/poolsGetSample.js b/sdk/devopsinfrastructure/arm-devopsinfrastructure/samples/v1-beta/javascript/poolsGetSample.js deleted file mode 100644 index 2a40721aad7b..000000000000 --- a/sdk/devopsinfrastructure/arm-devopsinfrastructure/samples/v1-beta/javascript/poolsGetSample.js +++ /dev/null @@ -1,36 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -const { ManagedDevOpsInfrastructure } = require("@azure/arm-devopsinfrastructure"); -const { DefaultAzureCredential } = require("@azure/identity"); -require("dotenv").config(); - -/** - * This sample demonstrates how to Get a Pool - * - * @summary Get a Pool - * x-ms-original-file: specification/devopsinfrastructure/resource-manager/Microsoft.DevOpsInfrastructure/preview/2024-04-04-preview/examples/GetPool.json - */ -async function poolsGet() { - const subscriptionId = - process.env["DEVOPSINFRASTRUCTURE_SUBSCRIPTION_ID"] || "a2e95d27-c161-4b61-bda4-11512c14c2c2"; - const resourceGroupName = process.env["DEVOPSINFRASTRUCTURE_RESOURCE_GROUP"] || "rg"; - const poolName = "pool"; - const credential = new DefaultAzureCredential(); - const client = new ManagedDevOpsInfrastructure(credential, subscriptionId); - const result = await client.pools.get(resourceGroupName, poolName); - console.log(result); -} - -async function main() { - poolsGet(); -} - -main().catch(console.error); diff --git a/sdk/devopsinfrastructure/arm-devopsinfrastructure/samples/v1-beta/javascript/poolsListByResourceGroupSample.js b/sdk/devopsinfrastructure/arm-devopsinfrastructure/samples/v1-beta/javascript/poolsListByResourceGroupSample.js deleted file mode 100644 index 8864a90b07f3..000000000000 --- a/sdk/devopsinfrastructure/arm-devopsinfrastructure/samples/v1-beta/javascript/poolsListByResourceGroupSample.js +++ /dev/null @@ -1,38 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -const { ManagedDevOpsInfrastructure } = require("@azure/arm-devopsinfrastructure"); -const { DefaultAzureCredential } = require("@azure/identity"); -require("dotenv").config(); - -/** - * This sample demonstrates how to List Pool resources by resource group - * - * @summary List Pool resources by resource group - * x-ms-original-file: specification/devopsinfrastructure/resource-manager/Microsoft.DevOpsInfrastructure/preview/2024-04-04-preview/examples/ListPoolsBySubscriptionAndResourceGroup.json - */ -async function poolsListByResourceGroup() { - const subscriptionId = - process.env["DEVOPSINFRASTRUCTURE_SUBSCRIPTION_ID"] || "a2e95d27-c161-4b61-bda4-11512c14c2c2"; - const resourceGroupName = process.env["DEVOPSINFRASTRUCTURE_RESOURCE_GROUP"] || "rg"; - const credential = new DefaultAzureCredential(); - const client = new ManagedDevOpsInfrastructure(credential, subscriptionId); - const resArray = new Array(); - for await (let item of client.pools.listByResourceGroup(resourceGroupName)) { - resArray.push(item); - } - console.log(resArray); -} - -async function main() { - poolsListByResourceGroup(); -} - -main().catch(console.error); diff --git a/sdk/devopsinfrastructure/arm-devopsinfrastructure/samples/v1-beta/javascript/poolsListBySubscriptionSample.js b/sdk/devopsinfrastructure/arm-devopsinfrastructure/samples/v1-beta/javascript/poolsListBySubscriptionSample.js deleted file mode 100644 index 35c3d84dc38f..000000000000 --- a/sdk/devopsinfrastructure/arm-devopsinfrastructure/samples/v1-beta/javascript/poolsListBySubscriptionSample.js +++ /dev/null @@ -1,37 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -const { ManagedDevOpsInfrastructure } = require("@azure/arm-devopsinfrastructure"); -const { DefaultAzureCredential } = require("@azure/identity"); -require("dotenv").config(); - -/** - * This sample demonstrates how to List Pool resources by subscription ID - * - * @summary List Pool resources by subscription ID - * x-ms-original-file: specification/devopsinfrastructure/resource-manager/Microsoft.DevOpsInfrastructure/preview/2024-04-04-preview/examples/ListPoolsBySubscription.json - */ -async function poolsListBySubscription() { - const subscriptionId = - process.env["DEVOPSINFRASTRUCTURE_SUBSCRIPTION_ID"] || "a2e95d27-c161-4b61-bda4-11512c14c2c2"; - const credential = new DefaultAzureCredential(); - const client = new ManagedDevOpsInfrastructure(credential, subscriptionId); - const resArray = new Array(); - for await (let item of client.pools.listBySubscription()) { - resArray.push(item); - } - console.log(resArray); -} - -async function main() { - poolsListBySubscription(); -} - -main().catch(console.error); diff --git a/sdk/devopsinfrastructure/arm-devopsinfrastructure/samples/v1-beta/javascript/poolsUpdateSample.js b/sdk/devopsinfrastructure/arm-devopsinfrastructure/samples/v1-beta/javascript/poolsUpdateSample.js deleted file mode 100644 index 7cd768ed1bb7..000000000000 --- a/sdk/devopsinfrastructure/arm-devopsinfrastructure/samples/v1-beta/javascript/poolsUpdateSample.js +++ /dev/null @@ -1,37 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -const { ManagedDevOpsInfrastructure } = require("@azure/arm-devopsinfrastructure"); -const { DefaultAzureCredential } = require("@azure/identity"); -require("dotenv").config(); - -/** - * This sample demonstrates how to Update a Pool - * - * @summary Update a Pool - * x-ms-original-file: specification/devopsinfrastructure/resource-manager/Microsoft.DevOpsInfrastructure/preview/2024-04-04-preview/examples/UpdatePool.json - */ -async function poolsUpdate() { - const subscriptionId = - process.env["DEVOPSINFRASTRUCTURE_SUBSCRIPTION_ID"] || "a2e95d27-c161-4b61-bda4-11512c14c2c2"; - const resourceGroupName = process.env["DEVOPSINFRASTRUCTURE_RESOURCE_GROUP"] || "rg"; - const poolName = "pool"; - const properties = {}; - const credential = new DefaultAzureCredential(); - const client = new ManagedDevOpsInfrastructure(credential, subscriptionId); - const result = await client.pools.beginUpdateAndWait(resourceGroupName, poolName, properties); - console.log(result); -} - -async function main() { - poolsUpdate(); -} - -main().catch(console.error); diff --git a/sdk/devopsinfrastructure/arm-devopsinfrastructure/samples/v1-beta/javascript/resourceDetailsListByPoolSample.js b/sdk/devopsinfrastructure/arm-devopsinfrastructure/samples/v1-beta/javascript/resourceDetailsListByPoolSample.js deleted file mode 100644 index 4ef908856929..000000000000 --- a/sdk/devopsinfrastructure/arm-devopsinfrastructure/samples/v1-beta/javascript/resourceDetailsListByPoolSample.js +++ /dev/null @@ -1,40 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -const { ManagedDevOpsInfrastructure } = require("@azure/arm-devopsinfrastructure"); -const { DefaultAzureCredential } = require("@azure/identity"); -require("dotenv").config(); - -/** - * This sample demonstrates how to List ResourceDetailsObject resources by Pool - * - * @summary List ResourceDetailsObject resources by Pool - * x-ms-original-file: specification/devopsinfrastructure/resource-manager/Microsoft.DevOpsInfrastructure/preview/2024-04-04-preview/examples/ResourceDetails_ListByPool.json - */ -async function resourceDetailsListByPool() { - const subscriptionId = - process.env["DEVOPSINFRASTRUCTURE_SUBSCRIPTION_ID"] || "a2e95d27-c161-4b61-bda4-11512c14c2c2"; - const resourceGroupName = - process.env["DEVOPSINFRASTRUCTURE_RESOURCE_GROUP"] || "my-resource-group"; - const poolName = "my-dev-ops-pool"; - const credential = new DefaultAzureCredential(); - const client = new ManagedDevOpsInfrastructure(credential, subscriptionId); - const resArray = new Array(); - for await (let item of client.resourceDetails.listByPool(resourceGroupName, poolName)) { - resArray.push(item); - } - console.log(resArray); -} - -async function main() { - resourceDetailsListByPool(); -} - -main().catch(console.error); diff --git a/sdk/devopsinfrastructure/arm-devopsinfrastructure/samples/v1-beta/javascript/sample.env b/sdk/devopsinfrastructure/arm-devopsinfrastructure/samples/v1-beta/javascript/sample.env deleted file mode 100644 index 672847a3fea0..000000000000 --- a/sdk/devopsinfrastructure/arm-devopsinfrastructure/samples/v1-beta/javascript/sample.env +++ /dev/null @@ -1,4 +0,0 @@ -# App registration secret for AAD authentication -AZURE_CLIENT_SECRET= -AZURE_CLIENT_ID= -AZURE_TENANT_ID= \ No newline at end of file diff --git a/sdk/devopsinfrastructure/arm-devopsinfrastructure/samples/v1-beta/javascript/skuListByLocationSample.js b/sdk/devopsinfrastructure/arm-devopsinfrastructure/samples/v1-beta/javascript/skuListByLocationSample.js deleted file mode 100644 index e5a14c504c46..000000000000 --- a/sdk/devopsinfrastructure/arm-devopsinfrastructure/samples/v1-beta/javascript/skuListByLocationSample.js +++ /dev/null @@ -1,38 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -const { ManagedDevOpsInfrastructure } = require("@azure/arm-devopsinfrastructure"); -const { DefaultAzureCredential } = require("@azure/identity"); -require("dotenv").config(); - -/** - * This sample demonstrates how to List ResourceSku resources by subscription ID - * - * @summary List ResourceSku resources by subscription ID - * x-ms-original-file: specification/devopsinfrastructure/resource-manager/Microsoft.DevOpsInfrastructure/preview/2024-04-04-preview/examples/Sku_ListByLocation.json - */ -async function skuListByLocation() { - const subscriptionId = - process.env["DEVOPSINFRASTRUCTURE_SUBSCRIPTION_ID"] || "a2e95d27-c161-4b61-bda4-11512c14c2c2"; - const locationName = "eastus"; - const credential = new DefaultAzureCredential(); - const client = new ManagedDevOpsInfrastructure(credential, subscriptionId); - const resArray = new Array(); - for await (let item of client.sku.listByLocation(locationName)) { - resArray.push(item); - } - console.log(resArray); -} - -async function main() { - skuListByLocation(); -} - -main().catch(console.error); diff --git a/sdk/devopsinfrastructure/arm-devopsinfrastructure/samples/v1-beta/javascript/subscriptionUsagesListByLocationSample.js b/sdk/devopsinfrastructure/arm-devopsinfrastructure/samples/v1-beta/javascript/subscriptionUsagesListByLocationSample.js deleted file mode 100644 index 18e96f2168c4..000000000000 --- a/sdk/devopsinfrastructure/arm-devopsinfrastructure/samples/v1-beta/javascript/subscriptionUsagesListByLocationSample.js +++ /dev/null @@ -1,38 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -const { ManagedDevOpsInfrastructure } = require("@azure/arm-devopsinfrastructure"); -const { DefaultAzureCredential } = require("@azure/identity"); -require("dotenv").config(); - -/** - * This sample demonstrates how to List Quota resources by subscription ID - * - * @summary List Quota resources by subscription ID - * x-ms-original-file: specification/devopsinfrastructure/resource-manager/Microsoft.DevOpsInfrastructure/preview/2024-04-04-preview/examples/SubscriptionUsages_ListByLocation.json - */ -async function subscriptionUsagesListByLocation() { - const subscriptionId = - process.env["DEVOPSINFRASTRUCTURE_SUBSCRIPTION_ID"] || "a2e95d27-c161-4b61-bda4-11512c14c2c2"; - const locationName = "eastus"; - const credential = new DefaultAzureCredential(); - const client = new ManagedDevOpsInfrastructure(credential, subscriptionId); - const resArray = new Array(); - for await (let item of client.subscriptionUsages.listByLocation(locationName)) { - resArray.push(item); - } - console.log(resArray); -} - -async function main() { - subscriptionUsagesListByLocation(); -} - -main().catch(console.error); diff --git a/sdk/devopsinfrastructure/arm-devopsinfrastructure/samples/v1-beta/typescript/README.md b/sdk/devopsinfrastructure/arm-devopsinfrastructure/samples/v1-beta/typescript/README.md deleted file mode 100644 index 2019da9785e7..000000000000 --- a/sdk/devopsinfrastructure/arm-devopsinfrastructure/samples/v1-beta/typescript/README.md +++ /dev/null @@ -1,83 +0,0 @@ -# client library samples for TypeScript (Beta) - -These sample programs show how to use the TypeScript client libraries for in some common scenarios. - -| **File Name** | **Description** | -| ----------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -| [imageVersionsListByImageSample.ts][imageversionslistbyimagesample] | List ImageVersion resources by Image x-ms-original-file: specification/devopsinfrastructure/resource-manager/Microsoft.DevOpsInfrastructure/preview/2024-04-04-preview/examples/ImageVersions_ListByImage.json | -| [operationsListSample.ts][operationslistsample] | List the operations for the provider x-ms-original-file: specification/devopsinfrastructure/resource-manager/Microsoft.DevOpsInfrastructure/preview/2024-04-04-preview/examples/ListOperations.json | -| [poolsCreateOrUpdateSample.ts][poolscreateorupdatesample] | Create a Pool x-ms-original-file: specification/devopsinfrastructure/resource-manager/Microsoft.DevOpsInfrastructure/preview/2024-04-04-preview/examples/CreateOrUpdatePool.json | -| [poolsDeleteSample.ts][poolsdeletesample] | Delete a Pool x-ms-original-file: specification/devopsinfrastructure/resource-manager/Microsoft.DevOpsInfrastructure/preview/2024-04-04-preview/examples/DeletePool.json | -| [poolsGetSample.ts][poolsgetsample] | Get a Pool x-ms-original-file: specification/devopsinfrastructure/resource-manager/Microsoft.DevOpsInfrastructure/preview/2024-04-04-preview/examples/GetPool.json | -| [poolsListByResourceGroupSample.ts][poolslistbyresourcegroupsample] | List Pool resources by resource group x-ms-original-file: specification/devopsinfrastructure/resource-manager/Microsoft.DevOpsInfrastructure/preview/2024-04-04-preview/examples/ListPoolsBySubscriptionAndResourceGroup.json | -| [poolsListBySubscriptionSample.ts][poolslistbysubscriptionsample] | List Pool resources by subscription ID x-ms-original-file: specification/devopsinfrastructure/resource-manager/Microsoft.DevOpsInfrastructure/preview/2024-04-04-preview/examples/ListPoolsBySubscription.json | -| [poolsUpdateSample.ts][poolsupdatesample] | Update a Pool x-ms-original-file: specification/devopsinfrastructure/resource-manager/Microsoft.DevOpsInfrastructure/preview/2024-04-04-preview/examples/UpdatePool.json | -| [resourceDetailsListByPoolSample.ts][resourcedetailslistbypoolsample] | List ResourceDetailsObject resources by Pool x-ms-original-file: specification/devopsinfrastructure/resource-manager/Microsoft.DevOpsInfrastructure/preview/2024-04-04-preview/examples/ResourceDetails_ListByPool.json | -| [skuListByLocationSample.ts][skulistbylocationsample] | List ResourceSku resources by subscription ID x-ms-original-file: specification/devopsinfrastructure/resource-manager/Microsoft.DevOpsInfrastructure/preview/2024-04-04-preview/examples/Sku_ListByLocation.json | -| [subscriptionUsagesListByLocationSample.ts][subscriptionusageslistbylocationsample] | List Quota resources by subscription ID x-ms-original-file: specification/devopsinfrastructure/resource-manager/Microsoft.DevOpsInfrastructure/preview/2024-04-04-preview/examples/SubscriptionUsages_ListByLocation.json | - -## Prerequisites - -The sample programs are compatible with [LTS versions of Node.js](https://github.com/nodejs/release#release-schedule). - -Before running the samples in Node, they must be compiled to JavaScript using the TypeScript compiler. For more information on TypeScript, see the [TypeScript documentation][typescript]. Install the TypeScript compiler using: - -```bash -npm install -g typescript -``` - -You need [an Azure subscription][freesub] to run these sample programs. - -Samples retrieve credentials to access the service endpoint from environment variables. Alternatively, edit the source code to include the appropriate credentials. See each individual sample for details on which environment variables/credentials it requires to function. - -Adapting the samples to run in the browser may require some additional consideration. For details, please see the [package README][package]. - -## Setup - -To run the samples using the published version of the package: - -1. Install the dependencies using `npm`: - -```bash -npm install -``` - -2. Compile the samples: - -```bash -npm run build -``` - -3. Edit the file `sample.env`, adding the correct credentials to access the Azure service and run the samples. Then rename the file from `sample.env` to just `.env`. The sample programs will read this file automatically. - -4. Run whichever samples you like (note that some samples may require additional setup, see the table above): - -```bash -node dist/imageVersionsListByImageSample.js -``` - -Alternatively, run a single sample with the correct environment variables set (setting up the `.env` file is not required if you do this), for example (cross-platform): - -```bash -npx dev-tool run vendored cross-env DEVOPSINFRASTRUCTURE_SUBSCRIPTION_ID="" DEVOPSINFRASTRUCTURE_RESOURCE_GROUP="" node dist/imageVersionsListByImageSample.js -``` - -## Next Steps - -Take a look at our [API Documentation][apiref] for more information about the APIs that are available in the clients. - -[imageversionslistbyimagesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/devopsinfrastructure/arm-devopsinfrastructure/samples/v1-beta/typescript/src/imageVersionsListByImageSample.ts -[operationslistsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/devopsinfrastructure/arm-devopsinfrastructure/samples/v1-beta/typescript/src/operationsListSample.ts -[poolscreateorupdatesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/devopsinfrastructure/arm-devopsinfrastructure/samples/v1-beta/typescript/src/poolsCreateOrUpdateSample.ts -[poolsdeletesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/devopsinfrastructure/arm-devopsinfrastructure/samples/v1-beta/typescript/src/poolsDeleteSample.ts -[poolsgetsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/devopsinfrastructure/arm-devopsinfrastructure/samples/v1-beta/typescript/src/poolsGetSample.ts -[poolslistbyresourcegroupsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/devopsinfrastructure/arm-devopsinfrastructure/samples/v1-beta/typescript/src/poolsListByResourceGroupSample.ts -[poolslistbysubscriptionsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/devopsinfrastructure/arm-devopsinfrastructure/samples/v1-beta/typescript/src/poolsListBySubscriptionSample.ts -[poolsupdatesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/devopsinfrastructure/arm-devopsinfrastructure/samples/v1-beta/typescript/src/poolsUpdateSample.ts -[resourcedetailslistbypoolsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/devopsinfrastructure/arm-devopsinfrastructure/samples/v1-beta/typescript/src/resourceDetailsListByPoolSample.ts -[skulistbylocationsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/devopsinfrastructure/arm-devopsinfrastructure/samples/v1-beta/typescript/src/skuListByLocationSample.ts -[subscriptionusageslistbylocationsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/devopsinfrastructure/arm-devopsinfrastructure/samples/v1-beta/typescript/src/subscriptionUsagesListByLocationSample.ts -[apiref]: https://docs.microsoft.com/javascript/api/@azure/arm-devopsinfrastructure?view=azure-node-preview -[freesub]: https://azure.microsoft.com/free/ -[package]: https://github.com/Azure/azure-sdk-for-js/tree/main/sdk/devopsinfrastructure/arm-devopsinfrastructure/README.md -[typescript]: https://www.typescriptlang.org/docs/home.html diff --git a/sdk/devopsinfrastructure/arm-devopsinfrastructure/samples/v1-beta/typescript/package.json b/sdk/devopsinfrastructure/arm-devopsinfrastructure/samples/v1-beta/typescript/package.json deleted file mode 100644 index 52ed54ab4b7e..000000000000 --- a/sdk/devopsinfrastructure/arm-devopsinfrastructure/samples/v1-beta/typescript/package.json +++ /dev/null @@ -1,41 +0,0 @@ -{ - "name": "@azure-samples/arm-devopsinfrastructure-ts-beta", - "private": true, - "version": "1.0.0", - "description": " client library samples for TypeScript (Beta)", - "engines": { - "node": ">=18.0.0" - }, - "scripts": { - "build": "tsc", - "prebuild": "rimraf dist/" - }, - "repository": { - "type": "git", - "url": "git+https://github.com/Azure/azure-sdk-for-js.git", - "directory": "sdk/devopsinfrastructure/arm-devopsinfrastructure" - }, - "keywords": [ - "node", - "azure", - "typescript", - "browser", - "isomorphic" - ], - "author": "Microsoft Corporation", - "license": "MIT", - "bugs": { - "url": "https://github.com/Azure/azure-sdk-for-js/issues" - }, - "homepage": "https://github.com/Azure/azure-sdk-for-js/tree/main/sdk/devopsinfrastructure/arm-devopsinfrastructure", - "dependencies": { - "@azure/arm-devopsinfrastructure": "next", - "dotenv": "latest", - "@azure/identity": "^4.2.1" - }, - "devDependencies": { - "@types/node": "^18.0.0", - "typescript": "~5.6.2", - "rimraf": "latest" - } -} diff --git a/sdk/devopsinfrastructure/arm-devopsinfrastructure/samples/v1-beta/typescript/sample.env b/sdk/devopsinfrastructure/arm-devopsinfrastructure/samples/v1-beta/typescript/sample.env deleted file mode 100644 index 672847a3fea0..000000000000 --- a/sdk/devopsinfrastructure/arm-devopsinfrastructure/samples/v1-beta/typescript/sample.env +++ /dev/null @@ -1,4 +0,0 @@ -# App registration secret for AAD authentication -AZURE_CLIENT_SECRET= -AZURE_CLIENT_ID= -AZURE_TENANT_ID= \ No newline at end of file diff --git a/sdk/devopsinfrastructure/arm-devopsinfrastructure/samples/v1-beta/typescript/src/imageVersionsListByImageSample.ts b/sdk/devopsinfrastructure/arm-devopsinfrastructure/samples/v1-beta/typescript/src/imageVersionsListByImageSample.ts deleted file mode 100644 index a7c2d0df1e33..000000000000 --- a/sdk/devopsinfrastructure/arm-devopsinfrastructure/samples/v1-beta/typescript/src/imageVersionsListByImageSample.ts +++ /dev/null @@ -1,46 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -import { ManagedDevOpsInfrastructure } from "@azure/arm-devopsinfrastructure"; -import { DefaultAzureCredential } from "@azure/identity"; -import * as dotenv from "dotenv"; - -dotenv.config(); - -/** - * This sample demonstrates how to List ImageVersion resources by Image - * - * @summary List ImageVersion resources by Image - * x-ms-original-file: specification/devopsinfrastructure/resource-manager/Microsoft.DevOpsInfrastructure/preview/2024-04-04-preview/examples/ImageVersions_ListByImage.json - */ -async function imageVersionsListByImage() { - const subscriptionId = - process.env["DEVOPSINFRASTRUCTURE_SUBSCRIPTION_ID"] || - "a2e95d27-c161-4b61-bda4-11512c14c2c2"; - const resourceGroupName = - process.env["DEVOPSINFRASTRUCTURE_RESOURCE_GROUP"] || "my-resource-group"; - const imageName = "windows-2022"; - const credential = new DefaultAzureCredential(); - const client = new ManagedDevOpsInfrastructure(credential, subscriptionId); - const resArray = new Array(); - for await (let item of client.imageVersions.listByImage( - resourceGroupName, - imageName, - )) { - resArray.push(item); - } - console.log(resArray); -} - -async function main() { - imageVersionsListByImage(); -} - -main().catch(console.error); diff --git a/sdk/devopsinfrastructure/arm-devopsinfrastructure/samples/v1-beta/typescript/src/operationsListSample.ts b/sdk/devopsinfrastructure/arm-devopsinfrastructure/samples/v1-beta/typescript/src/operationsListSample.ts deleted file mode 100644 index 846ffb10bf1d..000000000000 --- a/sdk/devopsinfrastructure/arm-devopsinfrastructure/samples/v1-beta/typescript/src/operationsListSample.ts +++ /dev/null @@ -1,40 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -import { ManagedDevOpsInfrastructure } from "@azure/arm-devopsinfrastructure"; -import { DefaultAzureCredential } from "@azure/identity"; -import * as dotenv from "dotenv"; - -dotenv.config(); - -/** - * This sample demonstrates how to List the operations for the provider - * - * @summary List the operations for the provider - * x-ms-original-file: specification/devopsinfrastructure/resource-manager/Microsoft.DevOpsInfrastructure/preview/2024-04-04-preview/examples/ListOperations.json - */ -async function operationsList() { - const subscriptionId = - process.env["DEVOPSINFRASTRUCTURE_SUBSCRIPTION_ID"] || - "00000000-0000-0000-0000-000000000000"; - const credential = new DefaultAzureCredential(); - const client = new ManagedDevOpsInfrastructure(credential, subscriptionId); - const resArray = new Array(); - for await (let item of client.operations.list()) { - resArray.push(item); - } - console.log(resArray); -} - -async function main() { - operationsList(); -} - -main().catch(console.error); diff --git a/sdk/devopsinfrastructure/arm-devopsinfrastructure/samples/v1-beta/typescript/src/poolsCreateOrUpdateSample.ts b/sdk/devopsinfrastructure/arm-devopsinfrastructure/samples/v1-beta/typescript/src/poolsCreateOrUpdateSample.ts deleted file mode 100644 index 42520866fe49..000000000000 --- a/sdk/devopsinfrastructure/arm-devopsinfrastructure/samples/v1-beta/typescript/src/poolsCreateOrUpdateSample.ts +++ /dev/null @@ -1,71 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -import { - Pool, - ManagedDevOpsInfrastructure, -} from "@azure/arm-devopsinfrastructure"; -import { DefaultAzureCredential } from "@azure/identity"; -import * as dotenv from "dotenv"; - -dotenv.config(); - -/** - * This sample demonstrates how to Create a Pool - * - * @summary Create a Pool - * x-ms-original-file: specification/devopsinfrastructure/resource-manager/Microsoft.DevOpsInfrastructure/preview/2024-04-04-preview/examples/CreateOrUpdatePool.json - */ -async function poolsCreateOrUpdate() { - const subscriptionId = - process.env["DEVOPSINFRASTRUCTURE_SUBSCRIPTION_ID"] || - "a2e95d27-c161-4b61-bda4-11512c14c2c2"; - const resourceGroupName = - process.env["DEVOPSINFRASTRUCTURE_RESOURCE_GROUP"] || "rg"; - const poolName = "pool"; - const resource: Pool = { - location: "eastus", - properties: { - agentProfile: { kind: "Stateless" }, - devCenterProjectResourceId: - "/subscriptions/222e81d0-cf38-4dab-baa5-289bf16baaa4/resourceGroups/rg-1es-devcenter/providers/Microsoft.DevCenter/projects/1ES", - fabricProfile: { - images: [ - { - resourceId: - "/MicrosoftWindowsServer/WindowsServer/2019-Datacenter/latest", - }, - ], - kind: "Vmss", - sku: { name: "Standard_D4ads_v5" }, - }, - maximumConcurrency: 10, - organizationProfile: { - kind: "AzureDevOps", - organizations: [{ url: "https://mseng.visualstudio.com" }], - }, - provisioningState: "Succeeded", - }, - }; - const credential = new DefaultAzureCredential(); - const client = new ManagedDevOpsInfrastructure(credential, subscriptionId); - const result = await client.pools.beginCreateOrUpdateAndWait( - resourceGroupName, - poolName, - resource, - ); - console.log(result); -} - -async function main() { - poolsCreateOrUpdate(); -} - -main().catch(console.error); diff --git a/sdk/devopsinfrastructure/arm-devopsinfrastructure/samples/v1-beta/typescript/src/poolsDeleteSample.ts b/sdk/devopsinfrastructure/arm-devopsinfrastructure/samples/v1-beta/typescript/src/poolsDeleteSample.ts deleted file mode 100644 index 44d67f65c6c5..000000000000 --- a/sdk/devopsinfrastructure/arm-devopsinfrastructure/samples/v1-beta/typescript/src/poolsDeleteSample.ts +++ /dev/null @@ -1,43 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -import { ManagedDevOpsInfrastructure } from "@azure/arm-devopsinfrastructure"; -import { DefaultAzureCredential } from "@azure/identity"; -import * as dotenv from "dotenv"; - -dotenv.config(); - -/** - * This sample demonstrates how to Delete a Pool - * - * @summary Delete a Pool - * x-ms-original-file: specification/devopsinfrastructure/resource-manager/Microsoft.DevOpsInfrastructure/preview/2024-04-04-preview/examples/DeletePool.json - */ -async function poolsDelete() { - const subscriptionId = - process.env["DEVOPSINFRASTRUCTURE_SUBSCRIPTION_ID"] || - "a2e95d27-c161-4b61-bda4-11512c14c2c2"; - const resourceGroupName = - process.env["DEVOPSINFRASTRUCTURE_RESOURCE_GROUP"] || "rg"; - const poolName = "pool"; - const credential = new DefaultAzureCredential(); - const client = new ManagedDevOpsInfrastructure(credential, subscriptionId); - const result = await client.pools.beginDeleteAndWait( - resourceGroupName, - poolName, - ); - console.log(result); -} - -async function main() { - poolsDelete(); -} - -main().catch(console.error); diff --git a/sdk/devopsinfrastructure/arm-devopsinfrastructure/samples/v1-beta/typescript/src/poolsGetSample.ts b/sdk/devopsinfrastructure/arm-devopsinfrastructure/samples/v1-beta/typescript/src/poolsGetSample.ts deleted file mode 100644 index 084268dadec2..000000000000 --- a/sdk/devopsinfrastructure/arm-devopsinfrastructure/samples/v1-beta/typescript/src/poolsGetSample.ts +++ /dev/null @@ -1,40 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -import { ManagedDevOpsInfrastructure } from "@azure/arm-devopsinfrastructure"; -import { DefaultAzureCredential } from "@azure/identity"; -import * as dotenv from "dotenv"; - -dotenv.config(); - -/** - * This sample demonstrates how to Get a Pool - * - * @summary Get a Pool - * x-ms-original-file: specification/devopsinfrastructure/resource-manager/Microsoft.DevOpsInfrastructure/preview/2024-04-04-preview/examples/GetPool.json - */ -async function poolsGet() { - const subscriptionId = - process.env["DEVOPSINFRASTRUCTURE_SUBSCRIPTION_ID"] || - "a2e95d27-c161-4b61-bda4-11512c14c2c2"; - const resourceGroupName = - process.env["DEVOPSINFRASTRUCTURE_RESOURCE_GROUP"] || "rg"; - const poolName = "pool"; - const credential = new DefaultAzureCredential(); - const client = new ManagedDevOpsInfrastructure(credential, subscriptionId); - const result = await client.pools.get(resourceGroupName, poolName); - console.log(result); -} - -async function main() { - poolsGet(); -} - -main().catch(console.error); diff --git a/sdk/devopsinfrastructure/arm-devopsinfrastructure/samples/v1-beta/typescript/src/poolsListByResourceGroupSample.ts b/sdk/devopsinfrastructure/arm-devopsinfrastructure/samples/v1-beta/typescript/src/poolsListByResourceGroupSample.ts deleted file mode 100644 index 7b6581b337e5..000000000000 --- a/sdk/devopsinfrastructure/arm-devopsinfrastructure/samples/v1-beta/typescript/src/poolsListByResourceGroupSample.ts +++ /dev/null @@ -1,42 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -import { ManagedDevOpsInfrastructure } from "@azure/arm-devopsinfrastructure"; -import { DefaultAzureCredential } from "@azure/identity"; -import * as dotenv from "dotenv"; - -dotenv.config(); - -/** - * This sample demonstrates how to List Pool resources by resource group - * - * @summary List Pool resources by resource group - * x-ms-original-file: specification/devopsinfrastructure/resource-manager/Microsoft.DevOpsInfrastructure/preview/2024-04-04-preview/examples/ListPoolsBySubscriptionAndResourceGroup.json - */ -async function poolsListByResourceGroup() { - const subscriptionId = - process.env["DEVOPSINFRASTRUCTURE_SUBSCRIPTION_ID"] || - "a2e95d27-c161-4b61-bda4-11512c14c2c2"; - const resourceGroupName = - process.env["DEVOPSINFRASTRUCTURE_RESOURCE_GROUP"] || "rg"; - const credential = new DefaultAzureCredential(); - const client = new ManagedDevOpsInfrastructure(credential, subscriptionId); - const resArray = new Array(); - for await (let item of client.pools.listByResourceGroup(resourceGroupName)) { - resArray.push(item); - } - console.log(resArray); -} - -async function main() { - poolsListByResourceGroup(); -} - -main().catch(console.error); diff --git a/sdk/devopsinfrastructure/arm-devopsinfrastructure/samples/v1-beta/typescript/src/poolsListBySubscriptionSample.ts b/sdk/devopsinfrastructure/arm-devopsinfrastructure/samples/v1-beta/typescript/src/poolsListBySubscriptionSample.ts deleted file mode 100644 index c6d553e58304..000000000000 --- a/sdk/devopsinfrastructure/arm-devopsinfrastructure/samples/v1-beta/typescript/src/poolsListBySubscriptionSample.ts +++ /dev/null @@ -1,40 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -import { ManagedDevOpsInfrastructure } from "@azure/arm-devopsinfrastructure"; -import { DefaultAzureCredential } from "@azure/identity"; -import * as dotenv from "dotenv"; - -dotenv.config(); - -/** - * This sample demonstrates how to List Pool resources by subscription ID - * - * @summary List Pool resources by subscription ID - * x-ms-original-file: specification/devopsinfrastructure/resource-manager/Microsoft.DevOpsInfrastructure/preview/2024-04-04-preview/examples/ListPoolsBySubscription.json - */ -async function poolsListBySubscription() { - const subscriptionId = - process.env["DEVOPSINFRASTRUCTURE_SUBSCRIPTION_ID"] || - "a2e95d27-c161-4b61-bda4-11512c14c2c2"; - const credential = new DefaultAzureCredential(); - const client = new ManagedDevOpsInfrastructure(credential, subscriptionId); - const resArray = new Array(); - for await (let item of client.pools.listBySubscription()) { - resArray.push(item); - } - console.log(resArray); -} - -async function main() { - poolsListBySubscription(); -} - -main().catch(console.error); diff --git a/sdk/devopsinfrastructure/arm-devopsinfrastructure/samples/v1-beta/typescript/src/poolsUpdateSample.ts b/sdk/devopsinfrastructure/arm-devopsinfrastructure/samples/v1-beta/typescript/src/poolsUpdateSample.ts deleted file mode 100644 index 29706aa1d3a8..000000000000 --- a/sdk/devopsinfrastructure/arm-devopsinfrastructure/samples/v1-beta/typescript/src/poolsUpdateSample.ts +++ /dev/null @@ -1,48 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -import { - PoolUpdate, - ManagedDevOpsInfrastructure, -} from "@azure/arm-devopsinfrastructure"; -import { DefaultAzureCredential } from "@azure/identity"; -import * as dotenv from "dotenv"; - -dotenv.config(); - -/** - * This sample demonstrates how to Update a Pool - * - * @summary Update a Pool - * x-ms-original-file: specification/devopsinfrastructure/resource-manager/Microsoft.DevOpsInfrastructure/preview/2024-04-04-preview/examples/UpdatePool.json - */ -async function poolsUpdate() { - const subscriptionId = - process.env["DEVOPSINFRASTRUCTURE_SUBSCRIPTION_ID"] || - "a2e95d27-c161-4b61-bda4-11512c14c2c2"; - const resourceGroupName = - process.env["DEVOPSINFRASTRUCTURE_RESOURCE_GROUP"] || "rg"; - const poolName = "pool"; - const properties: PoolUpdate = {}; - const credential = new DefaultAzureCredential(); - const client = new ManagedDevOpsInfrastructure(credential, subscriptionId); - const result = await client.pools.beginUpdateAndWait( - resourceGroupName, - poolName, - properties, - ); - console.log(result); -} - -async function main() { - poolsUpdate(); -} - -main().catch(console.error); diff --git a/sdk/devopsinfrastructure/arm-devopsinfrastructure/samples/v1-beta/typescript/src/resourceDetailsListByPoolSample.ts b/sdk/devopsinfrastructure/arm-devopsinfrastructure/samples/v1-beta/typescript/src/resourceDetailsListByPoolSample.ts deleted file mode 100644 index eb551fd80ed8..000000000000 --- a/sdk/devopsinfrastructure/arm-devopsinfrastructure/samples/v1-beta/typescript/src/resourceDetailsListByPoolSample.ts +++ /dev/null @@ -1,46 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -import { ManagedDevOpsInfrastructure } from "@azure/arm-devopsinfrastructure"; -import { DefaultAzureCredential } from "@azure/identity"; -import * as dotenv from "dotenv"; - -dotenv.config(); - -/** - * This sample demonstrates how to List ResourceDetailsObject resources by Pool - * - * @summary List ResourceDetailsObject resources by Pool - * x-ms-original-file: specification/devopsinfrastructure/resource-manager/Microsoft.DevOpsInfrastructure/preview/2024-04-04-preview/examples/ResourceDetails_ListByPool.json - */ -async function resourceDetailsListByPool() { - const subscriptionId = - process.env["DEVOPSINFRASTRUCTURE_SUBSCRIPTION_ID"] || - "a2e95d27-c161-4b61-bda4-11512c14c2c2"; - const resourceGroupName = - process.env["DEVOPSINFRASTRUCTURE_RESOURCE_GROUP"] || "my-resource-group"; - const poolName = "my-dev-ops-pool"; - const credential = new DefaultAzureCredential(); - const client = new ManagedDevOpsInfrastructure(credential, subscriptionId); - const resArray = new Array(); - for await (let item of client.resourceDetails.listByPool( - resourceGroupName, - poolName, - )) { - resArray.push(item); - } - console.log(resArray); -} - -async function main() { - resourceDetailsListByPool(); -} - -main().catch(console.error); diff --git a/sdk/devopsinfrastructure/arm-devopsinfrastructure/samples/v1-beta/typescript/src/skuListByLocationSample.ts b/sdk/devopsinfrastructure/arm-devopsinfrastructure/samples/v1-beta/typescript/src/skuListByLocationSample.ts deleted file mode 100644 index 3d74e7f9c164..000000000000 --- a/sdk/devopsinfrastructure/arm-devopsinfrastructure/samples/v1-beta/typescript/src/skuListByLocationSample.ts +++ /dev/null @@ -1,41 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -import { ManagedDevOpsInfrastructure } from "@azure/arm-devopsinfrastructure"; -import { DefaultAzureCredential } from "@azure/identity"; -import * as dotenv from "dotenv"; - -dotenv.config(); - -/** - * This sample demonstrates how to List ResourceSku resources by subscription ID - * - * @summary List ResourceSku resources by subscription ID - * x-ms-original-file: specification/devopsinfrastructure/resource-manager/Microsoft.DevOpsInfrastructure/preview/2024-04-04-preview/examples/Sku_ListByLocation.json - */ -async function skuListByLocation() { - const subscriptionId = - process.env["DEVOPSINFRASTRUCTURE_SUBSCRIPTION_ID"] || - "a2e95d27-c161-4b61-bda4-11512c14c2c2"; - const locationName = "eastus"; - const credential = new DefaultAzureCredential(); - const client = new ManagedDevOpsInfrastructure(credential, subscriptionId); - const resArray = new Array(); - for await (let item of client.sku.listByLocation(locationName)) { - resArray.push(item); - } - console.log(resArray); -} - -async function main() { - skuListByLocation(); -} - -main().catch(console.error); diff --git a/sdk/devopsinfrastructure/arm-devopsinfrastructure/samples/v1-beta/typescript/src/subscriptionUsagesListByLocationSample.ts b/sdk/devopsinfrastructure/arm-devopsinfrastructure/samples/v1-beta/typescript/src/subscriptionUsagesListByLocationSample.ts deleted file mode 100644 index 1e49a721ca07..000000000000 --- a/sdk/devopsinfrastructure/arm-devopsinfrastructure/samples/v1-beta/typescript/src/subscriptionUsagesListByLocationSample.ts +++ /dev/null @@ -1,43 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -import { ManagedDevOpsInfrastructure } from "@azure/arm-devopsinfrastructure"; -import { DefaultAzureCredential } from "@azure/identity"; -import * as dotenv from "dotenv"; - -dotenv.config(); - -/** - * This sample demonstrates how to List Quota resources by subscription ID - * - * @summary List Quota resources by subscription ID - * x-ms-original-file: specification/devopsinfrastructure/resource-manager/Microsoft.DevOpsInfrastructure/preview/2024-04-04-preview/examples/SubscriptionUsages_ListByLocation.json - */ -async function subscriptionUsagesListByLocation() { - const subscriptionId = - process.env["DEVOPSINFRASTRUCTURE_SUBSCRIPTION_ID"] || - "a2e95d27-c161-4b61-bda4-11512c14c2c2"; - const locationName = "eastus"; - const credential = new DefaultAzureCredential(); - const client = new ManagedDevOpsInfrastructure(credential, subscriptionId); - const resArray = new Array(); - for await (let item of client.subscriptionUsages.listByLocation( - locationName, - )) { - resArray.push(item); - } - console.log(resArray); -} - -async function main() { - subscriptionUsagesListByLocation(); -} - -main().catch(console.error); diff --git a/sdk/devopsinfrastructure/arm-devopsinfrastructure/samples/v1-beta/typescript/tsconfig.json b/sdk/devopsinfrastructure/arm-devopsinfrastructure/samples/v1-beta/typescript/tsconfig.json deleted file mode 100644 index 984eed535aa8..000000000000 --- a/sdk/devopsinfrastructure/arm-devopsinfrastructure/samples/v1-beta/typescript/tsconfig.json +++ /dev/null @@ -1,17 +0,0 @@ -{ - "compilerOptions": { - "target": "ES2020", - "module": "commonjs", - "moduleResolution": "node", - "resolveJsonModule": true, - "esModuleInterop": true, - "allowSyntheticDefaultImports": true, - "strict": true, - "alwaysStrict": true, - "outDir": "dist", - "rootDir": "src" - }, - "include": [ - "src/**/*.ts" - ] -} diff --git a/sdk/devopsinfrastructure/arm-devopsinfrastructure/src/api/devOpsInfrastructureContext.ts b/sdk/devopsinfrastructure/arm-devopsinfrastructure/src/api/devOpsInfrastructureContext.ts new file mode 100644 index 000000000000..915368b83fb4 --- /dev/null +++ b/sdk/devopsinfrastructure/arm-devopsinfrastructure/src/api/devOpsInfrastructureContext.ts @@ -0,0 +1,57 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +import { logger } from "../logger.js"; +import { KnownVersions } from "../models/models.js"; +import { Client, ClientOptions, getClient } from "@azure-rest/core-client"; +import { TokenCredential } from "@azure/core-auth"; + +export interface DevOpsInfrastructureContext extends Client {} + +/** Optional parameters for the client. */ +export interface DevOpsInfrastructureClientOptionalParams + extends ClientOptions { + /** The API version to use for this operation. */ + /** Known values of {@link KnownVersions} that the service accepts. */ + apiVersion?: string; +} + +export function createDevOpsInfrastructure( + credential: TokenCredential, + options: DevOpsInfrastructureClientOptionalParams = {}, +): DevOpsInfrastructureContext { + const endpointUrl = + options.endpoint ?? options.baseUrl ?? `https://management.azure.com`; + const prefixFromOptions = options?.userAgentOptions?.userAgentPrefix; + const userAgentInfo = `azsdk-js-arm-devopsinfrastructure/1.0.0-beta.1`; + const userAgentPrefix = prefixFromOptions + ? `${prefixFromOptions} azsdk-js-api ${userAgentInfo}` + : `azsdk-js-api ${userAgentInfo}`; + const { apiVersion: _, ...updatedOptions } = { + ...options, + userAgentOptions: { userAgentPrefix }, + loggingOptions: { logger: options.loggingOptions?.logger ?? logger.info }, + credentials: { + scopes: options.credentials?.scopes ?? [`${endpointUrl}/.default`], + }, + }; + const clientContext = getClient(endpointUrl, credential, updatedOptions); + clientContext.pipeline.removePolicy({ name: "ApiVersionPolicy" }); + const apiVersion = options.apiVersion ?? "2024-10-19"; + clientContext.pipeline.addPolicy({ + name: "ClientApiVersionPolicy", + sendRequest: (req, next) => { + // Use the apiVersion defined in request url directly + // Append one if there is no apiVersion and we have one at client options + const url = new URL(req.url); + if (!url.searchParams.get("api-version")) { + req.url = `${req.url}${ + Array.from(url.searchParams.keys()).length > 0 ? "&" : "?" + }api-version=${apiVersion}`; + } + + return next(req); + }, + }); + return clientContext; +} diff --git a/sdk/devopsinfrastructure/arm-devopsinfrastructure/src/api/imageVersions/index.ts b/sdk/devopsinfrastructure/arm-devopsinfrastructure/src/api/imageVersions/index.ts new file mode 100644 index 000000000000..5f426a81649a --- /dev/null +++ b/sdk/devopsinfrastructure/arm-devopsinfrastructure/src/api/imageVersions/index.ts @@ -0,0 +1,74 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +import { + DevOpsInfrastructureContext as Client, + ImageVersionsListByImageOptionalParams, +} from "../index.js"; +import { + _ImageVersionListResult, + _imageVersionListResultDeserializer, + ImageVersion, +} from "../../models/models.js"; +import { + PagedAsyncIterableIterator, + buildPagedAsyncIterator, +} from "../../static-helpers/pagingHelpers.js"; +import { + StreamableMethod, + PathUncheckedResponse, + createRestError, + operationOptionsToRequestParameters, +} from "@azure-rest/core-client"; + +export function _imageVersionsListByImageSend( + context: Client, + subscriptionId: string, + resourceGroupName: string, + imageName: string, + options: ImageVersionsListByImageOptionalParams = { requestOptions: {} }, +): StreamableMethod { + return context + .path( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DevOpsInfrastructure/images/{imageName}/versions", + subscriptionId, + resourceGroupName, + imageName, + ) + .get({ ...operationOptionsToRequestParameters(options) }); +} + +export async function _imageVersionsListByImageDeserialize( + result: PathUncheckedResponse, +): Promise<_ImageVersionListResult> { + const expectedStatuses = ["200"]; + if (!expectedStatuses.includes(result.status)) { + throw createRestError(result); + } + + return _imageVersionListResultDeserializer(result.body); +} + +/** List ImageVersion resources by Image */ +export function imageVersionsListByImage( + context: Client, + subscriptionId: string, + resourceGroupName: string, + imageName: string, + options: ImageVersionsListByImageOptionalParams = { requestOptions: {} }, +): PagedAsyncIterableIterator { + return buildPagedAsyncIterator( + context, + () => + _imageVersionsListByImageSend( + context, + subscriptionId, + resourceGroupName, + imageName, + options, + ), + _imageVersionsListByImageDeserialize, + ["200"], + { itemName: "value", nextLinkName: "nextLink" }, + ); +} diff --git a/sdk/devopsinfrastructure/arm-devopsinfrastructure/src/api/index.ts b/sdk/devopsinfrastructure/arm-devopsinfrastructure/src/api/index.ts new file mode 100644 index 000000000000..cec3608706fb --- /dev/null +++ b/sdk/devopsinfrastructure/arm-devopsinfrastructure/src/api/index.ts @@ -0,0 +1,36 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +export { + createDevOpsInfrastructure, + DevOpsInfrastructureContext, + DevOpsInfrastructureClientOptionalParams, +} from "./devOpsInfrastructureContext.js"; +export { + OperationsListOptionalParams, + PoolsGetOptionalParams, + PoolsCreateOrUpdateOptionalParams, + PoolsUpdateOptionalParams, + PoolsDeleteOptionalParams, + PoolsListByResourceGroupOptionalParams, + PoolsListBySubscriptionOptionalParams, + PoolsCheckNameAvailabilityOptionalParams, + ResourceDetailsListByPoolOptionalParams, + SkuListByLocationOptionalParams, + SubscriptionUsagesUsagesOptionalParams, + ImageVersionsListByImageOptionalParams, +} from "./options.js"; +export { imageVersionsListByImage } from "./imageVersions/index.js"; +export { operationsList } from "./operations/index.js"; +export { + poolsGet, + poolsCreateOrUpdate, + poolsUpdate, + poolsDelete, + poolsListByResourceGroup, + poolsListBySubscription, + poolsCheckNameAvailability, +} from "./pools/index.js"; +export { resourceDetailsListByPool } from "./resourceDetails/index.js"; +export { skuListByLocation } from "./sku/index.js"; +export { subscriptionUsagesUsages } from "./subscriptionUsages/index.js"; diff --git a/sdk/devopsinfrastructure/arm-devopsinfrastructure/src/api/operations/index.ts b/sdk/devopsinfrastructure/arm-devopsinfrastructure/src/api/operations/index.ts new file mode 100644 index 000000000000..9c30b725caea --- /dev/null +++ b/sdk/devopsinfrastructure/arm-devopsinfrastructure/src/api/operations/index.ts @@ -0,0 +1,56 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +import { + DevOpsInfrastructureContext as Client, + OperationsListOptionalParams, +} from "../index.js"; +import { + _OperationListResult, + _operationListResultDeserializer, + Operation, +} from "../../models/models.js"; +import { + PagedAsyncIterableIterator, + buildPagedAsyncIterator, +} from "../../static-helpers/pagingHelpers.js"; +import { + StreamableMethod, + PathUncheckedResponse, + createRestError, + operationOptionsToRequestParameters, +} from "@azure-rest/core-client"; + +export function _operationsListSend( + context: Client, + options: OperationsListOptionalParams = { requestOptions: {} }, +): StreamableMethod { + return context + .path("/providers/Microsoft.DevOpsInfrastructure/operations") + .get({ ...operationOptionsToRequestParameters(options) }); +} + +export async function _operationsListDeserialize( + result: PathUncheckedResponse, +): Promise<_OperationListResult> { + const expectedStatuses = ["200"]; + if (!expectedStatuses.includes(result.status)) { + throw createRestError(result); + } + + return _operationListResultDeserializer(result.body); +} + +/** List the operations for the provider */ +export function operationsList( + context: Client, + options: OperationsListOptionalParams = { requestOptions: {} }, +): PagedAsyncIterableIterator { + return buildPagedAsyncIterator( + context, + () => _operationsListSend(context, options), + _operationsListDeserialize, + ["200"], + { itemName: "value", nextLinkName: "nextLink" }, + ); +} diff --git a/sdk/devopsinfrastructure/arm-devopsinfrastructure/src/api/options.ts b/sdk/devopsinfrastructure/arm-devopsinfrastructure/src/api/options.ts new file mode 100644 index 000000000000..fbadb1df69c4 --- /dev/null +++ b/sdk/devopsinfrastructure/arm-devopsinfrastructure/src/api/options.ts @@ -0,0 +1,55 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +import { OperationOptions } from "@azure-rest/core-client"; + +/** Optional parameters. */ +export interface OperationsListOptionalParams extends OperationOptions {} + +/** Optional parameters. */ +export interface PoolsGetOptionalParams extends OperationOptions {} + +/** Optional parameters. */ +export interface PoolsCreateOrUpdateOptionalParams extends OperationOptions { + /** Delay to wait until next poll, in milliseconds. */ + updateIntervalInMs?: number; +} + +/** Optional parameters. */ +export interface PoolsUpdateOptionalParams extends OperationOptions { + /** Delay to wait until next poll, in milliseconds. */ + updateIntervalInMs?: number; +} + +/** Optional parameters. */ +export interface PoolsDeleteOptionalParams extends OperationOptions { + /** Delay to wait until next poll, in milliseconds. */ + updateIntervalInMs?: number; +} + +/** Optional parameters. */ +export interface PoolsListByResourceGroupOptionalParams + extends OperationOptions {} + +/** Optional parameters. */ +export interface PoolsListBySubscriptionOptionalParams + extends OperationOptions {} + +/** Optional parameters. */ +export interface PoolsCheckNameAvailabilityOptionalParams + extends OperationOptions {} + +/** Optional parameters. */ +export interface ResourceDetailsListByPoolOptionalParams + extends OperationOptions {} + +/** Optional parameters. */ +export interface SkuListByLocationOptionalParams extends OperationOptions {} + +/** Optional parameters. */ +export interface SubscriptionUsagesUsagesOptionalParams + extends OperationOptions {} + +/** Optional parameters. */ +export interface ImageVersionsListByImageOptionalParams + extends OperationOptions {} diff --git a/sdk/devopsinfrastructure/arm-devopsinfrastructure/src/api/pools/index.ts b/sdk/devopsinfrastructure/arm-devopsinfrastructure/src/api/pools/index.ts new file mode 100644 index 000000000000..c83004232afc --- /dev/null +++ b/sdk/devopsinfrastructure/arm-devopsinfrastructure/src/api/pools/index.ts @@ -0,0 +1,395 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +import { + DevOpsInfrastructureContext as Client, + PoolsCheckNameAvailabilityOptionalParams, + PoolsCreateOrUpdateOptionalParams, + PoolsDeleteOptionalParams, + PoolsGetOptionalParams, + PoolsListByResourceGroupOptionalParams, + PoolsListBySubscriptionOptionalParams, + PoolsUpdateOptionalParams, +} from "../index.js"; +import { + Pool, + poolSerializer, + poolDeserializer, + PoolUpdate, + poolUpdateSerializer, + _PoolListResult, + _poolListResultDeserializer, + CheckNameAvailability, + checkNameAvailabilitySerializer, + CheckNameAvailabilityResult, + checkNameAvailabilityResultDeserializer, +} from "../../models/models.js"; +import { + PagedAsyncIterableIterator, + buildPagedAsyncIterator, +} from "../../static-helpers/pagingHelpers.js"; +import { getLongRunningPoller } from "../../static-helpers/pollingHelpers.js"; +import { + StreamableMethod, + PathUncheckedResponse, + createRestError, + operationOptionsToRequestParameters, +} from "@azure-rest/core-client"; +import { PollerLike, OperationState } from "@azure/core-lro"; + +export function _poolsGetSend( + context: Client, + subscriptionId: string, + resourceGroupName: string, + poolName: string, + options: PoolsGetOptionalParams = { requestOptions: {} }, +): StreamableMethod { + return context + .path( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DevOpsInfrastructure/pools/{poolName}", + subscriptionId, + resourceGroupName, + poolName, + ) + .get({ ...operationOptionsToRequestParameters(options) }); +} + +export async function _poolsGetDeserialize( + result: PathUncheckedResponse, +): Promise { + const expectedStatuses = ["200"]; + if (!expectedStatuses.includes(result.status)) { + throw createRestError(result); + } + + return poolDeserializer(result.body); +} + +/** Get a Pool */ +export async function poolsGet( + context: Client, + subscriptionId: string, + resourceGroupName: string, + poolName: string, + options: PoolsGetOptionalParams = { requestOptions: {} }, +): Promise { + const result = await _poolsGetSend( + context, + subscriptionId, + resourceGroupName, + poolName, + options, + ); + return _poolsGetDeserialize(result); +} + +export function _poolsCreateOrUpdateSend( + context: Client, + subscriptionId: string, + resourceGroupName: string, + poolName: string, + resource: Pool, + options: PoolsCreateOrUpdateOptionalParams = { requestOptions: {} }, +): StreamableMethod { + return context + .path( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DevOpsInfrastructure/pools/{poolName}", + subscriptionId, + resourceGroupName, + poolName, + ) + .put({ + ...operationOptionsToRequestParameters(options), + body: poolSerializer(resource), + }); +} + +export async function _poolsCreateOrUpdateDeserialize( + result: PathUncheckedResponse, +): Promise { + const expectedStatuses = ["200", "201"]; + if (!expectedStatuses.includes(result.status)) { + throw createRestError(result); + } + + return poolDeserializer(result.body); +} + +/** Create a Pool */ +export function poolsCreateOrUpdate( + context: Client, + subscriptionId: string, + resourceGroupName: string, + poolName: string, + resource: Pool, + options: PoolsCreateOrUpdateOptionalParams = { requestOptions: {} }, +): PollerLike, Pool> { + return getLongRunningPoller( + context, + _poolsCreateOrUpdateDeserialize, + ["200", "201"], + { + updateIntervalInMs: options?.updateIntervalInMs, + abortSignal: options?.abortSignal, + getInitialResponse: () => + _poolsCreateOrUpdateSend( + context, + subscriptionId, + resourceGroupName, + poolName, + resource, + options, + ), + resourceLocationConfig: "azure-async-operation", + }, + ) as PollerLike, Pool>; +} + +export function _poolsUpdateSend( + context: Client, + subscriptionId: string, + resourceGroupName: string, + poolName: string, + properties: PoolUpdate, + options: PoolsUpdateOptionalParams = { requestOptions: {} }, +): StreamableMethod { + return context + .path( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DevOpsInfrastructure/pools/{poolName}", + subscriptionId, + resourceGroupName, + poolName, + ) + .patch({ + ...operationOptionsToRequestParameters(options), + body: poolUpdateSerializer(properties), + }); +} + +export async function _poolsUpdateDeserialize( + result: PathUncheckedResponse, +): Promise { + const expectedStatuses = ["200", "202"]; + if (!expectedStatuses.includes(result.status)) { + throw createRestError(result); + } + + return poolDeserializer(result.body); +} + +/** Update a Pool */ +export function poolsUpdate( + context: Client, + subscriptionId: string, + resourceGroupName: string, + poolName: string, + properties: PoolUpdate, + options: PoolsUpdateOptionalParams = { requestOptions: {} }, +): PollerLike, Pool> { + return getLongRunningPoller( + context, + _poolsUpdateDeserialize, + ["200", "202"], + { + updateIntervalInMs: options?.updateIntervalInMs, + abortSignal: options?.abortSignal, + getInitialResponse: () => + _poolsUpdateSend( + context, + subscriptionId, + resourceGroupName, + poolName, + properties, + options, + ), + resourceLocationConfig: "location", + }, + ) as PollerLike, Pool>; +} + +export function _poolsDeleteSend( + context: Client, + subscriptionId: string, + resourceGroupName: string, + poolName: string, + options: PoolsDeleteOptionalParams = { requestOptions: {} }, +): StreamableMethod { + return context + .path( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DevOpsInfrastructure/pools/{poolName}", + subscriptionId, + resourceGroupName, + poolName, + ) + .delete({ ...operationOptionsToRequestParameters(options) }); +} + +export async function _poolsDeleteDeserialize( + result: PathUncheckedResponse, +): Promise { + const expectedStatuses = ["202", "204", "200"]; + if (!expectedStatuses.includes(result.status)) { + throw createRestError(result); + } + + return; +} + +/** Delete a Pool */ +export function poolsDelete( + context: Client, + subscriptionId: string, + resourceGroupName: string, + poolName: string, + options: PoolsDeleteOptionalParams = { requestOptions: {} }, +): PollerLike, void> { + return getLongRunningPoller( + context, + _poolsDeleteDeserialize, + ["202", "204", "200"], + { + updateIntervalInMs: options?.updateIntervalInMs, + abortSignal: options?.abortSignal, + getInitialResponse: () => + _poolsDeleteSend( + context, + subscriptionId, + resourceGroupName, + poolName, + options, + ), + resourceLocationConfig: "location", + }, + ) as PollerLike, void>; +} + +export function _poolsListByResourceGroupSend( + context: Client, + subscriptionId: string, + resourceGroupName: string, + options: PoolsListByResourceGroupOptionalParams = { requestOptions: {} }, +): StreamableMethod { + return context + .path( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DevOpsInfrastructure/pools", + subscriptionId, + resourceGroupName, + ) + .get({ ...operationOptionsToRequestParameters(options) }); +} + +export async function _poolsListByResourceGroupDeserialize( + result: PathUncheckedResponse, +): Promise<_PoolListResult> { + const expectedStatuses = ["200"]; + if (!expectedStatuses.includes(result.status)) { + throw createRestError(result); + } + + return _poolListResultDeserializer(result.body); +} + +/** List Pool resources by resource group */ +export function poolsListByResourceGroup( + context: Client, + subscriptionId: string, + resourceGroupName: string, + options: PoolsListByResourceGroupOptionalParams = { requestOptions: {} }, +): PagedAsyncIterableIterator { + return buildPagedAsyncIterator( + context, + () => + _poolsListByResourceGroupSend( + context, + subscriptionId, + resourceGroupName, + options, + ), + _poolsListByResourceGroupDeserialize, + ["200"], + { itemName: "value", nextLinkName: "nextLink" }, + ); +} + +export function _poolsListBySubscriptionSend( + context: Client, + subscriptionId: string, + options: PoolsListBySubscriptionOptionalParams = { requestOptions: {} }, +): StreamableMethod { + return context + .path( + "/subscriptions/{subscriptionId}/providers/Microsoft.DevOpsInfrastructure/pools", + subscriptionId, + ) + .get({ ...operationOptionsToRequestParameters(options) }); +} + +export async function _poolsListBySubscriptionDeserialize( + result: PathUncheckedResponse, +): Promise<_PoolListResult> { + const expectedStatuses = ["200"]; + if (!expectedStatuses.includes(result.status)) { + throw createRestError(result); + } + + return _poolListResultDeserializer(result.body); +} + +/** List Pool resources by subscription ID */ +export function poolsListBySubscription( + context: Client, + subscriptionId: string, + options: PoolsListBySubscriptionOptionalParams = { requestOptions: {} }, +): PagedAsyncIterableIterator { + return buildPagedAsyncIterator( + context, + () => _poolsListBySubscriptionSend(context, subscriptionId, options), + _poolsListBySubscriptionDeserialize, + ["200"], + { itemName: "value", nextLinkName: "nextLink" }, + ); +} + +export function _poolsCheckNameAvailabilitySend( + context: Client, + subscriptionId: string, + body: CheckNameAvailability, + options: PoolsCheckNameAvailabilityOptionalParams = { requestOptions: {} }, +): StreamableMethod { + return context + .path( + "/subscriptions/{subscriptionId}/providers/Microsoft.DevOpsInfrastructure/checkNameAvailability", + subscriptionId, + ) + .post({ + ...operationOptionsToRequestParameters(options), + body: checkNameAvailabilitySerializer(body), + }); +} + +export async function _poolsCheckNameAvailabilityDeserialize( + result: PathUncheckedResponse, +): Promise { + const expectedStatuses = ["200"]; + if (!expectedStatuses.includes(result.status)) { + throw createRestError(result); + } + + return checkNameAvailabilityResultDeserializer(result.body); +} + +/** Checks that the pool name is valid and is not already in use. */ +export async function poolsCheckNameAvailability( + context: Client, + subscriptionId: string, + body: CheckNameAvailability, + options: PoolsCheckNameAvailabilityOptionalParams = { requestOptions: {} }, +): Promise { + const result = await _poolsCheckNameAvailabilitySend( + context, + subscriptionId, + body, + options, + ); + return _poolsCheckNameAvailabilityDeserialize(result); +} diff --git a/sdk/devopsinfrastructure/arm-devopsinfrastructure/src/api/resourceDetails/index.ts b/sdk/devopsinfrastructure/arm-devopsinfrastructure/src/api/resourceDetails/index.ts new file mode 100644 index 000000000000..87300418d3d7 --- /dev/null +++ b/sdk/devopsinfrastructure/arm-devopsinfrastructure/src/api/resourceDetails/index.ts @@ -0,0 +1,74 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +import { + DevOpsInfrastructureContext as Client, + ResourceDetailsListByPoolOptionalParams, +} from "../index.js"; +import { + _ResourceDetailsObjectListResult, + _resourceDetailsObjectListResultDeserializer, + ResourceDetailsObject, +} from "../../models/models.js"; +import { + PagedAsyncIterableIterator, + buildPagedAsyncIterator, +} from "../../static-helpers/pagingHelpers.js"; +import { + StreamableMethod, + PathUncheckedResponse, + createRestError, + operationOptionsToRequestParameters, +} from "@azure-rest/core-client"; + +export function _resourceDetailsListByPoolSend( + context: Client, + subscriptionId: string, + resourceGroupName: string, + poolName: string, + options: ResourceDetailsListByPoolOptionalParams = { requestOptions: {} }, +): StreamableMethod { + return context + .path( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DevOpsInfrastructure/pools/{poolName}/resources", + subscriptionId, + resourceGroupName, + poolName, + ) + .get({ ...operationOptionsToRequestParameters(options) }); +} + +export async function _resourceDetailsListByPoolDeserialize( + result: PathUncheckedResponse, +): Promise<_ResourceDetailsObjectListResult> { + const expectedStatuses = ["200"]; + if (!expectedStatuses.includes(result.status)) { + throw createRestError(result); + } + + return _resourceDetailsObjectListResultDeserializer(result.body); +} + +/** List ResourceDetailsObject resources by Pool */ +export function resourceDetailsListByPool( + context: Client, + subscriptionId: string, + resourceGroupName: string, + poolName: string, + options: ResourceDetailsListByPoolOptionalParams = { requestOptions: {} }, +): PagedAsyncIterableIterator { + return buildPagedAsyncIterator( + context, + () => + _resourceDetailsListByPoolSend( + context, + subscriptionId, + resourceGroupName, + poolName, + options, + ), + _resourceDetailsListByPoolDeserialize, + ["200"], + { itemName: "value", nextLinkName: "nextLink" }, + ); +} diff --git a/sdk/devopsinfrastructure/arm-devopsinfrastructure/src/api/sku/index.ts b/sdk/devopsinfrastructure/arm-devopsinfrastructure/src/api/sku/index.ts new file mode 100644 index 000000000000..4b9d009f338d --- /dev/null +++ b/sdk/devopsinfrastructure/arm-devopsinfrastructure/src/api/sku/index.ts @@ -0,0 +1,65 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +import { + DevOpsInfrastructureContext as Client, + SkuListByLocationOptionalParams, +} from "../index.js"; +import { + _ResourceSkuListResult, + _resourceSkuListResultDeserializer, + ResourceSku, +} from "../../models/models.js"; +import { + PagedAsyncIterableIterator, + buildPagedAsyncIterator, +} from "../../static-helpers/pagingHelpers.js"; +import { + StreamableMethod, + PathUncheckedResponse, + createRestError, + operationOptionsToRequestParameters, +} from "@azure-rest/core-client"; + +export function _skuListByLocationSend( + context: Client, + subscriptionId: string, + locationName: string, + options: SkuListByLocationOptionalParams = { requestOptions: {} }, +): StreamableMethod { + return context + .path( + "/subscriptions/{subscriptionId}/providers/Microsoft.DevOpsInfrastructure/locations/{locationName}/skus", + subscriptionId, + locationName, + ) + .get({ ...operationOptionsToRequestParameters(options) }); +} + +export async function _skuListByLocationDeserialize( + result: PathUncheckedResponse, +): Promise<_ResourceSkuListResult> { + const expectedStatuses = ["200"]; + if (!expectedStatuses.includes(result.status)) { + throw createRestError(result); + } + + return _resourceSkuListResultDeserializer(result.body); +} + +/** List ResourceSku resources by subscription ID */ +export function skuListByLocation( + context: Client, + subscriptionId: string, + locationName: string, + options: SkuListByLocationOptionalParams = { requestOptions: {} }, +): PagedAsyncIterableIterator { + return buildPagedAsyncIterator( + context, + () => + _skuListByLocationSend(context, subscriptionId, locationName, options), + _skuListByLocationDeserialize, + ["200"], + { itemName: "value", nextLinkName: "nextLink" }, + ); +} diff --git a/sdk/devopsinfrastructure/arm-devopsinfrastructure/src/api/subscriptionUsages/index.ts b/sdk/devopsinfrastructure/arm-devopsinfrastructure/src/api/subscriptionUsages/index.ts new file mode 100644 index 000000000000..b3292823a246 --- /dev/null +++ b/sdk/devopsinfrastructure/arm-devopsinfrastructure/src/api/subscriptionUsages/index.ts @@ -0,0 +1,65 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +import { + DevOpsInfrastructureContext as Client, + SubscriptionUsagesUsagesOptionalParams, +} from "../index.js"; +import { + _PagedQuota, + _pagedQuotaDeserializer, + Quota, +} from "../../models/models.js"; +import { + PagedAsyncIterableIterator, + buildPagedAsyncIterator, +} from "../../static-helpers/pagingHelpers.js"; +import { + StreamableMethod, + PathUncheckedResponse, + createRestError, + operationOptionsToRequestParameters, +} from "@azure-rest/core-client"; + +export function _subscriptionUsagesUsagesSend( + context: Client, + subscriptionId: string, + location: string, + options: SubscriptionUsagesUsagesOptionalParams = { requestOptions: {} }, +): StreamableMethod { + return context + .path( + "/subscriptions/{subscriptionId}/providers/Microsoft.DevOpsInfrastructure/locations/{location}/usages", + subscriptionId, + location, + ) + .get({ ...operationOptionsToRequestParameters(options) }); +} + +export async function _subscriptionUsagesUsagesDeserialize( + result: PathUncheckedResponse, +): Promise<_PagedQuota> { + const expectedStatuses = ["200"]; + if (!expectedStatuses.includes(result.status)) { + throw createRestError(result); + } + + return _pagedQuotaDeserializer(result.body); +} + +/** List Quota resources by subscription ID */ +export function subscriptionUsagesUsages( + context: Client, + subscriptionId: string, + location: string, + options: SubscriptionUsagesUsagesOptionalParams = { requestOptions: {} }, +): PagedAsyncIterableIterator { + return buildPagedAsyncIterator( + context, + () => + _subscriptionUsagesUsagesSend(context, subscriptionId, location, options), + _subscriptionUsagesUsagesDeserialize, + ["200"], + { itemName: "value", nextLinkName: "nextLink" }, + ); +} diff --git a/sdk/devopsinfrastructure/arm-devopsinfrastructure/src/classic/imageVersions/index.ts b/sdk/devopsinfrastructure/arm-devopsinfrastructure/src/classic/imageVersions/index.ts new file mode 100644 index 000000000000..8b19c3c9778f --- /dev/null +++ b/sdk/devopsinfrastructure/arm-devopsinfrastructure/src/classic/imageVersions/index.ts @@ -0,0 +1,47 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +import { DevOpsInfrastructureContext } from "../../api/devOpsInfrastructureContext.js"; +import { imageVersionsListByImage } from "../../api/imageVersions/index.js"; +import { ImageVersionsListByImageOptionalParams } from "../../api/options.js"; +import { ImageVersion } from "../../models/models.js"; +import { PagedAsyncIterableIterator } from "../../static-helpers/pagingHelpers.js"; + +/** Interface representing a ImageVersions operations. */ +export interface ImageVersionsOperations { + /** List ImageVersion resources by Image */ + listByImage: ( + resourceGroupName: string, + imageName: string, + options?: ImageVersionsListByImageOptionalParams, + ) => PagedAsyncIterableIterator; +} + +export function getImageVersions( + context: DevOpsInfrastructureContext, + subscriptionId: string, +) { + return { + listByImage: ( + resourceGroupName: string, + imageName: string, + options?: ImageVersionsListByImageOptionalParams, + ) => + imageVersionsListByImage( + context, + subscriptionId, + resourceGroupName, + imageName, + options, + ), + }; +} + +export function getImageVersionsOperations( + context: DevOpsInfrastructureContext, + subscriptionId: string, +): ImageVersionsOperations { + return { + ...getImageVersions(context, subscriptionId), + }; +} diff --git a/sdk/devopsinfrastructure/arm-devopsinfrastructure/src/classic/index.ts b/sdk/devopsinfrastructure/arm-devopsinfrastructure/src/classic/index.ts new file mode 100644 index 000000000000..9d4c5b46151a --- /dev/null +++ b/sdk/devopsinfrastructure/arm-devopsinfrastructure/src/classic/index.ts @@ -0,0 +1,9 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +export { ImageVersionsOperations } from "./imageVersions/index.js"; +export { OperationsOperations } from "./operations/index.js"; +export { PoolsOperations } from "./pools/index.js"; +export { ResourceDetailsOperations } from "./resourceDetails/index.js"; +export { SkuOperations } from "./sku/index.js"; +export { SubscriptionUsagesOperations } from "./subscriptionUsages/index.js"; diff --git a/sdk/devopsinfrastructure/arm-devopsinfrastructure/src/classic/operations/index.ts b/sdk/devopsinfrastructure/arm-devopsinfrastructure/src/classic/operations/index.ts new file mode 100644 index 000000000000..c56fca6d3ccd --- /dev/null +++ b/sdk/devopsinfrastructure/arm-devopsinfrastructure/src/classic/operations/index.ts @@ -0,0 +1,31 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +import { DevOpsInfrastructureContext } from "../../api/devOpsInfrastructureContext.js"; +import { operationsList } from "../../api/operations/index.js"; +import { OperationsListOptionalParams } from "../../api/options.js"; +import { Operation } from "../../models/models.js"; +import { PagedAsyncIterableIterator } from "../../static-helpers/pagingHelpers.js"; + +/** Interface representing a Operations operations. */ +export interface OperationsOperations { + /** List the operations for the provider */ + list: ( + options?: OperationsListOptionalParams, + ) => PagedAsyncIterableIterator; +} + +export function getOperations(context: DevOpsInfrastructureContext) { + return { + list: (options?: OperationsListOptionalParams) => + operationsList(context, options), + }; +} + +export function getOperationsOperations( + context: DevOpsInfrastructureContext, +): OperationsOperations { + return { + ...getOperations(context), + }; +} diff --git a/sdk/devopsinfrastructure/arm-devopsinfrastructure/src/classic/pools/index.ts b/sdk/devopsinfrastructure/arm-devopsinfrastructure/src/classic/pools/index.ts new file mode 100644 index 000000000000..ca14ba250425 --- /dev/null +++ b/sdk/devopsinfrastructure/arm-devopsinfrastructure/src/classic/pools/index.ts @@ -0,0 +1,153 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +import { DevOpsInfrastructureContext } from "../../api/devOpsInfrastructureContext.js"; +import { + PoolsGetOptionalParams, + PoolsCreateOrUpdateOptionalParams, + PoolsUpdateOptionalParams, + PoolsDeleteOptionalParams, + PoolsListByResourceGroupOptionalParams, + PoolsListBySubscriptionOptionalParams, + PoolsCheckNameAvailabilityOptionalParams, +} from "../../api/options.js"; +import { + poolsGet, + poolsCreateOrUpdate, + poolsUpdate, + poolsDelete, + poolsListByResourceGroup, + poolsListBySubscription, + poolsCheckNameAvailability, +} from "../../api/pools/index.js"; +import { + Pool, + PoolUpdate, + CheckNameAvailability, + CheckNameAvailabilityResult, +} from "../../models/models.js"; +import { PagedAsyncIterableIterator } from "../../static-helpers/pagingHelpers.js"; +import { PollerLike, OperationState } from "@azure/core-lro"; + +/** Interface representing a Pools operations. */ +export interface PoolsOperations { + /** Get a Pool */ + get: ( + resourceGroupName: string, + poolName: string, + options?: PoolsGetOptionalParams, + ) => Promise; + /** Create a Pool */ + createOrUpdate: ( + resourceGroupName: string, + poolName: string, + resource: Pool, + options?: PoolsCreateOrUpdateOptionalParams, + ) => PollerLike, Pool>; + /** Update a Pool */ + update: ( + resourceGroupName: string, + poolName: string, + properties: PoolUpdate, + options?: PoolsUpdateOptionalParams, + ) => PollerLike, Pool>; + /** Delete a Pool */ + delete: ( + resourceGroupName: string, + poolName: string, + options?: PoolsDeleteOptionalParams, + ) => PollerLike, void>; + /** List Pool resources by resource group */ + listByResourceGroup: ( + resourceGroupName: string, + options?: PoolsListByResourceGroupOptionalParams, + ) => PagedAsyncIterableIterator; + /** List Pool resources by subscription ID */ + listBySubscription: ( + options?: PoolsListBySubscriptionOptionalParams, + ) => PagedAsyncIterableIterator; + /** Checks that the pool name is valid and is not already in use. */ + checkNameAvailability: ( + body: CheckNameAvailability, + options?: PoolsCheckNameAvailabilityOptionalParams, + ) => Promise; +} + +export function getPools( + context: DevOpsInfrastructureContext, + subscriptionId: string, +) { + return { + get: ( + resourceGroupName: string, + poolName: string, + options?: PoolsGetOptionalParams, + ) => + poolsGet(context, subscriptionId, resourceGroupName, poolName, options), + createOrUpdate: ( + resourceGroupName: string, + poolName: string, + resource: Pool, + options?: PoolsCreateOrUpdateOptionalParams, + ) => + poolsCreateOrUpdate( + context, + subscriptionId, + resourceGroupName, + poolName, + resource, + options, + ), + update: ( + resourceGroupName: string, + poolName: string, + properties: PoolUpdate, + options?: PoolsUpdateOptionalParams, + ) => + poolsUpdate( + context, + subscriptionId, + resourceGroupName, + poolName, + properties, + options, + ), + delete: ( + resourceGroupName: string, + poolName: string, + options?: PoolsDeleteOptionalParams, + ) => + poolsDelete( + context, + subscriptionId, + resourceGroupName, + poolName, + options, + ), + listByResourceGroup: ( + resourceGroupName: string, + options?: PoolsListByResourceGroupOptionalParams, + ) => + poolsListByResourceGroup( + context, + subscriptionId, + resourceGroupName, + options, + ), + listBySubscription: (options?: PoolsListBySubscriptionOptionalParams) => + poolsListBySubscription(context, subscriptionId, options), + checkNameAvailability: ( + body: CheckNameAvailability, + options?: PoolsCheckNameAvailabilityOptionalParams, + ) => poolsCheckNameAvailability(context, subscriptionId, body, options), + }; +} + +export function getPoolsOperations( + context: DevOpsInfrastructureContext, + subscriptionId: string, +): PoolsOperations { + return { + ...getPools(context, subscriptionId), + }; +} diff --git a/sdk/devopsinfrastructure/arm-devopsinfrastructure/src/classic/resourceDetails/index.ts b/sdk/devopsinfrastructure/arm-devopsinfrastructure/src/classic/resourceDetails/index.ts new file mode 100644 index 000000000000..bea437295e2c --- /dev/null +++ b/sdk/devopsinfrastructure/arm-devopsinfrastructure/src/classic/resourceDetails/index.ts @@ -0,0 +1,47 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +import { DevOpsInfrastructureContext } from "../../api/devOpsInfrastructureContext.js"; +import { ResourceDetailsListByPoolOptionalParams } from "../../api/options.js"; +import { resourceDetailsListByPool } from "../../api/resourceDetails/index.js"; +import { ResourceDetailsObject } from "../../models/models.js"; +import { PagedAsyncIterableIterator } from "../../static-helpers/pagingHelpers.js"; + +/** Interface representing a ResourceDetails operations. */ +export interface ResourceDetailsOperations { + /** List ResourceDetailsObject resources by Pool */ + listByPool: ( + resourceGroupName: string, + poolName: string, + options?: ResourceDetailsListByPoolOptionalParams, + ) => PagedAsyncIterableIterator; +} + +export function getResourceDetails( + context: DevOpsInfrastructureContext, + subscriptionId: string, +) { + return { + listByPool: ( + resourceGroupName: string, + poolName: string, + options?: ResourceDetailsListByPoolOptionalParams, + ) => + resourceDetailsListByPool( + context, + subscriptionId, + resourceGroupName, + poolName, + options, + ), + }; +} + +export function getResourceDetailsOperations( + context: DevOpsInfrastructureContext, + subscriptionId: string, +): ResourceDetailsOperations { + return { + ...getResourceDetails(context, subscriptionId), + }; +} diff --git a/sdk/devopsinfrastructure/arm-devopsinfrastructure/src/classic/sku/index.ts b/sdk/devopsinfrastructure/arm-devopsinfrastructure/src/classic/sku/index.ts new file mode 100644 index 000000000000..c097ce30f1b1 --- /dev/null +++ b/sdk/devopsinfrastructure/arm-devopsinfrastructure/src/classic/sku/index.ts @@ -0,0 +1,38 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +import { DevOpsInfrastructureContext } from "../../api/devOpsInfrastructureContext.js"; +import { SkuListByLocationOptionalParams } from "../../api/options.js"; +import { skuListByLocation } from "../../api/sku/index.js"; +import { ResourceSku } from "../../models/models.js"; +import { PagedAsyncIterableIterator } from "../../static-helpers/pagingHelpers.js"; + +/** Interface representing a Sku operations. */ +export interface SkuOperations { + /** List ResourceSku resources by subscription ID */ + listByLocation: ( + locationName: string, + options?: SkuListByLocationOptionalParams, + ) => PagedAsyncIterableIterator; +} + +export function getSku( + context: DevOpsInfrastructureContext, + subscriptionId: string, +) { + return { + listByLocation: ( + locationName: string, + options?: SkuListByLocationOptionalParams, + ) => skuListByLocation(context, subscriptionId, locationName, options), + }; +} + +export function getSkuOperations( + context: DevOpsInfrastructureContext, + subscriptionId: string, +): SkuOperations { + return { + ...getSku(context, subscriptionId), + }; +} diff --git a/sdk/devopsinfrastructure/arm-devopsinfrastructure/src/classic/subscriptionUsages/index.ts b/sdk/devopsinfrastructure/arm-devopsinfrastructure/src/classic/subscriptionUsages/index.ts new file mode 100644 index 000000000000..f12607f78a12 --- /dev/null +++ b/sdk/devopsinfrastructure/arm-devopsinfrastructure/src/classic/subscriptionUsages/index.ts @@ -0,0 +1,38 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +import { DevOpsInfrastructureContext } from "../../api/devOpsInfrastructureContext.js"; +import { SubscriptionUsagesUsagesOptionalParams } from "../../api/options.js"; +import { subscriptionUsagesUsages } from "../../api/subscriptionUsages/index.js"; +import { Quota } from "../../models/models.js"; +import { PagedAsyncIterableIterator } from "../../static-helpers/pagingHelpers.js"; + +/** Interface representing a SubscriptionUsages operations. */ +export interface SubscriptionUsagesOperations { + /** List Quota resources by subscription ID */ + usages: ( + location: string, + options?: SubscriptionUsagesUsagesOptionalParams, + ) => PagedAsyncIterableIterator; +} + +export function getSubscriptionUsages( + context: DevOpsInfrastructureContext, + subscriptionId: string, +) { + return { + usages: ( + location: string, + options?: SubscriptionUsagesUsagesOptionalParams, + ) => subscriptionUsagesUsages(context, subscriptionId, location, options), + }; +} + +export function getSubscriptionUsagesOperations( + context: DevOpsInfrastructureContext, + subscriptionId: string, +): SubscriptionUsagesOperations { + return { + ...getSubscriptionUsages(context, subscriptionId), + }; +} diff --git a/sdk/devopsinfrastructure/arm-devopsinfrastructure/src/devOpsInfrastructureClient.ts b/sdk/devopsinfrastructure/arm-devopsinfrastructure/src/devOpsInfrastructureClient.ts new file mode 100644 index 000000000000..bee8cffdb7c4 --- /dev/null +++ b/sdk/devopsinfrastructure/arm-devopsinfrastructure/src/devOpsInfrastructureClient.ts @@ -0,0 +1,80 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +import { + getOperationsOperations, + OperationsOperations, +} from "./classic/operations/index.js"; +import { getPoolsOperations, PoolsOperations } from "./classic/pools/index.js"; +import { + getResourceDetailsOperations, + ResourceDetailsOperations, +} from "./classic/resourceDetails/index.js"; +import { getSkuOperations, SkuOperations } from "./classic/sku/index.js"; +import { + getSubscriptionUsagesOperations, + SubscriptionUsagesOperations, +} from "./classic/subscriptionUsages/index.js"; +import { + getImageVersionsOperations, + ImageVersionsOperations, +} from "./classic/imageVersions/index.js"; +import { + createDevOpsInfrastructure, + DevOpsInfrastructureContext, + DevOpsInfrastructureClientOptionalParams, +} from "./api/index.js"; +import { Pipeline } from "@azure/core-rest-pipeline"; +import { TokenCredential } from "@azure/core-auth"; + +export { DevOpsInfrastructureClientOptionalParams } from "./api/devOpsInfrastructureContext.js"; + +export class DevOpsInfrastructureClient { + private _client: DevOpsInfrastructureContext; + /** The pipeline used by this client to make requests */ + public readonly pipeline: Pipeline; + + constructor( + credential: TokenCredential, + subscriptionId: string, + options: DevOpsInfrastructureClientOptionalParams = {}, + ) { + const prefixFromOptions = options?.userAgentOptions?.userAgentPrefix; + const userAgentPrefix = prefixFromOptions + ? `${prefixFromOptions} azsdk-js-client` + : `azsdk-js-client`; + this._client = createDevOpsInfrastructure(credential, { + ...options, + userAgentOptions: { userAgentPrefix }, + }); + this.pipeline = this._client.pipeline; + this.operations = getOperationsOperations(this._client); + this.pools = getPoolsOperations(this._client, subscriptionId); + this.resourceDetails = getResourceDetailsOperations( + this._client, + subscriptionId, + ); + this.sku = getSkuOperations(this._client, subscriptionId); + this.subscriptionUsages = getSubscriptionUsagesOperations( + this._client, + subscriptionId, + ); + this.imageVersions = getImageVersionsOperations( + this._client, + subscriptionId, + ); + } + + /** The operation groups for Operations */ + public readonly operations: OperationsOperations; + /** The operation groups for Pools */ + public readonly pools: PoolsOperations; + /** The operation groups for ResourceDetails */ + public readonly resourceDetails: ResourceDetailsOperations; + /** The operation groups for Sku */ + public readonly sku: SkuOperations; + /** The operation groups for SubscriptionUsages */ + public readonly subscriptionUsages: SubscriptionUsagesOperations; + /** The operation groups for ImageVersions */ + public readonly imageVersions: ImageVersionsOperations; +} diff --git a/sdk/devopsinfrastructure/arm-devopsinfrastructure/src/helpers/serializerHelpers.ts b/sdk/devopsinfrastructure/arm-devopsinfrastructure/src/helpers/serializerHelpers.ts new file mode 100644 index 000000000000..4baaac77c8be --- /dev/null +++ b/sdk/devopsinfrastructure/arm-devopsinfrastructure/src/helpers/serializerHelpers.ts @@ -0,0 +1,40 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +export function serializeRecord< + T extends string | number | boolean | Date | null, + R, +>(item: Record): Record; +export function serializeRecord( + item: Record, + serializer: (item: T) => R, +): Record; +export function serializeRecord( + item: Record, + serializer?: (item: T) => R, +): Record { + return Object.keys(item).reduce( + (acc, key) => { + if (isSupportedRecordType(item[key])) { + acc[key] = item[key] as any; + } else if (serializer) { + const value = item[key]; + if (value !== undefined) { + acc[key] = serializer(value); + } + } else { + console.warn(`Don't know how to serialize ${item[key]}`); + acc[key] = item[key] as any; + } + return acc; + }, + {} as Record, + ); +} + +function isSupportedRecordType(t: any) { + return ( + ["number", "string", "boolean", "null"].includes(typeof t) || + t instanceof Date + ); +} diff --git a/sdk/devopsinfrastructure/arm-devopsinfrastructure/src/index.ts b/sdk/devopsinfrastructure/arm-devopsinfrastructure/src/index.ts index dc6a6c0a1d3e..7c54c71e4495 100644 --- a/sdk/devopsinfrastructure/arm-devopsinfrastructure/src/index.ts +++ b/sdk/devopsinfrastructure/arm-devopsinfrastructure/src/index.ts @@ -1,13 +1,130 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. -/// -export { getContinuationToken } from "./pagingHelper"; -export * from "./models"; -export { ManagedDevOpsInfrastructure } from "./managedDevOpsInfrastructure"; -export * from "./operationsInterfaces"; +import { + PageSettings, + ContinuablePage, + PagedAsyncIterableIterator, +} from "./static-helpers/pagingHelpers.js"; + +export { DevOpsInfrastructureClient } from "./devOpsInfrastructureClient.js"; +export { restorePoller, RestorePollerOptions } from "./restorePollerHelpers.js"; +export { + ImageVersion, + ImageVersionProperties, + ProxyResource, + Resource, + SystemData, + KnownCreatedByType, + CreatedByType, + ErrorResponse, + ErrorDetail, + ErrorAdditionalInfo, + Quota, + QuotaName, + ResourceSku, + ResourceSkuProperties, + ResourceSkuLocationInfo, + ResourceSkuZoneDetails, + ResourceSkuCapabilities, + ResourceSkuRestrictions, + KnownResourceSkuRestrictionsType, + ResourceSkuRestrictionsType, + ResourceSkuRestrictionInfo, + KnownResourceSkuRestrictionsReasonCode, + ResourceSkuRestrictionsReasonCode, + ResourceDetailsObject, + ResourceDetailsObjectProperties, + KnownResourceStatus, + ResourceStatus, + Pool, + PoolProperties, + KnownProvisioningState, + ProvisioningState, + OrganizationProfile, + OrganizationProfileUnion, + GitHubOrganizationProfile, + GitHubOrganization, + AzureDevOpsOrganizationProfile, + Organization, + AzureDevOpsPermissionProfile, + KnownAzureDevOpsPermissionType, + AzureDevOpsPermissionType, + AgentProfile, + AgentProfileUnion, + ResourcePredictions, + ResourcePredictionsProfile, + ResourcePredictionsProfileUnion, + KnownResourcePredictionsProfileType, + ResourcePredictionsProfileType, + ManualResourcePredictionsProfile, + AutomaticResourcePredictionsProfile, + KnownPredictionPreference, + PredictionPreference, + StatelessAgentProfile, + Stateful, + FabricProfile, + FabricProfileUnion, + VmssFabricProfile, + DevOpsAzureSku, + PoolImage, + OsProfile, + SecretsManagementSettings, + KnownLogonType, + LogonType, + StorageProfile, + KnownOsDiskStorageAccountType, + OsDiskStorageAccountType, + DataDisk, + KnownCachingType, + CachingType, + KnownStorageAccountType, + StorageAccountType, + NetworkProfile, + ManagedServiceIdentity, + KnownManagedServiceIdentityType, + ManagedServiceIdentityType, + UserAssignedIdentity, + TrackedResource, + PoolUpdate, + PoolUpdateProperties, + CheckNameAvailability, + KnownDevOpsInfrastructureResourceType, + DevOpsInfrastructureResourceType, + CheckNameAvailabilityResult, + KnownAvailabilityStatus, + AvailabilityStatus, + KnownCheckNameAvailabilityReason, + CheckNameAvailabilityReason, + Operation, + OperationDisplay, + KnownOrigin, + Origin, + KnownActionType, + ActionType, + KnownVersions, +} from "./models/index.js"; +export { + DevOpsInfrastructureClientOptionalParams, + OperationsListOptionalParams, + PoolsGetOptionalParams, + PoolsCreateOrUpdateOptionalParams, + PoolsUpdateOptionalParams, + PoolsDeleteOptionalParams, + PoolsListByResourceGroupOptionalParams, + PoolsListBySubscriptionOptionalParams, + PoolsCheckNameAvailabilityOptionalParams, + ResourceDetailsListByPoolOptionalParams, + SkuListByLocationOptionalParams, + SubscriptionUsagesUsagesOptionalParams, + ImageVersionsListByImageOptionalParams, +} from "./api/index.js"; +export { + ImageVersionsOperations, + OperationsOperations, + PoolsOperations, + ResourceDetailsOperations, + SkuOperations, + SubscriptionUsagesOperations, +} from "./classic/index.js"; +export { PageSettings, ContinuablePage, PagedAsyncIterableIterator }; diff --git a/sdk/devopsinfrastructure/arm-devopsinfrastructure/src/logger.ts b/sdk/devopsinfrastructure/arm-devopsinfrastructure/src/logger.ts new file mode 100644 index 000000000000..f150e5b3b4c2 --- /dev/null +++ b/sdk/devopsinfrastructure/arm-devopsinfrastructure/src/logger.ts @@ -0,0 +1,5 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +import { createClientLogger } from "@azure/logger"; +export const logger = createClientLogger("arm-devopsinfrastructure"); diff --git a/sdk/devopsinfrastructure/arm-devopsinfrastructure/src/lroImpl.ts b/sdk/devopsinfrastructure/arm-devopsinfrastructure/src/lroImpl.ts deleted file mode 100644 index 5f88efab981b..000000000000 --- a/sdk/devopsinfrastructure/arm-devopsinfrastructure/src/lroImpl.ts +++ /dev/null @@ -1,42 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. - -import { AbortSignalLike } from "@azure/abort-controller"; -import { LongRunningOperation, LroResponse } from "@azure/core-lro"; - -export function createLroSpec(inputs: { - sendOperationFn: (args: any, spec: any) => Promise>; - args: Record; - spec: { - readonly requestBody?: unknown; - readonly path?: string; - readonly httpMethod: string; - } & Record; -}): LongRunningOperation { - const { args, spec, sendOperationFn } = inputs; - return { - requestMethod: spec.httpMethod, - requestPath: spec.path!, - sendInitialRequest: () => sendOperationFn(args, spec), - sendPollRequest: ( - path: string, - options?: { abortSignal?: AbortSignalLike }, - ) => { - const { requestBody, ...restSpec } = spec; - return sendOperationFn(args, { - ...restSpec, - httpMethod: "GET", - path, - abortSignal: options?.abortSignal, - }); - }, - }; -} diff --git a/sdk/devopsinfrastructure/arm-devopsinfrastructure/src/managedDevOpsInfrastructure.ts b/sdk/devopsinfrastructure/arm-devopsinfrastructure/src/managedDevOpsInfrastructure.ts deleted file mode 100644 index 06339dba7a72..000000000000 --- a/sdk/devopsinfrastructure/arm-devopsinfrastructure/src/managedDevOpsInfrastructure.ts +++ /dev/null @@ -1,165 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -import * as coreClient from "@azure/core-client"; -import * as coreRestPipeline from "@azure/core-rest-pipeline"; -import { - PipelineRequest, - PipelineResponse, - SendRequest, -} from "@azure/core-rest-pipeline"; -import * as coreAuth from "@azure/core-auth"; -import { - OperationsImpl, - SkuImpl, - SubscriptionUsagesImpl, - PoolsImpl, - ImageVersionsImpl, - ResourceDetailsImpl, -} from "./operations"; -import { - Operations, - Sku, - SubscriptionUsages, - Pools, - ImageVersions, - ResourceDetails, -} from "./operationsInterfaces"; -import { ManagedDevOpsInfrastructureOptionalParams } from "./models"; - -export class ManagedDevOpsInfrastructure extends coreClient.ServiceClient { - $host: string; - apiVersion: string; - subscriptionId: string; - - /** - * Initializes a new instance of the ManagedDevOpsInfrastructure class. - * @param credentials Subscription credentials which uniquely identify client subscription. - * @param subscriptionId The ID of the target subscription. The value must be an UUID. - * @param options The parameter options - */ - constructor( - credentials: coreAuth.TokenCredential, - subscriptionId: string, - options?: ManagedDevOpsInfrastructureOptionalParams, - ) { - 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: ManagedDevOpsInfrastructureOptionalParams = { - requestContentType: "application/json; charset=utf-8", - credential: credentials, - }; - - const packageDetails = `azsdk-js-arm-devopsinfrastructure/1.0.0-beta.2`; - const userAgentPrefix = - options.userAgentOptions && options.userAgentOptions.userAgentPrefix - ? `${options.userAgentOptions.userAgentPrefix} ${packageDetails}` - : `${packageDetails}`; - - const optionsWithDefaults = { - ...defaults, - ...options, - userAgentOptions: { - userAgentPrefix, - }, - endpoint: - options.endpoint ?? options.baseUri ?? "https://management.azure.com", - }; - super(optionsWithDefaults); - - let bearerTokenAuthenticationPolicyFound: boolean = false; - if (options?.pipeline && options.pipeline.getOrderedPolicies().length > 0) { - const pipelinePolicies: coreRestPipeline.PipelinePolicy[] = - options.pipeline.getOrderedPolicies(); - bearerTokenAuthenticationPolicyFound = pipelinePolicies.some( - (pipelinePolicy) => - pipelinePolicy.name === - coreRestPipeline.bearerTokenAuthenticationPolicyName, - ); - } - if ( - !options || - !options.pipeline || - options.pipeline.getOrderedPolicies().length == 0 || - !bearerTokenAuthenticationPolicyFound - ) { - this.pipeline.removePolicy({ - name: coreRestPipeline.bearerTokenAuthenticationPolicyName, - }); - this.pipeline.addPolicy( - coreRestPipeline.bearerTokenAuthenticationPolicy({ - credential: credentials, - scopes: - optionsWithDefaults.credentialScopes ?? - `${optionsWithDefaults.endpoint}/.default`, - challengeCallbacks: { - authorizeRequestOnChallenge: - coreClient.authorizeRequestOnClaimChallenge, - }, - }), - ); - } - // Parameter assignments - this.subscriptionId = subscriptionId; - - // Assigning values to Constant parameters - this.$host = options.$host || "https://management.azure.com"; - this.apiVersion = options.apiVersion || "2024-04-04-preview"; - this.operations = new OperationsImpl(this); - this.sku = new SkuImpl(this); - this.subscriptionUsages = new SubscriptionUsagesImpl(this); - this.pools = new PoolsImpl(this); - this.imageVersions = new ImageVersionsImpl(this); - this.resourceDetails = new ResourceDetailsImpl(this); - this.addCustomApiVersionPolicy(options.apiVersion); - } - - /** A function that adds a policy that sets the api-version (or equivalent) to reflect the library version. */ - private addCustomApiVersionPolicy(apiVersion?: string) { - if (!apiVersion) { - return; - } - const apiVersionPolicy = { - name: "CustomApiVersionPolicy", - async sendRequest( - request: PipelineRequest, - next: SendRequest, - ): Promise { - const param = request.url.split("?"); - if (param.length > 1) { - const newParams = param[1].split("&").map((item) => { - if (item.indexOf("api-version") > -1) { - return "api-version=" + apiVersion; - } else { - return item; - } - }); - request.url = param[0] + "?" + newParams.join("&"); - } - return next(request); - }, - }; - this.pipeline.addPolicy(apiVersionPolicy); - } - - operations: Operations; - sku: Sku; - subscriptionUsages: SubscriptionUsages; - pools: Pools; - imageVersions: ImageVersions; - resourceDetails: ResourceDetails; -} diff --git a/sdk/devopsinfrastructure/arm-devopsinfrastructure/src/models/index.ts b/sdk/devopsinfrastructure/arm-devopsinfrastructure/src/models/index.ts index 2cb194f9d4d2..6d0d2eaa914c 100644 --- a/sdk/devopsinfrastructure/arm-devopsinfrastructure/src/models/index.ts +++ b/sdk/devopsinfrastructure/arm-devopsinfrastructure/src/models/index.ts @@ -1,1197 +1,98 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -import * as coreClient from "@azure/core-client"; - -export type OrganizationProfileUnion = - | OrganizationProfile - | AzureDevOpsOrganizationProfile - | GitHubOrganizationProfile; -export type AgentProfileUnion = AgentProfile | Stateful | StatelessAgentProfile; -export type ResourcePredictionsProfileUnion = - | ResourcePredictionsProfile - | AutomaticResourcePredictionsProfile - | ManualResourcePredictionsProfile; -export type FabricProfileUnion = FabricProfile | VmssFabricProfile; -export type AgentProfileUpdateUnion = - | AgentProfileUpdate - | StatefulUpdate - | StatelessAgentProfileUpdate; -export type ResourcePredictionsProfileUpdateUnion = - | ResourcePredictionsProfileUpdate - | AutomaticResourcePredictionsProfileUpdate - | ManualResourcePredictionsProfileUpdate; - -/** 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; -} - -/** Common error response for all Azure Resource Manager APIs to return error details for failed operations. (This also follows the OData error response format.). */ -export interface ErrorResponse { - /** The error object. */ - error?: ErrorDetail; -} - -/** The error detail. */ -export interface ErrorDetail { - /** - * The error code. - * NOTE: This property will not be serialized. It can only be populated by the server. - */ - readonly code?: string; - /** - * The error message. - * NOTE: This property will not be serialized. It can only be populated by the server. - */ - readonly message?: string; - /** - * The error target. - * NOTE: This property will not be serialized. It can only be populated by the server. - */ - readonly target?: string; - /** - * The error details. - * NOTE: This property will not be serialized. It can only be populated by the server. - */ - readonly details?: ErrorDetail[]; - /** - * The error additional info. - * NOTE: This property will not be serialized. It can only be populated by the server. - */ - readonly additionalInfo?: ErrorAdditionalInfo[]; -} - -/** The resource management error additional info. */ -export interface ErrorAdditionalInfo { - /** - * The additional info type. - * NOTE: This property will not be serialized. It can only be populated by the server. - */ - readonly type?: string; - /** - * The additional info. - * NOTE: This property will not be serialized. It can only be populated by the server. - */ - readonly info?: Record; -} - -/** The response of a ResourceSku list operation. */ -export interface ResourceSkuListResult { - /** The ResourceSku items on this page */ - value: ResourceSku[]; - /** The link to the next page of items */ - nextLink?: string; -} - -/** Properties of a ResourceSku */ -export interface ResourceSkuProperties { - /** The type of resource the SKU applies to. */ - resourceType: string; - /** The tier of virtual machines in a scale set */ - tier: string; - /** The size of the SKU. */ - size: string; - /** The family of the SKU. */ - family: string; - /** The set of locations that the SKU is available. */ - locations: string[]; - /** A list of locations and availability zones in those locations where the SKU is available */ - locationInfo: ResourceSkuLocationInfo[]; - /** Name value pairs to describe the capability. */ - capabilities: ResourceSkuCapabilities[]; - /** The restrictions of the SKU. */ - restrictions: ResourceSkuRestrictions[]; -} - -/** Describes an available Compute SKU Location Information. */ -export interface ResourceSkuLocationInfo { - /** Location of the SKU */ - location: string; - /** List of availability zones where the SKU is supported. */ - zones: string[]; - /** Gets details of capabilities available to a SKU in specific zones. */ - zoneDetails: ResourceSkuZoneDetails[]; -} - -/** Describes The zonal capabilities of a SKU. */ -export interface ResourceSkuZoneDetails { - /** Gets the set of zones that the SKU is available in with the specified capabilities. */ - name: string[]; - /** A list of capabilities that are available for the SKU in the specified list of zones. */ - capabilities: ResourceSkuCapabilities[]; -} - -/** Describes The SKU capabilities object. */ -export interface ResourceSkuCapabilities { - /** The name of the SKU capability. */ - name: string; - /** The value of the SKU capability. */ - value: string; -} - -/** The restrictions of the SKU. */ -export interface ResourceSkuRestrictions { - /** the type of restrictions. */ - type?: ResourceSkuRestrictionsType; - /** The value of restrictions. If the restriction type is set to location. This would be different locations where the SKU is restricted. */ - values: string[]; - /** The information about the restriction where the SKU cannot be used. */ - restrictionInfo: ResourceSkuRestrictionInfo; - /** the reason for restriction. */ - reasonCode?: ResourceSkuRestrictionsReasonCode; -} - -/** Describes an available Compute SKU Restriction Information. */ -export interface ResourceSkuRestrictionInfo { - /** Locations where the SKU is restricted */ - locations?: string[]; - /** List of availability zones where the SKU is restricted. */ - zones?: 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. E.g. "/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; -} - -/** The response of a Quota list operation. */ -export interface QuotaListResult { - /** The Quota items on this page */ - value: Quota[]; - /** The link to the next page of items */ - nextLink?: string; -} - -/** Describes Resource Quota properties */ -export interface QuotaProperties { - /** The unit of usage measurement. */ - unit: string; - /** The current usage of the resource. */ - currentValue: number; - /** The maximum permitted usage of the resource. */ - limit: number; - /** The details of the quota. */ - name: QuotaName; -} - -/** The Quota Names */ -export interface QuotaName { - /** The name of the resource. */ - value?: string; - /** The localized name of the resource. */ - localizedValue?: string; -} - -/** The response of a Pool list operation. */ -export interface PoolListResult { - /** The Pool items on this page */ - value: Pool[]; - /** The link to the next page of items */ - nextLink?: string; -} - -/** Pool properties */ -export interface PoolProperties { - /** The status of the current operation. */ - provisioningState?: ProvisioningState; - /** Defines how many resources can there be created at any given time. */ - maximumConcurrency: number; - /** Defines the organization in which the pool will be used. */ - organizationProfile: OrganizationProfileUnion; - /** Defines how the machine will be handled once it executed a job. */ - agentProfile: AgentProfileUnion; - /** Defines the type of fabric the agent will run on. */ - fabricProfile: FabricProfileUnion; - /** The resource id of the DevCenter Project the pool belongs to. */ - devCenterProjectResourceId: string; -} - -/** Defines the organization in which the pool will be used. */ -export interface OrganizationProfile { - /** Polymorphic discriminator, which specifies the different types this object can be */ - kind: "AzureDevOps" | "GitHub"; -} - -/** The agent profile of the machines in the pool. */ -export interface AgentProfile { - /** Polymorphic discriminator, which specifies the different types this object can be */ - kind: "Stateful" | "Stateless"; - /** Defines pool buffer/stand-by agents. */ - resourcePredictions?: Record; - /** Defines how the pool buffer/stand-by agents is provided. */ - resourcePredictionsProfile?: ResourcePredictionsProfileUnion; -} - -/** Determines how the stand-by scheme should be provided. */ -export interface ResourcePredictionsProfile { - /** Polymorphic discriminator, which specifies the different types this object can be */ - kind: "Automatic" | "Manual"; -} - -/** Defines the type of fabric the agent will run on. */ -export interface FabricProfile { - /** Polymorphic discriminator, which specifies the different types this object can be */ - kind: "Vmss"; -} - -/** 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 | null; - }; -} - -/** 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; -} - -/** The response of a ImageVersion list operation. */ -export interface ImageVersionListResult { - /** The ImageVersion items on this page */ - value: ImageVersion[]; - /** The link to the next page of items */ - nextLink?: string; -} - -/** Details of the ImageVersionProperties. */ -export interface ImageVersionProperties { - /** Version of the image. */ - version: string; -} - -/** The type used for update operations of the Pool. */ -export interface PoolUpdate { - /** The managed service identities assigned to this resource. */ - identity?: ManagedServiceIdentity; - /** Resource tags. */ - tags?: { [propertyName: string]: string }; - /** The updatable properties of the Pool. */ - properties?: PoolUpdateProperties; -} - -/** The updatable properties of the Pool. */ -export interface PoolUpdateProperties { - /** The status of the current operation. */ - provisioningState?: ProvisioningState; - /** Defines how many resources can there be created at any given time. */ - maximumConcurrency?: number; - /** Defines the organization in which the pool will be used. */ - organizationProfile?: OrganizationProfileUnion; - /** Defines how the machine will be handled once it executed a job. */ - agentProfile?: AgentProfileUpdateUnion; - /** Defines the type of fabric the agent will run on. */ - fabricProfile?: FabricProfileUnion; - /** The resource id of the DevCenter Project the pool belongs to. */ - devCenterProjectResourceId?: string; -} - -/** The agent profile of the machines in the pool. */ -export interface AgentProfileUpdate { - /** Polymorphic discriminator, which specifies the different types this object can be */ - kind: "Stateful" | "Stateless"; - /** Defines pool buffer/stand-by agents. */ - resourcePredictions?: Record; - /** Defines how the pool buffer/stand-by agents is provided. */ - resourcePredictionsProfile?: ResourcePredictionsProfileUpdateUnion; -} - -/** Determines how the stand-by scheme should be provided. */ -export interface ResourcePredictionsProfileUpdate { - /** Polymorphic discriminator, which specifies the different types this object can be */ - kind: "Automatic" | "Manual"; -} - -/** The response of a ResourceDetailsObject list operation. */ -export interface ResourceDetailsObjectListResult { - /** The ResourceDetailsObject items on this page */ - value: ResourceDetailsObject[]; - /** The link to the next page of items */ - nextLink?: string; -} - -/** Details of the ResourceDetailsObject. */ -export interface ResourceDetailsObjectProperties { - /** The status of the resource. */ - status: ResourceStatus; - /** The image name of the resource. */ - image: string; - /** The version of the image running on the resource. */ - imageVersion: string; -} - -/** Defines an Azure DevOps organization. */ -export interface Organization { - /** The Azure DevOps organization URL in which the pool should be created. */ - url: string; - /** Optional list of projects in which the pool should be created. */ - projects?: string[]; - /** How many machines can be created at maximum in this organization out of the maximumConcurrency of the pool. */ - parallelism?: number; -} - -/** Defines the type of Azure DevOps pool permission. */ -export interface AzureDevOpsPermissionProfile { - /** Determines who has admin permissions to the Azure DevOps pool. */ - kind: AzureDevOpsPermissionType; - /** User email addresses */ - users?: string[]; - /** Group email addresses */ - groups?: string[]; -} - -/** The data disk of the VMSS. */ -export interface DataDisk { - /** The type of caching to be enabled for the data disks. The default value for caching is readwrite. For information about the caching options see: https://blogs.msdn.microsoft.com/windowsazurestorage/2012/06/27/exploring-windows-azure-drives-disks-and-images/. */ - caching?: CachingType; - /** The initial disk size in gigabytes. */ - diskSizeGiB?: number; - /** The storage Account type to be used for the data disk. If omitted, the default is "standard_lrs". */ - storageAccountType?: StorageAccountType; - /** The drive letter for the empty data disk. If not specified, it will be the first available letter. */ - driveLetter?: string; -} - -/** The Azure SKU of the machines in the pool. */ -export interface DevOpsAzureSku { - /** The Azure SKU name of the machines in the pool. */ - name: string; -} - -/** Defines a GitHub organization */ -export interface GitHubOrganization { - /** The GitHub organization URL in which the pool should be created. */ - url: string; - /** Optional list of repositories in which the pool should be created. */ - repositories?: string[]; -} - -/** The network profile of the machines in the pool. */ -export interface NetworkProfile { - /** The subnet id on which to put all machines created in the pool. */ - subnetId: string; -} - -/** The OS profile of the machines in the pool. */ -export interface OsProfile { - /** The secret management settings of the machines in the pool. */ - secretsManagementSettings?: SecretsManagementSettings; - /** Determines how the service should be run. By default, this will be set to Service. */ - logonType?: LogonType; -} - -/** The secret management settings of the machines in the pool. */ -export interface SecretsManagementSettings { - /** Where to store certificates on the machine. */ - certificateStoreLocation?: string; - /** The list of certificates to install on all machines in the pool. */ - observedCertificates: string[]; - /** Defines if the key of the certificates should be exportable. */ - keyExportable: boolean; -} - -/** The VM image of the machines in the pool. */ -export interface PoolImage { - /** The resource id of the image. */ - resourceId?: string; - /** The image to use from a well-known set of images made available to customers. */ - wellKnownImageName?: string; - /** List of aliases to reference the image by. */ - aliases?: string[]; - /** The percentage of the buffer to be allocated to this image. */ - buffer?: string; -} - -/** The storage profile of the VMSS. */ -export interface StorageProfile { - /** The Azure SKU name of the machines in the pool. */ - osDiskStorageAccountType?: OsDiskStorageAccountType; - /** A list of empty data disks to attach. */ - dataDisks?: DataDisk[]; -} - -/** The resource model definition for a Azure Resource Manager proxy resource. It will not have tags and a location */ -export interface ProxyResource extends Resource {} - -/** The resource model definition for an Azure Resource Manager tracked top level resource which has 'tags' and a 'location' */ -export interface TrackedResource extends Resource { - /** Resource tags. */ - tags?: { [propertyName: string]: string }; - /** The geo-location where the resource lives */ - location: string; -} - -/** Azure DevOps organization profile */ -export interface AzureDevOpsOrganizationProfile extends OrganizationProfile { - /** Polymorphic discriminator, which specifies the different types this object can be */ - kind: "AzureDevOps"; - /** The list of Azure DevOps organizations the pool should be present in. */ - organizations: Organization[]; - /** The type of permission which determines which accounts are admins on the Azure DevOps pool. */ - permissionProfile?: AzureDevOpsPermissionProfile; -} - -/** GitHub organization profile */ -export interface GitHubOrganizationProfile extends OrganizationProfile { - /** Polymorphic discriminator, which specifies the different types this object can be */ - kind: "GitHub"; - /** The list of GitHub organizations/repositories the pool should be present in. */ - organizations: GitHubOrganization[]; -} - -/** Stateful profile meaning that the machines will be returned to the pool after running a job. */ -export interface Stateful extends AgentProfile { - /** Polymorphic discriminator, which specifies the different types this object can be */ - kind: "Stateful"; - /** How long should stateful machines be kept around. The maximum is one week. */ - maxAgentLifetime?: string; - /** How long should the machine be kept around after it ran a workload when there are no stand-by agents. The maximum is one week. */ - gracePeriodTimeSpan?: string; -} - -/** Stateless profile meaning that the machines will be cleaned up after running a job. */ -export interface StatelessAgentProfile extends AgentProfile { - /** Polymorphic discriminator, which specifies the different types this object can be */ - kind: "Stateless"; -} - -/** The stand-by agent scheme is determined based on historical demand. */ -export interface AutomaticResourcePredictionsProfile - extends ResourcePredictionsProfile { - /** Polymorphic discriminator, which specifies the different types this object can be */ - kind: "Automatic"; - /** Determines the balance between cost and performance. */ - predictionPreference?: PredictionPreference; -} - -/** Customer provides the stand-by agent scheme. */ -export interface ManualResourcePredictionsProfile - extends ResourcePredictionsProfile { - /** Polymorphic discriminator, which specifies the different types this object can be */ - kind: "Manual"; -} - -/** The agents will run on Virtual Machine Scale Sets. */ -export interface VmssFabricProfile extends FabricProfile { - /** Polymorphic discriminator, which specifies the different types this object can be */ - kind: "Vmss"; - /** The Azure SKU of the machines in the pool. */ - sku: DevOpsAzureSku; - /** The VM images of the machines in the pool. */ - images: PoolImage[]; - /** The OS profile of the machines in the pool. */ - osProfile?: OsProfile; - /** The storage profile of the machines in the pool. */ - storageProfile?: StorageProfile; - /** The network profile of the machines in the pool. */ - networkProfile?: NetworkProfile; -} - -/** Stateful profile meaning that the machines will be returned to the pool after running a job. */ -export interface StatefulUpdate extends AgentProfileUpdate { - /** Polymorphic discriminator, which specifies the different types this object can be */ - kind: "Stateful"; - /** How long should stateful machines be kept around. The maximum is one week. */ - maxAgentLifetime?: string; - /** How long should the machine be kept around after it ran a workload when there are no stand-by agents. The maximum is one week. */ - gracePeriodTimeSpan?: string; -} - -/** Stateless profile meaning that the machines will be cleaned up after running a job. */ -export interface StatelessAgentProfileUpdate extends AgentProfileUpdate { - /** Polymorphic discriminator, which specifies the different types this object can be */ - kind: "Stateless"; -} - -/** The stand-by agent scheme is determined based on historical demand. */ -export interface AutomaticResourcePredictionsProfileUpdate - extends ResourcePredictionsProfileUpdate { - /** Polymorphic discriminator, which specifies the different types this object can be */ - kind: "Automatic"; - /** Determines the balance between cost and performance. */ - predictionPreference?: PredictionPreference; -} - -/** Customer provides the stand-by agent scheme. */ -export interface ManualResourcePredictionsProfileUpdate - extends ResourcePredictionsProfileUpdate { - /** Polymorphic discriminator, which specifies the different types this object can be */ - kind: "Manual"; -} - -/** A ResourceSku */ -export interface ResourceSku extends ProxyResource { - /** The resource-specific properties for this resource. */ - properties?: ResourceSkuProperties; -} - -/** Describes Resource Quota */ -export interface Quota extends ProxyResource { - /** The resource-specific properties for this resource. */ - properties?: QuotaProperties; -} - -/** An image version object */ -export interface ImageVersion extends ProxyResource { - /** The resource-specific properties for this resource. */ - properties?: ImageVersionProperties; -} - -/** A ResourceDetailsObject */ -export interface ResourceDetailsObject extends ProxyResource { - /** The resource-specific properties for this resource. */ - properties?: ResourceDetailsObjectProperties; -} - -/** Concrete tracked resource types can be created by aliasing this type using a specific property type. */ -export interface Pool extends TrackedResource { - /** The resource-specific properties for this resource. */ - properties?: PoolProperties; - /** The managed service identities assigned to this resource. */ - identity?: ManagedServiceIdentity; -} - -/** Defines headers for Pools_createOrUpdate operation. */ -export interface PoolsCreateOrUpdateHeaders { - /** The Retry-After header can indicate how long the client should wait before polling the operation status. */ - retryAfter?: number; -} - -/** Defines headers for Pools_update operation. */ -export interface PoolsUpdateHeaders { - /** The Location header contains the URL where the status of the long running operation can be checked. */ - location?: string; - /** The Retry-After header can indicate how long the client should wait before polling the operation status. */ - retryAfter?: number; -} - -/** Defines headers for Pools_delete operation. */ -export interface PoolsDeleteHeaders { - /** The Location header contains the URL where the status of the long running operation can be checked. */ - location?: string; - /** The Retry-After header can indicate how long the client should wait before polling the operation status. */ - retryAfter?: number; -} - -/** Known values of {@link Origin} that the service accepts. */ -export enum KnownOrigin { - /** User */ - User = "user", - /** System */ - System = "system", - /** UserSystem */ - 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 = "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 ResourceSkuRestrictionsType} that the service accepts. */ -export enum KnownResourceSkuRestrictionsType { - /** Location */ - Location = "Location", - /** Zone */ - Zone = "Zone", -} - -/** - * Defines values for ResourceSkuRestrictionsType. \ - * {@link KnownResourceSkuRestrictionsType} can be used interchangeably with ResourceSkuRestrictionsType, - * this enum contains the known values that the service supports. - * ### Known values supported by the service - * **Location** \ - * **Zone** - */ -export type ResourceSkuRestrictionsType = string; - -/** Known values of {@link ResourceSkuRestrictionsReasonCode} that the service accepts. */ -export enum KnownResourceSkuRestrictionsReasonCode { - /** QuotaId */ - QuotaId = "QuotaId", - /** NotAvailableForSubscription */ - NotAvailableForSubscription = "NotAvailableForSubscription", -} - -/** - * Defines values for ResourceSkuRestrictionsReasonCode. \ - * {@link KnownResourceSkuRestrictionsReasonCode} can be used interchangeably with ResourceSkuRestrictionsReasonCode, - * this enum contains the known values that the service supports. - * ### Known values supported by the service - * **QuotaId** \ - * **NotAvailableForSubscription** - */ -export type ResourceSkuRestrictionsReasonCode = string; - -/** Known values of {@link CreatedByType} that the service accepts. */ -export enum KnownCreatedByType { - /** User */ - User = "User", - /** Application */ - Application = "Application", - /** ManagedIdentity */ - ManagedIdentity = "ManagedIdentity", - /** Key */ - Key = "Key", -} - -/** - * Defines values for CreatedByType. \ - * {@link KnownCreatedByType} can be used interchangeably with CreatedByType, - * this enum contains the known values that the service supports. - * ### Known values supported by the service - * **User** \ - * **Application** \ - * **ManagedIdentity** \ - * **Key** - */ -export type CreatedByType = string; - -/** Known values of {@link ProvisioningState} that the service accepts. */ -export enum KnownProvisioningState { - /** Represents a succeeded operation. */ - Succeeded = "Succeeded", - /** Represents a failed operation. */ - Failed = "Failed", - /** Represents a canceled operation. */ - Canceled = "Canceled", - /** Represents a pending operation. */ - Provisioning = "Provisioning", - /** Represents a pending operation. */ - Updating = "Updating", - /** Represents an operation under deletion. */ - Deleting = "Deleting", - /** Represents an accepted operation. */ - Accepted = "Accepted", -} - -/** - * Defines values for ProvisioningState. \ - * {@link KnownProvisioningState} can be used interchangeably with ProvisioningState, - * this enum contains the known values that the service supports. - * ### Known values supported by the service - * **Succeeded**: Represents a succeeded operation. \ - * **Failed**: Represents a failed operation. \ - * **Canceled**: Represents a canceled operation. \ - * **Provisioning**: Represents a pending operation. \ - * **Updating**: Represents a pending operation. \ - * **Deleting**: Represents an operation under deletion. \ - * **Accepted**: Represents an accepted operation. - */ -export type ProvisioningState = string; - -/** Known values of {@link ResourcePredictionsProfileType} that the service accepts. */ -export enum KnownResourcePredictionsProfileType { - /** Customer provides the stand-by agent scheme. */ - Manual = "Manual", - /** The stand-by agent scheme is determined based on historical demand. */ - Automatic = "Automatic", -} - -/** - * Defines values for ResourcePredictionsProfileType. \ - * {@link KnownResourcePredictionsProfileType} can be used interchangeably with ResourcePredictionsProfileType, - * this enum contains the known values that the service supports. - * ### Known values supported by the service - * **Manual**: Customer provides the stand-by agent scheme. \ - * **Automatic**: The stand-by agent scheme is determined based on historical demand. - */ -export type ResourcePredictionsProfileType = string; - -/** Known values of {@link ManagedServiceIdentityType} that the service accepts. */ -export enum KnownManagedServiceIdentityType { - /** None */ - None = "None", - /** SystemAssigned */ - SystemAssigned = "SystemAssigned", - /** UserAssigned */ - UserAssigned = "UserAssigned", - /** SystemAssignedUserAssigned */ - 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 ResourceStatus} that the service accepts. */ -export enum KnownResourceStatus { - /** Represents a machine resource that is ready. */ - Ready = "Ready", - /** Represents a machine resource that is not ready. */ - NotReady = "NotReady", - /** Represents a machine resource that is allocated. */ - Allocated = "Allocated", - /** Represents a machine resource that is pending return. */ - PendingReturn = "PendingReturn", - /** Represents a machine resource that is returned. */ - Returned = "Returned", - /** Represents a machine resource that is leased. */ - Leased = "Leased", - /** Represents a machine resource that is provisioning. */ - Provisioning = "Provisioning", - /** Represents a machine resource that is updating. */ - Updating = "Updating", - /** Represents a machine resource that is starting. */ - Starting = "Starting", - /** Represents a machine resource that is pending reimage. */ - PendingReimage = "PendingReimage", - /** Represents a machine resource that is reimaging. */ - Reimaging = "Reimaging", -} - -/** - * Defines values for ResourceStatus. \ - * {@link KnownResourceStatus} can be used interchangeably with ResourceStatus, - * this enum contains the known values that the service supports. - * ### Known values supported by the service - * **Ready**: Represents a machine resource that is ready. \ - * **NotReady**: Represents a machine resource that is not ready. \ - * **Allocated**: Represents a machine resource that is allocated. \ - * **PendingReturn**: Represents a machine resource that is pending return. \ - * **Returned**: Represents a machine resource that is returned. \ - * **Leased**: Represents a machine resource that is leased. \ - * **Provisioning**: Represents a machine resource that is provisioning. \ - * **Updating**: Represents a machine resource that is updating. \ - * **Starting**: Represents a machine resource that is starting. \ - * **PendingReimage**: Represents a machine resource that is pending reimage. \ - * **Reimaging**: Represents a machine resource that is reimaging. - */ -export type ResourceStatus = string; - -/** Known values of {@link PredictionPreference} that the service accepts. */ -export enum KnownPredictionPreference { - /** Balance between cost and performance. */ - Balanced = "Balanced", - /** Optimizes for cost over performance. */ - MostCostEffective = "MostCostEffective", - /** Halfway through cost and balanced. */ - MoreCostEffective = "MoreCostEffective", - /** Halfway through balanced and performance. */ - MorePerformance = "MorePerformance", - /** Optimizes for performance over cost. */ - BestPerformance = "BestPerformance", -} - -/** - * Defines values for PredictionPreference. \ - * {@link KnownPredictionPreference} can be used interchangeably with PredictionPreference, - * this enum contains the known values that the service supports. - * ### Known values supported by the service - * **Balanced**: Balance between cost and performance. \ - * **MostCostEffective**: Optimizes for cost over performance. \ - * **MoreCostEffective**: Halfway through cost and balanced. \ - * **MorePerformance**: Halfway through balanced and performance. \ - * **BestPerformance**: Optimizes for performance over cost. - */ -export type PredictionPreference = string; - -/** Known values of {@link AzureDevOpsPermissionType} that the service accepts. */ -export enum KnownAzureDevOpsPermissionType { - /** Pool will inherit permissions from the project or organization. */ - Inherit = "Inherit", - /** Only the pool creator will be an admin of the pool. */ - CreatorOnly = "CreatorOnly", - /** Only the specified accounts will be admins of the pool. */ - SpecificAccounts = "SpecificAccounts", -} - -/** - * Defines values for AzureDevOpsPermissionType. \ - * {@link KnownAzureDevOpsPermissionType} can be used interchangeably with AzureDevOpsPermissionType, - * this enum contains the known values that the service supports. - * ### Known values supported by the service - * **Inherit**: Pool will inherit permissions from the project or organization. \ - * **CreatorOnly**: Only the pool creator will be an admin of the pool. \ - * **SpecificAccounts**: Only the specified accounts will be admins of the pool. - */ -export type AzureDevOpsPermissionType = string; - -/** Known values of {@link CachingType} that the service accepts. */ -export enum KnownCachingType { - /** Don't use host caching. */ - None = "None", - /** For workloads that only do read operations. */ - ReadOnly = "ReadOnly", - /** For workloads that do a balance of read and write operations. */ - ReadWrite = "ReadWrite", -} - -/** - * Defines values for CachingType. \ - * {@link KnownCachingType} can be used interchangeably with CachingType, - * this enum contains the known values that the service supports. - * ### Known values supported by the service - * **None**: Don't use host caching. \ - * **ReadOnly**: For workloads that only do read operations. \ - * **ReadWrite**: For workloads that do a balance of read and write operations. - */ -export type CachingType = string; - -/** Known values of {@link StorageAccountType} that the service accepts. */ -export enum KnownStorageAccountType { - /** The data disk should use standard locally redundant storage. */ - StandardLRS = "Standard_LRS", - /** The data disk should use premium locally redundant storage. */ - PremiumLRS = "Premium_LRS", - /** The data disk should use standard SSD locally redundant storage. */ - StandardSsdlrs = "StandardSSD_LRS", - /** The data disk should use premium SSD zonal redundant storage. */ - PremiumZRS = "Premium_ZRS", - /** The data disk should use standard SSD zonal redundant storage. */ - StandardSsdzrs = "StandardSSD_ZRS", -} - -/** - * Defines values for StorageAccountType. \ - * {@link KnownStorageAccountType} can be used interchangeably with StorageAccountType, - * this enum contains the known values that the service supports. - * ### Known values supported by the service - * **Standard_LRS**: The data disk should use standard locally redundant storage. \ - * **Premium_LRS**: The data disk should use premium locally redundant storage. \ - * **StandardSSD_LRS**: The data disk should use standard SSD locally redundant storage. \ - * **Premium_ZRS**: The data disk should use premium SSD zonal redundant storage. \ - * **StandardSSD_ZRS**: The data disk should use standard SSD zonal redundant storage. - */ -export type StorageAccountType = string; - -/** Known values of {@link LogonType} that the service accepts. */ -export enum KnownLogonType { - /** Run as a service. */ - Service = "Service", - /** Run in interactive mode. */ - Interactive = "Interactive", -} - -/** - * Defines values for LogonType. \ - * {@link KnownLogonType} can be used interchangeably with LogonType, - * this enum contains the known values that the service supports. - * ### Known values supported by the service - * **Service**: Run as a service. \ - * **Interactive**: Run in interactive mode. - */ -export type LogonType = string; - -/** Known values of {@link OsDiskStorageAccountType} that the service accepts. */ -export enum KnownOsDiskStorageAccountType { - /** Standard OS disk type. */ - Standard = "Standard", - /** Premium OS disk type. */ - Premium = "Premium", - /** Standard SSD OS disk type. */ - StandardSSD = "StandardSSD", -} - -/** - * Defines values for OsDiskStorageAccountType. \ - * {@link KnownOsDiskStorageAccountType} can be used interchangeably with OsDiskStorageAccountType, - * this enum contains the known values that the service supports. - * ### Known values supported by the service - * **Standard**: Standard OS disk type. \ - * **Premium**: Premium OS disk type. \ - * **StandardSSD**: Standard SSD OS disk type. - */ -export type OsDiskStorageAccountType = string; - -/** 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 SkuListByLocationOptionalParams - extends coreClient.OperationOptions {} - -/** Contains response data for the listByLocation operation. */ -export type SkuListByLocationResponse = ResourceSkuListResult; - -/** Optional parameters. */ -export interface SkuListByLocationNextOptionalParams - extends coreClient.OperationOptions {} - -/** Contains response data for the listByLocationNext operation. */ -export type SkuListByLocationNextResponse = ResourceSkuListResult; - -/** Optional parameters. */ -export interface SubscriptionUsagesListByLocationOptionalParams - extends coreClient.OperationOptions {} - -/** Contains response data for the listByLocation operation. */ -export type SubscriptionUsagesListByLocationResponse = QuotaListResult; - -/** Optional parameters. */ -export interface SubscriptionUsagesListByLocationNextOptionalParams - extends coreClient.OperationOptions {} - -/** Contains response data for the listByLocationNext operation. */ -export type SubscriptionUsagesListByLocationNextResponse = QuotaListResult; - -/** Optional parameters. */ -export interface PoolsListBySubscriptionOptionalParams - extends coreClient.OperationOptions {} - -/** Contains response data for the listBySubscription operation. */ -export type PoolsListBySubscriptionResponse = PoolListResult; - -/** Optional parameters. */ -export interface PoolsListByResourceGroupOptionalParams - extends coreClient.OperationOptions {} - -/** Contains response data for the listByResourceGroup operation. */ -export type PoolsListByResourceGroupResponse = 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; -} - -/** Contains response data for the delete operation. */ -export type PoolsDeleteResponse = PoolsDeleteHeaders; - -/** Optional parameters. */ -export interface PoolsListBySubscriptionNextOptionalParams - extends coreClient.OperationOptions {} - -/** Contains response data for the listBySubscriptionNext operation. */ -export type PoolsListBySubscriptionNextResponse = PoolListResult; - -/** Optional parameters. */ -export interface PoolsListByResourceGroupNextOptionalParams - extends coreClient.OperationOptions {} - -/** Contains response data for the listByResourceGroupNext operation. */ -export type PoolsListByResourceGroupNextResponse = PoolListResult; - -/** Optional parameters. */ -export interface ImageVersionsListByImageOptionalParams - extends coreClient.OperationOptions {} - -/** Contains response data for the listByImage operation. */ -export type ImageVersionsListByImageResponse = ImageVersionListResult; - -/** Optional parameters. */ -export interface ImageVersionsListByImageNextOptionalParams - extends coreClient.OperationOptions {} - -/** Contains response data for the listByImageNext operation. */ -export type ImageVersionsListByImageNextResponse = ImageVersionListResult; - -/** Optional parameters. */ -export interface ResourceDetailsListByPoolOptionalParams - extends coreClient.OperationOptions {} - -/** Contains response data for the listByPool operation. */ -export type ResourceDetailsListByPoolResponse = ResourceDetailsObjectListResult; - -/** Optional parameters. */ -export interface ResourceDetailsListByPoolNextOptionalParams - extends coreClient.OperationOptions {} - -/** Contains response data for the listByPoolNext operation. */ -export type ResourceDetailsListByPoolNextResponse = - ResourceDetailsObjectListResult; - -/** Optional parameters. */ -export interface ManagedDevOpsInfrastructureOptionalParams - extends coreClient.ServiceClientOptions { - /** server parameter */ - $host?: string; - /** Api Version */ - apiVersion?: string; - /** Overrides client endpoint. */ - endpoint?: string; -} +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +export { + ImageVersion, + ImageVersionProperties, + ProxyResource, + Resource, + SystemData, + KnownCreatedByType, + CreatedByType, + ErrorResponse, + ErrorDetail, + ErrorAdditionalInfo, + Quota, + QuotaName, + ResourceSku, + ResourceSkuProperties, + ResourceSkuLocationInfo, + ResourceSkuZoneDetails, + ResourceSkuCapabilities, + ResourceSkuRestrictions, + KnownResourceSkuRestrictionsType, + ResourceSkuRestrictionsType, + ResourceSkuRestrictionInfo, + KnownResourceSkuRestrictionsReasonCode, + ResourceSkuRestrictionsReasonCode, + ResourceDetailsObject, + ResourceDetailsObjectProperties, + KnownResourceStatus, + ResourceStatus, + Pool, + PoolProperties, + KnownProvisioningState, + ProvisioningState, + OrganizationProfile, + OrganizationProfileUnion, + GitHubOrganizationProfile, + GitHubOrganization, + AzureDevOpsOrganizationProfile, + Organization, + AzureDevOpsPermissionProfile, + KnownAzureDevOpsPermissionType, + AzureDevOpsPermissionType, + AgentProfile, + AgentProfileUnion, + ResourcePredictions, + ResourcePredictionsProfile, + ResourcePredictionsProfileUnion, + KnownResourcePredictionsProfileType, + ResourcePredictionsProfileType, + ManualResourcePredictionsProfile, + AutomaticResourcePredictionsProfile, + KnownPredictionPreference, + PredictionPreference, + StatelessAgentProfile, + Stateful, + FabricProfile, + FabricProfileUnion, + VmssFabricProfile, + DevOpsAzureSku, + PoolImage, + OsProfile, + SecretsManagementSettings, + KnownLogonType, + LogonType, + StorageProfile, + KnownOsDiskStorageAccountType, + OsDiskStorageAccountType, + DataDisk, + KnownCachingType, + CachingType, + KnownStorageAccountType, + StorageAccountType, + NetworkProfile, + ManagedServiceIdentity, + KnownManagedServiceIdentityType, + ManagedServiceIdentityType, + UserAssignedIdentity, + TrackedResource, + PoolUpdate, + PoolUpdateProperties, + CheckNameAvailability, + KnownDevOpsInfrastructureResourceType, + DevOpsInfrastructureResourceType, + CheckNameAvailabilityResult, + KnownAvailabilityStatus, + AvailabilityStatus, + KnownCheckNameAvailabilityReason, + CheckNameAvailabilityReason, + Operation, + OperationDisplay, + KnownOrigin, + Origin, + KnownActionType, + ActionType, + KnownVersions, +} from "./models.js"; diff --git a/sdk/devopsinfrastructure/arm-devopsinfrastructure/src/models/mappers.ts b/sdk/devopsinfrastructure/arm-devopsinfrastructure/src/models/mappers.ts deleted file mode 100644 index 4275dbcfc96d..000000000000 --- a/sdk/devopsinfrastructure/arm-devopsinfrastructure/src/models/mappers.ts +++ /dev/null @@ -1,1899 +0,0 @@ -/* - * 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 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 ErrorResponse: coreClient.CompositeMapper = { - type: { - name: "Composite", - className: "ErrorResponse", - modelProperties: { - error: { - serializedName: "error", - type: { - name: "Composite", - className: "ErrorDetail", - }, - }, - }, - }, -}; - -export const ErrorDetail: coreClient.CompositeMapper = { - type: { - name: "Composite", - className: "ErrorDetail", - modelProperties: { - code: { - serializedName: "code", - readOnly: true, - type: { - name: "String", - }, - }, - message: { - serializedName: "message", - readOnly: true, - type: { - name: "String", - }, - }, - target: { - serializedName: "target", - readOnly: true, - type: { - name: "String", - }, - }, - details: { - serializedName: "details", - readOnly: true, - type: { - name: "Sequence", - element: { - type: { - name: "Composite", - className: "ErrorDetail", - }, - }, - }, - }, - additionalInfo: { - serializedName: "additionalInfo", - readOnly: true, - type: { - name: "Sequence", - element: { - type: { - name: "Composite", - className: "ErrorAdditionalInfo", - }, - }, - }, - }, - }, - }, -}; - -export const ErrorAdditionalInfo: coreClient.CompositeMapper = { - type: { - name: "Composite", - className: "ErrorAdditionalInfo", - modelProperties: { - type: { - serializedName: "type", - readOnly: true, - type: { - name: "String", - }, - }, - info: { - serializedName: "info", - readOnly: true, - type: { - name: "Dictionary", - value: { type: { name: "any" } }, - }, - }, - }, - }, -}; - -export const ResourceSkuListResult: coreClient.CompositeMapper = { - type: { - name: "Composite", - className: "ResourceSkuListResult", - modelProperties: { - value: { - serializedName: "value", - required: true, - type: { - name: "Sequence", - element: { - type: { - name: "Composite", - className: "ResourceSku", - }, - }, - }, - }, - nextLink: { - serializedName: "nextLink", - type: { - name: "String", - }, - }, - }, - }, -}; - -export const ResourceSkuProperties: coreClient.CompositeMapper = { - type: { - name: "Composite", - className: "ResourceSkuProperties", - modelProperties: { - resourceType: { - serializedName: "resourceType", - required: true, - type: { - name: "String", - }, - }, - tier: { - serializedName: "tier", - required: true, - type: { - name: "String", - }, - }, - size: { - serializedName: "size", - required: true, - type: { - name: "String", - }, - }, - family: { - serializedName: "family", - required: true, - type: { - name: "String", - }, - }, - locations: { - serializedName: "locations", - required: true, - type: { - name: "Sequence", - element: { - type: { - name: "String", - }, - }, - }, - }, - locationInfo: { - serializedName: "locationInfo", - required: true, - type: { - name: "Sequence", - element: { - type: { - name: "Composite", - className: "ResourceSkuLocationInfo", - }, - }, - }, - }, - capabilities: { - serializedName: "capabilities", - required: true, - type: { - name: "Sequence", - element: { - type: { - name: "Composite", - className: "ResourceSkuCapabilities", - }, - }, - }, - }, - restrictions: { - serializedName: "restrictions", - required: true, - type: { - name: "Sequence", - element: { - type: { - name: "Composite", - className: "ResourceSkuRestrictions", - }, - }, - }, - }, - }, - }, -}; - -export const ResourceSkuLocationInfo: coreClient.CompositeMapper = { - type: { - name: "Composite", - className: "ResourceSkuLocationInfo", - modelProperties: { - location: { - serializedName: "location", - required: true, - type: { - name: "String", - }, - }, - zones: { - serializedName: "zones", - required: true, - type: { - name: "Sequence", - element: { - type: { - name: "String", - }, - }, - }, - }, - zoneDetails: { - serializedName: "zoneDetails", - required: true, - type: { - name: "Sequence", - element: { - type: { - name: "Composite", - className: "ResourceSkuZoneDetails", - }, - }, - }, - }, - }, - }, -}; - -export const ResourceSkuZoneDetails: coreClient.CompositeMapper = { - type: { - name: "Composite", - className: "ResourceSkuZoneDetails", - modelProperties: { - name: { - serializedName: "name", - required: true, - type: { - name: "Sequence", - element: { - type: { - name: "String", - }, - }, - }, - }, - capabilities: { - serializedName: "capabilities", - required: true, - type: { - name: "Sequence", - element: { - type: { - name: "Composite", - className: "ResourceSkuCapabilities", - }, - }, - }, - }, - }, - }, -}; - -export const ResourceSkuCapabilities: coreClient.CompositeMapper = { - type: { - name: "Composite", - className: "ResourceSkuCapabilities", - modelProperties: { - name: { - serializedName: "name", - required: true, - type: { - name: "String", - }, - }, - value: { - serializedName: "value", - required: true, - type: { - name: "String", - }, - }, - }, - }, -}; - -export const ResourceSkuRestrictions: coreClient.CompositeMapper = { - type: { - name: "Composite", - className: "ResourceSkuRestrictions", - modelProperties: { - type: { - serializedName: "type", - type: { - name: "String", - }, - }, - values: { - serializedName: "values", - required: true, - type: { - name: "Sequence", - element: { - type: { - name: "String", - }, - }, - }, - }, - restrictionInfo: { - serializedName: "restrictionInfo", - type: { - name: "Composite", - className: "ResourceSkuRestrictionInfo", - }, - }, - reasonCode: { - serializedName: "reasonCode", - type: { - name: "String", - }, - }, - }, - }, -}; - -export const ResourceSkuRestrictionInfo: coreClient.CompositeMapper = { - type: { - name: "Composite", - className: "ResourceSkuRestrictionInfo", - modelProperties: { - locations: { - serializedName: "locations", - type: { - name: "Sequence", - element: { - type: { - name: "String", - }, - }, - }, - }, - zones: { - serializedName: "zones", - type: { - name: "Sequence", - element: { - type: { - name: "String", - }, - }, - }, - }, - }, - }, -}; - -export const Resource: coreClient.CompositeMapper = { - type: { - name: "Composite", - className: "Resource", - modelProperties: { - id: { - serializedName: "id", - readOnly: true, - type: { - name: "String", - }, - }, - name: { - serializedName: "name", - readOnly: true, - type: { - name: "String", - }, - }, - type: { - serializedName: "type", - readOnly: true, - type: { - name: "String", - }, - }, - 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 QuotaListResult: coreClient.CompositeMapper = { - type: { - name: "Composite", - className: "QuotaListResult", - modelProperties: { - value: { - serializedName: "value", - required: true, - type: { - name: "Sequence", - element: { - type: { - name: "Composite", - className: "Quota", - }, - }, - }, - }, - nextLink: { - serializedName: "nextLink", - type: { - name: "String", - }, - }, - }, - }, -}; - -export const QuotaProperties: coreClient.CompositeMapper = { - type: { - name: "Composite", - className: "QuotaProperties", - modelProperties: { - unit: { - serializedName: "unit", - required: true, - type: { - name: "String", - }, - }, - currentValue: { - serializedName: "currentValue", - required: true, - type: { - name: "Number", - }, - }, - limit: { - serializedName: "limit", - required: true, - type: { - name: "Number", - }, - }, - name: { - serializedName: "name", - type: { - name: "Composite", - className: "QuotaName", - }, - }, - }, - }, -}; - -export const QuotaName: coreClient.CompositeMapper = { - type: { - name: "Composite", - className: "QuotaName", - modelProperties: { - value: { - serializedName: "value", - type: { - name: "String", - }, - }, - localizedValue: { - serializedName: "localizedValue", - type: { - name: "String", - }, - }, - }, - }, -}; - -export const PoolListResult: coreClient.CompositeMapper = { - type: { - name: "Composite", - className: "PoolListResult", - modelProperties: { - value: { - serializedName: "value", - required: true, - type: { - name: "Sequence", - element: { - type: { - name: "Composite", - className: "Pool", - }, - }, - }, - }, - nextLink: { - serializedName: "nextLink", - type: { - name: "String", - }, - }, - }, - }, -}; - -export const PoolProperties: coreClient.CompositeMapper = { - type: { - name: "Composite", - className: "PoolProperties", - modelProperties: { - provisioningState: { - serializedName: "provisioningState", - type: { - name: "String", - }, - }, - maximumConcurrency: { - constraints: { - InclusiveMaximum: 10000, - InclusiveMinimum: 1, - }, - serializedName: "maximumConcurrency", - required: true, - type: { - name: "Number", - }, - }, - organizationProfile: { - serializedName: "organizationProfile", - type: { - name: "Composite", - className: "OrganizationProfile", - }, - }, - agentProfile: { - serializedName: "agentProfile", - type: { - name: "Composite", - className: "AgentProfile", - }, - }, - fabricProfile: { - serializedName: "fabricProfile", - type: { - name: "Composite", - className: "FabricProfile", - }, - }, - devCenterProjectResourceId: { - serializedName: "devCenterProjectResourceId", - required: true, - type: { - name: "String", - }, - }, - }, - }, -}; - -export const OrganizationProfile: coreClient.CompositeMapper = { - type: { - name: "Composite", - className: "OrganizationProfile", - uberParent: "OrganizationProfile", - polymorphicDiscriminator: { - serializedName: "kind", - clientName: "kind", - }, - modelProperties: { - kind: { - serializedName: "kind", - required: true, - type: { - name: "String", - }, - }, - }, - }, -}; - -export const AgentProfile: coreClient.CompositeMapper = { - type: { - name: "Composite", - className: "AgentProfile", - uberParent: "AgentProfile", - polymorphicDiscriminator: { - serializedName: "kind", - clientName: "kind", - }, - modelProperties: { - kind: { - serializedName: "kind", - required: true, - type: { - name: "String", - }, - }, - resourcePredictions: { - serializedName: "resourcePredictions", - type: { - name: "Dictionary", - value: { type: { name: "any" } }, - }, - }, - resourcePredictionsProfile: { - serializedName: "resourcePredictionsProfile", - type: { - name: "Composite", - className: "ResourcePredictionsProfile", - }, - }, - }, - }, -}; - -export const ResourcePredictionsProfile: coreClient.CompositeMapper = { - type: { - name: "Composite", - className: "ResourcePredictionsProfile", - uberParent: "ResourcePredictionsProfile", - polymorphicDiscriminator: { - serializedName: "kind", - clientName: "kind", - }, - modelProperties: { - kind: { - serializedName: "kind", - required: true, - type: { - name: "String", - }, - }, - }, - }, -}; - -export const FabricProfile: coreClient.CompositeMapper = { - type: { - name: "Composite", - className: "FabricProfile", - uberParent: "FabricProfile", - polymorphicDiscriminator: { - serializedName: "kind", - clientName: "kind", - }, - modelProperties: { - kind: { - serializedName: "kind", - required: 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 ImageVersionListResult: coreClient.CompositeMapper = { - type: { - name: "Composite", - className: "ImageVersionListResult", - modelProperties: { - value: { - serializedName: "value", - required: true, - type: { - name: "Sequence", - element: { - type: { - name: "Composite", - className: "ImageVersion", - }, - }, - }, - }, - nextLink: { - serializedName: "nextLink", - type: { - name: "String", - }, - }, - }, - }, -}; - -export const ImageVersionProperties: coreClient.CompositeMapper = { - type: { - name: "Composite", - className: "ImageVersionProperties", - modelProperties: { - version: { - serializedName: "version", - required: true, - type: { - name: "String", - }, - }, - }, - }, -}; - -export const PoolUpdate: coreClient.CompositeMapper = { - type: { - name: "Composite", - className: "PoolUpdate", - modelProperties: { - identity: { - serializedName: "identity", - type: { - name: "Composite", - className: "ManagedServiceIdentity", - }, - }, - tags: { - serializedName: "tags", - type: { - name: "Dictionary", - value: { type: { name: "String" } }, - }, - }, - properties: { - serializedName: "properties", - type: { - name: "Composite", - className: "PoolUpdateProperties", - }, - }, - }, - }, -}; - -export const PoolUpdateProperties: coreClient.CompositeMapper = { - type: { - name: "Composite", - className: "PoolUpdateProperties", - modelProperties: { - provisioningState: { - serializedName: "provisioningState", - type: { - name: "String", - }, - }, - maximumConcurrency: { - constraints: { - InclusiveMaximum: 10000, - InclusiveMinimum: 1, - }, - serializedName: "maximumConcurrency", - type: { - name: "Number", - }, - }, - organizationProfile: { - serializedName: "organizationProfile", - type: { - name: "Composite", - className: "OrganizationProfile", - }, - }, - agentProfile: { - serializedName: "agentProfile", - type: { - name: "Composite", - className: "AgentProfileUpdate", - }, - }, - fabricProfile: { - serializedName: "fabricProfile", - type: { - name: "Composite", - className: "FabricProfile", - }, - }, - devCenterProjectResourceId: { - serializedName: "devCenterProjectResourceId", - type: { - name: "String", - }, - }, - }, - }, -}; - -export const AgentProfileUpdate: coreClient.CompositeMapper = { - type: { - name: "Composite", - className: "AgentProfileUpdate", - uberParent: "AgentProfileUpdate", - polymorphicDiscriminator: { - serializedName: "kind", - clientName: "kind", - }, - modelProperties: { - kind: { - serializedName: "kind", - required: true, - type: { - name: "String", - }, - }, - resourcePredictions: { - serializedName: "resourcePredictions", - type: { - name: "Dictionary", - value: { type: { name: "any" } }, - }, - }, - resourcePredictionsProfile: { - serializedName: "resourcePredictionsProfile", - type: { - name: "Composite", - className: "ResourcePredictionsProfileUpdate", - }, - }, - }, - }, -}; - -export const ResourcePredictionsProfileUpdate: coreClient.CompositeMapper = { - type: { - name: "Composite", - className: "ResourcePredictionsProfileUpdate", - uberParent: "ResourcePredictionsProfileUpdate", - polymorphicDiscriminator: { - serializedName: "kind", - clientName: "kind", - }, - modelProperties: { - kind: { - serializedName: "kind", - required: true, - type: { - name: "String", - }, - }, - }, - }, -}; - -export const ResourceDetailsObjectListResult: coreClient.CompositeMapper = { - type: { - name: "Composite", - className: "ResourceDetailsObjectListResult", - modelProperties: { - value: { - serializedName: "value", - required: true, - type: { - name: "Sequence", - element: { - type: { - name: "Composite", - className: "ResourceDetailsObject", - }, - }, - }, - }, - nextLink: { - serializedName: "nextLink", - type: { - name: "String", - }, - }, - }, - }, -}; - -export const ResourceDetailsObjectProperties: coreClient.CompositeMapper = { - type: { - name: "Composite", - className: "ResourceDetailsObjectProperties", - modelProperties: { - status: { - serializedName: "status", - required: true, - type: { - name: "String", - }, - }, - image: { - serializedName: "image", - required: true, - type: { - name: "String", - }, - }, - imageVersion: { - serializedName: "imageVersion", - required: true, - type: { - name: "String", - }, - }, - }, - }, -}; - -export const Organization: coreClient.CompositeMapper = { - type: { - name: "Composite", - className: "Organization", - modelProperties: { - url: { - serializedName: "url", - required: true, - type: { - name: "String", - }, - }, - projects: { - serializedName: "projects", - type: { - name: "Sequence", - element: { - type: { - name: "String", - }, - }, - }, - }, - parallelism: { - serializedName: "parallelism", - type: { - name: "Number", - }, - }, - }, - }, -}; - -export const AzureDevOpsPermissionProfile: coreClient.CompositeMapper = { - type: { - name: "Composite", - className: "AzureDevOpsPermissionProfile", - modelProperties: { - kind: { - serializedName: "kind", - required: true, - type: { - name: "String", - }, - }, - users: { - serializedName: "users", - type: { - name: "Sequence", - element: { - type: { - name: "String", - }, - }, - }, - }, - groups: { - serializedName: "groups", - type: { - name: "Sequence", - element: { - type: { - name: "String", - }, - }, - }, - }, - }, - }, -}; - -export const DataDisk: coreClient.CompositeMapper = { - type: { - name: "Composite", - className: "DataDisk", - modelProperties: { - caching: { - serializedName: "caching", - type: { - name: "String", - }, - }, - diskSizeGiB: { - serializedName: "diskSizeGiB", - type: { - name: "Number", - }, - }, - storageAccountType: { - serializedName: "storageAccountType", - type: { - name: "String", - }, - }, - driveLetter: { - serializedName: "driveLetter", - type: { - name: "String", - }, - }, - }, - }, -}; - -export const DevOpsAzureSku: coreClient.CompositeMapper = { - type: { - name: "Composite", - className: "DevOpsAzureSku", - modelProperties: { - name: { - serializedName: "name", - required: true, - type: { - name: "String", - }, - }, - }, - }, -}; - -export const GitHubOrganization: coreClient.CompositeMapper = { - type: { - name: "Composite", - className: "GitHubOrganization", - modelProperties: { - url: { - serializedName: "url", - required: true, - type: { - name: "String", - }, - }, - repositories: { - serializedName: "repositories", - type: { - name: "Sequence", - element: { - type: { - name: "String", - }, - }, - }, - }, - }, - }, -}; - -export const NetworkProfile: coreClient.CompositeMapper = { - type: { - name: "Composite", - className: "NetworkProfile", - modelProperties: { - subnetId: { - serializedName: "subnetId", - required: true, - type: { - name: "String", - }, - }, - }, - }, -}; - -export const OsProfile: coreClient.CompositeMapper = { - type: { - name: "Composite", - className: "OsProfile", - modelProperties: { - secretsManagementSettings: { - serializedName: "secretsManagementSettings", - type: { - name: "Composite", - className: "SecretsManagementSettings", - }, - }, - logonType: { - serializedName: "logonType", - type: { - name: "String", - }, - }, - }, - }, -}; - -export const SecretsManagementSettings: coreClient.CompositeMapper = { - type: { - name: "Composite", - className: "SecretsManagementSettings", - modelProperties: { - certificateStoreLocation: { - serializedName: "certificateStoreLocation", - type: { - name: "String", - }, - }, - observedCertificates: { - serializedName: "observedCertificates", - required: true, - type: { - name: "Sequence", - element: { - type: { - name: "String", - }, - }, - }, - }, - keyExportable: { - serializedName: "keyExportable", - required: true, - type: { - name: "Boolean", - }, - }, - }, - }, -}; - -export const PoolImage: coreClient.CompositeMapper = { - type: { - name: "Composite", - className: "PoolImage", - modelProperties: { - resourceId: { - serializedName: "resourceId", - type: { - name: "String", - }, - }, - wellKnownImageName: { - serializedName: "wellKnownImageName", - type: { - name: "String", - }, - }, - aliases: { - serializedName: "aliases", - type: { - name: "Sequence", - element: { - type: { - name: "String", - }, - }, - }, - }, - buffer: { - defaultValue: "*", - serializedName: "buffer", - type: { - name: "String", - }, - }, - }, - }, -}; - -export const StorageProfile: coreClient.CompositeMapper = { - type: { - name: "Composite", - className: "StorageProfile", - modelProperties: { - osDiskStorageAccountType: { - serializedName: "osDiskStorageAccountType", - type: { - name: "String", - }, - }, - dataDisks: { - serializedName: "dataDisks", - type: { - name: "Sequence", - element: { - type: { - name: "Composite", - className: "DataDisk", - }, - }, - }, - }, - }, - }, -}; - -export const ProxyResource: coreClient.CompositeMapper = { - type: { - name: "Composite", - className: "ProxyResource", - modelProperties: { - ...Resource.type.modelProperties, - }, - }, -}; - -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 AzureDevOpsOrganizationProfile: coreClient.CompositeMapper = { - serializedName: "AzureDevOps", - type: { - name: "Composite", - className: "AzureDevOpsOrganizationProfile", - uberParent: "OrganizationProfile", - polymorphicDiscriminator: OrganizationProfile.type.polymorphicDiscriminator, - modelProperties: { - ...OrganizationProfile.type.modelProperties, - organizations: { - serializedName: "organizations", - required: true, - type: { - name: "Sequence", - element: { - type: { - name: "Composite", - className: "Organization", - }, - }, - }, - }, - permissionProfile: { - serializedName: "permissionProfile", - type: { - name: "Composite", - className: "AzureDevOpsPermissionProfile", - }, - }, - }, - }, -}; - -export const GitHubOrganizationProfile: coreClient.CompositeMapper = { - serializedName: "GitHub", - type: { - name: "Composite", - className: "GitHubOrganizationProfile", - uberParent: "OrganizationProfile", - polymorphicDiscriminator: OrganizationProfile.type.polymorphicDiscriminator, - modelProperties: { - ...OrganizationProfile.type.modelProperties, - organizations: { - serializedName: "organizations", - required: true, - type: { - name: "Sequence", - element: { - type: { - name: "Composite", - className: "GitHubOrganization", - }, - }, - }, - }, - }, - }, -}; - -export const Stateful: coreClient.CompositeMapper = { - serializedName: "Stateful", - type: { - name: "Composite", - className: "Stateful", - uberParent: "AgentProfile", - polymorphicDiscriminator: AgentProfile.type.polymorphicDiscriminator, - modelProperties: { - ...AgentProfile.type.modelProperties, - maxAgentLifetime: { - serializedName: "maxAgentLifetime", - type: { - name: "String", - }, - }, - gracePeriodTimeSpan: { - serializedName: "gracePeriodTimeSpan", - type: { - name: "String", - }, - }, - }, - }, -}; - -export const StatelessAgentProfile: coreClient.CompositeMapper = { - serializedName: "Stateless", - type: { - name: "Composite", - className: "StatelessAgentProfile", - uberParent: "AgentProfile", - polymorphicDiscriminator: AgentProfile.type.polymorphicDiscriminator, - modelProperties: { - ...AgentProfile.type.modelProperties, - }, - }, -}; - -export const AutomaticResourcePredictionsProfile: coreClient.CompositeMapper = { - serializedName: "Automatic", - type: { - name: "Composite", - className: "AutomaticResourcePredictionsProfile", - uberParent: "ResourcePredictionsProfile", - polymorphicDiscriminator: - ResourcePredictionsProfile.type.polymorphicDiscriminator, - modelProperties: { - ...ResourcePredictionsProfile.type.modelProperties, - predictionPreference: { - serializedName: "predictionPreference", - type: { - name: "String", - }, - }, - }, - }, -}; - -export const ManualResourcePredictionsProfile: coreClient.CompositeMapper = { - serializedName: "Manual", - type: { - name: "Composite", - className: "ManualResourcePredictionsProfile", - uberParent: "ResourcePredictionsProfile", - polymorphicDiscriminator: - ResourcePredictionsProfile.type.polymorphicDiscriminator, - modelProperties: { - ...ResourcePredictionsProfile.type.modelProperties, - }, - }, -}; - -export const VmssFabricProfile: coreClient.CompositeMapper = { - serializedName: "Vmss", - type: { - name: "Composite", - className: "VmssFabricProfile", - uberParent: "FabricProfile", - polymorphicDiscriminator: FabricProfile.type.polymorphicDiscriminator, - modelProperties: { - ...FabricProfile.type.modelProperties, - sku: { - serializedName: "sku", - type: { - name: "Composite", - className: "DevOpsAzureSku", - }, - }, - images: { - serializedName: "images", - required: true, - type: { - name: "Sequence", - element: { - type: { - name: "Composite", - className: "PoolImage", - }, - }, - }, - }, - osProfile: { - serializedName: "osProfile", - type: { - name: "Composite", - className: "OsProfile", - }, - }, - storageProfile: { - serializedName: "storageProfile", - type: { - name: "Composite", - className: "StorageProfile", - }, - }, - networkProfile: { - serializedName: "networkProfile", - type: { - name: "Composite", - className: "NetworkProfile", - }, - }, - }, - }, -}; - -export const StatefulUpdate: coreClient.CompositeMapper = { - serializedName: "Stateful", - type: { - name: "Composite", - className: "StatefulUpdate", - uberParent: "AgentProfileUpdate", - polymorphicDiscriminator: AgentProfileUpdate.type.polymorphicDiscriminator, - modelProperties: { - ...AgentProfileUpdate.type.modelProperties, - maxAgentLifetime: { - serializedName: "maxAgentLifetime", - type: { - name: "String", - }, - }, - gracePeriodTimeSpan: { - serializedName: "gracePeriodTimeSpan", - type: { - name: "String", - }, - }, - }, - }, -}; - -export const StatelessAgentProfileUpdate: coreClient.CompositeMapper = { - serializedName: "Stateless", - type: { - name: "Composite", - className: "StatelessAgentProfileUpdate", - uberParent: "AgentProfileUpdate", - polymorphicDiscriminator: AgentProfileUpdate.type.polymorphicDiscriminator, - modelProperties: { - ...AgentProfileUpdate.type.modelProperties, - }, - }, -}; - -export const AutomaticResourcePredictionsProfileUpdate: coreClient.CompositeMapper = - { - serializedName: "Automatic", - type: { - name: "Composite", - className: "AutomaticResourcePredictionsProfileUpdate", - uberParent: "ResourcePredictionsProfileUpdate", - polymorphicDiscriminator: - ResourcePredictionsProfileUpdate.type.polymorphicDiscriminator, - modelProperties: { - ...ResourcePredictionsProfileUpdate.type.modelProperties, - predictionPreference: { - serializedName: "predictionPreference", - type: { - name: "String", - }, - }, - }, - }, - }; - -export const ManualResourcePredictionsProfileUpdate: coreClient.CompositeMapper = - { - serializedName: "Manual", - type: { - name: "Composite", - className: "ManualResourcePredictionsProfileUpdate", - uberParent: "ResourcePredictionsProfileUpdate", - polymorphicDiscriminator: - ResourcePredictionsProfileUpdate.type.polymorphicDiscriminator, - modelProperties: { - ...ResourcePredictionsProfileUpdate.type.modelProperties, - }, - }, - }; - -export const ResourceSku: coreClient.CompositeMapper = { - type: { - name: "Composite", - className: "ResourceSku", - modelProperties: { - ...ProxyResource.type.modelProperties, - properties: { - serializedName: "properties", - type: { - name: "Composite", - className: "ResourceSkuProperties", - }, - }, - }, - }, -}; - -export const Quota: coreClient.CompositeMapper = { - type: { - name: "Composite", - className: "Quota", - modelProperties: { - ...ProxyResource.type.modelProperties, - properties: { - serializedName: "properties", - type: { - name: "Composite", - className: "QuotaProperties", - }, - }, - }, - }, -}; - -export const ImageVersion: coreClient.CompositeMapper = { - type: { - name: "Composite", - className: "ImageVersion", - modelProperties: { - ...ProxyResource.type.modelProperties, - properties: { - serializedName: "properties", - type: { - name: "Composite", - className: "ImageVersionProperties", - }, - }, - }, - }, -}; - -export const ResourceDetailsObject: coreClient.CompositeMapper = { - type: { - name: "Composite", - className: "ResourceDetailsObject", - modelProperties: { - ...ProxyResource.type.modelProperties, - properties: { - serializedName: "properties", - type: { - name: "Composite", - className: "ResourceDetailsObjectProperties", - }, - }, - }, - }, -}; - -export const Pool: coreClient.CompositeMapper = { - type: { - name: "Composite", - className: "Pool", - modelProperties: { - ...TrackedResource.type.modelProperties, - properties: { - serializedName: "properties", - type: { - name: "Composite", - className: "PoolProperties", - }, - }, - identity: { - serializedName: "identity", - type: { - name: "Composite", - className: "ManagedServiceIdentity", - }, - }, - }, - }, -}; - -export const PoolsCreateOrUpdateHeaders: coreClient.CompositeMapper = { - type: { - name: "Composite", - className: "PoolsCreateOrUpdateHeaders", - modelProperties: { - retryAfter: { - serializedName: "retry-after", - type: { - name: "Number", - }, - }, - }, - }, -}; - -export const PoolsUpdateHeaders: coreClient.CompositeMapper = { - type: { - name: "Composite", - className: "PoolsUpdateHeaders", - modelProperties: { - location: { - serializedName: "location", - type: { - name: "String", - }, - }, - retryAfter: { - serializedName: "retry-after", - type: { - name: "Number", - }, - }, - }, - }, -}; - -export const PoolsDeleteHeaders: coreClient.CompositeMapper = { - type: { - name: "Composite", - className: "PoolsDeleteHeaders", - modelProperties: { - location: { - serializedName: "location", - type: { - name: "String", - }, - }, - retryAfter: { - serializedName: "retry-after", - type: { - name: "Number", - }, - }, - }, - }, -}; - -export let discriminators = { - OrganizationProfile: OrganizationProfile, - AgentProfile: AgentProfile, - ResourcePredictionsProfile: ResourcePredictionsProfile, - FabricProfile: FabricProfile, - AgentProfileUpdate: AgentProfileUpdate, - ResourcePredictionsProfileUpdate: ResourcePredictionsProfileUpdate, - "OrganizationProfile.AzureDevOps": AzureDevOpsOrganizationProfile, - "OrganizationProfile.GitHub": GitHubOrganizationProfile, - "AgentProfile.Stateful": Stateful, - "AgentProfile.Stateless": StatelessAgentProfile, - "ResourcePredictionsProfile.Automatic": AutomaticResourcePredictionsProfile, - "ResourcePredictionsProfile.Manual": ManualResourcePredictionsProfile, - "FabricProfile.Vmss": VmssFabricProfile, - "AgentProfileUpdate.Stateful": StatefulUpdate, - "AgentProfileUpdate.Stateless": StatelessAgentProfileUpdate, - "ResourcePredictionsProfileUpdate.Automatic": - AutomaticResourcePredictionsProfileUpdate, - "ResourcePredictionsProfileUpdate.Manual": - ManualResourcePredictionsProfileUpdate, -}; diff --git a/sdk/devopsinfrastructure/arm-devopsinfrastructure/src/models/models.ts b/sdk/devopsinfrastructure/arm-devopsinfrastructure/src/models/models.ts new file mode 100644 index 000000000000..cdf0381c2852 --- /dev/null +++ b/sdk/devopsinfrastructure/arm-devopsinfrastructure/src/models/models.ts @@ -0,0 +1,2180 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +/** The response of a ImageVersion list operation. */ +export interface _ImageVersionListResult { + /** The ImageVersion items on this page */ + value: ImageVersion[]; + /** The link to the next page of items */ + nextLink?: string; +} + +export function _imageVersionListResultDeserializer( + item: any, +): _ImageVersionListResult { + return { + value: imageVersionArrayDeserializer(item["value"]), + nextLink: item["nextLink"], + }; +} + +export function imageVersionArrayDeserializer( + result: Array, +): any[] { + return result.map((item) => { + return imageVersionDeserializer(item); + }); +} + +/** An image version object */ +export interface ImageVersion extends ProxyResource { + /** The resource-specific properties for this resource. */ + properties?: ImageVersionProperties; +} + +export function imageVersionDeserializer(item: any): ImageVersion { + return { + id: item["id"], + name: item["name"], + type: item["type"], + systemData: !item["systemData"] + ? item["systemData"] + : systemDataDeserializer(item["systemData"]), + properties: !item["properties"] + ? item["properties"] + : imageVersionPropertiesDeserializer(item["properties"]), + }; +} + +/** Details of the ImageVersionProperties. */ +export interface ImageVersionProperties { + /** Version of the image. */ + version: string; +} + +export function imageVersionPropertiesDeserializer( + item: any, +): ImageVersionProperties { + return { + version: item["version"], + }; +} + +/** The resource model definition for a Azure Resource Manager proxy resource. It will not have tags and a location */ +export interface ProxyResource extends Resource {} + +export function proxyResourceDeserializer(item: any): ProxyResource { + return { + id: item["id"], + name: item["name"], + type: item["type"], + systemData: !item["systemData"] + ? item["systemData"] + : systemDataDeserializer(item["systemData"]), + }; +} + +/** 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} */ + readonly id?: string; + /** The name of the resource */ + readonly name?: string; + /** The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts" */ + readonly type?: string; + /** Azure Resource Manager metadata containing createdBy and modifiedBy information. */ + readonly systemData?: SystemData; +} + +export function resourceSerializer(item: Resource): any { + return item; +} + +export function resourceDeserializer(item: any): Resource { + return { + id: item["id"], + name: item["name"], + type: item["type"], + systemData: !item["systemData"] + ? item["systemData"] + : systemDataDeserializer(item["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; +} + +export function systemDataDeserializer(item: any): SystemData { + return { + createdBy: item["createdBy"], + createdByType: item["createdByType"], + createdAt: !item["createdAt"] + ? item["createdAt"] + : new Date(item["createdAt"]), + lastModifiedBy: item["lastModifiedBy"], + lastModifiedByType: item["lastModifiedByType"], + lastModifiedAt: !item["lastModifiedAt"] + ? item["lastModifiedAt"] + : new Date(item["lastModifiedAt"]), + }; +} + +/** The kind of entity that created the resource. */ +export enum KnownCreatedByType { + /** The entity was created by a user. */ + User = "User", + /** The entity was created by an application. */ + Application = "Application", + /** The entity was created by a managed identity. */ + ManagedIdentity = "ManagedIdentity", + /** The entity was created by a key. */ + Key = "Key", +} + +/** + * The kind of entity that created the resource. \ + * {@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**: The entity was created by a user. \ + * **Application**: The entity was created by an application. \ + * **ManagedIdentity**: The entity was created by a managed identity. \ + * **Key**: The entity was created by a key. + */ +export type CreatedByType = string; + +/** Common error response for all Azure Resource Manager APIs to return error details for failed operations. */ +export interface ErrorResponse { + /** The error object. */ + error?: ErrorDetail; +} + +export function errorResponseDeserializer(item: any): ErrorResponse { + return { + error: !item["error"] + ? item["error"] + : errorDetailDeserializer(item["error"]), + }; +} + +/** The error detail. */ +export interface ErrorDetail { + /** The error code. */ + readonly code?: string; + /** The error message. */ + readonly message?: string; + /** The error target. */ + readonly target?: string; + /** The error details. */ + readonly details?: ErrorDetail[]; + /** The error additional info. */ + readonly additionalInfo?: ErrorAdditionalInfo[]; +} + +export function errorDetailDeserializer(item: any): ErrorDetail { + return { + code: item["code"], + message: item["message"], + target: item["target"], + details: !item["details"] + ? item["details"] + : errorDetailArrayDeserializer(item["details"]), + additionalInfo: !item["additionalInfo"] + ? item["additionalInfo"] + : errorAdditionalInfoArrayDeserializer(item["additionalInfo"]), + }; +} + +export function errorDetailArrayDeserializer( + result: Array, +): any[] { + return result.map((item) => { + return errorDetailDeserializer(item); + }); +} + +export function errorAdditionalInfoArrayDeserializer( + result: Array, +): any[] { + return result.map((item) => { + return errorAdditionalInfoDeserializer(item); + }); +} + +/** The resource management error additional info. */ +export interface ErrorAdditionalInfo { + /** The additional info type. */ + readonly type?: string; + /** The additional info. */ + readonly info?: Record; +} + +export function errorAdditionalInfoDeserializer( + item: any, +): ErrorAdditionalInfo { + return { + type: item["type"], + info: !item["info"] + ? item["info"] + : _errorAdditionalInfoInfoDeserializer(item["info"]), + }; +} + +/** model interface _ErrorAdditionalInfoInfo */ +export interface _ErrorAdditionalInfoInfo {} + +export function _errorAdditionalInfoInfoDeserializer( + item: any, +): _ErrorAdditionalInfoInfo { + return item; +} + +/** Paged collection of Quota items */ +export interface _PagedQuota { + /** The Quota items on this page */ + value: Quota[]; + /** The link to the next page of items */ + nextLink?: string; +} + +export function _pagedQuotaDeserializer(item: any): _PagedQuota { + return { + value: quotaArrayDeserializer(item["value"]), + nextLink: item["nextLink"], + }; +} + +export function quotaArrayDeserializer(result: Array): any[] { + return result.map((item) => { + return quotaDeserializer(item); + }); +} + +/** Describes Resource Quota */ +export interface Quota { + /** The name of the quota. */ + readonly name?: QuotaName; + /** Fully qualified ARM resource id */ + id: string; + /** The unit of usage measurement. */ + unit: string; + /** The current usage of the resource. */ + currentValue: number; + /** The maximum permitted usage of the resource. */ + limit: number; +} + +export function quotaDeserializer(item: any): Quota { + return { + name: !item["name"] ? item["name"] : quotaNameDeserializer(item["name"]), + id: item["id"], + unit: item["unit"], + currentValue: item["currentValue"], + limit: item["limit"], + }; +} + +/** The Quota Names */ +export interface QuotaName { + /** The name of the resource. */ + value?: string; + /** The localized name of the resource. */ + localizedValue?: string; +} + +export function quotaNameDeserializer(item: any): QuotaName { + return { + value: item["value"], + localizedValue: item["localizedValue"], + }; +} + +/** The response of a ResourceSku list operation. */ +export interface _ResourceSkuListResult { + /** The ResourceSku items on this page */ + value: ResourceSku[]; + /** The link to the next page of items */ + nextLink?: string; +} + +export function _resourceSkuListResultDeserializer( + item: any, +): _ResourceSkuListResult { + return { + value: resourceSkuArrayDeserializer(item["value"]), + nextLink: item["nextLink"], + }; +} + +export function resourceSkuArrayDeserializer( + result: Array, +): any[] { + return result.map((item) => { + return resourceSkuDeserializer(item); + }); +} + +/** A ResourceSku */ +export interface ResourceSku extends ProxyResource { + /** The resource-specific properties for this resource. */ + properties?: ResourceSkuProperties; +} + +export function resourceSkuDeserializer(item: any): ResourceSku { + return { + id: item["id"], + name: item["name"], + type: item["type"], + systemData: !item["systemData"] + ? item["systemData"] + : systemDataDeserializer(item["systemData"]), + properties: !item["properties"] + ? item["properties"] + : resourceSkuPropertiesDeserializer(item["properties"]), + }; +} + +/** Properties of a ResourceSku */ +export interface ResourceSkuProperties { + /** The type of resource the SKU applies to. */ + resourceType: string; + /** The tier of virtual machines in a scale set */ + tier: string; + /** The size of the SKU. */ + size: string; + /** The family of the SKU. */ + family: string; + /** The set of locations that the SKU is available. */ + locations: string[]; + /** A list of locations and availability zones in those locations where the SKU is available */ + locationInfo: ResourceSkuLocationInfo[]; + /** Name value pairs to describe the capability. */ + capabilities: ResourceSkuCapabilities[]; + /** The restrictions of the SKU. */ + restrictions: ResourceSkuRestrictions[]; +} + +export function resourceSkuPropertiesDeserializer( + item: any, +): ResourceSkuProperties { + return { + resourceType: item["resourceType"], + tier: item["tier"], + size: item["size"], + family: item["family"], + locations: item["locations"].map((p: any) => { + return p; + }), + locationInfo: resourceSkuLocationInfoArrayDeserializer( + item["locationInfo"], + ), + capabilities: resourceSkuCapabilitiesArrayDeserializer( + item["capabilities"], + ), + restrictions: resourceSkuRestrictionsArrayDeserializer( + item["restrictions"], + ), + }; +} + +export function resourceSkuLocationInfoArrayDeserializer( + result: Array, +): any[] { + return result.map((item) => { + return resourceSkuLocationInfoDeserializer(item); + }); +} + +/** Describes an available Compute SKU Location Information. */ +export interface ResourceSkuLocationInfo { + /** Location of the SKU */ + location: string; + /** List of availability zones where the SKU is supported. */ + zones: string[]; + /** Gets details of capabilities available to a SKU in specific zones. */ + zoneDetails: ResourceSkuZoneDetails[]; +} + +export function resourceSkuLocationInfoDeserializer( + item: any, +): ResourceSkuLocationInfo { + return { + location: item["location"], + zones: item["zones"].map((p: any) => { + return p; + }), + zoneDetails: resourceSkuZoneDetailsArrayDeserializer(item["zoneDetails"]), + }; +} + +export function resourceSkuZoneDetailsArrayDeserializer( + result: Array, +): any[] { + return result.map((item) => { + return resourceSkuZoneDetailsDeserializer(item); + }); +} + +/** Describes The zonal capabilities of a SKU. */ +export interface ResourceSkuZoneDetails { + /** Gets the set of zones that the SKU is available in with the specified capabilities. */ + name: string[]; + /** A list of capabilities that are available for the SKU in the specified list of zones. */ + capabilities: ResourceSkuCapabilities[]; +} + +export function resourceSkuZoneDetailsDeserializer( + item: any, +): ResourceSkuZoneDetails { + return { + name: item["name"].map((p: any) => { + return p; + }), + capabilities: resourceSkuCapabilitiesArrayDeserializer( + item["capabilities"], + ), + }; +} + +export function resourceSkuCapabilitiesArrayDeserializer( + result: Array, +): any[] { + return result.map((item) => { + return resourceSkuCapabilitiesDeserializer(item); + }); +} + +/** Describes The SKU capabilities object. */ +export interface ResourceSkuCapabilities { + /** The name of the SKU capability. */ + name: string; + /** The value of the SKU capability. */ + value: string; +} + +export function resourceSkuCapabilitiesDeserializer( + item: any, +): ResourceSkuCapabilities { + return { + name: item["name"], + value: item["value"], + }; +} + +export function resourceSkuRestrictionsArrayDeserializer( + result: Array, +): any[] { + return result.map((item) => { + return resourceSkuRestrictionsDeserializer(item); + }); +} + +/** The restrictions of the SKU. */ +export interface ResourceSkuRestrictions { + /** the type of restrictions. */ + type?: ResourceSkuRestrictionsType; + /** The value of restrictions. If the restriction type is set to location. This would be different locations where the SKU is restricted. */ + values: string[]; + /** The information about the restriction where the SKU cannot be used. */ + restrictionInfo: ResourceSkuRestrictionInfo; + /** the reason for restriction. */ + reasonCode?: ResourceSkuRestrictionsReasonCode; +} + +export function resourceSkuRestrictionsDeserializer( + item: any, +): ResourceSkuRestrictions { + return { + type: item["type"], + values: item["values"].map((p: any) => { + return p; + }), + restrictionInfo: resourceSkuRestrictionInfoDeserializer( + item["restrictionInfo"], + ), + reasonCode: item["reasonCode"], + }; +} + +/** Describes the kind of SKU restrictions that can exist */ +export enum KnownResourceSkuRestrictionsType { + /** SKU restricted by location. */ + Location = "Location", + /** SKU restricted by availability zone. */ + Zone = "Zone", +} + +/** + * Describes the kind of SKU restrictions that can exist \ + * {@link KnownResourceSkuRestrictionsType} can be used interchangeably with ResourceSkuRestrictionsType, + * this enum contains the known values that the service supports. + * ### Known values supported by the service + * **Location**: SKU restricted by location. \ + * **Zone**: SKU restricted by availability zone. + */ +export type ResourceSkuRestrictionsType = string; + +/** Describes an available Compute SKU Restriction Information. */ +export interface ResourceSkuRestrictionInfo { + /** Locations where the SKU is restricted */ + locations?: string[]; + /** List of availability zones where the SKU is restricted. */ + zones?: string[]; +} + +export function resourceSkuRestrictionInfoDeserializer( + item: any, +): ResourceSkuRestrictionInfo { + return { + locations: !item["locations"] + ? item["locations"] + : item["locations"].map((p: any) => { + return p; + }), + zones: !item["zones"] + ? item["zones"] + : item["zones"].map((p: any) => { + return p; + }), + }; +} + +/** Describes the reason for SKU restriction. */ +export enum KnownResourceSkuRestrictionsReasonCode { + /** The restriction is due to exceeding a quota limitation. */ + QuotaId = "QuotaId", + /** The restriction is not available for this subscription. */ + NotAvailableForSubscription = "NotAvailableForSubscription", +} + +/** + * Describes the reason for SKU restriction. \ + * {@link KnownResourceSkuRestrictionsReasonCode} can be used interchangeably with ResourceSkuRestrictionsReasonCode, + * this enum contains the known values that the service supports. + * ### Known values supported by the service + * **QuotaId**: The restriction is due to exceeding a quota limitation. \ + * **NotAvailableForSubscription**: The restriction is not available for this subscription. + */ +export type ResourceSkuRestrictionsReasonCode = string; + +/** The response of a ResourceDetailsObject list operation. */ +export interface _ResourceDetailsObjectListResult { + /** The ResourceDetailsObject items on this page */ + value: ResourceDetailsObject[]; + /** The link to the next page of items */ + nextLink?: string; +} + +export function _resourceDetailsObjectListResultDeserializer( + item: any, +): _ResourceDetailsObjectListResult { + return { + value: resourceDetailsObjectArrayDeserializer(item["value"]), + nextLink: item["nextLink"], + }; +} + +export function resourceDetailsObjectArrayDeserializer( + result: Array, +): any[] { + return result.map((item) => { + return resourceDetailsObjectDeserializer(item); + }); +} + +/** A ResourceDetailsObject */ +export interface ResourceDetailsObject extends ProxyResource { + /** The resource-specific properties for this resource. */ + properties?: ResourceDetailsObjectProperties; +} + +export function resourceDetailsObjectDeserializer( + item: any, +): ResourceDetailsObject { + return { + id: item["id"], + name: item["name"], + type: item["type"], + systemData: !item["systemData"] + ? item["systemData"] + : systemDataDeserializer(item["systemData"]), + properties: !item["properties"] + ? item["properties"] + : resourceDetailsObjectPropertiesDeserializer(item["properties"]), + }; +} + +/** Details of the ResourceDetailsObject. */ +export interface ResourceDetailsObjectProperties { + /** The status of the resource. */ + status: ResourceStatus; + /** The image name of the resource. */ + image: string; + /** The version of the image running on the resource. */ + imageVersion: string; +} + +export function resourceDetailsObjectPropertiesDeserializer( + item: any, +): ResourceDetailsObjectProperties { + return { + status: item["status"], + image: item["image"], + imageVersion: item["imageVersion"], + }; +} + +/** The status of the machine resource. */ +export enum KnownResourceStatus { + /** Represents a machine resource that is ready. */ + Ready = "Ready", + /** Represents a machine resource that is not ready. */ + NotReady = "NotReady", + /** Represents a machine resource that is allocated. */ + Allocated = "Allocated", + /** Represents a machine resource that is pending return. */ + PendingReturn = "PendingReturn", + /** Represents a machine resource that is returned. */ + Returned = "Returned", + /** Represents a machine resource that is leased. */ + Leased = "Leased", + /** Represents a machine resource that is provisioning. */ + Provisioning = "Provisioning", + /** Represents a machine resource that is updating. */ + Updating = "Updating", + /** Represents a machine resource that is starting. */ + Starting = "Starting", + /** Represents a machine resource that is pending reimage. */ + PendingReimage = "PendingReimage", + /** Represents a machine resource that is reimaging. */ + Reimaging = "Reimaging", +} + +/** + * The status of the machine resource. \ + * {@link KnownResourceStatus} can be used interchangeably with ResourceStatus, + * this enum contains the known values that the service supports. + * ### Known values supported by the service + * **Ready**: Represents a machine resource that is ready. \ + * **NotReady**: Represents a machine resource that is not ready. \ + * **Allocated**: Represents a machine resource that is allocated. \ + * **PendingReturn**: Represents a machine resource that is pending return. \ + * **Returned**: Represents a machine resource that is returned. \ + * **Leased**: Represents a machine resource that is leased. \ + * **Provisioning**: Represents a machine resource that is provisioning. \ + * **Updating**: Represents a machine resource that is updating. \ + * **Starting**: Represents a machine resource that is starting. \ + * **PendingReimage**: Represents a machine resource that is pending reimage. \ + * **Reimaging**: Represents a machine resource that is reimaging. + */ +export type ResourceStatus = string; + +/** Concrete tracked resource types can be created by aliasing this type using a specific property type. */ +export interface Pool extends TrackedResource { + /** The resource-specific properties for this resource. */ + properties?: PoolProperties; + /** The managed service identities assigned to this resource. */ + identity?: ManagedServiceIdentity; +} + +export function poolSerializer(item: Pool): any { + return { + tags: item["tags"], + location: item["location"], + properties: !item["properties"] + ? item["properties"] + : poolPropertiesSerializer(item["properties"]), + identity: !item["identity"] + ? item["identity"] + : managedServiceIdentitySerializer(item["identity"]), + }; +} + +export function poolDeserializer(item: any): Pool { + return { + tags: item["tags"], + location: item["location"], + id: item["id"], + name: item["name"], + type: item["type"], + systemData: !item["systemData"] + ? item["systemData"] + : systemDataDeserializer(item["systemData"]), + properties: !item["properties"] + ? item["properties"] + : poolPropertiesDeserializer(item["properties"]), + identity: !item["identity"] + ? item["identity"] + : managedServiceIdentityDeserializer(item["identity"]), + }; +} + +/** Pool properties */ +export interface PoolProperties { + /** The status of the current operation. */ + provisioningState?: ProvisioningState; + /** Defines how many resources can there be created at any given time. */ + maximumConcurrency: number; + /** Defines the organization in which the pool will be used. */ + organizationProfile: OrganizationProfileUnion; + /** Defines how the machine will be handled once it executed a job. */ + agentProfile: AgentProfileUnion; + /** Defines the type of fabric the agent will run on. */ + fabricProfile: FabricProfileUnion; + /** The resource id of the DevCenter Project the pool belongs to. */ + devCenterProjectResourceId: string; +} + +export function poolPropertiesSerializer(item: PoolProperties): any { + return { + provisioningState: item["provisioningState"], + maximumConcurrency: item["maximumConcurrency"], + organizationProfile: organizationProfileUnionSerializer( + item["organizationProfile"], + ), + agentProfile: agentProfileUnionSerializer(item["agentProfile"]), + fabricProfile: fabricProfileUnionSerializer(item["fabricProfile"]), + devCenterProjectResourceId: item["devCenterProjectResourceId"], + }; +} + +export function poolPropertiesDeserializer(item: any): PoolProperties { + return { + provisioningState: item["provisioningState"], + maximumConcurrency: item["maximumConcurrency"], + organizationProfile: organizationProfileUnionDeserializer( + item["organizationProfile"], + ), + agentProfile: agentProfileUnionDeserializer(item["agentProfile"]), + fabricProfile: fabricProfileUnionDeserializer(item["fabricProfile"]), + devCenterProjectResourceId: item["devCenterProjectResourceId"], + }; +} + +/** The status of the current operation. */ +export enum KnownProvisioningState { + /** Represents a succeeded operation. */ + Succeeded = "Succeeded", + /** Represents a failed operation. */ + Failed = "Failed", + /** Represents a canceled operation. */ + Canceled = "Canceled", + /** Represents a pending operation. */ + Provisioning = "Provisioning", + /** Represents a pending operation. */ + Updating = "Updating", + /** Represents an operation under deletion. */ + Deleting = "Deleting", + /** Represents an accepted operation. */ + Accepted = "Accepted", +} + +/** + * The status of the current operation. \ + * {@link KnownProvisioningState} can be used interchangeably with ProvisioningState, + * this enum contains the known values that the service supports. + * ### Known values supported by the service + * **Succeeded**: Represents a succeeded operation. \ + * **Failed**: Represents a failed operation. \ + * **Canceled**: Represents a canceled operation. \ + * **Provisioning**: Represents a pending operation. \ + * **Updating**: Represents a pending operation. \ + * **Deleting**: Represents an operation under deletion. \ + * **Accepted**: Represents an accepted operation. + */ +export type ProvisioningState = string; + +/** Defines the organization in which the pool will be used. */ +export interface OrganizationProfile { + /** Discriminator property for OrganizationProfile. */ + /** The discriminator possible values: GitHub, AzureDevOps */ + kind: string; +} + +export function organizationProfileSerializer(item: OrganizationProfile): any { + return { kind: item["kind"] }; +} + +export function organizationProfileDeserializer( + item: any, +): OrganizationProfile { + return { + kind: item["kind"], + }; +} + +/** Alias for OrganizationProfileUnion */ +export type OrganizationProfileUnion = + | GitHubOrganizationProfile + | AzureDevOpsOrganizationProfile + | OrganizationProfile; + +export function organizationProfileUnionSerializer( + item: OrganizationProfileUnion, +): any { + switch (item.kind) { + case "GitHub": + return gitHubOrganizationProfileSerializer( + item as GitHubOrganizationProfile, + ); + + case "AzureDevOps": + return azureDevOpsOrganizationProfileSerializer( + item as AzureDevOpsOrganizationProfile, + ); + + default: + return organizationProfileSerializer(item); + } +} + +export function organizationProfileUnionDeserializer( + item: any, +): OrganizationProfileUnion { + switch (item.kind) { + case "GitHub": + return gitHubOrganizationProfileDeserializer( + item as GitHubOrganizationProfile, + ); + + case "AzureDevOps": + return azureDevOpsOrganizationProfileDeserializer( + item as AzureDevOpsOrganizationProfile, + ); + + default: + return organizationProfileDeserializer(item); + } +} + +/** GitHub organization profile */ +export interface GitHubOrganizationProfile extends OrganizationProfile { + /** GitHub organization profile */ + kind: "GitHub"; + /** The list of GitHub organizations/repositories the pool should be present in. */ + organizations: GitHubOrganization[]; +} + +export function gitHubOrganizationProfileSerializer( + item: GitHubOrganizationProfile, +): any { + return { + kind: item["kind"], + organizations: gitHubOrganizationArraySerializer(item["organizations"]), + }; +} + +export function gitHubOrganizationProfileDeserializer( + item: any, +): GitHubOrganizationProfile { + return { + kind: item["kind"], + organizations: gitHubOrganizationArrayDeserializer(item["organizations"]), + }; +} + +export function gitHubOrganizationArraySerializer( + result: Array, +): any[] { + return result.map((item) => { + return gitHubOrganizationSerializer(item); + }); +} + +export function gitHubOrganizationArrayDeserializer( + result: Array, +): any[] { + return result.map((item) => { + return gitHubOrganizationDeserializer(item); + }); +} + +/** Defines a GitHub organization */ +export interface GitHubOrganization { + /** The GitHub organization URL in which the pool should be created. */ + url: string; + /** Optional list of repositories in which the pool should be created. */ + repositories?: string[]; +} + +export function gitHubOrganizationSerializer(item: GitHubOrganization): any { + return { + url: item["url"], + repositories: !item["repositories"] + ? item["repositories"] + : item["repositories"].map((p: any) => { + return p; + }), + }; +} + +export function gitHubOrganizationDeserializer(item: any): GitHubOrganization { + return { + url: item["url"], + repositories: !item["repositories"] + ? item["repositories"] + : item["repositories"].map((p: any) => { + return p; + }), + }; +} + +/** Azure DevOps organization profile */ +export interface AzureDevOpsOrganizationProfile extends OrganizationProfile { + /** Azure DevOps organization profile */ + kind: "AzureDevOps"; + /** The list of Azure DevOps organizations the pool should be present in. */ + organizations: Organization[]; + /** The type of permission which determines which accounts are admins on the Azure DevOps pool. */ + permissionProfile?: AzureDevOpsPermissionProfile; +} + +export function azureDevOpsOrganizationProfileSerializer( + item: AzureDevOpsOrganizationProfile, +): any { + return { + kind: item["kind"], + organizations: organizationArraySerializer(item["organizations"]), + permissionProfile: !item["permissionProfile"] + ? item["permissionProfile"] + : azureDevOpsPermissionProfileSerializer(item["permissionProfile"]), + }; +} + +export function azureDevOpsOrganizationProfileDeserializer( + item: any, +): AzureDevOpsOrganizationProfile { + return { + kind: item["kind"], + organizations: organizationArrayDeserializer(item["organizations"]), + permissionProfile: !item["permissionProfile"] + ? item["permissionProfile"] + : azureDevOpsPermissionProfileDeserializer(item["permissionProfile"]), + }; +} + +export function organizationArraySerializer( + result: Array, +): any[] { + return result.map((item) => { + return organizationSerializer(item); + }); +} + +export function organizationArrayDeserializer( + result: Array, +): any[] { + return result.map((item) => { + return organizationDeserializer(item); + }); +} + +/** Defines an Azure DevOps organization. */ +export interface Organization { + /** The Azure DevOps organization URL in which the pool should be created. */ + url: string; + /** Optional list of projects in which the pool should be created. */ + projects?: string[]; + /** How many machines can be created at maximum in this organization out of the maximumConcurrency of the pool. */ + parallelism?: number; +} + +export function organizationSerializer(item: Organization): any { + return { + url: item["url"], + projects: !item["projects"] + ? item["projects"] + : item["projects"].map((p: any) => { + return p; + }), + parallelism: item["parallelism"], + }; +} + +export function organizationDeserializer(item: any): Organization { + return { + url: item["url"], + projects: !item["projects"] + ? item["projects"] + : item["projects"].map((p: any) => { + return p; + }), + parallelism: item["parallelism"], + }; +} + +/** Defines the type of Azure DevOps pool permission. */ +export interface AzureDevOpsPermissionProfile { + /** Determines who has admin permissions to the Azure DevOps pool. */ + kind: AzureDevOpsPermissionType; + /** User email addresses */ + users?: string[]; + /** Group email addresses */ + groups?: string[]; +} + +export function azureDevOpsPermissionProfileSerializer( + item: AzureDevOpsPermissionProfile, +): any { + return { + kind: item["kind"], + users: !item["users"] + ? item["users"] + : item["users"].map((p: any) => { + return p; + }), + groups: !item["groups"] + ? item["groups"] + : item["groups"].map((p: any) => { + return p; + }), + }; +} + +export function azureDevOpsPermissionProfileDeserializer( + item: any, +): AzureDevOpsPermissionProfile { + return { + kind: item["kind"], + users: !item["users"] + ? item["users"] + : item["users"].map((p: any) => { + return p; + }), + groups: !item["groups"] + ? item["groups"] + : item["groups"].map((p: any) => { + return p; + }), + }; +} + +/** Determines who has admin permissions to the Azure DevOps pool. */ +export enum KnownAzureDevOpsPermissionType { + /** Pool will inherit permissions from the project or organization. */ + Inherit = "Inherit", + /** Only the pool creator will be an admin of the pool. */ + CreatorOnly = "CreatorOnly", + /** Only the specified accounts will be admins of the pool. */ + SpecificAccounts = "SpecificAccounts", +} + +/** + * Determines who has admin permissions to the Azure DevOps pool. \ + * {@link KnownAzureDevOpsPermissionType} can be used interchangeably with AzureDevOpsPermissionType, + * this enum contains the known values that the service supports. + * ### Known values supported by the service + * **Inherit**: Pool will inherit permissions from the project or organization. \ + * **CreatorOnly**: Only the pool creator will be an admin of the pool. \ + * **SpecificAccounts**: Only the specified accounts will be admins of the pool. + */ +export type AzureDevOpsPermissionType = string; + +/** The agent profile of the machines in the pool. */ +export interface AgentProfile { + /** Discriminator property for AgentProfile. */ + /** The discriminator possible values: Stateless, Stateful */ + kind: string; + /** Defines pool buffer/stand-by agents. */ + resourcePredictions?: ResourcePredictions; + /** Defines how the pool buffer/stand-by agents is provided. */ + resourcePredictionsProfile?: ResourcePredictionsProfileUnion; +} + +export function agentProfileSerializer(item: AgentProfile): any { + return { + resourcePredictions: !item["resourcePredictions"] + ? item["resourcePredictions"] + : resourcePredictionsSerializer(item["resourcePredictions"]), + resourcePredictionsProfile: !item["resourcePredictionsProfile"] + ? item["resourcePredictionsProfile"] + : resourcePredictionsProfileUnionSerializer( + item["resourcePredictionsProfile"], + ), + kind: item["kind"], + }; +} + +export function agentProfileDeserializer(item: any): AgentProfile { + return { + resourcePredictions: !item["resourcePredictions"] + ? item["resourcePredictions"] + : resourcePredictionsDeserializer(item["resourcePredictions"]), + resourcePredictionsProfile: !item["resourcePredictionsProfile"] + ? item["resourcePredictionsProfile"] + : resourcePredictionsProfileUnionDeserializer( + item["resourcePredictionsProfile"], + ), + kind: item["kind"], + }; +} + +/** Alias for AgentProfileUnion */ +export type AgentProfileUnion = StatelessAgentProfile | Stateful | AgentProfile; + +export function agentProfileUnionSerializer(item: AgentProfileUnion): any { + switch (item.kind) { + case "Stateless": + return statelessAgentProfileSerializer(item as StatelessAgentProfile); + + case "Stateful": + return statefulSerializer(item as Stateful); + + default: + return agentProfileSerializer(item); + } +} + +export function agentProfileUnionDeserializer(item: any): AgentProfileUnion { + switch (item.kind) { + case "Stateless": + return statelessAgentProfileDeserializer(item as StatelessAgentProfile); + + case "Stateful": + return statefulDeserializer(item as Stateful); + + default: + return agentProfileDeserializer(item); + } +} + +/** Defines pool buffer. */ +export interface ResourcePredictions {} + +export function resourcePredictionsSerializer(item: ResourcePredictions): any { + return item; +} + +export function resourcePredictionsDeserializer( + item: any, +): ResourcePredictions { + return item; +} + +/** Determines how the stand-by scheme should be provided. */ +export interface ResourcePredictionsProfile { + /** Determines how the stand-by scheme should be provided. */ + /** The discriminator possible values: Manual, Automatic */ + kind: ResourcePredictionsProfileType; +} + +export function resourcePredictionsProfileSerializer( + item: ResourcePredictionsProfile, +): any { + return { kind: item["kind"] }; +} + +export function resourcePredictionsProfileDeserializer( + item: any, +): ResourcePredictionsProfile { + return { + kind: item["kind"], + }; +} + +/** Alias for ResourcePredictionsProfileUnion */ +export type ResourcePredictionsProfileUnion = + | ManualResourcePredictionsProfile + | AutomaticResourcePredictionsProfile + | ResourcePredictionsProfile; + +export function resourcePredictionsProfileUnionSerializer( + item: ResourcePredictionsProfileUnion, +): any { + switch (item.kind) { + case "Manual": + return manualResourcePredictionsProfileSerializer( + item as ManualResourcePredictionsProfile, + ); + + case "Automatic": + return automaticResourcePredictionsProfileSerializer( + item as AutomaticResourcePredictionsProfile, + ); + + default: + return resourcePredictionsProfileSerializer(item); + } +} + +export function resourcePredictionsProfileUnionDeserializer( + item: any, +): ResourcePredictionsProfileUnion { + switch (item.kind) { + case "Manual": + return manualResourcePredictionsProfileDeserializer( + item as ManualResourcePredictionsProfile, + ); + + case "Automatic": + return automaticResourcePredictionsProfileDeserializer( + item as AutomaticResourcePredictionsProfile, + ); + + default: + return resourcePredictionsProfileDeserializer(item); + } +} + +/** Determines how the stand-by scheme should be provided. */ +export enum KnownResourcePredictionsProfileType { + /** Customer provides the stand-by agent scheme. */ + Manual = "Manual", + /** The stand-by agent scheme is determined based on historical demand. */ + Automatic = "Automatic", +} + +/** + * Determines how the stand-by scheme should be provided. \ + * {@link KnownResourcePredictionsProfileType} can be used interchangeably with ResourcePredictionsProfileType, + * this enum contains the known values that the service supports. + * ### Known values supported by the service + * **Manual**: Customer provides the stand-by agent scheme. \ + * **Automatic**: The stand-by agent scheme is determined based on historical demand. + */ +export type ResourcePredictionsProfileType = string; + +/** Customer provides the stand-by agent scheme. */ +export interface ManualResourcePredictionsProfile + extends ResourcePredictionsProfile { + /** Customer provides the stand-by agent scheme. */ + kind: "Manual"; +} + +export function manualResourcePredictionsProfileSerializer( + item: ManualResourcePredictionsProfile, +): any { + return { kind: item["kind"] }; +} + +export function manualResourcePredictionsProfileDeserializer( + item: any, +): ManualResourcePredictionsProfile { + return { + kind: item["kind"], + }; +} + +/** The stand-by agent scheme is determined based on historical demand. */ +export interface AutomaticResourcePredictionsProfile + extends ResourcePredictionsProfile { + /** The stand-by agent scheme is determined based on historical demand. */ + kind: "Automatic"; + /** Determines the balance between cost and performance. */ + predictionPreference?: PredictionPreference; +} + +export function automaticResourcePredictionsProfileSerializer( + item: AutomaticResourcePredictionsProfile, +): any { + return { + kind: item["kind"], + predictionPreference: item["predictionPreference"], + }; +} + +export function automaticResourcePredictionsProfileDeserializer( + item: any, +): AutomaticResourcePredictionsProfile { + return { + kind: item["kind"], + predictionPreference: item["predictionPreference"], + }; +} + +/** Determines the balance between cost and performance. */ +export enum KnownPredictionPreference { + /** Balance between cost and performance. */ + Balanced = "Balanced", + /** Optimizes for cost over performance. */ + MostCostEffective = "MostCostEffective", + /** Halfway through cost and balanced. */ + MoreCostEffective = "MoreCostEffective", + /** Halfway through balanced and performance. */ + MorePerformance = "MorePerformance", + /** Optimizes for performance over cost. */ + BestPerformance = "BestPerformance", +} + +/** + * Determines the balance between cost and performance. \ + * {@link KnownPredictionPreference} can be used interchangeably with PredictionPreference, + * this enum contains the known values that the service supports. + * ### Known values supported by the service + * **Balanced**: Balance between cost and performance. \ + * **MostCostEffective**: Optimizes for cost over performance. \ + * **MoreCostEffective**: Halfway through cost and balanced. \ + * **MorePerformance**: Halfway through balanced and performance. \ + * **BestPerformance**: Optimizes for performance over cost. + */ +export type PredictionPreference = string; + +/** Stateless profile meaning that the machines will be cleaned up after running a job. */ +export interface StatelessAgentProfile extends AgentProfile { + /** Stateless profile meaning that the machines will be cleaned up after running a job. */ + kind: "Stateless"; +} + +export function statelessAgentProfileSerializer( + item: StatelessAgentProfile, +): any { + return { + resourcePredictions: !item["resourcePredictions"] + ? item["resourcePredictions"] + : resourcePredictionsSerializer(item["resourcePredictions"]), + resourcePredictionsProfile: !item["resourcePredictionsProfile"] + ? item["resourcePredictionsProfile"] + : resourcePredictionsProfileUnionSerializer( + item["resourcePredictionsProfile"], + ), + kind: item["kind"], + }; +} + +export function statelessAgentProfileDeserializer( + item: any, +): StatelessAgentProfile { + return { + resourcePredictions: !item["resourcePredictions"] + ? item["resourcePredictions"] + : resourcePredictionsDeserializer(item["resourcePredictions"]), + resourcePredictionsProfile: !item["resourcePredictionsProfile"] + ? item["resourcePredictionsProfile"] + : resourcePredictionsProfileUnionDeserializer( + item["resourcePredictionsProfile"], + ), + kind: item["kind"], + }; +} + +/** Stateful profile meaning that the machines will be returned to the pool after running a job. */ +export interface Stateful extends AgentProfile { + /** Stateful profile meaning that the machines will be returned to the pool after running a job. */ + kind: "Stateful"; + /** How long should stateful machines be kept around. The maximum is one week. */ + maxAgentLifetime?: string; + /** How long should the machine be kept around after it ran a workload when there are no stand-by agents. The maximum is one week. */ + gracePeriodTimeSpan?: string; +} + +export function statefulSerializer(item: Stateful): any { + return { + resourcePredictions: !item["resourcePredictions"] + ? item["resourcePredictions"] + : resourcePredictionsSerializer(item["resourcePredictions"]), + resourcePredictionsProfile: !item["resourcePredictionsProfile"] + ? item["resourcePredictionsProfile"] + : resourcePredictionsProfileUnionSerializer( + item["resourcePredictionsProfile"], + ), + kind: item["kind"], + maxAgentLifetime: item["maxAgentLifetime"], + gracePeriodTimeSpan: item["gracePeriodTimeSpan"], + }; +} + +export function statefulDeserializer(item: any): Stateful { + return { + resourcePredictions: !item["resourcePredictions"] + ? item["resourcePredictions"] + : resourcePredictionsDeserializer(item["resourcePredictions"]), + resourcePredictionsProfile: !item["resourcePredictionsProfile"] + ? item["resourcePredictionsProfile"] + : resourcePredictionsProfileUnionDeserializer( + item["resourcePredictionsProfile"], + ), + kind: item["kind"], + maxAgentLifetime: item["maxAgentLifetime"], + gracePeriodTimeSpan: item["gracePeriodTimeSpan"], + }; +} + +/** Defines the type of fabric the agent will run on. */ +export interface FabricProfile { + /** Discriminator property for FabricProfile. */ + /** The discriminator possible values: Vmss */ + kind: string; +} + +export function fabricProfileSerializer(item: FabricProfile): any { + return { kind: item["kind"] }; +} + +export function fabricProfileDeserializer(item: any): FabricProfile { + return { + kind: item["kind"], + }; +} + +/** Alias for FabricProfileUnion */ +export type FabricProfileUnion = VmssFabricProfile | FabricProfile; + +export function fabricProfileUnionSerializer(item: FabricProfileUnion): any { + switch (item.kind) { + case "Vmss": + return vmssFabricProfileSerializer(item as VmssFabricProfile); + + default: + return fabricProfileSerializer(item); + } +} + +export function fabricProfileUnionDeserializer(item: any): FabricProfileUnion { + switch (item.kind) { + case "Vmss": + return vmssFabricProfileDeserializer(item as VmssFabricProfile); + + default: + return fabricProfileDeserializer(item); + } +} + +/** The agents will run on Virtual Machine Scale Sets. */ +export interface VmssFabricProfile extends FabricProfile { + /** Virtual Machine Scale Sets */ + kind: "Vmss"; + /** The Azure SKU of the machines in the pool. */ + sku: DevOpsAzureSku; + /** The VM images of the machines in the pool. */ + images: PoolImage[]; + /** The OS profile of the machines in the pool. */ + osProfile?: OsProfile; + /** The storage profile of the machines in the pool. */ + storageProfile?: StorageProfile; + /** The network profile of the machines in the pool. */ + networkProfile?: NetworkProfile; +} + +export function vmssFabricProfileSerializer(item: VmssFabricProfile): any { + return { + kind: item["kind"], + sku: devOpsAzureSkuSerializer(item["sku"]), + images: poolImageArraySerializer(item["images"]), + osProfile: !item["osProfile"] + ? item["osProfile"] + : osProfileSerializer(item["osProfile"]), + storageProfile: !item["storageProfile"] + ? item["storageProfile"] + : storageProfileSerializer(item["storageProfile"]), + networkProfile: !item["networkProfile"] + ? item["networkProfile"] + : networkProfileSerializer(item["networkProfile"]), + }; +} + +export function vmssFabricProfileDeserializer(item: any): VmssFabricProfile { + return { + kind: item["kind"], + sku: devOpsAzureSkuDeserializer(item["sku"]), + images: poolImageArrayDeserializer(item["images"]), + osProfile: !item["osProfile"] + ? item["osProfile"] + : osProfileDeserializer(item["osProfile"]), + storageProfile: !item["storageProfile"] + ? item["storageProfile"] + : storageProfileDeserializer(item["storageProfile"]), + networkProfile: !item["networkProfile"] + ? item["networkProfile"] + : networkProfileDeserializer(item["networkProfile"]), + }; +} + +/** The Azure SKU of the machines in the pool. */ +export interface DevOpsAzureSku { + /** The Azure SKU name of the machines in the pool. */ + name: string; +} + +export function devOpsAzureSkuSerializer(item: DevOpsAzureSku): any { + return { name: item["name"] }; +} + +export function devOpsAzureSkuDeserializer(item: any): DevOpsAzureSku { + return { + name: item["name"], + }; +} + +export function poolImageArraySerializer(result: Array): any[] { + return result.map((item) => { + return poolImageSerializer(item); + }); +} + +export function poolImageArrayDeserializer(result: Array): any[] { + return result.map((item) => { + return poolImageDeserializer(item); + }); +} + +/** The VM image of the machines in the pool. */ +export interface PoolImage { + /** The resource id of the image. */ + resourceId?: string; + /** The image to use from a well-known set of images made available to customers. */ + wellKnownImageName?: string; + /** List of aliases to reference the image by. */ + aliases?: string[]; + /** The percentage of the buffer to be allocated to this image. */ + buffer?: string; +} + +export function poolImageSerializer(item: PoolImage): any { + return { + resourceId: item["resourceId"], + wellKnownImageName: item["wellKnownImageName"], + aliases: !item["aliases"] + ? item["aliases"] + : item["aliases"].map((p: any) => { + return p; + }), + buffer: item["buffer"], + }; +} + +export function poolImageDeserializer(item: any): PoolImage { + return { + resourceId: item["resourceId"], + wellKnownImageName: item["wellKnownImageName"], + aliases: !item["aliases"] + ? item["aliases"] + : item["aliases"].map((p: any) => { + return p; + }), + buffer: item["buffer"], + }; +} + +/** The OS profile of the machines in the pool. */ +export interface OsProfile { + /** The secret management settings of the machines in the pool. */ + secretsManagementSettings?: SecretsManagementSettings; + /** Determines how the service should be run. By default, this will be set to Service. */ + logonType?: LogonType; +} + +export function osProfileSerializer(item: OsProfile): any { + return { + secretsManagementSettings: !item["secretsManagementSettings"] + ? item["secretsManagementSettings"] + : secretsManagementSettingsSerializer(item["secretsManagementSettings"]), + logonType: item["logonType"], + }; +} + +export function osProfileDeserializer(item: any): OsProfile { + return { + secretsManagementSettings: !item["secretsManagementSettings"] + ? item["secretsManagementSettings"] + : secretsManagementSettingsDeserializer( + item["secretsManagementSettings"], + ), + logonType: item["logonType"], + }; +} + +/** The secret management settings of the machines in the pool. */ +export interface SecretsManagementSettings { + /** Where to store certificates on the machine. */ + certificateStoreLocation?: string; + /** The list of certificates to install on all machines in the pool. */ + observedCertificates: string[]; + /** Defines if the key of the certificates should be exportable. */ + keyExportable: boolean; +} + +export function secretsManagementSettingsSerializer( + item: SecretsManagementSettings, +): any { + return { + certificateStoreLocation: item["certificateStoreLocation"], + observedCertificates: item["observedCertificates"].map((p: any) => { + return p; + }), + keyExportable: item["keyExportable"], + }; +} + +export function secretsManagementSettingsDeserializer( + item: any, +): SecretsManagementSettings { + return { + certificateStoreLocation: item["certificateStoreLocation"], + observedCertificates: item["observedCertificates"].map((p: any) => { + return p; + }), + keyExportable: item["keyExportable"], + }; +} + +/** Determines how the service should be run. */ +export enum KnownLogonType { + /** Run as a service. */ + Service = "Service", + /** Run in interactive mode. */ + Interactive = "Interactive", +} + +/** + * Determines how the service should be run. \ + * {@link KnownLogonType} can be used interchangeably with LogonType, + * this enum contains the known values that the service supports. + * ### Known values supported by the service + * **Service**: Run as a service. \ + * **Interactive**: Run in interactive mode. + */ +export type LogonType = string; + +/** The storage profile of the VMSS. */ +export interface StorageProfile { + /** The Azure SKU name of the machines in the pool. */ + osDiskStorageAccountType?: OsDiskStorageAccountType; + /** A list of empty data disks to attach. */ + dataDisks?: DataDisk[]; +} + +export function storageProfileSerializer(item: StorageProfile): any { + return { + osDiskStorageAccountType: item["osDiskStorageAccountType"], + dataDisks: !item["dataDisks"] + ? item["dataDisks"] + : dataDiskArraySerializer(item["dataDisks"]), + }; +} + +export function storageProfileDeserializer(item: any): StorageProfile { + return { + osDiskStorageAccountType: item["osDiskStorageAccountType"], + dataDisks: !item["dataDisks"] + ? item["dataDisks"] + : dataDiskArrayDeserializer(item["dataDisks"]), + }; +} + +/** The storage account type of the OS disk. */ +export enum KnownOsDiskStorageAccountType { + /** Standard OS disk type. */ + Standard = "Standard", + /** Premium OS disk type. */ + Premium = "Premium", + /** Standard SSD OS disk type. */ + StandardSSD = "StandardSSD", +} + +/** + * The storage account type of the OS disk. \ + * {@link KnownOsDiskStorageAccountType} can be used interchangeably with OsDiskStorageAccountType, + * this enum contains the known values that the service supports. + * ### Known values supported by the service + * **Standard**: Standard OS disk type. \ + * **Premium**: Premium OS disk type. \ + * **StandardSSD**: Standard SSD OS disk type. + */ +export type OsDiskStorageAccountType = string; + +export function dataDiskArraySerializer(result: Array): any[] { + return result.map((item) => { + return dataDiskSerializer(item); + }); +} + +export function dataDiskArrayDeserializer(result: Array): any[] { + return result.map((item) => { + return dataDiskDeserializer(item); + }); +} + +/** The data disk of the VMSS. */ +export interface DataDisk { + /** The type of caching to be enabled for the data disks. The default value for caching is readwrite. For information about the caching options see: https://blogs.msdn.microsoft.com/windowsazurestorage/2012/06/27/exploring-windows-azure-drives-disks-and-images/. */ + caching?: CachingType; + /** The initial disk size in gigabytes. */ + diskSizeGiB?: number; + /** The storage Account type to be used for the data disk. If omitted, the default is "standard_lrs". */ + storageAccountType?: StorageAccountType; + /** The drive letter for the empty data disk. If not specified, it will be the first available letter. */ + driveLetter?: string; +} + +export function dataDiskSerializer(item: DataDisk): any { + return { + caching: item["caching"], + diskSizeGiB: item["diskSizeGiB"], + storageAccountType: item["storageAccountType"], + driveLetter: item["driveLetter"], + }; +} + +export function dataDiskDeserializer(item: any): DataDisk { + return { + caching: item["caching"], + diskSizeGiB: item["diskSizeGiB"], + storageAccountType: item["storageAccountType"], + driveLetter: item["driveLetter"], + }; +} + +/** The type of caching in a data disk. */ +export enum KnownCachingType { + /** Don't use host caching. */ + None = "None", + /** For workloads that only do read operations. */ + ReadOnly = "ReadOnly", + /** For workloads that do a balance of read and write operations. */ + ReadWrite = "ReadWrite", +} + +/** + * The type of caching in a data disk. \ + * {@link KnownCachingType} can be used interchangeably with CachingType, + * this enum contains the known values that the service supports. + * ### Known values supported by the service + * **None**: Don't use host caching. \ + * **ReadOnly**: For workloads that only do read operations. \ + * **ReadWrite**: For workloads that do a balance of read and write operations. + */ +export type CachingType = string; + +/** StorageAccountType enums */ +export enum KnownStorageAccountType { + /** The data disk should use standard locally redundant storage. */ + StandardLRS = "Standard_LRS", + /** The data disk should use premium locally redundant storage. */ + PremiumLRS = "Premium_LRS", + /** The data disk should use standard SSD locally redundant storage. */ + StandardSSDLRS = "StandardSSD_LRS", + /** The data disk should use premium SSD zonal redundant storage. */ + PremiumZRS = "Premium_ZRS", + /** The data disk should use standard SSD zonal redundant storage. */ + StandardSSDZRS = "StandardSSD_ZRS", +} + +/** + * StorageAccountType enums \ + * {@link KnownStorageAccountType} can be used interchangeably with StorageAccountType, + * this enum contains the known values that the service supports. + * ### Known values supported by the service + * **Standard_LRS**: The data disk should use standard locally redundant storage. \ + * **Premium_LRS**: The data disk should use premium locally redundant storage. \ + * **StandardSSD_LRS**: The data disk should use standard SSD locally redundant storage. \ + * **Premium_ZRS**: The data disk should use premium SSD zonal redundant storage. \ + * **StandardSSD_ZRS**: The data disk should use standard SSD zonal redundant storage. + */ +export type StorageAccountType = string; + +/** The network profile of the machines in the pool. */ +export interface NetworkProfile { + /** The subnet id on which to put all machines created in the pool. */ + subnetId: string; +} + +export function networkProfileSerializer(item: NetworkProfile): any { + return { subnetId: item["subnetId"] }; +} + +export function networkProfileDeserializer(item: any): NetworkProfile { + return { + subnetId: item["subnetId"], + }; +} + +/** 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. */ + readonly principalId?: string; + /** The tenant ID of the system assigned identity. This property will only be provided for a system assigned identity. */ + readonly tenantId?: string; + /** The type of managed identity assigned to this resource. */ + type: ManagedServiceIdentityType; + /** The identities assigned to this resource by the user. */ + userAssignedIdentities?: Record; +} + +export function managedServiceIdentitySerializer( + item: ManagedServiceIdentity, +): any { + return { + type: item["type"], + userAssignedIdentities: item["userAssignedIdentities"], + }; +} + +export function managedServiceIdentityDeserializer( + item: any, +): ManagedServiceIdentity { + return { + principalId: item["principalId"], + tenantId: item["tenantId"], + type: item["type"], + userAssignedIdentities: item["userAssignedIdentities"], + }; +} + +/** Type of managed service identity (where both SystemAssigned and UserAssigned types are allowed). */ +export enum KnownManagedServiceIdentityType { + /** No managed identity. */ + None = "None", + /** System assigned managed identity. */ + SystemAssigned = "SystemAssigned", + /** User assigned managed identity. */ + UserAssigned = "UserAssigned", + /** System and user assigned managed identity. */ + "SystemAssigned,UserAssigned" = "SystemAssigned,UserAssigned", +} + +/** + * Type of managed service identity (where both SystemAssigned and UserAssigned types are allowed). \ + * {@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**: No managed identity. \ + * **SystemAssigned**: System assigned managed identity. \ + * **UserAssigned**: User assigned managed identity. \ + * **SystemAssigned,UserAssigned**: System and user assigned managed identity. + */ +export type ManagedServiceIdentityType = string; + +/** User assigned identity properties */ +export interface UserAssignedIdentity { + /** The principal ID of the assigned identity. */ + readonly principalId?: string; + /** The client ID of the assigned identity. */ + readonly clientId?: string; +} + +export function userAssignedIdentitySerializer( + item: UserAssignedIdentity, +): any { + return item; +} + +export function userAssignedIdentityDeserializer( + item: any, +): UserAssignedIdentity { + return { + principalId: item["principalId"], + clientId: item["clientId"], + }; +} + +/** The resource model definition for an Azure Resource Manager tracked top level resource which has 'tags' and a 'location' */ +export interface TrackedResource extends Resource { + /** Resource tags. */ + tags?: Record; + /** The geo-location where the resource lives */ + location: string; +} + +export function trackedResourceSerializer(item: TrackedResource): any { + return { tags: item["tags"], location: item["location"] }; +} + +export function trackedResourceDeserializer(item: any): TrackedResource { + return { + id: item["id"], + name: item["name"], + type: item["type"], + systemData: !item["systemData"] + ? item["systemData"] + : systemDataDeserializer(item["systemData"]), + tags: item["tags"], + location: item["location"], + }; +} + +/** The type used for update operations of the Pool. */ +export interface PoolUpdate { + /** The managed service identities assigned to this resource. */ + identity?: ManagedServiceIdentity; + /** Resource tags. */ + tags?: Record; + /** The resource-specific properties for this resource. */ + properties?: PoolUpdateProperties; +} + +export function poolUpdateSerializer(item: PoolUpdate): any { + return { + identity: !item["identity"] + ? item["identity"] + : managedServiceIdentitySerializer(item["identity"]), + tags: item["tags"], + properties: !item["properties"] + ? item["properties"] + : poolUpdatePropertiesSerializer(item["properties"]), + }; +} + +/** The updatable properties of the Pool. */ +export interface PoolUpdateProperties { + /** The status of the current operation. */ + provisioningState?: ProvisioningState; + /** Defines how many resources can there be created at any given time. */ + maximumConcurrency?: number; + /** Defines the organization in which the pool will be used. */ + organizationProfile?: OrganizationProfileUnion; + /** Defines how the machine will be handled once it executed a job. */ + agentProfile?: AgentProfileUnion; + /** Defines the type of fabric the agent will run on. */ + fabricProfile?: FabricProfileUnion; + /** The resource id of the DevCenter Project the pool belongs to. */ + devCenterProjectResourceId?: string; +} + +export function poolUpdatePropertiesSerializer( + item: PoolUpdateProperties, +): any { + return { + provisioningState: item["provisioningState"], + maximumConcurrency: item["maximumConcurrency"], + organizationProfile: !item["organizationProfile"] + ? item["organizationProfile"] + : organizationProfileUnionSerializer(item["organizationProfile"]), + agentProfile: !item["agentProfile"] + ? item["agentProfile"] + : agentProfileUnionSerializer(item["agentProfile"]), + fabricProfile: !item["fabricProfile"] + ? item["fabricProfile"] + : fabricProfileUnionSerializer(item["fabricProfile"]), + devCenterProjectResourceId: item["devCenterProjectResourceId"], + }; +} + +/** The response of a Pool list operation. */ +export interface _PoolListResult { + /** The Pool items on this page */ + value: Pool[]; + /** The link to the next page of items */ + nextLink?: string; +} + +export function _poolListResultDeserializer(item: any): _PoolListResult { + return { + value: poolArrayDeserializer(item["value"]), + nextLink: item["nextLink"], + }; +} + +export function poolArraySerializer(result: Array): any[] { + return result.map((item) => { + return poolSerializer(item); + }); +} + +export function poolArrayDeserializer(result: Array): any[] { + return result.map((item) => { + return poolDeserializer(item); + }); +} + +/** The parameters used to check the availability of a resource. */ +export interface CheckNameAvailability { + /** The name of the resource. */ + name: string; + /** The type of resource that is used as the scope of the availability check. */ + type: DevOpsInfrastructureResourceType; +} + +export function checkNameAvailabilitySerializer( + item: CheckNameAvailability, +): any { + return { name: item["name"], type: item["type"] }; +} + +/** The type of resource. */ +export enum KnownDevOpsInfrastructureResourceType { + /** DevOpsInfrastructure pool resource. */ + "Microsoft.DevOpsInfrastructure/pools" = "Microsoft.DevOpsInfrastructure/pools", +} + +/** + * The type of resource. \ + * {@link KnownDevOpsInfrastructureResourceType} can be used interchangeably with DevOpsInfrastructureResourceType, + * this enum contains the known values that the service supports. + * ### Known values supported by the service + * **Microsoft.DevOpsInfrastructure\/pools**: DevOpsInfrastructure pool resource. + */ +export type DevOpsInfrastructureResourceType = string; + +/** The CheckNameAvailability operation response. */ +export interface CheckNameAvailabilityResult { + /** Availability status of the name. */ + available: AvailabilityStatus; + /** A message explaining why the name is unavailable. Will be null if the name is available. */ + message: string; + /** The name whose availability was checked. */ + name: string; + /** The reason code explaining why the name is unavailable. Will be null if the name is available. */ + reason: CheckNameAvailabilityReason; +} + +export function checkNameAvailabilityResultDeserializer( + item: any, +): CheckNameAvailabilityResult { + return { + available: item["available"], + message: item["message"], + name: item["name"], + reason: item["reason"], + }; +} + +/** AvailabilityStatus of a name. */ +export enum KnownAvailabilityStatus { + /** The name is available. */ + Available = "Available", + /** The name is unavailable */ + Unavailable = "Unavailable", +} + +/** + * AvailabilityStatus of a name. \ + * {@link KnownAvailabilityStatus} can be used interchangeably with AvailabilityStatus, + * this enum contains the known values that the service supports. + * ### Known values supported by the service + * **Available**: The name is available. \ + * **Unavailable**: The name is unavailable + */ +export type AvailabilityStatus = string; + +/** The reason code explaining why the name is unavailable. Will be null if the name is available. */ +export enum KnownCheckNameAvailabilityReason { + /** The name is invalid. */ + Invalid = "Invalid", + /** The name already exists. */ + AlreadyExists = "AlreadyExists", +} + +/** + * The reason code explaining why the name is unavailable. Will be null if the name is available. \ + * {@link KnownCheckNameAvailabilityReason} can be used interchangeably with CheckNameAvailabilityReason, + * this enum contains the known values that the service supports. + * ### Known values supported by the service + * **Invalid**: The name is invalid. \ + * **AlreadyExists**: The name already exists. + */ +export type CheckNameAvailabilityReason = string; + +/** 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 { + /** The Operation items on this page */ + value: Operation[]; + /** The link to the next page of items */ + nextLink?: string; +} + +export function _operationListResultDeserializer( + item: any, +): _OperationListResult { + return { + value: operationArrayDeserializer(item["value"]), + nextLink: item["nextLink"], + }; +} + +export function operationArrayDeserializer(result: Array): any[] { + return result.map((item) => { + return operationDeserializer(item); + }); +} + +/** 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" */ + readonly name?: string; + /** Whether the operation applies to data-plane. This is "true" for data-plane operations and "false" for Azure Resource Manager/control-plane operations. */ + readonly isDataAction?: boolean; + /** Localized display information for this particular operation. */ + readonly display?: OperationDisplay; + /** The intended executor of the operation; as in Resource Based Access Control (RBAC) and audit logs UX. Default value is "user,system" */ + readonly origin?: Origin; + /** Extensible enum. Indicates the action type. "Internal" refers to actions that are for internal only APIs. */ + actionType?: ActionType; +} + +export function operationDeserializer(item: any): Operation { + return { + name: item["name"], + isDataAction: item["isDataAction"], + display: !item["display"] + ? item["display"] + : operationDisplayDeserializer(item["display"]), + origin: item["origin"], + actionType: item["actionType"], + }; +} + +/** Localized display information for and operation. */ +export interface OperationDisplay { + /** The localized friendly form of the resource provider name, e.g. "Microsoft Monitoring Insights" or "Microsoft Compute". */ + readonly provider?: string; + /** The localized friendly name of the resource type related to this operation. E.g. "Virtual Machines" or "Job Schedule Collections". */ + readonly resource?: string; + /** The concise, localized friendly name for the operation; suitable for dropdowns. E.g. "Create or Update Virtual Machine", "Restart Virtual Machine". */ + readonly operation?: string; + /** The short, localized friendly description of the operation; suitable for tool tips and detailed views. */ + readonly description?: string; +} + +export function operationDisplayDeserializer(item: any): OperationDisplay { + return { + provider: item["provider"], + resource: item["resource"], + operation: item["operation"], + description: item["description"], + }; +} + +/** The intended executor of the operation; as in Resource Based Access Control (RBAC) and audit logs UX. Default value is "user,system" */ +export enum KnownOrigin { + /** Indicates the operation is initiated by a user. */ + user = "user", + /** Indicates the operation is initiated by a system. */ + system = "system", + /** Indicates the operation is initiated by a user or system. */ + "user,system" = "user,system", +} + +/** + * The intended executor of the operation; as in Resource Based Access Control (RBAC) and audit logs UX. Default value is "user,system" \ + * {@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**: Indicates the operation is initiated by a user. \ + * **system**: Indicates the operation is initiated by a system. \ + * **user,system**: Indicates the operation is initiated by a user or system. + */ +export type Origin = string; + +/** Extensible enum. Indicates the action type. "Internal" refers to actions that are for internal only APIs. */ +export enum KnownActionType { + /** Actions are for internal-only APIs. */ + Internal = "Internal", +} + +/** + * Extensible enum. Indicates the action type. "Internal" refers to actions that are for internal only APIs. \ + * {@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**: Actions are for internal-only APIs. + */ +export type ActionType = string; + +/** Api versions */ +export enum KnownVersions { + /** 2024-10-19 version */ + "2024-10-19" = "2024-10-19", +} diff --git a/sdk/devopsinfrastructure/arm-devopsinfrastructure/src/models/parameters.ts b/sdk/devopsinfrastructure/arm-devopsinfrastructure/src/models/parameters.ts deleted file mode 100644 index 66625c41fed9..000000000000 --- a/sdk/devopsinfrastructure/arm-devopsinfrastructure/src/models/parameters.ts +++ /dev/null @@ -1,155 +0,0 @@ -/* - * 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 { - Pool as PoolMapper, - PoolUpdate as PoolUpdateMapper, -} 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: "2024-04-04-preview", - isConstant: true, - serializedName: "api-version", - type: { - name: "String", - }, - }, -}; - -export const nextLink: OperationURLParameter = { - parameterPath: "nextLink", - mapper: { - serializedName: "nextLink", - required: true, - type: { - name: "String", - }, - }, - skipEncoding: true, -}; - -export const subscriptionId: OperationURLParameter = { - parameterPath: "subscriptionId", - mapper: { - serializedName: "subscriptionId", - required: true, - type: { - name: "Uuid", - }, - }, -}; - -export const locationName: OperationURLParameter = { - parameterPath: "locationName", - mapper: { - constraints: { - Pattern: new RegExp("^[a-zA-Z0-9][a-zA-Z0-9-.]*$"), - }, - serializedName: "locationName", - required: true, - type: { - name: "String", - }, - }, -}; - -export const resourceGroupName: OperationURLParameter = { - parameterPath: "resourceGroupName", - mapper: { - constraints: { - MaxLength: 90, - MinLength: 1, - }, - serializedName: "resourceGroupName", - required: true, - type: { - name: "String", - }, - }, -}; - -export const poolName: OperationURLParameter = { - parameterPath: "poolName", - mapper: { - constraints: { - Pattern: new RegExp("^[a-zA-Z0-9][a-zA-Z0-9-.]*$"), - }, - serializedName: "poolName", - 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 resource: OperationParameter = { - parameterPath: "resource", - mapper: PoolMapper, -}; - -export const properties: OperationParameter = { - parameterPath: "properties", - mapper: PoolUpdateMapper, -}; - -export const imageName: OperationURLParameter = { - parameterPath: "imageName", - mapper: { - constraints: { - Pattern: new RegExp("^[a-zA-Z0-9][a-zA-Z0-9-.]*$"), - }, - serializedName: "imageName", - required: true, - type: { - name: "String", - }, - }, -}; diff --git a/sdk/devopsinfrastructure/arm-devopsinfrastructure/src/operations/imageVersions.ts b/sdk/devopsinfrastructure/arm-devopsinfrastructure/src/operations/imageVersions.ts deleted file mode 100644 index 9e02da613642..000000000000 --- a/sdk/devopsinfrastructure/arm-devopsinfrastructure/src/operations/imageVersions.ts +++ /dev/null @@ -1,197 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -import { PagedAsyncIterableIterator, PageSettings } from "@azure/core-paging"; -import { setContinuationToken } from "../pagingHelper"; -import { ImageVersions } from "../operationsInterfaces"; -import * as coreClient from "@azure/core-client"; -import * as Mappers from "../models/mappers"; -import * as Parameters from "../models/parameters"; -import { ManagedDevOpsInfrastructure } from "../managedDevOpsInfrastructure"; -import { - ImageVersion, - ImageVersionsListByImageNextOptionalParams, - ImageVersionsListByImageOptionalParams, - ImageVersionsListByImageResponse, - ImageVersionsListByImageNextResponse, -} from "../models"; - -/// -/** Class containing ImageVersions operations. */ -export class ImageVersionsImpl implements ImageVersions { - private readonly client: ManagedDevOpsInfrastructure; - - /** - * Initialize a new instance of the class ImageVersions class. - * @param client Reference to the service client - */ - constructor(client: ManagedDevOpsInfrastructure) { - this.client = client; - } - - /** - * List ImageVersion resources by Image - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param imageName Name of the image. - * @param options The options parameters. - */ - public listByImage( - resourceGroupName: string, - imageName: string, - options?: ImageVersionsListByImageOptionalParams, - ): PagedAsyncIterableIterator { - const iter = this.listByImagePagingAll( - resourceGroupName, - imageName, - options, - ); - return { - next() { - return iter.next(); - }, - [Symbol.asyncIterator]() { - return this; - }, - byPage: (settings?: PageSettings) => { - if (settings?.maxPageSize) { - throw new Error("maxPageSize is not supported by this operation."); - } - return this.listByImagePagingPage( - resourceGroupName, - imageName, - options, - settings, - ); - }, - }; - } - - private async *listByImagePagingPage( - resourceGroupName: string, - imageName: string, - options?: ImageVersionsListByImageOptionalParams, - settings?: PageSettings, - ): AsyncIterableIterator { - let result: ImageVersionsListByImageResponse; - let continuationToken = settings?.continuationToken; - if (!continuationToken) { - result = await this._listByImage(resourceGroupName, imageName, options); - let page = result.value || []; - continuationToken = result.nextLink; - setContinuationToken(page, continuationToken); - yield page; - } - while (continuationToken) { - result = await this._listByImageNext( - resourceGroupName, - imageName, - continuationToken, - options, - ); - continuationToken = result.nextLink; - let page = result.value || []; - setContinuationToken(page, continuationToken); - yield page; - } - } - - private async *listByImagePagingAll( - resourceGroupName: string, - imageName: string, - options?: ImageVersionsListByImageOptionalParams, - ): AsyncIterableIterator { - for await (const page of this.listByImagePagingPage( - resourceGroupName, - imageName, - options, - )) { - yield* page; - } - } - - /** - * List ImageVersion resources by Image - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param imageName Name of the image. - * @param options The options parameters. - */ - private _listByImage( - resourceGroupName: string, - imageName: string, - options?: ImageVersionsListByImageOptionalParams, - ): Promise { - return this.client.sendOperationRequest( - { resourceGroupName, imageName, options }, - listByImageOperationSpec, - ); - } - - /** - * ListByImageNext - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param imageName 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, - imageName: string, - nextLink: string, - options?: ImageVersionsListByImageNextOptionalParams, - ): Promise { - return this.client.sendOperationRequest( - { resourceGroupName, imageName, nextLink, options }, - listByImageNextOperationSpec, - ); - } -} -// Operation Specifications -const serializer = coreClient.createSerializer(Mappers, /* isXml */ false); - -const listByImageOperationSpec: coreClient.OperationSpec = { - path: "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DevOpsInfrastructure/images/{imageName}/versions", - httpMethod: "GET", - responses: { - 200: { - bodyMapper: Mappers.ImageVersionListResult, - }, - default: { - bodyMapper: Mappers.ErrorResponse, - }, - }, - queryParameters: [Parameters.apiVersion], - urlParameters: [ - Parameters.$host, - Parameters.subscriptionId, - Parameters.resourceGroupName, - Parameters.imageName, - ], - headerParameters: [Parameters.accept], - serializer, -}; -const listByImageNextOperationSpec: coreClient.OperationSpec = { - path: "{nextLink}", - httpMethod: "GET", - responses: { - 200: { - bodyMapper: Mappers.ImageVersionListResult, - }, - default: { - bodyMapper: Mappers.ErrorResponse, - }, - }, - urlParameters: [ - Parameters.$host, - Parameters.nextLink, - Parameters.subscriptionId, - Parameters.resourceGroupName, - Parameters.imageName, - ], - headerParameters: [Parameters.accept], - serializer, -}; diff --git a/sdk/devopsinfrastructure/arm-devopsinfrastructure/src/operations/index.ts b/sdk/devopsinfrastructure/arm-devopsinfrastructure/src/operations/index.ts deleted file mode 100644 index ad3bc37a2b93..000000000000 --- a/sdk/devopsinfrastructure/arm-devopsinfrastructure/src/operations/index.ts +++ /dev/null @@ -1,14 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -export * from "./operations"; -export * from "./sku"; -export * from "./subscriptionUsages"; -export * from "./pools"; -export * from "./imageVersions"; -export * from "./resourceDetails"; diff --git a/sdk/devopsinfrastructure/arm-devopsinfrastructure/src/operations/operations.ts b/sdk/devopsinfrastructure/arm-devopsinfrastructure/src/operations/operations.ts deleted file mode 100644 index ac361b93f435..000000000000 --- a/sdk/devopsinfrastructure/arm-devopsinfrastructure/src/operations/operations.ts +++ /dev/null @@ -1,149 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -import { PagedAsyncIterableIterator, PageSettings } from "@azure/core-paging"; -import { setContinuationToken } from "../pagingHelper"; -import { Operations } from "../operationsInterfaces"; -import * as coreClient from "@azure/core-client"; -import * as Mappers from "../models/mappers"; -import * as Parameters from "../models/parameters"; -import { ManagedDevOpsInfrastructure } from "../managedDevOpsInfrastructure"; -import { - Operation, - OperationsListNextOptionalParams, - OperationsListOptionalParams, - OperationsListResponse, - OperationsListNextResponse, -} from "../models"; - -/// -/** Class containing Operations operations. */ -export class OperationsImpl implements Operations { - private readonly client: ManagedDevOpsInfrastructure; - - /** - * Initialize a new instance of the class Operations class. - * @param client Reference to the service client - */ - constructor(client: ManagedDevOpsInfrastructure) { - this.client = client; - } - - /** - * List the operations for the provider - * @param options The options parameters. - */ - public list( - options?: OperationsListOptionalParams, - ): PagedAsyncIterableIterator { - const iter = this.listPagingAll(options); - return { - next() { - return iter.next(); - }, - [Symbol.asyncIterator]() { - return this; - }, - byPage: (settings?: PageSettings) => { - if (settings?.maxPageSize) { - throw new Error("maxPageSize is not supported by this operation."); - } - return this.listPagingPage(options, settings); - }, - }; - } - - private async *listPagingPage( - options?: OperationsListOptionalParams, - settings?: PageSettings, - ): AsyncIterableIterator { - let result: OperationsListResponse; - let continuationToken = settings?.continuationToken; - if (!continuationToken) { - result = await this._list(options); - let page = result.value || []; - continuationToken = result.nextLink; - setContinuationToken(page, continuationToken); - yield page; - } - while (continuationToken) { - result = await this._listNext(continuationToken, options); - continuationToken = result.nextLink; - let page = result.value || []; - setContinuationToken(page, continuationToken); - yield page; - } - } - - private async *listPagingAll( - options?: OperationsListOptionalParams, - ): AsyncIterableIterator { - for await (const page of this.listPagingPage(options)) { - yield* page; - } - } - - /** - * List the operations for the provider - * @param options The options parameters. - */ - private _list( - options?: OperationsListOptionalParams, - ): Promise { - return this.client.sendOperationRequest({ options }, listOperationSpec); - } - - /** - * ListNext - * @param nextLink The nextLink from the previous successful call to the List method. - * @param options The options parameters. - */ - private _listNext( - nextLink: string, - options?: OperationsListNextOptionalParams, - ): Promise { - return this.client.sendOperationRequest( - { nextLink, options }, - listNextOperationSpec, - ); - } -} -// Operation Specifications -const serializer = coreClient.createSerializer(Mappers, /* isXml */ false); - -const listOperationSpec: coreClient.OperationSpec = { - path: "/providers/Microsoft.DevOpsInfrastructure/operations", - httpMethod: "GET", - responses: { - 200: { - bodyMapper: Mappers.OperationListResult, - }, - default: { - bodyMapper: Mappers.ErrorResponse, - }, - }, - queryParameters: [Parameters.apiVersion], - urlParameters: [Parameters.$host], - headerParameters: [Parameters.accept], - serializer, -}; -const listNextOperationSpec: coreClient.OperationSpec = { - path: "{nextLink}", - httpMethod: "GET", - responses: { - 200: { - bodyMapper: Mappers.OperationListResult, - }, - default: { - bodyMapper: Mappers.ErrorResponse, - }, - }, - urlParameters: [Parameters.$host, Parameters.nextLink], - headerParameters: [Parameters.accept], - serializer, -}; diff --git a/sdk/devopsinfrastructure/arm-devopsinfrastructure/src/operations/pools.ts b/sdk/devopsinfrastructure/arm-devopsinfrastructure/src/operations/pools.ts deleted file mode 100644 index c2b81ed067f0..000000000000 --- a/sdk/devopsinfrastructure/arm-devopsinfrastructure/src/operations/pools.ts +++ /dev/null @@ -1,718 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -import { PagedAsyncIterableIterator, PageSettings } from "@azure/core-paging"; -import { setContinuationToken } from "../pagingHelper"; -import { Pools } from "../operationsInterfaces"; -import * as coreClient from "@azure/core-client"; -import * as Mappers from "../models/mappers"; -import * as Parameters from "../models/parameters"; -import { ManagedDevOpsInfrastructure } from "../managedDevOpsInfrastructure"; -import { - SimplePollerLike, - OperationState, - createHttpPoller, -} from "@azure/core-lro"; -import { createLroSpec } from "../lroImpl"; -import { - Pool, - PoolsListBySubscriptionNextOptionalParams, - PoolsListBySubscriptionOptionalParams, - PoolsListBySubscriptionResponse, - PoolsListByResourceGroupNextOptionalParams, - PoolsListByResourceGroupOptionalParams, - PoolsListByResourceGroupResponse, - PoolsGetOptionalParams, - PoolsGetResponse, - PoolsCreateOrUpdateOptionalParams, - PoolsCreateOrUpdateResponse, - PoolUpdate, - PoolsUpdateOptionalParams, - PoolsUpdateResponse, - PoolsDeleteOptionalParams, - PoolsDeleteResponse, - PoolsListBySubscriptionNextResponse, - PoolsListByResourceGroupNextResponse, -} from "../models"; - -/// -/** Class containing Pools operations. */ -export class PoolsImpl implements Pools { - private readonly client: ManagedDevOpsInfrastructure; - - /** - * Initialize a new instance of the class Pools class. - * @param client Reference to the service client - */ - constructor(client: ManagedDevOpsInfrastructure) { - this.client = client; - } - - /** - * List Pool resources by subscription ID - * @param options The options parameters. - */ - public listBySubscription( - options?: PoolsListBySubscriptionOptionalParams, - ): PagedAsyncIterableIterator { - const iter = this.listBySubscriptionPagingAll(options); - return { - next() { - return iter.next(); - }, - [Symbol.asyncIterator]() { - return this; - }, - byPage: (settings?: PageSettings) => { - if (settings?.maxPageSize) { - throw new Error("maxPageSize is not supported by this operation."); - } - return this.listBySubscriptionPagingPage(options, settings); - }, - }; - } - - private async *listBySubscriptionPagingPage( - options?: PoolsListBySubscriptionOptionalParams, - settings?: PageSettings, - ): AsyncIterableIterator { - let result: PoolsListBySubscriptionResponse; - let continuationToken = settings?.continuationToken; - if (!continuationToken) { - result = await this._listBySubscription(options); - let page = result.value || []; - continuationToken = result.nextLink; - setContinuationToken(page, continuationToken); - yield page; - } - while (continuationToken) { - result = await this._listBySubscriptionNext(continuationToken, options); - continuationToken = result.nextLink; - let page = result.value || []; - setContinuationToken(page, continuationToken); - yield page; - } - } - - private async *listBySubscriptionPagingAll( - options?: PoolsListBySubscriptionOptionalParams, - ): AsyncIterableIterator { - for await (const page of this.listBySubscriptionPagingPage(options)) { - yield* page; - } - } - - /** - * List Pool resources by resource group - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param options The options parameters. - */ - public listByResourceGroup( - resourceGroupName: string, - options?: PoolsListByResourceGroupOptionalParams, - ): PagedAsyncIterableIterator { - const iter = this.listByResourceGroupPagingAll(resourceGroupName, options); - return { - next() { - return iter.next(); - }, - [Symbol.asyncIterator]() { - return this; - }, - byPage: (settings?: PageSettings) => { - if (settings?.maxPageSize) { - throw new Error("maxPageSize is not supported by this operation."); - } - return this.listByResourceGroupPagingPage( - resourceGroupName, - options, - settings, - ); - }, - }; - } - - private async *listByResourceGroupPagingPage( - resourceGroupName: string, - options?: PoolsListByResourceGroupOptionalParams, - settings?: PageSettings, - ): AsyncIterableIterator { - let result: PoolsListByResourceGroupResponse; - let continuationToken = settings?.continuationToken; - if (!continuationToken) { - result = await this._listByResourceGroup(resourceGroupName, options); - let page = result.value || []; - continuationToken = result.nextLink; - setContinuationToken(page, continuationToken); - yield page; - } - while (continuationToken) { - result = await this._listByResourceGroupNext( - resourceGroupName, - continuationToken, - options, - ); - continuationToken = result.nextLink; - let page = result.value || []; - setContinuationToken(page, continuationToken); - yield page; - } - } - - private async *listByResourceGroupPagingAll( - resourceGroupName: string, - options?: PoolsListByResourceGroupOptionalParams, - ): AsyncIterableIterator { - for await (const page of this.listByResourceGroupPagingPage( - resourceGroupName, - options, - )) { - yield* page; - } - } - - /** - * List Pool resources by subscription ID - * @param options The options parameters. - */ - private _listBySubscription( - options?: PoolsListBySubscriptionOptionalParams, - ): Promise { - return this.client.sendOperationRequest( - { options }, - listBySubscriptionOperationSpec, - ); - } - - /** - * List Pool resources by resource group - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param options The options parameters. - */ - private _listByResourceGroup( - resourceGroupName: string, - options?: PoolsListByResourceGroupOptionalParams, - ): Promise { - return this.client.sendOperationRequest( - { resourceGroupName, options }, - listByResourceGroupOperationSpec, - ); - } - - /** - * Get a Pool - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param poolName Name of the pool. It needs to be globally unique. - * @param options The options parameters. - */ - get( - resourceGroupName: string, - poolName: string, - options?: PoolsGetOptionalParams, - ): Promise { - return this.client.sendOperationRequest( - { resourceGroupName, poolName, options }, - getOperationSpec, - ); - } - - /** - * Create a Pool - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param poolName Name of the pool. It needs to be globally unique. - * @param resource Resource create parameters. - * @param options The options parameters. - */ - async beginCreateOrUpdate( - resourceGroupName: string, - poolName: string, - resource: Pool, - options?: PoolsCreateOrUpdateOptionalParams, - ): Promise< - SimplePollerLike< - OperationState, - PoolsCreateOrUpdateResponse - > - > { - const directSendOperation = async ( - args: coreClient.OperationArguments, - spec: coreClient.OperationSpec, - ): Promise => { - return this.client.sendOperationRequest(args, spec); - }; - const sendOperationFn = async ( - args: coreClient.OperationArguments, - spec: coreClient.OperationSpec, - ) => { - let currentRawResponse: coreClient.FullOperationResponse | undefined = - undefined; - const providedCallback = args.options?.onResponse; - const callback: coreClient.RawResponseCallback = ( - rawResponse: coreClient.FullOperationResponse, - flatResponse: unknown, - ) => { - currentRawResponse = rawResponse; - providedCallback?.(rawResponse, flatResponse); - }; - const updatedArgs = { - ...args, - options: { - ...args.options, - onResponse: callback, - }, - }; - const flatResponse = await directSendOperation(updatedArgs, spec); - return { - flatResponse, - rawResponse: { - statusCode: currentRawResponse!.status, - body: currentRawResponse!.parsedBody, - headers: currentRawResponse!.headers.toJSON(), - }, - }; - }; - - const lro = createLroSpec({ - sendOperationFn, - args: { resourceGroupName, poolName, resource, options }, - spec: createOrUpdateOperationSpec, - }); - const poller = await createHttpPoller< - PoolsCreateOrUpdateResponse, - OperationState - >(lro, { - restoreFrom: options?.resumeFrom, - intervalInMs: options?.updateIntervalInMs, - resourceLocationConfig: "azure-async-operation", - }); - await poller.poll(); - return poller; - } - - /** - * Create a Pool - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param poolName Name of the pool. It needs to be globally unique. - * @param resource Resource create parameters. - * @param options The options parameters. - */ - async beginCreateOrUpdateAndWait( - resourceGroupName: string, - poolName: string, - resource: Pool, - options?: PoolsCreateOrUpdateOptionalParams, - ): Promise { - const poller = await this.beginCreateOrUpdate( - resourceGroupName, - poolName, - resource, - options, - ); - return poller.pollUntilDone(); - } - - /** - * Update a Pool - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param poolName Name of the pool. It needs to be globally unique. - * @param properties The resource properties to be updated. - * @param options The options parameters. - */ - async beginUpdate( - resourceGroupName: string, - poolName: string, - properties: PoolUpdate, - options?: PoolsUpdateOptionalParams, - ): Promise< - SimplePollerLike, PoolsUpdateResponse> - > { - const directSendOperation = async ( - args: coreClient.OperationArguments, - spec: coreClient.OperationSpec, - ): Promise => { - return this.client.sendOperationRequest(args, spec); - }; - const sendOperationFn = async ( - args: coreClient.OperationArguments, - spec: coreClient.OperationSpec, - ) => { - let currentRawResponse: coreClient.FullOperationResponse | undefined = - undefined; - const providedCallback = args.options?.onResponse; - const callback: coreClient.RawResponseCallback = ( - rawResponse: coreClient.FullOperationResponse, - flatResponse: unknown, - ) => { - currentRawResponse = rawResponse; - providedCallback?.(rawResponse, flatResponse); - }; - const updatedArgs = { - ...args, - options: { - ...args.options, - onResponse: callback, - }, - }; - const flatResponse = await directSendOperation(updatedArgs, spec); - return { - flatResponse, - rawResponse: { - statusCode: currentRawResponse!.status, - body: currentRawResponse!.parsedBody, - headers: currentRawResponse!.headers.toJSON(), - }, - }; - }; - - const lro = createLroSpec({ - sendOperationFn, - args: { resourceGroupName, poolName, properties, options }, - spec: updateOperationSpec, - }); - const poller = await createHttpPoller< - PoolsUpdateResponse, - OperationState - >(lro, { - restoreFrom: options?.resumeFrom, - intervalInMs: options?.updateIntervalInMs, - resourceLocationConfig: "location", - }); - await poller.poll(); - return poller; - } - - /** - * Update a Pool - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param poolName Name of the pool. It needs to be globally unique. - * @param properties The resource properties to be updated. - * @param options The options parameters. - */ - async beginUpdateAndWait( - resourceGroupName: string, - poolName: string, - properties: PoolUpdate, - options?: PoolsUpdateOptionalParams, - ): Promise { - const poller = await this.beginUpdate( - resourceGroupName, - poolName, - properties, - options, - ); - return poller.pollUntilDone(); - } - - /** - * Delete a Pool - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param poolName Name of the pool. It needs to be globally unique. - * @param options The options parameters. - */ - async beginDelete( - resourceGroupName: string, - poolName: string, - options?: PoolsDeleteOptionalParams, - ): Promise< - SimplePollerLike, PoolsDeleteResponse> - > { - const directSendOperation = async ( - args: coreClient.OperationArguments, - spec: coreClient.OperationSpec, - ): Promise => { - return this.client.sendOperationRequest(args, spec); - }; - const sendOperationFn = async ( - args: coreClient.OperationArguments, - spec: coreClient.OperationSpec, - ) => { - let currentRawResponse: coreClient.FullOperationResponse | undefined = - undefined; - const providedCallback = args.options?.onResponse; - const callback: coreClient.RawResponseCallback = ( - rawResponse: coreClient.FullOperationResponse, - flatResponse: unknown, - ) => { - currentRawResponse = rawResponse; - providedCallback?.(rawResponse, flatResponse); - }; - const updatedArgs = { - ...args, - options: { - ...args.options, - onResponse: callback, - }, - }; - const flatResponse = await directSendOperation(updatedArgs, spec); - return { - flatResponse, - rawResponse: { - statusCode: currentRawResponse!.status, - body: currentRawResponse!.parsedBody, - headers: currentRawResponse!.headers.toJSON(), - }, - }; - }; - - const lro = createLroSpec({ - sendOperationFn, - args: { resourceGroupName, poolName, options }, - spec: deleteOperationSpec, - }); - const poller = await createHttpPoller< - PoolsDeleteResponse, - OperationState - >(lro, { - restoreFrom: options?.resumeFrom, - intervalInMs: options?.updateIntervalInMs, - resourceLocationConfig: "location", - }); - await poller.poll(); - return poller; - } - - /** - * Delete a Pool - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param poolName Name of the pool. It needs to be globally unique. - * @param options The options parameters. - */ - async beginDeleteAndWait( - resourceGroupName: string, - poolName: string, - options?: PoolsDeleteOptionalParams, - ): Promise { - const poller = await this.beginDelete(resourceGroupName, poolName, 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?: PoolsListBySubscriptionNextOptionalParams, - ): Promise { - return this.client.sendOperationRequest( - { nextLink, options }, - listBySubscriptionNextOperationSpec, - ); - } - - /** - * ListByResourceGroupNext - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @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?: PoolsListByResourceGroupNextOptionalParams, - ): 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.DevOpsInfrastructure/pools", - httpMethod: "GET", - responses: { - 200: { - bodyMapper: Mappers.PoolListResult, - }, - default: { - bodyMapper: Mappers.ErrorResponse, - }, - }, - queryParameters: [Parameters.apiVersion], - urlParameters: [Parameters.$host, Parameters.subscriptionId], - headerParameters: [Parameters.accept], - serializer, -}; -const listByResourceGroupOperationSpec: coreClient.OperationSpec = { - path: "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DevOpsInfrastructure/pools", - httpMethod: "GET", - responses: { - 200: { - bodyMapper: Mappers.PoolListResult, - }, - default: { - bodyMapper: Mappers.ErrorResponse, - }, - }, - queryParameters: [Parameters.apiVersion], - urlParameters: [ - Parameters.$host, - Parameters.subscriptionId, - Parameters.resourceGroupName, - ], - headerParameters: [Parameters.accept], - serializer, -}; -const getOperationSpec: coreClient.OperationSpec = { - path: "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DevOpsInfrastructure/pools/{poolName}", - httpMethod: "GET", - responses: { - 200: { - bodyMapper: Mappers.Pool, - }, - default: { - bodyMapper: Mappers.ErrorResponse, - }, - }, - queryParameters: [Parameters.apiVersion], - urlParameters: [ - Parameters.$host, - Parameters.subscriptionId, - Parameters.resourceGroupName, - Parameters.poolName, - ], - headerParameters: [Parameters.accept], - serializer, -}; -const createOrUpdateOperationSpec: coreClient.OperationSpec = { - path: "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DevOpsInfrastructure/pools/{poolName}", - httpMethod: "PUT", - responses: { - 200: { - bodyMapper: Mappers.Pool, - }, - 201: { - bodyMapper: Mappers.Pool, - }, - 202: { - bodyMapper: Mappers.Pool, - }, - 204: { - bodyMapper: Mappers.Pool, - }, - default: { - bodyMapper: Mappers.ErrorResponse, - }, - }, - requestBody: Parameters.resource, - queryParameters: [Parameters.apiVersion], - urlParameters: [ - Parameters.$host, - Parameters.subscriptionId, - Parameters.resourceGroupName, - Parameters.poolName, - ], - headerParameters: [Parameters.accept, Parameters.contentType], - mediaType: "json", - serializer, -}; -const updateOperationSpec: coreClient.OperationSpec = { - path: "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DevOpsInfrastructure/pools/{poolName}", - httpMethod: "PATCH", - responses: { - 200: { - bodyMapper: Mappers.Pool, - }, - 201: { - bodyMapper: Mappers.Pool, - }, - 202: { - bodyMapper: Mappers.Pool, - }, - 204: { - bodyMapper: Mappers.Pool, - }, - default: { - bodyMapper: Mappers.ErrorResponse, - }, - }, - requestBody: Parameters.properties, - queryParameters: [Parameters.apiVersion], - urlParameters: [ - Parameters.$host, - Parameters.subscriptionId, - Parameters.resourceGroupName, - Parameters.poolName, - ], - headerParameters: [Parameters.accept, Parameters.contentType], - mediaType: "json", - serializer, -}; -const deleteOperationSpec: coreClient.OperationSpec = { - path: "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DevOpsInfrastructure/pools/{poolName}", - httpMethod: "DELETE", - responses: { - 200: { - headersMapper: Mappers.PoolsDeleteHeaders, - }, - 201: { - headersMapper: Mappers.PoolsDeleteHeaders, - }, - 202: { - headersMapper: Mappers.PoolsDeleteHeaders, - }, - 204: { - headersMapper: Mappers.PoolsDeleteHeaders, - }, - default: { - bodyMapper: Mappers.ErrorResponse, - }, - }, - queryParameters: [Parameters.apiVersion], - urlParameters: [ - Parameters.$host, - Parameters.subscriptionId, - Parameters.resourceGroupName, - Parameters.poolName, - ], - headerParameters: [Parameters.accept], - serializer, -}; -const listBySubscriptionNextOperationSpec: coreClient.OperationSpec = { - path: "{nextLink}", - httpMethod: "GET", - responses: { - 200: { - bodyMapper: Mappers.PoolListResult, - }, - default: { - bodyMapper: Mappers.ErrorResponse, - }, - }, - urlParameters: [ - Parameters.$host, - Parameters.nextLink, - Parameters.subscriptionId, - ], - headerParameters: [Parameters.accept], - serializer, -}; -const listByResourceGroupNextOperationSpec: coreClient.OperationSpec = { - path: "{nextLink}", - httpMethod: "GET", - responses: { - 200: { - bodyMapper: Mappers.PoolListResult, - }, - default: { - bodyMapper: Mappers.ErrorResponse, - }, - }, - urlParameters: [ - Parameters.$host, - Parameters.nextLink, - Parameters.subscriptionId, - Parameters.resourceGroupName, - ], - headerParameters: [Parameters.accept], - serializer, -}; diff --git a/sdk/devopsinfrastructure/arm-devopsinfrastructure/src/operations/resourceDetails.ts b/sdk/devopsinfrastructure/arm-devopsinfrastructure/src/operations/resourceDetails.ts deleted file mode 100644 index 802ec1a58617..000000000000 --- a/sdk/devopsinfrastructure/arm-devopsinfrastructure/src/operations/resourceDetails.ts +++ /dev/null @@ -1,193 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -import { PagedAsyncIterableIterator, PageSettings } from "@azure/core-paging"; -import { setContinuationToken } from "../pagingHelper"; -import { ResourceDetails } from "../operationsInterfaces"; -import * as coreClient from "@azure/core-client"; -import * as Mappers from "../models/mappers"; -import * as Parameters from "../models/parameters"; -import { ManagedDevOpsInfrastructure } from "../managedDevOpsInfrastructure"; -import { - ResourceDetailsObject, - ResourceDetailsListByPoolNextOptionalParams, - ResourceDetailsListByPoolOptionalParams, - ResourceDetailsListByPoolResponse, - ResourceDetailsListByPoolNextResponse, -} from "../models"; - -/// -/** Class containing ResourceDetails operations. */ -export class ResourceDetailsImpl implements ResourceDetails { - private readonly client: ManagedDevOpsInfrastructure; - - /** - * Initialize a new instance of the class ResourceDetails class. - * @param client Reference to the service client - */ - constructor(client: ManagedDevOpsInfrastructure) { - this.client = client; - } - - /** - * List ResourceDetailsObject resources by Pool - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param poolName Name of the pool. It needs to be globally unique. - * @param options The options parameters. - */ - public listByPool( - resourceGroupName: string, - poolName: string, - options?: ResourceDetailsListByPoolOptionalParams, - ): PagedAsyncIterableIterator { - const iter = this.listByPoolPagingAll(resourceGroupName, poolName, options); - return { - next() { - return iter.next(); - }, - [Symbol.asyncIterator]() { - return this; - }, - byPage: (settings?: PageSettings) => { - if (settings?.maxPageSize) { - throw new Error("maxPageSize is not supported by this operation."); - } - return this.listByPoolPagingPage( - resourceGroupName, - poolName, - options, - settings, - ); - }, - }; - } - - private async *listByPoolPagingPage( - resourceGroupName: string, - poolName: string, - options?: ResourceDetailsListByPoolOptionalParams, - settings?: PageSettings, - ): AsyncIterableIterator { - let result: ResourceDetailsListByPoolResponse; - let continuationToken = settings?.continuationToken; - if (!continuationToken) { - result = await this._listByPool(resourceGroupName, poolName, options); - let page = result.value || []; - continuationToken = result.nextLink; - setContinuationToken(page, continuationToken); - yield page; - } - while (continuationToken) { - result = await this._listByPoolNext( - resourceGroupName, - poolName, - continuationToken, - options, - ); - continuationToken = result.nextLink; - let page = result.value || []; - setContinuationToken(page, continuationToken); - yield page; - } - } - - private async *listByPoolPagingAll( - resourceGroupName: string, - poolName: string, - options?: ResourceDetailsListByPoolOptionalParams, - ): AsyncIterableIterator { - for await (const page of this.listByPoolPagingPage( - resourceGroupName, - poolName, - options, - )) { - yield* page; - } - } - - /** - * List ResourceDetailsObject resources by Pool - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param poolName Name of the pool. It needs to be globally unique. - * @param options The options parameters. - */ - private _listByPool( - resourceGroupName: string, - poolName: string, - options?: ResourceDetailsListByPoolOptionalParams, - ): Promise { - return this.client.sendOperationRequest( - { resourceGroupName, poolName, options }, - listByPoolOperationSpec, - ); - } - - /** - * ListByPoolNext - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param poolName Name of the pool. It needs to be globally unique. - * @param nextLink The nextLink from the previous successful call to the ListByPool method. - * @param options The options parameters. - */ - private _listByPoolNext( - resourceGroupName: string, - poolName: string, - nextLink: string, - options?: ResourceDetailsListByPoolNextOptionalParams, - ): Promise { - return this.client.sendOperationRequest( - { resourceGroupName, poolName, nextLink, options }, - listByPoolNextOperationSpec, - ); - } -} -// Operation Specifications -const serializer = coreClient.createSerializer(Mappers, /* isXml */ false); - -const listByPoolOperationSpec: coreClient.OperationSpec = { - path: "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DevOpsInfrastructure/pools/{poolName}/resources", - httpMethod: "GET", - responses: { - 200: { - bodyMapper: Mappers.ResourceDetailsObjectListResult, - }, - default: { - bodyMapper: Mappers.ErrorResponse, - }, - }, - queryParameters: [Parameters.apiVersion], - urlParameters: [ - Parameters.$host, - Parameters.subscriptionId, - Parameters.resourceGroupName, - Parameters.poolName, - ], - headerParameters: [Parameters.accept], - serializer, -}; -const listByPoolNextOperationSpec: coreClient.OperationSpec = { - path: "{nextLink}", - httpMethod: "GET", - responses: { - 200: { - bodyMapper: Mappers.ResourceDetailsObjectListResult, - }, - default: { - bodyMapper: Mappers.ErrorResponse, - }, - }, - urlParameters: [ - Parameters.$host, - Parameters.nextLink, - Parameters.subscriptionId, - Parameters.resourceGroupName, - Parameters.poolName, - ], - headerParameters: [Parameters.accept], - serializer, -}; diff --git a/sdk/devopsinfrastructure/arm-devopsinfrastructure/src/operations/sku.ts b/sdk/devopsinfrastructure/arm-devopsinfrastructure/src/operations/sku.ts deleted file mode 100644 index 07d967c783a6..000000000000 --- a/sdk/devopsinfrastructure/arm-devopsinfrastructure/src/operations/sku.ts +++ /dev/null @@ -1,176 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -import { PagedAsyncIterableIterator, PageSettings } from "@azure/core-paging"; -import { setContinuationToken } from "../pagingHelper"; -import { Sku } from "../operationsInterfaces"; -import * as coreClient from "@azure/core-client"; -import * as Mappers from "../models/mappers"; -import * as Parameters from "../models/parameters"; -import { ManagedDevOpsInfrastructure } from "../managedDevOpsInfrastructure"; -import { - ResourceSku, - SkuListByLocationNextOptionalParams, - SkuListByLocationOptionalParams, - SkuListByLocationResponse, - SkuListByLocationNextResponse, -} from "../models"; - -/// -/** Class containing Sku operations. */ -export class SkuImpl implements Sku { - private readonly client: ManagedDevOpsInfrastructure; - - /** - * Initialize a new instance of the class Sku class. - * @param client Reference to the service client - */ - constructor(client: ManagedDevOpsInfrastructure) { - this.client = client; - } - - /** - * List ResourceSku resources by subscription ID - * @param locationName Name of the location. - * @param options The options parameters. - */ - public listByLocation( - locationName: string, - options?: SkuListByLocationOptionalParams, - ): PagedAsyncIterableIterator { - const iter = this.listByLocationPagingAll(locationName, options); - return { - next() { - return iter.next(); - }, - [Symbol.asyncIterator]() { - return this; - }, - byPage: (settings?: PageSettings) => { - if (settings?.maxPageSize) { - throw new Error("maxPageSize is not supported by this operation."); - } - return this.listByLocationPagingPage(locationName, options, settings); - }, - }; - } - - private async *listByLocationPagingPage( - locationName: string, - options?: SkuListByLocationOptionalParams, - settings?: PageSettings, - ): AsyncIterableIterator { - let result: SkuListByLocationResponse; - let continuationToken = settings?.continuationToken; - if (!continuationToken) { - result = await this._listByLocation(locationName, options); - let page = result.value || []; - continuationToken = result.nextLink; - setContinuationToken(page, continuationToken); - yield page; - } - while (continuationToken) { - result = await this._listByLocationNext( - locationName, - continuationToken, - options, - ); - continuationToken = result.nextLink; - let page = result.value || []; - setContinuationToken(page, continuationToken); - yield page; - } - } - - private async *listByLocationPagingAll( - locationName: string, - options?: SkuListByLocationOptionalParams, - ): AsyncIterableIterator { - for await (const page of this.listByLocationPagingPage( - locationName, - options, - )) { - yield* page; - } - } - - /** - * List ResourceSku resources by subscription ID - * @param locationName Name of the location. - * @param options The options parameters. - */ - private _listByLocation( - locationName: string, - options?: SkuListByLocationOptionalParams, - ): Promise { - return this.client.sendOperationRequest( - { locationName, options }, - listByLocationOperationSpec, - ); - } - - /** - * ListByLocationNext - * @param locationName Name of the location. - * @param nextLink The nextLink from the previous successful call to the ListByLocation method. - * @param options The options parameters. - */ - private _listByLocationNext( - locationName: string, - nextLink: string, - options?: SkuListByLocationNextOptionalParams, - ): Promise { - return this.client.sendOperationRequest( - { locationName, nextLink, options }, - listByLocationNextOperationSpec, - ); - } -} -// Operation Specifications -const serializer = coreClient.createSerializer(Mappers, /* isXml */ false); - -const listByLocationOperationSpec: coreClient.OperationSpec = { - path: "/subscriptions/{subscriptionId}/providers/Microsoft.DevOpsInfrastructure/locations/{locationName}/skus", - httpMethod: "GET", - responses: { - 200: { - bodyMapper: Mappers.ResourceSkuListResult, - }, - default: { - bodyMapper: Mappers.ErrorResponse, - }, - }, - queryParameters: [Parameters.apiVersion], - urlParameters: [ - Parameters.$host, - Parameters.subscriptionId, - Parameters.locationName, - ], - headerParameters: [Parameters.accept], - serializer, -}; -const listByLocationNextOperationSpec: coreClient.OperationSpec = { - path: "{nextLink}", - httpMethod: "GET", - responses: { - 200: { - bodyMapper: Mappers.ResourceSkuListResult, - }, - default: { - bodyMapper: Mappers.ErrorResponse, - }, - }, - urlParameters: [ - Parameters.$host, - Parameters.nextLink, - Parameters.subscriptionId, - Parameters.locationName, - ], - headerParameters: [Parameters.accept], - serializer, -}; diff --git a/sdk/devopsinfrastructure/arm-devopsinfrastructure/src/operations/subscriptionUsages.ts b/sdk/devopsinfrastructure/arm-devopsinfrastructure/src/operations/subscriptionUsages.ts deleted file mode 100644 index 79055ba8a2a7..000000000000 --- a/sdk/devopsinfrastructure/arm-devopsinfrastructure/src/operations/subscriptionUsages.ts +++ /dev/null @@ -1,176 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -import { PagedAsyncIterableIterator, PageSettings } from "@azure/core-paging"; -import { setContinuationToken } from "../pagingHelper"; -import { SubscriptionUsages } from "../operationsInterfaces"; -import * as coreClient from "@azure/core-client"; -import * as Mappers from "../models/mappers"; -import * as Parameters from "../models/parameters"; -import { ManagedDevOpsInfrastructure } from "../managedDevOpsInfrastructure"; -import { - Quota, - SubscriptionUsagesListByLocationNextOptionalParams, - SubscriptionUsagesListByLocationOptionalParams, - SubscriptionUsagesListByLocationResponse, - SubscriptionUsagesListByLocationNextResponse, -} from "../models"; - -/// -/** Class containing SubscriptionUsages operations. */ -export class SubscriptionUsagesImpl implements SubscriptionUsages { - private readonly client: ManagedDevOpsInfrastructure; - - /** - * Initialize a new instance of the class SubscriptionUsages class. - * @param client Reference to the service client - */ - constructor(client: ManagedDevOpsInfrastructure) { - this.client = client; - } - - /** - * List Quota resources by subscription ID - * @param locationName Name of the location. - * @param options The options parameters. - */ - public listByLocation( - locationName: string, - options?: SubscriptionUsagesListByLocationOptionalParams, - ): PagedAsyncIterableIterator { - const iter = this.listByLocationPagingAll(locationName, options); - return { - next() { - return iter.next(); - }, - [Symbol.asyncIterator]() { - return this; - }, - byPage: (settings?: PageSettings) => { - if (settings?.maxPageSize) { - throw new Error("maxPageSize is not supported by this operation."); - } - return this.listByLocationPagingPage(locationName, options, settings); - }, - }; - } - - private async *listByLocationPagingPage( - locationName: string, - options?: SubscriptionUsagesListByLocationOptionalParams, - settings?: PageSettings, - ): AsyncIterableIterator { - let result: SubscriptionUsagesListByLocationResponse; - let continuationToken = settings?.continuationToken; - if (!continuationToken) { - result = await this._listByLocation(locationName, options); - let page = result.value || []; - continuationToken = result.nextLink; - setContinuationToken(page, continuationToken); - yield page; - } - while (continuationToken) { - result = await this._listByLocationNext( - locationName, - continuationToken, - options, - ); - continuationToken = result.nextLink; - let page = result.value || []; - setContinuationToken(page, continuationToken); - yield page; - } - } - - private async *listByLocationPagingAll( - locationName: string, - options?: SubscriptionUsagesListByLocationOptionalParams, - ): AsyncIterableIterator { - for await (const page of this.listByLocationPagingPage( - locationName, - options, - )) { - yield* page; - } - } - - /** - * List Quota resources by subscription ID - * @param locationName Name of the location. - * @param options The options parameters. - */ - private _listByLocation( - locationName: string, - options?: SubscriptionUsagesListByLocationOptionalParams, - ): Promise { - return this.client.sendOperationRequest( - { locationName, options }, - listByLocationOperationSpec, - ); - } - - /** - * ListByLocationNext - * @param locationName Name of the location. - * @param nextLink The nextLink from the previous successful call to the ListByLocation method. - * @param options The options parameters. - */ - private _listByLocationNext( - locationName: string, - nextLink: string, - options?: SubscriptionUsagesListByLocationNextOptionalParams, - ): Promise { - return this.client.sendOperationRequest( - { locationName, nextLink, options }, - listByLocationNextOperationSpec, - ); - } -} -// Operation Specifications -const serializer = coreClient.createSerializer(Mappers, /* isXml */ false); - -const listByLocationOperationSpec: coreClient.OperationSpec = { - path: "/subscriptions/{subscriptionId}/providers/Microsoft.DevOpsInfrastructure/locations/{locationName}/usages", - httpMethod: "GET", - responses: { - 200: { - bodyMapper: Mappers.QuotaListResult, - }, - default: { - bodyMapper: Mappers.ErrorResponse, - }, - }, - queryParameters: [Parameters.apiVersion], - urlParameters: [ - Parameters.$host, - Parameters.subscriptionId, - Parameters.locationName, - ], - headerParameters: [Parameters.accept], - serializer, -}; -const listByLocationNextOperationSpec: coreClient.OperationSpec = { - path: "{nextLink}", - httpMethod: "GET", - responses: { - 200: { - bodyMapper: Mappers.QuotaListResult, - }, - default: { - bodyMapper: Mappers.ErrorResponse, - }, - }, - urlParameters: [ - Parameters.$host, - Parameters.nextLink, - Parameters.subscriptionId, - Parameters.locationName, - ], - headerParameters: [Parameters.accept], - serializer, -}; diff --git a/sdk/devopsinfrastructure/arm-devopsinfrastructure/src/operationsInterfaces/imageVersions.ts b/sdk/devopsinfrastructure/arm-devopsinfrastructure/src/operationsInterfaces/imageVersions.ts deleted file mode 100644 index 8d50854b1d23..000000000000 --- a/sdk/devopsinfrastructure/arm-devopsinfrastructure/src/operationsInterfaces/imageVersions.ts +++ /dev/null @@ -1,29 +0,0 @@ -/* - * 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, -} from "../models"; - -/// -/** Interface representing a ImageVersions. */ -export interface ImageVersions { - /** - * List ImageVersion resources by Image - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param imageName Name of the image. - * @param options The options parameters. - */ - listByImage( - resourceGroupName: string, - imageName: string, - options?: ImageVersionsListByImageOptionalParams, - ): PagedAsyncIterableIterator; -} diff --git a/sdk/devopsinfrastructure/arm-devopsinfrastructure/src/operationsInterfaces/index.ts b/sdk/devopsinfrastructure/arm-devopsinfrastructure/src/operationsInterfaces/index.ts deleted file mode 100644 index ad3bc37a2b93..000000000000 --- a/sdk/devopsinfrastructure/arm-devopsinfrastructure/src/operationsInterfaces/index.ts +++ /dev/null @@ -1,14 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -export * from "./operations"; -export * from "./sku"; -export * from "./subscriptionUsages"; -export * from "./pools"; -export * from "./imageVersions"; -export * from "./resourceDetails"; diff --git a/sdk/devopsinfrastructure/arm-devopsinfrastructure/src/operationsInterfaces/operations.ts b/sdk/devopsinfrastructure/arm-devopsinfrastructure/src/operationsInterfaces/operations.ts deleted file mode 100644 index 251f5f582e64..000000000000 --- a/sdk/devopsinfrastructure/arm-devopsinfrastructure/src/operationsInterfaces/operations.ts +++ /dev/null @@ -1,22 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -import { PagedAsyncIterableIterator } from "@azure/core-paging"; -import { Operation, OperationsListOptionalParams } from "../models"; - -/// -/** Interface representing a Operations. */ -export interface Operations { - /** - * List the operations for the provider - * @param options The options parameters. - */ - list( - options?: OperationsListOptionalParams, - ): PagedAsyncIterableIterator; -} diff --git a/sdk/devopsinfrastructure/arm-devopsinfrastructure/src/operationsInterfaces/pools.ts b/sdk/devopsinfrastructure/arm-devopsinfrastructure/src/operationsInterfaces/pools.ts deleted file mode 100644 index 5b5ab2adaa55..000000000000 --- a/sdk/devopsinfrastructure/arm-devopsinfrastructure/src/operationsInterfaces/pools.ts +++ /dev/null @@ -1,139 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -import { PagedAsyncIterableIterator } from "@azure/core-paging"; -import { SimplePollerLike, OperationState } from "@azure/core-lro"; -import { - Pool, - PoolsListBySubscriptionOptionalParams, - PoolsListByResourceGroupOptionalParams, - PoolsGetOptionalParams, - PoolsGetResponse, - PoolsCreateOrUpdateOptionalParams, - PoolsCreateOrUpdateResponse, - PoolUpdate, - PoolsUpdateOptionalParams, - PoolsUpdateResponse, - PoolsDeleteOptionalParams, - PoolsDeleteResponse, -} from "../models"; - -/// -/** Interface representing a Pools. */ -export interface Pools { - /** - * List Pool resources by subscription ID - * @param options The options parameters. - */ - listBySubscription( - options?: PoolsListBySubscriptionOptionalParams, - ): PagedAsyncIterableIterator; - /** - * List Pool resources by resource group - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param options The options parameters. - */ - listByResourceGroup( - resourceGroupName: string, - options?: PoolsListByResourceGroupOptionalParams, - ): PagedAsyncIterableIterator; - /** - * Get a Pool - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param poolName Name of the pool. It needs to be globally unique. - * @param options The options parameters. - */ - get( - resourceGroupName: string, - poolName: string, - options?: PoolsGetOptionalParams, - ): Promise; - /** - * Create a Pool - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param poolName Name of the pool. It needs to be globally unique. - * @param resource Resource create parameters. - * @param options The options parameters. - */ - beginCreateOrUpdate( - resourceGroupName: string, - poolName: string, - resource: Pool, - options?: PoolsCreateOrUpdateOptionalParams, - ): Promise< - SimplePollerLike< - OperationState, - PoolsCreateOrUpdateResponse - > - >; - /** - * Create a Pool - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param poolName Name of the pool. It needs to be globally unique. - * @param resource Resource create parameters. - * @param options The options parameters. - */ - beginCreateOrUpdateAndWait( - resourceGroupName: string, - poolName: string, - resource: Pool, - options?: PoolsCreateOrUpdateOptionalParams, - ): Promise; - /** - * Update a Pool - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param poolName Name of the pool. It needs to be globally unique. - * @param properties The resource properties to be updated. - * @param options The options parameters. - */ - beginUpdate( - resourceGroupName: string, - poolName: string, - properties: PoolUpdate, - options?: PoolsUpdateOptionalParams, - ): Promise< - SimplePollerLike, PoolsUpdateResponse> - >; - /** - * Update a Pool - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param poolName Name of the pool. It needs to be globally unique. - * @param properties The resource properties to be updated. - * @param options The options parameters. - */ - beginUpdateAndWait( - resourceGroupName: string, - poolName: string, - properties: PoolUpdate, - options?: PoolsUpdateOptionalParams, - ): Promise; - /** - * Delete a Pool - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param poolName Name of the pool. It needs to be globally unique. - * @param options The options parameters. - */ - beginDelete( - resourceGroupName: string, - poolName: string, - options?: PoolsDeleteOptionalParams, - ): Promise< - SimplePollerLike, PoolsDeleteResponse> - >; - /** - * Delete a Pool - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param poolName Name of the pool. It needs to be globally unique. - * @param options The options parameters. - */ - beginDeleteAndWait( - resourceGroupName: string, - poolName: string, - options?: PoolsDeleteOptionalParams, - ): Promise; -} diff --git a/sdk/devopsinfrastructure/arm-devopsinfrastructure/src/operationsInterfaces/resourceDetails.ts b/sdk/devopsinfrastructure/arm-devopsinfrastructure/src/operationsInterfaces/resourceDetails.ts deleted file mode 100644 index 2a0ef8fa0926..000000000000 --- a/sdk/devopsinfrastructure/arm-devopsinfrastructure/src/operationsInterfaces/resourceDetails.ts +++ /dev/null @@ -1,29 +0,0 @@ -/* - * 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 { - ResourceDetailsObject, - ResourceDetailsListByPoolOptionalParams, -} from "../models"; - -/// -/** Interface representing a ResourceDetails. */ -export interface ResourceDetails { - /** - * List ResourceDetailsObject resources by Pool - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param poolName Name of the pool. It needs to be globally unique. - * @param options The options parameters. - */ - listByPool( - resourceGroupName: string, - poolName: string, - options?: ResourceDetailsListByPoolOptionalParams, - ): PagedAsyncIterableIterator; -} diff --git a/sdk/devopsinfrastructure/arm-devopsinfrastructure/src/operationsInterfaces/sku.ts b/sdk/devopsinfrastructure/arm-devopsinfrastructure/src/operationsInterfaces/sku.ts deleted file mode 100644 index 15e1aff1a017..000000000000 --- a/sdk/devopsinfrastructure/arm-devopsinfrastructure/src/operationsInterfaces/sku.ts +++ /dev/null @@ -1,24 +0,0 @@ -/* - * 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 { ResourceSku, SkuListByLocationOptionalParams } from "../models"; - -/// -/** Interface representing a Sku. */ -export interface Sku { - /** - * List ResourceSku resources by subscription ID - * @param locationName Name of the location. - * @param options The options parameters. - */ - listByLocation( - locationName: string, - options?: SkuListByLocationOptionalParams, - ): PagedAsyncIterableIterator; -} diff --git a/sdk/devopsinfrastructure/arm-devopsinfrastructure/src/operationsInterfaces/subscriptionUsages.ts b/sdk/devopsinfrastructure/arm-devopsinfrastructure/src/operationsInterfaces/subscriptionUsages.ts deleted file mode 100644 index 2a40f145768e..000000000000 --- a/sdk/devopsinfrastructure/arm-devopsinfrastructure/src/operationsInterfaces/subscriptionUsages.ts +++ /dev/null @@ -1,27 +0,0 @@ -/* - * 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 { - Quota, - SubscriptionUsagesListByLocationOptionalParams, -} from "../models"; - -/// -/** Interface representing a SubscriptionUsages. */ -export interface SubscriptionUsages { - /** - * List Quota resources by subscription ID - * @param locationName Name of the location. - * @param options The options parameters. - */ - listByLocation( - locationName: string, - options?: SubscriptionUsagesListByLocationOptionalParams, - ): PagedAsyncIterableIterator; -} diff --git a/sdk/devopsinfrastructure/arm-devopsinfrastructure/src/pagingHelper.ts b/sdk/devopsinfrastructure/arm-devopsinfrastructure/src/pagingHelper.ts deleted file mode 100644 index 205cccc26592..000000000000 --- a/sdk/devopsinfrastructure/arm-devopsinfrastructure/src/pagingHelper.ts +++ /dev/null @@ -1,39 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -export interface PageInfo { - continuationToken?: string; -} - -const pageMap = new WeakMap(); - -/** - * Given the last `.value` produced by the `byPage` iterator, - * returns a continuation token that can be used to begin paging from - * that point later. - * @param page An object from accessing `value` on the IteratorResult from a `byPage` iterator. - * @returns The continuation token that can be passed into byPage() during future calls. - */ -export function getContinuationToken(page: unknown): string | undefined { - if (typeof page !== "object" || page === null) { - return undefined; - } - return pageMap.get(page)?.continuationToken; -} - -export function setContinuationToken( - page: unknown, - continuationToken: string | undefined, -): void { - if (typeof page !== "object" || page === null || !continuationToken) { - return; - } - const pageInfo = pageMap.get(page) ?? {}; - pageInfo.continuationToken = continuationToken; - pageMap.set(page, pageInfo); -} diff --git a/sdk/devopsinfrastructure/arm-devopsinfrastructure/src/restorePollerHelpers.ts b/sdk/devopsinfrastructure/arm-devopsinfrastructure/src/restorePollerHelpers.ts new file mode 100644 index 000000000000..2628150b2f17 --- /dev/null +++ b/sdk/devopsinfrastructure/arm-devopsinfrastructure/src/restorePollerHelpers.ts @@ -0,0 +1,177 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +import { DevOpsInfrastructureClient } from "./devOpsInfrastructureClient.js"; +import { + _poolsCreateOrUpdateDeserialize, + _poolsUpdateDeserialize, + _poolsDeleteDeserialize, +} from "./api/pools/index.js"; +import { getLongRunningPoller } from "./static-helpers/pollingHelpers.js"; +import { + OperationOptions, + PathUncheckedResponse, +} from "@azure-rest/core-client"; +import { AbortSignalLike } from "@azure/abort-controller"; +import { + PollerLike, + OperationState, + deserializeState, + ResourceLocationConfig, +} from "@azure/core-lro"; + +export interface RestorePollerOptions< + TResult, + TResponse extends PathUncheckedResponse = PathUncheckedResponse, +> extends OperationOptions { + /** Delay to wait until next poll, in milliseconds. */ + updateIntervalInMs?: number; + /** + * The signal which can be used to abort requests. + */ + abortSignal?: AbortSignalLike; + /** Deserialization function for raw response body */ + processResponseBody?: (result: TResponse) => Promise; +} + +/** + * Creates a poller from the serialized state of another poller. This can be + * useful when you want to create pollers on a different host or a poller + * needs to be constructed after the original one is not in scope. + */ +export function restorePoller( + client: DevOpsInfrastructureClient, + serializedState: string, + sourceOperation: ( + ...args: any[] + ) => PollerLike, TResult>, + options?: RestorePollerOptions, +): PollerLike, TResult> { + const pollerConfig = deserializeState(serializedState).config; + const { initialRequestUrl, requestMethod, metadata } = pollerConfig; + if (!initialRequestUrl || !requestMethod) { + throw new Error( + `Invalid serialized state: ${serializedState} for sourceOperation ${sourceOperation?.name}`, + ); + } + const resourceLocationConfig = metadata?.["resourceLocationConfig"] as + | ResourceLocationConfig + | undefined; + const { deserializer, expectedStatuses = [] } = + getDeserializationHelper(initialRequestUrl, requestMethod) ?? {}; + const deserializeHelper = options?.processResponseBody ?? deserializer; + if (!deserializeHelper) { + throw new Error( + `Please ensure the operation is in this client! We can't find its deserializeHelper for ${sourceOperation?.name}.`, + ); + } + return getLongRunningPoller( + (client as any)["_client"] ?? client, + deserializeHelper as (result: TResponse) => Promise, + expectedStatuses, + { + updateIntervalInMs: options?.updateIntervalInMs, + abortSignal: options?.abortSignal, + resourceLocationConfig, + restoreFrom: serializedState, + initialRequestUrl, + }, + ); +} + +interface DeserializationHelper { + deserializer: Function; + expectedStatuses: string[]; +} + +const deserializeMap: Record = { + "PUT /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DevOpsInfrastructure/pools/{poolName}": + { + deserializer: _poolsCreateOrUpdateDeserialize, + expectedStatuses: ["200", "201"], + }, + "PATCH /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DevOpsInfrastructure/pools/{poolName}": + { deserializer: _poolsUpdateDeserialize, expectedStatuses: ["200", "202"] }, + "DELETE /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DevOpsInfrastructure/pools/{poolName}": + { + deserializer: _poolsDeleteDeserialize, + expectedStatuses: ["202", "204", "200"], + }, +}; + +function getDeserializationHelper( + urlStr: string, + method: string, +): DeserializationHelper | undefined { + const path = new URL(urlStr).pathname; + const pathParts = path.split("/"); + + // Traverse list to match the longest candidate + // matchedLen: the length of candidate path + // matchedValue: the matched status code array + let matchedLen = -1, + matchedValue: DeserializationHelper | undefined; + + // Iterate the responseMap to find a match + for (const [key, value] of Object.entries(deserializeMap)) { + // Extracting the path from the map key which is in format + // GET /path/foo + if (!key.startsWith(method)) { + continue; + } + const candidatePath = getPathFromMapKey(key); + // Get each part of the url path + const candidateParts = candidatePath.split("/"); + + // track if we have found a match to return the values found. + let found = true; + for ( + let i = candidateParts.length - 1, j = pathParts.length - 1; + i >= 1 && j >= 1; + i--, j-- + ) { + if ( + candidateParts[i]?.startsWith("{") && + candidateParts[i]?.indexOf("}") !== -1 + ) { + const start = candidateParts[i]!.indexOf("}") + 1, + end = candidateParts[i]?.length; + // If the current part of the candidate is a "template" part + // Try to use the suffix of pattern to match the path + // {guid} ==> $ + // {guid}:export ==> :export$ + const isMatched = new RegExp( + `${candidateParts[i]?.slice(start, end)}`, + ).test(pathParts[j] || ""); + + if (!isMatched) { + found = false; + break; + } + continue; + } + + // If the candidate part is not a template and + // the parts don't match mark the candidate as not found + // to move on with the next candidate path. + if (candidateParts[i] !== pathParts[j]) { + found = false; + break; + } + } + + // We finished evaluating the current candidate parts + // Update the matched value if and only if we found the longer pattern + if (found && candidatePath.length > matchedLen) { + matchedLen = candidatePath.length; + matchedValue = value; + } + } + + return matchedValue; +} + +function getPathFromMapKey(mapKey: string): string { + const pathStart = mapKey.indexOf("/"); + return mapKey.slice(pathStart); +} diff --git a/sdk/devopsinfrastructure/arm-devopsinfrastructure/src/static-helpers/pagingHelpers.ts b/sdk/devopsinfrastructure/arm-devopsinfrastructure/src/static-helpers/pagingHelpers.ts new file mode 100644 index 000000000000..dc35b0af242d --- /dev/null +++ b/sdk/devopsinfrastructure/arm-devopsinfrastructure/src/static-helpers/pagingHelpers.ts @@ -0,0 +1,277 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +import { + Client, + createRestError, + PathUncheckedResponse, +} from "@azure-rest/core-client"; +import { RestError } from "@azure/core-rest-pipeline"; + +/** + * Options for the byPage method + */ +export interface PageSettings { + /** + * A reference to a specific page to start iterating from. + */ + continuationToken?: string; +} + +/** + * An interface that describes a page of results. + */ +export type ContinuablePage = TPage & { + /** + * The token that keeps track of where to continue the iterator + */ + continuationToken?: string; +}; + +/** + * An interface that allows async iterable iteration both to completion and by page. + */ +export interface PagedAsyncIterableIterator< + TElement, + TPage = TElement[], + TPageSettings extends PageSettings = PageSettings, +> { + /** + * The next method, part of the iteration protocol + */ + next(): Promise>; + /** + * The connection to the async iterator, part of the iteration protocol + */ + [Symbol.asyncIterator](): PagedAsyncIterableIterator< + TElement, + TPage, + TPageSettings + >; + /** + * Return an AsyncIterableIterator that works a page at a time + */ + byPage: ( + settings?: TPageSettings, + ) => AsyncIterableIterator>; +} + +/** + * An interface that describes how to communicate with the service. + */ +export interface PagedResult< + TElement, + TPage = TElement[], + TPageSettings extends PageSettings = PageSettings, +> { + /** + * Link to the first page of results. + */ + firstPageLink?: string; + /** + * A method that returns a page of results. + */ + getPage: ( + pageLink?: string, + ) => Promise<{ page: TPage; nextPageLink?: string } | undefined>; + /** + * a function to implement the `byPage` method on the paged async iterator. + */ + byPage?: ( + settings?: TPageSettings, + ) => AsyncIterableIterator>; + + /** + * A function to extract elements from a page. + */ + toElements?: (page: TPage) => TElement[]; +} + +/** + * Options for the paging helper + */ +export interface BuildPagedAsyncIteratorOptions { + itemName?: string; + nextLinkName?: string; +} + +/** + * Helper to paginate results in a generic way and return a PagedAsyncIterableIterator + */ +export function buildPagedAsyncIterator< + TElement, + TPage = TElement[], + TPageSettings extends PageSettings = PageSettings, + TResponse extends PathUncheckedResponse = PathUncheckedResponse, +>( + client: Client, + getInitialResponse: () => PromiseLike, + processResponseBody: (result: TResponse) => PromiseLike, + expectedStatuses: string[], + options: BuildPagedAsyncIteratorOptions = {}, +): PagedAsyncIterableIterator { + const itemName = options.itemName ?? "value"; + const nextLinkName = options.nextLinkName ?? "nextLink"; + const pagedResult: PagedResult = { + getPage: async (pageLink?: string) => { + const result = + pageLink === undefined + ? await getInitialResponse() + : await client.pathUnchecked(pageLink).get(); + checkPagingRequest(result, expectedStatuses); + const results = await processResponseBody(result as TResponse); + const nextLink = getNextLink(results, nextLinkName); + const values = getElements(results, itemName) as TPage; + return { + page: values, + nextPageLink: nextLink, + }; + }, + byPage: (settings?: TPageSettings) => { + const { continuationToken } = settings ?? {}; + return getPageAsyncIterator(pagedResult, { + pageLink: continuationToken, + }); + }, + }; + return getPagedAsyncIterator(pagedResult); +} + +/** + * returns an async iterator that iterates over results. It also has a `byPage` + * method that returns pages of items at once. + * + * @param pagedResult - an object that specifies how to get pages. + * @returns a paged async iterator that iterates over results. + */ + +function getPagedAsyncIterator< + TElement, + TPage = TElement[], + TPageSettings extends PageSettings = PageSettings, +>( + pagedResult: PagedResult, +): PagedAsyncIterableIterator { + const iter = getItemAsyncIterator( + pagedResult, + ); + return { + next() { + return iter.next(); + }, + [Symbol.asyncIterator]() { + return this; + }, + byPage: + pagedResult?.byPage ?? + ((settings?: TPageSettings) => { + const { continuationToken } = settings ?? {}; + return getPageAsyncIterator(pagedResult, { + pageLink: continuationToken, + }); + }), + }; +} + +async function* getItemAsyncIterator< + TElement, + TPage, + TPageSettings extends PageSettings, +>( + pagedResult: PagedResult, +): AsyncIterableIterator { + const pages = getPageAsyncIterator(pagedResult); + for await (const page of pages) { + yield* page as unknown as TElement[]; + } +} + +async function* getPageAsyncIterator< + TElement, + TPage, + TPageSettings extends PageSettings, +>( + pagedResult: PagedResult, + options: { + pageLink?: string; + } = {}, +): AsyncIterableIterator> { + const { pageLink } = options; + let response = await pagedResult.getPage( + pageLink ?? pagedResult.firstPageLink, + ); + if (!response) { + return; + } + let result = response.page as ContinuablePage; + result.continuationToken = response.nextPageLink; + yield result; + while (response.nextPageLink) { + response = await pagedResult.getPage(response.nextPageLink); + if (!response) { + return; + } + result = response.page as ContinuablePage; + result.continuationToken = response.nextPageLink; + yield result; + } +} + +/** + * Gets for the value of nextLink in the body + */ +function getNextLink(body: unknown, nextLinkName?: string): string | undefined { + if (!nextLinkName) { + return undefined; + } + + const nextLink = (body as Record)[nextLinkName]; + + if ( + typeof nextLink !== "string" && + typeof nextLink !== "undefined" && + nextLink !== null + ) { + throw new RestError( + `Body Property ${nextLinkName} should be a string or undefined or null but got ${typeof nextLink}`, + ); + } + + if (nextLink === null) { + return undefined; + } + + return nextLink; +} + +/** + * Gets the elements of the current request in the body. + */ +function getElements(body: unknown, itemName: string): T[] { + const value = (body as Record)[itemName] as T[]; + if (!Array.isArray(value)) { + throw new RestError( + `Couldn't paginate response\n Body doesn't contain an array property with name: ${itemName}`, + ); + } + + return value ?? []; +} + +/** + * Checks if a request failed + */ +function checkPagingRequest( + response: PathUncheckedResponse, + expectedStatuses: string[], +): void { + if (!expectedStatuses.includes(response.status)) { + throw createRestError( + `Pagination failed with unexpected statusCode ${response.status}`, + response, + ); + } +} diff --git a/sdk/devopsinfrastructure/arm-devopsinfrastructure/src/static-helpers/pollingHelpers.ts b/sdk/devopsinfrastructure/arm-devopsinfrastructure/src/static-helpers/pollingHelpers.ts new file mode 100644 index 000000000000..87a63b1fc5d1 --- /dev/null +++ b/sdk/devopsinfrastructure/arm-devopsinfrastructure/src/static-helpers/pollingHelpers.ts @@ -0,0 +1,140 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +import { + PollerLike, + OperationState, + ResourceLocationConfig, + RunningOperation, + createHttpPoller, + OperationResponse, +} from "@azure/core-lro"; + +import { + Client, + PathUncheckedResponse, + createRestError, +} from "@azure-rest/core-client"; +import { AbortSignalLike } from "@azure/abort-controller"; + +export interface GetLongRunningPollerOptions { + /** Delay to wait until next poll, in milliseconds. */ + updateIntervalInMs?: number; + /** + * The signal which can be used to abort requests. + */ + abortSignal?: AbortSignalLike; + /** + * The potential location of the result of the LRO if specified by the LRO extension in the swagger. + */ + resourceLocationConfig?: ResourceLocationConfig; + /** + * The original url of the LRO + * Should not be null when restoreFrom is set + */ + initialRequestUrl?: string; + /** + * A serialized poller which can be used to resume an existing paused Long-Running-Operation. + */ + restoreFrom?: string; + /** + * The function to get the initial response + */ + getInitialResponse?: () => PromiseLike; +} +export function getLongRunningPoller< + TResponse extends PathUncheckedResponse, + TResult = void, +>( + client: Client, + processResponseBody: (result: TResponse) => Promise, + expectedStatuses: string[], + options: GetLongRunningPollerOptions, +): PollerLike, TResult> { + const { restoreFrom, getInitialResponse } = options; + if (!restoreFrom && !getInitialResponse) { + throw new Error( + "Either restoreFrom or getInitialResponse must be specified", + ); + } + let initialResponse: TResponse | undefined = undefined; + const pollAbortController = new AbortController(); + const poller: RunningOperation = { + sendInitialRequest: async () => { + if (!getInitialResponse) { + throw new Error( + "getInitialResponse is required when initializing a new poller", + ); + } + initialResponse = await getInitialResponse(); + return getLroResponse(initialResponse, expectedStatuses); + }, + sendPollRequest: async ( + path: string, + pollOptions?: { + abortSignal?: AbortSignalLike; + }, + ) => { + // The poll request would both listen to the user provided abort signal and the poller's own abort signal + function abortListener(): void { + pollAbortController.abort(); + } + const abortSignal = pollAbortController.signal; + if (options.abortSignal?.aborted) { + pollAbortController.abort(); + } else if (pollOptions?.abortSignal?.aborted) { + pollAbortController.abort(); + } else if (!abortSignal.aborted) { + options.abortSignal?.addEventListener("abort", abortListener, { + once: true, + }); + pollOptions?.abortSignal?.addEventListener("abort", abortListener, { + once: true, + }); + } + let response; + try { + response = await client.pathUnchecked(path).get({ abortSignal }); + } finally { + options.abortSignal?.removeEventListener("abort", abortListener); + pollOptions?.abortSignal?.removeEventListener("abort", abortListener); + } + + return getLroResponse(response as TResponse, expectedStatuses); + }, + }; + return createHttpPoller(poller, { + intervalInMs: options?.updateIntervalInMs, + resourceLocationConfig: options?.resourceLocationConfig, + restoreFrom: options?.restoreFrom, + processResult: (result: unknown) => { + return processResponseBody(result as TResponse); + }, + }); +} +/** + * Converts a Rest Client response to a response that the LRO implementation understands + * @param response - a rest client http response + * @param deserializeFn - deserialize function to convert Rest response to modular output + * @returns - An LRO response that the LRO implementation understands + */ +function getLroResponse( + response: TResponse, + expectedStatuses: string[], +): OperationResponse { + if (!expectedStatuses.includes(response.status)) { + throw createRestError(response); + } + + return { + flatResponse: response, + rawResponse: { + ...response, + statusCode: Number.parseInt(response.status), + body: response.body, + }, + }; +} diff --git a/sdk/devopsinfrastructure/arm-devopsinfrastructure/test/devopsinfrastructure_operations_test.spec.ts b/sdk/devopsinfrastructure/arm-devopsinfrastructure/test/devopsinfrastructure_operations_test.spec.ts deleted file mode 100644 index a0727878b73f..000000000000 --- a/sdk/devopsinfrastructure/arm-devopsinfrastructure/test/devopsinfrastructure_operations_test.spec.ts +++ /dev/null @@ -1,69 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -import { - env, - Recorder, - RecorderStartOptions, - delay, - isPlaybackMode, -} from "@azure-tools/test-recorder"; -import { createTestCredential } from "@azure-tools/test-credential"; -import { assert } from "chai"; -import { Context } from "mocha"; -import { ManagedDevOpsInfrastructure } from "../src/managedDevOpsInfrastructure"; - -const replaceableVariables: Record = { - SUBSCRIPTION_ID: " 88888888-8888-8888-8888-888888888888" -}; - -const recorderOptions: RecorderStartOptions = { - envSetupForPlayback: replaceableVariables, - removeCentralSanitizers: [ - "AZSDK3493", // .name in the body is not a secret and is listed below in the beforeEach section - "AZSDK3430", // .id in the body is not a secret and is listed below in the beforeEach section - ], -}; - -export const testPollingOptions = { - updateIntervalInMs: isPlaybackMode() ? 0 : undefined, -}; - -describe("DevOpsInfrastructure test", () => { - let recorder: Recorder; - let subscriptionId: string; - let client: ManagedDevOpsInfrastructure; - let location: string; - let resourceGroup: string; - let resourcename: string; - - beforeEach(async function (this: Context) { - recorder = new Recorder(this.currentTest); - await recorder.start(recorderOptions); - subscriptionId = env.SUBSCRIPTION_ID || ''; - // This is an example of how the environment variables are used - const credential = createTestCredential(); - client = new ManagedDevOpsInfrastructure(credential, subscriptionId, recorder.configureClientOptions({})); - location = "eastus"; - resourceGroup = "myjstest"; - resourcename = "resourcetest"; - - }); - - afterEach(async function () { - await recorder.stop(); - }); - - it("operations list test", async function () { - const resArray = new Array(); - for await (let item of client.operations.list()) { - resArray.push(item); - } - assert.notEqual(resArray.length, 0); - }); -}) diff --git a/sdk/devopsinfrastructure/arm-devopsinfrastructure/test/public/sampleTest.spec.ts b/sdk/devopsinfrastructure/arm-devopsinfrastructure/test/public/sampleTest.spec.ts new file mode 100644 index 000000000000..d4919ac91ac5 --- /dev/null +++ b/sdk/devopsinfrastructure/arm-devopsinfrastructure/test/public/sampleTest.spec.ts @@ -0,0 +1,21 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +import { createRecorder } from "./utils/recordedClient.js"; +import { assert, beforeEach, afterEach, it, describe } from "vitest"; + +describe("My test", () => { + // let recorder: Recorder; + + beforeEach(async function () { + // recorder = await createRecorder(this); + }); + + afterEach(async function () { + // await recorder.stop(); + }); + + it("sample test", async function () { + assert.equal(1, 1); + }); +}); diff --git a/sdk/devopsinfrastructure/arm-devopsinfrastructure/test/public/utils/recordedClient.ts b/sdk/devopsinfrastructure/arm-devopsinfrastructure/test/public/utils/recordedClient.ts new file mode 100644 index 000000000000..6e425fdcfdf9 --- /dev/null +++ b/sdk/devopsinfrastructure/arm-devopsinfrastructure/test/public/utils/recordedClient.ts @@ -0,0 +1,29 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +import { + Recorder, + RecorderStartOptions, + VitestTestContext, +} from "@azure-tools/test-recorder"; + +const replaceableVariables: Record = { + SUBSCRIPTION_ID: "azure_subscription_id", +}; + +const recorderEnvSetup: RecorderStartOptions = { + envSetupForPlayback: replaceableVariables, +}; + +/** + * creates the recorder and reads the environment variables from the `.env` file. + * Should be called first in the test suite to make sure environment variables are + * read before they are being used. + */ +export async function createRecorder( + context: VitestTestContext, +): Promise { + const recorder = new Recorder(context); + await recorder.start(recorderEnvSetup); + return recorder; +} diff --git a/sdk/devopsinfrastructure/arm-devopsinfrastructure/tsconfig.browser.config.json b/sdk/devopsinfrastructure/arm-devopsinfrastructure/tsconfig.browser.config.json new file mode 100644 index 000000000000..091177fcb991 --- /dev/null +++ b/sdk/devopsinfrastructure/arm-devopsinfrastructure/tsconfig.browser.config.json @@ -0,0 +1,10 @@ +{ + "extends": "./.tshy/build.json", + "include": ["src/**/*.ts", "src/**/*.mts", "test/**/*.spec.ts"], + "exclude": ["test/**/node/**/*.ts"], + "compilerOptions": { + "outDir": "./dist-test/browser", + "rootDir": ".", + "skipLibCheck": true + } +} diff --git a/sdk/devopsinfrastructure/arm-devopsinfrastructure/tsconfig.json b/sdk/devopsinfrastructure/arm-devopsinfrastructure/tsconfig.json index f573af1f5fed..72266609583d 100644 --- a/sdk/devopsinfrastructure/arm-devopsinfrastructure/tsconfig.json +++ b/sdk/devopsinfrastructure/arm-devopsinfrastructure/tsconfig.json @@ -1,33 +1,16 @@ { + "extends": "../../../tsconfig", "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, - "paths": { - "@azure/arm-devopsinfrastructure": [ - "./src/index" - ] - } + "module": "NodeNext", + "moduleResolution": "NodeNext", + "rootDir": ".", + "skipLibCheck": true }, "include": [ - "./src/**/*.ts", - "./test/**/*.ts", - "samples-dev/**/*.ts" - ], - "exclude": [ - "node_modules" + "src/**/*.ts", + "src/**/*.mts", + "src/**/*.cts", + "test/**/*.ts", + "test/**/*.ts" ] -} \ No newline at end of file +} diff --git a/sdk/devopsinfrastructure/arm-devopsinfrastructure/tsp-location.yaml b/sdk/devopsinfrastructure/arm-devopsinfrastructure/tsp-location.yaml new file mode 100644 index 000000000000..3bd84dffce28 --- /dev/null +++ b/sdk/devopsinfrastructure/arm-devopsinfrastructure/tsp-location.yaml @@ -0,0 +1,4 @@ +directory: specification/devopsinfrastructure/Microsoft.DevOpsInfrastructure.Management +commit: d161f1af900c7aa8a96f1adfa38e893159831474 +repo: ../azure-rest-api-specs +additionalDirectories: diff --git a/sdk/devopsinfrastructure/arm-devopsinfrastructure/vitest.browser.config.ts b/sdk/devopsinfrastructure/arm-devopsinfrastructure/vitest.browser.config.ts new file mode 100644 index 000000000000..da68c1d231aa --- /dev/null +++ b/sdk/devopsinfrastructure/arm-devopsinfrastructure/vitest.browser.config.ts @@ -0,0 +1,38 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +import { defineConfig } from "vitest/config"; +import { relativeRecordingsPath } from "@azure-tools/test-recorder"; + +process.env.RECORDINGS_RELATIVE_PATH = relativeRecordingsPath(); + +export default defineConfig({ + define: { + "process.env": process.env, + }, + test: { + reporters: ["basic", "junit"], + outputFile: { + junit: "test-results.browser.xml", + }, + browser: { + enabled: true, + headless: true, + name: "chromium", + provider: "playwright", + }, + fakeTimers: { + toFake: ["setTimeout", "Date"], + }, + watch: false, + include: ["dist-test/browser/**/*.spec.js"], + coverage: { + include: ["dist-test/browser/**/*.spec.js"], + provider: "istanbul", + reporter: ["text", "json", "html"], + reportsDirectory: "coverage-browser", + }, + testTimeout: 1200000, + hookTimeout: 1200000, + }, +}); diff --git a/sdk/devopsinfrastructure/arm-devopsinfrastructure/vitest.config.ts b/sdk/devopsinfrastructure/arm-devopsinfrastructure/vitest.config.ts new file mode 100644 index 000000000000..2cf5d0e02c2e --- /dev/null +++ b/sdk/devopsinfrastructure/arm-devopsinfrastructure/vitest.config.ts @@ -0,0 +1,34 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +import { defineConfig } from "vitest/config"; +import { relativeRecordingsPath } from "@azure-tools/test-recorder"; + +export default defineConfig({ + test: { + reporters: ["basic", "junit"], + outputFile: { + junit: "test-results.browser.xml", + }, + fakeTimers: { + toFake: ["setTimeout", "Date"], + }, + watch: false, + include: ["test/**/*.spec.ts"], + exclude: ["test/**/browser/*.spec.ts"], + coverage: { + include: ["src/**/*.ts"], + exclude: [ + "src/**/*-browser.mts", + "src/**/*-react-native.mts", + "vitest*.config.ts", + "samples-dev/**/*.ts", + ], + provider: "istanbul", + reporter: ["text", "json", "html"], + reportsDirectory: "coverage", + }, + testTimeout: 1200000, + hookTimeout: 1200000, + }, +});