diff --git a/common/config/rush/pnpm-lock.yaml b/common/config/rush/pnpm-lock.yaml index 78d3769a9be2..59a77dc3016f 100644 --- a/common/config/rush/pnpm-lock.yaml +++ b/common/config/rush/pnpm-lock.yaml @@ -81,7 +81,7 @@ importers: version: file:projects/arm-agrifood.tgz(@vitest/browser@2.1.8)(msw@2.7.0(@types/node@22.7.9)(typescript@5.7.3)) '@rush-temp/arm-analysisservices': specifier: file:./projects/arm-analysisservices.tgz - version: file:projects/arm-analysisservices.tgz(msw@2.7.0(@types/node@22.7.9)(typescript@5.7.3))(vite@5.4.11(@types/node@22.7.9)) + version: file:projects/arm-analysisservices.tgz(@vitest/browser@2.1.8)(msw@2.7.0(@types/node@22.7.9)(typescript@5.7.3)) '@rush-temp/arm-apicenter': specifier: file:./projects/arm-apicenter.tgz version: file:projects/arm-apicenter.tgz(@vitest/browser@2.1.8)(msw@2.7.0(@types/node@22.7.9)(typescript@5.7.3)) @@ -2555,7 +2555,7 @@ packages: version: 0.0.0 '@rush-temp/arm-analysisservices@file:projects/arm-analysisservices.tgz': - resolution: {integrity: sha512-t5nlKA9aERhTLA1FtwaTyPlS1Ipu6zQgMyCVTHhJX42q6FPF/d5XbOMJz+58T5u8UY/JgTgxHuaese/KtbE7hA==, tarball: file:projects/arm-analysisservices.tgz} + resolution: {integrity: sha512-KOPovqzxtFRHWxuynP1VXcwLHtcuPqpQucJ301SHBKEPodN5jM3699wc/Q+ByUL+Rbbda+M9vsTnUA9o4cEPxg==, tarball: file:projects/arm-analysisservices.tgz} version: 0.0.0 '@rush-temp/arm-apicenter@file:projects/arm-apicenter.tgz': @@ -2563,15 +2563,15 @@ packages: version: 0.0.0 '@rush-temp/arm-apimanagement@file:projects/arm-apimanagement.tgz': - resolution: {integrity: sha512-21fUiCFQejze8e2l3PwTiHFc8KDuj3L8nXnEeFExNELM/nS+iCf6rEih+d5pe0+O6rQ3camxDNAA223kC/eBCA==, tarball: file:projects/arm-apimanagement.tgz} + resolution: {integrity: sha512-Oo7NsnCPAlo7YDMq88CdrMM+T3Ul6F7PyjMSQ3BJzua1xVx0Z3ZglwoW4ca7SNdJaPqIjdtInqMltmTdc4V4zw==, tarball: file:projects/arm-apimanagement.tgz} version: 0.0.0 '@rush-temp/arm-appcomplianceautomation@file:projects/arm-appcomplianceautomation.tgz': - resolution: {integrity: sha512-wVhFZffEgVUEVkJ/JXkXAw7AgsKAt9t4YdiDqhT85Os3EHVQCfs9zL2GOYo1TsJW8B94xeB1Q8NR5Gjb6tYUsA==, tarball: file:projects/arm-appcomplianceautomation.tgz} + resolution: {integrity: sha512-zB3KF5bcZVyCGC44uZFL/cNLbx9wHvVSixB+MibWs/vUrYJkSjn/aMAla40Y2ohdvSG0MQErrrykZ6xh0/ZzEQ==, tarball: file:projects/arm-appcomplianceautomation.tgz} version: 0.0.0 '@rush-temp/arm-appconfiguration@file:projects/arm-appconfiguration.tgz': - resolution: {integrity: sha512-X9vtg38hrEXVCKUdUFtZRTnbI4l+PzBGYO9lQYuimnRTxCMiTXc6GGjbOVQTTBzUZGfKwqNh0KH8+tCc2uwlPw==, tarball: file:projects/arm-appconfiguration.tgz} + resolution: {integrity: sha512-Ob7iFm0aHcW5QKlrWG9nT9s6qrr/MMxtZUp6PnTwaa0d5fnCzaeODXaJJuLEOuc3/o1JW5duk3dudzYVq/6OJA==, tarball: file:projects/arm-appconfiguration.tgz} version: 0.0.0 '@rush-temp/arm-appcontainers@file:projects/arm-appcontainers.tgz': @@ -2583,7 +2583,7 @@ packages: version: 0.0.0 '@rush-temp/arm-appplatform@file:projects/arm-appplatform.tgz': - resolution: {integrity: sha512-pYseTBkUlllHoClzDUz/xb69DkVEtB8s8qyu5nIqp6AWSiKH39yq8x2rx+EAFkS6AATaZS2rCAZK6E/3wwTLSQ==, tarball: file:projects/arm-appplatform.tgz} + resolution: {integrity: sha512-MAjDVwNRIa2pRHOTitorR3PglJT0Ba7mnsO0O09njccaS+HrRmQ5NNRuYtUTCgaqDQXwWmsdqW0398Fa91zQxA==, tarball: file:projects/arm-appplatform.tgz} version: 0.0.0 '@rush-temp/arm-appservice-1@file:projects/arm-appservice-1.tgz': @@ -3431,7 +3431,7 @@ packages: version: 0.0.0 '@rush-temp/arm-standbypool@file:projects/arm-standbypool.tgz': - resolution: {integrity: sha512-DF5wCFKQyLiFXpQgOkUmz9hReXdMUJhPkrN3AHoQXuZyLx+wA8YEdelvInjVGJ4d0vAT1/QR8TAbM4Cm0VpX+Q==, tarball: file:projects/arm-standbypool.tgz} + resolution: {integrity: sha512-LuQafw2bQkC0xj2L3MaqY1DrKfGIBOdNZK+6Dciu8T+tfXqZsY39wyqpzm4o6lmkYSoeKilp9+BdVOc/uJZbHA==, tarball: file:projects/arm-standbypool.tgz} version: 0.0.0 '@rush-temp/arm-storage-profile-2020-09-01-hybrid@file:projects/arm-storage-profile-2020-09-01-hybrid.tgz': @@ -3643,7 +3643,7 @@ packages: version: 0.0.0 '@rush-temp/core-lro@file:projects/core-lro.tgz': - resolution: {integrity: sha512-JVRq/adT3XVwGXBVhK42yFSTQ+sGrXfQTYCUyzj1c/nbaVSPfj3K38eKQHfTLSAs/UiwdUz9rFkxuo6CQvbkjQ==, tarball: file:projects/core-lro.tgz} + resolution: {integrity: sha512-iITKW8T3h/YUBSQw1PH/UMAsGAtT9EctavUtctF18L5P0PdhwVzI4RSItZq8ZS0ON2tEsZa6lriGDSeuNx8+7w==, tarball: file:projects/core-lro.tgz} version: 0.0.0 '@rush-temp/core-paging@file:projects/core-paging.tgz': @@ -10477,36 +10477,29 @@ snapshots: - supports-color - terser - '@rush-temp/arm-analysisservices@file:projects/arm-analysisservices.tgz(msw@2.7.0(@types/node@22.7.9)(typescript@5.7.3))(vite@5.4.11(@types/node@22.7.9))': + '@rush-temp/arm-analysisservices@file:projects/arm-analysisservices.tgz(@vitest/browser@2.1.8)(msw@2.7.0(@types/node@22.7.9)(typescript@5.7.3))': dependencies: - '@azure/abort-controller': 1.1.0 '@azure/core-lro': 2.7.2 '@types/node': 18.19.70 - '@vitest/browser': 2.1.8(@types/node@18.19.70)(playwright@1.49.1)(typescript@5.7.2)(vite@5.4.11(@types/node@22.7.9))(vitest@2.1.8) '@vitest/coverage-istanbul': 2.1.8(vitest@2.1.8) - playwright: 1.49.1 tslib: 2.8.1 typescript: 5.7.2 vitest: 2.1.8(@types/node@18.19.70)(@vitest/browser@2.1.8)(msw@2.7.0(@types/node@22.7.9)(typescript@5.7.3)) transitivePeerDependencies: - '@edge-runtime/vm' + - '@vitest/browser' - '@vitest/ui' - - bufferutil - happy-dom - jsdom - less - lightningcss - msw - - safaridriver - sass - sass-embedded - stylus - sugarss - supports-color - terser - - utf-8-validate - - vite - - webdriverio '@rush-temp/arm-apicenter@file:projects/arm-apicenter.tgz(@vitest/browser@2.1.8)(msw@2.7.0(@types/node@22.7.9)(typescript@5.7.3))': dependencies: @@ -10560,7 +10553,6 @@ snapshots: '@rush-temp/arm-appcomplianceautomation@file:projects/arm-appcomplianceautomation.tgz(msw@2.7.0(@types/node@22.7.9)(typescript@5.7.3))(vite@5.4.11(@types/node@22.7.9))': dependencies: - '@azure/abort-controller': 1.1.0 '@azure/core-lro': 2.7.2 '@types/node': 18.19.70 '@vitest/browser': 2.1.8(@types/node@18.19.70)(playwright@1.49.1)(typescript@5.7.2)(vite@5.4.11(@types/node@22.7.9))(vitest@2.1.8) @@ -10568,7 +10560,6 @@ snapshots: dotenv: 16.4.7 playwright: 1.49.1 tslib: 2.8.1 - tsx: 4.19.2 typescript: 5.7.2 vitest: 2.1.8(@types/node@18.19.70)(@vitest/browser@2.1.8)(msw@2.7.0(@types/node@22.7.9)(typescript@5.7.3)) transitivePeerDependencies: @@ -10598,13 +10589,9 @@ snapshots: '@types/node': 18.19.70 '@vitest/browser': 2.1.8(@types/node@18.19.70)(playwright@1.49.1)(typescript@5.7.2)(vite@5.4.11(@types/node@22.7.9))(vitest@2.1.8) '@vitest/coverage-istanbul': 2.1.8(vitest@2.1.8) - cross-env: 7.0.3 dotenv: 16.4.7 - mkdirp: 3.0.1 playwright: 1.49.1 - rimraf: 5.0.10 tslib: 2.8.1 - tsx: 4.19.2 typescript: 5.7.2 vitest: 2.1.8(@types/node@18.19.70)(@vitest/browser@2.1.8)(msw@2.7.0(@types/node@22.7.9)(typescript@5.7.3)) transitivePeerDependencies: @@ -10690,7 +10677,6 @@ snapshots: '@rush-temp/arm-appplatform@file:projects/arm-appplatform.tgz(msw@2.7.0(@types/node@22.7.9)(typescript@5.7.3))(vite@5.4.11(@types/node@22.7.9))': dependencies: - '@azure/abort-controller': 1.1.0 '@azure/core-lro': 2.7.2 '@types/node': 18.19.70 '@vitest/browser': 2.1.8(@types/node@18.19.70)(playwright@1.49.1)(typescript@5.7.2)(vite@5.4.11(@types/node@22.7.9))(vitest@2.1.8) @@ -15478,15 +15464,15 @@ snapshots: '@rush-temp/arm-standbypool@file:projects/arm-standbypool.tgz(msw@2.7.0(@types/node@22.7.9)(typescript@5.7.3))(vite@5.4.11(@types/node@22.7.9))': dependencies: + '@microsoft/api-extractor': 7.48.1(@types/node@18.19.70) '@types/node': 18.19.70 - '@vitest/browser': 2.1.8(@types/node@18.19.70)(playwright@1.49.1)(typescript@5.7.2)(vite@5.4.11(@types/node@22.7.9))(vitest@2.1.8) + '@vitest/browser': 2.1.8(@types/node@18.19.70)(playwright@1.49.1)(typescript@5.6.3)(vite@5.4.11(@types/node@22.7.9))(vitest@2.1.8) '@vitest/coverage-istanbul': 2.1.8(vitest@2.1.8) dotenv: 16.4.7 eslint: 9.17.0 playwright: 1.49.1 - prettier: 3.4.2 tslib: 2.8.1 - typescript: 5.7.2 + typescript: 5.6.3 vitest: 2.1.8(@types/node@18.19.70)(@vitest/browser@2.1.8)(msw@2.7.0(@types/node@22.7.9)(typescript@5.7.3)) transitivePeerDependencies: - '@edge-runtime/vm' diff --git a/sdk/standbypool/arm-standbypool/CHANGELOG.md b/sdk/standbypool/arm-standbypool/CHANGELOG.md index caf9a735a7df..f2e48a247acb 100644 --- a/sdk/standbypool/arm-standbypool/CHANGELOG.md +++ b/sdk/standbypool/arm-standbypool/CHANGELOG.md @@ -1,15 +1,22 @@ # Release History - -## 1.0.2 (Unreleased) - + +## 2.0.0 (2025-01-10) + ### Features Added -### Breaking Changes + - Added Enum KnownVersions + - Enum KnownOrigin has a new value "user,system" + - Enum KnownOrigin has a new value system + - Enum KnownOrigin has a new value user + - Enum KnownRefillPolicy has a new value always -### Bugs Fixed - -### Other Changes +### Breaking Changes + - Enum KnownOrigin no longer has value System + - Enum KnownOrigin no longer has value User + - Enum KnownOrigin no longer has value UserSystem + - Enum KnownRefillPolicy no longer has value Always + ## 1.0.1 (2024-11-04) ### Bugs Fixed diff --git a/sdk/standbypool/arm-standbypool/LICENSE b/sdk/standbypool/arm-standbypool/LICENSE index 7d5934740965..2ad4de7b17f0 100644 --- a/sdk/standbypool/arm-standbypool/LICENSE +++ b/sdk/standbypool/arm-standbypool/LICENSE @@ -1,6 +1,6 @@ The MIT License (MIT) -Copyright (c) 2024 Microsoft +Copyright (c) 2025 Microsoft Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal diff --git a/sdk/standbypool/arm-standbypool/README.md b/sdk/standbypool/arm-standbypool/README.md index d4d162475520..50be1255b4c7 100644 --- a/sdk/standbypool/arm-standbypool/README.md +++ b/sdk/standbypool/arm-standbypool/README.md @@ -1,11 +1,14 @@ -# Azure StandbyPoolManagement client library for JavaScript +# Azure StandbyPool client library for JavaScript -This package contains an isomorphic SDK (runs both in Node.js and in browsers) for Azure StandbyPoolManagement client. +This package contains an isomorphic SDK (runs both in Node.js and in browsers) for Azure StandbyPool client. -[Source code](https://github.com/Azure/azure-sdk-for-js/tree/main/sdk/standbypool/arm-standbypool) | -[Package (NPM)](https://www.npmjs.com/package/@azure/arm-standbypool) | -[API reference documentation](https://learn.microsoft.com/javascript/api/@azure/arm-standbypool?view=azure-node-preview) | -[Samples](https://github.com/Azure-Samples/azure-samples-js-management) + + +Key links: + +- [Source code](https://github.com/Azure/azure-sdk-for-js/tree/main/sdk/standbypool/arm-standbypool) +- [Package (NPM)](https://www.npmjs.com/package/@azure/arm-standbypool) +- [API reference documentation](https://docs.microsoft.com/javascript/api/@azure/arm-standbypool?view=azure-node-preview) ## Getting started @@ -22,16 +25,16 @@ See our [support policy](https://github.com/Azure/azure-sdk-for-js/blob/main/SUP ### Install the `@azure/arm-standbypool` package -Install the Azure StandbyPoolManagement client library for JavaScript with `npm`: +Install the Azure StandbyPool client library for JavaScript with `npm`: ```bash npm install @azure/arm-standbypool ``` -### Create and authenticate a `StandbyPoolManagementClient` +### Create and authenticate a `StandbyPoolClient` -To create a client object to access the Azure StandbyPoolManagement API, you will need the `endpoint` of your Azure StandbyPoolManagement resource and a `credential`. The Azure StandbyPoolManagement client can use Azure Active Directory credentials to authenticate. -You can find the endpoint for your Azure StandbyPoolManagement resource in the [Azure Portal][azure_portal]. +To create a client object to access the Azure StandbyPool API, you will need the `endpoint` of your Azure StandbyPool resource and a `credential`. The Azure StandbyPool client can use Azure Active Directory credentials to authenticate. +You can find the endpoint for your Azure StandbyPool 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). @@ -42,35 +45,34 @@ npm install @azure/identity ``` You will also need to **register a new AAD application and grant access to Azure StandbyPool** 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://learn.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal). +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 { StandbyPoolManagementClient } = require("@azure/arm-standbypool"); +const { StandbyPoolClient } = require("@azure/arm-standbypool"); 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 StandbyPoolManagementClient(new DefaultAzureCredential(), subscriptionId); +const client = new StandbyPoolClient(new DefaultAzureCredential(), subscriptionId); // For client-side applications running in the browser, use this code instead: // const credential = new InteractiveBrowserCredential({ // tenantId: "", // clientId: "" // }); -// const client = new StandbyPoolManagementClient(credential, subscriptionId); +// const client = new StandbyPoolClient(credential, subscriptionId); ``` -### JavaScript Bundle +### JavaScript Bundle To use this client library in the browser, first you need to use a bundler. For details on how to do this, please refer to our [bundling documentation](https://aka.ms/AzureSDKBundling). ## Key concepts -### StandbyPoolManagementClient +### StandbyPoolClient -`StandbyPoolManagementClient` is the primary interface for developers using the Azure StandbyPoolManagement client library. Explore the methods on this client object to understand the different features of the Azure StandbyPoolManagement service that you can access. +`StandbyPoolClient` is the primary interface for developers using the Azure StandbyPool client library. Explore the methods on this client object to understand the different features of the Azure StandbyPool service that you can access. ## Troubleshooting @@ -85,6 +87,7 @@ 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). + ## Contributing If you'd like to contribute to this library, please read the [contributing guide](https://github.com/Azure/azure-sdk-for-js/blob/main/CONTRIBUTING.md) to learn more about how to build and test the code. diff --git a/sdk/standbypool/arm-standbypool/api-extractor.json b/sdk/standbypool/arm-standbypool/api-extractor.json index e5e9fb5cfc7c..9102780dc1e2 100644 --- a/sdk/standbypool/arm-standbypool/api-extractor.json +++ b/sdk/standbypool/arm-standbypool/api-extractor.json @@ -1,18 +1,31 @@ { "$schema": "https://developer.microsoft.com/json-schemas/api-extractor/v7/api-extractor.schema.json", - "mainEntryPointFilePath": "./dist/esm/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-standbypool.d.ts" + "publicTrimmedFilePath": "dist/arm-standbypool.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" + } } } } diff --git a/sdk/standbypool/arm-standbypool/assets.json b/sdk/standbypool/arm-standbypool/assets.json deleted file mode 100644 index 8396f9b36ed5..000000000000 --- a/sdk/standbypool/arm-standbypool/assets.json +++ /dev/null @@ -1,6 +0,0 @@ -{ - "AssetsRepo": "Azure/azure-sdk-assets", - "AssetsRepoPrefixPath": "js", - "TagPrefix": "js/standbypool/arm-standbypool", - "Tag": "js/standbypool/arm-standbypool_128c5a15a5" -} diff --git a/sdk/standbypool/arm-standbypool/eslint.config.mjs b/sdk/standbypool/arm-standbypool/eslint.config.mjs new file mode 100644 index 000000000000..03244d34a19f --- /dev/null +++ b/sdk/standbypool/arm-standbypool/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/standbypool/arm-standbypool/package.json b/sdk/standbypool/arm-standbypool/package.json index 57faa7d236e1..79d7a5241033 100644 --- a/sdk/standbypool/arm-standbypool/package.json +++ b/sdk/standbypool/arm-standbypool/package.json @@ -1,6 +1,6 @@ { "name": "@azure/arm-standbypool", - "version": "1.0.2", + "version": "2.0.0", "description": "A generated SDK for StandbyPoolClient.", "engines": { "node": ">=18.0.0" @@ -8,10 +8,10 @@ "sideEffects": false, "autoPublish": false, "tshy": { + "project": "./tsconfig.src.json", "exports": { "./package.json": "./package.json", - ".": "./src/index.ts", - "./models": "./src/models/index.ts" + ".": "./src/index.ts" }, "dialects": [ "esm", @@ -21,8 +21,7 @@ "browser", "react-native" ], - "selfLink": false, - "project": "./tsconfig.src.json" + "selfLink": false }, "type": "module", "keywords": [ @@ -36,10 +35,10 @@ "author": "Microsoft Corporation", "license": "MIT", "files": [ - "dist", + "dist/", "README.md", "LICENSE", - "review/*", + "review/", "CHANGELOG.md" ], "sdk-type": "mgmt", @@ -47,6 +46,7 @@ "bugs": { "url": "https://github.com/Azure/azure-sdk-for-js/issues" }, + "homepage": "https://github.com/Azure/azure-sdk-for-js/tree/main/sdk/standbypool/arm-standbypool/README.md", "prettier": "@azure/eslint-plugin-azure-sdk/prettier.json", "//metadata": { "constantPaths": [ @@ -57,10 +57,10 @@ ] }, "dependencies": { - "@azure-rest/core-client": "^2.1.0", + "@azure-rest/core-client": "^2.3.1", "@azure/abort-controller": "^2.1.2", "@azure/core-auth": "^1.6.0", - "@azure/core-lro": "^3.0.0", + "@azure/core-lro": "^3.1.0", "@azure/core-rest-pipeline": "^1.5.0", "@azure/core-util": "^1.9.2", "@azure/logger": "^1.0.0", @@ -68,53 +68,48 @@ }, "devDependencies": { "@azure-tools/test-credential": "^2.0.0", - "@azure-tools/test-recorder": "^4.0.0", + "@azure-tools/test-recorder": "^4.1.0", + "@azure-tools/test-utils-vitest": "^1.0.0", "@azure/dev-tool": "^1.0.0", "@azure/eslint-plugin-azure-sdk": "^3.0.0", "@azure/identity": "^4.2.1", + "@microsoft/api-extractor": "^7.40.3", "@types/node": "^18.0.0", - "@vitest/browser": "^2.0.5", - "@vitest/coverage-istanbul": "^2.0.5", + "@vitest/browser": "^2.1.8", + "@vitest/coverage-istanbul": "^2.1.8", "dotenv": "^16.0.0", "eslint": "^9.9.0", - "playwright": "^1.41.2", - "prettier": "^3.2.5", - "typescript": "~5.7.2", - "vitest": "^2.0.5" + "playwright": "^1.49.1", + "typescript": "~5.6.2", + "vitest": "^2.1.8" }, "scripts": { "build": "npm run clean && dev-tool run build-package && dev-tool run vendored mkdirp ./review && dev-tool run extract-api", - "build:samples": "tsc -p tsconfig.samples.json && dev-tool samples publish -f", + "build:samples": "echo skipped", "build:test": "npm run clean && dev-tool run build-package && dev-tool run build-test", - "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}\" \"samples-dev/*.ts\"", + "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}\" ", "clean": "dev-tool run vendored rimraf --glob dist dist-browser dist-esm test-dist temp types *.tgz *.log", - "execute:samples": "dev-tool samples run samples-dev", + "execute:samples": "echo skipped", "extract-api": "dev-tool run vendored rimraf review && dev-tool run vendored mkdirp ./review && dev-tool run extract-api", - "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}\" \"samples-dev/*.ts\"", + "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", "integration-test": "npm run integration-test:node && npm run integration-test:browser", "integration-test:browser": "echo skipped", - "integration-test:node": "echo skipped", - "lint": "echo skipped", - "lint:fix": "echo skipped", + "integration-test:node": "dev-tool run test:vitest --esm", + "lint": "eslint package.json api-extractor.json src test", + "lint:fix": "eslint package.json api-extractor.json src test --fix --fix-type [problem,suggestion]", "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", "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", "test:browser": "npm run clean && npm run build:test && npm run unit-test:browser && npm run integration-test:browser", "test:node": "npm run clean && dev-tool run build-package && npm run unit-test:node && npm run integration-test:node", "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:browser": "npm run clean && dev-tool run build-package && dev-tool run build-test && dev-tool run test:vitest --browser", "unit-test:node": "dev-tool run test:vitest", "update-snippets": "echo skipped" }, - "//sampleConfiguration": { - "productName": "@azure/arm-standbypool", - "productSlugs": [ - "azure" - ], - "disableDocsMs": true, - "apiRefLink": "https://learn.microsoft.com/javascript/api/@azure/arm-standbypool?view=azure-node-preview" - }, + "browser": "./dist/browser/index.js", + "react-native": "./dist/react-native/index.js", "exports": { "./package.json": "./package.json", ".": { @@ -134,24 +129,6 @@ "types": "./dist/commonjs/index.d.ts", "default": "./dist/commonjs/index.js" } - }, - "./models": { - "browser": { - "types": "./dist/browser/models/index.d.ts", - "default": "./dist/browser/models/index.js" - }, - "react-native": { - "types": "./dist/react-native/models/index.d.ts", - "default": "./dist/react-native/models/index.js" - }, - "import": { - "types": "./dist/esm/models/index.d.ts", - "default": "./dist/esm/models/index.js" - }, - "require": { - "types": "./dist/commonjs/models/index.d.ts", - "default": "./dist/commonjs/models/index.js" - } } }, "main": "./dist/commonjs/index.js", diff --git a/sdk/standbypool/arm-standbypool/review/arm-standbypool-models.api.md b/sdk/standbypool/arm-standbypool/review/arm-standbypool-models.api.md deleted file mode 100644 index 72b428d685ba..000000000000 --- a/sdk/standbypool/arm-standbypool/review/arm-standbypool-models.api.md +++ /dev/null @@ -1,322 +0,0 @@ -## API Report File for "@azure/arm-standbypool" - -> Do not edit this file. It is a report generated by [API Extractor](https://api-extractor.com/). - -```ts - -import { OperationOptions } from '@azure-rest/core-client'; - -// @public -export type ActionType = string; - -// @public -export interface ContainerGroupInstanceCountSummary { - instanceCountsByState: PoolResourceStateCount[]; -} - -// @public -export interface ContainerGroupProfile { - id: string; - revision?: number; -} - -// @public -export interface ContainerGroupProperties { - containerGroupProfile: ContainerGroupProfile; - subnetIds?: Subnet[]; -} - -// @public -export type CreatedByType = string; - -// @public -export enum KnownActionType { - Internal = "Internal" -} - -// @public -export enum KnownCreatedByType { - Application = "Application", - Key = "Key", - ManagedIdentity = "ManagedIdentity", - User = "User" -} - -// @public -export enum KnownOrigin { - System = "system", - User = "user", - UserSystem = "user,system" -} - -// @public -export enum KnownProvisioningState { - Canceled = "Canceled", - Deleting = "Deleting", - Failed = "Failed", - Succeeded = "Succeeded" -} - -// @public -export enum KnownRefillPolicy { - Always = "always" -} - -// @public -export enum KnownVirtualMachineState { - Deallocated = "Deallocated", - Running = "Running" -} - -// @public -export interface Operation { - actionType?: ActionType; - readonly 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 OperationsListOptionalParams extends OperationOptions { -} - -// @public -export type Origin = string; - -// @public -export interface PoolResourceStateCount { - count: number; - state: string; -} - -// @public -export type ProvisioningState = string; - -// @public -export interface ProxyResource extends Resource { -} - -// @public -export type RefillPolicy = string; - -// @public -export interface Resource { - readonly id?: string; - readonly name?: string; - readonly systemData?: SystemData; - readonly type?: string; -} - -// @public -export interface StandbyContainerGroupPoolElasticityProfile { - maxReadyCapacity: number; - refillPolicy?: RefillPolicy; -} - -// @public -export interface StandbyContainerGroupPoolResource extends TrackedResource { - properties?: StandbyContainerGroupPoolResourceProperties; -} - -// @public -export interface StandbyContainerGroupPoolResourceProperties { - containerGroupProperties: ContainerGroupProperties; - elasticityProfile: StandbyContainerGroupPoolElasticityProfile; - readonly provisioningState?: ProvisioningState; -} - -// @public -export interface StandbyContainerGroupPoolResourceUpdate { - properties?: StandbyContainerGroupPoolResourceUpdateProperties; - tags?: Record; -} - -// @public -export interface StandbyContainerGroupPoolResourceUpdateProperties { - containerGroupProperties?: ContainerGroupProperties; - elasticityProfile?: StandbyContainerGroupPoolElasticityProfile; -} - -// @public -export interface StandbyContainerGroupPoolRuntimeViewResource extends ProxyResource { - properties?: StandbyContainerGroupPoolRuntimeViewResourceProperties; -} - -// @public -export interface StandbyContainerGroupPoolRuntimeViewResourceProperties { - readonly instanceCountSummary: ContainerGroupInstanceCountSummary[]; - readonly provisioningState?: ProvisioningState; -} - -// @public -export interface StandbyContainerGroupPoolRuntimeViewsGetOptionalParams extends OperationOptions { -} - -// @public -export interface StandbyContainerGroupPoolRuntimeViewsListByStandbyPoolOptionalParams extends OperationOptions { -} - -// @public -export interface StandbyContainerGroupPoolsCreateOrUpdateOptionalParams extends OperationOptions { - updateIntervalInMs?: number; -} - -// @public -export interface StandbyContainerGroupPoolsDeleteOptionalParams extends OperationOptions { - updateIntervalInMs?: number; -} - -// @public -export interface StandbyContainerGroupPoolsGetOptionalParams extends OperationOptions { -} - -// @public -export interface StandbyContainerGroupPoolsListByResourceGroupOptionalParams extends OperationOptions { -} - -// @public -export interface StandbyContainerGroupPoolsListBySubscriptionOptionalParams extends OperationOptions { -} - -// @public -export interface StandbyContainerGroupPoolsUpdateOptionalParams extends OperationOptions { -} - -// @public -export interface StandbyVirtualMachinePoolElasticityProfile { - maxReadyCapacity: number; - minReadyCapacity?: number; -} - -// @public -export interface StandbyVirtualMachinePoolResource extends TrackedResource { - properties?: StandbyVirtualMachinePoolResourceProperties; -} - -// @public -export interface StandbyVirtualMachinePoolResourceProperties { - attachedVirtualMachineScaleSetId?: string; - elasticityProfile?: StandbyVirtualMachinePoolElasticityProfile; - readonly provisioningState?: ProvisioningState; - virtualMachineState: VirtualMachineState; -} - -// @public -export interface StandbyVirtualMachinePoolResourceUpdate { - properties?: StandbyVirtualMachinePoolResourceUpdateProperties; - tags?: Record; -} - -// @public -export interface StandbyVirtualMachinePoolResourceUpdateProperties { - attachedVirtualMachineScaleSetId?: string; - elasticityProfile?: StandbyVirtualMachinePoolElasticityProfile; - virtualMachineState?: VirtualMachineState; -} - -// @public -export interface StandbyVirtualMachinePoolRuntimeViewResource extends ProxyResource { - properties?: StandbyVirtualMachinePoolRuntimeViewResourceProperties; -} - -// @public -export interface StandbyVirtualMachinePoolRuntimeViewResourceProperties { - readonly instanceCountSummary: VirtualMachineInstanceCountSummary[]; - readonly provisioningState?: ProvisioningState; -} - -// @public -export interface StandbyVirtualMachinePoolRuntimeViewsGetOptionalParams extends OperationOptions { -} - -// @public -export interface StandbyVirtualMachinePoolRuntimeViewsListByStandbyPoolOptionalParams extends OperationOptions { -} - -// @public -export interface StandbyVirtualMachinePoolsCreateOrUpdateOptionalParams extends OperationOptions { - updateIntervalInMs?: number; -} - -// @public -export interface StandbyVirtualMachinePoolsDeleteOptionalParams extends OperationOptions { - updateIntervalInMs?: number; -} - -// @public -export interface StandbyVirtualMachinePoolsGetOptionalParams extends OperationOptions { -} - -// @public -export interface StandbyVirtualMachinePoolsListByResourceGroupOptionalParams extends OperationOptions { -} - -// @public -export interface StandbyVirtualMachinePoolsListBySubscriptionOptionalParams extends OperationOptions { -} - -// @public -export interface StandbyVirtualMachinePoolsUpdateOptionalParams extends OperationOptions { -} - -// @public -export interface StandbyVirtualMachineResource extends ProxyResource { - properties?: StandbyVirtualMachineResourceProperties; -} - -// @public -export interface StandbyVirtualMachineResourceProperties { - readonly provisioningState?: ProvisioningState; - virtualMachineResourceId: string; -} - -// @public -export interface StandbyVirtualMachinesGetOptionalParams extends OperationOptions { -} - -// @public -export interface StandbyVirtualMachinesListByStandbyVirtualMachinePoolResourceOptionalParams extends OperationOptions { -} - -// @public -export interface Subnet { - id: string; -} - -// @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?: Record; -} - -// @public -export interface VirtualMachineInstanceCountSummary { - instanceCountsByState: PoolResourceStateCount[]; - zone?: number; -} - -// @public -export type VirtualMachineState = string; - -// (No @packageDocumentation comment for this package) - -``` diff --git a/sdk/standbypool/arm-standbypool/review/arm-standbypool.api.md b/sdk/standbypool/arm-standbypool/review/arm-standbypool.api.md index 4a77b7ef7436..3ead3851091a 100644 --- a/sdk/standbypool/arm-standbypool/review/arm-standbypool.api.md +++ b/sdk/standbypool/arm-standbypool/review/arm-standbypool.api.md @@ -56,9 +56,9 @@ export enum KnownCreatedByType { // @public export enum KnownOrigin { - System = "system", - User = "user", - UserSystem = "user,system" + "user,system" = "user,system", + system = "system", + user = "user" } // @public @@ -71,7 +71,12 @@ export enum KnownProvisioningState { // @public export enum KnownRefillPolicy { - Always = "always" + always = "always" +} + +// @public +export enum KnownVersions { + "2024-03-01" = "2024-03-01" } // @public @@ -82,8 +87,8 @@ export enum KnownVirtualMachineState { // @public export interface Operation { - actionType?: ActionType; - readonly display?: OperationDisplay; + readonly actionType?: ActionType; + display?: OperationDisplay; readonly isDataAction?: boolean; readonly name?: string; readonly origin?: Origin; diff --git a/sdk/standbypool/arm-standbypool/sample.env b/sdk/standbypool/arm-standbypool/sample.env index efbc7787bd3b..508439fc7d62 100644 --- a/sdk/standbypool/arm-standbypool/sample.env +++ b/sdk/standbypool/arm-standbypool/sample.env @@ -1 +1 @@ -# Feel free to add your own environment variables. +# Feel free to add your own environment variables. \ No newline at end of file diff --git a/sdk/standbypool/arm-standbypool/samples-dev/operationsListSample.ts b/sdk/standbypool/arm-standbypool/samples-dev/operationsListSample.ts deleted file mode 100644 index 49bd314d08e6..000000000000 --- a/sdk/standbypool/arm-standbypool/samples-dev/operationsListSample.ts +++ /dev/null @@ -1,29 +0,0 @@ -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. - -import { StandbyPoolManagementClient } from "@azure/arm-standbypool"; -import { DefaultAzureCredential } from "@azure/identity"; - -/** - * This sample demonstrates how to list the operations for the provider - * - * @summary list the operations for the provider - * x-ms-original-file: 2024-03-01/Operations_List.json - */ -async function operationsList() { - const credential = new DefaultAzureCredential(); - const subscriptionId = "00000000-0000-0000-0000-00000000000"; - const client = new StandbyPoolManagementClient(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/standbypool/arm-standbypool/samples-dev/standbyContainerGroupPoolRuntimeViewsGetSample.ts b/sdk/standbypool/arm-standbypool/samples-dev/standbyContainerGroupPoolRuntimeViewsGetSample.ts deleted file mode 100644 index c332e9b97753..000000000000 --- a/sdk/standbypool/arm-standbypool/samples-dev/standbyContainerGroupPoolRuntimeViewsGetSample.ts +++ /dev/null @@ -1,29 +0,0 @@ -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. - -import { StandbyPoolManagementClient } from "@azure/arm-standbypool"; -import { DefaultAzureCredential } from "@azure/identity"; - -/** - * This sample demonstrates how to get a StandbyContainerGroupPoolRuntimeViewResource - * - * @summary get a StandbyContainerGroupPoolRuntimeViewResource - * x-ms-original-file: 2024-03-01/StandbyContainerGroupPoolRuntimeViews_Get.json - */ -async function standbyContainerGroupPoolRuntimeViewsGet() { - const credential = new DefaultAzureCredential(); - const subscriptionId = "00000000-0000-0000-0000-000000000009"; - const client = new StandbyPoolManagementClient(credential, subscriptionId); - const result = await client.standbyContainerGroupPoolRuntimeViews.get( - "rgstandbypool", - "pool", - "latest", - ); - console.log(result); -} - -async function main() { - standbyContainerGroupPoolRuntimeViewsGet(); -} - -main().catch(console.error); diff --git a/sdk/standbypool/arm-standbypool/samples-dev/standbyContainerGroupPoolRuntimeViewsListByStandbyPoolSample.ts b/sdk/standbypool/arm-standbypool/samples-dev/standbyContainerGroupPoolRuntimeViewsListByStandbyPoolSample.ts deleted file mode 100644 index 9b2cec06f54c..000000000000 --- a/sdk/standbypool/arm-standbypool/samples-dev/standbyContainerGroupPoolRuntimeViewsListByStandbyPoolSample.ts +++ /dev/null @@ -1,32 +0,0 @@ -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. - -import { StandbyPoolManagementClient } from "@azure/arm-standbypool"; -import { DefaultAzureCredential } from "@azure/identity"; - -/** - * This sample demonstrates how to list StandbyContainerGroupPoolRuntimeViewResource resources by StandbyContainerGroupPoolResource - * - * @summary list StandbyContainerGroupPoolRuntimeViewResource resources by StandbyContainerGroupPoolResource - * x-ms-original-file: 2024-03-01/StandbyContainerGroupPoolRuntimeViews_ListByStandbyPool.json - */ -async function standbyContainerGroupPoolRuntimeViewsListByStandbyPool() { - const credential = new DefaultAzureCredential(); - const subscriptionId = "00000000-0000-0000-0000-000000000009"; - const client = new StandbyPoolManagementClient(credential, subscriptionId); - const resArray = new Array(); - for await (let item of client.standbyContainerGroupPoolRuntimeViews.listByStandbyPool( - "rgstandbypool", - "pool", - )) { - resArray.push(item); - } - - console.log(resArray); -} - -async function main() { - standbyContainerGroupPoolRuntimeViewsListByStandbyPool(); -} - -main().catch(console.error); diff --git a/sdk/standbypool/arm-standbypool/samples-dev/standbyContainerGroupPoolsCreateOrUpdateSample.ts b/sdk/standbypool/arm-standbypool/samples-dev/standbyContainerGroupPoolsCreateOrUpdateSample.ts deleted file mode 100644 index bdaeaf05da9c..000000000000 --- a/sdk/standbypool/arm-standbypool/samples-dev/standbyContainerGroupPoolsCreateOrUpdateSample.ts +++ /dev/null @@ -1,42 +0,0 @@ -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. - -import { StandbyPoolManagementClient } from "@azure/arm-standbypool"; -import { DefaultAzureCredential } from "@azure/identity"; - -/** - * This sample demonstrates how to create a StandbyContainerGroupPoolResource - * - * @summary create a StandbyContainerGroupPoolResource - * x-ms-original-file: 2024-03-01/StandbyContainerGroupPools_CreateOrUpdate.json - */ -async function standbyContainerGroupPoolsCreateOrUpdate() { - const credential = new DefaultAzureCredential(); - const subscriptionId = "00000000-0000-0000-0000-000000000009"; - const client = new StandbyPoolManagementClient(credential, subscriptionId); - const result = await client.standbyContainerGroupPools.createOrUpdate("rgstandbypool", "pool", { - properties: { - elasticityProfile: { maxReadyCapacity: 688, refillPolicy: "always" }, - containerGroupProperties: { - containerGroupProfile: { - id: "/subscriptions/00000000-0000-0000-0000-000000000009/resourceGroups/rgstandbypool/providers/Microsoft.ContainerInstance/containerGroupProfiles/cgProfile", - revision: 1, - }, - subnetIds: [ - { - id: "/subscriptions/00000000-0000-0000-0000-000000000009/resourceGroups/rgstandbypool/providers/Microsoft.Network/virtualNetworks/cgSubnet/subnets/cgSubnet", - }, - ], - }, - }, - tags: {}, - location: "West US", - }); - console.log(result); -} - -async function main() { - standbyContainerGroupPoolsCreateOrUpdate(); -} - -main().catch(console.error); diff --git a/sdk/standbypool/arm-standbypool/samples-dev/standbyContainerGroupPoolsDeleteSample.ts b/sdk/standbypool/arm-standbypool/samples-dev/standbyContainerGroupPoolsDeleteSample.ts deleted file mode 100644 index 3cd4b4c38705..000000000000 --- a/sdk/standbypool/arm-standbypool/samples-dev/standbyContainerGroupPoolsDeleteSample.ts +++ /dev/null @@ -1,24 +0,0 @@ -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. - -import { StandbyPoolManagementClient } from "@azure/arm-standbypool"; -import { DefaultAzureCredential } from "@azure/identity"; - -/** - * This sample demonstrates how to delete a StandbyContainerGroupPoolResource - * - * @summary delete a StandbyContainerGroupPoolResource - * x-ms-original-file: 2024-03-01/StandbyContainerGroupPools_Delete.json - */ -async function standbyContainerGroupPoolsDelete() { - const credential = new DefaultAzureCredential(); - const subscriptionId = "00000000-0000-0000-0000-000000000009"; - const client = new StandbyPoolManagementClient(credential, subscriptionId); - await client.standbyContainerGroupPools.delete("rgstandbypool", "pool"); -} - -async function main() { - standbyContainerGroupPoolsDelete(); -} - -main().catch(console.error); diff --git a/sdk/standbypool/arm-standbypool/samples-dev/standbyContainerGroupPoolsGetSample.ts b/sdk/standbypool/arm-standbypool/samples-dev/standbyContainerGroupPoolsGetSample.ts deleted file mode 100644 index 1ac71a70ed77..000000000000 --- a/sdk/standbypool/arm-standbypool/samples-dev/standbyContainerGroupPoolsGetSample.ts +++ /dev/null @@ -1,25 +0,0 @@ -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. - -import { StandbyPoolManagementClient } from "@azure/arm-standbypool"; -import { DefaultAzureCredential } from "@azure/identity"; - -/** - * This sample demonstrates how to get a StandbyContainerGroupPoolResource - * - * @summary get a StandbyContainerGroupPoolResource - * x-ms-original-file: 2024-03-01/StandbyContainerGroupPools_Get.json - */ -async function standbyContainerGroupPoolsGet() { - const credential = new DefaultAzureCredential(); - const subscriptionId = "00000000-0000-0000-0000-000000000009"; - const client = new StandbyPoolManagementClient(credential, subscriptionId); - const result = await client.standbyContainerGroupPools.get("rgstandbypool", "pool"); - console.log(result); -} - -async function main() { - standbyContainerGroupPoolsGet(); -} - -main().catch(console.error); diff --git a/sdk/standbypool/arm-standbypool/samples-dev/standbyContainerGroupPoolsListByResourceGroupSample.ts b/sdk/standbypool/arm-standbypool/samples-dev/standbyContainerGroupPoolsListByResourceGroupSample.ts deleted file mode 100644 index 685eed5edd66..000000000000 --- a/sdk/standbypool/arm-standbypool/samples-dev/standbyContainerGroupPoolsListByResourceGroupSample.ts +++ /dev/null @@ -1,29 +0,0 @@ -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. - -import { StandbyPoolManagementClient } from "@azure/arm-standbypool"; -import { DefaultAzureCredential } from "@azure/identity"; - -/** - * This sample demonstrates how to list StandbyContainerGroupPoolResource resources by resource group - * - * @summary list StandbyContainerGroupPoolResource resources by resource group - * x-ms-original-file: 2024-03-01/StandbyContainerGroupPools_ListByResourceGroup.json - */ -async function standbyContainerGroupPoolsListByResourceGroup() { - const credential = new DefaultAzureCredential(); - const subscriptionId = "00000000-0000-0000-0000-000000000009"; - const client = new StandbyPoolManagementClient(credential, subscriptionId); - const resArray = new Array(); - for await (let item of client.standbyContainerGroupPools.listByResourceGroup("rgstandbypool")) { - resArray.push(item); - } - - console.log(resArray); -} - -async function main() { - standbyContainerGroupPoolsListByResourceGroup(); -} - -main().catch(console.error); diff --git a/sdk/standbypool/arm-standbypool/samples-dev/standbyContainerGroupPoolsListBySubscriptionSample.ts b/sdk/standbypool/arm-standbypool/samples-dev/standbyContainerGroupPoolsListBySubscriptionSample.ts deleted file mode 100644 index 0e388ebccf42..000000000000 --- a/sdk/standbypool/arm-standbypool/samples-dev/standbyContainerGroupPoolsListBySubscriptionSample.ts +++ /dev/null @@ -1,29 +0,0 @@ -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. - -import { StandbyPoolManagementClient } from "@azure/arm-standbypool"; -import { DefaultAzureCredential } from "@azure/identity"; - -/** - * This sample demonstrates how to list StandbyContainerGroupPoolResource resources by subscription ID - * - * @summary list StandbyContainerGroupPoolResource resources by subscription ID - * x-ms-original-file: 2024-03-01/StandbyContainerGroupPools_ListBySubscription.json - */ -async function standbyContainerGroupPoolsListBySubscription() { - const credential = new DefaultAzureCredential(); - const subscriptionId = "00000000-0000-0000-0000-000000000009"; - const client = new StandbyPoolManagementClient(credential, subscriptionId); - const resArray = new Array(); - for await (let item of client.standbyContainerGroupPools.listBySubscription()) { - resArray.push(item); - } - - console.log(resArray); -} - -async function main() { - standbyContainerGroupPoolsListBySubscription(); -} - -main().catch(console.error); diff --git a/sdk/standbypool/arm-standbypool/samples-dev/standbyContainerGroupPoolsUpdateSample.ts b/sdk/standbypool/arm-standbypool/samples-dev/standbyContainerGroupPoolsUpdateSample.ts deleted file mode 100644 index 635c23982de8..000000000000 --- a/sdk/standbypool/arm-standbypool/samples-dev/standbyContainerGroupPoolsUpdateSample.ts +++ /dev/null @@ -1,41 +0,0 @@ -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. - -import { StandbyPoolManagementClient } from "@azure/arm-standbypool"; -import { DefaultAzureCredential } from "@azure/identity"; - -/** - * This sample demonstrates how to update a StandbyContainerGroupPoolResource - * - * @summary update a StandbyContainerGroupPoolResource - * x-ms-original-file: 2024-03-01/StandbyContainerGroupPools_Update.json - */ -async function standbyContainerGroupPoolsUpdate() { - const credential = new DefaultAzureCredential(); - const subscriptionId = "00000000-0000-0000-0000-000000000009"; - const client = new StandbyPoolManagementClient(credential, subscriptionId); - const result = await client.standbyContainerGroupPools.update("rgstandbypool", "pool", { - tags: {}, - properties: { - elasticityProfile: { maxReadyCapacity: 1743, refillPolicy: "always" }, - containerGroupProperties: { - containerGroupProfile: { - id: "/subscriptions/00000000-0000-0000-0000-000000000009/resourceGroups/rgstandbypool/providers/Microsoft.ContainerInstance/containerGroupProfiles/cgProfile", - revision: 2, - }, - subnetIds: [ - { - id: "/subscriptions/00000000-0000-0000-0000-000000000009/resourceGroups/rgstandbypool/providers/Microsoft.Network/virtualNetworks/cgSubnet/subnets/cgSubnet", - }, - ], - }, - }, - }); - console.log(result); -} - -async function main() { - standbyContainerGroupPoolsUpdate(); -} - -main().catch(console.error); diff --git a/sdk/standbypool/arm-standbypool/samples-dev/standbyVirtualMachinePoolRuntimeViewsGetSample.ts b/sdk/standbypool/arm-standbypool/samples-dev/standbyVirtualMachinePoolRuntimeViewsGetSample.ts deleted file mode 100644 index 7811a499ab75..000000000000 --- a/sdk/standbypool/arm-standbypool/samples-dev/standbyVirtualMachinePoolRuntimeViewsGetSample.ts +++ /dev/null @@ -1,29 +0,0 @@ -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. - -import { StandbyPoolManagementClient } from "@azure/arm-standbypool"; -import { DefaultAzureCredential } from "@azure/identity"; - -/** - * This sample demonstrates how to get a StandbyVirtualMachinePoolRuntimeViewResource - * - * @summary get a StandbyVirtualMachinePoolRuntimeViewResource - * x-ms-original-file: 2024-03-01/StandbyVirtualMachinePoolRuntimeViews_Get.json - */ -async function standbyVirtualMachinePoolRuntimeViewsGet() { - const credential = new DefaultAzureCredential(); - const subscriptionId = "00000000-0000-0000-0000-000000000009"; - const client = new StandbyPoolManagementClient(credential, subscriptionId); - const result = await client.standbyVirtualMachinePoolRuntimeViews.get( - "rgstandbypool", - "pool", - "latest", - ); - console.log(result); -} - -async function main() { - standbyVirtualMachinePoolRuntimeViewsGet(); -} - -main().catch(console.error); diff --git a/sdk/standbypool/arm-standbypool/samples-dev/standbyVirtualMachinePoolRuntimeViewsListByStandbyPoolSample.ts b/sdk/standbypool/arm-standbypool/samples-dev/standbyVirtualMachinePoolRuntimeViewsListByStandbyPoolSample.ts deleted file mode 100644 index f0636418c0f2..000000000000 --- a/sdk/standbypool/arm-standbypool/samples-dev/standbyVirtualMachinePoolRuntimeViewsListByStandbyPoolSample.ts +++ /dev/null @@ -1,32 +0,0 @@ -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. - -import { StandbyPoolManagementClient } from "@azure/arm-standbypool"; -import { DefaultAzureCredential } from "@azure/identity"; - -/** - * This sample demonstrates how to list StandbyVirtualMachinePoolRuntimeViewResource resources by StandbyVirtualMachinePoolResource - * - * @summary list StandbyVirtualMachinePoolRuntimeViewResource resources by StandbyVirtualMachinePoolResource - * x-ms-original-file: 2024-03-01/StandbyVirtualMachinePoolRuntimeViews_ListByStandbyPool.json - */ -async function standbyVirtualMachinePoolRuntimeViewsListByStandbyPool() { - const credential = new DefaultAzureCredential(); - const subscriptionId = "00000000-0000-0000-0000-000000000009"; - const client = new StandbyPoolManagementClient(credential, subscriptionId); - const resArray = new Array(); - for await (let item of client.standbyVirtualMachinePoolRuntimeViews.listByStandbyPool( - "rgstandbypool", - "pool", - )) { - resArray.push(item); - } - - console.log(resArray); -} - -async function main() { - standbyVirtualMachinePoolRuntimeViewsListByStandbyPool(); -} - -main().catch(console.error); diff --git a/sdk/standbypool/arm-standbypool/samples-dev/standbyVirtualMachinePoolsCreateOrUpdateSample.ts b/sdk/standbypool/arm-standbypool/samples-dev/standbyVirtualMachinePoolsCreateOrUpdateSample.ts deleted file mode 100644 index 9e01b5253953..000000000000 --- a/sdk/standbypool/arm-standbypool/samples-dev/standbyVirtualMachinePoolsCreateOrUpdateSample.ts +++ /dev/null @@ -1,34 +0,0 @@ -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. - -import { StandbyPoolManagementClient } from "@azure/arm-standbypool"; -import { DefaultAzureCredential } from "@azure/identity"; - -/** - * This sample demonstrates how to create a StandbyVirtualMachinePoolResource - * - * @summary create a StandbyVirtualMachinePoolResource - * x-ms-original-file: 2024-03-01/StandbyVirtualMachinePools_CreateOrUpdate.json - */ -async function standbyVirtualMachinePoolsCreateOrUpdate() { - const credential = new DefaultAzureCredential(); - const subscriptionId = "00000000-0000-0000-0000-000000000009"; - const client = new StandbyPoolManagementClient(credential, subscriptionId); - const result = await client.standbyVirtualMachinePools.createOrUpdate("rgstandbypool", "pool", { - properties: { - elasticityProfile: { maxReadyCapacity: 304, minReadyCapacity: 300 }, - virtualMachineState: "Running", - attachedVirtualMachineScaleSetId: - "/subscriptions/00000000-0000-0000-0000-000000000009/resourceGroups/rgstandbypool/providers/Microsoft.Compute/virtualMachineScaleSets/myVmss", - }, - tags: {}, - location: "West US", - }); - console.log(result); -} - -async function main() { - standbyVirtualMachinePoolsCreateOrUpdate(); -} - -main().catch(console.error); diff --git a/sdk/standbypool/arm-standbypool/samples-dev/standbyVirtualMachinePoolsDeleteSample.ts b/sdk/standbypool/arm-standbypool/samples-dev/standbyVirtualMachinePoolsDeleteSample.ts deleted file mode 100644 index 13854a5b536c..000000000000 --- a/sdk/standbypool/arm-standbypool/samples-dev/standbyVirtualMachinePoolsDeleteSample.ts +++ /dev/null @@ -1,24 +0,0 @@ -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. - -import { StandbyPoolManagementClient } from "@azure/arm-standbypool"; -import { DefaultAzureCredential } from "@azure/identity"; - -/** - * This sample demonstrates how to delete a StandbyVirtualMachinePoolResource - * - * @summary delete a StandbyVirtualMachinePoolResource - * x-ms-original-file: 2024-03-01/StandbyVirtualMachinePools_Delete.json - */ -async function standbyVirtualMachinePoolsDelete() { - const credential = new DefaultAzureCredential(); - const subscriptionId = "00000000-0000-0000-0000-000000000009"; - const client = new StandbyPoolManagementClient(credential, subscriptionId); - await client.standbyVirtualMachinePools.delete("rgstandbypool", "pool"); -} - -async function main() { - standbyVirtualMachinePoolsDelete(); -} - -main().catch(console.error); diff --git a/sdk/standbypool/arm-standbypool/samples-dev/standbyVirtualMachinePoolsGetSample.ts b/sdk/standbypool/arm-standbypool/samples-dev/standbyVirtualMachinePoolsGetSample.ts deleted file mode 100644 index 6e711be3f83b..000000000000 --- a/sdk/standbypool/arm-standbypool/samples-dev/standbyVirtualMachinePoolsGetSample.ts +++ /dev/null @@ -1,25 +0,0 @@ -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. - -import { StandbyPoolManagementClient } from "@azure/arm-standbypool"; -import { DefaultAzureCredential } from "@azure/identity"; - -/** - * This sample demonstrates how to get a StandbyVirtualMachinePoolResource - * - * @summary get a StandbyVirtualMachinePoolResource - * x-ms-original-file: 2024-03-01/StandbyVirtualMachinePools_Get.json - */ -async function standbyVirtualMachinePoolsGet() { - const credential = new DefaultAzureCredential(); - const subscriptionId = "00000000-0000-0000-0000-000000000009"; - const client = new StandbyPoolManagementClient(credential, subscriptionId); - const result = await client.standbyVirtualMachinePools.get("rgstandbypool", "pool"); - console.log(result); -} - -async function main() { - standbyVirtualMachinePoolsGet(); -} - -main().catch(console.error); diff --git a/sdk/standbypool/arm-standbypool/samples-dev/standbyVirtualMachinePoolsListByResourceGroupSample.ts b/sdk/standbypool/arm-standbypool/samples-dev/standbyVirtualMachinePoolsListByResourceGroupSample.ts deleted file mode 100644 index 0d33c9646b67..000000000000 --- a/sdk/standbypool/arm-standbypool/samples-dev/standbyVirtualMachinePoolsListByResourceGroupSample.ts +++ /dev/null @@ -1,29 +0,0 @@ -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. - -import { StandbyPoolManagementClient } from "@azure/arm-standbypool"; -import { DefaultAzureCredential } from "@azure/identity"; - -/** - * This sample demonstrates how to list StandbyVirtualMachinePoolResource resources by resource group - * - * @summary list StandbyVirtualMachinePoolResource resources by resource group - * x-ms-original-file: 2024-03-01/StandbyVirtualMachinePools_ListByResourceGroup.json - */ -async function standbyVirtualMachinePoolsListByResourceGroup() { - const credential = new DefaultAzureCredential(); - const subscriptionId = "00000000-0000-0000-0000-000000000009"; - const client = new StandbyPoolManagementClient(credential, subscriptionId); - const resArray = new Array(); - for await (let item of client.standbyVirtualMachinePools.listByResourceGroup("rgstandbypool")) { - resArray.push(item); - } - - console.log(resArray); -} - -async function main() { - standbyVirtualMachinePoolsListByResourceGroup(); -} - -main().catch(console.error); diff --git a/sdk/standbypool/arm-standbypool/samples-dev/standbyVirtualMachinePoolsListBySubscriptionSample.ts b/sdk/standbypool/arm-standbypool/samples-dev/standbyVirtualMachinePoolsListBySubscriptionSample.ts deleted file mode 100644 index 95e2eb31d0f1..000000000000 --- a/sdk/standbypool/arm-standbypool/samples-dev/standbyVirtualMachinePoolsListBySubscriptionSample.ts +++ /dev/null @@ -1,29 +0,0 @@ -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. - -import { StandbyPoolManagementClient } from "@azure/arm-standbypool"; -import { DefaultAzureCredential } from "@azure/identity"; - -/** - * This sample demonstrates how to list StandbyVirtualMachinePoolResource resources by subscription ID - * - * @summary list StandbyVirtualMachinePoolResource resources by subscription ID - * x-ms-original-file: 2024-03-01/StandbyVirtualMachinePools_ListBySubscription.json - */ -async function standbyVirtualMachinePoolsListBySubscription() { - const credential = new DefaultAzureCredential(); - const subscriptionId = "00000000-0000-0000-0000-000000000009"; - const client = new StandbyPoolManagementClient(credential, subscriptionId); - const resArray = new Array(); - for await (let item of client.standbyVirtualMachinePools.listBySubscription()) { - resArray.push(item); - } - - console.log(resArray); -} - -async function main() { - standbyVirtualMachinePoolsListBySubscription(); -} - -main().catch(console.error); diff --git a/sdk/standbypool/arm-standbypool/samples-dev/standbyVirtualMachinePoolsUpdateSample.ts b/sdk/standbypool/arm-standbypool/samples-dev/standbyVirtualMachinePoolsUpdateSample.ts deleted file mode 100644 index 2651641d2f1f..000000000000 --- a/sdk/standbypool/arm-standbypool/samples-dev/standbyVirtualMachinePoolsUpdateSample.ts +++ /dev/null @@ -1,33 +0,0 @@ -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. - -import { StandbyPoolManagementClient } from "@azure/arm-standbypool"; -import { DefaultAzureCredential } from "@azure/identity"; - -/** - * This sample demonstrates how to update a StandbyVirtualMachinePoolResource - * - * @summary update a StandbyVirtualMachinePoolResource - * x-ms-original-file: 2024-03-01/StandbyVirtualMachinePools_Update.json - */ -async function standbyVirtualMachinePoolsUpdate() { - const credential = new DefaultAzureCredential(); - const subscriptionId = "00000000-0000-0000-0000-000000000009"; - const client = new StandbyPoolManagementClient(credential, subscriptionId); - const result = await client.standbyVirtualMachinePools.update("rgstandbypool", "pool", { - tags: {}, - properties: { - elasticityProfile: { maxReadyCapacity: 304, minReadyCapacity: 300 }, - virtualMachineState: "Running", - attachedVirtualMachineScaleSetId: - "/subscriptions/00000000-0000-0000-0000-000000000009/resourceGroups/rgstandbypool/providers/Microsoft.Compute/virtualMachineScaleSets/myVmss", - }, - }); - console.log(result); -} - -async function main() { - standbyVirtualMachinePoolsUpdate(); -} - -main().catch(console.error); diff --git a/sdk/standbypool/arm-standbypool/samples-dev/standbyVirtualMachinesGetSample.ts b/sdk/standbypool/arm-standbypool/samples-dev/standbyVirtualMachinesGetSample.ts deleted file mode 100644 index 6a6003decb48..000000000000 --- a/sdk/standbypool/arm-standbypool/samples-dev/standbyVirtualMachinesGetSample.ts +++ /dev/null @@ -1,25 +0,0 @@ -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. - -import { StandbyPoolManagementClient } from "@azure/arm-standbypool"; -import { DefaultAzureCredential } from "@azure/identity"; - -/** - * This sample demonstrates how to get a StandbyVirtualMachineResource - * - * @summary get a StandbyVirtualMachineResource - * x-ms-original-file: 2024-03-01/StandbyVirtualMachines_Get.json - */ -async function standbyVirtualMachinesGet() { - const credential = new DefaultAzureCredential(); - const subscriptionId = "00000000-0000-0000-0000-000000000009"; - const client = new StandbyPoolManagementClient(credential, subscriptionId); - const result = await client.standbyVirtualMachines.get("rgstandbypool", "pool", "virtualMachine"); - console.log(result); -} - -async function main() { - standbyVirtualMachinesGet(); -} - -main().catch(console.error); diff --git a/sdk/standbypool/arm-standbypool/samples-dev/standbyVirtualMachinesListByStandbyVirtualMachinePoolResourceSample.ts b/sdk/standbypool/arm-standbypool/samples-dev/standbyVirtualMachinesListByStandbyVirtualMachinePoolResourceSample.ts deleted file mode 100644 index d92be150cea1..000000000000 --- a/sdk/standbypool/arm-standbypool/samples-dev/standbyVirtualMachinesListByStandbyVirtualMachinePoolResourceSample.ts +++ /dev/null @@ -1,32 +0,0 @@ -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. - -import { StandbyPoolManagementClient } from "@azure/arm-standbypool"; -import { DefaultAzureCredential } from "@azure/identity"; - -/** - * This sample demonstrates how to list StandbyVirtualMachineResource resources by StandbyVirtualMachinePoolResource - * - * @summary list StandbyVirtualMachineResource resources by StandbyVirtualMachinePoolResource - * x-ms-original-file: 2024-03-01/StandbyVirtualMachines_ListByStandbyVirtualMachinePoolResource.json - */ -async function standbyVirtualMachinesListByStandbyVirtualMachinePoolResource() { - const credential = new DefaultAzureCredential(); - const subscriptionId = "00000000-0000-0000-0000-000000000009"; - const client = new StandbyPoolManagementClient(credential, subscriptionId); - const resArray = new Array(); - for await (let item of client.standbyVirtualMachines.listByStandbyVirtualMachinePoolResource( - "rgstandbypool", - "pool", - )) { - resArray.push(item); - } - - console.log(resArray); -} - -async function main() { - standbyVirtualMachinesListByStandbyVirtualMachinePoolResource(); -} - -main().catch(console.error); diff --git a/sdk/standbypool/arm-standbypool/samples/v1/javascript/README.md b/sdk/standbypool/arm-standbypool/samples/v1/javascript/README.md deleted file mode 100644 index 89e7998d48ff..000000000000 --- a/sdk/standbypool/arm-standbypool/samples/v1/javascript/README.md +++ /dev/null @@ -1,86 +0,0 @@ -# @azure/arm-mongocluster client library samples for JavaScript - -These sample programs show how to use the JavaScript client libraries for @azure/arm-mongocluster in some common scenarios. - -| **File Name** | **Description** | -| --------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -| [operationsListSample.js][operationslistsample] | list the operations for the provider x-ms-original-file: 2024-03-01/Operations_List.json | -| [standbyContainerGroupPoolRuntimeViewsGetSample.js][standbycontainergrouppoolruntimeviewsgetsample] | get a StandbyContainerGroupPoolRuntimeViewResource x-ms-original-file: 2024-03-01/StandbyContainerGroupPoolRuntimeViews_Get.json | -| [standbyContainerGroupPoolRuntimeViewsListByStandbyPoolSample.js][standbycontainergrouppoolruntimeviewslistbystandbypoolsample] | list StandbyContainerGroupPoolRuntimeViewResource resources by StandbyContainerGroupPoolResource x-ms-original-file: 2024-03-01/StandbyContainerGroupPoolRuntimeViews_ListByStandbyPool.json | -| [standbyContainerGroupPoolsCreateOrUpdateSample.js][standbycontainergrouppoolscreateorupdatesample] | create a StandbyContainerGroupPoolResource x-ms-original-file: 2024-03-01/StandbyContainerGroupPools_CreateOrUpdate.json | -| [standbyContainerGroupPoolsDeleteSample.js][standbycontainergrouppoolsdeletesample] | delete a StandbyContainerGroupPoolResource x-ms-original-file: 2024-03-01/StandbyContainerGroupPools_Delete.json | -| [standbyContainerGroupPoolsGetSample.js][standbycontainergrouppoolsgetsample] | get a StandbyContainerGroupPoolResource x-ms-original-file: 2024-03-01/StandbyContainerGroupPools_Get.json | -| [standbyContainerGroupPoolsListByResourceGroupSample.js][standbycontainergrouppoolslistbyresourcegroupsample] | list StandbyContainerGroupPoolResource resources by resource group x-ms-original-file: 2024-03-01/StandbyContainerGroupPools_ListByResourceGroup.json | -| [standbyContainerGroupPoolsListBySubscriptionSample.js][standbycontainergrouppoolslistbysubscriptionsample] | list StandbyContainerGroupPoolResource resources by subscription ID x-ms-original-file: 2024-03-01/StandbyContainerGroupPools_ListBySubscription.json | -| [standbyContainerGroupPoolsUpdateSample.js][standbycontainergrouppoolsupdatesample] | update a StandbyContainerGroupPoolResource x-ms-original-file: 2024-03-01/StandbyContainerGroupPools_Update.json | -| [standbyVirtualMachinePoolRuntimeViewsGetSample.js][standbyvirtualmachinepoolruntimeviewsgetsample] | get a StandbyVirtualMachinePoolRuntimeViewResource x-ms-original-file: 2024-03-01/StandbyVirtualMachinePoolRuntimeViews_Get.json | -| [standbyVirtualMachinePoolRuntimeViewsListByStandbyPoolSample.js][standbyvirtualmachinepoolruntimeviewslistbystandbypoolsample] | list StandbyVirtualMachinePoolRuntimeViewResource resources by StandbyVirtualMachinePoolResource x-ms-original-file: 2024-03-01/StandbyVirtualMachinePoolRuntimeViews_ListByStandbyPool.json | -| [standbyVirtualMachinePoolsCreateOrUpdateSample.js][standbyvirtualmachinepoolscreateorupdatesample] | create a StandbyVirtualMachinePoolResource x-ms-original-file: 2024-03-01/StandbyVirtualMachinePools_CreateOrUpdate.json | -| [standbyVirtualMachinePoolsDeleteSample.js][standbyvirtualmachinepoolsdeletesample] | delete a StandbyVirtualMachinePoolResource x-ms-original-file: 2024-03-01/StandbyVirtualMachinePools_Delete.json | -| [standbyVirtualMachinePoolsGetSample.js][standbyvirtualmachinepoolsgetsample] | get a StandbyVirtualMachinePoolResource x-ms-original-file: 2024-03-01/StandbyVirtualMachinePools_Get.json | -| [standbyVirtualMachinePoolsListByResourceGroupSample.js][standbyvirtualmachinepoolslistbyresourcegroupsample] | list StandbyVirtualMachinePoolResource resources by resource group x-ms-original-file: 2024-03-01/StandbyVirtualMachinePools_ListByResourceGroup.json | -| [standbyVirtualMachinePoolsListBySubscriptionSample.js][standbyvirtualmachinepoolslistbysubscriptionsample] | list StandbyVirtualMachinePoolResource resources by subscription ID x-ms-original-file: 2024-03-01/StandbyVirtualMachinePools_ListBySubscription.json | -| [standbyVirtualMachinePoolsUpdateSample.js][standbyvirtualmachinepoolsupdatesample] | update a StandbyVirtualMachinePoolResource x-ms-original-file: 2024-03-01/StandbyVirtualMachinePools_Update.json | -| [standbyVirtualMachinesGetSample.js][standbyvirtualmachinesgetsample] | get a StandbyVirtualMachineResource x-ms-original-file: 2024-03-01/StandbyVirtualMachines_Get.json | -| [standbyVirtualMachinesListByStandbyVirtualMachinePoolResourceSample.js][standbyvirtualmachineslistbystandbyvirtualmachinepoolresourcesample] | list StandbyVirtualMachineResource resources by StandbyVirtualMachinePoolResource x-ms-original-file: 2024-03-01/StandbyVirtualMachines_ListByStandbyVirtualMachinePoolResource.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 operationsListSample.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 node operationsListSample.js -``` - -## Next Steps - -Take a look at our [API Documentation][apiref] for more information about the APIs that are available in the clients. - -[operationslistsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/standbypool/arm-standbypool/samples/v1/javascript/operationsListSample.js -[standbycontainergrouppoolruntimeviewsgetsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/standbypool/arm-standbypool/samples/v1/javascript/standbyContainerGroupPoolRuntimeViewsGetSample.js -[standbycontainergrouppoolruntimeviewslistbystandbypoolsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/standbypool/arm-standbypool/samples/v1/javascript/standbyContainerGroupPoolRuntimeViewsListByStandbyPoolSample.js -[standbycontainergrouppoolscreateorupdatesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/standbypool/arm-standbypool/samples/v1/javascript/standbyContainerGroupPoolsCreateOrUpdateSample.js -[standbycontainergrouppoolsdeletesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/standbypool/arm-standbypool/samples/v1/javascript/standbyContainerGroupPoolsDeleteSample.js -[standbycontainergrouppoolsgetsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/standbypool/arm-standbypool/samples/v1/javascript/standbyContainerGroupPoolsGetSample.js -[standbycontainergrouppoolslistbyresourcegroupsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/standbypool/arm-standbypool/samples/v1/javascript/standbyContainerGroupPoolsListByResourceGroupSample.js -[standbycontainergrouppoolslistbysubscriptionsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/standbypool/arm-standbypool/samples/v1/javascript/standbyContainerGroupPoolsListBySubscriptionSample.js -[standbycontainergrouppoolsupdatesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/standbypool/arm-standbypool/samples/v1/javascript/standbyContainerGroupPoolsUpdateSample.js -[standbyvirtualmachinepoolruntimeviewsgetsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/standbypool/arm-standbypool/samples/v1/javascript/standbyVirtualMachinePoolRuntimeViewsGetSample.js -[standbyvirtualmachinepoolruntimeviewslistbystandbypoolsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/standbypool/arm-standbypool/samples/v1/javascript/standbyVirtualMachinePoolRuntimeViewsListByStandbyPoolSample.js -[standbyvirtualmachinepoolscreateorupdatesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/standbypool/arm-standbypool/samples/v1/javascript/standbyVirtualMachinePoolsCreateOrUpdateSample.js -[standbyvirtualmachinepoolsdeletesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/standbypool/arm-standbypool/samples/v1/javascript/standbyVirtualMachinePoolsDeleteSample.js -[standbyvirtualmachinepoolsgetsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/standbypool/arm-standbypool/samples/v1/javascript/standbyVirtualMachinePoolsGetSample.js -[standbyvirtualmachinepoolslistbyresourcegroupsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/standbypool/arm-standbypool/samples/v1/javascript/standbyVirtualMachinePoolsListByResourceGroupSample.js -[standbyvirtualmachinepoolslistbysubscriptionsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/standbypool/arm-standbypool/samples/v1/javascript/standbyVirtualMachinePoolsListBySubscriptionSample.js -[standbyvirtualmachinepoolsupdatesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/standbypool/arm-standbypool/samples/v1/javascript/standbyVirtualMachinePoolsUpdateSample.js -[standbyvirtualmachinesgetsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/standbypool/arm-standbypool/samples/v1/javascript/standbyVirtualMachinesGetSample.js -[standbyvirtualmachineslistbystandbyvirtualmachinepoolresourcesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/standbypool/arm-standbypool/samples/v1/javascript/standbyVirtualMachinesListByStandbyVirtualMachinePoolResourceSample.js -[apiref]: https://learn.microsoft.com/javascript/api/@azure/arm-mongocluster?view=azure-node-preview -[freesub]: https://azure.microsoft.com/free/ -[package]: https://github.com/Azure/azure-sdk-for-js/tree/main/sdk/standbypool/arm-standbypool/README.md diff --git a/sdk/standbypool/arm-standbypool/samples/v1/javascript/operationsListSample.js b/sdk/standbypool/arm-standbypool/samples/v1/javascript/operationsListSample.js deleted file mode 100644 index d6dbab938f6e..000000000000 --- a/sdk/standbypool/arm-standbypool/samples/v1/javascript/operationsListSample.js +++ /dev/null @@ -1,29 +0,0 @@ -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. - -const { StandbyPoolManagementClient } = require("@azure/arm-standbypool"); -const { DefaultAzureCredential } = require("@azure/identity"); - -/** - * This sample demonstrates how to list the operations for the provider - * - * @summary list the operations for the provider - * x-ms-original-file: 2024-03-01/Operations_List.json - */ -async function operationsList() { - const credential = new DefaultAzureCredential(); - const subscriptionId = "00000000-0000-0000-0000-00000000000"; - const client = new StandbyPoolManagementClient(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/standbypool/arm-standbypool/samples/v1/javascript/package.json b/sdk/standbypool/arm-standbypool/samples/v1/javascript/package.json deleted file mode 100644 index 7982e96b6d2f..000000000000 --- a/sdk/standbypool/arm-standbypool/samples/v1/javascript/package.json +++ /dev/null @@ -1,33 +0,0 @@ -{ - "name": "@azure-samples/arm-standbypool-js", - "private": true, - "version": "1.0.0", - "description": "@azure/arm-mongocluster client library samples for JavaScript", - "engines": { - "node": ">=18.0.0" - }, - "repository": { - "type": "git", - "url": "git+https://github.com/Azure/azure-sdk-for-js.git", - "directory": "sdk/standbypool/arm-standbypool" - }, - "keywords": [ - "node", - "azure", - "cloud", - "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/standbypool/arm-standbypool", - "dependencies": { - "@azure/arm-standbypool": "latest", - "dotenv": "latest", - "@azure/identity": "^4.2.1" - } -} diff --git a/sdk/standbypool/arm-standbypool/samples/v1/javascript/sample.env b/sdk/standbypool/arm-standbypool/samples/v1/javascript/sample.env deleted file mode 100644 index efbc7787bd3b..000000000000 --- a/sdk/standbypool/arm-standbypool/samples/v1/javascript/sample.env +++ /dev/null @@ -1 +0,0 @@ -# Feel free to add your own environment variables. diff --git a/sdk/standbypool/arm-standbypool/samples/v1/javascript/standbyContainerGroupPoolRuntimeViewsGetSample.js b/sdk/standbypool/arm-standbypool/samples/v1/javascript/standbyContainerGroupPoolRuntimeViewsGetSample.js deleted file mode 100644 index ddff44922df2..000000000000 --- a/sdk/standbypool/arm-standbypool/samples/v1/javascript/standbyContainerGroupPoolRuntimeViewsGetSample.js +++ /dev/null @@ -1,29 +0,0 @@ -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. - -const { StandbyPoolManagementClient } = require("@azure/arm-standbypool"); -const { DefaultAzureCredential } = require("@azure/identity"); - -/** - * This sample demonstrates how to get a StandbyContainerGroupPoolRuntimeViewResource - * - * @summary get a StandbyContainerGroupPoolRuntimeViewResource - * x-ms-original-file: 2024-03-01/StandbyContainerGroupPoolRuntimeViews_Get.json - */ -async function standbyContainerGroupPoolRuntimeViewsGet() { - const credential = new DefaultAzureCredential(); - const subscriptionId = "00000000-0000-0000-0000-000000000009"; - const client = new StandbyPoolManagementClient(credential, subscriptionId); - const result = await client.standbyContainerGroupPoolRuntimeViews.get( - "rgstandbypool", - "pool", - "latest", - ); - console.log(result); -} - -async function main() { - standbyContainerGroupPoolRuntimeViewsGet(); -} - -main().catch(console.error); diff --git a/sdk/standbypool/arm-standbypool/samples/v1/javascript/standbyContainerGroupPoolRuntimeViewsListByStandbyPoolSample.js b/sdk/standbypool/arm-standbypool/samples/v1/javascript/standbyContainerGroupPoolRuntimeViewsListByStandbyPoolSample.js deleted file mode 100644 index 64e50ef1a2f2..000000000000 --- a/sdk/standbypool/arm-standbypool/samples/v1/javascript/standbyContainerGroupPoolRuntimeViewsListByStandbyPoolSample.js +++ /dev/null @@ -1,32 +0,0 @@ -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. - -const { StandbyPoolManagementClient } = require("@azure/arm-standbypool"); -const { DefaultAzureCredential } = require("@azure/identity"); - -/** - * This sample demonstrates how to list StandbyContainerGroupPoolRuntimeViewResource resources by StandbyContainerGroupPoolResource - * - * @summary list StandbyContainerGroupPoolRuntimeViewResource resources by StandbyContainerGroupPoolResource - * x-ms-original-file: 2024-03-01/StandbyContainerGroupPoolRuntimeViews_ListByStandbyPool.json - */ -async function standbyContainerGroupPoolRuntimeViewsListByStandbyPool() { - const credential = new DefaultAzureCredential(); - const subscriptionId = "00000000-0000-0000-0000-000000000009"; - const client = new StandbyPoolManagementClient(credential, subscriptionId); - const resArray = new Array(); - for await (let item of client.standbyContainerGroupPoolRuntimeViews.listByStandbyPool( - "rgstandbypool", - "pool", - )) { - resArray.push(item); - } - - console.log(resArray); -} - -async function main() { - standbyContainerGroupPoolRuntimeViewsListByStandbyPool(); -} - -main().catch(console.error); diff --git a/sdk/standbypool/arm-standbypool/samples/v1/javascript/standbyContainerGroupPoolsCreateOrUpdateSample.js b/sdk/standbypool/arm-standbypool/samples/v1/javascript/standbyContainerGroupPoolsCreateOrUpdateSample.js deleted file mode 100644 index f2ef7760110b..000000000000 --- a/sdk/standbypool/arm-standbypool/samples/v1/javascript/standbyContainerGroupPoolsCreateOrUpdateSample.js +++ /dev/null @@ -1,42 +0,0 @@ -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. - -const { StandbyPoolManagementClient } = require("@azure/arm-standbypool"); -const { DefaultAzureCredential } = require("@azure/identity"); - -/** - * This sample demonstrates how to create a StandbyContainerGroupPoolResource - * - * @summary create a StandbyContainerGroupPoolResource - * x-ms-original-file: 2024-03-01/StandbyContainerGroupPools_CreateOrUpdate.json - */ -async function standbyContainerGroupPoolsCreateOrUpdate() { - const credential = new DefaultAzureCredential(); - const subscriptionId = "00000000-0000-0000-0000-000000000009"; - const client = new StandbyPoolManagementClient(credential, subscriptionId); - const result = await client.standbyContainerGroupPools.createOrUpdate("rgstandbypool", "pool", { - properties: { - elasticityProfile: { maxReadyCapacity: 688, refillPolicy: "always" }, - containerGroupProperties: { - containerGroupProfile: { - id: "/subscriptions/00000000-0000-0000-0000-000000000009/resourceGroups/rgstandbypool/providers/Microsoft.ContainerInstance/containerGroupProfiles/cgProfile", - revision: 1, - }, - subnetIds: [ - { - id: "/subscriptions/00000000-0000-0000-0000-000000000009/resourceGroups/rgstandbypool/providers/Microsoft.Network/virtualNetworks/cgSubnet/subnets/cgSubnet", - }, - ], - }, - }, - tags: {}, - location: "West US", - }); - console.log(result); -} - -async function main() { - standbyContainerGroupPoolsCreateOrUpdate(); -} - -main().catch(console.error); diff --git a/sdk/standbypool/arm-standbypool/samples/v1/javascript/standbyContainerGroupPoolsDeleteSample.js b/sdk/standbypool/arm-standbypool/samples/v1/javascript/standbyContainerGroupPoolsDeleteSample.js deleted file mode 100644 index a0760841001b..000000000000 --- a/sdk/standbypool/arm-standbypool/samples/v1/javascript/standbyContainerGroupPoolsDeleteSample.js +++ /dev/null @@ -1,24 +0,0 @@ -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. - -const { StandbyPoolManagementClient } = require("@azure/arm-standbypool"); -const { DefaultAzureCredential } = require("@azure/identity"); - -/** - * This sample demonstrates how to delete a StandbyContainerGroupPoolResource - * - * @summary delete a StandbyContainerGroupPoolResource - * x-ms-original-file: 2024-03-01/StandbyContainerGroupPools_Delete.json - */ -async function standbyContainerGroupPoolsDelete() { - const credential = new DefaultAzureCredential(); - const subscriptionId = "00000000-0000-0000-0000-000000000009"; - const client = new StandbyPoolManagementClient(credential, subscriptionId); - await client.standbyContainerGroupPools.delete("rgstandbypool", "pool"); -} - -async function main() { - standbyContainerGroupPoolsDelete(); -} - -main().catch(console.error); diff --git a/sdk/standbypool/arm-standbypool/samples/v1/javascript/standbyContainerGroupPoolsGetSample.js b/sdk/standbypool/arm-standbypool/samples/v1/javascript/standbyContainerGroupPoolsGetSample.js deleted file mode 100644 index 44cc7784b4dd..000000000000 --- a/sdk/standbypool/arm-standbypool/samples/v1/javascript/standbyContainerGroupPoolsGetSample.js +++ /dev/null @@ -1,25 +0,0 @@ -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. - -const { StandbyPoolManagementClient } = require("@azure/arm-standbypool"); -const { DefaultAzureCredential } = require("@azure/identity"); - -/** - * This sample demonstrates how to get a StandbyContainerGroupPoolResource - * - * @summary get a StandbyContainerGroupPoolResource - * x-ms-original-file: 2024-03-01/StandbyContainerGroupPools_Get.json - */ -async function standbyContainerGroupPoolsGet() { - const credential = new DefaultAzureCredential(); - const subscriptionId = "00000000-0000-0000-0000-000000000009"; - const client = new StandbyPoolManagementClient(credential, subscriptionId); - const result = await client.standbyContainerGroupPools.get("rgstandbypool", "pool"); - console.log(result); -} - -async function main() { - standbyContainerGroupPoolsGet(); -} - -main().catch(console.error); diff --git a/sdk/standbypool/arm-standbypool/samples/v1/javascript/standbyContainerGroupPoolsListByResourceGroupSample.js b/sdk/standbypool/arm-standbypool/samples/v1/javascript/standbyContainerGroupPoolsListByResourceGroupSample.js deleted file mode 100644 index 838225acbda9..000000000000 --- a/sdk/standbypool/arm-standbypool/samples/v1/javascript/standbyContainerGroupPoolsListByResourceGroupSample.js +++ /dev/null @@ -1,29 +0,0 @@ -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. - -const { StandbyPoolManagementClient } = require("@azure/arm-standbypool"); -const { DefaultAzureCredential } = require("@azure/identity"); - -/** - * This sample demonstrates how to list StandbyContainerGroupPoolResource resources by resource group - * - * @summary list StandbyContainerGroupPoolResource resources by resource group - * x-ms-original-file: 2024-03-01/StandbyContainerGroupPools_ListByResourceGroup.json - */ -async function standbyContainerGroupPoolsListByResourceGroup() { - const credential = new DefaultAzureCredential(); - const subscriptionId = "00000000-0000-0000-0000-000000000009"; - const client = new StandbyPoolManagementClient(credential, subscriptionId); - const resArray = new Array(); - for await (let item of client.standbyContainerGroupPools.listByResourceGroup("rgstandbypool")) { - resArray.push(item); - } - - console.log(resArray); -} - -async function main() { - standbyContainerGroupPoolsListByResourceGroup(); -} - -main().catch(console.error); diff --git a/sdk/standbypool/arm-standbypool/samples/v1/javascript/standbyContainerGroupPoolsListBySubscriptionSample.js b/sdk/standbypool/arm-standbypool/samples/v1/javascript/standbyContainerGroupPoolsListBySubscriptionSample.js deleted file mode 100644 index 09e0eb540cdf..000000000000 --- a/sdk/standbypool/arm-standbypool/samples/v1/javascript/standbyContainerGroupPoolsListBySubscriptionSample.js +++ /dev/null @@ -1,29 +0,0 @@ -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. - -const { StandbyPoolManagementClient } = require("@azure/arm-standbypool"); -const { DefaultAzureCredential } = require("@azure/identity"); - -/** - * This sample demonstrates how to list StandbyContainerGroupPoolResource resources by subscription ID - * - * @summary list StandbyContainerGroupPoolResource resources by subscription ID - * x-ms-original-file: 2024-03-01/StandbyContainerGroupPools_ListBySubscription.json - */ -async function standbyContainerGroupPoolsListBySubscription() { - const credential = new DefaultAzureCredential(); - const subscriptionId = "00000000-0000-0000-0000-000000000009"; - const client = new StandbyPoolManagementClient(credential, subscriptionId); - const resArray = new Array(); - for await (let item of client.standbyContainerGroupPools.listBySubscription()) { - resArray.push(item); - } - - console.log(resArray); -} - -async function main() { - standbyContainerGroupPoolsListBySubscription(); -} - -main().catch(console.error); diff --git a/sdk/standbypool/arm-standbypool/samples/v1/javascript/standbyContainerGroupPoolsUpdateSample.js b/sdk/standbypool/arm-standbypool/samples/v1/javascript/standbyContainerGroupPoolsUpdateSample.js deleted file mode 100644 index e598c600adab..000000000000 --- a/sdk/standbypool/arm-standbypool/samples/v1/javascript/standbyContainerGroupPoolsUpdateSample.js +++ /dev/null @@ -1,41 +0,0 @@ -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. - -const { StandbyPoolManagementClient } = require("@azure/arm-standbypool"); -const { DefaultAzureCredential } = require("@azure/identity"); - -/** - * This sample demonstrates how to update a StandbyContainerGroupPoolResource - * - * @summary update a StandbyContainerGroupPoolResource - * x-ms-original-file: 2024-03-01/StandbyContainerGroupPools_Update.json - */ -async function standbyContainerGroupPoolsUpdate() { - const credential = new DefaultAzureCredential(); - const subscriptionId = "00000000-0000-0000-0000-000000000009"; - const client = new StandbyPoolManagementClient(credential, subscriptionId); - const result = await client.standbyContainerGroupPools.update("rgstandbypool", "pool", { - tags: {}, - properties: { - elasticityProfile: { maxReadyCapacity: 1743, refillPolicy: "always" }, - containerGroupProperties: { - containerGroupProfile: { - id: "/subscriptions/00000000-0000-0000-0000-000000000009/resourceGroups/rgstandbypool/providers/Microsoft.ContainerInstance/containerGroupProfiles/cgProfile", - revision: 2, - }, - subnetIds: [ - { - id: "/subscriptions/00000000-0000-0000-0000-000000000009/resourceGroups/rgstandbypool/providers/Microsoft.Network/virtualNetworks/cgSubnet/subnets/cgSubnet", - }, - ], - }, - }, - }); - console.log(result); -} - -async function main() { - standbyContainerGroupPoolsUpdate(); -} - -main().catch(console.error); diff --git a/sdk/standbypool/arm-standbypool/samples/v1/javascript/standbyVirtualMachinePoolRuntimeViewsGetSample.js b/sdk/standbypool/arm-standbypool/samples/v1/javascript/standbyVirtualMachinePoolRuntimeViewsGetSample.js deleted file mode 100644 index d1f1e08138a6..000000000000 --- a/sdk/standbypool/arm-standbypool/samples/v1/javascript/standbyVirtualMachinePoolRuntimeViewsGetSample.js +++ /dev/null @@ -1,29 +0,0 @@ -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. - -const { StandbyPoolManagementClient } = require("@azure/arm-standbypool"); -const { DefaultAzureCredential } = require("@azure/identity"); - -/** - * This sample demonstrates how to get a StandbyVirtualMachinePoolRuntimeViewResource - * - * @summary get a StandbyVirtualMachinePoolRuntimeViewResource - * x-ms-original-file: 2024-03-01/StandbyVirtualMachinePoolRuntimeViews_Get.json - */ -async function standbyVirtualMachinePoolRuntimeViewsGet() { - const credential = new DefaultAzureCredential(); - const subscriptionId = "00000000-0000-0000-0000-000000000009"; - const client = new StandbyPoolManagementClient(credential, subscriptionId); - const result = await client.standbyVirtualMachinePoolRuntimeViews.get( - "rgstandbypool", - "pool", - "latest", - ); - console.log(result); -} - -async function main() { - standbyVirtualMachinePoolRuntimeViewsGet(); -} - -main().catch(console.error); diff --git a/sdk/standbypool/arm-standbypool/samples/v1/javascript/standbyVirtualMachinePoolRuntimeViewsListByStandbyPoolSample.js b/sdk/standbypool/arm-standbypool/samples/v1/javascript/standbyVirtualMachinePoolRuntimeViewsListByStandbyPoolSample.js deleted file mode 100644 index b102d89ad26d..000000000000 --- a/sdk/standbypool/arm-standbypool/samples/v1/javascript/standbyVirtualMachinePoolRuntimeViewsListByStandbyPoolSample.js +++ /dev/null @@ -1,32 +0,0 @@ -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. - -const { StandbyPoolManagementClient } = require("@azure/arm-standbypool"); -const { DefaultAzureCredential } = require("@azure/identity"); - -/** - * This sample demonstrates how to list StandbyVirtualMachinePoolRuntimeViewResource resources by StandbyVirtualMachinePoolResource - * - * @summary list StandbyVirtualMachinePoolRuntimeViewResource resources by StandbyVirtualMachinePoolResource - * x-ms-original-file: 2024-03-01/StandbyVirtualMachinePoolRuntimeViews_ListByStandbyPool.json - */ -async function standbyVirtualMachinePoolRuntimeViewsListByStandbyPool() { - const credential = new DefaultAzureCredential(); - const subscriptionId = "00000000-0000-0000-0000-000000000009"; - const client = new StandbyPoolManagementClient(credential, subscriptionId); - const resArray = new Array(); - for await (let item of client.standbyVirtualMachinePoolRuntimeViews.listByStandbyPool( - "rgstandbypool", - "pool", - )) { - resArray.push(item); - } - - console.log(resArray); -} - -async function main() { - standbyVirtualMachinePoolRuntimeViewsListByStandbyPool(); -} - -main().catch(console.error); diff --git a/sdk/standbypool/arm-standbypool/samples/v1/javascript/standbyVirtualMachinePoolsCreateOrUpdateSample.js b/sdk/standbypool/arm-standbypool/samples/v1/javascript/standbyVirtualMachinePoolsCreateOrUpdateSample.js deleted file mode 100644 index 9ba9b77815ec..000000000000 --- a/sdk/standbypool/arm-standbypool/samples/v1/javascript/standbyVirtualMachinePoolsCreateOrUpdateSample.js +++ /dev/null @@ -1,34 +0,0 @@ -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. - -const { StandbyPoolManagementClient } = require("@azure/arm-standbypool"); -const { DefaultAzureCredential } = require("@azure/identity"); - -/** - * This sample demonstrates how to create a StandbyVirtualMachinePoolResource - * - * @summary create a StandbyVirtualMachinePoolResource - * x-ms-original-file: 2024-03-01/StandbyVirtualMachinePools_CreateOrUpdate.json - */ -async function standbyVirtualMachinePoolsCreateOrUpdate() { - const credential = new DefaultAzureCredential(); - const subscriptionId = "00000000-0000-0000-0000-000000000009"; - const client = new StandbyPoolManagementClient(credential, subscriptionId); - const result = await client.standbyVirtualMachinePools.createOrUpdate("rgstandbypool", "pool", { - properties: { - elasticityProfile: { maxReadyCapacity: 304, minReadyCapacity: 300 }, - virtualMachineState: "Running", - attachedVirtualMachineScaleSetId: - "/subscriptions/00000000-0000-0000-0000-000000000009/resourceGroups/rgstandbypool/providers/Microsoft.Compute/virtualMachineScaleSets/myVmss", - }, - tags: {}, - location: "West US", - }); - console.log(result); -} - -async function main() { - standbyVirtualMachinePoolsCreateOrUpdate(); -} - -main().catch(console.error); diff --git a/sdk/standbypool/arm-standbypool/samples/v1/javascript/standbyVirtualMachinePoolsDeleteSample.js b/sdk/standbypool/arm-standbypool/samples/v1/javascript/standbyVirtualMachinePoolsDeleteSample.js deleted file mode 100644 index 756873e734c9..000000000000 --- a/sdk/standbypool/arm-standbypool/samples/v1/javascript/standbyVirtualMachinePoolsDeleteSample.js +++ /dev/null @@ -1,24 +0,0 @@ -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. - -const { StandbyPoolManagementClient } = require("@azure/arm-standbypool"); -const { DefaultAzureCredential } = require("@azure/identity"); - -/** - * This sample demonstrates how to delete a StandbyVirtualMachinePoolResource - * - * @summary delete a StandbyVirtualMachinePoolResource - * x-ms-original-file: 2024-03-01/StandbyVirtualMachinePools_Delete.json - */ -async function standbyVirtualMachinePoolsDelete() { - const credential = new DefaultAzureCredential(); - const subscriptionId = "00000000-0000-0000-0000-000000000009"; - const client = new StandbyPoolManagementClient(credential, subscriptionId); - await client.standbyVirtualMachinePools.delete("rgstandbypool", "pool"); -} - -async function main() { - standbyVirtualMachinePoolsDelete(); -} - -main().catch(console.error); diff --git a/sdk/standbypool/arm-standbypool/samples/v1/javascript/standbyVirtualMachinePoolsGetSample.js b/sdk/standbypool/arm-standbypool/samples/v1/javascript/standbyVirtualMachinePoolsGetSample.js deleted file mode 100644 index 47a36aceebc7..000000000000 --- a/sdk/standbypool/arm-standbypool/samples/v1/javascript/standbyVirtualMachinePoolsGetSample.js +++ /dev/null @@ -1,25 +0,0 @@ -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. - -const { StandbyPoolManagementClient } = require("@azure/arm-standbypool"); -const { DefaultAzureCredential } = require("@azure/identity"); - -/** - * This sample demonstrates how to get a StandbyVirtualMachinePoolResource - * - * @summary get a StandbyVirtualMachinePoolResource - * x-ms-original-file: 2024-03-01/StandbyVirtualMachinePools_Get.json - */ -async function standbyVirtualMachinePoolsGet() { - const credential = new DefaultAzureCredential(); - const subscriptionId = "00000000-0000-0000-0000-000000000009"; - const client = new StandbyPoolManagementClient(credential, subscriptionId); - const result = await client.standbyVirtualMachinePools.get("rgstandbypool", "pool"); - console.log(result); -} - -async function main() { - standbyVirtualMachinePoolsGet(); -} - -main().catch(console.error); diff --git a/sdk/standbypool/arm-standbypool/samples/v1/javascript/standbyVirtualMachinePoolsListByResourceGroupSample.js b/sdk/standbypool/arm-standbypool/samples/v1/javascript/standbyVirtualMachinePoolsListByResourceGroupSample.js deleted file mode 100644 index 14c93af15d74..000000000000 --- a/sdk/standbypool/arm-standbypool/samples/v1/javascript/standbyVirtualMachinePoolsListByResourceGroupSample.js +++ /dev/null @@ -1,29 +0,0 @@ -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. - -const { StandbyPoolManagementClient } = require("@azure/arm-standbypool"); -const { DefaultAzureCredential } = require("@azure/identity"); - -/** - * This sample demonstrates how to list StandbyVirtualMachinePoolResource resources by resource group - * - * @summary list StandbyVirtualMachinePoolResource resources by resource group - * x-ms-original-file: 2024-03-01/StandbyVirtualMachinePools_ListByResourceGroup.json - */ -async function standbyVirtualMachinePoolsListByResourceGroup() { - const credential = new DefaultAzureCredential(); - const subscriptionId = "00000000-0000-0000-0000-000000000009"; - const client = new StandbyPoolManagementClient(credential, subscriptionId); - const resArray = new Array(); - for await (let item of client.standbyVirtualMachinePools.listByResourceGroup("rgstandbypool")) { - resArray.push(item); - } - - console.log(resArray); -} - -async function main() { - standbyVirtualMachinePoolsListByResourceGroup(); -} - -main().catch(console.error); diff --git a/sdk/standbypool/arm-standbypool/samples/v1/javascript/standbyVirtualMachinePoolsListBySubscriptionSample.js b/sdk/standbypool/arm-standbypool/samples/v1/javascript/standbyVirtualMachinePoolsListBySubscriptionSample.js deleted file mode 100644 index 96974219b753..000000000000 --- a/sdk/standbypool/arm-standbypool/samples/v1/javascript/standbyVirtualMachinePoolsListBySubscriptionSample.js +++ /dev/null @@ -1,29 +0,0 @@ -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. - -const { StandbyPoolManagementClient } = require("@azure/arm-standbypool"); -const { DefaultAzureCredential } = require("@azure/identity"); - -/** - * This sample demonstrates how to list StandbyVirtualMachinePoolResource resources by subscription ID - * - * @summary list StandbyVirtualMachinePoolResource resources by subscription ID - * x-ms-original-file: 2024-03-01/StandbyVirtualMachinePools_ListBySubscription.json - */ -async function standbyVirtualMachinePoolsListBySubscription() { - const credential = new DefaultAzureCredential(); - const subscriptionId = "00000000-0000-0000-0000-000000000009"; - const client = new StandbyPoolManagementClient(credential, subscriptionId); - const resArray = new Array(); - for await (let item of client.standbyVirtualMachinePools.listBySubscription()) { - resArray.push(item); - } - - console.log(resArray); -} - -async function main() { - standbyVirtualMachinePoolsListBySubscription(); -} - -main().catch(console.error); diff --git a/sdk/standbypool/arm-standbypool/samples/v1/javascript/standbyVirtualMachinePoolsUpdateSample.js b/sdk/standbypool/arm-standbypool/samples/v1/javascript/standbyVirtualMachinePoolsUpdateSample.js deleted file mode 100644 index 1b76e1315f80..000000000000 --- a/sdk/standbypool/arm-standbypool/samples/v1/javascript/standbyVirtualMachinePoolsUpdateSample.js +++ /dev/null @@ -1,33 +0,0 @@ -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. - -const { StandbyPoolManagementClient } = require("@azure/arm-standbypool"); -const { DefaultAzureCredential } = require("@azure/identity"); - -/** - * This sample demonstrates how to update a StandbyVirtualMachinePoolResource - * - * @summary update a StandbyVirtualMachinePoolResource - * x-ms-original-file: 2024-03-01/StandbyVirtualMachinePools_Update.json - */ -async function standbyVirtualMachinePoolsUpdate() { - const credential = new DefaultAzureCredential(); - const subscriptionId = "00000000-0000-0000-0000-000000000009"; - const client = new StandbyPoolManagementClient(credential, subscriptionId); - const result = await client.standbyVirtualMachinePools.update("rgstandbypool", "pool", { - tags: {}, - properties: { - elasticityProfile: { maxReadyCapacity: 304, minReadyCapacity: 300 }, - virtualMachineState: "Running", - attachedVirtualMachineScaleSetId: - "/subscriptions/00000000-0000-0000-0000-000000000009/resourceGroups/rgstandbypool/providers/Microsoft.Compute/virtualMachineScaleSets/myVmss", - }, - }); - console.log(result); -} - -async function main() { - standbyVirtualMachinePoolsUpdate(); -} - -main().catch(console.error); diff --git a/sdk/standbypool/arm-standbypool/samples/v1/javascript/standbyVirtualMachinesGetSample.js b/sdk/standbypool/arm-standbypool/samples/v1/javascript/standbyVirtualMachinesGetSample.js deleted file mode 100644 index 9e042802bb00..000000000000 --- a/sdk/standbypool/arm-standbypool/samples/v1/javascript/standbyVirtualMachinesGetSample.js +++ /dev/null @@ -1,25 +0,0 @@ -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. - -const { StandbyPoolManagementClient } = require("@azure/arm-standbypool"); -const { DefaultAzureCredential } = require("@azure/identity"); - -/** - * This sample demonstrates how to get a StandbyVirtualMachineResource - * - * @summary get a StandbyVirtualMachineResource - * x-ms-original-file: 2024-03-01/StandbyVirtualMachines_Get.json - */ -async function standbyVirtualMachinesGet() { - const credential = new DefaultAzureCredential(); - const subscriptionId = "00000000-0000-0000-0000-000000000009"; - const client = new StandbyPoolManagementClient(credential, subscriptionId); - const result = await client.standbyVirtualMachines.get("rgstandbypool", "pool", "virtualMachine"); - console.log(result); -} - -async function main() { - standbyVirtualMachinesGet(); -} - -main().catch(console.error); diff --git a/sdk/standbypool/arm-standbypool/samples/v1/javascript/standbyVirtualMachinesListByStandbyVirtualMachinePoolResourceSample.js b/sdk/standbypool/arm-standbypool/samples/v1/javascript/standbyVirtualMachinesListByStandbyVirtualMachinePoolResourceSample.js deleted file mode 100644 index 1928117b3382..000000000000 --- a/sdk/standbypool/arm-standbypool/samples/v1/javascript/standbyVirtualMachinesListByStandbyVirtualMachinePoolResourceSample.js +++ /dev/null @@ -1,32 +0,0 @@ -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. - -const { StandbyPoolManagementClient } = require("@azure/arm-standbypool"); -const { DefaultAzureCredential } = require("@azure/identity"); - -/** - * This sample demonstrates how to list StandbyVirtualMachineResource resources by StandbyVirtualMachinePoolResource - * - * @summary list StandbyVirtualMachineResource resources by StandbyVirtualMachinePoolResource - * x-ms-original-file: 2024-03-01/StandbyVirtualMachines_ListByStandbyVirtualMachinePoolResource.json - */ -async function standbyVirtualMachinesListByStandbyVirtualMachinePoolResource() { - const credential = new DefaultAzureCredential(); - const subscriptionId = "00000000-0000-0000-0000-000000000009"; - const client = new StandbyPoolManagementClient(credential, subscriptionId); - const resArray = new Array(); - for await (let item of client.standbyVirtualMachines.listByStandbyVirtualMachinePoolResource( - "rgstandbypool", - "pool", - )) { - resArray.push(item); - } - - console.log(resArray); -} - -async function main() { - standbyVirtualMachinesListByStandbyVirtualMachinePoolResource(); -} - -main().catch(console.error); diff --git a/sdk/standbypool/arm-standbypool/samples/v1/typescript/README.md b/sdk/standbypool/arm-standbypool/samples/v1/typescript/README.md deleted file mode 100644 index 50a199d22061..000000000000 --- a/sdk/standbypool/arm-standbypool/samples/v1/typescript/README.md +++ /dev/null @@ -1,99 +0,0 @@ -# @azure/arm-mongocluster client library samples for TypeScript - -These sample programs show how to use the TypeScript client libraries for @azure/arm-mongocluster in some common scenarios. - -| **File Name** | **Description** | -| --------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -| [operationsListSample.ts][operationslistsample] | list the operations for the provider x-ms-original-file: 2024-03-01/Operations_List.json | -| [standbyContainerGroupPoolRuntimeViewsGetSample.ts][standbycontainergrouppoolruntimeviewsgetsample] | get a StandbyContainerGroupPoolRuntimeViewResource x-ms-original-file: 2024-03-01/StandbyContainerGroupPoolRuntimeViews_Get.json | -| [standbyContainerGroupPoolRuntimeViewsListByStandbyPoolSample.ts][standbycontainergrouppoolruntimeviewslistbystandbypoolsample] | list StandbyContainerGroupPoolRuntimeViewResource resources by StandbyContainerGroupPoolResource x-ms-original-file: 2024-03-01/StandbyContainerGroupPoolRuntimeViews_ListByStandbyPool.json | -| [standbyContainerGroupPoolsCreateOrUpdateSample.ts][standbycontainergrouppoolscreateorupdatesample] | create a StandbyContainerGroupPoolResource x-ms-original-file: 2024-03-01/StandbyContainerGroupPools_CreateOrUpdate.json | -| [standbyContainerGroupPoolsDeleteSample.ts][standbycontainergrouppoolsdeletesample] | delete a StandbyContainerGroupPoolResource x-ms-original-file: 2024-03-01/StandbyContainerGroupPools_Delete.json | -| [standbyContainerGroupPoolsGetSample.ts][standbycontainergrouppoolsgetsample] | get a StandbyContainerGroupPoolResource x-ms-original-file: 2024-03-01/StandbyContainerGroupPools_Get.json | -| [standbyContainerGroupPoolsListByResourceGroupSample.ts][standbycontainergrouppoolslistbyresourcegroupsample] | list StandbyContainerGroupPoolResource resources by resource group x-ms-original-file: 2024-03-01/StandbyContainerGroupPools_ListByResourceGroup.json | -| [standbyContainerGroupPoolsListBySubscriptionSample.ts][standbycontainergrouppoolslistbysubscriptionsample] | list StandbyContainerGroupPoolResource resources by subscription ID x-ms-original-file: 2024-03-01/StandbyContainerGroupPools_ListBySubscription.json | -| [standbyContainerGroupPoolsUpdateSample.ts][standbycontainergrouppoolsupdatesample] | update a StandbyContainerGroupPoolResource x-ms-original-file: 2024-03-01/StandbyContainerGroupPools_Update.json | -| [standbyVirtualMachinePoolRuntimeViewsGetSample.ts][standbyvirtualmachinepoolruntimeviewsgetsample] | get a StandbyVirtualMachinePoolRuntimeViewResource x-ms-original-file: 2024-03-01/StandbyVirtualMachinePoolRuntimeViews_Get.json | -| [standbyVirtualMachinePoolRuntimeViewsListByStandbyPoolSample.ts][standbyvirtualmachinepoolruntimeviewslistbystandbypoolsample] | list StandbyVirtualMachinePoolRuntimeViewResource resources by StandbyVirtualMachinePoolResource x-ms-original-file: 2024-03-01/StandbyVirtualMachinePoolRuntimeViews_ListByStandbyPool.json | -| [standbyVirtualMachinePoolsCreateOrUpdateSample.ts][standbyvirtualmachinepoolscreateorupdatesample] | create a StandbyVirtualMachinePoolResource x-ms-original-file: 2024-03-01/StandbyVirtualMachinePools_CreateOrUpdate.json | -| [standbyVirtualMachinePoolsDeleteSample.ts][standbyvirtualmachinepoolsdeletesample] | delete a StandbyVirtualMachinePoolResource x-ms-original-file: 2024-03-01/StandbyVirtualMachinePools_Delete.json | -| [standbyVirtualMachinePoolsGetSample.ts][standbyvirtualmachinepoolsgetsample] | get a StandbyVirtualMachinePoolResource x-ms-original-file: 2024-03-01/StandbyVirtualMachinePools_Get.json | -| [standbyVirtualMachinePoolsListByResourceGroupSample.ts][standbyvirtualmachinepoolslistbyresourcegroupsample] | list StandbyVirtualMachinePoolResource resources by resource group x-ms-original-file: 2024-03-01/StandbyVirtualMachinePools_ListByResourceGroup.json | -| [standbyVirtualMachinePoolsListBySubscriptionSample.ts][standbyvirtualmachinepoolslistbysubscriptionsample] | list StandbyVirtualMachinePoolResource resources by subscription ID x-ms-original-file: 2024-03-01/StandbyVirtualMachinePools_ListBySubscription.json | -| [standbyVirtualMachinePoolsUpdateSample.ts][standbyvirtualmachinepoolsupdatesample] | update a StandbyVirtualMachinePoolResource x-ms-original-file: 2024-03-01/StandbyVirtualMachinePools_Update.json | -| [standbyVirtualMachinesGetSample.ts][standbyvirtualmachinesgetsample] | get a StandbyVirtualMachineResource x-ms-original-file: 2024-03-01/StandbyVirtualMachines_Get.json | -| [standbyVirtualMachinesListByStandbyVirtualMachinePoolResourceSample.ts][standbyvirtualmachineslistbystandbyvirtualmachinepoolresourcesample] | list StandbyVirtualMachineResource resources by StandbyVirtualMachinePoolResource x-ms-original-file: 2024-03-01/StandbyVirtualMachines_ListByStandbyVirtualMachinePoolResource.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/operationsListSample.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 node dist/operationsListSample.js -``` - -## Next Steps - -Take a look at our [API Documentation][apiref] for more information about the APIs that are available in the clients. - -[operationslistsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/standbypool/arm-standbypool/samples/v1/typescript/src/operationsListSample.ts -[standbycontainergrouppoolruntimeviewsgetsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/standbypool/arm-standbypool/samples/v1/typescript/src/standbyContainerGroupPoolRuntimeViewsGetSample.ts -[standbycontainergrouppoolruntimeviewslistbystandbypoolsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/standbypool/arm-standbypool/samples/v1/typescript/src/standbyContainerGroupPoolRuntimeViewsListByStandbyPoolSample.ts -[standbycontainergrouppoolscreateorupdatesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/standbypool/arm-standbypool/samples/v1/typescript/src/standbyContainerGroupPoolsCreateOrUpdateSample.ts -[standbycontainergrouppoolsdeletesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/standbypool/arm-standbypool/samples/v1/typescript/src/standbyContainerGroupPoolsDeleteSample.ts -[standbycontainergrouppoolsgetsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/standbypool/arm-standbypool/samples/v1/typescript/src/standbyContainerGroupPoolsGetSample.ts -[standbycontainergrouppoolslistbyresourcegroupsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/standbypool/arm-standbypool/samples/v1/typescript/src/standbyContainerGroupPoolsListByResourceGroupSample.ts -[standbycontainergrouppoolslistbysubscriptionsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/standbypool/arm-standbypool/samples/v1/typescript/src/standbyContainerGroupPoolsListBySubscriptionSample.ts -[standbycontainergrouppoolsupdatesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/standbypool/arm-standbypool/samples/v1/typescript/src/standbyContainerGroupPoolsUpdateSample.ts -[standbyvirtualmachinepoolruntimeviewsgetsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/standbypool/arm-standbypool/samples/v1/typescript/src/standbyVirtualMachinePoolRuntimeViewsGetSample.ts -[standbyvirtualmachinepoolruntimeviewslistbystandbypoolsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/standbypool/arm-standbypool/samples/v1/typescript/src/standbyVirtualMachinePoolRuntimeViewsListByStandbyPoolSample.ts -[standbyvirtualmachinepoolscreateorupdatesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/standbypool/arm-standbypool/samples/v1/typescript/src/standbyVirtualMachinePoolsCreateOrUpdateSample.ts -[standbyvirtualmachinepoolsdeletesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/standbypool/arm-standbypool/samples/v1/typescript/src/standbyVirtualMachinePoolsDeleteSample.ts -[standbyvirtualmachinepoolsgetsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/standbypool/arm-standbypool/samples/v1/typescript/src/standbyVirtualMachinePoolsGetSample.ts -[standbyvirtualmachinepoolslistbyresourcegroupsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/standbypool/arm-standbypool/samples/v1/typescript/src/standbyVirtualMachinePoolsListByResourceGroupSample.ts -[standbyvirtualmachinepoolslistbysubscriptionsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/standbypool/arm-standbypool/samples/v1/typescript/src/standbyVirtualMachinePoolsListBySubscriptionSample.ts -[standbyvirtualmachinepoolsupdatesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/standbypool/arm-standbypool/samples/v1/typescript/src/standbyVirtualMachinePoolsUpdateSample.ts -[standbyvirtualmachinesgetsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/standbypool/arm-standbypool/samples/v1/typescript/src/standbyVirtualMachinesGetSample.ts -[standbyvirtualmachineslistbystandbyvirtualmachinepoolresourcesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/standbypool/arm-standbypool/samples/v1/typescript/src/standbyVirtualMachinesListByStandbyVirtualMachinePoolResourceSample.ts -[apiref]: https://learn.microsoft.com/javascript/api/@azure/arm-mongocluster?view=azure-node-preview -[freesub]: https://azure.microsoft.com/free/ -[package]: https://github.com/Azure/azure-sdk-for-js/tree/main/sdk/standbypool/arm-standbypool/README.md -[typescript]: https://www.typescriptlang.org/docs/home.html diff --git a/sdk/standbypool/arm-standbypool/samples/v1/typescript/package.json b/sdk/standbypool/arm-standbypool/samples/v1/typescript/package.json deleted file mode 100644 index 43ed3561a058..000000000000 --- a/sdk/standbypool/arm-standbypool/samples/v1/typescript/package.json +++ /dev/null @@ -1,42 +0,0 @@ -{ - "name": "@azure-samples/arm-standbypool-ts", - "private": true, - "version": "1.0.0", - "description": "@azure/arm-mongocluster client library samples for TypeScript", - "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/standbypool/arm-standbypool" - }, - "keywords": [ - "node", - "azure", - "cloud", - "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/standbypool/arm-standbypool", - "dependencies": { - "@azure/arm-standbypool": "latest", - "dotenv": "latest", - "@azure/identity": "^4.2.1" - }, - "devDependencies": { - "@types/node": "^18.0.0", - "typescript": "~5.7.2", - "rimraf": "latest" - } -} diff --git a/sdk/standbypool/arm-standbypool/samples/v1/typescript/sample.env b/sdk/standbypool/arm-standbypool/samples/v1/typescript/sample.env deleted file mode 100644 index efbc7787bd3b..000000000000 --- a/sdk/standbypool/arm-standbypool/samples/v1/typescript/sample.env +++ /dev/null @@ -1 +0,0 @@ -# Feel free to add your own environment variables. diff --git a/sdk/standbypool/arm-standbypool/samples/v1/typescript/src/operationsListSample.ts b/sdk/standbypool/arm-standbypool/samples/v1/typescript/src/operationsListSample.ts deleted file mode 100644 index 49bd314d08e6..000000000000 --- a/sdk/standbypool/arm-standbypool/samples/v1/typescript/src/operationsListSample.ts +++ /dev/null @@ -1,29 +0,0 @@ -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. - -import { StandbyPoolManagementClient } from "@azure/arm-standbypool"; -import { DefaultAzureCredential } from "@azure/identity"; - -/** - * This sample demonstrates how to list the operations for the provider - * - * @summary list the operations for the provider - * x-ms-original-file: 2024-03-01/Operations_List.json - */ -async function operationsList() { - const credential = new DefaultAzureCredential(); - const subscriptionId = "00000000-0000-0000-0000-00000000000"; - const client = new StandbyPoolManagementClient(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/standbypool/arm-standbypool/samples/v1/typescript/src/standbyContainerGroupPoolRuntimeViewsGetSample.ts b/sdk/standbypool/arm-standbypool/samples/v1/typescript/src/standbyContainerGroupPoolRuntimeViewsGetSample.ts deleted file mode 100644 index c332e9b97753..000000000000 --- a/sdk/standbypool/arm-standbypool/samples/v1/typescript/src/standbyContainerGroupPoolRuntimeViewsGetSample.ts +++ /dev/null @@ -1,29 +0,0 @@ -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. - -import { StandbyPoolManagementClient } from "@azure/arm-standbypool"; -import { DefaultAzureCredential } from "@azure/identity"; - -/** - * This sample demonstrates how to get a StandbyContainerGroupPoolRuntimeViewResource - * - * @summary get a StandbyContainerGroupPoolRuntimeViewResource - * x-ms-original-file: 2024-03-01/StandbyContainerGroupPoolRuntimeViews_Get.json - */ -async function standbyContainerGroupPoolRuntimeViewsGet() { - const credential = new DefaultAzureCredential(); - const subscriptionId = "00000000-0000-0000-0000-000000000009"; - const client = new StandbyPoolManagementClient(credential, subscriptionId); - const result = await client.standbyContainerGroupPoolRuntimeViews.get( - "rgstandbypool", - "pool", - "latest", - ); - console.log(result); -} - -async function main() { - standbyContainerGroupPoolRuntimeViewsGet(); -} - -main().catch(console.error); diff --git a/sdk/standbypool/arm-standbypool/samples/v1/typescript/src/standbyContainerGroupPoolRuntimeViewsListByStandbyPoolSample.ts b/sdk/standbypool/arm-standbypool/samples/v1/typescript/src/standbyContainerGroupPoolRuntimeViewsListByStandbyPoolSample.ts deleted file mode 100644 index 9b2cec06f54c..000000000000 --- a/sdk/standbypool/arm-standbypool/samples/v1/typescript/src/standbyContainerGroupPoolRuntimeViewsListByStandbyPoolSample.ts +++ /dev/null @@ -1,32 +0,0 @@ -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. - -import { StandbyPoolManagementClient } from "@azure/arm-standbypool"; -import { DefaultAzureCredential } from "@azure/identity"; - -/** - * This sample demonstrates how to list StandbyContainerGroupPoolRuntimeViewResource resources by StandbyContainerGroupPoolResource - * - * @summary list StandbyContainerGroupPoolRuntimeViewResource resources by StandbyContainerGroupPoolResource - * x-ms-original-file: 2024-03-01/StandbyContainerGroupPoolRuntimeViews_ListByStandbyPool.json - */ -async function standbyContainerGroupPoolRuntimeViewsListByStandbyPool() { - const credential = new DefaultAzureCredential(); - const subscriptionId = "00000000-0000-0000-0000-000000000009"; - const client = new StandbyPoolManagementClient(credential, subscriptionId); - const resArray = new Array(); - for await (let item of client.standbyContainerGroupPoolRuntimeViews.listByStandbyPool( - "rgstandbypool", - "pool", - )) { - resArray.push(item); - } - - console.log(resArray); -} - -async function main() { - standbyContainerGroupPoolRuntimeViewsListByStandbyPool(); -} - -main().catch(console.error); diff --git a/sdk/standbypool/arm-standbypool/samples/v1/typescript/src/standbyContainerGroupPoolsCreateOrUpdateSample.ts b/sdk/standbypool/arm-standbypool/samples/v1/typescript/src/standbyContainerGroupPoolsCreateOrUpdateSample.ts deleted file mode 100644 index bdaeaf05da9c..000000000000 --- a/sdk/standbypool/arm-standbypool/samples/v1/typescript/src/standbyContainerGroupPoolsCreateOrUpdateSample.ts +++ /dev/null @@ -1,42 +0,0 @@ -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. - -import { StandbyPoolManagementClient } from "@azure/arm-standbypool"; -import { DefaultAzureCredential } from "@azure/identity"; - -/** - * This sample demonstrates how to create a StandbyContainerGroupPoolResource - * - * @summary create a StandbyContainerGroupPoolResource - * x-ms-original-file: 2024-03-01/StandbyContainerGroupPools_CreateOrUpdate.json - */ -async function standbyContainerGroupPoolsCreateOrUpdate() { - const credential = new DefaultAzureCredential(); - const subscriptionId = "00000000-0000-0000-0000-000000000009"; - const client = new StandbyPoolManagementClient(credential, subscriptionId); - const result = await client.standbyContainerGroupPools.createOrUpdate("rgstandbypool", "pool", { - properties: { - elasticityProfile: { maxReadyCapacity: 688, refillPolicy: "always" }, - containerGroupProperties: { - containerGroupProfile: { - id: "/subscriptions/00000000-0000-0000-0000-000000000009/resourceGroups/rgstandbypool/providers/Microsoft.ContainerInstance/containerGroupProfiles/cgProfile", - revision: 1, - }, - subnetIds: [ - { - id: "/subscriptions/00000000-0000-0000-0000-000000000009/resourceGroups/rgstandbypool/providers/Microsoft.Network/virtualNetworks/cgSubnet/subnets/cgSubnet", - }, - ], - }, - }, - tags: {}, - location: "West US", - }); - console.log(result); -} - -async function main() { - standbyContainerGroupPoolsCreateOrUpdate(); -} - -main().catch(console.error); diff --git a/sdk/standbypool/arm-standbypool/samples/v1/typescript/src/standbyContainerGroupPoolsDeleteSample.ts b/sdk/standbypool/arm-standbypool/samples/v1/typescript/src/standbyContainerGroupPoolsDeleteSample.ts deleted file mode 100644 index 3cd4b4c38705..000000000000 --- a/sdk/standbypool/arm-standbypool/samples/v1/typescript/src/standbyContainerGroupPoolsDeleteSample.ts +++ /dev/null @@ -1,24 +0,0 @@ -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. - -import { StandbyPoolManagementClient } from "@azure/arm-standbypool"; -import { DefaultAzureCredential } from "@azure/identity"; - -/** - * This sample demonstrates how to delete a StandbyContainerGroupPoolResource - * - * @summary delete a StandbyContainerGroupPoolResource - * x-ms-original-file: 2024-03-01/StandbyContainerGroupPools_Delete.json - */ -async function standbyContainerGroupPoolsDelete() { - const credential = new DefaultAzureCredential(); - const subscriptionId = "00000000-0000-0000-0000-000000000009"; - const client = new StandbyPoolManagementClient(credential, subscriptionId); - await client.standbyContainerGroupPools.delete("rgstandbypool", "pool"); -} - -async function main() { - standbyContainerGroupPoolsDelete(); -} - -main().catch(console.error); diff --git a/sdk/standbypool/arm-standbypool/samples/v1/typescript/src/standbyContainerGroupPoolsGetSample.ts b/sdk/standbypool/arm-standbypool/samples/v1/typescript/src/standbyContainerGroupPoolsGetSample.ts deleted file mode 100644 index 1ac71a70ed77..000000000000 --- a/sdk/standbypool/arm-standbypool/samples/v1/typescript/src/standbyContainerGroupPoolsGetSample.ts +++ /dev/null @@ -1,25 +0,0 @@ -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. - -import { StandbyPoolManagementClient } from "@azure/arm-standbypool"; -import { DefaultAzureCredential } from "@azure/identity"; - -/** - * This sample demonstrates how to get a StandbyContainerGroupPoolResource - * - * @summary get a StandbyContainerGroupPoolResource - * x-ms-original-file: 2024-03-01/StandbyContainerGroupPools_Get.json - */ -async function standbyContainerGroupPoolsGet() { - const credential = new DefaultAzureCredential(); - const subscriptionId = "00000000-0000-0000-0000-000000000009"; - const client = new StandbyPoolManagementClient(credential, subscriptionId); - const result = await client.standbyContainerGroupPools.get("rgstandbypool", "pool"); - console.log(result); -} - -async function main() { - standbyContainerGroupPoolsGet(); -} - -main().catch(console.error); diff --git a/sdk/standbypool/arm-standbypool/samples/v1/typescript/src/standbyContainerGroupPoolsListByResourceGroupSample.ts b/sdk/standbypool/arm-standbypool/samples/v1/typescript/src/standbyContainerGroupPoolsListByResourceGroupSample.ts deleted file mode 100644 index 685eed5edd66..000000000000 --- a/sdk/standbypool/arm-standbypool/samples/v1/typescript/src/standbyContainerGroupPoolsListByResourceGroupSample.ts +++ /dev/null @@ -1,29 +0,0 @@ -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. - -import { StandbyPoolManagementClient } from "@azure/arm-standbypool"; -import { DefaultAzureCredential } from "@azure/identity"; - -/** - * This sample demonstrates how to list StandbyContainerGroupPoolResource resources by resource group - * - * @summary list StandbyContainerGroupPoolResource resources by resource group - * x-ms-original-file: 2024-03-01/StandbyContainerGroupPools_ListByResourceGroup.json - */ -async function standbyContainerGroupPoolsListByResourceGroup() { - const credential = new DefaultAzureCredential(); - const subscriptionId = "00000000-0000-0000-0000-000000000009"; - const client = new StandbyPoolManagementClient(credential, subscriptionId); - const resArray = new Array(); - for await (let item of client.standbyContainerGroupPools.listByResourceGroup("rgstandbypool")) { - resArray.push(item); - } - - console.log(resArray); -} - -async function main() { - standbyContainerGroupPoolsListByResourceGroup(); -} - -main().catch(console.error); diff --git a/sdk/standbypool/arm-standbypool/samples/v1/typescript/src/standbyContainerGroupPoolsListBySubscriptionSample.ts b/sdk/standbypool/arm-standbypool/samples/v1/typescript/src/standbyContainerGroupPoolsListBySubscriptionSample.ts deleted file mode 100644 index 0e388ebccf42..000000000000 --- a/sdk/standbypool/arm-standbypool/samples/v1/typescript/src/standbyContainerGroupPoolsListBySubscriptionSample.ts +++ /dev/null @@ -1,29 +0,0 @@ -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. - -import { StandbyPoolManagementClient } from "@azure/arm-standbypool"; -import { DefaultAzureCredential } from "@azure/identity"; - -/** - * This sample demonstrates how to list StandbyContainerGroupPoolResource resources by subscription ID - * - * @summary list StandbyContainerGroupPoolResource resources by subscription ID - * x-ms-original-file: 2024-03-01/StandbyContainerGroupPools_ListBySubscription.json - */ -async function standbyContainerGroupPoolsListBySubscription() { - const credential = new DefaultAzureCredential(); - const subscriptionId = "00000000-0000-0000-0000-000000000009"; - const client = new StandbyPoolManagementClient(credential, subscriptionId); - const resArray = new Array(); - for await (let item of client.standbyContainerGroupPools.listBySubscription()) { - resArray.push(item); - } - - console.log(resArray); -} - -async function main() { - standbyContainerGroupPoolsListBySubscription(); -} - -main().catch(console.error); diff --git a/sdk/standbypool/arm-standbypool/samples/v1/typescript/src/standbyContainerGroupPoolsUpdateSample.ts b/sdk/standbypool/arm-standbypool/samples/v1/typescript/src/standbyContainerGroupPoolsUpdateSample.ts deleted file mode 100644 index 635c23982de8..000000000000 --- a/sdk/standbypool/arm-standbypool/samples/v1/typescript/src/standbyContainerGroupPoolsUpdateSample.ts +++ /dev/null @@ -1,41 +0,0 @@ -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. - -import { StandbyPoolManagementClient } from "@azure/arm-standbypool"; -import { DefaultAzureCredential } from "@azure/identity"; - -/** - * This sample demonstrates how to update a StandbyContainerGroupPoolResource - * - * @summary update a StandbyContainerGroupPoolResource - * x-ms-original-file: 2024-03-01/StandbyContainerGroupPools_Update.json - */ -async function standbyContainerGroupPoolsUpdate() { - const credential = new DefaultAzureCredential(); - const subscriptionId = "00000000-0000-0000-0000-000000000009"; - const client = new StandbyPoolManagementClient(credential, subscriptionId); - const result = await client.standbyContainerGroupPools.update("rgstandbypool", "pool", { - tags: {}, - properties: { - elasticityProfile: { maxReadyCapacity: 1743, refillPolicy: "always" }, - containerGroupProperties: { - containerGroupProfile: { - id: "/subscriptions/00000000-0000-0000-0000-000000000009/resourceGroups/rgstandbypool/providers/Microsoft.ContainerInstance/containerGroupProfiles/cgProfile", - revision: 2, - }, - subnetIds: [ - { - id: "/subscriptions/00000000-0000-0000-0000-000000000009/resourceGroups/rgstandbypool/providers/Microsoft.Network/virtualNetworks/cgSubnet/subnets/cgSubnet", - }, - ], - }, - }, - }); - console.log(result); -} - -async function main() { - standbyContainerGroupPoolsUpdate(); -} - -main().catch(console.error); diff --git a/sdk/standbypool/arm-standbypool/samples/v1/typescript/src/standbyVirtualMachinePoolRuntimeViewsGetSample.ts b/sdk/standbypool/arm-standbypool/samples/v1/typescript/src/standbyVirtualMachinePoolRuntimeViewsGetSample.ts deleted file mode 100644 index 7811a499ab75..000000000000 --- a/sdk/standbypool/arm-standbypool/samples/v1/typescript/src/standbyVirtualMachinePoolRuntimeViewsGetSample.ts +++ /dev/null @@ -1,29 +0,0 @@ -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. - -import { StandbyPoolManagementClient } from "@azure/arm-standbypool"; -import { DefaultAzureCredential } from "@azure/identity"; - -/** - * This sample demonstrates how to get a StandbyVirtualMachinePoolRuntimeViewResource - * - * @summary get a StandbyVirtualMachinePoolRuntimeViewResource - * x-ms-original-file: 2024-03-01/StandbyVirtualMachinePoolRuntimeViews_Get.json - */ -async function standbyVirtualMachinePoolRuntimeViewsGet() { - const credential = new DefaultAzureCredential(); - const subscriptionId = "00000000-0000-0000-0000-000000000009"; - const client = new StandbyPoolManagementClient(credential, subscriptionId); - const result = await client.standbyVirtualMachinePoolRuntimeViews.get( - "rgstandbypool", - "pool", - "latest", - ); - console.log(result); -} - -async function main() { - standbyVirtualMachinePoolRuntimeViewsGet(); -} - -main().catch(console.error); diff --git a/sdk/standbypool/arm-standbypool/samples/v1/typescript/src/standbyVirtualMachinePoolRuntimeViewsListByStandbyPoolSample.ts b/sdk/standbypool/arm-standbypool/samples/v1/typescript/src/standbyVirtualMachinePoolRuntimeViewsListByStandbyPoolSample.ts deleted file mode 100644 index f0636418c0f2..000000000000 --- a/sdk/standbypool/arm-standbypool/samples/v1/typescript/src/standbyVirtualMachinePoolRuntimeViewsListByStandbyPoolSample.ts +++ /dev/null @@ -1,32 +0,0 @@ -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. - -import { StandbyPoolManagementClient } from "@azure/arm-standbypool"; -import { DefaultAzureCredential } from "@azure/identity"; - -/** - * This sample demonstrates how to list StandbyVirtualMachinePoolRuntimeViewResource resources by StandbyVirtualMachinePoolResource - * - * @summary list StandbyVirtualMachinePoolRuntimeViewResource resources by StandbyVirtualMachinePoolResource - * x-ms-original-file: 2024-03-01/StandbyVirtualMachinePoolRuntimeViews_ListByStandbyPool.json - */ -async function standbyVirtualMachinePoolRuntimeViewsListByStandbyPool() { - const credential = new DefaultAzureCredential(); - const subscriptionId = "00000000-0000-0000-0000-000000000009"; - const client = new StandbyPoolManagementClient(credential, subscriptionId); - const resArray = new Array(); - for await (let item of client.standbyVirtualMachinePoolRuntimeViews.listByStandbyPool( - "rgstandbypool", - "pool", - )) { - resArray.push(item); - } - - console.log(resArray); -} - -async function main() { - standbyVirtualMachinePoolRuntimeViewsListByStandbyPool(); -} - -main().catch(console.error); diff --git a/sdk/standbypool/arm-standbypool/samples/v1/typescript/src/standbyVirtualMachinePoolsCreateOrUpdateSample.ts b/sdk/standbypool/arm-standbypool/samples/v1/typescript/src/standbyVirtualMachinePoolsCreateOrUpdateSample.ts deleted file mode 100644 index 9e01b5253953..000000000000 --- a/sdk/standbypool/arm-standbypool/samples/v1/typescript/src/standbyVirtualMachinePoolsCreateOrUpdateSample.ts +++ /dev/null @@ -1,34 +0,0 @@ -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. - -import { StandbyPoolManagementClient } from "@azure/arm-standbypool"; -import { DefaultAzureCredential } from "@azure/identity"; - -/** - * This sample demonstrates how to create a StandbyVirtualMachinePoolResource - * - * @summary create a StandbyVirtualMachinePoolResource - * x-ms-original-file: 2024-03-01/StandbyVirtualMachinePools_CreateOrUpdate.json - */ -async function standbyVirtualMachinePoolsCreateOrUpdate() { - const credential = new DefaultAzureCredential(); - const subscriptionId = "00000000-0000-0000-0000-000000000009"; - const client = new StandbyPoolManagementClient(credential, subscriptionId); - const result = await client.standbyVirtualMachinePools.createOrUpdate("rgstandbypool", "pool", { - properties: { - elasticityProfile: { maxReadyCapacity: 304, minReadyCapacity: 300 }, - virtualMachineState: "Running", - attachedVirtualMachineScaleSetId: - "/subscriptions/00000000-0000-0000-0000-000000000009/resourceGroups/rgstandbypool/providers/Microsoft.Compute/virtualMachineScaleSets/myVmss", - }, - tags: {}, - location: "West US", - }); - console.log(result); -} - -async function main() { - standbyVirtualMachinePoolsCreateOrUpdate(); -} - -main().catch(console.error); diff --git a/sdk/standbypool/arm-standbypool/samples/v1/typescript/src/standbyVirtualMachinePoolsDeleteSample.ts b/sdk/standbypool/arm-standbypool/samples/v1/typescript/src/standbyVirtualMachinePoolsDeleteSample.ts deleted file mode 100644 index 13854a5b536c..000000000000 --- a/sdk/standbypool/arm-standbypool/samples/v1/typescript/src/standbyVirtualMachinePoolsDeleteSample.ts +++ /dev/null @@ -1,24 +0,0 @@ -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. - -import { StandbyPoolManagementClient } from "@azure/arm-standbypool"; -import { DefaultAzureCredential } from "@azure/identity"; - -/** - * This sample demonstrates how to delete a StandbyVirtualMachinePoolResource - * - * @summary delete a StandbyVirtualMachinePoolResource - * x-ms-original-file: 2024-03-01/StandbyVirtualMachinePools_Delete.json - */ -async function standbyVirtualMachinePoolsDelete() { - const credential = new DefaultAzureCredential(); - const subscriptionId = "00000000-0000-0000-0000-000000000009"; - const client = new StandbyPoolManagementClient(credential, subscriptionId); - await client.standbyVirtualMachinePools.delete("rgstandbypool", "pool"); -} - -async function main() { - standbyVirtualMachinePoolsDelete(); -} - -main().catch(console.error); diff --git a/sdk/standbypool/arm-standbypool/samples/v1/typescript/src/standbyVirtualMachinePoolsGetSample.ts b/sdk/standbypool/arm-standbypool/samples/v1/typescript/src/standbyVirtualMachinePoolsGetSample.ts deleted file mode 100644 index 6e711be3f83b..000000000000 --- a/sdk/standbypool/arm-standbypool/samples/v1/typescript/src/standbyVirtualMachinePoolsGetSample.ts +++ /dev/null @@ -1,25 +0,0 @@ -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. - -import { StandbyPoolManagementClient } from "@azure/arm-standbypool"; -import { DefaultAzureCredential } from "@azure/identity"; - -/** - * This sample demonstrates how to get a StandbyVirtualMachinePoolResource - * - * @summary get a StandbyVirtualMachinePoolResource - * x-ms-original-file: 2024-03-01/StandbyVirtualMachinePools_Get.json - */ -async function standbyVirtualMachinePoolsGet() { - const credential = new DefaultAzureCredential(); - const subscriptionId = "00000000-0000-0000-0000-000000000009"; - const client = new StandbyPoolManagementClient(credential, subscriptionId); - const result = await client.standbyVirtualMachinePools.get("rgstandbypool", "pool"); - console.log(result); -} - -async function main() { - standbyVirtualMachinePoolsGet(); -} - -main().catch(console.error); diff --git a/sdk/standbypool/arm-standbypool/samples/v1/typescript/src/standbyVirtualMachinePoolsListByResourceGroupSample.ts b/sdk/standbypool/arm-standbypool/samples/v1/typescript/src/standbyVirtualMachinePoolsListByResourceGroupSample.ts deleted file mode 100644 index 0d33c9646b67..000000000000 --- a/sdk/standbypool/arm-standbypool/samples/v1/typescript/src/standbyVirtualMachinePoolsListByResourceGroupSample.ts +++ /dev/null @@ -1,29 +0,0 @@ -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. - -import { StandbyPoolManagementClient } from "@azure/arm-standbypool"; -import { DefaultAzureCredential } from "@azure/identity"; - -/** - * This sample demonstrates how to list StandbyVirtualMachinePoolResource resources by resource group - * - * @summary list StandbyVirtualMachinePoolResource resources by resource group - * x-ms-original-file: 2024-03-01/StandbyVirtualMachinePools_ListByResourceGroup.json - */ -async function standbyVirtualMachinePoolsListByResourceGroup() { - const credential = new DefaultAzureCredential(); - const subscriptionId = "00000000-0000-0000-0000-000000000009"; - const client = new StandbyPoolManagementClient(credential, subscriptionId); - const resArray = new Array(); - for await (let item of client.standbyVirtualMachinePools.listByResourceGroup("rgstandbypool")) { - resArray.push(item); - } - - console.log(resArray); -} - -async function main() { - standbyVirtualMachinePoolsListByResourceGroup(); -} - -main().catch(console.error); diff --git a/sdk/standbypool/arm-standbypool/samples/v1/typescript/src/standbyVirtualMachinePoolsListBySubscriptionSample.ts b/sdk/standbypool/arm-standbypool/samples/v1/typescript/src/standbyVirtualMachinePoolsListBySubscriptionSample.ts deleted file mode 100644 index 95e2eb31d0f1..000000000000 --- a/sdk/standbypool/arm-standbypool/samples/v1/typescript/src/standbyVirtualMachinePoolsListBySubscriptionSample.ts +++ /dev/null @@ -1,29 +0,0 @@ -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. - -import { StandbyPoolManagementClient } from "@azure/arm-standbypool"; -import { DefaultAzureCredential } from "@azure/identity"; - -/** - * This sample demonstrates how to list StandbyVirtualMachinePoolResource resources by subscription ID - * - * @summary list StandbyVirtualMachinePoolResource resources by subscription ID - * x-ms-original-file: 2024-03-01/StandbyVirtualMachinePools_ListBySubscription.json - */ -async function standbyVirtualMachinePoolsListBySubscription() { - const credential = new DefaultAzureCredential(); - const subscriptionId = "00000000-0000-0000-0000-000000000009"; - const client = new StandbyPoolManagementClient(credential, subscriptionId); - const resArray = new Array(); - for await (let item of client.standbyVirtualMachinePools.listBySubscription()) { - resArray.push(item); - } - - console.log(resArray); -} - -async function main() { - standbyVirtualMachinePoolsListBySubscription(); -} - -main().catch(console.error); diff --git a/sdk/standbypool/arm-standbypool/samples/v1/typescript/src/standbyVirtualMachinePoolsUpdateSample.ts b/sdk/standbypool/arm-standbypool/samples/v1/typescript/src/standbyVirtualMachinePoolsUpdateSample.ts deleted file mode 100644 index 2651641d2f1f..000000000000 --- a/sdk/standbypool/arm-standbypool/samples/v1/typescript/src/standbyVirtualMachinePoolsUpdateSample.ts +++ /dev/null @@ -1,33 +0,0 @@ -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. - -import { StandbyPoolManagementClient } from "@azure/arm-standbypool"; -import { DefaultAzureCredential } from "@azure/identity"; - -/** - * This sample demonstrates how to update a StandbyVirtualMachinePoolResource - * - * @summary update a StandbyVirtualMachinePoolResource - * x-ms-original-file: 2024-03-01/StandbyVirtualMachinePools_Update.json - */ -async function standbyVirtualMachinePoolsUpdate() { - const credential = new DefaultAzureCredential(); - const subscriptionId = "00000000-0000-0000-0000-000000000009"; - const client = new StandbyPoolManagementClient(credential, subscriptionId); - const result = await client.standbyVirtualMachinePools.update("rgstandbypool", "pool", { - tags: {}, - properties: { - elasticityProfile: { maxReadyCapacity: 304, minReadyCapacity: 300 }, - virtualMachineState: "Running", - attachedVirtualMachineScaleSetId: - "/subscriptions/00000000-0000-0000-0000-000000000009/resourceGroups/rgstandbypool/providers/Microsoft.Compute/virtualMachineScaleSets/myVmss", - }, - }); - console.log(result); -} - -async function main() { - standbyVirtualMachinePoolsUpdate(); -} - -main().catch(console.error); diff --git a/sdk/standbypool/arm-standbypool/samples/v1/typescript/src/standbyVirtualMachinesGetSample.ts b/sdk/standbypool/arm-standbypool/samples/v1/typescript/src/standbyVirtualMachinesGetSample.ts deleted file mode 100644 index 6a6003decb48..000000000000 --- a/sdk/standbypool/arm-standbypool/samples/v1/typescript/src/standbyVirtualMachinesGetSample.ts +++ /dev/null @@ -1,25 +0,0 @@ -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. - -import { StandbyPoolManagementClient } from "@azure/arm-standbypool"; -import { DefaultAzureCredential } from "@azure/identity"; - -/** - * This sample demonstrates how to get a StandbyVirtualMachineResource - * - * @summary get a StandbyVirtualMachineResource - * x-ms-original-file: 2024-03-01/StandbyVirtualMachines_Get.json - */ -async function standbyVirtualMachinesGet() { - const credential = new DefaultAzureCredential(); - const subscriptionId = "00000000-0000-0000-0000-000000000009"; - const client = new StandbyPoolManagementClient(credential, subscriptionId); - const result = await client.standbyVirtualMachines.get("rgstandbypool", "pool", "virtualMachine"); - console.log(result); -} - -async function main() { - standbyVirtualMachinesGet(); -} - -main().catch(console.error); diff --git a/sdk/standbypool/arm-standbypool/samples/v1/typescript/src/standbyVirtualMachinesListByStandbyVirtualMachinePoolResourceSample.ts b/sdk/standbypool/arm-standbypool/samples/v1/typescript/src/standbyVirtualMachinesListByStandbyVirtualMachinePoolResourceSample.ts deleted file mode 100644 index d92be150cea1..000000000000 --- a/sdk/standbypool/arm-standbypool/samples/v1/typescript/src/standbyVirtualMachinesListByStandbyVirtualMachinePoolResourceSample.ts +++ /dev/null @@ -1,32 +0,0 @@ -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. - -import { StandbyPoolManagementClient } from "@azure/arm-standbypool"; -import { DefaultAzureCredential } from "@azure/identity"; - -/** - * This sample demonstrates how to list StandbyVirtualMachineResource resources by StandbyVirtualMachinePoolResource - * - * @summary list StandbyVirtualMachineResource resources by StandbyVirtualMachinePoolResource - * x-ms-original-file: 2024-03-01/StandbyVirtualMachines_ListByStandbyVirtualMachinePoolResource.json - */ -async function standbyVirtualMachinesListByStandbyVirtualMachinePoolResource() { - const credential = new DefaultAzureCredential(); - const subscriptionId = "00000000-0000-0000-0000-000000000009"; - const client = new StandbyPoolManagementClient(credential, subscriptionId); - const resArray = new Array(); - for await (let item of client.standbyVirtualMachines.listByStandbyVirtualMachinePoolResource( - "rgstandbypool", - "pool", - )) { - resArray.push(item); - } - - console.log(resArray); -} - -async function main() { - standbyVirtualMachinesListByStandbyVirtualMachinePoolResource(); -} - -main().catch(console.error); diff --git a/sdk/standbypool/arm-standbypool/samples/v1/typescript/tsconfig.json b/sdk/standbypool/arm-standbypool/samples/v1/typescript/tsconfig.json deleted file mode 100644 index 984eed535aa8..000000000000 --- a/sdk/standbypool/arm-standbypool/samples/v1/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/standbypool/arm-standbypool/src/api/index.ts b/sdk/standbypool/arm-standbypool/src/api/index.ts index 583b7b0fab0c..40188ac5eabb 100644 --- a/sdk/standbypool/arm-standbypool/src/api/index.ts +++ b/sdk/standbypool/arm-standbypool/src/api/index.ts @@ -1,9 +1,30 @@ // Copyright (c) Microsoft Corporation. // Licensed under the MIT License. +export { + OperationsListOptionalParams, + StandbyVirtualMachinePoolsGetOptionalParams, + StandbyVirtualMachinePoolsCreateOrUpdateOptionalParams, + StandbyVirtualMachinePoolsDeleteOptionalParams, + StandbyVirtualMachinePoolsUpdateOptionalParams, + StandbyVirtualMachinePoolsListByResourceGroupOptionalParams, + StandbyVirtualMachinePoolsListBySubscriptionOptionalParams, + StandbyVirtualMachinesGetOptionalParams, + StandbyVirtualMachinesListByStandbyVirtualMachinePoolResourceOptionalParams, + StandbyVirtualMachinePoolRuntimeViewsGetOptionalParams, + StandbyVirtualMachinePoolRuntimeViewsListByStandbyPoolOptionalParams, + StandbyContainerGroupPoolsGetOptionalParams, + StandbyContainerGroupPoolsCreateOrUpdateOptionalParams, + StandbyContainerGroupPoolsDeleteOptionalParams, + StandbyContainerGroupPoolsUpdateOptionalParams, + StandbyContainerGroupPoolsListByResourceGroupOptionalParams, + StandbyContainerGroupPoolsListBySubscriptionOptionalParams, + StandbyContainerGroupPoolRuntimeViewsGetOptionalParams, + StandbyContainerGroupPoolRuntimeViewsListByStandbyPoolOptionalParams, +} from "./options.js"; export { createStandbyPoolManagement, - StandbyPoolContext, + StandbyPoolManagementContext, StandbyPoolManagementClientOptionalParams, } from "./standbyPoolManagementContext.js"; export { operationsList } from "./operations/index.js"; diff --git a/sdk/standbypool/arm-standbypool/src/api/operations/index.ts b/sdk/standbypool/arm-standbypool/src/api/operations/index.ts index 18aa4b660ed4..6db62cb9c357 100644 --- a/sdk/standbypool/arm-standbypool/src/api/operations/index.ts +++ b/sdk/standbypool/arm-standbypool/src/api/operations/index.ts @@ -1,19 +1,22 @@ // Copyright (c) Microsoft Corporation. // Licensed under the MIT License. -import { Operation, _OperationListResult } from "../../models/models.js"; -import { StandbyPoolContext as Client } from "../index.js"; +import { StandbyPoolManagementContext as Client, OperationsListOptionalParams } from "../index.js"; import { - StreamableMethod, - operationOptionsToRequestParameters, - PathUncheckedResponse, - createRestError, -} from "@azure-rest/core-client"; + _OperationListResult, + _operationListResultDeserializer, + Operation, +} from "../../models/models.js"; import { PagedAsyncIterableIterator, buildPagedAsyncIterator, } from "../../static-helpers/pagingHelpers.js"; -import { OperationsListOptionalParams } from "../../models/options.js"; +import { + StreamableMethod, + PathUncheckedResponse, + createRestError, + operationOptionsToRequestParameters, +} from "@azure-rest/core-client"; export function _operationsListSend( context: Client, @@ -32,25 +35,7 @@ export async function _operationsListDeserialize( throw createRestError(result); } - return { - value: result.body["value"].map((p: any) => { - return { - name: p["name"], - isDataAction: p["isDataAction"], - display: !p.display - ? undefined - : { - provider: p.display?.["provider"], - resource: p.display?.["resource"], - operation: p.display?.["operation"], - description: p.display?.["description"], - }, - origin: p["origin"], - actionType: p["actionType"], - }; - }), - nextLink: result.body["nextLink"], - }; + return _operationListResultDeserializer(result.body); } /** List the operations for the provider */ diff --git a/sdk/standbypool/arm-standbypool/src/models/options.ts b/sdk/standbypool/arm-standbypool/src/api/options.ts similarity index 100% rename from sdk/standbypool/arm-standbypool/src/models/options.ts rename to sdk/standbypool/arm-standbypool/src/api/options.ts diff --git a/sdk/standbypool/arm-standbypool/src/api/standbyContainerGroupPoolRuntimeViews/index.ts b/sdk/standbypool/arm-standbypool/src/api/standbyContainerGroupPoolRuntimeViews/index.ts index 055fce3dae78..6867b6f9585c 100644 --- a/sdk/standbypool/arm-standbypool/src/api/standbyContainerGroupPoolRuntimeViews/index.ts +++ b/sdk/standbypool/arm-standbypool/src/api/standbyContainerGroupPoolRuntimeViews/index.ts @@ -1,25 +1,27 @@ // Copyright (c) Microsoft Corporation. // Licensed under the MIT License. +import { + StandbyPoolManagementContext as Client, + StandbyContainerGroupPoolRuntimeViewsGetOptionalParams, + StandbyContainerGroupPoolRuntimeViewsListByStandbyPoolOptionalParams, +} from "../index.js"; import { StandbyContainerGroupPoolRuntimeViewResource, + standbyContainerGroupPoolRuntimeViewResourceDeserializer, _StandbyContainerGroupPoolRuntimeViewResourceListResult, + _standbyContainerGroupPoolRuntimeViewResourceListResultDeserializer, } from "../../models/models.js"; -import { StandbyPoolContext as Client } from "../index.js"; -import { - StreamableMethod, - operationOptionsToRequestParameters, - PathUncheckedResponse, - createRestError, -} from "@azure-rest/core-client"; import { PagedAsyncIterableIterator, buildPagedAsyncIterator, } from "../../static-helpers/pagingHelpers.js"; import { - StandbyContainerGroupPoolRuntimeViewsGetOptionalParams, - StandbyContainerGroupPoolRuntimeViewsListByStandbyPoolOptionalParams, -} from "../../models/options.js"; + StreamableMethod, + PathUncheckedResponse, + createRestError, + operationOptionsToRequestParameters, +} from "@azure-rest/core-client"; export function _standbyContainerGroupPoolRuntimeViewsGetSend( context: Client, @@ -50,39 +52,7 @@ export async function _standbyContainerGroupPoolRuntimeViewsGetDeserialize( throw createRestError(result); } - return { - id: result.body["id"], - name: result.body["name"], - type: result.body["type"], - systemData: !result.body.systemData - ? undefined - : { - createdBy: result.body.systemData?.["createdBy"], - createdByType: result.body.systemData?.["createdByType"], - createdAt: - result.body.systemData?.["createdAt"] !== undefined - ? new Date(result.body.systemData?.["createdAt"]) - : undefined, - lastModifiedBy: result.body.systemData?.["lastModifiedBy"], - lastModifiedByType: result.body.systemData?.["lastModifiedByType"], - lastModifiedAt: - result.body.systemData?.["lastModifiedAt"] !== undefined - ? new Date(result.body.systemData?.["lastModifiedAt"]) - : undefined, - }, - properties: !result.body.properties - ? undefined - : { - instanceCountSummary: result.body.properties?.["instanceCountSummary"].map((p: any) => { - return { - instanceCountsByState: p["instanceCountsByState"].map((p: any) => { - return { state: p["state"], count: p["count"] }; - }), - }; - }), - provisioningState: result.body.properties?.["provisioningState"], - }, - }; + return standbyContainerGroupPoolRuntimeViewResourceDeserializer(result.body); } /** Get a StandbyContainerGroupPoolRuntimeViewResource */ @@ -134,44 +104,7 @@ export async function _standbyContainerGroupPoolRuntimeViewsListByStandbyPoolDes throw createRestError(result); } - return { - value: result.body["value"].map((p: any) => { - return { - id: p["id"], - name: p["name"], - type: p["type"], - systemData: !p.systemData - ? undefined - : { - createdBy: p.systemData?.["createdBy"], - createdByType: p.systemData?.["createdByType"], - createdAt: - p.systemData?.["createdAt"] !== undefined - ? new Date(p.systemData?.["createdAt"]) - : undefined, - lastModifiedBy: p.systemData?.["lastModifiedBy"], - lastModifiedByType: p.systemData?.["lastModifiedByType"], - lastModifiedAt: - p.systemData?.["lastModifiedAt"] !== undefined - ? new Date(p.systemData?.["lastModifiedAt"]) - : undefined, - }, - properties: !p.properties - ? undefined - : { - instanceCountSummary: p.properties?.["instanceCountSummary"].map((p: any) => { - return { - instanceCountsByState: p["instanceCountsByState"].map((p: any) => { - return { state: p["state"], count: p["count"] }; - }), - }; - }), - provisioningState: p.properties?.["provisioningState"], - }, - }; - }), - nextLink: result.body["nextLink"], - }; + return _standbyContainerGroupPoolRuntimeViewResourceListResultDeserializer(result.body); } /** List StandbyContainerGroupPoolRuntimeViewResource resources by StandbyContainerGroupPoolResource */ diff --git a/sdk/standbypool/arm-standbypool/src/api/standbyContainerGroupPools/index.ts b/sdk/standbypool/arm-standbypool/src/api/standbyContainerGroupPools/index.ts index 3b0621773a94..263b06b731cb 100644 --- a/sdk/standbypool/arm-standbypool/src/api/standbyContainerGroupPools/index.ts +++ b/sdk/standbypool/arm-standbypool/src/api/standbyContainerGroupPools/index.ts @@ -2,34 +2,35 @@ // Licensed under the MIT License. import { - standbyContainerGroupPoolResourcePropertiesSerializer, - standbyContainerGroupPoolResourceUpdatePropertiesSerializer, + StandbyPoolManagementContext as Client, + StandbyContainerGroupPoolsCreateOrUpdateOptionalParams, + StandbyContainerGroupPoolsDeleteOptionalParams, + StandbyContainerGroupPoolsGetOptionalParams, + StandbyContainerGroupPoolsListByResourceGroupOptionalParams, + StandbyContainerGroupPoolsListBySubscriptionOptionalParams, + StandbyContainerGroupPoolsUpdateOptionalParams, +} from "../index.js"; +import { StandbyContainerGroupPoolResource, + standbyContainerGroupPoolResourceSerializer, + standbyContainerGroupPoolResourceDeserializer, StandbyContainerGroupPoolResourceUpdate, + standbyContainerGroupPoolResourceUpdateSerializer, _StandbyContainerGroupPoolResourceListResult, + _standbyContainerGroupPoolResourceListResultDeserializer, } from "../../models/models.js"; -import { StandbyPoolContext as Client } from "../index.js"; +import { + PagedAsyncIterableIterator, + buildPagedAsyncIterator, +} from "../../static-helpers/pagingHelpers.js"; +import { getLongRunningPoller } from "../../static-helpers/pollingHelpers.js"; import { StreamableMethod, - operationOptionsToRequestParameters, PathUncheckedResponse, createRestError, + operationOptionsToRequestParameters, } from "@azure-rest/core-client"; -import { serializeRecord } from "../../helpers/serializerHelpers.js"; -import { getLongRunningPoller } from "../../static-helpers/pollingHelpers.js"; -import { - PagedAsyncIterableIterator, - buildPagedAsyncIterator, -} from "../../static-helpers/pagingHelpers.js"; import { PollerLike, OperationState } from "@azure/core-lro"; -import { - StandbyContainerGroupPoolsGetOptionalParams, - StandbyContainerGroupPoolsCreateOrUpdateOptionalParams, - StandbyContainerGroupPoolsDeleteOptionalParams, - StandbyContainerGroupPoolsUpdateOptionalParams, - StandbyContainerGroupPoolsListByResourceGroupOptionalParams, - StandbyContainerGroupPoolsListBySubscriptionOptionalParams, -} from "../../models/options.js"; export function _standbyContainerGroupPoolsGetSend( context: Client, @@ -56,51 +57,7 @@ export async function _standbyContainerGroupPoolsGetDeserialize( throw createRestError(result); } - return { - tags: result.body["tags"], - location: result.body["location"], - id: result.body["id"], - name: result.body["name"], - type: result.body["type"], - systemData: !result.body.systemData - ? undefined - : { - createdBy: result.body.systemData?.["createdBy"], - createdByType: result.body.systemData?.["createdByType"], - createdAt: - result.body.systemData?.["createdAt"] !== undefined - ? new Date(result.body.systemData?.["createdAt"]) - : undefined, - lastModifiedBy: result.body.systemData?.["lastModifiedBy"], - lastModifiedByType: result.body.systemData?.["lastModifiedByType"], - lastModifiedAt: - result.body.systemData?.["lastModifiedAt"] !== undefined - ? new Date(result.body.systemData?.["lastModifiedAt"]) - : undefined, - }, - properties: !result.body.properties - ? undefined - : { - elasticityProfile: { - maxReadyCapacity: result.body.properties?.elasticityProfile["maxReadyCapacity"], - refillPolicy: result.body.properties?.elasticityProfile["refillPolicy"], - }, - containerGroupProperties: { - containerGroupProfile: { - id: result.body.properties?.containerGroupProperties.containerGroupProfile["id"], - revision: - result.body.properties?.containerGroupProperties.containerGroupProfile["revision"], - }, - subnetIds: - result.body.properties?.containerGroupProperties["subnetIds"] === undefined - ? result.body.properties?.containerGroupProperties["subnetIds"] - : result.body.properties?.containerGroupProperties["subnetIds"].map((p: any) => { - return { id: p["id"] }; - }), - }, - provisioningState: result.body.properties?.["provisioningState"], - }, - }; + return standbyContainerGroupPoolResourceDeserializer(result.body); } /** Get a StandbyContainerGroupPoolResource */ @@ -140,13 +97,7 @@ export function _standbyContainerGroupPoolsCreateOrUpdateSend( ) .put({ ...operationOptionsToRequestParameters(options), - body: { - tags: !resource.tags ? resource.tags : (serializeRecord(resource.tags as any) as any), - location: resource["location"], - properties: !resource.properties - ? resource.properties - : standbyContainerGroupPoolResourcePropertiesSerializer(resource.properties), - }, + body: standbyContainerGroupPoolResourceSerializer(resource), }); } @@ -158,51 +109,7 @@ export async function _standbyContainerGroupPoolsCreateOrUpdateDeserialize( throw createRestError(result); } - return { - tags: result.body["tags"], - location: result.body["location"], - id: result.body["id"], - name: result.body["name"], - type: result.body["type"], - systemData: !result.body.systemData - ? undefined - : { - createdBy: result.body.systemData?.["createdBy"], - createdByType: result.body.systemData?.["createdByType"], - createdAt: - result.body.systemData?.["createdAt"] !== undefined - ? new Date(result.body.systemData?.["createdAt"]) - : undefined, - lastModifiedBy: result.body.systemData?.["lastModifiedBy"], - lastModifiedByType: result.body.systemData?.["lastModifiedByType"], - lastModifiedAt: - result.body.systemData?.["lastModifiedAt"] !== undefined - ? new Date(result.body.systemData?.["lastModifiedAt"]) - : undefined, - }, - properties: !result.body.properties - ? undefined - : { - elasticityProfile: { - maxReadyCapacity: result.body.properties?.elasticityProfile["maxReadyCapacity"], - refillPolicy: result.body.properties?.elasticityProfile["refillPolicy"], - }, - containerGroupProperties: { - containerGroupProfile: { - id: result.body.properties?.containerGroupProperties.containerGroupProfile["id"], - revision: - result.body.properties?.containerGroupProperties.containerGroupProfile["revision"], - }, - subnetIds: - result.body.properties?.containerGroupProperties["subnetIds"] === undefined - ? result.body.properties?.containerGroupProperties["subnetIds"] - : result.body.properties?.containerGroupProperties["subnetIds"].map((p: any) => { - return { id: p["id"] }; - }), - }, - provisioningState: result.body.properties?.["provisioningState"], - }, - }; + return standbyContainerGroupPoolResourceDeserializer(result.body); } /** Create a StandbyContainerGroupPoolResource */ @@ -322,12 +229,7 @@ export function _standbyContainerGroupPoolsUpdateSend( ) .patch({ ...operationOptionsToRequestParameters(options), - body: { - tags: !properties.tags ? properties.tags : (serializeRecord(properties.tags as any) as any), - properties: !properties.properties - ? properties.properties - : standbyContainerGroupPoolResourceUpdatePropertiesSerializer(properties.properties), - }, + body: standbyContainerGroupPoolResourceUpdateSerializer(properties), }); } @@ -339,51 +241,7 @@ export async function _standbyContainerGroupPoolsUpdateDeserialize( throw createRestError(result); } - return { - tags: result.body["tags"], - location: result.body["location"], - id: result.body["id"], - name: result.body["name"], - type: result.body["type"], - systemData: !result.body.systemData - ? undefined - : { - createdBy: result.body.systemData?.["createdBy"], - createdByType: result.body.systemData?.["createdByType"], - createdAt: - result.body.systemData?.["createdAt"] !== undefined - ? new Date(result.body.systemData?.["createdAt"]) - : undefined, - lastModifiedBy: result.body.systemData?.["lastModifiedBy"], - lastModifiedByType: result.body.systemData?.["lastModifiedByType"], - lastModifiedAt: - result.body.systemData?.["lastModifiedAt"] !== undefined - ? new Date(result.body.systemData?.["lastModifiedAt"]) - : undefined, - }, - properties: !result.body.properties - ? undefined - : { - elasticityProfile: { - maxReadyCapacity: result.body.properties?.elasticityProfile["maxReadyCapacity"], - refillPolicy: result.body.properties?.elasticityProfile["refillPolicy"], - }, - containerGroupProperties: { - containerGroupProfile: { - id: result.body.properties?.containerGroupProperties.containerGroupProfile["id"], - revision: - result.body.properties?.containerGroupProperties.containerGroupProfile["revision"], - }, - subnetIds: - result.body.properties?.containerGroupProperties["subnetIds"] === undefined - ? result.body.properties?.containerGroupProperties["subnetIds"] - : result.body.properties?.containerGroupProperties["subnetIds"].map((p: any) => { - return { id: p["id"] }; - }), - }, - provisioningState: result.body.properties?.["provisioningState"], - }, - }; + return standbyContainerGroupPoolResourceDeserializer(result.body); } /** Update a StandbyContainerGroupPoolResource */ @@ -433,56 +291,7 @@ export async function _standbyContainerGroupPoolsListByResourceGroupDeserialize( throw createRestError(result); } - return { - value: result.body["value"].map((p: any) => { - return { - tags: p["tags"], - location: p["location"], - id: p["id"], - name: p["name"], - type: p["type"], - systemData: !p.systemData - ? undefined - : { - createdBy: p.systemData?.["createdBy"], - createdByType: p.systemData?.["createdByType"], - createdAt: - p.systemData?.["createdAt"] !== undefined - ? new Date(p.systemData?.["createdAt"]) - : undefined, - lastModifiedBy: p.systemData?.["lastModifiedBy"], - lastModifiedByType: p.systemData?.["lastModifiedByType"], - lastModifiedAt: - p.systemData?.["lastModifiedAt"] !== undefined - ? new Date(p.systemData?.["lastModifiedAt"]) - : undefined, - }, - properties: !p.properties - ? undefined - : { - elasticityProfile: { - maxReadyCapacity: p.properties?.elasticityProfile["maxReadyCapacity"], - refillPolicy: p.properties?.elasticityProfile["refillPolicy"], - }, - containerGroupProperties: { - containerGroupProfile: { - id: p.properties?.containerGroupProperties.containerGroupProfile["id"], - revision: - p.properties?.containerGroupProperties.containerGroupProfile["revision"], - }, - subnetIds: - p.properties?.containerGroupProperties["subnetIds"] === undefined - ? p.properties?.containerGroupProperties["subnetIds"] - : p.properties?.containerGroupProperties["subnetIds"].map((p: any) => { - return { id: p["id"] }; - }), - }, - provisioningState: p.properties?.["provisioningState"], - }, - }; - }), - nextLink: result.body["nextLink"], - }; + return _standbyContainerGroupPoolResourceListResultDeserializer(result.body); } /** List StandbyContainerGroupPoolResource resources by resource group */ @@ -532,56 +341,7 @@ export async function _standbyContainerGroupPoolsListBySubscriptionDeserialize( throw createRestError(result); } - return { - value: result.body["value"].map((p: any) => { - return { - tags: p["tags"], - location: p["location"], - id: p["id"], - name: p["name"], - type: p["type"], - systemData: !p.systemData - ? undefined - : { - createdBy: p.systemData?.["createdBy"], - createdByType: p.systemData?.["createdByType"], - createdAt: - p.systemData?.["createdAt"] !== undefined - ? new Date(p.systemData?.["createdAt"]) - : undefined, - lastModifiedBy: p.systemData?.["lastModifiedBy"], - lastModifiedByType: p.systemData?.["lastModifiedByType"], - lastModifiedAt: - p.systemData?.["lastModifiedAt"] !== undefined - ? new Date(p.systemData?.["lastModifiedAt"]) - : undefined, - }, - properties: !p.properties - ? undefined - : { - elasticityProfile: { - maxReadyCapacity: p.properties?.elasticityProfile["maxReadyCapacity"], - refillPolicy: p.properties?.elasticityProfile["refillPolicy"], - }, - containerGroupProperties: { - containerGroupProfile: { - id: p.properties?.containerGroupProperties.containerGroupProfile["id"], - revision: - p.properties?.containerGroupProperties.containerGroupProfile["revision"], - }, - subnetIds: - p.properties?.containerGroupProperties["subnetIds"] === undefined - ? p.properties?.containerGroupProperties["subnetIds"] - : p.properties?.containerGroupProperties["subnetIds"].map((p: any) => { - return { id: p["id"] }; - }), - }, - provisioningState: p.properties?.["provisioningState"], - }, - }; - }), - nextLink: result.body["nextLink"], - }; + return _standbyContainerGroupPoolResourceListResultDeserializer(result.body); } /** List StandbyContainerGroupPoolResource resources by subscription ID */ diff --git a/sdk/standbypool/arm-standbypool/src/api/standbyPoolManagementContext.ts b/sdk/standbypool/arm-standbypool/src/api/standbyPoolManagementContext.ts index 670981eee147..e7b1eb188def 100644 --- a/sdk/standbypool/arm-standbypool/src/api/standbyPoolManagementContext.ts +++ b/sdk/standbypool/arm-standbypool/src/api/standbyPoolManagementContext.ts @@ -1,26 +1,27 @@ // Copyright (c) Microsoft Corporation. // Licensed under the MIT License. -import { TokenCredential } from "@azure/core-auth"; -import { ClientOptions, Client, getClient } from "@azure-rest/core-client"; 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 StandbyPoolContext extends Client {} +export interface StandbyPoolManagementContext extends Client {} /** Optional parameters for the client. */ export interface StandbyPoolManagementClientOptionalParams extends ClientOptions { /** The API version to use for this operation. */ + /** Known values of {@link KnownVersions} that the service accepts. */ apiVersion?: string; } export function createStandbyPoolManagement( credential: TokenCredential, options: StandbyPoolManagementClientOptionalParams = {}, -): StandbyPoolContext { +): StandbyPoolManagementContext { const endpointUrl = options.endpoint ?? options.baseUrl ?? `https://management.azure.com`; - const prefixFromOptions = options?.userAgentOptions?.userAgentPrefix; - const userAgentInfo = `azsdk-js-arm-standbypool/1.0.2`; + const userAgentInfo = `azsdk-js-arm-standbypool/1.0.0-beta.1`; const userAgentPrefix = prefixFromOptions ? `${prefixFromOptions} azsdk-js-api ${userAgentInfo}` : `azsdk-js-api ${userAgentInfo}`; diff --git a/sdk/standbypool/arm-standbypool/src/api/standbyVirtualMachinePoolRuntimeViews/index.ts b/sdk/standbypool/arm-standbypool/src/api/standbyVirtualMachinePoolRuntimeViews/index.ts index 0e05d5a92b04..86a5a9623bb7 100644 --- a/sdk/standbypool/arm-standbypool/src/api/standbyVirtualMachinePoolRuntimeViews/index.ts +++ b/sdk/standbypool/arm-standbypool/src/api/standbyVirtualMachinePoolRuntimeViews/index.ts @@ -1,25 +1,27 @@ // Copyright (c) Microsoft Corporation. // Licensed under the MIT License. +import { + StandbyPoolManagementContext as Client, + StandbyVirtualMachinePoolRuntimeViewsGetOptionalParams, + StandbyVirtualMachinePoolRuntimeViewsListByStandbyPoolOptionalParams, +} from "../index.js"; import { StandbyVirtualMachinePoolRuntimeViewResource, + standbyVirtualMachinePoolRuntimeViewResourceDeserializer, _StandbyVirtualMachinePoolRuntimeViewResourceListResult, + _standbyVirtualMachinePoolRuntimeViewResourceListResultDeserializer, } from "../../models/models.js"; -import { StandbyPoolContext as Client } from "../index.js"; -import { - StreamableMethod, - operationOptionsToRequestParameters, - PathUncheckedResponse, - createRestError, -} from "@azure-rest/core-client"; import { PagedAsyncIterableIterator, buildPagedAsyncIterator, } from "../../static-helpers/pagingHelpers.js"; import { - StandbyVirtualMachinePoolRuntimeViewsGetOptionalParams, - StandbyVirtualMachinePoolRuntimeViewsListByStandbyPoolOptionalParams, -} from "../../models/options.js"; + StreamableMethod, + PathUncheckedResponse, + createRestError, + operationOptionsToRequestParameters, +} from "@azure-rest/core-client"; export function _standbyVirtualMachinePoolRuntimeViewsGetSend( context: Client, @@ -50,40 +52,7 @@ export async function _standbyVirtualMachinePoolRuntimeViewsGetDeserialize( throw createRestError(result); } - return { - id: result.body["id"], - name: result.body["name"], - type: result.body["type"], - systemData: !result.body.systemData - ? undefined - : { - createdBy: result.body.systemData?.["createdBy"], - createdByType: result.body.systemData?.["createdByType"], - createdAt: - result.body.systemData?.["createdAt"] !== undefined - ? new Date(result.body.systemData?.["createdAt"]) - : undefined, - lastModifiedBy: result.body.systemData?.["lastModifiedBy"], - lastModifiedByType: result.body.systemData?.["lastModifiedByType"], - lastModifiedAt: - result.body.systemData?.["lastModifiedAt"] !== undefined - ? new Date(result.body.systemData?.["lastModifiedAt"]) - : undefined, - }, - properties: !result.body.properties - ? undefined - : { - instanceCountSummary: result.body.properties?.["instanceCountSummary"].map((p: any) => { - return { - zone: p["zone"], - instanceCountsByState: p["instanceCountsByState"].map((p: any) => { - return { state: p["state"], count: p["count"] }; - }), - }; - }), - provisioningState: result.body.properties?.["provisioningState"], - }, - }; + return standbyVirtualMachinePoolRuntimeViewResourceDeserializer(result.body); } /** Get a StandbyVirtualMachinePoolRuntimeViewResource */ @@ -135,45 +104,7 @@ export async function _standbyVirtualMachinePoolRuntimeViewsListByStandbyPoolDes throw createRestError(result); } - return { - value: result.body["value"].map((p: any) => { - return { - id: p["id"], - name: p["name"], - type: p["type"], - systemData: !p.systemData - ? undefined - : { - createdBy: p.systemData?.["createdBy"], - createdByType: p.systemData?.["createdByType"], - createdAt: - p.systemData?.["createdAt"] !== undefined - ? new Date(p.systemData?.["createdAt"]) - : undefined, - lastModifiedBy: p.systemData?.["lastModifiedBy"], - lastModifiedByType: p.systemData?.["lastModifiedByType"], - lastModifiedAt: - p.systemData?.["lastModifiedAt"] !== undefined - ? new Date(p.systemData?.["lastModifiedAt"]) - : undefined, - }, - properties: !p.properties - ? undefined - : { - instanceCountSummary: p.properties?.["instanceCountSummary"].map((p: any) => { - return { - zone: p["zone"], - instanceCountsByState: p["instanceCountsByState"].map((p: any) => { - return { state: p["state"], count: p["count"] }; - }), - }; - }), - provisioningState: p.properties?.["provisioningState"], - }, - }; - }), - nextLink: result.body["nextLink"], - }; + return _standbyVirtualMachinePoolRuntimeViewResourceListResultDeserializer(result.body); } /** List StandbyVirtualMachinePoolRuntimeViewResource resources by StandbyVirtualMachinePoolResource */ diff --git a/sdk/standbypool/arm-standbypool/src/api/standbyVirtualMachinePools/index.ts b/sdk/standbypool/arm-standbypool/src/api/standbyVirtualMachinePools/index.ts index 57ff863d266c..33c85e16b3c2 100644 --- a/sdk/standbypool/arm-standbypool/src/api/standbyVirtualMachinePools/index.ts +++ b/sdk/standbypool/arm-standbypool/src/api/standbyVirtualMachinePools/index.ts @@ -2,34 +2,35 @@ // Licensed under the MIT License. import { - standbyVirtualMachinePoolResourcePropertiesSerializer, - standbyVirtualMachinePoolResourceUpdatePropertiesSerializer, + StandbyPoolManagementContext as Client, + StandbyVirtualMachinePoolsCreateOrUpdateOptionalParams, + StandbyVirtualMachinePoolsDeleteOptionalParams, + StandbyVirtualMachinePoolsGetOptionalParams, + StandbyVirtualMachinePoolsListByResourceGroupOptionalParams, + StandbyVirtualMachinePoolsListBySubscriptionOptionalParams, + StandbyVirtualMachinePoolsUpdateOptionalParams, +} from "../index.js"; +import { StandbyVirtualMachinePoolResource, + standbyVirtualMachinePoolResourceSerializer, + standbyVirtualMachinePoolResourceDeserializer, StandbyVirtualMachinePoolResourceUpdate, + standbyVirtualMachinePoolResourceUpdateSerializer, _StandbyVirtualMachinePoolResourceListResult, + _standbyVirtualMachinePoolResourceListResultDeserializer, } from "../../models/models.js"; -import { StandbyPoolContext as Client } from "../index.js"; +import { + PagedAsyncIterableIterator, + buildPagedAsyncIterator, +} from "../../static-helpers/pagingHelpers.js"; +import { getLongRunningPoller } from "../../static-helpers/pollingHelpers.js"; import { StreamableMethod, - operationOptionsToRequestParameters, PathUncheckedResponse, createRestError, + operationOptionsToRequestParameters, } from "@azure-rest/core-client"; -import { serializeRecord } from "../../helpers/serializerHelpers.js"; -import { getLongRunningPoller } from "../../static-helpers/pollingHelpers.js"; -import { - PagedAsyncIterableIterator, - buildPagedAsyncIterator, -} from "../../static-helpers/pagingHelpers.js"; import { PollerLike, OperationState } from "@azure/core-lro"; -import { - StandbyVirtualMachinePoolsGetOptionalParams, - StandbyVirtualMachinePoolsCreateOrUpdateOptionalParams, - StandbyVirtualMachinePoolsDeleteOptionalParams, - StandbyVirtualMachinePoolsUpdateOptionalParams, - StandbyVirtualMachinePoolsListByResourceGroupOptionalParams, - StandbyVirtualMachinePoolsListBySubscriptionOptionalParams, -} from "../../models/options.js"; export function _standbyVirtualMachinePoolsGetSend( context: Client, @@ -56,43 +57,7 @@ export async function _standbyVirtualMachinePoolsGetDeserialize( throw createRestError(result); } - return { - tags: result.body["tags"], - location: result.body["location"], - id: result.body["id"], - name: result.body["name"], - type: result.body["type"], - systemData: !result.body.systemData - ? undefined - : { - createdBy: result.body.systemData?.["createdBy"], - createdByType: result.body.systemData?.["createdByType"], - createdAt: - result.body.systemData?.["createdAt"] !== undefined - ? new Date(result.body.systemData?.["createdAt"]) - : undefined, - lastModifiedBy: result.body.systemData?.["lastModifiedBy"], - lastModifiedByType: result.body.systemData?.["lastModifiedByType"], - lastModifiedAt: - result.body.systemData?.["lastModifiedAt"] !== undefined - ? new Date(result.body.systemData?.["lastModifiedAt"]) - : undefined, - }, - properties: !result.body.properties - ? undefined - : { - elasticityProfile: !result.body.properties?.elasticityProfile - ? undefined - : { - maxReadyCapacity: result.body.properties?.elasticityProfile?.["maxReadyCapacity"], - minReadyCapacity: result.body.properties?.elasticityProfile?.["minReadyCapacity"], - }, - virtualMachineState: result.body.properties?.["virtualMachineState"], - attachedVirtualMachineScaleSetId: - result.body.properties?.["attachedVirtualMachineScaleSetId"], - provisioningState: result.body.properties?.["provisioningState"], - }, - }; + return standbyVirtualMachinePoolResourceDeserializer(result.body); } /** Get a StandbyVirtualMachinePoolResource */ @@ -132,13 +97,7 @@ export function _standbyVirtualMachinePoolsCreateOrUpdateSend( ) .put({ ...operationOptionsToRequestParameters(options), - body: { - tags: !resource.tags ? resource.tags : (serializeRecord(resource.tags as any) as any), - location: resource["location"], - properties: !resource.properties - ? resource.properties - : standbyVirtualMachinePoolResourcePropertiesSerializer(resource.properties), - }, + body: standbyVirtualMachinePoolResourceSerializer(resource), }); } @@ -150,43 +109,7 @@ export async function _standbyVirtualMachinePoolsCreateOrUpdateDeserialize( throw createRestError(result); } - return { - tags: result.body["tags"], - location: result.body["location"], - id: result.body["id"], - name: result.body["name"], - type: result.body["type"], - systemData: !result.body.systemData - ? undefined - : { - createdBy: result.body.systemData?.["createdBy"], - createdByType: result.body.systemData?.["createdByType"], - createdAt: - result.body.systemData?.["createdAt"] !== undefined - ? new Date(result.body.systemData?.["createdAt"]) - : undefined, - lastModifiedBy: result.body.systemData?.["lastModifiedBy"], - lastModifiedByType: result.body.systemData?.["lastModifiedByType"], - lastModifiedAt: - result.body.systemData?.["lastModifiedAt"] !== undefined - ? new Date(result.body.systemData?.["lastModifiedAt"]) - : undefined, - }, - properties: !result.body.properties - ? undefined - : { - elasticityProfile: !result.body.properties?.elasticityProfile - ? undefined - : { - maxReadyCapacity: result.body.properties?.elasticityProfile?.["maxReadyCapacity"], - minReadyCapacity: result.body.properties?.elasticityProfile?.["minReadyCapacity"], - }, - virtualMachineState: result.body.properties?.["virtualMachineState"], - attachedVirtualMachineScaleSetId: - result.body.properties?.["attachedVirtualMachineScaleSetId"], - provisioningState: result.body.properties?.["provisioningState"], - }, - }; + return standbyVirtualMachinePoolResourceDeserializer(result.body); } /** Create a StandbyVirtualMachinePoolResource */ @@ -306,12 +229,7 @@ export function _standbyVirtualMachinePoolsUpdateSend( ) .patch({ ...operationOptionsToRequestParameters(options), - body: { - tags: !properties.tags ? properties.tags : (serializeRecord(properties.tags as any) as any), - properties: !properties.properties - ? properties.properties - : standbyVirtualMachinePoolResourceUpdatePropertiesSerializer(properties.properties), - }, + body: standbyVirtualMachinePoolResourceUpdateSerializer(properties), }); } @@ -323,43 +241,7 @@ export async function _standbyVirtualMachinePoolsUpdateDeserialize( throw createRestError(result); } - return { - tags: result.body["tags"], - location: result.body["location"], - id: result.body["id"], - name: result.body["name"], - type: result.body["type"], - systemData: !result.body.systemData - ? undefined - : { - createdBy: result.body.systemData?.["createdBy"], - createdByType: result.body.systemData?.["createdByType"], - createdAt: - result.body.systemData?.["createdAt"] !== undefined - ? new Date(result.body.systemData?.["createdAt"]) - : undefined, - lastModifiedBy: result.body.systemData?.["lastModifiedBy"], - lastModifiedByType: result.body.systemData?.["lastModifiedByType"], - lastModifiedAt: - result.body.systemData?.["lastModifiedAt"] !== undefined - ? new Date(result.body.systemData?.["lastModifiedAt"]) - : undefined, - }, - properties: !result.body.properties - ? undefined - : { - elasticityProfile: !result.body.properties?.elasticityProfile - ? undefined - : { - maxReadyCapacity: result.body.properties?.elasticityProfile?.["maxReadyCapacity"], - minReadyCapacity: result.body.properties?.elasticityProfile?.["minReadyCapacity"], - }, - virtualMachineState: result.body.properties?.["virtualMachineState"], - attachedVirtualMachineScaleSetId: - result.body.properties?.["attachedVirtualMachineScaleSetId"], - provisioningState: result.body.properties?.["provisioningState"], - }, - }; + return standbyVirtualMachinePoolResourceDeserializer(result.body); } /** Update a StandbyVirtualMachinePoolResource */ @@ -409,47 +291,7 @@ export async function _standbyVirtualMachinePoolsListByResourceGroupDeserialize( throw createRestError(result); } - return { - value: result.body["value"].map((p: any) => { - return { - tags: p["tags"], - location: p["location"], - id: p["id"], - name: p["name"], - type: p["type"], - systemData: !p.systemData - ? undefined - : { - createdBy: p.systemData?.["createdBy"], - createdByType: p.systemData?.["createdByType"], - createdAt: - p.systemData?.["createdAt"] !== undefined - ? new Date(p.systemData?.["createdAt"]) - : undefined, - lastModifiedBy: p.systemData?.["lastModifiedBy"], - lastModifiedByType: p.systemData?.["lastModifiedByType"], - lastModifiedAt: - p.systemData?.["lastModifiedAt"] !== undefined - ? new Date(p.systemData?.["lastModifiedAt"]) - : undefined, - }, - properties: !p.properties - ? undefined - : { - elasticityProfile: !p.properties?.elasticityProfile - ? undefined - : { - maxReadyCapacity: p.properties?.elasticityProfile?.["maxReadyCapacity"], - minReadyCapacity: p.properties?.elasticityProfile?.["minReadyCapacity"], - }, - virtualMachineState: p.properties?.["virtualMachineState"], - attachedVirtualMachineScaleSetId: p.properties?.["attachedVirtualMachineScaleSetId"], - provisioningState: p.properties?.["provisioningState"], - }, - }; - }), - nextLink: result.body["nextLink"], - }; + return _standbyVirtualMachinePoolResourceListResultDeserializer(result.body); } /** List StandbyVirtualMachinePoolResource resources by resource group */ @@ -499,47 +341,7 @@ export async function _standbyVirtualMachinePoolsListBySubscriptionDeserialize( throw createRestError(result); } - return { - value: result.body["value"].map((p: any) => { - return { - tags: p["tags"], - location: p["location"], - id: p["id"], - name: p["name"], - type: p["type"], - systemData: !p.systemData - ? undefined - : { - createdBy: p.systemData?.["createdBy"], - createdByType: p.systemData?.["createdByType"], - createdAt: - p.systemData?.["createdAt"] !== undefined - ? new Date(p.systemData?.["createdAt"]) - : undefined, - lastModifiedBy: p.systemData?.["lastModifiedBy"], - lastModifiedByType: p.systemData?.["lastModifiedByType"], - lastModifiedAt: - p.systemData?.["lastModifiedAt"] !== undefined - ? new Date(p.systemData?.["lastModifiedAt"]) - : undefined, - }, - properties: !p.properties - ? undefined - : { - elasticityProfile: !p.properties?.elasticityProfile - ? undefined - : { - maxReadyCapacity: p.properties?.elasticityProfile?.["maxReadyCapacity"], - minReadyCapacity: p.properties?.elasticityProfile?.["minReadyCapacity"], - }, - virtualMachineState: p.properties?.["virtualMachineState"], - attachedVirtualMachineScaleSetId: p.properties?.["attachedVirtualMachineScaleSetId"], - provisioningState: p.properties?.["provisioningState"], - }, - }; - }), - nextLink: result.body["nextLink"], - }; + return _standbyVirtualMachinePoolResourceListResultDeserializer(result.body); } /** List StandbyVirtualMachinePoolResource resources by subscription ID */ diff --git a/sdk/standbypool/arm-standbypool/src/api/standbyVirtualMachines/index.ts b/sdk/standbypool/arm-standbypool/src/api/standbyVirtualMachines/index.ts index 3c94a437bb30..d60925f968e0 100644 --- a/sdk/standbypool/arm-standbypool/src/api/standbyVirtualMachines/index.ts +++ b/sdk/standbypool/arm-standbypool/src/api/standbyVirtualMachines/index.ts @@ -1,25 +1,27 @@ // Copyright (c) Microsoft Corporation. // Licensed under the MIT License. +import { + StandbyPoolManagementContext as Client, + StandbyVirtualMachinesGetOptionalParams, + StandbyVirtualMachinesListByStandbyVirtualMachinePoolResourceOptionalParams, +} from "../index.js"; import { StandbyVirtualMachineResource, + standbyVirtualMachineResourceDeserializer, _StandbyVirtualMachineResourceListResult, + _standbyVirtualMachineResourceListResultDeserializer, } from "../../models/models.js"; -import { StandbyPoolContext as Client } from "../index.js"; -import { - StreamableMethod, - operationOptionsToRequestParameters, - PathUncheckedResponse, - createRestError, -} from "@azure-rest/core-client"; import { PagedAsyncIterableIterator, buildPagedAsyncIterator, } from "../../static-helpers/pagingHelpers.js"; import { - StandbyVirtualMachinesGetOptionalParams, - StandbyVirtualMachinesListByStandbyVirtualMachinePoolResourceOptionalParams, -} from "../../models/options.js"; + StreamableMethod, + PathUncheckedResponse, + createRestError, + operationOptionsToRequestParameters, +} from "@azure-rest/core-client"; export function _standbyVirtualMachinesGetSend( context: Client, @@ -48,33 +50,7 @@ export async function _standbyVirtualMachinesGetDeserialize( throw createRestError(result); } - return { - id: result.body["id"], - name: result.body["name"], - type: result.body["type"], - systemData: !result.body.systemData - ? undefined - : { - createdBy: result.body.systemData?.["createdBy"], - createdByType: result.body.systemData?.["createdByType"], - createdAt: - result.body.systemData?.["createdAt"] !== undefined - ? new Date(result.body.systemData?.["createdAt"]) - : undefined, - lastModifiedBy: result.body.systemData?.["lastModifiedBy"], - lastModifiedByType: result.body.systemData?.["lastModifiedByType"], - lastModifiedAt: - result.body.systemData?.["lastModifiedAt"] !== undefined - ? new Date(result.body.systemData?.["lastModifiedAt"]) - : undefined, - }, - properties: !result.body.properties - ? undefined - : { - virtualMachineResourceId: result.body.properties?.["virtualMachineResourceId"], - provisioningState: result.body.properties?.["provisioningState"], - }, - }; + return standbyVirtualMachineResourceDeserializer(result.body); } /** Get a StandbyVirtualMachineResource */ @@ -124,38 +100,7 @@ export async function _standbyVirtualMachinesListByStandbyVirtualMachinePoolReso throw createRestError(result); } - return { - value: result.body["value"].map((p: any) => { - return { - id: p["id"], - name: p["name"], - type: p["type"], - systemData: !p.systemData - ? undefined - : { - createdBy: p.systemData?.["createdBy"], - createdByType: p.systemData?.["createdByType"], - createdAt: - p.systemData?.["createdAt"] !== undefined - ? new Date(p.systemData?.["createdAt"]) - : undefined, - lastModifiedBy: p.systemData?.["lastModifiedBy"], - lastModifiedByType: p.systemData?.["lastModifiedByType"], - lastModifiedAt: - p.systemData?.["lastModifiedAt"] !== undefined - ? new Date(p.systemData?.["lastModifiedAt"]) - : undefined, - }, - properties: !p.properties - ? undefined - : { - virtualMachineResourceId: p.properties?.["virtualMachineResourceId"], - provisioningState: p.properties?.["provisioningState"], - }, - }; - }), - nextLink: result.body["nextLink"], - }; + return _standbyVirtualMachineResourceListResultDeserializer(result.body); } /** List StandbyVirtualMachineResource resources by StandbyVirtualMachinePoolResource */ diff --git a/sdk/standbypool/arm-standbypool/src/classic/operations/index.ts b/sdk/standbypool/arm-standbypool/src/classic/operations/index.ts index 889b03a4f5db..029478c27f47 100644 --- a/sdk/standbypool/arm-standbypool/src/classic/operations/index.ts +++ b/sdk/standbypool/arm-standbypool/src/classic/operations/index.ts @@ -1,11 +1,11 @@ // Copyright (c) Microsoft Corporation. // Licensed under the MIT License. -import { StandbyPoolContext } from "../../api/standbyPoolManagementContext.js"; -import { Operation } from "../../models/models.js"; +import { StandbyPoolManagementContext } from "../../api/standbyPoolManagementContext.js"; import { operationsList } from "../../api/operations/index.js"; +import { Operation } from "../../models/models.js"; import { PagedAsyncIterableIterator } from "../../static-helpers/pagingHelpers.js"; -import { OperationsListOptionalParams } from "../../models/options.js"; +import { OperationsListOptionalParams } from "../../api/options.js"; /** Interface representing a Operations operations. */ export interface OperationsOperations { @@ -13,13 +13,15 @@ export interface OperationsOperations { list: (options?: OperationsListOptionalParams) => PagedAsyncIterableIterator; } -export function getOperations(context: StandbyPoolContext) { +export function getOperations(context: StandbyPoolManagementContext) { return { list: (options?: OperationsListOptionalParams) => operationsList(context, options), }; } -export function getOperationsOperations(context: StandbyPoolContext): OperationsOperations { +export function getOperationsOperations( + context: StandbyPoolManagementContext, +): OperationsOperations { return { ...getOperations(context), }; diff --git a/sdk/standbypool/arm-standbypool/src/classic/standbyContainerGroupPoolRuntimeViews/index.ts b/sdk/standbypool/arm-standbypool/src/classic/standbyContainerGroupPoolRuntimeViews/index.ts index 17cdf5c64985..b1655df7f901 100644 --- a/sdk/standbypool/arm-standbypool/src/classic/standbyContainerGroupPoolRuntimeViews/index.ts +++ b/sdk/standbypool/arm-standbypool/src/classic/standbyContainerGroupPoolRuntimeViews/index.ts @@ -1,17 +1,17 @@ // Copyright (c) Microsoft Corporation. // Licensed under the MIT License. -import { StandbyPoolContext } from "../../api/standbyPoolManagementContext.js"; -import { StandbyContainerGroupPoolRuntimeViewResource } from "../../models/models.js"; +import { StandbyPoolManagementContext } from "../../api/standbyPoolManagementContext.js"; import { standbyContainerGroupPoolRuntimeViewsGet, standbyContainerGroupPoolRuntimeViewsListByStandbyPool, } from "../../api/standbyContainerGroupPoolRuntimeViews/index.js"; +import { StandbyContainerGroupPoolRuntimeViewResource } from "../../models/models.js"; import { PagedAsyncIterableIterator } from "../../static-helpers/pagingHelpers.js"; import { StandbyContainerGroupPoolRuntimeViewsGetOptionalParams, StandbyContainerGroupPoolRuntimeViewsListByStandbyPoolOptionalParams, -} from "../../models/options.js"; +} from "../../api/options.js"; /** Interface representing a StandbyContainerGroupPoolRuntimeViews operations. */ export interface StandbyContainerGroupPoolRuntimeViewsOperations { @@ -31,7 +31,7 @@ export interface StandbyContainerGroupPoolRuntimeViewsOperations { } export function getStandbyContainerGroupPoolRuntimeViews( - context: StandbyPoolContext, + context: StandbyPoolManagementContext, subscriptionId: string, ) { return { @@ -65,7 +65,7 @@ export function getStandbyContainerGroupPoolRuntimeViews( } export function getStandbyContainerGroupPoolRuntimeViewsOperations( - context: StandbyPoolContext, + context: StandbyPoolManagementContext, subscriptionId: string, ): StandbyContainerGroupPoolRuntimeViewsOperations { return { diff --git a/sdk/standbypool/arm-standbypool/src/classic/standbyContainerGroupPools/index.ts b/sdk/standbypool/arm-standbypool/src/classic/standbyContainerGroupPools/index.ts index 4c936caff788..4b94844d25d0 100644 --- a/sdk/standbypool/arm-standbypool/src/classic/standbyContainerGroupPools/index.ts +++ b/sdk/standbypool/arm-standbypool/src/classic/standbyContainerGroupPools/index.ts @@ -1,11 +1,7 @@ // Copyright (c) Microsoft Corporation. // Licensed under the MIT License. -import { StandbyPoolContext } from "../../api/standbyPoolManagementContext.js"; -import { - StandbyContainerGroupPoolResource, - StandbyContainerGroupPoolResourceUpdate, -} from "../../models/models.js"; +import { StandbyPoolManagementContext } from "../../api/standbyPoolManagementContext.js"; import { standbyContainerGroupPoolsGet, standbyContainerGroupPoolsCreateOrUpdate, @@ -14,6 +10,10 @@ import { standbyContainerGroupPoolsListByResourceGroup, standbyContainerGroupPoolsListBySubscription, } from "../../api/standbyContainerGroupPools/index.js"; +import { + StandbyContainerGroupPoolResource, + StandbyContainerGroupPoolResourceUpdate, +} from "../../models/models.js"; import { PagedAsyncIterableIterator } from "../../static-helpers/pagingHelpers.js"; import { PollerLike, OperationState } from "@azure/core-lro"; import { @@ -23,7 +23,7 @@ import { StandbyContainerGroupPoolsUpdateOptionalParams, StandbyContainerGroupPoolsListByResourceGroupOptionalParams, StandbyContainerGroupPoolsListBySubscriptionOptionalParams, -} from "../../models/options.js"; +} from "../../api/options.js"; /** Interface representing a StandbyContainerGroupPools operations. */ export interface StandbyContainerGroupPoolsOperations { @@ -67,7 +67,10 @@ export interface StandbyContainerGroupPoolsOperations { ) => PagedAsyncIterableIterator; } -export function getStandbyContainerGroupPools(context: StandbyPoolContext, subscriptionId: string) { +export function getStandbyContainerGroupPools( + context: StandbyPoolManagementContext, + subscriptionId: string, +) { return { get: ( resourceGroupName: string, @@ -137,7 +140,7 @@ export function getStandbyContainerGroupPools(context: StandbyPoolContext, subsc } export function getStandbyContainerGroupPoolsOperations( - context: StandbyPoolContext, + context: StandbyPoolManagementContext, subscriptionId: string, ): StandbyContainerGroupPoolsOperations { return { diff --git a/sdk/standbypool/arm-standbypool/src/classic/standbyVirtualMachinePoolRuntimeViews/index.ts b/sdk/standbypool/arm-standbypool/src/classic/standbyVirtualMachinePoolRuntimeViews/index.ts index 53391598bc32..218fa14e9e8f 100644 --- a/sdk/standbypool/arm-standbypool/src/classic/standbyVirtualMachinePoolRuntimeViews/index.ts +++ b/sdk/standbypool/arm-standbypool/src/classic/standbyVirtualMachinePoolRuntimeViews/index.ts @@ -1,17 +1,17 @@ // Copyright (c) Microsoft Corporation. // Licensed under the MIT License. -import { StandbyPoolContext } from "../../api/standbyPoolManagementContext.js"; -import { StandbyVirtualMachinePoolRuntimeViewResource } from "../../models/models.js"; +import { + StandbyVirtualMachinePoolRuntimeViewsGetOptionalParams, + StandbyVirtualMachinePoolRuntimeViewsListByStandbyPoolOptionalParams, +} from "../../api/options.js"; +import { StandbyPoolManagementContext } from "../../api/standbyPoolManagementContext.js"; import { standbyVirtualMachinePoolRuntimeViewsGet, standbyVirtualMachinePoolRuntimeViewsListByStandbyPool, } from "../../api/standbyVirtualMachinePoolRuntimeViews/index.js"; +import { StandbyVirtualMachinePoolRuntimeViewResource } from "../../models/models.js"; import { PagedAsyncIterableIterator } from "../../static-helpers/pagingHelpers.js"; -import { - StandbyVirtualMachinePoolRuntimeViewsGetOptionalParams, - StandbyVirtualMachinePoolRuntimeViewsListByStandbyPoolOptionalParams, -} from "../../models/options.js"; /** Interface representing a StandbyVirtualMachinePoolRuntimeViews operations. */ export interface StandbyVirtualMachinePoolRuntimeViewsOperations { @@ -31,7 +31,7 @@ export interface StandbyVirtualMachinePoolRuntimeViewsOperations { } export function getStandbyVirtualMachinePoolRuntimeViews( - context: StandbyPoolContext, + context: StandbyPoolManagementContext, subscriptionId: string, ) { return { @@ -65,7 +65,7 @@ export function getStandbyVirtualMachinePoolRuntimeViews( } export function getStandbyVirtualMachinePoolRuntimeViewsOperations( - context: StandbyPoolContext, + context: StandbyPoolManagementContext, subscriptionId: string, ): StandbyVirtualMachinePoolRuntimeViewsOperations { return { diff --git a/sdk/standbypool/arm-standbypool/src/classic/standbyVirtualMachinePools/index.ts b/sdk/standbypool/arm-standbypool/src/classic/standbyVirtualMachinePools/index.ts index 0bc6701cd80b..ffe87ce640b5 100644 --- a/sdk/standbypool/arm-standbypool/src/classic/standbyVirtualMachinePools/index.ts +++ b/sdk/standbypool/arm-standbypool/src/classic/standbyVirtualMachinePools/index.ts @@ -1,11 +1,15 @@ // Copyright (c) Microsoft Corporation. // Licensed under the MIT License. -import { StandbyPoolContext } from "../../api/standbyPoolManagementContext.js"; import { - StandbyVirtualMachinePoolResource, - StandbyVirtualMachinePoolResourceUpdate, -} from "../../models/models.js"; + StandbyVirtualMachinePoolsGetOptionalParams, + StandbyVirtualMachinePoolsCreateOrUpdateOptionalParams, + StandbyVirtualMachinePoolsDeleteOptionalParams, + StandbyVirtualMachinePoolsUpdateOptionalParams, + StandbyVirtualMachinePoolsListByResourceGroupOptionalParams, + StandbyVirtualMachinePoolsListBySubscriptionOptionalParams, +} from "../../api/options.js"; +import { StandbyPoolManagementContext } from "../../api/standbyPoolManagementContext.js"; import { standbyVirtualMachinePoolsGet, standbyVirtualMachinePoolsCreateOrUpdate, @@ -14,16 +18,12 @@ import { standbyVirtualMachinePoolsListByResourceGroup, standbyVirtualMachinePoolsListBySubscription, } from "../../api/standbyVirtualMachinePools/index.js"; +import { + StandbyVirtualMachinePoolResource, + StandbyVirtualMachinePoolResourceUpdate, +} from "../../models/models.js"; import { PagedAsyncIterableIterator } from "../../static-helpers/pagingHelpers.js"; import { PollerLike, OperationState } from "@azure/core-lro"; -import { - StandbyVirtualMachinePoolsGetOptionalParams, - StandbyVirtualMachinePoolsCreateOrUpdateOptionalParams, - StandbyVirtualMachinePoolsDeleteOptionalParams, - StandbyVirtualMachinePoolsUpdateOptionalParams, - StandbyVirtualMachinePoolsListByResourceGroupOptionalParams, - StandbyVirtualMachinePoolsListBySubscriptionOptionalParams, -} from "../../models/options.js"; /** Interface representing a StandbyVirtualMachinePools operations. */ export interface StandbyVirtualMachinePoolsOperations { @@ -67,7 +67,10 @@ export interface StandbyVirtualMachinePoolsOperations { ) => PagedAsyncIterableIterator; } -export function getStandbyVirtualMachinePools(context: StandbyPoolContext, subscriptionId: string) { +export function getStandbyVirtualMachinePools( + context: StandbyPoolManagementContext, + subscriptionId: string, +) { return { get: ( resourceGroupName: string, @@ -137,7 +140,7 @@ export function getStandbyVirtualMachinePools(context: StandbyPoolContext, subsc } export function getStandbyVirtualMachinePoolsOperations( - context: StandbyPoolContext, + context: StandbyPoolManagementContext, subscriptionId: string, ): StandbyVirtualMachinePoolsOperations { return { diff --git a/sdk/standbypool/arm-standbypool/src/classic/standbyVirtualMachines/index.ts b/sdk/standbypool/arm-standbypool/src/classic/standbyVirtualMachines/index.ts index de1330f065db..4960e9712e51 100644 --- a/sdk/standbypool/arm-standbypool/src/classic/standbyVirtualMachines/index.ts +++ b/sdk/standbypool/arm-standbypool/src/classic/standbyVirtualMachines/index.ts @@ -1,17 +1,17 @@ // Copyright (c) Microsoft Corporation. // Licensed under the MIT License. -import { StandbyPoolContext } from "../../api/standbyPoolManagementContext.js"; -import { StandbyVirtualMachineResource } from "../../models/models.js"; +import { + StandbyVirtualMachinesGetOptionalParams, + StandbyVirtualMachinesListByStandbyVirtualMachinePoolResourceOptionalParams, +} from "../../api/options.js"; +import { StandbyPoolManagementContext } from "../../api/standbyPoolManagementContext.js"; import { standbyVirtualMachinesGet, standbyVirtualMachinesListByStandbyVirtualMachinePoolResource, } from "../../api/standbyVirtualMachines/index.js"; +import { StandbyVirtualMachineResource } from "../../models/models.js"; import { PagedAsyncIterableIterator } from "../../static-helpers/pagingHelpers.js"; -import { - StandbyVirtualMachinesGetOptionalParams, - StandbyVirtualMachinesListByStandbyVirtualMachinePoolResourceOptionalParams, -} from "../../models/options.js"; /** Interface representing a StandbyVirtualMachines operations. */ export interface StandbyVirtualMachinesOperations { @@ -30,7 +30,10 @@ export interface StandbyVirtualMachinesOperations { ) => PagedAsyncIterableIterator; } -export function getStandbyVirtualMachines(context: StandbyPoolContext, subscriptionId: string) { +export function getStandbyVirtualMachines( + context: StandbyPoolManagementContext, + subscriptionId: string, +) { return { get: ( resourceGroupName: string, @@ -62,7 +65,7 @@ export function getStandbyVirtualMachines(context: StandbyPoolContext, subscript } export function getStandbyVirtualMachinesOperations( - context: StandbyPoolContext, + context: StandbyPoolManagementContext, subscriptionId: string, ): StandbyVirtualMachinesOperations { return { diff --git a/sdk/standbypool/arm-standbypool/src/index.ts b/sdk/standbypool/arm-standbypool/src/index.ts index 2b8dfd256b02..2689264ba276 100644 --- a/sdk/standbypool/arm-standbypool/src/index.ts +++ b/sdk/standbypool/arm-standbypool/src/index.ts @@ -7,23 +7,20 @@ import { PagedAsyncIterableIterator, } from "./static-helpers/pagingHelpers.js"; -export { - StandbyPoolManagementClient, - StandbyPoolManagementClientOptionalParams, -} from "./standbyPoolManagementClient.js"; +export { StandbyPoolManagementClient } from "./standbyPoolManagementClient.js"; export { restorePoller, RestorePollerOptions } from "./restorePollerHelpers.js"; export { - Resource, - SystemData, - KnownCreatedByType, - CreatedByType, - ProxyResource, StandbyContainerGroupPoolRuntimeViewResource, StandbyContainerGroupPoolRuntimeViewResourceProperties, ContainerGroupInstanceCountSummary, PoolResourceStateCount, KnownProvisioningState, - TrackedResource, + ProvisioningState, + ProxyResource, + Resource, + SystemData, + KnownCreatedByType, + CreatedByType, StandbyContainerGroupPoolResource, StandbyContainerGroupPoolResourceProperties, StandbyContainerGroupPoolElasticityProfile, @@ -32,6 +29,7 @@ export { ContainerGroupProperties, ContainerGroupProfile, Subnet, + TrackedResource, StandbyContainerGroupPoolResourceUpdate, StandbyContainerGroupPoolResourceUpdateProperties, StandbyVirtualMachinePoolRuntimeViewResource, @@ -52,7 +50,9 @@ export { Origin, KnownActionType, ActionType, - ProvisioningState, + KnownVersions, +} from "./models/index.js"; +export { OperationsListOptionalParams, StandbyVirtualMachinePoolsGetOptionalParams, StandbyVirtualMachinePoolsCreateOrUpdateOptionalParams, @@ -72,7 +72,8 @@ export { StandbyContainerGroupPoolsListBySubscriptionOptionalParams, StandbyContainerGroupPoolRuntimeViewsGetOptionalParams, StandbyContainerGroupPoolRuntimeViewsListByStandbyPoolOptionalParams, -} from "./models/index.js"; + StandbyPoolManagementClientOptionalParams, +} from "./api/index.js"; export { OperationsOperations, StandbyContainerGroupPoolRuntimeViewsOperations, diff --git a/sdk/standbypool/arm-standbypool/src/models/index.ts b/sdk/standbypool/arm-standbypool/src/models/index.ts index e00c354f81a6..84d224e36169 100644 --- a/sdk/standbypool/arm-standbypool/src/models/index.ts +++ b/sdk/standbypool/arm-standbypool/src/models/index.ts @@ -2,17 +2,17 @@ // Licensed under the MIT License. export { - Resource, - SystemData, - KnownCreatedByType, - CreatedByType, - ProxyResource, StandbyContainerGroupPoolRuntimeViewResource, StandbyContainerGroupPoolRuntimeViewResourceProperties, ContainerGroupInstanceCountSummary, PoolResourceStateCount, KnownProvisioningState, - TrackedResource, + ProvisioningState, + ProxyResource, + Resource, + SystemData, + KnownCreatedByType, + CreatedByType, StandbyContainerGroupPoolResource, StandbyContainerGroupPoolResourceProperties, StandbyContainerGroupPoolElasticityProfile, @@ -21,6 +21,7 @@ export { ContainerGroupProperties, ContainerGroupProfile, Subnet, + TrackedResource, StandbyContainerGroupPoolResourceUpdate, StandbyContainerGroupPoolResourceUpdateProperties, StandbyVirtualMachinePoolRuntimeViewResource, @@ -41,26 +42,5 @@ export { Origin, KnownActionType, ActionType, - ProvisioningState, + KnownVersions, } from "./models.js"; -export { - OperationsListOptionalParams, - StandbyVirtualMachinePoolsGetOptionalParams, - StandbyVirtualMachinePoolsCreateOrUpdateOptionalParams, - StandbyVirtualMachinePoolsDeleteOptionalParams, - StandbyVirtualMachinePoolsUpdateOptionalParams, - StandbyVirtualMachinePoolsListByResourceGroupOptionalParams, - StandbyVirtualMachinePoolsListBySubscriptionOptionalParams, - StandbyVirtualMachinesGetOptionalParams, - StandbyVirtualMachinesListByStandbyVirtualMachinePoolResourceOptionalParams, - StandbyVirtualMachinePoolRuntimeViewsGetOptionalParams, - StandbyVirtualMachinePoolRuntimeViewsListByStandbyPoolOptionalParams, - StandbyContainerGroupPoolsGetOptionalParams, - StandbyContainerGroupPoolsCreateOrUpdateOptionalParams, - StandbyContainerGroupPoolsDeleteOptionalParams, - StandbyContainerGroupPoolsUpdateOptionalParams, - StandbyContainerGroupPoolsListByResourceGroupOptionalParams, - StandbyContainerGroupPoolsListBySubscriptionOptionalParams, - StandbyContainerGroupPoolRuntimeViewsGetOptionalParams, - StandbyContainerGroupPoolRuntimeViewsListByStandbyPoolOptionalParams, -} from "./options.js"; diff --git a/sdk/standbypool/arm-standbypool/src/models/models.ts b/sdk/standbypool/arm-standbypool/src/models/models.ts index d35602ef9362..785bb2a26376 100644 --- a/sdk/standbypool/arm-standbypool/src/models/models.ts +++ b/sdk/standbypool/arm-standbypool/src/models/models.ts @@ -1,7 +1,129 @@ // Copyright (c) Microsoft Corporation. // Licensed under the MIT License. -import { serializeRecord } from "../helpers/serializerHelpers.js"; +/** Contains information about a standby container group pool as last known by the StandbyPool resource provider. */ +export interface StandbyContainerGroupPoolRuntimeViewResource extends ProxyResource { + /** The resource-specific properties for this resource. */ + properties?: StandbyContainerGroupPoolRuntimeViewResourceProperties; +} + +export function standbyContainerGroupPoolRuntimeViewResourceDeserializer( + item: any, +): StandbyContainerGroupPoolRuntimeViewResource { + return { + id: item["id"], + name: item["name"], + type: item["type"], + systemData: !item["systemData"] + ? item["systemData"] + : systemDataDeserializer(item["systemData"]), + properties: !item["properties"] + ? item["properties"] + : standbyContainerGroupPoolRuntimeViewResourcePropertiesDeserializer(item["properties"]), + }; +} + +/** Contains information about a standby pool as last known by the StandbyPool resource provider. */ +export interface StandbyContainerGroupPoolRuntimeViewResourceProperties { + /** A list containing the counts of container groups in each possible state, as known by the StandbyPool resource provider. */ + readonly instanceCountSummary: ContainerGroupInstanceCountSummary[]; + /** Displays the provisioning state of the standby pool */ + readonly provisioningState?: ProvisioningState; +} + +export function standbyContainerGroupPoolRuntimeViewResourcePropertiesDeserializer( + item: any, +): StandbyContainerGroupPoolRuntimeViewResourceProperties { + return { + instanceCountSummary: containerGroupInstanceCountSummaryArrayDeserializer( + item["instanceCountSummary"], + ), + provisioningState: item["provisioningState"], + }; +} + +export function containerGroupInstanceCountSummaryArrayDeserializer( + result: Array, +): any[] { + return result.map((item) => { + return containerGroupInstanceCountSummaryDeserializer(item); + }); +} + +/** Displays the counts of container groups in each state, as known by the StandbyPool resource provider. */ +export interface ContainerGroupInstanceCountSummary { + /** The count of pooled resources in each state. */ + instanceCountsByState: PoolResourceStateCount[]; +} + +export function containerGroupInstanceCountSummaryDeserializer( + item: any, +): ContainerGroupInstanceCountSummary { + return { + instanceCountsByState: poolResourceStateCountArrayDeserializer(item["instanceCountsByState"]), + }; +} + +export function poolResourceStateCountArrayDeserializer( + result: Array, +): any[] { + return result.map((item) => { + return poolResourceStateCountDeserializer(item); + }); +} + +/** Displays the counts of pooled resources in each state, as known by the StandbyPool resource provider. */ +export interface PoolResourceStateCount { + /** The state that the pooled resources count is for. */ + state: string; + /** The count of pooled resources in the given state. */ + count: number; +} + +export function poolResourceStateCountDeserializer(item: any): PoolResourceStateCount { + return { + state: item["state"], + count: item["count"], + }; +} + +/** Provisioning state */ +export enum KnownProvisioningState { + /** Resource has been created. */ + Succeeded = "Succeeded", + /** Resource creation failed. */ + Failed = "Failed", + /** Resource creation was canceled. */ + Canceled = "Canceled", + /** Resource is being deleted. */ + Deleting = "Deleting", +} + +/** + * Provisioning state \ + * {@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**: Resource has been created. \ + * **Failed**: Resource creation failed. \ + * **Canceled**: Resource creation was canceled. \ + * **Deleting**: Resource is being deleted. + */ +export type ProvisioningState = string; + +/** 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 { @@ -15,8 +137,19 @@ export interface Resource { readonly systemData?: SystemData; } -export function resourceSerializer(item: Resource) { - return item as any; +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. */ @@ -35,61 +168,43 @@ export interface SystemData { lastModifiedAt?: Date; } -/** Known values of {@link CreatedByType} that the service accepts. */ +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 { - /** User */ + /** The entity was created by a user. */ User = "User", - /** Application */ + /** The entity was created by an application. */ Application = "Application", - /** ManagedIdentity */ + /** The entity was created by a managed identity. */ ManagedIdentity = "ManagedIdentity", - /** Key */ + /** 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, + * {@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** + * **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; -/** The resource model definition for a Azure Resource Manager proxy resource. It will not have tags and a location */ -export interface ProxyResource extends Resource {} - -/** Contains information about a standby container group pool as last known by the StandbyPool resource provider. */ -export interface StandbyContainerGroupPoolRuntimeViewResource extends ProxyResource { - /** The resource-specific properties for this resource. */ - properties?: StandbyContainerGroupPoolRuntimeViewResourceProperties; -} - -/** Contains information about a standby pool as last known by the StandbyPool resource provider. */ -export interface StandbyContainerGroupPoolRuntimeViewResourceProperties { - /** A list containing the counts of container groups in each possible state, as known by the StandbyPool resource provider. */ - readonly instanceCountSummary: ContainerGroupInstanceCountSummary[]; - /** Displays the provisioning state of the standby pool */ - readonly provisioningState?: ProvisioningState; -} - -/** Displays the counts of container groups in each state, as known by the StandbyPool resource provider. */ -export interface ContainerGroupInstanceCountSummary { - /** The count of pooled resources in each state. */ - instanceCountsByState: PoolResourceStateCount[]; -} - -/** Displays the counts of pooled resources in each state, as known by the StandbyPool resource provider. */ -export interface PoolResourceStateCount { - /** The state that the pooled resources count is for. */ - state: string; - /** The count of pooled resources in the given state. */ - count: number; -} - /** The response of a StandbyContainerGroupPoolRuntimeViewResource list operation. */ export interface _StandbyContainerGroupPoolRuntimeViewResourceListResult { /** The StandbyContainerGroupPoolRuntimeViewResource items on this page */ @@ -98,21 +213,23 @@ export interface _StandbyContainerGroupPoolRuntimeViewResourceListResult { nextLink?: string; } -/** 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): Record { +export function _standbyContainerGroupPoolRuntimeViewResourceListResultDeserializer( + item: any, +): _StandbyContainerGroupPoolRuntimeViewResourceListResult { return { - tags: !item.tags ? item.tags : (serializeRecord(item.tags as any) as any), - location: item["location"], + value: standbyContainerGroupPoolRuntimeViewResourceArrayDeserializer(item["value"]), + nextLink: item["nextLink"], }; } +export function standbyContainerGroupPoolRuntimeViewResourceArrayDeserializer( + result: Array, +): any[] { + return result.map((item) => { + return standbyContainerGroupPoolRuntimeViewResourceDeserializer(item); + }); +} + /** A StandbyContainerGroupPoolResource. */ export interface StandbyContainerGroupPoolResource extends TrackedResource { /** The resource-specific properties for this resource. */ @@ -121,13 +238,31 @@ export interface StandbyContainerGroupPoolResource extends TrackedResource { export function standbyContainerGroupPoolResourceSerializer( item: StandbyContainerGroupPoolResource, -): Record { +): any { + return { + tags: item["tags"], + location: item["location"], + properties: !item["properties"] + ? item["properties"] + : standbyContainerGroupPoolResourcePropertiesSerializer(item["properties"]), + }; +} + +export function standbyContainerGroupPoolResourceDeserializer( + item: any, +): StandbyContainerGroupPoolResource { return { - tags: !item.tags ? item.tags : (serializeRecord(item.tags as any) as any), + tags: item["tags"], location: item["location"], - properties: !item.properties - ? item.properties - : standbyContainerGroupPoolResourcePropertiesSerializer(item.properties), + id: item["id"], + name: item["name"], + type: item["type"], + systemData: !item["systemData"] + ? item["systemData"] + : systemDataDeserializer(item["systemData"]), + properties: !item["properties"] + ? item["properties"] + : standbyContainerGroupPoolResourcePropertiesDeserializer(item["properties"]), }; } @@ -143,10 +278,26 @@ export interface StandbyContainerGroupPoolResourceProperties { export function standbyContainerGroupPoolResourcePropertiesSerializer( item: StandbyContainerGroupPoolResourceProperties, -): Record { +): any { + return { + elasticityProfile: standbyContainerGroupPoolElasticityProfileSerializer( + item["elasticityProfile"], + ), + containerGroupProperties: containerGroupPropertiesSerializer(item["containerGroupProperties"]), + }; +} + +export function standbyContainerGroupPoolResourcePropertiesDeserializer( + item: any, +): StandbyContainerGroupPoolResourceProperties { return { - elasticityProfile: standbyContainerGroupPoolElasticityProfileSerializer(item.elasticityProfile), - containerGroupProperties: containerGroupPropertiesSerializer(item.containerGroupProperties), + elasticityProfile: standbyContainerGroupPoolElasticityProfileDeserializer( + item["elasticityProfile"], + ), + containerGroupProperties: containerGroupPropertiesDeserializer( + item["containerGroupProperties"], + ), + provisioningState: item["provisioningState"], }; } @@ -160,17 +311,26 @@ export interface StandbyContainerGroupPoolElasticityProfile { export function standbyContainerGroupPoolElasticityProfileSerializer( item: StandbyContainerGroupPoolElasticityProfile, -): Record { +): any { + return { + maxReadyCapacity: item["maxReadyCapacity"], + refillPolicy: item["refillPolicy"], + }; +} + +export function standbyContainerGroupPoolElasticityProfileDeserializer( + item: any, +): StandbyContainerGroupPoolElasticityProfile { return { maxReadyCapacity: item["maxReadyCapacity"], refillPolicy: item["refillPolicy"], }; } -/** Known values of {@link RefillPolicy} that the service accepts. */ +/** Refill policy of standby pool */ export enum KnownRefillPolicy { - /** always */ - Always = "always", + /** A refill policy that standby pool is automatically refilled to maintain maxReadyCapacity. */ + always = "always", } /** @@ -178,7 +338,7 @@ export enum KnownRefillPolicy { * {@link KnownRefillPolicy} can be used interchangeably with RefillPolicy, * this enum contains the known values that the service supports. * ### Known values supported by the service - * **always** + * **always**: A refill policy that standby pool is automatically refilled to maintain maxReadyCapacity. */ export type RefillPolicy = string; @@ -190,13 +350,17 @@ export interface ContainerGroupProperties { subnetIds?: Subnet[]; } -export function containerGroupPropertiesSerializer( - item: ContainerGroupProperties, -): Record { +export function containerGroupPropertiesSerializer(item: ContainerGroupProperties): any { + return { + containerGroupProfile: containerGroupProfileSerializer(item["containerGroupProfile"]), + subnetIds: !item["subnetIds"] ? item["subnetIds"] : subnetArraySerializer(item["subnetIds"]), + }; +} + +export function containerGroupPropertiesDeserializer(item: any): ContainerGroupProperties { return { - containerGroupProfile: containerGroupProfileSerializer(item.containerGroupProfile), - subnetIds: - item["subnetIds"] === undefined ? item["subnetIds"] : item["subnetIds"].map(subnetSerializer), + containerGroupProfile: containerGroupProfileDeserializer(item["containerGroupProfile"]), + subnetIds: !item["subnetIds"] ? item["subnetIds"] : subnetArrayDeserializer(item["subnetIds"]), }; } @@ -208,27 +372,70 @@ export interface ContainerGroupProfile { revision?: number; } -export function containerGroupProfileSerializer( - item: ContainerGroupProfile, -): Record { +export function containerGroupProfileSerializer(item: ContainerGroupProfile): any { + return { id: item["id"], revision: item["revision"] }; +} + +export function containerGroupProfileDeserializer(item: any): ContainerGroupProfile { return { id: item["id"], revision: item["revision"], }; } +export function subnetArraySerializer(result: Array): any[] { + return result.map((item) => { + return subnetSerializer(item); + }); +} + +export function subnetArrayDeserializer(result: Array): any[] { + return result.map((item) => { + return subnetDeserializer(item); + }); +} + /** Subnet of container group */ export interface Subnet { /** Specifies ARM resource id of the subnet. */ id: string; } -export function subnetSerializer(item: Subnet): Record { +export function subnetSerializer(item: Subnet): any { + return { id: item["id"] }; +} + +export function subnetDeserializer(item: any): Subnet { return { id: item["id"], }; } +/** 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 StandbyContainerGroupPoolResource. */ export interface StandbyContainerGroupPoolResourceUpdate { /** Resource tags. */ @@ -239,12 +446,12 @@ export interface StandbyContainerGroupPoolResourceUpdate { export function standbyContainerGroupPoolResourceUpdateSerializer( item: StandbyContainerGroupPoolResourceUpdate, -): Record { +): any { return { - tags: !item.tags ? item.tags : (serializeRecord(item.tags as any) as any), - properties: !item.properties - ? item.properties - : standbyContainerGroupPoolResourceUpdatePropertiesSerializer(item.properties), + tags: item["tags"], + properties: !item["properties"] + ? item["properties"] + : standbyContainerGroupPoolResourceUpdatePropertiesSerializer(item["properties"]), }; } @@ -258,14 +465,14 @@ export interface StandbyContainerGroupPoolResourceUpdateProperties { export function standbyContainerGroupPoolResourceUpdatePropertiesSerializer( item: StandbyContainerGroupPoolResourceUpdateProperties, -): Record { +): any { return { - elasticityProfile: !item.elasticityProfile - ? item.elasticityProfile - : standbyContainerGroupPoolElasticityProfileSerializer(item.elasticityProfile), - containerGroupProperties: !item.containerGroupProperties - ? item.containerGroupProperties - : containerGroupPropertiesSerializer(item.containerGroupProperties), + elasticityProfile: !item["elasticityProfile"] + ? item["elasticityProfile"] + : standbyContainerGroupPoolElasticityProfileSerializer(item["elasticityProfile"]), + containerGroupProperties: !item["containerGroupProperties"] + ? item["containerGroupProperties"] + : containerGroupPropertiesSerializer(item["containerGroupProperties"]), }; } @@ -277,30 +484,81 @@ export interface _StandbyContainerGroupPoolResourceListResult { nextLink?: string; } +export function _standbyContainerGroupPoolResourceListResultDeserializer( + item: any, +): _StandbyContainerGroupPoolResourceListResult { + return { + value: standbyContainerGroupPoolResourceArrayDeserializer(item["value"]), + nextLink: item["nextLink"], + }; +} + +export function standbyContainerGroupPoolResourceArraySerializer( + result: Array, +): any[] { + return result.map((item) => { + return standbyContainerGroupPoolResourceSerializer(item); + }); +} + +export function standbyContainerGroupPoolResourceArrayDeserializer( + result: Array, +): any[] { + return result.map((item) => { + return standbyContainerGroupPoolResourceDeserializer(item); + }); +} + /** Contains information about a standby virtual machine pool as last known by the StandbyPool resource provider. */ export interface StandbyVirtualMachinePoolRuntimeViewResource extends ProxyResource { /** The resource-specific properties for this resource. */ properties?: StandbyVirtualMachinePoolRuntimeViewResourceProperties; } +export function standbyVirtualMachinePoolRuntimeViewResourceDeserializer( + item: any, +): StandbyVirtualMachinePoolRuntimeViewResource { + return { + id: item["id"], + name: item["name"], + type: item["type"], + systemData: !item["systemData"] + ? item["systemData"] + : systemDataDeserializer(item["systemData"]), + properties: !item["properties"] + ? item["properties"] + : standbyVirtualMachinePoolRuntimeViewResourcePropertiesDeserializer(item["properties"]), + }; +} + /** Contains information about a standby pool as last known by the StandbyPool resource provider. */ export interface StandbyVirtualMachinePoolRuntimeViewResourceProperties { - /** - * A list containing the counts of virtual machines in each possible power state for each zone if enabled, as known by the StandbyPool resource provider. - * If zones are not enabled on the attached VMSS, the list will contain a single entry with null zone values. - * Note: any updates to pool resources outside of StandbyPoolRP (i.e deleting a VM through portal) are not reflected here. - * Note: any resources in the Running state may still be installing extensions / not fully provisioned. - */ + /** A list containing the counts of virtual machines in each possible power state for each zone if enabled, as known by the StandbyPool resource provider. If zones are not enabled on the attached VMSS, the list will contain a single entry without zone values. Note: any resources in the Running state may still be installing extensions / not fully provisioned. */ readonly instanceCountSummary: VirtualMachineInstanceCountSummary[]; /** Displays the provisioning state of the standby pool */ readonly provisioningState?: ProvisioningState; } -/** - * Contains the counts of VMs in each power state in a given zone, fault domain, as known by the StandbyPool resource provider. - * Note: any updates to pool resources outside of StandbyPoolRP (i.e deleting a VM through portal) are not reflected here. - * Note: any resources in the Running state may still be installing extensions / not fully provisioned. - */ +export function standbyVirtualMachinePoolRuntimeViewResourcePropertiesDeserializer( + item: any, +): StandbyVirtualMachinePoolRuntimeViewResourceProperties { + return { + instanceCountSummary: virtualMachineInstanceCountSummaryArrayDeserializer( + item["instanceCountSummary"], + ), + provisioningState: item["provisioningState"], + }; +} + +export function virtualMachineInstanceCountSummaryArrayDeserializer( + result: Array, +): any[] { + return result.map((item) => { + return virtualMachineInstanceCountSummaryDeserializer(item); + }); +} + +/** Contains the counts of VMs in each power state in a given zone, fault domain, as known by the StandbyPool resource provider. Note: any resources in the Running state may still be installing extensions / not fully provisioned. */ export interface VirtualMachineInstanceCountSummary { /** The zone that the provided counts are in. This is null if zones are not enabled on the attached VMSS. */ zone?: number; @@ -308,6 +566,15 @@ export interface VirtualMachineInstanceCountSummary { instanceCountsByState: PoolResourceStateCount[]; } +export function virtualMachineInstanceCountSummaryDeserializer( + item: any, +): VirtualMachineInstanceCountSummary { + return { + zone: item["zone"], + instanceCountsByState: poolResourceStateCountArrayDeserializer(item["instanceCountsByState"]), + }; +} + /** The response of a StandbyVirtualMachinePoolRuntimeViewResource list operation. */ export interface _StandbyVirtualMachinePoolRuntimeViewResourceListResult { /** The StandbyVirtualMachinePoolRuntimeViewResource items on this page */ @@ -316,12 +583,45 @@ export interface _StandbyVirtualMachinePoolRuntimeViewResourceListResult { nextLink?: string; } +export function _standbyVirtualMachinePoolRuntimeViewResourceListResultDeserializer( + item: any, +): _StandbyVirtualMachinePoolRuntimeViewResourceListResult { + return { + value: standbyVirtualMachinePoolRuntimeViewResourceArrayDeserializer(item["value"]), + nextLink: item["nextLink"], + }; +} + +export function standbyVirtualMachinePoolRuntimeViewResourceArrayDeserializer( + result: Array, +): any[] { + return result.map((item) => { + return standbyVirtualMachinePoolRuntimeViewResourceDeserializer(item); + }); +} + /** Concrete proxy resource types can be created by aliasing this type using a specific property type. */ export interface StandbyVirtualMachineResource extends ProxyResource { /** The resource-specific properties for this resource. */ properties?: StandbyVirtualMachineResourceProperties; } +export function standbyVirtualMachineResourceDeserializer( + item: any, +): StandbyVirtualMachineResource { + return { + id: item["id"], + name: item["name"], + type: item["type"], + systemData: !item["systemData"] + ? item["systemData"] + : systemDataDeserializer(item["systemData"]), + properties: !item["properties"] + ? item["properties"] + : standbyVirtualMachineResourcePropertiesDeserializer(item["properties"]), + }; +} + /** Details of the StandbyVirtualMachine. */ export interface StandbyVirtualMachineResourceProperties { /** Resource id of the virtual machine. */ @@ -330,6 +630,15 @@ export interface StandbyVirtualMachineResourceProperties { readonly provisioningState?: ProvisioningState; } +export function standbyVirtualMachineResourcePropertiesDeserializer( + item: any, +): StandbyVirtualMachineResourceProperties { + return { + virtualMachineResourceId: item["virtualMachineResourceId"], + provisioningState: item["provisioningState"], + }; +} + /** The response of a StandbyVirtualMachineResource list operation. */ export interface _StandbyVirtualMachineResourceListResult { /** The StandbyVirtualMachineResource items on this page */ @@ -338,6 +647,23 @@ export interface _StandbyVirtualMachineResourceListResult { nextLink?: string; } +export function _standbyVirtualMachineResourceListResultDeserializer( + item: any, +): _StandbyVirtualMachineResourceListResult { + return { + value: standbyVirtualMachineResourceArrayDeserializer(item["value"]), + nextLink: item["nextLink"], + }; +} + +export function standbyVirtualMachineResourceArrayDeserializer( + result: Array, +): any[] { + return result.map((item) => { + return standbyVirtualMachineResourceDeserializer(item); + }); +} + /** A StandbyVirtualMachinePoolResource. */ export interface StandbyVirtualMachinePoolResource extends TrackedResource { /** The resource-specific properties for this resource. */ @@ -346,13 +672,31 @@ export interface StandbyVirtualMachinePoolResource extends TrackedResource { export function standbyVirtualMachinePoolResourceSerializer( item: StandbyVirtualMachinePoolResource, -): Record { +): any { return { - tags: !item.tags ? item.tags : (serializeRecord(item.tags as any) as any), + tags: item["tags"], location: item["location"], - properties: !item.properties - ? item.properties - : standbyVirtualMachinePoolResourcePropertiesSerializer(item.properties), + properties: !item["properties"] + ? item["properties"] + : standbyVirtualMachinePoolResourcePropertiesSerializer(item["properties"]), + }; +} + +export function standbyVirtualMachinePoolResourceDeserializer( + item: any, +): StandbyVirtualMachinePoolResource { + 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"] + : standbyVirtualMachinePoolResourcePropertiesDeserializer(item["properties"]), }; } @@ -370,13 +714,26 @@ export interface StandbyVirtualMachinePoolResourceProperties { export function standbyVirtualMachinePoolResourcePropertiesSerializer( item: StandbyVirtualMachinePoolResourceProperties, -): Record { +): any { + return { + elasticityProfile: !item["elasticityProfile"] + ? item["elasticityProfile"] + : standbyVirtualMachinePoolElasticityProfileSerializer(item["elasticityProfile"]), + virtualMachineState: item["virtualMachineState"], + attachedVirtualMachineScaleSetId: item["attachedVirtualMachineScaleSetId"], + }; +} + +export function standbyVirtualMachinePoolResourcePropertiesDeserializer( + item: any, +): StandbyVirtualMachinePoolResourceProperties { return { - elasticityProfile: !item.elasticityProfile - ? item.elasticityProfile - : standbyVirtualMachinePoolElasticityProfileSerializer(item.elasticityProfile), + elasticityProfile: !item["elasticityProfile"] + ? item["elasticityProfile"] + : standbyVirtualMachinePoolElasticityProfileDeserializer(item["elasticityProfile"]), virtualMachineState: item["virtualMachineState"], attachedVirtualMachineScaleSetId: item["attachedVirtualMachineScaleSetId"], + provisioningState: item["provisioningState"], }; } @@ -390,18 +747,27 @@ export interface StandbyVirtualMachinePoolElasticityProfile { export function standbyVirtualMachinePoolElasticityProfileSerializer( item: StandbyVirtualMachinePoolElasticityProfile, -): Record { +): any { return { maxReadyCapacity: item["maxReadyCapacity"], minReadyCapacity: item["minReadyCapacity"], }; } -/** Known values of {@link VirtualMachineState} that the service accepts. */ +export function standbyVirtualMachinePoolElasticityProfileDeserializer( + item: any, +): StandbyVirtualMachinePoolElasticityProfile { + return { + maxReadyCapacity: item["maxReadyCapacity"], + minReadyCapacity: item["minReadyCapacity"], + }; +} + +/** State of standby virtual machines */ export enum KnownVirtualMachineState { - /** Running */ + /** The virtual machine is up and running. */ Running = "Running", - /** Deallocated */ + /** The virtual machine has released the lease on the underlying hardware and is powered off. */ Deallocated = "Deallocated", } @@ -410,8 +776,8 @@ export enum KnownVirtualMachineState { * {@link KnownVirtualMachineState} can be used interchangeably with VirtualMachineState, * this enum contains the known values that the service supports. * ### Known values supported by the service - * **Running** \ - * **Deallocated** + * **Running**: The virtual machine is up and running. \ + * **Deallocated**: The virtual machine has released the lease on the underlying hardware and is powered off. */ export type VirtualMachineState = string; @@ -425,12 +791,12 @@ export interface StandbyVirtualMachinePoolResourceUpdate { export function standbyVirtualMachinePoolResourceUpdateSerializer( item: StandbyVirtualMachinePoolResourceUpdate, -): Record { +): any { return { - tags: !item.tags ? item.tags : (serializeRecord(item.tags as any) as any), - properties: !item.properties - ? item.properties - : standbyVirtualMachinePoolResourceUpdatePropertiesSerializer(item.properties), + tags: item["tags"], + properties: !item["properties"] + ? item["properties"] + : standbyVirtualMachinePoolResourceUpdatePropertiesSerializer(item["properties"]), }; } @@ -446,11 +812,11 @@ export interface StandbyVirtualMachinePoolResourceUpdateProperties { export function standbyVirtualMachinePoolResourceUpdatePropertiesSerializer( item: StandbyVirtualMachinePoolResourceUpdateProperties, -): Record { +): any { return { - elasticityProfile: !item.elasticityProfile - ? item.elasticityProfile - : standbyVirtualMachinePoolElasticityProfileSerializer(item.elasticityProfile), + elasticityProfile: !item["elasticityProfile"] + ? item["elasticityProfile"] + : standbyVirtualMachinePoolElasticityProfileSerializer(item["elasticityProfile"]), virtualMachineState: item["virtualMachineState"], attachedVirtualMachineScaleSetId: item["attachedVirtualMachineScaleSetId"], }; @@ -464,6 +830,31 @@ export interface _StandbyVirtualMachinePoolResourceListResult { nextLink?: string; } +export function _standbyVirtualMachinePoolResourceListResultDeserializer( + item: any, +): _StandbyVirtualMachinePoolResourceListResult { + return { + value: standbyVirtualMachinePoolResourceArrayDeserializer(item["value"]), + nextLink: item["nextLink"], + }; +} + +export function standbyVirtualMachinePoolResourceArraySerializer( + result: Array, +): any[] { + return result.map((item) => { + return standbyVirtualMachinePoolResourceSerializer(item); + }); +} + +export function standbyVirtualMachinePoolResourceArrayDeserializer( + result: Array, +): any[] { + return result.map((item) => { + return standbyVirtualMachinePoolResourceDeserializer(item); + }); +} + /** 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 */ @@ -472,6 +863,19 @@ export interface _OperationListResult { 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" */ @@ -479,11 +883,21 @@ export interface Operation { /** 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; + 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; + readonly 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. */ @@ -498,14 +912,23 @@ export interface OperationDisplay { readonly description?: string; } -/** Known values of {@link Origin} that the service accepts. */ +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 { - /** user */ - User = "user", - /** system */ - System = "system", - /** user,system */ - UserSystem = "user,system", + /** 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", } /** @@ -513,15 +936,15 @@ export enum KnownOrigin { * {@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** + * **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; -/** Known values of {@link ActionType} that the service accepts. */ +/** Extensible enum. Indicates the action type. "Internal" refers to actions that are for internal only APIs. */ export enum KnownActionType { - /** Internal */ + /** Actions are for internal-only APIs. */ Internal = "Internal", } @@ -530,32 +953,12 @@ export enum KnownActionType { * {@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** + * **Internal**: Actions are for internal-only APIs. */ export type ActionType = string; -/** Known values of {@link ProvisioningState} that the service accepts. */ -export enum KnownProvisioningState { - /** Succeeded */ - Succeeded = "Succeeded", - /** Failed */ - Failed = "Failed", - /** Canceled */ - Canceled = "Canceled", - /** Deleting */ - Deleting = "Deleting", +/** Supported API Versions for Microsoft.StandbyPool */ +export enum KnownVersions { + /** API Version 2024-03-01. */ + "2024-03-01" = "2024-03-01", } - -/** - * The provisioning state of a resource type. \ - * {@link KnownProvisioningState} can be used interchangeably with ResourceProvisioningState, - * this enum contains the known values that the service supports. - * ### Known values supported by the service - * **Succeeded** \ - * **Failed** \ - * **Canceled** \ - * **Deleting** - */ -/** Alias for ProvisioningState */ - -export type ProvisioningState = string; diff --git a/sdk/standbypool/arm-standbypool/src/standbyPoolManagementClient.ts b/sdk/standbypool/arm-standbypool/src/standbyPoolManagementClient.ts index 4fdc5db0f672..5ea7f699f592 100644 --- a/sdk/standbypool/arm-standbypool/src/standbyPoolManagementClient.ts +++ b/sdk/standbypool/arm-standbypool/src/standbyPoolManagementClient.ts @@ -1,8 +1,6 @@ // Copyright (c) Microsoft Corporation. // Licensed under the MIT License. -import { TokenCredential } from "@azure/core-auth"; -import { Pipeline } from "@azure/core-rest-pipeline"; import { getOperationsOperations, OperationsOperations } from "./classic/operations/index.js"; import { getStandbyVirtualMachinePoolsOperations, @@ -26,14 +24,16 @@ import { } from "./classic/standbyContainerGroupPoolRuntimeViews/index.js"; import { createStandbyPoolManagement, - StandbyPoolContext, + StandbyPoolManagementContext, StandbyPoolManagementClientOptionalParams, } from "./api/index.js"; +import { Pipeline } from "@azure/core-rest-pipeline"; +import { TokenCredential } from "@azure/core-auth"; export { StandbyPoolManagementClientOptionalParams } from "./api/standbyPoolManagementContext.js"; export class StandbyPoolManagementClient { - private _client: StandbyPoolContext; + private _client: StandbyPoolManagementContext; /** The pipeline used by this client to make requests */ public readonly pipeline: Pipeline; @@ -45,7 +45,7 @@ export class StandbyPoolManagementClient { const prefixFromOptions = options?.userAgentOptions?.userAgentPrefix; const userAgentPrefix = prefixFromOptions ? `${prefixFromOptions} azsdk-js-client` - : "azsdk-js-client"; + : `azsdk-js-client`; this._client = createStandbyPoolManagement(credential, { ...options, userAgentOptions: { userAgentPrefix }, diff --git a/sdk/standbypool/arm-standbypool/src/static-helpers/pagingHelpers.ts b/sdk/standbypool/arm-standbypool/src/static-helpers/pagingHelpers.ts index bff1376fd432..ce33af5f4178 100644 --- a/sdk/standbypool/arm-standbypool/src/static-helpers/pagingHelpers.ts +++ b/sdk/standbypool/arm-standbypool/src/static-helpers/pagingHelpers.ts @@ -1,9 +1,6 @@ // 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"; diff --git a/sdk/standbypool/arm-standbypool/src/static-helpers/pollingHelpers.ts b/sdk/standbypool/arm-standbypool/src/static-helpers/pollingHelpers.ts index 42df16073822..f01c41bab69d 100644 --- a/sdk/standbypool/arm-standbypool/src/static-helpers/pollingHelpers.ts +++ b/sdk/standbypool/arm-standbypool/src/static-helpers/pollingHelpers.ts @@ -1,9 +1,6 @@ // Copyright (c) Microsoft Corporation. // Licensed under the MIT License. -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. - import { PollerLike, OperationState, diff --git a/sdk/standbypool/arm-standbypool/test/public/sampleTest.spec.ts b/sdk/standbypool/arm-standbypool/test/public/sampleTest.spec.ts new file mode 100644 index 000000000000..6cf37d4513a0 --- /dev/null +++ b/sdk/standbypool/arm-standbypool/test/public/sampleTest.spec.ts @@ -0,0 +1,20 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +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/standbypool/arm-standbypool/test/public/standbypool_operations_test.spec.ts b/sdk/standbypool/arm-standbypool/test/public/standbypool_operations_test.spec.ts deleted file mode 100644 index 18df27a349b6..000000000000 --- a/sdk/standbypool/arm-standbypool/test/public/standbypool_operations_test.spec.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. - */ - -import { env, Recorder, isPlaybackMode } from "@azure-tools/test-recorder"; -import { createTestCredential } from "@azure-tools/test-credential"; -import { assert, beforeEach, afterEach, it, describe } from "vitest"; -import { createRecorder } from "./utils/recordedClient.js"; -import { StandbyPoolManagementClient } from "../../src/standbyPoolManagementClient.js"; - -export const testPollingOptions = { - updateIntervalInMs: isPlaybackMode() ? 0 : undefined, -}; - -describe("StandbyPool test", () => { - let recorder: Recorder; - let subscriptionId: string; - let client: StandbyPoolManagementClient; - - beforeEach(async (context) => { - process.env.SystemRoot = process.env.SystemRoot || "C:\\Windows"; - recorder = await createRecorder(context); - subscriptionId = env.SUBSCRIPTION_ID || ""; - // This is an example of how the environment variables are used - const credential = createTestCredential(); - client = new StandbyPoolManagementClient( - credential, - subscriptionId, - recorder.configureClientOptions({}), - ); - }); - - 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/standbypool/arm-standbypool/test/public/utils/recordedClient.ts b/sdk/standbypool/arm-standbypool/test/public/utils/recordedClient.ts index 527ccc9dee86..14dcd9fa397c 100644 --- a/sdk/standbypool/arm-standbypool/test/public/utils/recordedClient.ts +++ b/sdk/standbypool/arm-standbypool/test/public/utils/recordedClient.ts @@ -9,10 +9,6 @@ const replaceableVariables: Record = { const recorderEnvSetup: 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 - ], }; /** diff --git a/sdk/standbypool/arm-standbypool/tsconfig.browser.config.json b/sdk/standbypool/arm-standbypool/tsconfig.browser.config.json index 75871518e3a0..f772e6eb3b76 100644 --- a/sdk/standbypool/arm-standbypool/tsconfig.browser.config.json +++ b/sdk/standbypool/arm-standbypool/tsconfig.browser.config.json @@ -1,3 +1,10 @@ { - "extends": ["./tsconfig.test.json", "../../../tsconfig.browser.base.json"] + "extends": "./.tshy/build.json", + "include": ["./src/**/*.ts", "./src/**/*.mts", "./test/**/*.spec.ts", "./test/**/*.mts"], + "exclude": ["./test/**/node/**/*.ts"], + "compilerOptions": { + "outDir": "./dist-test/browser", + "rootDir": ".", + "skipLibCheck": true + } } diff --git a/sdk/standbypool/arm-standbypool/tsconfig.json b/sdk/standbypool/arm-standbypool/tsconfig.json index 273d9078a24a..19ceb382b521 100644 --- a/sdk/standbypool/arm-standbypool/tsconfig.json +++ b/sdk/standbypool/arm-standbypool/tsconfig.json @@ -1,7 +1,13 @@ { "references": [ - { "path": "./tsconfig.src.json" }, - { "path": "./tsconfig.samples.json" }, - { "path": "./tsconfig.test.json" } + { + "path": "./tsconfig.src.json" + }, + { + "path": "./tsconfig.samples.json" + }, + { + "path": "./tsconfig.test.json" + } ] } diff --git a/sdk/standbypool/arm-standbypool/tsp-location.yaml b/sdk/standbypool/arm-standbypool/tsp-location.yaml index 5b2b24a1a7e6..736672640e8a 100644 --- a/sdk/standbypool/arm-standbypool/tsp-location.yaml +++ b/sdk/standbypool/arm-standbypool/tsp-location.yaml @@ -1,4 +1,4 @@ directory: specification/standbypool/StandbyPool.Management -commit: 3519c80fe510a268f6e59a29ccac8a53fdec15b6 -repo: Azure/azure-rest-api-specs -additionalDirectories: +commit: 19115ed348edb428d4875154626a6fcf7365e2d4 +repo: ../azure-rest-api-specs +additionalDirectories: diff --git a/sdk/standbypool/arm-standbypool/vitest.browser.config.ts b/sdk/standbypool/arm-standbypool/vitest.browser.config.ts index 93f3735b960c..b48c61b2ef46 100644 --- a/sdk/standbypool/arm-standbypool/vitest.browser.config.ts +++ b/sdk/standbypool/arm-standbypool/vitest.browser.config.ts @@ -1,38 +1,17 @@ + // 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(); +import { defineConfig, mergeConfig } from "vitest/config"; +import viteConfig from "../../../vitest.browser.shared.config.ts"; -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", +export default mergeConfig( + viteConfig, + defineConfig({ + test: { + include: [ + "dist-test/browser/test/**/*.spec.js", + ], }, - testTimeout: 1200000, - hookTimeout: 1200000 - }, -}); + }), +); diff --git a/sdk/standbypool/arm-standbypool/vitest.config.ts b/sdk/standbypool/arm-standbypool/vitest.config.ts index 86a71911ccc2..cc5cd85d4131 100644 --- a/sdk/standbypool/arm-standbypool/vitest.config.ts +++ b/sdk/standbypool/arm-standbypool/vitest.config.ts @@ -1,15 +1,7 @@ + // Copyright (c) Microsoft Corporation. // Licensed under the MIT License. -import { defineConfig, mergeConfig } from "vitest/config"; import viteConfig from "../../../vitest.shared.config.ts"; -export default mergeConfig( - viteConfig, - defineConfig({ - test: { - testTimeout: 1200000, - hookTimeout: 1200000, - }, - }), -); +export default viteConfig; diff --git a/sdk/standbypool/arm-standbypool/vitest.esm.config.ts b/sdk/standbypool/arm-standbypool/vitest.esm.config.ts new file mode 100644 index 000000000000..a70127279fc9 --- /dev/null +++ b/sdk/standbypool/arm-standbypool/vitest.esm.config.ts @@ -0,0 +1,12 @@ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +import { mergeConfig } from "vitest/config"; +import vitestConfig from "./vitest.config.ts"; +import vitestEsmConfig from "../../../vitest.esm.shared.config.ts"; + +export default mergeConfig( + vitestConfig, + vitestEsmConfig +); diff --git a/sdk/standbypool/ci.mgmt.yml b/sdk/standbypool/ci.mgmt.yml index 8f3f6c90c288..0dda7968ab42 100644 --- a/sdk/standbypool/ci.mgmt.yml +++ b/sdk/standbypool/ci.mgmt.yml @@ -1,5 +1,5 @@ # NOTE: Please refer to https://aka.ms/azsdk/engsys/ci-yaml before editing this file. - + trigger: branches: include: @@ -13,7 +13,6 @@ trigger: include: - sdk/standbypool/arm-standbypool - sdk/standbypool/ci.mgmt.yml - pr: branches: include: @@ -27,7 +26,6 @@ pr: include: - sdk/standbypool/arm-standbypool - sdk/standbypool/ci.mgmt.yml - extends: template: /eng/pipelines/templates/stages/archetype-sdk-client.yml parameters: @@ -35,4 +33,3 @@ extends: Artifacts: - name: azure-arm-standbypool safeName: azurearmstandbypool - \ No newline at end of file