diff --git a/common/config/rush/pnpm-lock.yaml b/common/config/rush/pnpm-lock.yaml index 6cf0e93679e3..609a248623af 100644 --- a/common/config/rush/pnpm-lock.yaml +++ b/common/config/rush/pnpm-lock.yaml @@ -53,6 +53,7 @@ specifiers: '@rush-temp/arm-quota': file:./projects/arm-quota.tgz '@rush-temp/arm-recoveryservices': file:./projects/arm-recoveryservices.tgz '@rush-temp/arm-rediscache': file:./projects/arm-rediscache.tgz + '@rush-temp/arm-relay': file:./projects/arm-relay.tgz '@rush-temp/arm-resourcehealth': file:./projects/arm-resourcehealth.tgz '@rush-temp/arm-resources': file:./projects/arm-resources.tgz '@rush-temp/arm-resources-subscriptions': file:./projects/arm-resources-subscriptions.tgz @@ -222,6 +223,7 @@ dependencies: '@rush-temp/arm-quota': file:projects/arm-quota.tgz '@rush-temp/arm-recoveryservices': file:projects/arm-recoveryservices.tgz '@rush-temp/arm-rediscache': file:projects/arm-rediscache.tgz + '@rush-temp/arm-relay': file:projects/arm-relay.tgz '@rush-temp/arm-resourcehealth': file:projects/arm-resourcehealth.tgz '@rush-temp/arm-resources': file:projects/arm-resources.tgz '@rush-temp/arm-resources-subscriptions': file:projects/arm-resources-subscriptions.tgz @@ -460,8 +462,8 @@ packages: util: 0.11.1 dev: false - /@azure/arm-network/26.0.0: - resolution: {integrity: sha512-Hp0Q4ZzChs8C0DUdGZOChWKMrhzZ53V0Q681puREZ9S1E6o2yWM0Vb+cYuWoyPOylwuzP2fjNjJZGtB7WuFd3w==} + /@azure/arm-network/26.0.0-beta.1: + resolution: {integrity: sha512-uTX8AmRmyXZO2EDY+4ZOy8OGg7acetv7RqGVE+r5YxwUdp7z7cws/gR0NCwWs0j474yk8Wp4p60IfhUKHVcWRg==} engines: {node: '>=12.0.0'} dependencies: '@azure/abort-controller': 1.0.4 @@ -491,21 +493,6 @@ packages: - supports-color dev: false - /@azure/arm-storage/17.0.0-beta.1: - resolution: {integrity: sha512-wLDQSo1XZZtPuh9T8OO4CmicnyJoEADuKnNQ9JCAe1KnAqckBiidJ+KmGAxQhg2NFQvtCUj8Xnhe7/MZWthjWA==} - engines: {node: '>=12.0.0'} - dependencies: - '@azure/abort-controller': 1.0.4 - '@azure/core-auth': 1.3.2 - '@azure/core-client': 1.3.2 - '@azure/core-lro': 2.2.1 - '@azure/core-paging': 1.2.0 - '@azure/core-rest-pipeline': 1.3.2 - tslib: 2.3.1 - transitivePeerDependencies: - - supports-color - dev: false - /@azure/arm-storage/30.0.0-beta.2: resolution: {integrity: sha512-KCmM5z3HlWZI6SXxwqoCi8V9Toau99EDSv/3t4zUTGrSv1v4UmuwKemsuvukvaEeOu6Y1gR9jO71snCJolD/yg==} engines: {node: '>=12.0.0'} @@ -1661,7 +1648,6 @@ packages: /@opentelemetry/node/0.22.0_@opentelemetry+api@1.0.3: resolution: {integrity: sha512-+HhGbDruQ7cwejVOIYyxRa28uosnG8W95NiQZ6qE8PXXPsDSyGeftAPbtYpGit0H2f5hrVcMlwmWHeAo9xkSLA==} engines: {node: '>=8.0.0'} - deprecated: Package renamed to @opentelemetry/sdk-trace-node peerDependencies: '@opentelemetry/api': ^1.0.0 dependencies: @@ -8648,7 +8634,7 @@ packages: dev: false file:projects/app-configuration.tgz: - resolution: {integrity: sha512-HBZl2EancfACeRLK2hWk+nCAgXrptXnS9hX5E5SLleYzlPHovsJRBWf3bv0NopaHCgFPdRcAw5xwKa1C2tPz2g==, tarball: file:projects/app-configuration.tgz} + resolution: {integrity: sha512-h9nLQwnEqw1OjRBrG2YmgFUD/wOCQe+fC+/45l/Kpeh2QBkLKXeJslgi5fme0YsUC0wmSsZqYaQZtn9mOCLjlw==, tarball: file:projects/app-configuration.tgz} name: '@rush-temp/app-configuration' version: 0.0.0 dependencies: @@ -8811,7 +8797,6 @@ packages: name: '@rush-temp/arm-batch' version: 0.0.0 dependencies: - '@azure/arm-storage': 17.0.0-beta.1 '@microsoft/api-extractor': 7.18.19 '@rollup/plugin-commonjs': 11.0.2_rollup@1.32.1 '@rollup/plugin-json': 4.1.0_rollup@1.32.1 @@ -8895,7 +8880,7 @@ packages: name: '@rush-temp/arm-compute' version: 0.0.0 dependencies: - '@azure/arm-network': 26.0.0 + '@azure/arm-network': 26.0.0-beta.1 '@microsoft/api-extractor': 7.18.19 '@rollup/plugin-commonjs': 11.0.2_rollup@1.32.1 '@rollup/plugin-json': 4.1.0_rollup@1.32.1 @@ -9122,7 +9107,7 @@ packages: dev: false file:projects/arm-eventhub.tgz: - resolution: {integrity: sha512-u7elK+VQEh/PpmETDYomvdkwVxKVjIPOb6dELGwpNB2cuTV0/nkZUEKeWux+36A8Lhwo5Lyc/XAkKWWlLixwWw==, tarball: file:projects/arm-eventhub.tgz} + resolution: {integrity: sha512-cWryEMqcziFmqSkDI9ZMhEhjBmX3UEdauByCW1fFHAJ9XGHISFxr8jpJ1hKOj+c6mbp5JBD0UIU2MyceWk/OMg==, tarball: file:projects/arm-eventhub.tgz} name: '@rush-temp/arm-eventhub' version: 0.0.0 dependencies: @@ -9622,6 +9607,27 @@ packages: - supports-color dev: false + file:projects/arm-relay.tgz: + resolution: {integrity: sha512-GTqmfFZ2ToplfgtJe7mDyTK9SRPuo5niMG5PTxOuHnjdqY9KG8+6nKu5rVgFsjIinMD+A/V52b1zHMK5cIjYfQ==, tarball: file:projects/arm-relay.tgz} + name: '@rush-temp/arm-relay' + version: 0.0.0 + dependencies: + '@microsoft/api-extractor': 7.18.19 + '@rollup/plugin-commonjs': 11.0.2_rollup@1.32.1 + '@rollup/plugin-json': 4.1.0_rollup@1.32.1 + '@rollup/plugin-multi-entry': 3.0.1_rollup@1.32.1 + '@rollup/plugin-node-resolve': 8.4.0_rollup@1.32.1 + cross-env: 7.0.3 + mkdirp: 1.0.4 + mocha: 7.2.0 + rimraf: 3.0.2 + rollup: 1.32.1 + rollup-plugin-sourcemaps: 0.4.2_rollup@1.32.1 + tslib: 2.3.1 + typescript: 4.2.4 + uglify-js: 3.14.3 + dev: false + file:projects/arm-resourcehealth.tgz: resolution: {integrity: sha512-2aZ/KsYKwAjiAVYNgPcnIHIZ1zPnIhoqJzsV188fdQ+QJAf5uP3LuyYbqv128SbEqrHQK5XSbAgWNQiAk7DecQ==, tarball: file:projects/arm-resourcehealth.tgz} name: '@rush-temp/arm-resourcehealth' diff --git a/rush.json b/rush.json index a7e20ebf1c9d..df474ee7c0e6 100644 --- a/rush.json +++ b/rush.json @@ -1155,6 +1155,11 @@ "packageName": "@azure/arm-loadtestservice", "projectFolder": "sdk/loadtestservice/arm-loadtestservice", "versionPolicyName": "management" + }, + { + "packageName": "@azure/arm-relay", + "projectFolder": "sdk/relay/arm-relay", + "versionPolicyName": "management" } ] -} \ No newline at end of file +} diff --git a/sdk/relay/arm-relay/CHANGELOG.md b/sdk/relay/arm-relay/CHANGELOG.md new file mode 100644 index 000000000000..a8a275e4e037 --- /dev/null +++ b/sdk/relay/arm-relay/CHANGELOG.md @@ -0,0 +1,11 @@ +# Release History + +## 3.0.0 (2021-12-10) + +The package of @azure/arm-relay is using our next generation design principles since version 3.0.0, which contains breaking changes. + +To understand the detail of the change, please refer to [Changelog](https://aka.ms/js-track2-changelog). + +To migrate the existing applications to the latest version, please refer to [Migration Guide](https://aka.ms/js-track2-migration-guide). + +To learn more, please refer to our documentation [Quick Start](https://aka.ms/js-track2-quickstart). diff --git a/sdk/relay/arm-relay/LICENSE.txt b/sdk/relay/arm-relay/LICENSE similarity index 96% rename from sdk/relay/arm-relay/LICENSE.txt rename to sdk/relay/arm-relay/LICENSE index a70e8cf66038..ccb63b166732 100644 --- a/sdk/relay/arm-relay/LICENSE.txt +++ b/sdk/relay/arm-relay/LICENSE @@ -1,6 +1,6 @@ The MIT License (MIT) -Copyright (c) 2018 Microsoft +Copyright (c) 2021 Microsoft Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal @@ -18,4 +18,4 @@ 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. +SOFTWARE. \ No newline at end of file diff --git a/sdk/relay/arm-relay/README.md b/sdk/relay/arm-relay/README.md index 5336c926f970..12a53857df3c 100644 --- a/sdk/relay/arm-relay/README.md +++ b/sdk/relay/arm-relay/README.md @@ -1,98 +1,98 @@ -## Azure RelayManagementClient SDK for JavaScript +# Azure Service client library for JavaScript -This package contains an isomorphic SDK for RelayManagementClient. +This package contains an isomorphic SDK (runs both in Node.js and in browsers) for Azure Service client. + +Use these API to manage Azure Relay resources through Azure Resource Manager. + +[Source code](https://github.com/Azure/azure-sdk-for-js/tree/main/sdk/relay/arm-relay) | +[Package (NPM)](https://www.npmjs.com/package/@azure/arm-relay) | +[API reference documentation](https://docs.microsoft.com/javascript/api/@azure/arm-relay) | +[Samples](https://github.com/Azure-Samples/azure-samples-js-management) + +## Getting started ### Currently supported environments - [LTS versions of Node.js](https://nodejs.org/about/releases/) -- Latest versions of Safari, Chrome, Edge, and Firefox. -### How to Install +- Latest versions of Safari, Chrome, Edge and Firefox. -``` +### Prerequisites + +- An [Azure subscription][azure_sub]. + +### Install the `@azure/arm-relay` package + +Install the Azure Service client library for JavaScript with `npm`: + +```bash npm install @azure/arm-relay ``` -### How to use +### Create and authenticate a `RelayAPI` -#### nodejs - Authentication, client creation and list operations as an example written in TypeScript. +To create a client object to access the Azure Service API, you will need the `endpoint` of your Azure Service resource and a `credential`. The Azure Service client can use Azure Active Directory credentials to authenticate. +You can find the endpoint for your Azure Service resource in the [Azure Portal][azure_portal]. -##### Install @azure/ms-rest-nodeauth +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). -``` -npm install @azure/ms-rest-nodeauth -``` +To use the [DefaultAzureCredential][defaultazurecredential] provider shown below, or other credential providers provided with the Azure SDK, please install the `@azure/identity` package: -##### Sample code - -```ts -import * as msRest from "@azure/ms-rest-js"; -import * as msRestAzure from "@azure/ms-rest-azure-js"; -import * as msRestNodeAuth from "@azure/ms-rest-nodeauth"; -import { RelayManagementClient, RelayManagementModels, RelayManagementMappers } from "@azure/arm-relay"; -const subscriptionId = process.env["AZURE_SUBSCRIPTION_ID"]; - -msRestNodeAuth.interactiveLogin().then((creds) => { - const client = new RelayManagementClient(creds, subscriptionId); - client.operations.list().then((result) => { - console.log("The result is:"); - console.log(result); - }); -}).catch((err) => { - console.error(err); -}); +```bash +npm install @azure/identity ``` -#### browser - Authentication, client creation and list operations as an example written in JavaScript. +You will also need to **register a new AAD application and grant access to Azure Service** by assigning the suitable role to your service principal (note: roles such as `"Owner"` will not grant the necessary permissions). +Set the values of the client ID, tenant ID, and client secret of the AAD application as environment variables: `AZURE_CLIENT_ID`, `AZURE_TENANT_ID`, `AZURE_CLIENT_SECRET`. -##### Install @azure/ms-rest-browserauth +For more information about how to create an Azure AD Application check out [this guide](https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal). +```javascript +const { RelayAPI } = require("@azure/arm-relay"); +const { DefaultAzureCredential } = require("@azure/identity"); +const subscriptionId = "00000000-0000-0000-0000-000000000000"; +const client = new RelayAPI(new DefaultAzureCredential(), subscriptionId); ``` -npm install @azure/ms-rest-browserauth -``` -##### Sample code - -See https://github.com/Azure/ms-rest-browserauth to learn how to authenticate to Azure in the browser. - -- index.html -```html - - - - @azure/arm-relay sample - - - - - - - - + +### 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 + +### RelayAPI + +`RelayAPI` is the primary interface for developers using the Azure Service client library. Explore the methods on this client object to understand the different features of the Azure Service service that you can access. + +## Troubleshooting + +### Logging + +Enabling logging may help uncover useful information about failures. In order to see a log of HTTP requests and responses, set the `AZURE_LOG_LEVEL` environment variable to `info`. Alternatively, logging can be enabled at runtime by calling `setLogLevel` in the `@azure/logger`: + +```javascript +const { setLogLevel } = require("@azure/logger"); +setLogLevel("info"); ``` -## Related projects +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). -- [Microsoft Azure SDK for Javascript](https://github.com/Azure/azure-sdk-for-js) +## Next steps +Please take a look at the [samples](https://github.com/Azure-Samples/azure-samples-js-management) directory for detailed examples on how to use this library. + +## Contributing + +If you'd like to contribute to this library, please read the [contributing guide](https://github.com/Azure/azure-sdk-for-js/blob/main/CONTRIBUTING.md) to learn more about how to build and test the code. + +## Related projects + +- [Microsoft Azure SDK for JavaScript](https://github.com/Azure/azure-sdk-for-js) ![Impressions](https://azure-sdk-impressions.azurewebsites.net/api/impressions/azure-sdk-for-js%2Fsdk%2Frelay%2Farm-relay%2FREADME.png) + +[azure_cli]: https://docs.microsoft.com/cli/azure +[azure_sub]: https://azure.microsoft.com/free/ +[azure_sub]: https://azure.microsoft.com/free/ +[azure_portal]: https://portal.azure.com +[azure_identity]: https://github.com/Azure/azure-sdk-for-js/tree/main/sdk/identity/identity +[defaultazurecredential]: https://github.com/Azure/azure-sdk-for-js/tree/main/sdk/identity/identity#defaultazurecredential diff --git a/sdk/relay/arm-relay/_meta.json b/sdk/relay/arm-relay/_meta.json new file mode 100644 index 000000000000..ddca5f51a00f --- /dev/null +++ b/sdk/relay/arm-relay/_meta.json @@ -0,0 +1,7 @@ +{ + "commit": "76f8e0c50629ef12aa338d55782278ceca46212a", + "readme": "specification/relay/resource-manager/readme.md", + "autorest_command": "autorest --version=3.1.3 --typescript --modelerfour.lenient-model-deduplication --head-as-boolean=true --license-header=MICROSOFT_MIT_NO_VERSION --generate-test --typescript-sdks-folder=D:\\mydev\\azure-sdk-for-js ../azure-rest-api-specs/specification/relay/resource-manager/readme.md --use=@autorest/typescript@6.0.0-alpha.16.20211130.1", + "repository_url": "https://github.com/Azure/azure-rest-api-specs.git", + "use": "@autorest/typescript@6.0.0-alpha.16.20211130.1" +} \ No newline at end of file diff --git a/sdk/relay/arm-relay/api-extractor.json b/sdk/relay/arm-relay/api-extractor.json new file mode 100644 index 000000000000..0098a4779674 --- /dev/null +++ b/sdk/relay/arm-relay/api-extractor.json @@ -0,0 +1,18 @@ +{ + "$schema": "https://developer.microsoft.com/json-schemas/api-extractor/v7/api-extractor.schema.json", + "mainEntryPointFilePath": "./dist-esm/src/index.d.ts", + "docModel": { "enabled": true }, + "apiReport": { "enabled": true, "reportFolder": "./review" }, + "dtsRollup": { + "enabled": true, + "untrimmedFilePath": "", + "publicTrimmedFilePath": "./types/arm-relay.d.ts" + }, + "messages": { + "tsdocMessageReporting": { "default": { "logLevel": "none" } }, + "extractorMessageReporting": { + "ae-missing-release-tag": { "logLevel": "none" }, + "ae-unresolved-link": { "logLevel": "none" } + } + } +} diff --git a/sdk/relay/arm-relay/package.json b/sdk/relay/arm-relay/package.json index 22d8588356f6..3bce5dfaff44 100644 --- a/sdk/relay/arm-relay/package.json +++ b/sdk/relay/arm-relay/package.json @@ -1,55 +1,91 @@ { "name": "@azure/arm-relay", + "sdk-type": "mgmt", "author": "Microsoft Corporation", - "description": "RelayManagementClient Library with typescript type definitions for node.js and browser.", - "version": "2.1.0", + "description": "A generated SDK for RelayAPI.", + "version": "3.0.0", + "engines": { "node": ">=12.0.0" }, "dependencies": { - "@azure/ms-rest-azure-js": "^1.1.0", - "@azure/ms-rest-js": "^1.1.0", - "tslib": "^1.9.3" + "@azure/core-lro": "^2.2.0", + "@azure/abort-controller": "^1.0.0", + "@azure/core-paging": "^1.2.0", + "@azure/core-client": "^1.0.0", + "@azure/core-auth": "^1.3.0", + "@azure/core-rest-pipeline": "^1.1.0", + "tslib": "^2.2.0" }, - "keywords": [ - "node", - "azure", - "typescript", - "browser", - "isomorphic" - ], + "keywords": ["node", "azure", "typescript", "browser", "isomorphic"], "license": "MIT", - "main": "./dist/arm-relay.js", - "module": "./esm/relayManagementClient.js", - "types": "./esm/relayManagementClient.d.ts", + "main": "./dist/index.js", + "module": "./dist-esm/src/index.js", + "types": "./types/arm-relay.d.ts", "devDependencies": { - "typescript": "^3.1.1", - "rollup": "^0.66.2", - "rollup-plugin-node-resolve": "^3.4.0", - "uglify-js": "^3.4.9" + "@microsoft/api-extractor": "^7.18.11", + "@rollup/plugin-commonjs": "11.0.2", + "@rollup/plugin-json": "^4.0.0", + "@rollup/plugin-multi-entry": "^3.0.0", + "@rollup/plugin-node-resolve": "^8.0.0", + "mkdirp": "^1.0.4", + "rollup": "^1.16.3", + "rollup-plugin-sourcemaps": "^0.4.2", + "typescript": "~4.2.0", + "uglify-js": "^3.4.9", + "rimraf": "^3.0.0", + "@azure/identity": "^2.0.1", + "@azure-tools/test-recorder": "^1.0.0", + "mocha": "^7.1.1", + "cross-env": "^7.0.2" }, - "homepage": "https://github.com/azure/azure-sdk-for-js/tree/main/sdk/relay/arm-relay", + "homepage": "https://github.com/Azure/azure-sdk-for-js/tree/main/sdk/relay/arm-relay", "repository": { "type": "git", - "url": "https://github.com/azure/azure-sdk-for-js.git" - }, - "bugs": { - "url": "https://github.com/azure/azure-sdk-for-js/issues" + "url": "https://github.com/Azure/azure-sdk-for-js.git" }, + "bugs": { "url": "https://github.com/Azure/azure-sdk-for-js/issues" }, "files": [ "dist/**/*.js", "dist/**/*.js.map", "dist/**/*.d.ts", "dist/**/*.d.ts.map", - "esm/**/*.js", - "esm/**/*.js.map", - "esm/**/*.d.ts", - "esm/**/*.d.ts.map", + "dist-esm/**/*.js", + "dist-esm/**/*.js.map", + "dist-esm/**/*.d.ts", + "dist-esm/**/*.d.ts.map", "src/**/*.ts", + "README.md", + "LICENSE", "rollup.config.js", - "tsconfig.json" + "tsconfig.json", + "review/*", + "CHANGELOG.md", + "types/*" ], "scripts": { - "build": "tsc && rollup -c rollup.config.js && npm run minify", - "minify": "uglifyjs -c -m --comments --source-map \"content='./dist/arm-relay.js.map'\" -o ./dist/arm-relay.min.js ./dist/arm-relay.js", - "prepack": "npm install && npm run build" + "build": "npm run clean && tsc && rollup -c 2>&1 && npm run minify && mkdirp ./review && npm run extract-api", + "minify": "uglifyjs -c -m --comments --source-map \"content='./dist/index.js.map'\" -o ./dist/index.min.js ./dist/index.js", + "prepack": "npm run build", + "pack": "npm pack 2>&1", + "extract-api": "api-extractor run --local", + "lint": "echo skipped", + "audit": "echo skipped", + "clean": "rimraf dist dist-browser dist-esm test-dist temp types *.tgz *.log", + "build:node": "echo skipped", + "build:browser": "echo skipped", + "build:test": "echo skipped", + "build:samples": "echo skipped.", + "check-format": "echo skipped", + "execute:samples": "echo skipped", + "format": "echo skipped", + "test": "npm run integration-test", + "test:node": "echo skipped", + "test:browser": "echo skipped", + "unit-test": "npm run unit-test:node && npm run unit-test:browser", + "unit-test:node": "cross-env TEST_MODE=playback npm run integration-test:node", + "unit-test:browser": "echo skipped", + "integration-test": "npm run integration-test:node && npm run integration-test:browser", + "integration-test:node": "mocha -r esm --require ts-node/register --timeout 1200000 --full-trace test/*.ts --reporter ../../../common/tools/mocha-multi-reporter.js", + "integration-test:browser": "echo skipped", + "docs": "echo skipped" }, "sideEffects": false, "autoPublish": true diff --git a/sdk/relay/arm-relay/recordings/node/relay_test/recording_namespaces_create_test.js b/sdk/relay/arm-relay/recordings/node/relay_test/recording_namespaces_create_test.js new file mode 100644 index 000000000000..f67e9eae96a3 --- /dev/null +++ b/sdk/relay/arm-relay/recordings/node/relay_test/recording_namespaces_create_test.js @@ -0,0 +1,671 @@ +let nock = require('nock'); + +module.exports.hash = "b948971e95eded2eba42a424fb4745dc"; + +module.exports.testInfo = {"uniqueName":{},"newDate":{}} + +nock('https://login.microsoftonline.com:443', {"encodedQueryParams":true}) + .get('/common/discovery/instance') + .query(true) + .reply(200, {"tenant_discovery_endpoint":"https://login.microsoftonline.com/88888888-8888-8888-8888-888888888888/v2.0/.well-known/openid-configuration","api-version":"1.1","metadata":[{"preferred_network":"login.microsoftonline.com","preferred_cache":"login.windows.net","aliases":["login.microsoftonline.com","login.windows.net","login.microsoft.com","sts.windows.net"]},{"preferred_network":"login.partner.microsoftonline.cn","preferred_cache":"login.partner.microsoftonline.cn","aliases":["login.partner.microsoftonline.cn","login.chinacloudapi.cn"]},{"preferred_network":"login.microsoftonline.de","preferred_cache":"login.microsoftonline.de","aliases":["login.microsoftonline.de"]},{"preferred_network":"login.microsoftonline.us","preferred_cache":"login.microsoftonline.us","aliases":["login.microsoftonline.us","login.usgovcloudapi.net"]},{"preferred_network":"login-us.microsoftonline.com","preferred_cache":"login-us.microsoftonline.com","aliases":["login-us.microsoftonline.com"]}]}, [ + 'Cache-Control', + 'max-age=86400, private', + 'Content-Type', + 'application/json; charset=utf-8', + 'Strict-Transport-Security', + 'max-age=31536000; includeSubDomains', + 'X-Content-Type-Options', + 'nosniff', + 'Access-Control-Allow-Origin', + '*', + 'Access-Control-Allow-Methods', + 'GET, OPTIONS', + 'P3P', + 'CP="DSP CUR OTPi IND OTRi ONL FIN"', + 'x-ms-request-id', + '515b7f7a-a6ec-4d9d-a61d-90fdcf0c0c00', + 'x-ms-ests-server', + '2.1.12261.14 - KRSLR1 ProdSlices', + 'Set-Cookie', + 'fpc=AsdA9I6_3MJIgR7IESqCxsk; expires=Sun, 09-Jan-2022 05:50:10 GMT; path=/; secure; HttpOnly; SameSite=None', + 'Set-Cookie', + 'esctx=AQABAAAAAAD--DLA3VO7QrddgJg7Wevr4BbhYVvsZWChK9et3_jvnOiwNtjmp2tGoarOoA-wmo41W_S6z81xJanOtbAKywfuZx6khgu5_LAT_FoJD_ScsZELc2A1BAj5Dn-eT3TBAiAx9YMapzxR7p6i2MB37-5wdX-h4E-P7d4u_WnXxL8DTq2Sk2f-ANetbTsweWelBkEgAA; domain=.login.microsoftonline.com; path=/; secure; HttpOnly; SameSite=None', + 'Set-Cookie', + 'x-ms-gateway-slice=estsfd; path=/; secure; samesite=none; httponly', + 'Set-Cookie', + 'stsservicecookie=estsfd; path=/; secure; samesite=none; httponly', + 'Date', + 'Fri, 10 Dec 2021 05:50:10 GMT', + 'Content-Length', + '980' +]); + +nock('https://login.microsoftonline.com:443', {"encodedQueryParams":true}) + .get('/88888888-8888-8888-8888-888888888888/v2.0/.well-known/openid-configuration') + .reply(200, {"token_endpoint":"https://login.microsoftonline.com/88888888-8888-8888-8888-888888888888/oauth2/v2.0/token","token_endpoint_auth_methods_supported":["client_secret_post","private_key_jwt","client_secret_basic"],"jwks_uri":"https://login.microsoftonline.com/88888888-8888-8888-8888-888888888888/discovery/v2.0/keys","response_modes_supported":["query","fragment","form_post"],"subject_types_supported":["pairwise"],"id_token_signing_alg_values_supported":["RS256"],"response_types_supported":["code","id_token","code id_token","id_token token"],"scopes_supported":["openid","profile","email","offline_access"],"issuer":"https://login.microsoftonline.com/88888888-8888-8888-8888-888888888888/v2.0","request_uri_parameter_supported":false,"userinfo_endpoint":"https://graph.microsoft.com/oidc/userinfo","authorization_endpoint":"https://login.microsoftonline.com/88888888-8888-8888-8888-888888888888/oauth2/v2.0/authorize","device_authorization_endpoint":"https://login.microsoftonline.com/88888888-8888-8888-8888-888888888888/oauth2/v2.0/devicecode","http_logout_supported":true,"frontchannel_logout_supported":true,"end_session_endpoint":"https://login.microsoftonline.com/88888888-8888-8888-8888-888888888888/oauth2/v2.0/logout","claims_supported":["sub","iss","cloud_instance_name","cloud_instance_host_name","cloud_graph_host_name","msgraph_host","aud","exp","iat","auth_time","acr","nonce","preferred_username","name","tid","ver","at_hash","c_hash","email"],"kerberos_endpoint":"https://login.microsoftonline.com/88888888-8888-8888-8888-888888888888/kerberos","tenant_region_scope":"WW","cloud_instance_name":"microsoftonline.com","cloud_graph_host_name":"graph.windows.net","msgraph_host":"graph.microsoft.com","rbac_url":"https://pas.windows.net"}, [ + 'Cache-Control', + 'max-age=86400, private', + 'Content-Type', + 'application/json; charset=utf-8', + 'Strict-Transport-Security', + 'max-age=31536000; includeSubDomains', + 'X-Content-Type-Options', + 'nosniff', + 'Access-Control-Allow-Origin', + '*', + 'Access-Control-Allow-Methods', + 'GET, OPTIONS', + 'P3P', + 'CP="DSP CUR OTPi IND OTRi ONL FIN"', + 'x-ms-request-id', + '9e4deb1d-59f9-4f91-a0fa-cb1eed3d0b00', + 'x-ms-ests-server', + '2.1.12261.14 - KRSLR2 ProdSlices', + 'Set-Cookie', + 'fpc=Arv7cFcg1f9KmLJsxqySkmc; expires=Sun, 09-Jan-2022 05:50:10 GMT; path=/; secure; HttpOnly; SameSite=None', + 'Set-Cookie', + 'esctx=AQABAAAAAAD--DLA3VO7QrddgJg7WevrBbbvAppmx68fCx_lpPOWYGBj0hshvtpaSuVvIfitn4y7J0ghPx0_dV6oGLarGGGLVS9--K9oWMFcVaYMCGyvqKfqZFI_XxZj8CYGGE4iXtQ8uQ9H_1iQPN9QkWkBxJPqrZU4uQWM1zCvUGHErqrROZBiVUEnOPCvC-8Wr0H7ORggAA; domain=.login.microsoftonline.com; path=/; secure; HttpOnly; SameSite=None', + 'Set-Cookie', + 'x-ms-gateway-slice=estsfd; path=/; secure; samesite=none; httponly', + 'Set-Cookie', + 'stsservicecookie=estsfd; path=/; secure; samesite=none; httponly', + 'Date', + 'Fri, 10 Dec 2021 05:50:10 GMT', + 'Content-Length', + '1753' +]); + +nock('https://login.microsoftonline.com:443', {"encodedQueryParams":true}) + .post('/88888888-8888-8888-8888-888888888888/oauth2/v2.0/token', "client_id=azure_client_id&scope=https%3A%2F%2Fsanitized%2F&grant_type=client_credentials&x-client-SKU=msal.js.node&x-client-VER=1.3.3&x-client-OS=win32&x-client-CPU=x64&x-ms-lib-capability=retry-after, h429&x-client-current-telemetry=5|771,2,,,|,&x-client-last-telemetry=5|0|||0,0&client-request-id=4385fbce-b20d-4f0c-aa58-2f4e8e382135&client_secret=azure_client_secret&claims=%7B%22access_token%22%3A%7B%22xms_cc%22%3A%7B%22values%22%3A%5B%22cp1%22%5D%7D%7D%7D") + .reply(200, {"token_type":"Bearer","expires_in":86399,"ext_expires_in":86399,"access_token":"access_token"}, [ + 'Cache-Control', + 'no-store, no-cache', + 'Pragma', + 'no-cache', + 'Content-Type', + 'application/json; charset=utf-8', + 'Expires', + '-1', + 'Strict-Transport-Security', + 'max-age=31536000; includeSubDomains', + 'X-Content-Type-Options', + 'nosniff', + 'P3P', + 'CP="DSP CUR OTPi IND OTRi ONL FIN"', + 'x-ms-request-id', + '1306231f-1899-4d48-aeca-900136130b00', + 'x-ms-ests-server', + '2.1.12261.14 - SEASLR1 ProdSlices', + 'x-ms-clitelem', + '1,0,0,,', + 'Set-Cookie', + 'fpc=AhOQHkcV-CdMl_XxrFQKxsIWPr5BAQAAAJLhRNkOAAAA; expires=Sun, 09-Jan-2022 05:50:10 GMT; path=/; secure; HttpOnly; SameSite=None', + 'Set-Cookie', + 'x-ms-gateway-slice=estsfd; path=/; secure; samesite=none; httponly', + 'Set-Cookie', + 'stsservicecookie=estsfd; path=/; secure; samesite=none; httponly', + 'Date', + 'Fri, 10 Dec 2021 05:50:10 GMT', + 'Content-Length', + '1374' +]); + +nock('https://management.azure.com:443', {"encodedQueryParams":true}) + .put('/subscriptions/azure_subscription_id/resourceGroups/myjstest/providers/Microsoft.Relay/namespaces/mynamespacexxx', {"location":"eastus","tags":{"tag1":"value1"},"sku":{"name":"Standard","tier":"Standard"}}) + .query(true) + .reply(200, ["1f8b0800000000000400edbd07601c499625262f6dca7b7f4af54ad7e074a10880601324d8904010ecc188cde692ec1d69472329ab2a81ca6556655d661640cced9dbcf7de7befbdf7de7befbdf7ba3b9d4e27f7dfff3f5c6664016cf6ce4adac99e2180aac81f3f7e7c1f3f227ef147cddbf5478f7ef147cb6c917ff4e8a3d76db69c65f5eca3d1476d91d7fe27bf64f45131a30fee36eb4933ad8b555b54cbe6eec3bdf387f76707e7dbf7a69f3ed8dedfdddbdf7eb83b7db07d303ddf79309d4dcef7f677efd67953adeb69fe795dad57cdddc5f54f376ddeb47757757559ccf2bab9fb4531adaba63a6fc7aff232bbbe0b7c9a5536cdd1dafef1eedd3bc20c7f1222bdcfdbeb153eef827a615a35d4a6aca61910a776a759d3a65fbda60fdbeca20111e8e72e7d719995eb7c170326fc56794d94e0afe9afcba2a1978be50591a5456727754ebf805e8bbcad8be91948741b9a3ceaa13f1550c72d41d8dbd9dbdddedddbdedd79b373ffd1fd9d47bb0fc6bb7bf77e8a9aad57b3db346bf2fab298e64fd6cde972b6aa8a25dacfdb76d53cbadb21e958db4ed6cdf8aa58ceaaab66bcccdb47fbfbf7ee02120d754d04f8e878da169744bde5c547bfe4","97fc3f1d8349be3a020000"], [ + 'Cache-Control', + 'no-cache', + 'Pragma', + 'no-cache', + 'Transfer-Encoding', + 'chunked', + 'Content-Type', + 'application/json; charset=utf-8', + 'Content-Encoding', + 'gzip', + 'Expires', + '-1', + 'Vary', + 'Accept-Encoding', + 'x-ms-request-id', + '9cd9bebf-e1af-4a01-b614-5f44b1a0c9c4_M4CH3_M4CH3', + 'Server-SB', + 'Service-Bus-Resource-Provider/CH3', + 'Server', + 'Service-Bus-Resource-Provider/CH3', + 'Server', + 'Microsoft-HTTPAPI/2.0', + 'x-ms-ratelimit-remaining-subscription-writes', + '1199', + 'x-ms-correlation-request-id', + 'efb927ec-3f5d-49ba-89fb-4c4b12c51c45', + 'x-ms-routing-request-id', + 'SOUTHEASTASIA:20211210T055019Z:efb927ec-3f5d-49ba-89fb-4c4b12c51c45', + 'Strict-Transport-Security', + 'max-age=31536000; includeSubDomains', + 'X-Content-Type-Options', + 'nosniff', + 'Date', + 'Fri, 10 Dec 2021 05:50:18 GMT' +]); + +nock('https://management.azure.com:443', {"encodedQueryParams":true}) + .get('/subscriptions/azure_subscription_id/resourceGroups/myjstest/providers/Microsoft.Relay/namespaces/mynamespacexxx') + .query(true) + .reply(200, ["1f8b0800000000000400edbd07601c499625262f6dca7b7f4af54ad7e074a10880601324d8904010ecc188cde692ec1d69472329ab2a81ca6556655d661640cced9dbcf7de7befbdf7de7befbdf7ba3b9d4e27f7dfff3f5c6664016cf6ce4adac99e2180aac81f3f7e7c1f3f227ef147cddbf5478f7ef147cb6c917ff4e8a3d76db69c65f5eca3d1476d91d7fe27bf64f45131a30fee36eb4933ad8b555b54cbe6eec3bdf387f76707e7dbf7a69f3ed8dedfdddbdf7eb83b7db07d303ddf79309d4dcef7f677efd67953adeb69fe795dad57cdddc5f54f376ddeb47757757559ccf2bab9fb4531adaba63a6fc7aff232bbbe0b7c9a5536cdd1dafef1eedd3bc20c7f1222bdcfdbeb153eef827a615a35d4a6aca61910a776a759d3a65fbda60fdbeca20111e8e72e7d719995eb7c170326fc56794d94e0afe9afcba2a1978be50591a5456727754ebf805e8bbcad8be91948741b9a3ceaa13f1550c72d41d8dbd9dbdddedddbdedd79b373ffd1fd9d47bb0fc6bb7bf77e8a9aad57b3db346bf2fab298e64fd6cde972b6aa8a25dacfdb76d53cbadb21e958db4ed6cdf8aa58ceaaab66bcccdb47fbfbf7ee02120d754d04f8e878da169744bde5c547bfe4","97fc3f1d8349be3a020000"], [ + 'Cache-Control', + 'no-cache', + 'Pragma', + 'no-cache', + 'Transfer-Encoding', + 'chunked', + 'Content-Type', + 'application/json; charset=utf-8', + 'Content-Encoding', + 'gzip', + 'Expires', + '-1', + 'Vary', + 'Accept-Encoding', + 'x-ms-request-id', + 'c0c9e010-3dbc-4ee1-bcac-86fb5e80b0a8_M11CH3_M11CH3', + 'Server-SB', + 'Service-Bus-Resource-Provider/CH3', + 'Server', + 'Service-Bus-Resource-Provider/CH3', + 'Server', + 'Microsoft-HTTPAPI/2.0', + 'x-ms-ratelimit-remaining-subscription-reads', + '11999', + 'x-ms-correlation-request-id', + 'ccb0cbf5-134a-4bf1-909a-d710f465d70a', + 'x-ms-routing-request-id', + 'SOUTHEASTASIA:20211210T055020Z:ccb0cbf5-134a-4bf1-909a-d710f465d70a', + 'Strict-Transport-Security', + 'max-age=31536000; includeSubDomains', + 'X-Content-Type-Options', + 'nosniff', + 'Date', + 'Fri, 10 Dec 2021 05:50:20 GMT' +]); + +nock('https://management.azure.com:443', {"encodedQueryParams":true}) + .get('/subscriptions/azure_subscription_id/resourceGroups/myjstest/providers/Microsoft.Relay/namespaces/mynamespacexxx') + .query(true) + .reply(200, ["1f8b0800000000000400edbd07601c499625262f6dca7b7f4af54ad7e074a10880601324d8904010ecc188cde692ec1d69472329ab2a81ca6556655d661640cced9dbcf7de7befbdf7de7befbdf7ba3b9d4e27f7dfff3f5c6664016cf6ce4adac99e2180aac81f3f7e7c1f3f227ef147cddbf5478f7ef147cb6c917ff4e8a3d76db69c65f5eca3d1476d91d7fe27bf64f45131a30fee36eb4933ad8b555b54cbe6eec3bdf387f76707e7dbf7a69f3ed8dedfdddbdf7eb83b7db07d303ddf79309d4dcef7f677efd67953adeb69fe795dad57cdddc5f54f376ddeb47757757559ccf2bab9fb4531adaba63a6fc7aff232bbbe0b7c9a5536cdd1dafef1eedd3bc20c7f1222bdcfdbeb153eef827a615a35d4a6aca61910a776a759d3a65fbda60fdbeca20111e8e72e7d719995eb7c170326fc56794d94e0afe9afcba2a1978be50591a5456727754ebf805e8bbcad8be91948741b9a3ceaa13f1550c72d41d8dbd9dbdddedddbdedd79b373ffd1fd9d47bb0fc6bb7bf77e8a9aad57b3db346bf2fab298e64fd6cde972b6aa8a25dacfdb76d53cbadb21e958db4ed6cdf8aa58ceaaab66bcccdb47fbfbf7ee02120d754d04f8e878da169744bde5c547bfe4","97fc3f1d8349be3a020000"], [ + 'Cache-Control', + 'no-cache', + 'Pragma', + 'no-cache', + 'Transfer-Encoding', + 'chunked', + 'Content-Type', + 'application/json; charset=utf-8', + 'Content-Encoding', + 'gzip', + 'Expires', + '-1', + 'Vary', + 'Accept-Encoding', + 'x-ms-request-id', + '2e610945-14e9-4b8d-8a68-ba9474fdc475_M8CH3_M8CH3', + 'Server-SB', + 'Service-Bus-Resource-Provider/CH3', + 'Server', + 'Service-Bus-Resource-Provider/CH3', + 'Server', + 'Microsoft-HTTPAPI/2.0', + 'x-ms-ratelimit-remaining-subscription-reads', + '11998', + 'x-ms-correlation-request-id', + '2a51869b-9ad1-4b07-82ca-c1e90fb8573b', + 'x-ms-routing-request-id', + 'SOUTHEASTASIA:20211210T055023Z:2a51869b-9ad1-4b07-82ca-c1e90fb8573b', + 'Strict-Transport-Security', + 'max-age=31536000; includeSubDomains', + 'X-Content-Type-Options', + 'nosniff', + 'Date', + 'Fri, 10 Dec 2021 05:50:23 GMT' +]); + +nock('https://management.azure.com:443', {"encodedQueryParams":true}) + .get('/subscriptions/azure_subscription_id/resourceGroups/myjstest/providers/Microsoft.Relay/namespaces/mynamespacexxx') + .query(true) + .reply(200, ["1f8b0800000000000400edbd07601c499625262f6dca7b7f4af54ad7e074a10880601324d8904010ecc188cde692ec1d69472329ab2a81ca6556655d661640cced9dbcf7de7befbdf7de7befbdf7ba3b9d4e27f7dfff3f5c6664016cf6ce4adac99e2180aac81f3f7e7c1f3f227ef147cddbf5478f7ef147cb6c917ff4e8a3d76db69c65f5eca3d1476d91d7fe27bf64f45131a30fee36eb4933ad8b555b54cbe6eec3bdf387f76707e7dbf7a69f3ed8dedfdddbdf7eb83b7db07d303ddf79309d4dcef7f677efd67953adeb69fe795dad57cdddc5f54f376ddeb47757757559ccf2bab9fb4531adaba63a6fc7aff232bbbe0b7c9a5536cdd1dafef1eedd3bc20c7f1222bdcfdbeb153eef827a615a35d4a6aca61910a776a759d3a65fbda60fdbeca20111e8e72e7d719995eb7c170326fc56794d94e0afe9afcba2a1978be50591a5456727754ebf805e8bbcad8be91948741b9a3ceaa13f1550c72d41d8dbd9dbdddedddbdedd79b373ffd1fd9d47bb0fc6bb7bf77e8a9aad57b3db346bf2fab298e64fd6cde972b6aa8a25dacfdb76d53cbadb21e958db4ed6cdf8aa58ceaaab66bcccdb47fbfbf7ee02120d754d04f8e878da169744bde5c547bfe4","97fc3f1d8349be3a020000"], [ + 'Cache-Control', + 'no-cache', + 'Pragma', + 'no-cache', + 'Transfer-Encoding', + 'chunked', + 'Content-Type', + 'application/json; charset=utf-8', + 'Content-Encoding', + 'gzip', + 'Expires', + '-1', + 'Vary', + 'Accept-Encoding', + 'x-ms-request-id', + 'cdb584b7-eb86-44e7-95cf-609b755466a3_M10CH3_M10CH3', + 'Server-SB', + 'Service-Bus-Resource-Provider/CH3', + 'Server', + 'Service-Bus-Resource-Provider/CH3', + 'Server', + 'Microsoft-HTTPAPI/2.0', + 'x-ms-ratelimit-remaining-subscription-reads', + '11997', + 'x-ms-correlation-request-id', + '53de320b-cff6-4ecd-9b04-662c98e4a3e3', + 'x-ms-routing-request-id', + 'SOUTHEASTASIA:20211210T055027Z:53de320b-cff6-4ecd-9b04-662c98e4a3e3', + 'Strict-Transport-Security', + 'max-age=31536000; includeSubDomains', + 'X-Content-Type-Options', + 'nosniff', + 'Date', + 'Fri, 10 Dec 2021 05:50:26 GMT' +]); + +nock('https://management.azure.com:443', {"encodedQueryParams":true}) + .get('/subscriptions/azure_subscription_id/resourceGroups/myjstest/providers/Microsoft.Relay/namespaces/mynamespacexxx') + .query(true) + .reply(200, ["1f8b0800000000000400edbd07601c499625262f6dca7b7f4af54ad7e074a10880601324d8904010ecc188cde692ec1d69472329ab2a81ca6556655d661640cced9dbcf7de7befbdf7de7befbdf7ba3b9d4e27f7dfff3f5c6664016cf6ce4adac99e2180aac81f3f7e7c1f3f227ef147cddbf5478f7ef147cb6c917ff4e8a3d76db69c65f5eca3d1476d91d7fe27bf64f45131a30fee36eb4933ad8b555b54cbe6eec3bdf387f76707e7dbf7a69f3ed8dedfdddbdf7eb83b7db07d303ddf79309d4dcef7f677efd67953adeb69fe795dad57cdddc5f54f376ddeb47757757559ccf2bab9fb4531adaba63a6fc7aff232bbbe0b7c9a5536cdd1dafef1eedd3bc20c7f1222bdcfdbeb153eef827a615a35d4a6aca61910a776a759d3a65fbda60fdbeca20111e8e72e7d719995eb7c170326fc56794d94e0afe9afcba2a1978be50591a5456727754ebf805e8bbcad8be91948741b9a3ceaa13f1550c72d41d8dbd9dbdddedddbdedd79b373ffd1fd9d47bb0fc6bb7bf77e8a9aad57b3db346bf2fab298e64fd6cde972b6aa8a25dacfdb76d53cbadb21e958db4ed6cdf8aa58ceaaab66bcccdb47fbfbf7ee02120d754d04f8e878da169744bde5c547bfe4","97fc3f1d8349be3a020000"], [ + 'Cache-Control', + 'no-cache', + 'Pragma', + 'no-cache', + 'Transfer-Encoding', + 'chunked', + 'Content-Type', + 'application/json; charset=utf-8', + 'Content-Encoding', + 'gzip', + 'Expires', + '-1', + 'Vary', + 'Accept-Encoding', + 'x-ms-request-id', + 'd32189bf-8353-419c-8012-a5d6b8298bf4_M6CH3_M6CH3', + 'Server-SB', + 'Service-Bus-Resource-Provider/CH3', + 'Server', + 'Service-Bus-Resource-Provider/CH3', + 'Server', + 'Microsoft-HTTPAPI/2.0', + 'x-ms-ratelimit-remaining-subscription-reads', + '11996', + 'x-ms-correlation-request-id', + '40d6c0d8-7746-451a-8f7b-16b1032fab8a', + 'x-ms-routing-request-id', + 'SOUTHEASTASIA:20211210T055031Z:40d6c0d8-7746-451a-8f7b-16b1032fab8a', + 'Strict-Transport-Security', + 'max-age=31536000; includeSubDomains', + 'X-Content-Type-Options', + 'nosniff', + 'Date', + 'Fri, 10 Dec 2021 05:50:30 GMT' +]); + +nock('https://management.azure.com:443', {"encodedQueryParams":true}) + .get('/subscriptions/azure_subscription_id/resourceGroups/myjstest/providers/Microsoft.Relay/namespaces/mynamespacexxx') + .query(true) + .reply(200, ["1f8b0800000000000400edbd07601c499625262f6dca7b7f4af54ad7e074a10880601324d8904010ecc188cde692ec1d69472329ab2a81ca6556655d661640cced9dbcf7de7befbdf7de7befbdf7ba3b9d4e27f7dfff3f5c6664016cf6ce4adac99e2180aac81f3f7e7c1f3f227ef147cddbf5478f7ef147cb6c917ff4e8a3d76db69c65f5eca3d1476d91d7fe27bf64f45131a30fee36eb4933ad8b555b54cbe6eec3bdf387f76707e7dbf7a69f3ed8dedfdddbdf7eb83b7db07d303ddf79309d4dcef7f677efd67953adeb69fe795dad57cdddc5f54f376ddeb47757757559ccf2bab9fb4531adaba63a6fc7aff232bbbe0b7c9a5536cdd1dafef1eedd3bc20c7f1222bdcfdbeb153eef827a615a35d4a6aca61910a776a759d3a65fbda60fdbeca20111e8e72e7d719995eb7c170326fc56794d94e0afe9afcba2a1978be50591a5456727754ebf805e8bbcad8be91948741b9a3ceaa13f1550c72d41d8dbd9dbdddedddbdedd79b373ffd1fd9d47bb0fc6bb7bf77e8a9aad57b3db346bf2fab298e64fd6cde972b6aa8a25dacfdb76d53cbadb21e958db4ed6cdf8aa58ceaaab66bcccdb47fbfbf7ee02120d754d04f8e878da169744bde5c547bfe4","97fc3f1d8349be3a020000"], [ + 'Cache-Control', + 'no-cache', + 'Pragma', + 'no-cache', + 'Transfer-Encoding', + 'chunked', + 'Content-Type', + 'application/json; charset=utf-8', + 'Content-Encoding', + 'gzip', + 'Expires', + '-1', + 'Vary', + 'Accept-Encoding', + 'x-ms-request-id', + '0f3a531a-99b4-4eb6-a111-fd0afe911bec_M7CH3_M7CH3', + 'Server-SB', + 'Service-Bus-Resource-Provider/CH3', + 'Server', + 'Service-Bus-Resource-Provider/CH3', + 'Server', + 'Microsoft-HTTPAPI/2.0', + 'x-ms-ratelimit-remaining-subscription-reads', + '11995', + 'x-ms-correlation-request-id', + 'e6c28032-55a9-4ea6-8154-26c3a9f98600', + 'x-ms-routing-request-id', + 'SOUTHEASTASIA:20211210T055033Z:e6c28032-55a9-4ea6-8154-26c3a9f98600', + 'Strict-Transport-Security', + 'max-age=31536000; includeSubDomains', + 'X-Content-Type-Options', + 'nosniff', + 'Date', + 'Fri, 10 Dec 2021 05:50:33 GMT' +]); + +nock('https://management.azure.com:443', {"encodedQueryParams":true}) + .get('/subscriptions/azure_subscription_id/resourceGroups/myjstest/providers/Microsoft.Relay/namespaces/mynamespacexxx') + .query(true) + .reply(200, ["1f8b0800000000000400edbd07601c499625262f6dca7b7f4af54ad7e074a10880601324d8904010ecc188cde692ec1d69472329ab2a81ca6556655d661640cced9dbcf7de7befbdf7de7befbdf7ba3b9d4e27f7dfff3f5c6664016cf6ce4adac99e2180aac81f3f7e7c1f3f227ef147cddbf5478f7ef147cb6c917ff4e8a3d76db69c65f5eca3d1476d91d7fe27bf64f45131a30fee36eb4933ad8b555b54cbe6eec3bdf387f76707e7dbf7a69f3ed8dedfdddbdf7eb83b7db07d303ddf79309d4dcef7f677efd67953adeb69fe795dad57cdddc5f54f376ddeb47757757559ccf2bab9fb4531adaba63a6fc7aff232bbbe0b7c9a5536cdd1dafef1eedd3bc20c7f1222bdcfdbeb153eef827a615a35d4a6aca61910a776a759d3a65fbda60fdbeca20111e8e72e7d719995eb7c170326fc56794d94e0afe9afcba2a1978be50591a5456727754ebf805e8bbcad8be91948741b9a3ceaa13f1550c72d41d8dbd9dbdddedddbdedd79b373ffd1fd9d47bb0fc6bb7bf77e8a9aad57b3db346bf2fab298e64fd6cde972b6aa8a25dacfdb76d53cbadb21e958db4ed6cdf8aa58ceaaab66bcccdb47fbfbf7ee02120d754d04f8e878da169744bde5c547bfe4","97fc3f1d8349be3a020000"], [ + 'Cache-Control', + 'no-cache', + 'Pragma', + 'no-cache', + 'Transfer-Encoding', + 'chunked', + 'Content-Type', + 'application/json; charset=utf-8', + 'Content-Encoding', + 'gzip', + 'Expires', + '-1', + 'Vary', + 'Accept-Encoding', + 'x-ms-request-id', + 'd84f4a4b-d0db-4ace-a4fb-5476d7b8787c_M7CH3_M7CH3', + 'Server-SB', + 'Service-Bus-Resource-Provider/CH3', + 'Server', + 'Service-Bus-Resource-Provider/CH3', + 'Server', + 'Microsoft-HTTPAPI/2.0', + 'x-ms-ratelimit-remaining-subscription-reads', + '11994', + 'x-ms-correlation-request-id', + '625a4615-2474-440d-b5d5-e759cc9a4d27', + 'x-ms-routing-request-id', + 'SOUTHEASTASIA:20211210T055036Z:625a4615-2474-440d-b5d5-e759cc9a4d27', + 'Strict-Transport-Security', + 'max-age=31536000; includeSubDomains', + 'X-Content-Type-Options', + 'nosniff', + 'Date', + 'Fri, 10 Dec 2021 05:50:36 GMT' +]); + +nock('https://management.azure.com:443', {"encodedQueryParams":true}) + .get('/subscriptions/azure_subscription_id/resourceGroups/myjstest/providers/Microsoft.Relay/namespaces/mynamespacexxx') + .query(true) + .reply(200, ["1f8b0800000000000400edbd07601c499625262f6dca7b7f4af54ad7e074a10880601324d8904010ecc188cde692ec1d69472329ab2a81ca6556655d661640cced9dbcf7de7befbdf7de7befbdf7ba3b9d4e27f7dfff3f5c6664016cf6ce4adac99e2180aac81f3f7e7c1f3f227ef147cddbf5478f7ef147cb6c917ff4e8a3d76db69c65f5eca3d1476d91d7fe27bf64f45131a30fee36eb4933ad8b555b54cbe6eec3bdf387f76707e7dbf7a69f3ed8dedfdddbdf7eb83b7db07d303ddf79309d4dcef7f677efd67953adeb69fe795dad57cdddc5f54f376ddeb47757757559ccf2bab9fb4531adaba63a6fc7aff232bbbe0b7c9a5536cdd1dafef1eedd3bc20c7f1222bdcfdbeb153eef827a615a35d4a6aca61910a776a759d3a65fbda60fdbeca20111e8e72e7d719995eb7c170326fc56794d94e0afe9afcba2a1978be50591a5456727754ebf805e8bbcad8be91948741b9a3ceaa13f1550c72d41d8dbd9dbdddedddbdedd79b373ffd1fd9d47bb0fc6bb7bf77e8a9aad57b3db346bf2fab298e64fd6cde972b6aa8a25dacfdb76d53cbadb21e958db4ed6cdf8aa58ceaaab66bcccdb47fbfbf7ee02120d754d04f8e878da169744bde5c547bfe4","97fc3f1d8349be3a020000"], [ + 'Cache-Control', + 'no-cache', + 'Pragma', + 'no-cache', + 'Transfer-Encoding', + 'chunked', + 'Content-Type', + 'application/json; charset=utf-8', + 'Content-Encoding', + 'gzip', + 'Expires', + '-1', + 'Vary', + 'Accept-Encoding', + 'x-ms-request-id', + '0e0f65f3-3692-49be-86d8-5f25128eaa41_M9CH3_M9CH3', + 'Server-SB', + 'Service-Bus-Resource-Provider/CH3', + 'Server', + 'Service-Bus-Resource-Provider/CH3', + 'Server', + 'Microsoft-HTTPAPI/2.0', + 'x-ms-ratelimit-remaining-subscription-reads', + '11993', + 'x-ms-correlation-request-id', + 'c701efa1-5fc2-415e-9398-2b8d76fcf188', + 'x-ms-routing-request-id', + 'SOUTHEASTASIA:20211210T055040Z:c701efa1-5fc2-415e-9398-2b8d76fcf188', + 'Strict-Transport-Security', + 'max-age=31536000; includeSubDomains', + 'X-Content-Type-Options', + 'nosniff', + 'Date', + 'Fri, 10 Dec 2021 05:50:39 GMT' +]); + +nock('https://management.azure.com:443', {"encodedQueryParams":true}) + .get('/subscriptions/azure_subscription_id/resourceGroups/myjstest/providers/Microsoft.Relay/namespaces/mynamespacexxx') + .query(true) + .reply(200, ["1f8b0800000000000400edbd07601c499625262f6dca7b7f4af54ad7e074a10880601324d8904010ecc188cde692ec1d69472329ab2a81ca6556655d661640cced9dbcf7de7befbdf7de7befbdf7ba3b9d4e27f7dfff3f5c6664016cf6ce4adac99e2180aac81f3f7e7c1f3f227ef147cddbf5478f7ef147cb6c917ff4e8a3d76db69c65f5eca3d1476d91d7fe27bf64f45131a30fee36eb4933ad8b555b54cbe6eec3bdf387f76707e7dbf7a69f3ed8dedfdddbdf7eb83b7db07d303ddf79309d4dcef7f677efd67953adeb69fe795dad57cdddc5f54f376ddeb47757757559ccf2bab9fb4531adaba63a6fc7aff232bbbe0b7c9a5536cdd1dafef1eedd3bc20c7f1222bdcfdbeb153eef827a615a35d4a6aca61910a776a759d3a65fbda60fdbeca20111e8e72e7d719995eb7c170326fc56794d94e0afe9afcba2a1978be50591a5456727754ebf805e8bbcad8be91948741b9a3ceaa13f1550c72d41d8dbd9dbdddedddbdedd79b373ffd1fd9d47bb0fc6bb7bf77e8a9aad57b3db346bf2fab298e64fd6cde972b6aa8a25dacfdb76d53cbadb21e958db4ed6cdf8aa58ceaaab66bcccdb47fbfbf7ee02120d754d04f8e878da169744bde5c547bfe4","97fc3f1d8349be3a020000"], [ + 'Cache-Control', + 'no-cache', + 'Pragma', + 'no-cache', + 'Transfer-Encoding', + 'chunked', + 'Content-Type', + 'application/json; charset=utf-8', + 'Content-Encoding', + 'gzip', + 'Expires', + '-1', + 'Vary', + 'Accept-Encoding', + 'x-ms-request-id', + 'ef5ecfe7-f14e-4e81-a2de-f8ede44a829f_M2CH3_M2CH3', + 'Server-SB', + 'Service-Bus-Resource-Provider/CH3', + 'Server', + 'Service-Bus-Resource-Provider/CH3', + 'Server', + 'Microsoft-HTTPAPI/2.0', + 'x-ms-ratelimit-remaining-subscription-reads', + '11992', + 'x-ms-correlation-request-id', + '9b76f4a8-dcc4-4a51-92cc-32eb906e0ee0', + 'x-ms-routing-request-id', + 'SOUTHEASTASIA:20211210T055044Z:9b76f4a8-dcc4-4a51-92cc-32eb906e0ee0', + 'Strict-Transport-Security', + 'max-age=31536000; includeSubDomains', + 'X-Content-Type-Options', + 'nosniff', + 'Date', + 'Fri, 10 Dec 2021 05:50:43 GMT' +]); + +nock('https://management.azure.com:443', {"encodedQueryParams":true}) + .get('/subscriptions/azure_subscription_id/resourceGroups/myjstest/providers/Microsoft.Relay/namespaces/mynamespacexxx') + .query(true) + .reply(200, ["1f8b0800000000000400edbd07601c499625262f6dca7b7f4af54ad7e074a10880601324d8904010ecc188cde692ec1d69472329ab2a81ca6556655d661640cced9dbcf7de7befbdf7de7befbdf7ba3b9d4e27f7dfff3f5c6664016cf6ce4adac99e2180aac81f3f7e7c1f3f227ef147cddbf5478f7ef147cb6c917ff4e8a3d76db69c65f5eca3d1476d91d7fe27bf64f45131a30fee36eb4933ad8b555b54cbe6eec3bdf387f76707e7dbf7a69f3ed8dedfdddbdf7eb83b7db07d303ddf79309d4dcef7f677efd67953adeb69fe795dad57cdddc5f54f376ddeb47757757559ccf2bab9fb4531adaba63a6fc7aff232bbbe0b7c9a5536cdd1dafef1eedd3bc20c7f1222bdcfdbeb153eef827a615a35d4a6aca61910a776a759d3a65fbda60fdbeca20111e8e72e7d719995eb7c170326fc56794d94e0afe9afcba2a1978be50591a5456727754ebf805e8bbcad8be91948741b9a3ceaa13f1550c72d41d8dbd9dbdddedddbdedd79b373ffd1fd9d47bb0fc6bb7bf77e8a9aad57b3db346bf2fab298e64fd6cde972b6aa8a25dacfdb76d53cbadb21e958db4ed6cdf8aa58ceaaab66bcccdb47fbfbf7ee02120d754d04f8e878da169744bde5c547bfe4","97fc3f1d8349be3a020000"], [ + 'Cache-Control', + 'no-cache', + 'Pragma', + 'no-cache', + 'Transfer-Encoding', + 'chunked', + 'Content-Type', + 'application/json; charset=utf-8', + 'Content-Encoding', + 'gzip', + 'Expires', + '-1', + 'Vary', + 'Accept-Encoding', + 'x-ms-request-id', + '6b89acc2-3f9b-4a7a-a70f-901dc81169b4_M2CH3_M2CH3', + 'Server-SB', + 'Service-Bus-Resource-Provider/CH3', + 'Server', + 'Service-Bus-Resource-Provider/CH3', + 'Server', + 'Microsoft-HTTPAPI/2.0', + 'x-ms-ratelimit-remaining-subscription-reads', + '11991', + 'x-ms-correlation-request-id', + '12faffeb-2018-4fbd-bdfb-567a86a760a8', + 'x-ms-routing-request-id', + 'SOUTHEASTASIA:20211210T055047Z:12faffeb-2018-4fbd-bdfb-567a86a760a8', + 'Strict-Transport-Security', + 'max-age=31536000; includeSubDomains', + 'X-Content-Type-Options', + 'nosniff', + 'Date', + 'Fri, 10 Dec 2021 05:50:47 GMT' +]); + +nock('https://management.azure.com:443', {"encodedQueryParams":true}) + .get('/subscriptions/azure_subscription_id/resourceGroups/myjstest/providers/Microsoft.Relay/namespaces/mynamespacexxx') + .query(true) + .reply(200, ["1f8b0800000000000400edbd07601c499625262f6dca7b7f4af54ad7e074a10880601324d8904010ecc188cde692ec1d69472329ab2a81ca6556655d661640cced9dbcf7de7befbdf7de7befbdf7ba3b9d4e27f7dfff3f5c6664016cf6ce4adac99e2180aac81f3f7e7c1f3f227ef147cddbf5478f7ef147cb6c917ff4e8a3d76db69c65f5eca3d1476d91d7fe27bf64f45131a30fee36eb4933ad8b555b54cbe6eec3bdf387f76707e7dbf7a69f3ed8dedfdddbdf7eb83b7db07d303ddf79309d4dcef7f677efd67953adeb69fe795dad57cdddc5f54f376ddeb47757757559ccf2bab9fb4531adaba63a6fc7aff232bbbe0b7c9a5536cdd1dafef1eedd3bc20c7f1222bdcfdbeb153eef827a615a35d4a6aca61910a776a759d3a65fbda60fdbeca20111e8e72e7d719995eb7c170326fc56794d94e0afe9afcba2a1978be50591a5456727754ebf805e8bbcad8be91948741b9a3ceaa13f1550c72d41d8dbd9dbdddedddbdedd79b373ffd1fd9d47bb0fc6bb7bf77e8a9aad57b3db346bf2fab298e64fd6cde972b6aa8a25dacfdb76d53cbadb21e958db4ed6cdf8aa58ceaaab66bcccdb47fbfbf7ee02120d754d04f8e878da169744bde5c547bfe4","97fc3f1d8349be3a020000"], [ + 'Cache-Control', + 'no-cache', + 'Pragma', + 'no-cache', + 'Transfer-Encoding', + 'chunked', + 'Content-Type', + 'application/json; charset=utf-8', + 'Content-Encoding', + 'gzip', + 'Expires', + '-1', + 'Vary', + 'Accept-Encoding', + 'x-ms-request-id', + '32af82f0-2b01-4988-9fa0-22377b734ac8_M11CH3_M11CH3', + 'Server-SB', + 'Service-Bus-Resource-Provider/CH3', + 'Server', + 'Service-Bus-Resource-Provider/CH3', + 'Server', + 'Microsoft-HTTPAPI/2.0', + 'x-ms-ratelimit-remaining-subscription-reads', + '11990', + 'x-ms-correlation-request-id', + '2ba3a64d-4fc4-475c-9f9c-0322bf780d60', + 'x-ms-routing-request-id', + 'SOUTHEASTASIA:20211210T055051Z:2ba3a64d-4fc4-475c-9f9c-0322bf780d60', + 'Strict-Transport-Security', + 'max-age=31536000; includeSubDomains', + 'X-Content-Type-Options', + 'nosniff', + 'Date', + 'Fri, 10 Dec 2021 05:50:50 GMT' +]); + +nock('https://management.azure.com:443', {"encodedQueryParams":true}) + .get('/subscriptions/azure_subscription_id/resourceGroups/myjstest/providers/Microsoft.Relay/namespaces/mynamespacexxx') + .query(true) + .reply(200, ["1f8b0800000000000400edbd07601c499625262f6dca7b7f4af54ad7e074a10880601324d8904010ecc188cde692ec1d69472329ab2a81ca6556655d661640cced9dbcf7de7befbdf7de7befbdf7ba3b9d4e27f7dfff3f5c6664016cf6ce4adac99e2180aac81f3f7e7c1f3f227ef147cddbf5478f7ef147cb6c917ff4e8a3d76db69c65f5eca3d1476d91d7fe27bf64f45131a30fee36eb4933ad8b555b54cbe6eec3bdf387f76707e7dbf7a69f3ed8dedfdddbdf7eb83b7db07d303ddf79309d4dcef7f677efd67953adeb69fe795dad57cdddc5f54f376ddeb47757757559ccf2bab9fb4531adaba63a6fc7aff232bbbe0b7c9a5536cdd1dafef1eedd3bc20c7f1222bdcfdbeb153eef827a615a35d4a6aca61910a776a759d3a65fbda60fdbeca20111e8e72e7d719995eb7c170326fc56794d94e0afe9afcba2a1978be50591a5456727754ebf805e8bbcad8be91948741b9a3ceaa13f1550c72d41d8dbd9dbdddedddbdedd79b373ffd1fd9d47bb0fc6bb7bf77e8a9aad57b3db346bf2fab298e64fd6cde972b6aa8a25dacfdb76d53cbadb21e958db4ed6cdf8aa58ceaaab66bcccdb47fbfbf7ee02120d754d04f8e878da169744bde5c547bfe4","97fc3f1d8349be3a020000"], [ + 'Cache-Control', + 'no-cache', + 'Pragma', + 'no-cache', + 'Transfer-Encoding', + 'chunked', + 'Content-Type', + 'application/json; charset=utf-8', + 'Content-Encoding', + 'gzip', + 'Expires', + '-1', + 'Vary', + 'Accept-Encoding', + 'x-ms-request-id', + '55aa725e-4b11-4185-96b5-8871cec9d9d5_M4CH3_M4CH3', + 'Server-SB', + 'Service-Bus-Resource-Provider/CH3', + 'Server', + 'Service-Bus-Resource-Provider/CH3', + 'Server', + 'Microsoft-HTTPAPI/2.0', + 'x-ms-ratelimit-remaining-subscription-reads', + '11989', + 'x-ms-correlation-request-id', + 'b17ae183-6be2-4a06-ac6c-6f332dfb1c19', + 'x-ms-routing-request-id', + 'SOUTHEASTASIA:20211210T055054Z:b17ae183-6be2-4a06-ac6c-6f332dfb1c19', + 'Strict-Transport-Security', + 'max-age=31536000; includeSubDomains', + 'X-Content-Type-Options', + 'nosniff', + 'Date', + 'Fri, 10 Dec 2021 05:50:54 GMT' +]); + +nock('https://management.azure.com:443', {"encodedQueryParams":true}) + .get('/subscriptions/azure_subscription_id/resourceGroups/myjstest/providers/Microsoft.Relay/namespaces/mynamespacexxx') + .query(true) + .reply(200, ["1f8b0800000000000400edbd07601c499625262f6dca7b7f4af54ad7e074a10880601324d8904010ecc188cde692ec1d69472329ab2a81ca6556655d661640cced9dbcf7de7befbdf7de7befbdf7ba3b9d4e27f7dfff3f5c6664016cf6ce4adac99e2180aac81f3f7e7c1f3f227ef147cddbf5478f7ef147cb6c917ff4e8a3d76db69c65f5eca3d1476d91d7fe27bf64f45131a30fee36eb4933ad8b555b54cbe6eec3bdf387f76707e7dbf7a69f3ed8dedfdddbdf7eb83b7db07d303ddf79309d4dcef7f677efd67953adeb69fe795dad57cdddc5f54f376ddeb47757757559ccf2bab9fb4531adaba63a6fc7aff232bbbe0b7c9a5536cdd1dafef1eedd3bc20c7f1222bdcfdbeb153eef827a615a35d4a6aca61910a776a759d3a65fbda60fdbeca20111e8e72e7d719995eb7c170326fc56794d94e0afe9afcba2a1978be50591a5456727754ebf805e8bbcad8be91948741b9a3ceaa13f1550c72d41d8dbd9dbdddedddbdedd79b373ffd1fd9d47bb0fc6bb7bf77e8a9aad57b3db346bf2fab298e64fd6cde972b6aa8a25dacfdb76d53cbadb21e958db4ed6cdf8aa58ceaaab66bcccdb47fbfbf7ee02120d754d04f8e878da169744bde5c547bfe4","97fc3f1d8349be3a020000"], [ + 'Cache-Control', + 'no-cache', + 'Pragma', + 'no-cache', + 'Transfer-Encoding', + 'chunked', + 'Content-Type', + 'application/json; charset=utf-8', + 'Content-Encoding', + 'gzip', + 'Expires', + '-1', + 'Vary', + 'Accept-Encoding', + 'x-ms-request-id', + '15211147-c9cd-40ca-a761-5956a89a51ee_M6CH3_M6CH3', + 'Server-SB', + 'Service-Bus-Resource-Provider/CH3', + 'Server', + 'Service-Bus-Resource-Provider/CH3', + 'Server', + 'Microsoft-HTTPAPI/2.0', + 'x-ms-ratelimit-remaining-subscription-reads', + '11988', + 'x-ms-correlation-request-id', + 'f9004db9-3850-42c8-a206-cd9412e420cb', + 'x-ms-routing-request-id', + 'SOUTHEASTASIA:20211210T055058Z:f9004db9-3850-42c8-a206-cd9412e420cb', + 'Strict-Transport-Security', + 'max-age=31536000; includeSubDomains', + 'X-Content-Type-Options', + 'nosniff', + 'Date', + 'Fri, 10 Dec 2021 05:50:57 GMT' +]); + +nock('https://management.azure.com:443', {"encodedQueryParams":true}) + .get('/subscriptions/azure_subscription_id/resourceGroups/myjstest/providers/Microsoft.Relay/namespaces/mynamespacexxx') + .query(true) + .reply(200, ["1f8b0800000000000400edbd07601c499625262f6dca7b7f4af54ad7e074a10880601324d8904010ecc188cde692ec1d69472329ab2a81ca6556655d661640cced9dbcf7de7befbdf7de7befbdf7ba3b9d4e27f7dfff3f5c6664016cf6ce4adac99e2180aac81f3f7e7c1f3f227ef147cddbf5478f7ef147cb6c917ff4e8a3d76db69c65f5eca3d1476d91d7fe27bf64f45131a30fee36eb4933ad8b555b54cbe6eec3bdf387f76707e7dbf7a69f3ed8dedfdddbdf7eb83b7db07d303ddf79309d4dcef7f677efd67953adeb69fe795dad57cdddc5f54f376ddeb47757757559ccf2bab9fb4531adaba63a6fc7aff232bbbe0b7c9a5536cdd1dafef1eedd3bc20c7f1222bdcfdbeb153eef827a615a35d4a6aca61910a776a759d3a65fbda60fdbeca20111e8e72e7d719995eb7c170326fc56794d94e0afe9afcba2a1978be50591a54567afd7d3699ecf72506c91b775313d03916e439547bd014ceb9ca0ce8e5b82b0b7b3b7bbbdbbb7bdbbf366e7fea3fb3b8f761f8c77f7eefd14355baf66c3cdee3f1c1fec3d40b326af2f8b69fe64dd9c2e67abaa58a2fdbc6d57cda3bb1da28eb5ed64dd8caf8ae5acba6ac6cbbc7db4bf7fef2e20d160d744828f8ea76d71997ff44b7e","c9ff0354517f5838020000"], [ + 'Cache-Control', + 'no-cache', + 'Pragma', + 'no-cache', + 'Transfer-Encoding', + 'chunked', + 'Content-Type', + 'application/json; charset=utf-8', + 'Content-Encoding', + 'gzip', + 'Expires', + '-1', + 'Vary', + 'Accept-Encoding', + 'x-ms-request-id', + '6d6ee1f9-b798-4cba-9163-a2d94effa0b3_M8CH3_M8CH3', + 'Server-SB', + 'Service-Bus-Resource-Provider/CH3', + 'Server', + 'Service-Bus-Resource-Provider/CH3', + 'Server', + 'Microsoft-HTTPAPI/2.0', + 'x-ms-ratelimit-remaining-subscription-reads', + '11987', + 'x-ms-correlation-request-id', + '6d76dedd-cf0a-457a-b727-d31cdfe0a1d5', + 'x-ms-routing-request-id', + 'SOUTHEASTASIA:20211210T055100Z:6d76dedd-cf0a-457a-b727-d31cdfe0a1d5', + 'Strict-Transport-Security', + 'max-age=31536000; includeSubDomains', + 'X-Content-Type-Options', + 'nosniff', + 'Date', + 'Fri, 10 Dec 2021 05:50:59 GMT' +]); diff --git a/sdk/relay/arm-relay/recordings/node/relay_test/recording_namespaces_delete_test.js b/sdk/relay/arm-relay/recordings/node/relay_test/recording_namespaces_delete_test.js new file mode 100644 index 000000000000..170da3a2fe37 --- /dev/null +++ b/sdk/relay/arm-relay/recordings/node/relay_test/recording_namespaces_delete_test.js @@ -0,0 +1,861 @@ +let nock = require('nock'); + +module.exports.hash = "cf465a79d162e3d4a3dd1bb9861b455a"; + +module.exports.testInfo = {"uniqueName":{},"newDate":{}} + +nock('https://login.microsoftonline.com:443', {"encodedQueryParams":true}) + .get('/common/discovery/instance') + .query(true) + .reply(200, {"tenant_discovery_endpoint":"https://login.microsoftonline.com/88888888-8888-8888-8888-888888888888/v2.0/.well-known/openid-configuration","api-version":"1.1","metadata":[{"preferred_network":"login.microsoftonline.com","preferred_cache":"login.windows.net","aliases":["login.microsoftonline.com","login.windows.net","login.microsoft.com","sts.windows.net"]},{"preferred_network":"login.partner.microsoftonline.cn","preferred_cache":"login.partner.microsoftonline.cn","aliases":["login.partner.microsoftonline.cn","login.chinacloudapi.cn"]},{"preferred_network":"login.microsoftonline.de","preferred_cache":"login.microsoftonline.de","aliases":["login.microsoftonline.de"]},{"preferred_network":"login.microsoftonline.us","preferred_cache":"login.microsoftonline.us","aliases":["login.microsoftonline.us","login.usgovcloudapi.net"]},{"preferred_network":"login-us.microsoftonline.com","preferred_cache":"login-us.microsoftonline.com","aliases":["login-us.microsoftonline.com"]}]}, [ + 'Cache-Control', + 'max-age=86400, private', + 'Content-Type', + 'application/json; charset=utf-8', + 'Strict-Transport-Security', + 'max-age=31536000; includeSubDomains', + 'X-Content-Type-Options', + 'nosniff', + 'Access-Control-Allow-Origin', + '*', + 'Access-Control-Allow-Methods', + 'GET, OPTIONS', + 'P3P', + 'CP="DSP CUR OTPi IND OTRi ONL FIN"', + 'x-ms-request-id', + '9e4deb1d-59f9-4f91-a0fa-cb1e68400b00', + 'x-ms-ests-server', + '2.1.12261.14 - KRSLR2 ProdSlices', + 'Set-Cookie', + 'fpc=AoC3zK6SqipHvdQBlzqDjkg; expires=Sun, 09-Jan-2022 05:51:36 GMT; path=/; secure; HttpOnly; SameSite=None', + 'Set-Cookie', + 'esctx=AQABAAAAAAD--DLA3VO7QrddgJg7WevrRvKLOjspZmfL669BqD0PyWHBd0BgUeYQqBbOllizVfqEqAekTpfwnSoodyT3JA29MOQ1_KRy35ZOxeOcfRMtHUW8mAc5rXrpJFmHwF-kOOJjrM9Cq5AWW-OdeOgmN2In0UdRurXXuMFgKEUMfvPCrSrbL0GO7xEhHVUIsfwoYgYgAA; domain=.login.microsoftonline.com; path=/; secure; HttpOnly; SameSite=None', + 'Set-Cookie', + 'x-ms-gateway-slice=estsfd; path=/; secure; samesite=none; httponly', + 'Set-Cookie', + 'stsservicecookie=estsfd; path=/; secure; samesite=none; httponly', + 'Date', + 'Fri, 10 Dec 2021 05:51:36 GMT', + 'Content-Length', + '980' +]); + +nock('https://login.microsoftonline.com:443', {"encodedQueryParams":true}) + .get('/88888888-8888-8888-8888-888888888888/v2.0/.well-known/openid-configuration') + .reply(200, {"token_endpoint":"https://login.microsoftonline.com/88888888-8888-8888-8888-888888888888/oauth2/v2.0/token","token_endpoint_auth_methods_supported":["client_secret_post","private_key_jwt","client_secret_basic"],"jwks_uri":"https://login.microsoftonline.com/88888888-8888-8888-8888-888888888888/discovery/v2.0/keys","response_modes_supported":["query","fragment","form_post"],"subject_types_supported":["pairwise"],"id_token_signing_alg_values_supported":["RS256"],"response_types_supported":["code","id_token","code id_token","id_token token"],"scopes_supported":["openid","profile","email","offline_access"],"issuer":"https://login.microsoftonline.com/88888888-8888-8888-8888-888888888888/v2.0","request_uri_parameter_supported":false,"userinfo_endpoint":"https://graph.microsoft.com/oidc/userinfo","authorization_endpoint":"https://login.microsoftonline.com/88888888-8888-8888-8888-888888888888/oauth2/v2.0/authorize","device_authorization_endpoint":"https://login.microsoftonline.com/88888888-8888-8888-8888-888888888888/oauth2/v2.0/devicecode","http_logout_supported":true,"frontchannel_logout_supported":true,"end_session_endpoint":"https://login.microsoftonline.com/88888888-8888-8888-8888-888888888888/oauth2/v2.0/logout","claims_supported":["sub","iss","cloud_instance_name","cloud_instance_host_name","cloud_graph_host_name","msgraph_host","aud","exp","iat","auth_time","acr","nonce","preferred_username","name","tid","ver","at_hash","c_hash","email"],"kerberos_endpoint":"https://login.microsoftonline.com/88888888-8888-8888-8888-888888888888/kerberos","tenant_region_scope":"WW","cloud_instance_name":"microsoftonline.com","cloud_graph_host_name":"graph.windows.net","msgraph_host":"graph.microsoft.com","rbac_url":"https://pas.windows.net"}, [ + 'Cache-Control', + 'max-age=86400, private', + 'Content-Type', + 'application/json; charset=utf-8', + 'Strict-Transport-Security', + 'max-age=31536000; includeSubDomains', + 'X-Content-Type-Options', + 'nosniff', + 'Access-Control-Allow-Origin', + '*', + 'Access-Control-Allow-Methods', + 'GET, OPTIONS', + 'P3P', + 'CP="DSP CUR OTPi IND OTRi ONL FIN"', + 'x-ms-request-id', + '2f2a3fa4-e575-45d7-8873-faa515720a00', + 'x-ms-ests-server', + '2.1.12261.14 - SEASLR2 ProdSlices', + 'Set-Cookie', + 'fpc=AlSFCEKeAoNBvq42WbrPoDQ; expires=Sun, 09-Jan-2022 05:51:37 GMT; path=/; secure; HttpOnly; SameSite=None', + 'Set-Cookie', + 'esctx=AQABAAAAAAD--DLA3VO7QrddgJg7Wevr1hog3AOLC0m6K2VX6ighziAaL-FD71rqGI1zo1sGokqiEbiADVgvWPI9uFdSGZmZskWPp77ZdKXsMlZlzkH2tfKfyCA_dgZ6Ycu5ZcPqkchN1ZBzVUjIL_J3jt0BD5ecRpmZ36g-e1ofzNf2yUvJzBpwnxPVaERwlveVo9j12tkgAA; domain=.login.microsoftonline.com; path=/; secure; HttpOnly; SameSite=None', + 'Set-Cookie', + 'x-ms-gateway-slice=estsfd; path=/; secure; samesite=none; httponly', + 'Set-Cookie', + 'stsservicecookie=estsfd; path=/; secure; samesite=none; httponly', + 'Date', + 'Fri, 10 Dec 2021 05:51:36 GMT', + 'Content-Length', + '1753' +]); + +nock('https://login.microsoftonline.com:443', {"encodedQueryParams":true}) + .post('/88888888-8888-8888-8888-888888888888/oauth2/v2.0/token', "client_id=azure_client_id&scope=https%3A%2F%2Fsanitized%2F&grant_type=client_credentials&x-client-SKU=msal.js.node&x-client-VER=1.3.3&x-client-OS=win32&x-client-CPU=x64&x-ms-lib-capability=retry-after, h429&x-client-current-telemetry=5|771,2,,,|,&x-client-last-telemetry=5|0|||0,0&client-request-id=718dbad8-f637-49fa-924f-744c673907c9&client_secret=azure_client_secret&claims=%7B%22access_token%22%3A%7B%22xms_cc%22%3A%7B%22values%22%3A%5B%22cp1%22%5D%7D%7D%7D") + .reply(200, {"token_type":"Bearer","expires_in":86399,"ext_expires_in":86399,"access_token":"access_token"}, [ + 'Cache-Control', + 'no-store, no-cache', + 'Pragma', + 'no-cache', + 'Content-Type', + 'application/json; charset=utf-8', + 'Expires', + '-1', + 'Strict-Transport-Security', + 'max-age=31536000; includeSubDomains', + 'X-Content-Type-Options', + 'nosniff', + 'P3P', + 'CP="DSP CUR OTPi IND OTRi ONL FIN"', + 'x-ms-request-id', + '2f2a3fa4-e575-45d7-8873-faa518720a00', + 'x-ms-ests-server', + '2.1.12261.14 - SEASLR2 ProdSlices', + 'x-ms-clitelem', + '1,0,0,,', + 'Set-Cookie', + 'fpc=AmznUzyecsZHj70Q1JRrbicWPr5BAQAAAOnhRNkOAAAA; expires=Sun, 09-Jan-2022 05:51:37 GMT; path=/; secure; HttpOnly; SameSite=None', + 'Set-Cookie', + 'x-ms-gateway-slice=estsfd; path=/; secure; samesite=none; httponly', + 'Set-Cookie', + 'stsservicecookie=estsfd; path=/; secure; samesite=none; httponly', + 'Date', + 'Fri, 10 Dec 2021 05:51:37 GMT', + 'Content-Length', + '1374' +]); + +nock('https://management.azure.com:443', {"encodedQueryParams":true}) + .delete('/subscriptions/azure_subscription_id/resourceGroups/myjstest/providers/Microsoft.Relay/namespaces/mynamespacexxx') + .query(true) + .reply(202, "", [ + 'Cache-Control', + 'no-cache', + 'Pragma', + 'no-cache', + 'Expires', + '-1', + 'Location', + 'https://management.azure.com/subscriptions/azure_subscription_id/resourceGroups/myjstest/providers/Microsoft.Relay/namespaces/mynamespacexxx/operationresults/mynamespacexxx?api-version=2017-04-01', + 'x-ms-request-id', + 'a7e9dc47-3c3a-4b04-91a2-3d8dcf61bbde_M0CH3_M0CH3', + 'Server-SB', + 'Service-Bus-Resource-Provider/CH3', + 'Server', + 'Service-Bus-Resource-Provider/CH3', + 'Server', + 'Microsoft-HTTPAPI/2.0', + 'x-ms-ratelimit-remaining-subscription-deletes', + '14997', + 'x-ms-correlation-request-id', + '0b269583-a0a7-42b5-a071-20d9004d0ab0', + 'x-ms-routing-request-id', + 'SOUTHEASTASIA:20211210T055139Z:0b269583-a0a7-42b5-a071-20d9004d0ab0', + 'Strict-Transport-Security', + 'max-age=31536000; includeSubDomains', + 'X-Content-Type-Options', + 'nosniff', + 'Date', + 'Fri, 10 Dec 2021 05:51:38 GMT', + 'Content-Length', + '0' +]); + +nock('https://management.azure.com:443', {"encodedQueryParams":true}) + .get('/subscriptions/azure_subscription_id/resourceGroups/myjstest/providers/Microsoft.Relay/namespaces/mynamespacexxx/operationresults/mynamespacexxx') + .query(true) + .reply(202, {"sku":{"name":"Standard","tier":"Standard"},"id":"/subscriptions/azure_subscription_id/resourceGroups/myjstest/providers/Microsoft.Relay/namespaces/mynamespacexxx","name":"mynamespacexxx","type":"Microsoft.Relay/Namespaces","location":"East US","tags":{"tag1":"value1","tag2":"value2","tag3":"value3"},"properties":{"provisioningState":"Succeeded","metricId":"azure_subscription_id:mynamespacexxx","createdAt":"2021-12-10T05:50:17.123Z","updatedAt":"2021-12-10T05:51:39.293Z","serviceBusEndpoint":"https://mynamespacexxx.servicebus.windows.net:443/","status":"Removing"}}, [ + 'Cache-Control', + 'no-cache', + 'Pragma', + 'no-cache', + 'Content-Length', + '602', + 'Content-Type', + 'application/json; charset=utf-8', + 'Expires', + '-1', + 'Location', + 'https://management.azure.com/subscriptions/azure_subscription_id/resourceGroups/myjstest/providers/Microsoft.Relay/namespaces/mynamespacexxx/operationresults/mynamespacexxx?api-version=2017-04-01', + 'Retry-After', + '33', + 'x-ms-request-id', + '227f7d78-c0f8-4530-bd37-491c2d3737f0_M6CH3_M6CH3', + 'Server-SB', + 'Service-Bus-Resource-Provider/CH3', + 'Server', + 'Service-Bus-Resource-Provider/CH3', + 'Server', + 'Microsoft-HTTPAPI/2.0', + 'x-ms-ratelimit-remaining-subscription-reads', + '11978', + 'x-ms-correlation-request-id', + '50d4cc19-8cad-49d8-961b-15e7d0f58a85', + 'x-ms-routing-request-id', + 'SOUTHEASTASIA:20211210T055139Z:50d4cc19-8cad-49d8-961b-15e7d0f58a85', + 'Strict-Transport-Security', + 'max-age=31536000; includeSubDomains', + 'X-Content-Type-Options', + 'nosniff', + 'Date', + 'Fri, 10 Dec 2021 05:51:39 GMT' +]); + +nock('https://management.azure.com:443', {"encodedQueryParams":true}) + .get('/subscriptions/azure_subscription_id/resourceGroups/myjstest/providers/Microsoft.Relay/namespaces/mynamespacexxx/operationresults/mynamespacexxx') + .query(true) + .reply(202, {"sku":{"name":"Standard","tier":"Standard"},"id":"/subscriptions/azure_subscription_id/resourceGroups/myjstest/providers/Microsoft.Relay/namespaces/mynamespacexxx","name":"mynamespacexxx","type":"Microsoft.Relay/Namespaces","location":"East US","tags":{"tag1":"value1","tag2":"value2","tag3":"value3"},"properties":{"provisioningState":"Succeeded","metricId":"azure_subscription_id:mynamespacexxx","createdAt":"2021-12-10T05:50:17.123Z","updatedAt":"2021-12-10T05:51:39.293Z","serviceBusEndpoint":"https://mynamespacexxx.servicebus.windows.net:443/","status":"Removing"}}, [ + 'Cache-Control', + 'no-cache', + 'Pragma', + 'no-cache', + 'Content-Length', + '602', + 'Content-Type', + 'application/json; charset=utf-8', + 'Expires', + '-1', + 'Location', + 'https://management.azure.com/subscriptions/azure_subscription_id/resourceGroups/myjstest/providers/Microsoft.Relay/namespaces/mynamespacexxx/operationresults/mynamespacexxx?api-version=2017-04-01', + 'Retry-After', + '52', + 'x-ms-request-id', + 'fe55175d-9d0a-4b70-9f82-7e58a011e5e9_M11CH3_M11CH3', + 'Server-SB', + 'Service-Bus-Resource-Provider/CH3', + 'Server', + 'Service-Bus-Resource-Provider/CH3', + 'Server', + 'Microsoft-HTTPAPI/2.0', + 'x-ms-ratelimit-remaining-subscription-reads', + '11977', + 'x-ms-correlation-request-id', + 'cb59600d-0aaf-4242-aaad-d4650b0f68ee', + 'x-ms-routing-request-id', + 'SOUTHEASTASIA:20211210T055142Z:cb59600d-0aaf-4242-aaad-d4650b0f68ee', + 'Strict-Transport-Security', + 'max-age=31536000; includeSubDomains', + 'X-Content-Type-Options', + 'nosniff', + 'Date', + 'Fri, 10 Dec 2021 05:51:41 GMT' +]); + +nock('https://management.azure.com:443', {"encodedQueryParams":true}) + .get('/subscriptions/azure_subscription_id/resourceGroups/myjstest/providers/Microsoft.Relay/namespaces/mynamespacexxx/operationresults/mynamespacexxx') + .query(true) + .reply(202, {"sku":{"name":"Standard","tier":"Standard"},"id":"/subscriptions/azure_subscription_id/resourceGroups/myjstest/providers/Microsoft.Relay/namespaces/mynamespacexxx","name":"mynamespacexxx","type":"Microsoft.Relay/Namespaces","location":"East US","tags":{"tag1":"value1","tag2":"value2","tag3":"value3"},"properties":{"provisioningState":"Succeeded","metricId":"azure_subscription_id:mynamespacexxx","createdAt":"2021-12-10T05:50:17.123Z","updatedAt":"2021-12-10T05:51:39.293Z","serviceBusEndpoint":"https://mynamespacexxx.servicebus.windows.net:443/","status":"Removing"}}, [ + 'Cache-Control', + 'no-cache', + 'Pragma', + 'no-cache', + 'Content-Length', + '602', + 'Content-Type', + 'application/json; charset=utf-8', + 'Expires', + '-1', + 'Location', + 'https://management.azure.com/subscriptions/azure_subscription_id/resourceGroups/myjstest/providers/Microsoft.Relay/namespaces/mynamespacexxx/operationresults/mynamespacexxx?api-version=2017-04-01', + 'Retry-After', + '57', + 'x-ms-request-id', + 'd26d5f9b-2127-4dd3-8a7e-597967f99de9_M10CH3_M10CH3', + 'Server-SB', + 'Service-Bus-Resource-Provider/CH3', + 'Server', + 'Service-Bus-Resource-Provider/CH3', + 'Server', + 'Microsoft-HTTPAPI/2.0', + 'x-ms-ratelimit-remaining-subscription-reads', + '11976', + 'x-ms-correlation-request-id', + 'efbc15ec-813b-45f9-bb49-416d855fed64', + 'x-ms-routing-request-id', + 'SOUTHEASTASIA:20211210T055143Z:efbc15ec-813b-45f9-bb49-416d855fed64', + 'Strict-Transport-Security', + 'max-age=31536000; includeSubDomains', + 'X-Content-Type-Options', + 'nosniff', + 'Date', + 'Fri, 10 Dec 2021 05:51:42 GMT' +]); + +nock('https://management.azure.com:443', {"encodedQueryParams":true}) + .get('/subscriptions/azure_subscription_id/resourceGroups/myjstest/providers/Microsoft.Relay/namespaces/mynamespacexxx/operationresults/mynamespacexxx') + .query(true) + .reply(202, {"sku":{"name":"Standard","tier":"Standard"},"id":"/subscriptions/azure_subscription_id/resourceGroups/myjstest/providers/Microsoft.Relay/namespaces/mynamespacexxx","name":"mynamespacexxx","type":"Microsoft.Relay/Namespaces","location":"East US","tags":{"tag1":"value1","tag2":"value2","tag3":"value3"},"properties":{"provisioningState":"Succeeded","metricId":"azure_subscription_id:mynamespacexxx","createdAt":"2021-12-10T05:50:17.123Z","updatedAt":"2021-12-10T05:51:39.293Z","serviceBusEndpoint":"https://mynamespacexxx.servicebus.windows.net:443/","status":"Removing"}}, [ + 'Cache-Control', + 'no-cache', + 'Pragma', + 'no-cache', + 'Content-Length', + '602', + 'Content-Type', + 'application/json; charset=utf-8', + 'Expires', + '-1', + 'Location', + 'https://management.azure.com/subscriptions/azure_subscription_id/resourceGroups/myjstest/providers/Microsoft.Relay/namespaces/mynamespacexxx/operationresults/mynamespacexxx?api-version=2017-04-01', + 'Retry-After', + '58', + 'x-ms-request-id', + 'f6fcdfce-3aa2-4562-a737-1d37f50deb4b_M1CH3_M1CH3', + 'Server-SB', + 'Service-Bus-Resource-Provider/CH3', + 'Server', + 'Service-Bus-Resource-Provider/CH3', + 'Server', + 'Microsoft-HTTPAPI/2.0', + 'x-ms-ratelimit-remaining-subscription-reads', + '11975', + 'x-ms-correlation-request-id', + 'baacbf96-8e2a-4bb8-a6df-55b0e78d1c8d', + 'x-ms-routing-request-id', + 'SOUTHEASTASIA:20211210T055145Z:baacbf96-8e2a-4bb8-a6df-55b0e78d1c8d', + 'Strict-Transport-Security', + 'max-age=31536000; includeSubDomains', + 'X-Content-Type-Options', + 'nosniff', + 'Date', + 'Fri, 10 Dec 2021 05:51:44 GMT' +]); + +nock('https://management.azure.com:443', {"encodedQueryParams":true}) + .get('/subscriptions/azure_subscription_id/resourceGroups/myjstest/providers/Microsoft.Relay/namespaces/mynamespacexxx/operationresults/mynamespacexxx') + .query(true) + .reply(202, {"sku":{"name":"Standard","tier":"Standard"},"id":"/subscriptions/azure_subscription_id/resourceGroups/myjstest/providers/Microsoft.Relay/namespaces/mynamespacexxx","name":"mynamespacexxx","type":"Microsoft.Relay/Namespaces","location":"East US","tags":{"tag1":"value1","tag2":"value2","tag3":"value3"},"properties":{"provisioningState":"Succeeded","metricId":"azure_subscription_id:mynamespacexxx","createdAt":"2021-12-10T05:50:17.123Z","updatedAt":"2021-12-10T05:51:39.293Z","serviceBusEndpoint":"https://mynamespacexxx.servicebus.windows.net:443/","status":"Removing"}}, [ + 'Cache-Control', + 'no-cache', + 'Pragma', + 'no-cache', + 'Content-Length', + '602', + 'Content-Type', + 'application/json; charset=utf-8', + 'Expires', + '-1', + 'Location', + 'https://management.azure.com/subscriptions/azure_subscription_id/resourceGroups/myjstest/providers/Microsoft.Relay/namespaces/mynamespacexxx/operationresults/mynamespacexxx?api-version=2017-04-01', + 'Retry-After', + '53', + 'x-ms-request-id', + '0baca29c-6353-43eb-8e07-a4b9a9b3cbe2_M11CH3_M11CH3', + 'Server-SB', + 'Service-Bus-Resource-Provider/CH3', + 'Server', + 'Service-Bus-Resource-Provider/CH3', + 'Server', + 'Microsoft-HTTPAPI/2.0', + 'x-ms-ratelimit-remaining-subscription-reads', + '11974', + 'x-ms-correlation-request-id', + '740ccd22-eac1-4ee4-b633-77f56cd08766', + 'x-ms-routing-request-id', + 'SOUTHEASTASIA:20211210T055146Z:740ccd22-eac1-4ee4-b633-77f56cd08766', + 'Strict-Transport-Security', + 'max-age=31536000; includeSubDomains', + 'X-Content-Type-Options', + 'nosniff', + 'Date', + 'Fri, 10 Dec 2021 05:51:45 GMT' +]); + +nock('https://management.azure.com:443', {"encodedQueryParams":true}) + .get('/subscriptions/azure_subscription_id/resourceGroups/myjstest/providers/Microsoft.Relay/namespaces/mynamespacexxx/operationresults/mynamespacexxx') + .query(true) + .reply(202, {"sku":{"name":"Standard","tier":"Standard"},"id":"/subscriptions/azure_subscription_id/resourceGroups/myjstest/providers/Microsoft.Relay/namespaces/mynamespacexxx","name":"mynamespacexxx","type":"Microsoft.Relay/Namespaces","location":"East US","tags":{"tag1":"value1","tag2":"value2","tag3":"value3"},"properties":{"provisioningState":"Succeeded","metricId":"azure_subscription_id:mynamespacexxx","createdAt":"2021-12-10T05:50:17.123Z","updatedAt":"2021-12-10T05:51:39.293Z","serviceBusEndpoint":"https://mynamespacexxx.servicebus.windows.net:443/","status":"Removing"}}, [ + 'Cache-Control', + 'no-cache', + 'Pragma', + 'no-cache', + 'Content-Length', + '602', + 'Content-Type', + 'application/json; charset=utf-8', + 'Expires', + '-1', + 'Location', + 'https://management.azure.com/subscriptions/azure_subscription_id/resourceGroups/myjstest/providers/Microsoft.Relay/namespaces/mynamespacexxx/operationresults/mynamespacexxx?api-version=2017-04-01', + 'Retry-After', + '54', + 'x-ms-request-id', + 'cdc7ea1c-ea53-4aed-913e-0bdf89c56a8f_M11CH3_M11CH3', + 'Server-SB', + 'Service-Bus-Resource-Provider/CH3', + 'Server', + 'Service-Bus-Resource-Provider/CH3', + 'Server', + 'Microsoft-HTTPAPI/2.0', + 'x-ms-ratelimit-remaining-subscription-reads', + '11973', + 'x-ms-correlation-request-id', + '1b22afc2-551a-4891-bbd3-236b181b3f1e', + 'x-ms-routing-request-id', + 'SOUTHEASTASIA:20211210T055147Z:1b22afc2-551a-4891-bbd3-236b181b3f1e', + 'Strict-Transport-Security', + 'max-age=31536000; includeSubDomains', + 'X-Content-Type-Options', + 'nosniff', + 'Date', + 'Fri, 10 Dec 2021 05:51:46 GMT' +]); + +nock('https://management.azure.com:443', {"encodedQueryParams":true}) + .get('/subscriptions/azure_subscription_id/resourceGroups/myjstest/providers/Microsoft.Relay/namespaces/mynamespacexxx/operationresults/mynamespacexxx') + .query(true) + .reply(202, {"sku":{"name":"Standard","tier":"Standard"},"id":"/subscriptions/azure_subscription_id/resourceGroups/myjstest/providers/Microsoft.Relay/namespaces/mynamespacexxx","name":"mynamespacexxx","type":"Microsoft.Relay/Namespaces","location":"East US","tags":{"tag1":"value1","tag2":"value2","tag3":"value3"},"properties":{"provisioningState":"Succeeded","metricId":"azure_subscription_id:mynamespacexxx","createdAt":"2021-12-10T05:50:17.123Z","updatedAt":"2021-12-10T05:51:39.293Z","serviceBusEndpoint":"https://mynamespacexxx.servicebus.windows.net:443/","status":"Removing"}}, [ + 'Cache-Control', + 'no-cache', + 'Pragma', + 'no-cache', + 'Content-Length', + '602', + 'Content-Type', + 'application/json; charset=utf-8', + 'Expires', + '-1', + 'Location', + 'https://management.azure.com/subscriptions/azure_subscription_id/resourceGroups/myjstest/providers/Microsoft.Relay/namespaces/mynamespacexxx/operationresults/mynamespacexxx?api-version=2017-04-01', + 'Retry-After', + '34', + 'x-ms-request-id', + 'cfb85e19-2268-4045-8ee0-7d5942df897e_M6CH3_M6CH3', + 'Server-SB', + 'Service-Bus-Resource-Provider/CH3', + 'Server', + 'Service-Bus-Resource-Provider/CH3', + 'Server', + 'Microsoft-HTTPAPI/2.0', + 'x-ms-ratelimit-remaining-subscription-reads', + '11972', + 'x-ms-correlation-request-id', + '4c8fc966-4924-4ae8-aa7b-2abe941c759a', + 'x-ms-routing-request-id', + 'SOUTHEASTASIA:20211210T055149Z:4c8fc966-4924-4ae8-aa7b-2abe941c759a', + 'Strict-Transport-Security', + 'max-age=31536000; includeSubDomains', + 'X-Content-Type-Options', + 'nosniff', + 'Date', + 'Fri, 10 Dec 2021 05:51:48 GMT' +]); + +nock('https://management.azure.com:443', {"encodedQueryParams":true}) + .get('/subscriptions/azure_subscription_id/resourceGroups/myjstest/providers/Microsoft.Relay/namespaces/mynamespacexxx/operationresults/mynamespacexxx') + .query(true) + .reply(202, {"sku":{"name":"Standard","tier":"Standard"},"id":"/subscriptions/azure_subscription_id/resourceGroups/myjstest/providers/Microsoft.Relay/namespaces/mynamespacexxx","name":"mynamespacexxx","type":"Microsoft.Relay/Namespaces","location":"East US","tags":{"tag1":"value1","tag2":"value2","tag3":"value3"},"properties":{"provisioningState":"Succeeded","metricId":"azure_subscription_id:mynamespacexxx","createdAt":"2021-12-10T05:50:17.123Z","updatedAt":"2021-12-10T05:51:39.293Z","serviceBusEndpoint":"https://mynamespacexxx.servicebus.windows.net:443/","status":"Removing"}}, [ + 'Cache-Control', + 'no-cache', + 'Pragma', + 'no-cache', + 'Content-Length', + '602', + 'Content-Type', + 'application/json; charset=utf-8', + 'Expires', + '-1', + 'Location', + 'https://management.azure.com/subscriptions/azure_subscription_id/resourceGroups/myjstest/providers/Microsoft.Relay/namespaces/mynamespacexxx/operationresults/mynamespacexxx?api-version=2017-04-01', + 'Retry-After', + '49', + 'x-ms-request-id', + '442c9a26-8887-4407-80f0-2783b80cab06_M7CH3_M7CH3', + 'Server-SB', + 'Service-Bus-Resource-Provider/CH3', + 'Server', + 'Service-Bus-Resource-Provider/CH3', + 'Server', + 'Microsoft-HTTPAPI/2.0', + 'x-ms-ratelimit-remaining-subscription-reads', + '11971', + 'x-ms-correlation-request-id', + '7eb21cf9-3f8b-4db0-becc-3f8e7c21d8b3', + 'x-ms-routing-request-id', + 'SOUTHEASTASIA:20211210T055150Z:7eb21cf9-3f8b-4db0-becc-3f8e7c21d8b3', + 'Strict-Transport-Security', + 'max-age=31536000; includeSubDomains', + 'X-Content-Type-Options', + 'nosniff', + 'Date', + 'Fri, 10 Dec 2021 05:51:49 GMT' +]); + +nock('https://management.azure.com:443', {"encodedQueryParams":true}) + .get('/subscriptions/azure_subscription_id/resourceGroups/myjstest/providers/Microsoft.Relay/namespaces/mynamespacexxx/operationresults/mynamespacexxx') + .query(true) + .reply(202, {"sku":{"name":"Standard","tier":"Standard"},"id":"/subscriptions/azure_subscription_id/resourceGroups/myjstest/providers/Microsoft.Relay/namespaces/mynamespacexxx","name":"mynamespacexxx","type":"Microsoft.Relay/Namespaces","location":"East US","tags":{"tag1":"value1","tag2":"value2","tag3":"value3"},"properties":{"provisioningState":"Succeeded","metricId":"azure_subscription_id:mynamespacexxx","createdAt":"2021-12-10T05:50:17.123Z","updatedAt":"2021-12-10T05:51:39.293Z","serviceBusEndpoint":"https://mynamespacexxx.servicebus.windows.net:443/","status":"Removing"}}, [ + 'Cache-Control', + 'no-cache', + 'Pragma', + 'no-cache', + 'Content-Length', + '602', + 'Content-Type', + 'application/json; charset=utf-8', + 'Expires', + '-1', + 'Location', + 'https://management.azure.com/subscriptions/azure_subscription_id/resourceGroups/myjstest/providers/Microsoft.Relay/namespaces/mynamespacexxx/operationresults/mynamespacexxx?api-version=2017-04-01', + 'Retry-After', + '37', + 'x-ms-request-id', + '67d1bd66-d636-4431-8bb0-d09acfe264e7_M0CH3_M0CH3', + 'Server-SB', + 'Service-Bus-Resource-Provider/CH3', + 'Server', + 'Service-Bus-Resource-Provider/CH3', + 'Server', + 'Microsoft-HTTPAPI/2.0', + 'x-ms-ratelimit-remaining-subscription-reads', + '11970', + 'x-ms-correlation-request-id', + '5564a3a8-eb62-4e14-a2b0-36e982ca2c3a', + 'x-ms-routing-request-id', + 'SOUTHEASTASIA:20211210T055152Z:5564a3a8-eb62-4e14-a2b0-36e982ca2c3a', + 'Strict-Transport-Security', + 'max-age=31536000; includeSubDomains', + 'X-Content-Type-Options', + 'nosniff', + 'Date', + 'Fri, 10 Dec 2021 05:51:51 GMT' +]); + +nock('https://management.azure.com:443', {"encodedQueryParams":true}) + .get('/subscriptions/azure_subscription_id/resourceGroups/myjstest/providers/Microsoft.Relay/namespaces/mynamespacexxx/operationresults/mynamespacexxx') + .query(true) + .reply(202, {"sku":{"name":"Standard","tier":"Standard"},"id":"/subscriptions/azure_subscription_id/resourceGroups/myjstest/providers/Microsoft.Relay/namespaces/mynamespacexxx","name":"mynamespacexxx","type":"Microsoft.Relay/Namespaces","location":"East US","tags":{"tag1":"value1","tag2":"value2","tag3":"value3"},"properties":{"provisioningState":"Succeeded","metricId":"azure_subscription_id:mynamespacexxx","createdAt":"2021-12-10T05:50:17.123Z","updatedAt":"2021-12-10T05:51:39.293Z","serviceBusEndpoint":"https://mynamespacexxx.servicebus.windows.net:443/","status":"Removing"}}, [ + 'Cache-Control', + 'no-cache', + 'Pragma', + 'no-cache', + 'Content-Length', + '602', + 'Content-Type', + 'application/json; charset=utf-8', + 'Expires', + '-1', + 'Location', + 'https://management.azure.com/subscriptions/azure_subscription_id/resourceGroups/myjstest/providers/Microsoft.Relay/namespaces/mynamespacexxx/operationresults/mynamespacexxx?api-version=2017-04-01', + 'Retry-After', + '42', + 'x-ms-request-id', + '9515141c-972e-4a34-a6c1-3004f96f2770_M0CH3_M0CH3', + 'Server-SB', + 'Service-Bus-Resource-Provider/CH3', + 'Server', + 'Service-Bus-Resource-Provider/CH3', + 'Server', + 'Microsoft-HTTPAPI/2.0', + 'x-ms-ratelimit-remaining-subscription-reads', + '11969', + 'x-ms-correlation-request-id', + '1d002d57-c014-426a-8c38-02f1b2cb26f9', + 'x-ms-routing-request-id', + 'SOUTHEASTASIA:20211210T055155Z:1d002d57-c014-426a-8c38-02f1b2cb26f9', + 'Strict-Transport-Security', + 'max-age=31536000; includeSubDomains', + 'X-Content-Type-Options', + 'nosniff', + 'Date', + 'Fri, 10 Dec 2021 05:51:54 GMT' +]); + +nock('https://management.azure.com:443', {"encodedQueryParams":true}) + .get('/subscriptions/azure_subscription_id/resourceGroups/myjstest/providers/Microsoft.Relay/namespaces/mynamespacexxx/operationresults/mynamespacexxx') + .query(true) + .reply(202, {"sku":{"name":"Standard","tier":"Standard"},"id":"/subscriptions/azure_subscription_id/resourceGroups/myjstest/providers/Microsoft.Relay/namespaces/mynamespacexxx","name":"mynamespacexxx","type":"Microsoft.Relay/Namespaces","location":"East US","tags":{"tag1":"value1","tag2":"value2","tag3":"value3"},"properties":{"provisioningState":"Succeeded","metricId":"azure_subscription_id:mynamespacexxx","createdAt":"2021-12-10T05:50:17.123Z","updatedAt":"2021-12-10T05:51:39.293Z","serviceBusEndpoint":"https://mynamespacexxx.servicebus.windows.net:443/","status":"Removing"}}, [ + 'Cache-Control', + 'no-cache', + 'Pragma', + 'no-cache', + 'Content-Length', + '602', + 'Content-Type', + 'application/json; charset=utf-8', + 'Expires', + '-1', + 'Location', + 'https://management.azure.com/subscriptions/azure_subscription_id/resourceGroups/myjstest/providers/Microsoft.Relay/namespaces/mynamespacexxx/operationresults/mynamespacexxx?api-version=2017-04-01', + 'Retry-After', + '43', + 'x-ms-request-id', + '073bfb95-038f-4004-aef8-6fe8d0ad4f42_M4CH3_M4CH3', + 'Server-SB', + 'Service-Bus-Resource-Provider/CH3', + 'Server', + 'Service-Bus-Resource-Provider/CH3', + 'Server', + 'Microsoft-HTTPAPI/2.0', + 'x-ms-ratelimit-remaining-subscription-reads', + '11968', + 'x-ms-correlation-request-id', + '0eeb22a9-1527-4dee-9c66-5246d599a80f', + 'x-ms-routing-request-id', + 'SOUTHEASTASIA:20211210T055156Z:0eeb22a9-1527-4dee-9c66-5246d599a80f', + 'Strict-Transport-Security', + 'max-age=31536000; includeSubDomains', + 'X-Content-Type-Options', + 'nosniff', + 'Date', + 'Fri, 10 Dec 2021 05:51:55 GMT' +]); + +nock('https://management.azure.com:443', {"encodedQueryParams":true}) + .get('/subscriptions/azure_subscription_id/resourceGroups/myjstest/providers/Microsoft.Relay/namespaces/mynamespacexxx/operationresults/mynamespacexxx') + .query(true) + .reply(202, {"sku":{"name":"Standard","tier":"Standard"},"id":"/subscriptions/azure_subscription_id/resourceGroups/myjstest/providers/Microsoft.Relay/namespaces/mynamespacexxx","name":"mynamespacexxx","type":"Microsoft.Relay/Namespaces","location":"East US","tags":{"tag1":"value1","tag2":"value2","tag3":"value3"},"properties":{"provisioningState":"Succeeded","metricId":"azure_subscription_id:mynamespacexxx","createdAt":"2021-12-10T05:50:17.123Z","updatedAt":"2021-12-10T05:51:39.293Z","serviceBusEndpoint":"https://mynamespacexxx.servicebus.windows.net:443/","status":"Removing"}}, [ + 'Cache-Control', + 'no-cache', + 'Pragma', + 'no-cache', + 'Content-Length', + '602', + 'Content-Type', + 'application/json; charset=utf-8', + 'Expires', + '-1', + 'Location', + 'https://management.azure.com/subscriptions/azure_subscription_id/resourceGroups/myjstest/providers/Microsoft.Relay/namespaces/mynamespacexxx/operationresults/mynamespacexxx?api-version=2017-04-01', + 'Retry-After', + '38', + 'x-ms-request-id', + 'd32e2bbf-fe65-40ff-a620-4d3bc3c4d76f_M10CH3_M10CH3', + 'Server-SB', + 'Service-Bus-Resource-Provider/CH3', + 'Server', + 'Service-Bus-Resource-Provider/CH3', + 'Server', + 'Microsoft-HTTPAPI/2.0', + 'x-ms-ratelimit-remaining-subscription-reads', + '11967', + 'x-ms-correlation-request-id', + '9dd6d085-5406-47a6-b8e3-57e71f6cef42', + 'x-ms-routing-request-id', + 'SOUTHEASTASIA:20211210T055157Z:9dd6d085-5406-47a6-b8e3-57e71f6cef42', + 'Strict-Transport-Security', + 'max-age=31536000; includeSubDomains', + 'X-Content-Type-Options', + 'nosniff', + 'Date', + 'Fri, 10 Dec 2021 05:51:56 GMT' +]); + +nock('https://management.azure.com:443', {"encodedQueryParams":true}) + .get('/subscriptions/azure_subscription_id/resourceGroups/myjstest/providers/Microsoft.Relay/namespaces/mynamespacexxx/operationresults/mynamespacexxx') + .query(true) + .reply(202, {"sku":{"name":"Standard","tier":"Standard"},"id":"/subscriptions/azure_subscription_id/resourceGroups/myjstest/providers/Microsoft.Relay/namespaces/mynamespacexxx","name":"mynamespacexxx","type":"Microsoft.Relay/Namespaces","location":"East US","tags":{"tag1":"value1","tag2":"value2","tag3":"value3"},"properties":{"provisioningState":"Succeeded","metricId":"azure_subscription_id:mynamespacexxx","createdAt":"2021-12-10T05:50:17.123Z","updatedAt":"2021-12-10T05:51:39.293Z","serviceBusEndpoint":"https://mynamespacexxx.servicebus.windows.net:443/","status":"Removing"}}, [ + 'Cache-Control', + 'no-cache', + 'Pragma', + 'no-cache', + 'Content-Length', + '602', + 'Content-Type', + 'application/json; charset=utf-8', + 'Expires', + '-1', + 'Location', + 'https://management.azure.com/subscriptions/azure_subscription_id/resourceGroups/myjstest/providers/Microsoft.Relay/namespaces/mynamespacexxx/operationresults/mynamespacexxx?api-version=2017-04-01', + 'Retry-After', + '38', + 'x-ms-request-id', + '0e097d55-422c-4815-981f-80aa535ecfd1_M10CH3_M10CH3', + 'Server-SB', + 'Service-Bus-Resource-Provider/CH3', + 'Server', + 'Service-Bus-Resource-Provider/CH3', + 'Server', + 'Microsoft-HTTPAPI/2.0', + 'x-ms-ratelimit-remaining-subscription-reads', + '11966', + 'x-ms-correlation-request-id', + '067556b2-c969-4681-944d-d553255a4862', + 'x-ms-routing-request-id', + 'SOUTHEASTASIA:20211210T055158Z:067556b2-c969-4681-944d-d553255a4862', + 'Strict-Transport-Security', + 'max-age=31536000; includeSubDomains', + 'X-Content-Type-Options', + 'nosniff', + 'Date', + 'Fri, 10 Dec 2021 05:51:57 GMT' +]); + +nock('https://management.azure.com:443', {"encodedQueryParams":true}) + .get('/subscriptions/azure_subscription_id/resourceGroups/myjstest/providers/Microsoft.Relay/namespaces/mynamespacexxx/operationresults/mynamespacexxx') + .query(true) + .reply(202, {"sku":{"name":"Standard","tier":"Standard"},"id":"/subscriptions/azure_subscription_id/resourceGroups/myjstest/providers/Microsoft.Relay/namespaces/mynamespacexxx","name":"mynamespacexxx","type":"Microsoft.Relay/Namespaces","location":"East US","tags":{"tag1":"value1","tag2":"value2","tag3":"value3"},"properties":{"provisioningState":"Succeeded","metricId":"azure_subscription_id:mynamespacexxx","createdAt":"2021-12-10T05:50:17.123Z","updatedAt":"2021-12-10T05:51:39.293Z","serviceBusEndpoint":"https://mynamespacexxx.servicebus.windows.net:443/","status":"Removing"}}, [ + 'Cache-Control', + 'no-cache', + 'Pragma', + 'no-cache', + 'Content-Length', + '602', + 'Content-Type', + 'application/json; charset=utf-8', + 'Expires', + '-1', + 'Location', + 'https://management.azure.com/subscriptions/azure_subscription_id/resourceGroups/myjstest/providers/Microsoft.Relay/namespaces/mynamespacexxx/operationresults/mynamespacexxx?api-version=2017-04-01', + 'Retry-After', + '48', + 'x-ms-request-id', + 'bf657f13-8dac-4f68-b31f-246b9ecccda9_M10CH3_M10CH3', + 'Server-SB', + 'Service-Bus-Resource-Provider/CH3', + 'Server', + 'Service-Bus-Resource-Provider/CH3', + 'Server', + 'Microsoft-HTTPAPI/2.0', + 'x-ms-ratelimit-remaining-subscription-reads', + '11965', + 'x-ms-correlation-request-id', + 'c55b99d8-99e0-486e-95a6-ff18f6aa42fa', + 'x-ms-routing-request-id', + 'SOUTHEASTASIA:20211210T055159Z:c55b99d8-99e0-486e-95a6-ff18f6aa42fa', + 'Strict-Transport-Security', + 'max-age=31536000; includeSubDomains', + 'X-Content-Type-Options', + 'nosniff', + 'Date', + 'Fri, 10 Dec 2021 05:51:58 GMT' +]); + +nock('https://management.azure.com:443', {"encodedQueryParams":true}) + .get('/subscriptions/azure_subscription_id/resourceGroups/myjstest/providers/Microsoft.Relay/namespaces/mynamespacexxx/operationresults/mynamespacexxx') + .query(true) + .reply(202, {"sku":{"name":"Standard","tier":"Standard"},"id":"/subscriptions/azure_subscription_id/resourceGroups/myjstest/providers/Microsoft.Relay/namespaces/mynamespacexxx","name":"mynamespacexxx","type":"Microsoft.Relay/Namespaces","location":"East US","tags":{"tag1":"value1","tag2":"value2","tag3":"value3"},"properties":{"provisioningState":"Succeeded","metricId":"azure_subscription_id:mynamespacexxx","createdAt":"2021-12-10T05:50:17.123Z","updatedAt":"2021-12-10T05:51:39.293Z","serviceBusEndpoint":"https://mynamespacexxx.servicebus.windows.net:443/","status":"Removing"}}, [ + 'Cache-Control', + 'no-cache', + 'Pragma', + 'no-cache', + 'Content-Length', + '602', + 'Content-Type', + 'application/json; charset=utf-8', + 'Expires', + '-1', + 'Location', + 'https://management.azure.com/subscriptions/azure_subscription_id/resourceGroups/myjstest/providers/Microsoft.Relay/namespaces/mynamespacexxx/operationresults/mynamespacexxx?api-version=2017-04-01', + 'Retry-After', + '46', + 'x-ms-request-id', + '744976ad-aeee-48b9-9acc-e87cac5f749d_M7CH3_M7CH3', + 'Server-SB', + 'Service-Bus-Resource-Provider/CH3', + 'Server', + 'Service-Bus-Resource-Provider/CH3', + 'Server', + 'Microsoft-HTTPAPI/2.0', + 'x-ms-ratelimit-remaining-subscription-reads', + '11964', + 'x-ms-correlation-request-id', + '2e936a6b-613a-4e35-8ad0-cc4941e27ee7', + 'x-ms-routing-request-id', + 'SOUTHEASTASIA:20211210T055201Z:2e936a6b-613a-4e35-8ad0-cc4941e27ee7', + 'Strict-Transport-Security', + 'max-age=31536000; includeSubDomains', + 'X-Content-Type-Options', + 'nosniff', + 'Date', + 'Fri, 10 Dec 2021 05:52:01 GMT' +]); + +nock('https://management.azure.com:443', {"encodedQueryParams":true}) + .get('/subscriptions/azure_subscription_id/resourceGroups/myjstest/providers/Microsoft.Relay/namespaces/mynamespacexxx/operationresults/mynamespacexxx') + .query(true) + .reply(202, {"sku":{"name":"Standard","tier":"Standard"},"id":"/subscriptions/azure_subscription_id/resourceGroups/myjstest/providers/Microsoft.Relay/namespaces/mynamespacexxx","name":"mynamespacexxx","type":"Microsoft.Relay/Namespaces","location":"East US","tags":{"tag1":"value1","tag2":"value2","tag3":"value3"},"properties":{"provisioningState":"Succeeded","metricId":"azure_subscription_id:mynamespacexxx","createdAt":"2021-12-10T05:50:17.123Z","updatedAt":"2021-12-10T05:51:39.293Z","serviceBusEndpoint":"https://mynamespacexxx.servicebus.windows.net:443/","status":"Removing"}}, [ + 'Cache-Control', + 'no-cache', + 'Pragma', + 'no-cache', + 'Content-Length', + '602', + 'Content-Type', + 'application/json; charset=utf-8', + 'Expires', + '-1', + 'Location', + 'https://management.azure.com/subscriptions/azure_subscription_id/resourceGroups/myjstest/providers/Microsoft.Relay/namespaces/mynamespacexxx/operationresults/mynamespacexxx?api-version=2017-04-01', + 'Retry-After', + '42', + 'x-ms-request-id', + '749c486e-dce1-423b-b114-e804a02a4a45_M1CH3_M1CH3', + 'Server-SB', + 'Service-Bus-Resource-Provider/CH3', + 'Server', + 'Service-Bus-Resource-Provider/CH3', + 'Server', + 'Microsoft-HTTPAPI/2.0', + 'x-ms-ratelimit-remaining-subscription-reads', + '11963', + 'x-ms-correlation-request-id', + '6f2817da-39ee-4ec5-9029-86bef43b39d5', + 'x-ms-routing-request-id', + 'SOUTHEASTASIA:20211210T055202Z:6f2817da-39ee-4ec5-9029-86bef43b39d5', + 'Strict-Transport-Security', + 'max-age=31536000; includeSubDomains', + 'X-Content-Type-Options', + 'nosniff', + 'Date', + 'Fri, 10 Dec 2021 05:52:02 GMT' +]); + +nock('https://management.azure.com:443', {"encodedQueryParams":true}) + .get('/subscriptions/azure_subscription_id/resourceGroups/myjstest/providers/Microsoft.Relay/namespaces/mynamespacexxx/operationresults/mynamespacexxx') + .query(true) + .reply(200, "", [ + 'Cache-Control', + 'no-cache', + 'Pragma', + 'no-cache', + 'Expires', + '-1', + 'x-ms-request-id', + '20724fcb-f573-4e56-80b1-6b95a74d2986_M0CH3_M0CH3', + 'Server-SB', + 'Service-Bus-Resource-Provider/CH3', + 'Server', + 'Service-Bus-Resource-Provider/CH3', + 'Server', + 'Microsoft-HTTPAPI/2.0', + 'x-ms-ratelimit-remaining-subscription-reads', + '11962', + 'x-ms-correlation-request-id', + '4a74d3bd-41f7-4c27-8acf-a8474b1f57ed', + 'x-ms-routing-request-id', + 'SOUTHEASTASIA:20211210T055204Z:4a74d3bd-41f7-4c27-8acf-a8474b1f57ed', + 'Strict-Transport-Security', + 'max-age=31536000; includeSubDomains', + 'X-Content-Type-Options', + 'nosniff', + 'Date', + 'Fri, 10 Dec 2021 05:52:04 GMT', + 'Content-Length', + '0' +]); + +nock('https://management.azure.com:443', {"encodedQueryParams":true}) + .get('/subscriptions/azure_subscription_id/resourceGroups/myjstest/providers/Microsoft.Relay/namespaces') + .query(true) + .reply(200, ["1f8b0800000000000400edbd07601c499625262f6dca7b7f4af54ad7e074a10880601324d8904010ecc188cde692ec1d69472329ab2a81ca6556655d661640cced9dbcf7de7befbdf7de7befbdf7ba3b9d4e27f7dfff3f5c6664016cf6ce4adac99e2180aac81f3f7e7c1f3f227ef1479759b9ce3f7af4bdefff","92ff0742ea40440c000000"], [ + 'Cache-Control', + 'no-cache', + 'Pragma', + 'no-cache', + 'Transfer-Encoding', + 'chunked', + 'Content-Type', + 'application/json; charset=utf-8', + 'Content-Encoding', + 'gzip', + 'Expires', + '-1', + 'Vary', + 'Accept-Encoding', + 'x-ms-request-id', + 'efb68426-482a-417b-9739-830c5a8d49c7_M0CH3_M0CH3', + 'Server-SB', + 'Service-Bus-Resource-Provider/CH3', + 'Server', + 'Service-Bus-Resource-Provider/CH3', + 'Server', + 'Microsoft-HTTPAPI/2.0', + 'x-ms-ratelimit-remaining-subscription-reads', + '11961', + 'x-ms-correlation-request-id', + 'c275d1d5-18d3-4e02-811b-d130ee764292', + 'x-ms-routing-request-id', + 'SOUTHEASTASIA:20211210T055204Z:c275d1d5-18d3-4e02-811b-d130ee764292', + 'Strict-Transport-Security', + 'max-age=31536000; includeSubDomains', + 'X-Content-Type-Options', + 'nosniff', + 'Date', + 'Fri, 10 Dec 2021 05:52:04 GMT' +]); diff --git a/sdk/relay/arm-relay/recordings/node/relay_test/recording_namespaces_get_test.js b/sdk/relay/arm-relay/recordings/node/relay_test/recording_namespaces_get_test.js new file mode 100644 index 000000000000..66ccadd9e39a --- /dev/null +++ b/sdk/relay/arm-relay/recordings/node/relay_test/recording_namespaces_get_test.js @@ -0,0 +1,151 @@ +let nock = require('nock'); + +module.exports.hash = "d86a34d0632b273cc64395b2fefe23c0"; + +module.exports.testInfo = {"uniqueName":{},"newDate":{}} + +nock('https://login.microsoftonline.com:443', {"encodedQueryParams":true}) + .get('/common/discovery/instance') + .query(true) + .reply(200, {"tenant_discovery_endpoint":"https://login.microsoftonline.com/88888888-8888-8888-8888-888888888888/v2.0/.well-known/openid-configuration","api-version":"1.1","metadata":[{"preferred_network":"login.microsoftonline.com","preferred_cache":"login.windows.net","aliases":["login.microsoftonline.com","login.windows.net","login.microsoft.com","sts.windows.net"]},{"preferred_network":"login.partner.microsoftonline.cn","preferred_cache":"login.partner.microsoftonline.cn","aliases":["login.partner.microsoftonline.cn","login.chinacloudapi.cn"]},{"preferred_network":"login.microsoftonline.de","preferred_cache":"login.microsoftonline.de","aliases":["login.microsoftonline.de"]},{"preferred_network":"login.microsoftonline.us","preferred_cache":"login.microsoftonline.us","aliases":["login.microsoftonline.us","login.usgovcloudapi.net"]},{"preferred_network":"login-us.microsoftonline.com","preferred_cache":"login-us.microsoftonline.com","aliases":["login-us.microsoftonline.com"]}]}, [ + 'Cache-Control', + 'max-age=86400, private', + 'Content-Type', + 'application/json; charset=utf-8', + 'Strict-Transport-Security', + 'max-age=31536000; includeSubDomains', + 'X-Content-Type-Options', + 'nosniff', + 'Access-Control-Allow-Origin', + '*', + 'Access-Control-Allow-Methods', + 'GET, OPTIONS', + 'P3P', + 'CP="DSP CUR OTPi IND OTRi ONL FIN"', + 'x-ms-request-id', + '1306231f-1899-4d48-aeca-9001f3140b00', + 'x-ms-ests-server', + '2.1.12261.14 - SEASLR1 ProdSlices', + 'Set-Cookie', + 'fpc=Ai7LI5N1jBlDksL7eIJr2Vg; expires=Sun, 09-Jan-2022 05:51:00 GMT; path=/; secure; HttpOnly; SameSite=None', + 'Set-Cookie', + 'esctx=AQABAAAAAAD--DLA3VO7QrddgJg7Wevr4hPLr-fR-XI0QlrCslr18ydZeZIFsFAi1yog959w21FK_u6rzEdkSVobi6HUuUMu7vOQUqFJ6FP5nyeIyqd6M7ULTLf5RKdrDvmMb2cqusNnP3g8PVH_Qa3SHiUvNla8PTk0JCdEArfiu26Y7HPjeyXgzoajMaTibRr4W-KY4ksgAA; domain=.login.microsoftonline.com; path=/; secure; HttpOnly; SameSite=None', + 'Set-Cookie', + 'x-ms-gateway-slice=estsfd; path=/; secure; samesite=none; httponly', + 'Set-Cookie', + 'stsservicecookie=estsfd; path=/; secure; samesite=none; httponly', + 'Date', + 'Fri, 10 Dec 2021 05:51:00 GMT', + 'Content-Length', + '980' +]); + +nock('https://login.microsoftonline.com:443', {"encodedQueryParams":true}) + .get('/88888888-8888-8888-8888-888888888888/v2.0/.well-known/openid-configuration') + .reply(200, {"token_endpoint":"https://login.microsoftonline.com/88888888-8888-8888-8888-888888888888/oauth2/v2.0/token","token_endpoint_auth_methods_supported":["client_secret_post","private_key_jwt","client_secret_basic"],"jwks_uri":"https://login.microsoftonline.com/88888888-8888-8888-8888-888888888888/discovery/v2.0/keys","response_modes_supported":["query","fragment","form_post"],"subject_types_supported":["pairwise"],"id_token_signing_alg_values_supported":["RS256"],"response_types_supported":["code","id_token","code id_token","id_token token"],"scopes_supported":["openid","profile","email","offline_access"],"issuer":"https://login.microsoftonline.com/88888888-8888-8888-8888-888888888888/v2.0","request_uri_parameter_supported":false,"userinfo_endpoint":"https://graph.microsoft.com/oidc/userinfo","authorization_endpoint":"https://login.microsoftonline.com/88888888-8888-8888-8888-888888888888/oauth2/v2.0/authorize","device_authorization_endpoint":"https://login.microsoftonline.com/88888888-8888-8888-8888-888888888888/oauth2/v2.0/devicecode","http_logout_supported":true,"frontchannel_logout_supported":true,"end_session_endpoint":"https://login.microsoftonline.com/88888888-8888-8888-8888-888888888888/oauth2/v2.0/logout","claims_supported":["sub","iss","cloud_instance_name","cloud_instance_host_name","cloud_graph_host_name","msgraph_host","aud","exp","iat","auth_time","acr","nonce","preferred_username","name","tid","ver","at_hash","c_hash","email"],"kerberos_endpoint":"https://login.microsoftonline.com/88888888-8888-8888-8888-888888888888/kerberos","tenant_region_scope":"WW","cloud_instance_name":"microsoftonline.com","cloud_graph_host_name":"graph.windows.net","msgraph_host":"graph.microsoft.com","rbac_url":"https://pas.windows.net"}, [ + 'Cache-Control', + 'max-age=86400, private', + 'Content-Type', + 'application/json; charset=utf-8', + 'Strict-Transport-Security', + 'max-age=31536000; includeSubDomains', + 'X-Content-Type-Options', + 'nosniff', + 'Access-Control-Allow-Origin', + '*', + 'Access-Control-Allow-Methods', + 'GET, OPTIONS', + 'P3P', + 'CP="DSP CUR OTPi IND OTRi ONL FIN"', + 'x-ms-request-id', + '20616d55-2ea3-43e7-9507-b18da7f70a00', + 'x-ms-ests-server', + '2.1.12261.14 - SEASLR1 ProdSlices', + 'Set-Cookie', + 'fpc=Ajca620D3iNKlJ2nqusVUUo; expires=Sun, 09-Jan-2022 05:51:00 GMT; path=/; secure; HttpOnly; SameSite=None', + 'Set-Cookie', + 'esctx=AQABAAAAAAD--DLA3VO7QrddgJg7Wevrmx5liEdWwzzpBw0oUVnplxhMClUbX3IDP9WnqofzsR76AlpNq-wtgFqGOOsCuOLeFhv3QeB3fEP4oWFQ_lGInqqj9cG6gSMnKbwANOMT5EwoH6GPg80qa-G-TW0S7B6xtFwEQ49nA8p5Hr_qOJoCdGcVjwPowKD-4oG3m8b5XgQgAA; domain=.login.microsoftonline.com; path=/; secure; HttpOnly; SameSite=None', + 'Set-Cookie', + 'x-ms-gateway-slice=estsfd; path=/; secure; samesite=none; httponly', + 'Set-Cookie', + 'stsservicecookie=estsfd; path=/; secure; samesite=none; httponly', + 'Date', + 'Fri, 10 Dec 2021 05:51:00 GMT', + 'Content-Length', + '1753' +]); + +nock('https://login.microsoftonline.com:443', {"encodedQueryParams":true}) + .post('/88888888-8888-8888-8888-888888888888/oauth2/v2.0/token', "client_id=azure_client_id&scope=https%3A%2F%2Fsanitized%2F&grant_type=client_credentials&x-client-SKU=msal.js.node&x-client-VER=1.3.3&x-client-OS=win32&x-client-CPU=x64&x-ms-lib-capability=retry-after, h429&x-client-current-telemetry=5|771,2,,,|,&x-client-last-telemetry=5|0|||0,0&client-request-id=9278fab5-e5af-4eff-8c0c-1e37f119f022&client_secret=azure_client_secret&claims=%7B%22access_token%22%3A%7B%22xms_cc%22%3A%7B%22values%22%3A%5B%22cp1%22%5D%7D%7D%7D") + .reply(200, {"token_type":"Bearer","expires_in":86399,"ext_expires_in":86399,"access_token":"access_token"}, [ + 'Cache-Control', + 'no-store, no-cache', + 'Pragma', + 'no-cache', + 'Content-Type', + 'application/json; charset=utf-8', + 'Expires', + '-1', + 'Strict-Transport-Security', + 'max-age=31536000; includeSubDomains', + 'X-Content-Type-Options', + 'nosniff', + 'P3P', + 'CP="DSP CUR OTPi IND OTRi ONL FIN"', + 'x-ms-request-id', + '25e1b200-ca8c-4386-a214-6e125bba0a00', + 'x-ms-ests-server', + '2.1.12261.14 - SEASLR2 ProdSlices', + 'x-ms-clitelem', + '1,0,0,,', + 'Set-Cookie', + 'fpc=Aqo2siGpSflHkdiZW-uAsd8WPr5BAQAAAMThRNkOAAAA; expires=Sun, 09-Jan-2022 05:51:01 GMT; path=/; secure; HttpOnly; SameSite=None', + 'Set-Cookie', + 'x-ms-gateway-slice=estsfd; path=/; secure; samesite=none; httponly', + 'Set-Cookie', + 'stsservicecookie=estsfd; path=/; secure; samesite=none; httponly', + 'Date', + 'Fri, 10 Dec 2021 05:51:01 GMT', + 'Content-Length', + '1374' +]); + +nock('https://management.azure.com:443', {"encodedQueryParams":true}) + .get('/subscriptions/azure_subscription_id/resourceGroups/myjstest/providers/Microsoft.Relay/namespaces/mynamespacexxx') + .query(true) + .reply(200, ["1f8b0800000000000400edbd07601c499625262f6dca7b7f4af54ad7e074a10880601324d8904010ecc188cde692ec1d69472329ab2a81ca6556655d661640cced9dbcf7de7befbdf7de7befbdf7ba3b9d4e27f7dfff3f5c6664016cf6ce4adac99e2180aac81f3f7e7c1f3f227ef147cddbf5478f7ef147cb6c917ff4e8a3d76db69c65f5eca3d1476d91d7fe27bf64f45131a30fee36eb4933ad8b555b54cbe6eec3bdf387f76707e7dbf7a69f3ed8dedfdddbdf7eb83b7db07d303ddf79309d4dcef7f677efd67953adeb69fe795dad57cdddc5f54f376ddeb47757757559ccf2bab9fb4531adaba63a6fc7aff232bbbe0b7c9a5536cdd1dafef1eedd3bc20c7f1222bdcfdbeb153eef827a615a35d4a6aca61910a776a759d3a65fbda60fdbeca20111e8e72e7d719995eb7c170326fc56794d94e0afe9afcba2a1978be50591a54567afd7d3699ecf72506c91b775313d03916e439547bd014ceb9ca0ce8e5b82b0b7b3b7bbbdbbb7bdbbf366e7fea3fb3b8f761f8c77f7eefd14355baf66c3cdee3f1c1fec3d40b326af2f8b69fe64dd9c2e67abaa58a2fdbc6d57cda3bb1da28eb5ed64dd8caf8ae5acba6ac6cbbc7db4bf7fef2e20d160d744828f8ea76d71997ff44b7e","c9ff0354517f5838020000"], [ + 'Cache-Control', + 'no-cache', + 'Pragma', + 'no-cache', + 'Transfer-Encoding', + 'chunked', + 'Content-Type', + 'application/json; charset=utf-8', + 'Content-Encoding', + 'gzip', + 'Expires', + '-1', + 'Vary', + 'Accept-Encoding', + 'x-ms-request-id', + '50b3044d-8388-4aec-8d36-8b9b948cb1cb_M11CH3_M11CH3', + 'Server-SB', + 'Service-Bus-Resource-Provider/CH3', + 'Server', + 'Service-Bus-Resource-Provider/CH3', + 'Server', + 'Microsoft-HTTPAPI/2.0', + 'x-ms-ratelimit-remaining-subscription-reads', + '11986', + 'x-ms-correlation-request-id', + '03474520-0233-43cc-8566-fa27d9d86cd0', + 'x-ms-routing-request-id', + 'SOUTHEASTASIA:20211210T055102Z:03474520-0233-43cc-8566-fa27d9d86cd0', + 'Strict-Transport-Security', + 'max-age=31536000; includeSubDomains', + 'X-Content-Type-Options', + 'nosniff', + 'Date', + 'Fri, 10 Dec 2021 05:51:02 GMT' +]); diff --git a/sdk/relay/arm-relay/recordings/node/relay_test/recording_namespaces_list_test.js b/sdk/relay/arm-relay/recordings/node/relay_test/recording_namespaces_list_test.js new file mode 100644 index 000000000000..c5472353ef27 --- /dev/null +++ b/sdk/relay/arm-relay/recordings/node/relay_test/recording_namespaces_list_test.js @@ -0,0 +1,153 @@ +let nock = require('nock'); + +module.exports.hash = "722f58834472f1ead1a36525fe6227c9"; + +module.exports.testInfo = {"uniqueName":{},"newDate":{}} + +nock('https://login.microsoftonline.com:443', {"encodedQueryParams":true}) + .get('/common/discovery/instance') + .query(true) + .reply(200, {"tenant_discovery_endpoint":"https://login.microsoftonline.com/88888888-8888-8888-8888-888888888888/v2.0/.well-known/openid-configuration","api-version":"1.1","metadata":[{"preferred_network":"login.microsoftonline.com","preferred_cache":"login.windows.net","aliases":["login.microsoftonline.com","login.windows.net","login.microsoft.com","sts.windows.net"]},{"preferred_network":"login.partner.microsoftonline.cn","preferred_cache":"login.partner.microsoftonline.cn","aliases":["login.partner.microsoftonline.cn","login.chinacloudapi.cn"]},{"preferred_network":"login.microsoftonline.de","preferred_cache":"login.microsoftonline.de","aliases":["login.microsoftonline.de"]},{"preferred_network":"login.microsoftonline.us","preferred_cache":"login.microsoftonline.us","aliases":["login.microsoftonline.us","login.usgovcloudapi.net"]},{"preferred_network":"login-us.microsoftonline.com","preferred_cache":"login-us.microsoftonline.com","aliases":["login-us.microsoftonline.com"]}]}, [ + 'Cache-Control', + 'max-age=86400, private', + 'Content-Type', + 'application/json; charset=utf-8', + 'Strict-Transport-Security', + 'max-age=31536000; includeSubDomains', + 'X-Content-Type-Options', + 'nosniff', + 'Access-Control-Allow-Origin', + '*', + 'Access-Control-Allow-Methods', + 'GET, OPTIONS', + 'P3P', + 'CP="DSP CUR OTPi IND OTRi ONL FIN"', + 'x-ms-request-id', + '25e1b200-ca8c-4386-a214-6e1268ba0a00', + 'x-ms-ests-server', + '2.1.12261.14 - SEASLR2 ProdSlices', + 'Set-Cookie', + 'fpc=ApkJyeu6V65GmY8LWStj3qA; expires=Sun, 09-Jan-2022 05:51:02 GMT; path=/; secure; HttpOnly; SameSite=None', + 'Set-Cookie', + 'esctx=AQABAAAAAAD--DLA3VO7QrddgJg7WevrwSaDBKOdKMBJQQs1OTQjUE23Rx_3oQH_79qOyii6ABKoJWy6FC-G-zJ0lGk8DRG7pH9xUQAkLbWpazempZB_RRn-uGgvxTqGJ7fH2XG4tV5EGgcyRS946RLdQlzYx3lZ9x4BzCimiQNuXEomN-eJ50el4WzryEZf3Rj_iLlZdI0gAA; domain=.login.microsoftonline.com; path=/; secure; HttpOnly; SameSite=None', + 'Set-Cookie', + 'x-ms-gateway-slice=estsfd; path=/; secure; samesite=none; httponly', + 'Set-Cookie', + 'stsservicecookie=estsfd; path=/; secure; samesite=none; httponly', + 'Date', + 'Fri, 10 Dec 2021 05:51:02 GMT', + 'Content-Length', + '980' +]); + +nock('https://login.microsoftonline.com:443', {"encodedQueryParams":true}) + .get('/88888888-8888-8888-8888-888888888888/v2.0/.well-known/openid-configuration') + .reply(200, {"token_endpoint":"https://login.microsoftonline.com/88888888-8888-8888-8888-888888888888/oauth2/v2.0/token","token_endpoint_auth_methods_supported":["client_secret_post","private_key_jwt","client_secret_basic"],"jwks_uri":"https://login.microsoftonline.com/88888888-8888-8888-8888-888888888888/discovery/v2.0/keys","response_modes_supported":["query","fragment","form_post"],"subject_types_supported":["pairwise"],"id_token_signing_alg_values_supported":["RS256"],"response_types_supported":["code","id_token","code id_token","id_token token"],"scopes_supported":["openid","profile","email","offline_access"],"issuer":"https://login.microsoftonline.com/88888888-8888-8888-8888-888888888888/v2.0","request_uri_parameter_supported":false,"userinfo_endpoint":"https://graph.microsoft.com/oidc/userinfo","authorization_endpoint":"https://login.microsoftonline.com/88888888-8888-8888-8888-888888888888/oauth2/v2.0/authorize","device_authorization_endpoint":"https://login.microsoftonline.com/88888888-8888-8888-8888-888888888888/oauth2/v2.0/devicecode","http_logout_supported":true,"frontchannel_logout_supported":true,"end_session_endpoint":"https://login.microsoftonline.com/88888888-8888-8888-8888-888888888888/oauth2/v2.0/logout","claims_supported":["sub","iss","cloud_instance_name","cloud_instance_host_name","cloud_graph_host_name","msgraph_host","aud","exp","iat","auth_time","acr","nonce","preferred_username","name","tid","ver","at_hash","c_hash","email"],"kerberos_endpoint":"https://login.microsoftonline.com/88888888-8888-8888-8888-888888888888/kerberos","tenant_region_scope":"WW","cloud_instance_name":"microsoftonline.com","cloud_graph_host_name":"graph.windows.net","msgraph_host":"graph.microsoft.com","rbac_url":"https://pas.windows.net"}, [ + 'Cache-Control', + 'max-age=86400, private', + 'Content-Type', + 'application/json; charset=utf-8', + 'Strict-Transport-Security', + 'max-age=31536000; includeSubDomains', + 'X-Content-Type-Options', + 'nosniff', + 'Access-Control-Allow-Origin', + '*', + 'Access-Control-Allow-Methods', + 'GET, OPTIONS', + 'P3P', + 'CP="DSP CUR OTPi IND OTRi ONL FIN"', + 'x-ms-request-id', + '41c02d2e-ea5c-4c6b-b8a9-d8681aed0a00', + 'x-ms-ests-server', + '2.1.12261.14 - KRSLR2 ProdSlices', + 'Set-Cookie', + 'fpc=AsDfyQ1cfAZJt9ULfGAnWIU; expires=Sun, 09-Jan-2022 05:51:03 GMT; path=/; secure; HttpOnly; SameSite=None', + 'Set-Cookie', + 'esctx=AQABAAAAAAD--DLA3VO7QrddgJg7WevrePsgdlJY688Fb0uCAAwH1BuATGzwZrA1krhr4O4Ij0G_bRYsuLsFX7rUdAtkl9KHWuluDAFhWPa7TYZxXOBBoA1QXmHv-30vUhgV1FpiWX9vT7cbPSBb4dEcJpyHTrId0S1ZZdWE7H-thLHzEu6MrRIa9xF4Wmt2tfWe-2yUGbogAA; domain=.login.microsoftonline.com; path=/; secure; HttpOnly; SameSite=None', + 'Set-Cookie', + 'x-ms-gateway-slice=estsfd; path=/; secure; samesite=none; httponly', + 'Set-Cookie', + 'stsservicecookie=estsfd; path=/; secure; samesite=none; httponly', + 'Date', + 'Fri, 10 Dec 2021 05:51:02 GMT', + 'Content-Length', + '1753' +]); + +nock('https://login.microsoftonline.com:443', {"encodedQueryParams":true}) + .post('/88888888-8888-8888-8888-888888888888/oauth2/v2.0/token', "client_id=azure_client_id&scope=https%3A%2F%2Fsanitized%2F&grant_type=client_credentials&x-client-SKU=msal.js.node&x-client-VER=1.3.3&x-client-OS=win32&x-client-CPU=x64&x-ms-lib-capability=retry-after, h429&x-client-current-telemetry=5|771,2,,,|,&x-client-last-telemetry=5|0|||0,0&client-request-id=6fdba6a8-5833-4078-a5e0-e076882d3513&client_secret=azure_client_secret&claims=%7B%22access_token%22%3A%7B%22xms_cc%22%3A%7B%22values%22%3A%5B%22cp1%22%5D%7D%7D%7D") + .reply(200, {"token_type":"Bearer","expires_in":86399,"ext_expires_in":86399,"access_token":"access_token"}, [ + 'Cache-Control', + 'no-store, no-cache', + 'Pragma', + 'no-cache', + 'Content-Type', + 'application/json; charset=utf-8', + 'Expires', + '-1', + 'Strict-Transport-Security', + 'max-age=31536000; includeSubDomains', + 'X-Content-Type-Options', + 'nosniff', + 'P3P', + 'CP="DSP CUR OTPi IND OTRi ONL FIN"', + 'x-ms-request-id', + '41c02d2e-ea5c-4c6b-b8a9-d8681eed0a00', + 'x-ms-ests-server', + '2.1.12261.14 - KRSLR2 ProdSlices', + 'x-ms-clitelem', + '1,0,0,,', + 'Set-Cookie', + 'fpc=AmYEORn4x91PmH5XNg0YZ2oWPr5BAQAAAMbhRNkOAAAA; expires=Sun, 09-Jan-2022 05:51:03 GMT; path=/; secure; HttpOnly; SameSite=None', + 'Set-Cookie', + 'x-ms-gateway-slice=estsfd; path=/; secure; samesite=none; httponly', + 'Set-Cookie', + 'stsservicecookie=estsfd; path=/; secure; samesite=none; httponly', + 'Date', + 'Fri, 10 Dec 2021 05:51:03 GMT', + 'Content-Length', + '1374' +]); + +nock('https://management.azure.com:443', {"encodedQueryParams":true}) + .get('/subscriptions/azure_subscription_id/providers/Microsoft.Relay/namespaces') + .query(true) + .reply(200, ["1f8b0800000000000400edbd07601c499625262f6dca7b7f4af54ad7e074a10880601324d8904010ecc188cde692ec1d69472329ab2a81ca6556655d661640cced9dbcf7de7befbdf7de7befbdf7ba3b9d4e27f7dfff3f5c6664016cf6ce4adac99e2180aac81f3f7e7c1f3f227ef1479759b9ce3f7af4bd5ffc51f376fdd1a35ffcd1325bd0df1fbd6eb3e52cab671f8d3e6a8bbcf63ff925a38f8a197d70b7594f9a695dacdaa25a36771fee9d3fbc3f3b38dfbe37fdf4c1f6feeedefef6c3dde983ed83e9f9ce83e96c72beb7bf7bb7ce9b6a5d4ff3cfeb6abd6aee2eae7fba69f3a6bdbbaaabcb6296d7cddd2f8a695d35d5793b7e9597d9f55de0d3acb2698ed6f68f77efde1166f89310e97dde5eaff07917d40bd3aaa1366535cd8038b53bcd9a36fdea357dd866170d88403f77e90b26ce2e064cf8adf29a28c15fd35f9745432f17cb0b224b8bce5eafa7d33c9fe5a0d8226feb627a0622dd862a8f7a0398d639419d1db704616f676f777b776f7b77e7cdcefd47f7771eed3e18efeeddfb296ab65ecd869bdd7f383ed87b80664d5e5f16d3fcc9ba395dce5655b144fb79dbae9a47773b441d6bdbc9ba195f15cb5975d58c9779fb687fffde5d40a2c1ae89041f1d4fdbe232ffe897fc92efff","92ff078f7eb1a944020000"], [ + 'Cache-Control', + 'no-cache', + 'Pragma', + 'no-cache', + 'Transfer-Encoding', + 'chunked', + 'Content-Type', + 'application/json; charset=utf-8', + 'Content-Encoding', + 'gzip', + 'Expires', + '-1', + 'Vary', + 'Accept-Encoding', + 'x-ms-inline-count', + '', + 'x-ms-request-id', + '5a935082-27b0-47a5-b3f7-bf526f825d63_M6CH3_M6CH3', + 'Server-SB', + 'Service-Bus-Resource-Provider/CH3', + 'Server', + 'Service-Bus-Resource-Provider/CH3', + 'Server', + 'Microsoft-HTTPAPI/2.0', + 'x-ms-ratelimit-remaining-subscription-reads', + '11985', + 'x-ms-correlation-request-id', + '6f97db0f-cc12-4f78-8cd5-3c30b1d8aec8', + 'x-ms-routing-request-id', + 'SOUTHEASTASIA:20211210T055104Z:6f97db0f-cc12-4f78-8cd5-3c30b1d8aec8', + 'Strict-Transport-Security', + 'max-age=31536000; includeSubDomains', + 'X-Content-Type-Options', + 'nosniff', + 'Date', + 'Fri, 10 Dec 2021 05:51:04 GMT' +]); diff --git a/sdk/relay/arm-relay/recordings/node/relay_test/recording_namespaces_update_test.js b/sdk/relay/arm-relay/recordings/node/relay_test/recording_namespaces_update_test.js new file mode 100644 index 000000000000..04674d37afd0 --- /dev/null +++ b/sdk/relay/arm-relay/recordings/node/relay_test/recording_namespaces_update_test.js @@ -0,0 +1,151 @@ +let nock = require('nock'); + +module.exports.hash = "b0baa90dfbc30c2a1d4522fe8e07f150"; + +module.exports.testInfo = {"uniqueName":{},"newDate":{}} + +nock('https://login.microsoftonline.com:443', {"encodedQueryParams":true}) + .get('/common/discovery/instance') + .query(true) + .reply(200, {"tenant_discovery_endpoint":"https://login.microsoftonline.com/88888888-8888-8888-8888-888888888888/v2.0/.well-known/openid-configuration","api-version":"1.1","metadata":[{"preferred_network":"login.microsoftonline.com","preferred_cache":"login.windows.net","aliases":["login.microsoftonline.com","login.windows.net","login.microsoft.com","sts.windows.net"]},{"preferred_network":"login.partner.microsoftonline.cn","preferred_cache":"login.partner.microsoftonline.cn","aliases":["login.partner.microsoftonline.cn","login.chinacloudapi.cn"]},{"preferred_network":"login.microsoftonline.de","preferred_cache":"login.microsoftonline.de","aliases":["login.microsoftonline.de"]},{"preferred_network":"login.microsoftonline.us","preferred_cache":"login.microsoftonline.us","aliases":["login.microsoftonline.us","login.usgovcloudapi.net"]},{"preferred_network":"login-us.microsoftonline.com","preferred_cache":"login-us.microsoftonline.com","aliases":["login-us.microsoftonline.com"]}]}, [ + 'Cache-Control', + 'max-age=86400, private', + 'Content-Type', + 'application/json; charset=utf-8', + 'Strict-Transport-Security', + 'max-age=31536000; includeSubDomains', + 'X-Content-Type-Options', + 'nosniff', + 'Access-Control-Allow-Origin', + '*', + 'Access-Control-Allow-Methods', + 'GET, OPTIONS', + 'P3P', + 'CP="DSP CUR OTPi IND OTRi ONL FIN"', + 'x-ms-request-id', + 'db2a9199-e54d-47bc-9a5f-7621d20a0b00', + 'x-ms-ests-server', + '2.1.12261.14 - SEASLR1 ProdSlices', + 'Set-Cookie', + 'fpc=Al4B0Xb9SaRLjfdxIU4J1UM; expires=Sun, 09-Jan-2022 05:51:05 GMT; path=/; secure; HttpOnly; SameSite=None', + 'Set-Cookie', + 'esctx=AQABAAAAAAD--DLA3VO7QrddgJg7Wevr3boq18gQrD_oZ1gFh6_kVTejwXFSrnX5Vf-n983S_Huy7kCve0GLxlVqBgzD4Vu_fJUt2IGDojX5dEOFyQV5iNE0kgmRC6DX7kugcydyi-p97pcOUbrOy65O0zu4bNDNKvj5EbSdNOo1noxpJQLdXDDz7DRh6LHhIypzM0OkA2EgAA; domain=.login.microsoftonline.com; path=/; secure; HttpOnly; SameSite=None', + 'Set-Cookie', + 'x-ms-gateway-slice=estsfd; path=/; secure; samesite=none; httponly', + 'Set-Cookie', + 'stsservicecookie=estsfd; path=/; secure; samesite=none; httponly', + 'Date', + 'Fri, 10 Dec 2021 05:51:05 GMT', + 'Content-Length', + '980' +]); + +nock('https://login.microsoftonline.com:443', {"encodedQueryParams":true}) + .get('/88888888-8888-8888-8888-888888888888/v2.0/.well-known/openid-configuration') + .reply(200, {"token_endpoint":"https://login.microsoftonline.com/88888888-8888-8888-8888-888888888888/oauth2/v2.0/token","token_endpoint_auth_methods_supported":["client_secret_post","private_key_jwt","client_secret_basic"],"jwks_uri":"https://login.microsoftonline.com/88888888-8888-8888-8888-888888888888/discovery/v2.0/keys","response_modes_supported":["query","fragment","form_post"],"subject_types_supported":["pairwise"],"id_token_signing_alg_values_supported":["RS256"],"response_types_supported":["code","id_token","code id_token","id_token token"],"scopes_supported":["openid","profile","email","offline_access"],"issuer":"https://login.microsoftonline.com/88888888-8888-8888-8888-888888888888/v2.0","request_uri_parameter_supported":false,"userinfo_endpoint":"https://graph.microsoft.com/oidc/userinfo","authorization_endpoint":"https://login.microsoftonline.com/88888888-8888-8888-8888-888888888888/oauth2/v2.0/authorize","device_authorization_endpoint":"https://login.microsoftonline.com/88888888-8888-8888-8888-888888888888/oauth2/v2.0/devicecode","http_logout_supported":true,"frontchannel_logout_supported":true,"end_session_endpoint":"https://login.microsoftonline.com/88888888-8888-8888-8888-888888888888/oauth2/v2.0/logout","claims_supported":["sub","iss","cloud_instance_name","cloud_instance_host_name","cloud_graph_host_name","msgraph_host","aud","exp","iat","auth_time","acr","nonce","preferred_username","name","tid","ver","at_hash","c_hash","email"],"kerberos_endpoint":"https://login.microsoftonline.com/88888888-8888-8888-8888-888888888888/kerberos","tenant_region_scope":"WW","cloud_instance_name":"microsoftonline.com","cloud_graph_host_name":"graph.windows.net","msgraph_host":"graph.microsoft.com","rbac_url":"https://pas.windows.net"}, [ + 'Cache-Control', + 'max-age=86400, private', + 'Content-Type', + 'application/json; charset=utf-8', + 'Strict-Transport-Security', + 'max-age=31536000; includeSubDomains', + 'X-Content-Type-Options', + 'nosniff', + 'Access-Control-Allow-Origin', + '*', + 'Access-Control-Allow-Methods', + 'GET, OPTIONS', + 'P3P', + 'CP="DSP CUR OTPi IND OTRi ONL FIN"', + 'x-ms-request-id', + '25e1b200-ca8c-4386-a214-6e127dba0a00', + 'x-ms-ests-server', + '2.1.12261.14 - SEASLR2 ProdSlices', + 'Set-Cookie', + 'fpc=AvqDM8oQL4FJqDDQAz5z6uI; expires=Sun, 09-Jan-2022 05:51:05 GMT; path=/; secure; HttpOnly; SameSite=None', + 'Set-Cookie', + 'esctx=AQABAAAAAAD--DLA3VO7QrddgJg7Wevr7gdwyfkXRsYjH2GuuWtlNfqs1tPf3GY-A0rqziwc1s7auBby0BS_S0FU7uMPivxwqXKu6phPxN8jf6oenkW93By3kxDkf9HTDVA-JtgfS5DpEks6_yxjXGQtwC9C53kRH6UCwxAaImIXTbIAu_4FfsNQ8-RRpMd9qcimfhqubCwgAA; domain=.login.microsoftonline.com; path=/; secure; HttpOnly; SameSite=None', + 'Set-Cookie', + 'x-ms-gateway-slice=estsfd; path=/; secure; samesite=none; httponly', + 'Set-Cookie', + 'stsservicecookie=estsfd; path=/; secure; samesite=none; httponly', + 'Date', + 'Fri, 10 Dec 2021 05:51:05 GMT', + 'Content-Length', + '1753' +]); + +nock('https://login.microsoftonline.com:443', {"encodedQueryParams":true}) + .post('/88888888-8888-8888-8888-888888888888/oauth2/v2.0/token', "client_id=azure_client_id&scope=https%3A%2F%2Fsanitized%2F&grant_type=client_credentials&x-client-SKU=msal.js.node&x-client-VER=1.3.3&x-client-OS=win32&x-client-CPU=x64&x-ms-lib-capability=retry-after, h429&x-client-current-telemetry=5|771,2,,,|,&x-client-last-telemetry=5|0|||0,0&client-request-id=5106d09f-f977-4749-8d93-fb720e6e7693&client_secret=azure_client_secret&claims=%7B%22access_token%22%3A%7B%22xms_cc%22%3A%7B%22values%22%3A%5B%22cp1%22%5D%7D%7D%7D") + .reply(200, {"token_type":"Bearer","expires_in":86399,"ext_expires_in":86399,"access_token":"access_token"}, [ + 'Cache-Control', + 'no-store, no-cache', + 'Pragma', + 'no-cache', + 'Content-Type', + 'application/json; charset=utf-8', + 'Expires', + '-1', + 'Strict-Transport-Security', + 'max-age=31536000; includeSubDomains', + 'X-Content-Type-Options', + 'nosniff', + 'P3P', + 'CP="DSP CUR OTPi IND OTRi ONL FIN"', + 'x-ms-request-id', + '056f2747-a290-418e-88dc-c95888480a00', + 'x-ms-ests-server', + '2.1.12261.14 - SEASLR2 ProdSlices', + 'x-ms-clitelem', + '1,0,0,,', + 'Set-Cookie', + 'fpc=AichwAVAekJBgDmynjsPfdYWPr5BAQAAAMnhRNkOAAAA; expires=Sun, 09-Jan-2022 05:51:05 GMT; path=/; secure; HttpOnly; SameSite=None', + 'Set-Cookie', + 'x-ms-gateway-slice=estsfd; path=/; secure; samesite=none; httponly', + 'Set-Cookie', + 'stsservicecookie=estsfd; path=/; secure; samesite=none; httponly', + 'Date', + 'Fri, 10 Dec 2021 05:51:05 GMT', + 'Content-Length', + '1374' +]); + +nock('https://management.azure.com:443', {"encodedQueryParams":true}) + .patch('/subscriptions/azure_subscription_id/resourceGroups/myjstest/providers/Microsoft.Relay/namespaces/mynamespacexxx', {"tags":{"tag1":"value1","tag2":"value2","tag3":"value3"}}) + .query(true) + .reply(200, ["1f8b0800000000000400edbd07601c499625262f6dca7b7f4af54ad7e074a10880601324d8904010ecc188cde692ec1d69472329ab2a81ca6556655d661640cced9dbcf7de7befbdf7de7befbdf7ba3b9d4e27f7dfff3f5c6664016cf6ce4adac99e2180aac81f3f7e7c1f3f227ef147cddbf5478f7ef147cb6c917ff4e8a3d76db69c65f5eca3d1476d91d7fe27bf64f45131a30fee36eb4933ad8b555b54cbe6eec3bdf387f76707e7dbf7a69f3ed8dedfdddbdf7eb83b7db07d303ddf79309d4dcef7f677efd67953adeb69fe795dad57cdddc5f54f376ddeb47757757559ccf2bab9fb4531adaba63a6fc7aff232bbbe0b7c9a5536cdd1dafef1eedd3bc20c7f1222bdcfdbeb153eef827a615a35d4a6aca61910a776a759d3a65fbda60fdbeca20111e8e72e7d719995eb7c573edf337fefc9dff7ccdff74010c27f95d744297e9dfeba2c1a025e2c2f886c2d90f96a35a3fe9617f4f6226feb627a061ade86688f7ae39bd639019d1db704616f676f777b776f7b77e7cdcefd47f7771eed3e18efeeddfb296ab64697f166bb8f760ec60f3e7d80664d5e5f16d3fcc9ba395dce5655b144fb79dbae9a47773b341f6bdbc9ba195f15cb5975d58c9779fb687fffde5d40a2b1ae89021f1d4fdbe25286fb4b","7ec9ff03302d84425b020000"], [ + 'Cache-Control', + 'no-cache', + 'Pragma', + 'no-cache', + 'Transfer-Encoding', + 'chunked', + 'Content-Type', + 'application/json; charset=utf-8', + 'Content-Encoding', + 'gzip', + 'Expires', + '-1', + 'Vary', + 'Accept-Encoding', + 'x-ms-request-id', + 'e29970de-bf07-4f46-abc3-292588b100c9_M4CH3_M4CH3', + 'Server-SB', + 'Service-Bus-Resource-Provider/CH3', + 'Server', + 'Service-Bus-Resource-Provider/CH3', + 'Server', + 'Microsoft-HTTPAPI/2.0', + 'x-ms-ratelimit-remaining-subscription-writes', + '1198', + 'x-ms-correlation-request-id', + 'ad2b1a1f-80cd-4d47-b008-f36d450f75e0', + 'x-ms-routing-request-id', + 'SOUTHEASTASIA:20211210T055111Z:ad2b1a1f-80cd-4d47-b008-f36d450f75e0', + 'Strict-Transport-Security', + 'max-age=31536000; includeSubDomains', + 'X-Content-Type-Options', + 'nosniff', + 'Date', + 'Fri, 10 Dec 2021 05:51:11 GMT' +]); diff --git a/sdk/relay/arm-relay/recordings/node/relay_test/recording_wcfrelays_create_test.js b/sdk/relay/arm-relay/recordings/node/relay_test/recording_wcfrelays_create_test.js new file mode 100644 index 000000000000..57fc2d8ca46c --- /dev/null +++ b/sdk/relay/arm-relay/recordings/node/relay_test/recording_wcfrelays_create_test.js @@ -0,0 +1,151 @@ +let nock = require('nock'); + +module.exports.hash = "bbc20c238fef37bfe122586fa03f1f54"; + +module.exports.testInfo = {"uniqueName":{},"newDate":{}} + +nock('https://login.microsoftonline.com:443', {"encodedQueryParams":true}) + .get('/common/discovery/instance') + .query(true) + .reply(200, {"tenant_discovery_endpoint":"https://login.microsoftonline.com/88888888-8888-8888-8888-888888888888/v2.0/.well-known/openid-configuration","api-version":"1.1","metadata":[{"preferred_network":"login.microsoftonline.com","preferred_cache":"login.windows.net","aliases":["login.microsoftonline.com","login.windows.net","login.microsoft.com","sts.windows.net"]},{"preferred_network":"login.partner.microsoftonline.cn","preferred_cache":"login.partner.microsoftonline.cn","aliases":["login.partner.microsoftonline.cn","login.chinacloudapi.cn"]},{"preferred_network":"login.microsoftonline.de","preferred_cache":"login.microsoftonline.de","aliases":["login.microsoftonline.de"]},{"preferred_network":"login.microsoftonline.us","preferred_cache":"login.microsoftonline.us","aliases":["login.microsoftonline.us","login.usgovcloudapi.net"]},{"preferred_network":"login-us.microsoftonline.com","preferred_cache":"login-us.microsoftonline.com","aliases":["login-us.microsoftonline.com"]}]}, [ + 'Cache-Control', + 'max-age=86400, private', + 'Content-Type', + 'application/json; charset=utf-8', + 'Strict-Transport-Security', + 'max-age=31536000; includeSubDomains', + 'X-Content-Type-Options', + 'nosniff', + 'Access-Control-Allow-Origin', + '*', + 'Access-Control-Allow-Methods', + 'GET, OPTIONS', + 'P3P', + 'CP="DSP CUR OTPi IND OTRi ONL FIN"', + 'x-ms-request-id', + '84e10da0-7734-4177-95ed-c3438bdb0b00', + 'x-ms-ests-server', + '2.1.12261.14 - KRSLR1 ProdSlices', + 'Set-Cookie', + 'fpc=Ar5xokX4JIBPnhrKB_U6k1s; expires=Sun, 09-Jan-2022 05:51:11 GMT; path=/; secure; HttpOnly; SameSite=None', + 'Set-Cookie', + 'esctx=AQABAAAAAAD--DLA3VO7QrddgJg7WevrfHBNpfXca5OC0QB7d3Es-B6l2pPXLGBFNPwEr9DOpkIEbNZK48mOoQXXSuYiHRUbOMcZ2v2Fl86RUm9yOD6zrCnanmpCJyFSbm6H5sRONl_DOkr4_Ktu8e6XKKxFWsQTbuGyokXEiZep0n_pGT_ad3nMxS7eYsugDV1vrfjMckcgAA; domain=.login.microsoftonline.com; path=/; secure; HttpOnly; SameSite=None', + 'Set-Cookie', + 'x-ms-gateway-slice=estsfd; path=/; secure; samesite=none; httponly', + 'Set-Cookie', + 'stsservicecookie=estsfd; path=/; secure; samesite=none; httponly', + 'Date', + 'Fri, 10 Dec 2021 05:51:11 GMT', + 'Content-Length', + '980' +]); + +nock('https://login.microsoftonline.com:443', {"encodedQueryParams":true}) + .get('/88888888-8888-8888-8888-888888888888/v2.0/.well-known/openid-configuration') + .reply(200, {"token_endpoint":"https://login.microsoftonline.com/88888888-8888-8888-8888-888888888888/oauth2/v2.0/token","token_endpoint_auth_methods_supported":["client_secret_post","private_key_jwt","client_secret_basic"],"jwks_uri":"https://login.microsoftonline.com/88888888-8888-8888-8888-888888888888/discovery/v2.0/keys","response_modes_supported":["query","fragment","form_post"],"subject_types_supported":["pairwise"],"id_token_signing_alg_values_supported":["RS256"],"response_types_supported":["code","id_token","code id_token","id_token token"],"scopes_supported":["openid","profile","email","offline_access"],"issuer":"https://login.microsoftonline.com/88888888-8888-8888-8888-888888888888/v2.0","request_uri_parameter_supported":false,"userinfo_endpoint":"https://graph.microsoft.com/oidc/userinfo","authorization_endpoint":"https://login.microsoftonline.com/88888888-8888-8888-8888-888888888888/oauth2/v2.0/authorize","device_authorization_endpoint":"https://login.microsoftonline.com/88888888-8888-8888-8888-888888888888/oauth2/v2.0/devicecode","http_logout_supported":true,"frontchannel_logout_supported":true,"end_session_endpoint":"https://login.microsoftonline.com/88888888-8888-8888-8888-888888888888/oauth2/v2.0/logout","claims_supported":["sub","iss","cloud_instance_name","cloud_instance_host_name","cloud_graph_host_name","msgraph_host","aud","exp","iat","auth_time","acr","nonce","preferred_username","name","tid","ver","at_hash","c_hash","email"],"kerberos_endpoint":"https://login.microsoftonline.com/88888888-8888-8888-8888-888888888888/kerberos","tenant_region_scope":"WW","cloud_instance_name":"microsoftonline.com","cloud_graph_host_name":"graph.windows.net","msgraph_host":"graph.microsoft.com","rbac_url":"https://pas.windows.net"}, [ + 'Cache-Control', + 'max-age=86400, private', + 'Content-Type', + 'application/json; charset=utf-8', + 'Strict-Transport-Security', + 'max-age=31536000; includeSubDomains', + 'X-Content-Type-Options', + 'nosniff', + 'Access-Control-Allow-Origin', + '*', + 'Access-Control-Allow-Methods', + 'GET, OPTIONS', + 'P3P', + 'CP="DSP CUR OTPi IND OTRi ONL FIN"', + 'x-ms-request-id', + '1306231f-1899-4d48-aeca-900152150b00', + 'x-ms-ests-server', + '2.1.12261.14 - SEASLR1 ProdSlices', + 'Set-Cookie', + 'fpc=Aoz2td0p5IhJkeoqLZ-W4Ws; expires=Sun, 09-Jan-2022 05:51:12 GMT; path=/; secure; HttpOnly; SameSite=None', + 'Set-Cookie', + 'esctx=AQABAAAAAAD--DLA3VO7QrddgJg7WevrROCZK94tiJMN7YuglQk3eLw2K9F3c6hSl8BdZRZPLYJ6LZNK8lH0eHPppls_4t-z6KgZAqjpRP24JXpNLJOmC8D_Tbt10Ta4nLT4Hd1TdwwT3pF7ifiYxdt5tLfIhqL4j3E36ExB3QgLg9ZLUyGYEOklni2vqXqJsWrMI6JKd3sgAA; domain=.login.microsoftonline.com; path=/; secure; HttpOnly; SameSite=None', + 'Set-Cookie', + 'x-ms-gateway-slice=estsfd; path=/; secure; samesite=none; httponly', + 'Set-Cookie', + 'stsservicecookie=estsfd; path=/; secure; samesite=none; httponly', + 'Date', + 'Fri, 10 Dec 2021 05:51:11 GMT', + 'Content-Length', + '1753' +]); + +nock('https://login.microsoftonline.com:443', {"encodedQueryParams":true}) + .post('/88888888-8888-8888-8888-888888888888/oauth2/v2.0/token', "client_id=azure_client_id&scope=https%3A%2F%2Fsanitized%2F&grant_type=client_credentials&x-client-SKU=msal.js.node&x-client-VER=1.3.3&x-client-OS=win32&x-client-CPU=x64&x-ms-lib-capability=retry-after, h429&x-client-current-telemetry=5|771,2,,,|,&x-client-last-telemetry=5|0|||0,0&client-request-id=5e5517c4-4829-42c6-bf2d-a4b1a80e051f&client_secret=azure_client_secret&claims=%7B%22access_token%22%3A%7B%22xms_cc%22%3A%7B%22values%22%3A%5B%22cp1%22%5D%7D%7D%7D") + .reply(200, {"token_type":"Bearer","expires_in":86399,"ext_expires_in":86399,"access_token":"access_token"}, [ + 'Cache-Control', + 'no-store, no-cache', + 'Pragma', + 'no-cache', + 'Content-Type', + 'application/json; charset=utf-8', + 'Expires', + '-1', + 'Strict-Transport-Security', + 'max-age=31536000; includeSubDomains', + 'X-Content-Type-Options', + 'nosniff', + 'P3P', + 'CP="DSP CUR OTPi IND OTRi ONL FIN"', + 'x-ms-request-id', + '25e1b200-ca8c-4386-a214-6e12b0ba0a00', + 'x-ms-ests-server', + '2.1.12261.14 - SEASLR2 ProdSlices', + 'x-ms-clitelem', + '1,0,0,,', + 'Set-Cookie', + 'fpc=AuYwPDfoXVVBrJhXkzW5E2cWPr5BAQAAANDhRNkOAAAA; expires=Sun, 09-Jan-2022 05:51:12 GMT; path=/; secure; HttpOnly; SameSite=None', + 'Set-Cookie', + 'x-ms-gateway-slice=estsfd; path=/; secure; samesite=none; httponly', + 'Set-Cookie', + 'stsservicecookie=estsfd; path=/; secure; samesite=none; httponly', + 'Date', + 'Fri, 10 Dec 2021 05:51:12 GMT', + 'Content-Length', + '1374' +]); + +nock('https://management.azure.com:443', {"encodedQueryParams":true}) + .put('/subscriptions/azure_subscription_id/resourceGroups/myjstest/providers/Microsoft.Relay/namespaces/mynamespacexxx/wcfRelays/myrelayxxx', {"properties":{"relayType":"NetTcp","requiresClientAuthorization":true,"requiresTransportSecurity":true}}) + .query(true) + .reply(200, ["1f8b0800000000000400edbd07601c499625262f6dca7b7f4af54ad7e074a10880601324d8904010ecc188cde692ec1d69472329ab2a81ca6556655d661640cced9dbcf7de7befbdf7de7befbdf7ba3b9d4e27f7dfff3f5c6664016cf6ce4adac99e2180aac81f3f7e7c1f3f227ef147c5eca3471fdd6dd693665a17abb6a896cddd877be70fefcf0eceb7ef4d3f7db0bdbfbbb7bffd7077fa60fb607abef3603a9b9cefedefdeadf3a65ad7d3fcf3ba5aaf9abb8beb9f6edabc69efaeeaeab298e57573f78b625a574d75de8e5fe565767d77992df266954d73b4b67fbc7bf7eeeed5f49c9be08b1abfd0871f8d3e421bc22ef8acbd5ee1b32eec17d494c13577bf6b8051ebb29a661813bd719a356dfad56bfa90305ce5755be4cd478f7ef147d33acfda7c76dc529bbd9dbdddedddbdeddd9d373bf71fdddf7db47b7f7c6fe7e1feceee839fa217d7abd96d9b9605516399d727d57a49cd77461fd5f92f5a1744b493b2c897edf1ba9d5775f103c5aeadd7399a10da6f64802ff2f6cd744590cc7b6fea6cd9acaaba7d9d4fd775d15e9bb78ae629a8594c3f7a749e954dfe4b7e","c9ff03d7c84178d6010000"], [ + 'Cache-Control', + 'no-cache', + 'Pragma', + 'no-cache', + 'Transfer-Encoding', + 'chunked', + 'Content-Type', + 'application/json; charset=utf-8', + 'Content-Encoding', + 'gzip', + 'Expires', + '-1', + 'Vary', + 'Accept-Encoding', + 'x-ms-request-id', + '17470838-72a0-4b1a-928b-879df359ca50_M3CH3_M3CH3', + 'Server-SB', + 'Service-Bus-Resource-Provider/CH3', + 'Server', + 'Service-Bus-Resource-Provider/CH3', + 'Server', + 'Microsoft-HTTPAPI/2.0', + 'x-ms-ratelimit-remaining-subscription-writes', + '1197', + 'x-ms-correlation-request-id', + '6e01b72a-06e0-4143-9b39-5978d438e2e8', + 'x-ms-routing-request-id', + 'SOUTHEASTASIA:20211210T055115Z:6e01b72a-06e0-4143-9b39-5978d438e2e8', + 'Strict-Transport-Security', + 'max-age=31536000; includeSubDomains', + 'X-Content-Type-Options', + 'nosniff', + 'Date', + 'Fri, 10 Dec 2021 05:51:15 GMT' +]); diff --git a/sdk/relay/arm-relay/recordings/node/relay_test/recording_wcfrelays_createorupdateauthorizationrule_test.js b/sdk/relay/arm-relay/recordings/node/relay_test/recording_wcfrelays_createorupdateauthorizationrule_test.js new file mode 100644 index 000000000000..50856a853a85 --- /dev/null +++ b/sdk/relay/arm-relay/recordings/node/relay_test/recording_wcfrelays_createorupdateauthorizationrule_test.js @@ -0,0 +1,151 @@ +let nock = require('nock'); + +module.exports.hash = "d30fb3cdd2890be1ffa60969d1b437cd"; + +module.exports.testInfo = {"uniqueName":{},"newDate":{}} + +nock('https://login.microsoftonline.com:443', {"encodedQueryParams":true}) + .get('/common/discovery/instance') + .query(true) + .reply(200, {"tenant_discovery_endpoint":"https://login.microsoftonline.com/88888888-8888-8888-8888-888888888888/v2.0/.well-known/openid-configuration","api-version":"1.1","metadata":[{"preferred_network":"login.microsoftonline.com","preferred_cache":"login.windows.net","aliases":["login.microsoftonline.com","login.windows.net","login.microsoft.com","sts.windows.net"]},{"preferred_network":"login.partner.microsoftonline.cn","preferred_cache":"login.partner.microsoftonline.cn","aliases":["login.partner.microsoftonline.cn","login.chinacloudapi.cn"]},{"preferred_network":"login.microsoftonline.de","preferred_cache":"login.microsoftonline.de","aliases":["login.microsoftonline.de"]},{"preferred_network":"login.microsoftonline.us","preferred_cache":"login.microsoftonline.us","aliases":["login.microsoftonline.us","login.usgovcloudapi.net"]},{"preferred_network":"login-us.microsoftonline.com","preferred_cache":"login-us.microsoftonline.com","aliases":["login-us.microsoftonline.com"]}]}, [ + 'Cache-Control', + 'max-age=86400, private', + 'Content-Type', + 'application/json; charset=utf-8', + 'Strict-Transport-Security', + 'max-age=31536000; includeSubDomains', + 'X-Content-Type-Options', + 'nosniff', + 'Access-Control-Allow-Origin', + '*', + 'Access-Control-Allow-Methods', + 'GET, OPTIONS', + 'P3P', + 'CP="DSP CUR OTPi IND OTRi ONL FIN"', + 'x-ms-request-id', + '84e10da0-7734-4177-95ed-c343b7db0b00', + 'x-ms-ests-server', + '2.1.12261.14 - KRSLR1 ProdSlices', + 'Set-Cookie', + 'fpc=Antb76_2S4tPjByaH8_aWQU; expires=Sun, 09-Jan-2022 05:51:16 GMT; path=/; secure; HttpOnly; SameSite=None', + 'Set-Cookie', + 'esctx=AQABAAAAAAD--DLA3VO7QrddgJg7WevrThyyjqZVOxfievQwU1xMSa05aGgqFEdmiADM75ZNo8EufPL_tE8aFu54Ao1qh171CRfsZIdUcXCUHyRk_NepTuy-Olwwhw8wkFOReQVj8jlojOg9w33cqAkD2wiplw2TBLjrUKxUiFdbKWoPsyblH5KUbVGD6OAg2lOgSpHjtiUgAA; domain=.login.microsoftonline.com; path=/; secure; HttpOnly; SameSite=None', + 'Set-Cookie', + 'x-ms-gateway-slice=estsfd; path=/; secure; samesite=none; httponly', + 'Set-Cookie', + 'stsservicecookie=estsfd; path=/; secure; samesite=none; httponly', + 'Date', + 'Fri, 10 Dec 2021 05:51:15 GMT', + 'Content-Length', + '980' +]); + +nock('https://login.microsoftonline.com:443', {"encodedQueryParams":true}) + .get('/88888888-8888-8888-8888-888888888888/v2.0/.well-known/openid-configuration') + .reply(200, {"token_endpoint":"https://login.microsoftonline.com/88888888-8888-8888-8888-888888888888/oauth2/v2.0/token","token_endpoint_auth_methods_supported":["client_secret_post","private_key_jwt","client_secret_basic"],"jwks_uri":"https://login.microsoftonline.com/88888888-8888-8888-8888-888888888888/discovery/v2.0/keys","response_modes_supported":["query","fragment","form_post"],"subject_types_supported":["pairwise"],"id_token_signing_alg_values_supported":["RS256"],"response_types_supported":["code","id_token","code id_token","id_token token"],"scopes_supported":["openid","profile","email","offline_access"],"issuer":"https://login.microsoftonline.com/88888888-8888-8888-8888-888888888888/v2.0","request_uri_parameter_supported":false,"userinfo_endpoint":"https://graph.microsoft.com/oidc/userinfo","authorization_endpoint":"https://login.microsoftonline.com/88888888-8888-8888-8888-888888888888/oauth2/v2.0/authorize","device_authorization_endpoint":"https://login.microsoftonline.com/88888888-8888-8888-8888-888888888888/oauth2/v2.0/devicecode","http_logout_supported":true,"frontchannel_logout_supported":true,"end_session_endpoint":"https://login.microsoftonline.com/88888888-8888-8888-8888-888888888888/oauth2/v2.0/logout","claims_supported":["sub","iss","cloud_instance_name","cloud_instance_host_name","cloud_graph_host_name","msgraph_host","aud","exp","iat","auth_time","acr","nonce","preferred_username","name","tid","ver","at_hash","c_hash","email"],"kerberos_endpoint":"https://login.microsoftonline.com/88888888-8888-8888-8888-888888888888/kerberos","tenant_region_scope":"WW","cloud_instance_name":"microsoftonline.com","cloud_graph_host_name":"graph.windows.net","msgraph_host":"graph.microsoft.com","rbac_url":"https://pas.windows.net"}, [ + 'Cache-Control', + 'max-age=86400, private', + 'Content-Type', + 'application/json; charset=utf-8', + 'Strict-Transport-Security', + 'max-age=31536000; includeSubDomains', + 'X-Content-Type-Options', + 'nosniff', + 'Access-Control-Allow-Origin', + '*', + 'Access-Control-Allow-Methods', + 'GET, OPTIONS', + 'P3P', + 'CP="DSP CUR OTPi IND OTRi ONL FIN"', + 'x-ms-request-id', + '1306231f-1899-4d48-aeca-90016b150b00', + 'x-ms-ests-server', + '2.1.12261.14 - SEASLR1 ProdSlices', + 'Set-Cookie', + 'fpc=ApP5ArcU6i9LmLpn54B1vu4; expires=Sun, 09-Jan-2022 05:51:16 GMT; path=/; secure; HttpOnly; SameSite=None', + 'Set-Cookie', + 'esctx=AQABAAAAAAD--DLA3VO7QrddgJg7WevrLVV9q4kLgnjUbZe0AZlQ58P3r37TZfeK2vTzwqIqmpiGKg5YdXC4rYwTI9miIGBpUMp1auElHIlKhjv-co1ypQnPr18kCtFMeENowN26k84S_4cAHw-MGGYAYtvmsFG233wYJ3zEZTmRLY6Uy4RtwSRcwzGPspvTh4cGe3KM3AggAA; domain=.login.microsoftonline.com; path=/; secure; HttpOnly; SameSite=None', + 'Set-Cookie', + 'x-ms-gateway-slice=estsfd; path=/; secure; samesite=none; httponly', + 'Set-Cookie', + 'stsservicecookie=estsfd; path=/; secure; samesite=none; httponly', + 'Date', + 'Fri, 10 Dec 2021 05:51:16 GMT', + 'Content-Length', + '1753' +]); + +nock('https://login.microsoftonline.com:443', {"encodedQueryParams":true}) + .post('/88888888-8888-8888-8888-888888888888/oauth2/v2.0/token', "client_id=azure_client_id&scope=https%3A%2F%2Fsanitized%2F&grant_type=client_credentials&x-client-SKU=msal.js.node&x-client-VER=1.3.3&x-client-OS=win32&x-client-CPU=x64&x-ms-lib-capability=retry-after, h429&x-client-current-telemetry=5|771,2,,,|,&x-client-last-telemetry=5|0|||0,0&client-request-id=8d18d8d7-8d6a-4059-b3e8-2c31b9faef9e&client_secret=azure_client_secret&claims=%7B%22access_token%22%3A%7B%22xms_cc%22%3A%7B%22values%22%3A%5B%22cp1%22%5D%7D%7D%7D") + .reply(200, {"token_type":"Bearer","expires_in":86399,"ext_expires_in":86399,"access_token":"access_token"}, [ + 'Cache-Control', + 'no-store, no-cache', + 'Pragma', + 'no-cache', + 'Content-Type', + 'application/json; charset=utf-8', + 'Expires', + '-1', + 'Strict-Transport-Security', + 'max-age=31536000; includeSubDomains', + 'X-Content-Type-Options', + 'nosniff', + 'P3P', + 'CP="DSP CUR OTPi IND OTRi ONL FIN"', + 'x-ms-request-id', + '41c02d2e-ea5c-4c6b-b8a9-d8688eed0a00', + 'x-ms-ests-server', + '2.1.12261.14 - KRSLR2 ProdSlices', + 'x-ms-clitelem', + '1,0,0,,', + 'Set-Cookie', + 'fpc=AiCC-4iaKv5En10dnA_A4KAWPr5BAQAAANPhRNkOAAAA; expires=Sun, 09-Jan-2022 05:51:16 GMT; path=/; secure; HttpOnly; SameSite=None', + 'Set-Cookie', + 'x-ms-gateway-slice=estsfd; path=/; secure; samesite=none; httponly', + 'Set-Cookie', + 'stsservicecookie=estsfd; path=/; secure; samesite=none; httponly', + 'Date', + 'Fri, 10 Dec 2021 05:51:16 GMT', + 'Content-Length', + '1374' +]); + +nock('https://management.azure.com:443', {"encodedQueryParams":true}) + .put('/subscriptions/azure_subscription_id/resourceGroups/myjstest/providers/Microsoft.Relay/namespaces/mynamespacexxx/wcfRelays/myrelayxxx/authorizationRules/myauthorizationxxxx', {"properties":{"rights":["Listen","Send"]}}) + .query(true) + .reply(200, ["1f8b0800000000000400edbd07601c499625262f6dca7b7f4af54ad7e074a10880601324d8904010ecc188cde692ec1d69472329ab2a81ca6556655d661640cced9dbcf7de7befbdf7de7befbdf7ba3b9d4e27f7dfff3f5c6664016cf6ce4adac99e2180aac81f3f7e7c1f3f227ef147c5eca3471fdd6dd693665a17abb6a896cddd877be70fefcf0eceb7ef4d3f7db0bdbfbbb7bffd7077fa60fb607abef3603a9b9cefedefdeadf3a65ad7d3fcf3ba5aaf9abb8beb9f6edabc69efaeeaeab298e57573f78b625a574d75de8e5fe565767d77992df266954d73b4b67fbc7bf7eeeed5f49c9be08b1abfe0c36cddceabbaf84106a45ead4b7e2df8905abdfb68f41140d120e25fb6d72b7cd9c5e505bdc3dd3777bf6b3b3ff6dfe71e0940594df96f02729a356dfad56bfa9006b9caebb6a0168f7ef1477571316fe9b7ef7df4bc20222ca9c1eb7c39fbe8fbbfe4","97fc3fa63c59c461010000"], [ + 'Cache-Control', + 'no-cache', + 'Pragma', + 'no-cache', + 'Transfer-Encoding', + 'chunked', + 'Content-Type', + 'application/json; charset=utf-8', + 'Content-Encoding', + 'gzip', + 'Expires', + '-1', + 'Vary', + 'Accept-Encoding', + 'x-ms-request-id', + '3ed931ae-639e-4edc-b417-4edc7b98b9fa_M4CH3_M4CH3', + 'Server-SB', + 'Service-Bus-Resource-Provider/CH3', + 'Server', + 'Service-Bus-Resource-Provider/CH3', + 'Server', + 'Microsoft-HTTPAPI/2.0', + 'x-ms-ratelimit-remaining-subscription-writes', + '1196', + 'x-ms-correlation-request-id', + 'ecd59b87-f9c9-4246-9d37-ddef0971bf76', + 'x-ms-routing-request-id', + 'SOUTHEASTASIA:20211210T055117Z:ecd59b87-f9c9-4246-9d37-ddef0971bf76', + 'Strict-Transport-Security', + 'max-age=31536000; includeSubDomains', + 'X-Content-Type-Options', + 'nosniff', + 'Date', + 'Fri, 10 Dec 2021 05:51:16 GMT' +]); diff --git a/sdk/relay/arm-relay/recordings/node/relay_test/recording_wcfrelays_delete_test.js b/sdk/relay/arm-relay/recordings/node/relay_test/recording_wcfrelays_delete_test.js new file mode 100644 index 000000000000..855617fca8e5 --- /dev/null +++ b/sdk/relay/arm-relay/recordings/node/relay_test/recording_wcfrelays_delete_test.js @@ -0,0 +1,187 @@ +let nock = require('nock'); + +module.exports.hash = "3a2e285bd2e679da649b7ce5e968bc6b"; + +module.exports.testInfo = {"uniqueName":{},"newDate":{}} + +nock('https://login.microsoftonline.com:443', {"encodedQueryParams":true}) + .get('/common/discovery/instance') + .query(true) + .reply(200, {"tenant_discovery_endpoint":"https://login.microsoftonline.com/88888888-8888-8888-8888-888888888888/v2.0/.well-known/openid-configuration","api-version":"1.1","metadata":[{"preferred_network":"login.microsoftonline.com","preferred_cache":"login.windows.net","aliases":["login.microsoftonline.com","login.windows.net","login.microsoft.com","sts.windows.net"]},{"preferred_network":"login.partner.microsoftonline.cn","preferred_cache":"login.partner.microsoftonline.cn","aliases":["login.partner.microsoftonline.cn","login.chinacloudapi.cn"]},{"preferred_network":"login.microsoftonline.de","preferred_cache":"login.microsoftonline.de","aliases":["login.microsoftonline.de"]},{"preferred_network":"login.microsoftonline.us","preferred_cache":"login.microsoftonline.us","aliases":["login.microsoftonline.us","login.usgovcloudapi.net"]},{"preferred_network":"login-us.microsoftonline.com","preferred_cache":"login-us.microsoftonline.com","aliases":["login-us.microsoftonline.com"]}]}, [ + 'Cache-Control', + 'max-age=86400, private', + 'Content-Type', + 'application/json; charset=utf-8', + 'Strict-Transport-Security', + 'max-age=31536000; includeSubDomains', + 'X-Content-Type-Options', + 'nosniff', + 'Access-Control-Allow-Origin', + '*', + 'Access-Control-Allow-Methods', + 'GET, OPTIONS', + 'P3P', + 'CP="DSP CUR OTPi IND OTRi ONL FIN"', + 'x-ms-request-id', + '1306231f-1899-4d48-aeca-9001fa150b00', + 'x-ms-ests-server', + '2.1.12261.14 - SEASLR1 ProdSlices', + 'Set-Cookie', + 'fpc=Av-w9DjNiOJFroretriUE_E; expires=Sun, 09-Jan-2022 05:51:31 GMT; path=/; secure; HttpOnly; SameSite=None', + 'Set-Cookie', + 'esctx=AQABAAAAAAD--DLA3VO7QrddgJg7WevrIdVwOSY9XJVEROUChLsM0qVErrCNm0xw28jwiesl4dtMMeAnPZbHYB1-j2Y0ta4yeZzFBCz55XTqQl66IrVMm9u17eXjWXfVhvvlLnbe13yAXLlYMFqUzlHLsRhAPsWNg8CNPWkhE-DqvNfrcENEs4J1p250QlbiHN2v9Et3VLsgAA; domain=.login.microsoftonline.com; path=/; secure; HttpOnly; SameSite=None', + 'Set-Cookie', + 'x-ms-gateway-slice=estsfd; path=/; secure; samesite=none; httponly', + 'Set-Cookie', + 'stsservicecookie=estsfd; path=/; secure; samesite=none; httponly', + 'Date', + 'Fri, 10 Dec 2021 05:51:31 GMT', + 'Content-Length', + '980' +]); + +nock('https://login.microsoftonline.com:443', {"encodedQueryParams":true}) + .get('/88888888-8888-8888-8888-888888888888/v2.0/.well-known/openid-configuration') + .reply(200, {"token_endpoint":"https://login.microsoftonline.com/88888888-8888-8888-8888-888888888888/oauth2/v2.0/token","token_endpoint_auth_methods_supported":["client_secret_post","private_key_jwt","client_secret_basic"],"jwks_uri":"https://login.microsoftonline.com/88888888-8888-8888-8888-888888888888/discovery/v2.0/keys","response_modes_supported":["query","fragment","form_post"],"subject_types_supported":["pairwise"],"id_token_signing_alg_values_supported":["RS256"],"response_types_supported":["code","id_token","code id_token","id_token token"],"scopes_supported":["openid","profile","email","offline_access"],"issuer":"https://login.microsoftonline.com/88888888-8888-8888-8888-888888888888/v2.0","request_uri_parameter_supported":false,"userinfo_endpoint":"https://graph.microsoft.com/oidc/userinfo","authorization_endpoint":"https://login.microsoftonline.com/88888888-8888-8888-8888-888888888888/oauth2/v2.0/authorize","device_authorization_endpoint":"https://login.microsoftonline.com/88888888-8888-8888-8888-888888888888/oauth2/v2.0/devicecode","http_logout_supported":true,"frontchannel_logout_supported":true,"end_session_endpoint":"https://login.microsoftonline.com/88888888-8888-8888-8888-888888888888/oauth2/v2.0/logout","claims_supported":["sub","iss","cloud_instance_name","cloud_instance_host_name","cloud_graph_host_name","msgraph_host","aud","exp","iat","auth_time","acr","nonce","preferred_username","name","tid","ver","at_hash","c_hash","email"],"kerberos_endpoint":"https://login.microsoftonline.com/88888888-8888-8888-8888-888888888888/kerberos","tenant_region_scope":"WW","cloud_instance_name":"microsoftonline.com","cloud_graph_host_name":"graph.windows.net","msgraph_host":"graph.microsoft.com","rbac_url":"https://pas.windows.net"}, [ + 'Cache-Control', + 'max-age=86400, private', + 'Content-Type', + 'application/json; charset=utf-8', + 'Strict-Transport-Security', + 'max-age=31536000; includeSubDomains', + 'X-Content-Type-Options', + 'nosniff', + 'Access-Control-Allow-Origin', + '*', + 'Access-Control-Allow-Methods', + 'GET, OPTIONS', + 'P3P', + 'CP="DSP CUR OTPi IND OTRi ONL FIN"', + 'x-ms-request-id', + '1306231f-1899-4d48-aeca-9001ff150b00', + 'x-ms-ests-server', + '2.1.12261.14 - SEASLR1 ProdSlices', + 'Set-Cookie', + 'fpc=Aozq29SXNtRAoGTCYzxXYV8; expires=Sun, 09-Jan-2022 05:51:31 GMT; path=/; secure; HttpOnly; SameSite=None', + 'Set-Cookie', + 'esctx=AQABAAAAAAD--DLA3VO7QrddgJg7Wevr1IeB-1042Sl3U9Z_56sHkPpiKxC_6X2v99MvbPYP8v2ZUMX1OeljGDA7hA-_Zu2wuwMwFXKCS6-Y_1kOXrYxoegZbsShPf-8rMN3TlgcwMqR8pOAKOyA1_9ma07oGka2HnyZp7jdJjSN1KIlUrFnQlwS7SsROhNtCoTEC_93IDggAA; domain=.login.microsoftonline.com; path=/; secure; HttpOnly; SameSite=None', + 'Set-Cookie', + 'x-ms-gateway-slice=estsfd; path=/; secure; samesite=none; httponly', + 'Set-Cookie', + 'stsservicecookie=estsfd; path=/; secure; samesite=none; httponly', + 'Date', + 'Fri, 10 Dec 2021 05:51:31 GMT', + 'Content-Length', + '1753' +]); + +nock('https://login.microsoftonline.com:443', {"encodedQueryParams":true}) + .post('/88888888-8888-8888-8888-888888888888/oauth2/v2.0/token', "client_id=azure_client_id&scope=https%3A%2F%2Fsanitized%2F&grant_type=client_credentials&x-client-SKU=msal.js.node&x-client-VER=1.3.3&x-client-OS=win32&x-client-CPU=x64&x-ms-lib-capability=retry-after, h429&x-client-current-telemetry=5|771,2,,,|,&x-client-last-telemetry=5|0|||0,0&client-request-id=d1509050-376a-46e1-b252-d82cb029afda&client_secret=azure_client_secret&claims=%7B%22access_token%22%3A%7B%22xms_cc%22%3A%7B%22values%22%3A%5B%22cp1%22%5D%7D%7D%7D") + .reply(200, {"token_type":"Bearer","expires_in":86399,"ext_expires_in":86399,"access_token":"access_token"}, [ + 'Cache-Control', + 'no-store, no-cache', + 'Pragma', + 'no-cache', + 'Content-Type', + 'application/json; charset=utf-8', + 'Expires', + '-1', + 'Strict-Transport-Security', + 'max-age=31536000; includeSubDomains', + 'X-Content-Type-Options', + 'nosniff', + 'P3P', + 'CP="DSP CUR OTPi IND OTRi ONL FIN"', + 'x-ms-request-id', + '84e10da0-7734-4177-95ed-c34351dc0b00', + 'x-ms-ests-server', + '2.1.12261.14 - KRSLR1 ProdSlices', + 'x-ms-clitelem', + '1,0,0,,', + 'Set-Cookie', + 'fpc=AgWsBCmMjgVLiavwxz-6UU0WPr5BAQAAAOLhRNkOAAAA; expires=Sun, 09-Jan-2022 05:51:32 GMT; path=/; secure; HttpOnly; SameSite=None', + 'Set-Cookie', + 'x-ms-gateway-slice=estsfd; path=/; secure; samesite=none; httponly', + 'Set-Cookie', + 'stsservicecookie=estsfd; path=/; secure; samesite=none; httponly', + 'Date', + 'Fri, 10 Dec 2021 05:51:31 GMT', + 'Content-Length', + '1374' +]); + +nock('https://management.azure.com:443', {"encodedQueryParams":true}) + .delete('/subscriptions/azure_subscription_id/resourceGroups/myjstest/providers/Microsoft.Relay/namespaces/mynamespacexxx/wcfRelays/myrelayxxx') + .query(true) + .reply(200, "", [ + 'Cache-Control', + 'no-cache', + 'Pragma', + 'no-cache', + 'Expires', + '-1', + 'x-ms-request-id', + 'cfdf172d-2dc3-45c2-8a07-9e32e4328ae7_M10CH3_M10CH3', + 'Server-SB', + 'Service-Bus-Resource-Provider/CH3', + 'Server', + 'Service-Bus-Resource-Provider/CH3', + 'Server', + 'Microsoft-HTTPAPI/2.0', + 'x-ms-ratelimit-remaining-subscription-deletes', + '14998', + 'x-ms-correlation-request-id', + 'c2a800ac-8500-46af-956d-95b64a03e4c4', + 'x-ms-routing-request-id', + 'SOUTHEASTASIA:20211210T055133Z:c2a800ac-8500-46af-956d-95b64a03e4c4', + 'Strict-Transport-Security', + 'max-age=31536000; includeSubDomains', + 'X-Content-Type-Options', + 'nosniff', + 'Date', + 'Fri, 10 Dec 2021 05:51:33 GMT', + 'Content-Length', + '0' +]); + +nock('https://management.azure.com:443', {"encodedQueryParams":true}) + .get('/subscriptions/azure_subscription_id/resourceGroups/myjstest/providers/Microsoft.Relay/namespaces/mynamespacexxx/wcfRelays') + .query(true) + .reply(200, ["1f8b0800000000000400edbd07601c499625262f6dca7b7f4af54ad7e074a10880601324d8904010ecc188cde692ec1d69472329ab2a81ca6556655d661640cced9dbcf7de7befbdf7de7befbdf7ba3b9d4e27f7dfff3f5c6664016cf6ce4adac99e2180aac81f3f7e7c1f3f227ef1479759b9ce3f7af4bdefff","92ff0742ea40440c000000"], [ + 'Cache-Control', + 'no-cache', + 'Pragma', + 'no-cache', + 'Transfer-Encoding', + 'chunked', + 'Content-Type', + 'application/json; charset=utf-8', + 'Content-Encoding', + 'gzip', + 'Expires', + '-1', + 'Vary', + 'Accept-Encoding', + 'x-ms-inline-count', + '', + 'x-ms-request-id', + '97ce1698-73a8-4214-bcd4-530600c03312_M4CH3_M4CH3', + 'Server-SB', + 'Service-Bus-Resource-Provider/CH3', + 'Server', + 'Service-Bus-Resource-Provider/CH3', + 'Server', + 'Microsoft-HTTPAPI/2.0', + 'x-ms-ratelimit-remaining-subscription-reads', + '11979', + 'x-ms-correlation-request-id', + 'c0f0fa1e-0b46-48f1-8cfb-3cb7371db0d6', + 'x-ms-routing-request-id', + 'SOUTHEASTASIA:20211210T055136Z:c0f0fa1e-0b46-48f1-8cfb-3cb7371db0d6', + 'Strict-Transport-Security', + 'max-age=31536000; includeSubDomains', + 'X-Content-Type-Options', + 'nosniff', + 'Date', + 'Fri, 10 Dec 2021 05:51:35 GMT' +]); diff --git a/sdk/relay/arm-relay/recordings/node/relay_test/recording_wcfrelays_deleteauthorizationrule_test.js b/sdk/relay/arm-relay/recordings/node/relay_test/recording_wcfrelays_deleteauthorizationrule_test.js new file mode 100644 index 000000000000..428792046c61 --- /dev/null +++ b/sdk/relay/arm-relay/recordings/node/relay_test/recording_wcfrelays_deleteauthorizationrule_test.js @@ -0,0 +1,185 @@ +let nock = require('nock'); + +module.exports.hash = "bc08d660d6f614f6ecf58b1bbc343243"; + +module.exports.testInfo = {"uniqueName":{},"newDate":{}} + +nock('https://login.microsoftonline.com:443', {"encodedQueryParams":true}) + .get('/common/discovery/instance') + .query(true) + .reply(200, {"tenant_discovery_endpoint":"https://login.microsoftonline.com/88888888-8888-8888-8888-888888888888/v2.0/.well-known/openid-configuration","api-version":"1.1","metadata":[{"preferred_network":"login.microsoftonline.com","preferred_cache":"login.windows.net","aliases":["login.microsoftonline.com","login.windows.net","login.microsoft.com","sts.windows.net"]},{"preferred_network":"login.partner.microsoftonline.cn","preferred_cache":"login.partner.microsoftonline.cn","aliases":["login.partner.microsoftonline.cn","login.chinacloudapi.cn"]},{"preferred_network":"login.microsoftonline.de","preferred_cache":"login.microsoftonline.de","aliases":["login.microsoftonline.de"]},{"preferred_network":"login.microsoftonline.us","preferred_cache":"login.microsoftonline.us","aliases":["login.microsoftonline.us","login.usgovcloudapi.net"]},{"preferred_network":"login-us.microsoftonline.com","preferred_cache":"login-us.microsoftonline.com","aliases":["login-us.microsoftonline.com"]}]}, [ + 'Cache-Control', + 'max-age=86400, private', + 'Content-Type', + 'application/json; charset=utf-8', + 'Strict-Transport-Security', + 'max-age=31536000; includeSubDomains', + 'X-Content-Type-Options', + 'nosniff', + 'Access-Control-Allow-Origin', + '*', + 'Access-Control-Allow-Methods', + 'GET, OPTIONS', + 'P3P', + 'CP="DSP CUR OTPi IND OTRi ONL FIN"', + 'x-ms-request-id', + '25e1b200-ca8c-4386-a214-6e1233bb0a00', + 'x-ms-ests-server', + '2.1.12261.14 - SEASLR2 ProdSlices', + 'Set-Cookie', + 'fpc=AmOF4XVwBQZBuXpoIwxYXJI; expires=Sun, 09-Jan-2022 05:51:27 GMT; path=/; secure; HttpOnly; SameSite=None', + 'Set-Cookie', + 'esctx=AQABAAAAAAD--DLA3VO7QrddgJg7WevrppBBhQCqnp_nPtnLRWsviltvU6FBrCJ3H1meeqjAUogrYsqAqBuhN6Nm3cKeJZCqJ38vKYb5oqsFIsthy7OygZK1oS6tI2KpiglkdMsCw0IM-LgquXIjhWPSEgJwVyXpLXSKewUO0e3_JWHIEfzaGBlsHqffZyW-GNhdM2_Hv44gAA; domain=.login.microsoftonline.com; path=/; secure; HttpOnly; SameSite=None', + 'Set-Cookie', + 'x-ms-gateway-slice=estsfd; path=/; secure; samesite=none; httponly', + 'Set-Cookie', + 'stsservicecookie=estsfd; path=/; secure; samesite=none; httponly', + 'Date', + 'Fri, 10 Dec 2021 05:51:27 GMT', + 'Content-Length', + '980' +]); + +nock('https://login.microsoftonline.com:443', {"encodedQueryParams":true}) + .get('/88888888-8888-8888-8888-888888888888/v2.0/.well-known/openid-configuration') + .reply(200, {"token_endpoint":"https://login.microsoftonline.com/88888888-8888-8888-8888-888888888888/oauth2/v2.0/token","token_endpoint_auth_methods_supported":["client_secret_post","private_key_jwt","client_secret_basic"],"jwks_uri":"https://login.microsoftonline.com/88888888-8888-8888-8888-888888888888/discovery/v2.0/keys","response_modes_supported":["query","fragment","form_post"],"subject_types_supported":["pairwise"],"id_token_signing_alg_values_supported":["RS256"],"response_types_supported":["code","id_token","code id_token","id_token token"],"scopes_supported":["openid","profile","email","offline_access"],"issuer":"https://login.microsoftonline.com/88888888-8888-8888-8888-888888888888/v2.0","request_uri_parameter_supported":false,"userinfo_endpoint":"https://graph.microsoft.com/oidc/userinfo","authorization_endpoint":"https://login.microsoftonline.com/88888888-8888-8888-8888-888888888888/oauth2/v2.0/authorize","device_authorization_endpoint":"https://login.microsoftonline.com/88888888-8888-8888-8888-888888888888/oauth2/v2.0/devicecode","http_logout_supported":true,"frontchannel_logout_supported":true,"end_session_endpoint":"https://login.microsoftonline.com/88888888-8888-8888-8888-888888888888/oauth2/v2.0/logout","claims_supported":["sub","iss","cloud_instance_name","cloud_instance_host_name","cloud_graph_host_name","msgraph_host","aud","exp","iat","auth_time","acr","nonce","preferred_username","name","tid","ver","at_hash","c_hash","email"],"kerberos_endpoint":"https://login.microsoftonline.com/88888888-8888-8888-8888-888888888888/kerberos","tenant_region_scope":"WW","cloud_instance_name":"microsoftonline.com","cloud_graph_host_name":"graph.windows.net","msgraph_host":"graph.microsoft.com","rbac_url":"https://pas.windows.net"}, [ + 'Cache-Control', + 'max-age=86400, private', + 'Content-Type', + 'application/json; charset=utf-8', + 'Strict-Transport-Security', + 'max-age=31536000; includeSubDomains', + 'X-Content-Type-Options', + 'nosniff', + 'Access-Control-Allow-Origin', + '*', + 'Access-Control-Allow-Methods', + 'GET, OPTIONS', + 'P3P', + 'CP="DSP CUR OTPi IND OTRi ONL FIN"', + 'x-ms-request-id', + '41c02d2e-ea5c-4c6b-b8a9-d868e2ed0a00', + 'x-ms-ests-server', + '2.1.12261.14 - KRSLR2 ProdSlices', + 'Set-Cookie', + 'fpc=AqM8QtleHTRKqBzFucORLw0; expires=Sun, 09-Jan-2022 05:51:27 GMT; path=/; secure; HttpOnly; SameSite=None', + 'Set-Cookie', + 'esctx=AQABAAAAAAD--DLA3VO7QrddgJg7Wevrgb6uJ-MXuafTgDEPmDlzKzwpYlexUBeVtGSDZyGlEGDTH0N8MVi3luiD648VG-f4kjB5biFSlNhzCZbERtuQWROnwGe0nzD0Oxh1ngYxGhph6LsDZWDILYWVUHIq4OW84nYx1UF5_TgS2tAjwnugJWvJqbdfjRFVn2krRteZZnIgAA; domain=.login.microsoftonline.com; path=/; secure; HttpOnly; SameSite=None', + 'Set-Cookie', + 'x-ms-gateway-slice=estsfd; path=/; secure; samesite=none; httponly', + 'Set-Cookie', + 'stsservicecookie=estsfd; path=/; secure; samesite=none; httponly', + 'Date', + 'Fri, 10 Dec 2021 05:51:27 GMT', + 'Content-Length', + '1753' +]); + +nock('https://login.microsoftonline.com:443', {"encodedQueryParams":true}) + .post('/88888888-8888-8888-8888-888888888888/oauth2/v2.0/token', "client_id=azure_client_id&scope=https%3A%2F%2Fsanitized%2F&grant_type=client_credentials&x-client-SKU=msal.js.node&x-client-VER=1.3.3&x-client-OS=win32&x-client-CPU=x64&x-ms-lib-capability=retry-after, h429&x-client-current-telemetry=5|771,2,,,|,&x-client-last-telemetry=5|0|||0,0&client-request-id=1406acc6-42ab-45d7-8c2a-4c79d7c79f69&client_secret=azure_client_secret&claims=%7B%22access_token%22%3A%7B%22xms_cc%22%3A%7B%22values%22%3A%5B%22cp1%22%5D%7D%7D%7D") + .reply(200, {"token_type":"Bearer","expires_in":86399,"ext_expires_in":86399,"access_token":"access_token"}, [ + 'Cache-Control', + 'no-store, no-cache', + 'Pragma', + 'no-cache', + 'Content-Type', + 'application/json; charset=utf-8', + 'Expires', + '-1', + 'Strict-Transport-Security', + 'max-age=31536000; includeSubDomains', + 'X-Content-Type-Options', + 'nosniff', + 'P3P', + 'CP="DSP CUR OTPi IND OTRi ONL FIN"', + 'x-ms-request-id', + '84e10da0-7734-4177-95ed-c34328dc0b00', + 'x-ms-ests-server', + '2.1.12261.14 - KRSLR1 ProdSlices', + 'x-ms-clitelem', + '1,0,0,,', + 'Set-Cookie', + 'fpc=AlPZ4c1yW6hKvwd2HbQPaYgWPr5BAQAAAN_hRNkOAAAA; expires=Sun, 09-Jan-2022 05:51:28 GMT; path=/; secure; HttpOnly; SameSite=None', + 'Set-Cookie', + 'x-ms-gateway-slice=estsfd; path=/; secure; samesite=none; httponly', + 'Set-Cookie', + 'stsservicecookie=estsfd; path=/; secure; samesite=none; httponly', + 'Date', + 'Fri, 10 Dec 2021 05:51:27 GMT', + 'Content-Length', + '1374' +]); + +nock('https://management.azure.com:443', {"encodedQueryParams":true}) + .delete('/subscriptions/azure_subscription_id/resourceGroups/myjstest/providers/Microsoft.Relay/namespaces/mynamespacexxx/wcfRelays/myrelayxxx/authorizationRules/myauthorizationxxxx') + .query(true) + .reply(200, "", [ + 'Cache-Control', + 'no-cache', + 'Pragma', + 'no-cache', + 'Expires', + '-1', + 'x-ms-request-id', + '774ea885-a7cd-45fd-ae2f-c6bd69ba36ad_M2CH3_M2CH3', + 'Server-SB', + 'Service-Bus-Resource-Provider/CH3', + 'Server', + 'Service-Bus-Resource-Provider/CH3', + 'Server', + 'Microsoft-HTTPAPI/2.0', + 'x-ms-ratelimit-remaining-subscription-deletes', + '14999', + 'x-ms-correlation-request-id', + '8f98c214-ac6b-464b-830b-7e4f016adef9', + 'x-ms-routing-request-id', + 'SOUTHEASTASIA:20211210T055129Z:8f98c214-ac6b-464b-830b-7e4f016adef9', + 'Strict-Transport-Security', + 'max-age=31536000; includeSubDomains', + 'X-Content-Type-Options', + 'nosniff', + 'Date', + 'Fri, 10 Dec 2021 05:51:29 GMT', + 'Content-Length', + '0' +]); + +nock('https://management.azure.com:443', {"encodedQueryParams":true}) + .get('/subscriptions/azure_subscription_id/resourceGroups/myjstest/providers/Microsoft.Relay/namespaces/mynamespacexxx/wcfRelays/myauthorizationxxxx/authorizationRules') + .query(true) + .reply(200, ["1f8b0800000000000400edbd07601c499625262f6dca7b7f4af54ad7e074a10880601324d8904010ecc188cde692ec1d69472329ab2a81ca6556655d661640cced9dbcf7de7befbdf7de7befbdf7ba3b9d4e27f7dfff3f5c6664016cf6ce4adac99e2180aac81f3f7e7c1f3f227ef12f","f97f0043bfa6a302000000"], [ + 'Cache-Control', + 'no-cache', + 'Pragma', + 'no-cache', + 'Transfer-Encoding', + 'chunked', + 'Content-Type', + 'application/json; charset=utf-8', + 'Content-Encoding', + 'gzip', + 'Expires', + '-1', + 'Vary', + 'Accept-Encoding', + 'x-ms-request-id', + '1cf7e354-c18c-4bfb-a437-19c9ca254108_M10CH3_M10CH3', + 'Server-SB', + 'Service-Bus-Resource-Provider/CH3', + 'Server', + 'Service-Bus-Resource-Provider/CH3', + 'Server', + 'Microsoft-HTTPAPI/2.0', + 'x-ms-ratelimit-remaining-subscription-reads', + '11980', + 'x-ms-correlation-request-id', + '83d7d95e-313b-435b-a92f-5e6fca7789b9', + 'x-ms-routing-request-id', + 'SOUTHEASTASIA:20211210T055131Z:83d7d95e-313b-435b-a92f-5e6fca7789b9', + 'Strict-Transport-Security', + 'max-age=31536000; includeSubDomains', + 'X-Content-Type-Options', + 'nosniff', + 'Date', + 'Fri, 10 Dec 2021 05:51:30 GMT' +]); diff --git a/sdk/relay/arm-relay/recordings/node/relay_test/recording_wcfrelays_get_test.js b/sdk/relay/arm-relay/recordings/node/relay_test/recording_wcfrelays_get_test.js new file mode 100644 index 000000000000..4e286d1adb4d --- /dev/null +++ b/sdk/relay/arm-relay/recordings/node/relay_test/recording_wcfrelays_get_test.js @@ -0,0 +1,151 @@ +let nock = require('nock'); + +module.exports.hash = "bd00f4adb8d574ecf94e3c3e62ef3939"; + +module.exports.testInfo = {"uniqueName":{},"newDate":{}} + +nock('https://login.microsoftonline.com:443', {"encodedQueryParams":true}) + .get('/common/discovery/instance') + .query(true) + .reply(200, {"tenant_discovery_endpoint":"https://login.microsoftonline.com/88888888-8888-8888-8888-888888888888/v2.0/.well-known/openid-configuration","api-version":"1.1","metadata":[{"preferred_network":"login.microsoftonline.com","preferred_cache":"login.windows.net","aliases":["login.microsoftonline.com","login.windows.net","login.microsoft.com","sts.windows.net"]},{"preferred_network":"login.partner.microsoftonline.cn","preferred_cache":"login.partner.microsoftonline.cn","aliases":["login.partner.microsoftonline.cn","login.chinacloudapi.cn"]},{"preferred_network":"login.microsoftonline.de","preferred_cache":"login.microsoftonline.de","aliases":["login.microsoftonline.de"]},{"preferred_network":"login.microsoftonline.us","preferred_cache":"login.microsoftonline.us","aliases":["login.microsoftonline.us","login.usgovcloudapi.net"]},{"preferred_network":"login-us.microsoftonline.com","preferred_cache":"login-us.microsoftonline.com","aliases":["login-us.microsoftonline.com"]}]}, [ + 'Cache-Control', + 'max-age=86400, private', + 'Content-Type', + 'application/json; charset=utf-8', + 'Strict-Transport-Security', + 'max-age=31536000; includeSubDomains', + 'X-Content-Type-Options', + 'nosniff', + 'Access-Control-Allow-Origin', + '*', + 'Access-Control-Allow-Methods', + 'GET, OPTIONS', + 'P3P', + 'CP="DSP CUR OTPi IND OTRi ONL FIN"', + 'x-ms-request-id', + '1306231f-1899-4d48-aeca-900178150b00', + 'x-ms-ests-server', + '2.1.12261.14 - SEASLR1 ProdSlices', + 'Set-Cookie', + 'fpc=AiOfGiqPMMFGp0PE3rodWU0; expires=Sun, 09-Jan-2022 05:51:17 GMT; path=/; secure; HttpOnly; SameSite=None', + 'Set-Cookie', + 'esctx=AQABAAAAAAD--DLA3VO7QrddgJg7WevrvF6EKu4kD-GOKtxWlzSkCeaoGKCWBNQMo4TC085KQgBRWnHh3C-oLxXf2RGO2vcPyVkRjT_cqnTkBPycSLz2wm-8ABfH4MwsO4tXAVbAcPXZoX8s2ywNTXcUdwpQ-Fl3Edk0sTTKqiQRdVxevBCTcqNbyAnIQ8_p2LMUUKfG3NsgAA; domain=.login.microsoftonline.com; path=/; secure; HttpOnly; SameSite=None', + 'Set-Cookie', + 'x-ms-gateway-slice=estsfd; path=/; secure; samesite=none; httponly', + 'Set-Cookie', + 'stsservicecookie=estsfd; path=/; secure; samesite=none; httponly', + 'Date', + 'Fri, 10 Dec 2021 05:51:17 GMT', + 'Content-Length', + '980' +]); + +nock('https://login.microsoftonline.com:443', {"encodedQueryParams":true}) + .get('/88888888-8888-8888-8888-888888888888/v2.0/.well-known/openid-configuration') + .reply(200, {"token_endpoint":"https://login.microsoftonline.com/88888888-8888-8888-8888-888888888888/oauth2/v2.0/token","token_endpoint_auth_methods_supported":["client_secret_post","private_key_jwt","client_secret_basic"],"jwks_uri":"https://login.microsoftonline.com/88888888-8888-8888-8888-888888888888/discovery/v2.0/keys","response_modes_supported":["query","fragment","form_post"],"subject_types_supported":["pairwise"],"id_token_signing_alg_values_supported":["RS256"],"response_types_supported":["code","id_token","code id_token","id_token token"],"scopes_supported":["openid","profile","email","offline_access"],"issuer":"https://login.microsoftonline.com/88888888-8888-8888-8888-888888888888/v2.0","request_uri_parameter_supported":false,"userinfo_endpoint":"https://graph.microsoft.com/oidc/userinfo","authorization_endpoint":"https://login.microsoftonline.com/88888888-8888-8888-8888-888888888888/oauth2/v2.0/authorize","device_authorization_endpoint":"https://login.microsoftonline.com/88888888-8888-8888-8888-888888888888/oauth2/v2.0/devicecode","http_logout_supported":true,"frontchannel_logout_supported":true,"end_session_endpoint":"https://login.microsoftonline.com/88888888-8888-8888-8888-888888888888/oauth2/v2.0/logout","claims_supported":["sub","iss","cloud_instance_name","cloud_instance_host_name","cloud_graph_host_name","msgraph_host","aud","exp","iat","auth_time","acr","nonce","preferred_username","name","tid","ver","at_hash","c_hash","email"],"kerberos_endpoint":"https://login.microsoftonline.com/88888888-8888-8888-8888-888888888888/kerberos","tenant_region_scope":"WW","cloud_instance_name":"microsoftonline.com","cloud_graph_host_name":"graph.windows.net","msgraph_host":"graph.microsoft.com","rbac_url":"https://pas.windows.net"}, [ + 'Cache-Control', + 'max-age=86400, private', + 'Content-Type', + 'application/json; charset=utf-8', + 'Strict-Transport-Security', + 'max-age=31536000; includeSubDomains', + 'X-Content-Type-Options', + 'nosniff', + 'Access-Control-Allow-Origin', + '*', + 'Access-Control-Allow-Methods', + 'GET, OPTIONS', + 'P3P', + 'CP="DSP CUR OTPi IND OTRi ONL FIN"', + 'x-ms-request-id', + '1306231f-1899-4d48-aeca-90017a150b00', + 'x-ms-ests-server', + '2.1.12261.14 - SEASLR1 ProdSlices', + 'Set-Cookie', + 'fpc=AtDWUJM_Z41JpU5HkiJh1TE; expires=Sun, 09-Jan-2022 05:51:17 GMT; path=/; secure; HttpOnly; SameSite=None', + 'Set-Cookie', + 'esctx=AQABAAAAAAD--DLA3VO7QrddgJg7WevrT3MxtT-CtKC-jfbbylT_GcoXtCFglmODg88HGHVrr9yUDfRxZGTWuKFcmGWyorkAxnWLvEaH90xiotI8Hwn2QwLa4KJ0z1M3zGaJH8PWBhaxcoT0HDHV4dYcSO6ZsM5HoK9HvkNZo2CnBos8eVY0fo_n4qqdw--ax2OBE8r4w6ogAA; domain=.login.microsoftonline.com; path=/; secure; HttpOnly; SameSite=None', + 'Set-Cookie', + 'x-ms-gateway-slice=estsfd; path=/; secure; samesite=none; httponly', + 'Set-Cookie', + 'stsservicecookie=estsfd; path=/; secure; samesite=none; httponly', + 'Date', + 'Fri, 10 Dec 2021 05:51:17 GMT', + 'Content-Length', + '1753' +]); + +nock('https://login.microsoftonline.com:443', {"encodedQueryParams":true}) + .post('/88888888-8888-8888-8888-888888888888/oauth2/v2.0/token', "client_id=azure_client_id&scope=https%3A%2F%2Fsanitized%2F&grant_type=client_credentials&x-client-SKU=msal.js.node&x-client-VER=1.3.3&x-client-OS=win32&x-client-CPU=x64&x-ms-lib-capability=retry-after, h429&x-client-current-telemetry=5|771,2,,,|,&x-client-last-telemetry=5|0|||0,0&client-request-id=cba8aaf6-a56d-430b-9ef8-1643907e875a&client_secret=azure_client_secret&claims=%7B%22access_token%22%3A%7B%22xms_cc%22%3A%7B%22values%22%3A%5B%22cp1%22%5D%7D%7D%7D") + .reply(200, {"token_type":"Bearer","expires_in":86399,"ext_expires_in":86399,"access_token":"access_token"}, [ + 'Cache-Control', + 'no-store, no-cache', + 'Pragma', + 'no-cache', + 'Content-Type', + 'application/json; charset=utf-8', + 'Expires', + '-1', + 'Strict-Transport-Security', + 'max-age=31536000; includeSubDomains', + 'X-Content-Type-Options', + 'nosniff', + 'P3P', + 'CP="DSP CUR OTPi IND OTRi ONL FIN"', + 'x-ms-request-id', + '1306231f-1899-4d48-aeca-90017d150b00', + 'x-ms-ests-server', + '2.1.12261.14 - SEASLR1 ProdSlices', + 'x-ms-clitelem', + '1,0,0,,', + 'Set-Cookie', + 'fpc=Atm43Ir7QHBMqEShmPGxqEUWPr5BAQAAANXhRNkOAAAA; expires=Sun, 09-Jan-2022 05:51:18 GMT; path=/; secure; HttpOnly; SameSite=None', + 'Set-Cookie', + 'x-ms-gateway-slice=estsfd; path=/; secure; samesite=none; httponly', + 'Set-Cookie', + 'stsservicecookie=estsfd; path=/; secure; samesite=none; httponly', + 'Date', + 'Fri, 10 Dec 2021 05:51:17 GMT', + 'Content-Length', + '1374' +]); + +nock('https://management.azure.com:443', {"encodedQueryParams":true}) + .get('/subscriptions/azure_subscription_id/resourceGroups/myjstest/providers/Microsoft.Relay/namespaces/mynamespacexxx/wcfRelays/myrelayxxx') + .query(true) + .reply(200, ["1f8b0800000000000400edbd07601c499625262f6dca7b7f4af54ad7e074a10880601324d8904010ecc188cde692ec1d69472329ab2a81ca6556655d661640cced9dbcf7de7befbdf7de7befbdf7ba3b9d4e27f7dfff3f5c6664016cf6ce4adac99e2180aac81f3f7e7c1f3f227ef147c5eca3471fdd6dd693665a17abb6a896cddd877be70fefcf0eceb7ef4d3f7db0bdbfbbb7bffd7077fa60fb607abef3603a9b9cefedefdeadf3a65ad7d3fcf3ba5aaf9abb8beb9f6edabc69efaeeaeab298e57573f78b625a574d75de8e5fe565767d77992df266954d73b4b67fbc7bf7eeeed5f49c9be08b1abfd0871f8d3e421bc22ef8acbd5ee1b32eec17d494c13577bf6b8051ebb29a661813bd719a356dfad56bfa90305ce5755be4cd478f7ef147d33acfda7c76dc529bbd9dbdddedddbdeddd9d373bf71fdddf7db47b7f7c6fe7e1feceee839fa217d7abd986a60fc67bf71e3c7cf0e92e9a9605516399d727d57a49cd77461fd5f92f5a1744b493b2c897edf1ba9d5775f103c5aeadd7399a10da6f64802ff2f6cd744590cc7b6fea6cd9acaaba7d9d4fd775d15e9bb78ae629a8594c3f7a749e954dfe4b","7ec9ff034976ab18d6010000"], [ + 'Cache-Control', + 'no-cache', + 'Pragma', + 'no-cache', + 'Transfer-Encoding', + 'chunked', + 'Content-Type', + 'application/json; charset=utf-8', + 'Content-Encoding', + 'gzip', + 'Expires', + '-1', + 'Vary', + 'Accept-Encoding', + 'x-ms-request-id', + 'e2fbdb69-6425-485a-8b7d-3d8aecf0e673_M0CH3_M0CH3', + 'Server-SB', + 'Service-Bus-Resource-Provider/CH3', + 'Server', + 'Service-Bus-Resource-Provider/CH3', + 'Server', + 'Microsoft-HTTPAPI/2.0', + 'x-ms-ratelimit-remaining-subscription-reads', + '11984', + 'x-ms-correlation-request-id', + 'db7d0275-0fae-4f3e-b3b7-19830d957db1', + 'x-ms-routing-request-id', + 'SOUTHEASTASIA:20211210T055119Z:db7d0275-0fae-4f3e-b3b7-19830d957db1', + 'Strict-Transport-Security', + 'max-age=31536000; includeSubDomains', + 'X-Content-Type-Options', + 'nosniff', + 'Date', + 'Fri, 10 Dec 2021 05:51:18 GMT' +]); diff --git a/sdk/relay/arm-relay/recordings/node/relay_test/recording_wcfrelays_getauthorizationrule_test.js b/sdk/relay/arm-relay/recordings/node/relay_test/recording_wcfrelays_getauthorizationrule_test.js new file mode 100644 index 000000000000..e709ee201524 --- /dev/null +++ b/sdk/relay/arm-relay/recordings/node/relay_test/recording_wcfrelays_getauthorizationrule_test.js @@ -0,0 +1,151 @@ +let nock = require('nock'); + +module.exports.hash = "37e40cfff6602414289f21bdfd5adc95"; + +module.exports.testInfo = {"uniqueName":{},"newDate":{}} + +nock('https://login.microsoftonline.com:443', {"encodedQueryParams":true}) + .get('/common/discovery/instance') + .query(true) + .reply(200, {"tenant_discovery_endpoint":"https://login.microsoftonline.com/88888888-8888-8888-8888-888888888888/v2.0/.well-known/openid-configuration","api-version":"1.1","metadata":[{"preferred_network":"login.microsoftonline.com","preferred_cache":"login.windows.net","aliases":["login.microsoftonline.com","login.windows.net","login.microsoft.com","sts.windows.net"]},{"preferred_network":"login.partner.microsoftonline.cn","preferred_cache":"login.partner.microsoftonline.cn","aliases":["login.partner.microsoftonline.cn","login.chinacloudapi.cn"]},{"preferred_network":"login.microsoftonline.de","preferred_cache":"login.microsoftonline.de","aliases":["login.microsoftonline.de"]},{"preferred_network":"login.microsoftonline.us","preferred_cache":"login.microsoftonline.us","aliases":["login.microsoftonline.us","login.usgovcloudapi.net"]},{"preferred_network":"login-us.microsoftonline.com","preferred_cache":"login-us.microsoftonline.com","aliases":["login-us.microsoftonline.com"]}]}, [ + 'Cache-Control', + 'max-age=86400, private', + 'Content-Type', + 'application/json; charset=utf-8', + 'Strict-Transport-Security', + 'max-age=31536000; includeSubDomains', + 'X-Content-Type-Options', + 'nosniff', + 'Access-Control-Allow-Origin', + '*', + 'Access-Control-Allow-Methods', + 'GET, OPTIONS', + 'P3P', + 'CP="DSP CUR OTPi IND OTRi ONL FIN"', + 'x-ms-request-id', + '41c02d2e-ea5c-4c6b-b8a9-d868aeed0a00', + 'x-ms-ests-server', + '2.1.12261.14 - KRSLR2 ProdSlices', + 'Set-Cookie', + 'fpc=AvExn83G_zNBpGcjRIyiTv0; expires=Sun, 09-Jan-2022 05:51:19 GMT; path=/; secure; HttpOnly; SameSite=None', + 'Set-Cookie', + 'esctx=AQABAAAAAAD--DLA3VO7QrddgJg7WevrLINrnECsre_HdgEtA-76Vlg9ZmovJsbi1fcM1opJqs4JvcmYvLpX6CVLkOJt74BzXa97xsswAGFOgdULnTglSngYR1xx3uFjXdeMiCD_vBTJ20OIZKD8gaB3YASaMNuhKLUB27T9ekxaSfQkaK6iyziXAHBzg5E6p25ihvdIVfggAA; domain=.login.microsoftonline.com; path=/; secure; HttpOnly; SameSite=None', + 'Set-Cookie', + 'x-ms-gateway-slice=estsfd; path=/; secure; samesite=none; httponly', + 'Set-Cookie', + 'stsservicecookie=estsfd; path=/; secure; samesite=none; httponly', + 'Date', + 'Fri, 10 Dec 2021 05:51:19 GMT', + 'Content-Length', + '980' +]); + +nock('https://login.microsoftonline.com:443', {"encodedQueryParams":true}) + .get('/88888888-8888-8888-8888-888888888888/v2.0/.well-known/openid-configuration') + .reply(200, {"token_endpoint":"https://login.microsoftonline.com/88888888-8888-8888-8888-888888888888/oauth2/v2.0/token","token_endpoint_auth_methods_supported":["client_secret_post","private_key_jwt","client_secret_basic"],"jwks_uri":"https://login.microsoftonline.com/88888888-8888-8888-8888-888888888888/discovery/v2.0/keys","response_modes_supported":["query","fragment","form_post"],"subject_types_supported":["pairwise"],"id_token_signing_alg_values_supported":["RS256"],"response_types_supported":["code","id_token","code id_token","id_token token"],"scopes_supported":["openid","profile","email","offline_access"],"issuer":"https://login.microsoftonline.com/88888888-8888-8888-8888-888888888888/v2.0","request_uri_parameter_supported":false,"userinfo_endpoint":"https://graph.microsoft.com/oidc/userinfo","authorization_endpoint":"https://login.microsoftonline.com/88888888-8888-8888-8888-888888888888/oauth2/v2.0/authorize","device_authorization_endpoint":"https://login.microsoftonline.com/88888888-8888-8888-8888-888888888888/oauth2/v2.0/devicecode","http_logout_supported":true,"frontchannel_logout_supported":true,"end_session_endpoint":"https://login.microsoftonline.com/88888888-8888-8888-8888-888888888888/oauth2/v2.0/logout","claims_supported":["sub","iss","cloud_instance_name","cloud_instance_host_name","cloud_graph_host_name","msgraph_host","aud","exp","iat","auth_time","acr","nonce","preferred_username","name","tid","ver","at_hash","c_hash","email"],"kerberos_endpoint":"https://login.microsoftonline.com/88888888-8888-8888-8888-888888888888/kerberos","tenant_region_scope":"WW","cloud_instance_name":"microsoftonline.com","cloud_graph_host_name":"graph.windows.net","msgraph_host":"graph.microsoft.com","rbac_url":"https://pas.windows.net"}, [ + 'Cache-Control', + 'max-age=86400, private', + 'Content-Type', + 'application/json; charset=utf-8', + 'Strict-Transport-Security', + 'max-age=31536000; includeSubDomains', + 'X-Content-Type-Options', + 'nosniff', + 'Access-Control-Allow-Origin', + '*', + 'Access-Control-Allow-Methods', + 'GET, OPTIONS', + 'P3P', + 'CP="DSP CUR OTPi IND OTRi ONL FIN"', + 'x-ms-request-id', + '056f2747-a290-418e-88dc-c95804490a00', + 'x-ms-ests-server', + '2.1.12261.14 - SEASLR2 ProdSlices', + 'Set-Cookie', + 'fpc=AjBb9CpHsVJDpDQKxtBlVSw; expires=Sun, 09-Jan-2022 05:51:19 GMT; path=/; secure; HttpOnly; SameSite=None', + 'Set-Cookie', + 'esctx=AQABAAAAAAD--DLA3VO7QrddgJg7WevrsxY35_KnK5RnN0_UEjdK4xn_w_Vd7hXRWiPU1H7otm20QE-bU8rsSXUQSkitV72h4SPLYJmzHvfg4R0LIDU28vfYhfG7oooXitGDY40Y4TWXj629BsRN2vlOnzPAIjYf1Au4DFRzYuMkKJ3vVEycFltgX3sw9hLThmfcey-fJEIgAA; domain=.login.microsoftonline.com; path=/; secure; HttpOnly; SameSite=None', + 'Set-Cookie', + 'x-ms-gateway-slice=estsfd; path=/; secure; samesite=none; httponly', + 'Set-Cookie', + 'stsservicecookie=estsfd; path=/; secure; samesite=none; httponly', + 'Date', + 'Fri, 10 Dec 2021 05:51:19 GMT', + 'Content-Length', + '1753' +]); + +nock('https://login.microsoftonline.com:443', {"encodedQueryParams":true}) + .post('/88888888-8888-8888-8888-888888888888/oauth2/v2.0/token', "client_id=azure_client_id&scope=https%3A%2F%2Fsanitized%2F&grant_type=client_credentials&x-client-SKU=msal.js.node&x-client-VER=1.3.3&x-client-OS=win32&x-client-CPU=x64&x-ms-lib-capability=retry-after, h429&x-client-current-telemetry=5|771,2,,,|,&x-client-last-telemetry=5|0|||0,0&client-request-id=bd723b0d-91a4-4a7e-bd86-96e6d2b5bdbc&client_secret=azure_client_secret&claims=%7B%22access_token%22%3A%7B%22xms_cc%22%3A%7B%22values%22%3A%5B%22cp1%22%5D%7D%7D%7D") + .reply(200, {"token_type":"Bearer","expires_in":86399,"ext_expires_in":86399,"access_token":"access_token"}, [ + 'Cache-Control', + 'no-store, no-cache', + 'Pragma', + 'no-cache', + 'Content-Type', + 'application/json; charset=utf-8', + 'Expires', + '-1', + 'Strict-Transport-Security', + 'max-age=31536000; includeSubDomains', + 'X-Content-Type-Options', + 'nosniff', + 'P3P', + 'CP="DSP CUR OTPi IND OTRi ONL FIN"', + 'x-ms-request-id', + '20616d55-2ea3-43e7-9507-b18d3ef80a00', + 'x-ms-ests-server', + '2.1.12261.14 - SEASLR1 ProdSlices', + 'x-ms-clitelem', + '1,0,0,,', + 'Set-Cookie', + 'fpc=ArOLJR9MyxlLm4l47w_o4YUWPr5BAQAAANfhRNkOAAAA; expires=Sun, 09-Jan-2022 05:51:20 GMT; path=/; secure; HttpOnly; SameSite=None', + 'Set-Cookie', + 'x-ms-gateway-slice=estsfd; path=/; secure; samesite=none; httponly', + 'Set-Cookie', + 'stsservicecookie=estsfd; path=/; secure; samesite=none; httponly', + 'Date', + 'Fri, 10 Dec 2021 05:51:20 GMT', + 'Content-Length', + '1374' +]); + +nock('https://management.azure.com:443', {"encodedQueryParams":true}) + .get('/subscriptions/azure_subscription_id/resourceGroups/myjstest/providers/Microsoft.Relay/namespaces/mynamespacexxx/wcfRelays/myrelayxxx/authorizationRules/myauthorizationxxxx') + .query(true) + .reply(200, ["1f8b0800000000000400edbd07601c499625262f6dca7b7f4af54ad7e074a10880601324d8904010ecc188cde692ec1d69472329ab2a81ca6556655d661640cced9dbcf7de7befbdf7de7befbdf7ba3b9d4e27f7dfff3f5c6664016cf6ce4adac99e2180aac81f3f7e7c1f3f227ef147c5eca3471fdd6dd693665a17abb6a896cddd877be70fefcf0eceb7ef4d3f7db0bdbfbbb7bffd7077fa60fb607abef3603a9b9cefedefdeadf3a65ad7d3fcf3ba5aaf9abb8beb9f6edabc69efaeeaeab298e57573f78b625a574d75de8e5fe565767d77992df266954d73b4b67fbc7bf7eeeed5f49c9be08b1abfe0c36cddceabbaf84106a45ead4b7e2df8905abdfb68f41140d120e25fb6d72b7cd9c5e505bdc3dd3777bf6b3b3ff6dfe71e0940594df96f02729a356dfad56bfa9006b9caebb6a0168f7ef1477571316fe9b7ef7df4bc20222ca9c1eb7c39fbe8fbbfe4","97fc3fa63c59c461010000"], [ + 'Cache-Control', + 'no-cache', + 'Pragma', + 'no-cache', + 'Transfer-Encoding', + 'chunked', + 'Content-Type', + 'application/json; charset=utf-8', + 'Content-Encoding', + 'gzip', + 'Expires', + '-1', + 'Vary', + 'Accept-Encoding', + 'x-ms-request-id', + 'f19fa546-8de2-423f-addc-9fffb7290af5_M2CH3_M2CH3', + 'Server-SB', + 'Service-Bus-Resource-Provider/CH3', + 'Server', + 'Service-Bus-Resource-Provider/CH3', + 'Server', + 'Microsoft-HTTPAPI/2.0', + 'x-ms-ratelimit-remaining-subscription-reads', + '11983', + 'x-ms-correlation-request-id', + '6c7c9595-5cd5-48a7-9ad1-ebc1e4381b60', + 'x-ms-routing-request-id', + 'SOUTHEASTASIA:20211210T055122Z:6c7c9595-5cd5-48a7-9ad1-ebc1e4381b60', + 'Strict-Transport-Security', + 'max-age=31536000; includeSubDomains', + 'X-Content-Type-Options', + 'nosniff', + 'Date', + 'Fri, 10 Dec 2021 05:51:21 GMT' +]); diff --git a/sdk/relay/arm-relay/recordings/node/relay_test/recording_wcfrelays_list_test.js b/sdk/relay/arm-relay/recordings/node/relay_test/recording_wcfrelays_list_test.js new file mode 100644 index 000000000000..870ea4102b9f --- /dev/null +++ b/sdk/relay/arm-relay/recordings/node/relay_test/recording_wcfrelays_list_test.js @@ -0,0 +1,153 @@ +let nock = require('nock'); + +module.exports.hash = "54dbb88b1f7bddfa451ff863a9b568c6"; + +module.exports.testInfo = {"uniqueName":{},"newDate":{}} + +nock('https://login.microsoftonline.com:443', {"encodedQueryParams":true}) + .get('/common/discovery/instance') + .query(true) + .reply(200, {"tenant_discovery_endpoint":"https://login.microsoftonline.com/88888888-8888-8888-8888-888888888888/v2.0/.well-known/openid-configuration","api-version":"1.1","metadata":[{"preferred_network":"login.microsoftonline.com","preferred_cache":"login.windows.net","aliases":["login.microsoftonline.com","login.windows.net","login.microsoft.com","sts.windows.net"]},{"preferred_network":"login.partner.microsoftonline.cn","preferred_cache":"login.partner.microsoftonline.cn","aliases":["login.partner.microsoftonline.cn","login.chinacloudapi.cn"]},{"preferred_network":"login.microsoftonline.de","preferred_cache":"login.microsoftonline.de","aliases":["login.microsoftonline.de"]},{"preferred_network":"login.microsoftonline.us","preferred_cache":"login.microsoftonline.us","aliases":["login.microsoftonline.us","login.usgovcloudapi.net"]},{"preferred_network":"login-us.microsoftonline.com","preferred_cache":"login-us.microsoftonline.com","aliases":["login-us.microsoftonline.com"]}]}, [ + 'Cache-Control', + 'max-age=86400, private', + 'Content-Type', + 'application/json; charset=utf-8', + 'Strict-Transport-Security', + 'max-age=31536000; includeSubDomains', + 'X-Content-Type-Options', + 'nosniff', + 'Access-Control-Allow-Origin', + '*', + 'Access-Control-Allow-Methods', + 'GET, OPTIONS', + 'P3P', + 'CP="DSP CUR OTPi IND OTRi ONL FIN"', + 'x-ms-request-id', + '84e10da0-7734-4177-95ed-c343f9db0b00', + 'x-ms-ests-server', + '2.1.12261.14 - KRSLR1 ProdSlices', + 'Set-Cookie', + 'fpc=Av7gCw64hzRFpEDPVwB8WqE; expires=Sun, 09-Jan-2022 05:51:22 GMT; path=/; secure; HttpOnly; SameSite=None', + 'Set-Cookie', + 'esctx=AQABAAAAAAD--DLA3VO7QrddgJg7WevrFvCvXjpU3HBfTJ7P1riQ5REuGjqrV4acAJy9N1mb-yS5y94BUG9Z966o0k6HS4SpnmFVIuqlUWJfl_QJqRJ8OPz6jiOswN8155T_LyvllyX9qisN_A3OyofkFcB9Z5Pjvlqj49x2qnifZ5U4ROE64r57dBwXAjzDt5gPrv779XogAA; domain=.login.microsoftonline.com; path=/; secure; HttpOnly; SameSite=None', + 'Set-Cookie', + 'x-ms-gateway-slice=estsfd; path=/; secure; samesite=none; httponly', + 'Set-Cookie', + 'stsservicecookie=estsfd; path=/; secure; samesite=none; httponly', + 'Date', + 'Fri, 10 Dec 2021 05:51:21 GMT', + 'Content-Length', + '980' +]); + +nock('https://login.microsoftonline.com:443', {"encodedQueryParams":true}) + .get('/88888888-8888-8888-8888-888888888888/v2.0/.well-known/openid-configuration') + .reply(200, {"token_endpoint":"https://login.microsoftonline.com/88888888-8888-8888-8888-888888888888/oauth2/v2.0/token","token_endpoint_auth_methods_supported":["client_secret_post","private_key_jwt","client_secret_basic"],"jwks_uri":"https://login.microsoftonline.com/88888888-8888-8888-8888-888888888888/discovery/v2.0/keys","response_modes_supported":["query","fragment","form_post"],"subject_types_supported":["pairwise"],"id_token_signing_alg_values_supported":["RS256"],"response_types_supported":["code","id_token","code id_token","id_token token"],"scopes_supported":["openid","profile","email","offline_access"],"issuer":"https://login.microsoftonline.com/88888888-8888-8888-8888-888888888888/v2.0","request_uri_parameter_supported":false,"userinfo_endpoint":"https://graph.microsoft.com/oidc/userinfo","authorization_endpoint":"https://login.microsoftonline.com/88888888-8888-8888-8888-888888888888/oauth2/v2.0/authorize","device_authorization_endpoint":"https://login.microsoftonline.com/88888888-8888-8888-8888-888888888888/oauth2/v2.0/devicecode","http_logout_supported":true,"frontchannel_logout_supported":true,"end_session_endpoint":"https://login.microsoftonline.com/88888888-8888-8888-8888-888888888888/oauth2/v2.0/logout","claims_supported":["sub","iss","cloud_instance_name","cloud_instance_host_name","cloud_graph_host_name","msgraph_host","aud","exp","iat","auth_time","acr","nonce","preferred_username","name","tid","ver","at_hash","c_hash","email"],"kerberos_endpoint":"https://login.microsoftonline.com/88888888-8888-8888-8888-888888888888/kerberos","tenant_region_scope":"WW","cloud_instance_name":"microsoftonline.com","cloud_graph_host_name":"graph.windows.net","msgraph_host":"graph.microsoft.com","rbac_url":"https://pas.windows.net"}, [ + 'Cache-Control', + 'max-age=86400, private', + 'Content-Type', + 'application/json; charset=utf-8', + 'Strict-Transport-Security', + 'max-age=31536000; includeSubDomains', + 'X-Content-Type-Options', + 'nosniff', + 'Access-Control-Allow-Origin', + '*', + 'Access-Control-Allow-Methods', + 'GET, OPTIONS', + 'P3P', + 'CP="DSP CUR OTPi IND OTRi ONL FIN"', + 'x-ms-request-id', + '84e10da0-7734-4177-95ed-c343fadb0b00', + 'x-ms-ests-server', + '2.1.12261.14 - KRSLR1 ProdSlices', + 'Set-Cookie', + 'fpc=AkcITIwmr1xJgZjZxm1fdVI; expires=Sun, 09-Jan-2022 05:51:22 GMT; path=/; secure; HttpOnly; SameSite=None', + 'Set-Cookie', + 'esctx=AQABAAAAAAD--DLA3VO7QrddgJg7WevrlVjgirAClCmQhGj-xp95NTKpfSo2vVTMxaHD73Guu_UlpHx1t2l5UkCGVLFqtqo3I_Jq7lOMDWuxIm1OswgOhFpJcZJY-S7mLQLMtD7-CE-rJL3o51MnCvuq7os_jS0-PvjXmYi4Zoe6oqN6HLHG_yqnHvG3kjizEwEaLTFwqrcgAA; domain=.login.microsoftonline.com; path=/; secure; HttpOnly; SameSite=None', + 'Set-Cookie', + 'x-ms-gateway-slice=estsfd; path=/; secure; samesite=none; httponly', + 'Set-Cookie', + 'stsservicecookie=estsfd; path=/; secure; samesite=none; httponly', + 'Date', + 'Fri, 10 Dec 2021 05:51:22 GMT', + 'Content-Length', + '1753' +]); + +nock('https://login.microsoftonline.com:443', {"encodedQueryParams":true}) + .post('/88888888-8888-8888-8888-888888888888/oauth2/v2.0/token', "client_id=azure_client_id&scope=https%3A%2F%2Fsanitized%2F&grant_type=client_credentials&x-client-SKU=msal.js.node&x-client-VER=1.3.3&x-client-OS=win32&x-client-CPU=x64&x-ms-lib-capability=retry-after, h429&x-client-current-telemetry=5|771,2,,,|,&x-client-last-telemetry=5|0|||0,0&client-request-id=82f8dc6c-5434-4407-a044-436e25d4c1e8&client_secret=azure_client_secret&claims=%7B%22access_token%22%3A%7B%22xms_cc%22%3A%7B%22values%22%3A%5B%22cp1%22%5D%7D%7D%7D") + .reply(200, {"token_type":"Bearer","expires_in":86399,"ext_expires_in":86399,"access_token":"access_token"}, [ + 'Cache-Control', + 'no-store, no-cache', + 'Pragma', + 'no-cache', + 'Content-Type', + 'application/json; charset=utf-8', + 'Expires', + '-1', + 'Strict-Transport-Security', + 'max-age=31536000; includeSubDomains', + 'X-Content-Type-Options', + 'nosniff', + 'P3P', + 'CP="DSP CUR OTPi IND OTRi ONL FIN"', + 'x-ms-request-id', + '25e1b200-ca8c-4386-a214-6e120dbb0a00', + 'x-ms-ests-server', + '2.1.12261.14 - SEASLR2 ProdSlices', + 'x-ms-clitelem', + '1,0,0,,', + 'Set-Cookie', + 'fpc=ArzYnrgOfU9LhwYOjT3iTvkWPr5BAQAAANrhRNkOAAAA; expires=Sun, 09-Jan-2022 05:51:22 GMT; path=/; secure; HttpOnly; SameSite=None', + 'Set-Cookie', + 'x-ms-gateway-slice=estsfd; path=/; secure; samesite=none; httponly', + 'Set-Cookie', + 'stsservicecookie=estsfd; path=/; secure; samesite=none; httponly', + 'Date', + 'Fri, 10 Dec 2021 05:51:22 GMT', + 'Content-Length', + '1374' +]); + +nock('https://management.azure.com:443', {"encodedQueryParams":true}) + .get('/subscriptions/azure_subscription_id/resourceGroups/myjstest/providers/Microsoft.Relay/namespaces/mynamespacexxx/wcfRelays') + .query(true) + .reply(200, ["1f8b0800000000000400edbd07601c499625262f6dca7b7f4af54ad7e074a10880601324d8904010ecc188cde692ec1d69472329ab2a81ca6556655d661640cced9dbcf7de7befbdf7de7befbdf7ba3b9d4e27f7dfff3f5c6664016cf6ce4adac99e2180aac81f3f7e7c1f3f227ef1479759b9ce3f7af4bd5ffc5131fbe8d147779bf5a499d6c5aa2daa6573f7e1def9c3fbb383f3ed7bd34f1f6cefefeeed6f3fdc9d3ed83e989eef3c98ce26e77bfbbb77ebbca9d6f534ffbcaed6abe6eee2faa79b366fdabbabbaba2c6679dddcfda298d655539db7e35779995ddf5d668bbc5965d31caded1fefdebdbb7b353de726f8a2c62ff4e147a38fd086b00b3e6baf57f8ac0bfb05356570cdddef1a60d4baaca619c6446f9c664d9b7ef59a3e240c5779dd1679f3d1a35ffcd1b4ceb3369f1db7d4666f676f777b776f7b77e7cdcefd47f7771fedde1fdfdb79b8bfb3fbe0a7e8c5f56ab6a1e983f1debd070f1f7cba8ba66541d458e6f549b55e52f39dd14775fe8bd60511eda42cf2657bbc6ee7555dfc40b16beb758e2684f61b19e08bbc7d335d1124f3de9b3a5b36abaa6e5fe7d3755db4d7e6ada2790a6a16d38f1e9d676593ff925ff2fd","5ff2ff007dd22ca6e2010000"], [ + 'Cache-Control', + 'no-cache', + 'Pragma', + 'no-cache', + 'Transfer-Encoding', + 'chunked', + 'Content-Type', + 'application/json; charset=utf-8', + 'Content-Encoding', + 'gzip', + 'Expires', + '-1', + 'Vary', + 'Accept-Encoding', + 'x-ms-inline-count', + '', + 'x-ms-request-id', + '42fc3e7b-2511-44c9-adfa-b06f8a19606b_M9CH3_M9CH3', + 'Server-SB', + 'Service-Bus-Resource-Provider/CH3', + 'Server', + 'Service-Bus-Resource-Provider/CH3', + 'Server', + 'Microsoft-HTTPAPI/2.0', + 'x-ms-ratelimit-remaining-subscription-reads', + '11982', + 'x-ms-correlation-request-id', + 'e284d792-387a-4f6e-aed1-7d0eadbd1199', + 'x-ms-routing-request-id', + 'SOUTHEASTASIA:20211210T055124Z:e284d792-387a-4f6e-aed1-7d0eadbd1199', + 'Strict-Transport-Security', + 'max-age=31536000; includeSubDomains', + 'X-Content-Type-Options', + 'nosniff', + 'Date', + 'Fri, 10 Dec 2021 05:51:23 GMT' +]); diff --git a/sdk/relay/arm-relay/recordings/node/relay_test/recording_wcfrelays_listauthorizationrules_test.js b/sdk/relay/arm-relay/recordings/node/relay_test/recording_wcfrelays_listauthorizationrules_test.js new file mode 100644 index 000000000000..ee30966c7ea9 --- /dev/null +++ b/sdk/relay/arm-relay/recordings/node/relay_test/recording_wcfrelays_listauthorizationrules_test.js @@ -0,0 +1,151 @@ +let nock = require('nock'); + +module.exports.hash = "bfa03c59f93568b3e311eb9393e6876f"; + +module.exports.testInfo = {"uniqueName":{},"newDate":{}} + +nock('https://login.microsoftonline.com:443', {"encodedQueryParams":true}) + .get('/common/discovery/instance') + .query(true) + .reply(200, {"tenant_discovery_endpoint":"https://login.microsoftonline.com/88888888-8888-8888-8888-888888888888/v2.0/.well-known/openid-configuration","api-version":"1.1","metadata":[{"preferred_network":"login.microsoftonline.com","preferred_cache":"login.windows.net","aliases":["login.microsoftonline.com","login.windows.net","login.microsoft.com","sts.windows.net"]},{"preferred_network":"login.partner.microsoftonline.cn","preferred_cache":"login.partner.microsoftonline.cn","aliases":["login.partner.microsoftonline.cn","login.chinacloudapi.cn"]},{"preferred_network":"login.microsoftonline.de","preferred_cache":"login.microsoftonline.de","aliases":["login.microsoftonline.de"]},{"preferred_network":"login.microsoftonline.us","preferred_cache":"login.microsoftonline.us","aliases":["login.microsoftonline.us","login.usgovcloudapi.net"]},{"preferred_network":"login-us.microsoftonline.com","preferred_cache":"login-us.microsoftonline.com","aliases":["login-us.microsoftonline.com"]}]}, [ + 'Cache-Control', + 'max-age=86400, private', + 'Content-Type', + 'application/json; charset=utf-8', + 'Strict-Transport-Security', + 'max-age=31536000; includeSubDomains', + 'X-Content-Type-Options', + 'nosniff', + 'Access-Control-Allow-Origin', + '*', + 'Access-Control-Allow-Methods', + 'GET, OPTIONS', + 'P3P', + 'CP="DSP CUR OTPi IND OTRi ONL FIN"', + 'x-ms-request-id', + '41c02d2e-ea5c-4c6b-b8a9-d868cced0a00', + 'x-ms-ests-server', + '2.1.12261.14 - KRSLR2 ProdSlices', + 'Set-Cookie', + 'fpc=AiX85CHSKQ1ClLUhgqeTSYc; expires=Sun, 09-Jan-2022 05:51:24 GMT; path=/; secure; HttpOnly; SameSite=None', + 'Set-Cookie', + 'esctx=AQABAAAAAAD--DLA3VO7QrddgJg7Wevr3-xVZGeOGWVWKFXhfpJALit97Zt9zrH3zNZ553FxBSupmLKiIYwnoBdEs85XML2PpEYs-xUT9Ix5-CCbPxsAtVcXmvzVE9d2KZ_I9njAZc1xARlgUm0cAPLVJz-XmkKad_N1rAOKI4QWIx4AWEl4DvbPGPvGIhtj9W8WHN1pQ8YgAA; domain=.login.microsoftonline.com; path=/; secure; HttpOnly; SameSite=None', + 'Set-Cookie', + 'x-ms-gateway-slice=estsfd; path=/; secure; samesite=none; httponly', + 'Set-Cookie', + 'stsservicecookie=estsfd; path=/; secure; samesite=none; httponly', + 'Date', + 'Fri, 10 Dec 2021 05:51:24 GMT', + 'Content-Length', + '980' +]); + +nock('https://login.microsoftonline.com:443', {"encodedQueryParams":true}) + .get('/88888888-8888-8888-8888-888888888888/v2.0/.well-known/openid-configuration') + .reply(200, {"token_endpoint":"https://login.microsoftonline.com/88888888-8888-8888-8888-888888888888/oauth2/v2.0/token","token_endpoint_auth_methods_supported":["client_secret_post","private_key_jwt","client_secret_basic"],"jwks_uri":"https://login.microsoftonline.com/88888888-8888-8888-8888-888888888888/discovery/v2.0/keys","response_modes_supported":["query","fragment","form_post"],"subject_types_supported":["pairwise"],"id_token_signing_alg_values_supported":["RS256"],"response_types_supported":["code","id_token","code id_token","id_token token"],"scopes_supported":["openid","profile","email","offline_access"],"issuer":"https://login.microsoftonline.com/88888888-8888-8888-8888-888888888888/v2.0","request_uri_parameter_supported":false,"userinfo_endpoint":"https://graph.microsoft.com/oidc/userinfo","authorization_endpoint":"https://login.microsoftonline.com/88888888-8888-8888-8888-888888888888/oauth2/v2.0/authorize","device_authorization_endpoint":"https://login.microsoftonline.com/88888888-8888-8888-8888-888888888888/oauth2/v2.0/devicecode","http_logout_supported":true,"frontchannel_logout_supported":true,"end_session_endpoint":"https://login.microsoftonline.com/88888888-8888-8888-8888-888888888888/oauth2/v2.0/logout","claims_supported":["sub","iss","cloud_instance_name","cloud_instance_host_name","cloud_graph_host_name","msgraph_host","aud","exp","iat","auth_time","acr","nonce","preferred_username","name","tid","ver","at_hash","c_hash","email"],"kerberos_endpoint":"https://login.microsoftonline.com/88888888-8888-8888-8888-888888888888/kerberos","tenant_region_scope":"WW","cloud_instance_name":"microsoftonline.com","cloud_graph_host_name":"graph.windows.net","msgraph_host":"graph.microsoft.com","rbac_url":"https://pas.windows.net"}, [ + 'Cache-Control', + 'max-age=86400, private', + 'Content-Type', + 'application/json; charset=utf-8', + 'Strict-Transport-Security', + 'max-age=31536000; includeSubDomains', + 'X-Content-Type-Options', + 'nosniff', + 'Access-Control-Allow-Origin', + '*', + 'Access-Control-Allow-Methods', + 'GET, OPTIONS', + 'P3P', + 'CP="DSP CUR OTPi IND OTRi ONL FIN"', + 'x-ms-request-id', + '9e4deb1d-59f9-4f91-a0fa-cb1e19400b00', + 'x-ms-ests-server', + '2.1.12261.14 - KRSLR2 ProdSlices', + 'Set-Cookie', + 'fpc=AlTJFd_df5VJm-cavhobmnI; expires=Sun, 09-Jan-2022 05:51:24 GMT; path=/; secure; HttpOnly; SameSite=None', + 'Set-Cookie', + 'esctx=AQABAAAAAAD--DLA3VO7QrddgJg7WevrH-3x_nm6EWEJWA8Mj5GyKT9a7gaUTddGGU--u7c0_1-oPEWxEPoWGJid5MDjtbZdngrWdqat21clbCb12xjR6m740Id7SRwNpK-oq6Abhj8pUt5MICbmGChNKhIf9kyVZr3f9Ak0UiYK0WNp0tFWgf8LfEYikxwWfukCSJ-2RfYgAA; domain=.login.microsoftonline.com; path=/; secure; HttpOnly; SameSite=None', + 'Set-Cookie', + 'x-ms-gateway-slice=estsfd; path=/; secure; samesite=none; httponly', + 'Set-Cookie', + 'stsservicecookie=estsfd; path=/; secure; samesite=none; httponly', + 'Date', + 'Fri, 10 Dec 2021 05:51:24 GMT', + 'Content-Length', + '1753' +]); + +nock('https://login.microsoftonline.com:443', {"encodedQueryParams":true}) + .post('/88888888-8888-8888-8888-888888888888/oauth2/v2.0/token', "client_id=azure_client_id&scope=https%3A%2F%2Fsanitized%2F&grant_type=client_credentials&x-client-SKU=msal.js.node&x-client-VER=1.3.3&x-client-OS=win32&x-client-CPU=x64&x-ms-lib-capability=retry-after, h429&x-client-current-telemetry=5|771,2,,,|,&x-client-last-telemetry=5|0|||0,0&client-request-id=463b537e-baaf-457a-b163-c09250fec84c&client_secret=azure_client_secret&claims=%7B%22access_token%22%3A%7B%22xms_cc%22%3A%7B%22values%22%3A%5B%22cp1%22%5D%7D%7D%7D") + .reply(200, {"token_type":"Bearer","expires_in":86399,"ext_expires_in":86399,"access_token":"access_token"}, [ + 'Cache-Control', + 'no-store, no-cache', + 'Pragma', + 'no-cache', + 'Content-Type', + 'application/json; charset=utf-8', + 'Expires', + '-1', + 'Strict-Transport-Security', + 'max-age=31536000; includeSubDomains', + 'X-Content-Type-Options', + 'nosniff', + 'P3P', + 'CP="DSP CUR OTPi IND OTRi ONL FIN"', + 'x-ms-request-id', + '41c02d2e-ea5c-4c6b-b8a9-d868d0ed0a00', + 'x-ms-ests-server', + '2.1.12261.14 - KRSLR2 ProdSlices', + 'x-ms-clitelem', + '1,0,0,,', + 'Set-Cookie', + 'fpc=AvQj_wZcAfZEgJGsjQGyfawWPr5BAQAAANzhRNkOAAAA; expires=Sun, 09-Jan-2022 05:51:25 GMT; path=/; secure; HttpOnly; SameSite=None', + 'Set-Cookie', + 'x-ms-gateway-slice=estsfd; path=/; secure; samesite=none; httponly', + 'Set-Cookie', + 'stsservicecookie=estsfd; path=/; secure; samesite=none; httponly', + 'Date', + 'Fri, 10 Dec 2021 05:51:24 GMT', + 'Content-Length', + '1374' +]); + +nock('https://management.azure.com:443', {"encodedQueryParams":true}) + .get('/subscriptions/azure_subscription_id/resourceGroups/myjstest/providers/Microsoft.Relay/namespaces/mynamespacexxx/wcfRelays/myauthorizationxxxx/authorizationRules') + .query(true) + .reply(200, ["1f8b0800000000000400edbd07601c499625262f6dca7b7f4af54ad7e074a10880601324d8904010ecc188cde692ec1d69472329ab2a81ca6556655d661640cced9dbcf7de7befbdf7de7befbdf7ba3b9d4e27f7dfff3f5c6664016cf6ce4adac99e2180aac81f3f7e7c1f3f227ef12f","f97f0043bfa6a302000000"], [ + 'Cache-Control', + 'no-cache', + 'Pragma', + 'no-cache', + 'Transfer-Encoding', + 'chunked', + 'Content-Type', + 'application/json; charset=utf-8', + 'Content-Encoding', + 'gzip', + 'Expires', + '-1', + 'Vary', + 'Accept-Encoding', + 'x-ms-request-id', + 'bad685ba-e1e0-4074-aad7-8cdc6a49bdaa_M2CH3_M2CH3', + 'Server-SB', + 'Service-Bus-Resource-Provider/CH3', + 'Server', + 'Service-Bus-Resource-Provider/CH3', + 'Server', + 'Microsoft-HTTPAPI/2.0', + 'x-ms-ratelimit-remaining-subscription-reads', + '11981', + 'x-ms-correlation-request-id', + 'afb2e4ca-f46c-4014-84e9-373dbb5d45fe', + 'x-ms-routing-request-id', + 'SOUTHEASTASIA:20211210T055127Z:afb2e4ca-f46c-4014-84e9-373dbb5d45fe', + 'Strict-Transport-Security', + 'max-age=31536000; includeSubDomains', + 'X-Content-Type-Options', + 'nosniff', + 'Date', + 'Fri, 10 Dec 2021 05:51:26 GMT' +]); diff --git a/sdk/relay/arm-relay/review/arm-relay.api.md b/sdk/relay/arm-relay/review/arm-relay.api.md new file mode 100644 index 000000000000..34a98249e423 --- /dev/null +++ b/sdk/relay/arm-relay/review/arm-relay.api.md @@ -0,0 +1,539 @@ +## API Report File for "@azure/arm-relay" + +> Do not edit this file. It is a report generated by [API Extractor](https://api-extractor.com/). + +```ts + +import * as coreAuth from '@azure/core-auth'; +import * as coreClient from '@azure/core-client'; +import { PagedAsyncIterableIterator } from '@azure/core-paging'; +import { PollerLike } from '@azure/core-lro'; +import { PollOperationState } from '@azure/core-lro'; + +// @public +export interface AccessKeys { + keyName?: string; + primaryConnectionString?: string; + primaryKey?: string; + secondaryConnectionString?: string; + secondaryKey?: string; +} + +// @public +export type AccessRights = "Manage" | "Send" | "Listen"; + +// @public +export type AuthorizationRule = Resource & { + rights: AccessRights[]; +}; + +// @public +export interface AuthorizationRuleListResult { + nextLink?: string; + value?: AuthorizationRule[]; +} + +// @public +export interface CheckNameAvailability { + name: string; +} + +// @public +export interface CheckNameAvailabilityResult { + readonly message?: string; + nameAvailable?: boolean; + reason?: UnavailableReason; +} + +// @public +export interface ErrorResponse { + code?: string; + message?: string; +} + +// @public +export type HybridConnection = Resource & { + readonly createdAt?: Date; + readonly updatedAt?: Date; + readonly listenerCount?: number; + requiresClientAuthorization?: boolean; + userMetadata?: string; +}; + +// @public +export interface HybridConnectionListResult { + nextLink?: string; + value?: HybridConnection[]; +} + +// @public +export interface HybridConnections { + createOrUpdate(resourceGroupName: string, namespaceName: string, hybridConnectionName: string, parameters: HybridConnection, options?: HybridConnectionsCreateOrUpdateOptionalParams): Promise; + createOrUpdateAuthorizationRule(resourceGroupName: string, namespaceName: string, hybridConnectionName: string, authorizationRuleName: string, parameters: AuthorizationRule, options?: HybridConnectionsCreateOrUpdateAuthorizationRuleOptionalParams): Promise; + delete(resourceGroupName: string, namespaceName: string, hybridConnectionName: string, options?: HybridConnectionsDeleteOptionalParams): Promise; + deleteAuthorizationRule(resourceGroupName: string, namespaceName: string, hybridConnectionName: string, authorizationRuleName: string, options?: HybridConnectionsDeleteAuthorizationRuleOptionalParams): Promise; + get(resourceGroupName: string, namespaceName: string, hybridConnectionName: string, options?: HybridConnectionsGetOptionalParams): Promise; + getAuthorizationRule(resourceGroupName: string, namespaceName: string, hybridConnectionName: string, authorizationRuleName: string, options?: HybridConnectionsGetAuthorizationRuleOptionalParams): Promise; + listAuthorizationRules(resourceGroupName: string, namespaceName: string, hybridConnectionName: string, options?: HybridConnectionsListAuthorizationRulesOptionalParams): PagedAsyncIterableIterator; + listByNamespace(resourceGroupName: string, namespaceName: string, options?: HybridConnectionsListByNamespaceOptionalParams): PagedAsyncIterableIterator; + listKeys(resourceGroupName: string, namespaceName: string, hybridConnectionName: string, authorizationRuleName: string, options?: HybridConnectionsListKeysOptionalParams): Promise; + regenerateKeys(resourceGroupName: string, namespaceName: string, hybridConnectionName: string, authorizationRuleName: string, parameters: RegenerateAccessKeyParameters, options?: HybridConnectionsRegenerateKeysOptionalParams): Promise; +} + +// @public +export interface HybridConnectionsCreateOrUpdateAuthorizationRuleOptionalParams extends coreClient.OperationOptions { +} + +// @public +export type HybridConnectionsCreateOrUpdateAuthorizationRuleResponse = AuthorizationRule; + +// @public +export interface HybridConnectionsCreateOrUpdateOptionalParams extends coreClient.OperationOptions { +} + +// @public +export type HybridConnectionsCreateOrUpdateResponse = HybridConnection; + +// @public +export interface HybridConnectionsDeleteAuthorizationRuleOptionalParams extends coreClient.OperationOptions { +} + +// @public +export interface HybridConnectionsDeleteOptionalParams extends coreClient.OperationOptions { +} + +// @public +export interface HybridConnectionsGetAuthorizationRuleOptionalParams extends coreClient.OperationOptions { +} + +// @public +export type HybridConnectionsGetAuthorizationRuleResponse = AuthorizationRule; + +// @public +export interface HybridConnectionsGetOptionalParams extends coreClient.OperationOptions { +} + +// @public +export type HybridConnectionsGetResponse = HybridConnection; + +// @public +export interface HybridConnectionsListAuthorizationRulesNextOptionalParams extends coreClient.OperationOptions { +} + +// @public +export type HybridConnectionsListAuthorizationRulesNextResponse = AuthorizationRuleListResult; + +// @public +export interface HybridConnectionsListAuthorizationRulesOptionalParams extends coreClient.OperationOptions { +} + +// @public +export type HybridConnectionsListAuthorizationRulesResponse = AuthorizationRuleListResult; + +// @public +export interface HybridConnectionsListByNamespaceNextOptionalParams extends coreClient.OperationOptions { +} + +// @public +export type HybridConnectionsListByNamespaceNextResponse = HybridConnectionListResult; + +// @public +export interface HybridConnectionsListByNamespaceOptionalParams extends coreClient.OperationOptions { +} + +// @public +export type HybridConnectionsListByNamespaceResponse = HybridConnectionListResult; + +// @public +export interface HybridConnectionsListKeysOptionalParams extends coreClient.OperationOptions { +} + +// @public +export type HybridConnectionsListKeysResponse = AccessKeys; + +// @public +export interface HybridConnectionsRegenerateKeysOptionalParams extends coreClient.OperationOptions { +} + +// @public +export type HybridConnectionsRegenerateKeysResponse = AccessKeys; + +// @public +type KeyType_2 = "PrimaryKey" | "SecondaryKey"; +export { KeyType_2 as KeyType } + +// @public +export interface Namespaces { + beginCreateOrUpdate(resourceGroupName: string, namespaceName: string, parameters: RelayNamespace, options?: NamespacesCreateOrUpdateOptionalParams): Promise, NamespacesCreateOrUpdateResponse>>; + beginCreateOrUpdateAndWait(resourceGroupName: string, namespaceName: string, parameters: RelayNamespace, options?: NamespacesCreateOrUpdateOptionalParams): Promise; + beginDelete(resourceGroupName: string, namespaceName: string, options?: NamespacesDeleteOptionalParams): Promise, void>>; + beginDeleteAndWait(resourceGroupName: string, namespaceName: string, options?: NamespacesDeleteOptionalParams): Promise; + checkNameAvailability(parameters: CheckNameAvailability, options?: NamespacesCheckNameAvailabilityOptionalParams): Promise; + createOrUpdateAuthorizationRule(resourceGroupName: string, namespaceName: string, authorizationRuleName: string, parameters: AuthorizationRule, options?: NamespacesCreateOrUpdateAuthorizationRuleOptionalParams): Promise; + deleteAuthorizationRule(resourceGroupName: string, namespaceName: string, authorizationRuleName: string, options?: NamespacesDeleteAuthorizationRuleOptionalParams): Promise; + get(resourceGroupName: string, namespaceName: string, options?: NamespacesGetOptionalParams): Promise; + getAuthorizationRule(resourceGroupName: string, namespaceName: string, authorizationRuleName: string, options?: NamespacesGetAuthorizationRuleOptionalParams): Promise; + list(options?: NamespacesListOptionalParams): PagedAsyncIterableIterator; + listAuthorizationRules(resourceGroupName: string, namespaceName: string, options?: NamespacesListAuthorizationRulesOptionalParams): PagedAsyncIterableIterator; + listByResourceGroup(resourceGroupName: string, options?: NamespacesListByResourceGroupOptionalParams): PagedAsyncIterableIterator; + listKeys(resourceGroupName: string, namespaceName: string, authorizationRuleName: string, options?: NamespacesListKeysOptionalParams): Promise; + regenerateKeys(resourceGroupName: string, namespaceName: string, authorizationRuleName: string, parameters: RegenerateAccessKeyParameters, options?: NamespacesRegenerateKeysOptionalParams): Promise; + update(resourceGroupName: string, namespaceName: string, parameters: RelayUpdateParameters, options?: NamespacesUpdateOptionalParams): Promise; +} + +// @public +export interface NamespacesCheckNameAvailabilityOptionalParams extends coreClient.OperationOptions { +} + +// @public +export type NamespacesCheckNameAvailabilityResponse = CheckNameAvailabilityResult; + +// @public +export interface NamespacesCreateOrUpdateAuthorizationRuleOptionalParams extends coreClient.OperationOptions { +} + +// @public +export type NamespacesCreateOrUpdateAuthorizationRuleResponse = AuthorizationRule; + +// @public +export interface NamespacesCreateOrUpdateOptionalParams extends coreClient.OperationOptions { + resumeFrom?: string; + updateIntervalInMs?: number; +} + +// @public +export type NamespacesCreateOrUpdateResponse = RelayNamespace; + +// @public +export interface NamespacesDeleteAuthorizationRuleOptionalParams extends coreClient.OperationOptions { +} + +// @public +export interface NamespacesDeleteOptionalParams extends coreClient.OperationOptions { + resumeFrom?: string; + updateIntervalInMs?: number; +} + +// @public +export interface NamespacesGetAuthorizationRuleOptionalParams extends coreClient.OperationOptions { +} + +// @public +export type NamespacesGetAuthorizationRuleResponse = AuthorizationRule; + +// @public +export interface NamespacesGetOptionalParams extends coreClient.OperationOptions { +} + +// @public +export type NamespacesGetResponse = RelayNamespace; + +// @public +export interface NamespacesListAuthorizationRulesNextOptionalParams extends coreClient.OperationOptions { +} + +// @public +export type NamespacesListAuthorizationRulesNextResponse = AuthorizationRuleListResult; + +// @public +export interface NamespacesListAuthorizationRulesOptionalParams extends coreClient.OperationOptions { +} + +// @public +export type NamespacesListAuthorizationRulesResponse = AuthorizationRuleListResult; + +// @public +export interface NamespacesListByResourceGroupNextOptionalParams extends coreClient.OperationOptions { +} + +// @public +export type NamespacesListByResourceGroupNextResponse = RelayNamespaceListResult; + +// @public +export interface NamespacesListByResourceGroupOptionalParams extends coreClient.OperationOptions { +} + +// @public +export type NamespacesListByResourceGroupResponse = RelayNamespaceListResult; + +// @public +export interface NamespacesListKeysOptionalParams extends coreClient.OperationOptions { +} + +// @public +export type NamespacesListKeysResponse = AccessKeys; + +// @public +export interface NamespacesListNextOptionalParams extends coreClient.OperationOptions { +} + +// @public +export type NamespacesListNextResponse = RelayNamespaceListResult; + +// @public +export interface NamespacesListOptionalParams extends coreClient.OperationOptions { +} + +// @public +export type NamespacesListResponse = RelayNamespaceListResult; + +// @public +export interface NamespacesRegenerateKeysOptionalParams extends coreClient.OperationOptions { +} + +// @public +export type NamespacesRegenerateKeysResponse = AccessKeys; + +// @public +export interface NamespacesUpdateOptionalParams extends coreClient.OperationOptions { +} + +// @public +export type NamespacesUpdateResponse = RelayNamespace; + +// @public +export interface Operation { + display?: OperationDisplay; + readonly name?: string; +} + +// @public +export interface OperationDisplay { + readonly operation?: string; + readonly provider?: string; + readonly resource?: string; +} + +// @public +export interface OperationListResult { + readonly nextLink?: string; + readonly value?: Operation[]; +} + +// @public +export interface Operations { + list(options?: OperationsListOptionalParams): PagedAsyncIterableIterator; +} + +// @public +export interface OperationsListNextOptionalParams extends coreClient.OperationOptions { +} + +// @public +export type OperationsListNextResponse = OperationListResult; + +// @public +export interface OperationsListOptionalParams extends coreClient.OperationOptions { +} + +// @public +export type OperationsListResponse = OperationListResult; + +// @public +export type ProvisioningStateEnum = "Created" | "Succeeded" | "Deleted" | "Failed" | "Updating" | "Unknown"; + +// @public +export interface RegenerateAccessKeyParameters { + key?: string; + keyType: KeyType_2; +} + +// @public (undocumented) +export class RelayAPI extends coreClient.ServiceClient { + // (undocumented) + $host: string; + constructor(credentials: coreAuth.TokenCredential, subscriptionId: string, options?: RelayAPIOptionalParams); + // (undocumented) + apiVersion: string; + // (undocumented) + hybridConnections: HybridConnections; + // (undocumented) + namespaces: Namespaces; + // (undocumented) + operations: Operations; + // (undocumented) + subscriptionId: string; + // (undocumented) + wCFRelays: WCFRelays; +} + +// @public +export interface RelayAPIOptionalParams extends coreClient.ServiceClientOptions { + $host?: string; + apiVersion?: string; + endpoint?: string; +} + +// @public +export type RelayNamespace = TrackedResource & { + sku?: Sku; + readonly provisioningState?: ProvisioningStateEnum; + readonly createdAt?: Date; + readonly updatedAt?: Date; + readonly serviceBusEndpoint?: string; + readonly metricId?: string; +}; + +// @public +export interface RelayNamespaceListResult { + nextLink?: string; + value?: RelayNamespace[]; +} + +// @public +export type Relaytype = "NetTcp" | "Http"; + +// @public +export type RelayUpdateParameters = ResourceNamespacePatch & { + sku?: Sku; + readonly provisioningState?: ProvisioningStateEnum; + readonly createdAt?: Date; + readonly updatedAt?: Date; + readonly serviceBusEndpoint?: string; + readonly metricId?: string; +}; + +// @public +export interface Resource { + readonly id?: string; + readonly name?: string; + readonly type?: string; +} + +// @public +export type ResourceNamespacePatch = Resource & { + tags?: { + [propertyName: string]: string; + }; +}; + +// @public +export interface Sku { + name: "Standard"; + tier?: "Standard"; +} + +// @public +export type TrackedResource = Resource & { + location: string; + tags?: { + [propertyName: string]: string; + }; +}; + +// @public +export type UnavailableReason = "None" | "InvalidName" | "SubscriptionIsDisabled" | "NameInUse" | "NameInLockdown" | "TooManyNamespaceInCurrentSubscription"; + +// @public +export type WcfRelay = Resource & { + readonly isDynamic?: boolean; + readonly createdAt?: Date; + readonly updatedAt?: Date; + readonly listenerCount?: number; + relayType?: Relaytype; + requiresClientAuthorization?: boolean; + requiresTransportSecurity?: boolean; + userMetadata?: string; +}; + +// @public +export interface WCFRelays { + createOrUpdate(resourceGroupName: string, namespaceName: string, relayName: string, parameters: WcfRelay, options?: WCFRelaysCreateOrUpdateOptionalParams): Promise; + createOrUpdateAuthorizationRule(resourceGroupName: string, namespaceName: string, relayName: string, authorizationRuleName: string, parameters: AuthorizationRule, options?: WCFRelaysCreateOrUpdateAuthorizationRuleOptionalParams): Promise; + delete(resourceGroupName: string, namespaceName: string, relayName: string, options?: WCFRelaysDeleteOptionalParams): Promise; + deleteAuthorizationRule(resourceGroupName: string, namespaceName: string, relayName: string, authorizationRuleName: string, options?: WCFRelaysDeleteAuthorizationRuleOptionalParams): Promise; + get(resourceGroupName: string, namespaceName: string, relayName: string, options?: WCFRelaysGetOptionalParams): Promise; + getAuthorizationRule(resourceGroupName: string, namespaceName: string, relayName: string, authorizationRuleName: string, options?: WCFRelaysGetAuthorizationRuleOptionalParams): Promise; + listAuthorizationRules(resourceGroupName: string, namespaceName: string, relayName: string, options?: WCFRelaysListAuthorizationRulesOptionalParams): PagedAsyncIterableIterator; + listByNamespace(resourceGroupName: string, namespaceName: string, options?: WCFRelaysListByNamespaceOptionalParams): PagedAsyncIterableIterator; + listKeys(resourceGroupName: string, namespaceName: string, relayName: string, authorizationRuleName: string, options?: WCFRelaysListKeysOptionalParams): Promise; + regenerateKeys(resourceGroupName: string, namespaceName: string, relayName: string, authorizationRuleName: string, parameters: RegenerateAccessKeyParameters, options?: WCFRelaysRegenerateKeysOptionalParams): Promise; +} + +// @public +export interface WCFRelaysCreateOrUpdateAuthorizationRuleOptionalParams extends coreClient.OperationOptions { +} + +// @public +export type WCFRelaysCreateOrUpdateAuthorizationRuleResponse = AuthorizationRule; + +// @public +export interface WCFRelaysCreateOrUpdateOptionalParams extends coreClient.OperationOptions { +} + +// @public +export type WCFRelaysCreateOrUpdateResponse = WcfRelay; + +// @public +export interface WCFRelaysDeleteAuthorizationRuleOptionalParams extends coreClient.OperationOptions { +} + +// @public +export interface WCFRelaysDeleteOptionalParams extends coreClient.OperationOptions { +} + +// @public +export interface WCFRelaysGetAuthorizationRuleOptionalParams extends coreClient.OperationOptions { +} + +// @public +export type WCFRelaysGetAuthorizationRuleResponse = AuthorizationRule; + +// @public +export interface WCFRelaysGetOptionalParams extends coreClient.OperationOptions { +} + +// @public +export type WCFRelaysGetResponse = WcfRelay; + +// @public +export interface WCFRelaysListAuthorizationRulesNextOptionalParams extends coreClient.OperationOptions { +} + +// @public +export type WCFRelaysListAuthorizationRulesNextResponse = AuthorizationRuleListResult; + +// @public +export interface WCFRelaysListAuthorizationRulesOptionalParams extends coreClient.OperationOptions { +} + +// @public +export type WCFRelaysListAuthorizationRulesResponse = AuthorizationRuleListResult; + +// @public +export interface WCFRelaysListByNamespaceNextOptionalParams extends coreClient.OperationOptions { +} + +// @public +export type WCFRelaysListByNamespaceNextResponse = WcfRelaysListResult; + +// @public +export interface WCFRelaysListByNamespaceOptionalParams extends coreClient.OperationOptions { +} + +// @public +export type WCFRelaysListByNamespaceResponse = WcfRelaysListResult; + +// @public +export interface WCFRelaysListKeysOptionalParams extends coreClient.OperationOptions { +} + +// @public +export type WCFRelaysListKeysResponse = AccessKeys; + +// @public +export interface WcfRelaysListResult { + nextLink?: string; + value?: WcfRelay[]; +} + +// @public +export interface WCFRelaysRegenerateKeysOptionalParams extends coreClient.OperationOptions { +} + +// @public +export type WCFRelaysRegenerateKeysResponse = AccessKeys; + +// (No @packageDocumentation comment for this package) + +``` diff --git a/sdk/relay/arm-relay/rollup.config.js b/sdk/relay/arm-relay/rollup.config.js index ab4b0f0bd608..9be1955eb7f1 100644 --- a/sdk/relay/arm-relay/rollup.config.js +++ b/sdk/relay/arm-relay/rollup.config.js @@ -1,31 +1,188 @@ -import nodeResolve from "rollup-plugin-node-resolve"; +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +import nodeResolve from "@rollup/plugin-node-resolve"; +import cjs from "@rollup/plugin-commonjs"; +import sourcemaps from "rollup-plugin-sourcemaps"; +import multiEntry from "@rollup/plugin-multi-entry"; +import json from "@rollup/plugin-json"; + +import nodeBuiltins from "builtin-modules"; + +/** + * Gets the proper configuration needed for rollup's commonJS plugin for @opentelemetry/api. + * + * NOTE: this manual configuration is only needed because OpenTelemetry uses an + * __exportStar downleveled helper function to declare its exports which confuses + * rollup's automatic discovery mechanism. + * + * @returns an object reference that can be `...`'d into your cjs() configuration. + */ +export function openTelemetryCommonJs() { + const namedExports = {}; + + for (const key of [ + "@opentelemetry/api", + "@azure/core-tracing/node_modules/@opentelemetry/api" + ]) { + namedExports[key] = [ + "SpanKind", + "TraceFlags", + "getSpan", + "setSpan", + "SpanStatusCode", + "getSpanContext", + "setSpanContext" + ]; + } + + const releasedOpenTelemetryVersions = ["0.10.2", "1.0.0-rc.0"]; + + for (const version of releasedOpenTelemetryVersions) { + namedExports[ + // working around a limitation in the rollup common.js plugin - it's not able to resolve these modules so the named exports listed above will not get applied. We have to drill down to the actual path. + `../../../common/temp/node_modules/.pnpm/@opentelemetry/api@${version}/node_modules/@opentelemetry/api/build/src/index.js` + ] = [ + "SpanKind", + "TraceFlags", + "getSpan", + "setSpan", + "StatusCode", + "CanonicalCode", + "getSpanContext", + "setSpanContext" + ]; + } + + return namedExports; +} + +// #region Warning Handler + +/** + * A function that can determine whether a rollupwarning should be ignored. If + * the function returns `true`, then the warning will not be displayed. + */ + +function ignoreNiseSinonEvalWarnings(warning) { + return ( + warning.code === "EVAL" && + warning.id && + (warning.id.includes("node_modules/nise") || + warning.id.includes("node_modules/sinon")) === true + ); +} + +function ignoreChaiCircularDependencyWarnings(warning) { + return ( + warning.code === "CIRCULAR_DEPENDENCY" && + warning.importer && warning.importer.includes("node_modules/chai") === true + ); +} + +const warningInhibitors = [ + ignoreChaiCircularDependencyWarnings, + ignoreNiseSinonEvalWarnings +]; + /** - * @type {import('rollup').RollupFileOptions} + * Construct a warning handler for the shared rollup configuration + * that ignores certain warnings that are not relevant to testing. */ -const config = { - input: './esm/relayManagementClient.js', - external: ["@azure/ms-rest-js", "@azure/ms-rest-azure-js"], - output: { - file: "./dist/arm-relay.js", - format: "umd", - name: "Azure.ArmRelay", - sourcemap: true, - globals: { - "@azure/ms-rest-js": "msRest", - "@azure/ms-rest-azure-js": "msRestAzure" +function makeOnWarnForTesting() { + return (warning, warn) => { + // If every inhibitor returns false (i.e. no inhibitors), then show the warning + if (warningInhibitors.every((inhib) => !inhib(warning))) { + warn(warning); + } + }; +} + +// #endregion + +function makeBrowserTestConfig() { + const config = { + input: { + include: ["dist-esm/test/**/*.spec.js"], + exclude: ["dist-esm/test/**/node/**"] }, - banner: `/* - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for - * license information. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is - * regenerated. - */` - }, - plugins: [ - nodeResolve({ module: true }) - ] + output: { + file: `dist-test/index.browser.js`, + format: "umd", + sourcemap: true + }, + preserveSymlinks: false, + plugins: [ + multiEntry({ exports: false }), + nodeResolve({ + mainFields: ["module", "browser"] + }), + cjs({ + namedExports: { + // Chai's strange internal architecture makes it impossible to statically + // analyze its exports. + chai: [ + "version", + "use", + "util", + "config", + "expect", + "should", + "assert" + ], + ...openTelemetryCommonJs() + } + }), + json(), + sourcemaps() + //viz({ filename: "dist-test/browser-stats.html", sourcemap: true }) + ], + onwarn: makeOnWarnForTesting(), + // Disable tree-shaking of test code. In rollup-plugin-node-resolve@5.0.0, + // rollup started respecting the "sideEffects" field in package.json. Since + // our package.json sets "sideEffects=false", this also applies to test + // code, which causes all tests to be removed by tree-shaking. + treeshake: false + }; + + return config; +} + +const defaultConfigurationOptions = { + disableBrowserBundle: false }; -export default config; + +export function makeConfig(pkg, options) { + options = { + ...defaultConfigurationOptions, + ...(options || {}) + }; + + const baseConfig = { + // Use the package's module field if it has one + input: pkg["module"] || "dist-esm/src/index.js", + external: [ + ...nodeBuiltins, + ...Object.keys(pkg.dependencies), + ...Object.keys(pkg.devDependencies) + ], + output: { file: "dist/index.js", format: "cjs", sourcemap: true }, + preserveSymlinks: false, + plugins: [sourcemaps(), nodeResolve(), cjs()] + }; + + const config = [baseConfig]; + + if (!options.disableBrowserBundle) { + config.push(makeBrowserTestConfig()); + } + + return config; +} + +export default makeConfig(require("./package.json")); diff --git a/sdk/relay/arm-relay/src/index.ts b/sdk/relay/arm-relay/src/index.ts new file mode 100644 index 000000000000..bc56d1fc6777 --- /dev/null +++ b/sdk/relay/arm-relay/src/index.ts @@ -0,0 +1,12 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +/// +export * from "./models"; +export { RelayAPI } from "./relayAPI"; +export * from "./operationsInterfaces"; diff --git a/sdk/relay/arm-relay/src/lroImpl.ts b/sdk/relay/arm-relay/src/lroImpl.ts new file mode 100644 index 000000000000..518d5f053b4e --- /dev/null +++ b/sdk/relay/arm-relay/src/lroImpl.ts @@ -0,0 +1,34 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +import { LongRunningOperation, LroResponse } from "@azure/core-lro"; + +export class LroImpl implements LongRunningOperation { + constructor( + private sendOperationFn: (args: any, spec: any) => Promise>, + private args: Record, + private spec: { + readonly requestBody?: unknown; + readonly path?: string; + readonly httpMethod: string; + } & Record, + public requestPath: string = spec.path!, + public requestMethod: string = spec.httpMethod + ) {} + public async sendInitialRequest(): Promise> { + return this.sendOperationFn(this.args, this.spec); + } + public async sendPollRequest(path: string): Promise> { + const { requestBody, ...restSpec } = this.spec; + return this.sendOperationFn(this.args, { + ...restSpec, + path, + httpMethod: "GET" + }); + } +} diff --git a/sdk/relay/arm-relay/src/models/hybridConnectionsMappers.ts b/sdk/relay/arm-relay/src/models/hybridConnectionsMappers.ts deleted file mode 100644 index 60387ca6e3ac..000000000000 --- a/sdk/relay/arm-relay/src/models/hybridConnectionsMappers.ts +++ /dev/null @@ -1,28 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for - * license information. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is - * regenerated. - */ - -export { - HybridConnectionListResult, - HybridConnection, - Resource, - BaseResource, - ErrorResponse, - AuthorizationRuleListResult, - AuthorizationRule, - AccessKeys, - RegenerateAccessKeyParameters, - TrackedResource, - ResourceNamespacePatch, - WcfRelay, - RelayNamespace, - Sku, - RelayUpdateParameters -} from "../models/mappers"; - diff --git a/sdk/relay/arm-relay/src/models/index.ts b/sdk/relay/arm-relay/src/models/index.ts index a25ca873f859..9c4167750d05 100644 --- a/sdk/relay/arm-relay/src/models/index.ts +++ b/sdk/relay/arm-relay/src/models/index.ts @@ -1,1304 +1,611 @@ /* - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for - * license information. + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. * * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is - * regenerated. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. */ -import { BaseResource, CloudError, AzureServiceClientOptions } from "@azure/ms-rest-azure-js"; -import * as msRest from "@azure/ms-rest-js"; +import * as coreClient from "@azure/core-client"; -export { BaseResource, CloudError }; - - -/** - * @interface - * An interface representing Resource. - * The resource definition. - * - * @extends BaseResource - */ -export interface Resource extends BaseResource { +/** Result of the request to list Relay operations. It contains a list of operations and a URL link to get the next set of results. */ +export interface OperationListResult { /** - * @member {string} [id] Resource ID. - * **NOTE: This property will not be serialized. It can only be populated by - * the server.** + * List of Relay operations supported by resource provider. + * NOTE: This property will not be serialized. It can only be populated by the server. */ - readonly id?: string; + readonly value?: Operation[]; /** - * @member {string} [name] Resource name. - * **NOTE: This property will not be serialized. It can only be populated by - * the server.** + * URL to get the next set of operation list results if there are any. + * NOTE: This property will not be serialized. It can only be populated by the server. */ - readonly name?: string; + readonly nextLink?: string; +} + +/** A Relay REST API operation. */ +export interface Operation { /** - * @member {string} [type] Resource type. - * **NOTE: This property will not be serialized. It can only be populated by - * the server.** + * Operation name: {provider}/{resource}/{operation} + * NOTE: This property will not be serialized. It can only be populated by the server. */ - readonly type?: string; + readonly name?: string; + /** The object that represents the operation. */ + display?: OperationDisplay; } -/** - * @interface - * An interface representing TrackedResource. - * Definition of resource. - * - * @extends Resource - */ -export interface TrackedResource extends Resource { +/** The object that represents the operation. */ +export interface OperationDisplay { /** - * @member {string} location Resource location. + * Service provider: Relay. + * NOTE: This property will not be serialized. It can only be populated by the server. */ - location: string; + readonly provider?: string; /** - * @member {{ [propertyName: string]: string }} [tags] Resource tags. + * Resource on which the operation is performed: Invoice, etc. + * NOTE: This property will not be serialized. It can only be populated by the server. */ - tags?: { [propertyName: string]: string }; + readonly resource?: string; + /** + * Operation type: Read, write, delete, etc. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly operation?: string; } -/** - * @interface - * An interface representing ResourceNamespacePatch. - * Definition of resource. - * - * @extends Resource - */ -export interface ResourceNamespacePatch extends Resource { +/** Error reponse indicates Relay service is not able to process the incoming request. The reason is provided in the error message. */ +export interface ErrorResponse { + /** Error code. */ + code?: string; + /** Error message indicating why the operation failed. */ + message?: string; +} + +/** Description of the check name availability request properties. */ +export interface CheckNameAvailability { + /** The namespace name to check for availability. The namespace name can contain only letters, numbers, and hyphens. The namespace must start with a letter, and it must end with a letter or number. */ + name: string; +} + +/** Description of the check name availability request properties. */ +export interface CheckNameAvailabilityResult { /** - * @member {{ [propertyName: string]: string }} [tags] Resource tags. + * The detailed info regarding the reason associated with the namespace. + * NOTE: This property will not be serialized. It can only be populated by the server. */ - tags?: { [propertyName: string]: string }; + readonly message?: string; + /** Value indicating namespace is available. Returns true if the namespace is available; otherwise, false. */ + nameAvailable?: boolean; + /** The reason for unavailability of a namespace. */ + reason?: UnavailableReason; } -/** - * @interface - * An interface representing HybridConnection. - * Description of hybrid connection resource. - * - * @extends Resource - */ -export interface HybridConnection extends Resource { +/** The response from the list namespace operation. */ +export interface RelayNamespaceListResult { + /** Result of the list namespace operation. */ + value?: RelayNamespace[]; + /** Link to the next set of results. Not empty if value contains incomplete list of namespaces. */ + nextLink?: string; +} + +/** SKU of the namespace. */ +export interface Sku { + /** Name of this SKU. */ + name: "Standard"; + /** The tier of this SKU. */ + tier?: "Standard"; +} + +/** The resource definition. */ +export interface Resource { /** - * @member {Date} [createdAt] The time the hybrid connection was created. - * **NOTE: This property will not be serialized. It can only be populated by - * the server.** + * Resource ID. + * NOTE: This property will not be serialized. It can only be populated by the server. */ - readonly createdAt?: Date; + readonly id?: string; /** - * @member {Date} [updatedAt] The time the namespace was updated. - * **NOTE: This property will not be serialized. It can only be populated by - * the server.** + * Resource name. + * NOTE: This property will not be serialized. It can only be populated by the server. */ - readonly updatedAt?: Date; + readonly name?: string; /** - * @member {number} [listenerCount] The number of listeners for this hybrid - * connection. Note that min : 1 and max:25 are supported. - * **NOTE: This property will not be serialized. It can only be populated by - * the server.** + * Resource type. + * NOTE: This property will not be serialized. It can only be populated by the server. */ - readonly listenerCount?: number; + readonly type?: string; +} + +/** The response from the list namespace operation. */ +export interface AuthorizationRuleListResult { + /** Result of the list authorization rules operation. */ + value?: AuthorizationRule[]; + /** Link to the next set of results. Not empty if value contains incomplete list of authorization rules. */ + nextLink?: string; +} + +/** Namespace/Relay Connection String */ +export interface AccessKeys { + /** Primary connection string of the created namespace authorization rule. */ + primaryConnectionString?: string; + /** Secondary connection string of the created namespace authorization rule. */ + secondaryConnectionString?: string; + /** A base64-encoded 256-bit primary key for signing and validating the SAS token. */ + primaryKey?: string; + /** A base64-encoded 256-bit secondary key for signing and validating the SAS token. */ + secondaryKey?: string; + /** A string that describes the authorization rule. */ + keyName?: string; +} + +/** Parameters supplied to the regenerate authorization rule operation, specifies which key neeeds to be reset. */ +export interface RegenerateAccessKeyParameters { + /** The access key to regenerate. */ + keyType: KeyType; + /** Optional. If the key value is provided, this is set to key type, or autogenerated key value set for key type. */ + key?: string; +} + +/** The response of the list hybrid connection operation. */ +export interface HybridConnectionListResult { + /** Result of the list hybrid connections. */ + value?: HybridConnection[]; + /** Link to the next set of results. Not empty if value contains incomplete list hybrid connection operation. */ + nextLink?: string; +} + +/** The response of the list WCF relay operation. */ +export interface WcfRelaysListResult { + /** Result of the list WCF relay operation. */ + value?: WcfRelay[]; + /** Link to the next set of results. Not empty if value contains incomplete list of WCF relays. */ + nextLink?: string; +} + +/** Definition of resource. */ +export type TrackedResource = Resource & { + /** Resource location. */ + location: string; + /** Resource tags. */ + tags?: { [propertyName: string]: string }; +}; + +/** Definition of resource. */ +export type ResourceNamespacePatch = Resource & { + /** Resource tags. */ + tags?: { [propertyName: string]: string }; +}; + +/** Description of a namespace authorization rule. */ +export type AuthorizationRule = Resource & { + /** The rights associated with the rule. */ + rights: AccessRights[]; +}; + +/** Description of hybrid connection resource. */ +export type HybridConnection = Resource & { /** - * @member {boolean} [requiresClientAuthorization] Returns true if client - * authorization is needed for this hybrid connection; otherwise, false. + * The time the hybrid connection was created. + * NOTE: This property will not be serialized. It can only be populated by the server. */ - requiresClientAuthorization?: boolean; + readonly createdAt?: Date; + /** + * The time the namespace was updated. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly updatedAt?: Date; /** - * @member {string} [userMetadata] The usermetadata is a placeholder to store - * user-defined string data for the hybrid connection endpoint. For example, - * it can be used to store descriptive data, such as a list of teams and - * their contact information. Also, user-defined configuration settings can - * be stored. + * The number of listeners for this hybrid connection. Note that min : 1 and max:25 are supported. + * NOTE: This property will not be serialized. It can only be populated by the server. */ + readonly listenerCount?: number; + /** Returns true if client authorization is needed for this hybrid connection; otherwise, false. */ + requiresClientAuthorization?: boolean; + /** The usermetadata is a placeholder to store user-defined string data for the hybrid connection endpoint. For example, it can be used to store descriptive data, such as a list of teams and their contact information. Also, user-defined configuration settings can be stored. */ userMetadata?: string; -} +}; -/** - * @interface - * An interface representing WcfRelay. - * Description of the WCF relay resource. - * - * @extends Resource - */ -export interface WcfRelay extends Resource { +/** Description of the WCF relay resource. */ +export type WcfRelay = Resource & { /** - * @member {boolean} [isDynamic] Returns true if the relay is dynamic; - * otherwise, false. - * **NOTE: This property will not be serialized. It can only be populated by - * the server.** + * Returns true if the relay is dynamic; otherwise, false. + * NOTE: This property will not be serialized. It can only be populated by the server. */ readonly isDynamic?: boolean; /** - * @member {Date} [createdAt] The time the WCF relay was created. - * **NOTE: This property will not be serialized. It can only be populated by - * the server.** + * The time the WCF relay was created. + * NOTE: This property will not be serialized. It can only be populated by the server. */ readonly createdAt?: Date; /** - * @member {Date} [updatedAt] The time the namespace was updated. - * **NOTE: This property will not be serialized. It can only be populated by - * the server.** + * The time the namespace was updated. + * NOTE: This property will not be serialized. It can only be populated by the server. */ readonly updatedAt?: Date; /** - * @member {number} [listenerCount] The number of listeners for this relay. - * Note that min :1 and max:25 are supported. - * **NOTE: This property will not be serialized. It can only be populated by - * the server.** + * The number of listeners for this relay. Note that min :1 and max:25 are supported. + * NOTE: This property will not be serialized. It can only be populated by the server. */ readonly listenerCount?: number; - /** - * @member {Relaytype} [relayType] WCF relay type. Possible values include: - * 'NetTcp', 'Http' - */ + /** WCF relay type. */ relayType?: Relaytype; - /** - * @member {boolean} [requiresClientAuthorization] Returns true if client - * authorization is needed for this relay; otherwise, false. - */ + /** Returns true if client authorization is needed for this relay; otherwise, false. */ requiresClientAuthorization?: boolean; - /** - * @member {boolean} [requiresTransportSecurity] Returns true if transport - * security is needed for this relay; otherwise, false. - */ + /** Returns true if transport security is needed for this relay; otherwise, false. */ requiresTransportSecurity?: boolean; - /** - * @member {string} [userMetadata] The usermetadata is a placeholder to store - * user-defined string data for the WCF Relay endpoint. For example, it can - * be used to store descriptive data, such as list of teams and their contact - * information. Also, user-defined configuration settings can be stored. - */ + /** The usermetadata is a placeholder to store user-defined string data for the WCF Relay endpoint. For example, it can be used to store descriptive data, such as list of teams and their contact information. Also, user-defined configuration settings can be stored. */ userMetadata?: string; -} - -/** - * @interface - * An interface representing Sku. - * SKU of the namespace. - * - */ -export interface Sku { - /** - * @member {SkuTier} [tier] The tier of this SKU. Possible values include: - * 'Standard' - */ - tier?: SkuTier; -} +}; -/** - * @interface - * An interface representing RelayNamespace. - * Description of a namespace resource. - * - * @extends TrackedResource - */ -export interface RelayNamespace extends TrackedResource { - /** - * @member {Sku} [sku] SKU of the namespace. - */ +/** Description of a namespace resource. */ +export type RelayNamespace = TrackedResource & { + /** SKU of the namespace. */ sku?: Sku; - /** - * @member {ProvisioningStateEnum} [provisioningState] Possible values - * include: 'Created', 'Succeeded', 'Deleted', 'Failed', 'Updating', - * 'Unknown' - * **NOTE: This property will not be serialized. It can only be populated by - * the server.** - */ + /** NOTE: This property will not be serialized. It can only be populated by the server. */ readonly provisioningState?: ProvisioningStateEnum; /** - * @member {Date} [createdAt] The time the namespace was created. - * **NOTE: This property will not be serialized. It can only be populated by - * the server.** + * The time the namespace was created. + * NOTE: This property will not be serialized. It can only be populated by the server. */ readonly createdAt?: Date; /** - * @member {Date} [updatedAt] The time the namespace was updated. - * **NOTE: This property will not be serialized. It can only be populated by - * the server.** + * The time the namespace was updated. + * NOTE: This property will not be serialized. It can only be populated by the server. */ readonly updatedAt?: Date; /** - * @member {string} [serviceBusEndpoint] Endpoint you can use to perform - * Service Bus operations. - * **NOTE: This property will not be serialized. It can only be populated by - * the server.** + * Endpoint you can use to perform Service Bus operations. + * NOTE: This property will not be serialized. It can only be populated by the server. */ readonly serviceBusEndpoint?: string; /** - * @member {string} [metricId] Identifier for Azure Insights metrics. - * **NOTE: This property will not be serialized. It can only be populated by - * the server.** + * Identifier for Azure Insights metrics. + * NOTE: This property will not be serialized. It can only be populated by the server. */ readonly metricId?: string; -} +}; -/** - * @interface - * An interface representing RelayUpdateParameters. - * Description of a namespace resource. - * - * @extends ResourceNamespacePatch - */ -export interface RelayUpdateParameters extends ResourceNamespacePatch { - /** - * @member {Sku} [sku] SKU of the namespace. - */ +/** Description of a namespace resource. */ +export type RelayUpdateParameters = ResourceNamespacePatch & { + /** SKU of the namespace. */ sku?: Sku; - /** - * @member {ProvisioningStateEnum} [provisioningState] Possible values - * include: 'Created', 'Succeeded', 'Deleted', 'Failed', 'Updating', - * 'Unknown' - * **NOTE: This property will not be serialized. It can only be populated by - * the server.** - */ + /** NOTE: This property will not be serialized. It can only be populated by the server. */ readonly provisioningState?: ProvisioningStateEnum; /** - * @member {Date} [createdAt] The time the namespace was created. - * **NOTE: This property will not be serialized. It can only be populated by - * the server.** + * The time the namespace was created. + * NOTE: This property will not be serialized. It can only be populated by the server. */ readonly createdAt?: Date; /** - * @member {Date} [updatedAt] The time the namespace was updated. - * **NOTE: This property will not be serialized. It can only be populated by - * the server.** + * The time the namespace was updated. + * NOTE: This property will not be serialized. It can only be populated by the server. */ readonly updatedAt?: Date; /** - * @member {string} [serviceBusEndpoint] Endpoint you can use to perform - * Service Bus operations. - * **NOTE: This property will not be serialized. It can only be populated by - * the server.** + * Endpoint you can use to perform Service Bus operations. + * NOTE: This property will not be serialized. It can only be populated by the server. */ readonly serviceBusEndpoint?: string; /** - * @member {string} [metricId] Identifier for Azure Insights metrics. - * **NOTE: This property will not be serialized. It can only be populated by - * the server.** + * Identifier for Azure Insights metrics. + * NOTE: This property will not be serialized. It can only be populated by the server. */ readonly metricId?: string; +}; +/** Defines values for UnavailableReason. */ +export type UnavailableReason = + | "None" + | "InvalidName" + | "SubscriptionIsDisabled" + | "NameInUse" + | "NameInLockdown" + | "TooManyNamespaceInCurrentSubscription"; +/** Defines values for ProvisioningStateEnum. */ +export type ProvisioningStateEnum = + | "Created" + | "Succeeded" + | "Deleted" + | "Failed" + | "Updating" + | "Unknown"; +/** Defines values for AccessRights. */ +export type AccessRights = "Manage" | "Send" | "Listen"; +/** Defines values for KeyType. */ +export type KeyType = "PrimaryKey" | "SecondaryKey"; +/** Defines values for Relaytype. */ +export type Relaytype = "NetTcp" | "Http"; + +/** Optional parameters. */ +export interface OperationsListOptionalParams + extends coreClient.OperationOptions {} + +/** Contains response data for the list operation. */ +export type OperationsListResponse = OperationListResult; + +/** Optional parameters. */ +export interface OperationsListNextOptionalParams + extends coreClient.OperationOptions {} + +/** Contains response data for the listNext operation. */ +export type OperationsListNextResponse = OperationListResult; + +/** Optional parameters. */ +export interface NamespacesCheckNameAvailabilityOptionalParams + extends coreClient.OperationOptions {} + +/** Contains response data for the checkNameAvailability operation. */ +export type NamespacesCheckNameAvailabilityResponse = CheckNameAvailabilityResult; + +/** Optional parameters. */ +export interface NamespacesListOptionalParams + extends coreClient.OperationOptions {} + +/** Contains response data for the list operation. */ +export type NamespacesListResponse = RelayNamespaceListResult; + +/** Optional parameters. */ +export interface NamespacesListByResourceGroupOptionalParams + extends coreClient.OperationOptions {} + +/** Contains response data for the listByResourceGroup operation. */ +export type NamespacesListByResourceGroupResponse = RelayNamespaceListResult; + +/** Optional parameters. */ +export interface NamespacesCreateOrUpdateOptionalParams + extends coreClient.OperationOptions { + /** Delay to wait until next poll, in milliseconds. */ + updateIntervalInMs?: number; + /** A serialized poller which can be used to resume an existing paused Long-Running-Operation. */ + resumeFrom?: string; } -/** - * @interface - * An interface representing AuthorizationRule. - * Description of a namespace authorization rule. - * - * @extends Resource - */ -export interface AuthorizationRule extends Resource { - /** - * @member {AccessRights[]} rights The rights associated with the rule. - */ - rights: AccessRights[]; -} +/** Contains response data for the createOrUpdate operation. */ +export type NamespacesCreateOrUpdateResponse = RelayNamespace; -/** - * @interface - * An interface representing AccessKeys. - * Namespace/Relay Connection String - * - */ -export interface AccessKeys { - /** - * @member {string} [primaryConnectionString] Primary connection string of - * the created namespace authorization rule. - */ - primaryConnectionString?: string; - /** - * @member {string} [secondaryConnectionString] Secondary connection string - * of the created namespace authorization rule. - */ - secondaryConnectionString?: string; - /** - * @member {string} [primaryKey] A base64-encoded 256-bit primary key for - * signing and validating the SAS token. - */ - primaryKey?: string; - /** - * @member {string} [secondaryKey] A base64-encoded 256-bit secondary key for - * signing and validating the SAS token. - */ - secondaryKey?: string; - /** - * @member {string} [keyName] A string that describes the authorization rule. - */ - keyName?: string; +/** Optional parameters. */ +export interface NamespacesDeleteOptionalParams + extends coreClient.OperationOptions { + /** Delay to wait until next poll, in milliseconds. */ + updateIntervalInMs?: number; + /** A serialized poller which can be used to resume an existing paused Long-Running-Operation. */ + resumeFrom?: string; } -/** - * @interface - * An interface representing RegenerateAccessKeyParameters. - * Parameters supplied to the regenerate authorization rule operation, - * specifies which key neeeds to be reset. - * - */ -export interface RegenerateAccessKeyParameters { - /** - * @member {KeyType} keyType The access key to regenerate. Possible values - * include: 'PrimaryKey', 'SecondaryKey' - */ - keyType: KeyType; - /** - * @member {string} [key] Optional. If the key value is provided, this is set - * to key type, or autogenerated key value set for key type. - */ - key?: string; -} +/** Optional parameters. */ +export interface NamespacesGetOptionalParams + extends coreClient.OperationOptions {} -/** - * @interface - * An interface representing CheckNameAvailability. - * Description of the check name availability request properties. - * - */ -export interface CheckNameAvailability { - /** - * @member {string} name The namespace name to check for availability. The - * namespace name can contain only letters, numbers, and hyphens. The - * namespace must start with a letter, and it must end with a letter or - * number. - */ - name: string; -} +/** Contains response data for the get operation. */ +export type NamespacesGetResponse = RelayNamespace; -/** - * @interface - * An interface representing CheckNameAvailabilityResult. - * Description of the check name availability request properties. - * - */ -export interface CheckNameAvailabilityResult { - /** - * @member {string} [message] The detailed info regarding the reason - * associated with the namespace. - * **NOTE: This property will not be serialized. It can only be populated by - * the server.** - */ - readonly message?: string; - /** - * @member {boolean} [nameAvailable] Value indicating namespace is available. - * Returns true if the namespace is available; otherwise, false. - */ - nameAvailable?: boolean; - /** - * @member {UnavailableReason} [reason] The reason for unavailability of a - * namespace. Possible values include: 'None', 'InvalidName', - * 'SubscriptionIsDisabled', 'NameInUse', 'NameInLockdown', - * 'TooManyNamespaceInCurrentSubscription' - */ - reason?: UnavailableReason; -} +/** Optional parameters. */ +export interface NamespacesUpdateOptionalParams + extends coreClient.OperationOptions {} -/** - * @interface - * An interface representing OperationDisplay. - * The object that represents the operation. - * - */ -export interface OperationDisplay { - /** - * @member {string} [provider] Service provider: Relay. - * **NOTE: This property will not be serialized. It can only be populated by - * the server.** - */ - readonly provider?: string; - /** - * @member {string} [resource] Resource on which the operation is performed: - * Invoice, etc. - * **NOTE: This property will not be serialized. It can only be populated by - * the server.** - */ - readonly resource?: string; - /** - * @member {string} [operation] Operation type: Read, write, delete, etc. - * **NOTE: This property will not be serialized. It can only be populated by - * the server.** - */ - readonly operation?: string; -} +/** Contains response data for the update operation. */ +export type NamespacesUpdateResponse = RelayNamespace; -/** - * @interface - * An interface representing Operation. - * A Relay REST API operation. - * - */ -export interface Operation { - /** - * @member {string} [name] Operation name: {provider}/{resource}/{operation} - * **NOTE: This property will not be serialized. It can only be populated by - * the server.** - */ - readonly name?: string; - /** - * @member {OperationDisplay} [display] The object that represents the - * operation. - */ - display?: OperationDisplay; -} +/** Optional parameters. */ +export interface NamespacesListAuthorizationRulesOptionalParams + extends coreClient.OperationOptions {} -/** - * @interface - * An interface representing ErrorResponse. - * Error reponse indicates Relay service is not able to process the incoming - * request. The reason is provided in the error message. - * - */ -export interface ErrorResponse { - /** - * @member {string} [code] Error code. - */ - code?: string; - /** - * @member {string} [message] Error message indicating why the operation - * failed. - */ - message?: string; -} +/** Contains response data for the listAuthorizationRules operation. */ +export type NamespacesListAuthorizationRulesResponse = AuthorizationRuleListResult; -/** - * @interface - * An interface representing RelayManagementClientOptions. - * @extends AzureServiceClientOptions - */ -export interface RelayManagementClientOptions extends AzureServiceClientOptions { - /** - * @member {string} [baseUri] - */ - baseUri?: string; -} +/** Optional parameters. */ +export interface NamespacesCreateOrUpdateAuthorizationRuleOptionalParams + extends coreClient.OperationOptions {} +/** Contains response data for the createOrUpdateAuthorizationRule operation. */ +export type NamespacesCreateOrUpdateAuthorizationRuleResponse = AuthorizationRule; -/** - * @interface - * An interface representing the OperationListResult. - * Result of the request to list Relay operations. It contains a list of - * operations and a URL link to get the next set of results. - * - * @extends Array - */ -export interface OperationListResult extends Array { - /** - * @member {string} [nextLink] URL to get the next set of operation list - * results if there are any. - * **NOTE: This property will not be serialized. It can only be populated by - * the server.** - */ - readonly nextLink?: string; -} +/** Optional parameters. */ +export interface NamespacesDeleteAuthorizationRuleOptionalParams + extends coreClient.OperationOptions {} -/** - * @interface - * An interface representing the RelayNamespaceListResult. - * The response from the list namespace operation. - * - * @extends Array - */ -export interface RelayNamespaceListResult extends Array { - /** - * @member {string} [nextLink] Link to the next set of results. Not empty if - * value contains incomplete list of namespaces. - */ - nextLink?: string; -} +/** Optional parameters. */ +export interface NamespacesGetAuthorizationRuleOptionalParams + extends coreClient.OperationOptions {} -/** - * @interface - * An interface representing the AuthorizationRuleListResult. - * The response from the list namespace operation. - * - * @extends Array - */ -export interface AuthorizationRuleListResult extends Array { - /** - * @member {string} [nextLink] Link to the next set of results. Not empty if - * value contains incomplete list of authorization rules. - */ - nextLink?: string; -} +/** Contains response data for the getAuthorizationRule operation. */ +export type NamespacesGetAuthorizationRuleResponse = AuthorizationRule; -/** - * @interface - * An interface representing the HybridConnectionListResult. - * The response of the list hybrid connection operation. - * - * @extends Array - */ -export interface HybridConnectionListResult extends Array { - /** - * @member {string} [nextLink] Link to the next set of results. Not empty if - * value contains incomplete list hybrid connection operation. - */ - nextLink?: string; -} +/** Optional parameters. */ +export interface NamespacesListKeysOptionalParams + extends coreClient.OperationOptions {} -/** - * @interface - * An interface representing the WcfRelaysListResult. - * The response of the list WCF relay operation. - * - * @extends Array - */ -export interface WcfRelaysListResult extends Array { - /** - * @member {string} [nextLink] Link to the next set of results. Not empty if - * value contains incomplete list of WCF relays. - */ - nextLink?: string; -} +/** Contains response data for the listKeys operation. */ +export type NamespacesListKeysResponse = AccessKeys; -/** - * Defines values for Relaytype. - * Possible values include: 'NetTcp', 'Http' - * @readonly - * @enum {string} - */ -export type Relaytype = 'NetTcp' | 'Http'; +/** Optional parameters. */ +export interface NamespacesRegenerateKeysOptionalParams + extends coreClient.OperationOptions {} -/** - * Defines values for SkuTier. - * Possible values include: 'Standard' - * @readonly - * @enum {string} - */ -export type SkuTier = 'Standard'; +/** Contains response data for the regenerateKeys operation. */ +export type NamespacesRegenerateKeysResponse = AccessKeys; -/** - * Defines values for ProvisioningStateEnum. - * Possible values include: 'Created', 'Succeeded', 'Deleted', 'Failed', 'Updating', 'Unknown' - * @readonly - * @enum {string} - */ -export type ProvisioningStateEnum = 'Created' | 'Succeeded' | 'Deleted' | 'Failed' | 'Updating' | 'Unknown'; +/** Optional parameters. */ +export interface NamespacesListNextOptionalParams + extends coreClient.OperationOptions {} -/** - * Defines values for AccessRights. - * Possible values include: 'Manage', 'Send', 'Listen' - * @readonly - * @enum {string} - */ -export type AccessRights = 'Manage' | 'Send' | 'Listen'; +/** Contains response data for the listNext operation. */ +export type NamespacesListNextResponse = RelayNamespaceListResult; -/** - * Defines values for KeyType. - * Possible values include: 'PrimaryKey', 'SecondaryKey' - * @readonly - * @enum {string} - */ -export type KeyType = 'PrimaryKey' | 'SecondaryKey'; - -/** - * Defines values for UnavailableReason. - * Possible values include: 'None', 'InvalidName', 'SubscriptionIsDisabled', 'NameInUse', - * 'NameInLockdown', 'TooManyNamespaceInCurrentSubscription' - * @readonly - * @enum {string} - */ -export type UnavailableReason = 'None' | 'InvalidName' | 'SubscriptionIsDisabled' | 'NameInUse' | 'NameInLockdown' | 'TooManyNamespaceInCurrentSubscription'; +/** Optional parameters. */ +export interface NamespacesListByResourceGroupNextOptionalParams + extends coreClient.OperationOptions {} -/** - * Contains response data for the list operation. - */ -export type OperationsListResponse = OperationListResult & { - /** - * The underlying HTTP response. - */ - _response: msRest.HttpResponse & { - /** - * The response body as text (string format) - */ - bodyAsText: string; - /** - * The response body as parsed JSON or XML - */ - parsedBody: OperationListResult; - }; -}; +/** Contains response data for the listByResourceGroupNext operation. */ +export type NamespacesListByResourceGroupNextResponse = RelayNamespaceListResult; -/** - * Contains response data for the listNext operation. - */ -export type OperationsListNextResponse = OperationListResult & { - /** - * The underlying HTTP response. - */ - _response: msRest.HttpResponse & { - /** - * The response body as text (string format) - */ - bodyAsText: string; - /** - * The response body as parsed JSON or XML - */ - parsedBody: OperationListResult; - }; -}; +/** Optional parameters. */ +export interface NamespacesListAuthorizationRulesNextOptionalParams + extends coreClient.OperationOptions {} -/** - * Contains response data for the checkNameAvailabilityMethod operation. - */ -export type NamespacesCheckNameAvailabilityMethodResponse = CheckNameAvailabilityResult & { - /** - * The underlying HTTP response. - */ - _response: msRest.HttpResponse & { - /** - * The response body as text (string format) - */ - bodyAsText: string; - /** - * The response body as parsed JSON or XML - */ - parsedBody: CheckNameAvailabilityResult; - }; -}; +/** Contains response data for the listAuthorizationRulesNext operation. */ +export type NamespacesListAuthorizationRulesNextResponse = AuthorizationRuleListResult; -/** - * Contains response data for the list operation. - */ -export type NamespacesListResponse = RelayNamespaceListResult & { - /** - * The underlying HTTP response. - */ - _response: msRest.HttpResponse & { - /** - * The response body as text (string format) - */ - bodyAsText: string; - /** - * The response body as parsed JSON or XML - */ - parsedBody: RelayNamespaceListResult; - }; -}; +/** Optional parameters. */ +export interface HybridConnectionsListByNamespaceOptionalParams + extends coreClient.OperationOptions {} -/** - * Contains response data for the listByResourceGroup operation. - */ -export type NamespacesListByResourceGroupResponse = RelayNamespaceListResult & { - /** - * The underlying HTTP response. - */ - _response: msRest.HttpResponse & { - /** - * The response body as text (string format) - */ - bodyAsText: string; - /** - * The response body as parsed JSON or XML - */ - parsedBody: RelayNamespaceListResult; - }; -}; +/** Contains response data for the listByNamespace operation. */ +export type HybridConnectionsListByNamespaceResponse = HybridConnectionListResult; -/** - * Contains response data for the createOrUpdate operation. - */ -export type NamespacesCreateOrUpdateResponse = RelayNamespace & { - /** - * The underlying HTTP response. - */ - _response: msRest.HttpResponse & { - /** - * The response body as text (string format) - */ - bodyAsText: string; - /** - * The response body as parsed JSON or XML - */ - parsedBody: RelayNamespace; - }; -}; +/** Optional parameters. */ +export interface HybridConnectionsCreateOrUpdateOptionalParams + extends coreClient.OperationOptions {} -/** - * Contains response data for the get operation. - */ -export type NamespacesGetResponse = RelayNamespace & { - /** - * The underlying HTTP response. - */ - _response: msRest.HttpResponse & { - /** - * The response body as text (string format) - */ - bodyAsText: string; - /** - * The response body as parsed JSON or XML - */ - parsedBody: RelayNamespace; - }; -}; +/** Contains response data for the createOrUpdate operation. */ +export type HybridConnectionsCreateOrUpdateResponse = HybridConnection; -/** - * Contains response data for the update operation. - */ -export type NamespacesUpdateResponse = RelayNamespace & { - /** - * The underlying HTTP response. - */ - _response: msRest.HttpResponse & { - /** - * The response body as text (string format) - */ - bodyAsText: string; - /** - * The response body as parsed JSON or XML - */ - parsedBody: RelayNamespace; - }; -}; +/** Optional parameters. */ +export interface HybridConnectionsDeleteOptionalParams + extends coreClient.OperationOptions {} -/** - * Contains response data for the listAuthorizationRules operation. - */ -export type NamespacesListAuthorizationRulesResponse = AuthorizationRuleListResult & { - /** - * The underlying HTTP response. - */ - _response: msRest.HttpResponse & { - /** - * The response body as text (string format) - */ - bodyAsText: string; - /** - * The response body as parsed JSON or XML - */ - parsedBody: AuthorizationRuleListResult; - }; -}; +/** Optional parameters. */ +export interface HybridConnectionsGetOptionalParams + extends coreClient.OperationOptions {} -/** - * Contains response data for the createOrUpdateAuthorizationRule operation. - */ -export type NamespacesCreateOrUpdateAuthorizationRuleResponse = AuthorizationRule & { - /** - * The underlying HTTP response. - */ - _response: msRest.HttpResponse & { - /** - * The response body as text (string format) - */ - bodyAsText: string; - /** - * The response body as parsed JSON or XML - */ - parsedBody: AuthorizationRule; - }; -}; +/** Contains response data for the get operation. */ +export type HybridConnectionsGetResponse = HybridConnection; -/** - * Contains response data for the getAuthorizationRule operation. - */ -export type NamespacesGetAuthorizationRuleResponse = AuthorizationRule & { - /** - * The underlying HTTP response. - */ - _response: msRest.HttpResponse & { - /** - * The response body as text (string format) - */ - bodyAsText: string; - /** - * The response body as parsed JSON or XML - */ - parsedBody: AuthorizationRule; - }; -}; +/** Optional parameters. */ +export interface HybridConnectionsListAuthorizationRulesOptionalParams + extends coreClient.OperationOptions {} -/** - * Contains response data for the listKeys operation. - */ -export type NamespacesListKeysResponse = AccessKeys & { - /** - * The underlying HTTP response. - */ - _response: msRest.HttpResponse & { - /** - * The response body as text (string format) - */ - bodyAsText: string; - /** - * The response body as parsed JSON or XML - */ - parsedBody: AccessKeys; - }; -}; +/** Contains response data for the listAuthorizationRules operation. */ +export type HybridConnectionsListAuthorizationRulesResponse = AuthorizationRuleListResult; -/** - * Contains response data for the regenerateKeys operation. - */ -export type NamespacesRegenerateKeysResponse = AccessKeys & { - /** - * The underlying HTTP response. - */ - _response: msRest.HttpResponse & { - /** - * The response body as text (string format) - */ - bodyAsText: string; - /** - * The response body as parsed JSON or XML - */ - parsedBody: AccessKeys; - }; -}; +/** Optional parameters. */ +export interface HybridConnectionsCreateOrUpdateAuthorizationRuleOptionalParams + extends coreClient.OperationOptions {} -/** - * Contains response data for the beginCreateOrUpdate operation. - */ -export type NamespacesBeginCreateOrUpdateResponse = RelayNamespace & { - /** - * The underlying HTTP response. - */ - _response: msRest.HttpResponse & { - /** - * The response body as text (string format) - */ - bodyAsText: string; - /** - * The response body as parsed JSON or XML - */ - parsedBody: RelayNamespace; - }; -}; +/** Contains response data for the createOrUpdateAuthorizationRule operation. */ +export type HybridConnectionsCreateOrUpdateAuthorizationRuleResponse = AuthorizationRule; -/** - * Contains response data for the listNext operation. - */ -export type NamespacesListNextResponse = RelayNamespaceListResult & { - /** - * The underlying HTTP response. - */ - _response: msRest.HttpResponse & { - /** - * The response body as text (string format) - */ - bodyAsText: string; - /** - * The response body as parsed JSON or XML - */ - parsedBody: RelayNamespaceListResult; - }; -}; +/** Optional parameters. */ +export interface HybridConnectionsDeleteAuthorizationRuleOptionalParams + extends coreClient.OperationOptions {} -/** - * Contains response data for the listByResourceGroupNext operation. - */ -export type NamespacesListByResourceGroupNextResponse = RelayNamespaceListResult & { - /** - * The underlying HTTP response. - */ - _response: msRest.HttpResponse & { - /** - * The response body as text (string format) - */ - bodyAsText: string; - /** - * The response body as parsed JSON or XML - */ - parsedBody: RelayNamespaceListResult; - }; -}; +/** Optional parameters. */ +export interface HybridConnectionsGetAuthorizationRuleOptionalParams + extends coreClient.OperationOptions {} -/** - * Contains response data for the listAuthorizationRulesNext operation. - */ -export type NamespacesListAuthorizationRulesNextResponse = AuthorizationRuleListResult & { - /** - * The underlying HTTP response. - */ - _response: msRest.HttpResponse & { - /** - * The response body as text (string format) - */ - bodyAsText: string; - /** - * The response body as parsed JSON or XML - */ - parsedBody: AuthorizationRuleListResult; - }; -}; +/** Contains response data for the getAuthorizationRule operation. */ +export type HybridConnectionsGetAuthorizationRuleResponse = AuthorizationRule; -/** - * Contains response data for the listByNamespace operation. - */ -export type HybridConnectionsListByNamespaceResponse = HybridConnectionListResult & { - /** - * The underlying HTTP response. - */ - _response: msRest.HttpResponse & { - /** - * The response body as text (string format) - */ - bodyAsText: string; - /** - * The response body as parsed JSON or XML - */ - parsedBody: HybridConnectionListResult; - }; -}; +/** Optional parameters. */ +export interface HybridConnectionsListKeysOptionalParams + extends coreClient.OperationOptions {} -/** - * Contains response data for the createOrUpdate operation. - */ -export type HybridConnectionsCreateOrUpdateResponse = HybridConnection & { - /** - * The underlying HTTP response. - */ - _response: msRest.HttpResponse & { - /** - * The response body as text (string format) - */ - bodyAsText: string; - /** - * The response body as parsed JSON or XML - */ - parsedBody: HybridConnection; - }; -}; +/** Contains response data for the listKeys operation. */ +export type HybridConnectionsListKeysResponse = AccessKeys; -/** - * Contains response data for the get operation. - */ -export type HybridConnectionsGetResponse = HybridConnection & { - /** - * The underlying HTTP response. - */ - _response: msRest.HttpResponse & { - /** - * The response body as text (string format) - */ - bodyAsText: string; - /** - * The response body as parsed JSON or XML - */ - parsedBody: HybridConnection; - }; -}; +/** Optional parameters. */ +export interface HybridConnectionsRegenerateKeysOptionalParams + extends coreClient.OperationOptions {} -/** - * Contains response data for the listAuthorizationRules operation. - */ -export type HybridConnectionsListAuthorizationRulesResponse = AuthorizationRuleListResult & { - /** - * The underlying HTTP response. - */ - _response: msRest.HttpResponse & { - /** - * The response body as text (string format) - */ - bodyAsText: string; - /** - * The response body as parsed JSON or XML - */ - parsedBody: AuthorizationRuleListResult; - }; -}; +/** Contains response data for the regenerateKeys operation. */ +export type HybridConnectionsRegenerateKeysResponse = AccessKeys; -/** - * Contains response data for the createOrUpdateAuthorizationRule operation. - */ -export type HybridConnectionsCreateOrUpdateAuthorizationRuleResponse = AuthorizationRule & { - /** - * The underlying HTTP response. - */ - _response: msRest.HttpResponse & { - /** - * The response body as text (string format) - */ - bodyAsText: string; - /** - * The response body as parsed JSON or XML - */ - parsedBody: AuthorizationRule; - }; -}; +/** Optional parameters. */ +export interface HybridConnectionsListByNamespaceNextOptionalParams + extends coreClient.OperationOptions {} -/** - * Contains response data for the getAuthorizationRule operation. - */ -export type HybridConnectionsGetAuthorizationRuleResponse = AuthorizationRule & { - /** - * The underlying HTTP response. - */ - _response: msRest.HttpResponse & { - /** - * The response body as text (string format) - */ - bodyAsText: string; - /** - * The response body as parsed JSON or XML - */ - parsedBody: AuthorizationRule; - }; -}; +/** Contains response data for the listByNamespaceNext operation. */ +export type HybridConnectionsListByNamespaceNextResponse = HybridConnectionListResult; -/** - * Contains response data for the listKeys operation. - */ -export type HybridConnectionsListKeysResponse = AccessKeys & { - /** - * The underlying HTTP response. - */ - _response: msRest.HttpResponse & { - /** - * The response body as text (string format) - */ - bodyAsText: string; - /** - * The response body as parsed JSON or XML - */ - parsedBody: AccessKeys; - }; -}; +/** Optional parameters. */ +export interface HybridConnectionsListAuthorizationRulesNextOptionalParams + extends coreClient.OperationOptions {} -/** - * Contains response data for the regenerateKeys operation. - */ -export type HybridConnectionsRegenerateKeysResponse = AccessKeys & { - /** - * The underlying HTTP response. - */ - _response: msRest.HttpResponse & { - /** - * The response body as text (string format) - */ - bodyAsText: string; - /** - * The response body as parsed JSON or XML - */ - parsedBody: AccessKeys; - }; -}; +/** Contains response data for the listAuthorizationRulesNext operation. */ +export type HybridConnectionsListAuthorizationRulesNextResponse = AuthorizationRuleListResult; -/** - * Contains response data for the listByNamespaceNext operation. - */ -export type HybridConnectionsListByNamespaceNextResponse = HybridConnectionListResult & { - /** - * The underlying HTTP response. - */ - _response: msRest.HttpResponse & { - /** - * The response body as text (string format) - */ - bodyAsText: string; - /** - * The response body as parsed JSON or XML - */ - parsedBody: HybridConnectionListResult; - }; -}; +/** Optional parameters. */ +export interface WCFRelaysListByNamespaceOptionalParams + extends coreClient.OperationOptions {} -/** - * Contains response data for the listAuthorizationRulesNext operation. - */ -export type HybridConnectionsListAuthorizationRulesNextResponse = AuthorizationRuleListResult & { - /** - * The underlying HTTP response. - */ - _response: msRest.HttpResponse & { - /** - * The response body as text (string format) - */ - bodyAsText: string; - /** - * The response body as parsed JSON or XML - */ - parsedBody: AuthorizationRuleListResult; - }; -}; +/** Contains response data for the listByNamespace operation. */ +export type WCFRelaysListByNamespaceResponse = WcfRelaysListResult; -/** - * Contains response data for the listByNamespace operation. - */ -export type WCFRelaysListByNamespaceResponse = WcfRelaysListResult & { - /** - * The underlying HTTP response. - */ - _response: msRest.HttpResponse & { - /** - * The response body as text (string format) - */ - bodyAsText: string; - /** - * The response body as parsed JSON or XML - */ - parsedBody: WcfRelaysListResult; - }; -}; +/** Optional parameters. */ +export interface WCFRelaysCreateOrUpdateOptionalParams + extends coreClient.OperationOptions {} -/** - * Contains response data for the createOrUpdate operation. - */ -export type WCFRelaysCreateOrUpdateResponse = WcfRelay & { - /** - * The underlying HTTP response. - */ - _response: msRest.HttpResponse & { - /** - * The response body as text (string format) - */ - bodyAsText: string; - /** - * The response body as parsed JSON or XML - */ - parsedBody: WcfRelay; - }; -}; +/** Contains response data for the createOrUpdate operation. */ +export type WCFRelaysCreateOrUpdateResponse = WcfRelay; -/** - * Contains response data for the get operation. - */ -export type WCFRelaysGetResponse = WcfRelay & { - /** - * The underlying HTTP response. - */ - _response: msRest.HttpResponse & { - /** - * The response body as text (string format) - */ - bodyAsText: string; - /** - * The response body as parsed JSON or XML - */ - parsedBody: WcfRelay; - }; -}; +/** Optional parameters. */ +export interface WCFRelaysDeleteOptionalParams + extends coreClient.OperationOptions {} -/** - * Contains response data for the listAuthorizationRules operation. - */ -export type WCFRelaysListAuthorizationRulesResponse = AuthorizationRuleListResult & { - /** - * The underlying HTTP response. - */ - _response: msRest.HttpResponse & { - /** - * The response body as text (string format) - */ - bodyAsText: string; - /** - * The response body as parsed JSON or XML - */ - parsedBody: AuthorizationRuleListResult; - }; -}; +/** Optional parameters. */ +export interface WCFRelaysGetOptionalParams + extends coreClient.OperationOptions {} -/** - * Contains response data for the createOrUpdateAuthorizationRule operation. - */ -export type WCFRelaysCreateOrUpdateAuthorizationRuleResponse = AuthorizationRule & { - /** - * The underlying HTTP response. - */ - _response: msRest.HttpResponse & { - /** - * The response body as text (string format) - */ - bodyAsText: string; - /** - * The response body as parsed JSON or XML - */ - parsedBody: AuthorizationRule; - }; -}; +/** Contains response data for the get operation. */ +export type WCFRelaysGetResponse = WcfRelay; -/** - * Contains response data for the getAuthorizationRule operation. - */ -export type WCFRelaysGetAuthorizationRuleResponse = AuthorizationRule & { - /** - * The underlying HTTP response. - */ - _response: msRest.HttpResponse & { - /** - * The response body as text (string format) - */ - bodyAsText: string; - /** - * The response body as parsed JSON or XML - */ - parsedBody: AuthorizationRule; - }; -}; +/** Optional parameters. */ +export interface WCFRelaysListAuthorizationRulesOptionalParams + extends coreClient.OperationOptions {} -/** - * Contains response data for the listKeys operation. - */ -export type WCFRelaysListKeysResponse = AccessKeys & { - /** - * The underlying HTTP response. - */ - _response: msRest.HttpResponse & { - /** - * The response body as text (string format) - */ - bodyAsText: string; - /** - * The response body as parsed JSON or XML - */ - parsedBody: AccessKeys; - }; -}; +/** Contains response data for the listAuthorizationRules operation. */ +export type WCFRelaysListAuthorizationRulesResponse = AuthorizationRuleListResult; -/** - * Contains response data for the regenerateKeys operation. - */ -export type WCFRelaysRegenerateKeysResponse = AccessKeys & { - /** - * The underlying HTTP response. - */ - _response: msRest.HttpResponse & { - /** - * The response body as text (string format) - */ - bodyAsText: string; - /** - * The response body as parsed JSON or XML - */ - parsedBody: AccessKeys; - }; -}; +/** Optional parameters. */ +export interface WCFRelaysCreateOrUpdateAuthorizationRuleOptionalParams + extends coreClient.OperationOptions {} -/** - * Contains response data for the listByNamespaceNext operation. - */ -export type WCFRelaysListByNamespaceNextResponse = WcfRelaysListResult & { - /** - * The underlying HTTP response. - */ - _response: msRest.HttpResponse & { - /** - * The response body as text (string format) - */ - bodyAsText: string; - /** - * The response body as parsed JSON or XML - */ - parsedBody: WcfRelaysListResult; - }; -}; +/** Contains response data for the createOrUpdateAuthorizationRule operation. */ +export type WCFRelaysCreateOrUpdateAuthorizationRuleResponse = AuthorizationRule; -/** - * Contains response data for the listAuthorizationRulesNext operation. - */ -export type WCFRelaysListAuthorizationRulesNextResponse = AuthorizationRuleListResult & { - /** - * The underlying HTTP response. - */ - _response: msRest.HttpResponse & { - /** - * The response body as text (string format) - */ - bodyAsText: string; - /** - * The response body as parsed JSON or XML - */ - parsedBody: AuthorizationRuleListResult; - }; -}; +/** Optional parameters. */ +export interface WCFRelaysDeleteAuthorizationRuleOptionalParams + extends coreClient.OperationOptions {} + +/** Optional parameters. */ +export interface WCFRelaysGetAuthorizationRuleOptionalParams + extends coreClient.OperationOptions {} + +/** Contains response data for the getAuthorizationRule operation. */ +export type WCFRelaysGetAuthorizationRuleResponse = AuthorizationRule; + +/** Optional parameters. */ +export interface WCFRelaysListKeysOptionalParams + extends coreClient.OperationOptions {} + +/** Contains response data for the listKeys operation. */ +export type WCFRelaysListKeysResponse = AccessKeys; + +/** Optional parameters. */ +export interface WCFRelaysRegenerateKeysOptionalParams + extends coreClient.OperationOptions {} + +/** Contains response data for the regenerateKeys operation. */ +export type WCFRelaysRegenerateKeysResponse = AccessKeys; + +/** Optional parameters. */ +export interface WCFRelaysListByNamespaceNextOptionalParams + extends coreClient.OperationOptions {} + +/** Contains response data for the listByNamespaceNext operation. */ +export type WCFRelaysListByNamespaceNextResponse = WcfRelaysListResult; + +/** Optional parameters. */ +export interface WCFRelaysListAuthorizationRulesNextOptionalParams + extends coreClient.OperationOptions {} + +/** Contains response data for the listAuthorizationRulesNext operation. */ +export type WCFRelaysListAuthorizationRulesNextResponse = AuthorizationRuleListResult; + +/** Optional parameters. */ +export interface RelayAPIOptionalParams + extends coreClient.ServiceClientOptions { + /** server parameter */ + $host?: string; + /** Api Version */ + apiVersion?: string; + /** Overrides client endpoint. */ + endpoint?: string; +} diff --git a/sdk/relay/arm-relay/src/models/mappers.ts b/sdk/relay/arm-relay/src/models/mappers.ts index b1dd22291a64..d94956b614b1 100644 --- a/sdk/relay/arm-relay/src/models/mappers.ts +++ b/sdk/relay/arm-relay/src/models/mappers.ts @@ -1,42 +1,34 @@ /* - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for - * license information. + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. * * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is - * regenerated. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. */ -import { CloudErrorMapper, BaseResourceMapper } from "@azure/ms-rest-azure-js"; -import * as msRest from "@azure/ms-rest-js"; +import * as coreClient from "@azure/core-client"; -export const CloudError = CloudErrorMapper; -export const BaseResource = BaseResourceMapper; - -export const Resource: msRest.CompositeMapper = { - serializedName: "Resource", +export const OperationListResult: coreClient.CompositeMapper = { type: { name: "Composite", - className: "Resource", + className: "OperationListResult", modelProperties: { - id: { - readOnly: true, - serializedName: "id", - type: { - name: "String" - } - }, - name: { + value: { + serializedName: "value", readOnly: true, - serializedName: "name", type: { - name: "String" + name: "Sequence", + element: { + type: { + name: "Composite", + className: "Operation" + } + } } }, - type: { + nextLink: { + serializedName: "nextLink", readOnly: true, - serializedName: "type", type: { name: "String" } @@ -45,97 +37,72 @@ export const Resource: msRest.CompositeMapper = { } }; -export const TrackedResource: msRest.CompositeMapper = { - serializedName: "TrackedResource", +export const Operation: coreClient.CompositeMapper = { type: { name: "Composite", - className: "TrackedResource", + className: "Operation", modelProperties: { - ...Resource.type.modelProperties, - location: { - required: true, - serializedName: "location", + name: { + serializedName: "name", + readOnly: true, type: { name: "String" } }, - tags: { - serializedName: "tags", - type: { - name: "Dictionary", - value: { - type: { - name: "String" - } - } - } - } - } - } -}; - -export const ResourceNamespacePatch: msRest.CompositeMapper = { - serializedName: "ResourceNamespacePatch", - type: { - name: "Composite", - className: "ResourceNamespacePatch", - modelProperties: { - ...Resource.type.modelProperties, - tags: { - serializedName: "tags", + display: { + serializedName: "display", type: { - name: "Dictionary", - value: { - type: { - name: "String" - } - } + name: "Composite", + className: "OperationDisplay" } } } } }; -export const HybridConnection: msRest.CompositeMapper = { - serializedName: "HybridConnection", +export const OperationDisplay: coreClient.CompositeMapper = { type: { name: "Composite", - className: "HybridConnection", + className: "OperationDisplay", modelProperties: { - ...Resource.type.modelProperties, - createdAt: { + provider: { + serializedName: "provider", readOnly: true, - serializedName: "properties.createdAt", type: { - name: "DateTime" + name: "String" } }, - updatedAt: { + resource: { + serializedName: "resource", readOnly: true, - serializedName: "properties.updatedAt", type: { - name: "DateTime" + name: "String" } }, - listenerCount: { + operation: { + serializedName: "operation", readOnly: true, - serializedName: "properties.listenerCount", - constraints: { - InclusiveMaximum: 25, - InclusiveMinimum: 0 - }, type: { - name: "Number" + name: "String" } - }, - requiresClientAuthorization: { - serializedName: "properties.requiresClientAuthorization", + } + } + } +}; + +export const ErrorResponse: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "ErrorResponse", + modelProperties: { + code: { + serializedName: "code", type: { - name: "Boolean" + name: "String" } }, - userMetadata: { - serializedName: "properties.userMetadata", + message: { + serializedName: "message", type: { name: "String" } @@ -144,69 +111,77 @@ export const HybridConnection: msRest.CompositeMapper = { } }; -export const WcfRelay: msRest.CompositeMapper = { - serializedName: "WcfRelay", +export const CheckNameAvailability: coreClient.CompositeMapper = { type: { name: "Composite", - className: "WcfRelay", + className: "CheckNameAvailability", modelProperties: { - ...Resource.type.modelProperties, - isDynamic: { - readOnly: true, - serializedName: "properties.isDynamic", - type: { - name: "Boolean" - } - }, - createdAt: { - readOnly: true, - serializedName: "properties.createdAt", + name: { + serializedName: "name", + required: true, type: { - name: "DateTime" + name: "String" } - }, - updatedAt: { + } + } + } +}; + +export const CheckNameAvailabilityResult: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "CheckNameAvailabilityResult", + modelProperties: { + message: { + serializedName: "message", readOnly: true, - serializedName: "properties.updatedAt", type: { - name: "DateTime" + name: "String" } }, - listenerCount: { - readOnly: true, - serializedName: "properties.listenerCount", - constraints: { - InclusiveMaximum: 25, - InclusiveMinimum: 0 - }, + nameAvailable: { + serializedName: "nameAvailable", type: { - name: "Number" + name: "Boolean" } }, - relayType: { - serializedName: "properties.relayType", + reason: { + serializedName: "reason", type: { name: "Enum", allowedValues: [ - "NetTcp", - "Http" + "None", + "InvalidName", + "SubscriptionIsDisabled", + "NameInUse", + "NameInLockdown", + "TooManyNamespaceInCurrentSubscription" ] } - }, - requiresClientAuthorization: { - serializedName: "properties.requiresClientAuthorization", - type: { - name: "Boolean" - } - }, - requiresTransportSecurity: { - serializedName: "properties.requiresTransportSecurity", + } + } + } +}; + +export const RelayNamespaceListResult: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "RelayNamespaceListResult", + modelProperties: { + value: { + serializedName: "value", type: { - name: "Boolean" + name: "Sequence", + element: { + type: { + name: "Composite", + className: "RelayNamespace" + } + } } }, - userMetadata: { - serializedName: "properties.userMetadata", + nextLink: { + serializedName: "nextLink", type: { name: "String" } @@ -215,87 +190,53 @@ export const WcfRelay: msRest.CompositeMapper = { } }; -export const Sku: msRest.CompositeMapper = { - serializedName: "Sku", +export const Sku: coreClient.CompositeMapper = { type: { name: "Composite", className: "Sku", modelProperties: { name: { - required: true, + defaultValue: "Standard", isConstant: true, serializedName: "name", - defaultValue: 'Standard', type: { name: "String" } }, tier: { + defaultValue: "Standard", + isConstant: true, serializedName: "tier", type: { - name: "Enum", - allowedValues: [ - "Standard" - ] + name: "String" } } } } }; -export const RelayNamespace: msRest.CompositeMapper = { - serializedName: "RelayNamespace", +export const Resource: coreClient.CompositeMapper = { type: { name: "Composite", - className: "RelayNamespace", + className: "Resource", modelProperties: { - ...TrackedResource.type.modelProperties, - sku: { - serializedName: "sku", - type: { - name: "Composite", - className: "Sku" - } - }, - provisioningState: { - readOnly: true, - serializedName: "properties.provisioningState", - type: { - name: "Enum", - allowedValues: [ - "Created", - "Succeeded", - "Deleted", - "Failed", - "Updating", - "Unknown" - ] - } - }, - createdAt: { - readOnly: true, - serializedName: "properties.createdAt", - type: { - name: "DateTime" - } - }, - updatedAt: { + id: { + serializedName: "id", readOnly: true, - serializedName: "properties.updatedAt", type: { - name: "DateTime" + name: "String" } }, - serviceBusEndpoint: { + name: { + serializedName: "name", readOnly: true, - serializedName: "properties.serviceBusEndpoint", type: { name: "String" } }, - metricId: { + type: { + serializedName: "type", readOnly: true, - serializedName: "properties.metricId", type: { name: "String" } @@ -304,100 +245,34 @@ export const RelayNamespace: msRest.CompositeMapper = { } }; -export const RelayUpdateParameters: msRest.CompositeMapper = { - serializedName: "RelayUpdateParameters", +export const AuthorizationRuleListResult: coreClient.CompositeMapper = { type: { name: "Composite", - className: "RelayUpdateParameters", + className: "AuthorizationRuleListResult", modelProperties: { - ...ResourceNamespacePatch.type.modelProperties, - sku: { - serializedName: "sku", - type: { - name: "Composite", - className: "Sku" - } - }, - provisioningState: { - readOnly: true, - serializedName: "properties.provisioningState", - type: { - name: "Enum", - allowedValues: [ - "Created", - "Succeeded", - "Deleted", - "Failed", - "Updating", - "Unknown" - ] - } - }, - createdAt: { - readOnly: true, - serializedName: "properties.createdAt", - type: { - name: "DateTime" - } - }, - updatedAt: { - readOnly: true, - serializedName: "properties.updatedAt", - type: { - name: "DateTime" - } - }, - serviceBusEndpoint: { - readOnly: true, - serializedName: "properties.serviceBusEndpoint", - type: { - name: "String" - } - }, - metricId: { - readOnly: true, - serializedName: "properties.metricId", - type: { - name: "String" - } - } - } - } -}; - -export const AuthorizationRule: msRest.CompositeMapper = { - serializedName: "AuthorizationRule", - type: { - name: "Composite", - className: "AuthorizationRule", - modelProperties: { - ...Resource.type.modelProperties, - rights: { - required: true, - serializedName: "properties.rights", - constraints: { - UniqueItems: true - }, + value: { + serializedName: "value", type: { name: "Sequence", element: { type: { - name: "Enum", - allowedValues: [ - "Manage", - "Send", - "Listen" - ] + name: "Composite", + className: "AuthorizationRule" } } } + }, + nextLink: { + serializedName: "nextLink", + type: { + name: "String" + } } } } }; -export const AccessKeys: msRest.CompositeMapper = { - serializedName: "AccessKeys", +export const AccessKeys: coreClient.CompositeMapper = { type: { name: "Composite", className: "AccessKeys", @@ -436,21 +311,17 @@ export const AccessKeys: msRest.CompositeMapper = { } }; -export const RegenerateAccessKeyParameters: msRest.CompositeMapper = { - serializedName: "RegenerateAccessKeyParameters", +export const RegenerateAccessKeyParameters: coreClient.CompositeMapper = { type: { name: "Composite", className: "RegenerateAccessKeyParameters", modelProperties: { keyType: { - required: true, serializedName: "keyType", + required: true, type: { name: "Enum", - allowedValues: [ - "PrimaryKey", - "SecondaryKey" - ] + allowedValues: ["PrimaryKey", "SecondaryKey"] } }, key: { @@ -463,83 +334,52 @@ export const RegenerateAccessKeyParameters: msRest.CompositeMapper = { } }; -export const CheckNameAvailability: msRest.CompositeMapper = { - serializedName: "CheckNameAvailability", - type: { - name: "Composite", - className: "CheckNameAvailability", - modelProperties: { - name: { - required: true, - serializedName: "name", - type: { - name: "String" - } - } - } - } -}; - -export const CheckNameAvailabilityResult: msRest.CompositeMapper = { - serializedName: "CheckNameAvailabilityResult", +export const HybridConnectionListResult: coreClient.CompositeMapper = { type: { name: "Composite", - className: "CheckNameAvailabilityResult", + className: "HybridConnectionListResult", modelProperties: { - message: { - readOnly: true, - serializedName: "message", - type: { - name: "String" - } - }, - nameAvailable: { - serializedName: "nameAvailable", + value: { + serializedName: "value", type: { - name: "Boolean" + name: "Sequence", + element: { + type: { + name: "Composite", + className: "HybridConnection" + } + } } }, - reason: { - serializedName: "reason", + nextLink: { + serializedName: "nextLink", type: { - name: "Enum", - allowedValues: [ - "None", - "InvalidName", - "SubscriptionIsDisabled", - "NameInUse", - "NameInLockdown", - "TooManyNamespaceInCurrentSubscription" - ] + name: "String" } } } } }; -export const OperationDisplay: msRest.CompositeMapper = { - serializedName: "Operation_display", +export const WcfRelaysListResult: coreClient.CompositeMapper = { type: { name: "Composite", - className: "OperationDisplay", + className: "WcfRelaysListResult", modelProperties: { - provider: { - readOnly: true, - serializedName: "provider", - type: { - name: "String" - } - }, - resource: { - readOnly: true, - serializedName: "resource", + value: { + serializedName: "value", type: { - name: "String" + name: "Sequence", + element: { + type: { + name: "Composite", + className: "WcfRelay" + } + } } }, - operation: { - readOnly: true, - serializedName: "operation", + nextLink: { + serializedName: "nextLink", type: { name: "String" } @@ -548,102 +388,112 @@ export const OperationDisplay: msRest.CompositeMapper = { } }; -export const Operation: msRest.CompositeMapper = { - serializedName: "Operation", +export const TrackedResource: coreClient.CompositeMapper = { type: { name: "Composite", - className: "Operation", + className: "TrackedResource", modelProperties: { - name: { - readOnly: true, - serializedName: "name", + ...Resource.type.modelProperties, + location: { + serializedName: "location", + required: true, type: { name: "String" } }, - display: { - serializedName: "display", + tags: { + serializedName: "tags", type: { - name: "Composite", - className: "OperationDisplay" + name: "Dictionary", + value: { type: { name: "String" } } } } } } }; -export const ErrorResponse: msRest.CompositeMapper = { - serializedName: "ErrorResponse", +export const ResourceNamespacePatch: coreClient.CompositeMapper = { type: { name: "Composite", - className: "ErrorResponse", + className: "ResourceNamespacePatch", modelProperties: { - code: { - serializedName: "code", - type: { - name: "String" - } - }, - message: { - serializedName: "message", + ...Resource.type.modelProperties, + tags: { + serializedName: "tags", type: { - name: "String" + name: "Dictionary", + value: { type: { name: "String" } } } } } } }; -export const OperationListResult: msRest.CompositeMapper = { - serializedName: "OperationListResult", +export const AuthorizationRule: coreClient.CompositeMapper = { type: { name: "Composite", - className: "OperationListResult", + className: "AuthorizationRule", modelProperties: { - value: { - readOnly: true, - serializedName: "", + ...Resource.type.modelProperties, + rights: { + constraints: { + UniqueItems: true + }, + serializedName: "properties.rights", + required: true, type: { name: "Sequence", element: { type: { - name: "Composite", - className: "Operation" + name: "Enum", + allowedValues: ["Manage", "Send", "Listen"] } } } - }, - nextLink: { - readOnly: true, - serializedName: "nextLink", - type: { - name: "String" - } } } } }; -export const RelayNamespaceListResult: msRest.CompositeMapper = { - serializedName: "RelayNamespaceListResult", +export const HybridConnection: coreClient.CompositeMapper = { type: { name: "Composite", - className: "RelayNamespaceListResult", + className: "HybridConnection", modelProperties: { - value: { - serializedName: "", + ...Resource.type.modelProperties, + createdAt: { + serializedName: "properties.createdAt", + readOnly: true, type: { - name: "Sequence", - element: { - type: { - name: "Composite", - className: "RelayNamespace" - } - } + name: "DateTime" } }, - nextLink: { - serializedName: "nextLink", + updatedAt: { + serializedName: "properties.updatedAt", + readOnly: true, + type: { + name: "DateTime" + } + }, + listenerCount: { + constraints: { + InclusiveMaximum: 25, + InclusiveMinimum: 0 + }, + serializedName: "properties.listenerCount", + readOnly: true, + type: { + name: "Number" + } + }, + requiresClientAuthorization: { + serializedName: "properties.requiresClientAuthorization", + type: { + name: "Boolean" + } + }, + userMetadata: { + serializedName: "properties.userMetadata", type: { name: "String" } @@ -652,26 +502,65 @@ export const RelayNamespaceListResult: msRest.CompositeMapper = { } }; -export const AuthorizationRuleListResult: msRest.CompositeMapper = { - serializedName: "AuthorizationRuleListResult", +export const WcfRelay: coreClient.CompositeMapper = { type: { name: "Composite", - className: "AuthorizationRuleListResult", + className: "WcfRelay", modelProperties: { - value: { - serializedName: "", + ...Resource.type.modelProperties, + isDynamic: { + serializedName: "properties.isDynamic", + readOnly: true, type: { - name: "Sequence", - element: { - type: { - name: "Composite", - className: "AuthorizationRule" - } - } + name: "Boolean" } }, - nextLink: { - serializedName: "nextLink", + createdAt: { + serializedName: "properties.createdAt", + readOnly: true, + type: { + name: "DateTime" + } + }, + updatedAt: { + serializedName: "properties.updatedAt", + readOnly: true, + type: { + name: "DateTime" + } + }, + listenerCount: { + constraints: { + InclusiveMaximum: 25, + InclusiveMinimum: 0 + }, + serializedName: "properties.listenerCount", + readOnly: true, + type: { + name: "Number" + } + }, + relayType: { + serializedName: "properties.relayType", + type: { + name: "Enum", + allowedValues: ["NetTcp", "Http"] + } + }, + requiresClientAuthorization: { + serializedName: "properties.requiresClientAuthorization", + type: { + name: "Boolean" + } + }, + requiresTransportSecurity: { + serializedName: "properties.requiresTransportSecurity", + type: { + name: "Boolean" + } + }, + userMetadata: { + serializedName: "properties.userMetadata", type: { name: "String" } @@ -680,26 +569,58 @@ export const AuthorizationRuleListResult: msRest.CompositeMapper = { } }; -export const HybridConnectionListResult: msRest.CompositeMapper = { - serializedName: "HybridConnectionListResult", +export const RelayNamespace: coreClient.CompositeMapper = { type: { name: "Composite", - className: "HybridConnectionListResult", + className: "RelayNamespace", modelProperties: { - value: { - serializedName: "", + ...TrackedResource.type.modelProperties, + sku: { + serializedName: "sku", type: { - name: "Sequence", - element: { - type: { - name: "Composite", - className: "HybridConnection" - } - } + name: "Composite", + className: "Sku" } }, - nextLink: { - serializedName: "nextLink", + provisioningState: { + serializedName: "properties.provisioningState", + readOnly: true, + type: { + name: "Enum", + allowedValues: [ + "Created", + "Succeeded", + "Deleted", + "Failed", + "Updating", + "Unknown" + ] + } + }, + createdAt: { + serializedName: "properties.createdAt", + readOnly: true, + type: { + name: "DateTime" + } + }, + updatedAt: { + serializedName: "properties.updatedAt", + readOnly: true, + type: { + name: "DateTime" + } + }, + serviceBusEndpoint: { + serializedName: "properties.serviceBusEndpoint", + readOnly: true, + type: { + name: "String" + } + }, + metricId: { + serializedName: "properties.metricId", + readOnly: true, type: { name: "String" } @@ -708,26 +629,58 @@ export const HybridConnectionListResult: msRest.CompositeMapper = { } }; -export const WcfRelaysListResult: msRest.CompositeMapper = { - serializedName: "WcfRelaysListResult", +export const RelayUpdateParameters: coreClient.CompositeMapper = { type: { name: "Composite", - className: "WcfRelaysListResult", + className: "RelayUpdateParameters", modelProperties: { - value: { - serializedName: "", + ...ResourceNamespacePatch.type.modelProperties, + sku: { + serializedName: "sku", type: { - name: "Sequence", - element: { - type: { - name: "Composite", - className: "WcfRelay" - } - } + name: "Composite", + className: "Sku" } }, - nextLink: { - serializedName: "nextLink", + provisioningState: { + serializedName: "properties.provisioningState", + readOnly: true, + type: { + name: "Enum", + allowedValues: [ + "Created", + "Succeeded", + "Deleted", + "Failed", + "Updating", + "Unknown" + ] + } + }, + createdAt: { + serializedName: "properties.createdAt", + readOnly: true, + type: { + name: "DateTime" + } + }, + updatedAt: { + serializedName: "properties.updatedAt", + readOnly: true, + type: { + name: "DateTime" + } + }, + serviceBusEndpoint: { + serializedName: "properties.serviceBusEndpoint", + readOnly: true, + type: { + name: "String" + } + }, + metricId: { + serializedName: "properties.metricId", + readOnly: true, type: { name: "String" } diff --git a/sdk/relay/arm-relay/src/models/namespacesMappers.ts b/sdk/relay/arm-relay/src/models/namespacesMappers.ts deleted file mode 100644 index 737425940d82..000000000000 --- a/sdk/relay/arm-relay/src/models/namespacesMappers.ts +++ /dev/null @@ -1,30 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for - * license information. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is - * regenerated. - */ - -export { - CheckNameAvailability, - CheckNameAvailabilityResult, - ErrorResponse, - RelayNamespaceListResult, - RelayNamespace, - TrackedResource, - Resource, - BaseResource, - Sku, - RelayUpdateParameters, - ResourceNamespacePatch, - AuthorizationRuleListResult, - AuthorizationRule, - AccessKeys, - RegenerateAccessKeyParameters, - HybridConnection, - WcfRelay -} from "../models/mappers"; - diff --git a/sdk/relay/arm-relay/src/models/operationsMappers.ts b/sdk/relay/arm-relay/src/models/operationsMappers.ts deleted file mode 100644 index 715467ec9522..000000000000 --- a/sdk/relay/arm-relay/src/models/operationsMappers.ts +++ /dev/null @@ -1,17 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for - * license information. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is - * regenerated. - */ - -export { - OperationListResult, - Operation, - OperationDisplay, - ErrorResponse -} from "../models/mappers"; - diff --git a/sdk/relay/arm-relay/src/models/parameters.ts b/sdk/relay/arm-relay/src/models/parameters.ts index d5b8cd02599a..6e14c392ea5c 100644 --- a/sdk/relay/arm-relay/src/models/parameters.ts +++ b/sdk/relay/arm-relay/src/models/parameters.ts @@ -1,118 +1,198 @@ /* - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for - * license information. + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. * * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is - * regenerated. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. */ -import * as msRest from "@azure/ms-rest-js"; +import { + OperationParameter, + OperationURLParameter, + OperationQueryParameter +} from "@azure/core-client"; +import { + CheckNameAvailability as CheckNameAvailabilityMapper, + RelayNamespace as RelayNamespaceMapper, + RelayUpdateParameters as RelayUpdateParametersMapper, + AuthorizationRule as AuthorizationRuleMapper, + RegenerateAccessKeyParameters as RegenerateAccessKeyParametersMapper, + HybridConnection as HybridConnectionMapper, + WcfRelay as WcfRelayMapper +} from "../models/mappers"; -export const acceptLanguage: msRest.OperationParameter = { - parameterPath: "acceptLanguage", +export const accept: OperationParameter = { + parameterPath: "accept", mapper: { - serializedName: "accept-language", - defaultValue: 'en-US', + defaultValue: "application/json", + isConstant: true, + serializedName: "Accept", type: { name: "String" } } }; -export const apiVersion: msRest.OperationQueryParameter = { - parameterPath: "apiVersion", + +export const $host: OperationURLParameter = { + parameterPath: "$host", mapper: { + serializedName: "$host", required: true, + type: { + name: "String" + } + }, + skipEncoding: true +}; + +export const apiVersion: OperationQueryParameter = { + parameterPath: "apiVersion", + mapper: { + defaultValue: "2017-04-01", + isConstant: true, serializedName: "api-version", type: { name: "String" } } }; -export const authorizationRuleName: msRest.OperationURLParameter = { - parameterPath: "authorizationRuleName", + +export const nextLink: OperationURLParameter = { + parameterPath: "nextLink", mapper: { + serializedName: "nextLink", required: true, - serializedName: "authorizationRuleName", - constraints: { - MinLength: 1 - }, + type: { + name: "String" + } + }, + skipEncoding: true +}; + +export const contentType: OperationParameter = { + parameterPath: ["options", "contentType"], + mapper: { + defaultValue: "application/json", + isConstant: true, + serializedName: "Content-Type", type: { name: "String" } } }; -export const hybridConnectionName: msRest.OperationURLParameter = { - parameterPath: "hybridConnectionName", + +export const parameters: OperationParameter = { + parameterPath: "parameters", + mapper: CheckNameAvailabilityMapper +}; + +export const subscriptionId: OperationURLParameter = { + parameterPath: "subscriptionId", mapper: { + serializedName: "subscriptionId", required: true, - serializedName: "hybridConnectionName", + type: { + name: "String" + } + } +}; + +export const resourceGroupName: OperationURLParameter = { + parameterPath: "resourceGroupName", + mapper: { constraints: { + MaxLength: 90, MinLength: 1 }, + serializedName: "resourceGroupName", + required: true, type: { name: "String" } } }; -export const namespaceName: msRest.OperationURLParameter = { + +export const parameters1: OperationParameter = { + parameterPath: "parameters", + mapper: RelayNamespaceMapper +}; + +export const namespaceName: OperationURLParameter = { parameterPath: "namespaceName", mapper: { - required: true, - serializedName: "namespaceName", constraints: { MaxLength: 50, MinLength: 6 }, + serializedName: "namespaceName", + required: true, type: { name: "String" } } }; -export const nextPageLink: msRest.OperationURLParameter = { - parameterPath: "nextPageLink", - mapper: { - required: true, - serializedName: "nextLink", - type: { - name: "String" - } - }, - skipEncoding: true + +export const parameters2: OperationParameter = { + parameterPath: "parameters", + mapper: RelayUpdateParametersMapper }; -export const relayName: msRest.OperationURLParameter = { - parameterPath: "relayName", + +export const parameters3: OperationParameter = { + parameterPath: "parameters", + mapper: AuthorizationRuleMapper +}; + +export const authorizationRuleName: OperationURLParameter = { + parameterPath: "authorizationRuleName", mapper: { - required: true, - serializedName: "relayName", constraints: { MinLength: 1 }, + serializedName: "authorizationRuleName", + required: true, type: { name: "String" } } }; -export const resourceGroupName: msRest.OperationURLParameter = { - parameterPath: "resourceGroupName", + +export const parameters4: OperationParameter = { + parameterPath: "parameters", + mapper: RegenerateAccessKeyParametersMapper +}; + +export const parameters5: OperationParameter = { + parameterPath: "parameters", + mapper: HybridConnectionMapper +}; + +export const hybridConnectionName: OperationURLParameter = { + parameterPath: "hybridConnectionName", mapper: { - required: true, - serializedName: "resourceGroupName", constraints: { - MaxLength: 90, MinLength: 1 }, + serializedName: "hybridConnectionName", + required: true, type: { name: "String" } } }; -export const subscriptionId: msRest.OperationURLParameter = { - parameterPath: "subscriptionId", + +export const parameters6: OperationParameter = { + parameterPath: "parameters", + mapper: WcfRelayMapper +}; + +export const relayName: OperationURLParameter = { + parameterPath: "relayName", mapper: { + constraints: { + MinLength: 1 + }, + serializedName: "relayName", required: true, - serializedName: "subscriptionId", type: { name: "String" } diff --git a/sdk/relay/arm-relay/src/models/wCFRelaysMappers.ts b/sdk/relay/arm-relay/src/models/wCFRelaysMappers.ts deleted file mode 100644 index bf5ee70e6dd2..000000000000 --- a/sdk/relay/arm-relay/src/models/wCFRelaysMappers.ts +++ /dev/null @@ -1,29 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for - * license information. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is - * regenerated. - */ - -export { - WcfRelaysListResult, - WcfRelay, - Resource, - BaseResource, - ErrorResponse, - AuthorizationRuleListResult, - AuthorizationRule, - CloudError, - AccessKeys, - RegenerateAccessKeyParameters, - TrackedResource, - ResourceNamespacePatch, - HybridConnection, - RelayNamespace, - Sku, - RelayUpdateParameters -} from "../models/mappers"; - diff --git a/sdk/relay/arm-relay/src/operations/hybridConnections.ts b/sdk/relay/arm-relay/src/operations/hybridConnections.ts index 5618c3f5a3be..b2b2c751fdac 100644 --- a/sdk/relay/arm-relay/src/operations/hybridConnections.ts +++ b/sdk/relay/arm-relay/src/operations/hybridConnections.ts @@ -1,28 +1,55 @@ /* - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for - * license information. + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. * * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is - * regenerated. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. */ -import * as msRest from "@azure/ms-rest-js"; -import * as Models from "../models"; -import * as Mappers from "../models/hybridConnectionsMappers"; +import { PagedAsyncIterableIterator } from "@azure/core-paging"; +import { HybridConnections } from "../operationsInterfaces"; +import * as coreClient from "@azure/core-client"; +import * as Mappers from "../models/mappers"; import * as Parameters from "../models/parameters"; -import { RelayManagementClientContext } from "../relayManagementClientContext"; +import { RelayAPI } from "../relayAPI"; +import { + HybridConnection, + HybridConnectionsListByNamespaceNextOptionalParams, + HybridConnectionsListByNamespaceOptionalParams, + AuthorizationRule, + HybridConnectionsListAuthorizationRulesNextOptionalParams, + HybridConnectionsListAuthorizationRulesOptionalParams, + HybridConnectionsListByNamespaceResponse, + HybridConnectionsCreateOrUpdateOptionalParams, + HybridConnectionsCreateOrUpdateResponse, + HybridConnectionsDeleteOptionalParams, + HybridConnectionsGetOptionalParams, + HybridConnectionsGetResponse, + HybridConnectionsListAuthorizationRulesResponse, + HybridConnectionsCreateOrUpdateAuthorizationRuleOptionalParams, + HybridConnectionsCreateOrUpdateAuthorizationRuleResponse, + HybridConnectionsDeleteAuthorizationRuleOptionalParams, + HybridConnectionsGetAuthorizationRuleOptionalParams, + HybridConnectionsGetAuthorizationRuleResponse, + HybridConnectionsListKeysOptionalParams, + HybridConnectionsListKeysResponse, + RegenerateAccessKeyParameters, + HybridConnectionsRegenerateKeysOptionalParams, + HybridConnectionsRegenerateKeysResponse, + HybridConnectionsListByNamespaceNextResponse, + HybridConnectionsListAuthorizationRulesNextResponse +} from "../models"; -/** Class representing a HybridConnections. */ -export class HybridConnections { - private readonly client: RelayManagementClientContext; +/// +/** Class containing HybridConnections operations. */ +export class HybridConnectionsImpl implements HybridConnections { + private readonly client: RelayAPI; /** - * Create a HybridConnections. - * @param {RelayManagementClientContext} client Reference to the service client. + * Initialize a new instance of the class HybridConnections class. + * @param client Reference to the service client */ - constructor(client: RelayManagementClientContext) { + constructor(client: RelayAPI) { this.client = client; } @@ -30,62 +57,185 @@ export class HybridConnections { * Lists the hybrid connection within the namespace. * @param resourceGroupName Name of the Resource group within the Azure subscription. * @param namespaceName The namespace name - * @param [options] The optional parameters - * @returns Promise - */ - listByNamespace(resourceGroupName: string, namespaceName: string, options?: msRest.RequestOptionsBase): Promise; - /** - * @param resourceGroupName Name of the Resource group within the Azure subscription. - * @param namespaceName The namespace name - * @param callback The callback - */ - listByNamespace(resourceGroupName: string, namespaceName: string, callback: msRest.ServiceCallback): void; - /** - * @param resourceGroupName Name of the Resource group within the Azure subscription. - * @param namespaceName The namespace name - * @param options The optional parameters - * @param callback The callback - */ - listByNamespace(resourceGroupName: string, namespaceName: string, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; - listByNamespace(resourceGroupName: string, namespaceName: string, options?: msRest.RequestOptionsBase | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { - return this.client.sendOperationRequest( - { + * @param options The options parameters. + */ + public listByNamespace( + resourceGroupName: string, + namespaceName: string, + options?: HybridConnectionsListByNamespaceOptionalParams + ): PagedAsyncIterableIterator { + const iter = this.listByNamespacePagingAll( + resourceGroupName, + namespaceName, + options + ); + return { + next() { + return iter.next(); + }, + [Symbol.asyncIterator]() { + return this; + }, + byPage: () => { + return this.listByNamespacePagingPage( + resourceGroupName, + namespaceName, + options + ); + } + }; + } + + private async *listByNamespacePagingPage( + resourceGroupName: string, + namespaceName: string, + options?: HybridConnectionsListByNamespaceOptionalParams + ): AsyncIterableIterator { + let result = await this._listByNamespace( + resourceGroupName, + namespaceName, + options + ); + yield result.value || []; + let continuationToken = result.nextLink; + while (continuationToken) { + result = await this._listByNamespaceNext( resourceGroupName, namespaceName, + continuationToken, options - }, - listByNamespaceOperationSpec, - callback) as Promise; + ); + continuationToken = result.nextLink; + yield result.value || []; + } + } + + private async *listByNamespacePagingAll( + resourceGroupName: string, + namespaceName: string, + options?: HybridConnectionsListByNamespaceOptionalParams + ): AsyncIterableIterator { + for await (const page of this.listByNamespacePagingPage( + resourceGroupName, + namespaceName, + options + )) { + yield* page; + } } /** - * Creates or updates a service hybrid connection. This operation is idempotent. + * Authorization rules for a hybrid connection. * @param resourceGroupName Name of the Resource group within the Azure subscription. * @param namespaceName The namespace name * @param hybridConnectionName The hybrid connection name. - * @param parameters Parameters supplied to create a hybrid connection. - * @param [options] The optional parameters - * @returns Promise - */ - createOrUpdate(resourceGroupName: string, namespaceName: string, hybridConnectionName: string, parameters: Models.HybridConnection, options?: msRest.RequestOptionsBase): Promise; + * @param options The options parameters. + */ + public listAuthorizationRules( + resourceGroupName: string, + namespaceName: string, + hybridConnectionName: string, + options?: HybridConnectionsListAuthorizationRulesOptionalParams + ): PagedAsyncIterableIterator { + const iter = this.listAuthorizationRulesPagingAll( + resourceGroupName, + namespaceName, + hybridConnectionName, + options + ); + return { + next() { + return iter.next(); + }, + [Symbol.asyncIterator]() { + return this; + }, + byPage: () => { + return this.listAuthorizationRulesPagingPage( + resourceGroupName, + namespaceName, + hybridConnectionName, + options + ); + } + }; + } + + private async *listAuthorizationRulesPagingPage( + resourceGroupName: string, + namespaceName: string, + hybridConnectionName: string, + options?: HybridConnectionsListAuthorizationRulesOptionalParams + ): AsyncIterableIterator { + let result = await this._listAuthorizationRules( + resourceGroupName, + namespaceName, + hybridConnectionName, + options + ); + yield result.value || []; + let continuationToken = result.nextLink; + while (continuationToken) { + result = await this._listAuthorizationRulesNext( + resourceGroupName, + namespaceName, + hybridConnectionName, + continuationToken, + options + ); + continuationToken = result.nextLink; + yield result.value || []; + } + } + + private async *listAuthorizationRulesPagingAll( + resourceGroupName: string, + namespaceName: string, + hybridConnectionName: string, + options?: HybridConnectionsListAuthorizationRulesOptionalParams + ): AsyncIterableIterator { + for await (const page of this.listAuthorizationRulesPagingPage( + resourceGroupName, + namespaceName, + hybridConnectionName, + options + )) { + yield* page; + } + } + /** + * Lists the hybrid connection within the namespace. * @param resourceGroupName Name of the Resource group within the Azure subscription. * @param namespaceName The namespace name - * @param hybridConnectionName The hybrid connection name. - * @param parameters Parameters supplied to create a hybrid connection. - * @param callback The callback + * @param options The options parameters. */ - createOrUpdate(resourceGroupName: string, namespaceName: string, hybridConnectionName: string, parameters: Models.HybridConnection, callback: msRest.ServiceCallback): void; + private _listByNamespace( + resourceGroupName: string, + namespaceName: string, + options?: HybridConnectionsListByNamespaceOptionalParams + ): Promise { + return this.client.sendOperationRequest( + { resourceGroupName, namespaceName, options }, + listByNamespaceOperationSpec + ); + } + /** + * Creates or updates a service hybrid connection. This operation is idempotent. * @param resourceGroupName Name of the Resource group within the Azure subscription. * @param namespaceName The namespace name * @param hybridConnectionName The hybrid connection name. * @param parameters Parameters supplied to create a hybrid connection. - * @param options The optional parameters - * @param callback The callback - */ - createOrUpdate(resourceGroupName: string, namespaceName: string, hybridConnectionName: string, parameters: Models.HybridConnection, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; - createOrUpdate(resourceGroupName: string, namespaceName: string, hybridConnectionName: string, parameters: Models.HybridConnection, options?: msRest.RequestOptionsBase | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { + * @param options The options parameters. + */ + createOrUpdate( + resourceGroupName: string, + namespaceName: string, + hybridConnectionName: string, + parameters: HybridConnection, + options?: HybridConnectionsCreateOrUpdateOptionalParams + ): Promise { return this.client.sendOperationRequest( { resourceGroupName, @@ -94,8 +244,8 @@ export class HybridConnections { parameters, options }, - createOrUpdateOperationSpec, - callback) as Promise; + createOrUpdateOperationSpec + ); } /** @@ -103,35 +253,18 @@ export class HybridConnections { * @param resourceGroupName Name of the Resource group within the Azure subscription. * @param namespaceName The namespace name * @param hybridConnectionName The hybrid connection name. - * @param [options] The optional parameters - * @returns Promise - */ - deleteMethod(resourceGroupName: string, namespaceName: string, hybridConnectionName: string, options?: msRest.RequestOptionsBase): Promise; - /** - * @param resourceGroupName Name of the Resource group within the Azure subscription. - * @param namespaceName The namespace name - * @param hybridConnectionName The hybrid connection name. - * @param callback The callback - */ - deleteMethod(resourceGroupName: string, namespaceName: string, hybridConnectionName: string, callback: msRest.ServiceCallback): void; - /** - * @param resourceGroupName Name of the Resource group within the Azure subscription. - * @param namespaceName The namespace name - * @param hybridConnectionName The hybrid connection name. - * @param options The optional parameters - * @param callback The callback - */ - deleteMethod(resourceGroupName: string, namespaceName: string, hybridConnectionName: string, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; - deleteMethod(resourceGroupName: string, namespaceName: string, hybridConnectionName: string, options?: msRest.RequestOptionsBase | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { + * @param options The options parameters. + */ + delete( + resourceGroupName: string, + namespaceName: string, + hybridConnectionName: string, + options?: HybridConnectionsDeleteOptionalParams + ): Promise { return this.client.sendOperationRequest( - { - resourceGroupName, - namespaceName, - hybridConnectionName, - options - }, - deleteMethodOperationSpec, - callback); + { resourceGroupName, namespaceName, hybridConnectionName, options }, + deleteOperationSpec + ); } /** @@ -139,35 +272,18 @@ export class HybridConnections { * @param resourceGroupName Name of the Resource group within the Azure subscription. * @param namespaceName The namespace name * @param hybridConnectionName The hybrid connection name. - * @param [options] The optional parameters - * @returns Promise - */ - get(resourceGroupName: string, namespaceName: string, hybridConnectionName: string, options?: msRest.RequestOptionsBase): Promise; - /** - * @param resourceGroupName Name of the Resource group within the Azure subscription. - * @param namespaceName The namespace name - * @param hybridConnectionName The hybrid connection name. - * @param callback The callback - */ - get(resourceGroupName: string, namespaceName: string, hybridConnectionName: string, callback: msRest.ServiceCallback): void; - /** - * @param resourceGroupName Name of the Resource group within the Azure subscription. - * @param namespaceName The namespace name - * @param hybridConnectionName The hybrid connection name. - * @param options The optional parameters - * @param callback The callback - */ - get(resourceGroupName: string, namespaceName: string, hybridConnectionName: string, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; - get(resourceGroupName: string, namespaceName: string, hybridConnectionName: string, options?: msRest.RequestOptionsBase | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { + * @param options The options parameters. + */ + get( + resourceGroupName: string, + namespaceName: string, + hybridConnectionName: string, + options?: HybridConnectionsGetOptionalParams + ): Promise { return this.client.sendOperationRequest( - { - resourceGroupName, - namespaceName, - hybridConnectionName, - options - }, - getOperationSpec, - callback) as Promise; + { resourceGroupName, namespaceName, hybridConnectionName, options }, + getOperationSpec + ); } /** @@ -175,35 +291,18 @@ export class HybridConnections { * @param resourceGroupName Name of the Resource group within the Azure subscription. * @param namespaceName The namespace name * @param hybridConnectionName The hybrid connection name. - * @param [options] The optional parameters - * @returns Promise - */ - listAuthorizationRules(resourceGroupName: string, namespaceName: string, hybridConnectionName: string, options?: msRest.RequestOptionsBase): Promise; - /** - * @param resourceGroupName Name of the Resource group within the Azure subscription. - * @param namespaceName The namespace name - * @param hybridConnectionName The hybrid connection name. - * @param callback The callback - */ - listAuthorizationRules(resourceGroupName: string, namespaceName: string, hybridConnectionName: string, callback: msRest.ServiceCallback): void; - /** - * @param resourceGroupName Name of the Resource group within the Azure subscription. - * @param namespaceName The namespace name - * @param hybridConnectionName The hybrid connection name. - * @param options The optional parameters - * @param callback The callback - */ - listAuthorizationRules(resourceGroupName: string, namespaceName: string, hybridConnectionName: string, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; - listAuthorizationRules(resourceGroupName: string, namespaceName: string, hybridConnectionName: string, options?: msRest.RequestOptionsBase | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { + * @param options The options parameters. + */ + private _listAuthorizationRules( + resourceGroupName: string, + namespaceName: string, + hybridConnectionName: string, + options?: HybridConnectionsListAuthorizationRulesOptionalParams + ): Promise { return this.client.sendOperationRequest( - { - resourceGroupName, - namespaceName, - hybridConnectionName, - options - }, - listAuthorizationRulesOperationSpec, - callback) as Promise; + { resourceGroupName, namespaceName, hybridConnectionName, options }, + listAuthorizationRulesOperationSpec + ); } /** @@ -213,30 +312,16 @@ export class HybridConnections { * @param hybridConnectionName The hybrid connection name. * @param authorizationRuleName The authorization rule name. * @param parameters The authorization rule parameters. - * @param [options] The optional parameters - * @returns Promise - */ - createOrUpdateAuthorizationRule(resourceGroupName: string, namespaceName: string, hybridConnectionName: string, authorizationRuleName: string, parameters: Models.AuthorizationRule, options?: msRest.RequestOptionsBase): Promise; - /** - * @param resourceGroupName Name of the Resource group within the Azure subscription. - * @param namespaceName The namespace name - * @param hybridConnectionName The hybrid connection name. - * @param authorizationRuleName The authorization rule name. - * @param parameters The authorization rule parameters. - * @param callback The callback - */ - createOrUpdateAuthorizationRule(resourceGroupName: string, namespaceName: string, hybridConnectionName: string, authorizationRuleName: string, parameters: Models.AuthorizationRule, callback: msRest.ServiceCallback): void; - /** - * @param resourceGroupName Name of the Resource group within the Azure subscription. - * @param namespaceName The namespace name - * @param hybridConnectionName The hybrid connection name. - * @param authorizationRuleName The authorization rule name. - * @param parameters The authorization rule parameters. - * @param options The optional parameters - * @param callback The callback - */ - createOrUpdateAuthorizationRule(resourceGroupName: string, namespaceName: string, hybridConnectionName: string, authorizationRuleName: string, parameters: Models.AuthorizationRule, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; - createOrUpdateAuthorizationRule(resourceGroupName: string, namespaceName: string, hybridConnectionName: string, authorizationRuleName: string, parameters: Models.AuthorizationRule, options?: msRest.RequestOptionsBase | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { + * @param options The options parameters. + */ + createOrUpdateAuthorizationRule( + resourceGroupName: string, + namespaceName: string, + hybridConnectionName: string, + authorizationRuleName: string, + parameters: AuthorizationRule, + options?: HybridConnectionsCreateOrUpdateAuthorizationRuleOptionalParams + ): Promise { return this.client.sendOperationRequest( { resourceGroupName, @@ -246,8 +331,8 @@ export class HybridConnections { parameters, options }, - createOrUpdateAuthorizationRuleOperationSpec, - callback) as Promise; + createOrUpdateAuthorizationRuleOperationSpec + ); } /** @@ -256,28 +341,15 @@ export class HybridConnections { * @param namespaceName The namespace name * @param hybridConnectionName The hybrid connection name. * @param authorizationRuleName The authorization rule name. - * @param [options] The optional parameters - * @returns Promise - */ - deleteAuthorizationRule(resourceGroupName: string, namespaceName: string, hybridConnectionName: string, authorizationRuleName: string, options?: msRest.RequestOptionsBase): Promise; - /** - * @param resourceGroupName Name of the Resource group within the Azure subscription. - * @param namespaceName The namespace name - * @param hybridConnectionName The hybrid connection name. - * @param authorizationRuleName The authorization rule name. - * @param callback The callback - */ - deleteAuthorizationRule(resourceGroupName: string, namespaceName: string, hybridConnectionName: string, authorizationRuleName: string, callback: msRest.ServiceCallback): void; - /** - * @param resourceGroupName Name of the Resource group within the Azure subscription. - * @param namespaceName The namespace name - * @param hybridConnectionName The hybrid connection name. - * @param authorizationRuleName The authorization rule name. - * @param options The optional parameters - * @param callback The callback - */ - deleteAuthorizationRule(resourceGroupName: string, namespaceName: string, hybridConnectionName: string, authorizationRuleName: string, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; - deleteAuthorizationRule(resourceGroupName: string, namespaceName: string, hybridConnectionName: string, authorizationRuleName: string, options?: msRest.RequestOptionsBase | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { + * @param options The options parameters. + */ + deleteAuthorizationRule( + resourceGroupName: string, + namespaceName: string, + hybridConnectionName: string, + authorizationRuleName: string, + options?: HybridConnectionsDeleteAuthorizationRuleOptionalParams + ): Promise { return this.client.sendOperationRequest( { resourceGroupName, @@ -286,8 +358,8 @@ export class HybridConnections { authorizationRuleName, options }, - deleteAuthorizationRuleOperationSpec, - callback); + deleteAuthorizationRuleOperationSpec + ); } /** @@ -296,28 +368,15 @@ export class HybridConnections { * @param namespaceName The namespace name * @param hybridConnectionName The hybrid connection name. * @param authorizationRuleName The authorization rule name. - * @param [options] The optional parameters - * @returns Promise - */ - getAuthorizationRule(resourceGroupName: string, namespaceName: string, hybridConnectionName: string, authorizationRuleName: string, options?: msRest.RequestOptionsBase): Promise; - /** - * @param resourceGroupName Name of the Resource group within the Azure subscription. - * @param namespaceName The namespace name - * @param hybridConnectionName The hybrid connection name. - * @param authorizationRuleName The authorization rule name. - * @param callback The callback - */ - getAuthorizationRule(resourceGroupName: string, namespaceName: string, hybridConnectionName: string, authorizationRuleName: string, callback: msRest.ServiceCallback): void; - /** - * @param resourceGroupName Name of the Resource group within the Azure subscription. - * @param namespaceName The namespace name - * @param hybridConnectionName The hybrid connection name. - * @param authorizationRuleName The authorization rule name. - * @param options The optional parameters - * @param callback The callback - */ - getAuthorizationRule(resourceGroupName: string, namespaceName: string, hybridConnectionName: string, authorizationRuleName: string, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; - getAuthorizationRule(resourceGroupName: string, namespaceName: string, hybridConnectionName: string, authorizationRuleName: string, options?: msRest.RequestOptionsBase | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { + * @param options The options parameters. + */ + getAuthorizationRule( + resourceGroupName: string, + namespaceName: string, + hybridConnectionName: string, + authorizationRuleName: string, + options?: HybridConnectionsGetAuthorizationRuleOptionalParams + ): Promise { return this.client.sendOperationRequest( { resourceGroupName, @@ -326,8 +385,8 @@ export class HybridConnections { authorizationRuleName, options }, - getAuthorizationRuleOperationSpec, - callback) as Promise; + getAuthorizationRuleOperationSpec + ); } /** @@ -336,28 +395,15 @@ export class HybridConnections { * @param namespaceName The namespace name * @param hybridConnectionName The hybrid connection name. * @param authorizationRuleName The authorization rule name. - * @param [options] The optional parameters - * @returns Promise - */ - listKeys(resourceGroupName: string, namespaceName: string, hybridConnectionName: string, authorizationRuleName: string, options?: msRest.RequestOptionsBase): Promise; - /** - * @param resourceGroupName Name of the Resource group within the Azure subscription. - * @param namespaceName The namespace name - * @param hybridConnectionName The hybrid connection name. - * @param authorizationRuleName The authorization rule name. - * @param callback The callback - */ - listKeys(resourceGroupName: string, namespaceName: string, hybridConnectionName: string, authorizationRuleName: string, callback: msRest.ServiceCallback): void; - /** - * @param resourceGroupName Name of the Resource group within the Azure subscription. - * @param namespaceName The namespace name - * @param hybridConnectionName The hybrid connection name. - * @param authorizationRuleName The authorization rule name. - * @param options The optional parameters - * @param callback The callback - */ - listKeys(resourceGroupName: string, namespaceName: string, hybridConnectionName: string, authorizationRuleName: string, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; - listKeys(resourceGroupName: string, namespaceName: string, hybridConnectionName: string, authorizationRuleName: string, options?: msRest.RequestOptionsBase | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { + * @param options The options parameters. + */ + listKeys( + resourceGroupName: string, + namespaceName: string, + hybridConnectionName: string, + authorizationRuleName: string, + options?: HybridConnectionsListKeysOptionalParams + ): Promise { return this.client.sendOperationRequest( { resourceGroupName, @@ -366,8 +412,8 @@ export class HybridConnections { authorizationRuleName, options }, - listKeysOperationSpec, - callback) as Promise; + listKeysOperationSpec + ); } /** @@ -377,30 +423,16 @@ export class HybridConnections { * @param hybridConnectionName The hybrid connection name. * @param authorizationRuleName The authorization rule name. * @param parameters Parameters supplied to regenerate authorization rule. - * @param [options] The optional parameters - * @returns Promise - */ - regenerateKeys(resourceGroupName: string, namespaceName: string, hybridConnectionName: string, authorizationRuleName: string, parameters: Models.RegenerateAccessKeyParameters, options?: msRest.RequestOptionsBase): Promise; - /** - * @param resourceGroupName Name of the Resource group within the Azure subscription. - * @param namespaceName The namespace name - * @param hybridConnectionName The hybrid connection name. - * @param authorizationRuleName The authorization rule name. - * @param parameters Parameters supplied to regenerate authorization rule. - * @param callback The callback - */ - regenerateKeys(resourceGroupName: string, namespaceName: string, hybridConnectionName: string, authorizationRuleName: string, parameters: Models.RegenerateAccessKeyParameters, callback: msRest.ServiceCallback): void; - /** - * @param resourceGroupName Name of the Resource group within the Azure subscription. - * @param namespaceName The namespace name - * @param hybridConnectionName The hybrid connection name. - * @param authorizationRuleName The authorization rule name. - * @param parameters Parameters supplied to regenerate authorization rule. - * @param options The optional parameters - * @param callback The callback - */ - regenerateKeys(resourceGroupName: string, namespaceName: string, hybridConnectionName: string, authorizationRuleName: string, parameters: Models.RegenerateAccessKeyParameters, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; - regenerateKeys(resourceGroupName: string, namespaceName: string, hybridConnectionName: string, authorizationRuleName: string, parameters: Models.RegenerateAccessKeyParameters, options?: msRest.RequestOptionsBase | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { + * @param options The options parameters. + */ + regenerateKeys( + resourceGroupName: string, + namespaceName: string, + hybridConnectionName: string, + authorizationRuleName: string, + parameters: RegenerateAccessKeyParameters, + options?: HybridConnectionsRegenerateKeysOptionalParams + ): Promise { return this.client.sendOperationRequest( { resourceGroupName, @@ -410,83 +442,63 @@ export class HybridConnections { parameters, options }, - regenerateKeysOperationSpec, - callback) as Promise; + regenerateKeysOperationSpec + ); } /** - * Lists the hybrid connection within the namespace. - * @param nextPageLink The NextLink from the previous successful call to List operation. - * @param [options] The optional parameters - * @returns Promise - */ - listByNamespaceNext(nextPageLink: string, options?: msRest.RequestOptionsBase): Promise; - /** - * @param nextPageLink The NextLink from the previous successful call to List operation. - * @param callback The callback - */ - listByNamespaceNext(nextPageLink: string, callback: msRest.ServiceCallback): void; - /** - * @param nextPageLink The NextLink from the previous successful call to List operation. - * @param options The optional parameters - * @param callback The callback - */ - listByNamespaceNext(nextPageLink: string, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; - listByNamespaceNext(nextPageLink: string, options?: msRest.RequestOptionsBase | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { + * ListByNamespaceNext + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param namespaceName The namespace name + * @param nextLink The nextLink from the previous successful call to the ListByNamespace method. + * @param options The options parameters. + */ + private _listByNamespaceNext( + resourceGroupName: string, + namespaceName: string, + nextLink: string, + options?: HybridConnectionsListByNamespaceNextOptionalParams + ): Promise { return this.client.sendOperationRequest( - { - nextPageLink, - options - }, - listByNamespaceNextOperationSpec, - callback) as Promise; + { resourceGroupName, namespaceName, nextLink, options }, + listByNamespaceNextOperationSpec + ); } /** - * Authorization rules for a hybrid connection. - * @param nextPageLink The NextLink from the previous successful call to List operation. - * @param [options] The optional parameters - * @returns Promise - */ - listAuthorizationRulesNext(nextPageLink: string, options?: msRest.RequestOptionsBase): Promise; - /** - * @param nextPageLink The NextLink from the previous successful call to List operation. - * @param callback The callback - */ - listAuthorizationRulesNext(nextPageLink: string, callback: msRest.ServiceCallback): void; - /** - * @param nextPageLink The NextLink from the previous successful call to List operation. - * @param options The optional parameters - * @param callback The callback - */ - listAuthorizationRulesNext(nextPageLink: string, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; - listAuthorizationRulesNext(nextPageLink: string, options?: msRest.RequestOptionsBase | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { + * ListAuthorizationRulesNext + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param namespaceName The namespace name + * @param hybridConnectionName The hybrid connection name. + * @param nextLink The nextLink from the previous successful call to the ListAuthorizationRules method. + * @param options The options parameters. + */ + private _listAuthorizationRulesNext( + resourceGroupName: string, + namespaceName: string, + hybridConnectionName: string, + nextLink: string, + options?: HybridConnectionsListAuthorizationRulesNextOptionalParams + ): Promise { return this.client.sendOperationRequest( { - nextPageLink, + resourceGroupName, + namespaceName, + hybridConnectionName, + nextLink, options }, - listAuthorizationRulesNextOperationSpec, - callback) as Promise; + listAuthorizationRulesNextOperationSpec + ); } } - // Operation Specifications -const serializer = new msRest.Serializer(Mappers); -const listByNamespaceOperationSpec: msRest.OperationSpec = { +const serializer = coreClient.createSerializer(Mappers, /* isXml */ false); + +const listByNamespaceOperationSpec: coreClient.OperationSpec = { + path: + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Relay/namespaces/{namespaceName}/hybridConnections", httpMethod: "GET", - path: "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Relay/namespaces/{namespaceName}/hybridConnections", - urlParameters: [ - Parameters.resourceGroupName, - Parameters.namespaceName, - Parameters.subscriptionId - ], - queryParameters: [ - Parameters.apiVersion - ], - headerParameters: [ - Parameters.acceptLanguage - ], responses: { 200: { bodyMapper: Mappers.HybridConnectionListResult @@ -495,31 +507,20 @@ const listByNamespaceOperationSpec: msRest.OperationSpec = { bodyMapper: Mappers.ErrorResponse } }, - serializer -}; - -const createOrUpdateOperationSpec: msRest.OperationSpec = { - httpMethod: "PUT", - path: "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Relay/namespaces/{namespaceName}/hybridConnections/{hybridConnectionName}", + queryParameters: [Parameters.apiVersion], urlParameters: [ + Parameters.$host, + Parameters.subscriptionId, Parameters.resourceGroupName, - Parameters.namespaceName, - Parameters.hybridConnectionName, - Parameters.subscriptionId - ], - queryParameters: [ - Parameters.apiVersion - ], - headerParameters: [ - Parameters.acceptLanguage + Parameters.namespaceName ], - requestBody: { - parameterPath: "parameters", - mapper: { - ...Mappers.HybridConnection, - required: true - } - }, + headerParameters: [Parameters.accept], + serializer +}; +const createOrUpdateOperationSpec: coreClient.OperationSpec = { + path: + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Relay/namespaces/{namespaceName}/hybridConnections/{hybridConnectionName}", + httpMethod: "PUT", responses: { 200: { bodyMapper: Mappers.HybridConnection @@ -528,24 +529,23 @@ const createOrUpdateOperationSpec: msRest.OperationSpec = { bodyMapper: Mappers.ErrorResponse } }, - serializer -}; - -const deleteMethodOperationSpec: msRest.OperationSpec = { - httpMethod: "DELETE", - path: "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Relay/namespaces/{namespaceName}/hybridConnections/{hybridConnectionName}", + requestBody: Parameters.parameters5, + queryParameters: [Parameters.apiVersion], urlParameters: [ + Parameters.$host, + Parameters.subscriptionId, Parameters.resourceGroupName, Parameters.namespaceName, - Parameters.hybridConnectionName, - Parameters.subscriptionId - ], - queryParameters: [ - Parameters.apiVersion - ], - headerParameters: [ - Parameters.acceptLanguage + Parameters.hybridConnectionName ], + headerParameters: [Parameters.accept, Parameters.contentType], + mediaType: "json", + serializer +}; +const deleteOperationSpec: coreClient.OperationSpec = { + path: + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Relay/namespaces/{namespaceName}/hybridConnections/{hybridConnectionName}", + httpMethod: "DELETE", responses: { 200: {}, 204: {}, @@ -553,24 +553,21 @@ const deleteMethodOperationSpec: msRest.OperationSpec = { bodyMapper: Mappers.ErrorResponse } }, - serializer -}; - -const getOperationSpec: msRest.OperationSpec = { - httpMethod: "GET", - path: "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Relay/namespaces/{namespaceName}/hybridConnections/{hybridConnectionName}", + queryParameters: [Parameters.apiVersion], urlParameters: [ + Parameters.$host, + Parameters.subscriptionId, Parameters.resourceGroupName, Parameters.namespaceName, - Parameters.hybridConnectionName, - Parameters.subscriptionId - ], - queryParameters: [ - Parameters.apiVersion - ], - headerParameters: [ - Parameters.acceptLanguage + Parameters.hybridConnectionName ], + headerParameters: [Parameters.accept], + serializer +}; +const getOperationSpec: coreClient.OperationSpec = { + path: + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Relay/namespaces/{namespaceName}/hybridConnections/{hybridConnectionName}", + httpMethod: "GET", responses: { 200: { bodyMapper: Mappers.HybridConnection @@ -579,24 +576,21 @@ const getOperationSpec: msRest.OperationSpec = { bodyMapper: Mappers.ErrorResponse } }, - serializer -}; - -const listAuthorizationRulesOperationSpec: msRest.OperationSpec = { - httpMethod: "GET", - path: "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Relay/namespaces/{namespaceName}/hybridConnections/{hybridConnectionName}/authorizationRules", + queryParameters: [Parameters.apiVersion], urlParameters: [ + Parameters.$host, + Parameters.subscriptionId, Parameters.resourceGroupName, Parameters.namespaceName, - Parameters.hybridConnectionName, - Parameters.subscriptionId - ], - queryParameters: [ - Parameters.apiVersion - ], - headerParameters: [ - Parameters.acceptLanguage + Parameters.hybridConnectionName ], + headerParameters: [Parameters.accept], + serializer +}; +const listAuthorizationRulesOperationSpec: coreClient.OperationSpec = { + path: + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Relay/namespaces/{namespaceName}/hybridConnections/{hybridConnectionName}/authorizationRules", + httpMethod: "GET", responses: { 200: { bodyMapper: Mappers.AuthorizationRuleListResult @@ -605,32 +599,21 @@ const listAuthorizationRulesOperationSpec: msRest.OperationSpec = { bodyMapper: Mappers.ErrorResponse } }, - serializer -}; - -const createOrUpdateAuthorizationRuleOperationSpec: msRest.OperationSpec = { - httpMethod: "PUT", - path: "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Relay/namespaces/{namespaceName}/hybridConnections/{hybridConnectionName}/authorizationRules/{authorizationRuleName}", + queryParameters: [Parameters.apiVersion], urlParameters: [ + Parameters.$host, + Parameters.subscriptionId, Parameters.resourceGroupName, Parameters.namespaceName, - Parameters.hybridConnectionName, - Parameters.authorizationRuleName, - Parameters.subscriptionId - ], - queryParameters: [ - Parameters.apiVersion - ], - headerParameters: [ - Parameters.acceptLanguage + Parameters.hybridConnectionName ], - requestBody: { - parameterPath: "parameters", - mapper: { - ...Mappers.AuthorizationRule, - required: true - } - }, + headerParameters: [Parameters.accept], + serializer +}; +const createOrUpdateAuthorizationRuleOperationSpec: coreClient.OperationSpec = { + path: + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Relay/namespaces/{namespaceName}/hybridConnections/{hybridConnectionName}/authorizationRules/{authorizationRuleName}", + httpMethod: "PUT", responses: { 200: { bodyMapper: Mappers.AuthorizationRule @@ -639,25 +622,24 @@ const createOrUpdateAuthorizationRuleOperationSpec: msRest.OperationSpec = { bodyMapper: Mappers.ErrorResponse } }, - serializer -}; - -const deleteAuthorizationRuleOperationSpec: msRest.OperationSpec = { - httpMethod: "DELETE", - path: "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Relay/namespaces/{namespaceName}/hybridConnections/{hybridConnectionName}/authorizationRules/{authorizationRuleName}", + requestBody: Parameters.parameters3, + queryParameters: [Parameters.apiVersion], urlParameters: [ + Parameters.$host, + Parameters.subscriptionId, Parameters.resourceGroupName, Parameters.namespaceName, - Parameters.hybridConnectionName, Parameters.authorizationRuleName, - Parameters.subscriptionId - ], - queryParameters: [ - Parameters.apiVersion - ], - headerParameters: [ - Parameters.acceptLanguage + Parameters.hybridConnectionName ], + headerParameters: [Parameters.accept, Parameters.contentType], + mediaType: "json", + serializer +}; +const deleteAuthorizationRuleOperationSpec: coreClient.OperationSpec = { + path: + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Relay/namespaces/{namespaceName}/hybridConnections/{hybridConnectionName}/authorizationRules/{authorizationRuleName}", + httpMethod: "DELETE", responses: { 200: {}, 204: {}, @@ -665,25 +647,22 @@ const deleteAuthorizationRuleOperationSpec: msRest.OperationSpec = { bodyMapper: Mappers.ErrorResponse } }, - serializer -}; - -const getAuthorizationRuleOperationSpec: msRest.OperationSpec = { - httpMethod: "GET", - path: "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Relay/namespaces/{namespaceName}/hybridConnections/{hybridConnectionName}/authorizationRules/{authorizationRuleName}", + queryParameters: [Parameters.apiVersion], urlParameters: [ + Parameters.$host, + Parameters.subscriptionId, Parameters.resourceGroupName, Parameters.namespaceName, - Parameters.hybridConnectionName, Parameters.authorizationRuleName, - Parameters.subscriptionId - ], - queryParameters: [ - Parameters.apiVersion - ], - headerParameters: [ - Parameters.acceptLanguage + Parameters.hybridConnectionName ], + headerParameters: [Parameters.accept], + serializer +}; +const getAuthorizationRuleOperationSpec: coreClient.OperationSpec = { + path: + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Relay/namespaces/{namespaceName}/hybridConnections/{hybridConnectionName}/authorizationRules/{authorizationRuleName}", + httpMethod: "GET", responses: { 200: { bodyMapper: Mappers.AuthorizationRule @@ -692,25 +671,22 @@ const getAuthorizationRuleOperationSpec: msRest.OperationSpec = { bodyMapper: Mappers.ErrorResponse } }, - serializer -}; - -const listKeysOperationSpec: msRest.OperationSpec = { - httpMethod: "POST", - path: "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Relay/namespaces/{namespaceName}/hybridConnections/{hybridConnectionName}/authorizationRules/{authorizationRuleName}/listKeys", + queryParameters: [Parameters.apiVersion], urlParameters: [ + Parameters.$host, + Parameters.subscriptionId, Parameters.resourceGroupName, Parameters.namespaceName, - Parameters.hybridConnectionName, Parameters.authorizationRuleName, - Parameters.subscriptionId - ], - queryParameters: [ - Parameters.apiVersion - ], - headerParameters: [ - Parameters.acceptLanguage + Parameters.hybridConnectionName ], + headerParameters: [Parameters.accept], + serializer +}; +const listKeysOperationSpec: coreClient.OperationSpec = { + path: + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Relay/namespaces/{namespaceName}/hybridConnections/{hybridConnectionName}/authorizationRules/{authorizationRuleName}/listKeys", + httpMethod: "POST", responses: { 200: { bodyMapper: Mappers.AccessKeys @@ -719,32 +695,22 @@ const listKeysOperationSpec: msRest.OperationSpec = { bodyMapper: Mappers.ErrorResponse } }, - serializer -}; - -const regenerateKeysOperationSpec: msRest.OperationSpec = { - httpMethod: "POST", - path: "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Relay/namespaces/{namespaceName}/hybridConnections/{hybridConnectionName}/authorizationRules/{authorizationRuleName}/regenerateKeys", + queryParameters: [Parameters.apiVersion], urlParameters: [ + Parameters.$host, + Parameters.subscriptionId, Parameters.resourceGroupName, Parameters.namespaceName, - Parameters.hybridConnectionName, Parameters.authorizationRuleName, - Parameters.subscriptionId - ], - queryParameters: [ - Parameters.apiVersion + Parameters.hybridConnectionName ], - headerParameters: [ - Parameters.acceptLanguage - ], - requestBody: { - parameterPath: "parameters", - mapper: { - ...Mappers.RegenerateAccessKeyParameters, - required: true - } - }, + headerParameters: [Parameters.accept], + serializer +}; +const regenerateKeysOperationSpec: coreClient.OperationSpec = { + path: + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Relay/namespaces/{namespaceName}/hybridConnections/{hybridConnectionName}/authorizationRules/{authorizationRuleName}/regenerateKeys", + httpMethod: "POST", responses: { 200: { bodyMapper: Mappers.AccessKeys @@ -753,19 +719,23 @@ const regenerateKeysOperationSpec: msRest.OperationSpec = { bodyMapper: Mappers.ErrorResponse } }, + requestBody: Parameters.parameters4, + queryParameters: [Parameters.apiVersion], + urlParameters: [ + Parameters.$host, + Parameters.subscriptionId, + Parameters.resourceGroupName, + Parameters.namespaceName, + Parameters.authorizationRuleName, + Parameters.hybridConnectionName + ], + headerParameters: [Parameters.accept, Parameters.contentType], + mediaType: "json", serializer }; - -const listByNamespaceNextOperationSpec: msRest.OperationSpec = { - httpMethod: "GET", - baseUrl: "https://management.azure.com", +const listByNamespaceNextOperationSpec: coreClient.OperationSpec = { path: "{nextLink}", - urlParameters: [ - Parameters.nextPageLink - ], - headerParameters: [ - Parameters.acceptLanguage - ], + httpMethod: "GET", responses: { 200: { bodyMapper: Mappers.HybridConnectionListResult @@ -774,19 +744,20 @@ const listByNamespaceNextOperationSpec: msRest.OperationSpec = { bodyMapper: Mappers.ErrorResponse } }, + queryParameters: [Parameters.apiVersion], + urlParameters: [ + Parameters.$host, + Parameters.nextLink, + Parameters.subscriptionId, + Parameters.resourceGroupName, + Parameters.namespaceName + ], + headerParameters: [Parameters.accept], serializer }; - -const listAuthorizationRulesNextOperationSpec: msRest.OperationSpec = { - httpMethod: "GET", - baseUrl: "https://management.azure.com", +const listAuthorizationRulesNextOperationSpec: coreClient.OperationSpec = { path: "{nextLink}", - urlParameters: [ - Parameters.nextPageLink - ], - headerParameters: [ - Parameters.acceptLanguage - ], + httpMethod: "GET", responses: { 200: { bodyMapper: Mappers.AuthorizationRuleListResult @@ -795,5 +766,15 @@ const listAuthorizationRulesNextOperationSpec: msRest.OperationSpec = { bodyMapper: Mappers.ErrorResponse } }, + queryParameters: [Parameters.apiVersion], + urlParameters: [ + Parameters.$host, + Parameters.nextLink, + Parameters.subscriptionId, + Parameters.resourceGroupName, + Parameters.namespaceName, + Parameters.hybridConnectionName + ], + headerParameters: [Parameters.accept], serializer }; diff --git a/sdk/relay/arm-relay/src/operations/index.ts b/sdk/relay/arm-relay/src/operations/index.ts index 86f3a9a87d67..38b7e10a5d1b 100644 --- a/sdk/relay/arm-relay/src/operations/index.ts +++ b/sdk/relay/arm-relay/src/operations/index.ts @@ -1,11 +1,9 @@ /* - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for - * license information. + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. * * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is - * regenerated. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. */ export * from "./operations"; diff --git a/sdk/relay/arm-relay/src/operations/namespaces.ts b/sdk/relay/arm-relay/src/operations/namespaces.ts index e78b187c7db3..88837815eb0d 100644 --- a/sdk/relay/arm-relay/src/operations/namespaces.ts +++ b/sdk/relay/arm-relay/src/operations/namespaces.ts @@ -1,110 +1,274 @@ /* - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for - * license information. + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. * * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is - * regenerated. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. */ -import * as msRest from "@azure/ms-rest-js"; -import * as msRestAzure from "@azure/ms-rest-azure-js"; -import * as Models from "../models"; -import * as Mappers from "../models/namespacesMappers"; +import { PagedAsyncIterableIterator } from "@azure/core-paging"; +import { Namespaces } from "../operationsInterfaces"; +import * as coreClient from "@azure/core-client"; +import * as Mappers from "../models/mappers"; import * as Parameters from "../models/parameters"; -import { RelayManagementClientContext } from "../relayManagementClientContext"; +import { RelayAPI } from "../relayAPI"; +import { PollerLike, PollOperationState, LroEngine } from "@azure/core-lro"; +import { LroImpl } from "../lroImpl"; +import { + RelayNamespace, + NamespacesListNextOptionalParams, + NamespacesListOptionalParams, + NamespacesListByResourceGroupNextOptionalParams, + NamespacesListByResourceGroupOptionalParams, + AuthorizationRule, + NamespacesListAuthorizationRulesNextOptionalParams, + NamespacesListAuthorizationRulesOptionalParams, + CheckNameAvailability, + NamespacesCheckNameAvailabilityOptionalParams, + NamespacesCheckNameAvailabilityResponse, + NamespacesListResponse, + NamespacesListByResourceGroupResponse, + NamespacesCreateOrUpdateOptionalParams, + NamespacesCreateOrUpdateResponse, + NamespacesDeleteOptionalParams, + NamespacesGetOptionalParams, + NamespacesGetResponse, + RelayUpdateParameters, + NamespacesUpdateOptionalParams, + NamespacesUpdateResponse, + NamespacesListAuthorizationRulesResponse, + NamespacesCreateOrUpdateAuthorizationRuleOptionalParams, + NamespacesCreateOrUpdateAuthorizationRuleResponse, + NamespacesDeleteAuthorizationRuleOptionalParams, + NamespacesGetAuthorizationRuleOptionalParams, + NamespacesGetAuthorizationRuleResponse, + NamespacesListKeysOptionalParams, + NamespacesListKeysResponse, + RegenerateAccessKeyParameters, + NamespacesRegenerateKeysOptionalParams, + NamespacesRegenerateKeysResponse, + NamespacesListNextResponse, + NamespacesListByResourceGroupNextResponse, + NamespacesListAuthorizationRulesNextResponse +} from "../models"; -/** Class representing a Namespaces. */ -export class Namespaces { - private readonly client: RelayManagementClientContext; +/// +/** Class containing Namespaces operations. */ +export class NamespacesImpl implements Namespaces { + private readonly client: RelayAPI; /** - * Create a Namespaces. - * @param {RelayManagementClientContext} client Reference to the service client. + * Initialize a new instance of the class Namespaces class. + * @param client Reference to the service client */ - constructor(client: RelayManagementClientContext) { + constructor(client: RelayAPI) { this.client = client; } /** - * Check the specified namespace name availability. - * @param parameters Parameters to check availability of the specified namespace name. - * @param [options] The optional parameters - * @returns Promise - */ - checkNameAvailabilityMethod(parameters: Models.CheckNameAvailability, options?: msRest.RequestOptionsBase): Promise; - /** - * @param parameters Parameters to check availability of the specified namespace name. - * @param callback The callback - */ - checkNameAvailabilityMethod(parameters: Models.CheckNameAvailability, callback: msRest.ServiceCallback): void; - /** - * @param parameters Parameters to check availability of the specified namespace name. - * @param options The optional parameters - * @param callback The callback + * Lists all the available namespaces within the subscription regardless of the resourceGroups. + * @param options The options parameters. */ - checkNameAvailabilityMethod(parameters: Models.CheckNameAvailability, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; - checkNameAvailabilityMethod(parameters: Models.CheckNameAvailability, options?: msRest.RequestOptionsBase | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { - return this.client.sendOperationRequest( - { - parameters, - options + public list( + options?: NamespacesListOptionalParams + ): PagedAsyncIterableIterator { + const iter = this.listPagingAll(options); + return { + next() { + return iter.next(); + }, + [Symbol.asyncIterator]() { + return this; }, - checkNameAvailabilityMethodOperationSpec, - callback) as Promise; + byPage: () => { + return this.listPagingPage(options); + } + }; + } + + private async *listPagingPage( + options?: NamespacesListOptionalParams + ): AsyncIterableIterator { + let result = await this._list(options); + yield result.value || []; + let continuationToken = result.nextLink; + while (continuationToken) { + result = await this._listNext(continuationToken, options); + continuationToken = result.nextLink; + yield result.value || []; + } + } + + private async *listPagingAll( + options?: NamespacesListOptionalParams + ): AsyncIterableIterator { + for await (const page of this.listPagingPage(options)) { + yield* page; + } } /** - * Lists all the available namespaces within the subscription regardless of the resourceGroups. - * @param [options] The optional parameters - * @returns Promise - */ - list(options?: msRest.RequestOptionsBase): Promise; - /** - * @param callback The callback + * Lists all the available namespaces within the ResourceGroup. + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param options The options parameters. */ - list(callback: msRest.ServiceCallback): void; + public listByResourceGroup( + resourceGroupName: string, + options?: NamespacesListByResourceGroupOptionalParams + ): PagedAsyncIterableIterator { + const iter = this.listByResourceGroupPagingAll(resourceGroupName, options); + return { + next() { + return iter.next(); + }, + [Symbol.asyncIterator]() { + return this; + }, + byPage: () => { + return this.listByResourceGroupPagingPage(resourceGroupName, options); + } + }; + } + + private async *listByResourceGroupPagingPage( + resourceGroupName: string, + options?: NamespacesListByResourceGroupOptionalParams + ): AsyncIterableIterator { + let result = await this._listByResourceGroup(resourceGroupName, options); + yield result.value || []; + let continuationToken = result.nextLink; + while (continuationToken) { + result = await this._listByResourceGroupNext( + resourceGroupName, + continuationToken, + options + ); + continuationToken = result.nextLink; + yield result.value || []; + } + } + + private async *listByResourceGroupPagingAll( + resourceGroupName: string, + options?: NamespacesListByResourceGroupOptionalParams + ): AsyncIterableIterator { + for await (const page of this.listByResourceGroupPagingPage( + resourceGroupName, + options + )) { + yield* page; + } + } + /** - * @param options The optional parameters - * @param callback The callback + * Authorization rules for a namespace. + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param namespaceName The namespace name + * @param options The options parameters. */ - list(options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; - list(options?: msRest.RequestOptionsBase | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { - return this.client.sendOperationRequest( - { - options + public listAuthorizationRules( + resourceGroupName: string, + namespaceName: string, + options?: NamespacesListAuthorizationRulesOptionalParams + ): PagedAsyncIterableIterator { + const iter = this.listAuthorizationRulesPagingAll( + resourceGroupName, + namespaceName, + options + ); + return { + next() { + return iter.next(); + }, + [Symbol.asyncIterator]() { + return this; }, - listOperationSpec, - callback) as Promise; + byPage: () => { + return this.listAuthorizationRulesPagingPage( + resourceGroupName, + namespaceName, + options + ); + } + }; + } + + private async *listAuthorizationRulesPagingPage( + resourceGroupName: string, + namespaceName: string, + options?: NamespacesListAuthorizationRulesOptionalParams + ): AsyncIterableIterator { + let result = await this._listAuthorizationRules( + resourceGroupName, + namespaceName, + options + ); + yield result.value || []; + let continuationToken = result.nextLink; + while (continuationToken) { + result = await this._listAuthorizationRulesNext( + resourceGroupName, + namespaceName, + continuationToken, + options + ); + continuationToken = result.nextLink; + yield result.value || []; + } + } + + private async *listAuthorizationRulesPagingAll( + resourceGroupName: string, + namespaceName: string, + options?: NamespacesListAuthorizationRulesOptionalParams + ): AsyncIterableIterator { + for await (const page of this.listAuthorizationRulesPagingPage( + resourceGroupName, + namespaceName, + options + )) { + yield* page; + } } /** - * Lists all the available namespaces within the ResourceGroup. - * @param resourceGroupName Name of the Resource group within the Azure subscription. - * @param [options] The optional parameters - * @returns Promise + * Check the specified namespace name availability. + * @param parameters Parameters to check availability of the specified namespace name. + * @param options The options parameters. */ - listByResourceGroup(resourceGroupName: string, options?: msRest.RequestOptionsBase): Promise; + checkNameAvailability( + parameters: CheckNameAvailability, + options?: NamespacesCheckNameAvailabilityOptionalParams + ): Promise { + return this.client.sendOperationRequest( + { parameters, options }, + checkNameAvailabilityOperationSpec + ); + } + /** - * @param resourceGroupName Name of the Resource group within the Azure subscription. - * @param callback The callback + * Lists all the available namespaces within the subscription regardless of the resourceGroups. + * @param options The options parameters. */ - listByResourceGroup(resourceGroupName: string, callback: msRest.ServiceCallback): void; + private _list( + options?: NamespacesListOptionalParams + ): Promise { + return this.client.sendOperationRequest({ options }, listOperationSpec); + } + /** + * Lists all the available namespaces within the ResourceGroup. * @param resourceGroupName Name of the Resource group within the Azure subscription. - * @param options The optional parameters - * @param callback The callback + * @param options The options parameters. */ - listByResourceGroup(resourceGroupName: string, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; - listByResourceGroup(resourceGroupName: string, options?: msRest.RequestOptionsBase | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { + private _listByResourceGroup( + resourceGroupName: string, + options?: NamespacesListByResourceGroupOptionalParams + ): Promise { return this.client.sendOperationRequest( - { - resourceGroupName, - options - }, - listByResourceGroupOperationSpec, - callback) as Promise; + { resourceGroupName, options }, + listByResourceGroupOperationSpec + ); } /** @@ -112,126 +276,225 @@ export class Namespaces { * @param resourceGroupName Name of the Resource group within the Azure subscription. * @param namespaceName The namespace name * @param parameters Parameters supplied to create a namespace resource. - * @param [options] The optional parameters - * @returns Promise + * @param options The options parameters. */ - createOrUpdate(resourceGroupName: string, namespaceName: string, parameters: Models.RelayNamespace, options?: msRest.RequestOptionsBase): Promise { - return this.beginCreateOrUpdate(resourceGroupName,namespaceName,parameters,options) - .then(lroPoller => lroPoller.pollUntilFinished()) as Promise; + async beginCreateOrUpdate( + resourceGroupName: string, + namespaceName: string, + parameters: RelayNamespace, + options?: NamespacesCreateOrUpdateOptionalParams + ): Promise< + PollerLike< + PollOperationState, + NamespacesCreateOrUpdateResponse + > + > { + const directSendOperation = async ( + args: coreClient.OperationArguments, + spec: coreClient.OperationSpec + ): Promise => { + return this.client.sendOperationRequest(args, spec); + }; + const sendOperation = async ( + args: coreClient.OperationArguments, + spec: coreClient.OperationSpec + ) => { + let currentRawResponse: + | coreClient.FullOperationResponse + | undefined = undefined; + const providedCallback = args.options?.onResponse; + const callback: coreClient.RawResponseCallback = ( + rawResponse: coreClient.FullOperationResponse, + flatResponse: unknown + ) => { + currentRawResponse = rawResponse; + providedCallback?.(rawResponse, flatResponse); + }; + const updatedArgs = { + ...args, + options: { + ...args.options, + onResponse: callback + } + }; + const flatResponse = await directSendOperation(updatedArgs, spec); + return { + flatResponse, + rawResponse: { + statusCode: currentRawResponse!.status, + body: currentRawResponse!.parsedBody, + headers: currentRawResponse!.headers.toJSON() + } + }; + }; + + const lro = new LroImpl( + sendOperation, + { resourceGroupName, namespaceName, parameters, options }, + createOrUpdateOperationSpec + ); + return new LroEngine(lro, { + resumeFrom: options?.resumeFrom, + intervalInMs: options?.updateIntervalInMs + }); } /** - * Deletes an existing namespace. This operation also removes all associated resources under the - * namespace. + * Create Azure Relay namespace. * @param resourceGroupName Name of the Resource group within the Azure subscription. * @param namespaceName The namespace name - * @param [options] The optional parameters - * @returns Promise + * @param parameters Parameters supplied to create a namespace resource. + * @param options The options parameters. */ - deleteMethod(resourceGroupName: string, namespaceName: string, options?: msRest.RequestOptionsBase): Promise { - return this.beginDeleteMethod(resourceGroupName,namespaceName,options) - .then(lroPoller => lroPoller.pollUntilFinished()); + async beginCreateOrUpdateAndWait( + resourceGroupName: string, + namespaceName: string, + parameters: RelayNamespace, + options?: NamespacesCreateOrUpdateOptionalParams + ): Promise { + const poller = await this.beginCreateOrUpdate( + resourceGroupName, + namespaceName, + parameters, + options + ); + return poller.pollUntilDone(); } /** - * Returns the description for the specified namespace. + * Deletes an existing namespace. This operation also removes all associated resources under the + * namespace. * @param resourceGroupName Name of the Resource group within the Azure subscription. * @param namespaceName The namespace name - * @param [options] The optional parameters - * @returns Promise + * @param options The options parameters. */ - get(resourceGroupName: string, namespaceName: string, options?: msRest.RequestOptionsBase): Promise; + async beginDelete( + resourceGroupName: string, + namespaceName: string, + options?: NamespacesDeleteOptionalParams + ): Promise, void>> { + const directSendOperation = async ( + args: coreClient.OperationArguments, + spec: coreClient.OperationSpec + ): Promise => { + return this.client.sendOperationRequest(args, spec); + }; + const sendOperation = async ( + args: coreClient.OperationArguments, + spec: coreClient.OperationSpec + ) => { + let currentRawResponse: + | coreClient.FullOperationResponse + | undefined = undefined; + const providedCallback = args.options?.onResponse; + const callback: coreClient.RawResponseCallback = ( + rawResponse: coreClient.FullOperationResponse, + flatResponse: unknown + ) => { + currentRawResponse = rawResponse; + providedCallback?.(rawResponse, flatResponse); + }; + const updatedArgs = { + ...args, + options: { + ...args.options, + onResponse: callback + } + }; + const flatResponse = await directSendOperation(updatedArgs, spec); + return { + flatResponse, + rawResponse: { + statusCode: currentRawResponse!.status, + body: currentRawResponse!.parsedBody, + headers: currentRawResponse!.headers.toJSON() + } + }; + }; + + const lro = new LroImpl( + sendOperation, + { resourceGroupName, namespaceName, options }, + deleteOperationSpec + ); + return new LroEngine(lro, { + resumeFrom: options?.resumeFrom, + intervalInMs: options?.updateIntervalInMs + }); + } + /** + * Deletes an existing namespace. This operation also removes all associated resources under the + * namespace. * @param resourceGroupName Name of the Resource group within the Azure subscription. * @param namespaceName The namespace name - * @param callback The callback + * @param options The options parameters. */ - get(resourceGroupName: string, namespaceName: string, callback: msRest.ServiceCallback): void; + async beginDeleteAndWait( + resourceGroupName: string, + namespaceName: string, + options?: NamespacesDeleteOptionalParams + ): Promise { + const poller = await this.beginDelete( + resourceGroupName, + namespaceName, + options + ); + return poller.pollUntilDone(); + } + /** + * Returns the description for the specified namespace. * @param resourceGroupName Name of the Resource group within the Azure subscription. * @param namespaceName The namespace name - * @param options The optional parameters - * @param callback The callback + * @param options The options parameters. */ - get(resourceGroupName: string, namespaceName: string, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; - get(resourceGroupName: string, namespaceName: string, options?: msRest.RequestOptionsBase | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { + get( + resourceGroupName: string, + namespaceName: string, + options?: NamespacesGetOptionalParams + ): Promise { return this.client.sendOperationRequest( - { - resourceGroupName, - namespaceName, - options - }, - getOperationSpec, - callback) as Promise; + { resourceGroupName, namespaceName, options }, + getOperationSpec + ); } /** - * Creates or updates a namespace. Once created, this namespace's resource manifest is immutable. - * This operation is idempotent. - * @param resourceGroupName Name of the Resource group within the Azure subscription. - * @param namespaceName The namespace name - * @param parameters Parameters for updating a namespace resource. - * @param [options] The optional parameters - * @returns Promise - */ - update(resourceGroupName: string, namespaceName: string, parameters: Models.RelayUpdateParameters, options?: msRest.RequestOptionsBase): Promise; - /** - * @param resourceGroupName Name of the Resource group within the Azure subscription. - * @param namespaceName The namespace name - * @param parameters Parameters for updating a namespace resource. - * @param callback The callback - */ - update(resourceGroupName: string, namespaceName: string, parameters: Models.RelayUpdateParameters, callback: msRest.ServiceCallback): void; - /** + * Creates or updates a namespace. Once created, this namespace's resource manifest is immutable. This + * operation is idempotent. * @param resourceGroupName Name of the Resource group within the Azure subscription. * @param namespaceName The namespace name * @param parameters Parameters for updating a namespace resource. - * @param options The optional parameters - * @param callback The callback + * @param options The options parameters. */ - update(resourceGroupName: string, namespaceName: string, parameters: Models.RelayUpdateParameters, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; - update(resourceGroupName: string, namespaceName: string, parameters: Models.RelayUpdateParameters, options?: msRest.RequestOptionsBase | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { + update( + resourceGroupName: string, + namespaceName: string, + parameters: RelayUpdateParameters, + options?: NamespacesUpdateOptionalParams + ): Promise { return this.client.sendOperationRequest( - { - resourceGroupName, - namespaceName, - parameters, - options - }, - updateOperationSpec, - callback) as Promise; + { resourceGroupName, namespaceName, parameters, options }, + updateOperationSpec + ); } /** * Authorization rules for a namespace. * @param resourceGroupName Name of the Resource group within the Azure subscription. * @param namespaceName The namespace name - * @param [options] The optional parameters - * @returns Promise + * @param options The options parameters. */ - listAuthorizationRules(resourceGroupName: string, namespaceName: string, options?: msRest.RequestOptionsBase): Promise; - /** - * @param resourceGroupName Name of the Resource group within the Azure subscription. - * @param namespaceName The namespace name - * @param callback The callback - */ - listAuthorizationRules(resourceGroupName: string, namespaceName: string, callback: msRest.ServiceCallback): void; - /** - * @param resourceGroupName Name of the Resource group within the Azure subscription. - * @param namespaceName The namespace name - * @param options The optional parameters - * @param callback The callback - */ - listAuthorizationRules(resourceGroupName: string, namespaceName: string, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; - listAuthorizationRules(resourceGroupName: string, namespaceName: string, options?: msRest.RequestOptionsBase | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { + private _listAuthorizationRules( + resourceGroupName: string, + namespaceName: string, + options?: NamespacesListAuthorizationRulesOptionalParams + ): Promise { return this.client.sendOperationRequest( - { - resourceGroupName, - namespaceName, - options - }, - listAuthorizationRulesOperationSpec, - callback) as Promise; + { resourceGroupName, namespaceName, options }, + listAuthorizationRulesOperationSpec + ); } /** @@ -240,28 +503,15 @@ export class Namespaces { * @param namespaceName The namespace name * @param authorizationRuleName The authorization rule name. * @param parameters The authorization rule parameters. - * @param [options] The optional parameters - * @returns Promise - */ - createOrUpdateAuthorizationRule(resourceGroupName: string, namespaceName: string, authorizationRuleName: string, parameters: Models.AuthorizationRule, options?: msRest.RequestOptionsBase): Promise; - /** - * @param resourceGroupName Name of the Resource group within the Azure subscription. - * @param namespaceName The namespace name - * @param authorizationRuleName The authorization rule name. - * @param parameters The authorization rule parameters. - * @param callback The callback - */ - createOrUpdateAuthorizationRule(resourceGroupName: string, namespaceName: string, authorizationRuleName: string, parameters: Models.AuthorizationRule, callback: msRest.ServiceCallback): void; - /** - * @param resourceGroupName Name of the Resource group within the Azure subscription. - * @param namespaceName The namespace name - * @param authorizationRuleName The authorization rule name. - * @param parameters The authorization rule parameters. - * @param options The optional parameters - * @param callback The callback + * @param options The options parameters. */ - createOrUpdateAuthorizationRule(resourceGroupName: string, namespaceName: string, authorizationRuleName: string, parameters: Models.AuthorizationRule, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; - createOrUpdateAuthorizationRule(resourceGroupName: string, namespaceName: string, authorizationRuleName: string, parameters: Models.AuthorizationRule, options?: msRest.RequestOptionsBase | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { + createOrUpdateAuthorizationRule( + resourceGroupName: string, + namespaceName: string, + authorizationRuleName: string, + parameters: AuthorizationRule, + options?: NamespacesCreateOrUpdateAuthorizationRuleOptionalParams + ): Promise { return this.client.sendOperationRequest( { resourceGroupName, @@ -270,8 +520,8 @@ export class Namespaces { parameters, options }, - createOrUpdateAuthorizationRuleOperationSpec, - callback) as Promise; + createOrUpdateAuthorizationRuleOperationSpec + ); } /** @@ -279,35 +529,18 @@ export class Namespaces { * @param resourceGroupName Name of the Resource group within the Azure subscription. * @param namespaceName The namespace name * @param authorizationRuleName The authorization rule name. - * @param [options] The optional parameters - * @returns Promise - */ - deleteAuthorizationRule(resourceGroupName: string, namespaceName: string, authorizationRuleName: string, options?: msRest.RequestOptionsBase): Promise; - /** - * @param resourceGroupName Name of the Resource group within the Azure subscription. - * @param namespaceName The namespace name - * @param authorizationRuleName The authorization rule name. - * @param callback The callback - */ - deleteAuthorizationRule(resourceGroupName: string, namespaceName: string, authorizationRuleName: string, callback: msRest.ServiceCallback): void; - /** - * @param resourceGroupName Name of the Resource group within the Azure subscription. - * @param namespaceName The namespace name - * @param authorizationRuleName The authorization rule name. - * @param options The optional parameters - * @param callback The callback + * @param options The options parameters. */ - deleteAuthorizationRule(resourceGroupName: string, namespaceName: string, authorizationRuleName: string, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; - deleteAuthorizationRule(resourceGroupName: string, namespaceName: string, authorizationRuleName: string, options?: msRest.RequestOptionsBase | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { + deleteAuthorizationRule( + resourceGroupName: string, + namespaceName: string, + authorizationRuleName: string, + options?: NamespacesDeleteAuthorizationRuleOptionalParams + ): Promise { return this.client.sendOperationRequest( - { - resourceGroupName, - namespaceName, - authorizationRuleName, - options - }, - deleteAuthorizationRuleOperationSpec, - callback); + { resourceGroupName, namespaceName, authorizationRuleName, options }, + deleteAuthorizationRuleOperationSpec + ); } /** @@ -315,35 +548,18 @@ export class Namespaces { * @param resourceGroupName Name of the Resource group within the Azure subscription. * @param namespaceName The namespace name * @param authorizationRuleName The authorization rule name. - * @param [options] The optional parameters - * @returns Promise - */ - getAuthorizationRule(resourceGroupName: string, namespaceName: string, authorizationRuleName: string, options?: msRest.RequestOptionsBase): Promise; - /** - * @param resourceGroupName Name of the Resource group within the Azure subscription. - * @param namespaceName The namespace name - * @param authorizationRuleName The authorization rule name. - * @param callback The callback - */ - getAuthorizationRule(resourceGroupName: string, namespaceName: string, authorizationRuleName: string, callback: msRest.ServiceCallback): void; - /** - * @param resourceGroupName Name of the Resource group within the Azure subscription. - * @param namespaceName The namespace name - * @param authorizationRuleName The authorization rule name. - * @param options The optional parameters - * @param callback The callback + * @param options The options parameters. */ - getAuthorizationRule(resourceGroupName: string, namespaceName: string, authorizationRuleName: string, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; - getAuthorizationRule(resourceGroupName: string, namespaceName: string, authorizationRuleName: string, options?: msRest.RequestOptionsBase | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { + getAuthorizationRule( + resourceGroupName: string, + namespaceName: string, + authorizationRuleName: string, + options?: NamespacesGetAuthorizationRuleOptionalParams + ): Promise { return this.client.sendOperationRequest( - { - resourceGroupName, - namespaceName, - authorizationRuleName, - options - }, - getAuthorizationRuleOperationSpec, - callback) as Promise; + { resourceGroupName, namespaceName, authorizationRuleName, options }, + getAuthorizationRuleOperationSpec + ); } /** @@ -351,35 +567,18 @@ export class Namespaces { * @param resourceGroupName Name of the Resource group within the Azure subscription. * @param namespaceName The namespace name * @param authorizationRuleName The authorization rule name. - * @param [options] The optional parameters - * @returns Promise - */ - listKeys(resourceGroupName: string, namespaceName: string, authorizationRuleName: string, options?: msRest.RequestOptionsBase): Promise; - /** - * @param resourceGroupName Name of the Resource group within the Azure subscription. - * @param namespaceName The namespace name - * @param authorizationRuleName The authorization rule name. - * @param callback The callback + * @param options The options parameters. */ - listKeys(resourceGroupName: string, namespaceName: string, authorizationRuleName: string, callback: msRest.ServiceCallback): void; - /** - * @param resourceGroupName Name of the Resource group within the Azure subscription. - * @param namespaceName The namespace name - * @param authorizationRuleName The authorization rule name. - * @param options The optional parameters - * @param callback The callback - */ - listKeys(resourceGroupName: string, namespaceName: string, authorizationRuleName: string, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; - listKeys(resourceGroupName: string, namespaceName: string, authorizationRuleName: string, options?: msRest.RequestOptionsBase | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { + listKeys( + resourceGroupName: string, + namespaceName: string, + authorizationRuleName: string, + options?: NamespacesListKeysOptionalParams + ): Promise { return this.client.sendOperationRequest( - { - resourceGroupName, - namespaceName, - authorizationRuleName, - options - }, - listKeysOperationSpec, - callback) as Promise; + { resourceGroupName, namespaceName, authorizationRuleName, options }, + listKeysOperationSpec + ); } /** @@ -388,28 +587,15 @@ export class Namespaces { * @param namespaceName The namespace name * @param authorizationRuleName The authorization rule name. * @param parameters Parameters supplied to regenerate authorization rule. - * @param [options] The optional parameters - * @returns Promise - */ - regenerateKeys(resourceGroupName: string, namespaceName: string, authorizationRuleName: string, parameters: Models.RegenerateAccessKeyParameters, options?: msRest.RequestOptionsBase): Promise; - /** - * @param resourceGroupName Name of the Resource group within the Azure subscription. - * @param namespaceName The namespace name - * @param authorizationRuleName The authorization rule name. - * @param parameters Parameters supplied to regenerate authorization rule. - * @param callback The callback - */ - regenerateKeys(resourceGroupName: string, namespaceName: string, authorizationRuleName: string, parameters: Models.RegenerateAccessKeyParameters, callback: msRest.ServiceCallback): void; - /** - * @param resourceGroupName Name of the Resource group within the Azure subscription. - * @param namespaceName The namespace name - * @param authorizationRuleName The authorization rule name. - * @param parameters Parameters supplied to regenerate authorization rule. - * @param options The optional parameters - * @param callback The callback + * @param options The options parameters. */ - regenerateKeys(resourceGroupName: string, namespaceName: string, authorizationRuleName: string, parameters: Models.RegenerateAccessKeyParameters, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; - regenerateKeys(resourceGroupName: string, namespaceName: string, authorizationRuleName: string, parameters: Models.RegenerateAccessKeyParameters, options?: msRest.RequestOptionsBase | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { + regenerateKeys( + resourceGroupName: string, + namespaceName: string, + authorizationRuleName: string, + parameters: RegenerateAccessKeyParameters, + options?: NamespacesRegenerateKeysOptionalParams + ): Promise { return this.client.sendOperationRequest( { resourceGroupName, @@ -418,155 +604,68 @@ export class Namespaces { parameters, options }, - regenerateKeysOperationSpec, - callback) as Promise; + regenerateKeysOperationSpec + ); } /** - * Create Azure Relay namespace. - * @param resourceGroupName Name of the Resource group within the Azure subscription. - * @param namespaceName The namespace name - * @param parameters Parameters supplied to create a namespace resource. - * @param [options] The optional parameters - * @returns Promise - */ - beginCreateOrUpdate(resourceGroupName: string, namespaceName: string, parameters: Models.RelayNamespace, options?: msRest.RequestOptionsBase): Promise { - return this.client.sendLRORequest( - { - resourceGroupName, - namespaceName, - parameters, - options - }, - beginCreateOrUpdateOperationSpec, - options); - } - - /** - * Deletes an existing namespace. This operation also removes all associated resources under the - * namespace. - * @param resourceGroupName Name of the Resource group within the Azure subscription. - * @param namespaceName The namespace name - * @param [options] The optional parameters - * @returns Promise - */ - beginDeleteMethod(resourceGroupName: string, namespaceName: string, options?: msRest.RequestOptionsBase): Promise { - return this.client.sendLRORequest( - { - resourceGroupName, - namespaceName, - options - }, - beginDeleteMethodOperationSpec, - options); - } - - /** - * Lists all the available namespaces within the subscription regardless of the resourceGroups. - * @param nextPageLink The NextLink from the previous successful call to List operation. - * @param [options] The optional parameters - * @returns Promise - */ - listNext(nextPageLink: string, options?: msRest.RequestOptionsBase): Promise; - /** - * @param nextPageLink The NextLink from the previous successful call to List operation. - * @param callback The callback - */ - listNext(nextPageLink: string, callback: msRest.ServiceCallback): void; - /** - * @param nextPageLink The NextLink from the previous successful call to List operation. - * @param options The optional parameters - * @param callback The callback + * ListNext + * @param nextLink The nextLink from the previous successful call to the List method. + * @param options The options parameters. */ - listNext(nextPageLink: string, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; - listNext(nextPageLink: string, options?: msRest.RequestOptionsBase | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { + private _listNext( + nextLink: string, + options?: NamespacesListNextOptionalParams + ): Promise { return this.client.sendOperationRequest( - { - nextPageLink, - options - }, - listNextOperationSpec, - callback) as Promise; + { nextLink, options }, + listNextOperationSpec + ); } /** - * Lists all the available namespaces within the ResourceGroup. - * @param nextPageLink The NextLink from the previous successful call to List operation. - * @param [options] The optional parameters - * @returns Promise - */ - listByResourceGroupNext(nextPageLink: string, options?: msRest.RequestOptionsBase): Promise; - /** - * @param nextPageLink The NextLink from the previous successful call to List operation. - * @param callback The callback - */ - listByResourceGroupNext(nextPageLink: string, callback: msRest.ServiceCallback): void; - /** - * @param nextPageLink The NextLink from the previous successful call to List operation. - * @param options The optional parameters - * @param callback The callback + * ListByResourceGroupNext + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param nextLink The nextLink from the previous successful call to the ListByResourceGroup method. + * @param options The options parameters. */ - listByResourceGroupNext(nextPageLink: string, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; - listByResourceGroupNext(nextPageLink: string, options?: msRest.RequestOptionsBase | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { + private _listByResourceGroupNext( + resourceGroupName: string, + nextLink: string, + options?: NamespacesListByResourceGroupNextOptionalParams + ): Promise { return this.client.sendOperationRequest( - { - nextPageLink, - options - }, - listByResourceGroupNextOperationSpec, - callback) as Promise; + { resourceGroupName, nextLink, options }, + listByResourceGroupNextOperationSpec + ); } /** - * Authorization rules for a namespace. - * @param nextPageLink The NextLink from the previous successful call to List operation. - * @param [options] The optional parameters - * @returns Promise - */ - listAuthorizationRulesNext(nextPageLink: string, options?: msRest.RequestOptionsBase): Promise; - /** - * @param nextPageLink The NextLink from the previous successful call to List operation. - * @param callback The callback - */ - listAuthorizationRulesNext(nextPageLink: string, callback: msRest.ServiceCallback): void; - /** - * @param nextPageLink The NextLink from the previous successful call to List operation. - * @param options The optional parameters - * @param callback The callback + * ListAuthorizationRulesNext + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param namespaceName The namespace name + * @param nextLink The nextLink from the previous successful call to the ListAuthorizationRules method. + * @param options The options parameters. */ - listAuthorizationRulesNext(nextPageLink: string, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; - listAuthorizationRulesNext(nextPageLink: string, options?: msRest.RequestOptionsBase | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { + private _listAuthorizationRulesNext( + resourceGroupName: string, + namespaceName: string, + nextLink: string, + options?: NamespacesListAuthorizationRulesNextOptionalParams + ): Promise { return this.client.sendOperationRequest( - { - nextPageLink, - options - }, - listAuthorizationRulesNextOperationSpec, - callback) as Promise; + { resourceGroupName, namespaceName, nextLink, options }, + listAuthorizationRulesNextOperationSpec + ); } } - // Operation Specifications -const serializer = new msRest.Serializer(Mappers); -const checkNameAvailabilityMethodOperationSpec: msRest.OperationSpec = { +const serializer = coreClient.createSerializer(Mappers, /* isXml */ false); + +const checkNameAvailabilityOperationSpec: coreClient.OperationSpec = { + path: + "/subscriptions/{subscriptionId}/providers/Microsoft.Relay/checkNameAvailability", httpMethod: "POST", - path: "subscriptions/{subscriptionId}/providers/Microsoft.Relay/checkNameAvailability", - urlParameters: [ - Parameters.subscriptionId - ], - queryParameters: [ - Parameters.apiVersion - ], - headerParameters: [ - Parameters.acceptLanguage - ], - requestBody: { - parameterPath: "parameters", - mapper: { - ...Mappers.CheckNameAvailability, - required: true - } - }, responses: { 200: { bodyMapper: Mappers.CheckNameAvailabilityResult @@ -575,21 +674,16 @@ const checkNameAvailabilityMethodOperationSpec: msRest.OperationSpec = { bodyMapper: Mappers.ErrorResponse } }, + requestBody: Parameters.parameters, + queryParameters: [Parameters.apiVersion], + urlParameters: [Parameters.$host, Parameters.subscriptionId], + headerParameters: [Parameters.accept, Parameters.contentType], + mediaType: "json", serializer }; - -const listOperationSpec: msRest.OperationSpec = { +const listOperationSpec: coreClient.OperationSpec = { + path: "/subscriptions/{subscriptionId}/providers/Microsoft.Relay/namespaces", httpMethod: "GET", - path: "subscriptions/{subscriptionId}/providers/Microsoft.Relay/namespaces", - urlParameters: [ - Parameters.subscriptionId - ], - queryParameters: [ - Parameters.apiVersion - ], - headerParameters: [ - Parameters.acceptLanguage - ], responses: { 200: { bodyMapper: Mappers.RelayNamespaceListResult @@ -598,22 +692,15 @@ const listOperationSpec: msRest.OperationSpec = { bodyMapper: Mappers.ErrorResponse } }, + queryParameters: [Parameters.apiVersion], + urlParameters: [Parameters.$host, Parameters.subscriptionId], + headerParameters: [Parameters.accept], serializer }; - -const listByResourceGroupOperationSpec: msRest.OperationSpec = { +const listByResourceGroupOperationSpec: coreClient.OperationSpec = { + path: + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Relay/namespaces", httpMethod: "GET", - path: "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Relay/namespaces", - urlParameters: [ - Parameters.resourceGroupName, - Parameters.subscriptionId - ], - queryParameters: [ - Parameters.apiVersion - ], - headerParameters: [ - Parameters.acceptLanguage - ], responses: { 200: { bodyMapper: Mappers.RelayNamespaceListResult @@ -622,55 +709,97 @@ const listByResourceGroupOperationSpec: msRest.OperationSpec = { bodyMapper: Mappers.ErrorResponse } }, - serializer -}; - -const getOperationSpec: msRest.OperationSpec = { - httpMethod: "GET", - path: "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Relay/namespaces/{namespaceName}", + queryParameters: [Parameters.apiVersion], urlParameters: [ - Parameters.resourceGroupName, - Parameters.namespaceName, - Parameters.subscriptionId - ], - queryParameters: [ - Parameters.apiVersion - ], - headerParameters: [ - Parameters.acceptLanguage + Parameters.$host, + Parameters.subscriptionId, + Parameters.resourceGroupName ], + headerParameters: [Parameters.accept], + serializer +}; +const createOrUpdateOperationSpec: coreClient.OperationSpec = { + path: + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Relay/namespaces/{namespaceName}", + httpMethod: "PUT", responses: { 200: { bodyMapper: Mappers.RelayNamespace }, + 201: { + bodyMapper: Mappers.RelayNamespace + }, + 202: { + bodyMapper: Mappers.RelayNamespace + }, + 204: { + bodyMapper: Mappers.RelayNamespace + }, default: { bodyMapper: Mappers.ErrorResponse } }, + requestBody: Parameters.parameters1, + queryParameters: [Parameters.apiVersion], + urlParameters: [ + Parameters.$host, + Parameters.subscriptionId, + Parameters.resourceGroupName, + Parameters.namespaceName + ], + headerParameters: [Parameters.accept, Parameters.contentType], + mediaType: "json", serializer }; - -const updateOperationSpec: msRest.OperationSpec = { - httpMethod: "PATCH", - path: "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Relay/namespaces/{namespaceName}", +const deleteOperationSpec: coreClient.OperationSpec = { + path: + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Relay/namespaces/{namespaceName}", + httpMethod: "DELETE", + responses: { + 200: {}, + 201: {}, + 202: {}, + 204: {}, + default: { + bodyMapper: Mappers.ErrorResponse + } + }, + queryParameters: [Parameters.apiVersion], urlParameters: [ + Parameters.$host, + Parameters.subscriptionId, Parameters.resourceGroupName, - Parameters.namespaceName, - Parameters.subscriptionId - ], - queryParameters: [ - Parameters.apiVersion - ], - headerParameters: [ - Parameters.acceptLanguage + Parameters.namespaceName ], - requestBody: { - parameterPath: "parameters", - mapper: { - ...Mappers.RelayUpdateParameters, - required: true + headerParameters: [Parameters.accept], + serializer +}; +const getOperationSpec: coreClient.OperationSpec = { + path: + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Relay/namespaces/{namespaceName}", + httpMethod: "GET", + responses: { + 200: { + bodyMapper: Mappers.RelayNamespace + }, + default: { + bodyMapper: Mappers.ErrorResponse } }, + queryParameters: [Parameters.apiVersion], + urlParameters: [ + Parameters.$host, + Parameters.subscriptionId, + Parameters.resourceGroupName, + Parameters.namespaceName + ], + headerParameters: [Parameters.accept], + serializer +}; +const updateOperationSpec: coreClient.OperationSpec = { + path: + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Relay/namespaces/{namespaceName}", + httpMethod: "PATCH", responses: { 200: { bodyMapper: Mappers.RelayNamespace @@ -682,23 +811,22 @@ const updateOperationSpec: msRest.OperationSpec = { bodyMapper: Mappers.ErrorResponse } }, - serializer -}; - -const listAuthorizationRulesOperationSpec: msRest.OperationSpec = { - httpMethod: "GET", - path: "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Relay/namespaces/{namespaceName}/authorizationRules", + requestBody: Parameters.parameters2, + queryParameters: [Parameters.apiVersion], urlParameters: [ + Parameters.$host, + Parameters.subscriptionId, Parameters.resourceGroupName, - Parameters.namespaceName, - Parameters.subscriptionId - ], - queryParameters: [ - Parameters.apiVersion - ], - headerParameters: [ - Parameters.acceptLanguage + Parameters.namespaceName ], + headerParameters: [Parameters.accept, Parameters.contentType], + mediaType: "json", + serializer +}; +const listAuthorizationRulesOperationSpec: coreClient.OperationSpec = { + path: + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Relay/namespaces/{namespaceName}/authorizationRules", + httpMethod: "GET", responses: { 200: { bodyMapper: Mappers.AuthorizationRuleListResult @@ -707,31 +835,20 @@ const listAuthorizationRulesOperationSpec: msRest.OperationSpec = { bodyMapper: Mappers.ErrorResponse } }, - serializer -}; - -const createOrUpdateAuthorizationRuleOperationSpec: msRest.OperationSpec = { - httpMethod: "PUT", - path: "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Relay/namespaces/{namespaceName}/authorizationRules/{authorizationRuleName}", + queryParameters: [Parameters.apiVersion], urlParameters: [ + Parameters.$host, + Parameters.subscriptionId, Parameters.resourceGroupName, - Parameters.namespaceName, - Parameters.authorizationRuleName, - Parameters.subscriptionId - ], - queryParameters: [ - Parameters.apiVersion + Parameters.namespaceName ], - headerParameters: [ - Parameters.acceptLanguage - ], - requestBody: { - parameterPath: "parameters", - mapper: { - ...Mappers.AuthorizationRule, - required: true - } - }, + headerParameters: [Parameters.accept], + serializer +}; +const createOrUpdateAuthorizationRuleOperationSpec: coreClient.OperationSpec = { + path: + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Relay/namespaces/{namespaceName}/authorizationRules/{authorizationRuleName}", + httpMethod: "PUT", responses: { 200: { bodyMapper: Mappers.AuthorizationRule @@ -740,24 +857,23 @@ const createOrUpdateAuthorizationRuleOperationSpec: msRest.OperationSpec = { bodyMapper: Mappers.ErrorResponse } }, - serializer -}; - -const deleteAuthorizationRuleOperationSpec: msRest.OperationSpec = { - httpMethod: "DELETE", - path: "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Relay/namespaces/{namespaceName}/authorizationRules/{authorizationRuleName}", + requestBody: Parameters.parameters3, + queryParameters: [Parameters.apiVersion], urlParameters: [ + Parameters.$host, + Parameters.subscriptionId, Parameters.resourceGroupName, Parameters.namespaceName, - Parameters.authorizationRuleName, - Parameters.subscriptionId - ], - queryParameters: [ - Parameters.apiVersion - ], - headerParameters: [ - Parameters.acceptLanguage + Parameters.authorizationRuleName ], + headerParameters: [Parameters.accept, Parameters.contentType], + mediaType: "json", + serializer +}; +const deleteAuthorizationRuleOperationSpec: coreClient.OperationSpec = { + path: + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Relay/namespaces/{namespaceName}/authorizationRules/{authorizationRuleName}", + httpMethod: "DELETE", responses: { 200: {}, 204: {}, @@ -765,24 +881,21 @@ const deleteAuthorizationRuleOperationSpec: msRest.OperationSpec = { bodyMapper: Mappers.ErrorResponse } }, - serializer -}; - -const getAuthorizationRuleOperationSpec: msRest.OperationSpec = { - httpMethod: "GET", - path: "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Relay/namespaces/{namespaceName}/authorizationRules/{authorizationRuleName}", + queryParameters: [Parameters.apiVersion], urlParameters: [ + Parameters.$host, + Parameters.subscriptionId, Parameters.resourceGroupName, Parameters.namespaceName, - Parameters.authorizationRuleName, - Parameters.subscriptionId - ], - queryParameters: [ - Parameters.apiVersion - ], - headerParameters: [ - Parameters.acceptLanguage + Parameters.authorizationRuleName ], + headerParameters: [Parameters.accept], + serializer +}; +const getAuthorizationRuleOperationSpec: coreClient.OperationSpec = { + path: + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Relay/namespaces/{namespaceName}/authorizationRules/{authorizationRuleName}", + httpMethod: "GET", responses: { 200: { bodyMapper: Mappers.AuthorizationRule @@ -791,57 +904,21 @@ const getAuthorizationRuleOperationSpec: msRest.OperationSpec = { bodyMapper: Mappers.ErrorResponse } }, - serializer -}; - -const listKeysOperationSpec: msRest.OperationSpec = { - httpMethod: "POST", - path: "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Relay/namespaces/{namespaceName}/authorizationRules/{authorizationRuleName}/listKeys", + queryParameters: [Parameters.apiVersion], urlParameters: [ + Parameters.$host, + Parameters.subscriptionId, Parameters.resourceGroupName, Parameters.namespaceName, - Parameters.authorizationRuleName, - Parameters.subscriptionId - ], - queryParameters: [ - Parameters.apiVersion - ], - headerParameters: [ - Parameters.acceptLanguage + Parameters.authorizationRuleName ], - responses: { - 200: { - bodyMapper: Mappers.AccessKeys - }, - default: { - bodyMapper: Mappers.ErrorResponse - } - }, + headerParameters: [Parameters.accept], serializer }; - -const regenerateKeysOperationSpec: msRest.OperationSpec = { +const listKeysOperationSpec: coreClient.OperationSpec = { + path: + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Relay/namespaces/{namespaceName}/authorizationRules/{authorizationRuleName}/listKeys", httpMethod: "POST", - path: "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Relay/namespaces/{namespaceName}/authorizationRules/{authorizationRuleName}/regenerateKeys", - urlParameters: [ - Parameters.resourceGroupName, - Parameters.namespaceName, - Parameters.authorizationRuleName, - Parameters.subscriptionId - ], - queryParameters: [ - Parameters.apiVersion - ], - headerParameters: [ - Parameters.acceptLanguage - ], - requestBody: { - parameterPath: "parameters", - mapper: { - ...Mappers.RegenerateAccessKeyParameters, - required: true - } - }, responses: { 200: { bodyMapper: Mappers.AccessKeys @@ -850,79 +927,45 @@ const regenerateKeysOperationSpec: msRest.OperationSpec = { bodyMapper: Mappers.ErrorResponse } }, - serializer -}; - -const beginCreateOrUpdateOperationSpec: msRest.OperationSpec = { - httpMethod: "PUT", - path: "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Relay/namespaces/{namespaceName}", + queryParameters: [Parameters.apiVersion], urlParameters: [ + Parameters.$host, + Parameters.subscriptionId, Parameters.resourceGroupName, Parameters.namespaceName, - Parameters.subscriptionId - ], - queryParameters: [ - Parameters.apiVersion - ], - headerParameters: [ - Parameters.acceptLanguage + Parameters.authorizationRuleName ], - requestBody: { - parameterPath: "parameters", - mapper: { - ...Mappers.RelayNamespace, - required: true - } - }, + headerParameters: [Parameters.accept], + serializer +}; +const regenerateKeysOperationSpec: coreClient.OperationSpec = { + path: + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Relay/namespaces/{namespaceName}/authorizationRules/{authorizationRuleName}/regenerateKeys", + httpMethod: "POST", responses: { 200: { - bodyMapper: Mappers.RelayNamespace - }, - 201: { - bodyMapper: Mappers.RelayNamespace + bodyMapper: Mappers.AccessKeys }, default: { bodyMapper: Mappers.ErrorResponse } }, - serializer -}; - -const beginDeleteMethodOperationSpec: msRest.OperationSpec = { - httpMethod: "DELETE", - path: "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Relay/namespaces/{namespaceName}", + requestBody: Parameters.parameters4, + queryParameters: [Parameters.apiVersion], urlParameters: [ + Parameters.$host, + Parameters.subscriptionId, Parameters.resourceGroupName, Parameters.namespaceName, - Parameters.subscriptionId - ], - queryParameters: [ - Parameters.apiVersion - ], - headerParameters: [ - Parameters.acceptLanguage + Parameters.authorizationRuleName ], - responses: { - 200: {}, - 202: {}, - 204: {}, - default: { - bodyMapper: Mappers.ErrorResponse - } - }, + headerParameters: [Parameters.accept, Parameters.contentType], + mediaType: "json", serializer }; - -const listNextOperationSpec: msRest.OperationSpec = { - httpMethod: "GET", - baseUrl: "https://management.azure.com", +const listNextOperationSpec: coreClient.OperationSpec = { path: "{nextLink}", - urlParameters: [ - Parameters.nextPageLink - ], - headerParameters: [ - Parameters.acceptLanguage - ], + httpMethod: "GET", responses: { 200: { bodyMapper: Mappers.RelayNamespaceListResult @@ -931,19 +974,18 @@ const listNextOperationSpec: msRest.OperationSpec = { bodyMapper: Mappers.ErrorResponse } }, + queryParameters: [Parameters.apiVersion], + urlParameters: [ + Parameters.$host, + Parameters.nextLink, + Parameters.subscriptionId + ], + headerParameters: [Parameters.accept], serializer }; - -const listByResourceGroupNextOperationSpec: msRest.OperationSpec = { - httpMethod: "GET", - baseUrl: "https://management.azure.com", +const listByResourceGroupNextOperationSpec: coreClient.OperationSpec = { path: "{nextLink}", - urlParameters: [ - Parameters.nextPageLink - ], - headerParameters: [ - Parameters.acceptLanguage - ], + httpMethod: "GET", responses: { 200: { bodyMapper: Mappers.RelayNamespaceListResult @@ -952,19 +994,19 @@ const listByResourceGroupNextOperationSpec: msRest.OperationSpec = { bodyMapper: Mappers.ErrorResponse } }, + queryParameters: [Parameters.apiVersion], + urlParameters: [ + Parameters.$host, + Parameters.nextLink, + Parameters.subscriptionId, + Parameters.resourceGroupName + ], + headerParameters: [Parameters.accept], serializer }; - -const listAuthorizationRulesNextOperationSpec: msRest.OperationSpec = { - httpMethod: "GET", - baseUrl: "https://management.azure.com", +const listAuthorizationRulesNextOperationSpec: coreClient.OperationSpec = { path: "{nextLink}", - urlParameters: [ - Parameters.nextPageLink - ], - headerParameters: [ - Parameters.acceptLanguage - ], + httpMethod: "GET", responses: { 200: { bodyMapper: Mappers.AuthorizationRuleListResult @@ -973,5 +1015,14 @@ const listAuthorizationRulesNextOperationSpec: msRest.OperationSpec = { bodyMapper: Mappers.ErrorResponse } }, + queryParameters: [Parameters.apiVersion], + urlParameters: [ + Parameters.$host, + Parameters.nextLink, + Parameters.subscriptionId, + Parameters.resourceGroupName, + Parameters.namespaceName + ], + headerParameters: [Parameters.accept], serializer }; diff --git a/sdk/relay/arm-relay/src/operations/operations.ts b/sdk/relay/arm-relay/src/operations/operations.ts index 2d64cbe9bd60..8b7c33f8cc47 100644 --- a/sdk/relay/arm-relay/src/operations/operations.ts +++ b/sdk/relay/arm-relay/src/operations/operations.ts @@ -1,95 +1,111 @@ /* - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for - * license information. + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. * * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is - * regenerated. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. */ -import * as msRest from "@azure/ms-rest-js"; -import * as Models from "../models"; -import * as Mappers from "../models/operationsMappers"; +import { PagedAsyncIterableIterator } from "@azure/core-paging"; +import { Operations } from "../operationsInterfaces"; +import * as coreClient from "@azure/core-client"; +import * as Mappers from "../models/mappers"; import * as Parameters from "../models/parameters"; -import { RelayManagementClientContext } from "../relayManagementClientContext"; +import { RelayAPI } from "../relayAPI"; +import { + Operation, + OperationsListNextOptionalParams, + OperationsListOptionalParams, + OperationsListResponse, + OperationsListNextResponse +} from "../models"; -/** Class representing a Operations. */ -export class Operations { - private readonly client: RelayManagementClientContext; +/// +/** Class containing Operations operations. */ +export class OperationsImpl implements Operations { + private readonly client: RelayAPI; /** - * Create a Operations. - * @param {RelayManagementClientContext} client Reference to the service client. + * Initialize a new instance of the class Operations class. + * @param client Reference to the service client */ - constructor(client: RelayManagementClientContext) { + constructor(client: RelayAPI) { this.client = client; } /** * Lists all available Relay REST API operations. - * @param [options] The optional parameters - * @returns Promise + * @param options The options parameters. */ - list(options?: msRest.RequestOptionsBase): Promise; - /** - * @param callback The callback - */ - list(callback: msRest.ServiceCallback): void; - /** - * @param options The optional parameters - * @param callback The callback - */ - list(options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; - list(options?: msRest.RequestOptionsBase | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { - return this.client.sendOperationRequest( - { - options + public list( + options?: OperationsListOptionalParams + ): PagedAsyncIterableIterator { + const iter = this.listPagingAll(options); + return { + next() { + return iter.next(); + }, + [Symbol.asyncIterator]() { + return this; }, - listOperationSpec, - callback) as Promise; + byPage: () => { + return this.listPagingPage(options); + } + }; + } + + private async *listPagingPage( + options?: OperationsListOptionalParams + ): AsyncIterableIterator { + let result = await this._list(options); + yield result.value || []; + let continuationToken = result.nextLink; + while (continuationToken) { + result = await this._listNext(continuationToken, options); + continuationToken = result.nextLink; + yield result.value || []; + } + } + + private async *listPagingAll( + options?: OperationsListOptionalParams + ): AsyncIterableIterator { + for await (const page of this.listPagingPage(options)) { + yield* page; + } } /** * Lists all available Relay REST API operations. - * @param nextPageLink The NextLink from the previous successful call to List operation. - * @param [options] The optional parameters - * @returns Promise - */ - listNext(nextPageLink: string, options?: msRest.RequestOptionsBase): Promise; - /** - * @param nextPageLink The NextLink from the previous successful call to List operation. - * @param callback The callback + * @param options The options parameters. */ - listNext(nextPageLink: string, callback: msRest.ServiceCallback): void; + private _list( + options?: OperationsListOptionalParams + ): Promise { + return this.client.sendOperationRequest({ options }, listOperationSpec); + } + /** - * @param nextPageLink The NextLink from the previous successful call to List operation. - * @param options The optional parameters - * @param callback The callback + * ListNext + * @param nextLink The nextLink from the previous successful call to the List method. + * @param options The options parameters. */ - listNext(nextPageLink: string, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; - listNext(nextPageLink: string, options?: msRest.RequestOptionsBase | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { + private _listNext( + nextLink: string, + options?: OperationsListNextOptionalParams + ): Promise { return this.client.sendOperationRequest( - { - nextPageLink, - options - }, - listNextOperationSpec, - callback) as Promise; + { nextLink, options }, + listNextOperationSpec + ); } } - // Operation Specifications -const serializer = new msRest.Serializer(Mappers); -const listOperationSpec: msRest.OperationSpec = { +const serializer = coreClient.createSerializer(Mappers, /* isXml */ false); + +const listOperationSpec: coreClient.OperationSpec = { + path: "/providers/Microsoft.Relay/operations", httpMethod: "GET", - path: "providers/Microsoft.Relay/operations", - queryParameters: [ - Parameters.apiVersion - ], - headerParameters: [ - Parameters.acceptLanguage - ], responses: { 200: { bodyMapper: Mappers.OperationListResult @@ -98,19 +114,14 @@ const listOperationSpec: msRest.OperationSpec = { bodyMapper: Mappers.ErrorResponse } }, + queryParameters: [Parameters.apiVersion], + urlParameters: [Parameters.$host], + headerParameters: [Parameters.accept], serializer }; - -const listNextOperationSpec: msRest.OperationSpec = { - httpMethod: "GET", - baseUrl: "https://management.azure.com", +const listNextOperationSpec: coreClient.OperationSpec = { path: "{nextLink}", - urlParameters: [ - Parameters.nextPageLink - ], - headerParameters: [ - Parameters.acceptLanguage - ], + httpMethod: "GET", responses: { 200: { bodyMapper: Mappers.OperationListResult @@ -119,5 +130,8 @@ const listNextOperationSpec: msRest.OperationSpec = { bodyMapper: Mappers.ErrorResponse } }, + queryParameters: [Parameters.apiVersion], + urlParameters: [Parameters.$host, Parameters.nextLink], + headerParameters: [Parameters.accept], serializer }; diff --git a/sdk/relay/arm-relay/src/operations/wCFRelays.ts b/sdk/relay/arm-relay/src/operations/wCFRelays.ts index 1ef280a8dc55..299ce9f9dfa8 100644 --- a/sdk/relay/arm-relay/src/operations/wCFRelays.ts +++ b/sdk/relay/arm-relay/src/operations/wCFRelays.ts @@ -1,28 +1,55 @@ /* - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for - * license information. + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. * * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is - * regenerated. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. */ -import * as msRest from "@azure/ms-rest-js"; -import * as Models from "../models"; -import * as Mappers from "../models/wCFRelaysMappers"; +import { PagedAsyncIterableIterator } from "@azure/core-paging"; +import { WCFRelays } from "../operationsInterfaces"; +import * as coreClient from "@azure/core-client"; +import * as Mappers from "../models/mappers"; import * as Parameters from "../models/parameters"; -import { RelayManagementClientContext } from "../relayManagementClientContext"; +import { RelayAPI } from "../relayAPI"; +import { + WcfRelay, + WCFRelaysListByNamespaceNextOptionalParams, + WCFRelaysListByNamespaceOptionalParams, + AuthorizationRule, + WCFRelaysListAuthorizationRulesNextOptionalParams, + WCFRelaysListAuthorizationRulesOptionalParams, + WCFRelaysListByNamespaceResponse, + WCFRelaysCreateOrUpdateOptionalParams, + WCFRelaysCreateOrUpdateResponse, + WCFRelaysDeleteOptionalParams, + WCFRelaysGetOptionalParams, + WCFRelaysGetResponse, + WCFRelaysListAuthorizationRulesResponse, + WCFRelaysCreateOrUpdateAuthorizationRuleOptionalParams, + WCFRelaysCreateOrUpdateAuthorizationRuleResponse, + WCFRelaysDeleteAuthorizationRuleOptionalParams, + WCFRelaysGetAuthorizationRuleOptionalParams, + WCFRelaysGetAuthorizationRuleResponse, + WCFRelaysListKeysOptionalParams, + WCFRelaysListKeysResponse, + RegenerateAccessKeyParameters, + WCFRelaysRegenerateKeysOptionalParams, + WCFRelaysRegenerateKeysResponse, + WCFRelaysListByNamespaceNextResponse, + WCFRelaysListAuthorizationRulesNextResponse +} from "../models"; -/** Class representing a WCFRelays. */ -export class WCFRelays { - private readonly client: RelayManagementClientContext; +/// +/** Class containing WCFRelays operations. */ +export class WCFRelaysImpl implements WCFRelays { + private readonly client: RelayAPI; /** - * Create a WCFRelays. - * @param {RelayManagementClientContext} client Reference to the service client. + * Initialize a new instance of the class WCFRelays class. + * @param client Reference to the service client */ - constructor(client: RelayManagementClientContext) { + constructor(client: RelayAPI) { this.client = client; } @@ -30,108 +57,208 @@ export class WCFRelays { * Lists the WCF relays within the namespace. * @param resourceGroupName Name of the Resource group within the Azure subscription. * @param namespaceName The namespace name - * @param [options] The optional parameters - * @returns Promise - */ - listByNamespace(resourceGroupName: string, namespaceName: string, options?: msRest.RequestOptionsBase): Promise; - /** - * @param resourceGroupName Name of the Resource group within the Azure subscription. - * @param namespaceName The namespace name - * @param callback The callback - */ - listByNamespace(resourceGroupName: string, namespaceName: string, callback: msRest.ServiceCallback): void; - /** - * @param resourceGroupName Name of the Resource group within the Azure subscription. - * @param namespaceName The namespace name - * @param options The optional parameters - * @param callback The callback - */ - listByNamespace(resourceGroupName: string, namespaceName: string, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; - listByNamespace(resourceGroupName: string, namespaceName: string, options?: msRest.RequestOptionsBase | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { - return this.client.sendOperationRequest( - { + * @param options The options parameters. + */ + public listByNamespace( + resourceGroupName: string, + namespaceName: string, + options?: WCFRelaysListByNamespaceOptionalParams + ): PagedAsyncIterableIterator { + const iter = this.listByNamespacePagingAll( + resourceGroupName, + namespaceName, + options + ); + return { + next() { + return iter.next(); + }, + [Symbol.asyncIterator]() { + return this; + }, + byPage: () => { + return this.listByNamespacePagingPage( + resourceGroupName, + namespaceName, + options + ); + } + }; + } + + private async *listByNamespacePagingPage( + resourceGroupName: string, + namespaceName: string, + options?: WCFRelaysListByNamespaceOptionalParams + ): AsyncIterableIterator { + let result = await this._listByNamespace( + resourceGroupName, + namespaceName, + options + ); + yield result.value || []; + let continuationToken = result.nextLink; + while (continuationToken) { + result = await this._listByNamespaceNext( resourceGroupName, namespaceName, + continuationToken, options - }, - listByNamespaceOperationSpec, - callback) as Promise; + ); + continuationToken = result.nextLink; + yield result.value || []; + } + } + + private async *listByNamespacePagingAll( + resourceGroupName: string, + namespaceName: string, + options?: WCFRelaysListByNamespaceOptionalParams + ): AsyncIterableIterator { + for await (const page of this.listByNamespacePagingPage( + resourceGroupName, + namespaceName, + options + )) { + yield* page; + } } /** - * Creates or updates a WCF relay. This operation is idempotent. - * @param resourceGroupName Name of the Resource group within the Azure subscription. - * @param namespaceName The namespace name - * @param relayName The relay name. - * @param parameters Parameters supplied to create a WCF relay. - * @param [options] The optional parameters - * @returns Promise - */ - createOrUpdate(resourceGroupName: string, namespaceName: string, relayName: string, parameters: Models.WcfRelay, options?: msRest.RequestOptionsBase): Promise; - /** - * @param resourceGroupName Name of the Resource group within the Azure subscription. - * @param namespaceName The namespace name - * @param relayName The relay name. - * @param parameters Parameters supplied to create a WCF relay. - * @param callback The callback - */ - createOrUpdate(resourceGroupName: string, namespaceName: string, relayName: string, parameters: Models.WcfRelay, callback: msRest.ServiceCallback): void; - /** + * Authorization rules for a WCF relay. * @param resourceGroupName Name of the Resource group within the Azure subscription. * @param namespaceName The namespace name * @param relayName The relay name. - * @param parameters Parameters supplied to create a WCF relay. - * @param options The optional parameters - * @param callback The callback - */ - createOrUpdate(resourceGroupName: string, namespaceName: string, relayName: string, parameters: Models.WcfRelay, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; - createOrUpdate(resourceGroupName: string, namespaceName: string, relayName: string, parameters: Models.WcfRelay, options?: msRest.RequestOptionsBase | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { - return this.client.sendOperationRequest( - { + * @param options The options parameters. + */ + public listAuthorizationRules( + resourceGroupName: string, + namespaceName: string, + relayName: string, + options?: WCFRelaysListAuthorizationRulesOptionalParams + ): PagedAsyncIterableIterator { + const iter = this.listAuthorizationRulesPagingAll( + resourceGroupName, + namespaceName, + relayName, + options + ); + return { + next() { + return iter.next(); + }, + [Symbol.asyncIterator]() { + return this; + }, + byPage: () => { + return this.listAuthorizationRulesPagingPage( + resourceGroupName, + namespaceName, + relayName, + options + ); + } + }; + } + + private async *listAuthorizationRulesPagingPage( + resourceGroupName: string, + namespaceName: string, + relayName: string, + options?: WCFRelaysListAuthorizationRulesOptionalParams + ): AsyncIterableIterator { + let result = await this._listAuthorizationRules( + resourceGroupName, + namespaceName, + relayName, + options + ); + yield result.value || []; + let continuationToken = result.nextLink; + while (continuationToken) { + result = await this._listAuthorizationRulesNext( resourceGroupName, namespaceName, relayName, - parameters, + continuationToken, options - }, - createOrUpdateOperationSpec, - callback) as Promise; + ); + continuationToken = result.nextLink; + yield result.value || []; + } + } + + private async *listAuthorizationRulesPagingAll( + resourceGroupName: string, + namespaceName: string, + relayName: string, + options?: WCFRelaysListAuthorizationRulesOptionalParams + ): AsyncIterableIterator { + for await (const page of this.listAuthorizationRulesPagingPage( + resourceGroupName, + namespaceName, + relayName, + options + )) { + yield* page; + } } /** - * Deletes a WCF relay. + * Lists the WCF relays within the namespace. * @param resourceGroupName Name of the Resource group within the Azure subscription. * @param namespaceName The namespace name - * @param relayName The relay name. - * @param [options] The optional parameters - * @returns Promise + * @param options The options parameters. */ - deleteMethod(resourceGroupName: string, namespaceName: string, relayName: string, options?: msRest.RequestOptionsBase): Promise; + private _listByNamespace( + resourceGroupName: string, + namespaceName: string, + options?: WCFRelaysListByNamespaceOptionalParams + ): Promise { + return this.client.sendOperationRequest( + { resourceGroupName, namespaceName, options }, + listByNamespaceOperationSpec + ); + } + /** + * Creates or updates a WCF relay. This operation is idempotent. * @param resourceGroupName Name of the Resource group within the Azure subscription. * @param namespaceName The namespace name * @param relayName The relay name. - * @param callback The callback - */ - deleteMethod(resourceGroupName: string, namespaceName: string, relayName: string, callback: msRest.ServiceCallback): void; + * @param parameters Parameters supplied to create a WCF relay. + * @param options The options parameters. + */ + createOrUpdate( + resourceGroupName: string, + namespaceName: string, + relayName: string, + parameters: WcfRelay, + options?: WCFRelaysCreateOrUpdateOptionalParams + ): Promise { + return this.client.sendOperationRequest( + { resourceGroupName, namespaceName, relayName, parameters, options }, + createOrUpdateOperationSpec + ); + } + /** + * Deletes a WCF relay. * @param resourceGroupName Name of the Resource group within the Azure subscription. * @param namespaceName The namespace name * @param relayName The relay name. - * @param options The optional parameters - * @param callback The callback - */ - deleteMethod(resourceGroupName: string, namespaceName: string, relayName: string, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; - deleteMethod(resourceGroupName: string, namespaceName: string, relayName: string, options?: msRest.RequestOptionsBase | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { + * @param options The options parameters. + */ + delete( + resourceGroupName: string, + namespaceName: string, + relayName: string, + options?: WCFRelaysDeleteOptionalParams + ): Promise { return this.client.sendOperationRequest( - { - resourceGroupName, - namespaceName, - relayName, - options - }, - deleteMethodOperationSpec, - callback); + { resourceGroupName, namespaceName, relayName, options }, + deleteOperationSpec + ); } /** @@ -139,35 +266,18 @@ export class WCFRelays { * @param resourceGroupName Name of the Resource group within the Azure subscription. * @param namespaceName The namespace name * @param relayName The relay name. - * @param [options] The optional parameters - * @returns Promise - */ - get(resourceGroupName: string, namespaceName: string, relayName: string, options?: msRest.RequestOptionsBase): Promise; - /** - * @param resourceGroupName Name of the Resource group within the Azure subscription. - * @param namespaceName The namespace name - * @param relayName The relay name. - * @param callback The callback - */ - get(resourceGroupName: string, namespaceName: string, relayName: string, callback: msRest.ServiceCallback): void; - /** - * @param resourceGroupName Name of the Resource group within the Azure subscription. - * @param namespaceName The namespace name - * @param relayName The relay name. - * @param options The optional parameters - * @param callback The callback - */ - get(resourceGroupName: string, namespaceName: string, relayName: string, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; - get(resourceGroupName: string, namespaceName: string, relayName: string, options?: msRest.RequestOptionsBase | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { + * @param options The options parameters. + */ + get( + resourceGroupName: string, + namespaceName: string, + relayName: string, + options?: WCFRelaysGetOptionalParams + ): Promise { return this.client.sendOperationRequest( - { - resourceGroupName, - namespaceName, - relayName, - options - }, - getOperationSpec, - callback) as Promise; + { resourceGroupName, namespaceName, relayName, options }, + getOperationSpec + ); } /** @@ -175,35 +285,18 @@ export class WCFRelays { * @param resourceGroupName Name of the Resource group within the Azure subscription. * @param namespaceName The namespace name * @param relayName The relay name. - * @param [options] The optional parameters - * @returns Promise - */ - listAuthorizationRules(resourceGroupName: string, namespaceName: string, relayName: string, options?: msRest.RequestOptionsBase): Promise; - /** - * @param resourceGroupName Name of the Resource group within the Azure subscription. - * @param namespaceName The namespace name - * @param relayName The relay name. - * @param callback The callback - */ - listAuthorizationRules(resourceGroupName: string, namespaceName: string, relayName: string, callback: msRest.ServiceCallback): void; - /** - * @param resourceGroupName Name of the Resource group within the Azure subscription. - * @param namespaceName The namespace name - * @param relayName The relay name. - * @param options The optional parameters - * @param callback The callback - */ - listAuthorizationRules(resourceGroupName: string, namespaceName: string, relayName: string, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; - listAuthorizationRules(resourceGroupName: string, namespaceName: string, relayName: string, options?: msRest.RequestOptionsBase | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { + * @param options The options parameters. + */ + private _listAuthorizationRules( + resourceGroupName: string, + namespaceName: string, + relayName: string, + options?: WCFRelaysListAuthorizationRulesOptionalParams + ): Promise { return this.client.sendOperationRequest( - { - resourceGroupName, - namespaceName, - relayName, - options - }, - listAuthorizationRulesOperationSpec, - callback) as Promise; + { resourceGroupName, namespaceName, relayName, options }, + listAuthorizationRulesOperationSpec + ); } /** @@ -213,30 +306,16 @@ export class WCFRelays { * @param relayName The relay name. * @param authorizationRuleName The authorization rule name. * @param parameters The authorization rule parameters. - * @param [options] The optional parameters - * @returns Promise - */ - createOrUpdateAuthorizationRule(resourceGroupName: string, namespaceName: string, relayName: string, authorizationRuleName: string, parameters: Models.AuthorizationRule, options?: msRest.RequestOptionsBase): Promise; - /** - * @param resourceGroupName Name of the Resource group within the Azure subscription. - * @param namespaceName The namespace name - * @param relayName The relay name. - * @param authorizationRuleName The authorization rule name. - * @param parameters The authorization rule parameters. - * @param callback The callback - */ - createOrUpdateAuthorizationRule(resourceGroupName: string, namespaceName: string, relayName: string, authorizationRuleName: string, parameters: Models.AuthorizationRule, callback: msRest.ServiceCallback): void; - /** - * @param resourceGroupName Name of the Resource group within the Azure subscription. - * @param namespaceName The namespace name - * @param relayName The relay name. - * @param authorizationRuleName The authorization rule name. - * @param parameters The authorization rule parameters. - * @param options The optional parameters - * @param callback The callback - */ - createOrUpdateAuthorizationRule(resourceGroupName: string, namespaceName: string, relayName: string, authorizationRuleName: string, parameters: Models.AuthorizationRule, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; - createOrUpdateAuthorizationRule(resourceGroupName: string, namespaceName: string, relayName: string, authorizationRuleName: string, parameters: Models.AuthorizationRule, options?: msRest.RequestOptionsBase | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { + * @param options The options parameters. + */ + createOrUpdateAuthorizationRule( + resourceGroupName: string, + namespaceName: string, + relayName: string, + authorizationRuleName: string, + parameters: AuthorizationRule, + options?: WCFRelaysCreateOrUpdateAuthorizationRuleOptionalParams + ): Promise { return this.client.sendOperationRequest( { resourceGroupName, @@ -246,8 +325,8 @@ export class WCFRelays { parameters, options }, - createOrUpdateAuthorizationRuleOperationSpec, - callback) as Promise; + createOrUpdateAuthorizationRuleOperationSpec + ); } /** @@ -256,28 +335,15 @@ export class WCFRelays { * @param namespaceName The namespace name * @param relayName The relay name. * @param authorizationRuleName The authorization rule name. - * @param [options] The optional parameters - * @returns Promise - */ - deleteAuthorizationRule(resourceGroupName: string, namespaceName: string, relayName: string, authorizationRuleName: string, options?: msRest.RequestOptionsBase): Promise; - /** - * @param resourceGroupName Name of the Resource group within the Azure subscription. - * @param namespaceName The namespace name - * @param relayName The relay name. - * @param authorizationRuleName The authorization rule name. - * @param callback The callback - */ - deleteAuthorizationRule(resourceGroupName: string, namespaceName: string, relayName: string, authorizationRuleName: string, callback: msRest.ServiceCallback): void; - /** - * @param resourceGroupName Name of the Resource group within the Azure subscription. - * @param namespaceName The namespace name - * @param relayName The relay name. - * @param authorizationRuleName The authorization rule name. - * @param options The optional parameters - * @param callback The callback - */ - deleteAuthorizationRule(resourceGroupName: string, namespaceName: string, relayName: string, authorizationRuleName: string, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; - deleteAuthorizationRule(resourceGroupName: string, namespaceName: string, relayName: string, authorizationRuleName: string, options?: msRest.RequestOptionsBase | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { + * @param options The options parameters. + */ + deleteAuthorizationRule( + resourceGroupName: string, + namespaceName: string, + relayName: string, + authorizationRuleName: string, + options?: WCFRelaysDeleteAuthorizationRuleOptionalParams + ): Promise { return this.client.sendOperationRequest( { resourceGroupName, @@ -286,8 +352,8 @@ export class WCFRelays { authorizationRuleName, options }, - deleteAuthorizationRuleOperationSpec, - callback); + deleteAuthorizationRuleOperationSpec + ); } /** @@ -296,28 +362,15 @@ export class WCFRelays { * @param namespaceName The namespace name * @param relayName The relay name. * @param authorizationRuleName The authorization rule name. - * @param [options] The optional parameters - * @returns Promise - */ - getAuthorizationRule(resourceGroupName: string, namespaceName: string, relayName: string, authorizationRuleName: string, options?: msRest.RequestOptionsBase): Promise; - /** - * @param resourceGroupName Name of the Resource group within the Azure subscription. - * @param namespaceName The namespace name - * @param relayName The relay name. - * @param authorizationRuleName The authorization rule name. - * @param callback The callback - */ - getAuthorizationRule(resourceGroupName: string, namespaceName: string, relayName: string, authorizationRuleName: string, callback: msRest.ServiceCallback): void; - /** - * @param resourceGroupName Name of the Resource group within the Azure subscription. - * @param namespaceName The namespace name - * @param relayName The relay name. - * @param authorizationRuleName The authorization rule name. - * @param options The optional parameters - * @param callback The callback - */ - getAuthorizationRule(resourceGroupName: string, namespaceName: string, relayName: string, authorizationRuleName: string, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; - getAuthorizationRule(resourceGroupName: string, namespaceName: string, relayName: string, authorizationRuleName: string, options?: msRest.RequestOptionsBase | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { + * @param options The options parameters. + */ + getAuthorizationRule( + resourceGroupName: string, + namespaceName: string, + relayName: string, + authorizationRuleName: string, + options?: WCFRelaysGetAuthorizationRuleOptionalParams + ): Promise { return this.client.sendOperationRequest( { resourceGroupName, @@ -326,8 +379,8 @@ export class WCFRelays { authorizationRuleName, options }, - getAuthorizationRuleOperationSpec, - callback) as Promise; + getAuthorizationRuleOperationSpec + ); } /** @@ -336,28 +389,15 @@ export class WCFRelays { * @param namespaceName The namespace name * @param relayName The relay name. * @param authorizationRuleName The authorization rule name. - * @param [options] The optional parameters - * @returns Promise - */ - listKeys(resourceGroupName: string, namespaceName: string, relayName: string, authorizationRuleName: string, options?: msRest.RequestOptionsBase): Promise; - /** - * @param resourceGroupName Name of the Resource group within the Azure subscription. - * @param namespaceName The namespace name - * @param relayName The relay name. - * @param authorizationRuleName The authorization rule name. - * @param callback The callback - */ - listKeys(resourceGroupName: string, namespaceName: string, relayName: string, authorizationRuleName: string, callback: msRest.ServiceCallback): void; - /** - * @param resourceGroupName Name of the Resource group within the Azure subscription. - * @param namespaceName The namespace name - * @param relayName The relay name. - * @param authorizationRuleName The authorization rule name. - * @param options The optional parameters - * @param callback The callback - */ - listKeys(resourceGroupName: string, namespaceName: string, relayName: string, authorizationRuleName: string, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; - listKeys(resourceGroupName: string, namespaceName: string, relayName: string, authorizationRuleName: string, options?: msRest.RequestOptionsBase | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { + * @param options The options parameters. + */ + listKeys( + resourceGroupName: string, + namespaceName: string, + relayName: string, + authorizationRuleName: string, + options?: WCFRelaysListKeysOptionalParams + ): Promise { return this.client.sendOperationRequest( { resourceGroupName, @@ -366,8 +406,8 @@ export class WCFRelays { authorizationRuleName, options }, - listKeysOperationSpec, - callback) as Promise; + listKeysOperationSpec + ); } /** @@ -377,30 +417,16 @@ export class WCFRelays { * @param relayName The relay name. * @param authorizationRuleName The authorization rule name. * @param parameters Parameters supplied to regenerate authorization rule. - * @param [options] The optional parameters - * @returns Promise - */ - regenerateKeys(resourceGroupName: string, namespaceName: string, relayName: string, authorizationRuleName: string, parameters: Models.RegenerateAccessKeyParameters, options?: msRest.RequestOptionsBase): Promise; - /** - * @param resourceGroupName Name of the Resource group within the Azure subscription. - * @param namespaceName The namespace name - * @param relayName The relay name. - * @param authorizationRuleName The authorization rule name. - * @param parameters Parameters supplied to regenerate authorization rule. - * @param callback The callback - */ - regenerateKeys(resourceGroupName: string, namespaceName: string, relayName: string, authorizationRuleName: string, parameters: Models.RegenerateAccessKeyParameters, callback: msRest.ServiceCallback): void; - /** - * @param resourceGroupName Name of the Resource group within the Azure subscription. - * @param namespaceName The namespace name - * @param relayName The relay name. - * @param authorizationRuleName The authorization rule name. - * @param parameters Parameters supplied to regenerate authorization rule. - * @param options The optional parameters - * @param callback The callback - */ - regenerateKeys(resourceGroupName: string, namespaceName: string, relayName: string, authorizationRuleName: string, parameters: Models.RegenerateAccessKeyParameters, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; - regenerateKeys(resourceGroupName: string, namespaceName: string, relayName: string, authorizationRuleName: string, parameters: Models.RegenerateAccessKeyParameters, options?: msRest.RequestOptionsBase | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { + * @param options The options parameters. + */ + regenerateKeys( + resourceGroupName: string, + namespaceName: string, + relayName: string, + authorizationRuleName: string, + parameters: RegenerateAccessKeyParameters, + options?: WCFRelaysRegenerateKeysOptionalParams + ): Promise { return this.client.sendOperationRequest( { resourceGroupName, @@ -410,83 +436,57 @@ export class WCFRelays { parameters, options }, - regenerateKeysOperationSpec, - callback) as Promise; + regenerateKeysOperationSpec + ); } /** - * Lists the WCF relays within the namespace. - * @param nextPageLink The NextLink from the previous successful call to List operation. - * @param [options] The optional parameters - * @returns Promise - */ - listByNamespaceNext(nextPageLink: string, options?: msRest.RequestOptionsBase): Promise; - /** - * @param nextPageLink The NextLink from the previous successful call to List operation. - * @param callback The callback - */ - listByNamespaceNext(nextPageLink: string, callback: msRest.ServiceCallback): void; - /** - * @param nextPageLink The NextLink from the previous successful call to List operation. - * @param options The optional parameters - * @param callback The callback - */ - listByNamespaceNext(nextPageLink: string, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; - listByNamespaceNext(nextPageLink: string, options?: msRest.RequestOptionsBase | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { + * ListByNamespaceNext + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param namespaceName The namespace name + * @param nextLink The nextLink from the previous successful call to the ListByNamespace method. + * @param options The options parameters. + */ + private _listByNamespaceNext( + resourceGroupName: string, + namespaceName: string, + nextLink: string, + options?: WCFRelaysListByNamespaceNextOptionalParams + ): Promise { return this.client.sendOperationRequest( - { - nextPageLink, - options - }, - listByNamespaceNextOperationSpec, - callback) as Promise; + { resourceGroupName, namespaceName, nextLink, options }, + listByNamespaceNextOperationSpec + ); } /** - * Authorization rules for a WCF relay. - * @param nextPageLink The NextLink from the previous successful call to List operation. - * @param [options] The optional parameters - * @returns Promise - */ - listAuthorizationRulesNext(nextPageLink: string, options?: msRest.RequestOptionsBase): Promise; - /** - * @param nextPageLink The NextLink from the previous successful call to List operation. - * @param callback The callback - */ - listAuthorizationRulesNext(nextPageLink: string, callback: msRest.ServiceCallback): void; - /** - * @param nextPageLink The NextLink from the previous successful call to List operation. - * @param options The optional parameters - * @param callback The callback - */ - listAuthorizationRulesNext(nextPageLink: string, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; - listAuthorizationRulesNext(nextPageLink: string, options?: msRest.RequestOptionsBase | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { + * ListAuthorizationRulesNext + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param namespaceName The namespace name + * @param relayName The relay name. + * @param nextLink The nextLink from the previous successful call to the ListAuthorizationRules method. + * @param options The options parameters. + */ + private _listAuthorizationRulesNext( + resourceGroupName: string, + namespaceName: string, + relayName: string, + nextLink: string, + options?: WCFRelaysListAuthorizationRulesNextOptionalParams + ): Promise { return this.client.sendOperationRequest( - { - nextPageLink, - options - }, - listAuthorizationRulesNextOperationSpec, - callback) as Promise; + { resourceGroupName, namespaceName, relayName, nextLink, options }, + listAuthorizationRulesNextOperationSpec + ); } } - // Operation Specifications -const serializer = new msRest.Serializer(Mappers); -const listByNamespaceOperationSpec: msRest.OperationSpec = { +const serializer = coreClient.createSerializer(Mappers, /* isXml */ false); + +const listByNamespaceOperationSpec: coreClient.OperationSpec = { + path: + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Relay/namespaces/{namespaceName}/wcfRelays", httpMethod: "GET", - path: "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Relay/namespaces/{namespaceName}/wcfRelays", - urlParameters: [ - Parameters.resourceGroupName, - Parameters.namespaceName, - Parameters.subscriptionId - ], - queryParameters: [ - Parameters.apiVersion - ], - headerParameters: [ - Parameters.acceptLanguage - ], responses: { 200: { bodyMapper: Mappers.WcfRelaysListResult @@ -495,31 +495,20 @@ const listByNamespaceOperationSpec: msRest.OperationSpec = { bodyMapper: Mappers.ErrorResponse } }, - serializer -}; - -const createOrUpdateOperationSpec: msRest.OperationSpec = { - httpMethod: "PUT", - path: "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Relay/namespaces/{namespaceName}/wcfRelays/{relayName}", + queryParameters: [Parameters.apiVersion], urlParameters: [ + Parameters.$host, + Parameters.subscriptionId, Parameters.resourceGroupName, - Parameters.namespaceName, - Parameters.relayName, - Parameters.subscriptionId - ], - queryParameters: [ - Parameters.apiVersion + Parameters.namespaceName ], - headerParameters: [ - Parameters.acceptLanguage - ], - requestBody: { - parameterPath: "parameters", - mapper: { - ...Mappers.WcfRelay, - required: true - } - }, + headerParameters: [Parameters.accept], + serializer +}; +const createOrUpdateOperationSpec: coreClient.OperationSpec = { + path: + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Relay/namespaces/{namespaceName}/wcfRelays/{relayName}", + httpMethod: "PUT", responses: { 200: { bodyMapper: Mappers.WcfRelay @@ -528,24 +517,23 @@ const createOrUpdateOperationSpec: msRest.OperationSpec = { bodyMapper: Mappers.ErrorResponse } }, - serializer -}; - -const deleteMethodOperationSpec: msRest.OperationSpec = { - httpMethod: "DELETE", - path: "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Relay/namespaces/{namespaceName}/wcfRelays/{relayName}", + requestBody: Parameters.parameters6, + queryParameters: [Parameters.apiVersion], urlParameters: [ + Parameters.$host, + Parameters.subscriptionId, Parameters.resourceGroupName, Parameters.namespaceName, - Parameters.relayName, - Parameters.subscriptionId - ], - queryParameters: [ - Parameters.apiVersion - ], - headerParameters: [ - Parameters.acceptLanguage + Parameters.relayName ], + headerParameters: [Parameters.accept, Parameters.contentType], + mediaType: "json", + serializer +}; +const deleteOperationSpec: coreClient.OperationSpec = { + path: + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Relay/namespaces/{namespaceName}/wcfRelays/{relayName}", + httpMethod: "DELETE", responses: { 200: {}, 204: {}, @@ -553,24 +541,21 @@ const deleteMethodOperationSpec: msRest.OperationSpec = { bodyMapper: Mappers.ErrorResponse } }, - serializer -}; - -const getOperationSpec: msRest.OperationSpec = { - httpMethod: "GET", - path: "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Relay/namespaces/{namespaceName}/wcfRelays/{relayName}", + queryParameters: [Parameters.apiVersion], urlParameters: [ + Parameters.$host, + Parameters.subscriptionId, Parameters.resourceGroupName, Parameters.namespaceName, - Parameters.relayName, - Parameters.subscriptionId - ], - queryParameters: [ - Parameters.apiVersion - ], - headerParameters: [ - Parameters.acceptLanguage + Parameters.relayName ], + headerParameters: [Parameters.accept], + serializer +}; +const getOperationSpec: coreClient.OperationSpec = { + path: + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Relay/namespaces/{namespaceName}/wcfRelays/{relayName}", + httpMethod: "GET", responses: { 200: { bodyMapper: Mappers.WcfRelay @@ -580,58 +565,41 @@ const getOperationSpec: msRest.OperationSpec = { bodyMapper: Mappers.ErrorResponse } }, - serializer -}; - -const listAuthorizationRulesOperationSpec: msRest.OperationSpec = { - httpMethod: "GET", - path: "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Relay/namespaces/{namespaceName}/wcfRelays/{relayName}/authorizationRules", + queryParameters: [Parameters.apiVersion], urlParameters: [ + Parameters.$host, + Parameters.subscriptionId, Parameters.resourceGroupName, Parameters.namespaceName, - Parameters.relayName, - Parameters.subscriptionId - ], - queryParameters: [ - Parameters.apiVersion - ], - headerParameters: [ - Parameters.acceptLanguage + Parameters.relayName ], + headerParameters: [Parameters.accept], + serializer +}; +const listAuthorizationRulesOperationSpec: coreClient.OperationSpec = { + path: + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Relay/namespaces/{namespaceName}/wcfRelays/{relayName}/authorizationRules", + httpMethod: "GET", responses: { 200: { bodyMapper: Mappers.AuthorizationRuleListResult - }, - default: { - bodyMapper: Mappers.CloudError } }, - serializer -}; - -const createOrUpdateAuthorizationRuleOperationSpec: msRest.OperationSpec = { - httpMethod: "PUT", - path: "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Relay/namespaces/{namespaceName}/wcfRelays/{relayName}/authorizationRules/{authorizationRuleName}", + queryParameters: [Parameters.apiVersion], urlParameters: [ + Parameters.$host, + Parameters.subscriptionId, Parameters.resourceGroupName, Parameters.namespaceName, - Parameters.relayName, - Parameters.authorizationRuleName, - Parameters.subscriptionId - ], - queryParameters: [ - Parameters.apiVersion - ], - headerParameters: [ - Parameters.acceptLanguage + Parameters.relayName ], - requestBody: { - parameterPath: "parameters", - mapper: { - ...Mappers.AuthorizationRule, - required: true - } - }, + headerParameters: [Parameters.accept], + serializer +}; +const createOrUpdateAuthorizationRuleOperationSpec: coreClient.OperationSpec = { + path: + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Relay/namespaces/{namespaceName}/wcfRelays/{relayName}/authorizationRules/{authorizationRuleName}", + httpMethod: "PUT", responses: { 200: { bodyMapper: Mappers.AuthorizationRule @@ -640,25 +608,24 @@ const createOrUpdateAuthorizationRuleOperationSpec: msRest.OperationSpec = { bodyMapper: Mappers.ErrorResponse } }, - serializer -}; - -const deleteAuthorizationRuleOperationSpec: msRest.OperationSpec = { - httpMethod: "DELETE", - path: "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Relay/namespaces/{namespaceName}/wcfRelays/{relayName}/authorizationRules/{authorizationRuleName}", + requestBody: Parameters.parameters3, + queryParameters: [Parameters.apiVersion], urlParameters: [ + Parameters.$host, + Parameters.subscriptionId, Parameters.resourceGroupName, Parameters.namespaceName, - Parameters.relayName, Parameters.authorizationRuleName, - Parameters.subscriptionId - ], - queryParameters: [ - Parameters.apiVersion - ], - headerParameters: [ - Parameters.acceptLanguage + Parameters.relayName ], + headerParameters: [Parameters.accept, Parameters.contentType], + mediaType: "json", + serializer +}; +const deleteAuthorizationRuleOperationSpec: coreClient.OperationSpec = { + path: + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Relay/namespaces/{namespaceName}/wcfRelays/{relayName}/authorizationRules/{authorizationRuleName}", + httpMethod: "DELETE", responses: { 200: {}, 204: {}, @@ -666,25 +633,22 @@ const deleteAuthorizationRuleOperationSpec: msRest.OperationSpec = { bodyMapper: Mappers.ErrorResponse } }, - serializer -}; - -const getAuthorizationRuleOperationSpec: msRest.OperationSpec = { - httpMethod: "GET", - path: "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Relay/namespaces/{namespaceName}/wcfRelays/{relayName}/authorizationRules/{authorizationRuleName}", + queryParameters: [Parameters.apiVersion], urlParameters: [ + Parameters.$host, + Parameters.subscriptionId, Parameters.resourceGroupName, Parameters.namespaceName, - Parameters.relayName, Parameters.authorizationRuleName, - Parameters.subscriptionId - ], - queryParameters: [ - Parameters.apiVersion - ], - headerParameters: [ - Parameters.acceptLanguage + Parameters.relayName ], + headerParameters: [Parameters.accept], + serializer +}; +const getAuthorizationRuleOperationSpec: coreClient.OperationSpec = { + path: + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Relay/namespaces/{namespaceName}/wcfRelays/{relayName}/authorizationRules/{authorizationRuleName}", + httpMethod: "GET", responses: { 200: { bodyMapper: Mappers.AuthorizationRule @@ -693,25 +657,22 @@ const getAuthorizationRuleOperationSpec: msRest.OperationSpec = { bodyMapper: Mappers.ErrorResponse } }, - serializer -}; - -const listKeysOperationSpec: msRest.OperationSpec = { - httpMethod: "POST", - path: "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Relay/namespaces/{namespaceName}/wcfRelays/{relayName}/authorizationRules/{authorizationRuleName}/listKeys", + queryParameters: [Parameters.apiVersion], urlParameters: [ + Parameters.$host, + Parameters.subscriptionId, Parameters.resourceGroupName, Parameters.namespaceName, - Parameters.relayName, Parameters.authorizationRuleName, - Parameters.subscriptionId - ], - queryParameters: [ - Parameters.apiVersion - ], - headerParameters: [ - Parameters.acceptLanguage + Parameters.relayName ], + headerParameters: [Parameters.accept], + serializer +}; +const listKeysOperationSpec: coreClient.OperationSpec = { + path: + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Relay/namespaces/{namespaceName}/wcfRelays/{relayName}/authorizationRules/{authorizationRuleName}/listKeys", + httpMethod: "POST", responses: { 200: { bodyMapper: Mappers.AccessKeys @@ -720,32 +681,22 @@ const listKeysOperationSpec: msRest.OperationSpec = { bodyMapper: Mappers.ErrorResponse } }, - serializer -}; - -const regenerateKeysOperationSpec: msRest.OperationSpec = { - httpMethod: "POST", - path: "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Relay/namespaces/{namespaceName}/wcfRelays/{relayName}/authorizationRules/{authorizationRuleName}/regenerateKeys", + queryParameters: [Parameters.apiVersion], urlParameters: [ + Parameters.$host, + Parameters.subscriptionId, Parameters.resourceGroupName, Parameters.namespaceName, - Parameters.relayName, Parameters.authorizationRuleName, - Parameters.subscriptionId - ], - queryParameters: [ - Parameters.apiVersion - ], - headerParameters: [ - Parameters.acceptLanguage + Parameters.relayName ], - requestBody: { - parameterPath: "parameters", - mapper: { - ...Mappers.RegenerateAccessKeyParameters, - required: true - } - }, + headerParameters: [Parameters.accept], + serializer +}; +const regenerateKeysOperationSpec: coreClient.OperationSpec = { + path: + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Relay/namespaces/{namespaceName}/wcfRelays/{relayName}/authorizationRules/{authorizationRuleName}/regenerateKeys", + httpMethod: "POST", responses: { 200: { bodyMapper: Mappers.AccessKeys @@ -754,19 +705,23 @@ const regenerateKeysOperationSpec: msRest.OperationSpec = { bodyMapper: Mappers.ErrorResponse } }, + requestBody: Parameters.parameters4, + queryParameters: [Parameters.apiVersion], + urlParameters: [ + Parameters.$host, + Parameters.subscriptionId, + Parameters.resourceGroupName, + Parameters.namespaceName, + Parameters.authorizationRuleName, + Parameters.relayName + ], + headerParameters: [Parameters.accept, Parameters.contentType], + mediaType: "json", serializer }; - -const listByNamespaceNextOperationSpec: msRest.OperationSpec = { - httpMethod: "GET", - baseUrl: "https://management.azure.com", +const listByNamespaceNextOperationSpec: coreClient.OperationSpec = { path: "{nextLink}", - urlParameters: [ - Parameters.nextPageLink - ], - headerParameters: [ - Parameters.acceptLanguage - ], + httpMethod: "GET", responses: { 200: { bodyMapper: Mappers.WcfRelaysListResult @@ -775,26 +730,34 @@ const listByNamespaceNextOperationSpec: msRest.OperationSpec = { bodyMapper: Mappers.ErrorResponse } }, + queryParameters: [Parameters.apiVersion], + urlParameters: [ + Parameters.$host, + Parameters.nextLink, + Parameters.subscriptionId, + Parameters.resourceGroupName, + Parameters.namespaceName + ], + headerParameters: [Parameters.accept], serializer }; - -const listAuthorizationRulesNextOperationSpec: msRest.OperationSpec = { - httpMethod: "GET", - baseUrl: "https://management.azure.com", +const listAuthorizationRulesNextOperationSpec: coreClient.OperationSpec = { path: "{nextLink}", - urlParameters: [ - Parameters.nextPageLink - ], - headerParameters: [ - Parameters.acceptLanguage - ], + httpMethod: "GET", responses: { 200: { bodyMapper: Mappers.AuthorizationRuleListResult - }, - default: { - bodyMapper: Mappers.CloudError } }, + queryParameters: [Parameters.apiVersion], + urlParameters: [ + Parameters.$host, + Parameters.nextLink, + Parameters.subscriptionId, + Parameters.resourceGroupName, + Parameters.namespaceName, + Parameters.relayName + ], + headerParameters: [Parameters.accept], serializer }; diff --git a/sdk/relay/arm-relay/src/operationsInterfaces/hybridConnections.ts b/sdk/relay/arm-relay/src/operationsInterfaces/hybridConnections.ts new file mode 100644 index 000000000000..400b401b209b --- /dev/null +++ b/sdk/relay/arm-relay/src/operationsInterfaces/hybridConnections.ts @@ -0,0 +1,179 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +import { PagedAsyncIterableIterator } from "@azure/core-paging"; +import { + HybridConnection, + HybridConnectionsListByNamespaceOptionalParams, + AuthorizationRule, + HybridConnectionsListAuthorizationRulesOptionalParams, + HybridConnectionsCreateOrUpdateOptionalParams, + HybridConnectionsCreateOrUpdateResponse, + HybridConnectionsDeleteOptionalParams, + HybridConnectionsGetOptionalParams, + HybridConnectionsGetResponse, + HybridConnectionsCreateOrUpdateAuthorizationRuleOptionalParams, + HybridConnectionsCreateOrUpdateAuthorizationRuleResponse, + HybridConnectionsDeleteAuthorizationRuleOptionalParams, + HybridConnectionsGetAuthorizationRuleOptionalParams, + HybridConnectionsGetAuthorizationRuleResponse, + HybridConnectionsListKeysOptionalParams, + HybridConnectionsListKeysResponse, + RegenerateAccessKeyParameters, + HybridConnectionsRegenerateKeysOptionalParams, + HybridConnectionsRegenerateKeysResponse +} from "../models"; + +/// +/** Interface representing a HybridConnections. */ +export interface HybridConnections { + /** + * Lists the hybrid connection within the namespace. + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param namespaceName The namespace name + * @param options The options parameters. + */ + listByNamespace( + resourceGroupName: string, + namespaceName: string, + options?: HybridConnectionsListByNamespaceOptionalParams + ): PagedAsyncIterableIterator; + /** + * Authorization rules for a hybrid connection. + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param namespaceName The namespace name + * @param hybridConnectionName The hybrid connection name. + * @param options The options parameters. + */ + listAuthorizationRules( + resourceGroupName: string, + namespaceName: string, + hybridConnectionName: string, + options?: HybridConnectionsListAuthorizationRulesOptionalParams + ): PagedAsyncIterableIterator; + /** + * Creates or updates a service hybrid connection. This operation is idempotent. + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param namespaceName The namespace name + * @param hybridConnectionName The hybrid connection name. + * @param parameters Parameters supplied to create a hybrid connection. + * @param options The options parameters. + */ + createOrUpdate( + resourceGroupName: string, + namespaceName: string, + hybridConnectionName: string, + parameters: HybridConnection, + options?: HybridConnectionsCreateOrUpdateOptionalParams + ): Promise; + /** + * Deletes a hybrid connection. + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param namespaceName The namespace name + * @param hybridConnectionName The hybrid connection name. + * @param options The options parameters. + */ + delete( + resourceGroupName: string, + namespaceName: string, + hybridConnectionName: string, + options?: HybridConnectionsDeleteOptionalParams + ): Promise; + /** + * Returns the description for the specified hybrid connection. + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param namespaceName The namespace name + * @param hybridConnectionName The hybrid connection name. + * @param options The options parameters. + */ + get( + resourceGroupName: string, + namespaceName: string, + hybridConnectionName: string, + options?: HybridConnectionsGetOptionalParams + ): Promise; + /** + * Creates or updates an authorization rule for a hybrid connection. + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param namespaceName The namespace name + * @param hybridConnectionName The hybrid connection name. + * @param authorizationRuleName The authorization rule name. + * @param parameters The authorization rule parameters. + * @param options The options parameters. + */ + createOrUpdateAuthorizationRule( + resourceGroupName: string, + namespaceName: string, + hybridConnectionName: string, + authorizationRuleName: string, + parameters: AuthorizationRule, + options?: HybridConnectionsCreateOrUpdateAuthorizationRuleOptionalParams + ): Promise; + /** + * Deletes a hybrid connection authorization rule. + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param namespaceName The namespace name + * @param hybridConnectionName The hybrid connection name. + * @param authorizationRuleName The authorization rule name. + * @param options The options parameters. + */ + deleteAuthorizationRule( + resourceGroupName: string, + namespaceName: string, + hybridConnectionName: string, + authorizationRuleName: string, + options?: HybridConnectionsDeleteAuthorizationRuleOptionalParams + ): Promise; + /** + * Hybrid connection authorization rule for a hybrid connection by name. + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param namespaceName The namespace name + * @param hybridConnectionName The hybrid connection name. + * @param authorizationRuleName The authorization rule name. + * @param options The options parameters. + */ + getAuthorizationRule( + resourceGroupName: string, + namespaceName: string, + hybridConnectionName: string, + authorizationRuleName: string, + options?: HybridConnectionsGetAuthorizationRuleOptionalParams + ): Promise; + /** + * Primary and secondary connection strings to the hybrid connection. + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param namespaceName The namespace name + * @param hybridConnectionName The hybrid connection name. + * @param authorizationRuleName The authorization rule name. + * @param options The options parameters. + */ + listKeys( + resourceGroupName: string, + namespaceName: string, + hybridConnectionName: string, + authorizationRuleName: string, + options?: HybridConnectionsListKeysOptionalParams + ): Promise; + /** + * Regenerates the primary or secondary connection strings to the hybrid connection. + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param namespaceName The namespace name + * @param hybridConnectionName The hybrid connection name. + * @param authorizationRuleName The authorization rule name. + * @param parameters Parameters supplied to regenerate authorization rule. + * @param options The options parameters. + */ + regenerateKeys( + resourceGroupName: string, + namespaceName: string, + hybridConnectionName: string, + authorizationRuleName: string, + parameters: RegenerateAccessKeyParameters, + options?: HybridConnectionsRegenerateKeysOptionalParams + ): Promise; +} diff --git a/sdk/relay/arm-relay/src/operationsInterfaces/index.ts b/sdk/relay/arm-relay/src/operationsInterfaces/index.ts new file mode 100644 index 000000000000..38b7e10a5d1b --- /dev/null +++ b/sdk/relay/arm-relay/src/operationsInterfaces/index.ts @@ -0,0 +1,12 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +export * from "./operations"; +export * from "./namespaces"; +export * from "./hybridConnections"; +export * from "./wCFRelays"; diff --git a/sdk/relay/arm-relay/src/operationsInterfaces/namespaces.ts b/sdk/relay/arm-relay/src/operationsInterfaces/namespaces.ts new file mode 100644 index 000000000000..88f9b4ba419b --- /dev/null +++ b/sdk/relay/arm-relay/src/operationsInterfaces/namespaces.ts @@ -0,0 +1,228 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +import { PagedAsyncIterableIterator } from "@azure/core-paging"; +import { PollerLike, PollOperationState } from "@azure/core-lro"; +import { + RelayNamespace, + NamespacesListOptionalParams, + NamespacesListByResourceGroupOptionalParams, + AuthorizationRule, + NamespacesListAuthorizationRulesOptionalParams, + CheckNameAvailability, + NamespacesCheckNameAvailabilityOptionalParams, + NamespacesCheckNameAvailabilityResponse, + NamespacesCreateOrUpdateOptionalParams, + NamespacesCreateOrUpdateResponse, + NamespacesDeleteOptionalParams, + NamespacesGetOptionalParams, + NamespacesGetResponse, + RelayUpdateParameters, + NamespacesUpdateOptionalParams, + NamespacesUpdateResponse, + NamespacesCreateOrUpdateAuthorizationRuleOptionalParams, + NamespacesCreateOrUpdateAuthorizationRuleResponse, + NamespacesDeleteAuthorizationRuleOptionalParams, + NamespacesGetAuthorizationRuleOptionalParams, + NamespacesGetAuthorizationRuleResponse, + NamespacesListKeysOptionalParams, + NamespacesListKeysResponse, + RegenerateAccessKeyParameters, + NamespacesRegenerateKeysOptionalParams, + NamespacesRegenerateKeysResponse +} from "../models"; + +/// +/** Interface representing a Namespaces. */ +export interface Namespaces { + /** + * Lists all the available namespaces within the subscription regardless of the resourceGroups. + * @param options The options parameters. + */ + list( + options?: NamespacesListOptionalParams + ): PagedAsyncIterableIterator; + /** + * Lists all the available namespaces within the ResourceGroup. + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param options The options parameters. + */ + listByResourceGroup( + resourceGroupName: string, + options?: NamespacesListByResourceGroupOptionalParams + ): PagedAsyncIterableIterator; + /** + * Authorization rules for a namespace. + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param namespaceName The namespace name + * @param options The options parameters. + */ + listAuthorizationRules( + resourceGroupName: string, + namespaceName: string, + options?: NamespacesListAuthorizationRulesOptionalParams + ): PagedAsyncIterableIterator; + /** + * Check the specified namespace name availability. + * @param parameters Parameters to check availability of the specified namespace name. + * @param options The options parameters. + */ + checkNameAvailability( + parameters: CheckNameAvailability, + options?: NamespacesCheckNameAvailabilityOptionalParams + ): Promise; + /** + * Create Azure Relay namespace. + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param namespaceName The namespace name + * @param parameters Parameters supplied to create a namespace resource. + * @param options The options parameters. + */ + beginCreateOrUpdate( + resourceGroupName: string, + namespaceName: string, + parameters: RelayNamespace, + options?: NamespacesCreateOrUpdateOptionalParams + ): Promise< + PollerLike< + PollOperationState, + NamespacesCreateOrUpdateResponse + > + >; + /** + * Create Azure Relay namespace. + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param namespaceName The namespace name + * @param parameters Parameters supplied to create a namespace resource. + * @param options The options parameters. + */ + beginCreateOrUpdateAndWait( + resourceGroupName: string, + namespaceName: string, + parameters: RelayNamespace, + options?: NamespacesCreateOrUpdateOptionalParams + ): Promise; + /** + * Deletes an existing namespace. This operation also removes all associated resources under the + * namespace. + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param namespaceName The namespace name + * @param options The options parameters. + */ + beginDelete( + resourceGroupName: string, + namespaceName: string, + options?: NamespacesDeleteOptionalParams + ): Promise, void>>; + /** + * Deletes an existing namespace. This operation also removes all associated resources under the + * namespace. + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param namespaceName The namespace name + * @param options The options parameters. + */ + beginDeleteAndWait( + resourceGroupName: string, + namespaceName: string, + options?: NamespacesDeleteOptionalParams + ): Promise; + /** + * Returns the description for the specified namespace. + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param namespaceName The namespace name + * @param options The options parameters. + */ + get( + resourceGroupName: string, + namespaceName: string, + options?: NamespacesGetOptionalParams + ): Promise; + /** + * Creates or updates a namespace. Once created, this namespace's resource manifest is immutable. This + * operation is idempotent. + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param namespaceName The namespace name + * @param parameters Parameters for updating a namespace resource. + * @param options The options parameters. + */ + update( + resourceGroupName: string, + namespaceName: string, + parameters: RelayUpdateParameters, + options?: NamespacesUpdateOptionalParams + ): Promise; + /** + * Creates or updates an authorization rule for a namespace. + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param namespaceName The namespace name + * @param authorizationRuleName The authorization rule name. + * @param parameters The authorization rule parameters. + * @param options The options parameters. + */ + createOrUpdateAuthorizationRule( + resourceGroupName: string, + namespaceName: string, + authorizationRuleName: string, + parameters: AuthorizationRule, + options?: NamespacesCreateOrUpdateAuthorizationRuleOptionalParams + ): Promise; + /** + * Deletes a namespace authorization rule. + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param namespaceName The namespace name + * @param authorizationRuleName The authorization rule name. + * @param options The options parameters. + */ + deleteAuthorizationRule( + resourceGroupName: string, + namespaceName: string, + authorizationRuleName: string, + options?: NamespacesDeleteAuthorizationRuleOptionalParams + ): Promise; + /** + * Authorization rule for a namespace by name. + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param namespaceName The namespace name + * @param authorizationRuleName The authorization rule name. + * @param options The options parameters. + */ + getAuthorizationRule( + resourceGroupName: string, + namespaceName: string, + authorizationRuleName: string, + options?: NamespacesGetAuthorizationRuleOptionalParams + ): Promise; + /** + * Primary and secondary connection strings to the namespace. + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param namespaceName The namespace name + * @param authorizationRuleName The authorization rule name. + * @param options The options parameters. + */ + listKeys( + resourceGroupName: string, + namespaceName: string, + authorizationRuleName: string, + options?: NamespacesListKeysOptionalParams + ): Promise; + /** + * Regenerates the primary or secondary connection strings to the namespace. + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param namespaceName The namespace name + * @param authorizationRuleName The authorization rule name. + * @param parameters Parameters supplied to regenerate authorization rule. + * @param options The options parameters. + */ + regenerateKeys( + resourceGroupName: string, + namespaceName: string, + authorizationRuleName: string, + parameters: RegenerateAccessKeyParameters, + options?: NamespacesRegenerateKeysOptionalParams + ): Promise; +} diff --git a/sdk/relay/arm-relay/src/operationsInterfaces/operations.ts b/sdk/relay/arm-relay/src/operationsInterfaces/operations.ts new file mode 100644 index 000000000000..44649d330cff --- /dev/null +++ b/sdk/relay/arm-relay/src/operationsInterfaces/operations.ts @@ -0,0 +1,22 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +import { PagedAsyncIterableIterator } from "@azure/core-paging"; +import { Operation, OperationsListOptionalParams } from "../models"; + +/// +/** Interface representing a Operations. */ +export interface Operations { + /** + * Lists all available Relay REST API operations. + * @param options The options parameters. + */ + list( + options?: OperationsListOptionalParams + ): PagedAsyncIterableIterator; +} diff --git a/sdk/relay/arm-relay/src/operationsInterfaces/wCFRelays.ts b/sdk/relay/arm-relay/src/operationsInterfaces/wCFRelays.ts new file mode 100644 index 000000000000..5f8ef22f50c7 --- /dev/null +++ b/sdk/relay/arm-relay/src/operationsInterfaces/wCFRelays.ts @@ -0,0 +1,179 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +import { PagedAsyncIterableIterator } from "@azure/core-paging"; +import { + WcfRelay, + WCFRelaysListByNamespaceOptionalParams, + AuthorizationRule, + WCFRelaysListAuthorizationRulesOptionalParams, + WCFRelaysCreateOrUpdateOptionalParams, + WCFRelaysCreateOrUpdateResponse, + WCFRelaysDeleteOptionalParams, + WCFRelaysGetOptionalParams, + WCFRelaysGetResponse, + WCFRelaysCreateOrUpdateAuthorizationRuleOptionalParams, + WCFRelaysCreateOrUpdateAuthorizationRuleResponse, + WCFRelaysDeleteAuthorizationRuleOptionalParams, + WCFRelaysGetAuthorizationRuleOptionalParams, + WCFRelaysGetAuthorizationRuleResponse, + WCFRelaysListKeysOptionalParams, + WCFRelaysListKeysResponse, + RegenerateAccessKeyParameters, + WCFRelaysRegenerateKeysOptionalParams, + WCFRelaysRegenerateKeysResponse +} from "../models"; + +/// +/** Interface representing a WCFRelays. */ +export interface WCFRelays { + /** + * Lists the WCF relays within the namespace. + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param namespaceName The namespace name + * @param options The options parameters. + */ + listByNamespace( + resourceGroupName: string, + namespaceName: string, + options?: WCFRelaysListByNamespaceOptionalParams + ): PagedAsyncIterableIterator; + /** + * Authorization rules for a WCF relay. + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param namespaceName The namespace name + * @param relayName The relay name. + * @param options The options parameters. + */ + listAuthorizationRules( + resourceGroupName: string, + namespaceName: string, + relayName: string, + options?: WCFRelaysListAuthorizationRulesOptionalParams + ): PagedAsyncIterableIterator; + /** + * Creates or updates a WCF relay. This operation is idempotent. + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param namespaceName The namespace name + * @param relayName The relay name. + * @param parameters Parameters supplied to create a WCF relay. + * @param options The options parameters. + */ + createOrUpdate( + resourceGroupName: string, + namespaceName: string, + relayName: string, + parameters: WcfRelay, + options?: WCFRelaysCreateOrUpdateOptionalParams + ): Promise; + /** + * Deletes a WCF relay. + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param namespaceName The namespace name + * @param relayName The relay name. + * @param options The options parameters. + */ + delete( + resourceGroupName: string, + namespaceName: string, + relayName: string, + options?: WCFRelaysDeleteOptionalParams + ): Promise; + /** + * Returns the description for the specified WCF relay. + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param namespaceName The namespace name + * @param relayName The relay name. + * @param options The options parameters. + */ + get( + resourceGroupName: string, + namespaceName: string, + relayName: string, + options?: WCFRelaysGetOptionalParams + ): Promise; + /** + * Creates or updates an authorization rule for a WCF relay. + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param namespaceName The namespace name + * @param relayName The relay name. + * @param authorizationRuleName The authorization rule name. + * @param parameters The authorization rule parameters. + * @param options The options parameters. + */ + createOrUpdateAuthorizationRule( + resourceGroupName: string, + namespaceName: string, + relayName: string, + authorizationRuleName: string, + parameters: AuthorizationRule, + options?: WCFRelaysCreateOrUpdateAuthorizationRuleOptionalParams + ): Promise; + /** + * Deletes a WCF relay authorization rule. + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param namespaceName The namespace name + * @param relayName The relay name. + * @param authorizationRuleName The authorization rule name. + * @param options The options parameters. + */ + deleteAuthorizationRule( + resourceGroupName: string, + namespaceName: string, + relayName: string, + authorizationRuleName: string, + options?: WCFRelaysDeleteAuthorizationRuleOptionalParams + ): Promise; + /** + * Get authorizationRule for a WCF relay by name. + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param namespaceName The namespace name + * @param relayName The relay name. + * @param authorizationRuleName The authorization rule name. + * @param options The options parameters. + */ + getAuthorizationRule( + resourceGroupName: string, + namespaceName: string, + relayName: string, + authorizationRuleName: string, + options?: WCFRelaysGetAuthorizationRuleOptionalParams + ): Promise; + /** + * Primary and secondary connection strings to the WCF relay. + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param namespaceName The namespace name + * @param relayName The relay name. + * @param authorizationRuleName The authorization rule name. + * @param options The options parameters. + */ + listKeys( + resourceGroupName: string, + namespaceName: string, + relayName: string, + authorizationRuleName: string, + options?: WCFRelaysListKeysOptionalParams + ): Promise; + /** + * Regenerates the primary or secondary connection strings to the WCF relay. + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param namespaceName The namespace name + * @param relayName The relay name. + * @param authorizationRuleName The authorization rule name. + * @param parameters Parameters supplied to regenerate authorization rule. + * @param options The options parameters. + */ + regenerateKeys( + resourceGroupName: string, + namespaceName: string, + relayName: string, + authorizationRuleName: string, + parameters: RegenerateAccessKeyParameters, + options?: WCFRelaysRegenerateKeysOptionalParams + ): Promise; +} diff --git a/sdk/relay/arm-relay/src/relayAPI.ts b/sdk/relay/arm-relay/src/relayAPI.ts new file mode 100644 index 000000000000..483660d0683c --- /dev/null +++ b/sdk/relay/arm-relay/src/relayAPI.ts @@ -0,0 +1,92 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +import * as coreClient from "@azure/core-client"; +import * as coreAuth from "@azure/core-auth"; +import { + OperationsImpl, + NamespacesImpl, + HybridConnectionsImpl, + WCFRelaysImpl +} from "./operations"; +import { + Operations, + Namespaces, + HybridConnections, + WCFRelays +} from "./operationsInterfaces"; +import { RelayAPIOptionalParams } from "./models"; + +export class RelayAPI extends coreClient.ServiceClient { + $host: string; + apiVersion: string; + subscriptionId: string; + + /** + * Initializes a new instance of the RelayAPI class. + * @param credentials Subscription credentials which uniquely identify client subscription. + * @param subscriptionId Subscription credentials which uniquely identify the Microsoft Azure + * subscription. The subscription ID forms part of the URI for every service call. + * @param options The parameter options + */ + constructor( + credentials: coreAuth.TokenCredential, + subscriptionId: string, + options?: RelayAPIOptionalParams + ) { + if (credentials === undefined) { + throw new Error("'credentials' cannot be null"); + } + if (subscriptionId === undefined) { + throw new Error("'subscriptionId' cannot be null"); + } + + // Initializing default values for options + if (!options) { + options = {}; + } + const defaults: RelayAPIOptionalParams = { + requestContentType: "application/json; charset=utf-8", + credential: credentials + }; + + const packageDetails = `azsdk-js-arm-relay/3.0.0`; + const userAgentPrefix = + options.userAgentOptions && options.userAgentOptions.userAgentPrefix + ? `${options.userAgentOptions.userAgentPrefix} ${packageDetails}` + : `${packageDetails}`; + + if (!options.credentialScopes) { + options.credentialScopes = ["https://management.azure.com/.default"]; + } + const optionsWithDefaults = { + ...defaults, + ...options, + userAgentOptions: { + userAgentPrefix + }, + baseUri: options.endpoint || "https://management.azure.com" + }; + super(optionsWithDefaults); + // Parameter assignments + this.subscriptionId = subscriptionId; + + // Assigning values to Constant parameters + this.$host = options.$host || "https://management.azure.com"; + this.apiVersion = options.apiVersion || "2017-04-01"; + this.operations = new OperationsImpl(this); + this.namespaces = new NamespacesImpl(this); + this.hybridConnections = new HybridConnectionsImpl(this); + this.wCFRelays = new WCFRelaysImpl(this); + } + + operations: Operations; + namespaces: Namespaces; + hybridConnections: HybridConnections; + wCFRelays: WCFRelays; +} diff --git a/sdk/relay/arm-relay/src/relayManagementClient.ts b/sdk/relay/arm-relay/src/relayManagementClient.ts deleted file mode 100644 index 41bfce598bec..000000000000 --- a/sdk/relay/arm-relay/src/relayManagementClient.ts +++ /dev/null @@ -1,49 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for - * license information. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is - * regenerated. - */ - -import * as msRest from "@azure/ms-rest-js"; -import * as Models from "./models"; -import * as Mappers from "./models/mappers"; -import * as operations from "./operations"; -import { RelayManagementClientContext } from "./relayManagementClientContext"; - - -class RelayManagementClient extends RelayManagementClientContext { - // Operation groups - operations: operations.Operations; - namespaces: operations.Namespaces; - hybridConnections: operations.HybridConnections; - wCFRelays: operations.WCFRelays; - - /** - * Initializes a new instance of the RelayManagementClient class. - * @param credentials Credentials needed for the client to connect to Azure. - * @param subscriptionId Subscription credentials which uniquely identify the Microsoft Azure - * subscription. The subscription ID forms part of the URI for every service call. - * @param [options] The parameter options - */ - constructor(credentials: msRest.ServiceClientCredentials, subscriptionId: string, options?: Models.RelayManagementClientOptions) { - super(credentials, subscriptionId, options); - this.operations = new operations.Operations(this); - this.namespaces = new operations.Namespaces(this); - this.hybridConnections = new operations.HybridConnections(this); - this.wCFRelays = new operations.WCFRelays(this); - } -} - -// Operation Specifications - -export { - RelayManagementClient, - RelayManagementClientContext, - Models as RelayManagementModels, - Mappers as RelayManagementMappers -}; -export * from "./operations"; diff --git a/sdk/relay/arm-relay/src/relayManagementClientContext.ts b/sdk/relay/arm-relay/src/relayManagementClientContext.ts deleted file mode 100644 index a00071e51c98..000000000000 --- a/sdk/relay/arm-relay/src/relayManagementClientContext.ts +++ /dev/null @@ -1,63 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for - * license information. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is - * regenerated. - */ - -import * as Models from "./models"; -import * as msRest from "@azure/ms-rest-js"; -import * as msRestAzure from "@azure/ms-rest-azure-js"; - -const packageName = "@azure/arm-relay"; -const packageVersion = "0.1.0"; - -export class RelayManagementClientContext extends msRestAzure.AzureServiceClient { - credentials: msRest.ServiceClientCredentials; - subscriptionId: string; - apiVersion?: string; - - /** - * Initializes a new instance of the RelayManagementClient class. - * @param credentials Credentials needed for the client to connect to Azure. - * @param subscriptionId Subscription credentials which uniquely identify the Microsoft Azure - * subscription. The subscription ID forms part of the URI for every service call. - * @param [options] The parameter options - */ - constructor(credentials: msRest.ServiceClientCredentials, subscriptionId: string, options?: Models.RelayManagementClientOptions) { - if (credentials == undefined) { - throw new Error('\'credentials\' cannot be null.'); - } - if (subscriptionId == undefined) { - throw new Error('\'subscriptionId\' cannot be null.'); - } - - if (!options) { - options = {}; - } - if(!options.userAgent) { - const defaultUserAgent = msRestAzure.getDefaultUserAgentValue(); - options.userAgent = `${packageName}/${packageVersion} ${defaultUserAgent}`; - } - - super(credentials, options); - - this.apiVersion = '2017-04-01'; - this.acceptLanguage = 'en-US'; - this.longRunningOperationRetryTimeout = 30; - this.baseUri = options.baseUri || this.baseUri || "https://management.azure.com"; - this.requestContentType = "application/json; charset=utf-8"; - this.credentials = credentials; - this.subscriptionId = subscriptionId; - - if(options.acceptLanguage !== null && options.acceptLanguage !== undefined) { - this.acceptLanguage = options.acceptLanguage; - } - if(options.longRunningOperationRetryTimeout !== null && options.longRunningOperationRetryTimeout !== undefined) { - this.longRunningOperationRetryTimeout = options.longRunningOperationRetryTimeout; - } - } -} diff --git a/sdk/relay/arm-relay/test/relay_examples.ts b/sdk/relay/arm-relay/test/relay_examples.ts new file mode 100644 index 000000000000..f1b24b0686a4 --- /dev/null +++ b/sdk/relay/arm-relay/test/relay_examples.ts @@ -0,0 +1,176 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +import { + env, + record, + RecorderEnvironmentSetup, + Recorder, + delay, + isPlaybackMode +} from "@azure-tools/test-recorder"; +import * as assert from "assert"; +import { ClientSecretCredential } from "@azure/identity"; +import { RelayAPI } from "../src/relayAPI"; + +const recorderEnvSetup: RecorderEnvironmentSetup = { + replaceableVariables: { + AZURE_CLIENT_ID: "azure_client_id", + AZURE_CLIENT_SECRET: "azure_client_secret", + AZURE_TENANT_ID: "88888888-8888-8888-8888-888888888888", + SUBSCRIPTION_ID: "azure_subscription_id" + }, + customizationsOnRecordings: [ + (recording: any): any => + recording.replace( + /"access_token":"[^"]*"/g, + `"access_token":"access_token"` + ) + ], + queryParametersToSkip: [] +}; + +export const testPollingOptions = { + updateIntervalInMs: isPlaybackMode() ? 0 : undefined, +}; + +describe("Relay test", () => { + let recorder: Recorder; + let subscriptionId: string; + let client: RelayAPI; + let location: string; + let resourceGroup: string; + let relayName: string; + let namespaceName: string; + let authorizationRuleName: string; + + beforeEach(async function() { + recorder = record(this, recorderEnvSetup); + subscriptionId = env.SUBSCRIPTION_ID; + // This is an example of how the environment variables are used + const credential = new ClientSecretCredential( + env.AZURE_TENANT_ID, + env.AZURE_CLIENT_ID, + env.AZURE_CLIENT_SECRET + ); + client = new RelayAPI(credential, subscriptionId); + location = "eastus"; + resourceGroup = "myjstest"; + relayName = "myrelayxxx"; + namespaceName = "mynamespacexxx"; + authorizationRuleName = "myauthorizationxxxx"; + }); + + afterEach(async function() { + await recorder.stop(); + }); + + it("namespaces create test", async function() { + const res = await client.namespaces.beginCreateOrUpdateAndWait(resourceGroup,namespaceName,{ + location: location, + sku: { + name: "Standard", + tier: "Standard" + }, + tags: { + tag1: "value1" + } + }); + assert.equal(res.name,namespaceName); + }); + + it("namespaces get test", async function() { + const res = await client.namespaces.get(resourceGroup,namespaceName); + assert.equal(res.name,namespaceName); + }); + + it("namespaces list test", async function() { + const resArray = new Array(); + for await (let item of client.namespaces.list()){ + resArray.push(item); + } + }); + + it("namespaces update test", async function() { + const res = await client.namespaces.update(resourceGroup,namespaceName,{ + tags: { + tag1: "value1", + tag2: "value2", + tag3: "value3" + } + }); + assert.equal(res.type,"Microsoft.Relay/Namespaces"); + }); + + it("wCFRelays create test", async function() { + const res = await client.wCFRelays.createOrUpdate(resourceGroup,namespaceName,relayName,{ + relayType: "NetTcp", + requiresClientAuthorization: true, + requiresTransportSecurity: true, + }); + assert.equal(res.name,relayName); + }); + + it("wCFRelays createOrUpdateAuthorizationRule test", async function() { + const res = await client.wCFRelays.createOrUpdateAuthorizationRule(resourceGroup,namespaceName,relayName,authorizationRuleName,{rights:["Listen","Send"]}); + assert.equal(res.name,authorizationRuleName); + }); + + it("wCFRelays get test", async function() { + const res = await client.wCFRelays.get(resourceGroup,namespaceName,relayName); + assert.equal(res.name,relayName); + }); + + it("wCFRelays getAuthorizationRule test", async function() { + const res = await client.wCFRelays.getAuthorizationRule(resourceGroup,namespaceName,relayName,authorizationRuleName); + assert.equal(res.name,authorizationRuleName); + }); + + it("wCFRelays list test", async function() { + const resArray = new Array(); + for await (let item of client.wCFRelays.listByNamespace(resourceGroup,namespaceName)){ + resArray.push(item); + } + assert.equal(resArray.length,1); + }); + + it("wCFRelays listAuthorizationRules test", async function() { + const resArray = new Array(); + for await (let item of client.wCFRelays.listAuthorizationRules(resourceGroup,namespaceName,authorizationRuleName)){ + resArray.push(item); + } + assert.equal(resArray.length,0); + }); + + it("wCFRelays deleteAuthorizationRule test", async function() { + const res = await client.wCFRelays.deleteAuthorizationRule(resourceGroup,namespaceName,relayName,authorizationRuleName); + const resArray = new Array(); + for await (let item of client.wCFRelays.listAuthorizationRules(resourceGroup,namespaceName,authorizationRuleName)){ + resArray.push(item); + } + assert.equal(resArray.length,0); + }); + + it("wCFRelays delete test", async function() { + const res = await client.wCFRelays.delete(resourceGroup,namespaceName,relayName); + const resArray = new Array(); + for await (let item of client.wCFRelays.listByNamespace(resourceGroup,namespaceName)){ + resArray.push(item); + } + assert.equal(resArray.length,0); + }); + + it("namespaces delete test", async function() { + const res = await client.namespaces.beginDeleteAndWait(resourceGroup,namespaceName,testPollingOptions); + const resArray = new Array(); + for await (let item of client.namespaces.listByResourceGroup(resourceGroup)){ + resArray.push(item); + } + assert.equal(resArray.length,0); + }); +}); diff --git a/sdk/relay/arm-relay/tsconfig.json b/sdk/relay/arm-relay/tsconfig.json index 87bbf5b5fa49..6e3251194117 100644 --- a/sdk/relay/arm-relay/tsconfig.json +++ b/sdk/relay/arm-relay/tsconfig.json @@ -3,17 +3,17 @@ "module": "es6", "moduleResolution": "node", "strict": true, - "target": "es5", + "target": "es6", "sourceMap": true, "declarationMap": true, "esModuleInterop": true, "allowSyntheticDefaultImports": true, "forceConsistentCasingInFileNames": true, - "lib": ["es6"], + "lib": ["es6", "dom"], "declaration": true, - "outDir": "./esm", + "outDir": "./dist-esm", "importHelpers": true }, - "include": ["./src/**/*.ts"], + "include": ["./src/**/*.ts", "./test/**/*.ts"], "exclude": ["node_modules"] } diff --git a/sdk/relay/ci.yml b/sdk/relay/ci.yml new file mode 100644 index 000000000000..4c9ab208995f --- /dev/null +++ b/sdk/relay/ci.yml @@ -0,0 +1,29 @@ +# NOTE: Please refer to https://aka.ms/azsdk/engsys/ci-yaml before editing this file. +trigger: + branches: + include: + - main + - release/* + - hotfix/* + paths: + include: + - sdk/relay/ + +pr: + branches: + include: + - main + - release/* + - hotfix/* + paths: + include: + - sdk/relay/ + +extends: + template: ../../eng/pipelines/templates/stages/archetype-sdk-client.yml + parameters: + ServiceDirectory: relay + Artifacts: + - name: azure-arm-relay + safeName: azurearmrelay + \ No newline at end of file