diff --git a/common/config/rush/pnpm-lock.yaml b/common/config/rush/pnpm-lock.yaml index a9d46d020fc8..d77bcf96dac8 100644 --- a/common/config/rush/pnpm-lock.yaml +++ b/common/config/rush/pnpm-lock.yaml @@ -113,6 +113,9 @@ dependencies: '@rush-temp/arm-azureadexternalidentities': specifier: file:./projects/arm-azureadexternalidentities.tgz version: file:projects/arm-azureadexternalidentities.tgz + '@rush-temp/arm-azurelargeinstance': + specifier: file:./projects/arm-azurelargeinstance.tgz + version: file:projects/arm-azurelargeinstance.tgz '@rush-temp/arm-azurestack': specifier: file:./projects/arm-azurestack.tgz version: file:projects/arm-azurestack.tgz @@ -2928,7 +2931,7 @@ packages: /@types/decompress@4.2.5: resolution: {integrity: sha512-LdL+kbcKGs9TzvB/K+OBGzPfDoP6gwwTsykYjodlzUJUUYp/43c1p1jE5YTtz3z4Ml90iruvBXbJ6+kDvb3WSQ==} dependencies: - '@types/node': 16.18.55 + '@types/node': 18.18.6 dev: false /@types/eslint@8.44.3: @@ -8956,6 +8959,37 @@ packages: code-block-writer: 12.0.0 dev: false + /ts-node@10.9.1(@types/node@16.18.55)(typescript@5.0.4): + resolution: {integrity: sha512-NtVysVPkxxrwFGUUxGYhfux8k78pQB3JqYBXlLRZgdGUqTO5wU/UyHop5p70iEbGhB7q5KmiZiU0Y3KlJrScEw==} + hasBin: true + peerDependencies: + '@swc/core': '>=1.2.50' + '@swc/wasm': '>=1.2.50' + '@types/node': '*' + typescript: '>=2.7' + peerDependenciesMeta: + '@swc/core': + optional: true + '@swc/wasm': + optional: true + dependencies: + '@cspotcode/source-map-support': 0.8.1 + '@tsconfig/node10': 1.0.9 + '@tsconfig/node12': 1.0.11 + '@tsconfig/node14': 1.0.3 + '@tsconfig/node16': 1.0.4 + '@types/node': 16.18.55 + acorn: 8.10.0 + acorn-walk: 8.2.0 + arg: 4.1.3 + create-require: 1.1.1 + diff: 4.0.2 + make-error: 1.3.6 + typescript: 5.0.4 + v8-compile-cache-lib: 3.0.1 + yn: 3.1.1 + dev: false + /ts-node@10.9.1(@types/node@16.18.55)(typescript@5.2.2): resolution: {integrity: sha512-NtVysVPkxxrwFGUUxGYhfux8k78pQB3JqYBXlLRZgdGUqTO5wU/UyHop5p70iEbGhB7q5KmiZiU0Y3KlJrScEw==} hasBin: true @@ -10996,6 +11030,37 @@ packages: - '@swc/wasm' dev: false + file:projects/arm-azurelargeinstance.tgz: + resolution: {integrity: sha512-lRoW+yYQVVbbcPe85EhalposS+2XsNMVIkR4pTyMahmsw4DS4YTykG6ptm/bJTNFKHYJHrpclDTX6LYpjNgbRA==, tarball: file:projects/arm-azurelargeinstance.tgz} + name: '@rush-temp/arm-azurelargeinstance' + version: 0.0.0 + dependencies: + '@microsoft/api-extractor': 7.38.0(@types/node@16.18.55) + '@rollup/plugin-commonjs': 24.1.0(rollup@2.79.1) + '@rollup/plugin-json': 6.0.0(rollup@2.79.1) + '@rollup/plugin-multi-entry': 6.0.0(rollup@2.79.1) + '@rollup/plugin-node-resolve': 13.3.0(rollup@2.79.1) + '@types/chai': 4.3.6 + '@types/mocha': 10.0.2 + '@types/node': 16.18.55 + chai: 4.3.10 + cross-env: 7.0.3 + dotenv: 16.3.1 + esm: 3.2.25 + mkdirp: 2.1.6 + mocha: 10.2.0 + rimraf: 5.0.5 + rollup: 2.79.1 + rollup-plugin-sourcemaps: 0.6.3(@types/node@16.18.55)(rollup@2.79.1) + ts-node: 10.9.1(@types/node@16.18.55)(typescript@5.0.4) + tslib: 2.6.2 + typescript: 5.0.4 + uglify-js: 3.17.4 + transitivePeerDependencies: + - '@swc/core' + - '@swc/wasm' + dev: false + file:projects/arm-azurestack.tgz: resolution: {integrity: sha512-cyV34oj3t5SE6slMyH0Y+o1E+y2hKsxcCbNtoIpk9vwUV7vFZ1Fa3JD8y/aGZCB/np5KyupVdC6Yvi565cwsaw==, tarball: file:projects/arm-azurestack.tgz} name: '@rush-temp/arm-azurestack' @@ -19212,7 +19277,7 @@ packages: dev: false file:projects/keyvault-certificates.tgz: - resolution: {integrity: sha512-I2HoDbXKPMnWCzSLvBfSeRvhcEcjo5QbWjR69KuNMGEeNtuyi9ZIYdRhvDkh1jhmXF0pUFIO+gxW1fDLZNHL+w==, tarball: file:projects/keyvault-certificates.tgz} + resolution: {integrity: sha512-N3MzxkAtHFu1M6+2m0+9fYOpGu66U9JAjLwxrkMPgj/qtovuH2m8lFizg6B4k4mnWSo19Z0kl04vF7nNS9CR6g==, tarball: file:projects/keyvault-certificates.tgz} name: '@rush-temp/keyvault-certificates' version: 0.0.0 dependencies: @@ -20028,7 +20093,7 @@ packages: dev: false file:projects/openai.tgz: - resolution: {integrity: sha512-HPJq35LqAc0O4ZWamZunXj5BkVfVNdv2w1RdY2uw64qwsyHfDNFl2AQ9RSGn9HxJtZopAmf93tueLSiARnjQsg==, tarball: file:projects/openai.tgz} + resolution: {integrity: sha512-xYnrqVPQaBXxwvLxAX32bPmxIQyZCHNlUmtJoOMxe1ij2h7Mki4+y4OTBA7UVwgqfHWd2FzEClwuZGomo0LpwQ==, tarball: file:projects/openai.tgz} name: '@rush-temp/openai' version: 0.0.0 dependencies: diff --git a/rush.json b/rush.json index 8ade5068358e..eab01d6729db 100644 --- a/rush.json +++ b/rush.json @@ -1,7 +1,7 @@ /** * This is the main configuration file for Rush. * For full documentation, please see https://rushjs.io - */ { + */{ "$schema": "https://developer.microsoft.com/json-schemas/rush/v5/rush.schema.json", /** * (Required) This specifies the version of the Rush engine to be used in this repo. @@ -2140,6 +2140,11 @@ "packageName": "@azure/arm-playwrighttesting", "projectFolder": "sdk/playwrighttesting/arm-playwrighttesting", "versionPolicyName": "management" + }, + { + "packageName": "@azure/arm-azurelargeinstance", + "projectFolder": "sdk/azurelargeinstance/arm-azurelargeinstance", + "versionPolicyName": "management" } ] -} +} \ No newline at end of file diff --git a/sdk/azurelargeinstance/arm-azurelargeinstance/LICENSE b/sdk/azurelargeinstance/arm-azurelargeinstance/LICENSE new file mode 100644 index 000000000000..3a1d9b6f24f7 --- /dev/null +++ b/sdk/azurelargeinstance/arm-azurelargeinstance/LICENSE @@ -0,0 +1,21 @@ +The MIT License (MIT) + +Copyright (c) 2023 Microsoft + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. \ No newline at end of file diff --git a/sdk/azurelargeinstance/arm-azurelargeinstance/README.md b/sdk/azurelargeinstance/arm-azurelargeinstance/README.md new file mode 100644 index 000000000000..2200ddd91b6f --- /dev/null +++ b/sdk/azurelargeinstance/arm-azurelargeinstance/README.md @@ -0,0 +1,109 @@ +# AzureLargeInstance client library for JavaScript + +This package contains an isomorphic SDK (runs both in Node.js and in browsers) for AzureLargeInstance client. + +The AzureLargeInstance Management client + +[Source code](https://github.com/Azure/azure-sdk-for-js/tree/main/sdk/azurelargeinstance/arm-azurelargeinstance) | +[Package (NPM)](https://www.npmjs.com/package/@azure/arm-azurelargeinstance) | +[API reference documentation](https://docs.microsoft.com/javascript/api/@azure/arm-azurelargeinstance?view=azure-node-preview) | +[Samples](https://github.com/Azure-Samples/azure-samples-js-management) + +## Getting started + +### Currently supported environments + +- [LTS versions of Node.js](https://github.com/nodejs/release#release-schedule) +- Latest versions of Safari, Chrome, Edge and Firefox. + +See our [support policy](https://github.com/Azure/azure-sdk-for-js/blob/main/SUPPORT.md) for more details. + +### Prerequisites + +- An [Azure subscription][azure_sub]. + +### Install the `@azure/arm-azurelargeinstance` package + +Install the AzureLargeInstance client library for JavaScript with `npm`: + +```bash +npm install @azure/arm-azurelargeinstance +``` + +### Create and authenticate a `AzureLargeInstance` + +To create a client object to access the AzureLargeInstance API, you will need the `endpoint` of your AzureLargeInstance resource and a `credential`. The AzureLargeInstance client can use Azure Active Directory credentials to authenticate. +You can find the endpoint for your AzureLargeInstance resource in the [Azure Portal][azure_portal]. + +You can authenticate with Azure Active Directory using a credential from the [@azure/identity][azure_identity] library or [an existing AAD Token](https://github.com/Azure/azure-sdk-for-js/blob/master/sdk/identity/identity/samples/AzureIdentityExamples.md#authenticating-with-a-pre-fetched-access-token). + +To use the [DefaultAzureCredential][defaultazurecredential] provider shown below, or other credential providers provided with the Azure SDK, please install the `@azure/identity` package: + +```bash +npm install @azure/identity +``` + +You will also need to **register a new AAD application and grant access to AzureLargeInstance** by assigning the suitable role to your service principal (note: roles such as `"Owner"` will not grant the necessary permissions). +Set the values of the client ID, tenant ID, and client secret of the AAD application as environment variables: `AZURE_CLIENT_ID`, `AZURE_TENANT_ID`, `AZURE_CLIENT_SECRET`. + +For more information about how to create an Azure AD Application check out [this guide](https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal). + +```javascript +const { AzureLargeInstance } = require("@azure/arm-azurelargeinstance"); +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 AzureLargeInstance(new DefaultAzureCredential(), subscriptionId); + +// For client-side applications running in the browser, use this code instead: +// const credential = new InteractiveBrowserCredential({ +// tenantId: "", +// clientId: "" +// }); +// const client = new AzureLargeInstance(credential, subscriptionId); +``` + + +### JavaScript Bundle +To use this client library in the browser, first you need to use a bundler. For details on how to do this, please refer to our [bundling documentation](https://aka.ms/AzureSDKBundling). + +## Key concepts + +### AzureLargeInstance + +`AzureLargeInstance` is the primary interface for developers using the AzureLargeInstance client library. Explore the methods on this client object to understand the different features of the AzureLargeInstance service that you can access. + +## Troubleshooting + +### Logging + +Enabling logging may help uncover useful information about failures. In order to see a log of HTTP requests and responses, set the `AZURE_LOG_LEVEL` environment variable to `info`. Alternatively, logging can be enabled at runtime by calling `setLogLevel` in the `@azure/logger`: + +```javascript +const { setLogLevel } = require("@azure/logger"); +setLogLevel("info"); +``` + +For more detailed instructions on how to enable logs, you can look at the [@azure/logger package docs](https://github.com/Azure/azure-sdk-for-js/tree/main/sdk/core/logger). + +## Next steps + +Please take a look at the [samples](https://github.com/Azure-Samples/azure-samples-js-management) directory for detailed examples on how to use this library. + +## Contributing + +If you'd like to contribute to this library, please read the [contributing guide](https://github.com/Azure/azure-sdk-for-js/blob/main/CONTRIBUTING.md) to learn more about how to build and test the code. + +## Related projects + +- [Microsoft Azure SDK for JavaScript](https://github.com/Azure/azure-sdk-for-js) + +![Impressions](https://azure-sdk-impressions.azurewebsites.net/api/impressions/azure-sdk-for-js%2Fsdk%2Fazurelargeinstance%2Farm-azurelargeinstance%2FREADME.png) + +[azure_cli]: https://docs.microsoft.com/cli/azure +[azure_sub]: https://azure.microsoft.com/free/ +[azure_sub]: https://azure.microsoft.com/free/ +[azure_portal]: https://portal.azure.com +[azure_identity]: https://github.com/Azure/azure-sdk-for-js/tree/main/sdk/identity/identity +[defaultazurecredential]: https://github.com/Azure/azure-sdk-for-js/tree/main/sdk/identity/identity#defaultazurecredential diff --git a/sdk/azurelargeinstance/arm-azurelargeinstance/_meta.json b/sdk/azurelargeinstance/arm-azurelargeinstance/_meta.json new file mode 100644 index 000000000000..169b3373cfda --- /dev/null +++ b/sdk/azurelargeinstance/arm-azurelargeinstance/_meta.json @@ -0,0 +1,8 @@ +{ + "commit": "095d5bf664be2c5f42a0efa49017d4794eca4338", + "readme": "specification/azurelargeinstance/resource-manager/readme.md", + "autorest_command": "autorest --version=3.9.7 --typescript --modelerfour.lenient-model-deduplication --azure-arm --head-as-boolean=true --license-header=MICROSOFT_MIT_NO_VERSION --generate-test --typescript-sdks-folder=/mnt/vss/_work/1/s/azure-sdk-for-js ../azure-rest-api-specs/specification/azurelargeinstance/resource-manager/readme.md --use=@autorest/typescript@^6.0.11", + "repository_url": "https://github.com/Azure/azure-rest-api-specs.git", + "release_tool": "@azure-tools/js-sdk-release-tools@2.7.2", + "use": "@autorest/typescript@^6.0.11" +} \ No newline at end of file diff --git a/sdk/azurelargeinstance/arm-azurelargeinstance/api-extractor.json b/sdk/azurelargeinstance/arm-azurelargeinstance/api-extractor.json new file mode 100644 index 000000000000..05bfb313e09c --- /dev/null +++ b/sdk/azurelargeinstance/arm-azurelargeinstance/api-extractor.json @@ -0,0 +1,31 @@ +{ + "$schema": "https://developer.microsoft.com/json-schemas/api-extractor/v7/api-extractor.schema.json", + "mainEntryPointFilePath": "./dist-esm/src/index.d.ts", + "docModel": { + "enabled": true + }, + "apiReport": { + "enabled": true, + "reportFolder": "./review" + }, + "dtsRollup": { + "enabled": true, + "untrimmedFilePath": "", + "publicTrimmedFilePath": "./types/arm-azurelargeinstance.d.ts" + }, + "messages": { + "tsdocMessageReporting": { + "default": { + "logLevel": "none" + } + }, + "extractorMessageReporting": { + "ae-missing-release-tag": { + "logLevel": "none" + }, + "ae-unresolved-link": { + "logLevel": "none" + } + } + } +} \ No newline at end of file diff --git a/sdk/azurelargeinstance/arm-azurelargeinstance/package.json b/sdk/azurelargeinstance/arm-azurelargeinstance/package.json new file mode 100644 index 000000000000..06c07327fe3f --- /dev/null +++ b/sdk/azurelargeinstance/arm-azurelargeinstance/package.json @@ -0,0 +1,118 @@ +{ + "name": "@azure/arm-azurelargeinstance", + "sdk-type": "mgmt", + "author": "Microsoft Corporation", + "description": "A generated SDK for AzureLargeInstance.", + "version": "1.0.0-beta.1", + "engines": { + "node": ">=16.0.0" + }, + "dependencies": { + "@azure/core-lro": "^2.5.4", + "@azure/abort-controller": "^1.0.0", + "@azure/core-paging": "^1.2.0", + "@azure/core-client": "^1.7.0", + "@azure/core-auth": "^1.3.0", + "@azure/core-rest-pipeline": "^1.12.0", + "tslib": "^2.2.0" + }, + "keywords": [ + "node", + "azure", + "typescript", + "browser", + "isomorphic" + ], + "license": "MIT", + "main": "./dist/index.js", + "module": "./dist-esm/src/index.js", + "types": "./types/arm-azurelargeinstance.d.ts", + "devDependencies": { + "@microsoft/api-extractor": "^7.31.1", + "@rollup/plugin-commonjs": "^24.0.0", + "@rollup/plugin-json": "^6.0.0", + "@rollup/plugin-multi-entry": "^6.0.0", + "@rollup/plugin-node-resolve": "^13.1.3", + "mkdirp": "^2.1.2", + "rollup": "^2.66.1", + "rollup-plugin-sourcemaps": "^0.6.3", + "typescript": "~5.0.0", + "uglify-js": "^3.4.9", + "rimraf": "^5.0.0", + "dotenv": "^16.0.0", + "@azure/identity": "^3.3.0", + "@azure-tools/test-recorder": "^3.0.0", + "@azure-tools/test-credential": "^1.0.0", + "mocha": "^10.0.0", + "@types/mocha": "^10.0.0", + "esm": "^3.2.18", + "@types/chai": "^4.2.8", + "chai": "^4.2.0", + "cross-env": "^7.0.2", + "@types/node": "^16.0.0", + "ts-node": "^10.0.0", + "@azure/dev-tool": "^1.0.0" + }, + "repository": { + "type": "git", + "url": "https://github.com/Azure/azure-sdk-for-js.git" + }, + "bugs": { + "url": "https://github.com/Azure/azure-sdk-for-js/issues" + }, + "files": [ + "dist/**/*.js", + "dist/**/*.js.map", + "dist/**/*.d.ts", + "dist/**/*.d.ts.map", + "dist-esm/**/*.js", + "dist-esm/**/*.js.map", + "dist-esm/**/*.d.ts", + "dist-esm/**/*.d.ts.map", + "src/**/*.ts", + "README.md", + "LICENSE", + "rollup.config.js", + "tsconfig.json", + "review/*", + "CHANGELOG.md", + "types/*" + ], + "scripts": { + "build": "npm run clean && tsc && rollup -c 2>&1 && npm run minify && mkdirp ./review && npm run extract-api", + "minify": "uglifyjs -c -m --comments --source-map \"content='./dist/index.js.map'\" -o ./dist/index.min.js ./dist/index.js", + "prepack": "npm run build", + "pack": "npm pack 2>&1", + "extract-api": "api-extractor run --local", + "lint": "echo skipped", + "audit": "echo skipped", + "clean": "rimraf --glob dist dist-browser dist-esm test-dist temp types *.tgz *.log", + "build:node": "echo skipped", + "build:browser": "echo skipped", + "build:test": "echo skipped", + "build:samples": "echo skipped.", + "check-format": "echo skipped", + "execute:samples": "echo skipped", + "format": "echo skipped", + "test": "npm run integration-test", + "test:node": "echo skipped", + "test:browser": "echo skipped", + "unit-test": "npm run unit-test:node && npm run unit-test:browser", + "unit-test:node": "cross-env TEST_MODE=playback npm run integration-test:node", + "unit-test:browser": "echo skipped", + "integration-test": "npm run integration-test:node && npm run integration-test:browser", + "integration-test:node": "dev-tool run test:node-ts-input -- --timeout 1200000 'test/*.ts'", + "integration-test:browser": "echo skipped" + }, + "sideEffects": false, + "//metadata": { + "constantPaths": [ + { + "path": "src/azureLargeInstance.ts", + "prefix": "packageDetails" + } + ] + }, + "autoPublish": true, + "homepage": "https://github.com/Azure/azure-sdk-for-js/tree/main/sdk/azurelargeinstance/arm-azurelargeinstance" +} \ No newline at end of file diff --git a/sdk/azurelargeinstance/arm-azurelargeinstance/rollup.config.js b/sdk/azurelargeinstance/arm-azurelargeinstance/rollup.config.js new file mode 100644 index 000000000000..3f89d7309da5 --- /dev/null +++ b/sdk/azurelargeinstance/arm-azurelargeinstance/rollup.config.js @@ -0,0 +1,122 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +import nodeResolve from "@rollup/plugin-node-resolve"; +import cjs from "@rollup/plugin-commonjs"; +import sourcemaps from "rollup-plugin-sourcemaps"; +import multiEntry from "@rollup/plugin-multi-entry"; +import json from "@rollup/plugin-json"; + +import nodeBuiltins from "builtin-modules"; + +// #region Warning Handler + +/** + * A function that can determine whether a rollup warning should be ignored. If + * the function returns `true`, then the warning will not be displayed. + */ + +function ignoreNiseSinonEval(warning) { + return ( + warning.code === "EVAL" && + warning.id && + (warning.id.includes("node_modules/nise") || + warning.id.includes("node_modules/sinon")) === true + ); +} + +function ignoreChaiCircularDependency(warning) { + return ( + warning.code === "CIRCULAR_DEPENDENCY" && + warning.importer && warning.importer.includes("node_modules/chai") === true + ); +} + +const warningInhibitors = [ignoreChaiCircularDependency, ignoreNiseSinonEval]; + +/** + * Construct a warning handler for the shared rollup configuration + * that ignores certain warnings that are not relevant to testing. + */ +function makeOnWarnForTesting() { + return (warning, warn) => { + // If every inhibitor returns false (i.e. no inhibitors), then show the warning + if (warningInhibitors.every((inhib) => !inhib(warning))) { + warn(warning); + } + }; +} + +// #endregion + +function makeBrowserTestConfig() { + const config = { + input: { + include: ["dist-esm/test/**/*.spec.js"], + exclude: ["dist-esm/test/**/node/**"] + }, + output: { + file: `dist-test/index.browser.js`, + format: "umd", + sourcemap: true + }, + preserveSymlinks: false, + plugins: [ + multiEntry({ exports: false }), + nodeResolve({ + mainFields: ["module", "browser"] + }), + cjs(), + json(), + sourcemaps() + //viz({ filename: "dist-test/browser-stats.html", sourcemap: true }) + ], + onwarn: makeOnWarnForTesting(), + // Disable tree-shaking of test code. In rollup-plugin-node-resolve@5.0.0, + // rollup started respecting the "sideEffects" field in package.json. Since + // our package.json sets "sideEffects=false", this also applies to test + // code, which causes all tests to be removed by tree-shaking. + treeshake: false + }; + + return config; +} + +const defaultConfigurationOptions = { + disableBrowserBundle: false +}; + +export function makeConfig(pkg, options) { + options = { + ...defaultConfigurationOptions, + ...(options || {}) + }; + + const baseConfig = { + // Use the package's module field if it has one + input: pkg["module"] || "dist-esm/src/index.js", + external: [ + ...nodeBuiltins, + ...Object.keys(pkg.dependencies), + ...Object.keys(pkg.devDependencies) + ], + output: { file: "dist/index.js", format: "cjs", sourcemap: true }, + preserveSymlinks: false, + plugins: [sourcemaps(), nodeResolve()] + }; + + const config = [baseConfig]; + + if (!options.disableBrowserBundle) { + config.push(makeBrowserTestConfig()); + } + + return config; +} + +export default makeConfig(require("./package.json")); diff --git a/sdk/azurelargeinstance/arm-azurelargeinstance/sample.env b/sdk/azurelargeinstance/arm-azurelargeinstance/sample.env new file mode 100644 index 000000000000..672847a3fea0 --- /dev/null +++ b/sdk/azurelargeinstance/arm-azurelargeinstance/sample.env @@ -0,0 +1,4 @@ +# App registration secret for AAD authentication +AZURE_CLIENT_SECRET= +AZURE_CLIENT_ID= +AZURE_TENANT_ID= \ No newline at end of file diff --git a/sdk/azurelargeinstance/arm-azurelargeinstance/src/azureLargeInstance.ts b/sdk/azurelargeinstance/arm-azurelargeinstance/src/azureLargeInstance.ts new file mode 100644 index 000000000000..d6d5ff67ba91 --- /dev/null +++ b/sdk/azurelargeinstance/arm-azurelargeinstance/src/azureLargeInstance.ts @@ -0,0 +1,156 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +import * as coreClient from "@azure/core-client"; +import * as coreRestPipeline from "@azure/core-rest-pipeline"; +import { + PipelineRequest, + PipelineResponse, + SendRequest +} from "@azure/core-rest-pipeline"; +import * as coreAuth from "@azure/core-auth"; +import { + AzureLargeInstanceOperationsImpl, + OperationsImpl, + AzureLargeStorageInstanceOperationsImpl +} from "./operations"; +import { + AzureLargeInstanceOperations, + Operations, + AzureLargeStorageInstanceOperations +} from "./operationsInterfaces"; +import { AzureLargeInstanceOptionalParams } from "./models"; + +export class AzureLargeInstance extends coreClient.ServiceClient { + $host: string; + apiVersion: string; + subscriptionId: string; + + /** + * Initializes a new instance of the AzureLargeInstance class. + * @param credentials Subscription credentials which uniquely identify client subscription. + * @param subscriptionId The ID of the target subscription. The value must be an UUID. + * @param options The parameter options + */ + constructor( + credentials: coreAuth.TokenCredential, + subscriptionId: string, + options?: AzureLargeInstanceOptionalParams + ) { + if (credentials === undefined) { + throw new Error("'credentials' cannot be null"); + } + if (subscriptionId === undefined) { + throw new Error("'subscriptionId' cannot be null"); + } + + // Initializing default values for options + if (!options) { + options = {}; + } + const defaults: AzureLargeInstanceOptionalParams = { + requestContentType: "application/json; charset=utf-8", + credential: credentials + }; + + const packageDetails = `azsdk-js-arm-azurelargeinstance/1.0.0-beta.1`; + const userAgentPrefix = + options.userAgentOptions && options.userAgentOptions.userAgentPrefix + ? `${options.userAgentOptions.userAgentPrefix} ${packageDetails}` + : `${packageDetails}`; + + const optionsWithDefaults = { + ...defaults, + ...options, + userAgentOptions: { + userAgentPrefix + }, + endpoint: + options.endpoint ?? options.baseUri ?? "https://management.azure.com" + }; + super(optionsWithDefaults); + + let bearerTokenAuthenticationPolicyFound: boolean = false; + if (options?.pipeline && options.pipeline.getOrderedPolicies().length > 0) { + const pipelinePolicies: coreRestPipeline.PipelinePolicy[] = options.pipeline.getOrderedPolicies(); + bearerTokenAuthenticationPolicyFound = pipelinePolicies.some( + (pipelinePolicy) => + pipelinePolicy.name === + coreRestPipeline.bearerTokenAuthenticationPolicyName + ); + } + if ( + !options || + !options.pipeline || + options.pipeline.getOrderedPolicies().length == 0 || + !bearerTokenAuthenticationPolicyFound + ) { + this.pipeline.removePolicy({ + name: coreRestPipeline.bearerTokenAuthenticationPolicyName + }); + this.pipeline.addPolicy( + coreRestPipeline.bearerTokenAuthenticationPolicy({ + credential: credentials, + scopes: + optionsWithDefaults.credentialScopes ?? + `${optionsWithDefaults.endpoint}/.default`, + challengeCallbacks: { + authorizeRequestOnChallenge: + coreClient.authorizeRequestOnClaimChallenge + } + }) + ); + } + // Parameter assignments + this.subscriptionId = subscriptionId; + + // Assigning values to Constant parameters + this.$host = options.$host || "https://management.azure.com"; + this.apiVersion = options.apiVersion || "2023-07-20-preview"; + this.azureLargeInstanceOperations = new AzureLargeInstanceOperationsImpl( + this + ); + this.operations = new OperationsImpl(this); + this.azureLargeStorageInstanceOperations = new AzureLargeStorageInstanceOperationsImpl( + this + ); + this.addCustomApiVersionPolicy(options.apiVersion); + } + + /** A function that adds a policy that sets the api-version (or equivalent) to reflect the library version. */ + private addCustomApiVersionPolicy(apiVersion?: string) { + if (!apiVersion) { + return; + } + const apiVersionPolicy = { + name: "CustomApiVersionPolicy", + async sendRequest( + request: PipelineRequest, + next: SendRequest + ): Promise { + const param = request.url.split("?"); + if (param.length > 1) { + const newParams = param[1].split("&").map((item) => { + if (item.indexOf("api-version") > -1) { + return "api-version=" + apiVersion; + } else { + return item; + } + }); + request.url = param[0] + "?" + newParams.join("&"); + } + return next(request); + } + }; + this.pipeline.addPolicy(apiVersionPolicy); + } + + azureLargeInstanceOperations: AzureLargeInstanceOperations; + operations: Operations; + azureLargeStorageInstanceOperations: AzureLargeStorageInstanceOperations; +} diff --git a/sdk/azurelargeinstance/arm-azurelargeinstance/src/index.ts b/sdk/azurelargeinstance/arm-azurelargeinstance/src/index.ts new file mode 100644 index 000000000000..9b7816fa92db --- /dev/null +++ b/sdk/azurelargeinstance/arm-azurelargeinstance/src/index.ts @@ -0,0 +1,13 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +/// +export { getContinuationToken } from "./pagingHelper"; +export * from "./models"; +export { AzureLargeInstance } from "./azureLargeInstance"; +export * from "./operationsInterfaces"; diff --git a/sdk/azurelargeinstance/arm-azurelargeinstance/src/lroImpl.ts b/sdk/azurelargeinstance/arm-azurelargeinstance/src/lroImpl.ts new file mode 100644 index 000000000000..dd803cd5e28c --- /dev/null +++ b/sdk/azurelargeinstance/arm-azurelargeinstance/src/lroImpl.ts @@ -0,0 +1,42 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT license. + +import { AbortSignalLike } from "@azure/abort-controller"; +import { LongRunningOperation, LroResponse } from "@azure/core-lro"; + +export function createLroSpec(inputs: { + sendOperationFn: (args: any, spec: any) => Promise>; + args: Record; + spec: { + readonly requestBody?: unknown; + readonly path?: string; + readonly httpMethod: string; + } & Record; +}): LongRunningOperation { + const { args, spec, sendOperationFn } = inputs; + return { + requestMethod: spec.httpMethod, + requestPath: spec.path!, + sendInitialRequest: () => sendOperationFn(args, spec), + sendPollRequest: ( + path: string, + options?: { abortSignal?: AbortSignalLike } + ) => { + const { requestBody, ...restSpec } = spec; + return sendOperationFn(args, { + ...restSpec, + httpMethod: "GET", + path, + abortSignal: options?.abortSignal + }); + } + }; +} diff --git a/sdk/azurelargeinstance/arm-azurelargeinstance/src/models/index.ts b/sdk/azurelargeinstance/arm-azurelargeinstance/src/models/index.ts new file mode 100644 index 000000000000..dffdaf00f5bc --- /dev/null +++ b/sdk/azurelargeinstance/arm-azurelargeinstance/src/models/index.ts @@ -0,0 +1,877 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +import * as coreClient from "@azure/core-client"; + +/** The response from the List Azure Large Instances operation. */ +export interface AzureLargeInstanceListResult { + /** The list of Azure Large Instances. */ + value?: AzureLargeInstance[]; + /** The URL to get the next set of Azure Large Instances. */ + nextLink?: string; +} + +/** Specifies the hardware settings for the Azure Large Instance. */ +export interface HardwareProfile { + /** + * Name of the hardware type (vendor and/or their product name) + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly hardwareType?: AzureLargeInstanceHardwareTypeNamesEnum; + /** + * Specifies the Azure Large Instance SKU. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly azureLargeInstanceSize?: AzureLargeInstanceSizeNamesEnum; +} + +/** Specifies the storage settings for the Azure Large Instance disks. */ +export interface StorageProfile { + /** + * IP Address to connect to storage. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly nfsIpAddress?: string; + /** Specifies information about the operating system disk used by Azure Large Instance. */ + osDisks?: Disk[]; +} + +/** Specifies the disk information fo the Azure Large Instance */ +export interface Disk { + /** The disk name. */ + name?: string; + /** Specifies the size of an empty data disk in gigabytes. */ + diskSizeGB?: number; + /** + * Specifies the logical unit number of the data disk. This value is used to identify data disks within the VM and therefore must be unique for each data disk attached to a VM. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly lun?: number; +} + +/** Specifies the operating system settings for the Azure Large Instance. */ +export interface OSProfile { + /** Specifies the host OS name of the Azure Large Instance. */ + computerName?: string; + /** + * This property allows you to specify the type of the OS. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly osType?: string; + /** + * Specifies version of operating system. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly version?: string; + /** Specifies the SSH public key used to access the operating system. */ + sshPublicKey?: string; +} + +/** Specifies the network settings for the Azure Large Instance disks. */ +export interface NetworkProfile { + /** Specifies the network interfaces for the Azure Large Instance. */ + networkInterfaces?: IpAddress[]; + /** + * Specifies the circuit id for connecting to express route. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly circuitId?: string; +} + +/** Specifies the IP address of the network interface. */ +export interface IpAddress { + /** Specifies the IP address of the network interface. */ + ipAddress?: string; +} + +/** Common fields that are returned in the response for all Azure Resource Manager resources */ +export interface Resource { + /** + * Fully qualified resource ID for the resource. E.g. "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}" + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly id?: string; + /** + * The name of the resource + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly name?: string; + /** + * The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts" + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly type?: string; + /** + * Azure Resource Manager metadata containing createdBy and modifiedBy information. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly systemData?: SystemData; +} + +/** Metadata pertaining to creation and last modification of the resource. */ +export interface SystemData { + /** The identity that created the resource. */ + createdBy?: string; + /** The type of identity that created the resource. */ + createdByType?: CreatedByType; + /** The timestamp of resource creation (UTC). */ + createdAt?: Date; + /** The identity that last modified the resource. */ + lastModifiedBy?: string; + /** The type of identity that last modified the resource. */ + lastModifiedByType?: CreatedByType; + /** The timestamp of resource last modification (UTC) */ + lastModifiedAt?: Date; +} + +/** Common error response for all Azure Resource Manager APIs to return error details for failed operations. (This also follows the OData error response format.). */ +export interface ErrorResponse { + /** The error object. */ + error?: ErrorDetail; +} + +/** The error detail. */ +export interface ErrorDetail { + /** + * The error code. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly code?: string; + /** + * The error message. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly message?: string; + /** + * The error target. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly target?: string; + /** + * The error details. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly details?: ErrorDetail[]; + /** + * The error additional info. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly additionalInfo?: ErrorAdditionalInfo[]; +} + +/** The resource management error additional info. */ +export interface ErrorAdditionalInfo { + /** + * The additional info type. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly type?: string; + /** + * The additional info. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly info?: Record; +} + +/** The current status of an async operation. */ +export interface OperationStatusResult { + /** Fully qualified ID for the async operation. */ + id?: string; + /** + * Fully qualified ID of the resource against which the original async operation was started. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly resourceId?: string; + /** Name of the async operation. */ + name?: string; + /** Operation status. */ + status: string; + /** Percent of the operation that is complete. */ + percentComplete?: number; + /** The start time of the operation. */ + startTime?: Date; + /** The end time of the operation. */ + endTime?: Date; + /** The operations list. */ + operations?: OperationStatusResult[]; + /** If present, details of the operation error. */ + error?: ErrorDetail; +} + +/** The active state empowers the server with the ability to forcefully terminate and halt any existing processes that may be running on the server */ +export interface ForceState { + /** Whether to force restart by shutting all processes. */ + forceState?: AzureLargeInstanceForcePowerState; +} + +/** A list of REST API operations supported by an Azure Resource Provider. It contains an URL link to get the next set of results. */ +export interface OperationListResult { + /** + * List of operations supported by the resource provider + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly value?: Operation[]; + /** + * URL to get the next set of operation list results (if there are any). + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly nextLink?: string; +} + +/** Details of a REST API operation, returned from the Resource Provider Operations API */ +export interface Operation { + /** + * The name of the operation, as per Resource-Based Access Control (RBAC). Examples: "Microsoft.Compute/virtualMachines/write", "Microsoft.Compute/virtualMachines/capture/action" + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly name?: string; + /** + * Whether the operation applies to data-plane. This is "true" for data-plane operations and "false" for ARM/control-plane operations. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly isDataAction?: boolean; + /** Localized display information for this particular operation. */ + display?: OperationDisplay; + /** + * The intended executor of the operation; as in Resource Based Access Control (RBAC) and audit logs UX. Default value is "user,system" + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly origin?: Origin; + /** + * Enum. Indicates the action type. "Internal" refers to actions that are for internal only APIs. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly actionType?: ActionType; +} + +/** Localized display information for this particular operation. */ +export interface OperationDisplay { + /** + * The localized friendly form of the resource provider name, e.g. "Microsoft Monitoring Insights" or "Microsoft Compute". + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly provider?: string; + /** + * The localized friendly name of the resource type related to this operation. E.g. "Virtual Machines" or "Job Schedule Collections". + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly resource?: string; + /** + * The concise, localized friendly name for the operation; suitable for dropdowns. E.g. "Create or Update Virtual Machine", "Restart Virtual Machine". + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly operation?: string; + /** + * The short, localized friendly description of the operation; suitable for tool tips and detailed views. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly description?: string; +} + +/** Tags field of the AzureLargeInstance instance. */ +export interface Tags { + /** Tags field of the AzureLargeInstance instance. */ + tags?: { [propertyName: string]: string }; +} + +/** The response from the Get AzureLargeStorageInstances operation. */ +export interface AzureLargeStorageInstanceListResult { + /** The list of AzureLargeStorage instances. */ + value?: AzureLargeStorageInstance[]; + /** The URL to get the next set of AzureLargeStorage instances. */ + nextLink?: string; +} + +/** described the storage properties of the azure large storage instance */ +export interface StorageProperties { + /** State of provisioning of the AzureLargeStorageInstance */ + provisioningState?: ProvisioningState; + /** the offering type for which the resource is getting provisioned */ + offeringType?: string; + /** the storage protocol for which the resource is getting provisioned */ + storageType?: string; + /** the kind of storage instance */ + generation?: string; + /** the hardware type of the storage instance */ + hardwareType?: string; + /** the workload for which the resource is getting provisioned */ + workloadType?: string; + /** the billing related information for the resource */ + storageBillingProperties?: StorageBillingProperties; +} + +/** Describes the billing related details of the AzureLargeStorageInstance. */ +export interface StorageBillingProperties { + /** the billing mode for the storage instance */ + billingMode?: string; + /** the SKU type that is provisioned */ + sku?: 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?: { [propertyName: string]: string }; + /** The geo-location where the resource lives */ + location: string; +} + +/** Azure Large Instance info on Azure (ARM properties and AzureLargeInstance properties) */ +export interface AzureLargeInstance extends TrackedResource { + /** Specifies the hardware settings for the Azure Large Instance. */ + hardwareProfile?: HardwareProfile; + /** Specifies the storage settings for the Azure Large Instance disks. */ + storageProfile?: StorageProfile; + /** Specifies the operating system settings for the Azure Large Instance. */ + osProfile?: OSProfile; + /** Specifies the network settings for the Azure Large Instance. */ + networkProfile?: NetworkProfile; + /** + * Specifies the Azure Large Instance unique ID. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly azureLargeInstanceId?: string; + /** + * Resource power state + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly powerState?: AzureLargeInstancePowerStateEnum; + /** + * Resource proximity placement group + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly proximityPlacementGroup?: string; + /** + * Hardware revision of an Azure Large Instance + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly hwRevision?: string; + /** ARM ID of another AzureLargeInstance that will share a network with this AzureLargeInstance */ + partnerNodeId?: string; + /** + * State of provisioning of the AzureLargeInstance + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly provisioningState?: AzureLargeInstanceProvisioningStatesEnum; +} + +/** AzureLargeStorageInstance info on Azure (ARM properties and AzureLargeStorageInstance properties) */ +export interface AzureLargeStorageInstance extends TrackedResource { + /** Specifies the AzureLargeStorageInstance unique ID. */ + azureLargeStorageInstanceUniqueIdentifier?: string; + /** Specifies the storage properties for the AzureLargeStorage instance. */ + storageProperties?: StorageProperties; +} + +/** Defines headers for AzureLargeInstance_start operation. */ +export interface AzureLargeInstanceStartHeaders { + /** URL to track the operation status of the Microsoft Azure Large Instance in the specified location. */ + location?: string; +} + +/** Defines headers for AzureLargeInstance_restart operation. */ +export interface AzureLargeInstanceRestartHeaders { + /** URL to track the operation status of the Microsoft Azure Large Instance in the specified location. */ + location?: string; +} + +/** Defines headers for AzureLargeInstance_shutdown operation. */ +export interface AzureLargeInstanceShutdownHeaders { + /** URL to track the operation status of the Microsoft Azure Large Instance in the specified location. */ + location?: string; +} + +/** Known values of {@link AzureLargeInstanceHardwareTypeNamesEnum} that the service accepts. */ +export enum KnownAzureLargeInstanceHardwareTypeNamesEnum { + /** CiscoUCS */ + CiscoUCS = "Cisco_UCS", + /** HPE */ + HPE = "HPE", + /** Sdflex */ + Sdflex = "SDFLEX" +} + +/** + * Defines values for AzureLargeInstanceHardwareTypeNamesEnum. \ + * {@link KnownAzureLargeInstanceHardwareTypeNamesEnum} can be used interchangeably with AzureLargeInstanceHardwareTypeNamesEnum, + * this enum contains the known values that the service supports. + * ### Known values supported by the service + * **Cisco_UCS** \ + * **HPE** \ + * **SDFLEX** + */ +export type AzureLargeInstanceHardwareTypeNamesEnum = string; + +/** Known values of {@link AzureLargeInstanceSizeNamesEnum} that the service accepts. */ +export enum KnownAzureLargeInstanceSizeNamesEnum { + /** S72M */ + S72M = "S72m", + /** S144M */ + S144M = "S144m", + /** S72 */ + S72 = "S72", + /** S144 */ + S144 = "S144", + /** S192 */ + S192 = "S192", + /** S192M */ + S192M = "S192m", + /** S192Xm */ + S192Xm = "S192xm", + /** S96 */ + S96 = "S96", + /** S112 */ + S112 = "S112", + /** S224 */ + S224 = "S224", + /** S224M */ + S224M = "S224m", + /** S224Om */ + S224Om = "S224om", + /** S224Oo */ + S224Oo = "S224oo", + /** S224Oom */ + S224Oom = "S224oom", + /** S224Ooo */ + S224Ooo = "S224ooo", + /** S224Se */ + S224Se = "S224se", + /** S384 */ + S384 = "S384", + /** S384M */ + S384M = "S384m", + /** S384Xm */ + S384Xm = "S384xm", + /** S384Xxm */ + S384Xxm = "S384xxm", + /** S448 */ + S448 = "S448", + /** S448M */ + S448M = "S448m", + /** S448Om */ + S448Om = "S448om", + /** S448Oo */ + S448Oo = "S448oo", + /** S448Oom */ + S448Oom = "S448oom", + /** S448Ooo */ + S448Ooo = "S448ooo", + /** S448Se */ + S448Se = "S448se", + /** S576M */ + S576M = "S576m", + /** S576Xm */ + S576Xm = "S576xm", + /** S672 */ + S672 = "S672", + /** S672M */ + S672M = "S672m", + /** S672Om */ + S672Om = "S672om", + /** S672Oo */ + S672Oo = "S672oo", + /** S672Oom */ + S672Oom = "S672oom", + /** S672Ooo */ + S672Ooo = "S672ooo", + /** S768 */ + S768 = "S768", + /** S768M */ + S768M = "S768m", + /** S768Xm */ + S768Xm = "S768xm", + /** S896 */ + S896 = "S896", + /** S896M */ + S896M = "S896m", + /** S896Om */ + S896Om = "S896om", + /** S896Oo */ + S896Oo = "S896oo", + /** S896Oom */ + S896Oom = "S896oom", + /** S896Ooo */ + S896Ooo = "S896ooo", + /** S960M */ + S960M = "S960m" +} + +/** + * Defines values for AzureLargeInstanceSizeNamesEnum. \ + * {@link KnownAzureLargeInstanceSizeNamesEnum} can be used interchangeably with AzureLargeInstanceSizeNamesEnum, + * this enum contains the known values that the service supports. + * ### Known values supported by the service + * **S72m** \ + * **S144m** \ + * **S72** \ + * **S144** \ + * **S192** \ + * **S192m** \ + * **S192xm** \ + * **S96** \ + * **S112** \ + * **S224** \ + * **S224m** \ + * **S224om** \ + * **S224oo** \ + * **S224oom** \ + * **S224ooo** \ + * **S224se** \ + * **S384** \ + * **S384m** \ + * **S384xm** \ + * **S384xxm** \ + * **S448** \ + * **S448m** \ + * **S448om** \ + * **S448oo** \ + * **S448oom** \ + * **S448ooo** \ + * **S448se** \ + * **S576m** \ + * **S576xm** \ + * **S672** \ + * **S672m** \ + * **S672om** \ + * **S672oo** \ + * **S672oom** \ + * **S672ooo** \ + * **S768** \ + * **S768m** \ + * **S768xm** \ + * **S896** \ + * **S896m** \ + * **S896om** \ + * **S896oo** \ + * **S896oom** \ + * **S896ooo** \ + * **S960m** + */ +export type AzureLargeInstanceSizeNamesEnum = string; + +/** Known values of {@link AzureLargeInstancePowerStateEnum} that the service accepts. */ +export enum KnownAzureLargeInstancePowerStateEnum { + /** Starting */ + Starting = "starting", + /** Started */ + Started = "started", + /** Stopping */ + Stopping = "stopping", + /** Stopped */ + Stopped = "stopped", + /** Restarting */ + Restarting = "restarting", + /** Unknown */ + Unknown = "unknown" +} + +/** + * Defines values for AzureLargeInstancePowerStateEnum. \ + * {@link KnownAzureLargeInstancePowerStateEnum} can be used interchangeably with AzureLargeInstancePowerStateEnum, + * this enum contains the known values that the service supports. + * ### Known values supported by the service + * **starting** \ + * **started** \ + * **stopping** \ + * **stopped** \ + * **restarting** \ + * **unknown** + */ +export type AzureLargeInstancePowerStateEnum = string; + +/** Known values of {@link AzureLargeInstanceProvisioningStatesEnum} that the service accepts. */ +export enum KnownAzureLargeInstanceProvisioningStatesEnum { + /** Accepted */ + Accepted = "Accepted", + /** Creating */ + Creating = "Creating", + /** Updating */ + Updating = "Updating", + /** Failed */ + Failed = "Failed", + /** Succeeded */ + Succeeded = "Succeeded", + /** Deleting */ + Deleting = "Deleting", + /** Migrating */ + Migrating = "Migrating", + /** Canceled */ + Canceled = "Canceled" +} + +/** + * Defines values for AzureLargeInstanceProvisioningStatesEnum. \ + * {@link KnownAzureLargeInstanceProvisioningStatesEnum} can be used interchangeably with AzureLargeInstanceProvisioningStatesEnum, + * this enum contains the known values that the service supports. + * ### Known values supported by the service + * **Accepted** \ + * **Creating** \ + * **Updating** \ + * **Failed** \ + * **Succeeded** \ + * **Deleting** \ + * **Migrating** \ + * **Canceled** + */ +export type AzureLargeInstanceProvisioningStatesEnum = string; + +/** Known values of {@link CreatedByType} that the service accepts. */ +export enum KnownCreatedByType { + /** User */ + User = "User", + /** Application */ + Application = "Application", + /** ManagedIdentity */ + ManagedIdentity = "ManagedIdentity", + /** Key */ + Key = "Key" +} + +/** + * Defines values for CreatedByType. \ + * {@link KnownCreatedByType} can be used interchangeably with CreatedByType, + * this enum contains the known values that the service supports. + * ### Known values supported by the service + * **User** \ + * **Application** \ + * **ManagedIdentity** \ + * **Key** + */ +export type CreatedByType = string; + +/** Known values of {@link AzureLargeInstanceForcePowerState} that the service accepts. */ +export enum KnownAzureLargeInstanceForcePowerState { + /** Active */ + Active = "active", + /** Inactive */ + Inactive = "inactive" +} + +/** + * Defines values for AzureLargeInstanceForcePowerState. \ + * {@link KnownAzureLargeInstanceForcePowerState} can be used interchangeably with AzureLargeInstanceForcePowerState, + * this enum contains the known values that the service supports. + * ### Known values supported by the service + * **active** \ + * **inactive** + */ +export type AzureLargeInstanceForcePowerState = string; + +/** Known values of {@link Origin} that the service accepts. */ +export enum KnownOrigin { + /** User */ + User = "user", + /** System */ + System = "system", + /** UserSystem */ + UserSystem = "user,system" +} + +/** + * Defines values for Origin. \ + * {@link KnownOrigin} can be used interchangeably with Origin, + * this enum contains the known values that the service supports. + * ### Known values supported by the service + * **user** \ + * **system** \ + * **user,system** + */ +export type Origin = string; + +/** Known values of {@link ActionType} that the service accepts. */ +export enum KnownActionType { + /** Internal */ + Internal = "Internal" +} + +/** + * Defines values for ActionType. \ + * {@link KnownActionType} can be used interchangeably with ActionType, + * this enum contains the known values that the service supports. + * ### Known values supported by the service + * **Internal** + */ +export type ActionType = string; + +/** Known values of {@link ProvisioningState} that the service accepts. */ +export enum KnownProvisioningState { + /** Accepted */ + Accepted = "Accepted", + /** Creating */ + Creating = "Creating", + /** Updating */ + Updating = "Updating", + /** Failed */ + Failed = "Failed", + /** Succeeded */ + Succeeded = "Succeeded", + /** Deleting */ + Deleting = "Deleting", + /** Canceled */ + Canceled = "Canceled", + /** Migrating */ + Migrating = "Migrating" +} + +/** + * Defines values for ProvisioningState. \ + * {@link KnownProvisioningState} can be used interchangeably with ProvisioningState, + * this enum contains the known values that the service supports. + * ### Known values supported by the service + * **Accepted** \ + * **Creating** \ + * **Updating** \ + * **Failed** \ + * **Succeeded** \ + * **Deleting** \ + * **Canceled** \ + * **Migrating** + */ +export type ProvisioningState = string; + +/** Optional parameters. */ +export interface ListBySubscriptionOptionalParams + extends coreClient.OperationOptions {} + +/** Contains response data for the listBySubscription operation. */ +export type ListBySubscriptionResponse = AzureLargeInstanceListResult; + +/** Optional parameters. */ +export interface ListByResourceGroupOptionalParams + extends coreClient.OperationOptions {} + +/** Contains response data for the listByResourceGroup operation. */ +export type ListByResourceGroupResponse = AzureLargeInstanceListResult; + +/** Optional parameters. */ +export interface StartOptionalParams extends coreClient.OperationOptions { + /** Delay to wait until next poll, in milliseconds. */ + updateIntervalInMs?: number; + /** A serialized poller which can be used to resume an existing paused Long-Running-Operation. */ + resumeFrom?: string; +} + +/** Contains response data for the start operation. */ +export type StartResponse = OperationStatusResult; + +/** Optional parameters. */ +export interface RestartOptionalParams extends coreClient.OperationOptions { + /** When set to 'active', this parameter empowers the server with the ability to forcefully terminate and halt any existing processes that may be running on the server */ + forceParameter?: ForceState; + /** Delay to wait until next poll, in milliseconds. */ + updateIntervalInMs?: number; + /** A serialized poller which can be used to resume an existing paused Long-Running-Operation. */ + resumeFrom?: string; +} + +/** Contains response data for the restart operation. */ +export type RestartResponse = OperationStatusResult; + +/** Optional parameters. */ +export interface ShutdownOptionalParams extends coreClient.OperationOptions { + /** Delay to wait until next poll, in milliseconds. */ + updateIntervalInMs?: number; + /** A serialized poller which can be used to resume an existing paused Long-Running-Operation. */ + resumeFrom?: string; +} + +/** Contains response data for the shutdown operation. */ +export type ShutdownResponse = OperationStatusResult; + +/** Optional parameters. */ +export interface GetOptionalParams extends coreClient.OperationOptions {} + +/** Contains response data for the get operation. */ +export type GetResponse = AzureLargeInstance; + +/** Optional parameters. */ +export interface UpdateOptionalParams extends coreClient.OperationOptions {} + +/** Contains response data for the update operation. */ +export type UpdateResponse = AzureLargeInstance; + +/** Optional parameters. */ +export interface ListBySubscriptionNextOptionalParams + extends coreClient.OperationOptions {} + +/** Contains response data for the listBySubscriptionNext operation. */ +export type ListBySubscriptionNextResponse = AzureLargeInstanceListResult; + +/** Optional parameters. */ +export interface ListByResourceGroupNextOptionalParams + extends coreClient.OperationOptions {} + +/** Contains response data for the listByResourceGroupNext operation. */ +export type ListByResourceGroupNextResponse = AzureLargeInstanceListResult; + +/** Optional parameters. */ +export interface OperationsListOptionalParams + extends coreClient.OperationOptions {} + +/** Contains response data for the list operation. */ +export type OperationsListResponse = OperationListResult; + +/** Optional parameters. */ +export interface OperationsListNextOptionalParams + extends coreClient.OperationOptions {} + +/** Contains response data for the listNext operation. */ +export type OperationsListNextResponse = OperationListResult; + +/** Optional parameters. */ +export interface AzureLargeStorageInstanceListBySubscriptionOptionalParams + extends coreClient.OperationOptions {} + +/** Contains response data for the listBySubscription operation. */ +export type AzureLargeStorageInstanceListBySubscriptionResponse = AzureLargeStorageInstanceListResult; + +/** Optional parameters. */ +export interface AzureLargeStorageInstanceListByResourceGroupOptionalParams + extends coreClient.OperationOptions {} + +/** Contains response data for the listByResourceGroup operation. */ +export type AzureLargeStorageInstanceListByResourceGroupResponse = AzureLargeStorageInstanceListResult; + +/** Optional parameters. */ +export interface AzureLargeStorageInstanceGetOptionalParams + extends coreClient.OperationOptions {} + +/** Contains response data for the get operation. */ +export type AzureLargeStorageInstanceGetResponse = AzureLargeStorageInstance; + +/** Optional parameters. */ +export interface AzureLargeStorageInstanceUpdateOptionalParams + extends coreClient.OperationOptions {} + +/** Contains response data for the update operation. */ +export type AzureLargeStorageInstanceUpdateResponse = AzureLargeStorageInstance; + +/** Optional parameters. */ +export interface AzureLargeStorageInstanceListBySubscriptionNextOptionalParams + extends coreClient.OperationOptions {} + +/** Contains response data for the listBySubscriptionNext operation. */ +export type AzureLargeStorageInstanceListBySubscriptionNextResponse = AzureLargeStorageInstanceListResult; + +/** Optional parameters. */ +export interface AzureLargeStorageInstanceListByResourceGroupNextOptionalParams + extends coreClient.OperationOptions {} + +/** Contains response data for the listByResourceGroupNext operation. */ +export type AzureLargeStorageInstanceListByResourceGroupNextResponse = AzureLargeStorageInstanceListResult; + +/** Optional parameters. */ +export interface AzureLargeInstanceOptionalParams + extends coreClient.ServiceClientOptions { + /** server parameter */ + $host?: string; + /** Api Version */ + apiVersion?: string; + /** Overrides client endpoint. */ + endpoint?: string; +} diff --git a/sdk/azurelargeinstance/arm-azurelargeinstance/src/models/mappers.ts b/sdk/azurelargeinstance/arm-azurelargeinstance/src/models/mappers.ts new file mode 100644 index 000000000000..8399de87b72e --- /dev/null +++ b/sdk/azurelargeinstance/arm-azurelargeinstance/src/models/mappers.ts @@ -0,0 +1,859 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +import * as coreClient from "@azure/core-client"; + +export const AzureLargeInstanceListResult: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "AzureLargeInstanceListResult", + modelProperties: { + value: { + serializedName: "value", + type: { + name: "Sequence", + element: { + type: { + name: "Composite", + className: "AzureLargeInstance" + } + } + } + }, + nextLink: { + serializedName: "nextLink", + type: { + name: "String" + } + } + } + } +}; + +export const HardwareProfile: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "HardwareProfile", + modelProperties: { + hardwareType: { + serializedName: "hardwareType", + readOnly: true, + type: { + name: "String" + } + }, + azureLargeInstanceSize: { + serializedName: "azureLargeInstanceSize", + readOnly: true, + type: { + name: "String" + } + } + } + } +}; + +export const StorageProfile: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "StorageProfile", + modelProperties: { + nfsIpAddress: { + serializedName: "nfsIpAddress", + readOnly: true, + type: { + name: "String" + } + }, + osDisks: { + serializedName: "osDisks", + type: { + name: "Sequence", + element: { + type: { + name: "Composite", + className: "Disk" + } + } + } + } + } + } +}; + +export const Disk: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "Disk", + modelProperties: { + name: { + serializedName: "name", + type: { + name: "String" + } + }, + diskSizeGB: { + serializedName: "diskSizeGB", + type: { + name: "Number" + } + }, + lun: { + serializedName: "lun", + readOnly: true, + type: { + name: "Number" + } + } + } + } +}; + +export const OSProfile: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "OSProfile", + modelProperties: { + computerName: { + serializedName: "computerName", + type: { + name: "String" + } + }, + osType: { + serializedName: "osType", + readOnly: true, + type: { + name: "String" + } + }, + version: { + serializedName: "version", + readOnly: true, + type: { + name: "String" + } + }, + sshPublicKey: { + serializedName: "sshPublicKey", + type: { + name: "String" + } + } + } + } +}; + +export const NetworkProfile: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "NetworkProfile", + modelProperties: { + networkInterfaces: { + serializedName: "networkInterfaces", + type: { + name: "Sequence", + element: { + type: { + name: "Composite", + className: "IpAddress" + } + } + } + }, + circuitId: { + serializedName: "circuitId", + readOnly: true, + type: { + name: "String" + } + } + } + } +}; + +export const IpAddress: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "IpAddress", + modelProperties: { + ipAddress: { + serializedName: "ipAddress", + type: { + name: "String" + } + } + } + } +}; + +export const Resource: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "Resource", + modelProperties: { + id: { + serializedName: "id", + readOnly: true, + type: { + name: "String" + } + }, + name: { + serializedName: "name", + readOnly: true, + type: { + name: "String" + } + }, + type: { + serializedName: "type", + readOnly: true, + type: { + name: "String" + } + }, + systemData: { + serializedName: "systemData", + type: { + name: "Composite", + className: "SystemData" + } + } + } + } +}; + +export const SystemData: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "SystemData", + modelProperties: { + createdBy: { + serializedName: "createdBy", + type: { + name: "String" + } + }, + createdByType: { + serializedName: "createdByType", + type: { + name: "String" + } + }, + createdAt: { + serializedName: "createdAt", + type: { + name: "DateTime" + } + }, + lastModifiedBy: { + serializedName: "lastModifiedBy", + type: { + name: "String" + } + }, + lastModifiedByType: { + serializedName: "lastModifiedByType", + type: { + name: "String" + } + }, + lastModifiedAt: { + serializedName: "lastModifiedAt", + type: { + name: "DateTime" + } + } + } + } +}; + +export const ErrorResponse: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "ErrorResponse", + modelProperties: { + error: { + serializedName: "error", + type: { + name: "Composite", + className: "ErrorDetail" + } + } + } + } +}; + +export const ErrorDetail: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "ErrorDetail", + modelProperties: { + code: { + serializedName: "code", + readOnly: true, + type: { + name: "String" + } + }, + message: { + serializedName: "message", + readOnly: true, + type: { + name: "String" + } + }, + target: { + serializedName: "target", + readOnly: true, + type: { + name: "String" + } + }, + details: { + serializedName: "details", + readOnly: true, + type: { + name: "Sequence", + element: { + type: { + name: "Composite", + className: "ErrorDetail" + } + } + } + }, + additionalInfo: { + serializedName: "additionalInfo", + readOnly: true, + type: { + name: "Sequence", + element: { + type: { + name: "Composite", + className: "ErrorAdditionalInfo" + } + } + } + } + } + } +}; + +export const ErrorAdditionalInfo: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "ErrorAdditionalInfo", + modelProperties: { + type: { + serializedName: "type", + readOnly: true, + type: { + name: "String" + } + }, + info: { + serializedName: "info", + readOnly: true, + type: { + name: "Dictionary", + value: { type: { name: "any" } } + } + } + } + } +}; + +export const OperationStatusResult: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "OperationStatusResult", + modelProperties: { + id: { + serializedName: "id", + type: { + name: "String" + } + }, + resourceId: { + serializedName: "resourceId", + readOnly: true, + type: { + name: "String" + } + }, + name: { + serializedName: "name", + type: { + name: "String" + } + }, + status: { + serializedName: "status", + required: true, + type: { + name: "String" + } + }, + percentComplete: { + constraints: { + InclusiveMaximum: 100, + InclusiveMinimum: 0 + }, + serializedName: "percentComplete", + type: { + name: "Number" + } + }, + startTime: { + serializedName: "startTime", + type: { + name: "DateTime" + } + }, + endTime: { + serializedName: "endTime", + type: { + name: "DateTime" + } + }, + operations: { + serializedName: "operations", + type: { + name: "Sequence", + element: { + type: { + name: "Composite", + className: "OperationStatusResult" + } + } + } + }, + error: { + serializedName: "error", + type: { + name: "Composite", + className: "ErrorDetail" + } + } + } + } +}; + +export const ForceState: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "ForceState", + modelProperties: { + forceState: { + serializedName: "forceState", + type: { + name: "String" + } + } + } + } +}; + +export const OperationListResult: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "OperationListResult", + modelProperties: { + value: { + serializedName: "value", + readOnly: true, + type: { + name: "Sequence", + element: { + type: { + name: "Composite", + className: "Operation" + } + } + } + }, + nextLink: { + serializedName: "nextLink", + readOnly: true, + type: { + name: "String" + } + } + } + } +}; + +export const Operation: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "Operation", + modelProperties: { + name: { + serializedName: "name", + readOnly: true, + type: { + name: "String" + } + }, + isDataAction: { + serializedName: "isDataAction", + readOnly: true, + type: { + name: "Boolean" + } + }, + display: { + serializedName: "display", + type: { + name: "Composite", + className: "OperationDisplay" + } + }, + origin: { + serializedName: "origin", + readOnly: true, + type: { + name: "String" + } + }, + actionType: { + serializedName: "actionType", + readOnly: true, + type: { + name: "String" + } + } + } + } +}; + +export const OperationDisplay: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "OperationDisplay", + modelProperties: { + provider: { + serializedName: "provider", + readOnly: true, + type: { + name: "String" + } + }, + resource: { + serializedName: "resource", + readOnly: true, + type: { + name: "String" + } + }, + operation: { + serializedName: "operation", + readOnly: true, + type: { + name: "String" + } + }, + description: { + serializedName: "description", + readOnly: true, + type: { + name: "String" + } + } + } + } +}; + +export const Tags: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "Tags", + modelProperties: { + tags: { + serializedName: "tags", + type: { + name: "Dictionary", + value: { type: { name: "String" } } + } + } + } + } +}; + +export const AzureLargeStorageInstanceListResult: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "AzureLargeStorageInstanceListResult", + modelProperties: { + value: { + serializedName: "value", + type: { + name: "Sequence", + element: { + type: { + name: "Composite", + className: "AzureLargeStorageInstance" + } + } + } + }, + nextLink: { + serializedName: "nextLink", + type: { + name: "String" + } + } + } + } +}; + +export const StorageProperties: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "StorageProperties", + modelProperties: { + provisioningState: { + serializedName: "provisioningState", + type: { + name: "String" + } + }, + offeringType: { + serializedName: "offeringType", + type: { + name: "String" + } + }, + storageType: { + serializedName: "storageType", + type: { + name: "String" + } + }, + generation: { + serializedName: "generation", + type: { + name: "String" + } + }, + hardwareType: { + serializedName: "hardwareType", + type: { + name: "String" + } + }, + workloadType: { + serializedName: "workloadType", + type: { + name: "String" + } + }, + storageBillingProperties: { + serializedName: "storageBillingProperties", + type: { + name: "Composite", + className: "StorageBillingProperties" + } + } + } + } +}; + +export const StorageBillingProperties: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "StorageBillingProperties", + modelProperties: { + billingMode: { + serializedName: "billingMode", + type: { + name: "String" + } + }, + sku: { + serializedName: "sku", + type: { + name: "String" + } + } + } + } +}; + +export const TrackedResource: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "TrackedResource", + modelProperties: { + ...Resource.type.modelProperties, + tags: { + serializedName: "tags", + type: { + name: "Dictionary", + value: { type: { name: "String" } } + } + }, + location: { + serializedName: "location", + required: true, + type: { + name: "String" + } + } + } + } +}; + +export const AzureLargeInstance: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "AzureLargeInstance", + modelProperties: { + ...TrackedResource.type.modelProperties, + hardwareProfile: { + serializedName: "properties.hardwareProfile", + type: { + name: "Composite", + className: "HardwareProfile" + } + }, + storageProfile: { + serializedName: "properties.storageProfile", + type: { + name: "Composite", + className: "StorageProfile" + } + }, + osProfile: { + serializedName: "properties.osProfile", + type: { + name: "Composite", + className: "OSProfile" + } + }, + networkProfile: { + serializedName: "properties.networkProfile", + type: { + name: "Composite", + className: "NetworkProfile" + } + }, + azureLargeInstanceId: { + serializedName: "properties.azureLargeInstanceId", + readOnly: true, + type: { + name: "String" + } + }, + powerState: { + serializedName: "properties.powerState", + readOnly: true, + type: { + name: "String" + } + }, + proximityPlacementGroup: { + serializedName: "properties.proximityPlacementGroup", + readOnly: true, + type: { + name: "String" + } + }, + hwRevision: { + serializedName: "properties.hwRevision", + readOnly: true, + type: { + name: "String" + } + }, + partnerNodeId: { + serializedName: "properties.partnerNodeId", + type: { + name: "String" + } + }, + provisioningState: { + serializedName: "properties.provisioningState", + readOnly: true, + type: { + name: "String" + } + } + } + } +}; + +export const AzureLargeStorageInstance: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "AzureLargeStorageInstance", + modelProperties: { + ...TrackedResource.type.modelProperties, + azureLargeStorageInstanceUniqueIdentifier: { + serializedName: "properties.azureLargeStorageInstanceUniqueIdentifier", + type: { + name: "String" + } + }, + storageProperties: { + serializedName: "properties.storageProperties", + type: { + name: "Composite", + className: "StorageProperties" + } + } + } + } +}; + +export const AzureLargeInstanceStartHeaders: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "AzureLargeInstanceStartHeaders", + modelProperties: { + location: { + serializedName: "location", + type: { + name: "String" + } + } + } + } +}; + +export const AzureLargeInstanceRestartHeaders: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "AzureLargeInstanceRestartHeaders", + modelProperties: { + location: { + serializedName: "location", + type: { + name: "String" + } + } + } + } +}; + +export const AzureLargeInstanceShutdownHeaders: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "AzureLargeInstanceShutdownHeaders", + modelProperties: { + location: { + serializedName: "location", + type: { + name: "String" + } + } + } + } +}; diff --git a/sdk/azurelargeinstance/arm-azurelargeinstance/src/models/parameters.ts b/sdk/azurelargeinstance/arm-azurelargeinstance/src/models/parameters.ts new file mode 100644 index 000000000000..1bfcb862886d --- /dev/null +++ b/sdk/azurelargeinstance/arm-azurelargeinstance/src/models/parameters.ts @@ -0,0 +1,141 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +import { + OperationParameter, + OperationURLParameter, + OperationQueryParameter +} from "@azure/core-client"; +import { + ForceState as ForceStateMapper, + Tags as TagsMapper +} from "../models/mappers"; + +export const accept: OperationParameter = { + parameterPath: "accept", + mapper: { + defaultValue: "application/json", + isConstant: true, + serializedName: "Accept", + type: { + name: "String" + } + } +}; + +export const $host: OperationURLParameter = { + parameterPath: "$host", + mapper: { + serializedName: "$host", + required: true, + type: { + name: "String" + } + }, + skipEncoding: true +}; + +export const apiVersion: OperationQueryParameter = { + parameterPath: "apiVersion", + mapper: { + defaultValue: "2023-07-20-preview", + isConstant: true, + serializedName: "api-version", + type: { + name: "String" + } + } +}; + +export const subscriptionId: OperationURLParameter = { + parameterPath: "subscriptionId", + mapper: { + serializedName: "subscriptionId", + required: true, + type: { + name: "Uuid" + } + } +}; + +export const resourceGroupName: OperationURLParameter = { + parameterPath: "resourceGroupName", + mapper: { + constraints: { + MaxLength: 90, + MinLength: 1 + }, + serializedName: "resourceGroupName", + required: true, + type: { + name: "String" + } + } +}; + +export const azureLargeInstanceName: OperationURLParameter = { + parameterPath: "azureLargeInstanceName", + mapper: { + constraints: { + Pattern: new RegExp(".*") + }, + serializedName: "azureLargeInstanceName", + required: true, + type: { + name: "String" + } + } +}; + +export const contentType: OperationParameter = { + parameterPath: ["options", "contentType"], + mapper: { + defaultValue: "application/json", + isConstant: true, + serializedName: "Content-Type", + type: { + name: "String" + } + } +}; + +export const forceParameter: OperationParameter = { + parameterPath: ["options", "forceParameter"], + mapper: ForceStateMapper +}; + +export const tagsParameter: OperationParameter = { + parameterPath: "tagsParameter", + mapper: TagsMapper +}; + +export const nextLink: OperationURLParameter = { + parameterPath: "nextLink", + mapper: { + serializedName: "nextLink", + required: true, + type: { + name: "String" + } + }, + skipEncoding: true +}; + +export const azureLargeStorageInstanceName: OperationURLParameter = { + parameterPath: "azureLargeStorageInstanceName", + mapper: { + constraints: { + Pattern: new RegExp(".*") + }, + serializedName: "azureLargeStorageInstanceName", + required: true, + type: { + name: "String" + } + } +}; diff --git a/sdk/azurelargeinstance/arm-azurelargeinstance/src/operations/azureLargeInstanceOperations.ts b/sdk/azurelargeinstance/arm-azurelargeinstance/src/operations/azureLargeInstanceOperations.ts new file mode 100644 index 000000000000..5f7e0fcc7df1 --- /dev/null +++ b/sdk/azurelargeinstance/arm-azurelargeinstance/src/operations/azureLargeInstanceOperations.ts @@ -0,0 +1,765 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +import { PagedAsyncIterableIterator, PageSettings } from "@azure/core-paging"; +import { setContinuationToken } from "../pagingHelper"; +import { AzureLargeInstanceOperations } from "../operationsInterfaces"; +import * as coreClient from "@azure/core-client"; +import * as Mappers from "../models/mappers"; +import * as Parameters from "../models/parameters"; +import { AzureLargeInstance } from "../azureLargeInstance"; +import { + SimplePollerLike, + OperationState, + createHttpPoller +} from "@azure/core-lro"; +import { createLroSpec } from "../lroImpl"; +import { + AzureLargeInstance, + ListBySubscriptionNextOptionalParams, + ListBySubscriptionOptionalParams, + ListBySubscriptionResponse, + ListByResourceGroupNextOptionalParams, + ListByResourceGroupOptionalParams, + ListByResourceGroupResponse, + StartOptionalParams, + StartResponse, + RestartOptionalParams, + RestartResponse, + ShutdownOptionalParams, + ShutdownResponse, + GetOptionalParams, + GetResponse, + Tags, + UpdateOptionalParams, + UpdateResponse, + ListBySubscriptionNextResponse, + ListByResourceGroupNextResponse +} from "../models"; + +/// +/** Class containing AzureLargeInstanceOperations operations. */ +export class AzureLargeInstanceOperationsImpl + implements AzureLargeInstanceOperations { + private readonly client: AzureLargeInstance; + + /** + * Initialize a new instance of the class AzureLargeInstanceOperations class. + * @param client Reference to the service client + */ + constructor(client: AzureLargeInstance) { + this.client = client; + } + + /** + * Gets a list of Azure Large Instances in the specified subscription. The operations returns various + * properties of each Azure Large Instance. + * @param options The options parameters. + */ + public listBySubscription( + options?: ListBySubscriptionOptionalParams + ): PagedAsyncIterableIterator { + const iter = this.listBySubscriptionPagingAll(options); + return { + next() { + return iter.next(); + }, + [Symbol.asyncIterator]() { + return this; + }, + byPage: (settings?: PageSettings) => { + if (settings?.maxPageSize) { + throw new Error("maxPageSize is not supported by this operation."); + } + return this.listBySubscriptionPagingPage(options, settings); + } + }; + } + + private async *listBySubscriptionPagingPage( + options?: ListBySubscriptionOptionalParams, + settings?: PageSettings + ): AsyncIterableIterator { + let result: ListBySubscriptionResponse; + let continuationToken = settings?.continuationToken; + if (!continuationToken) { + result = await this._listBySubscription(options); + let page = result.value || []; + continuationToken = result.nextLink; + setContinuationToken(page, continuationToken); + yield page; + } + while (continuationToken) { + result = await this._listBySubscriptionNext(continuationToken, options); + continuationToken = result.nextLink; + let page = result.value || []; + setContinuationToken(page, continuationToken); + yield page; + } + } + + private async *listBySubscriptionPagingAll( + options?: ListBySubscriptionOptionalParams + ): AsyncIterableIterator { + for await (const page of this.listBySubscriptionPagingPage(options)) { + yield* page; + } + } + + /** + * Gets a list of Azure Large Instances in the specified subscription and resource group. The + * operations returns various properties of each Azure Large Instance. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param options The options parameters. + */ + public listByResourceGroup( + resourceGroupName: string, + options?: ListByResourceGroupOptionalParams + ): PagedAsyncIterableIterator { + const iter = this.listByResourceGroupPagingAll(resourceGroupName, options); + return { + next() { + return iter.next(); + }, + [Symbol.asyncIterator]() { + return this; + }, + byPage: (settings?: PageSettings) => { + if (settings?.maxPageSize) { + throw new Error("maxPageSize is not supported by this operation."); + } + return this.listByResourceGroupPagingPage( + resourceGroupName, + options, + settings + ); + } + }; + } + + private async *listByResourceGroupPagingPage( + resourceGroupName: string, + options?: ListByResourceGroupOptionalParams, + settings?: PageSettings + ): AsyncIterableIterator { + let result: ListByResourceGroupResponse; + let continuationToken = settings?.continuationToken; + if (!continuationToken) { + result = await this._listByResourceGroup(resourceGroupName, options); + let page = result.value || []; + continuationToken = result.nextLink; + setContinuationToken(page, continuationToken); + yield page; + } + while (continuationToken) { + result = await this._listByResourceGroupNext( + resourceGroupName, + continuationToken, + options + ); + continuationToken = result.nextLink; + let page = result.value || []; + setContinuationToken(page, continuationToken); + yield page; + } + } + + private async *listByResourceGroupPagingAll( + resourceGroupName: string, + options?: ListByResourceGroupOptionalParams + ): AsyncIterableIterator { + for await (const page of this.listByResourceGroupPagingPage( + resourceGroupName, + options + )) { + yield* page; + } + } + + /** + * Gets a list of Azure Large Instances in the specified subscription. The operations returns various + * properties of each Azure Large Instance. + * @param options The options parameters. + */ + private _listBySubscription( + options?: ListBySubscriptionOptionalParams + ): Promise { + return this.client.sendOperationRequest( + { options }, + listBySubscriptionOperationSpec + ); + } + + /** + * Gets a list of Azure Large Instances in the specified subscription and resource group. The + * operations returns various properties of each Azure Large Instance. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param options The options parameters. + */ + private _listByResourceGroup( + resourceGroupName: string, + options?: ListByResourceGroupOptionalParams + ): Promise { + return this.client.sendOperationRequest( + { resourceGroupName, options }, + listByResourceGroupOperationSpec + ); + } + + /** + * The operation to start an Azure Large Instance (only for compute instances) + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param azureLargeInstanceName Name of the AzureLargeInstance. + * @param options The options parameters. + */ + async beginStart( + resourceGroupName: string, + azureLargeInstanceName: string, + options?: StartOptionalParams + ): Promise, StartResponse>> { + const directSendOperation = async ( + args: coreClient.OperationArguments, + spec: coreClient.OperationSpec + ): Promise => { + return this.client.sendOperationRequest(args, spec); + }; + const sendOperationFn = async ( + args: coreClient.OperationArguments, + spec: coreClient.OperationSpec + ) => { + let currentRawResponse: + | coreClient.FullOperationResponse + | undefined = undefined; + const providedCallback = args.options?.onResponse; + const callback: coreClient.RawResponseCallback = ( + rawResponse: coreClient.FullOperationResponse, + flatResponse: unknown + ) => { + currentRawResponse = rawResponse; + providedCallback?.(rawResponse, flatResponse); + }; + const updatedArgs = { + ...args, + options: { + ...args.options, + onResponse: callback + } + }; + const flatResponse = await directSendOperation(updatedArgs, spec); + return { + flatResponse, + rawResponse: { + statusCode: currentRawResponse!.status, + body: currentRawResponse!.parsedBody, + headers: currentRawResponse!.headers.toJSON() + } + }; + }; + + const lro = createLroSpec({ + sendOperationFn, + args: { resourceGroupName, azureLargeInstanceName, options }, + spec: startOperationSpec + }); + const poller = await createHttpPoller< + StartResponse, + OperationState + >(lro, { + restoreFrom: options?.resumeFrom, + intervalInMs: options?.updateIntervalInMs, + resourceLocationConfig: "location" + }); + await poller.poll(); + return poller; + } + + /** + * The operation to start an Azure Large Instance (only for compute instances) + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param azureLargeInstanceName Name of the AzureLargeInstance. + * @param options The options parameters. + */ + async beginStartAndWait( + resourceGroupName: string, + azureLargeInstanceName: string, + options?: StartOptionalParams + ): Promise { + const poller = await this.beginStart( + resourceGroupName, + azureLargeInstanceName, + options + ); + return poller.pollUntilDone(); + } + + /** + * The operation to restart an Azure Large Instance (only for compute instances) + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param azureLargeInstanceName Name of the AzureLargeInstance. + * @param options The options parameters. + */ + async beginRestart( + resourceGroupName: string, + azureLargeInstanceName: string, + options?: RestartOptionalParams + ): Promise< + SimplePollerLike, RestartResponse> + > { + const directSendOperation = async ( + args: coreClient.OperationArguments, + spec: coreClient.OperationSpec + ): Promise => { + return this.client.sendOperationRequest(args, spec); + }; + const sendOperationFn = async ( + args: coreClient.OperationArguments, + spec: coreClient.OperationSpec + ) => { + let currentRawResponse: + | coreClient.FullOperationResponse + | undefined = undefined; + const providedCallback = args.options?.onResponse; + const callback: coreClient.RawResponseCallback = ( + rawResponse: coreClient.FullOperationResponse, + flatResponse: unknown + ) => { + currentRawResponse = rawResponse; + providedCallback?.(rawResponse, flatResponse); + }; + const updatedArgs = { + ...args, + options: { + ...args.options, + onResponse: callback + } + }; + const flatResponse = await directSendOperation(updatedArgs, spec); + return { + flatResponse, + rawResponse: { + statusCode: currentRawResponse!.status, + body: currentRawResponse!.parsedBody, + headers: currentRawResponse!.headers.toJSON() + } + }; + }; + + const lro = createLroSpec({ + sendOperationFn, + args: { resourceGroupName, azureLargeInstanceName, options }, + spec: restartOperationSpec + }); + const poller = await createHttpPoller< + RestartResponse, + OperationState + >(lro, { + restoreFrom: options?.resumeFrom, + intervalInMs: options?.updateIntervalInMs, + resourceLocationConfig: "location" + }); + await poller.poll(); + return poller; + } + + /** + * The operation to restart an Azure Large Instance (only for compute instances) + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param azureLargeInstanceName Name of the AzureLargeInstance. + * @param options The options parameters. + */ + async beginRestartAndWait( + resourceGroupName: string, + azureLargeInstanceName: string, + options?: RestartOptionalParams + ): Promise { + const poller = await this.beginRestart( + resourceGroupName, + azureLargeInstanceName, + options + ); + return poller.pollUntilDone(); + } + + /** + * The operation to shutdown an Azure Large Instance (only for compute instances) + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param azureLargeInstanceName Name of the AzureLargeInstance. + * @param options The options parameters. + */ + async beginShutdown( + resourceGroupName: string, + azureLargeInstanceName: string, + options?: ShutdownOptionalParams + ): Promise< + SimplePollerLike, ShutdownResponse> + > { + const directSendOperation = async ( + args: coreClient.OperationArguments, + spec: coreClient.OperationSpec + ): Promise => { + return this.client.sendOperationRequest(args, spec); + }; + const sendOperationFn = async ( + args: coreClient.OperationArguments, + spec: coreClient.OperationSpec + ) => { + let currentRawResponse: + | coreClient.FullOperationResponse + | undefined = undefined; + const providedCallback = args.options?.onResponse; + const callback: coreClient.RawResponseCallback = ( + rawResponse: coreClient.FullOperationResponse, + flatResponse: unknown + ) => { + currentRawResponse = rawResponse; + providedCallback?.(rawResponse, flatResponse); + }; + const updatedArgs = { + ...args, + options: { + ...args.options, + onResponse: callback + } + }; + const flatResponse = await directSendOperation(updatedArgs, spec); + return { + flatResponse, + rawResponse: { + statusCode: currentRawResponse!.status, + body: currentRawResponse!.parsedBody, + headers: currentRawResponse!.headers.toJSON() + } + }; + }; + + const lro = createLroSpec({ + sendOperationFn, + args: { resourceGroupName, azureLargeInstanceName, options }, + spec: shutdownOperationSpec + }); + const poller = await createHttpPoller< + ShutdownResponse, + OperationState + >(lro, { + restoreFrom: options?.resumeFrom, + intervalInMs: options?.updateIntervalInMs, + resourceLocationConfig: "location" + }); + await poller.poll(); + return poller; + } + + /** + * The operation to shutdown an Azure Large Instance (only for compute instances) + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param azureLargeInstanceName Name of the AzureLargeInstance. + * @param options The options parameters. + */ + async beginShutdownAndWait( + resourceGroupName: string, + azureLargeInstanceName: string, + options?: ShutdownOptionalParams + ): Promise { + const poller = await this.beginShutdown( + resourceGroupName, + azureLargeInstanceName, + options + ); + return poller.pollUntilDone(); + } + + /** + * Gets an Azure Large Instance for the specified subscription, resource group, and instance name. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param azureLargeInstanceName Name of the AzureLargeInstance. + * @param options The options parameters. + */ + get( + resourceGroupName: string, + azureLargeInstanceName: string, + options?: GetOptionalParams + ): Promise { + return this.client.sendOperationRequest( + { resourceGroupName, azureLargeInstanceName, options }, + getOperationSpec + ); + } + + /** + * Patches the Tags field of an Azure Large Instance for the specified subscription, resource group, + * and instance name. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param azureLargeInstanceName Name of the AzureLargeInstance. + * @param tagsParameter Request body that only contains the new Tags field + * @param options The options parameters. + */ + update( + resourceGroupName: string, + azureLargeInstanceName: string, + tagsParameter: Tags, + options?: UpdateOptionalParams + ): Promise { + return this.client.sendOperationRequest( + { resourceGroupName, azureLargeInstanceName, tagsParameter, options }, + updateOperationSpec + ); + } + + /** + * ListBySubscriptionNext + * @param nextLink The nextLink from the previous successful call to the ListBySubscription method. + * @param options The options parameters. + */ + private _listBySubscriptionNext( + nextLink: string, + options?: ListBySubscriptionNextOptionalParams + ): Promise { + return this.client.sendOperationRequest( + { nextLink, options }, + listBySubscriptionNextOperationSpec + ); + } + + /** + * ListByResourceGroupNext + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param nextLink The nextLink from the previous successful call to the ListByResourceGroup method. + * @param options The options parameters. + */ + private _listByResourceGroupNext( + resourceGroupName: string, + nextLink: string, + options?: ListByResourceGroupNextOptionalParams + ): Promise { + return this.client.sendOperationRequest( + { resourceGroupName, nextLink, options }, + listByResourceGroupNextOperationSpec + ); + } +} +// Operation Specifications +const serializer = coreClient.createSerializer(Mappers, /* isXml */ false); + +const listBySubscriptionOperationSpec: coreClient.OperationSpec = { + path: + "/subscriptions/{subscriptionId}/providers/Microsoft.AzureLargeInstance/azureLargeInstances", + httpMethod: "GET", + responses: { + 200: { + bodyMapper: Mappers.AzureLargeInstanceListResult + }, + default: { + bodyMapper: Mappers.ErrorResponse + } + }, + queryParameters: [Parameters.apiVersion], + urlParameters: [Parameters.$host, Parameters.subscriptionId], + headerParameters: [Parameters.accept], + serializer +}; +const listByResourceGroupOperationSpec: coreClient.OperationSpec = { + path: + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureLargeInstance/azureLargeInstances", + httpMethod: "GET", + responses: { + 200: { + bodyMapper: Mappers.AzureLargeInstanceListResult + }, + default: { + bodyMapper: Mappers.ErrorResponse + } + }, + queryParameters: [Parameters.apiVersion], + urlParameters: [ + Parameters.$host, + Parameters.subscriptionId, + Parameters.resourceGroupName + ], + headerParameters: [Parameters.accept], + serializer +}; +const startOperationSpec: coreClient.OperationSpec = { + path: + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureLargeInstance/azureLargeInstances/{azureLargeInstanceName}/start", + httpMethod: "POST", + responses: { + 200: { + bodyMapper: Mappers.OperationStatusResult + }, + 201: { + bodyMapper: Mappers.OperationStatusResult + }, + 202: { + bodyMapper: Mappers.OperationStatusResult + }, + 204: { + bodyMapper: Mappers.OperationStatusResult + }, + default: { + bodyMapper: Mappers.ErrorResponse + } + }, + queryParameters: [Parameters.apiVersion], + urlParameters: [ + Parameters.$host, + Parameters.subscriptionId, + Parameters.resourceGroupName, + Parameters.azureLargeInstanceName + ], + headerParameters: [Parameters.accept], + serializer +}; +const restartOperationSpec: coreClient.OperationSpec = { + path: + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureLargeInstance/azureLargeInstances/{azureLargeInstanceName}/restart", + httpMethod: "POST", + responses: { + 200: { + bodyMapper: Mappers.OperationStatusResult + }, + 201: { + bodyMapper: Mappers.OperationStatusResult + }, + 202: { + bodyMapper: Mappers.OperationStatusResult + }, + 204: { + bodyMapper: Mappers.OperationStatusResult + }, + default: { + bodyMapper: Mappers.ErrorResponse + } + }, + requestBody: Parameters.forceParameter, + queryParameters: [Parameters.apiVersion], + urlParameters: [ + Parameters.$host, + Parameters.subscriptionId, + Parameters.resourceGroupName, + Parameters.azureLargeInstanceName + ], + headerParameters: [Parameters.accept, Parameters.contentType], + mediaType: "json", + serializer +}; +const shutdownOperationSpec: coreClient.OperationSpec = { + path: + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureLargeInstance/azureLargeInstances/{azureLargeInstanceName}/shutdown", + httpMethod: "POST", + responses: { + 200: { + bodyMapper: Mappers.OperationStatusResult + }, + 201: { + bodyMapper: Mappers.OperationStatusResult + }, + 202: { + bodyMapper: Mappers.OperationStatusResult + }, + 204: { + bodyMapper: Mappers.OperationStatusResult + }, + default: { + bodyMapper: Mappers.ErrorResponse + } + }, + queryParameters: [Parameters.apiVersion], + urlParameters: [ + Parameters.$host, + Parameters.subscriptionId, + Parameters.resourceGroupName, + Parameters.azureLargeInstanceName + ], + headerParameters: [Parameters.accept], + serializer +}; +const getOperationSpec: coreClient.OperationSpec = { + path: + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureLargeInstance/azureLargeInstances/{azureLargeInstanceName}", + httpMethod: "GET", + responses: { + 200: { + bodyMapper: Mappers.AzureLargeInstance + }, + default: { + bodyMapper: Mappers.ErrorResponse + } + }, + queryParameters: [Parameters.apiVersion], + urlParameters: [ + Parameters.$host, + Parameters.subscriptionId, + Parameters.resourceGroupName, + Parameters.azureLargeInstanceName + ], + headerParameters: [Parameters.accept], + serializer +}; +const updateOperationSpec: coreClient.OperationSpec = { + path: + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureLargeInstance/azureLargeInstances/{azureLargeInstanceName}", + httpMethod: "PATCH", + responses: { + 200: { + bodyMapper: Mappers.AzureLargeInstance + }, + default: { + bodyMapper: Mappers.ErrorResponse + } + }, + requestBody: Parameters.tagsParameter, + queryParameters: [Parameters.apiVersion], + urlParameters: [ + Parameters.$host, + Parameters.subscriptionId, + Parameters.resourceGroupName, + Parameters.azureLargeInstanceName + ], + headerParameters: [Parameters.accept, Parameters.contentType], + mediaType: "json", + serializer +}; +const listBySubscriptionNextOperationSpec: coreClient.OperationSpec = { + path: "{nextLink}", + httpMethod: "GET", + responses: { + 200: { + bodyMapper: Mappers.AzureLargeInstanceListResult + }, + default: { + bodyMapper: Mappers.ErrorResponse + } + }, + urlParameters: [ + Parameters.$host, + Parameters.subscriptionId, + Parameters.nextLink + ], + headerParameters: [Parameters.accept], + serializer +}; +const listByResourceGroupNextOperationSpec: coreClient.OperationSpec = { + path: "{nextLink}", + httpMethod: "GET", + responses: { + 200: { + bodyMapper: Mappers.AzureLargeInstanceListResult + }, + default: { + bodyMapper: Mappers.ErrorResponse + } + }, + urlParameters: [ + Parameters.$host, + Parameters.subscriptionId, + Parameters.resourceGroupName, + Parameters.nextLink + ], + headerParameters: [Parameters.accept], + serializer +}; diff --git a/sdk/azurelargeinstance/arm-azurelargeinstance/src/operations/azureLargeStorageInstanceOperations.ts b/sdk/azurelargeinstance/arm-azurelargeinstance/src/operations/azureLargeStorageInstanceOperations.ts new file mode 100644 index 000000000000..0a7c19c1a0a7 --- /dev/null +++ b/sdk/azurelargeinstance/arm-azurelargeinstance/src/operations/azureLargeStorageInstanceOperations.ts @@ -0,0 +1,402 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +import { PagedAsyncIterableIterator, PageSettings } from "@azure/core-paging"; +import { setContinuationToken } from "../pagingHelper"; +import { AzureLargeStorageInstanceOperations } from "../operationsInterfaces"; +import * as coreClient from "@azure/core-client"; +import * as Mappers from "../models/mappers"; +import * as Parameters from "../models/parameters"; +import { AzureLargeInstance } from "../azureLargeInstance"; +import { + AzureLargeStorageInstance, + AzureLargeStorageInstanceListBySubscriptionNextOptionalParams, + AzureLargeStorageInstanceListBySubscriptionOptionalParams, + AzureLargeStorageInstanceListBySubscriptionResponse, + AzureLargeStorageInstanceListByResourceGroupNextOptionalParams, + AzureLargeStorageInstanceListByResourceGroupOptionalParams, + AzureLargeStorageInstanceListByResourceGroupResponse, + AzureLargeStorageInstanceGetOptionalParams, + AzureLargeStorageInstanceGetResponse, + Tags, + AzureLargeStorageInstanceUpdateOptionalParams, + AzureLargeStorageInstanceUpdateResponse, + AzureLargeStorageInstanceListBySubscriptionNextResponse, + AzureLargeStorageInstanceListByResourceGroupNextResponse +} from "../models"; + +/// +/** Class containing AzureLargeStorageInstanceOperations operations. */ +export class AzureLargeStorageInstanceOperationsImpl + implements AzureLargeStorageInstanceOperations { + private readonly client: AzureLargeInstance; + + /** + * Initialize a new instance of the class AzureLargeStorageInstanceOperations class. + * @param client Reference to the service client + */ + constructor(client: AzureLargeInstance) { + this.client = client; + } + + /** + * Gets a list of AzureLargeStorageInstances in the specified subscription. The operations returns + * various properties of each Azure LargeStorage instance. + * @param options The options parameters. + */ + public listBySubscription( + options?: AzureLargeStorageInstanceListBySubscriptionOptionalParams + ): PagedAsyncIterableIterator { + const iter = this.listBySubscriptionPagingAll(options); + return { + next() { + return iter.next(); + }, + [Symbol.asyncIterator]() { + return this; + }, + byPage: (settings?: PageSettings) => { + if (settings?.maxPageSize) { + throw new Error("maxPageSize is not supported by this operation."); + } + return this.listBySubscriptionPagingPage(options, settings); + } + }; + } + + private async *listBySubscriptionPagingPage( + options?: AzureLargeStorageInstanceListBySubscriptionOptionalParams, + settings?: PageSettings + ): AsyncIterableIterator { + let result: AzureLargeStorageInstanceListBySubscriptionResponse; + let continuationToken = settings?.continuationToken; + if (!continuationToken) { + result = await this._listBySubscription(options); + let page = result.value || []; + continuationToken = result.nextLink; + setContinuationToken(page, continuationToken); + yield page; + } + while (continuationToken) { + result = await this._listBySubscriptionNext(continuationToken, options); + continuationToken = result.nextLink; + let page = result.value || []; + setContinuationToken(page, continuationToken); + yield page; + } + } + + private async *listBySubscriptionPagingAll( + options?: AzureLargeStorageInstanceListBySubscriptionOptionalParams + ): AsyncIterableIterator { + for await (const page of this.listBySubscriptionPagingPage(options)) { + yield* page; + } + } + + /** + * Gets a list of AzureLargeStorageInstances in the specified subscription and resource group. The + * operations returns various properties of each Azure LargeStorage instance. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param options The options parameters. + */ + public listByResourceGroup( + resourceGroupName: string, + options?: AzureLargeStorageInstanceListByResourceGroupOptionalParams + ): PagedAsyncIterableIterator { + const iter = this.listByResourceGroupPagingAll(resourceGroupName, options); + return { + next() { + return iter.next(); + }, + [Symbol.asyncIterator]() { + return this; + }, + byPage: (settings?: PageSettings) => { + if (settings?.maxPageSize) { + throw new Error("maxPageSize is not supported by this operation."); + } + return this.listByResourceGroupPagingPage( + resourceGroupName, + options, + settings + ); + } + }; + } + + private async *listByResourceGroupPagingPage( + resourceGroupName: string, + options?: AzureLargeStorageInstanceListByResourceGroupOptionalParams, + settings?: PageSettings + ): AsyncIterableIterator { + let result: AzureLargeStorageInstanceListByResourceGroupResponse; + let continuationToken = settings?.continuationToken; + if (!continuationToken) { + result = await this._listByResourceGroup(resourceGroupName, options); + let page = result.value || []; + continuationToken = result.nextLink; + setContinuationToken(page, continuationToken); + yield page; + } + while (continuationToken) { + result = await this._listByResourceGroupNext( + resourceGroupName, + continuationToken, + options + ); + continuationToken = result.nextLink; + let page = result.value || []; + setContinuationToken(page, continuationToken); + yield page; + } + } + + private async *listByResourceGroupPagingAll( + resourceGroupName: string, + options?: AzureLargeStorageInstanceListByResourceGroupOptionalParams + ): AsyncIterableIterator { + for await (const page of this.listByResourceGroupPagingPage( + resourceGroupName, + options + )) { + yield* page; + } + } + + /** + * Gets a list of AzureLargeStorageInstances in the specified subscription. The operations returns + * various properties of each Azure LargeStorage instance. + * @param options The options parameters. + */ + private _listBySubscription( + options?: AzureLargeStorageInstanceListBySubscriptionOptionalParams + ): Promise { + return this.client.sendOperationRequest( + { options }, + listBySubscriptionOperationSpec + ); + } + + /** + * Gets a list of AzureLargeStorageInstances in the specified subscription and resource group. The + * operations returns various properties of each Azure LargeStorage instance. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param options The options parameters. + */ + private _listByResourceGroup( + resourceGroupName: string, + options?: AzureLargeStorageInstanceListByResourceGroupOptionalParams + ): Promise { + return this.client.sendOperationRequest( + { resourceGroupName, options }, + listByResourceGroupOperationSpec + ); + } + + /** + * Gets an Azure Large Storage instance for the specified subscription, resource group, and instance + * name. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param azureLargeStorageInstanceName Name of the AzureLargeStorageInstance. + * @param options The options parameters. + */ + get( + resourceGroupName: string, + azureLargeStorageInstanceName: string, + options?: AzureLargeStorageInstanceGetOptionalParams + ): Promise { + return this.client.sendOperationRequest( + { resourceGroupName, azureLargeStorageInstanceName, options }, + getOperationSpec + ); + } + + /** + * Patches the Tags field of a Azure Large Storage Instance for the specified subscription, resource + * group, and instance name. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param azureLargeStorageInstanceName Name of the AzureLargeStorageInstance. + * @param tagsParameter Request body that only contains the new Tags field + * @param options The options parameters. + */ + update( + resourceGroupName: string, + azureLargeStorageInstanceName: string, + tagsParameter: Tags, + options?: AzureLargeStorageInstanceUpdateOptionalParams + ): Promise { + return this.client.sendOperationRequest( + { + resourceGroupName, + azureLargeStorageInstanceName, + tagsParameter, + options + }, + updateOperationSpec + ); + } + + /** + * ListBySubscriptionNext + * @param nextLink The nextLink from the previous successful call to the ListBySubscription method. + * @param options The options parameters. + */ + private _listBySubscriptionNext( + nextLink: string, + options?: AzureLargeStorageInstanceListBySubscriptionNextOptionalParams + ): Promise { + return this.client.sendOperationRequest( + { nextLink, options }, + listBySubscriptionNextOperationSpec + ); + } + + /** + * ListByResourceGroupNext + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param nextLink The nextLink from the previous successful call to the ListByResourceGroup method. + * @param options The options parameters. + */ + private _listByResourceGroupNext( + resourceGroupName: string, + nextLink: string, + options?: AzureLargeStorageInstanceListByResourceGroupNextOptionalParams + ): Promise { + return this.client.sendOperationRequest( + { resourceGroupName, nextLink, options }, + listByResourceGroupNextOperationSpec + ); + } +} +// Operation Specifications +const serializer = coreClient.createSerializer(Mappers, /* isXml */ false); + +const listBySubscriptionOperationSpec: coreClient.OperationSpec = { + path: + "/subscriptions/{subscriptionId}/providers/Microsoft.AzureLargeInstance/azureLargeStorageInstances", + httpMethod: "GET", + responses: { + 200: { + bodyMapper: Mappers.AzureLargeStorageInstanceListResult + }, + default: { + bodyMapper: Mappers.ErrorResponse + } + }, + queryParameters: [Parameters.apiVersion], + urlParameters: [Parameters.$host, Parameters.subscriptionId], + headerParameters: [Parameters.accept], + serializer +}; +const listByResourceGroupOperationSpec: coreClient.OperationSpec = { + path: + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureLargeInstance/azureLargeStorageInstances", + httpMethod: "GET", + responses: { + 200: { + bodyMapper: Mappers.AzureLargeStorageInstanceListResult + }, + default: { + bodyMapper: Mappers.ErrorResponse + } + }, + queryParameters: [Parameters.apiVersion], + urlParameters: [ + Parameters.$host, + Parameters.subscriptionId, + Parameters.resourceGroupName + ], + headerParameters: [Parameters.accept], + serializer +}; +const getOperationSpec: coreClient.OperationSpec = { + path: + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureLargeInstance/azureLargeStorageInstances/{azureLargeStorageInstanceName}", + httpMethod: "GET", + responses: { + 200: { + bodyMapper: Mappers.AzureLargeStorageInstance + }, + default: { + bodyMapper: Mappers.ErrorResponse + } + }, + queryParameters: [Parameters.apiVersion], + urlParameters: [ + Parameters.$host, + Parameters.subscriptionId, + Parameters.resourceGroupName, + Parameters.azureLargeStorageInstanceName + ], + headerParameters: [Parameters.accept], + serializer +}; +const updateOperationSpec: coreClient.OperationSpec = { + path: + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureLargeInstance/azureLargeStorageInstances/{azureLargeStorageInstanceName}", + httpMethod: "PATCH", + responses: { + 200: { + bodyMapper: Mappers.AzureLargeStorageInstance + }, + default: { + bodyMapper: Mappers.ErrorResponse + } + }, + requestBody: Parameters.tagsParameter, + queryParameters: [Parameters.apiVersion], + urlParameters: [ + Parameters.$host, + Parameters.subscriptionId, + Parameters.resourceGroupName, + Parameters.azureLargeStorageInstanceName + ], + headerParameters: [Parameters.accept, Parameters.contentType], + mediaType: "json", + serializer +}; +const listBySubscriptionNextOperationSpec: coreClient.OperationSpec = { + path: "{nextLink}", + httpMethod: "GET", + responses: { + 200: { + bodyMapper: Mappers.AzureLargeStorageInstanceListResult + }, + default: { + bodyMapper: Mappers.ErrorResponse + } + }, + urlParameters: [ + Parameters.$host, + Parameters.subscriptionId, + Parameters.nextLink + ], + headerParameters: [Parameters.accept], + serializer +}; +const listByResourceGroupNextOperationSpec: coreClient.OperationSpec = { + path: "{nextLink}", + httpMethod: "GET", + responses: { + 200: { + bodyMapper: Mappers.AzureLargeStorageInstanceListResult + }, + default: { + bodyMapper: Mappers.ErrorResponse + } + }, + urlParameters: [ + Parameters.$host, + Parameters.subscriptionId, + Parameters.resourceGroupName, + Parameters.nextLink + ], + headerParameters: [Parameters.accept], + serializer +}; diff --git a/sdk/azurelargeinstance/arm-azurelargeinstance/src/operations/index.ts b/sdk/azurelargeinstance/arm-azurelargeinstance/src/operations/index.ts new file mode 100644 index 000000000000..4218d4953c0b --- /dev/null +++ b/sdk/azurelargeinstance/arm-azurelargeinstance/src/operations/index.ts @@ -0,0 +1,11 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +export * from "./azureLargeInstanceOperations"; +export * from "./operations"; +export * from "./azureLargeStorageInstanceOperations"; diff --git a/sdk/azurelargeinstance/arm-azurelargeinstance/src/operations/operations.ts b/sdk/azurelargeinstance/arm-azurelargeinstance/src/operations/operations.ts new file mode 100644 index 000000000000..cdf5c892d988 --- /dev/null +++ b/sdk/azurelargeinstance/arm-azurelargeinstance/src/operations/operations.ts @@ -0,0 +1,149 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +import { PagedAsyncIterableIterator, PageSettings } from "@azure/core-paging"; +import { setContinuationToken } from "../pagingHelper"; +import { Operations } from "../operationsInterfaces"; +import * as coreClient from "@azure/core-client"; +import * as Mappers from "../models/mappers"; +import * as Parameters from "../models/parameters"; +import { AzureLargeInstance } from "../azureLargeInstance"; +import { + Operation, + OperationsListNextOptionalParams, + OperationsListOptionalParams, + OperationsListResponse, + OperationsListNextResponse +} from "../models"; + +/// +/** Class containing Operations operations. */ +export class OperationsImpl implements Operations { + private readonly client: AzureLargeInstance; + + /** + * Initialize a new instance of the class Operations class. + * @param client Reference to the service client + */ + constructor(client: AzureLargeInstance) { + this.client = client; + } + + /** + * Gets a list of AzureLargeInstance management operations. + * @param options The options parameters. + */ + public list( + options?: OperationsListOptionalParams + ): PagedAsyncIterableIterator { + const iter = this.listPagingAll(options); + return { + next() { + return iter.next(); + }, + [Symbol.asyncIterator]() { + return this; + }, + byPage: (settings?: PageSettings) => { + if (settings?.maxPageSize) { + throw new Error("maxPageSize is not supported by this operation."); + } + return this.listPagingPage(options, settings); + } + }; + } + + private async *listPagingPage( + options?: OperationsListOptionalParams, + settings?: PageSettings + ): AsyncIterableIterator { + let result: OperationsListResponse; + let continuationToken = settings?.continuationToken; + if (!continuationToken) { + result = await this._list(options); + let page = result.value || []; + continuationToken = result.nextLink; + setContinuationToken(page, continuationToken); + yield page; + } + while (continuationToken) { + result = await this._listNext(continuationToken, options); + continuationToken = result.nextLink; + let page = result.value || []; + setContinuationToken(page, continuationToken); + yield page; + } + } + + private async *listPagingAll( + options?: OperationsListOptionalParams + ): AsyncIterableIterator { + for await (const page of this.listPagingPage(options)) { + yield* page; + } + } + + /** + * Gets a list of AzureLargeInstance management operations. + * @param options The options parameters. + */ + private _list( + options?: OperationsListOptionalParams + ): Promise { + return this.client.sendOperationRequest({ options }, listOperationSpec); + } + + /** + * ListNext + * @param nextLink The nextLink from the previous successful call to the List method. + * @param options The options parameters. + */ + private _listNext( + nextLink: string, + options?: OperationsListNextOptionalParams + ): Promise { + return this.client.sendOperationRequest( + { nextLink, options }, + listNextOperationSpec + ); + } +} +// Operation Specifications +const serializer = coreClient.createSerializer(Mappers, /* isXml */ false); + +const listOperationSpec: coreClient.OperationSpec = { + path: "/providers/Microsoft.AzureLargeInstance/operations", + httpMethod: "GET", + responses: { + 200: { + bodyMapper: Mappers.OperationListResult + }, + default: { + bodyMapper: Mappers.ErrorResponse + } + }, + queryParameters: [Parameters.apiVersion], + urlParameters: [Parameters.$host], + headerParameters: [Parameters.accept], + serializer +}; +const listNextOperationSpec: coreClient.OperationSpec = { + path: "{nextLink}", + httpMethod: "GET", + responses: { + 200: { + bodyMapper: Mappers.OperationListResult + }, + default: { + bodyMapper: Mappers.ErrorResponse + } + }, + urlParameters: [Parameters.$host, Parameters.nextLink], + headerParameters: [Parameters.accept], + serializer +}; diff --git a/sdk/azurelargeinstance/arm-azurelargeinstance/src/operationsInterfaces/azureLargeInstanceOperations.ts b/sdk/azurelargeinstance/arm-azurelargeinstance/src/operationsInterfaces/azureLargeInstanceOperations.ts new file mode 100644 index 000000000000..39cc0e0fbbda --- /dev/null +++ b/sdk/azurelargeinstance/arm-azurelargeinstance/src/operationsInterfaces/azureLargeInstanceOperations.ts @@ -0,0 +1,144 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +import { PagedAsyncIterableIterator } from "@azure/core-paging"; +import { SimplePollerLike, OperationState } from "@azure/core-lro"; +import { + AzureLargeInstance, + ListBySubscriptionOptionalParams, + ListByResourceGroupOptionalParams, + StartOptionalParams, + StartResponse, + RestartOptionalParams, + RestartResponse, + ShutdownOptionalParams, + ShutdownResponse, + GetOptionalParams, + GetResponse, + Tags, + UpdateOptionalParams, + UpdateResponse +} from "../models"; + +/// +/** Interface representing a AzureLargeInstanceOperations. */ +export interface AzureLargeInstanceOperations { + /** + * Gets a list of Azure Large Instances in the specified subscription. The operations returns various + * properties of each Azure Large Instance. + * @param options The options parameters. + */ + listBySubscription( + options?: ListBySubscriptionOptionalParams + ): PagedAsyncIterableIterator; + /** + * Gets a list of Azure Large Instances in the specified subscription and resource group. The + * operations returns various properties of each Azure Large Instance. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param options The options parameters. + */ + listByResourceGroup( + resourceGroupName: string, + options?: ListByResourceGroupOptionalParams + ): PagedAsyncIterableIterator; + /** + * The operation to start an Azure Large Instance (only for compute instances) + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param azureLargeInstanceName Name of the AzureLargeInstance. + * @param options The options parameters. + */ + beginStart( + resourceGroupName: string, + azureLargeInstanceName: string, + options?: StartOptionalParams + ): Promise, StartResponse>>; + /** + * The operation to start an Azure Large Instance (only for compute instances) + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param azureLargeInstanceName Name of the AzureLargeInstance. + * @param options The options parameters. + */ + beginStartAndWait( + resourceGroupName: string, + azureLargeInstanceName: string, + options?: StartOptionalParams + ): Promise; + /** + * The operation to restart an Azure Large Instance (only for compute instances) + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param azureLargeInstanceName Name of the AzureLargeInstance. + * @param options The options parameters. + */ + beginRestart( + resourceGroupName: string, + azureLargeInstanceName: string, + options?: RestartOptionalParams + ): Promise< + SimplePollerLike, RestartResponse> + >; + /** + * The operation to restart an Azure Large Instance (only for compute instances) + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param azureLargeInstanceName Name of the AzureLargeInstance. + * @param options The options parameters. + */ + beginRestartAndWait( + resourceGroupName: string, + azureLargeInstanceName: string, + options?: RestartOptionalParams + ): Promise; + /** + * The operation to shutdown an Azure Large Instance (only for compute instances) + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param azureLargeInstanceName Name of the AzureLargeInstance. + * @param options The options parameters. + */ + beginShutdown( + resourceGroupName: string, + azureLargeInstanceName: string, + options?: ShutdownOptionalParams + ): Promise< + SimplePollerLike, ShutdownResponse> + >; + /** + * The operation to shutdown an Azure Large Instance (only for compute instances) + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param azureLargeInstanceName Name of the AzureLargeInstance. + * @param options The options parameters. + */ + beginShutdownAndWait( + resourceGroupName: string, + azureLargeInstanceName: string, + options?: ShutdownOptionalParams + ): Promise; + /** + * Gets an Azure Large Instance for the specified subscription, resource group, and instance name. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param azureLargeInstanceName Name of the AzureLargeInstance. + * @param options The options parameters. + */ + get( + resourceGroupName: string, + azureLargeInstanceName: string, + options?: GetOptionalParams + ): Promise; + /** + * Patches the Tags field of an Azure Large Instance for the specified subscription, resource group, + * and instance name. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param azureLargeInstanceName Name of the AzureLargeInstance. + * @param tagsParameter Request body that only contains the new Tags field + * @param options The options parameters. + */ + update( + resourceGroupName: string, + azureLargeInstanceName: string, + tagsParameter: Tags, + options?: UpdateOptionalParams + ): Promise; +} diff --git a/sdk/azurelargeinstance/arm-azurelargeinstance/src/operationsInterfaces/azureLargeStorageInstanceOperations.ts b/sdk/azurelargeinstance/arm-azurelargeinstance/src/operationsInterfaces/azureLargeStorageInstanceOperations.ts new file mode 100644 index 000000000000..4c478b92c4de --- /dev/null +++ b/sdk/azurelargeinstance/arm-azurelargeinstance/src/operationsInterfaces/azureLargeStorageInstanceOperations.ts @@ -0,0 +1,68 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +import { PagedAsyncIterableIterator } from "@azure/core-paging"; +import { + AzureLargeStorageInstance, + AzureLargeStorageInstanceListBySubscriptionOptionalParams, + AzureLargeStorageInstanceListByResourceGroupOptionalParams, + AzureLargeStorageInstanceGetOptionalParams, + AzureLargeStorageInstanceGetResponse, + Tags, + AzureLargeStorageInstanceUpdateOptionalParams, + AzureLargeStorageInstanceUpdateResponse +} from "../models"; + +/// +/** Interface representing a AzureLargeStorageInstanceOperations. */ +export interface AzureLargeStorageInstanceOperations { + /** + * Gets a list of AzureLargeStorageInstances in the specified subscription. The operations returns + * various properties of each Azure LargeStorage instance. + * @param options The options parameters. + */ + listBySubscription( + options?: AzureLargeStorageInstanceListBySubscriptionOptionalParams + ): PagedAsyncIterableIterator; + /** + * Gets a list of AzureLargeStorageInstances in the specified subscription and resource group. The + * operations returns various properties of each Azure LargeStorage instance. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param options The options parameters. + */ + listByResourceGroup( + resourceGroupName: string, + options?: AzureLargeStorageInstanceListByResourceGroupOptionalParams + ): PagedAsyncIterableIterator; + /** + * Gets an Azure Large Storage instance for the specified subscription, resource group, and instance + * name. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param azureLargeStorageInstanceName Name of the AzureLargeStorageInstance. + * @param options The options parameters. + */ + get( + resourceGroupName: string, + azureLargeStorageInstanceName: string, + options?: AzureLargeStorageInstanceGetOptionalParams + ): Promise; + /** + * Patches the Tags field of a Azure Large Storage Instance for the specified subscription, resource + * group, and instance name. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param azureLargeStorageInstanceName Name of the AzureLargeStorageInstance. + * @param tagsParameter Request body that only contains the new Tags field + * @param options The options parameters. + */ + update( + resourceGroupName: string, + azureLargeStorageInstanceName: string, + tagsParameter: Tags, + options?: AzureLargeStorageInstanceUpdateOptionalParams + ): Promise; +} diff --git a/sdk/azurelargeinstance/arm-azurelargeinstance/src/operationsInterfaces/index.ts b/sdk/azurelargeinstance/arm-azurelargeinstance/src/operationsInterfaces/index.ts new file mode 100644 index 000000000000..4218d4953c0b --- /dev/null +++ b/sdk/azurelargeinstance/arm-azurelargeinstance/src/operationsInterfaces/index.ts @@ -0,0 +1,11 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +export * from "./azureLargeInstanceOperations"; +export * from "./operations"; +export * from "./azureLargeStorageInstanceOperations"; diff --git a/sdk/azurelargeinstance/arm-azurelargeinstance/src/operationsInterfaces/operations.ts b/sdk/azurelargeinstance/arm-azurelargeinstance/src/operationsInterfaces/operations.ts new file mode 100644 index 000000000000..90a5f9fe7bcd --- /dev/null +++ b/sdk/azurelargeinstance/arm-azurelargeinstance/src/operationsInterfaces/operations.ts @@ -0,0 +1,22 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +import { PagedAsyncIterableIterator } from "@azure/core-paging"; +import { Operation, OperationsListOptionalParams } from "../models"; + +/// +/** Interface representing a Operations. */ +export interface Operations { + /** + * Gets a list of AzureLargeInstance management operations. + * @param options The options parameters. + */ + list( + options?: OperationsListOptionalParams + ): PagedAsyncIterableIterator; +} diff --git a/sdk/azurelargeinstance/arm-azurelargeinstance/src/pagingHelper.ts b/sdk/azurelargeinstance/arm-azurelargeinstance/src/pagingHelper.ts new file mode 100644 index 000000000000..269a2b9814b5 --- /dev/null +++ b/sdk/azurelargeinstance/arm-azurelargeinstance/src/pagingHelper.ts @@ -0,0 +1,39 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +export interface PageInfo { + continuationToken?: string; +} + +const pageMap = new WeakMap(); + +/** + * Given the last `.value` produced by the `byPage` iterator, + * returns a continuation token that can be used to begin paging from + * that point later. + * @param page An object from accessing `value` on the IteratorResult from a `byPage` iterator. + * @returns The continuation token that can be passed into byPage() during future calls. + */ +export function getContinuationToken(page: unknown): string | undefined { + if (typeof page !== "object" || page === null) { + return undefined; + } + return pageMap.get(page)?.continuationToken; +} + +export function setContinuationToken( + page: unknown, + continuationToken: string | undefined +): void { + if (typeof page !== "object" || page === null || !continuationToken) { + return; + } + const pageInfo = pageMap.get(page) ?? {}; + pageInfo.continuationToken = continuationToken; + pageMap.set(page, pageInfo); +} diff --git a/sdk/azurelargeinstance/arm-azurelargeinstance/test/sampleTest.ts b/sdk/azurelargeinstance/arm-azurelargeinstance/test/sampleTest.ts new file mode 100644 index 000000000000..25aeb3ebcc36 --- /dev/null +++ b/sdk/azurelargeinstance/arm-azurelargeinstance/test/sampleTest.ts @@ -0,0 +1,43 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +import { + Recorder, + RecorderStartOptions, + env +} from "@azure-tools/test-recorder"; +import { assert } from "chai"; +import { Context } from "mocha"; + +const replaceableVariables: Record = { + AZURE_CLIENT_ID: "azure_client_id", + AZURE_CLIENT_SECRET: "azure_client_secret", + AZURE_TENANT_ID: "88888888-8888-8888-8888-888888888888", + SUBSCRIPTION_ID: "azure_subscription_id" +}; + +const recorderOptions: RecorderStartOptions = { + envSetupForPlayback: replaceableVariables +}; + +describe("My test", () => { + let recorder: Recorder; + + beforeEach(async function(this: Context) { + recorder = new Recorder(this.currentTest); + await recorder.start(recorderOptions); + }); + + afterEach(async function() { + await recorder.stop(); + }); + + it("sample test", async function() { + console.log("Hi, I'm a test!"); + }); +}); diff --git a/sdk/azurelargeinstance/arm-azurelargeinstance/tsconfig.json b/sdk/azurelargeinstance/arm-azurelargeinstance/tsconfig.json new file mode 100644 index 000000000000..3e6ae96443f3 --- /dev/null +++ b/sdk/azurelargeinstance/arm-azurelargeinstance/tsconfig.json @@ -0,0 +1,27 @@ +{ + "compilerOptions": { + "module": "es6", + "moduleResolution": "node", + "strict": true, + "target": "es6", + "sourceMap": true, + "declarationMap": true, + "esModuleInterop": true, + "allowSyntheticDefaultImports": true, + "forceConsistentCasingInFileNames": true, + "lib": [ + "es6", + "dom" + ], + "declaration": true, + "outDir": "./dist-esm", + "importHelpers": true + }, + "include": [ + "./src/**/*.ts", + "./test/**/*.ts" + ], + "exclude": [ + "node_modules" + ] +} \ No newline at end of file diff --git a/sdk/azurelargeinstance/ci.mgmt.yml b/sdk/azurelargeinstance/ci.mgmt.yml new file mode 100644 index 000000000000..5a90949b3f67 --- /dev/null +++ b/sdk/azurelargeinstance/ci.mgmt.yml @@ -0,0 +1,38 @@ +# NOTE: Please refer to https://aka.ms/azsdk/engsys/ci-yaml before editing this file. + +trigger: + branches: + include: + - main + - feature/* + - release/* + - hotfix/* + exclude: + - feature/v4 + paths: + include: + - sdk/azurelargeinstance/arm-azurelargeinstance + - sdk/azurelargeinstance/ci.mgmt.yml + +pr: + branches: + include: + - main + - feature/* + - release/* + - hotfix/* + exclude: + - feature/v4 + paths: + include: + - sdk/azurelargeinstance/arm-azurelargeinstance + - sdk/azurelargeinstance/ci.mgmt.yml + +extends: + template: /eng/pipelines/templates/stages/archetype-sdk-client.yml + parameters: + ServiceDirectory: azurelargeinstance + Artifacts: + - name: azure-arm-azurelargeinstance + safeName: azurearmazurelargeinstance + \ No newline at end of file