diff --git a/common/config/rush/pnpm-lock.yaml b/common/config/rush/pnpm-lock.yaml index effaa47f703e..976018071091 100644 --- a/common/config/rush/pnpm-lock.yaml +++ b/common/config/rush/pnpm-lock.yaml @@ -346,6 +346,9 @@ importers: '@rush-temp/arm-dynatrace': specifier: file:./projects/arm-dynatrace.tgz version: file:projects/arm-dynatrace.tgz(@types/debug@4.1.12)(tsx@4.19.4)(vite@6.3.5(@types/node@22.7.9)(tsx@4.19.4)(yaml@2.7.1))(yaml@2.7.1) + '@rush-temp/arm-edgeorder': + specifier: file:./projects/arm-edgeorder.tgz + version: file:projects/arm-edgeorder.tgz(@types/debug@4.1.12)(tsx@4.19.4)(vite@6.3.5(@types/node@22.7.9)(tsx@4.19.4)(yaml@2.7.1))(yaml@2.7.1) '@rush-temp/arm-edgezones': specifier: file:./projects/arm-edgezones.tgz version: file:projects/arm-edgezones.tgz(@types/debug@4.1.12)(tsx@4.19.4)(vite@6.3.5(@types/node@22.7.9)(tsx@4.19.4)(yaml@2.7.1))(yaml@2.7.1) @@ -1021,9 +1024,6 @@ importers: '@rush-temp/iot-modelsrepository': specifier: file:./projects/iot-modelsrepository.tgz version: file:projects/iot-modelsrepository.tgz(@types/debug@4.1.12)(tsx@4.19.4)(vite@6.3.5(@types/node@22.7.9)(tsx@4.19.4)(yaml@2.7.1))(yaml@2.7.1) - '@rush-temp/mcp-server': - specifier: file:./projects/mcp-server.tgz - version: file:projects/mcp-server.tgz(@types/debug@4.1.12)(@vitest/browser@3.1.2)(yaml@2.7.1) '@rush-temp/keyvault-admin': specifier: file:./projects/keyvault-admin.tgz version: file:projects/keyvault-admin.tgz(@types/debug@4.1.12)(tsx@4.19.4)(vite@6.3.5(@types/node@22.7.9)(tsx@4.19.4)(yaml@2.7.1))(yaml@2.7.1) @@ -1063,6 +1063,9 @@ importers: '@rush-temp/maps-timezone': specifier: file:./projects/maps-timezone.tgz version: file:projects/maps-timezone.tgz(@types/debug@4.1.12)(tsx@4.19.4)(vite@6.3.5(@types/node@22.7.9)(tsx@4.19.4)(yaml@2.7.1))(yaml@2.7.1) + '@rush-temp/mcp-server': + specifier: file:./projects/mcp-server.tgz + version: file:projects/mcp-server.tgz(@types/debug@4.1.12)(@vitest/browser@3.1.2)(yaml@2.7.1) '@rush-temp/microsoft-playwright-testing': specifier: file:./projects/microsoft-playwright-testing.tgz version: file:projects/microsoft-playwright-testing.tgz(tsx@4.19.4)(vite@6.3.5(@types/node@22.7.9)(tsx@4.19.4)(yaml@2.7.1))(yaml@2.7.1) @@ -2769,6 +2772,10 @@ packages: resolution: {integrity: sha512-YTfFYvwh1TlaXb2SG0jWOOc8BZxBn8cJBwNJUV30WzaXX6O5Oe4sRLd9fkqcCnujfxRVG84UKz+zvDhrSSXjEg==, tarball: file:projects/arm-dynatrace.tgz} version: 0.0.0 + '@rush-temp/arm-edgeorder@file:projects/arm-edgeorder.tgz': + resolution: {integrity: sha512-8vwsEwWPPIAYRH+HW0c0eH7HOQWWJjGdpjGsITlQ2d6xee9ub8+iY2pmyRzbfGVLbHnjB+Di+2lA9vja9YsVXw==, tarball: file:projects/arm-edgeorder.tgz} + version: 0.0.0 + '@rush-temp/arm-edgezones@file:projects/arm-edgezones.tgz': resolution: {integrity: sha512-2PMba5lT8zStW+R8wYrocvrzOBQtBKpIIV2DCGS6xgJgQYr1CxmpYv9H7oS1Ib9cqb4WrA2R2Nlckrg3GV3Izw==, tarball: file:projects/arm-edgezones.tgz} version: 0.0.0 @@ -3669,10 +3676,6 @@ packages: resolution: {integrity: sha512-nVEawKXIhltEp1Zvua0E46Gdg0Hs5JJDFD7WPgqFBycYtQjRVsw60x49ZTi8ZxYXPJGQBJC2xLvj1fg/A5uhyQ==, tarball: file:projects/iot-modelsrepository.tgz} version: 0.0.0 - '@rush-temp/mcp-server@file:projects/mcp-server.tgz': - resolution: {integrity: sha512-DuCikdWUz6hleAR8EjUp7JD4VAGR1YMfNRAshvzJ7W20qAMV10dscYCo2wq8Eqt5TtEwLOrJFFfnbHwGIhNTZQ==, tarball: file:projects/mcp-server.tgz} - version: 0.0.0 - '@rush-temp/keyvault-admin@file:projects/keyvault-admin.tgz': resolution: {integrity: sha512-+pLp6hMMbEHRNWIWBJHEb3ovy65MoQthJRuwfDYdXDDYMYgiazL7j3CLleRz+WpDlI5kJ8gyD24pIqCoVZvQqg==, tarball: file:projects/keyvault-admin.tgz} version: 0.0.0 @@ -3725,6 +3728,10 @@ packages: resolution: {integrity: sha512-LLoNu/hOKIZ5/eLQ0io6I6kDPrnkiI1C3rDtG0DEQlP097B9CoeeaQ2E+qbGYUAPvvyo6QththExkcmgUENgEg==, tarball: file:projects/maps-timezone.tgz} version: 0.0.0 + '@rush-temp/mcp-server@file:projects/mcp-server.tgz': + resolution: {integrity: sha512-xVj0UA/iOcFZso/cQiQ1Ug5juexp+mJOhFwNBANfNb0bzXo9BRrgR2/0DxaTIIS0lest23qzU0nMQUiZPPetpA==, tarball: file:projects/mcp-server.tgz} + version: 0.0.0 + '@rush-temp/microsoft-playwright-testing@file:projects/microsoft-playwright-testing.tgz': resolution: {integrity: sha512-sVU4AhYy8i4VhihEGOHMZLmUggC15w2JvBfGUC+i+q7nxmE3sIbO+EzicltK811tg0QQML6lAzKonojrK4FO6g==, tarball: file:projects/microsoft-playwright-testing.tgz} version: 0.0.0 @@ -12475,6 +12482,41 @@ snapshots: - webdriverio - yaml + '@rush-temp/arm-edgeorder@file:projects/arm-edgeorder.tgz(@types/debug@4.1.12)(tsx@4.19.4)(vite@6.3.5(@types/node@22.7.9)(tsx@4.19.4)(yaml@2.7.1))(yaml@2.7.1)': + dependencies: + '@types/node': 18.19.87 + '@vitest/browser': 3.1.2(playwright@1.52.0)(vite@6.3.5(@types/node@22.7.9)(tsx@4.19.4)(yaml@2.7.1))(vitest@3.1.2) + '@vitest/coverage-istanbul': 3.1.2(vitest@3.1.2) + dotenv: 16.5.0 + eslint: 9.26.0 + playwright: 1.52.0 + tslib: 2.8.1 + typescript: 5.8.3 + vitest: 3.1.2(@types/debug@4.1.12)(@types/node@18.19.87)(@vitest/browser@3.1.2)(tsx@4.19.4)(yaml@2.7.1) + transitivePeerDependencies: + - '@edge-runtime/vm' + - '@types/debug' + - '@vitest/ui' + - bufferutil + - happy-dom + - jiti + - jsdom + - less + - lightningcss + - msw + - safaridriver + - sass + - sass-embedded + - stylus + - sugarss + - supports-color + - terser + - tsx + - utf-8-validate + - vite + - webdriverio + - yaml + '@rush-temp/arm-edgezones@file:projects/arm-edgezones.tgz(@types/debug@4.1.12)(tsx@4.19.4)(vite@6.3.5(@types/node@22.7.9)(tsx@4.19.4)(yaml@2.7.1))(yaml@2.7.1)': dependencies: '@types/node': 18.19.87 @@ -20462,37 +20504,6 @@ snapshots: - webdriverio - yaml - '@rush-temp/mcp-server@file:projects/mcp-server.tgz(@types/debug@4.1.12)(@vitest/browser@3.1.2)(yaml@2.7.1)': - dependencies: - '@modelcontextprotocol/sdk': 1.11.0 - '@types/node': 18.19.87 - '@vitest/coverage-istanbul': 3.1.2(vitest@3.1.2) - '@vitest/expect': 3.1.2 - dotenv: 16.5.0 - eslint: 9.26.0 - tsx: 4.19.3 - typescript: 5.8.3 - vitest: 3.1.2(@types/debug@4.1.12)(@types/node@18.19.87)(@vitest/browser@3.1.2)(tsx@4.19.3)(yaml@2.7.1) - zod: 3.24.4 - transitivePeerDependencies: - - '@edge-runtime/vm' - - '@types/debug' - - '@vitest/browser' - - '@vitest/ui' - - happy-dom - - jiti - - jsdom - - less - - lightningcss - - msw - - sass - - sass-embedded - - stylus - - sugarss - - supports-color - - terser - - yaml - '@rush-temp/keyvault-admin@file:projects/keyvault-admin.tgz(@types/debug@4.1.12)(tsx@4.19.4)(vite@6.3.5(@types/node@22.7.9)(tsx@4.19.4)(yaml@2.7.1))(yaml@2.7.1)': dependencies: '@azure/keyvault-keys': 4.9.0 @@ -20962,6 +20973,37 @@ snapshots: - webdriverio - yaml + '@rush-temp/mcp-server@file:projects/mcp-server.tgz(@types/debug@4.1.12)(@vitest/browser@3.1.2)(yaml@2.7.1)': + dependencies: + '@modelcontextprotocol/sdk': 1.11.0 + '@types/node': 18.19.87 + '@vitest/coverage-istanbul': 3.1.2(vitest@3.1.2) + '@vitest/expect': 3.1.2 + dotenv: 16.5.0 + eslint: 9.26.0 + tsx: 4.19.3 + typescript: 5.8.3 + vitest: 3.1.2(@types/debug@4.1.12)(@types/node@18.19.87)(@vitest/browser@3.1.2)(tsx@4.19.3)(yaml@2.7.1) + zod: 3.24.4 + transitivePeerDependencies: + - '@edge-runtime/vm' + - '@types/debug' + - '@vitest/browser' + - '@vitest/ui' + - happy-dom + - jiti + - jsdom + - less + - lightningcss + - msw + - sass + - sass-embedded + - stylus + - sugarss + - supports-color + - terser + - yaml + '@rush-temp/microsoft-playwright-testing@file:projects/microsoft-playwright-testing.tgz(tsx@4.19.4)(vite@6.3.5(@types/node@22.7.9)(tsx@4.19.4)(yaml@2.7.1))(yaml@2.7.1)': dependencies: '@playwright/test': 1.52.0 @@ -22953,11 +22995,11 @@ snapshots: '@types/body-parser@1.19.5': dependencies: '@types/connect': 3.4.38 - '@types/node': 18.19.87 + '@types/node': 22.7.9 '@types/bunyan@1.8.11': dependencies: - '@types/node': 18.19.87 + '@types/node': 22.7.9 '@types/chai-as-promised@8.0.2': dependencies: @@ -22969,7 +23011,7 @@ snapshots: '@types/connect@3.4.38': dependencies: - '@types/node': 18.19.87 + '@types/node': 22.7.9 '@types/debug@4.1.12': dependencies: @@ -23025,7 +23067,7 @@ snapshots: '@types/glob@7.2.0': dependencies: '@types/minimatch': 5.1.2 - '@types/node': 18.19.87 + '@types/node': 22.7.9 '@types/http-errors@2.0.4': {} @@ -23070,7 +23112,7 @@ snapshots: '@types/mysql@2.15.26': dependencies: - '@types/node': 18.19.87 + '@types/node': 22.7.9 '@types/node-fetch@2.6.12': dependencies: @@ -23099,7 +23141,7 @@ snapshots: '@types/pg@8.6.1': dependencies: - '@types/node': 18.19.87 + '@types/node': 22.7.9 pg-protocol: 1.8.0 pg-types: 2.2.0 @@ -23127,19 +23169,19 @@ snapshots: '@types/send@0.17.4': dependencies: '@types/mime': 1.3.5 - '@types/node': 18.19.87 + '@types/node': 22.7.9 '@types/serve-static@1.15.7': dependencies: '@types/http-errors': 2.0.4 - '@types/node': 18.19.87 + '@types/node': 22.7.9 '@types/send': 0.17.4 '@types/shimmer@1.2.0': {} '@types/through@0.0.33': dependencies: - '@types/node': 18.19.87 + '@types/node': 22.7.9 '@types/triple-beam@1.3.5': {} @@ -25336,7 +25378,7 @@ snapshots: '@protobufjs/path': 1.1.2 '@protobufjs/pool': 1.1.0 '@protobufjs/utf8': 1.1.0 - '@types/node': 18.19.87 + '@types/node': 22.7.9 long: 5.3.2 proxy-addr@2.0.7: diff --git a/rush.json b/rush.json index 228494b8babb..a9fd99e2ff56 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. @@ -555,7 +555,9 @@ "projectFolder": "common/tools/dev-tool", "versionPolicyName": "utility", // Add Identity to decoupledLocalDependencies so that dev-tool uses the package from npm, avoiding a cyclic dependency. - "decoupledLocalDependencies": ["@azure/identity"] + "decoupledLocalDependencies": [ + "@azure/identity" + ] }, { "packageName": "@azure/eventgrid", @@ -595,7 +597,9 @@ { "packageName": "@azure/identity", "projectFolder": "sdk/identity/identity", - "decoupledLocalDependencies": ["@azure/keyvault-keys"], + "decoupledLocalDependencies": [ + "@azure/keyvault-keys" + ], "versionPolicyName": "client" }, { @@ -2367,6 +2371,11 @@ "packageName": "@azure/arm-carbonoptimization", "projectFolder": "sdk/carbonoptimization/arm-carbonoptimization", "versionPolicyName": "management" + }, + { + "packageName": "@azure/arm-edgeorder", + "projectFolder": "sdk/edgeorder/arm-edgeorder", + "versionPolicyName": "management" } ] -} +} \ No newline at end of file diff --git a/sdk/edgeorder/arm-edgeorder/CHANGELOG.md b/sdk/edgeorder/arm-edgeorder/CHANGELOG.md new file mode 100644 index 000000000000..4d7dc405c85c --- /dev/null +++ b/sdk/edgeorder/arm-edgeorder/CHANGELOG.md @@ -0,0 +1,7 @@ +# Release History + +## 1.0.0 (2025-05-12) + +### Features Added + +The package of @azure/arm-edgeorder is using our next generation design principles. To learn more, please refer to our documentation [Quick Start](https://aka.ms/azsdk/js/mgmt/quickstart). diff --git a/sdk/edgeorder/arm-edgeorder/LICENSE b/sdk/edgeorder/arm-edgeorder/LICENSE new file mode 100644 index 000000000000..63447fd8bbbf --- /dev/null +++ b/sdk/edgeorder/arm-edgeorder/LICENSE @@ -0,0 +1,21 @@ +Copyright (c) Microsoft Corporation. + +MIT License + +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/edgeorder/arm-edgeorder/README.md b/sdk/edgeorder/arm-edgeorder/README.md new file mode 100644 index 000000000000..9c0a965ac047 --- /dev/null +++ b/sdk/edgeorder/arm-edgeorder/README.md @@ -0,0 +1,114 @@ +# Azure EdgeOrder client library for JavaScript + +This package contains an isomorphic SDK (runs both in Node.js and in browsers) for Azure EdgeOrder client. + +Edge Order API's + +Key links: + +- [Source code](https://github.com/Azure/azure-sdk-for-js/tree/main/sdk/edgeorder/arm-edgeorder) +- [Package (NPM)](https://www.npmjs.com/package/@azure/arm-edgeorder) +- [API reference documentation](https://learn.microsoft.com/javascript/api/@azure/arm-edgeorder?view=azure-node-preview) +- [Samples](https://github.com/Azure/azure-sdk-for-js/tree/main/sdk/edgeorder/arm-edgeorder/samples) + +## 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-edgeorder` package + +Install the Azure EdgeOrder client library for JavaScript with `npm`: + +```bash +npm install @azure/arm-edgeorder +``` + +### Create and authenticate a `EdgeOrderClient` + +To create a client object to access the Azure EdgeOrder API, you will need the `endpoint` of your Azure EdgeOrder resource and a `credential`. The Azure EdgeOrder client can use Azure Active Directory credentials to authenticate. +You can find the endpoint for your Azure EdgeOrder resource in the [Azure Portal][azure_portal]. + +You can authenticate with Azure Active Directory using a credential from the [@azure/identity][azure_identity] library or [an existing AAD Token](https://github.com/Azure/azure-sdk-for-js/blob/master/sdk/identity/identity/samples/AzureIdentityExamples.md#authenticating-with-a-pre-fetched-access-token). + +To use the [DefaultAzureCredential][defaultazurecredential] provider shown below, or other credential providers provided with the Azure SDK, please install the `@azure/identity` package: + +```bash +npm install @azure/identity +``` + +You will also need to **register a new AAD application and grant access to Azure EdgeOrder** by assigning the suitable role to your service principal (note: roles such as `"Owner"` will not grant the necessary permissions). + +For more information about how to create an Azure AD Application check out [this guide](https://learn.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal). + +Using Node.js and Node-like environments, you can use the `DefaultAzureCredential` class to authenticate the client. + +```ts snippet:ReadmeSampleCreateClient_Node +import { EdgeOrderClient } from "@azure/arm-edgeorder"; +import { DefaultAzureCredential } from "@azure/identity"; + +const subscriptionId = "00000000-0000-0000-0000-000000000000"; +const client = new EdgeOrderClient(new DefaultAzureCredential(), subscriptionId); +``` + +For browser environments, use the `InteractiveBrowserCredential` from the `@azure/identity` package to authenticate. + +```ts snippet:ReadmeSampleCreateClient_Browser +import { InteractiveBrowserCredential } from "@azure/identity"; +import { EdgeOrderClient } from "@azure/arm-edgeorder"; + +const credential = new InteractiveBrowserCredential({ + tenantId: "", + clientId: "" + }); +const client = new EdgeOrderClient(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 + +### EdgeOrderClient + +`EdgeOrderClient` is the primary interface for developers using the Azure EdgeOrder client library. Explore the methods on this client object to understand the different features of the Azure EdgeOrder 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`: + +```ts snippet:SetLogLevel +import { setLogLevel } from "@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/azure-sdk-for-js/tree/main/sdk/edgeorder/arm-edgeorder/samples) 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) + +[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/edgeorder/arm-edgeorder/api-extractor.json b/sdk/edgeorder/arm-edgeorder/api-extractor.json new file mode 100644 index 000000000000..af175497306d --- /dev/null +++ b/sdk/edgeorder/arm-edgeorder/api-extractor.json @@ -0,0 +1,31 @@ +{ + "$schema": "https://developer.microsoft.com/json-schemas/api-extractor/v7/api-extractor.schema.json", + "mainEntryPointFilePath": "dist/esm/index.d.ts", + "docModel": { + "enabled": true + }, + "apiReport": { + "enabled": true, + "reportFolder": "./review" + }, + "dtsRollup": { + "enabled": true, + "untrimmedFilePath": "", + "publicTrimmedFilePath": "dist/arm-edgeorder.d.ts" + }, + "messages": { + "tsdocMessageReporting": { + "default": { + "logLevel": "none" + } + }, + "extractorMessageReporting": { + "ae-missing-release-tag": { + "logLevel": "none" + }, + "ae-unresolved-link": { + "logLevel": "none" + } + } + } +} diff --git a/sdk/edgeorder/arm-edgeorder/eslint.config.mjs b/sdk/edgeorder/arm-edgeorder/eslint.config.mjs new file mode 100644 index 000000000000..6d2f8a5914c3 --- /dev/null +++ b/sdk/edgeorder/arm-edgeorder/eslint.config.mjs @@ -0,0 +1,14 @@ +import azsdkEslint from "@azure/eslint-plugin-azure-sdk"; + +export default azsdkEslint.config([ + { + rules: { + "@azure/azure-sdk/ts-modules-only-named": "warn", + "@azure/azure-sdk/ts-package-json-types": "warn", + "@azure/azure-sdk/ts-package-json-engine-is-present": "warn", + "@azure/azure-sdk/ts-package-json-files-required": "off", + "@azure/azure-sdk/ts-package-json-main-is-cjs": "off", + "tsdoc/syntax": "warn", + }, + }, +]); diff --git a/sdk/edgeorder/arm-edgeorder/package.json b/sdk/edgeorder/arm-edgeorder/package.json new file mode 100644 index 000000000000..8041f4a23f65 --- /dev/null +++ b/sdk/edgeorder/arm-edgeorder/package.json @@ -0,0 +1,297 @@ +{ + "name": "@azure/arm-edgeorder", + "version": "1.0.0", + "description": "A generated SDK for EdgeOrderClient.", + "engines": { + "node": ">=18.0.0" + }, + "sideEffects": false, + "autoPublish": false, + "tshy": { + "exports": { + "./package.json": "./package.json", + ".": "./src/index.ts", + "./api": "./src/api/index.ts", + "./api/ordersOperationGroup": "./src/api/ordersOperationGroup/index.ts", + "./api/productsAndConfigurationsOperationGroup": "./src/api/productsAndConfigurationsOperationGroup/index.ts", + "./api/orderResources": "./src/api/orderResources/index.ts", + "./api/orderItemResources": "./src/api/orderItemResources/index.ts", + "./api/addressResources": "./src/api/addressResources/index.ts", + "./api/operations": "./src/api/operations/index.ts", + "./models": "./src/models/index.ts" + }, + "dialects": [ + "esm", + "commonjs" + ], + "esmDialects": [ + "browser", + "react-native" + ], + "selfLink": false, + "project": "./tsconfig.src.json" + }, + "type": "module", + "keywords": [ + "node", + "azure", + "cloud", + "typescript", + "browser", + "isomorphic" + ], + "author": "Microsoft Corporation", + "license": "MIT", + "files": [ + "dist/", + "README.md", + "LICENSE", + "review/", + "CHANGELOG.md" + ], + "sdk-type": "mgmt", + "repository": "github:Azure/azure-sdk-for-js", + "bugs": { + "url": "https://github.com/Azure/azure-sdk-for-js/issues" + }, + "homepage": "https://github.com/Azure/azure-sdk-for-js/tree/main/sdk/edgeorder/arm-edgeorder/README.md", + "prettier": "@azure/eslint-plugin-azure-sdk/prettier.json", + "//metadata": { + "constantPaths": [ + { + "path": "src/api/edgeOrderContext.ts", + "prefix": "userAgentInfo" + } + ] + }, + "dependencies": { + "@azure-rest/core-client": "^2.3.1", + "@azure/abort-controller": "^2.1.2", + "@azure/core-auth": "^1.9.0", + "@azure/core-lro": "^3.1.0", + "@azure/core-rest-pipeline": "^1.20.0", + "@azure/core-util": "^1.12.0", + "@azure/logger": "^1.2.0", + "tslib": "^2.8.1" + }, + "devDependencies": { + "@azure-tools/test-credential": "^2.0.0", + "@azure-tools/test-recorder": "^4.1.0", + "@azure-tools/test-utils-vitest": "^1.0.0", + "@azure/dev-tool": "^1.0.0", + "@azure/eslint-plugin-azure-sdk": "^3.0.0", + "@azure/identity": "^4.9.1", + "@types/node": "^18.0.0", + "@vitest/browser": "^3.0.9", + "@vitest/coverage-istanbul": "^3.0.9", + "dotenv": "^16.0.0", + "eslint": "^9.9.0", + "playwright": "^1.52.0", + "typescript": "~5.8.2", + "vitest": "^3.0.9" + }, + "scripts": { + "build": "npm run clean && dev-tool run build-package && dev-tool run extract-api", + "build:samples": "tsc -p tsconfig.samples.json && dev-tool samples publish -f", + "build:test": "npm run clean && dev-tool run build-package && dev-tool run build-test", + "check-format": "dev-tool run vendored prettier --list-different --config ../../../.prettierrc.json --ignore-path ../../../.prettierignore \"src/**/*.{ts,cts,mts}\" \"test/**/*.{ts,cts,mts}\" \"*.{js,cjs,mjs,json}\" \"samples-dev/*.ts\"", + "clean": "dev-tool run vendored rimraf --glob dist dist-browser dist-esm test-dist temp types *.tgz *.log", + "execute:samples": "dev-tool samples run samples-dev", + "extract-api": "dev-tool run vendored rimraf review && dev-tool run extract-api", + "format": "dev-tool run vendored prettier --write --config ../../../.prettierrc.json --ignore-path ../../../.prettierignore \"src/**/*.{ts,cts,mts}\" \"test/**/*.{ts,cts,mts}\" \"*.{js,cjs,mjs,json}\" \"samples-dev/*.ts\"", + "generate:client": "echo skipped", + "integration-test": "npm run integration-test:node && npm run integration-test:browser", + "integration-test:browser": "echo skipped", + "integration-test:node": "echo skipped", + "lint": "eslint package.json api-extractor.json src test", + "lint:fix": "eslint package.json api-extractor.json src test --fix --fix-type [problem,suggestion]", + "minify": "dev-tool run vendored uglifyjs -c -m --comments --source-map \"content='./dist/index.js.map'\" -o ./dist/index.min.js ./dist/index.js", + "pack": "npm pack 2>&1", + "test": "npm run clean && dev-tool run build-package && npm run unit-test:node && dev-tool run bundle && npm run unit-test:browser && npm run integration-test", + "test:browser": "echo skipped", + "test:node": "dev-tool run test:vitest", + "unit-test": "npm run unit-test:node && npm run unit-test:browser", + "unit-test:browser": "npm run build:test && dev-tool run test:vitest --browser", + "unit-test:node": "dev-tool run test:vitest", + "update-snippets": "dev-tool run update-snippets", + "test:node:esm": "dev-tool run test:vitest --esm" + }, + "//sampleConfiguration": { + "productName": "@azure/arm-edgeorder", + "productSlugs": [ + "azure" + ], + "disableDocsMs": true, + "apiRefLink": "https://learn.microsoft.com/javascript/api/@azure/arm-edgeorder?view=azure-node-preview" + }, + "browser": "./dist/browser/index.js", + "react-native": "./dist/react-native/index.js", + "exports": { + "./package.json": "./package.json", + ".": { + "browser": { + "types": "./dist/browser/index.d.ts", + "default": "./dist/browser/index.js" + }, + "react-native": { + "types": "./dist/react-native/index.d.ts", + "default": "./dist/react-native/index.js" + }, + "import": { + "types": "./dist/esm/index.d.ts", + "default": "./dist/esm/index.js" + }, + "require": { + "types": "./dist/commonjs/index.d.ts", + "default": "./dist/commonjs/index.js" + } + }, + "./api": { + "browser": { + "types": "./dist/browser/api/index.d.ts", + "default": "./dist/browser/api/index.js" + }, + "react-native": { + "types": "./dist/react-native/api/index.d.ts", + "default": "./dist/react-native/api/index.js" + }, + "import": { + "types": "./dist/esm/api/index.d.ts", + "default": "./dist/esm/api/index.js" + }, + "require": { + "types": "./dist/commonjs/api/index.d.ts", + "default": "./dist/commonjs/api/index.js" + } + }, + "./api/ordersOperationGroup": { + "browser": { + "types": "./dist/browser/api/ordersOperationGroup/index.d.ts", + "default": "./dist/browser/api/ordersOperationGroup/index.js" + }, + "react-native": { + "types": "./dist/react-native/api/ordersOperationGroup/index.d.ts", + "default": "./dist/react-native/api/ordersOperationGroup/index.js" + }, + "import": { + "types": "./dist/esm/api/ordersOperationGroup/index.d.ts", + "default": "./dist/esm/api/ordersOperationGroup/index.js" + }, + "require": { + "types": "./dist/commonjs/api/ordersOperationGroup/index.d.ts", + "default": "./dist/commonjs/api/ordersOperationGroup/index.js" + } + }, + "./api/productsAndConfigurationsOperationGroup": { + "browser": { + "types": "./dist/browser/api/productsAndConfigurationsOperationGroup/index.d.ts", + "default": "./dist/browser/api/productsAndConfigurationsOperationGroup/index.js" + }, + "react-native": { + "types": "./dist/react-native/api/productsAndConfigurationsOperationGroup/index.d.ts", + "default": "./dist/react-native/api/productsAndConfigurationsOperationGroup/index.js" + }, + "import": { + "types": "./dist/esm/api/productsAndConfigurationsOperationGroup/index.d.ts", + "default": "./dist/esm/api/productsAndConfigurationsOperationGroup/index.js" + }, + "require": { + "types": "./dist/commonjs/api/productsAndConfigurationsOperationGroup/index.d.ts", + "default": "./dist/commonjs/api/productsAndConfigurationsOperationGroup/index.js" + } + }, + "./api/orderResources": { + "browser": { + "types": "./dist/browser/api/orderResources/index.d.ts", + "default": "./dist/browser/api/orderResources/index.js" + }, + "react-native": { + "types": "./dist/react-native/api/orderResources/index.d.ts", + "default": "./dist/react-native/api/orderResources/index.js" + }, + "import": { + "types": "./dist/esm/api/orderResources/index.d.ts", + "default": "./dist/esm/api/orderResources/index.js" + }, + "require": { + "types": "./dist/commonjs/api/orderResources/index.d.ts", + "default": "./dist/commonjs/api/orderResources/index.js" + } + }, + "./api/orderItemResources": { + "browser": { + "types": "./dist/browser/api/orderItemResources/index.d.ts", + "default": "./dist/browser/api/orderItemResources/index.js" + }, + "react-native": { + "types": "./dist/react-native/api/orderItemResources/index.d.ts", + "default": "./dist/react-native/api/orderItemResources/index.js" + }, + "import": { + "types": "./dist/esm/api/orderItemResources/index.d.ts", + "default": "./dist/esm/api/orderItemResources/index.js" + }, + "require": { + "types": "./dist/commonjs/api/orderItemResources/index.d.ts", + "default": "./dist/commonjs/api/orderItemResources/index.js" + } + }, + "./api/addressResources": { + "browser": { + "types": "./dist/browser/api/addressResources/index.d.ts", + "default": "./dist/browser/api/addressResources/index.js" + }, + "react-native": { + "types": "./dist/react-native/api/addressResources/index.d.ts", + "default": "./dist/react-native/api/addressResources/index.js" + }, + "import": { + "types": "./dist/esm/api/addressResources/index.d.ts", + "default": "./dist/esm/api/addressResources/index.js" + }, + "require": { + "types": "./dist/commonjs/api/addressResources/index.d.ts", + "default": "./dist/commonjs/api/addressResources/index.js" + } + }, + "./api/operations": { + "browser": { + "types": "./dist/browser/api/operations/index.d.ts", + "default": "./dist/browser/api/operations/index.js" + }, + "react-native": { + "types": "./dist/react-native/api/operations/index.d.ts", + "default": "./dist/react-native/api/operations/index.js" + }, + "import": { + "types": "./dist/esm/api/operations/index.d.ts", + "default": "./dist/esm/api/operations/index.js" + }, + "require": { + "types": "./dist/commonjs/api/operations/index.d.ts", + "default": "./dist/commonjs/api/operations/index.js" + } + }, + "./models": { + "browser": { + "types": "./dist/browser/models/index.d.ts", + "default": "./dist/browser/models/index.js" + }, + "react-native": { + "types": "./dist/react-native/models/index.d.ts", + "default": "./dist/react-native/models/index.js" + }, + "import": { + "types": "./dist/esm/models/index.d.ts", + "default": "./dist/esm/models/index.js" + }, + "require": { + "types": "./dist/commonjs/models/index.d.ts", + "default": "./dist/commonjs/models/index.js" + } + } + }, + "main": "./dist/commonjs/index.js", + "types": "./dist/commonjs/index.d.ts", + "module": "./dist/esm/index.js" +} diff --git a/sdk/edgeorder/arm-edgeorder/review/arm-edgeorder-api-addressResources.api.md b/sdk/edgeorder/arm-edgeorder/review/arm-edgeorder-api-addressResources.api.md new file mode 100644 index 000000000000..1b2028916897 --- /dev/null +++ b/sdk/edgeorder/arm-edgeorder/review/arm-edgeorder-api-addressResources.api.md @@ -0,0 +1,66 @@ +## API Report File for "@azure/arm-edgeorder" + +> Do not edit this file. It is a report generated by [API Extractor](https://api-extractor.com/). + +```ts + +import { Client } from '@azure-rest/core-client'; +import { OperationOptions } from '@azure-rest/core-client'; +import { OperationState } from '@azure/core-lro'; +import { PollerLike } from '@azure/core-lro'; + +// @public +export function $delete(context: EdgeOrderContext, resourceGroupName: string, addressName: string, options?: AddressResourcesDeleteOptionalParams): PollerLike, void>; + +// @public +export interface AddressResourcesCreateOptionalParams extends OperationOptions { + updateIntervalInMs?: number; +} + +// @public +export interface AddressResourcesDeleteOptionalParams extends OperationOptions { + updateIntervalInMs?: number; +} + +// @public +export interface AddressResourcesGetOptionalParams extends OperationOptions { +} + +// @public +export interface AddressResourcesListByResourceGroupOptionalParams extends OperationOptions { + filter?: string; + skipToken?: string; + top?: number; +} + +// @public +export interface AddressResourcesListBySubscriptionOptionalParams extends OperationOptions { + filter?: string; + skipToken?: string; + top?: number; +} + +// @public +export interface AddressResourcesUpdateOptionalParams extends OperationOptions { + ifMatch?: string; + updateIntervalInMs?: number; +} + +// @public +export function create(context: EdgeOrderContext, resourceGroupName: string, addressName: string, addressResource: AddressResource, options?: AddressResourcesCreateOptionalParams): PollerLike, void>; + +// @public +export function get(context: EdgeOrderContext, resourceGroupName: string, addressName: string, options?: AddressResourcesGetOptionalParams): Promise; + +// @public +export function listByResourceGroup(context: EdgeOrderContext, resourceGroupName: string, options?: AddressResourcesListByResourceGroupOptionalParams): PagedAsyncIterableIterator; + +// @public +export function listBySubscription(context: EdgeOrderContext, options?: AddressResourcesListBySubscriptionOptionalParams): PagedAsyncIterableIterator; + +// @public +export function update(context: EdgeOrderContext, resourceGroupName: string, addressName: string, addressUpdateParameter: AddressUpdateParameter, options?: AddressResourcesUpdateOptionalParams): PollerLike, AddressResource>; + +// (No @packageDocumentation comment for this package) + +``` diff --git a/sdk/edgeorder/arm-edgeorder/review/arm-edgeorder-api-operations.api.md b/sdk/edgeorder/arm-edgeorder/review/arm-edgeorder-api-operations.api.md new file mode 100644 index 000000000000..bc4870a0b0c5 --- /dev/null +++ b/sdk/edgeorder/arm-edgeorder/review/arm-edgeorder-api-operations.api.md @@ -0,0 +1,19 @@ +## API Report File for "@azure/arm-edgeorder" + +> Do not edit this file. It is a report generated by [API Extractor](https://api-extractor.com/). + +```ts + +import { Client } from '@azure-rest/core-client'; +import { OperationOptions } from '@azure-rest/core-client'; + +// @public +export function list(context: EdgeOrderContext, options?: OperationsListOptionalParams): PagedAsyncIterableIterator; + +// @public +export interface OperationsListOptionalParams extends OperationOptions { +} + +// (No @packageDocumentation comment for this package) + +``` diff --git a/sdk/edgeorder/arm-edgeorder/review/arm-edgeorder-api-orderItemResources.api.md b/sdk/edgeorder/arm-edgeorder/review/arm-edgeorder-api-orderItemResources.api.md new file mode 100644 index 000000000000..69ced225a960 --- /dev/null +++ b/sdk/edgeorder/arm-edgeorder/review/arm-edgeorder-api-orderItemResources.api.md @@ -0,0 +1,84 @@ +## API Report File for "@azure/arm-edgeorder" + +> Do not edit this file. It is a report generated by [API Extractor](https://api-extractor.com/). + +```ts + +import { Client } from '@azure-rest/core-client'; +import { OperationOptions } from '@azure-rest/core-client'; +import { OperationState } from '@azure/core-lro'; +import { PollerLike } from '@azure/core-lro'; + +// @public +export function $delete(context: EdgeOrderContext, resourceGroupName: string, orderItemName: string, options?: OrderItemResourcesDeleteOptionalParams): PollerLike, void>; + +// @public +export function cancel(context: EdgeOrderContext, resourceGroupName: string, orderItemName: string, cancellationReason: CancellationReason, options?: OrderItemResourcesCancelOptionalParams): Promise; + +// @public +export function create(context: EdgeOrderContext, resourceGroupName: string, orderItemName: string, orderItemResource: OrderItemResource, options?: OrderItemResourcesCreateOptionalParams): PollerLike, void>; + +// @public +export function get(context: EdgeOrderContext, resourceGroupName: string, orderItemName: string, options?: OrderItemResourcesGetOptionalParams): Promise; + +// @public +export function listByResourceGroup(context: EdgeOrderContext, resourceGroupName: string, options?: OrderItemResourcesListByResourceGroupOptionalParams): PagedAsyncIterableIterator; + +// @public +export function listBySubscription(context: EdgeOrderContext, options?: OrderItemResourcesListBySubscriptionOptionalParams): PagedAsyncIterableIterator; + +// @public +export interface OrderItemResourcesCancelOptionalParams extends OperationOptions { +} + +// @public +export interface OrderItemResourcesCreateOptionalParams extends OperationOptions { + updateIntervalInMs?: number; +} + +// @public +export interface OrderItemResourcesDeleteOptionalParams extends OperationOptions { + updateIntervalInMs?: number; +} + +// @public +export interface OrderItemResourcesGetOptionalParams extends OperationOptions { + expand?: string; +} + +// @public +export interface OrderItemResourcesListByResourceGroupOptionalParams extends OperationOptions { + expand?: string; + filter?: string; + skipToken?: string; + top?: number; +} + +// @public +export interface OrderItemResourcesListBySubscriptionOptionalParams extends OperationOptions { + expand?: string; + filter?: string; + skipToken?: string; + top?: number; +} + +// @public +export interface OrderItemResourcesReturnOrderItemOptionalParams extends OperationOptions { + updateIntervalInMs?: number; +} + +// @public +export interface OrderItemResourcesUpdateOptionalParams extends OperationOptions { + ifMatch?: string; + updateIntervalInMs?: number; +} + +// @public +export function returnOrderItem(context: EdgeOrderContext, resourceGroupName: string, orderItemName: string, returnOrderItemDetails: ReturnOrderItemDetails, options?: OrderItemResourcesReturnOrderItemOptionalParams): PollerLike, OkResponse>; + +// @public +export function update(context: EdgeOrderContext, resourceGroupName: string, orderItemName: string, orderItemUpdateParameter: OrderItemUpdateParameter, options?: OrderItemResourcesUpdateOptionalParams): PollerLike, OrderItemResource>; + +// (No @packageDocumentation comment for this package) + +``` diff --git a/sdk/edgeorder/arm-edgeorder/review/arm-edgeorder-api-orderResources.api.md b/sdk/edgeorder/arm-edgeorder/review/arm-edgeorder-api-orderResources.api.md new file mode 100644 index 000000000000..f67be3654bee --- /dev/null +++ b/sdk/edgeorder/arm-edgeorder/review/arm-edgeorder-api-orderResources.api.md @@ -0,0 +1,19 @@ +## API Report File for "@azure/arm-edgeorder" + +> Do not edit this file. It is a report generated by [API Extractor](https://api-extractor.com/). + +```ts + +import { Client } from '@azure-rest/core-client'; +import { OperationOptions } from '@azure-rest/core-client'; + +// @public +export function get(context: EdgeOrderContext, resourceGroupName: string, location: string, orderName: string, options?: OrderResourcesGetOptionalParams): Promise; + +// @public +export interface OrderResourcesGetOptionalParams extends OperationOptions { +} + +// (No @packageDocumentation comment for this package) + +``` diff --git a/sdk/edgeorder/arm-edgeorder/review/arm-edgeorder-api-ordersOperationGroup.api.md b/sdk/edgeorder/arm-edgeorder/review/arm-edgeorder-api-ordersOperationGroup.api.md new file mode 100644 index 000000000000..e5f727b2a29a --- /dev/null +++ b/sdk/edgeorder/arm-edgeorder/review/arm-edgeorder-api-ordersOperationGroup.api.md @@ -0,0 +1,30 @@ +## API Report File for "@azure/arm-edgeorder" + +> Do not edit this file. It is a report generated by [API Extractor](https://api-extractor.com/). + +```ts + +import { Client } from '@azure-rest/core-client'; +import { OperationOptions } from '@azure-rest/core-client'; + +// @public +export function listByResourceGroup(context: EdgeOrderContext, resourceGroupName: string, options?: OrdersOperationGroupListByResourceGroupOptionalParams): PagedAsyncIterableIterator; + +// @public +export function listBySubscription(context: EdgeOrderContext, options?: OrdersOperationGroupListBySubscriptionOptionalParams): PagedAsyncIterableIterator; + +// @public +export interface OrdersOperationGroupListByResourceGroupOptionalParams extends OperationOptions { + skipToken?: string; + top?: number; +} + +// @public +export interface OrdersOperationGroupListBySubscriptionOptionalParams extends OperationOptions { + skipToken?: string; + top?: number; +} + +// (No @packageDocumentation comment for this package) + +``` diff --git a/sdk/edgeorder/arm-edgeorder/review/arm-edgeorder-api-productsAndConfigurationsOperationGroup.api.md b/sdk/edgeorder/arm-edgeorder/review/arm-edgeorder-api-productsAndConfigurationsOperationGroup.api.md new file mode 100644 index 000000000000..e77009814d4d --- /dev/null +++ b/sdk/edgeorder/arm-edgeorder/review/arm-edgeorder-api-productsAndConfigurationsOperationGroup.api.md @@ -0,0 +1,37 @@ +## API Report File for "@azure/arm-edgeorder" + +> Do not edit this file. It is a report generated by [API Extractor](https://api-extractor.com/). + +```ts + +import { Client } from '@azure-rest/core-client'; +import { OperationOptions } from '@azure-rest/core-client'; + +// @public +export function listConfigurations(context: EdgeOrderContext, configurationsRequest: ConfigurationsRequest, options?: ProductsAndConfigurationsOperationGroupListConfigurationsOptionalParams): PagedAsyncIterableIterator; + +// @public +export function listProductFamilies(context: EdgeOrderContext, productFamiliesRequest: ProductFamiliesRequest, options?: ProductsAndConfigurationsOperationGroupListProductFamiliesOptionalParams): PagedAsyncIterableIterator; + +// @public +export function listProductFamiliesMetadata(context: EdgeOrderContext, options?: ProductsAndConfigurationsOperationGroupListProductFamiliesMetadataOptionalParams): PagedAsyncIterableIterator; + +// @public +export interface ProductsAndConfigurationsOperationGroupListConfigurationsOptionalParams extends OperationOptions { + skipToken?: string; +} + +// @public +export interface ProductsAndConfigurationsOperationGroupListProductFamiliesMetadataOptionalParams extends OperationOptions { + skipToken?: string; +} + +// @public +export interface ProductsAndConfigurationsOperationGroupListProductFamiliesOptionalParams extends OperationOptions { + expand?: string; + skipToken?: string; +} + +// (No @packageDocumentation comment for this package) + +``` diff --git a/sdk/edgeorder/arm-edgeorder/review/arm-edgeorder-api.api.md b/sdk/edgeorder/arm-edgeorder/review/arm-edgeorder-api.api.md new file mode 100644 index 000000000000..f5c08d0cd0d4 --- /dev/null +++ b/sdk/edgeorder/arm-edgeorder/review/arm-edgeorder-api.api.md @@ -0,0 +1,27 @@ +## API Report File for "@azure/arm-edgeorder" + +> Do not edit this file. It is a report generated by [API Extractor](https://api-extractor.com/). + +```ts + +import { Client } from '@azure-rest/core-client'; +import { ClientOptions } from '@azure-rest/core-client'; +import { TokenCredential } from '@azure/core-auth'; + +// @public +export function createEdgeOrder(credential: TokenCredential, subscriptionId: string, options?: EdgeOrderClientOptionalParams): EdgeOrderContext; + +// @public +export interface EdgeOrderClientOptionalParams extends ClientOptions { + apiVersion?: string; +} + +// @public +export interface EdgeOrderContext extends Client { + apiVersion: string; + subscriptionId: string; +} + +// (No @packageDocumentation comment for this package) + +``` diff --git a/sdk/edgeorder/arm-edgeorder/review/arm-edgeorder-models.api.md b/sdk/edgeorder/arm-edgeorder/review/arm-edgeorder-models.api.md new file mode 100644 index 000000000000..c52870083153 --- /dev/null +++ b/sdk/edgeorder/arm-edgeorder/review/arm-edgeorder-models.api.md @@ -0,0 +1,993 @@ +## API Report File for "@azure/arm-edgeorder" + +> Do not edit this file. It is a report generated by [API Extractor](https://api-extractor.com/). + +```ts + +// @public +export type ActionStatusEnum = string; + +// @public +export type ActionType = string; + +// @public +export interface AdditionalConfiguration { + hierarchyInformation: HierarchyInformation; + provisioningDetails?: ProvisioningDetails[]; + quantity: number; +} + +// @public +export type AddressClassification = string; + +// @public +export interface AddressDetails { + forwardAddress: AddressProperties; + readonly returnAddress?: AddressProperties; +} + +// @public +export interface AddressProperties { + addressClassification?: AddressClassification; + readonly addressValidationStatus?: AddressValidationStatus; + contactDetails?: ContactDetails; + readonly provisioningState?: ProvisioningState; + shippingAddress?: ShippingAddress; +} + +// @public +export interface AddressResource extends TrackedResource { + properties: AddressProperties; +} + +// @public +export type AddressType = string; + +// @public +export interface AddressUpdateParameter { + properties?: AddressUpdateProperties; + tags?: Record; +} + +// @public +export interface AddressUpdateProperties { + contactDetails?: ContactDetails; + shippingAddress?: ShippingAddress; +} + +// @public +export type AddressValidationStatus = string; + +// @public +export type AutoProvisioningStatus = string; + +// @public +export interface AvailabilityInformation { + readonly availabilityStage?: AvailabilityStage; + readonly disabledReason?: DisabledReason; + readonly disabledReasonMessage?: string; +} + +// @public +export type AvailabilityStage = string; + +// @public +export interface BasicInformation { + readonly availabilityInformation?: AvailabilityInformation; + readonly costInformation?: CostInformation; + readonly description?: Description; + readonly displayName?: string; + readonly fulfilledBy?: FulfillmentType; + readonly hierarchyInformation?: HierarchyInformation; + readonly imageInformation?: ImageInformation[]; +} + +// @public +export interface BillingMeterDetails { + readonly frequency?: string; + readonly meterDetails?: MeterDetailsUnion; + readonly meteringType?: MeteringType; + readonly name?: string; + readonly termTypeDetails?: TermTypeDetails; +} + +// @public +export type BillingType = string; + +// @public +export interface CancellationReason { + reason: string; +} + +// @public +export interface CategoryInformation { + categoryDisplayName?: string; + categoryName?: string; + description?: string; + links?: Link[]; +} + +// @public +export type ChargingType = string; + +// @public +export interface ChildConfiguration { + readonly properties?: ChildConfigurationProperties; +} + +// @public +export interface ChildConfigurationFilter { + childConfigurationTypes?: ChildConfigurationType[]; + hierarchyInformations?: HierarchyInformation[]; +} + +// @public +export interface ChildConfigurationProperties { + readonly availabilityInformation?: AvailabilityInformation; + readonly childConfigurationType?: ChildConfigurationType; + readonly childConfigurationTypes?: ChildConfigurationType[]; + readonly costInformation?: CostInformation; + readonly description?: Description; + readonly dimensions?: Dimensions; + readonly displayName?: string; + readonly filterableProperties?: FilterableProperty[]; + readonly fulfilledBy?: FulfillmentType; + readonly groupedChildConfigurations?: GroupedChildConfigurations[]; + readonly hierarchyInformation?: HierarchyInformation; + readonly imageInformation?: ImageInformation[]; + readonly isPartOfBaseConfiguration?: boolean; + readonly maximumQuantity?: number; + readonly minimumQuantity?: number; + readonly provisioningSupport?: ProvisioningSupport; + readonly specifications?: Specification[]; + readonly supportedTermCommitmentDurations?: string[]; +} + +// @public +export type ChildConfigurationType = string; + +// @public +export interface CommonProperties extends BasicInformation { + readonly filterableProperties?: FilterableProperty[]; +} + +// @public +export interface Configuration { + readonly properties?: ConfigurationProperties; +} + +// @public +export interface ConfigurationDeviceDetails { + readonly deviceDetails?: DeviceDetails[]; + displayInfo?: DisplayInfo; + readonly hierarchyInformation?: HierarchyInformation; + readonly identificationType?: IdentificationType; + readonly quantity?: number; + readonly termCommitmentInformation?: TermCommitmentInformation; +} + +// @public +export interface ConfigurationFilter { + childConfigurationFilter?: ChildConfigurationFilter; + filterableProperty?: FilterableProperty[]; + hierarchyInformation: HierarchyInformation; +} + +// @public +export interface ConfigurationProperties extends CommonProperties { + readonly childConfigurationTypes?: ChildConfigurationType[]; + readonly dimensions?: Dimensions; + readonly groupedChildConfigurations?: GroupedChildConfigurations[]; + readonly provisioningSupport?: ProvisioningSupport; + readonly specifications?: Specification[]; + readonly supportedTermCommitmentDurations?: string[]; +} + +// @public +export interface ConfigurationsRequest { + configurationFilter?: ConfigurationFilter; + customerSubscriptionDetails?: CustomerSubscriptionDetails; +} + +// @public +export interface ContactDetails { + contactName?: string; + emailList?: string[]; + mobile?: string; + phone?: string; + phoneExtension?: string; +} + +// @public +export interface CostInformation { + readonly billingInfoUrl?: string; + readonly billingMeterDetails?: BillingMeterDetails[]; +} + +// @public +export type CreatedByType = string; + +// @public +export interface CustomerSubscriptionDetails { + locationPlacementId?: string; + quotaId: string; + registeredFeatures?: CustomerSubscriptionRegisteredFeatures[]; +} + +// @public +export interface CustomerSubscriptionRegisteredFeatures { + name?: string; + state?: string; +} + +// @public +export interface Description { + readonly attributes?: string[]; + readonly descriptionType?: DescriptionType; + readonly keywords?: string[]; + readonly links?: Link[]; + readonly longDescription?: string; + readonly shortDescription?: string; +} + +// @public +export type DescriptionType = string; + +// @public +export interface DeviceDetails { + readonly displaySerialNumber?: string; + readonly managementResourceId?: string; + readonly managementResourceTenantId?: string; + readonly provisioningDetails?: ProvisioningDetails; + readonly provisioningSupport?: ProvisioningSupport; + readonly serialNumber?: string; +} + +// @public +export interface DevicePresenceVerificationDetails { + readonly message?: string; + readonly status?: DevicePresenceVerificationStatus; +} + +// @public +export type DevicePresenceVerificationStatus = string; + +// @public +export interface Dimensions { + readonly depth?: number; + readonly height?: number; + readonly length?: number; + readonly lengthHeightUnit?: LengthHeightUnit; + readonly weight?: number; + readonly weightUnit?: WeightMeasurementUnit; + readonly width?: number; +} + +// @public +export type DisabledReason = string; + +// @public +export interface DisplayInfo { + readonly configurationDisplayName?: string; + readonly productFamilyDisplayName?: string; +} + +// @public +export type DoubleEncryptionStatus = string; + +// @public +export interface EncryptionPreferences { + doubleEncryptionStatus?: DoubleEncryptionStatus; +} + +// @public +export interface ErrorAdditionalInfo { + readonly info?: Record; + readonly type?: string; +} + +// @public +export interface ErrorDetail { + readonly additionalInfo?: ErrorAdditionalInfo[]; + readonly code?: string; + readonly details?: ErrorDetail[]; + readonly message?: string; + readonly target?: string; +} + +// @public +export interface ErrorResponse { + error?: ErrorDetail; +} + +// @public +export interface FilterableProperty { + supportedValues: string[]; + type: SupportedFilterTypes; +} + +// @public +export interface ForwardShippingDetails { + readonly carrierDisplayName?: string; + readonly carrierName?: string; + readonly trackingId?: string; + readonly trackingUrl?: string; +} + +// @public +export type FulfillmentType = string; + +// @public +export interface GroupedChildConfigurations { + readonly categoryInformation?: CategoryInformation; + readonly childConfigurations?: ChildConfiguration[]; +} + +// @public +export interface HierarchyInformation { + configurationIdDisplayName?: string; + configurationName?: string; + productFamilyName?: string; + productLineName?: string; + productName?: string; +} + +// @public +export type IdentificationType = string; + +// @public +export interface ImageInformation { + readonly imageType?: ImageType; + readonly imageUrl?: string; +} + +// @public +export type ImageType = string; + +// @public +export enum KnownActionStatusEnum { + Allowed = "Allowed", + NotAllowed = "NotAllowed" +} + +// @public +export enum KnownActionType { + Internal = "Internal" +} + +// @public +export enum KnownAddressClassification { + Shipping = "Shipping", + Site = "Site" +} + +// @public +export enum KnownAddressType { + Commercial = "Commercial", + None = "None", + Residential = "Residential" +} + +// @public +export enum KnownAddressValidationStatus { + Ambiguous = "Ambiguous", + Invalid = "Invalid", + Valid = "Valid" +} + +// @public +export enum KnownAutoProvisioningStatus { + Disabled = "Disabled", + Enabled = "Enabled" +} + +// @public +export enum KnownAvailabilityStage { + Available = "Available", + ComingSoon = "ComingSoon", + Deprecated = "Deprecated", + Discoverable = "Discoverable", + Preview = "Preview", + Signup = "Signup", + Unavailable = "Unavailable" +} + +// @public +export enum KnownBillingType { + Pav2 = "Pav2", + Purchase = "Purchase" +} + +// @public +export enum KnownChargingType { + PerDevice = "PerDevice", + PerOrder = "PerOrder" +} + +// @public +export enum KnownChildConfigurationType { + AdditionalConfiguration = "AdditionalConfiguration", + DeviceConfiguration = "DeviceConfiguration" +} + +// @public +export enum KnownCreatedByType { + Application = "Application", + Key = "Key", + ManagedIdentity = "ManagedIdentity", + User = "User" +} + +// @public +export enum KnownDescriptionType { + Base = "Base" +} + +// @public +export enum KnownDevicePresenceVerificationStatus { + Completed = "Completed", + NotInitiated = "NotInitiated" +} + +// @public +export enum KnownDisabledReason { + Country = "Country", + Feature = "Feature", + None = "None", + NoSubscriptionInfo = "NoSubscriptionInfo", + NotAvailable = "NotAvailable", + OfferType = "OfferType", + OutOfStock = "OutOfStock", + Region = "Region" +} + +// @public +export enum KnownDoubleEncryptionStatus { + Disabled = "Disabled", + Enabled = "Enabled" +} + +// @public +export enum KnownFulfillmentType { + External = "External", + Microsoft = "Microsoft" +} + +// @public +export enum KnownIdentificationType { + NotSupported = "NotSupported", + SerialNumber = "SerialNumber" +} + +// @public +export enum KnownImageType { + BulletImage = "BulletImage", + GenericImage = "GenericImage", + MainImage = "MainImage" +} + +// @public +export enum KnownLengthHeightUnit { + CM = "CM", + IN = "IN" +} + +// @public +export enum KnownLinkType { + Discoverable = "Discoverable", + Documentation = "Documentation", + Generic = "Generic", + KnowMore = "KnowMore", + SignUp = "SignUp", + Specification = "Specification", + TermsAndConditions = "TermsAndConditions" +} + +// @public +export enum KnownMeteringType { + Adhoc = "Adhoc", + OneTime = "OneTime", + Recurring = "Recurring" +} + +// @public +export enum KnownNotificationStageName { + Delivered = "Delivered", + Shipped = "Shipped" +} + +// @public +export enum KnownOrderItemCancellationEnum { + Cancellable = "Cancellable", + CancellableWithFee = "CancellableWithFee", + NotCancellable = "NotCancellable" +} + +// @public +export enum KnownOrderItemReturnEnum { + NotReturnable = "NotReturnable", + Returnable = "Returnable", + ReturnableWithFee = "ReturnableWithFee" +} + +// @public +export enum KnownOrderItemType { + External = "External", + Purchase = "Purchase", + Rental = "Rental" +} + +// @public +export enum KnownOrderMode { + Default = "Default", + DoNotFulfill = "DoNotFulfill" +} + +// @public +export enum KnownOrigin { + System = "system", + User = "user", + UserSystem = "user,system" +} + +// @public +export enum KnownProvisioningState { + Canceled = "Canceled", + Creating = "Creating", + Failed = "Failed", + Succeeded = "Succeeded" +} + +// @public +export enum KnownProvisioningSupport { + CloudBased = "CloudBased", + Manual = "Manual" +} + +// @public +export enum KnownStageName { + Cancelled = "Cancelled", + Confirmed = "Confirmed", + Delivered = "Delivered", + InReview = "InReview", + InUse = "InUse", + Placed = "Placed", + ReadyToSetup = "ReadyToSetup", + ReadyToShip = "ReadyToShip", + ReturnCompleted = "ReturnCompleted", + ReturnedToMicrosoft = "ReturnedToMicrosoft", + ReturnInitiated = "ReturnInitiated", + ReturnPickedUp = "ReturnPickedUp", + Shipped = "Shipped" +} + +// @public +export enum KnownStageStatus { + Cancelled = "Cancelled", + Cancelling = "Cancelling", + Failed = "Failed", + InProgress = "InProgress", + None = "None", + Succeeded = "Succeeded" +} + +// @public +export enum KnownSupportedFilterTypes { + DoubleEncryptionStatus = "DoubleEncryptionStatus", + ShipToCountries = "ShipToCountries" +} + +// @public +export enum KnownTermCommitmentType { + None = "None", + Timed = "Timed", + Trial = "Trial" +} + +// @public +export enum KnownTransportShipmentTypes { + CustomerManaged = "CustomerManaged", + MicrosoftManaged = "MicrosoftManaged" +} + +// @public +export enum KnownVersions { + V20240201 = "2024-02-01" +} + +// @public +export enum KnownWeightMeasurementUnit { + KGS = "KGS", + LBS = "LBS" +} + +// @public +export type LengthHeightUnit = string; + +// @public +export interface Link { + readonly linkType?: LinkType; + readonly linkUrl?: string; +} + +// @public +export type LinkType = string; + +// @public +export interface ManagementResourcePreferences { + preferredManagementResourceId?: string; +} + +// @public +export interface MeterDetails { + billingType: BillingType; + readonly chargingType?: ChargingType; + readonly multiplier?: number; +} + +// @public +export type MeterDetailsUnion = Pav2MeterDetails | PurchaseMeterDetails | MeterDetails; + +// @public +export type MeteringType = string; + +// @public +export interface NotificationPreference { + sendNotification: boolean; + stageName: NotificationStageName; +} + +// @public +export type NotificationStageName = string; + +// @public +export interface OkResponse { +} + +// @public +export interface Operation { + readonly actionType?: ActionType; + display?: OperationDisplay; + readonly isDataAction?: boolean; + readonly name?: string; + readonly origin?: Origin; +} + +// @public +export interface OperationDisplay { + readonly description?: string; + readonly operation?: string; + readonly provider?: string; + readonly resource?: string; +} + +// @public +export type OrderItemCancellationEnum = string; + +// @public +export interface OrderItemDetails { + readonly cancellationReason?: string; + readonly cancellationStatus?: OrderItemCancellationEnum; + readonly currentStage?: StageDetails; + readonly deletionStatus?: ActionStatusEnum; + readonly error?: ErrorDetail; + readonly forwardShippingDetails?: ForwardShippingDetails; + readonly managementRpDetailsList?: ResourceProviderDetails[]; + notificationEmailList?: string[]; + orderItemMode?: OrderMode; + readonly orderItemStageHistory?: StageDetails[]; + orderItemType: OrderItemType; + preferences?: Preferences; + productDetails: ProductDetails; + readonly returnReason?: string; + readonly returnStatus?: OrderItemReturnEnum; + readonly reverseShippingDetails?: ReverseShippingDetails; + siteDetails?: SiteDetails; +} + +// @public +export interface OrderItemDetailsUpdateParameter { + productDetails?: ProductDetailsUpdateParameter; + siteDetails?: SiteDetails; +} + +// @public +export interface OrderItemProperties { + addressDetails?: AddressDetails; + orderId: string; + orderItemDetails: OrderItemDetails; + readonly provisioningState?: ProvisioningState; + readonly startTime?: Date; +} + +// @public +export interface OrderItemResource extends TrackedResource { + identity?: ResourceIdentity; + properties: OrderItemProperties; +} + +// @public +export type OrderItemReturnEnum = string; + +// @public +export type OrderItemType = string; + +// @public +export interface OrderItemUpdateParameter { + identity?: ResourceIdentity; + properties?: OrderItemUpdateProperties; + tags?: Record; +} + +// @public +export interface OrderItemUpdateProperties { + forwardAddress?: AddressProperties; + notificationEmailList?: string[]; + orderItemDetails?: OrderItemDetailsUpdateParameter; + preferences?: Preferences; +} + +// @public +export type OrderMode = string; + +// @public +export interface OrderProperties { + readonly currentStage?: StageDetails; + readonly orderItemIds?: string[]; + readonly orderMode?: OrderMode; + readonly orderStageHistory?: StageDetails[]; +} + +// @public +export interface OrderResource extends ProxyResource { + properties: OrderProperties; +} + +// @public +export type Origin = string; + +// @public +export interface Pav2MeterDetails extends MeterDetails { + billingType: "Pav2"; + readonly meterGuid?: string; +} + +// @public +export interface Preferences { + encryptionPreferences?: EncryptionPreferences; + managementResourcePreferences?: ManagementResourcePreferences; + notificationPreferences?: NotificationPreference[]; + termCommitmentPreferences?: TermCommitmentPreferences; + transportPreferences?: TransportPreferences; +} + +// @public +export interface Product { + readonly properties?: ProductProperties; +} + +// @public +export interface ProductDetails { + readonly childConfigurationDeviceDetails?: ConfigurationDeviceDetails[]; + displayInfo?: DisplayInfo; + hierarchyInformation: HierarchyInformation; + readonly identificationType?: IdentificationType; + optInAdditionalConfigurations?: AdditionalConfiguration[]; + readonly parentDeviceDetails?: DeviceDetails; + parentProvisioningDetails?: ProvisioningDetails; + readonly productDoubleEncryptionStatus?: DoubleEncryptionStatus; + readonly termCommitmentInformation?: TermCommitmentInformation; +} + +// @public +export interface ProductDetailsUpdateParameter { + parentProvisioningDetails?: ProvisioningDetails; +} + +// @public +export interface ProductFamiliesMetadataDetails { + readonly properties?: ProductFamilyProperties; +} + +// @public +export interface ProductFamiliesRequest { + customerSubscriptionDetails?: CustomerSubscriptionDetails; + filterableProperties: Record; +} + +// @public +export interface ProductFamily { + readonly properties?: ProductFamilyProperties; +} + +// @public +export interface ProductFamilyProperties extends CommonProperties { + readonly productLines?: ProductLine[]; + resourceProviderDetails?: ResourceProviderDetails[]; +} + +// @public +export interface ProductLine { + readonly properties?: ProductLineProperties; +} + +// @public +export interface ProductLineProperties extends CommonProperties { + readonly products?: Product[]; +} + +// @public +export interface ProductProperties extends CommonProperties { + readonly configurations?: Configuration[]; +} + +// @public +export interface ProvisioningDetails { + autoProvisioningStatus?: AutoProvisioningStatus; + devicePresenceVerification?: DevicePresenceVerificationDetails; + managementResourceArmId?: string; + provisioningArmId?: string; + provisioningEndPoint?: string; + quantity?: number; + readyToConnectArmId?: string; + serialNumber?: string; + readonly uniqueDeviceIdentifier?: string; + vendorName?: string; +} + +// @public +export type ProvisioningState = string; + +// @public +export type ProvisioningSupport = string; + +// @public +export interface ProxyResource extends Resource { +} + +// @public +export interface PurchaseMeterDetails extends MeterDetails { + billingType: "Purchase"; + readonly productId?: string; + readonly skuId?: string; + readonly termId?: string; +} + +// @public +export interface Resource { + readonly id?: string; + readonly name?: string; + readonly systemData?: SystemData; + readonly type?: string; +} + +// @public +export interface ResourceIdentity { + readonly principalId?: string; + readonly tenantId?: string; + type?: string; + userAssignedIdentities?: Record; +} + +// @public +export interface ResourceProviderDetails { + readonly resourceProviderNamespace?: string; +} + +// @public +export interface ReturnOrderItemDetails { + returnAddress?: AddressProperties; + returnReason: string; + serviceTag?: string; + shippingBoxRequired?: boolean; +} + +// @public +export interface ReverseShippingDetails { + readonly carrierDisplayName?: string; + readonly carrierName?: string; + readonly sasKeyForLabel?: string; + readonly trackingId?: string; + readonly trackingUrl?: string; +} + +// @public +export interface ShippingAddress { + addressType?: AddressType; + city?: string; + companyName?: string; + country: string; + postalCode?: string; + stateOrProvince?: string; + streetAddress1?: string; + streetAddress2?: string; + streetAddress3?: string; + zipExtendedCode?: string; +} + +// @public +export interface SiteDetails { + siteId: string; +} + +// @public +export interface Specification { + readonly name?: string; + readonly value?: string; +} + +// @public +export interface StageDetails { + readonly displayName?: string; + readonly stageName?: StageName; + readonly stageStatus?: StageStatus; + readonly startTime?: Date; +} + +// @public +export type StageName = string; + +// @public +export type StageStatus = string; + +// @public +export type SupportedFilterTypes = string; + +// @public +export interface SystemData { + createdAt?: Date; + createdBy?: string; + createdByType?: CreatedByType; + lastModifiedAt?: Date; + lastModifiedBy?: string; + lastModifiedByType?: CreatedByType; +} + +// @public +export interface TermCommitmentInformation { + readonly pendingDaysForTerm?: number; + termCommitmentType: TermCommitmentType; + readonly termCommitmentTypeDuration?: string; +} + +// @public +export interface TermCommitmentPreferences { + preferredTermCommitmentDuration?: string; + preferredTermCommitmentType: TermCommitmentType; +} + +// @public +export type TermCommitmentType = string; + +// @public +export interface TermTypeDetails { + termType: TermCommitmentType; + termTypeDuration: string; +} + +// @public +export interface TrackedResource extends Resource { + location: string; + tags?: Record; +} + +// @public +export interface TransportPreferences { + preferredShipmentType: TransportShipmentTypes; +} + +// @public +export type TransportShipmentTypes = string; + +// @public +export interface UserAssignedIdentity { + readonly clientId?: string; + readonly principalId?: string; +} + +// @public +export type WeightMeasurementUnit = string; + +// (No @packageDocumentation comment for this package) + +``` diff --git a/sdk/edgeorder/arm-edgeorder/review/arm-edgeorder.api.md b/sdk/edgeorder/arm-edgeorder/review/arm-edgeorder.api.md new file mode 100644 index 000000000000..48f02322f0ee --- /dev/null +++ b/sdk/edgeorder/arm-edgeorder/review/arm-edgeorder.api.md @@ -0,0 +1,1207 @@ +## API Report File for "@azure/arm-edgeorder" + +> Do not edit this file. It is a report generated by [API Extractor](https://api-extractor.com/). + +```ts + +import { AbortSignalLike } from '@azure/abort-controller'; +import { ClientOptions } from '@azure-rest/core-client'; +import { OperationOptions } from '@azure-rest/core-client'; +import { OperationState } from '@azure/core-lro'; +import { PathUncheckedResponse } from '@azure-rest/core-client'; +import { Pipeline } from '@azure/core-rest-pipeline'; +import { PollerLike } from '@azure/core-lro'; +import { TokenCredential } from '@azure/core-auth'; + +// @public +export type ActionStatusEnum = string; + +// @public +export type ActionType = string; + +// @public +export interface AdditionalConfiguration { + hierarchyInformation: HierarchyInformation; + provisioningDetails?: ProvisioningDetails[]; + quantity: number; +} + +// @public +export type AddressClassification = string; + +// @public +export interface AddressDetails { + forwardAddress: AddressProperties; + readonly returnAddress?: AddressProperties; +} + +// @public +export interface AddressProperties { + addressClassification?: AddressClassification; + readonly addressValidationStatus?: AddressValidationStatus; + contactDetails?: ContactDetails; + readonly provisioningState?: ProvisioningState; + shippingAddress?: ShippingAddress; +} + +// @public +export interface AddressResource extends TrackedResource { + properties: AddressProperties; +} + +// @public +export interface AddressResourcesCreateOptionalParams extends OperationOptions { + updateIntervalInMs?: number; +} + +// @public +export interface AddressResourcesDeleteOptionalParams extends OperationOptions { + updateIntervalInMs?: number; +} + +// @public +export interface AddressResourcesGetOptionalParams extends OperationOptions { +} + +// @public +export interface AddressResourcesListByResourceGroupOptionalParams extends OperationOptions { + filter?: string; + skipToken?: string; + top?: number; +} + +// @public +export interface AddressResourcesListBySubscriptionOptionalParams extends OperationOptions { + filter?: string; + skipToken?: string; + top?: number; +} + +// @public +export interface AddressResourcesOperations { + create: (resourceGroupName: string, addressName: string, addressResource: AddressResource, options?: AddressResourcesCreateOptionalParams) => PollerLike, void>; + delete: (resourceGroupName: string, addressName: string, options?: AddressResourcesDeleteOptionalParams) => PollerLike, void>; + get: (resourceGroupName: string, addressName: string, options?: AddressResourcesGetOptionalParams) => Promise; + listByResourceGroup: (resourceGroupName: string, options?: AddressResourcesListByResourceGroupOptionalParams) => PagedAsyncIterableIterator; + listBySubscription: (options?: AddressResourcesListBySubscriptionOptionalParams) => PagedAsyncIterableIterator; + update: (resourceGroupName: string, addressName: string, addressUpdateParameter: AddressUpdateParameter, options?: AddressResourcesUpdateOptionalParams) => PollerLike, AddressResource>; +} + +// @public +export interface AddressResourcesUpdateOptionalParams extends OperationOptions { + ifMatch?: string; + updateIntervalInMs?: number; +} + +// @public +export type AddressType = string; + +// @public +export interface AddressUpdateParameter { + properties?: AddressUpdateProperties; + tags?: Record; +} + +// @public +export interface AddressUpdateProperties { + contactDetails?: ContactDetails; + shippingAddress?: ShippingAddress; +} + +// @public +export type AddressValidationStatus = string; + +// @public +export type AutoProvisioningStatus = string; + +// @public +export interface AvailabilityInformation { + readonly availabilityStage?: AvailabilityStage; + readonly disabledReason?: DisabledReason; + readonly disabledReasonMessage?: string; +} + +// @public +export type AvailabilityStage = string; + +// @public +export interface BasicInformation { + readonly availabilityInformation?: AvailabilityInformation; + readonly costInformation?: CostInformation; + readonly description?: Description; + readonly displayName?: string; + readonly fulfilledBy?: FulfillmentType; + readonly hierarchyInformation?: HierarchyInformation; + readonly imageInformation?: ImageInformation[]; +} + +// @public +export interface BillingMeterDetails { + readonly frequency?: string; + readonly meterDetails?: MeterDetailsUnion; + readonly meteringType?: MeteringType; + readonly name?: string; + readonly termTypeDetails?: TermTypeDetails; +} + +// @public +export type BillingType = string; + +// @public +export interface CancellationReason { + reason: string; +} + +// @public +export interface CategoryInformation { + categoryDisplayName?: string; + categoryName?: string; + description?: string; + links?: Link[]; +} + +// @public +export type ChargingType = string; + +// @public +export interface ChildConfiguration { + readonly properties?: ChildConfigurationProperties; +} + +// @public +export interface ChildConfigurationFilter { + childConfigurationTypes?: ChildConfigurationType[]; + hierarchyInformations?: HierarchyInformation[]; +} + +// @public +export interface ChildConfigurationProperties { + readonly availabilityInformation?: AvailabilityInformation; + readonly childConfigurationType?: ChildConfigurationType; + readonly childConfigurationTypes?: ChildConfigurationType[]; + readonly costInformation?: CostInformation; + readonly description?: Description; + readonly dimensions?: Dimensions; + readonly displayName?: string; + readonly filterableProperties?: FilterableProperty[]; + readonly fulfilledBy?: FulfillmentType; + readonly groupedChildConfigurations?: GroupedChildConfigurations[]; + readonly hierarchyInformation?: HierarchyInformation; + readonly imageInformation?: ImageInformation[]; + readonly isPartOfBaseConfiguration?: boolean; + readonly maximumQuantity?: number; + readonly minimumQuantity?: number; + readonly provisioningSupport?: ProvisioningSupport; + readonly specifications?: Specification[]; + readonly supportedTermCommitmentDurations?: string[]; +} + +// @public +export type ChildConfigurationType = string; + +// @public +export interface CommonProperties extends BasicInformation { + readonly filterableProperties?: FilterableProperty[]; +} + +// @public +export interface Configuration { + readonly properties?: ConfigurationProperties; +} + +// @public +export interface ConfigurationDeviceDetails { + readonly deviceDetails?: DeviceDetails[]; + displayInfo?: DisplayInfo; + readonly hierarchyInformation?: HierarchyInformation; + readonly identificationType?: IdentificationType; + readonly quantity?: number; + readonly termCommitmentInformation?: TermCommitmentInformation; +} + +// @public +export interface ConfigurationFilter { + childConfigurationFilter?: ChildConfigurationFilter; + filterableProperty?: FilterableProperty[]; + hierarchyInformation: HierarchyInformation; +} + +// @public +export interface ConfigurationProperties extends CommonProperties { + readonly childConfigurationTypes?: ChildConfigurationType[]; + readonly dimensions?: Dimensions; + readonly groupedChildConfigurations?: GroupedChildConfigurations[]; + readonly provisioningSupport?: ProvisioningSupport; + readonly specifications?: Specification[]; + readonly supportedTermCommitmentDurations?: string[]; +} + +// @public +export interface ConfigurationsRequest { + configurationFilter?: ConfigurationFilter; + customerSubscriptionDetails?: CustomerSubscriptionDetails; +} + +// @public +export interface ContactDetails { + contactName?: string; + emailList?: string[]; + mobile?: string; + phone?: string; + phoneExtension?: string; +} + +// @public +export type ContinuablePage = TPage & { + continuationToken?: string; +}; + +// @public +export interface CostInformation { + readonly billingInfoUrl?: string; + readonly billingMeterDetails?: BillingMeterDetails[]; +} + +// @public +export type CreatedByType = string; + +// @public +export interface CustomerSubscriptionDetails { + locationPlacementId?: string; + quotaId: string; + registeredFeatures?: CustomerSubscriptionRegisteredFeatures[]; +} + +// @public +export interface CustomerSubscriptionRegisteredFeatures { + name?: string; + state?: string; +} + +// @public +export interface Description { + readonly attributes?: string[]; + readonly descriptionType?: DescriptionType; + readonly keywords?: string[]; + readonly links?: Link[]; + readonly longDescription?: string; + readonly shortDescription?: string; +} + +// @public +export type DescriptionType = string; + +// @public +export interface DeviceDetails { + readonly displaySerialNumber?: string; + readonly managementResourceId?: string; + readonly managementResourceTenantId?: string; + readonly provisioningDetails?: ProvisioningDetails; + readonly provisioningSupport?: ProvisioningSupport; + readonly serialNumber?: string; +} + +// @public +export interface DevicePresenceVerificationDetails { + readonly message?: string; + readonly status?: DevicePresenceVerificationStatus; +} + +// @public +export type DevicePresenceVerificationStatus = string; + +// @public +export interface Dimensions { + readonly depth?: number; + readonly height?: number; + readonly length?: number; + readonly lengthHeightUnit?: LengthHeightUnit; + readonly weight?: number; + readonly weightUnit?: WeightMeasurementUnit; + readonly width?: number; +} + +// @public +export type DisabledReason = string; + +// @public +export interface DisplayInfo { + readonly configurationDisplayName?: string; + readonly productFamilyDisplayName?: string; +} + +// @public +export type DoubleEncryptionStatus = string; + +// @public (undocumented) +export class EdgeOrderClient { + constructor(credential: TokenCredential, subscriptionId: string, options?: EdgeOrderClientOptionalParams); + readonly addressResources: AddressResourcesOperations; + readonly operations: OperationsOperations; + readonly orderItemResources: OrderItemResourcesOperations; + readonly orderResources: OrderResourcesOperations; + readonly ordersOperationGroup: OrdersOperationGroupOperations; + readonly pipeline: Pipeline; + readonly productsAndConfigurationsOperationGroup: ProductsAndConfigurationsOperationGroupOperations; +} + +// @public +export interface EdgeOrderClientOptionalParams extends ClientOptions { + apiVersion?: string; +} + +// @public +export interface EncryptionPreferences { + doubleEncryptionStatus?: DoubleEncryptionStatus; +} + +// @public +export interface ErrorAdditionalInfo { + readonly info?: Record; + readonly type?: string; +} + +// @public +export interface ErrorDetail { + readonly additionalInfo?: ErrorAdditionalInfo[]; + readonly code?: string; + readonly details?: ErrorDetail[]; + readonly message?: string; + readonly target?: string; +} + +// @public +export interface ErrorResponse { + error?: ErrorDetail; +} + +// @public +export interface FilterableProperty { + supportedValues: string[]; + type: SupportedFilterTypes; +} + +// @public +export interface ForwardShippingDetails { + readonly carrierDisplayName?: string; + readonly carrierName?: string; + readonly trackingId?: string; + readonly trackingUrl?: string; +} + +// @public +export type FulfillmentType = string; + +// @public +export interface GroupedChildConfigurations { + readonly categoryInformation?: CategoryInformation; + readonly childConfigurations?: ChildConfiguration[]; +} + +// @public +export interface HierarchyInformation { + configurationIdDisplayName?: string; + configurationName?: string; + productFamilyName?: string; + productLineName?: string; + productName?: string; +} + +// @public +export type IdentificationType = string; + +// @public +export interface ImageInformation { + readonly imageType?: ImageType; + readonly imageUrl?: string; +} + +// @public +export type ImageType = string; + +// @public +export enum KnownActionStatusEnum { + Allowed = "Allowed", + NotAllowed = "NotAllowed" +} + +// @public +export enum KnownActionType { + Internal = "Internal" +} + +// @public +export enum KnownAddressClassification { + Shipping = "Shipping", + Site = "Site" +} + +// @public +export enum KnownAddressType { + Commercial = "Commercial", + None = "None", + Residential = "Residential" +} + +// @public +export enum KnownAddressValidationStatus { + Ambiguous = "Ambiguous", + Invalid = "Invalid", + Valid = "Valid" +} + +// @public +export enum KnownAutoProvisioningStatus { + Disabled = "Disabled", + Enabled = "Enabled" +} + +// @public +export enum KnownAvailabilityStage { + Available = "Available", + ComingSoon = "ComingSoon", + Deprecated = "Deprecated", + Discoverable = "Discoverable", + Preview = "Preview", + Signup = "Signup", + Unavailable = "Unavailable" +} + +// @public +export enum KnownBillingType { + Pav2 = "Pav2", + Purchase = "Purchase" +} + +// @public +export enum KnownChargingType { + PerDevice = "PerDevice", + PerOrder = "PerOrder" +} + +// @public +export enum KnownChildConfigurationType { + AdditionalConfiguration = "AdditionalConfiguration", + DeviceConfiguration = "DeviceConfiguration" +} + +// @public +export enum KnownCreatedByType { + Application = "Application", + Key = "Key", + ManagedIdentity = "ManagedIdentity", + User = "User" +} + +// @public +export enum KnownDescriptionType { + Base = "Base" +} + +// @public +export enum KnownDevicePresenceVerificationStatus { + Completed = "Completed", + NotInitiated = "NotInitiated" +} + +// @public +export enum KnownDisabledReason { + Country = "Country", + Feature = "Feature", + None = "None", + NoSubscriptionInfo = "NoSubscriptionInfo", + NotAvailable = "NotAvailable", + OfferType = "OfferType", + OutOfStock = "OutOfStock", + Region = "Region" +} + +// @public +export enum KnownDoubleEncryptionStatus { + Disabled = "Disabled", + Enabled = "Enabled" +} + +// @public +export enum KnownFulfillmentType { + External = "External", + Microsoft = "Microsoft" +} + +// @public +export enum KnownIdentificationType { + NotSupported = "NotSupported", + SerialNumber = "SerialNumber" +} + +// @public +export enum KnownImageType { + BulletImage = "BulletImage", + GenericImage = "GenericImage", + MainImage = "MainImage" +} + +// @public +export enum KnownLengthHeightUnit { + CM = "CM", + IN = "IN" +} + +// @public +export enum KnownLinkType { + Discoverable = "Discoverable", + Documentation = "Documentation", + Generic = "Generic", + KnowMore = "KnowMore", + SignUp = "SignUp", + Specification = "Specification", + TermsAndConditions = "TermsAndConditions" +} + +// @public +export enum KnownMeteringType { + Adhoc = "Adhoc", + OneTime = "OneTime", + Recurring = "Recurring" +} + +// @public +export enum KnownNotificationStageName { + Delivered = "Delivered", + Shipped = "Shipped" +} + +// @public +export enum KnownOrderItemCancellationEnum { + Cancellable = "Cancellable", + CancellableWithFee = "CancellableWithFee", + NotCancellable = "NotCancellable" +} + +// @public +export enum KnownOrderItemReturnEnum { + NotReturnable = "NotReturnable", + Returnable = "Returnable", + ReturnableWithFee = "ReturnableWithFee" +} + +// @public +export enum KnownOrderItemType { + External = "External", + Purchase = "Purchase", + Rental = "Rental" +} + +// @public +export enum KnownOrderMode { + Default = "Default", + DoNotFulfill = "DoNotFulfill" +} + +// @public +export enum KnownOrigin { + System = "system", + User = "user", + UserSystem = "user,system" +} + +// @public +export enum KnownProvisioningState { + Canceled = "Canceled", + Creating = "Creating", + Failed = "Failed", + Succeeded = "Succeeded" +} + +// @public +export enum KnownProvisioningSupport { + CloudBased = "CloudBased", + Manual = "Manual" +} + +// @public +export enum KnownStageName { + Cancelled = "Cancelled", + Confirmed = "Confirmed", + Delivered = "Delivered", + InReview = "InReview", + InUse = "InUse", + Placed = "Placed", + ReadyToSetup = "ReadyToSetup", + ReadyToShip = "ReadyToShip", + ReturnCompleted = "ReturnCompleted", + ReturnedToMicrosoft = "ReturnedToMicrosoft", + ReturnInitiated = "ReturnInitiated", + ReturnPickedUp = "ReturnPickedUp", + Shipped = "Shipped" +} + +// @public +export enum KnownStageStatus { + Cancelled = "Cancelled", + Cancelling = "Cancelling", + Failed = "Failed", + InProgress = "InProgress", + None = "None", + Succeeded = "Succeeded" +} + +// @public +export enum KnownSupportedFilterTypes { + DoubleEncryptionStatus = "DoubleEncryptionStatus", + ShipToCountries = "ShipToCountries" +} + +// @public +export enum KnownTermCommitmentType { + None = "None", + Timed = "Timed", + Trial = "Trial" +} + +// @public +export enum KnownTransportShipmentTypes { + CustomerManaged = "CustomerManaged", + MicrosoftManaged = "MicrosoftManaged" +} + +// @public +export enum KnownVersions { + V20240201 = "2024-02-01" +} + +// @public +export enum KnownWeightMeasurementUnit { + KGS = "KGS", + LBS = "LBS" +} + +// @public +export type LengthHeightUnit = string; + +// @public +export interface Link { + readonly linkType?: LinkType; + readonly linkUrl?: string; +} + +// @public +export type LinkType = string; + +// @public +export interface ManagementResourcePreferences { + preferredManagementResourceId?: string; +} + +// @public +export interface MeterDetails { + billingType: BillingType; + readonly chargingType?: ChargingType; + readonly multiplier?: number; +} + +// @public +export type MeterDetailsUnion = Pav2MeterDetails | PurchaseMeterDetails | MeterDetails; + +// @public +export type MeteringType = string; + +// @public +export interface NotificationPreference { + sendNotification: boolean; + stageName: NotificationStageName; +} + +// @public +export type NotificationStageName = string; + +// @public +export interface OkResponse { +} + +// @public +export interface Operation { + readonly actionType?: ActionType; + display?: OperationDisplay; + readonly isDataAction?: boolean; + readonly name?: string; + readonly origin?: Origin; +} + +// @public +export interface OperationDisplay { + readonly description?: string; + readonly operation?: string; + readonly provider?: string; + readonly resource?: string; +} + +// @public +export interface OperationsListOptionalParams extends OperationOptions { +} + +// @public +export interface OperationsOperations { + list: (options?: OperationsListOptionalParams) => PagedAsyncIterableIterator; +} + +// @public +export type OrderItemCancellationEnum = string; + +// @public +export interface OrderItemDetails { + readonly cancellationReason?: string; + readonly cancellationStatus?: OrderItemCancellationEnum; + readonly currentStage?: StageDetails; + readonly deletionStatus?: ActionStatusEnum; + readonly error?: ErrorDetail; + readonly forwardShippingDetails?: ForwardShippingDetails; + readonly managementRpDetailsList?: ResourceProviderDetails[]; + notificationEmailList?: string[]; + orderItemMode?: OrderMode; + readonly orderItemStageHistory?: StageDetails[]; + orderItemType: OrderItemType; + preferences?: Preferences; + productDetails: ProductDetails; + readonly returnReason?: string; + readonly returnStatus?: OrderItemReturnEnum; + readonly reverseShippingDetails?: ReverseShippingDetails; + siteDetails?: SiteDetails; +} + +// @public +export interface OrderItemDetailsUpdateParameter { + productDetails?: ProductDetailsUpdateParameter; + siteDetails?: SiteDetails; +} + +// @public +export interface OrderItemProperties { + addressDetails?: AddressDetails; + orderId: string; + orderItemDetails: OrderItemDetails; + readonly provisioningState?: ProvisioningState; + readonly startTime?: Date; +} + +// @public +export interface OrderItemResource extends TrackedResource { + identity?: ResourceIdentity; + properties: OrderItemProperties; +} + +// @public +export interface OrderItemResourcesCancelOptionalParams extends OperationOptions { +} + +// @public +export interface OrderItemResourcesCreateOptionalParams extends OperationOptions { + updateIntervalInMs?: number; +} + +// @public +export interface OrderItemResourcesDeleteOptionalParams extends OperationOptions { + updateIntervalInMs?: number; +} + +// @public +export interface OrderItemResourcesGetOptionalParams extends OperationOptions { + expand?: string; +} + +// @public +export interface OrderItemResourcesListByResourceGroupOptionalParams extends OperationOptions { + expand?: string; + filter?: string; + skipToken?: string; + top?: number; +} + +// @public +export interface OrderItemResourcesListBySubscriptionOptionalParams extends OperationOptions { + expand?: string; + filter?: string; + skipToken?: string; + top?: number; +} + +// @public +export interface OrderItemResourcesOperations { + cancel: (resourceGroupName: string, orderItemName: string, cancellationReason: CancellationReason, options?: OrderItemResourcesCancelOptionalParams) => Promise; + create: (resourceGroupName: string, orderItemName: string, orderItemResource: OrderItemResource, options?: OrderItemResourcesCreateOptionalParams) => PollerLike, void>; + delete: (resourceGroupName: string, orderItemName: string, options?: OrderItemResourcesDeleteOptionalParams) => PollerLike, void>; + get: (resourceGroupName: string, orderItemName: string, options?: OrderItemResourcesGetOptionalParams) => Promise; + listByResourceGroup: (resourceGroupName: string, options?: OrderItemResourcesListByResourceGroupOptionalParams) => PagedAsyncIterableIterator; + listBySubscription: (options?: OrderItemResourcesListBySubscriptionOptionalParams) => PagedAsyncIterableIterator; + returnOrderItem: (resourceGroupName: string, orderItemName: string, returnOrderItemDetails: ReturnOrderItemDetails, options?: OrderItemResourcesReturnOrderItemOptionalParams) => PollerLike, OkResponse>; + update: (resourceGroupName: string, orderItemName: string, orderItemUpdateParameter: OrderItemUpdateParameter, options?: OrderItemResourcesUpdateOptionalParams) => PollerLike, OrderItemResource>; +} + +// @public +export interface OrderItemResourcesReturnOrderItemOptionalParams extends OperationOptions { + updateIntervalInMs?: number; +} + +// @public +export interface OrderItemResourcesUpdateOptionalParams extends OperationOptions { + ifMatch?: string; + updateIntervalInMs?: number; +} + +// @public +export type OrderItemReturnEnum = string; + +// @public +export type OrderItemType = string; + +// @public +export interface OrderItemUpdateParameter { + identity?: ResourceIdentity; + properties?: OrderItemUpdateProperties; + tags?: Record; +} + +// @public +export interface OrderItemUpdateProperties { + forwardAddress?: AddressProperties; + notificationEmailList?: string[]; + orderItemDetails?: OrderItemDetailsUpdateParameter; + preferences?: Preferences; +} + +// @public +export type OrderMode = string; + +// @public +export interface OrderProperties { + readonly currentStage?: StageDetails; + readonly orderItemIds?: string[]; + readonly orderMode?: OrderMode; + readonly orderStageHistory?: StageDetails[]; +} + +// @public +export interface OrderResource extends ProxyResource { + properties: OrderProperties; +} + +// @public +export interface OrderResourcesGetOptionalParams extends OperationOptions { +} + +// @public +export interface OrderResourcesOperations { + get: (resourceGroupName: string, location: string, orderName: string, options?: OrderResourcesGetOptionalParams) => Promise; +} + +// @public +export interface OrdersOperationGroupListByResourceGroupOptionalParams extends OperationOptions { + skipToken?: string; + top?: number; +} + +// @public +export interface OrdersOperationGroupListBySubscriptionOptionalParams extends OperationOptions { + skipToken?: string; + top?: number; +} + +// @public +export interface OrdersOperationGroupOperations { + listByResourceGroup: (resourceGroupName: string, options?: OrdersOperationGroupListByResourceGroupOptionalParams) => PagedAsyncIterableIterator; + listBySubscription: (options?: OrdersOperationGroupListBySubscriptionOptionalParams) => PagedAsyncIterableIterator; +} + +// @public +export type Origin = string; + +// @public +export interface PagedAsyncIterableIterator { + [Symbol.asyncIterator](): PagedAsyncIterableIterator; + byPage: (settings?: TPageSettings) => AsyncIterableIterator>; + next(): Promise>; +} + +// @public +export interface PageSettings { + continuationToken?: string; +} + +// @public +export interface Pav2MeterDetails extends MeterDetails { + billingType: "Pav2"; + readonly meterGuid?: string; +} + +// @public +export interface Preferences { + encryptionPreferences?: EncryptionPreferences; + managementResourcePreferences?: ManagementResourcePreferences; + notificationPreferences?: NotificationPreference[]; + termCommitmentPreferences?: TermCommitmentPreferences; + transportPreferences?: TransportPreferences; +} + +// @public +export interface Product { + readonly properties?: ProductProperties; +} + +// @public +export interface ProductDetails { + readonly childConfigurationDeviceDetails?: ConfigurationDeviceDetails[]; + displayInfo?: DisplayInfo; + hierarchyInformation: HierarchyInformation; + readonly identificationType?: IdentificationType; + optInAdditionalConfigurations?: AdditionalConfiguration[]; + readonly parentDeviceDetails?: DeviceDetails; + parentProvisioningDetails?: ProvisioningDetails; + readonly productDoubleEncryptionStatus?: DoubleEncryptionStatus; + readonly termCommitmentInformation?: TermCommitmentInformation; +} + +// @public +export interface ProductDetailsUpdateParameter { + parentProvisioningDetails?: ProvisioningDetails; +} + +// @public +export interface ProductFamiliesMetadataDetails { + readonly properties?: ProductFamilyProperties; +} + +// @public +export interface ProductFamiliesRequest { + customerSubscriptionDetails?: CustomerSubscriptionDetails; + filterableProperties: Record; +} + +// @public +export interface ProductFamily { + readonly properties?: ProductFamilyProperties; +} + +// @public +export interface ProductFamilyProperties extends CommonProperties { + readonly productLines?: ProductLine[]; + resourceProviderDetails?: ResourceProviderDetails[]; +} + +// @public +export interface ProductLine { + readonly properties?: ProductLineProperties; +} + +// @public +export interface ProductLineProperties extends CommonProperties { + readonly products?: Product[]; +} + +// @public +export interface ProductProperties extends CommonProperties { + readonly configurations?: Configuration[]; +} + +// @public +export interface ProductsAndConfigurationsOperationGroupListConfigurationsOptionalParams extends OperationOptions { + skipToken?: string; +} + +// @public +export interface ProductsAndConfigurationsOperationGroupListProductFamiliesMetadataOptionalParams extends OperationOptions { + skipToken?: string; +} + +// @public +export interface ProductsAndConfigurationsOperationGroupListProductFamiliesOptionalParams extends OperationOptions { + expand?: string; + skipToken?: string; +} + +// @public +export interface ProductsAndConfigurationsOperationGroupOperations { + listConfigurations: (configurationsRequest: ConfigurationsRequest, options?: ProductsAndConfigurationsOperationGroupListConfigurationsOptionalParams) => PagedAsyncIterableIterator; + listProductFamilies: (productFamiliesRequest: ProductFamiliesRequest, options?: ProductsAndConfigurationsOperationGroupListProductFamiliesOptionalParams) => PagedAsyncIterableIterator; + listProductFamiliesMetadata: (options?: ProductsAndConfigurationsOperationGroupListProductFamiliesMetadataOptionalParams) => PagedAsyncIterableIterator; +} + +// @public +export interface ProvisioningDetails { + autoProvisioningStatus?: AutoProvisioningStatus; + devicePresenceVerification?: DevicePresenceVerificationDetails; + managementResourceArmId?: string; + provisioningArmId?: string; + provisioningEndPoint?: string; + quantity?: number; + readyToConnectArmId?: string; + serialNumber?: string; + readonly uniqueDeviceIdentifier?: string; + vendorName?: string; +} + +// @public +export type ProvisioningState = string; + +// @public +export type ProvisioningSupport = string; + +// @public +export interface ProxyResource extends Resource { +} + +// @public +export interface PurchaseMeterDetails extends MeterDetails { + billingType: "Purchase"; + readonly productId?: string; + readonly skuId?: string; + readonly termId?: string; +} + +// @public +export interface Resource { + readonly id?: string; + readonly name?: string; + readonly systemData?: SystemData; + readonly type?: string; +} + +// @public +export interface ResourceIdentity { + readonly principalId?: string; + readonly tenantId?: string; + type?: string; + userAssignedIdentities?: Record; +} + +// @public +export interface ResourceProviderDetails { + readonly resourceProviderNamespace?: string; +} + +// @public +export function restorePoller(client: EdgeOrderClient, serializedState: string, sourceOperation: (...args: any[]) => PollerLike, TResult>, options?: RestorePollerOptions): PollerLike, TResult>; + +// @public (undocumented) +export interface RestorePollerOptions extends OperationOptions { + abortSignal?: AbortSignalLike; + processResponseBody?: (result: TResponse) => Promise; + updateIntervalInMs?: number; +} + +// @public +export interface ReturnOrderItemDetails { + returnAddress?: AddressProperties; + returnReason: string; + serviceTag?: string; + shippingBoxRequired?: boolean; +} + +// @public +export interface ReverseShippingDetails { + readonly carrierDisplayName?: string; + readonly carrierName?: string; + readonly sasKeyForLabel?: string; + readonly trackingId?: string; + readonly trackingUrl?: string; +} + +// @public +export interface ShippingAddress { + addressType?: AddressType; + city?: string; + companyName?: string; + country: string; + postalCode?: string; + stateOrProvince?: string; + streetAddress1?: string; + streetAddress2?: string; + streetAddress3?: string; + zipExtendedCode?: string; +} + +// @public +export interface SiteDetails { + siteId: string; +} + +// @public +export interface Specification { + readonly name?: string; + readonly value?: string; +} + +// @public +export interface StageDetails { + readonly displayName?: string; + readonly stageName?: StageName; + readonly stageStatus?: StageStatus; + readonly startTime?: Date; +} + +// @public +export type StageName = string; + +// @public +export type StageStatus = string; + +// @public +export type SupportedFilterTypes = string; + +// @public +export interface SystemData { + createdAt?: Date; + createdBy?: string; + createdByType?: CreatedByType; + lastModifiedAt?: Date; + lastModifiedBy?: string; + lastModifiedByType?: CreatedByType; +} + +// @public +export interface TermCommitmentInformation { + readonly pendingDaysForTerm?: number; + termCommitmentType: TermCommitmentType; + readonly termCommitmentTypeDuration?: string; +} + +// @public +export interface TermCommitmentPreferences { + preferredTermCommitmentDuration?: string; + preferredTermCommitmentType: TermCommitmentType; +} + +// @public +export type TermCommitmentType = string; + +// @public +export interface TermTypeDetails { + termType: TermCommitmentType; + termTypeDuration: string; +} + +// @public +export interface TrackedResource extends Resource { + location: string; + tags?: Record; +} + +// @public +export interface TransportPreferences { + preferredShipmentType: TransportShipmentTypes; +} + +// @public +export type TransportShipmentTypes = string; + +// @public +export interface UserAssignedIdentity { + readonly clientId?: string; + readonly principalId?: string; +} + +// @public +export type WeightMeasurementUnit = string; + +// (No @packageDocumentation comment for this package) + +``` diff --git a/sdk/edgeorder/arm-edgeorder/sample.env b/sdk/edgeorder/arm-edgeorder/sample.env new file mode 100644 index 000000000000..508439fc7d62 --- /dev/null +++ b/sdk/edgeorder/arm-edgeorder/sample.env @@ -0,0 +1 @@ +# Feel free to add your own environment variables. \ No newline at end of file diff --git a/sdk/edgeorder/arm-edgeorder/samples-dev/addressResourcesCreateSample.ts b/sdk/edgeorder/arm-edgeorder/samples-dev/addressResourcesCreateSample.ts new file mode 100644 index 000000000000..7c8285a9491b --- /dev/null +++ b/sdk/edgeorder/arm-edgeorder/samples-dev/addressResourcesCreateSample.ts @@ -0,0 +1,26 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +import { EdgeOrderClient } from "@azure/arm-edgeorder"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to create a new address with the specified parameters. Existing address cannot be updated with this API and should + * instead be updated with the Update address API. + * + * @summary create a new address with the specified parameters. Existing address cannot be updated with this API and should + * instead be updated with the Update address API. + * x-ms-original-file: 2024-02-01/CreateAddress.json + */ +async function createAddress(): Promise { + const credential = new DefaultAzureCredential(); + const subscriptionId = "eb5dc900-6186-49d8-b7d7-febd866fdc1d"; + const client = new EdgeOrderClient(credential, subscriptionId); + await client.addressResources.create("YourResourceGroupName", "TestAddressName2"); +} + +async function main(): Promise { + await createAddress(); +} + +main().catch(console.error); diff --git a/sdk/edgeorder/arm-edgeorder/samples-dev/addressResourcesDeleteSample.ts b/sdk/edgeorder/arm-edgeorder/samples-dev/addressResourcesDeleteSample.ts new file mode 100644 index 000000000000..9a3026c94d5c --- /dev/null +++ b/sdk/edgeorder/arm-edgeorder/samples-dev/addressResourcesDeleteSample.ts @@ -0,0 +1,24 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +import { EdgeOrderClient } from "@azure/arm-edgeorder"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to delete an address. + * + * @summary delete an address. + * x-ms-original-file: 2024-02-01/DeleteAddressByName.json + */ +async function deleteAddressByName(): Promise { + const credential = new DefaultAzureCredential(); + const subscriptionId = "eb5dc900-6186-49d8-b7d7-febd866fdc1d"; + const client = new EdgeOrderClient(credential, subscriptionId); + await client.addressResources.delete("YourResourceGroupName", "TestAddressName1"); +} + +async function main(): Promise { + await deleteAddressByName(); +} + +main().catch(console.error); diff --git a/sdk/edgeorder/arm-edgeorder/samples-dev/addressResourcesGetSample.ts b/sdk/edgeorder/arm-edgeorder/samples-dev/addressResourcesGetSample.ts new file mode 100644 index 000000000000..6b469bc2f1cd --- /dev/null +++ b/sdk/edgeorder/arm-edgeorder/samples-dev/addressResourcesGetSample.ts @@ -0,0 +1,25 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +import { EdgeOrderClient } from "@azure/arm-edgeorder"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to get information about the specified address. + * + * @summary get information about the specified address. + * x-ms-original-file: 2024-02-01/GetAddressByName.json + */ +async function getAddressByName(): Promise { + const credential = new DefaultAzureCredential(); + const subscriptionId = "eb5dc900-6186-49d8-b7d7-febd866fdc1d"; + const client = new EdgeOrderClient(credential, subscriptionId); + const result = await client.addressResources.get("YourResourceGroupName", "TestAddressName1"); + console.log(result); +} + +async function main(): Promise { + await getAddressByName(); +} + +main().catch(console.error); diff --git a/sdk/edgeorder/arm-edgeorder/samples-dev/addressResourcesListByResourceGroupSample.ts b/sdk/edgeorder/arm-edgeorder/samples-dev/addressResourcesListByResourceGroupSample.ts new file mode 100644 index 000000000000..d1baddef5a88 --- /dev/null +++ b/sdk/edgeorder/arm-edgeorder/samples-dev/addressResourcesListByResourceGroupSample.ts @@ -0,0 +1,29 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +import { EdgeOrderClient } from "@azure/arm-edgeorder"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to list all the addresses available under the given resource group. + * + * @summary list all the addresses available under the given resource group. + * x-ms-original-file: 2024-02-01/ListAddressesAtResourceGroupLevel.json + */ +async function listAddressesAtResourceGroupLevel(): Promise { + const credential = new DefaultAzureCredential(); + const subscriptionId = "eb5dc900-6186-49d8-b7d7-febd866fdc1d"; + const client = new EdgeOrderClient(credential, subscriptionId); + const resArray = new Array(); + for await (const item of client.addressResources.listByResourceGroup("YourResourceGroupName")) { + resArray.push(item); + } + + console.log(resArray); +} + +async function main(): Promise { + await listAddressesAtResourceGroupLevel(); +} + +main().catch(console.error); diff --git a/sdk/edgeorder/arm-edgeorder/samples-dev/addressResourcesListBySubscriptionSample.ts b/sdk/edgeorder/arm-edgeorder/samples-dev/addressResourcesListBySubscriptionSample.ts new file mode 100644 index 000000000000..179d5575211e --- /dev/null +++ b/sdk/edgeorder/arm-edgeorder/samples-dev/addressResourcesListBySubscriptionSample.ts @@ -0,0 +1,29 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +import { EdgeOrderClient } from "@azure/arm-edgeorder"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to list all the addresses available under the subscription. + * + * @summary list all the addresses available under the subscription. + * x-ms-original-file: 2024-02-01/ListAddressesAtSubscriptionLevel.json + */ +async function listAddressesAtSubscriptionLevel(): Promise { + const credential = new DefaultAzureCredential(); + const subscriptionId = "eb5dc900-6186-49d8-b7d7-febd866fdc1d"; + const client = new EdgeOrderClient(credential, subscriptionId); + const resArray = new Array(); + for await (const item of client.addressResources.listBySubscription()) { + resArray.push(item); + } + + console.log(resArray); +} + +async function main(): Promise { + await listAddressesAtSubscriptionLevel(); +} + +main().catch(console.error); diff --git a/sdk/edgeorder/arm-edgeorder/samples-dev/addressResourcesUpdateSample.ts b/sdk/edgeorder/arm-edgeorder/samples-dev/addressResourcesUpdateSample.ts new file mode 100644 index 000000000000..ab135074a001 --- /dev/null +++ b/sdk/edgeorder/arm-edgeorder/samples-dev/addressResourcesUpdateSample.ts @@ -0,0 +1,25 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +import { EdgeOrderClient } from "@azure/arm-edgeorder"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to update the properties of an existing address. + * + * @summary update the properties of an existing address. + * x-ms-original-file: 2024-02-01/UpdateAddress.json + */ +async function updateAddress(): Promise { + const credential = new DefaultAzureCredential(); + const subscriptionId = "eb5dc900-6186-49d8-b7d7-febd866fdc1d"; + const client = new EdgeOrderClient(credential, subscriptionId); + const result = await client.addressResources.update("YourResourceGroupName", "TestAddressName2"); + console.log(result); +} + +async function main(): Promise { + await updateAddress(); +} + +main().catch(console.error); diff --git a/sdk/edgeorder/arm-edgeorder/samples-dev/operationsListSample.ts b/sdk/edgeorder/arm-edgeorder/samples-dev/operationsListSample.ts new file mode 100644 index 000000000000..710fa1cdcf27 --- /dev/null +++ b/sdk/edgeorder/arm-edgeorder/samples-dev/operationsListSample.ts @@ -0,0 +1,29 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +import { EdgeOrderClient } from "@azure/arm-edgeorder"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to list the operations for the provider + * + * @summary list the operations for the provider + * x-ms-original-file: 2024-02-01/ListOperations.json + */ +async function listOperations(): Promise { + const credential = new DefaultAzureCredential(); + const subscriptionId = "00000000-0000-0000-0000-00000000000"; + const client = new EdgeOrderClient(credential, subscriptionId); + const resArray = new Array(); + for await (const item of client.operations.list()) { + resArray.push(item); + } + + console.log(resArray); +} + +async function main(): Promise { + await listOperations(); +} + +main().catch(console.error); diff --git a/sdk/edgeorder/arm-edgeorder/samples-dev/orderItemResourcesCancelSample.ts b/sdk/edgeorder/arm-edgeorder/samples-dev/orderItemResourcesCancelSample.ts new file mode 100644 index 000000000000..da955928187b --- /dev/null +++ b/sdk/edgeorder/arm-edgeorder/samples-dev/orderItemResourcesCancelSample.ts @@ -0,0 +1,24 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +import { EdgeOrderClient } from "@azure/arm-edgeorder"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to cancel order item. + * + * @summary cancel order item. + * x-ms-original-file: 2024-02-01/CancelOrderItem.json + */ +async function cancelOrderItem(): Promise { + const credential = new DefaultAzureCredential(); + const subscriptionId = "eb5dc900-6186-49d8-b7d7-febd866fdc1d"; + const client = new EdgeOrderClient(credential, subscriptionId); + await client.orderItemResources.cancel("YourResourceGroupName", "TestOrderItemName3"); +} + +async function main(): Promise { + await cancelOrderItem(); +} + +main().catch(console.error); diff --git a/sdk/edgeorder/arm-edgeorder/samples-dev/orderItemResourcesCreateSample.ts b/sdk/edgeorder/arm-edgeorder/samples-dev/orderItemResourcesCreateSample.ts new file mode 100644 index 000000000000..61cb95579b7c --- /dev/null +++ b/sdk/edgeorder/arm-edgeorder/samples-dev/orderItemResourcesCreateSample.ts @@ -0,0 +1,26 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +import { EdgeOrderClient } from "@azure/arm-edgeorder"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to create an order item. Existing order item cannot be updated with this api and should instead be updated with the Update order item + * API. + * + * @summary create an order item. Existing order item cannot be updated with this api and should instead be updated with the Update order item + * API. + * x-ms-original-file: 2024-02-01/CreateOrderItem.json + */ +async function createOrderItem(): Promise { + const credential = new DefaultAzureCredential(); + const subscriptionId = "eb5dc900-6186-49d8-b7d7-febd866fdc1d"; + const client = new EdgeOrderClient(credential, subscriptionId); + await client.orderItemResources.create("YourResourceGroupName", "TestOrderItemName2"); +} + +async function main(): Promise { + await createOrderItem(); +} + +main().catch(console.error); diff --git a/sdk/edgeorder/arm-edgeorder/samples-dev/orderItemResourcesDeleteSample.ts b/sdk/edgeorder/arm-edgeorder/samples-dev/orderItemResourcesDeleteSample.ts new file mode 100644 index 000000000000..bcaa3b373261 --- /dev/null +++ b/sdk/edgeorder/arm-edgeorder/samples-dev/orderItemResourcesDeleteSample.ts @@ -0,0 +1,24 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +import { EdgeOrderClient } from "@azure/arm-edgeorder"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to delete an order item. + * + * @summary delete an order item. + * x-ms-original-file: 2024-02-01/DeleteOrderItemByName.json + */ +async function deleteOrderItemByName(): Promise { + const credential = new DefaultAzureCredential(); + const subscriptionId = "eb5dc900-6186-49d8-b7d7-febd866fdc1d"; + const client = new EdgeOrderClient(credential, subscriptionId); + await client.orderItemResources.delete("YourResourceGroupName", "TestOrderItemName3"); +} + +async function main(): Promise { + await deleteOrderItemByName(); +} + +main().catch(console.error); diff --git a/sdk/edgeorder/arm-edgeorder/samples-dev/orderItemResourcesGetSample.ts b/sdk/edgeorder/arm-edgeorder/samples-dev/orderItemResourcesGetSample.ts new file mode 100644 index 000000000000..6f006c03ded2 --- /dev/null +++ b/sdk/edgeorder/arm-edgeorder/samples-dev/orderItemResourcesGetSample.ts @@ -0,0 +1,25 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +import { EdgeOrderClient } from "@azure/arm-edgeorder"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to get an order item. + * + * @summary get an order item. + * x-ms-original-file: 2024-02-01/GetOrderItemByName.json + */ +async function getOrderItemByName(): Promise { + const credential = new DefaultAzureCredential(); + const subscriptionId = "eb5dc900-6186-49d8-b7d7-febd866fdc1d"; + const client = new EdgeOrderClient(credential, subscriptionId); + const result = await client.orderItemResources.get("YourResourceGroupName", "TestOrderItemName1"); + console.log(result); +} + +async function main(): Promise { + await getOrderItemByName(); +} + +main().catch(console.error); diff --git a/sdk/edgeorder/arm-edgeorder/samples-dev/orderItemResourcesListByResourceGroupSample.ts b/sdk/edgeorder/arm-edgeorder/samples-dev/orderItemResourcesListByResourceGroupSample.ts new file mode 100644 index 000000000000..21d786699a33 --- /dev/null +++ b/sdk/edgeorder/arm-edgeorder/samples-dev/orderItemResourcesListByResourceGroupSample.ts @@ -0,0 +1,29 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +import { EdgeOrderClient } from "@azure/arm-edgeorder"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to list order items at resource group level. + * + * @summary list order items at resource group level. + * x-ms-original-file: 2024-02-01/ListOrderItemsAtResourceGroupLevel.json + */ +async function listOrderItemsAtResourceGroupLevel(): Promise { + const credential = new DefaultAzureCredential(); + const subscriptionId = "eb5dc900-6186-49d8-b7d7-febd866fdc1d"; + const client = new EdgeOrderClient(credential, subscriptionId); + const resArray = new Array(); + for await (const item of client.orderItemResources.listByResourceGroup("YourResourceGroupName")) { + resArray.push(item); + } + + console.log(resArray); +} + +async function main(): Promise { + await listOrderItemsAtResourceGroupLevel(); +} + +main().catch(console.error); diff --git a/sdk/edgeorder/arm-edgeorder/samples-dev/orderItemResourcesListBySubscriptionSample.ts b/sdk/edgeorder/arm-edgeorder/samples-dev/orderItemResourcesListBySubscriptionSample.ts new file mode 100644 index 000000000000..4e1b8447f522 --- /dev/null +++ b/sdk/edgeorder/arm-edgeorder/samples-dev/orderItemResourcesListBySubscriptionSample.ts @@ -0,0 +1,29 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +import { EdgeOrderClient } from "@azure/arm-edgeorder"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to list order items at subscription level. + * + * @summary list order items at subscription level. + * x-ms-original-file: 2024-02-01/ListOrderItemsAtSubscriptionLevel.json + */ +async function listOrderItemsAtSubscriptionLevel(): Promise { + const credential = new DefaultAzureCredential(); + const subscriptionId = "eb5dc900-6186-49d8-b7d7-febd866fdc1d"; + const client = new EdgeOrderClient(credential, subscriptionId); + const resArray = new Array(); + for await (const item of client.orderItemResources.listBySubscription()) { + resArray.push(item); + } + + console.log(resArray); +} + +async function main(): Promise { + await listOrderItemsAtSubscriptionLevel(); +} + +main().catch(console.error); diff --git a/sdk/edgeorder/arm-edgeorder/samples-dev/orderItemResourcesReturnOrderItemSample.ts b/sdk/edgeorder/arm-edgeorder/samples-dev/orderItemResourcesReturnOrderItemSample.ts new file mode 100644 index 000000000000..abf72754e427 --- /dev/null +++ b/sdk/edgeorder/arm-edgeorder/samples-dev/orderItemResourcesReturnOrderItemSample.ts @@ -0,0 +1,28 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +import { EdgeOrderClient } from "@azure/arm-edgeorder"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to return order item. + * + * @summary return order item. + * x-ms-original-file: 2024-02-01/ReturnOrderItem.json + */ +async function returnOrderItem(): Promise { + const credential = new DefaultAzureCredential(); + const subscriptionId = "eb5dc900-6186-49d8-b7d7-febd866fdc1d"; + const client = new EdgeOrderClient(credential, subscriptionId); + const result = await client.orderItemResources.returnOrderItem( + "YourResourceGroupName", + "TestOrderName4", + ); + console.log(result); +} + +async function main(): Promise { + await returnOrderItem(); +} + +main().catch(console.error); diff --git a/sdk/edgeorder/arm-edgeorder/samples-dev/orderItemResourcesUpdateSample.ts b/sdk/edgeorder/arm-edgeorder/samples-dev/orderItemResourcesUpdateSample.ts new file mode 100644 index 000000000000..a891b5996c42 --- /dev/null +++ b/sdk/edgeorder/arm-edgeorder/samples-dev/orderItemResourcesUpdateSample.ts @@ -0,0 +1,28 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +import { EdgeOrderClient } from "@azure/arm-edgeorder"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to update the properties of an existing order item. + * + * @summary update the properties of an existing order item. + * x-ms-original-file: 2024-02-01/UpdateOrderItem.json + */ +async function updateOrderItem(): Promise { + const credential = new DefaultAzureCredential(); + const subscriptionId = "eb5dc900-6186-49d8-b7d7-febd866fdc1d"; + const client = new EdgeOrderClient(credential, subscriptionId); + const result = await client.orderItemResources.update( + "YourResourceGroupName", + "TestOrderItemName3", + ); + console.log(result); +} + +async function main(): Promise { + await updateOrderItem(); +} + +main().catch(console.error); diff --git a/sdk/edgeorder/arm-edgeorder/samples-dev/orderResourcesGetSample.ts b/sdk/edgeorder/arm-edgeorder/samples-dev/orderResourcesGetSample.ts new file mode 100644 index 000000000000..144a48d86842 --- /dev/null +++ b/sdk/edgeorder/arm-edgeorder/samples-dev/orderResourcesGetSample.ts @@ -0,0 +1,29 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +import { EdgeOrderClient } from "@azure/arm-edgeorder"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to get an order. + * + * @summary get an order. + * x-ms-original-file: 2024-02-01/GetOrderByName.json + */ +async function getOrderByName(): Promise { + const credential = new DefaultAzureCredential(); + const subscriptionId = "eb5dc900-6186-49d8-b7d7-febd866fdc1d"; + const client = new EdgeOrderClient(credential, subscriptionId); + const result = await client.orderResources.get( + "YourResourceGroupName", + "eastus", + "TestOrderName3", + ); + console.log(result); +} + +async function main(): Promise { + await getOrderByName(); +} + +main().catch(console.error); diff --git a/sdk/edgeorder/arm-edgeorder/samples-dev/ordersOperationGroupListByResourceGroupSample.ts b/sdk/edgeorder/arm-edgeorder/samples-dev/ordersOperationGroupListByResourceGroupSample.ts new file mode 100644 index 000000000000..7a59037ff58f --- /dev/null +++ b/sdk/edgeorder/arm-edgeorder/samples-dev/ordersOperationGroupListByResourceGroupSample.ts @@ -0,0 +1,31 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +import { EdgeOrderClient } from "@azure/arm-edgeorder"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to list orders at resource group level. + * + * @summary list orders at resource group level. + * x-ms-original-file: 2024-02-01/ListOrderAtResourceGroupLevel.json + */ +async function listOrderAtResourceGroupLevel(): Promise { + const credential = new DefaultAzureCredential(); + const subscriptionId = "eb5dc900-6186-49d8-b7d7-febd866fdc1d"; + const client = new EdgeOrderClient(credential, subscriptionId); + const resArray = new Array(); + for await (const item of client.ordersOperationGroup.listByResourceGroup( + "YourResourceGroupName", + )) { + resArray.push(item); + } + + console.log(resArray); +} + +async function main(): Promise { + await listOrderAtResourceGroupLevel(); +} + +main().catch(console.error); diff --git a/sdk/edgeorder/arm-edgeorder/samples-dev/ordersOperationGroupListBySubscriptionSample.ts b/sdk/edgeorder/arm-edgeorder/samples-dev/ordersOperationGroupListBySubscriptionSample.ts new file mode 100644 index 000000000000..df66d2d1fd72 --- /dev/null +++ b/sdk/edgeorder/arm-edgeorder/samples-dev/ordersOperationGroupListBySubscriptionSample.ts @@ -0,0 +1,29 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +import { EdgeOrderClient } from "@azure/arm-edgeorder"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to list orders at subscription level. + * + * @summary list orders at subscription level. + * x-ms-original-file: 2024-02-01/ListOrderAtSubscriptionLevel.json + */ +async function listOrderAtSubscriptionLevel(): Promise { + const credential = new DefaultAzureCredential(); + const subscriptionId = "eb5dc900-6186-49d8-b7d7-febd866fdc1d"; + const client = new EdgeOrderClient(credential, subscriptionId); + const resArray = new Array(); + for await (const item of client.ordersOperationGroup.listBySubscription()) { + resArray.push(item); + } + + console.log(resArray); +} + +async function main(): Promise { + await listOrderAtSubscriptionLevel(); +} + +main().catch(console.error); diff --git a/sdk/edgeorder/arm-edgeorder/samples-dev/productsAndConfigurationsOperationGroupListConfigurationsSample.ts b/sdk/edgeorder/arm-edgeorder/samples-dev/productsAndConfigurationsOperationGroupListConfigurationsSample.ts new file mode 100644 index 000000000000..d27442602361 --- /dev/null +++ b/sdk/edgeorder/arm-edgeorder/samples-dev/productsAndConfigurationsOperationGroupListConfigurationsSample.ts @@ -0,0 +1,29 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +import { EdgeOrderClient } from "@azure/arm-edgeorder"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to list configurations for the given product family, product line and product for the given subscription. + * + * @summary list configurations for the given product family, product line and product for the given subscription. + * x-ms-original-file: 2024-02-01/ListConfigurations.json + */ +async function listConfigurations(): Promise { + const credential = new DefaultAzureCredential(); + const subscriptionId = "eb5dc900-6186-49d8-b7d7-febd866fdc1d"; + const client = new EdgeOrderClient(credential, subscriptionId); + const resArray = new Array(); + for await (const item of client.productsAndConfigurationsOperationGroup.listConfigurations()) { + resArray.push(item); + } + + console.log(resArray); +} + +async function main(): Promise { + await listConfigurations(); +} + +main().catch(console.error); diff --git a/sdk/edgeorder/arm-edgeorder/samples-dev/productsAndConfigurationsOperationGroupListProductFamiliesMetadataSample.ts b/sdk/edgeorder/arm-edgeorder/samples-dev/productsAndConfigurationsOperationGroupListProductFamiliesMetadataSample.ts new file mode 100644 index 000000000000..2b8c02c62ddf --- /dev/null +++ b/sdk/edgeorder/arm-edgeorder/samples-dev/productsAndConfigurationsOperationGroupListProductFamiliesMetadataSample.ts @@ -0,0 +1,29 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +import { EdgeOrderClient } from "@azure/arm-edgeorder"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to list product families metadata for the given subscription. + * + * @summary list product families metadata for the given subscription. + * x-ms-original-file: 2024-02-01/ListProductFamiliesMetadata.json + */ +async function listProductFamiliesMetadata(): Promise { + const credential = new DefaultAzureCredential(); + const subscriptionId = "eb5dc900-6186-49d8-b7d7-febd866fdc1d"; + const client = new EdgeOrderClient(credential, subscriptionId); + const resArray = new Array(); + for await (const item of client.productsAndConfigurationsOperationGroup.listProductFamiliesMetadata()) { + resArray.push(item); + } + + console.log(resArray); +} + +async function main(): Promise { + await listProductFamiliesMetadata(); +} + +main().catch(console.error); diff --git a/sdk/edgeorder/arm-edgeorder/samples-dev/productsAndConfigurationsOperationGroupListProductFamiliesSample.ts b/sdk/edgeorder/arm-edgeorder/samples-dev/productsAndConfigurationsOperationGroupListProductFamiliesSample.ts new file mode 100644 index 000000000000..d500ca695178 --- /dev/null +++ b/sdk/edgeorder/arm-edgeorder/samples-dev/productsAndConfigurationsOperationGroupListProductFamiliesSample.ts @@ -0,0 +1,31 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +import { EdgeOrderClient } from "@azure/arm-edgeorder"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to list product families for the given subscription. + * + * @summary list product families for the given subscription. + * x-ms-original-file: 2024-02-01/ListProductFamilies.json + */ +async function listProductFamilies(): Promise { + const credential = new DefaultAzureCredential(); + const subscriptionId = "eb5dc900-6186-49d8-b7d7-febd866fdc1d"; + const client = new EdgeOrderClient(credential, subscriptionId); + const resArray = new Array(); + for await (const item of client.productsAndConfigurationsOperationGroup.listProductFamilies({ + expand: "configurations", + })) { + resArray.push(item); + } + + console.log(resArray); +} + +async function main(): Promise { + await listProductFamilies(); +} + +main().catch(console.error); diff --git a/sdk/edgeorder/arm-edgeorder/src/api/addressResources/index.ts b/sdk/edgeorder/arm-edgeorder/src/api/addressResources/index.ts new file mode 100644 index 000000000000..ccfe2c4ab7a0 --- /dev/null +++ b/sdk/edgeorder/arm-edgeorder/src/api/addressResources/index.ts @@ -0,0 +1,19 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +export { + listBySubscription, + listByResourceGroup, + $delete, + update, + create, + get, +} from "./operations.js"; +export { + AddressResourcesListBySubscriptionOptionalParams, + AddressResourcesListByResourceGroupOptionalParams, + AddressResourcesDeleteOptionalParams, + AddressResourcesUpdateOptionalParams, + AddressResourcesCreateOptionalParams, + AddressResourcesGetOptionalParams, +} from "./options.js"; diff --git a/sdk/edgeorder/arm-edgeorder/src/api/addressResources/operations.ts b/sdk/edgeorder/arm-edgeorder/src/api/addressResources/operations.ts new file mode 100644 index 000000000000..e998b81555da --- /dev/null +++ b/sdk/edgeorder/arm-edgeorder/src/api/addressResources/operations.ts @@ -0,0 +1,379 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +import { EdgeOrderContext as Client } from "../index.js"; +import { + errorResponseDeserializer, + AddressResource, + addressResourceSerializer, + addressResourceDeserializer, + AddressUpdateParameter, + addressUpdateParameterSerializer, + _AddressResourceList, + _addressResourceListDeserializer, +} from "../../models/models.js"; +import { + AddressResourcesListBySubscriptionOptionalParams, + AddressResourcesListByResourceGroupOptionalParams, + AddressResourcesDeleteOptionalParams, + AddressResourcesUpdateOptionalParams, + AddressResourcesCreateOptionalParams, + AddressResourcesGetOptionalParams, +} from "./options.js"; +import { + PagedAsyncIterableIterator, + buildPagedAsyncIterator, +} from "../../static-helpers/pagingHelpers.js"; +import { getLongRunningPoller } from "../../static-helpers/pollingHelpers.js"; +import { expandUrlTemplate } from "../../static-helpers/urlTemplate.js"; +import { + StreamableMethod, + PathUncheckedResponse, + createRestError, + operationOptionsToRequestParameters, +} from "@azure-rest/core-client"; +import { PollerLike, OperationState } from "@azure/core-lro"; + +export function _listBySubscriptionSend( + context: Client, + options: AddressResourcesListBySubscriptionOptionalParams = { + requestOptions: {}, + }, +): StreamableMethod { + const path = expandUrlTemplate( + "/subscriptions/{subscriptionId}/providers/Microsoft.EdgeOrder/addresses{?api%2Dversion,%24filter,%24skipToken,%24top}", + { + subscriptionId: context.subscriptionId, + "api%2Dversion": context.apiVersion, + "%24filter": options?.filter, + "%24skipToken": options?.skipToken, + "%24top": options?.top, + }, + { + allowReserved: options?.requestOptions?.skipUrlEncoding, + }, + ); + return context.path(path).get({ + ...operationOptionsToRequestParameters(options), + headers: { + accept: "application/json", + ...options.requestOptions?.headers, + }, + }); +} + +export async function _listBySubscriptionDeserialize( + result: PathUncheckedResponse, +): Promise<_AddressResourceList> { + const expectedStatuses = ["200"]; + if (!expectedStatuses.includes(result.status)) { + const error = createRestError(result); + error.details = errorResponseDeserializer(result.body); + throw error; + } + + return _addressResourceListDeserializer(result.body); +} + +/** List all the addresses available under the subscription. */ +export function listBySubscription( + context: Client, + options: AddressResourcesListBySubscriptionOptionalParams = { + requestOptions: {}, + }, +): PagedAsyncIterableIterator { + return buildPagedAsyncIterator( + context, + () => _listBySubscriptionSend(context, options), + _listBySubscriptionDeserialize, + ["200"], + { itemName: "value", nextLinkName: "nextLink" }, + ); +} + +export function _listByResourceGroupSend( + context: Client, + resourceGroupName: string, + options: AddressResourcesListByResourceGroupOptionalParams = { + requestOptions: {}, + }, +): StreamableMethod { + const path = expandUrlTemplate( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EdgeOrder/addresses{?api%2Dversion,%24filter,%24skipToken,%24top}", + { + subscriptionId: context.subscriptionId, + resourceGroupName: resourceGroupName, + "api%2Dversion": context.apiVersion, + "%24filter": options?.filter, + "%24skipToken": options?.skipToken, + "%24top": options?.top, + }, + { + allowReserved: options?.requestOptions?.skipUrlEncoding, + }, + ); + return context.path(path).get({ + ...operationOptionsToRequestParameters(options), + headers: { + accept: "application/json", + ...options.requestOptions?.headers, + }, + }); +} + +export async function _listByResourceGroupDeserialize( + result: PathUncheckedResponse, +): Promise<_AddressResourceList> { + const expectedStatuses = ["200"]; + if (!expectedStatuses.includes(result.status)) { + const error = createRestError(result); + error.details = errorResponseDeserializer(result.body); + throw error; + } + + return _addressResourceListDeserializer(result.body); +} + +/** List all the addresses available under the given resource group. */ +export function listByResourceGroup( + context: Client, + resourceGroupName: string, + options: AddressResourcesListByResourceGroupOptionalParams = { + requestOptions: {}, + }, +): PagedAsyncIterableIterator { + return buildPagedAsyncIterator( + context, + () => _listByResourceGroupSend(context, resourceGroupName, options), + _listByResourceGroupDeserialize, + ["200"], + { itemName: "value", nextLinkName: "nextLink" }, + ); +} + +export function _$deleteSend( + context: Client, + resourceGroupName: string, + addressName: string, + options: AddressResourcesDeleteOptionalParams = { requestOptions: {} }, +): StreamableMethod { + const path = expandUrlTemplate( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EdgeOrder/addresses/{addressName}{?api%2Dversion}", + { + subscriptionId: context.subscriptionId, + resourceGroupName: resourceGroupName, + addressName: addressName, + "api%2Dversion": context.apiVersion, + }, + { + allowReserved: options?.requestOptions?.skipUrlEncoding, + }, + ); + return context.path(path).delete({ + ...operationOptionsToRequestParameters(options), + headers: { + accept: "application/json", + ...options.requestOptions?.headers, + }, + }); +} + +export async function _$deleteDeserialize(result: PathUncheckedResponse): Promise { + const expectedStatuses = ["202", "204", "200"]; + if (!expectedStatuses.includes(result.status)) { + const error = createRestError(result); + error.details = errorResponseDeserializer(result.body); + throw error; + } + + return; +} + +/** Delete an address. */ +/** + * @fixme delete is a reserved word that cannot be used as an operation name. + * Please add @clientName("clientName") or @clientName("", "javascript") + * to the operation to override the generated name. + */ +export function $delete( + context: Client, + resourceGroupName: string, + addressName: string, + options: AddressResourcesDeleteOptionalParams = { requestOptions: {} }, +): PollerLike, void> { + return getLongRunningPoller(context, _$deleteDeserialize, ["202", "204", "200"], { + updateIntervalInMs: options?.updateIntervalInMs, + abortSignal: options?.abortSignal, + getInitialResponse: () => _$deleteSend(context, resourceGroupName, addressName, options), + resourceLocationConfig: "location", + }) as PollerLike, void>; +} + +export function _updateSend( + context: Client, + resourceGroupName: string, + addressName: string, + addressUpdateParameter: AddressUpdateParameter, + options: AddressResourcesUpdateOptionalParams = { requestOptions: {} }, +): StreamableMethod { + const path = expandUrlTemplate( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EdgeOrder/addresses/{addressName}{?api%2Dversion}", + { + subscriptionId: context.subscriptionId, + resourceGroupName: resourceGroupName, + addressName: addressName, + "api%2Dversion": context.apiVersion, + }, + { + allowReserved: options?.requestOptions?.skipUrlEncoding, + }, + ); + return context.path(path).patch({ + ...operationOptionsToRequestParameters(options), + contentType: "application/json", + headers: { + ...(options?.ifMatch !== undefined ? { "If-Match": options?.ifMatch } : {}), + accept: "application/json", + ...options.requestOptions?.headers, + }, + body: addressUpdateParameterSerializer(addressUpdateParameter), + }); +} + +export async function _updateDeserialize(result: PathUncheckedResponse): Promise { + const expectedStatuses = ["200", "202"]; + if (!expectedStatuses.includes(result.status)) { + const error = createRestError(result); + error.details = errorResponseDeserializer(result.body); + throw error; + } + + return addressResourceDeserializer(result.body); +} + +/** Update the properties of an existing address. */ +export function update( + context: Client, + resourceGroupName: string, + addressName: string, + addressUpdateParameter: AddressUpdateParameter, + options: AddressResourcesUpdateOptionalParams = { requestOptions: {} }, +): PollerLike, AddressResource> { + return getLongRunningPoller(context, _updateDeserialize, ["200", "202"], { + updateIntervalInMs: options?.updateIntervalInMs, + abortSignal: options?.abortSignal, + getInitialResponse: () => + _updateSend(context, resourceGroupName, addressName, addressUpdateParameter, options), + resourceLocationConfig: "location", + }) as PollerLike, AddressResource>; +} + +export function _createSend( + context: Client, + resourceGroupName: string, + addressName: string, + addressResource: AddressResource, + options: AddressResourcesCreateOptionalParams = { requestOptions: {} }, +): StreamableMethod { + const path = expandUrlTemplate( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EdgeOrder/addresses/{addressName}{?api%2Dversion}", + { + subscriptionId: context.subscriptionId, + resourceGroupName: resourceGroupName, + addressName: addressName, + "api%2Dversion": context.apiVersion, + }, + { + allowReserved: options?.requestOptions?.skipUrlEncoding, + }, + ); + return context.path(path).put({ + ...operationOptionsToRequestParameters(options), + contentType: "application/json", + headers: { + accept: "application/json", + ...options.requestOptions?.headers, + }, + body: addressResourceSerializer(addressResource), + }); +} + +export async function _createDeserialize(result: PathUncheckedResponse): Promise { + const expectedStatuses = ["200", "202"]; + if (!expectedStatuses.includes(result.status)) { + const error = createRestError(result); + error.details = errorResponseDeserializer(result.body); + throw error; + } + + return; +} + +/** + * Create a new address with the specified parameters. Existing address cannot be updated with this API and should + * instead be updated with the Update address API. + */ +export function create( + context: Client, + resourceGroupName: string, + addressName: string, + addressResource: AddressResource, + options: AddressResourcesCreateOptionalParams = { requestOptions: {} }, +): PollerLike, void> { + return getLongRunningPoller(context, _createDeserialize, ["200", "202"], { + updateIntervalInMs: options?.updateIntervalInMs, + abortSignal: options?.abortSignal, + getInitialResponse: () => + _createSend(context, resourceGroupName, addressName, addressResource, options), + resourceLocationConfig: "location", + }) as PollerLike, void>; +} + +export function _getSend( + context: Client, + resourceGroupName: string, + addressName: string, + options: AddressResourcesGetOptionalParams = { requestOptions: {} }, +): StreamableMethod { + const path = expandUrlTemplate( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EdgeOrder/addresses/{addressName}{?api%2Dversion}", + { + subscriptionId: context.subscriptionId, + resourceGroupName: resourceGroupName, + addressName: addressName, + "api%2Dversion": context.apiVersion, + }, + { + allowReserved: options?.requestOptions?.skipUrlEncoding, + }, + ); + return context.path(path).get({ + ...operationOptionsToRequestParameters(options), + headers: { + accept: "application/json", + ...options.requestOptions?.headers, + }, + }); +} + +export async function _getDeserialize(result: PathUncheckedResponse): Promise { + const expectedStatuses = ["200"]; + if (!expectedStatuses.includes(result.status)) { + const error = createRestError(result); + error.details = errorResponseDeserializer(result.body); + throw error; + } + + return addressResourceDeserializer(result.body); +} + +/** Get information about the specified address. */ +export async function get( + context: Client, + resourceGroupName: string, + addressName: string, + options: AddressResourcesGetOptionalParams = { requestOptions: {} }, +): Promise { + const result = await _getSend(context, resourceGroupName, addressName, options); + return _getDeserialize(result); +} diff --git a/sdk/edgeorder/arm-edgeorder/src/api/addressResources/options.ts b/sdk/edgeorder/arm-edgeorder/src/api/addressResources/options.ts new file mode 100644 index 000000000000..69f8ba052690 --- /dev/null +++ b/sdk/edgeorder/arm-edgeorder/src/api/addressResources/options.ts @@ -0,0 +1,47 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +import { OperationOptions } from "@azure-rest/core-client"; + +/** Optional parameters. */ +export interface AddressResourcesListBySubscriptionOptionalParams extends OperationOptions { + /** $filter is supported to filter based on shipping address properties. Filter supports only equals operation. */ + filter?: string; + /** $skipToken is supported on Get list of addresses, which provides the next page in the list of addresses. */ + skipToken?: string; + /** $top is supported on fetching list of resources. $top=10 means that the first 10 items in the list will be returned to the API caller. */ + top?: number; +} + +/** Optional parameters. */ +export interface AddressResourcesListByResourceGroupOptionalParams extends OperationOptions { + /** $filter is supported to filter based on shipping address properties. Filter supports only equals operation. */ + filter?: string; + /** $skipToken is supported on Get list of addresses, which provides the next page in the list of addresses. */ + skipToken?: string; + /** $top is supported on fetching list of resources. $top=10 means that the first 10 items in the list will be returned to the API caller. */ + top?: number; +} + +/** Optional parameters. */ +export interface AddressResourcesDeleteOptionalParams extends OperationOptions { + /** Delay to wait until next poll, in milliseconds. */ + updateIntervalInMs?: number; +} + +/** Optional parameters. */ +export interface AddressResourcesUpdateOptionalParams extends OperationOptions { + /** Delay to wait until next poll, in milliseconds. */ + updateIntervalInMs?: number; + /** Defines the If-Match condition. The patch will be performed only if the ETag of the job on the server matches this value. */ + ifMatch?: string; +} + +/** Optional parameters. */ +export interface AddressResourcesCreateOptionalParams extends OperationOptions { + /** Delay to wait until next poll, in milliseconds. */ + updateIntervalInMs?: number; +} + +/** Optional parameters. */ +export interface AddressResourcesGetOptionalParams extends OperationOptions {} diff --git a/sdk/edgeorder/arm-edgeorder/src/api/edgeOrderContext.ts b/sdk/edgeorder/arm-edgeorder/src/api/edgeOrderContext.ts new file mode 100644 index 000000000000..43e776fb2435 --- /dev/null +++ b/sdk/edgeorder/arm-edgeorder/src/api/edgeOrderContext.ts @@ -0,0 +1,64 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +import { logger } from "../logger.js"; +import { KnownVersions } from "../models/models.js"; +import { Client, ClientOptions, getClient } from "@azure-rest/core-client"; +import { TokenCredential } from "@azure/core-auth"; + +/** Edge Order API's */ +export interface EdgeOrderContext extends Client { + /** The API version to use for this operation. */ + /** Known values of {@link KnownVersions} that the service accepts. */ + apiVersion: string; + /** The ID of the target subscription. The value must be an UUID. */ + subscriptionId: string; +} + +/** Optional parameters for the client. */ +export interface EdgeOrderClientOptionalParams extends ClientOptions { + /** The API version to use for this operation. */ + /** Known values of {@link KnownVersions} that the service accepts. */ + apiVersion?: string; +} + +/** Edge Order API's */ +export function createEdgeOrder( + credential: TokenCredential, + subscriptionId: string, + options: EdgeOrderClientOptionalParams = {}, +): EdgeOrderContext { + const endpointUrl = options.endpoint ?? options.baseUrl ?? "https://management.azure.com"; + const prefixFromOptions = options?.userAgentOptions?.userAgentPrefix; + const userAgentInfo = `azsdk-js-arm-edgeorder/1.0.0`; + const userAgentPrefix = prefixFromOptions + ? `${prefixFromOptions} azsdk-js-api ${userAgentInfo}` + : `azsdk-js-api ${userAgentInfo}`; + const { apiVersion: _, ...updatedOptions } = { + ...options, + userAgentOptions: { userAgentPrefix }, + loggingOptions: { logger: options.loggingOptions?.logger ?? logger.info }, + credentials: { + scopes: options.credentials?.scopes ?? [`${endpointUrl}/.default`], + }, + }; + const clientContext = getClient(endpointUrl, credential, updatedOptions); + clientContext.pipeline.removePolicy({ name: "ApiVersionPolicy" }); + const apiVersion = options.apiVersion ?? "2024-02-01"; + clientContext.pipeline.addPolicy({ + name: "ClientApiVersionPolicy", + sendRequest: (req, next) => { + // Use the apiVersion defined in request url directly + // Append one if there is no apiVersion and we have one at client options + const url = new URL(req.url); + if (!url.searchParams.get("api-version")) { + req.url = `${req.url}${ + Array.from(url.searchParams.keys()).length > 0 ? "&" : "?" + }api-version=${apiVersion}`; + } + + return next(req); + }, + }); + return { ...clientContext, apiVersion, subscriptionId } as EdgeOrderContext; +} diff --git a/sdk/edgeorder/arm-edgeorder/src/api/index.ts b/sdk/edgeorder/arm-edgeorder/src/api/index.ts new file mode 100644 index 000000000000..1b510bf44833 --- /dev/null +++ b/sdk/edgeorder/arm-edgeorder/src/api/index.ts @@ -0,0 +1,8 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +export { + createEdgeOrder, + EdgeOrderContext, + EdgeOrderClientOptionalParams, +} from "./edgeOrderContext.js"; diff --git a/sdk/edgeorder/arm-edgeorder/src/api/operations/index.ts b/sdk/edgeorder/arm-edgeorder/src/api/operations/index.ts new file mode 100644 index 000000000000..24a804d14fcf --- /dev/null +++ b/sdk/edgeorder/arm-edgeorder/src/api/operations/index.ts @@ -0,0 +1,5 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +export { list } from "./operations.js"; +export { OperationsListOptionalParams } from "./options.js"; diff --git a/sdk/edgeorder/arm-edgeorder/src/api/operations/operations.ts b/sdk/edgeorder/arm-edgeorder/src/api/operations/operations.ts new file mode 100644 index 000000000000..3efc81b588aa --- /dev/null +++ b/sdk/edgeorder/arm-edgeorder/src/api/operations/operations.ts @@ -0,0 +1,71 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +import { EdgeOrderContext as Client } from "../index.js"; +import { + _OperationListResult, + _operationListResultDeserializer, + Operation, + errorResponseDeserializer, +} from "../../models/models.js"; +import { OperationsListOptionalParams } from "./options.js"; +import { + PagedAsyncIterableIterator, + buildPagedAsyncIterator, +} from "../../static-helpers/pagingHelpers.js"; +import { expandUrlTemplate } from "../../static-helpers/urlTemplate.js"; +import { + StreamableMethod, + PathUncheckedResponse, + createRestError, + operationOptionsToRequestParameters, +} from "@azure-rest/core-client"; + +export function _listSend( + context: Client, + options: OperationsListOptionalParams = { requestOptions: {} }, +): StreamableMethod { + const path = expandUrlTemplate( + "/providers/Microsoft.EdgeOrder/operations{?api%2Dversion}", + { + "api%2Dversion": context.apiVersion, + }, + { + allowReserved: options?.requestOptions?.skipUrlEncoding, + }, + ); + return context.path(path).get({ + ...operationOptionsToRequestParameters(options), + headers: { + accept: "application/json", + ...options.requestOptions?.headers, + }, + }); +} + +export async function _listDeserialize( + result: PathUncheckedResponse, +): Promise<_OperationListResult> { + const expectedStatuses = ["200"]; + if (!expectedStatuses.includes(result.status)) { + const error = createRestError(result); + error.details = errorResponseDeserializer(result.body); + throw error; + } + + return _operationListResultDeserializer(result.body); +} + +/** List the operations for the provider */ +export function list( + context: Client, + options: OperationsListOptionalParams = { requestOptions: {} }, +): PagedAsyncIterableIterator { + return buildPagedAsyncIterator( + context, + () => _listSend(context, options), + _listDeserialize, + ["200"], + { itemName: "value", nextLinkName: "nextLink" }, + ); +} diff --git a/sdk/edgeorder/arm-edgeorder/src/api/operations/options.ts b/sdk/edgeorder/arm-edgeorder/src/api/operations/options.ts new file mode 100644 index 000000000000..c461016ad1c5 --- /dev/null +++ b/sdk/edgeorder/arm-edgeorder/src/api/operations/options.ts @@ -0,0 +1,7 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +import { OperationOptions } from "@azure-rest/core-client"; + +/** Optional parameters. */ +export interface OperationsListOptionalParams extends OperationOptions {} diff --git a/sdk/edgeorder/arm-edgeorder/src/api/orderItemResources/index.ts b/sdk/edgeorder/arm-edgeorder/src/api/orderItemResources/index.ts new file mode 100644 index 000000000000..f77041900e33 --- /dev/null +++ b/sdk/edgeorder/arm-edgeorder/src/api/orderItemResources/index.ts @@ -0,0 +1,23 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +export { + returnOrderItem, + cancel, + listBySubscription, + listByResourceGroup, + $delete, + update, + create, + get, +} from "./operations.js"; +export { + OrderItemResourcesReturnOrderItemOptionalParams, + OrderItemResourcesCancelOptionalParams, + OrderItemResourcesListBySubscriptionOptionalParams, + OrderItemResourcesListByResourceGroupOptionalParams, + OrderItemResourcesDeleteOptionalParams, + OrderItemResourcesUpdateOptionalParams, + OrderItemResourcesCreateOptionalParams, + OrderItemResourcesGetOptionalParams, +} from "./options.js"; diff --git a/sdk/edgeorder/arm-edgeorder/src/api/orderItemResources/operations.ts b/sdk/edgeorder/arm-edgeorder/src/api/orderItemResources/operations.ts new file mode 100644 index 000000000000..2af76487d7a0 --- /dev/null +++ b/sdk/edgeorder/arm-edgeorder/src/api/orderItemResources/operations.ts @@ -0,0 +1,521 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +import { EdgeOrderContext as Client } from "../index.js"; +import { + errorResponseDeserializer, + OrderItemResource, + orderItemResourceSerializer, + orderItemResourceDeserializer, + OrderItemUpdateParameter, + orderItemUpdateParameterSerializer, + _OrderItemResourceList, + _orderItemResourceListDeserializer, + CancellationReason, + cancellationReasonSerializer, + ReturnOrderItemDetails, + returnOrderItemDetailsSerializer, + OkResponse, + okResponseDeserializer, +} from "../../models/models.js"; +import { + OrderItemResourcesReturnOrderItemOptionalParams, + OrderItemResourcesCancelOptionalParams, + OrderItemResourcesListBySubscriptionOptionalParams, + OrderItemResourcesListByResourceGroupOptionalParams, + OrderItemResourcesDeleteOptionalParams, + OrderItemResourcesUpdateOptionalParams, + OrderItemResourcesCreateOptionalParams, + OrderItemResourcesGetOptionalParams, +} from "./options.js"; +import { + PagedAsyncIterableIterator, + buildPagedAsyncIterator, +} from "../../static-helpers/pagingHelpers.js"; +import { getLongRunningPoller } from "../../static-helpers/pollingHelpers.js"; +import { expandUrlTemplate } from "../../static-helpers/urlTemplate.js"; +import { + StreamableMethod, + PathUncheckedResponse, + createRestError, + operationOptionsToRequestParameters, +} from "@azure-rest/core-client"; +import { PollerLike, OperationState } from "@azure/core-lro"; + +export function _returnOrderItemSend( + context: Client, + resourceGroupName: string, + orderItemName: string, + returnOrderItemDetails: ReturnOrderItemDetails, + options: OrderItemResourcesReturnOrderItemOptionalParams = { + requestOptions: {}, + }, +): StreamableMethod { + const path = expandUrlTemplate( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EdgeOrder/orderItems/{orderItemName}/return{?api%2Dversion}", + { + subscriptionId: context.subscriptionId, + resourceGroupName: resourceGroupName, + orderItemName: orderItemName, + "api%2Dversion": context.apiVersion, + }, + { + allowReserved: options?.requestOptions?.skipUrlEncoding, + }, + ); + return context.path(path).post({ + ...operationOptionsToRequestParameters(options), + contentType: "application/json", + headers: { + accept: "application/json", + ...options.requestOptions?.headers, + }, + body: returnOrderItemDetailsSerializer(returnOrderItemDetails), + }); +} + +export async function _returnOrderItemDeserialize( + result: PathUncheckedResponse, +): Promise { + const expectedStatuses = ["202", "200"]; + if (!expectedStatuses.includes(result.status)) { + const error = createRestError(result); + error.details = errorResponseDeserializer(result.body); + throw error; + } + + return okResponseDeserializer(result.body); +} + +/** Return order item. */ +export function returnOrderItem( + context: Client, + resourceGroupName: string, + orderItemName: string, + returnOrderItemDetails: ReturnOrderItemDetails, + options: OrderItemResourcesReturnOrderItemOptionalParams = { + requestOptions: {}, + }, +): PollerLike, OkResponse> { + return getLongRunningPoller(context, _returnOrderItemDeserialize, ["202", "200"], { + updateIntervalInMs: options?.updateIntervalInMs, + abortSignal: options?.abortSignal, + getInitialResponse: () => + _returnOrderItemSend( + context, + resourceGroupName, + orderItemName, + returnOrderItemDetails, + options, + ), + resourceLocationConfig: "location", + }) as PollerLike, OkResponse>; +} + +export function _cancelSend( + context: Client, + resourceGroupName: string, + orderItemName: string, + cancellationReason: CancellationReason, + options: OrderItemResourcesCancelOptionalParams = { requestOptions: {} }, +): StreamableMethod { + const path = expandUrlTemplate( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EdgeOrder/orderItems/{orderItemName}/cancel{?api%2Dversion}", + { + subscriptionId: context.subscriptionId, + resourceGroupName: resourceGroupName, + orderItemName: orderItemName, + "api%2Dversion": context.apiVersion, + }, + { + allowReserved: options?.requestOptions?.skipUrlEncoding, + }, + ); + return context.path(path).post({ + ...operationOptionsToRequestParameters(options), + contentType: "application/json", + headers: { + accept: "application/json", + ...options.requestOptions?.headers, + }, + body: cancellationReasonSerializer(cancellationReason), + }); +} + +export async function _cancelDeserialize(result: PathUncheckedResponse): Promise { + const expectedStatuses = ["200", "204"]; + if (!expectedStatuses.includes(result.status)) { + const error = createRestError(result); + error.details = errorResponseDeserializer(result.body); + throw error; + } + + return; +} + +/** Cancel order item. */ +export async function cancel( + context: Client, + resourceGroupName: string, + orderItemName: string, + cancellationReason: CancellationReason, + options: OrderItemResourcesCancelOptionalParams = { requestOptions: {} }, +): Promise { + const result = await _cancelSend( + context, + resourceGroupName, + orderItemName, + cancellationReason, + options, + ); + return _cancelDeserialize(result); +} + +export function _listBySubscriptionSend( + context: Client, + options: OrderItemResourcesListBySubscriptionOptionalParams = { + requestOptions: {}, + }, +): StreamableMethod { + const path = expandUrlTemplate( + "/subscriptions/{subscriptionId}/providers/Microsoft.EdgeOrder/orderItems{?api%2Dversion,%24filter,%24expand,%24skipToken,%24top}", + { + subscriptionId: context.subscriptionId, + "api%2Dversion": context.apiVersion, + "%24filter": options?.filter, + "%24expand": options?.expand, + "%24skipToken": options?.skipToken, + "%24top": options?.top, + }, + { + allowReserved: options?.requestOptions?.skipUrlEncoding, + }, + ); + return context.path(path).get({ + ...operationOptionsToRequestParameters(options), + headers: { + accept: "application/json", + ...options.requestOptions?.headers, + }, + }); +} + +export async function _listBySubscriptionDeserialize( + result: PathUncheckedResponse, +): Promise<_OrderItemResourceList> { + const expectedStatuses = ["200"]; + if (!expectedStatuses.includes(result.status)) { + const error = createRestError(result); + error.details = errorResponseDeserializer(result.body); + throw error; + } + + return _orderItemResourceListDeserializer(result.body); +} + +/** List order items at subscription level. */ +export function listBySubscription( + context: Client, + options: OrderItemResourcesListBySubscriptionOptionalParams = { + requestOptions: {}, + }, +): PagedAsyncIterableIterator { + return buildPagedAsyncIterator( + context, + () => _listBySubscriptionSend(context, options), + _listBySubscriptionDeserialize, + ["200"], + { itemName: "value", nextLinkName: "nextLink" }, + ); +} + +export function _listByResourceGroupSend( + context: Client, + resourceGroupName: string, + options: OrderItemResourcesListByResourceGroupOptionalParams = { + requestOptions: {}, + }, +): StreamableMethod { + const path = expandUrlTemplate( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EdgeOrder/orderItems{?api%2Dversion,%24filter,%24expand,%24skipToken,%24top}", + { + subscriptionId: context.subscriptionId, + resourceGroupName: resourceGroupName, + "api%2Dversion": context.apiVersion, + "%24filter": options?.filter, + "%24expand": options?.expand, + "%24skipToken": options?.skipToken, + "%24top": options?.top, + }, + { + allowReserved: options?.requestOptions?.skipUrlEncoding, + }, + ); + return context.path(path).get({ + ...operationOptionsToRequestParameters(options), + headers: { + accept: "application/json", + ...options.requestOptions?.headers, + }, + }); +} + +export async function _listByResourceGroupDeserialize( + result: PathUncheckedResponse, +): Promise<_OrderItemResourceList> { + const expectedStatuses = ["200"]; + if (!expectedStatuses.includes(result.status)) { + const error = createRestError(result); + error.details = errorResponseDeserializer(result.body); + throw error; + } + + return _orderItemResourceListDeserializer(result.body); +} + +/** List order items at resource group level. */ +export function listByResourceGroup( + context: Client, + resourceGroupName: string, + options: OrderItemResourcesListByResourceGroupOptionalParams = { + requestOptions: {}, + }, +): PagedAsyncIterableIterator { + return buildPagedAsyncIterator( + context, + () => _listByResourceGroupSend(context, resourceGroupName, options), + _listByResourceGroupDeserialize, + ["200"], + { itemName: "value", nextLinkName: "nextLink" }, + ); +} + +export function _$deleteSend( + context: Client, + resourceGroupName: string, + orderItemName: string, + options: OrderItemResourcesDeleteOptionalParams = { requestOptions: {} }, +): StreamableMethod { + const path = expandUrlTemplate( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EdgeOrder/orderItems/{orderItemName}{?api%2Dversion}", + { + subscriptionId: context.subscriptionId, + resourceGroupName: resourceGroupName, + orderItemName: orderItemName, + "api%2Dversion": context.apiVersion, + }, + { + allowReserved: options?.requestOptions?.skipUrlEncoding, + }, + ); + return context.path(path).delete({ + ...operationOptionsToRequestParameters(options), + headers: { + accept: "application/json", + ...options.requestOptions?.headers, + }, + }); +} + +export async function _$deleteDeserialize(result: PathUncheckedResponse): Promise { + const expectedStatuses = ["202", "204", "200"]; + if (!expectedStatuses.includes(result.status)) { + const error = createRestError(result); + error.details = errorResponseDeserializer(result.body); + throw error; + } + + return; +} + +/** Delete an order item. */ +/** + * @fixme delete is a reserved word that cannot be used as an operation name. + * Please add @clientName("clientName") or @clientName("", "javascript") + * to the operation to override the generated name. + */ +export function $delete( + context: Client, + resourceGroupName: string, + orderItemName: string, + options: OrderItemResourcesDeleteOptionalParams = { requestOptions: {} }, +): PollerLike, void> { + return getLongRunningPoller(context, _$deleteDeserialize, ["202", "204", "200"], { + updateIntervalInMs: options?.updateIntervalInMs, + abortSignal: options?.abortSignal, + getInitialResponse: () => _$deleteSend(context, resourceGroupName, orderItemName, options), + resourceLocationConfig: "location", + }) as PollerLike, void>; +} + +export function _updateSend( + context: Client, + resourceGroupName: string, + orderItemName: string, + orderItemUpdateParameter: OrderItemUpdateParameter, + options: OrderItemResourcesUpdateOptionalParams = { requestOptions: {} }, +): StreamableMethod { + const path = expandUrlTemplate( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EdgeOrder/orderItems/{orderItemName}{?api%2Dversion}", + { + subscriptionId: context.subscriptionId, + resourceGroupName: resourceGroupName, + orderItemName: orderItemName, + "api%2Dversion": context.apiVersion, + }, + { + allowReserved: options?.requestOptions?.skipUrlEncoding, + }, + ); + return context.path(path).patch({ + ...operationOptionsToRequestParameters(options), + contentType: "application/json", + headers: { + ...(options?.ifMatch !== undefined ? { "If-Match": options?.ifMatch } : {}), + accept: "application/json", + ...options.requestOptions?.headers, + }, + body: orderItemUpdateParameterSerializer(orderItemUpdateParameter), + }); +} + +export async function _updateDeserialize( + result: PathUncheckedResponse, +): Promise { + const expectedStatuses = ["200", "202"]; + if (!expectedStatuses.includes(result.status)) { + const error = createRestError(result); + error.details = errorResponseDeserializer(result.body); + throw error; + } + + return orderItemResourceDeserializer(result.body); +} + +/** Update the properties of an existing order item. */ +export function update( + context: Client, + resourceGroupName: string, + orderItemName: string, + orderItemUpdateParameter: OrderItemUpdateParameter, + options: OrderItemResourcesUpdateOptionalParams = { requestOptions: {} }, +): PollerLike, OrderItemResource> { + return getLongRunningPoller(context, _updateDeserialize, ["200", "202"], { + updateIntervalInMs: options?.updateIntervalInMs, + abortSignal: options?.abortSignal, + getInitialResponse: () => + _updateSend(context, resourceGroupName, orderItemName, orderItemUpdateParameter, options), + resourceLocationConfig: "location", + }) as PollerLike, OrderItemResource>; +} + +export function _createSend( + context: Client, + resourceGroupName: string, + orderItemName: string, + orderItemResource: OrderItemResource, + options: OrderItemResourcesCreateOptionalParams = { requestOptions: {} }, +): StreamableMethod { + const path = expandUrlTemplate( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EdgeOrder/orderItems/{orderItemName}{?api%2Dversion}", + { + subscriptionId: context.subscriptionId, + resourceGroupName: resourceGroupName, + orderItemName: orderItemName, + "api%2Dversion": context.apiVersion, + }, + { + allowReserved: options?.requestOptions?.skipUrlEncoding, + }, + ); + return context.path(path).put({ + ...operationOptionsToRequestParameters(options), + contentType: "application/json", + headers: { + accept: "application/json", + ...options.requestOptions?.headers, + }, + body: orderItemResourceSerializer(orderItemResource), + }); +} + +export async function _createDeserialize(result: PathUncheckedResponse): Promise { + const expectedStatuses = ["200", "202"]; + if (!expectedStatuses.includes(result.status)) { + const error = createRestError(result); + error.details = errorResponseDeserializer(result.body); + throw error; + } + + return; +} + +/** + * Create an order item. Existing order item cannot be updated with this api and should instead be updated with the Update order item + * API. + */ +export function create( + context: Client, + resourceGroupName: string, + orderItemName: string, + orderItemResource: OrderItemResource, + options: OrderItemResourcesCreateOptionalParams = { requestOptions: {} }, +): PollerLike, void> { + return getLongRunningPoller(context, _createDeserialize, ["200", "202"], { + updateIntervalInMs: options?.updateIntervalInMs, + abortSignal: options?.abortSignal, + getInitialResponse: () => + _createSend(context, resourceGroupName, orderItemName, orderItemResource, options), + resourceLocationConfig: "location", + }) as PollerLike, void>; +} + +export function _getSend( + context: Client, + resourceGroupName: string, + orderItemName: string, + options: OrderItemResourcesGetOptionalParams = { requestOptions: {} }, +): StreamableMethod { + const path = expandUrlTemplate( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EdgeOrder/orderItems/{orderItemName}{?api%2Dversion,%24expand}", + { + subscriptionId: context.subscriptionId, + resourceGroupName: resourceGroupName, + orderItemName: orderItemName, + "api%2Dversion": context.apiVersion, + "%24expand": options?.expand, + }, + { + allowReserved: options?.requestOptions?.skipUrlEncoding, + }, + ); + return context.path(path).get({ + ...operationOptionsToRequestParameters(options), + headers: { + accept: "application/json", + ...options.requestOptions?.headers, + }, + }); +} + +export async function _getDeserialize(result: PathUncheckedResponse): Promise { + const expectedStatuses = ["200"]; + if (!expectedStatuses.includes(result.status)) { + const error = createRestError(result); + error.details = errorResponseDeserializer(result.body); + throw error; + } + + return orderItemResourceDeserializer(result.body); +} + +/** Get an order item. */ +export async function get( + context: Client, + resourceGroupName: string, + orderItemName: string, + options: OrderItemResourcesGetOptionalParams = { requestOptions: {} }, +): Promise { + const result = await _getSend(context, resourceGroupName, orderItemName, options); + return _getDeserialize(result); +} diff --git a/sdk/edgeorder/arm-edgeorder/src/api/orderItemResources/options.ts b/sdk/edgeorder/arm-edgeorder/src/api/orderItemResources/options.ts new file mode 100644 index 000000000000..2f7766211018 --- /dev/null +++ b/sdk/edgeorder/arm-edgeorder/src/api/orderItemResources/options.ts @@ -0,0 +1,63 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +import { OperationOptions } from "@azure-rest/core-client"; + +/** Optional parameters. */ +export interface OrderItemResourcesReturnOrderItemOptionalParams extends OperationOptions { + /** Delay to wait until next poll, in milliseconds. */ + updateIntervalInMs?: number; +} + +/** Optional parameters. */ +export interface OrderItemResourcesCancelOptionalParams extends OperationOptions {} + +/** Optional parameters. */ +export interface OrderItemResourcesListBySubscriptionOptionalParams extends OperationOptions { + /** $filter is supported to filter based on order id and order Item Type. Filter supports only equals operation. */ + filter?: string; + /** $expand is supported on parent device details, device details, forward shipping details and reverse shipping details parameters. Each of these can be provided as a comma separated list. Parent Device Details for order item provides details on the devices of the product, Device Details for order item provides details on the devices of the child configurations of the product, Forward and Reverse Shipping details provide forward and reverse shipping details respectively. */ + expand?: string; + /** $skipToken is supported on Get list of order items, which provides the next page in the list of order items. */ + skipToken?: string; + /** $top is supported on fetching list of resources. $top=10 means that the first 10 items in the list will be returned to the API caller. */ + top?: number; +} + +/** Optional parameters. */ +export interface OrderItemResourcesListByResourceGroupOptionalParams extends OperationOptions { + /** $filter is supported to filter based on order id and order Item Type. Filter supports only equals operation. */ + filter?: string; + /** $expand is supported on parent device details, device details, forward shipping details and reverse shipping details parameters. Each of these can be provided as a comma separated list. Parent Device Details for order item provides details on the devices of the product, Device Details for order item provides details on the devices of the child configurations of the product, Forward and Reverse Shipping details provide forward and reverse shipping details respectively. */ + expand?: string; + /** $skipToken is supported on Get list of order items, which provides the next page in the list of order items. */ + skipToken?: string; + /** $top is supported on fetching list of resources. $top=10 means that the first 10 items in the list will be returned to the API caller. */ + top?: number; +} + +/** Optional parameters. */ +export interface OrderItemResourcesDeleteOptionalParams extends OperationOptions { + /** Delay to wait until next poll, in milliseconds. */ + updateIntervalInMs?: number; +} + +/** Optional parameters. */ +export interface OrderItemResourcesUpdateOptionalParams extends OperationOptions { + /** Delay to wait until next poll, in milliseconds. */ + updateIntervalInMs?: number; + /** Defines the If-Match condition. The patch will be performed only if the ETag of the order on the server matches this value. */ + ifMatch?: string; +} + +/** Optional parameters. */ +export interface OrderItemResourcesCreateOptionalParams extends OperationOptions { + /** Delay to wait until next poll, in milliseconds. */ + updateIntervalInMs?: number; +} + +/** Optional parameters. */ +export interface OrderItemResourcesGetOptionalParams extends OperationOptions { + /** $expand is supported on parent device details, device details, forward shipping details and reverse shipping details parameters. Each of these can be provided as a comma separated list. Parent Device Details for order item provides details on the devices of the product, Device Details for order item provides details on the devices of the child configurations of the product, Forward and Reverse Shipping details provide forward and reverse shipping details respectively. */ + expand?: string; +} diff --git a/sdk/edgeorder/arm-edgeorder/src/api/orderResources/index.ts b/sdk/edgeorder/arm-edgeorder/src/api/orderResources/index.ts new file mode 100644 index 000000000000..c61d1875fc91 --- /dev/null +++ b/sdk/edgeorder/arm-edgeorder/src/api/orderResources/index.ts @@ -0,0 +1,5 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +export { get } from "./operations.js"; +export { OrderResourcesGetOptionalParams } from "./options.js"; diff --git a/sdk/edgeorder/arm-edgeorder/src/api/orderResources/operations.ts b/sdk/edgeorder/arm-edgeorder/src/api/orderResources/operations.ts new file mode 100644 index 000000000000..17ebd8c8c0b3 --- /dev/null +++ b/sdk/edgeorder/arm-edgeorder/src/api/orderResources/operations.ts @@ -0,0 +1,69 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +import { EdgeOrderContext as Client } from "../index.js"; +import { + errorResponseDeserializer, + OrderResource, + orderResourceDeserializer, +} from "../../models/models.js"; +import { OrderResourcesGetOptionalParams } from "./options.js"; +import { expandUrlTemplate } from "../../static-helpers/urlTemplate.js"; +import { + StreamableMethod, + PathUncheckedResponse, + createRestError, + operationOptionsToRequestParameters, +} from "@azure-rest/core-client"; + +export function _getSend( + context: Client, + resourceGroupName: string, + location: string, + orderName: string, + options: OrderResourcesGetOptionalParams = { requestOptions: {} }, +): StreamableMethod { + const path = expandUrlTemplate( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EdgeOrder/locations/{location}/orders/{orderName}{?api%2Dversion}", + { + subscriptionId: context.subscriptionId, + resourceGroupName: resourceGroupName, + location: location, + orderName: orderName, + "api%2Dversion": context.apiVersion, + }, + { + allowReserved: options?.requestOptions?.skipUrlEncoding, + }, + ); + return context.path(path).get({ + ...operationOptionsToRequestParameters(options), + headers: { + accept: "application/json", + ...options.requestOptions?.headers, + }, + }); +} + +export async function _getDeserialize(result: PathUncheckedResponse): Promise { + const expectedStatuses = ["200"]; + if (!expectedStatuses.includes(result.status)) { + const error = createRestError(result); + error.details = errorResponseDeserializer(result.body); + throw error; + } + + return orderResourceDeserializer(result.body); +} + +/** Get an order. */ +export async function get( + context: Client, + resourceGroupName: string, + location: string, + orderName: string, + options: OrderResourcesGetOptionalParams = { requestOptions: {} }, +): Promise { + const result = await _getSend(context, resourceGroupName, location, orderName, options); + return _getDeserialize(result); +} diff --git a/sdk/edgeorder/arm-edgeorder/src/api/orderResources/options.ts b/sdk/edgeorder/arm-edgeorder/src/api/orderResources/options.ts new file mode 100644 index 000000000000..c59873c9a566 --- /dev/null +++ b/sdk/edgeorder/arm-edgeorder/src/api/orderResources/options.ts @@ -0,0 +1,7 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +import { OperationOptions } from "@azure-rest/core-client"; + +/** Optional parameters. */ +export interface OrderResourcesGetOptionalParams extends OperationOptions {} diff --git a/sdk/edgeorder/arm-edgeorder/src/api/ordersOperationGroup/index.ts b/sdk/edgeorder/arm-edgeorder/src/api/ordersOperationGroup/index.ts new file mode 100644 index 000000000000..df7dc6d65d60 --- /dev/null +++ b/sdk/edgeorder/arm-edgeorder/src/api/ordersOperationGroup/index.ts @@ -0,0 +1,8 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +export { listByResourceGroup, listBySubscription } from "./operations.js"; +export { + OrdersOperationGroupListByResourceGroupOptionalParams, + OrdersOperationGroupListBySubscriptionOptionalParams, +} from "./options.js"; diff --git a/sdk/edgeorder/arm-edgeorder/src/api/ordersOperationGroup/operations.ts b/sdk/edgeorder/arm-edgeorder/src/api/ordersOperationGroup/operations.ts new file mode 100644 index 000000000000..b4f602d1202e --- /dev/null +++ b/sdk/edgeorder/arm-edgeorder/src/api/ordersOperationGroup/operations.ts @@ -0,0 +1,140 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +import { EdgeOrderContext as Client } from "../index.js"; +import { + errorResponseDeserializer, + OrderResource, + _OrderResourceList, + _orderResourceListDeserializer, +} from "../../models/models.js"; +import { + OrdersOperationGroupListByResourceGroupOptionalParams, + OrdersOperationGroupListBySubscriptionOptionalParams, +} from "./options.js"; +import { + PagedAsyncIterableIterator, + buildPagedAsyncIterator, +} from "../../static-helpers/pagingHelpers.js"; +import { expandUrlTemplate } from "../../static-helpers/urlTemplate.js"; +import { + StreamableMethod, + PathUncheckedResponse, + createRestError, + operationOptionsToRequestParameters, +} from "@azure-rest/core-client"; + +export function _listByResourceGroupSend( + context: Client, + resourceGroupName: string, + options: OrdersOperationGroupListByResourceGroupOptionalParams = { + requestOptions: {}, + }, +): StreamableMethod { + const path = expandUrlTemplate( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EdgeOrder/orders{?api%2Dversion,%24skipToken,%24top}", + { + subscriptionId: context.subscriptionId, + resourceGroupName: resourceGroupName, + "api%2Dversion": context.apiVersion, + "%24skipToken": options?.skipToken, + "%24top": options?.top, + }, + { + allowReserved: options?.requestOptions?.skipUrlEncoding, + }, + ); + return context.path(path).get({ + ...operationOptionsToRequestParameters(options), + headers: { + accept: "application/json", + ...options.requestOptions?.headers, + }, + }); +} + +export async function _listByResourceGroupDeserialize( + result: PathUncheckedResponse, +): Promise<_OrderResourceList> { + const expectedStatuses = ["200"]; + if (!expectedStatuses.includes(result.status)) { + const error = createRestError(result); + error.details = errorResponseDeserializer(result.body); + throw error; + } + + return _orderResourceListDeserializer(result.body); +} + +/** List orders at resource group level. */ +export function listByResourceGroup( + context: Client, + resourceGroupName: string, + options: OrdersOperationGroupListByResourceGroupOptionalParams = { + requestOptions: {}, + }, +): PagedAsyncIterableIterator { + return buildPagedAsyncIterator( + context, + () => _listByResourceGroupSend(context, resourceGroupName, options), + _listByResourceGroupDeserialize, + ["200"], + { itemName: "value", nextLinkName: "nextLink" }, + ); +} + +export function _listBySubscriptionSend( + context: Client, + options: OrdersOperationGroupListBySubscriptionOptionalParams = { + requestOptions: {}, + }, +): StreamableMethod { + const path = expandUrlTemplate( + "/subscriptions/{subscriptionId}/providers/Microsoft.EdgeOrder/orders{?api%2Dversion,%24skipToken,%24top}", + { + subscriptionId: context.subscriptionId, + "api%2Dversion": context.apiVersion, + "%24skipToken": options?.skipToken, + "%24top": options?.top, + }, + { + allowReserved: options?.requestOptions?.skipUrlEncoding, + }, + ); + return context.path(path).get({ + ...operationOptionsToRequestParameters(options), + headers: { + accept: "application/json", + ...options.requestOptions?.headers, + }, + }); +} + +export async function _listBySubscriptionDeserialize( + result: PathUncheckedResponse, +): Promise<_OrderResourceList> { + const expectedStatuses = ["200"]; + if (!expectedStatuses.includes(result.status)) { + const error = createRestError(result); + error.details = errorResponseDeserializer(result.body); + throw error; + } + + return _orderResourceListDeserializer(result.body); +} + +/** List orders at subscription level. */ +export function listBySubscription( + context: Client, + options: OrdersOperationGroupListBySubscriptionOptionalParams = { + requestOptions: {}, + }, +): PagedAsyncIterableIterator { + return buildPagedAsyncIterator( + context, + () => _listBySubscriptionSend(context, options), + _listBySubscriptionDeserialize, + ["200"], + { itemName: "value", nextLinkName: "nextLink" }, + ); +} diff --git a/sdk/edgeorder/arm-edgeorder/src/api/ordersOperationGroup/options.ts b/sdk/edgeorder/arm-edgeorder/src/api/ordersOperationGroup/options.ts new file mode 100644 index 000000000000..e5da82bcdd56 --- /dev/null +++ b/sdk/edgeorder/arm-edgeorder/src/api/ordersOperationGroup/options.ts @@ -0,0 +1,20 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +import { OperationOptions } from "@azure-rest/core-client"; + +/** Optional parameters. */ +export interface OrdersOperationGroupListByResourceGroupOptionalParams extends OperationOptions { + /** $skipToken is supported on Get list of orders, which provides the next page in the list of orders. */ + skipToken?: string; + /** $top is supported on fetching list of resources. $top=10 means that the first 10 items in the list will be returned to the API caller. */ + top?: number; +} + +/** Optional parameters. */ +export interface OrdersOperationGroupListBySubscriptionOptionalParams extends OperationOptions { + /** $skipToken is supported on Get list of orders, which provides the next page in the list of orders. */ + skipToken?: string; + /** $top is supported on fetching list of resources. $top=10 means that the first 10 items in the list will be returned to the API caller. */ + top?: number; +} diff --git a/sdk/edgeorder/arm-edgeorder/src/api/productsAndConfigurationsOperationGroup/index.ts b/sdk/edgeorder/arm-edgeorder/src/api/productsAndConfigurationsOperationGroup/index.ts new file mode 100644 index 000000000000..27b41995cb88 --- /dev/null +++ b/sdk/edgeorder/arm-edgeorder/src/api/productsAndConfigurationsOperationGroup/index.ts @@ -0,0 +1,13 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +export { + listProductFamiliesMetadata, + listProductFamilies, + listConfigurations, +} from "./operations.js"; +export { + ProductsAndConfigurationsOperationGroupListProductFamiliesMetadataOptionalParams, + ProductsAndConfigurationsOperationGroupListProductFamiliesOptionalParams, + ProductsAndConfigurationsOperationGroupListConfigurationsOptionalParams, +} from "./options.js"; diff --git a/sdk/edgeorder/arm-edgeorder/src/api/productsAndConfigurationsOperationGroup/operations.ts b/sdk/edgeorder/arm-edgeorder/src/api/productsAndConfigurationsOperationGroup/operations.ts new file mode 100644 index 000000000000..26d7a24345c5 --- /dev/null +++ b/sdk/edgeorder/arm-edgeorder/src/api/productsAndConfigurationsOperationGroup/operations.ts @@ -0,0 +1,210 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +import { EdgeOrderContext as Client } from "../index.js"; +import { + errorResponseDeserializer, + ConfigurationsRequest, + configurationsRequestSerializer, + _Configurations, + _configurationsDeserializer, + Configuration, + ProductFamiliesRequest, + productFamiliesRequestSerializer, + _ProductFamilies, + _productFamiliesDeserializer, + ProductFamily, + _ProductFamiliesMetadata, + _productFamiliesMetadataDeserializer, + ProductFamiliesMetadataDetails, +} from "../../models/models.js"; +import { + ProductsAndConfigurationsOperationGroupListProductFamiliesMetadataOptionalParams, + ProductsAndConfigurationsOperationGroupListProductFamiliesOptionalParams, + ProductsAndConfigurationsOperationGroupListConfigurationsOptionalParams, +} from "./options.js"; +import { + PagedAsyncIterableIterator, + buildPagedAsyncIterator, +} from "../../static-helpers/pagingHelpers.js"; +import { expandUrlTemplate } from "../../static-helpers/urlTemplate.js"; +import { + StreamableMethod, + PathUncheckedResponse, + createRestError, + operationOptionsToRequestParameters, +} from "@azure-rest/core-client"; + +export function _listProductFamiliesMetadataSend( + context: Client, + options: ProductsAndConfigurationsOperationGroupListProductFamiliesMetadataOptionalParams = { + requestOptions: {}, + }, +): StreamableMethod { + const path = expandUrlTemplate( + "/subscriptions/{subscriptionId}/providers/Microsoft.EdgeOrder/productFamiliesMetadata{?api%2Dversion,%24skipToken}", + { + subscriptionId: context.subscriptionId, + "api%2Dversion": context.apiVersion, + "%24skipToken": options?.skipToken, + }, + { + allowReserved: options?.requestOptions?.skipUrlEncoding, + }, + ); + return context.path(path).post({ + ...operationOptionsToRequestParameters(options), + headers: { + accept: "application/json", + ...options.requestOptions?.headers, + }, + }); +} + +export async function _listProductFamiliesMetadataDeserialize( + result: PathUncheckedResponse, +): Promise<_ProductFamiliesMetadata> { + const expectedStatuses = ["200"]; + if (!expectedStatuses.includes(result.status)) { + const error = createRestError(result); + error.details = errorResponseDeserializer(result.body); + throw error; + } + + return _productFamiliesMetadataDeserializer(result.body); +} + +/** List product families metadata for the given subscription. */ +export function listProductFamiliesMetadata( + context: Client, + options: ProductsAndConfigurationsOperationGroupListProductFamiliesMetadataOptionalParams = { + requestOptions: {}, + }, +): PagedAsyncIterableIterator { + return buildPagedAsyncIterator( + context, + () => _listProductFamiliesMetadataSend(context, options), + _listProductFamiliesMetadataDeserialize, + ["200"], + { itemName: "value", nextLinkName: "nextLink" }, + ); +} + +export function _listProductFamiliesSend( + context: Client, + productFamiliesRequest: ProductFamiliesRequest, + options: ProductsAndConfigurationsOperationGroupListProductFamiliesOptionalParams = { + requestOptions: {}, + }, +): StreamableMethod { + const path = expandUrlTemplate( + "/subscriptions/{subscriptionId}/providers/Microsoft.EdgeOrder/listProductFamilies{?api%2Dversion,%24expand,%24skipToken}", + { + subscriptionId: context.subscriptionId, + "api%2Dversion": context.apiVersion, + "%24expand": options?.expand, + "%24skipToken": options?.skipToken, + }, + { + allowReserved: options?.requestOptions?.skipUrlEncoding, + }, + ); + return context.path(path).post({ + ...operationOptionsToRequestParameters(options), + contentType: "application/json", + headers: { + accept: "application/json", + ...options.requestOptions?.headers, + }, + body: productFamiliesRequestSerializer(productFamiliesRequest), + }); +} + +export async function _listProductFamiliesDeserialize( + result: PathUncheckedResponse, +): Promise<_ProductFamilies> { + const expectedStatuses = ["200"]; + if (!expectedStatuses.includes(result.status)) { + const error = createRestError(result); + error.details = errorResponseDeserializer(result.body); + throw error; + } + + return _productFamiliesDeserializer(result.body); +} + +/** List product families for the given subscription. */ +export function listProductFamilies( + context: Client, + productFamiliesRequest: ProductFamiliesRequest, + options: ProductsAndConfigurationsOperationGroupListProductFamiliesOptionalParams = { + requestOptions: {}, + }, +): PagedAsyncIterableIterator { + return buildPagedAsyncIterator( + context, + () => _listProductFamiliesSend(context, productFamiliesRequest, options), + _listProductFamiliesDeserialize, + ["200"], + { itemName: "value", nextLinkName: "nextLink" }, + ); +} + +export function _listConfigurationsSend( + context: Client, + configurationsRequest: ConfigurationsRequest, + options: ProductsAndConfigurationsOperationGroupListConfigurationsOptionalParams = { + requestOptions: {}, + }, +): StreamableMethod { + const path = expandUrlTemplate( + "/subscriptions/{subscriptionId}/providers/Microsoft.EdgeOrder/listConfigurations{?api%2Dversion,%24skipToken}", + { + subscriptionId: context.subscriptionId, + "api%2Dversion": context.apiVersion, + "%24skipToken": options?.skipToken, + }, + { + allowReserved: options?.requestOptions?.skipUrlEncoding, + }, + ); + return context.path(path).post({ + ...operationOptionsToRequestParameters(options), + contentType: "application/json", + headers: { + accept: "application/json", + ...options.requestOptions?.headers, + }, + body: configurationsRequestSerializer(configurationsRequest), + }); +} + +export async function _listConfigurationsDeserialize( + result: PathUncheckedResponse, +): Promise<_Configurations> { + const expectedStatuses = ["200"]; + if (!expectedStatuses.includes(result.status)) { + const error = createRestError(result); + error.details = errorResponseDeserializer(result.body); + throw error; + } + + return _configurationsDeserializer(result.body); +} + +/** List configurations for the given product family, product line and product for the given subscription. */ +export function listConfigurations( + context: Client, + configurationsRequest: ConfigurationsRequest, + options: ProductsAndConfigurationsOperationGroupListConfigurationsOptionalParams = { + requestOptions: {}, + }, +): PagedAsyncIterableIterator { + return buildPagedAsyncIterator( + context, + () => _listConfigurationsSend(context, configurationsRequest, options), + _listConfigurationsDeserialize, + ["200"], + { itemName: "value", nextLinkName: "nextLink" }, + ); +} diff --git a/sdk/edgeorder/arm-edgeorder/src/api/productsAndConfigurationsOperationGroup/options.ts b/sdk/edgeorder/arm-edgeorder/src/api/productsAndConfigurationsOperationGroup/options.ts new file mode 100644 index 000000000000..468dc6dd8cc0 --- /dev/null +++ b/sdk/edgeorder/arm-edgeorder/src/api/productsAndConfigurationsOperationGroup/options.ts @@ -0,0 +1,27 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +import { OperationOptions } from "@azure-rest/core-client"; + +/** Optional parameters. */ +export interface ProductsAndConfigurationsOperationGroupListProductFamiliesMetadataOptionalParams + extends OperationOptions { + /** $skipToken is supported on list of product families metadata, which provides the next page in the list of product families metadata. */ + skipToken?: string; +} + +/** Optional parameters. */ +export interface ProductsAndConfigurationsOperationGroupListProductFamiliesOptionalParams + extends OperationOptions { + /** $expand is supported on configurations parameter for product, which provides details on the configurations for the product. */ + expand?: string; + /** $skipToken is supported on list of product families, which provides the next page in the list of product families. */ + skipToken?: string; +} + +/** Optional parameters. */ +export interface ProductsAndConfigurationsOperationGroupListConfigurationsOptionalParams + extends OperationOptions { + /** $skipToken is supported on list of configurations, which provides the next page in the list of configurations. */ + skipToken?: string; +} diff --git a/sdk/edgeorder/arm-edgeorder/src/classic/addressResources/index.ts b/sdk/edgeorder/arm-edgeorder/src/classic/addressResources/index.ts new file mode 100644 index 000000000000..30d9492f040c --- /dev/null +++ b/sdk/edgeorder/arm-edgeorder/src/classic/addressResources/index.ts @@ -0,0 +1,111 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +import { EdgeOrderContext } from "../../api/edgeOrderContext.js"; +import { AddressResource, AddressUpdateParameter } from "../../models/models.js"; +import { + AddressResourcesListBySubscriptionOptionalParams, + AddressResourcesListByResourceGroupOptionalParams, + AddressResourcesDeleteOptionalParams, + AddressResourcesUpdateOptionalParams, + AddressResourcesCreateOptionalParams, + AddressResourcesGetOptionalParams, +} from "../../api/addressResources/options.js"; +import { + listBySubscription, + listByResourceGroup, + $delete, + update, + create, + get, +} from "../../api/addressResources/operations.js"; +import { PagedAsyncIterableIterator } from "../../static-helpers/pagingHelpers.js"; +import { PollerLike, OperationState } from "@azure/core-lro"; + +/** Interface representing a AddressResources operations. */ +export interface AddressResourcesOperations { + /** List all the addresses available under the subscription. */ + listBySubscription: ( + options?: AddressResourcesListBySubscriptionOptionalParams, + ) => PagedAsyncIterableIterator; + /** List all the addresses available under the given resource group. */ + listByResourceGroup: ( + resourceGroupName: string, + options?: AddressResourcesListByResourceGroupOptionalParams, + ) => PagedAsyncIterableIterator; + /** Delete an address. */ + /** + * @fixme delete is a reserved word that cannot be used as an operation name. + * Please add @clientName("clientName") or @clientName("", "javascript") + * to the operation to override the generated name. + */ + delete: ( + resourceGroupName: string, + addressName: string, + options?: AddressResourcesDeleteOptionalParams, + ) => PollerLike, void>; + /** Update the properties of an existing address. */ + update: ( + resourceGroupName: string, + addressName: string, + addressUpdateParameter: AddressUpdateParameter, + options?: AddressResourcesUpdateOptionalParams, + ) => PollerLike, AddressResource>; + /** + * Create a new address with the specified parameters. Existing address cannot be updated with this API and should + * instead be updated with the Update address API. + */ + create: ( + resourceGroupName: string, + addressName: string, + addressResource: AddressResource, + options?: AddressResourcesCreateOptionalParams, + ) => PollerLike, void>; + /** Get information about the specified address. */ + get: ( + resourceGroupName: string, + addressName: string, + options?: AddressResourcesGetOptionalParams, + ) => Promise; +} + +function _getAddressResources(context: EdgeOrderContext) { + return { + listBySubscription: (options?: AddressResourcesListBySubscriptionOptionalParams) => + listBySubscription(context, options), + listByResourceGroup: ( + resourceGroupName: string, + options?: AddressResourcesListByResourceGroupOptionalParams, + ) => listByResourceGroup(context, resourceGroupName, options), + delete: ( + resourceGroupName: string, + addressName: string, + options?: AddressResourcesDeleteOptionalParams, + ) => $delete(context, resourceGroupName, addressName, options), + update: ( + resourceGroupName: string, + addressName: string, + addressUpdateParameter: AddressUpdateParameter, + options?: AddressResourcesUpdateOptionalParams, + ) => update(context, resourceGroupName, addressName, addressUpdateParameter, options), + create: ( + resourceGroupName: string, + addressName: string, + addressResource: AddressResource, + options?: AddressResourcesCreateOptionalParams, + ) => create(context, resourceGroupName, addressName, addressResource, options), + get: ( + resourceGroupName: string, + addressName: string, + options?: AddressResourcesGetOptionalParams, + ) => get(context, resourceGroupName, addressName, options), + }; +} + +export function _getAddressResourcesOperations( + context: EdgeOrderContext, +): AddressResourcesOperations { + return { + ..._getAddressResources(context), + }; +} diff --git a/sdk/edgeorder/arm-edgeorder/src/classic/index.ts b/sdk/edgeorder/arm-edgeorder/src/classic/index.ts new file mode 100644 index 000000000000..2d88a11d0ed2 --- /dev/null +++ b/sdk/edgeorder/arm-edgeorder/src/classic/index.ts @@ -0,0 +1,9 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +export { AddressResourcesOperations } from "./addressResources/index.js"; +export { OperationsOperations } from "./operations/index.js"; +export { OrderItemResourcesOperations } from "./orderItemResources/index.js"; +export { OrderResourcesOperations } from "./orderResources/index.js"; +export { OrdersOperationGroupOperations } from "./ordersOperationGroup/index.js"; +export { ProductsAndConfigurationsOperationGroupOperations } from "./productsAndConfigurationsOperationGroup/index.js"; diff --git a/sdk/edgeorder/arm-edgeorder/src/classic/operations/index.ts b/sdk/edgeorder/arm-edgeorder/src/classic/operations/index.ts new file mode 100644 index 000000000000..aa6efe1a9277 --- /dev/null +++ b/sdk/edgeorder/arm-edgeorder/src/classic/operations/index.ts @@ -0,0 +1,26 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +import { EdgeOrderContext } from "../../api/edgeOrderContext.js"; +import { Operation } from "../../models/models.js"; +import { OperationsListOptionalParams } from "../../api/operations/options.js"; +import { list } from "../../api/operations/operations.js"; +import { PagedAsyncIterableIterator } from "../../static-helpers/pagingHelpers.js"; + +/** Interface representing a Operations operations. */ +export interface OperationsOperations { + /** List the operations for the provider */ + list: (options?: OperationsListOptionalParams) => PagedAsyncIterableIterator; +} + +function _getOperations(context: EdgeOrderContext) { + return { + list: (options?: OperationsListOptionalParams) => list(context, options), + }; +} + +export function _getOperationsOperations(context: EdgeOrderContext): OperationsOperations { + return { + ..._getOperations(context), + }; +} diff --git a/sdk/edgeorder/arm-edgeorder/src/classic/orderItemResources/index.ts b/sdk/edgeorder/arm-edgeorder/src/classic/orderItemResources/index.ts new file mode 100644 index 000000000000..e9847a2e1b1a --- /dev/null +++ b/sdk/edgeorder/arm-edgeorder/src/classic/orderItemResources/index.ts @@ -0,0 +1,148 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +import { EdgeOrderContext } from "../../api/edgeOrderContext.js"; +import { + OrderItemResource, + OrderItemUpdateParameter, + CancellationReason, + ReturnOrderItemDetails, + OkResponse, +} from "../../models/models.js"; +import { + OrderItemResourcesReturnOrderItemOptionalParams, + OrderItemResourcesCancelOptionalParams, + OrderItemResourcesListBySubscriptionOptionalParams, + OrderItemResourcesListByResourceGroupOptionalParams, + OrderItemResourcesDeleteOptionalParams, + OrderItemResourcesUpdateOptionalParams, + OrderItemResourcesCreateOptionalParams, + OrderItemResourcesGetOptionalParams, +} from "../../api/orderItemResources/options.js"; +import { + returnOrderItem, + cancel, + listBySubscription, + listByResourceGroup, + $delete, + update, + create, + get, +} from "../../api/orderItemResources/operations.js"; +import { PagedAsyncIterableIterator } from "../../static-helpers/pagingHelpers.js"; +import { PollerLike, OperationState } from "@azure/core-lro"; + +/** Interface representing a OrderItemResources operations. */ +export interface OrderItemResourcesOperations { + /** Return order item. */ + returnOrderItem: ( + resourceGroupName: string, + orderItemName: string, + returnOrderItemDetails: ReturnOrderItemDetails, + options?: OrderItemResourcesReturnOrderItemOptionalParams, + ) => PollerLike, OkResponse>; + /** Cancel order item. */ + cancel: ( + resourceGroupName: string, + orderItemName: string, + cancellationReason: CancellationReason, + options?: OrderItemResourcesCancelOptionalParams, + ) => Promise; + /** List order items at subscription level. */ + listBySubscription: ( + options?: OrderItemResourcesListBySubscriptionOptionalParams, + ) => PagedAsyncIterableIterator; + /** List order items at resource group level. */ + listByResourceGroup: ( + resourceGroupName: string, + options?: OrderItemResourcesListByResourceGroupOptionalParams, + ) => PagedAsyncIterableIterator; + /** Delete an order item. */ + /** + * @fixme delete is a reserved word that cannot be used as an operation name. + * Please add @clientName("clientName") or @clientName("", "javascript") + * to the operation to override the generated name. + */ + delete: ( + resourceGroupName: string, + orderItemName: string, + options?: OrderItemResourcesDeleteOptionalParams, + ) => PollerLike, void>; + /** Update the properties of an existing order item. */ + update: ( + resourceGroupName: string, + orderItemName: string, + orderItemUpdateParameter: OrderItemUpdateParameter, + options?: OrderItemResourcesUpdateOptionalParams, + ) => PollerLike, OrderItemResource>; + /** + * Create an order item. Existing order item cannot be updated with this api and should instead be updated with the Update order item + * API. + */ + create: ( + resourceGroupName: string, + orderItemName: string, + orderItemResource: OrderItemResource, + options?: OrderItemResourcesCreateOptionalParams, + ) => PollerLike, void>; + /** Get an order item. */ + get: ( + resourceGroupName: string, + orderItemName: string, + options?: OrderItemResourcesGetOptionalParams, + ) => Promise; +} + +function _getOrderItemResources(context: EdgeOrderContext) { + return { + returnOrderItem: ( + resourceGroupName: string, + orderItemName: string, + returnOrderItemDetails: ReturnOrderItemDetails, + options?: OrderItemResourcesReturnOrderItemOptionalParams, + ) => + returnOrderItem(context, resourceGroupName, orderItemName, returnOrderItemDetails, options), + cancel: ( + resourceGroupName: string, + orderItemName: string, + cancellationReason: CancellationReason, + options?: OrderItemResourcesCancelOptionalParams, + ) => cancel(context, resourceGroupName, orderItemName, cancellationReason, options), + listBySubscription: (options?: OrderItemResourcesListBySubscriptionOptionalParams) => + listBySubscription(context, options), + listByResourceGroup: ( + resourceGroupName: string, + options?: OrderItemResourcesListByResourceGroupOptionalParams, + ) => listByResourceGroup(context, resourceGroupName, options), + delete: ( + resourceGroupName: string, + orderItemName: string, + options?: OrderItemResourcesDeleteOptionalParams, + ) => $delete(context, resourceGroupName, orderItemName, options), + update: ( + resourceGroupName: string, + orderItemName: string, + orderItemUpdateParameter: OrderItemUpdateParameter, + options?: OrderItemResourcesUpdateOptionalParams, + ) => update(context, resourceGroupName, orderItemName, orderItemUpdateParameter, options), + create: ( + resourceGroupName: string, + orderItemName: string, + orderItemResource: OrderItemResource, + options?: OrderItemResourcesCreateOptionalParams, + ) => create(context, resourceGroupName, orderItemName, orderItemResource, options), + get: ( + resourceGroupName: string, + orderItemName: string, + options?: OrderItemResourcesGetOptionalParams, + ) => get(context, resourceGroupName, orderItemName, options), + }; +} + +export function _getOrderItemResourcesOperations( + context: EdgeOrderContext, +): OrderItemResourcesOperations { + return { + ..._getOrderItemResources(context), + }; +} diff --git a/sdk/edgeorder/arm-edgeorder/src/classic/orderResources/index.ts b/sdk/edgeorder/arm-edgeorder/src/classic/orderResources/index.ts new file mode 100644 index 000000000000..bc3cbcee689b --- /dev/null +++ b/sdk/edgeorder/arm-edgeorder/src/classic/orderResources/index.ts @@ -0,0 +1,35 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +import { EdgeOrderContext } from "../../api/edgeOrderContext.js"; +import { OrderResource } from "../../models/models.js"; +import { OrderResourcesGetOptionalParams } from "../../api/orderResources/options.js"; +import { get } from "../../api/orderResources/operations.js"; + +/** Interface representing a OrderResources operations. */ +export interface OrderResourcesOperations { + /** Get an order. */ + get: ( + resourceGroupName: string, + location: string, + orderName: string, + options?: OrderResourcesGetOptionalParams, + ) => Promise; +} + +function _getOrderResources(context: EdgeOrderContext) { + return { + get: ( + resourceGroupName: string, + location: string, + orderName: string, + options?: OrderResourcesGetOptionalParams, + ) => get(context, resourceGroupName, location, orderName, options), + }; +} + +export function _getOrderResourcesOperations(context: EdgeOrderContext): OrderResourcesOperations { + return { + ..._getOrderResources(context), + }; +} diff --git a/sdk/edgeorder/arm-edgeorder/src/classic/ordersOperationGroup/index.ts b/sdk/edgeorder/arm-edgeorder/src/classic/ordersOperationGroup/index.ts new file mode 100644 index 000000000000..0709d802ff11 --- /dev/null +++ b/sdk/edgeorder/arm-edgeorder/src/classic/ordersOperationGroup/index.ts @@ -0,0 +1,46 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +import { EdgeOrderContext } from "../../api/edgeOrderContext.js"; +import { OrderResource } from "../../models/models.js"; +import { + OrdersOperationGroupListByResourceGroupOptionalParams, + OrdersOperationGroupListBySubscriptionOptionalParams, +} from "../../api/ordersOperationGroup/options.js"; +import { + listByResourceGroup, + listBySubscription, +} from "../../api/ordersOperationGroup/operations.js"; +import { PagedAsyncIterableIterator } from "../../static-helpers/pagingHelpers.js"; + +/** Interface representing a OrdersOperationGroup operations. */ +export interface OrdersOperationGroupOperations { + /** List orders at resource group level. */ + listByResourceGroup: ( + resourceGroupName: string, + options?: OrdersOperationGroupListByResourceGroupOptionalParams, + ) => PagedAsyncIterableIterator; + /** List orders at subscription level. */ + listBySubscription: ( + options?: OrdersOperationGroupListBySubscriptionOptionalParams, + ) => PagedAsyncIterableIterator; +} + +function _getOrdersOperationGroup(context: EdgeOrderContext) { + return { + listByResourceGroup: ( + resourceGroupName: string, + options?: OrdersOperationGroupListByResourceGroupOptionalParams, + ) => listByResourceGroup(context, resourceGroupName, options), + listBySubscription: (options?: OrdersOperationGroupListBySubscriptionOptionalParams) => + listBySubscription(context, options), + }; +} + +export function _getOrdersOperationGroupOperations( + context: EdgeOrderContext, +): OrdersOperationGroupOperations { + return { + ..._getOrdersOperationGroup(context), + }; +} diff --git a/sdk/edgeorder/arm-edgeorder/src/classic/productsAndConfigurationsOperationGroup/index.ts b/sdk/edgeorder/arm-edgeorder/src/classic/productsAndConfigurationsOperationGroup/index.ts new file mode 100644 index 000000000000..33a6c45e190c --- /dev/null +++ b/sdk/edgeorder/arm-edgeorder/src/classic/productsAndConfigurationsOperationGroup/index.ts @@ -0,0 +1,64 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +import { EdgeOrderContext } from "../../api/edgeOrderContext.js"; +import { + ConfigurationsRequest, + Configuration, + ProductFamiliesRequest, + ProductFamily, + ProductFamiliesMetadataDetails, +} from "../../models/models.js"; +import { + ProductsAndConfigurationsOperationGroupListProductFamiliesMetadataOptionalParams, + ProductsAndConfigurationsOperationGroupListProductFamiliesOptionalParams, + ProductsAndConfigurationsOperationGroupListConfigurationsOptionalParams, +} from "../../api/productsAndConfigurationsOperationGroup/options.js"; +import { + listProductFamiliesMetadata, + listProductFamilies, + listConfigurations, +} from "../../api/productsAndConfigurationsOperationGroup/operations.js"; +import { PagedAsyncIterableIterator } from "../../static-helpers/pagingHelpers.js"; + +/** Interface representing a ProductsAndConfigurationsOperationGroup operations. */ +export interface ProductsAndConfigurationsOperationGroupOperations { + /** List product families metadata for the given subscription. */ + listProductFamiliesMetadata: ( + options?: ProductsAndConfigurationsOperationGroupListProductFamiliesMetadataOptionalParams, + ) => PagedAsyncIterableIterator; + /** List product families for the given subscription. */ + listProductFamilies: ( + productFamiliesRequest: ProductFamiliesRequest, + options?: ProductsAndConfigurationsOperationGroupListProductFamiliesOptionalParams, + ) => PagedAsyncIterableIterator; + /** List configurations for the given product family, product line and product for the given subscription. */ + listConfigurations: ( + configurationsRequest: ConfigurationsRequest, + options?: ProductsAndConfigurationsOperationGroupListConfigurationsOptionalParams, + ) => PagedAsyncIterableIterator; +} + +function _getProductsAndConfigurationsOperationGroup(context: EdgeOrderContext) { + return { + listProductFamiliesMetadata: ( + options?: ProductsAndConfigurationsOperationGroupListProductFamiliesMetadataOptionalParams, + ) => listProductFamiliesMetadata(context, options), + listProductFamilies: ( + productFamiliesRequest: ProductFamiliesRequest, + options?: ProductsAndConfigurationsOperationGroupListProductFamiliesOptionalParams, + ) => listProductFamilies(context, productFamiliesRequest, options), + listConfigurations: ( + configurationsRequest: ConfigurationsRequest, + options?: ProductsAndConfigurationsOperationGroupListConfigurationsOptionalParams, + ) => listConfigurations(context, configurationsRequest, options), + }; +} + +export function _getProductsAndConfigurationsOperationGroupOperations( + context: EdgeOrderContext, +): ProductsAndConfigurationsOperationGroupOperations { + return { + ..._getProductsAndConfigurationsOperationGroup(context), + }; +} diff --git a/sdk/edgeorder/arm-edgeorder/src/edgeOrderClient.ts b/sdk/edgeorder/arm-edgeorder/src/edgeOrderClient.ts new file mode 100644 index 000000000000..7dfb78838c4f --- /dev/null +++ b/sdk/edgeorder/arm-edgeorder/src/edgeOrderClient.ts @@ -0,0 +1,72 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +import { createEdgeOrder, EdgeOrderContext, EdgeOrderClientOptionalParams } from "./api/index.js"; +import { + OrdersOperationGroupOperations, + _getOrdersOperationGroupOperations, +} from "./classic/ordersOperationGroup/index.js"; +import { + ProductsAndConfigurationsOperationGroupOperations, + _getProductsAndConfigurationsOperationGroupOperations, +} from "./classic/productsAndConfigurationsOperationGroup/index.js"; +import { + OrderResourcesOperations, + _getOrderResourcesOperations, +} from "./classic/orderResources/index.js"; +import { + OrderItemResourcesOperations, + _getOrderItemResourcesOperations, +} from "./classic/orderItemResources/index.js"; +import { + AddressResourcesOperations, + _getAddressResourcesOperations, +} from "./classic/addressResources/index.js"; +import { OperationsOperations, _getOperationsOperations } from "./classic/operations/index.js"; +import { Pipeline } from "@azure/core-rest-pipeline"; +import { TokenCredential } from "@azure/core-auth"; + +export { EdgeOrderClientOptionalParams } from "./api/edgeOrderContext.js"; + +export class EdgeOrderClient { + private _client: EdgeOrderContext; + /** The pipeline used by this client to make requests */ + public readonly pipeline: Pipeline; + + /** Edge Order API's */ + constructor( + credential: TokenCredential, + subscriptionId: string, + options: EdgeOrderClientOptionalParams = {}, + ) { + const prefixFromOptions = options?.userAgentOptions?.userAgentPrefix; + const userAgentPrefix = prefixFromOptions + ? `${prefixFromOptions} azsdk-js-client` + : `azsdk-js-client`; + this._client = createEdgeOrder(credential, subscriptionId, { + ...options, + userAgentOptions: { userAgentPrefix }, + }); + this.pipeline = this._client.pipeline; + this.ordersOperationGroup = _getOrdersOperationGroupOperations(this._client); + this.productsAndConfigurationsOperationGroup = + _getProductsAndConfigurationsOperationGroupOperations(this._client); + this.orderResources = _getOrderResourcesOperations(this._client); + this.orderItemResources = _getOrderItemResourcesOperations(this._client); + this.addressResources = _getAddressResourcesOperations(this._client); + this.operations = _getOperationsOperations(this._client); + } + + /** The operation groups for ordersOperationGroup */ + public readonly ordersOperationGroup: OrdersOperationGroupOperations; + /** The operation groups for productsAndConfigurationsOperationGroup */ + public readonly productsAndConfigurationsOperationGroup: ProductsAndConfigurationsOperationGroupOperations; + /** The operation groups for orderResources */ + public readonly orderResources: OrderResourcesOperations; + /** The operation groups for orderItemResources */ + public readonly orderItemResources: OrderItemResourcesOperations; + /** The operation groups for addressResources */ + public readonly addressResources: AddressResourcesOperations; + /** The operation groups for operations */ + public readonly operations: OperationsOperations; +} diff --git a/sdk/edgeorder/arm-edgeorder/src/index.ts b/sdk/edgeorder/arm-edgeorder/src/index.ts new file mode 100644 index 000000000000..fc591233be50 --- /dev/null +++ b/sdk/edgeorder/arm-edgeorder/src/index.ts @@ -0,0 +1,208 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +import { + PageSettings, + ContinuablePage, + PagedAsyncIterableIterator, +} from "./static-helpers/pagingHelpers.js"; + +export { EdgeOrderClient } from "./edgeOrderClient.js"; +export { restorePoller, RestorePollerOptions } from "./restorePollerHelpers.js"; +export { + Operation, + OperationDisplay, + KnownOrigin, + Origin, + KnownActionType, + ActionType, + ErrorResponse, + ErrorDetail, + ErrorAdditionalInfo, + AddressResource, + AddressProperties, + KnownAddressClassification, + AddressClassification, + ShippingAddress, + KnownAddressType, + AddressType, + ContactDetails, + KnownAddressValidationStatus, + AddressValidationStatus, + KnownProvisioningState, + ProvisioningState, + TrackedResource, + Resource, + SystemData, + KnownCreatedByType, + CreatedByType, + AddressUpdateParameter, + AddressUpdateProperties, + OrderItemResource, + OrderItemProperties, + OrderItemDetails, + ProductDetails, + DisplayInfo, + HierarchyInformation, + KnownDoubleEncryptionStatus, + DoubleEncryptionStatus, + KnownIdentificationType, + IdentificationType, + DeviceDetails, + KnownProvisioningSupport, + ProvisioningSupport, + ProvisioningDetails, + KnownAutoProvisioningStatus, + AutoProvisioningStatus, + DevicePresenceVerificationDetails, + KnownDevicePresenceVerificationStatus, + DevicePresenceVerificationStatus, + AdditionalConfiguration, + ConfigurationDeviceDetails, + TermCommitmentInformation, + KnownTermCommitmentType, + TermCommitmentType, + KnownOrderItemType, + OrderItemType, + KnownOrderMode, + OrderMode, + SiteDetails, + StageDetails, + KnownStageStatus, + StageStatus, + KnownStageName, + StageName, + Preferences, + NotificationPreference, + KnownNotificationStageName, + NotificationStageName, + TransportPreferences, + KnownTransportShipmentTypes, + TransportShipmentTypes, + EncryptionPreferences, + ManagementResourcePreferences, + TermCommitmentPreferences, + ForwardShippingDetails, + ReverseShippingDetails, + KnownOrderItemCancellationEnum, + OrderItemCancellationEnum, + KnownActionStatusEnum, + ActionStatusEnum, + KnownOrderItemReturnEnum, + OrderItemReturnEnum, + ResourceProviderDetails, + AddressDetails, + ResourceIdentity, + UserAssignedIdentity, + OrderItemUpdateParameter, + OrderItemUpdateProperties, + OrderItemDetailsUpdateParameter, + ProductDetailsUpdateParameter, + CancellationReason, + ReturnOrderItemDetails, + OkResponse, + OrderResource, + OrderProperties, + ProxyResource, + ConfigurationsRequest, + ConfigurationFilter, + FilterableProperty, + KnownSupportedFilterTypes, + SupportedFilterTypes, + ChildConfigurationFilter, + KnownChildConfigurationType, + ChildConfigurationType, + CustomerSubscriptionDetails, + CustomerSubscriptionRegisteredFeatures, + Configuration, + ConfigurationProperties, + Specification, + Dimensions, + KnownLengthHeightUnit, + LengthHeightUnit, + KnownWeightMeasurementUnit, + WeightMeasurementUnit, + GroupedChildConfigurations, + CategoryInformation, + Link, + KnownLinkType, + LinkType, + ChildConfiguration, + ChildConfigurationProperties, + Description, + KnownDescriptionType, + DescriptionType, + ImageInformation, + KnownImageType, + ImageType, + CostInformation, + BillingMeterDetails, + MeterDetails, + MeterDetailsUnion, + KnownBillingType, + BillingType, + KnownChargingType, + ChargingType, + Pav2MeterDetails, + PurchaseMeterDetails, + KnownMeteringType, + MeteringType, + TermTypeDetails, + AvailabilityInformation, + KnownAvailabilityStage, + AvailabilityStage, + KnownDisabledReason, + DisabledReason, + KnownFulfillmentType, + FulfillmentType, + CommonProperties, + BasicInformation, + ProductFamiliesRequest, + ProductFamily, + ProductFamilyProperties, + ProductLine, + ProductLineProperties, + Product, + ProductProperties, + ProductFamiliesMetadataDetails, + KnownVersions, +} from "./models/index.js"; +export { EdgeOrderClientOptionalParams } from "./api/index.js"; +export { + AddressResourcesListBySubscriptionOptionalParams, + AddressResourcesListByResourceGroupOptionalParams, + AddressResourcesDeleteOptionalParams, + AddressResourcesUpdateOptionalParams, + AddressResourcesCreateOptionalParams, + AddressResourcesGetOptionalParams, +} from "./api/addressResources/index.js"; +export { OperationsListOptionalParams } from "./api/operations/index.js"; +export { + OrderItemResourcesReturnOrderItemOptionalParams, + OrderItemResourcesCancelOptionalParams, + OrderItemResourcesListBySubscriptionOptionalParams, + OrderItemResourcesListByResourceGroupOptionalParams, + OrderItemResourcesDeleteOptionalParams, + OrderItemResourcesUpdateOptionalParams, + OrderItemResourcesCreateOptionalParams, + OrderItemResourcesGetOptionalParams, +} from "./api/orderItemResources/index.js"; +export { OrderResourcesGetOptionalParams } from "./api/orderResources/index.js"; +export { + OrdersOperationGroupListByResourceGroupOptionalParams, + OrdersOperationGroupListBySubscriptionOptionalParams, +} from "./api/ordersOperationGroup/index.js"; +export { + ProductsAndConfigurationsOperationGroupListProductFamiliesMetadataOptionalParams, + ProductsAndConfigurationsOperationGroupListProductFamiliesOptionalParams, + ProductsAndConfigurationsOperationGroupListConfigurationsOptionalParams, +} from "./api/productsAndConfigurationsOperationGroup/index.js"; +export { + AddressResourcesOperations, + OperationsOperations, + OrderItemResourcesOperations, + OrderResourcesOperations, + OrdersOperationGroupOperations, + ProductsAndConfigurationsOperationGroupOperations, +} from "./classic/index.js"; +export { PageSettings, ContinuablePage, PagedAsyncIterableIterator }; diff --git a/sdk/edgeorder/arm-edgeorder/src/logger.ts b/sdk/edgeorder/arm-edgeorder/src/logger.ts new file mode 100644 index 000000000000..3bfecf0bfc75 --- /dev/null +++ b/sdk/edgeorder/arm-edgeorder/src/logger.ts @@ -0,0 +1,5 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +import { createClientLogger } from "@azure/logger"; +export const logger = createClientLogger("arm-edgeorder"); diff --git a/sdk/edgeorder/arm-edgeorder/src/models/index.ts b/sdk/edgeorder/arm-edgeorder/src/models/index.ts new file mode 100644 index 000000000000..95bee7cae5e7 --- /dev/null +++ b/sdk/edgeorder/arm-edgeorder/src/models/index.ts @@ -0,0 +1,161 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +export { + Operation, + OperationDisplay, + KnownOrigin, + Origin, + KnownActionType, + ActionType, + ErrorResponse, + ErrorDetail, + ErrorAdditionalInfo, + AddressResource, + AddressProperties, + KnownAddressClassification, + AddressClassification, + ShippingAddress, + KnownAddressType, + AddressType, + ContactDetails, + KnownAddressValidationStatus, + AddressValidationStatus, + KnownProvisioningState, + ProvisioningState, + TrackedResource, + Resource, + SystemData, + KnownCreatedByType, + CreatedByType, + AddressUpdateParameter, + AddressUpdateProperties, + OrderItemResource, + OrderItemProperties, + OrderItemDetails, + ProductDetails, + DisplayInfo, + HierarchyInformation, + KnownDoubleEncryptionStatus, + DoubleEncryptionStatus, + KnownIdentificationType, + IdentificationType, + DeviceDetails, + KnownProvisioningSupport, + ProvisioningSupport, + ProvisioningDetails, + KnownAutoProvisioningStatus, + AutoProvisioningStatus, + DevicePresenceVerificationDetails, + KnownDevicePresenceVerificationStatus, + DevicePresenceVerificationStatus, + AdditionalConfiguration, + ConfigurationDeviceDetails, + TermCommitmentInformation, + KnownTermCommitmentType, + TermCommitmentType, + KnownOrderItemType, + OrderItemType, + KnownOrderMode, + OrderMode, + SiteDetails, + StageDetails, + KnownStageStatus, + StageStatus, + KnownStageName, + StageName, + Preferences, + NotificationPreference, + KnownNotificationStageName, + NotificationStageName, + TransportPreferences, + KnownTransportShipmentTypes, + TransportShipmentTypes, + EncryptionPreferences, + ManagementResourcePreferences, + TermCommitmentPreferences, + ForwardShippingDetails, + ReverseShippingDetails, + KnownOrderItemCancellationEnum, + OrderItemCancellationEnum, + KnownActionStatusEnum, + ActionStatusEnum, + KnownOrderItemReturnEnum, + OrderItemReturnEnum, + ResourceProviderDetails, + AddressDetails, + ResourceIdentity, + UserAssignedIdentity, + OrderItemUpdateParameter, + OrderItemUpdateProperties, + OrderItemDetailsUpdateParameter, + ProductDetailsUpdateParameter, + CancellationReason, + ReturnOrderItemDetails, + OkResponse, + OrderResource, + OrderProperties, + ProxyResource, + ConfigurationsRequest, + ConfigurationFilter, + FilterableProperty, + KnownSupportedFilterTypes, + SupportedFilterTypes, + ChildConfigurationFilter, + KnownChildConfigurationType, + ChildConfigurationType, + CustomerSubscriptionDetails, + CustomerSubscriptionRegisteredFeatures, + Configuration, + ConfigurationProperties, + Specification, + Dimensions, + KnownLengthHeightUnit, + LengthHeightUnit, + KnownWeightMeasurementUnit, + WeightMeasurementUnit, + GroupedChildConfigurations, + CategoryInformation, + Link, + KnownLinkType, + LinkType, + ChildConfiguration, + ChildConfigurationProperties, + Description, + KnownDescriptionType, + DescriptionType, + ImageInformation, + KnownImageType, + ImageType, + CostInformation, + BillingMeterDetails, + MeterDetails, + MeterDetailsUnion, + KnownBillingType, + BillingType, + KnownChargingType, + ChargingType, + Pav2MeterDetails, + PurchaseMeterDetails, + KnownMeteringType, + MeteringType, + TermTypeDetails, + AvailabilityInformation, + KnownAvailabilityStage, + AvailabilityStage, + KnownDisabledReason, + DisabledReason, + KnownFulfillmentType, + FulfillmentType, + CommonProperties, + BasicInformation, + ProductFamiliesRequest, + ProductFamily, + ProductFamilyProperties, + ProductLine, + ProductLineProperties, + Product, + ProductProperties, + ProductFamiliesMetadataDetails, + KnownVersions, +} from "./models.js"; diff --git a/sdk/edgeorder/arm-edgeorder/src/models/models.ts b/sdk/edgeorder/arm-edgeorder/src/models/models.ts new file mode 100644 index 000000000000..7e3df99bc192 --- /dev/null +++ b/sdk/edgeorder/arm-edgeorder/src/models/models.ts @@ -0,0 +1,3318 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +/** A list of REST API operations supported by an Azure Resource Provider. It contains an URL link to get the next set of results. */ +export interface _OperationListResult { + /** The Operation items on this page */ + value: Operation[]; + /** The link to the next page of items */ + nextLink?: string; +} + +export function _operationListResultDeserializer(item: any): _OperationListResult { + return { + value: operationArrayDeserializer(item["value"]), + nextLink: item["nextLink"], + }; +} + +export function operationArrayDeserializer(result: Array): any[] { + return result.map((item) => { + return operationDeserializer(item); + }); +} + +/** Details of a REST API operation, returned from the Resource Provider Operations API */ +export interface Operation { + /** The name of the operation, as per Resource-Based Access Control (RBAC). Examples: "Microsoft.Compute/virtualMachines/write", "Microsoft.Compute/virtualMachines/capture/action" */ + readonly name?: string; + /** Whether the operation applies to data-plane. This is "true" for data-plane operations and "false" for Azure Resource Manager/control-plane operations. */ + readonly isDataAction?: boolean; + /** Localized display information for this particular operation. */ + display?: OperationDisplay; + /** The intended executor of the operation; as in Resource Based Access Control (RBAC) and audit logs UX. Default value is "user,system" */ + readonly origin?: Origin; + /** Extensible enum. Indicates the action type. "Internal" refers to actions that are for internal only APIs. */ + readonly actionType?: ActionType; +} + +export function operationDeserializer(item: any): Operation { + return { + name: item["name"], + isDataAction: item["isDataAction"], + display: !item["display"] ? item["display"] : operationDisplayDeserializer(item["display"]), + origin: item["origin"], + actionType: item["actionType"], + }; +} + +/** Localized display information for and operation. */ +export interface OperationDisplay { + /** The localized friendly form of the resource provider name, e.g. "Microsoft Monitoring Insights" or "Microsoft Compute". */ + readonly provider?: string; + /** The localized friendly name of the resource type related to this operation. E.g. "Virtual Machines" or "Job Schedule Collections". */ + readonly resource?: string; + /** The concise, localized friendly name for the operation; suitable for dropdowns. E.g. "Create or Update Virtual Machine", "Restart Virtual Machine". */ + readonly operation?: string; + /** The short, localized friendly description of the operation; suitable for tool tips and detailed views. */ + readonly description?: string; +} + +export function operationDisplayDeserializer(item: any): OperationDisplay { + return { + provider: item["provider"], + resource: item["resource"], + operation: item["operation"], + description: item["description"], + }; +} + +/** The intended executor of the operation; as in Resource Based Access Control (RBAC) and audit logs UX. Default value is "user,system" */ +export enum KnownOrigin { + /** Indicates the operation is initiated by a user. */ + User = "user", + /** Indicates the operation is initiated by a system. */ + System = "system", + /** Indicates the operation is initiated by a user or system. */ + UserSystem = "user,system", +} + +/** + * The intended executor of the operation; as in Resource Based Access Control (RBAC) and audit logs UX. Default value is "user,system" \ + * {@link KnownOrigin} can be used interchangeably with Origin, + * this enum contains the known values that the service supports. + * ### Known values supported by the service + * **user**: Indicates the operation is initiated by a user. \ + * **system**: Indicates the operation is initiated by a system. \ + * **user,system**: Indicates the operation is initiated by a user or system. + */ +export type Origin = string; + +/** Extensible enum. Indicates the action type. "Internal" refers to actions that are for internal only APIs. */ +export enum KnownActionType { + /** Actions are for internal-only APIs. */ + Internal = "Internal", +} + +/** + * Extensible enum. Indicates the action type. "Internal" refers to actions that are for internal only APIs. \ + * {@link KnownActionType} can be used interchangeably with ActionType, + * this enum contains the known values that the service supports. + * ### Known values supported by the service + * **Internal**: Actions are for internal-only APIs. + */ +export type ActionType = string; + +/** Common error response for all Azure Resource Manager APIs to return error details for failed operations. */ +export interface ErrorResponse { + /** The error object. */ + error?: ErrorDetail; +} + +export function errorResponseDeserializer(item: any): ErrorResponse { + return { + error: !item["error"] ? item["error"] : errorDetailDeserializer(item["error"]), + }; +} + +/** The error detail. */ +export interface ErrorDetail { + /** The error code. */ + readonly code?: string; + /** The error message. */ + readonly message?: string; + /** The error target. */ + readonly target?: string; + /** The error details. */ + readonly details?: ErrorDetail[]; + /** The error additional info. */ + readonly additionalInfo?: ErrorAdditionalInfo[]; +} + +export function errorDetailDeserializer(item: any): ErrorDetail { + return { + code: item["code"], + message: item["message"], + target: item["target"], + details: !item["details"] ? item["details"] : errorDetailArrayDeserializer(item["details"]), + additionalInfo: !item["additionalInfo"] + ? item["additionalInfo"] + : errorAdditionalInfoArrayDeserializer(item["additionalInfo"]), + }; +} + +export function errorDetailArrayDeserializer(result: Array): any[] { + return result.map((item) => { + return errorDetailDeserializer(item); + }); +} + +export function errorAdditionalInfoArrayDeserializer(result: Array): any[] { + return result.map((item) => { + return errorAdditionalInfoDeserializer(item); + }); +} + +/** The resource management error additional info. */ +export interface ErrorAdditionalInfo { + /** The additional info type. */ + readonly type?: string; + /** The additional info. */ + readonly info?: Record; +} + +export function errorAdditionalInfoDeserializer(item: any): ErrorAdditionalInfo { + return { + type: item["type"], + info: !item["info"] ? item["info"] : _errorAdditionalInfoInfoDeserializer(item["info"]), + }; +} + +/** model interface _ErrorAdditionalInfoInfo */ +export interface _ErrorAdditionalInfoInfo {} + +export function _errorAdditionalInfoInfoDeserializer(item: any): _ErrorAdditionalInfoInfo { + return item; +} + +/** Address Resource. */ +export interface AddressResource extends TrackedResource { + /** Properties of an address. */ + properties: AddressProperties; +} + +export function addressResourceSerializer(item: AddressResource): any { + return { + tags: item["tags"], + location: item["location"], + properties: addressPropertiesSerializer(item["properties"]), + }; +} + +export function addressResourceDeserializer(item: any): AddressResource { + return { + tags: item["tags"], + location: item["location"], + id: item["id"], + name: item["name"], + type: item["type"], + systemData: !item["systemData"] + ? item["systemData"] + : systemDataDeserializer(item["systemData"]), + properties: addressPropertiesDeserializer(item["properties"]), + }; +} + +/** Address Properties. */ +export interface AddressProperties { + /** Type of address based on its usage context. */ + addressClassification?: AddressClassification; + /** Shipping details for the address. */ + shippingAddress?: ShippingAddress; + /** Contact details for the address. */ + contactDetails?: ContactDetails; + /** Status of address validation. */ + readonly addressValidationStatus?: AddressValidationStatus; + /** Provisioning state */ + readonly provisioningState?: ProvisioningState; +} + +export function addressPropertiesSerializer(item: AddressProperties): any { + return { + addressClassification: item["addressClassification"], + shippingAddress: !item["shippingAddress"] + ? item["shippingAddress"] + : shippingAddressSerializer(item["shippingAddress"]), + contactDetails: !item["contactDetails"] + ? item["contactDetails"] + : contactDetailsSerializer(item["contactDetails"]), + }; +} + +export function addressPropertiesDeserializer(item: any): AddressProperties { + return { + addressClassification: item["addressClassification"], + shippingAddress: !item["shippingAddress"] + ? item["shippingAddress"] + : shippingAddressDeserializer(item["shippingAddress"]), + contactDetails: !item["contactDetails"] + ? item["contactDetails"] + : contactDetailsDeserializer(item["contactDetails"]), + addressValidationStatus: item["addressValidationStatus"], + provisioningState: item["provisioningState"], + }; +} + +/** Type of address based on its usage context. */ +export enum KnownAddressClassification { + /** Shipping address for the order. */ + Shipping = "Shipping", + /** Site Address. */ + Site = "Site", +} + +/** + * Type of address based on its usage context. \ + * {@link KnownAddressClassification} can be used interchangeably with AddressClassification, + * this enum contains the known values that the service supports. + * ### Known values supported by the service + * **Shipping**: Shipping address for the order. \ + * **Site**: Site Address. + */ +export type AddressClassification = string; + +/** Shipping address where customer wishes to receive the device. */ +export interface ShippingAddress { + /** Street Address line 1. */ + streetAddress1?: string; + /** Street Address line 2. */ + streetAddress2?: string; + /** Street Address line 3. */ + streetAddress3?: string; + /** Name of the City. */ + city?: string; + /** Name of the State or Province. */ + stateOrProvince?: string; + /** Name of the Country. */ + country: string; + /** Postal code. */ + postalCode?: string; + /** Extended Zip Code. */ + zipExtendedCode?: string; + /** Name of the company. */ + companyName?: string; + /** Type of address. */ + addressType?: AddressType; +} + +export function shippingAddressSerializer(item: ShippingAddress): any { + return { + streetAddress1: item["streetAddress1"], + streetAddress2: item["streetAddress2"], + streetAddress3: item["streetAddress3"], + city: item["city"], + stateOrProvince: item["stateOrProvince"], + country: item["country"], + postalCode: item["postalCode"], + zipExtendedCode: item["zipExtendedCode"], + companyName: item["companyName"], + addressType: item["addressType"], + }; +} + +export function shippingAddressDeserializer(item: any): ShippingAddress { + return { + streetAddress1: item["streetAddress1"], + streetAddress2: item["streetAddress2"], + streetAddress3: item["streetAddress3"], + city: item["city"], + stateOrProvince: item["stateOrProvince"], + country: item["country"], + postalCode: item["postalCode"], + zipExtendedCode: item["zipExtendedCode"], + companyName: item["companyName"], + addressType: item["addressType"], + }; +} + +/** Type of address. */ +export enum KnownAddressType { + /** Address type not known. */ + None = "None", + /** Residential Address. */ + Residential = "Residential", + /** Commercial Address. */ + Commercial = "Commercial", +} + +/** + * Type of address. \ + * {@link KnownAddressType} can be used interchangeably with AddressType, + * this enum contains the known values that the service supports. + * ### Known values supported by the service + * **None**: Address type not known. \ + * **Residential**: Residential Address. \ + * **Commercial**: Commercial Address. + */ +export type AddressType = string; + +/** Contact Details. */ +export interface ContactDetails { + /** Contact name of the person. */ + contactName?: string; + /** Phone number of the contact person. */ + phone?: string; + /** Phone extension number of the contact person. */ + phoneExtension?: string; + /** Mobile number of the contact person. */ + mobile?: string; + /** List of Email-ids to be notified about job progress. */ + emailList?: string[]; +} + +export function contactDetailsSerializer(item: ContactDetails): any { + return { + contactName: item["contactName"], + phone: item["phone"], + phoneExtension: item["phoneExtension"], + mobile: item["mobile"], + emailList: !item["emailList"] + ? item["emailList"] + : item["emailList"].map((p: any) => { + return p; + }), + }; +} + +export function contactDetailsDeserializer(item: any): ContactDetails { + return { + contactName: item["contactName"], + phone: item["phone"], + phoneExtension: item["phoneExtension"], + mobile: item["mobile"], + emailList: !item["emailList"] + ? item["emailList"] + : item["emailList"].map((p: any) => { + return p; + }), + }; +} + +/** Status of address validation. */ +export enum KnownAddressValidationStatus { + /** Address provided is valid. */ + Valid = "Valid", + /** Address provided is invalid or not supported. */ + Invalid = "Invalid", + /** Address provided is ambiguous, please choose one of the alternate addresses returned. */ + Ambiguous = "Ambiguous", +} + +/** + * Status of address validation. \ + * {@link KnownAddressValidationStatus} can be used interchangeably with AddressValidationStatus, + * this enum contains the known values that the service supports. + * ### Known values supported by the service + * **Valid**: Address provided is valid. \ + * **Invalid**: Address provided is invalid or not supported. \ + * **Ambiguous**: Address provided is ambiguous, please choose one of the alternate addresses returned. + */ +export type AddressValidationStatus = string; + +/** Provisioning state */ +export enum KnownProvisioningState { + /** Creating state. */ + Creating = "Creating", + /** Succeeded state. */ + Succeeded = "Succeeded", + /** Failed state. */ + Failed = "Failed", + /** Canceled state. */ + Canceled = "Canceled", +} + +/** + * Provisioning state \ + * {@link KnownProvisioningState} can be used interchangeably with ProvisioningState, + * this enum contains the known values that the service supports. + * ### Known values supported by the service + * **Creating**: Creating state. \ + * **Succeeded**: Succeeded state. \ + * **Failed**: Failed state. \ + * **Canceled**: Canceled state. + */ +export type ProvisioningState = string; + +/** The resource model definition for an Azure Resource Manager tracked top level resource which has 'tags' and a 'location' */ +export interface TrackedResource extends Resource { + /** Resource tags. */ + tags?: Record; + /** The geo-location where the resource lives */ + location: string; +} + +export function trackedResourceSerializer(item: TrackedResource): any { + return { tags: item["tags"], location: item["location"] }; +} + +export function trackedResourceDeserializer(item: any): TrackedResource { + return { + id: item["id"], + name: item["name"], + type: item["type"], + systemData: !item["systemData"] + ? item["systemData"] + : systemDataDeserializer(item["systemData"]), + tags: item["tags"], + location: item["location"], + }; +} + +/** Common fields that are returned in the response for all Azure Resource Manager resources */ +export interface Resource { + /** Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} */ + readonly id?: string; + /** The name of the resource */ + readonly name?: string; + /** The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts" */ + readonly type?: string; + /** Azure Resource Manager metadata containing createdBy and modifiedBy information. */ + readonly systemData?: SystemData; +} + +export function resourceSerializer(item: Resource): any { + return item; +} + +export function resourceDeserializer(item: any): Resource { + return { + id: item["id"], + name: item["name"], + type: item["type"], + systemData: !item["systemData"] + ? item["systemData"] + : systemDataDeserializer(item["systemData"]), + }; +} + +/** Metadata pertaining to creation and last modification of the resource. */ +export interface SystemData { + /** The identity that created the resource. */ + createdBy?: string; + /** The type of identity that created the resource. */ + createdByType?: CreatedByType; + /** The timestamp of resource creation (UTC). */ + createdAt?: Date; + /** The identity that last modified the resource. */ + lastModifiedBy?: string; + /** The type of identity that last modified the resource. */ + lastModifiedByType?: CreatedByType; + /** The timestamp of resource last modification (UTC) */ + lastModifiedAt?: Date; +} + +export function systemDataDeserializer(item: any): SystemData { + return { + createdBy: item["createdBy"], + createdByType: item["createdByType"], + createdAt: !item["createdAt"] ? item["createdAt"] : new Date(item["createdAt"]), + lastModifiedBy: item["lastModifiedBy"], + lastModifiedByType: item["lastModifiedByType"], + lastModifiedAt: !item["lastModifiedAt"] + ? item["lastModifiedAt"] + : new Date(item["lastModifiedAt"]), + }; +} + +/** The kind of entity that created the resource. */ +export enum KnownCreatedByType { + /** The entity was created by a user. */ + User = "User", + /** The entity was created by an application. */ + Application = "Application", + /** The entity was created by a managed identity. */ + ManagedIdentity = "ManagedIdentity", + /** The entity was created by a key. */ + Key = "Key", +} + +/** + * The kind of entity that created the resource. \ + * {@link KnowncreatedByType} can be used interchangeably with createdByType, + * this enum contains the known values that the service supports. + * ### Known values supported by the service + * **User**: The entity was created by a user. \ + * **Application**: The entity was created by an application. \ + * **ManagedIdentity**: The entity was created by a managed identity. \ + * **Key**: The entity was created by a key. + */ +export type CreatedByType = string; + +/** The Address update parameters. */ +export interface AddressUpdateParameter { + /** Properties of an address to be updated. */ + properties?: AddressUpdateProperties; + /** The list of key value pairs that describe the resource. These tags can be used in viewing and grouping this resource (across resource groups). */ + tags?: Record; +} + +export function addressUpdateParameterSerializer(item: AddressUpdateParameter): any { + return { + properties: !item["properties"] + ? item["properties"] + : addressUpdatePropertiesSerializer(item["properties"]), + tags: item["tags"], + }; +} + +/** Address Update Properties. */ +export interface AddressUpdateProperties { + /** Shipping details for the address. */ + shippingAddress?: ShippingAddress; + /** Contact details for the address. */ + contactDetails?: ContactDetails; +} + +export function addressUpdatePropertiesSerializer(item: AddressUpdateProperties): any { + return { + shippingAddress: !item["shippingAddress"] + ? item["shippingAddress"] + : shippingAddressSerializer(item["shippingAddress"]), + contactDetails: !item["contactDetails"] + ? item["contactDetails"] + : contactDetailsSerializer(item["contactDetails"]), + }; +} + +/** Address Resource Collection. */ +export interface _AddressResourceList { + /** The AddressResource items on this page */ + readonly value: AddressResource[]; + /** The link to the next page of items */ + nextLink?: string; +} + +export function _addressResourceListDeserializer(item: any): _AddressResourceList { + return { + value: addressResourceArrayDeserializer(item["value"]), + nextLink: item["nextLink"], + }; +} + +export function addressResourceArraySerializer(result: Array): any[] { + return result.map((item) => { + return addressResourceSerializer(item); + }); +} + +export function addressResourceArrayDeserializer(result: Array): any[] { + return result.map((item) => { + return addressResourceDeserializer(item); + }); +} + +/** Represents order item resource. */ +export interface OrderItemResource extends TrackedResource { + /** Order item properties. */ + properties: OrderItemProperties; + /** Msi identity of the resource */ + identity?: ResourceIdentity; +} + +export function orderItemResourceSerializer(item: OrderItemResource): any { + return { + tags: item["tags"], + location: item["location"], + properties: orderItemPropertiesSerializer(item["properties"]), + identity: !item["identity"] ? item["identity"] : resourceIdentitySerializer(item["identity"]), + }; +} + +export function orderItemResourceDeserializer(item: any): OrderItemResource { + return { + tags: item["tags"], + location: item["location"], + id: item["id"], + name: item["name"], + type: item["type"], + systemData: !item["systemData"] + ? item["systemData"] + : systemDataDeserializer(item["systemData"]), + properties: orderItemPropertiesDeserializer(item["properties"]), + identity: !item["identity"] ? item["identity"] : resourceIdentityDeserializer(item["identity"]), + }; +} + +/** Represents order item properties. */ +export interface OrderItemProperties { + /** Represents order item details. */ + orderItemDetails: OrderItemDetails; + /** Represents shipping and return address for order item. */ + addressDetails?: AddressDetails; + /** Start time of order item. */ + readonly startTime?: Date; + /** Id of the order to which order item belongs to. */ + orderId: string; + /** Provisioning state */ + readonly provisioningState?: ProvisioningState; +} + +export function orderItemPropertiesSerializer(item: OrderItemProperties): any { + return { + orderItemDetails: orderItemDetailsSerializer(item["orderItemDetails"]), + addressDetails: !item["addressDetails"] + ? item["addressDetails"] + : addressDetailsSerializer(item["addressDetails"]), + orderId: item["orderId"], + }; +} + +export function orderItemPropertiesDeserializer(item: any): OrderItemProperties { + return { + orderItemDetails: orderItemDetailsDeserializer(item["orderItemDetails"]), + addressDetails: !item["addressDetails"] + ? item["addressDetails"] + : addressDetailsDeserializer(item["addressDetails"]), + startTime: !item["startTime"] ? item["startTime"] : new Date(item["startTime"]), + orderId: item["orderId"], + provisioningState: item["provisioningState"], + }; +} + +/** Order item details. */ +export interface OrderItemDetails { + /** Represents product details. */ + productDetails: ProductDetails; + /** Order item type. */ + orderItemType: OrderItemType; + /** Defines the mode of the Order item. */ + orderItemMode?: OrderMode; + /** Site Related Details. */ + siteDetails?: SiteDetails; + /** Current Order item Status. */ + readonly currentStage?: StageDetails; + /** Order item status history. */ + readonly orderItemStageHistory?: StageDetails[]; + /** Customer notification Preferences. */ + preferences?: Preferences; + /** Forward Package Shipping details. */ + readonly forwardShippingDetails?: ForwardShippingDetails; + /** Reverse Package Shipping details. */ + readonly reverseShippingDetails?: ReverseShippingDetails; + /** Additional notification email list. */ + notificationEmailList?: string[]; + /** Cancellation reason. */ + readonly cancellationReason?: string; + /** Describes whether the order item is cancellable or not. */ + readonly cancellationStatus?: OrderItemCancellationEnum; + /** Describes whether the order item is deletable or not. */ + readonly deletionStatus?: ActionStatusEnum; + /** Return reason. */ + readonly returnReason?: string; + /** Describes whether the order item is returnable or not. */ + readonly returnStatus?: OrderItemReturnEnum; + /** List of parent RP details supported for configuration. */ + readonly managementRpDetailsList?: ResourceProviderDetails[]; + /** Top level error for the job. */ + readonly error?: ErrorDetail; +} + +export function orderItemDetailsSerializer(item: OrderItemDetails): any { + return { + productDetails: productDetailsSerializer(item["productDetails"]), + orderItemType: item["orderItemType"], + orderItemMode: item["orderItemMode"], + siteDetails: !item["siteDetails"] + ? item["siteDetails"] + : siteDetailsSerializer(item["siteDetails"]), + preferences: !item["preferences"] + ? item["preferences"] + : preferencesSerializer(item["preferences"]), + notificationEmailList: !item["notificationEmailList"] + ? item["notificationEmailList"] + : item["notificationEmailList"].map((p: any) => { + return p; + }), + }; +} + +export function orderItemDetailsDeserializer(item: any): OrderItemDetails { + return { + productDetails: productDetailsDeserializer(item["productDetails"]), + orderItemType: item["orderItemType"], + orderItemMode: item["orderItemMode"], + siteDetails: !item["siteDetails"] + ? item["siteDetails"] + : siteDetailsDeserializer(item["siteDetails"]), + currentStage: !item["currentStage"] + ? item["currentStage"] + : stageDetailsDeserializer(item["currentStage"]), + orderItemStageHistory: !item["orderItemStageHistory"] + ? item["orderItemStageHistory"] + : stageDetailsArrayDeserializer(item["orderItemStageHistory"]), + preferences: !item["preferences"] + ? item["preferences"] + : preferencesDeserializer(item["preferences"]), + forwardShippingDetails: !item["forwardShippingDetails"] + ? item["forwardShippingDetails"] + : forwardShippingDetailsDeserializer(item["forwardShippingDetails"]), + reverseShippingDetails: !item["reverseShippingDetails"] + ? item["reverseShippingDetails"] + : reverseShippingDetailsDeserializer(item["reverseShippingDetails"]), + notificationEmailList: !item["notificationEmailList"] + ? item["notificationEmailList"] + : item["notificationEmailList"].map((p: any) => { + return p; + }), + cancellationReason: item["cancellationReason"], + cancellationStatus: item["cancellationStatus"], + deletionStatus: item["deletionStatus"], + returnReason: item["returnReason"], + returnStatus: item["returnStatus"], + managementRpDetailsList: !item["managementRpDetailsList"] + ? item["managementRpDetailsList"] + : resourceProviderDetailsArrayDeserializer(item["managementRpDetailsList"]), + error: !item["error"] ? item["error"] : errorDetailDeserializer(item["error"]), + }; +} + +/** Represents product details. */ +export interface ProductDetails { + /** Display details of the product. */ + displayInfo?: DisplayInfo; + /** Hierarchy of the product which uniquely identifies the product. */ + hierarchyInformation: HierarchyInformation; + /** Double encryption status of the configuration. Read-only field. */ + readonly productDoubleEncryptionStatus?: DoubleEncryptionStatus; + /** Identification type of the configuration. */ + readonly identificationType?: IdentificationType; + /** Device details of the parent configuration. */ + readonly parentDeviceDetails?: DeviceDetails; + /** Device Provisioning Details for Parent. */ + parentProvisioningDetails?: ProvisioningDetails; + /** List of additional configurations customer wants in the order item apart from the ones included in the base configuration. */ + optInAdditionalConfigurations?: AdditionalConfiguration[]; + /** Details of all child configurations that are part of the order item. */ + readonly childConfigurationDeviceDetails?: ConfigurationDeviceDetails[]; + /** Term Commitment Information of the Device. */ + readonly termCommitmentInformation?: TermCommitmentInformation; +} + +export function productDetailsSerializer(item: ProductDetails): any { + return { + displayInfo: !item["displayInfo"] + ? item["displayInfo"] + : displayInfoSerializer(item["displayInfo"]), + hierarchyInformation: hierarchyInformationSerializer(item["hierarchyInformation"]), + parentProvisioningDetails: !item["parentProvisioningDetails"] + ? item["parentProvisioningDetails"] + : provisioningDetailsSerializer(item["parentProvisioningDetails"]), + optInAdditionalConfigurations: !item["optInAdditionalConfigurations"] + ? item["optInAdditionalConfigurations"] + : additionalConfigurationArraySerializer(item["optInAdditionalConfigurations"]), + }; +} + +export function productDetailsDeserializer(item: any): ProductDetails { + return { + displayInfo: !item["displayInfo"] + ? item["displayInfo"] + : displayInfoDeserializer(item["displayInfo"]), + hierarchyInformation: hierarchyInformationDeserializer(item["hierarchyInformation"]), + productDoubleEncryptionStatus: item["productDoubleEncryptionStatus"], + identificationType: item["identificationType"], + parentDeviceDetails: !item["parentDeviceDetails"] + ? item["parentDeviceDetails"] + : deviceDetailsDeserializer(item["parentDeviceDetails"]), + parentProvisioningDetails: !item["parentProvisioningDetails"] + ? item["parentProvisioningDetails"] + : provisioningDetailsDeserializer(item["parentProvisioningDetails"]), + optInAdditionalConfigurations: !item["optInAdditionalConfigurations"] + ? item["optInAdditionalConfigurations"] + : additionalConfigurationArrayDeserializer(item["optInAdditionalConfigurations"]), + childConfigurationDeviceDetails: !item["childConfigurationDeviceDetails"] + ? item["childConfigurationDeviceDetails"] + : configurationDeviceDetailsArrayDeserializer(item["childConfigurationDeviceDetails"]), + termCommitmentInformation: !item["termCommitmentInformation"] + ? item["termCommitmentInformation"] + : termCommitmentInformationDeserializer(item["termCommitmentInformation"]), + }; +} + +/** Describes product display information. */ +export interface DisplayInfo { + /** Product family display name. */ + readonly productFamilyDisplayName?: string; + /** Configuration display name. */ + readonly configurationDisplayName?: string; +} + +export function displayInfoSerializer(item: DisplayInfo): any { + return item; +} + +export function displayInfoDeserializer(item: any): DisplayInfo { + return { + productFamilyDisplayName: item["productFamilyDisplayName"], + configurationDisplayName: item["configurationDisplayName"], + }; +} + +/** Holds details about product hierarchy information. */ +export interface HierarchyInformation { + /** Represents product family name that uniquely identifies product family. */ + productFamilyName?: string; + /** Represents product line name that uniquely identifies product line. */ + productLineName?: string; + /** Represents product name that uniquely identifies product. */ + productName?: string; + /** Represents configuration name that uniquely identifies configuration. */ + configurationName?: string; + /** Represents Model Display Name. */ + configurationIdDisplayName?: string; +} + +export function hierarchyInformationSerializer(item: HierarchyInformation): any { + return { + productFamilyName: item["productFamilyName"], + productLineName: item["productLineName"], + productName: item["productName"], + configurationName: item["configurationName"], + configurationIdDisplayName: item["configurationIdDisplayName"], + }; +} + +export function hierarchyInformationDeserializer(item: any): HierarchyInformation { + return { + productFamilyName: item["productFamilyName"], + productLineName: item["productLineName"], + productName: item["productName"], + configurationName: item["configurationName"], + configurationIdDisplayName: item["configurationIdDisplayName"], + }; +} + +/** Double encryption status as entered by the customer. It is compulsory to give this parameter if the 'Deny' or 'Disabled' policy is configured. */ +export enum KnownDoubleEncryptionStatus { + /** Double encryption is disabled. */ + Disabled = "Disabled", + /** Double encryption is enabled. */ + Enabled = "Enabled", +} + +/** + * Double encryption status as entered by the customer. It is compulsory to give this parameter if the 'Deny' or 'Disabled' policy is configured. \ + * {@link KnownDoubleEncryptionStatus} can be used interchangeably with DoubleEncryptionStatus, + * this enum contains the known values that the service supports. + * ### Known values supported by the service + * **Disabled**: Double encryption is disabled. \ + * **Enabled**: Double encryption is enabled. + */ +export type DoubleEncryptionStatus = string; + +/** Identification type of the configuration. */ +export enum KnownIdentificationType { + /** Product does not have any explicit identifier. */ + NotSupported = "NotSupported", + /** Product is identifiable by serial number. */ + SerialNumber = "SerialNumber", +} + +/** + * Identification type of the configuration. \ + * {@link KnownIdentificationType} can be used interchangeably with IdentificationType, + * this enum contains the known values that the service supports. + * ### Known values supported by the service + * **NotSupported**: Product does not have any explicit identifier. \ + * **SerialNumber**: Product is identifiable by serial number. + */ +export type IdentificationType = string; + +/** Device details. */ +export interface DeviceDetails { + /** Device serial number. */ + readonly serialNumber?: string; + /** Device serial number to be displayed. */ + readonly displaySerialNumber?: string; + /** Management Resource Id. */ + readonly managementResourceId?: string; + /** Management Resource Tenant ID. */ + readonly managementResourceTenantId?: string; + /** Determining nature of provisioning that the configuration supports. */ + readonly provisioningSupport?: ProvisioningSupport; + /** Provisioning Details for the device. */ + readonly provisioningDetails?: ProvisioningDetails; +} + +export function deviceDetailsDeserializer(item: any): DeviceDetails { + return { + serialNumber: item["serialNumber"], + displaySerialNumber: item["displaySerialNumber"], + managementResourceId: item["managementResourceId"], + managementResourceTenantId: item["managementResourceTenantId"], + provisioningSupport: item["provisioningSupport"], + provisioningDetails: !item["provisioningDetails"] + ? item["provisioningDetails"] + : provisioningDetailsDeserializer(item["provisioningDetails"]), + }; +} + +/** Determining nature of provisioning that the configuration supports. */ +export enum KnownProvisioningSupport { + /** The configuration can be provisioned from the cloud. */ + CloudBased = "CloudBased", + /** The configuration need to be provisioned manually by the end user. */ + Manual = "Manual", +} + +/** + * Determining nature of provisioning that the configuration supports. \ + * {@link KnownProvisioningSupport} can be used interchangeably with ProvisioningSupport, + * this enum contains the known values that the service supports. + * ### Known values supported by the service + * **CloudBased**: The configuration can be provisioned from the cloud. \ + * **Manual**: The configuration need to be provisioned manually by the end user. + */ +export type ProvisioningSupport = string; + +/** Details Related To Provision Resource. */ +export interface ProvisioningDetails { + /** Quantity of the devices. */ + quantity?: number; + /** Provisioning Resource Arm ID. */ + provisioningArmId?: string; + /** Provisioning End Point. */ + provisioningEndPoint?: string; + /** Serial Number for the Device. */ + serialNumber?: string; + /** Vendor Name for the Device , (for 1P devices - Microsoft). */ + vendorName?: string; + /** Arc Enabled Resource Arm id. */ + readyToConnectArmId?: string; + /** Management Resource ArmId. */ + managementResourceArmId?: string; + /** Unique Identity for a Device. */ + readonly uniqueDeviceIdentifier?: string; + /** Auto Provisioning Details. */ + autoProvisioningStatus?: AutoProvisioningStatus; + /** Proof of possession details. */ + devicePresenceVerification?: DevicePresenceVerificationDetails; +} + +export function provisioningDetailsSerializer(item: ProvisioningDetails): any { + return { + quantity: item["quantity"], + provisioningArmId: item["provisioningArmId"], + provisioningEndPoint: item["provisioningEndPoint"], + serialNumber: item["serialNumber"], + vendorName: item["vendorName"], + readyToConnectArmId: item["readyToConnectArmId"], + managementResourceArmId: item["managementResourceArmId"], + autoProvisioningStatus: item["autoProvisioningStatus"], + devicePresenceVerification: !item["devicePresenceVerification"] + ? item["devicePresenceVerification"] + : devicePresenceVerificationDetailsSerializer(item["devicePresenceVerification"]), + }; +} + +export function provisioningDetailsDeserializer(item: any): ProvisioningDetails { + return { + quantity: item["quantity"], + provisioningArmId: item["provisioningArmId"], + provisioningEndPoint: item["provisioningEndPoint"], + serialNumber: item["serialNumber"], + vendorName: item["vendorName"], + readyToConnectArmId: item["readyToConnectArmId"], + managementResourceArmId: item["managementResourceArmId"], + uniqueDeviceIdentifier: item["uniqueDeviceIdentifier"], + autoProvisioningStatus: item["autoProvisioningStatus"], + devicePresenceVerification: !item["devicePresenceVerification"] + ? item["devicePresenceVerification"] + : devicePresenceVerificationDetailsDeserializer(item["devicePresenceVerification"]), + }; +} + +/** Auto Provisioning Details. */ +export enum KnownAutoProvisioningStatus { + /** Provisioning Enabled. Will act as pre-approved, and arc extension will be enabled as soon as the device is verified to be at the right edge location. */ + Enabled = "Enabled", + /** Provisioning Disabled. */ + Disabled = "Disabled", +} + +/** + * Auto Provisioning Details. \ + * {@link KnownAutoProvisioningStatus} can be used interchangeably with AutoProvisioningStatus, + * this enum contains the known values that the service supports. + * ### Known values supported by the service + * **Enabled**: Provisioning Enabled. Will act as pre-approved, and arc extension will be enabled as soon as the device is verified to be at the right edge location. \ + * **Disabled**: Provisioning Disabled. + */ +export type AutoProvisioningStatus = string; + +/** Proof of possession details. */ +export interface DevicePresenceVerificationDetails { + /** Proof of possession status. */ + readonly status?: DevicePresenceVerificationStatus; + /** Insights on current status. */ + readonly message?: string; +} + +export function devicePresenceVerificationDetailsSerializer( + item: DevicePresenceVerificationDetails, +): any { + return item; +} + +export function devicePresenceVerificationDetailsDeserializer( + item: any, +): DevicePresenceVerificationDetails { + return { + status: item["status"], + message: item["message"], + }; +} + +/** Proof of possession status. */ +export enum KnownDevicePresenceVerificationStatus { + /** The device has not yet been verified to be with the right edge operator or at the right location. */ + NotInitiated = "NotInitiated", + /** Confirms that the device is verified to be with the right edge operator or at the right location. */ + Completed = "Completed", +} + +/** + * Proof of possession status. \ + * {@link KnownDevicePresenceVerificationStatus} can be used interchangeably with DevicePresenceVerificationStatus, + * this enum contains the known values that the service supports. + * ### Known values supported by the service + * **NotInitiated**: The device has not yet been verified to be with the right edge operator or at the right location. \ + * **Completed**: Confirms that the device is verified to be with the right edge operator or at the right location. + */ +export type DevicePresenceVerificationStatus = string; + +export function additionalConfigurationArraySerializer( + result: Array, +): any[] { + return result.map((item) => { + return additionalConfigurationSerializer(item); + }); +} + +export function additionalConfigurationArrayDeserializer( + result: Array, +): any[] { + return result.map((item) => { + return additionalConfigurationDeserializer(item); + }); +} + +/** Additional Configuration details. */ +export interface AdditionalConfiguration { + /** Hierarchy of the product which uniquely identifies the configuration. */ + hierarchyInformation: HierarchyInformation; + /** Quantity of the product. */ + quantity: number; + /** List Provisioning Details for Devices in Additional Config. */ + provisioningDetails?: ProvisioningDetails[]; +} + +export function additionalConfigurationSerializer(item: AdditionalConfiguration): any { + return { + hierarchyInformation: hierarchyInformationSerializer(item["hierarchyInformation"]), + quantity: item["quantity"], + provisioningDetails: !item["provisioningDetails"] + ? item["provisioningDetails"] + : provisioningDetailsArraySerializer(item["provisioningDetails"]), + }; +} + +export function additionalConfigurationDeserializer(item: any): AdditionalConfiguration { + return { + hierarchyInformation: hierarchyInformationDeserializer(item["hierarchyInformation"]), + quantity: item["quantity"], + provisioningDetails: !item["provisioningDetails"] + ? item["provisioningDetails"] + : provisioningDetailsArrayDeserializer(item["provisioningDetails"]), + }; +} + +export function provisioningDetailsArraySerializer(result: Array): any[] { + return result.map((item) => { + return provisioningDetailsSerializer(item); + }); +} + +export function provisioningDetailsArrayDeserializer(result: Array): any[] { + return result.map((item) => { + return provisioningDetailsDeserializer(item); + }); +} + +export function configurationDeviceDetailsArrayDeserializer( + result: Array, +): any[] { + return result.map((item) => { + return configurationDeviceDetailsDeserializer(item); + }); +} + +/** Device details for configuration. */ +export interface ConfigurationDeviceDetails { + /** Display details of the product. */ + displayInfo?: DisplayInfo; + /** Hierarchy of the product which uniquely identifies the configuration. */ + readonly hierarchyInformation?: HierarchyInformation; + /** Quantity of the product. */ + readonly quantity?: number; + /** Identification type of the configuration. */ + readonly identificationType?: IdentificationType; + /** List of device details. */ + readonly deviceDetails?: DeviceDetails[]; + /** Term Commitment Information of the Device. */ + readonly termCommitmentInformation?: TermCommitmentInformation; +} + +export function configurationDeviceDetailsDeserializer(item: any): ConfigurationDeviceDetails { + return { + displayInfo: !item["displayInfo"] + ? item["displayInfo"] + : displayInfoDeserializer(item["displayInfo"]), + hierarchyInformation: !item["hierarchyInformation"] + ? item["hierarchyInformation"] + : hierarchyInformationDeserializer(item["hierarchyInformation"]), + quantity: item["quantity"], + identificationType: item["identificationType"], + deviceDetails: !item["deviceDetails"] + ? item["deviceDetails"] + : deviceDetailsArrayDeserializer(item["deviceDetails"]), + termCommitmentInformation: !item["termCommitmentInformation"] + ? item["termCommitmentInformation"] + : termCommitmentInformationDeserializer(item["termCommitmentInformation"]), + }; +} + +export function deviceDetailsArrayDeserializer(result: Array): any[] { + return result.map((item) => { + return deviceDetailsDeserializer(item); + }); +} + +/** Term Commitment Information. */ +export interface TermCommitmentInformation { + /** Term Commitment Type */ + termCommitmentType: TermCommitmentType; + /** Term Commitment Duration. Currently Supporting P365D, P1095D */ + readonly termCommitmentTypeDuration?: string; + /** Number of Days Pending for Term Commitment */ + readonly pendingDaysForTerm?: number; +} + +export function termCommitmentInformationDeserializer(item: any): TermCommitmentInformation { + return { + termCommitmentType: item["termCommitmentType"], + termCommitmentTypeDuration: item["termCommitmentTypeDuration"], + pendingDaysForTerm: item["pendingDaysForTerm"], + }; +} + +/** Term Commitment Type */ +export enum KnownTermCommitmentType { + /** Pay as you go Term Commitment Model. */ + None = "None", + /** Trial Term Commitment Model. */ + Trial = "Trial", + /** Time based Term Commitment Model. */ + Timed = "Timed", +} + +/** + * Term Commitment Type \ + * {@link KnownTermCommitmentType} can be used interchangeably with TermCommitmentType, + * this enum contains the known values that the service supports. + * ### Known values supported by the service + * **None**: Pay as you go Term Commitment Model. \ + * **Trial**: Trial Term Commitment Model. \ + * **Timed**: Time based Term Commitment Model. + */ +export type TermCommitmentType = string; + +/** Order item type. */ +export enum KnownOrderItemType { + /** Purchase OrderItem. */ + Purchase = "Purchase", + /** Rental OrderItem. */ + Rental = "Rental", + /** Orders placed outside of azure. */ + External = "External", +} + +/** + * Order item type. \ + * {@link KnownOrderItemType} can be used interchangeably with OrderItemType, + * this enum contains the known values that the service supports. + * ### Known values supported by the service + * **Purchase**: Purchase OrderItem. \ + * **Rental**: Rental OrderItem. \ + * **External**: Orders placed outside of azure. + */ +export type OrderItemType = string; + +/** Defines the mode of the Order item. */ +export enum KnownOrderMode { + /** Default Order mode. */ + Default = "Default", + /** Mode in which the Order will not be fulfilled. */ + DoNotFulfill = "DoNotFulfill", +} + +/** + * Defines the mode of the Order item. \ + * {@link KnownOrderMode} can be used interchangeably with OrderMode, + * this enum contains the known values that the service supports. + * ### Known values supported by the service + * **Default**: Default Order mode. \ + * **DoNotFulfill**: Mode in which the Order will not be fulfilled. + */ +export type OrderMode = string; + +/** Represents Site Related Details. */ +export interface SiteDetails { + /** Unique Id, Identifying A Site. */ + siteId: string; +} + +export function siteDetailsSerializer(item: SiteDetails): any { + return { siteId: item["siteId"] }; +} + +export function siteDetailsDeserializer(item: any): SiteDetails { + return { + siteId: item["siteId"], + }; +} + +/** Resource stage details. */ +export interface StageDetails { + /** Stage status. */ + readonly stageStatus?: StageStatus; + /** Stage name. */ + readonly stageName?: StageName; + /** Display name of the resource stage. */ + readonly displayName?: string; + /** Stage start time. */ + readonly startTime?: Date; +} + +export function stageDetailsDeserializer(item: any): StageDetails { + return { + stageStatus: item["stageStatus"], + stageName: item["stageName"], + displayName: item["displayName"], + startTime: !item["startTime"] ? item["startTime"] : new Date(item["startTime"]), + }; +} + +/** Stage status. */ +export enum KnownStageStatus { + /** No status available yet. */ + None = "None", + /** Stage is in progress. */ + InProgress = "InProgress", + /** Stage has succeeded. */ + Succeeded = "Succeeded", + /** Stage has failed. */ + Failed = "Failed", + /** Stage has been cancelled. */ + Cancelled = "Cancelled", + /** Stage is cancelling. */ + Cancelling = "Cancelling", +} + +/** + * Stage status. \ + * {@link KnownStageStatus} can be used interchangeably with StageStatus, + * this enum contains the known values that the service supports. + * ### Known values supported by the service + * **None**: No status available yet. \ + * **InProgress**: Stage is in progress. \ + * **Succeeded**: Stage has succeeded. \ + * **Failed**: Stage has failed. \ + * **Cancelled**: Stage has been cancelled. \ + * **Cancelling**: Stage is cancelling. + */ +export type StageStatus = string; + +/** Stage name. */ +export enum KnownStageName { + /** Currently in draft mode and can still be cancelled. */ + Placed = "Placed", + /** Order is currently in draft mode and can still be cancelled. */ + InReview = "InReview", + /** Order is confirmed. */ + Confirmed = "Confirmed", + /** Order is ready to ship. */ + ReadyToShip = "ReadyToShip", + /** Order is in transit to customer. */ + Shipped = "Shipped", + /** Order is delivered to customer. */ + Delivered = "Delivered", + /** Order is ready to get cloud connected. */ + ReadyToSetup = "ReadyToSetup", + /** Order is in use at customer site. */ + InUse = "InUse", + /** Return has been initiated by customer. */ + ReturnInitiated = "ReturnInitiated", + /** Order is in transit from customer to Microsoft. */ + ReturnPickedUp = "ReturnPickedUp", + /** Order has been received back to Microsoft. */ + ReturnedToMicrosoft = "ReturnedToMicrosoft", + /** Return has now completed. */ + ReturnCompleted = "ReturnCompleted", + /** Order has been cancelled. */ + Cancelled = "Cancelled", +} + +/** + * Stage name. \ + * {@link KnownStageName} can be used interchangeably with StageName, + * this enum contains the known values that the service supports. + * ### Known values supported by the service + * **Placed**: Currently in draft mode and can still be cancelled. \ + * **InReview**: Order is currently in draft mode and can still be cancelled. \ + * **Confirmed**: Order is confirmed. \ + * **ReadyToShip**: Order is ready to ship. \ + * **Shipped**: Order is in transit to customer. \ + * **Delivered**: Order is delivered to customer. \ + * **ReadyToSetup**: Order is ready to get cloud connected. \ + * **InUse**: Order is in use at customer site. \ + * **ReturnInitiated**: Return has been initiated by customer. \ + * **ReturnPickedUp**: Order is in transit from customer to Microsoft. \ + * **ReturnedToMicrosoft**: Order has been received back to Microsoft. \ + * **ReturnCompleted**: Return has now completed. \ + * **Cancelled**: Order has been cancelled. + */ +export type StageName = string; + +export function stageDetailsArrayDeserializer(result: Array): any[] { + return result.map((item) => { + return stageDetailsDeserializer(item); + }); +} + +/** Preferences related to the order. */ +export interface Preferences { + /** Notification preferences. */ + notificationPreferences?: NotificationPreference[]; + /** Preferences related to the shipment logistics of the order. */ + transportPreferences?: TransportPreferences; + /** Preferences related to the Encryption. */ + encryptionPreferences?: EncryptionPreferences; + /** Preferences related to the Management resource. */ + managementResourcePreferences?: ManagementResourcePreferences; + /** Preferences related to the Term commitment. */ + termCommitmentPreferences?: TermCommitmentPreferences; +} + +export function preferencesSerializer(item: Preferences): any { + return { + notificationPreferences: !item["notificationPreferences"] + ? item["notificationPreferences"] + : notificationPreferenceArraySerializer(item["notificationPreferences"]), + transportPreferences: !item["transportPreferences"] + ? item["transportPreferences"] + : transportPreferencesSerializer(item["transportPreferences"]), + encryptionPreferences: !item["encryptionPreferences"] + ? item["encryptionPreferences"] + : encryptionPreferencesSerializer(item["encryptionPreferences"]), + managementResourcePreferences: !item["managementResourcePreferences"] + ? item["managementResourcePreferences"] + : managementResourcePreferencesSerializer(item["managementResourcePreferences"]), + termCommitmentPreferences: !item["termCommitmentPreferences"] + ? item["termCommitmentPreferences"] + : termCommitmentPreferencesSerializer(item["termCommitmentPreferences"]), + }; +} + +export function preferencesDeserializer(item: any): Preferences { + return { + notificationPreferences: !item["notificationPreferences"] + ? item["notificationPreferences"] + : notificationPreferenceArrayDeserializer(item["notificationPreferences"]), + transportPreferences: !item["transportPreferences"] + ? item["transportPreferences"] + : transportPreferencesDeserializer(item["transportPreferences"]), + encryptionPreferences: !item["encryptionPreferences"] + ? item["encryptionPreferences"] + : encryptionPreferencesDeserializer(item["encryptionPreferences"]), + managementResourcePreferences: !item["managementResourcePreferences"] + ? item["managementResourcePreferences"] + : managementResourcePreferencesDeserializer(item["managementResourcePreferences"]), + termCommitmentPreferences: !item["termCommitmentPreferences"] + ? item["termCommitmentPreferences"] + : termCommitmentPreferencesDeserializer(item["termCommitmentPreferences"]), + }; +} + +export function notificationPreferenceArraySerializer( + result: Array, +): any[] { + return result.map((item) => { + return notificationPreferenceSerializer(item); + }); +} + +export function notificationPreferenceArrayDeserializer( + result: Array, +): any[] { + return result.map((item) => { + return notificationPreferenceDeserializer(item); + }); +} + +/** Notification preference for a job stage. */ +export interface NotificationPreference { + /** Name of the stage. */ + stageName: NotificationStageName; + /** Notification is required or not. */ + sendNotification: boolean; +} + +export function notificationPreferenceSerializer(item: NotificationPreference): any { + return { + stageName: item["stageName"], + sendNotification: item["sendNotification"], + }; +} + +export function notificationPreferenceDeserializer(item: any): NotificationPreference { + return { + stageName: item["stageName"], + sendNotification: item["sendNotification"], + }; +} + +/** Name of the stage. */ +export enum KnownNotificationStageName { + /** Notification at order item shipped from microsoft datacenter. */ + Shipped = "Shipped", + /** Notification at order item delivered to customer. */ + Delivered = "Delivered", +} + +/** + * Name of the stage. \ + * {@link KnownNotificationStageName} can be used interchangeably with NotificationStageName, + * this enum contains the known values that the service supports. + * ### Known values supported by the service + * **Shipped**: Notification at order item shipped from microsoft datacenter. \ + * **Delivered**: Notification at order item delivered to customer. + */ +export type NotificationStageName = string; + +/** Preferences related to the shipment logistics of the sku. */ +export interface TransportPreferences { + /** Indicates Shipment Logistics type that the customer preferred. */ + preferredShipmentType: TransportShipmentTypes; +} + +export function transportPreferencesSerializer(item: TransportPreferences): any { + return { preferredShipmentType: item["preferredShipmentType"] }; +} + +export function transportPreferencesDeserializer(item: any): TransportPreferences { + return { + preferredShipmentType: item["preferredShipmentType"], + }; +} + +/** Indicates Shipment Logistics type that the customer preferred. */ +export enum KnownTransportShipmentTypes { + /** Shipment Logistics is handled by the customer. */ + CustomerManaged = "CustomerManaged", + /** Shipment Logistics is handled by Microsoft. */ + MicrosoftManaged = "MicrosoftManaged", +} + +/** + * Indicates Shipment Logistics type that the customer preferred. \ + * {@link KnownTransportShipmentTypes} can be used interchangeably with TransportShipmentTypes, + * this enum contains the known values that the service supports. + * ### Known values supported by the service + * **CustomerManaged**: Shipment Logistics is handled by the customer. \ + * **MicrosoftManaged**: Shipment Logistics is handled by Microsoft. + */ +export type TransportShipmentTypes = string; + +/** Preferences related to the double encryption. */ +export interface EncryptionPreferences { + /** Double encryption status as entered by the customer. It is compulsory to give this parameter if the 'Deny' or 'Disabled' policy is configured. */ + doubleEncryptionStatus?: DoubleEncryptionStatus; +} + +export function encryptionPreferencesSerializer(item: EncryptionPreferences): any { + return { doubleEncryptionStatus: item["doubleEncryptionStatus"] }; +} + +export function encryptionPreferencesDeserializer(item: any): EncryptionPreferences { + return { + doubleEncryptionStatus: item["doubleEncryptionStatus"], + }; +} + +/** Management resource preference to link device. */ +export interface ManagementResourcePreferences { + /** Customer preferred Management resource ARM ID. */ + preferredManagementResourceId?: string; +} + +export function managementResourcePreferencesSerializer(item: ManagementResourcePreferences): any { + return { + preferredManagementResourceId: item["preferredManagementResourceId"], + }; +} + +export function managementResourcePreferencesDeserializer( + item: any, +): ManagementResourcePreferences { + return { + preferredManagementResourceId: item["preferredManagementResourceId"], + }; +} + +/** Term Commitment preference received from customer. */ +export interface TermCommitmentPreferences { + /** Term Commitment Type */ + preferredTermCommitmentType: TermCommitmentType; + /** Customer preferred Term Duration. */ + preferredTermCommitmentDuration?: string; +} + +export function termCommitmentPreferencesSerializer(item: TermCommitmentPreferences): any { + return { + preferredTermCommitmentType: item["preferredTermCommitmentType"], + preferredTermCommitmentDuration: item["preferredTermCommitmentDuration"], + }; +} + +export function termCommitmentPreferencesDeserializer(item: any): TermCommitmentPreferences { + return { + preferredTermCommitmentType: item["preferredTermCommitmentType"], + preferredTermCommitmentDuration: item["preferredTermCommitmentDuration"], + }; +} + +/** Forward shipment details. */ +export interface ForwardShippingDetails { + /** Name of the carrier. */ + readonly carrierName?: string; + /** Carrier Name for display purpose. Not to be used for any processing. */ + readonly carrierDisplayName?: string; + /** TrackingId of the package. */ + readonly trackingId?: string; + /** TrackingUrl of the package. */ + readonly trackingUrl?: string; +} + +export function forwardShippingDetailsDeserializer(item: any): ForwardShippingDetails { + return { + carrierName: item["carrierName"], + carrierDisplayName: item["carrierDisplayName"], + trackingId: item["trackingId"], + trackingUrl: item["trackingUrl"], + }; +} + +/** Reverse shipment details. */ +export interface ReverseShippingDetails { + /** SAS key to download the reverse shipment label of the package. */ + readonly sasKeyForLabel?: string; + /** Name of the carrier. */ + readonly carrierName?: string; + /** Carrier Name for display purpose. Not to be used for any processing. */ + readonly carrierDisplayName?: string; + /** TrackingId of the package. */ + readonly trackingId?: string; + /** TrackingUrl of the package. */ + readonly trackingUrl?: string; +} + +export function reverseShippingDetailsDeserializer(item: any): ReverseShippingDetails { + return { + sasKeyForLabel: item["sasKeyForLabel"], + carrierName: item["carrierName"], + carrierDisplayName: item["carrierDisplayName"], + trackingId: item["trackingId"], + trackingUrl: item["trackingUrl"], + }; +} + +/** Describes whether the order item is cancellable or not. */ +export enum KnownOrderItemCancellationEnum { + /** Order item can be cancelled without fee. */ + Cancellable = "Cancellable", + /** Order item can be cancelled with fee. */ + CancellableWithFee = "CancellableWithFee", + /** Order item not cancellable. */ + NotCancellable = "NotCancellable", +} + +/** + * Describes whether the order item is cancellable or not. \ + * {@link KnownOrderItemCancellationEnum} can be used interchangeably with OrderItemCancellationEnum, + * this enum contains the known values that the service supports. + * ### Known values supported by the service + * **Cancellable**: Order item can be cancelled without fee. \ + * **CancellableWithFee**: Order item can be cancelled with fee. \ + * **NotCancellable**: Order item not cancellable. + */ +export type OrderItemCancellationEnum = string; + +/** Describes whether the order item is deletable or not. */ +export enum KnownActionStatusEnum { + /** Allowed flag. */ + Allowed = "Allowed", + /** Not Allowed flag. */ + NotAllowed = "NotAllowed", +} + +/** + * Describes whether the order item is deletable or not. \ + * {@link KnownActionStatusEnum} can be used interchangeably with ActionStatusEnum, + * this enum contains the known values that the service supports. + * ### Known values supported by the service + * **Allowed**: Allowed flag. \ + * **NotAllowed**: Not Allowed flag. + */ +export type ActionStatusEnum = string; + +/** Describes whether the order item is returnable or not. */ +export enum KnownOrderItemReturnEnum { + /** Order item can be returned without fee. */ + Returnable = "Returnable", + /** Order item can be returned with fee. */ + ReturnableWithFee = "ReturnableWithFee", + /** Order item not returnable. */ + NotReturnable = "NotReturnable", +} + +/** + * Describes whether the order item is returnable or not. \ + * {@link KnownOrderItemReturnEnum} can be used interchangeably with OrderItemReturnEnum, + * this enum contains the known values that the service supports. + * ### Known values supported by the service + * **Returnable**: Order item can be returned without fee. \ + * **ReturnableWithFee**: Order item can be returned with fee. \ + * **NotReturnable**: Order item not returnable. + */ +export type OrderItemReturnEnum = string; + +export function resourceProviderDetailsArrayDeserializer( + result: Array, +): any[] { + return result.map((item) => { + return resourceProviderDetailsDeserializer(item); + }); +} + +/** Management RP details. */ +export interface ResourceProviderDetails { + /** Resource provider namespace. */ + readonly resourceProviderNamespace?: string; +} + +export function resourceProviderDetailsDeserializer(item: any): ResourceProviderDetails { + return { + resourceProviderNamespace: item["resourceProviderNamespace"], + }; +} + +/** Address details for an order item. */ +export interface AddressDetails { + /** Customer address and contact details. */ + forwardAddress: AddressProperties; + /** Return shipping address. */ + readonly returnAddress?: AddressProperties; +} + +export function addressDetailsSerializer(item: AddressDetails): any { + return { + forwardAddress: addressPropertiesSerializer(item["forwardAddress"]), + }; +} + +export function addressDetailsDeserializer(item: any): AddressDetails { + return { + forwardAddress: addressPropertiesDeserializer(item["forwardAddress"]), + returnAddress: !item["returnAddress"] + ? item["returnAddress"] + : addressPropertiesDeserializer(item["returnAddress"]), + }; +} + +/** Msi identity details of the resource */ +export interface ResourceIdentity { + /** Identity type */ + type?: string; + /** Service Principal Id backing the Msi */ + readonly principalId?: string; + /** Home Tenant Id */ + readonly tenantId?: string; + /** User Assigned Identities */ + userAssignedIdentities?: Record; +} + +export function resourceIdentitySerializer(item: ResourceIdentity): any { + return { + type: item["type"], + userAssignedIdentities: item["userAssignedIdentities"], + }; +} + +export function resourceIdentityDeserializer(item: any): ResourceIdentity { + return { + type: item["type"], + principalId: item["principalId"], + tenantId: item["tenantId"], + userAssignedIdentities: item["userAssignedIdentities"], + }; +} + +/** User assigned identity properties */ +export interface UserAssignedIdentity { + /** The principal ID of the assigned identity. */ + readonly principalId?: string; + /** The client ID of the assigned identity. */ + readonly clientId?: string; +} + +export function userAssignedIdentitySerializer(item: UserAssignedIdentity): any { + return item; +} + +export function userAssignedIdentityDeserializer(item: any): UserAssignedIdentity { + return { + principalId: item["principalId"], + clientId: item["clientId"], + }; +} + +/** Updates order item parameters. */ +export interface OrderItemUpdateParameter { + /** Order item update properties. */ + properties?: OrderItemUpdateProperties; + /** The list of key value pairs that describe the resource. These tags can be used in viewing and grouping this resource (across resource groups). */ + tags?: Record; + /** Msi identity of the resource */ + identity?: ResourceIdentity; +} + +export function orderItemUpdateParameterSerializer(item: OrderItemUpdateParameter): any { + return { + properties: !item["properties"] + ? item["properties"] + : orderItemUpdatePropertiesSerializer(item["properties"]), + tags: item["tags"], + identity: !item["identity"] ? item["identity"] : resourceIdentitySerializer(item["identity"]), + }; +} + +/** Order item update properties. */ +export interface OrderItemUpdateProperties { + /** Updates forward shipping address and contact details. */ + forwardAddress?: AddressProperties; + /** Customer preference. */ + preferences?: Preferences; + /** Additional notification email list. */ + notificationEmailList?: string[]; + /** Represents order item details. */ + orderItemDetails?: OrderItemDetailsUpdateParameter; +} + +export function orderItemUpdatePropertiesSerializer(item: OrderItemUpdateProperties): any { + return { + forwardAddress: !item["forwardAddress"] + ? item["forwardAddress"] + : addressPropertiesSerializer(item["forwardAddress"]), + preferences: !item["preferences"] + ? item["preferences"] + : preferencesSerializer(item["preferences"]), + notificationEmailList: !item["notificationEmailList"] + ? item["notificationEmailList"] + : item["notificationEmailList"].map((p: any) => { + return p; + }), + orderItemDetails: !item["orderItemDetails"] + ? item["orderItemDetails"] + : orderItemDetailsUpdateParameterSerializer(item["orderItemDetails"]), + }; +} + +/** Order item details Patchable Properties. */ +export interface OrderItemDetailsUpdateParameter { + /** Represents product details. */ + productDetails?: ProductDetailsUpdateParameter; + /** Site Related Details. */ + siteDetails?: SiteDetails; +} + +export function orderItemDetailsUpdateParameterSerializer( + item: OrderItemDetailsUpdateParameter, +): any { + return { + productDetails: !item["productDetails"] + ? item["productDetails"] + : productDetailsUpdateParameterSerializer(item["productDetails"]), + siteDetails: !item["siteDetails"] + ? item["siteDetails"] + : siteDetailsSerializer(item["siteDetails"]), + }; +} + +/** Represents product details patchable properties. */ +export interface ProductDetailsUpdateParameter { + /** Device Provisioning Details for Parent. */ + parentProvisioningDetails?: ProvisioningDetails; +} + +export function productDetailsUpdateParameterSerializer(item: ProductDetailsUpdateParameter): any { + return { + parentProvisioningDetails: !item["parentProvisioningDetails"] + ? item["parentProvisioningDetails"] + : provisioningDetailsSerializer(item["parentProvisioningDetails"]), + }; +} + +/** List of order items. */ +export interface _OrderItemResourceList { + /** The OrderItemResource items on this page */ + readonly value: OrderItemResource[]; + /** The link to the next page of items */ + nextLink?: string; +} + +export function _orderItemResourceListDeserializer(item: any): _OrderItemResourceList { + return { + value: orderItemResourceArrayDeserializer(item["value"]), + nextLink: item["nextLink"], + }; +} + +export function orderItemResourceArraySerializer(result: Array): any[] { + return result.map((item) => { + return orderItemResourceSerializer(item); + }); +} + +export function orderItemResourceArrayDeserializer(result: Array): any[] { + return result.map((item) => { + return orderItemResourceDeserializer(item); + }); +} + +/** Reason for cancellation. */ +export interface CancellationReason { + /** Reason for cancellation. */ + reason: string; +} + +export function cancellationReasonSerializer(item: CancellationReason): any { + return { reason: item["reason"] }; +} + +/** Return order item request body. */ +export interface ReturnOrderItemDetails { + /** Customer return address. */ + returnAddress?: AddressProperties; + /** Return Reason. */ + returnReason: string; + /** Service tag (located on the bottom-right corner of the device). */ + serviceTag?: string; + /** Shipping Box required. */ + shippingBoxRequired?: boolean; +} + +export function returnOrderItemDetailsSerializer(item: ReturnOrderItemDetails): any { + return { + returnAddress: !item["returnAddress"] + ? item["returnAddress"] + : addressPropertiesSerializer(item["returnAddress"]), + returnReason: item["returnReason"], + serviceTag: item["serviceTag"], + shippingBoxRequired: item["shippingBoxRequired"], + }; +} + +/** The request has succeeded. */ +export interface OkResponse {} + +export function okResponseDeserializer(item: any): OkResponse { + return item; +} + +/** Specifies the properties or parameters for an order. Order is a grouping of one or more order items. */ +export interface OrderResource extends ProxyResource { + /** Order properties. */ + properties: OrderProperties; +} + +export function orderResourceDeserializer(item: any): OrderResource { + return { + id: item["id"], + name: item["name"], + type: item["type"], + systemData: !item["systemData"] + ? item["systemData"] + : systemDataDeserializer(item["systemData"]), + properties: orderPropertiesDeserializer(item["properties"]), + }; +} + +/** Represents order details. */ +export interface OrderProperties { + /** List of order item ARM Ids which are part of an order. */ + readonly orderItemIds?: string[]; + /** Order current status. */ + readonly currentStage?: StageDetails; + /** Order status history. */ + readonly orderStageHistory?: StageDetails[]; + /** Order mode. */ + readonly orderMode?: OrderMode; +} + +export function orderPropertiesDeserializer(item: any): OrderProperties { + return { + orderItemIds: !item["orderItemIds"] + ? item["orderItemIds"] + : item["orderItemIds"].map((p: any) => { + return p; + }), + currentStage: !item["currentStage"] + ? item["currentStage"] + : stageDetailsDeserializer(item["currentStage"]), + orderStageHistory: !item["orderStageHistory"] + ? item["orderStageHistory"] + : stageDetailsArrayDeserializer(item["orderStageHistory"]), + orderMode: item["orderMode"], + }; +} + +/** The resource model definition for a Azure Resource Manager proxy resource. It will not have tags and a location */ +export interface ProxyResource extends Resource {} + +export function proxyResourceDeserializer(item: any): ProxyResource { + return { + id: item["id"], + name: item["name"], + type: item["type"], + systemData: !item["systemData"] + ? item["systemData"] + : systemDataDeserializer(item["systemData"]), + }; +} + +/** Configuration request object. */ +export interface ConfigurationsRequest { + /** Holds details about product hierarchy information and filterable property. */ + configurationFilter?: ConfigurationFilter; + /** Customer subscription properties. Clients can display available products to unregistered customers by explicitly passing subscription details. */ + customerSubscriptionDetails?: CustomerSubscriptionDetails; +} + +export function configurationsRequestSerializer(item: ConfigurationsRequest): any { + return { + configurationFilter: !item["configurationFilter"] + ? item["configurationFilter"] + : configurationFilterSerializer(item["configurationFilter"]), + customerSubscriptionDetails: !item["customerSubscriptionDetails"] + ? item["customerSubscriptionDetails"] + : customerSubscriptionDetailsSerializer(item["customerSubscriptionDetails"]), + }; +} + +/** Configuration filters. */ +export interface ConfigurationFilter { + /** Product hierarchy information. */ + hierarchyInformation: HierarchyInformation; + /** Filters specific to product. */ + filterableProperty?: FilterableProperty[]; + /** Filter to fetch specific child configurations that exist in the configuration. This must be passed to either fetch a list of specific child configurations, or all child configurations of specific types of child configurations. */ + childConfigurationFilter?: ChildConfigurationFilter; +} + +export function configurationFilterSerializer(item: ConfigurationFilter): any { + return { + hierarchyInformation: hierarchyInformationSerializer(item["hierarchyInformation"]), + filterableProperty: !item["filterableProperty"] + ? item["filterableProperty"] + : filterablePropertyArraySerializer(item["filterableProperty"]), + childConfigurationFilter: !item["childConfigurationFilter"] + ? item["childConfigurationFilter"] + : childConfigurationFilterSerializer(item["childConfigurationFilter"]), + }; +} + +export function filterablePropertyArraySerializer(result: Array): any[] { + return result.map((item) => { + return filterablePropertySerializer(item); + }); +} + +export function filterablePropertyArrayDeserializer(result: Array): any[] { + return result.map((item) => { + return filterablePropertyDeserializer(item); + }); +} + +/** Different types of filters supported and its values. */ +export interface FilterableProperty { + /** Type of product filter. */ + type: SupportedFilterTypes; + /** Values to be filtered. */ + supportedValues: string[]; +} + +export function filterablePropertySerializer(item: FilterableProperty): any { + return { + type: item["type"], + supportedValues: item["supportedValues"].map((p: any) => { + return p; + }), + }; +} + +export function filterablePropertyDeserializer(item: any): FilterableProperty { + return { + type: item["type"], + supportedValues: item["supportedValues"].map((p: any) => { + return p; + }), + }; +} + +/** Type of product filter. */ +export enum KnownSupportedFilterTypes { + /** Ship to country. */ + ShipToCountries = "ShipToCountries", + /** Double encryption status. */ + DoubleEncryptionStatus = "DoubleEncryptionStatus", +} + +/** + * Type of product filter. \ + * {@link KnownSupportedFilterTypes} can be used interchangeably with SupportedFilterTypes, + * this enum contains the known values that the service supports. + * ### Known values supported by the service + * **ShipToCountries**: Ship to country. \ + * **DoubleEncryptionStatus**: Double encryption status. + */ +export type SupportedFilterTypes = string; + +/** Child configuration filter. */ +export interface ChildConfigurationFilter { + /** The list of child configuration hierarchy customer wants to filter for the given configuration. */ + hierarchyInformations?: HierarchyInformation[]; + /** Filter to fetch all child configurations belonging to the given list of configuration types. */ + childConfigurationTypes?: ChildConfigurationType[]; +} + +export function childConfigurationFilterSerializer(item: ChildConfigurationFilter): any { + return { + hierarchyInformations: !item["hierarchyInformations"] + ? item["hierarchyInformations"] + : hierarchyInformationArraySerializer(item["hierarchyInformations"]), + childConfigurationTypes: !item["childConfigurationTypes"] + ? item["childConfigurationTypes"] + : item["childConfigurationTypes"].map((p: any) => { + return p; + }), + }; +} + +export function hierarchyInformationArraySerializer(result: Array): any[] { + return result.map((item) => { + return hierarchyInformationSerializer(item); + }); +} + +export function hierarchyInformationArrayDeserializer(result: Array): any[] { + return result.map((item) => { + return hierarchyInformationDeserializer(item); + }); +} + +/** Known values of {@link ChildConfigurationType} that the service accepts. */ +export enum KnownChildConfigurationType { + /** Child configuration is a device configuration. */ + DeviceConfiguration = "DeviceConfiguration", + /** Child configuration is an additional configuration. */ + AdditionalConfiguration = "AdditionalConfiguration", +} + +/** Type of ChildConfigurationType */ +export type ChildConfigurationType = string; + +/** Holds Customer subscription details. Clients can display available products to unregistered customers by explicitly passing subscription details. */ +export interface CustomerSubscriptionDetails { + /** List of registered feature flags for subscription. */ + registeredFeatures?: CustomerSubscriptionRegisteredFeatures[]; + /** Location placement Id of a subscription. */ + locationPlacementId?: string; + /** Quota ID of a subscription. */ + quotaId: string; +} + +export function customerSubscriptionDetailsSerializer(item: CustomerSubscriptionDetails): any { + return { + registeredFeatures: !item["registeredFeatures"] + ? item["registeredFeatures"] + : customerSubscriptionRegisteredFeaturesArraySerializer(item["registeredFeatures"]), + locationPlacementId: item["locationPlacementId"], + quotaId: item["quotaId"], + }; +} + +export function customerSubscriptionRegisteredFeaturesArraySerializer( + result: Array, +): any[] { + return result.map((item) => { + return customerSubscriptionRegisteredFeaturesSerializer(item); + }); +} + +/** Represents subscription registered features. */ +export interface CustomerSubscriptionRegisteredFeatures { + /** Name of subscription registered feature. */ + name?: string; + /** State of subscription registered feature. */ + state?: string; +} + +export function customerSubscriptionRegisteredFeaturesSerializer( + item: CustomerSubscriptionRegisteredFeatures, +): any { + return { name: item["name"], state: item["state"] }; +} + +/** The list of configurations. */ +export interface _Configurations { + /** The Configuration items on this page */ + readonly value: Configuration[]; + /** The link to the next page of items */ + nextLink?: string; +} + +export function _configurationsDeserializer(item: any): _Configurations { + return { + value: configurationArrayDeserializer(item["value"]), + nextLink: item["nextLink"], + }; +} + +export function configurationArrayDeserializer(result: Array): any[] { + return result.map((item) => { + return configurationDeserializer(item); + }); +} + +/** Configuration object. */ +export interface Configuration { + /** Properties of configuration. */ + readonly properties?: ConfigurationProperties; +} + +export function configurationDeserializer(item: any): Configuration { + return { + properties: !item["properties"] + ? item["properties"] + : configurationPropertiesDeserializer(item["properties"]), + }; +} + +/** Properties of configuration. */ +export interface ConfigurationProperties extends CommonProperties { + /** Specifications of the configuration. */ + readonly specifications?: Specification[]; + /** Dimensions of the configuration. */ + readonly dimensions?: Dimensions; + /** Determining nature of provisioning that the configuration supports. */ + readonly provisioningSupport?: ProvisioningSupport; + /** Different types of child configurations which exist for this configuration, these can be used to populate the child configuration filter. */ + readonly childConfigurationTypes?: ChildConfigurationType[]; + /** Child configurations present for the configuration after applying child configuration filter, grouped by the category name of the child configuration. */ + readonly groupedChildConfigurations?: GroupedChildConfigurations[]; + /** The Term Commitment Durations that are supported for a configuration. */ + readonly supportedTermCommitmentDurations?: string[]; +} + +export function configurationPropertiesDeserializer(item: any): ConfigurationProperties { + return { + filterableProperties: !item["filterableProperties"] + ? item["filterableProperties"] + : filterablePropertyArrayDeserializer(item["filterableProperties"]), + displayName: item["displayName"], + description: !item["description"] + ? item["description"] + : descriptionDeserializer(item["description"]), + imageInformation: !item["imageInformation"] + ? item["imageInformation"] + : imageInformationArrayDeserializer(item["imageInformation"]), + costInformation: !item["costInformation"] + ? item["costInformation"] + : costInformationDeserializer(item["costInformation"]), + availabilityInformation: !item["availabilityInformation"] + ? item["availabilityInformation"] + : availabilityInformationDeserializer(item["availabilityInformation"]), + hierarchyInformation: !item["hierarchyInformation"] + ? item["hierarchyInformation"] + : hierarchyInformationDeserializer(item["hierarchyInformation"]), + fulfilledBy: item["fulfilledBy"], + specifications: !item["specifications"] + ? item["specifications"] + : specificationArrayDeserializer(item["specifications"]), + dimensions: !item["dimensions"] + ? item["dimensions"] + : dimensionsDeserializer(item["dimensions"]), + provisioningSupport: item["provisioningSupport"], + childConfigurationTypes: !item["childConfigurationTypes"] + ? item["childConfigurationTypes"] + : item["childConfigurationTypes"].map((p: any) => { + return p; + }), + groupedChildConfigurations: !item["groupedChildConfigurations"] + ? item["groupedChildConfigurations"] + : groupedChildConfigurationsArrayDeserializer(item["groupedChildConfigurations"]), + supportedTermCommitmentDurations: !item["supportedTermCommitmentDurations"] + ? item["supportedTermCommitmentDurations"] + : item["supportedTermCommitmentDurations"].map((p: any) => { + return p; + }), + }; +} + +export function specificationArrayDeserializer(result: Array): any[] { + return result.map((item) => { + return specificationDeserializer(item); + }); +} + +/** Specification of the configurations. */ +export interface Specification { + /** Name of the specification. */ + readonly name?: string; + /** Value of the specification. */ + readonly value?: string; +} + +export function specificationDeserializer(item: any): Specification { + return { + name: item["name"], + value: item["value"], + }; +} + +/** Dimensions of a configuration. */ +export interface Dimensions { + /** Length of the device. */ + readonly length?: number; + /** Height of the device. */ + readonly height?: number; + /** Width of the device. */ + readonly width?: number; + /** Unit for the dimensions of length, height and width. */ + readonly lengthHeightUnit?: LengthHeightUnit; + /** Weight of the device. */ + readonly weight?: number; + /** Depth of the device. */ + readonly depth?: number; + /** Unit for the dimensions of weight. */ + readonly weightUnit?: WeightMeasurementUnit; +} + +export function dimensionsDeserializer(item: any): Dimensions { + return { + length: item["length"], + height: item["height"], + width: item["width"], + lengthHeightUnit: item["lengthHeightUnit"], + weight: item["weight"], + depth: item["depth"], + weightUnit: item["weightUnit"], + }; +} + +/** Unit for the dimensions of length, height and width. */ +export enum KnownLengthHeightUnit { + /** Inch, applicable for West US. */ + IN = "IN", + /** Centimeter. */ + CM = "CM", +} + +/** + * Unit for the dimensions of length, height and width. \ + * {@link KnownLengthHeightUnit} can be used interchangeably with LengthHeightUnit, + * this enum contains the known values that the service supports. + * ### Known values supported by the service + * **IN**: Inch, applicable for West US. \ + * **CM**: Centimeter. + */ +export type LengthHeightUnit = string; + +/** Unit for the dimensions of weight. */ +export enum KnownWeightMeasurementUnit { + /** Pounds. */ + LBS = "LBS", + /** Kilograms. */ + KGS = "KGS", +} + +/** + * Unit for the dimensions of weight. \ + * {@link KnownWeightMeasurementUnit} can be used interchangeably with WeightMeasurementUnit, + * this enum contains the known values that the service supports. + * ### Known values supported by the service + * **LBS**: Pounds. \ + * **KGS**: Kilograms. + */ +export type WeightMeasurementUnit = string; + +export function groupedChildConfigurationsArrayDeserializer( + result: Array, +): any[] { + return result.map((item) => { + return groupedChildConfigurationsDeserializer(item); + }); +} + +/** Grouped child configuration object. */ +export interface GroupedChildConfigurations { + /** Category information. */ + readonly categoryInformation?: CategoryInformation; + /** List of child configurations. */ + readonly childConfigurations?: ChildConfiguration[]; +} + +export function groupedChildConfigurationsDeserializer(item: any): GroupedChildConfigurations { + return { + categoryInformation: !item["categoryInformation"] + ? item["categoryInformation"] + : categoryInformationDeserializer(item["categoryInformation"]), + childConfigurations: !item["childConfigurations"] + ? item["childConfigurations"] + : childConfigurationArrayDeserializer(item["childConfigurations"]), + }; +} + +/** Category related properties of a child configuration. */ +export interface CategoryInformation { + /** Category name of the child configuration. */ + categoryName?: string; + /** Category display name of the child configuration. */ + categoryDisplayName?: string; + /** Description text for the category. */ + description?: string; + /** Links for the category. */ + links?: Link[]; +} + +export function categoryInformationDeserializer(item: any): CategoryInformation { + return { + categoryName: item["categoryName"], + categoryDisplayName: item["categoryDisplayName"], + description: item["description"], + links: !item["links"] ? item["links"] : linkArrayDeserializer(item["links"]), + }; +} + +export function linkArrayDeserializer(result: Array): any[] { + return result.map((item) => { + return linkDeserializer(item); + }); +} + +/** Returns link related to the product. */ +export interface Link { + /** Type of link. */ + readonly linkType?: LinkType; + /** Url of the link. */ + readonly linkUrl?: string; +} + +export function linkDeserializer(item: any): Link { + return { + linkType: item["linkType"], + linkUrl: item["linkUrl"], + }; +} + +/** Type of link. */ +export enum KnownLinkType { + /** Generic link. */ + Generic = "Generic", + /** Terms and conditions link. */ + TermsAndConditions = "TermsAndConditions", + /** Link to product specification. */ + Specification = "Specification", + /** Link to product documentation. */ + Documentation = "Documentation", + /** Link to know more. */ + KnowMore = "KnowMore", + /** Link to sign up for products. */ + SignUp = "SignUp", + /** Link to order the product from another source and not from Azure Edge Hardware Center. */ + Discoverable = "Discoverable", +} + +/** + * Type of link. \ + * {@link KnownLinkType} can be used interchangeably with LinkType, + * this enum contains the known values that the service supports. + * ### Known values supported by the service + * **Generic**: Generic link. \ + * **TermsAndConditions**: Terms and conditions link. \ + * **Specification**: Link to product specification. \ + * **Documentation**: Link to product documentation. \ + * **KnowMore**: Link to know more. \ + * **SignUp**: Link to sign up for products. \ + * **Discoverable**: Link to order the product from another source and not from Azure Edge Hardware Center. + */ +export type LinkType = string; + +export function childConfigurationArrayDeserializer(result: Array): any[] { + return result.map((item) => { + return childConfigurationDeserializer(item); + }); +} + +/** Child configuration object. */ +export interface ChildConfiguration { + /** Properties of child configuration. */ + readonly properties?: ChildConfigurationProperties; +} + +export function childConfigurationDeserializer(item: any): ChildConfiguration { + return { + properties: !item["properties"] + ? item["properties"] + : childConfigurationPropertiesDeserializer(item["properties"]), + }; +} + +/** Properties of child configuration. */ +export interface ChildConfigurationProperties { + /** Child configuration type. */ + readonly childConfigurationType?: ChildConfigurationType; + /** Flag to indicate if the child configuration is part of the base configuration, which means the customer need not pass this configuration in OptInAdditionalConfigurations while placing an order, it will be shipped by default. */ + readonly isPartOfBaseConfiguration?: boolean; + /** Minimum quantity a customer can order while choosing this configuration. */ + readonly minimumQuantity?: number; + /** Maximum quantity a customer can order while choosing this configuration. */ + readonly maximumQuantity?: number; + /** Specifications of the configuration. */ + readonly specifications?: Specification[]; + /** Dimensions of the configuration. */ + readonly dimensions?: Dimensions; + /** Determining nature of provisioning that the configuration supports. */ + readonly provisioningSupport?: ProvisioningSupport; + /** Different types of child configurations which exist for this configuration, these can be used to populate the child configuration filter. */ + readonly childConfigurationTypes?: ChildConfigurationType[]; + /** Child configurations present for the configuration after applying child configuration filter, grouped by the category name of the child configuration. */ + readonly groupedChildConfigurations?: GroupedChildConfigurations[]; + /** The Term Commitment Durations that are supported for a configuration. */ + readonly supportedTermCommitmentDurations?: string[]; + /** List of filters supported for a product. */ + readonly filterableProperties?: FilterableProperty[]; + /** Display Name for the product system. */ + readonly displayName?: string; + /** Description related to the product system. */ + readonly description?: Description; + /** Image information for the product system. */ + readonly imageInformation?: ImageInformation[]; + /** Cost information for the product system. */ + readonly costInformation?: CostInformation; + /** Availability information of the product system. */ + readonly availabilityInformation?: AvailabilityInformation; + /** Hierarchy information of a product. */ + readonly hierarchyInformation?: HierarchyInformation; + /** The entity responsible for fulfillment of the item at the given hierarchy level. */ + readonly fulfilledBy?: FulfillmentType; +} + +export function childConfigurationPropertiesDeserializer(item: any): ChildConfigurationProperties { + return { + childConfigurationType: item["childConfigurationType"], + isPartOfBaseConfiguration: item["isPartOfBaseConfiguration"], + minimumQuantity: item["minimumQuantity"], + maximumQuantity: item["maximumQuantity"], + specifications: !item["specifications"] + ? item["specifications"] + : specificationArrayDeserializer(item["specifications"]), + dimensions: !item["dimensions"] + ? item["dimensions"] + : dimensionsDeserializer(item["dimensions"]), + provisioningSupport: item["provisioningSupport"], + childConfigurationTypes: !item["childConfigurationTypes"] + ? item["childConfigurationTypes"] + : item["childConfigurationTypes"].map((p: any) => { + return p; + }), + groupedChildConfigurations: !item["groupedChildConfigurations"] + ? item["groupedChildConfigurations"] + : groupedChildConfigurationsArrayDeserializer(item["groupedChildConfigurations"]), + supportedTermCommitmentDurations: !item["supportedTermCommitmentDurations"] + ? item["supportedTermCommitmentDurations"] + : item["supportedTermCommitmentDurations"].map((p: any) => { + return p; + }), + filterableProperties: !item["filterableProperties"] + ? item["filterableProperties"] + : filterablePropertyArrayDeserializer(item["filterableProperties"]), + displayName: item["displayName"], + description: !item["description"] + ? item["description"] + : descriptionDeserializer(item["description"]), + imageInformation: !item["imageInformation"] + ? item["imageInformation"] + : imageInformationArrayDeserializer(item["imageInformation"]), + costInformation: !item["costInformation"] + ? item["costInformation"] + : costInformationDeserializer(item["costInformation"]), + availabilityInformation: !item["availabilityInformation"] + ? item["availabilityInformation"] + : availabilityInformationDeserializer(item["availabilityInformation"]), + hierarchyInformation: !item["hierarchyInformation"] + ? item["hierarchyInformation"] + : hierarchyInformationDeserializer(item["hierarchyInformation"]), + fulfilledBy: item["fulfilledBy"], + }; +} + +/** Description related properties of a product system. */ +export interface Description { + /** Type of description. */ + readonly descriptionType?: DescriptionType; + /** Short description of the product system. */ + readonly shortDescription?: string; + /** Long description of the product system. */ + readonly longDescription?: string; + /** Keywords for the product system. */ + readonly keywords?: string[]; + /** Attributes for the product system. */ + readonly attributes?: string[]; + /** Links for the product system. */ + readonly links?: Link[]; +} + +export function descriptionDeserializer(item: any): Description { + return { + descriptionType: item["descriptionType"], + shortDescription: item["shortDescription"], + longDescription: item["longDescription"], + keywords: !item["keywords"] + ? item["keywords"] + : item["keywords"].map((p: any) => { + return p; + }), + attributes: !item["attributes"] + ? item["attributes"] + : item["attributes"].map((p: any) => { + return p; + }), + links: !item["links"] ? item["links"] : linkArrayDeserializer(item["links"]), + }; +} + +/** Type of description. */ +export enum KnownDescriptionType { + /** Base description. */ + Base = "Base", +} + +/** + * Type of description. \ + * {@link KnownDescriptionType} can be used interchangeably with DescriptionType, + * this enum contains the known values that the service supports. + * ### Known values supported by the service + * **Base**: Base description. + */ +export type DescriptionType = string; + +export function imageInformationArrayDeserializer(result: Array): any[] { + return result.map((item) => { + return imageInformationDeserializer(item); + }); +} + +/** Image for the product. */ +export interface ImageInformation { + /** Type of the image. */ + readonly imageType?: ImageType; + /** Url of the image. */ + readonly imageUrl?: string; +} + +export function imageInformationDeserializer(item: any): ImageInformation { + return { + imageType: item["imageType"], + imageUrl: item["imageUrl"], + }; +} + +/** Type of the image. */ +export enum KnownImageType { + /** Main image. */ + MainImage = "MainImage", + /** Bullet image. */ + BulletImage = "BulletImage", + /** Generic image. */ + GenericImage = "GenericImage", +} + +/** + * Type of the image. \ + * {@link KnownImageType} can be used interchangeably with ImageType, + * this enum contains the known values that the service supports. + * ### Known values supported by the service + * **MainImage**: Main image. \ + * **BulletImage**: Bullet image. \ + * **GenericImage**: Generic image. + */ +export type ImageType = string; + +/** Cost information for the product system. */ +export interface CostInformation { + /** Details on the various billing aspects for the product system. */ + readonly billingMeterDetails?: BillingMeterDetails[]; + /** Default url to display billing information. */ + readonly billingInfoUrl?: string; +} + +export function costInformationDeserializer(item: any): CostInformation { + return { + billingMeterDetails: !item["billingMeterDetails"] + ? item["billingMeterDetails"] + : billingMeterDetailsArrayDeserializer(item["billingMeterDetails"]), + billingInfoUrl: item["billingInfoUrl"], + }; +} + +export function billingMeterDetailsArrayDeserializer(result: Array): any[] { + return result.map((item) => { + return billingMeterDetailsDeserializer(item); + }); +} + +/** Holds billing meter details for each type of billing. */ +export interface BillingMeterDetails { + /** Represents Billing type name. */ + readonly name?: string; + /** Represents MeterDetails. */ + readonly meterDetails?: MeterDetailsUnion; + /** Represents Metering type (eg one-time or recurrent). */ + readonly meteringType?: MeteringType; + /** Frequency of recurrence. */ + readonly frequency?: string; + /** Represent Term Type details. */ + readonly termTypeDetails?: TermTypeDetails; +} + +export function billingMeterDetailsDeserializer(item: any): BillingMeterDetails { + return { + name: item["name"], + meterDetails: !item["meterDetails"] + ? item["meterDetails"] + : meterDetailsUnionDeserializer(item["meterDetails"]), + meteringType: item["meteringType"], + frequency: item["frequency"], + termTypeDetails: !item["termTypeDetails"] + ? item["termTypeDetails"] + : termTypeDetailsDeserializer(item["termTypeDetails"]), + }; +} + +/** Holds details about billing type and its meter guids. */ +export interface MeterDetails { + /** Represents billing type. */ + /** The discriminator possible values: Pav2, Purchase */ + billingType: BillingType; + /** Billing unit applicable for Pav2 billing. */ + readonly multiplier?: number; + /** Charging type. */ + readonly chargingType?: ChargingType; +} + +export function meterDetailsDeserializer(item: any): MeterDetails { + return { + billingType: item["billingType"], + multiplier: item["multiplier"], + chargingType: item["chargingType"], + }; +} + +/** Alias for MeterDetailsUnion */ +export type MeterDetailsUnion = Pav2MeterDetails | PurchaseMeterDetails | MeterDetails; + +export function meterDetailsUnionDeserializer(item: any): MeterDetailsUnion { + switch (item.billingType) { + case "Pav2": + return pav2MeterDetailsDeserializer(item as Pav2MeterDetails); + + case "Purchase": + return purchaseMeterDetailsDeserializer(item as PurchaseMeterDetails); + + default: + return meterDetailsDeserializer(item); + } +} + +/** Represents billing type. */ +export enum KnownBillingType { + /** PaV2 billing. */ + Pav2 = "Pav2", + /** Purchase billing. */ + Purchase = "Purchase", +} + +/** + * Represents billing type. \ + * {@link KnownBillingType} can be used interchangeably with BillingType, + * this enum contains the known values that the service supports. + * ### Known values supported by the service + * **Pav2**: PaV2 billing. \ + * **Purchase**: Purchase billing. + */ +export type BillingType = string; + +/** Charging type. */ +export enum KnownChargingType { + /** Per order charging type. */ + PerOrder = "PerOrder", + /** Per device charging type. */ + PerDevice = "PerDevice", +} + +/** + * Charging type. \ + * {@link KnownChargingType} can be used interchangeably with ChargingType, + * this enum contains the known values that the service supports. + * ### Known values supported by the service + * **PerOrder**: Per order charging type. \ + * **PerDevice**: Per device charging type. + */ +export type ChargingType = string; + +/** Billing type PAV2 meter details. */ +export interface Pav2MeterDetails extends MeterDetails { + /** Validation status of requested data center and transport. */ + readonly meterGuid?: string; + /** Represents billing type. */ + billingType: "Pav2"; +} + +export function pav2MeterDetailsDeserializer(item: any): Pav2MeterDetails { + return { + billingType: item["billingType"], + multiplier: item["multiplier"], + chargingType: item["chargingType"], + meterGuid: item["meterGuid"], + }; +} + +/** Billing type Purchase meter details. */ +export interface PurchaseMeterDetails extends MeterDetails { + /** Product Id. */ + readonly productId?: string; + /** Sku Id. */ + readonly skuId?: string; + /** Term Id. */ + readonly termId?: string; + /** Represents billing type. */ + billingType: "Purchase"; +} + +export function purchaseMeterDetailsDeserializer(item: any): PurchaseMeterDetails { + return { + billingType: item["billingType"], + multiplier: item["multiplier"], + chargingType: item["chargingType"], + productId: item["productId"], + skuId: item["skuId"], + termId: item["termId"], + }; +} + +/** Represents Metering type (eg one-time or recurrent). */ +export enum KnownMeteringType { + /** One time billing. */ + OneTime = "OneTime", + /** Recurring billing. */ + Recurring = "Recurring", + /** Adhoc billing. */ + Adhoc = "Adhoc", +} + +/** + * Represents Metering type (eg one-time or recurrent). \ + * {@link KnownMeteringType} can be used interchangeably with MeteringType, + * this enum contains the known values that the service supports. + * ### Known values supported by the service + * **OneTime**: One time billing. \ + * **Recurring**: Recurring billing. \ + * **Adhoc**: Adhoc billing. + */ +export type MeteringType = string; + +/** Holds details about term type and duration. */ +export interface TermTypeDetails { + /** Term Commitment Type */ + termType: TermCommitmentType; + /** Duration for the term type. */ + termTypeDuration: string; +} + +export function termTypeDetailsDeserializer(item: any): TermTypeDetails { + return { + termType: item["termType"], + termTypeDuration: item["termTypeDuration"], + }; +} + +/** Availability information of a product system. */ +export interface AvailabilityInformation { + /** Current availability stage of the product. */ + readonly availabilityStage?: AvailabilityStage; + /** Reason why the product is disabled. */ + readonly disabledReason?: DisabledReason; + /** Message for why the product is disabled. */ + readonly disabledReasonMessage?: string; +} + +export function availabilityInformationDeserializer(item: any): AvailabilityInformation { + return { + availabilityStage: item["availabilityStage"], + disabledReason: item["disabledReason"], + disabledReasonMessage: item["disabledReasonMessage"], + }; +} + +/** Current availability stage of the product. */ +export enum KnownAvailabilityStage { + /** Product is available. */ + Available = "Available", + /** Product is in preview. */ + Preview = "Preview", + /** Product is available only on signup. */ + Signup = "Signup", + /** Product is not available in our service but can be discovered from other sources. */ + Discoverable = "Discoverable", + /** Product is coming soon. */ + ComingSoon = "ComingSoon", + /** Product is not available. */ + Unavailable = "Unavailable", + /** Product is deprecated. */ + Deprecated = "Deprecated", +} + +/** + * Current availability stage of the product. \ + * {@link KnownAvailabilityStage} can be used interchangeably with AvailabilityStage, + * this enum contains the known values that the service supports. + * ### Known values supported by the service + * **Available**: Product is available. \ + * **Preview**: Product is in preview. \ + * **Signup**: Product is available only on signup. \ + * **Discoverable**: Product is not available in our service but can be discovered from other sources. \ + * **ComingSoon**: Product is coming soon. \ + * **Unavailable**: Product is not available. \ + * **Deprecated**: Product is deprecated. + */ +export type AvailabilityStage = string; + +/** Reason why the product is disabled. */ +export enum KnownDisabledReason { + /** Not disabled. */ + None = "None", + /** Not available in the requested country. */ + Country = "Country", + /** Not available to push data to the requested Azure region. */ + Region = "Region", + /** Required features are not enabled. */ + Feature = "Feature", + /** Subscription does not have required offer types. */ + OfferType = "OfferType", + /** Subscription has not registered to Microsoft.DataBox and Service does not have the subscription notification. */ + NoSubscriptionInfo = "NoSubscriptionInfo", + /** The product is not yet available. */ + NotAvailable = "NotAvailable", + /** The product is out of stock. */ + OutOfStock = "OutOfStock", +} + +/** + * Reason why the product is disabled. \ + * {@link KnownDisabledReason} can be used interchangeably with DisabledReason, + * this enum contains the known values that the service supports. + * ### Known values supported by the service + * **None**: Not disabled. \ + * **Country**: Not available in the requested country. \ + * **Region**: Not available to push data to the requested Azure region. \ + * **Feature**: Required features are not enabled. \ + * **OfferType**: Subscription does not have required offer types. \ + * **NoSubscriptionInfo**: Subscription has not registered to Microsoft.DataBox and Service does not have the subscription notification. \ + * **NotAvailable**: The product is not yet available. \ + * **OutOfStock**: The product is out of stock. + */ +export type DisabledReason = string; + +/** The entity responsible for fulfillment of the item at the given hierarchy level. */ +export enum KnownFulfillmentType { + /** The fulfillment (the whole journey of the product offering) is handled by microsoft. */ + Microsoft = "Microsoft", + /** The fulfillment (the whole journey of the product offering) is handled by external third party entities. */ + External = "External", +} + +/** + * The entity responsible for fulfillment of the item at the given hierarchy level. \ + * {@link KnownFulfillmentType} can be used interchangeably with FulfillmentType, + * this enum contains the known values that the service supports. + * ### Known values supported by the service + * **Microsoft**: The fulfillment (the whole journey of the product offering) is handled by microsoft. \ + * **External**: The fulfillment (the whole journey of the product offering) is handled by external third party entities. + */ +export type FulfillmentType = string; + +/** Represents common properties across product hierarchy. */ +export interface CommonProperties extends BasicInformation { + /** List of filters supported for a product. */ + readonly filterableProperties?: FilterableProperty[]; +} + +export function commonPropertiesDeserializer(item: any): CommonProperties { + return { + displayName: item["displayName"], + description: !item["description"] + ? item["description"] + : descriptionDeserializer(item["description"]), + imageInformation: !item["imageInformation"] + ? item["imageInformation"] + : imageInformationArrayDeserializer(item["imageInformation"]), + costInformation: !item["costInformation"] + ? item["costInformation"] + : costInformationDeserializer(item["costInformation"]), + availabilityInformation: !item["availabilityInformation"] + ? item["availabilityInformation"] + : availabilityInformationDeserializer(item["availabilityInformation"]), + hierarchyInformation: !item["hierarchyInformation"] + ? item["hierarchyInformation"] + : hierarchyInformationDeserializer(item["hierarchyInformation"]), + fulfilledBy: item["fulfilledBy"], + filterableProperties: !item["filterableProperties"] + ? item["filterableProperties"] + : filterablePropertyArrayDeserializer(item["filterableProperties"]), + }; +} + +/** Basic information for any product system. */ +export interface BasicInformation { + /** Display Name for the product system. */ + readonly displayName?: string; + /** Description related to the product system. */ + readonly description?: Description; + /** Image information for the product system. */ + readonly imageInformation?: ImageInformation[]; + /** Cost information for the product system. */ + readonly costInformation?: CostInformation; + /** Availability information of the product system. */ + readonly availabilityInformation?: AvailabilityInformation; + /** Hierarchy information of a product. */ + readonly hierarchyInformation?: HierarchyInformation; + /** The entity responsible for fulfillment of the item at the given hierarchy level. */ + readonly fulfilledBy?: FulfillmentType; +} + +export function basicInformationDeserializer(item: any): BasicInformation { + return { + displayName: item["displayName"], + description: !item["description"] + ? item["description"] + : descriptionDeserializer(item["description"]), + imageInformation: !item["imageInformation"] + ? item["imageInformation"] + : imageInformationArrayDeserializer(item["imageInformation"]), + costInformation: !item["costInformation"] + ? item["costInformation"] + : costInformationDeserializer(item["costInformation"]), + availabilityInformation: !item["availabilityInformation"] + ? item["availabilityInformation"] + : availabilityInformationDeserializer(item["availabilityInformation"]), + hierarchyInformation: !item["hierarchyInformation"] + ? item["hierarchyInformation"] + : hierarchyInformationDeserializer(item["hierarchyInformation"]), + fulfilledBy: item["fulfilledBy"], + }; +} + +/** The filters for showing the product families. */ +export interface ProductFamiliesRequest { + /** Dictionary of filterable properties on product family. */ + filterableProperties: Record; + /** Customer subscription properties. Clients can display available products to unregistered customers by explicitly passing subscription details. */ + customerSubscriptionDetails?: CustomerSubscriptionDetails; +} + +export function productFamiliesRequestSerializer(item: ProductFamiliesRequest): any { + return { + filterableProperties: filterablePropertyArrayRecordSerializer(item["filterableProperties"]), + customerSubscriptionDetails: !item["customerSubscriptionDetails"] + ? item["customerSubscriptionDetails"] + : customerSubscriptionDetailsSerializer(item["customerSubscriptionDetails"]), + }; +} + +export function filterablePropertyArrayRecordSerializer( + item: Record>, +): Record { + const result: Record = {}; + Object.keys(item).map((key) => { + result[key] = !item[key] ? item[key] : filterablePropertyArraySerializer(item[key]); + }); + return result; +} + +export function filterablePropertyArrayRecordDeserializer( + item: Record, +): Record> { + const result: Record = {}; + Object.keys(item).map((key) => { + result[key] = !item[key] ? item[key] : filterablePropertyArrayDeserializer(item[key]); + }); + return result; +} + +/** The list of product families. */ +export interface _ProductFamilies { + /** The ProductFamily items on this page */ + readonly value: ProductFamily[]; + /** The link to the next page of items */ + nextLink?: string; +} + +export function _productFamiliesDeserializer(item: any): _ProductFamilies { + return { + value: productFamilyArrayDeserializer(item["value"]), + nextLink: item["nextLink"], + }; +} + +export function productFamilyArrayDeserializer(result: Array): any[] { + return result.map((item) => { + return productFamilyDeserializer(item); + }); +} + +/** Product Family. */ +export interface ProductFamily { + /** Properties of product family. */ + readonly properties?: ProductFamilyProperties; +} + +export function productFamilyDeserializer(item: any): ProductFamily { + return { + properties: !item["properties"] + ? item["properties"] + : productFamilyPropertiesDeserializer(item["properties"]), + }; +} + +/** Properties of product family. */ +export interface ProductFamilyProperties extends CommonProperties { + /** List of product lines supported in the product family. */ + readonly productLines?: ProductLine[]; + /** Contains details related to resource provider. */ + resourceProviderDetails?: ResourceProviderDetails[]; +} + +export function productFamilyPropertiesDeserializer(item: any): ProductFamilyProperties { + return { + filterableProperties: !item["filterableProperties"] + ? item["filterableProperties"] + : filterablePropertyArrayDeserializer(item["filterableProperties"]), + displayName: item["displayName"], + description: !item["description"] + ? item["description"] + : descriptionDeserializer(item["description"]), + imageInformation: !item["imageInformation"] + ? item["imageInformation"] + : imageInformationArrayDeserializer(item["imageInformation"]), + costInformation: !item["costInformation"] + ? item["costInformation"] + : costInformationDeserializer(item["costInformation"]), + availabilityInformation: !item["availabilityInformation"] + ? item["availabilityInformation"] + : availabilityInformationDeserializer(item["availabilityInformation"]), + hierarchyInformation: !item["hierarchyInformation"] + ? item["hierarchyInformation"] + : hierarchyInformationDeserializer(item["hierarchyInformation"]), + fulfilledBy: item["fulfilledBy"], + productLines: !item["productLines"] + ? item["productLines"] + : productLineArrayDeserializer(item["productLines"]), + resourceProviderDetails: !item["resourceProviderDetails"] + ? item["resourceProviderDetails"] + : resourceProviderDetailsArrayDeserializer(item["resourceProviderDetails"]), + }; +} + +export function productLineArrayDeserializer(result: Array): any[] { + return result.map((item) => { + return productLineDeserializer(item); + }); +} + +/** Product line. */ +export interface ProductLine { + /** Properties of product line. */ + readonly properties?: ProductLineProperties; +} + +export function productLineDeserializer(item: any): ProductLine { + return { + properties: !item["properties"] + ? item["properties"] + : productLinePropertiesDeserializer(item["properties"]), + }; +} + +/** Properties of product line. */ +export interface ProductLineProperties extends CommonProperties { + /** List of products in the product line. */ + readonly products?: Product[]; +} + +export function productLinePropertiesDeserializer(item: any): ProductLineProperties { + return { + filterableProperties: !item["filterableProperties"] + ? item["filterableProperties"] + : filterablePropertyArrayDeserializer(item["filterableProperties"]), + displayName: item["displayName"], + description: !item["description"] + ? item["description"] + : descriptionDeserializer(item["description"]), + imageInformation: !item["imageInformation"] + ? item["imageInformation"] + : imageInformationArrayDeserializer(item["imageInformation"]), + costInformation: !item["costInformation"] + ? item["costInformation"] + : costInformationDeserializer(item["costInformation"]), + availabilityInformation: !item["availabilityInformation"] + ? item["availabilityInformation"] + : availabilityInformationDeserializer(item["availabilityInformation"]), + hierarchyInformation: !item["hierarchyInformation"] + ? item["hierarchyInformation"] + : hierarchyInformationDeserializer(item["hierarchyInformation"]), + fulfilledBy: item["fulfilledBy"], + products: !item["products"] ? item["products"] : productArrayDeserializer(item["products"]), + }; +} + +export function productArrayDeserializer(result: Array): any[] { + return result.map((item) => { + return productDeserializer(item); + }); +} + +/** Represents a product. */ +export interface Product { + /** Properties of product. */ + readonly properties?: ProductProperties; +} + +export function productDeserializer(item: any): Product { + return { + properties: !item["properties"] + ? item["properties"] + : productPropertiesDeserializer(item["properties"]), + }; +} + +/** Properties of product. */ +export interface ProductProperties extends CommonProperties { + /** List of configurations for the product. */ + readonly configurations?: Configuration[]; +} + +export function productPropertiesDeserializer(item: any): ProductProperties { + return { + filterableProperties: !item["filterableProperties"] + ? item["filterableProperties"] + : filterablePropertyArrayDeserializer(item["filterableProperties"]), + displayName: item["displayName"], + description: !item["description"] + ? item["description"] + : descriptionDeserializer(item["description"]), + imageInformation: !item["imageInformation"] + ? item["imageInformation"] + : imageInformationArrayDeserializer(item["imageInformation"]), + costInformation: !item["costInformation"] + ? item["costInformation"] + : costInformationDeserializer(item["costInformation"]), + availabilityInformation: !item["availabilityInformation"] + ? item["availabilityInformation"] + : availabilityInformationDeserializer(item["availabilityInformation"]), + hierarchyInformation: !item["hierarchyInformation"] + ? item["hierarchyInformation"] + : hierarchyInformationDeserializer(item["hierarchyInformation"]), + fulfilledBy: item["fulfilledBy"], + configurations: !item["configurations"] + ? item["configurations"] + : configurationArrayDeserializer(item["configurations"]), + }; +} + +/** Holds details about product family metadata. */ +export interface _ProductFamiliesMetadata { + /** The ProductFamiliesMetadataDetails items on this page */ + readonly value: ProductFamiliesMetadataDetails[]; + /** The link to the next page of items */ + nextLink?: string; +} + +export function _productFamiliesMetadataDeserializer(item: any): _ProductFamiliesMetadata { + return { + value: productFamiliesMetadataDetailsArrayDeserializer(item["value"]), + nextLink: item["nextLink"], + }; +} + +export function productFamiliesMetadataDetailsArrayDeserializer( + result: Array, +): any[] { + return result.map((item) => { + return productFamiliesMetadataDetailsDeserializer(item); + }); +} + +/** Product families metadata details. */ +export interface ProductFamiliesMetadataDetails { + /** Product family properties. */ + readonly properties?: ProductFamilyProperties; +} + +export function productFamiliesMetadataDetailsDeserializer( + item: any, +): ProductFamiliesMetadataDetails { + return { + properties: !item["properties"] + ? item["properties"] + : productFamilyPropertiesDeserializer(item["properties"]), + }; +} + +/** List of orders. */ +export interface _OrderResourceList { + /** The OrderResource items on this page */ + readonly value: OrderResource[]; + /** The link to the next page of items */ + nextLink?: string; +} + +export function _orderResourceListDeserializer(item: any): _OrderResourceList { + return { + value: orderResourceArrayDeserializer(item["value"]), + nextLink: item["nextLink"], + }; +} + +export function orderResourceArrayDeserializer(result: Array): any[] { + return result.map((item) => { + return orderResourceDeserializer(item); + }); +} + +/** The available API versions. */ +export enum KnownVersions { + /** The 2024-02-01 API version. */ + V20240201 = "2024-02-01", +} diff --git a/sdk/edgeorder/arm-edgeorder/src/restorePollerHelpers.ts b/sdk/edgeorder/arm-edgeorder/src/restorePollerHelpers.ts new file mode 100644 index 000000000000..de178925332c --- /dev/null +++ b/sdk/edgeorder/arm-edgeorder/src/restorePollerHelpers.ts @@ -0,0 +1,188 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +import { EdgeOrderClient } from "./edgeOrderClient.js"; +import { + _returnOrderItemDeserialize, + _$deleteDeserialize, + _updateDeserialize, + _createDeserialize, +} from "./api/orderItemResources/operations.js"; +import { + _$deleteDeserialize as _$deleteDeserializeAddressResources, + _updateDeserialize as _updateDeserializeAddressResources, + _createDeserialize as _createDeserializeAddressResources, +} from "./api/addressResources/operations.js"; +import { getLongRunningPoller } from "./static-helpers/pollingHelpers.js"; +import { OperationOptions, PathUncheckedResponse } from "@azure-rest/core-client"; +import { AbortSignalLike } from "@azure/abort-controller"; +import { + PollerLike, + OperationState, + deserializeState, + ResourceLocationConfig, +} from "@azure/core-lro"; + +export interface RestorePollerOptions< + TResult, + TResponse extends PathUncheckedResponse = PathUncheckedResponse, +> extends OperationOptions { + /** Delay to wait until next poll, in milliseconds. */ + updateIntervalInMs?: number; + /** + * The signal which can be used to abort requests. + */ + abortSignal?: AbortSignalLike; + /** Deserialization function for raw response body */ + processResponseBody?: (result: TResponse) => Promise; +} + +/** + * Creates a poller from the serialized state of another poller. This can be + * useful when you want to create pollers on a different host or a poller + * needs to be constructed after the original one is not in scope. + */ +export function restorePoller( + client: EdgeOrderClient, + serializedState: string, + sourceOperation: (...args: any[]) => PollerLike, TResult>, + options?: RestorePollerOptions, +): PollerLike, TResult> { + const pollerConfig = deserializeState(serializedState).config; + const { initialRequestUrl, requestMethod, metadata } = pollerConfig; + if (!initialRequestUrl || !requestMethod) { + throw new Error( + `Invalid serialized state: ${serializedState} for sourceOperation ${sourceOperation?.name}`, + ); + } + const resourceLocationConfig = metadata?.["resourceLocationConfig"] as + | ResourceLocationConfig + | undefined; + const { deserializer, expectedStatuses = [] } = + getDeserializationHelper(initialRequestUrl, requestMethod) ?? {}; + const deserializeHelper = options?.processResponseBody ?? deserializer; + if (!deserializeHelper) { + throw new Error( + `Please ensure the operation is in this client! We can't find its deserializeHelper for ${sourceOperation?.name}.`, + ); + } + return getLongRunningPoller( + (client as any)["_client"] ?? client, + deserializeHelper as (result: TResponse) => Promise, + expectedStatuses, + { + updateIntervalInMs: options?.updateIntervalInMs, + abortSignal: options?.abortSignal, + resourceLocationConfig, + restoreFrom: serializedState, + initialRequestUrl, + }, + ); +} + +interface DeserializationHelper { + deserializer: Function; + expectedStatuses: string[]; +} + +const deserializeMap: Record = { + "POST /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EdgeOrder/orderItems/{orderItemName}/return": + { + deserializer: _returnOrderItemDeserialize, + expectedStatuses: ["202", "200"], + }, + "DELETE /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EdgeOrder/orderItems/{orderItemName}": + { + deserializer: _$deleteDeserialize, + expectedStatuses: ["202", "204", "200"], + }, + "PATCH /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EdgeOrder/orderItems/{orderItemName}": + { deserializer: _updateDeserialize, expectedStatuses: ["200", "202"] }, + "PUT /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EdgeOrder/orderItems/{orderItemName}": + { deserializer: _createDeserialize, expectedStatuses: ["200", "202"] }, + "DELETE /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EdgeOrder/addresses/{addressName}": + { + deserializer: _$deleteDeserializeAddressResources, + expectedStatuses: ["202", "204", "200"], + }, + "PATCH /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EdgeOrder/addresses/{addressName}": + { + deserializer: _updateDeserializeAddressResources, + expectedStatuses: ["200", "202"], + }, + "PUT /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EdgeOrder/addresses/{addressName}": + { + deserializer: _createDeserializeAddressResources, + expectedStatuses: ["200", "202"], + }, +}; + +function getDeserializationHelper( + urlStr: string, + method: string, +): DeserializationHelper | undefined { + const path = new URL(urlStr).pathname; + const pathParts = path.split("/"); + + // Traverse list to match the longest candidate + // matchedLen: the length of candidate path + // matchedValue: the matched status code array + let matchedLen = -1, + matchedValue: DeserializationHelper | undefined; + + // Iterate the responseMap to find a match + for (const [key, value] of Object.entries(deserializeMap)) { + // Extracting the path from the map key which is in format + // GET /path/foo + if (!key.startsWith(method)) { + continue; + } + const candidatePath = getPathFromMapKey(key); + // Get each part of the url path + const candidateParts = candidatePath.split("/"); + + // track if we have found a match to return the values found. + let found = true; + for (let i = candidateParts.length - 1, j = pathParts.length - 1; i >= 1 && j >= 1; i--, j--) { + if (candidateParts[i]?.startsWith("{") && candidateParts[i]?.indexOf("}") !== -1) { + const start = candidateParts[i]!.indexOf("}") + 1, + end = candidateParts[i]?.length; + // If the current part of the candidate is a "template" part + // Try to use the suffix of pattern to match the path + // {guid} ==> $ + // {guid}:export ==> :export$ + const isMatched = new RegExp(`${candidateParts[i]?.slice(start, end)}`).test( + pathParts[j] || "", + ); + + if (!isMatched) { + found = false; + break; + } + continue; + } + + // If the candidate part is not a template and + // the parts don't match mark the candidate as not found + // to move on with the next candidate path. + if (candidateParts[i] !== pathParts[j]) { + found = false; + break; + } + } + + // We finished evaluating the current candidate parts + // Update the matched value if and only if we found the longer pattern + if (found && candidatePath.length > matchedLen) { + matchedLen = candidatePath.length; + matchedValue = value; + } + } + + return matchedValue; +} + +function getPathFromMapKey(mapKey: string): string { + const pathStart = mapKey.indexOf("/"); + return mapKey.slice(pathStart); +} diff --git a/sdk/edgeorder/arm-edgeorder/src/static-helpers/pagingHelpers.ts b/sdk/edgeorder/arm-edgeorder/src/static-helpers/pagingHelpers.ts new file mode 100644 index 000000000000..ce33af5f4178 --- /dev/null +++ b/sdk/edgeorder/arm-edgeorder/src/static-helpers/pagingHelpers.ts @@ -0,0 +1,241 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +import { Client, createRestError, PathUncheckedResponse } from "@azure-rest/core-client"; +import { RestError } from "@azure/core-rest-pipeline"; + +/** + * Options for the byPage method + */ +export interface PageSettings { + /** + * A reference to a specific page to start iterating from. + */ + continuationToken?: string; +} + +/** + * An interface that describes a page of results. + */ +export type ContinuablePage = TPage & { + /** + * The token that keeps track of where to continue the iterator + */ + continuationToken?: string; +}; + +/** + * An interface that allows async iterable iteration both to completion and by page. + */ +export interface PagedAsyncIterableIterator< + TElement, + TPage = TElement[], + TPageSettings extends PageSettings = PageSettings, +> { + /** + * The next method, part of the iteration protocol + */ + next(): Promise>; + /** + * The connection to the async iterator, part of the iteration protocol + */ + [Symbol.asyncIterator](): PagedAsyncIterableIterator; + /** + * Return an AsyncIterableIterator that works a page at a time + */ + byPage: (settings?: TPageSettings) => AsyncIterableIterator>; +} + +/** + * An interface that describes how to communicate with the service. + */ +export interface PagedResult< + TElement, + TPage = TElement[], + TPageSettings extends PageSettings = PageSettings, +> { + /** + * Link to the first page of results. + */ + firstPageLink?: string; + /** + * A method that returns a page of results. + */ + getPage: (pageLink?: string) => Promise<{ page: TPage; nextPageLink?: string } | undefined>; + /** + * a function to implement the `byPage` method on the paged async iterator. + */ + byPage?: (settings?: TPageSettings) => AsyncIterableIterator>; + + /** + * A function to extract elements from a page. + */ + toElements?: (page: TPage) => TElement[]; +} + +/** + * Options for the paging helper + */ +export interface BuildPagedAsyncIteratorOptions { + itemName?: string; + nextLinkName?: string; +} + +/** + * Helper to paginate results in a generic way and return a PagedAsyncIterableIterator + */ +export function buildPagedAsyncIterator< + TElement, + TPage = TElement[], + TPageSettings extends PageSettings = PageSettings, + TResponse extends PathUncheckedResponse = PathUncheckedResponse, +>( + client: Client, + getInitialResponse: () => PromiseLike, + processResponseBody: (result: TResponse) => PromiseLike, + expectedStatuses: string[], + options: BuildPagedAsyncIteratorOptions = {}, +): PagedAsyncIterableIterator { + const itemName = options.itemName ?? "value"; + const nextLinkName = options.nextLinkName ?? "nextLink"; + const pagedResult: PagedResult = { + getPage: async (pageLink?: string) => { + const result = + pageLink === undefined + ? await getInitialResponse() + : await client.pathUnchecked(pageLink).get(); + checkPagingRequest(result, expectedStatuses); + const results = await processResponseBody(result as TResponse); + const nextLink = getNextLink(results, nextLinkName); + const values = getElements(results, itemName) as TPage; + return { + page: values, + nextPageLink: nextLink, + }; + }, + byPage: (settings?: TPageSettings) => { + const { continuationToken } = settings ?? {}; + return getPageAsyncIterator(pagedResult, { + pageLink: continuationToken, + }); + }, + }; + return getPagedAsyncIterator(pagedResult); +} + +/** + * returns an async iterator that iterates over results. It also has a `byPage` + * method that returns pages of items at once. + * + * @param pagedResult - an object that specifies how to get pages. + * @returns a paged async iterator that iterates over results. + */ + +function getPagedAsyncIterator< + TElement, + TPage = TElement[], + TPageSettings extends PageSettings = PageSettings, +>( + pagedResult: PagedResult, +): PagedAsyncIterableIterator { + const iter = getItemAsyncIterator(pagedResult); + return { + next() { + return iter.next(); + }, + [Symbol.asyncIterator]() { + return this; + }, + byPage: + pagedResult?.byPage ?? + ((settings?: TPageSettings) => { + const { continuationToken } = settings ?? {}; + return getPageAsyncIterator(pagedResult, { + pageLink: continuationToken, + }); + }), + }; +} + +async function* getItemAsyncIterator( + pagedResult: PagedResult, +): AsyncIterableIterator { + const pages = getPageAsyncIterator(pagedResult); + for await (const page of pages) { + yield* page as unknown as TElement[]; + } +} + +async function* getPageAsyncIterator( + pagedResult: PagedResult, + options: { + pageLink?: string; + } = {}, +): AsyncIterableIterator> { + const { pageLink } = options; + let response = await pagedResult.getPage(pageLink ?? pagedResult.firstPageLink); + if (!response) { + return; + } + let result = response.page as ContinuablePage; + result.continuationToken = response.nextPageLink; + yield result; + while (response.nextPageLink) { + response = await pagedResult.getPage(response.nextPageLink); + if (!response) { + return; + } + result = response.page as ContinuablePage; + result.continuationToken = response.nextPageLink; + yield result; + } +} + +/** + * Gets for the value of nextLink in the body + */ +function getNextLink(body: unknown, nextLinkName?: string): string | undefined { + if (!nextLinkName) { + return undefined; + } + + const nextLink = (body as Record)[nextLinkName]; + + if (typeof nextLink !== "string" && typeof nextLink !== "undefined" && nextLink !== null) { + throw new RestError( + `Body Property ${nextLinkName} should be a string or undefined or null but got ${typeof nextLink}`, + ); + } + + if (nextLink === null) { + return undefined; + } + + return nextLink; +} + +/** + * Gets the elements of the current request in the body. + */ +function getElements(body: unknown, itemName: string): T[] { + const value = (body as Record)[itemName] as T[]; + if (!Array.isArray(value)) { + throw new RestError( + `Couldn't paginate response\n Body doesn't contain an array property with name: ${itemName}`, + ); + } + + return value ?? []; +} + +/** + * Checks if a request failed + */ +function checkPagingRequest(response: PathUncheckedResponse, expectedStatuses: string[]): void { + if (!expectedStatuses.includes(response.status)) { + throw createRestError( + `Pagination failed with unexpected statusCode ${response.status}`, + response, + ); + } +} diff --git a/sdk/edgeorder/arm-edgeorder/src/static-helpers/pollingHelpers.ts b/sdk/edgeorder/arm-edgeorder/src/static-helpers/pollingHelpers.ts new file mode 100644 index 000000000000..f01c41bab69d --- /dev/null +++ b/sdk/edgeorder/arm-edgeorder/src/static-helpers/pollingHelpers.ts @@ -0,0 +1,126 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +import { + PollerLike, + OperationState, + ResourceLocationConfig, + RunningOperation, + createHttpPoller, + OperationResponse, +} from "@azure/core-lro"; + +import { Client, PathUncheckedResponse, createRestError } from "@azure-rest/core-client"; +import { AbortSignalLike } from "@azure/abort-controller"; + +export interface GetLongRunningPollerOptions { + /** Delay to wait until next poll, in milliseconds. */ + updateIntervalInMs?: number; + /** + * The signal which can be used to abort requests. + */ + abortSignal?: AbortSignalLike; + /** + * The potential location of the result of the LRO if specified by the LRO extension in the swagger. + */ + resourceLocationConfig?: ResourceLocationConfig; + /** + * The original url of the LRO + * Should not be null when restoreFrom is set + */ + initialRequestUrl?: string; + /** + * A serialized poller which can be used to resume an existing paused Long-Running-Operation. + */ + restoreFrom?: string; + /** + * The function to get the initial response + */ + getInitialResponse?: () => PromiseLike; +} +export function getLongRunningPoller( + client: Client, + processResponseBody: (result: TResponse) => Promise, + expectedStatuses: string[], + options: GetLongRunningPollerOptions, +): PollerLike, TResult> { + const { restoreFrom, getInitialResponse } = options; + if (!restoreFrom && !getInitialResponse) { + throw new Error("Either restoreFrom or getInitialResponse must be specified"); + } + let initialResponse: TResponse | undefined = undefined; + const pollAbortController = new AbortController(); + const poller: RunningOperation = { + sendInitialRequest: async () => { + if (!getInitialResponse) { + throw new Error("getInitialResponse is required when initializing a new poller"); + } + initialResponse = await getInitialResponse(); + return getLroResponse(initialResponse, expectedStatuses); + }, + sendPollRequest: async ( + path: string, + pollOptions?: { + abortSignal?: AbortSignalLike; + }, + ) => { + // The poll request would both listen to the user provided abort signal and the poller's own abort signal + function abortListener(): void { + pollAbortController.abort(); + } + const abortSignal = pollAbortController.signal; + if (options.abortSignal?.aborted) { + pollAbortController.abort(); + } else if (pollOptions?.abortSignal?.aborted) { + pollAbortController.abort(); + } else if (!abortSignal.aborted) { + options.abortSignal?.addEventListener("abort", abortListener, { + once: true, + }); + pollOptions?.abortSignal?.addEventListener("abort", abortListener, { + once: true, + }); + } + let response; + try { + response = await client.pathUnchecked(path).get({ abortSignal }); + } finally { + options.abortSignal?.removeEventListener("abort", abortListener); + pollOptions?.abortSignal?.removeEventListener("abort", abortListener); + } + + return getLroResponse(response as TResponse, expectedStatuses); + }, + }; + return createHttpPoller(poller, { + intervalInMs: options?.updateIntervalInMs, + resourceLocationConfig: options?.resourceLocationConfig, + restoreFrom: options?.restoreFrom, + processResult: (result: unknown) => { + return processResponseBody(result as TResponse); + }, + }); +} +/** + * Converts a Rest Client response to a response that the LRO implementation understands + * @param response - a rest client http response + * @param deserializeFn - deserialize function to convert Rest response to modular output + * @returns - An LRO response that the LRO implementation understands + */ +function getLroResponse( + response: TResponse, + expectedStatuses: string[], +): OperationResponse { + if (!expectedStatuses.includes(response.status)) { + throw createRestError(response); + } + + return { + flatResponse: response, + rawResponse: { + ...response, + statusCode: Number.parseInt(response.status), + body: response.body, + }, + }; +} diff --git a/sdk/edgeorder/arm-edgeorder/src/static-helpers/urlTemplate.ts b/sdk/edgeorder/arm-edgeorder/src/static-helpers/urlTemplate.ts new file mode 100644 index 000000000000..cd03319fda35 --- /dev/null +++ b/sdk/edgeorder/arm-edgeorder/src/static-helpers/urlTemplate.ts @@ -0,0 +1,197 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +//--------------------- +// interfaces +//--------------------- +interface ValueOptions { + isFirst: boolean; // is first value in the expression + op?: string; // operator + varValue?: any; // variable value + varName?: string; // variable name + modifier?: string; // modifier e.g * + reserved?: boolean; // if true we'll keep reserved words with not encoding +} + +export interface UrlTemplateOptions { + // if set to true, reserved characters will not be encoded + allowReserved?: boolean; +} + +// --------------------- +// helpers +// --------------------- +function encodeComponent(val: string, reserved?: boolean, op?: string) { + return (reserved ?? op === "+") || op === "#" + ? encodeReservedComponent(val) + : encodeRFC3986URIComponent(val); +} + +function encodeReservedComponent(str: string) { + return str + .split(/(%[0-9A-Fa-f]{2})/g) + .map((part) => (!/%[0-9A-Fa-f]/.test(part) ? encodeURI(part) : part)) + .join(""); +} + +function encodeRFC3986URIComponent(str: string) { + return encodeURIComponent(str).replace( + /[!'()*]/g, + (c) => `%${c.charCodeAt(0).toString(16).toUpperCase()}`, + ); +} + +function isDefined(val: any) { + return val !== undefined && val !== null; +} + +function getNamedAndIfEmpty(op?: string): [boolean, string] { + return [!!op && [";", "?", "&"].includes(op), !!op && ["?", "&"].includes(op) ? "=" : ""]; +} + +function getFirstOrSep(op?: string, isFirst = false) { + if (isFirst) { + return !op || op === "+" ? "" : op; + } else if (!op || op === "+" || op === "#") { + return ","; + } else if (op === "?") { + return "&"; + } else { + return op; + } +} + +function getExpandedValue(option: ValueOptions) { + let isFirst = option.isFirst; + const { op, varName, varValue: value, reserved } = option; + const vals: string[] = []; + const [named, ifEmpty] = getNamedAndIfEmpty(op); + + if (Array.isArray(value)) { + for (const val of value.filter(isDefined)) { + // prepare the following parts: separator, varName, value + vals.push(`${getFirstOrSep(op, isFirst)}`); + if (named && varName) { + vals.push(`${encodeURIComponent(varName)}`); + val === "" ? vals.push(ifEmpty) : vals.push("="); + } + vals.push(encodeComponent(val, reserved, op)); + isFirst = false; + } + } else if (typeof value === "object") { + for (const key of Object.keys(value)) { + const val = value[key]; + if (!isDefined(val)) { + continue; + } + // prepare the following parts: separator, key, value + vals.push(`${getFirstOrSep(op, isFirst)}`); + if (key) { + vals.push(`${encodeURIComponent(key)}`); + named && val === "" ? vals.push(ifEmpty) : vals.push("="); + } + vals.push(encodeComponent(val, reserved, op)); + isFirst = false; + } + } + return vals.join(""); +} + +function getNonExpandedValue(option: ValueOptions) { + const { op, varName, varValue: value, isFirst, reserved } = option; + const vals: string[] = []; + const first = getFirstOrSep(op, isFirst); + const [named, ifEmpty] = getNamedAndIfEmpty(op); + if (named && varName) { + vals.push(encodeComponent(varName, reserved, op)); + if (value === "") { + if (!ifEmpty) { + vals.push(ifEmpty); + } + return !vals.join("") ? undefined : `${first}${vals.join("")}`; + } + vals.push("="); + } + + const items = []; + if (Array.isArray(value)) { + for (const val of value.filter(isDefined)) { + items.push(encodeComponent(val, reserved, op)); + } + } else if (typeof value === "object") { + for (const key of Object.keys(value)) { + if (!isDefined(value[key])) { + continue; + } + items.push(encodeRFC3986URIComponent(key)); + items.push(encodeComponent(value[key], reserved, op)); + } + } + vals.push(items.join(",")); + return !vals.join(",") ? undefined : `${first}${vals.join("")}`; +} + +function getVarValue(option: ValueOptions): string | undefined { + const { op, varName, modifier, isFirst, reserved, varValue: value } = option; + + if (!isDefined(value)) { + return undefined; + } else if (["string", "number", "boolean"].includes(typeof value)) { + let val = value.toString(); + const [named, ifEmpty] = getNamedAndIfEmpty(op); + const vals: string[] = [getFirstOrSep(op, isFirst)]; + if (named && varName) { + // No need to encode varName considering it is already encoded + vals.push(varName); + val === "" ? vals.push(ifEmpty) : vals.push("="); + } + if (modifier && modifier !== "*") { + val = val.substring(0, parseInt(modifier, 10)); + } + vals.push(encodeComponent(val, reserved, op)); + return vals.join(""); + } else if (modifier === "*") { + return getExpandedValue(option); + } else { + return getNonExpandedValue(option); + } +} + +// --------------------------------------------------------------------------------------------------- +// This is an implementation of RFC 6570 URI Template: https://datatracker.ietf.org/doc/html/rfc6570. +// --------------------------------------------------------------------------------------------------- +export function expandUrlTemplate( + template: string, + context: Record, + option?: UrlTemplateOptions, +): string { + return template.replace(/\{([^\{\}]+)\}|([^\{\}]+)/g, (_, expr, text) => { + if (!expr) { + return encodeReservedComponent(text); + } + let op; + if (["+", "#", ".", "/", ";", "?", "&"].includes(expr[0])) { + (op = expr[0]), (expr = expr.slice(1)); + } + const varList = expr.split(/,/g); + const result = []; + for (const varSpec of varList) { + const varMatch = /([^:\*]*)(?::(\d+)|(\*))?/.exec(varSpec); + if (!varMatch || !varMatch[1]) { + continue; + } + const varValue = getVarValue({ + isFirst: result.length === 0, + op, + varValue: context[varMatch[1]], + varName: varMatch[1], + modifier: varMatch[2] || varMatch[3], + reserved: option?.allowReserved, + }); + if (varValue) { + result.push(varValue); + } + } + return result.join(""); + }); +} diff --git a/sdk/edgeorder/arm-edgeorder/test/public/sampleTest.spec.ts b/sdk/edgeorder/arm-edgeorder/test/public/sampleTest.spec.ts new file mode 100644 index 000000000000..e4591bbad342 --- /dev/null +++ b/sdk/edgeorder/arm-edgeorder/test/public/sampleTest.spec.ts @@ -0,0 +1,20 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +import { assert, beforeEach, afterEach, it, describe } from "vitest"; + +describe("My test", () => { + // let recorder: Recorder; + + beforeEach(async () => { + // recorder = await createRecorder(this); + }); + + afterEach(async () => { + // await recorder.stop(); + }); + + it("sample test", async function () { + assert.equal(1, 1); + }); +}); diff --git a/sdk/edgeorder/arm-edgeorder/test/public/utils/recordedClient.ts b/sdk/edgeorder/arm-edgeorder/test/public/utils/recordedClient.ts new file mode 100644 index 000000000000..14dcd9fa397c --- /dev/null +++ b/sdk/edgeorder/arm-edgeorder/test/public/utils/recordedClient.ts @@ -0,0 +1,23 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +import { Recorder, RecorderStartOptions, VitestTestContext } from "@azure-tools/test-recorder"; + +const replaceableVariables: Record = { + SUBSCRIPTION_ID: "azure_subscription_id", +}; + +const recorderEnvSetup: RecorderStartOptions = { + envSetupForPlayback: replaceableVariables, +}; + +/** + * creates the recorder and reads the environment variables from the `.env` file. + * Should be called first in the test suite to make sure environment variables are + * read before they are being used. + */ +export async function createRecorder(context: VitestTestContext): Promise { + const recorder = new Recorder(context); + await recorder.start(recorderEnvSetup); + return recorder; +} diff --git a/sdk/edgeorder/arm-edgeorder/test/snippets.spec.ts b/sdk/edgeorder/arm-edgeorder/test/snippets.spec.ts new file mode 100644 index 000000000000..e9ca7f73b83f --- /dev/null +++ b/sdk/edgeorder/arm-edgeorder/test/snippets.spec.ts @@ -0,0 +1,27 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +import { EdgeOrderClient } from "../src/index.js"; +import { DefaultAzureCredential, InteractiveBrowserCredential } from "@azure/identity"; +import { setLogLevel } from "@azure/logger"; +import { describe, it } from "vitest"; + +describe("snippets", () => { + it("ReadmeSampleCreateClient_Node", async () => { + const subscriptionId = "00000000-0000-0000-0000-000000000000"; + const client = new EdgeOrderClient(new DefaultAzureCredential(), subscriptionId); + }); + + it("ReadmeSampleCreateClient_Browser", async () => { + const subscriptionId = "00000000-0000-0000-0000-000000000000"; + const credential = new InteractiveBrowserCredential({ + tenantId: "", + clientId: "", + }); + const client = new EdgeOrderClient(credential, subscriptionId); + }); + + it("SetLogLevel", async () => { + setLogLevel("info"); + }); +}); diff --git a/sdk/edgeorder/arm-edgeorder/tsconfig.browser.config.json b/sdk/edgeorder/arm-edgeorder/tsconfig.browser.config.json new file mode 100644 index 000000000000..75871518e3a0 --- /dev/null +++ b/sdk/edgeorder/arm-edgeorder/tsconfig.browser.config.json @@ -0,0 +1,3 @@ +{ + "extends": ["./tsconfig.test.json", "../../../tsconfig.browser.base.json"] +} diff --git a/sdk/edgeorder/arm-edgeorder/tsconfig.json b/sdk/edgeorder/arm-edgeorder/tsconfig.json new file mode 100644 index 000000000000..19ceb382b521 --- /dev/null +++ b/sdk/edgeorder/arm-edgeorder/tsconfig.json @@ -0,0 +1,13 @@ +{ + "references": [ + { + "path": "./tsconfig.src.json" + }, + { + "path": "./tsconfig.samples.json" + }, + { + "path": "./tsconfig.test.json" + } + ] +} diff --git a/sdk/edgeorder/arm-edgeorder/tsconfig.samples.json b/sdk/edgeorder/arm-edgeorder/tsconfig.samples.json new file mode 100644 index 000000000000..c85e8d83d0f2 --- /dev/null +++ b/sdk/edgeorder/arm-edgeorder/tsconfig.samples.json @@ -0,0 +1,8 @@ +{ + "extends": "../../../tsconfig.samples.base.json", + "compilerOptions": { + "paths": { + "@azure/arm-edgeorder": ["./dist/esm"] + } + } +} diff --git a/sdk/edgeorder/arm-edgeorder/tsconfig.src.json b/sdk/edgeorder/arm-edgeorder/tsconfig.src.json new file mode 100644 index 000000000000..bae70752dd38 --- /dev/null +++ b/sdk/edgeorder/arm-edgeorder/tsconfig.src.json @@ -0,0 +1,3 @@ +{ + "extends": "../../../tsconfig.lib.json" +} diff --git a/sdk/edgeorder/arm-edgeorder/tsconfig.test.json b/sdk/edgeorder/arm-edgeorder/tsconfig.test.json new file mode 100644 index 000000000000..290ca214aebc --- /dev/null +++ b/sdk/edgeorder/arm-edgeorder/tsconfig.test.json @@ -0,0 +1,3 @@ +{ + "extends": ["./tsconfig.src.json", "../../../tsconfig.test.base.json"] +} diff --git a/sdk/edgeorder/arm-edgeorder/tsp-location.yaml b/sdk/edgeorder/arm-edgeorder/tsp-location.yaml new file mode 100644 index 000000000000..a986b7ea2d37 --- /dev/null +++ b/sdk/edgeorder/arm-edgeorder/tsp-location.yaml @@ -0,0 +1,4 @@ +directory: specification/edgeorder/EdgeOrder.Management +commit: 1114538fd24217b94902430aa2f9b227f5c55727 +repo: Azure/azure-rest-api-specs +additionalDirectories: diff --git a/sdk/edgeorder/arm-edgeorder/vitest.browser.config.ts b/sdk/edgeorder/arm-edgeorder/vitest.browser.config.ts new file mode 100644 index 000000000000..182729ab5ce9 --- /dev/null +++ b/sdk/edgeorder/arm-edgeorder/vitest.browser.config.ts @@ -0,0 +1,17 @@ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +import { defineConfig, mergeConfig } from "vitest/config"; +import viteConfig from "../../../vitest.browser.shared.config.ts"; + +export default mergeConfig( + viteConfig, + defineConfig({ + test: { + include: ["dist-test/browser/test/**/*.spec.js",], + testTimeout: 1200000, + hookTimeout: 1200000, + }, + }), +); diff --git a/sdk/edgeorder/arm-edgeorder/vitest.config.ts b/sdk/edgeorder/arm-edgeorder/vitest.config.ts new file mode 100644 index 000000000000..40e031385dd8 --- /dev/null +++ b/sdk/edgeorder/arm-edgeorder/vitest.config.ts @@ -0,0 +1,16 @@ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +import { defineConfig, mergeConfig } from "vitest/config"; +import viteConfig from "../../../vitest.shared.config.ts"; + +export default mergeConfig( + viteConfig, + defineConfig({ + test: { + testTimeout: 1200000, + hookTimeout: 1200000, + }, + }), +); diff --git a/sdk/edgeorder/arm-edgeorder/vitest.esm.config.ts b/sdk/edgeorder/arm-edgeorder/vitest.esm.config.ts new file mode 100644 index 000000000000..a70127279fc9 --- /dev/null +++ b/sdk/edgeorder/arm-edgeorder/vitest.esm.config.ts @@ -0,0 +1,12 @@ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +import { mergeConfig } from "vitest/config"; +import vitestConfig from "./vitest.config.ts"; +import vitestEsmConfig from "../../../vitest.esm.shared.config.ts"; + +export default mergeConfig( + vitestConfig, + vitestEsmConfig +); diff --git a/sdk/edgeorder/ci.mgmt.yml b/sdk/edgeorder/ci.mgmt.yml new file mode 100644 index 000000000000..69e9daeb114d --- /dev/null +++ b/sdk/edgeorder/ci.mgmt.yml @@ -0,0 +1,35 @@ +# 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/edgeorder/arm-edgeorder + - sdk/edgeorder/ci.mgmt.yml +pr: + branches: + include: + - main + - feature/* + - release/* + - hotfix/* + exclude: + - feature/v4 + paths: + include: + - sdk/edgeorder/arm-edgeorder + - sdk/edgeorder/ci.mgmt.yml +extends: + template: /eng/pipelines/templates/stages/archetype-sdk-client.yml + parameters: + ServiceDirectory: edgeorder + Artifacts: + - name: azure-arm-edgeorder + safeName: azurearmedgeorder