diff --git a/common/config/rush/pnpm-lock.yaml b/common/config/rush/pnpm-lock.yaml index 4f861daab837..233ffcccc151 100644 --- a/common/config/rush/pnpm-lock.yaml +++ b/common/config/rush/pnpm-lock.yaml @@ -32,6 +32,7 @@ specifiers: '@rush-temp/arm-eventhub': file:./projects/arm-eventhub.tgz '@rush-temp/arm-extendedlocation': file:./projects/arm-extendedlocation.tgz '@rush-temp/arm-features': file:./projects/arm-features.tgz + '@rush-temp/arm-iothub': file:./projects/arm-iothub.tgz '@rush-temp/arm-keyvault': file:./projects/arm-keyvault.tgz '@rush-temp/arm-links': file:./projects/arm-links.tgz '@rush-temp/arm-loadtestservice': file:./projects/arm-loadtestservice.tgz @@ -201,6 +202,7 @@ dependencies: '@rush-temp/arm-eventhub': file:projects/arm-eventhub.tgz '@rush-temp/arm-extendedlocation': file:projects/arm-extendedlocation.tgz '@rush-temp/arm-features': file:projects/arm-features.tgz + '@rush-temp/arm-iothub': file:projects/arm-iothub.tgz '@rush-temp/arm-keyvault': file:projects/arm-keyvault.tgz '@rush-temp/arm-links': file:projects/arm-links.tgz '@rush-temp/arm-loadtestservice': file:projects/arm-loadtestservice.tgz @@ -8661,6 +8663,27 @@ packages: uglify-js: 3.14.3 dev: false + file:projects/arm-iothub.tgz: + resolution: {integrity: sha512-PzFOxAYNZCA5fFinZSNlhYM6Z5GYX/yJkJAKycsLISLkEDrj70v3ihSJqSoyI3o9y0oxM1GqeijIgfPgvj4zWg==, tarball: file:projects/arm-iothub.tgz} + name: '@rush-temp/arm-iothub' + 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-keyvault.tgz: resolution: {integrity: sha512-FnvWshHbYbXqHFfanHE8YzqznZBDWFIDY3Cud0PNTTds8esvpH3gRYEuZWYMcLGXymShlYeLdYaUcxMEk1/eCA==, tarball: file:projects/arm-keyvault.tgz} name: '@rush-temp/arm-keyvault' diff --git a/rush.json b/rush.json index 0bdf615ba0d5..40ebd9ac7a38 100644 --- a/rush.json +++ b/rush.json @@ -1,7 +1,7 @@ /** * This is the main configuration file for Rush. * For full documentation, please see https://rushjs.io - */ { + */{ "$schema": "https://developer.microsoft.com/json-schemas/rush/v5/rush.schema.json", /** * (Required) This specifies the version of the Rush engine to be used in this repo. @@ -1155,6 +1155,11 @@ "packageName": "@azure/arm-relay", "projectFolder": "sdk/relay/arm-relay", "versionPolicyName": "management" + }, + { + "packageName": "@azure/arm-iothub", + "projectFolder": "sdk/iothub/arm-iothub", + "versionPolicyName": "management" } ] -} +} \ No newline at end of file diff --git a/sdk/iothub/arm-iothub/CHANGELOG.md b/sdk/iothub/arm-iothub/CHANGELOG.md new file mode 100644 index 000000000000..8225e3ce3ebe --- /dev/null +++ b/sdk/iothub/arm-iothub/CHANGELOG.md @@ -0,0 +1,11 @@ +# Release History + +## 6.0.0 (2021-12-17) + +The package of @azure/arm-iothub is using our next generation design principles since version 6.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/iothub/arm-iothub/LICENSE.txt b/sdk/iothub/arm-iothub/LICENSE similarity index 99% rename from sdk/iothub/arm-iothub/LICENSE.txt rename to sdk/iothub/arm-iothub/LICENSE index 2d3163745319..ccb63b166732 100644 --- a/sdk/iothub/arm-iothub/LICENSE.txt +++ b/sdk/iothub/arm-iothub/LICENSE @@ -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/iothub/arm-iothub/README.md b/sdk/iothub/arm-iothub/README.md index cf53b0c0aae0..81af5383d079 100644 --- a/sdk/iothub/arm-iothub/README.md +++ b/sdk/iothub/arm-iothub/README.md @@ -1,107 +1,98 @@ -## Azure IotHubClient SDK for JavaScript +# Azure iotHub client library for JavaScript -This package contains an isomorphic SDK for IotHubClient. +This package contains an isomorphic SDK (runs both in Node.js and in browsers) for Azure iotHub client. + +Use this API to manage the IoT hubs in your Azure subscription. + +[Source code](https://github.com/Azure/azure-sdk-for-js/tree/main/sdk/iothub/arm-iothub) | +[Package (NPM)](https://www.npmjs.com/package/@azure/arm-iothub) | +[API reference documentation](https://docs.microsoft.com/javascript/api/@azure/arm-iothub) | +[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. +- Latest versions of Safari, Chrome, Edge and Firefox. + +### Prerequisites + +- An [Azure subscription][azure_sub]. -### How to Install +### Install the `@azure/arm-iothub` package + +Install the Azure iotHub client library for JavaScript with `npm`: ```bash npm install @azure/arm-iothub ``` -### How to use +### Create and authenticate a `IotHubClient` -#### nodejs - client creation and list operations as an example written in TypeScript. +To create a client object to access the Azure iotHub API, you will need the `endpoint` of your Azure iotHub resource and a `credential`. The Azure iotHub client can use Azure Active Directory credentials to authenticate. +You can find the endpoint for your Azure iotHub 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). -- Please install minimum version of `"@azure/ms-rest-nodeauth": "^3.0.0"`. +To use the [DefaultAzureCredential][defaultazurecredential] provider shown below, or other credential providers provided with the Azure SDK, please install the `@azure/identity` package: ```bash -npm install @azure/ms-rest-nodeauth@"^3.0.0" +npm install @azure/identity ``` -##### Sample code +You will also need to **register a new AAD application and grant access to Azure iotHub** 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`. -While the below sample uses the interactive login, other authentication options can be found in the [README.md file of @azure/ms-rest-nodeauth](https://www.npmjs.com/package/@azure/ms-rest-nodeauth) package +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). -```typescript -const msRestNodeAuth = require("@azure/ms-rest-nodeauth"); +```javascript const { IotHubClient } = require("@azure/arm-iothub"); -const subscriptionId = process.env["AZURE_SUBSCRIPTION_ID"]; - -msRestNodeAuth - .interactiveLogin() - .then((creds) => { - const client = new IotHubClient(creds, subscriptionId); - client.operations.list().then((result) => { - console.log("The result is:"); - console.log(result); - }); - }) - .catch((err) => { - console.error(err); - }); +const { DefaultAzureCredential } = require("@azure/identity"); +const subscriptionId = "00000000-0000-0000-0000-000000000000"; +const client = new IotHubClient(new DefaultAzureCredential(), subscriptionId); ``` -#### browser - Authentication, client creation and list operations as an example written in JavaScript. -##### Install @azure/ms-rest-browserauth +### 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). -```bash -npm install @azure/ms-rest-browserauth -``` +## Key concepts + +### IotHubClient + +`IotHubClient` is the primary interface for developers using the Azure iotHub client library. Explore the methods on this client object to understand the different features of the Azure iotHub service that you can access. -##### 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-iothub sample - - - - - - - - +## Troubleshooting + +### Logging + +Enabling logging may help uncover useful information about failures. In order to see a log of HTTP requests and responses, set the `AZURE_LOG_LEVEL` environment variable to `info`. Alternatively, logging can be enabled at runtime by calling `setLogLevel` in the `@azure/logger`: + +```javascript +const { setLogLevel } = require("@azure/logger"); +setLogLevel("info"); ``` +For more detailed instructions on how to enable logs, you can look at the [@azure/logger package docs](https://github.com/Azure/azure-sdk-for-js/tree/main/sdk/core/logger). + +## Next steps + +Please take a look at the [samples](https://github.com/Azure-Samples/azure-samples-js-management) directory for detailed examples on how to use this library. + +## Contributing + +If you'd like to contribute to this library, please read the [contributing guide](https://github.com/Azure/azure-sdk-for-js/blob/main/CONTRIBUTING.md) to learn more about how to build and test the code. + ## Related projects -- [Microsoft Azure SDK for Javascript](https://github.com/Azure/azure-sdk-for-js) +- [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%2Fiothub%2Farm-iothub%2FREADME.png) -![Impressions](https://azure-sdk-impressions.azurewebsites.net/api/impressions/azure-sdk-for-js/sdk/iothub/arm-iothub/README.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/iothub/arm-iothub/_meta.json b/sdk/iothub/arm-iothub/_meta.json new file mode 100644 index 000000000000..d56468474e3e --- /dev/null +++ b/sdk/iothub/arm-iothub/_meta.json @@ -0,0 +1,7 @@ +{ + "commit": "e6d1396612965f2af8df6bb941be19681147930a", + "readme": "specification/iothub/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/iothub/resource-manager/readme.md --use=@autorest/typescript@6.0.0-alpha.16.20211207.1", + "repository_url": "https://github.com/Azure/azure-rest-api-specs.git", + "use": "@autorest/typescript@6.0.0-alpha.16.20211207.1" +} \ No newline at end of file diff --git a/sdk/iothub/arm-iothub/api-extractor.json b/sdk/iothub/arm-iothub/api-extractor.json new file mode 100644 index 000000000000..7c973756a144 --- /dev/null +++ b/sdk/iothub/arm-iothub/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-iothub.d.ts" + }, + "messages": { + "tsdocMessageReporting": { "default": { "logLevel": "none" } }, + "extractorMessageReporting": { + "ae-missing-release-tag": { "logLevel": "none" }, + "ae-unresolved-link": { "logLevel": "none" } + } + } +} diff --git a/sdk/iothub/arm-iothub/package.json b/sdk/iothub/arm-iothub/package.json index 7824a6ad8e67..b060af0cfc83 100644 --- a/sdk/iothub/arm-iothub/package.json +++ b/sdk/iothub/arm-iothub/package.json @@ -1,57 +1,91 @@ { "name": "@azure/arm-iothub", + "sdk-type": "mgmt", "author": "Microsoft Corporation", - "description": "IotHubClient Library with typescript type definitions for node.js and browser.", - "version": "5.0.0", + "description": "A generated SDK for IotHubClient.", + "version": "6.0.0", + "engines": { "node": ">=12.0.0" }, "dependencies": { - "@azure/ms-rest-azure-js": "^2.0.1", - "@azure/ms-rest-js": "^2.0.4", - "tslib": "^1.10.0" + "@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-iothub.js", - "module": "./esm/iotHubClient.js", - "types": "./esm/iotHubClient.d.ts", + "main": "./dist/index.js", + "module": "./dist-esm/src/index.js", + "types": "./types/arm-iothub.d.ts", "devDependencies": { - "typescript": "^3.5.3", - "rollup": "^1.18.0", - "rollup-plugin-node-resolve": "^5.2.0", + "@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", - "uglify-js": "^3.6.0" + "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/iothub/arm-iothub", "repository": { "type": "git", "url": "https://github.com/Azure/azure-sdk-for-js.git" }, - "bugs": { - "url": "https://github.com/Azure/azure-sdk-for-js/issues" - }, + "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-iothub.js.map'\" -o ./dist/arm-iothub.min.js ./dist/arm-iothub.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/iothub/arm-iothub/recordings/node/iothub_test/recording_iothubresource_create_test.js b/sdk/iothub/arm-iothub/recordings/node/iothub_test/recording_iothubresource_create_test.js new file mode 100644 index 000000000000..b2cc366bc579 --- /dev/null +++ b/sdk/iothub/arm-iothub/recordings/node/iothub_test/recording_iothubresource_create_test.js @@ -0,0 +1,2125 @@ +let nock = require('nock'); + +module.exports.hash = "26edd9fff69b00fd60ebaa1b94cf2391"; + +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', + '4150cca7-f51d-4a39-827d-43dbbebd0f00', + 'x-ms-ests-server', + '2.1.12261.15 - KRSLR1 ProdSlices', + 'Set-Cookie', + 'fpc=AmR1A5ecasxEhBvfvJmMVGM; expires=Sun, 16-Jan-2022 06:42:12 GMT; path=/; secure; HttpOnly; SameSite=None', + 'Set-Cookie', + 'esctx=AQABAAAAAAD--DLA3VO7QrddgJg7WevrNI72xBPfYS3EhQoRMUgfhASfpq0uU5-Dyv8XQyB7dreMxRPePCbPyLoy3Ba4tgeEH9lg8kq-eIUl1F1QZjTBLffCWE_jkFMSheqGPc1zpNabP6m-eMOWDzqxu_lAXwOyO1jjkKzV-qWvXJj6HgobeaeKOKHgPDAHGK5QS4lEf-AgAA; 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, 17 Dec 2021 06:42: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', + '6edbaf0b-a0a4-49c7-852a-1809e06a1000', + 'x-ms-ests-server', + '2.1.12261.15 - KRSLR1 ProdSlices', + 'Set-Cookie', + 'fpc=AiEHC3P1vRlPlMC9pVm4sfQ; expires=Sun, 16-Jan-2022 06:42:12 GMT; path=/; secure; HttpOnly; SameSite=None', + 'Set-Cookie', + 'esctx=AQABAAAAAAD--DLA3VO7QrddgJg7WevrWhFvvhW8cj5Di5cnx4FlPFFqxElUKRhI5yhd8n5VpGVvjPHKJZOUVi33Um-GwgO27uaOe4Hzl2LnKQxmeTsos61hkNSYRlFknoiClyKtWEszykhSazrbPoEf01zHcS_s_e41-a5Rm_zY-YuW60ip9VxhDj5iXvmabwWuAX-IgmYgAA; 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, 17 Dec 2021 06:42: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.4.0&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=0f2ecb92-6815-433d-9543-229746320dc4&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', + 'e0170dd1-a540-4246-afce-71fb6ba70a00', + 'x-ms-ests-server', + '2.1.12261.15 - SEASLR1 ProdSlices', + 'x-ms-clitelem', + '1,0,0,,', + 'Set-Cookie', + 'fpc=Auv30kBy0f9Hlt0ejoGCX3nLj78gAQAAAEMoTtkOAAAA; expires=Sun, 16-Jan-2022 06:42: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, 17 Dec 2021 06:42:12 GMT', + 'Content-Length', + '1393' +]); + +nock('https://management.azure.com:443', {"encodedQueryParams":true}) + .put('/subscriptions/azure_subscription_id/resourceGroups/myjstest/providers/Microsoft.Devices/IotHubs/myiothubxxxxyyyjjrr', {"location":"eastus","tags":{"key":"value1"},"etag":"AAAAAAFD6M4=","properties":{"ipFilterRules":[],"networkRuleSets":{"defaultAction":"Deny","applyToBuiltInEventHubEndpoint":true,"ipRules":[{"filterName":"rule1","action":"Allow","ipMask":"131.117.159.53"}]},"minTlsVersion":"1.2","eventHubEndpoints":{"events":{"retentionTimeInDays":1,"partitionCount":2}},"routing":{"endpoints":{"serviceBusQueues":[],"serviceBusTopics":[],"eventHubs":[],"storageContainers":[]},"routes":[]},"storageEndpoints":{"$default":{"sasTtlAsIso8601":"PT1H","connectionString":"","containerName":""}},"messagingEndpoints":{"fileNotifications":{"lockDurationAsIso8601":"PT1M","ttlAsIso8601":"PT1H","maxDeliveryCount":10}},"enableFileUploadNotifications":false,"cloudToDevice":{"maxDeliveryCount":10,"defaultTtlAsIso8601":"PT1H","feedback":{"lockDurationAsIso8601":"PT1M","ttlAsIso8601":"PT1H","maxDeliveryCount":10}},"features":"None"},"sku":{"name":"S1","capacity":1}}) + .query(true) + .reply(201, {"id":"/subscriptions/azure_subscription_id/resourceGroups/myjstest/providers/Microsoft.Devices/IotHubs/myiothubxxxxyyyjjrr","name":"myiothubxxxxyyyjjrr","type":"Microsoft.Devices/IotHubs","location":"eastus","tags":{"key":"value1"},"subscriptionid":"azure_subscription_id","resourcegroup":"myjstest","etag":"AAAAAAFD6M4=","properties":{"state":"Activating","provisioningState":"Accepted","ipFilterRules":[{"filterName":"rule1","action":"Accept","ipMask":"131.117.159.53"}],"networkRuleSets":{"defaultAction":"Deny","applyToBuiltInEventHubEndpoint":true,"ipRules":[{"filterName":"rule1","action":"Allow","ipMask":"131.117.159.53"}]},"eventHubEndpoints":{"events":{"retentionTimeInDays":1,"partitionCount":2},"operationsMonitoringEvents":{"retentionTimeInDays":1,"partitionCount":2}},"routing":{"endpoints":{"serviceBusQueues":[],"serviceBusTopics":[],"eventHubs":[],"storageContainers":[],"cosmosDBSqlCollections":[]},"routes":[],"fallbackRoute":{"name":"$fallback","source":"DeviceMessages","condition":"true","endpointNames":["events"],"isEnabled":false}},"storageEndpoints":{"$default":{"sasTtlAsIso8601":"PT1H","connectionString":"","containerName":""}},"messagingEndpoints":{"fileNotifications":{"lockDurationAsIso8601":"PT1M","ttlAsIso8601":"PT1H","maxDeliveryCount":10}},"enableFileUploadNotifications":false,"cloudToDevice":{"maxDeliveryCount":10,"defaultTtlAsIso8601":"PT1H","feedback":{"lockDurationAsIso8601":"PT1M","ttlAsIso8601":"PT1H","maxDeliveryCount":10}},"features":"None","minTlsVersion":"1.2","allowedFqdnList":[]},"sku":{"name":"S1","tier":"Standard","capacity":1}}, [ + 'Cache-Control', + 'no-cache', + 'Pragma', + 'no-cache', + 'Content-Length', + '1616', + 'Content-Type', + 'application/json; charset=utf-8', + 'Expires', + '-1', + 'Azure-AsyncOperation', + 'https://management.azure.com/subscriptions/azure_subscription_id/providers/Microsoft.Devices/locations/eastus/operationResults/aWQ9b3NfaWhfMWFiNTIxY2QtZjI1Ny00MzBkLWI3ZGQtYzJmMmFhMTA0NDJhO3JlZ2lvbj1lYXN0dXM=?api-version=2021-07-01&operationSource=other&asyncinfo', + 'Server', + 'Microsoft-HTTPAPI/2.0', + 'x-ms-ratelimit-remaining-subscription-resource-requests', + '4999', + 'x-ms-request-id', + 'b2f75b6d-a900-4bad-adaa-b5b6bc32c421', + 'x-ms-correlation-request-id', + 'b2f75b6d-a900-4bad-adaa-b5b6bc32c421', + 'x-ms-routing-request-id', + 'JAPANEAST:20211217T064220Z:b2f75b6d-a900-4bad-adaa-b5b6bc32c421', + 'Strict-Transport-Security', + 'max-age=31536000; includeSubDomains', + 'X-Content-Type-Options', + 'nosniff', + 'Date', + 'Fri, 17 Dec 2021 06:42:20 GMT' +]); + +nock('https://management.azure.com:443', {"encodedQueryParams":true}) + .get('/subscriptions/azure_subscription_id/providers/Microsoft.Devices/locations/eastus/operationResults/aWQ9b3NfaWhfMWFiNTIxY2QtZjI1Ny00MzBkLWI3ZGQtYzJmMmFhMTA0NDJhO3JlZ2lvbj1lYXN0dXM=') + .query(true) + .reply(200, ["1f8b0800000000000400edbd07601c499625262f6dca7b7f4af54ad7e074a10880601324d8904010ecc188cde692ec1d69472329ab2a81ca6556655d661640cced9dbcf7de7befbdf7de7befbdf7ba3b9d4e27f7dfff3f5c6664016cf6ce4adac99e2180aac81f3f7e7c1f3f227ef1474d9bb5ebe6a3471fbd5a2f97c5f2e2a3","5ff2ff0089ccbd4914000000"], [ + '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', + 'Server', + 'Microsoft-HTTPAPI/2.0', + 'x-ms-ratelimit-remaining-subscription-reads', + '11999', + 'x-ms-request-id', + 'cd945919-9b54-4d17-8463-1e228e3fc352', + 'x-ms-correlation-request-id', + 'cd945919-9b54-4d17-8463-1e228e3fc352', + 'x-ms-routing-request-id', + 'JAPANEAST:20211217T064221Z:cd945919-9b54-4d17-8463-1e228e3fc352', + 'Strict-Transport-Security', + 'max-age=31536000; includeSubDomains', + 'X-Content-Type-Options', + 'nosniff', + 'Date', + 'Fri, 17 Dec 2021 06:42:20 GMT' +]); + +nock('https://management.azure.com:443', {"encodedQueryParams":true}) + .get('/subscriptions/azure_subscription_id/providers/Microsoft.Devices/locations/eastus/operationResults/aWQ9b3NfaWhfMWFiNTIxY2QtZjI1Ny00MzBkLWI3ZGQtYzJmMmFhMTA0NDJhO3JlZ2lvbj1lYXN0dXM=') + .query(true) + .reply(200, ["1f8b0800000000000400edbd07601c499625262f6dca7b7f4af54ad7e074a10880601324d8904010ecc188cde692ec1d69472329ab2a81ca6556655d661640cced9dbcf7de7befbdf7de7befbdf7ba3b9d4e27f7dfff3f5c6664016cf6ce4adac99e2180aac81f3f7e7c1f3f227ef1474d9bb5ebe6a3471fbd5a2f97c5f2e2a3","5ff2ff0089ccbd4914000000"], [ + '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', + 'Server', + 'Microsoft-HTTPAPI/2.0', + 'x-ms-ratelimit-remaining-subscription-reads', + '11998', + 'x-ms-request-id', + '2ff6ee57-a243-4901-9eb1-f7140a31088f', + 'x-ms-correlation-request-id', + '2ff6ee57-a243-4901-9eb1-f7140a31088f', + 'x-ms-routing-request-id', + 'JAPANEAST:20211217T064223Z:2ff6ee57-a243-4901-9eb1-f7140a31088f', + 'Strict-Transport-Security', + 'max-age=31536000; includeSubDomains', + 'X-Content-Type-Options', + 'nosniff', + 'Date', + 'Fri, 17 Dec 2021 06:42:23 GMT' +]); + +nock('https://management.azure.com:443', {"encodedQueryParams":true}) + .get('/subscriptions/azure_subscription_id/providers/Microsoft.Devices/locations/eastus/operationResults/aWQ9b3NfaWhfMWFiNTIxY2QtZjI1Ny00MzBkLWI3ZGQtYzJmMmFhMTA0NDJhO3JlZ2lvbj1lYXN0dXM=') + .query(true) + .reply(200, ["1f8b0800000000000400edbd07601c499625262f6dca7b7f4af54ad7e074a10880601324d8904010ecc188cde692ec1d69472329ab2a81ca6556655d661640cced9dbcf7de7befbdf7de7befbdf7ba3b9d4e27f7dfff3f5c6664016cf6ce4adac99e2180aac81f3f7e7c1f3f227ef1474d9bb5ebe6a3471fbd5a2f97c5f2e2a3","5ff2ff0089ccbd4914000000"], [ + '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', + 'Server', + 'Microsoft-HTTPAPI/2.0', + 'x-ms-ratelimit-remaining-subscription-reads', + '11997', + 'x-ms-request-id', + '7b8c73c6-3a2e-4a7e-94cf-64f470d35410', + 'x-ms-correlation-request-id', + '7b8c73c6-3a2e-4a7e-94cf-64f470d35410', + 'x-ms-routing-request-id', + 'JAPANEAST:20211217T064225Z:7b8c73c6-3a2e-4a7e-94cf-64f470d35410', + 'Strict-Transport-Security', + 'max-age=31536000; includeSubDomains', + 'X-Content-Type-Options', + 'nosniff', + 'Date', + 'Fri, 17 Dec 2021 06:42:25 GMT' +]); + +nock('https://management.azure.com:443', {"encodedQueryParams":true}) + .get('/subscriptions/azure_subscription_id/providers/Microsoft.Devices/locations/eastus/operationResults/aWQ9b3NfaWhfMWFiNTIxY2QtZjI1Ny00MzBkLWI3ZGQtYzJmMmFhMTA0NDJhO3JlZ2lvbj1lYXN0dXM=') + .query(true) + .reply(200, ["1f8b0800000000000400edbd07601c499625262f6dca7b7f4af54ad7e074a10880601324d8904010ecc188cde692ec1d69472329ab2a81ca6556655d661640cced9dbcf7de7befbdf7de7befbdf7ba3b9d4e27f7dfff3f5c6664016cf6ce4adac99e2180aac81f3f7e7c1f3f227ef1474d9bb5ebe6a3471fbd5a2f97c5f2e2a3","5ff2ff0089ccbd4914000000"], [ + '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', + 'Server', + 'Microsoft-HTTPAPI/2.0', + 'x-ms-ratelimit-remaining-subscription-reads', + '11996', + 'x-ms-request-id', + 'eb7b74f8-f10f-4393-8c16-f6bf21a56fa7', + 'x-ms-correlation-request-id', + 'eb7b74f8-f10f-4393-8c16-f6bf21a56fa7', + 'x-ms-routing-request-id', + 'JAPANEAST:20211217T064227Z:eb7b74f8-f10f-4393-8c16-f6bf21a56fa7', + 'Strict-Transport-Security', + 'max-age=31536000; includeSubDomains', + 'X-Content-Type-Options', + 'nosniff', + 'Date', + 'Fri, 17 Dec 2021 06:42:27 GMT' +]); + +nock('https://management.azure.com:443', {"encodedQueryParams":true}) + .get('/subscriptions/azure_subscription_id/providers/Microsoft.Devices/locations/eastus/operationResults/aWQ9b3NfaWhfMWFiNTIxY2QtZjI1Ny00MzBkLWI3ZGQtYzJmMmFhMTA0NDJhO3JlZ2lvbj1lYXN0dXM=') + .query(true) + .reply(200, ["1f8b0800000000000400edbd07601c499625262f6dca7b7f4af54ad7e074a10880601324d8904010ecc188cde692ec1d69472329ab2a81ca6556655d661640cced9dbcf7de7befbdf7de7befbdf7ba3b9d4e27f7dfff3f5c6664016cf6ce4adac99e2180aac81f3f7e7c1f3f227ef1474d9bb5ebe6a3471fbd5a2f97c5f2e2a3","5ff2ff0089ccbd4914000000"], [ + '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', + 'Server', + 'Microsoft-HTTPAPI/2.0', + 'x-ms-ratelimit-remaining-subscription-reads', + '11995', + 'x-ms-request-id', + '9fabb90e-6199-47e4-95da-e62ef429ffe5', + 'x-ms-correlation-request-id', + '9fabb90e-6199-47e4-95da-e62ef429ffe5', + 'x-ms-routing-request-id', + 'JAPANEAST:20211217T064230Z:9fabb90e-6199-47e4-95da-e62ef429ffe5', + 'Strict-Transport-Security', + 'max-age=31536000; includeSubDomains', + 'X-Content-Type-Options', + 'nosniff', + 'Date', + 'Fri, 17 Dec 2021 06:42:29 GMT' +]); + +nock('https://management.azure.com:443', {"encodedQueryParams":true}) + .get('/subscriptions/azure_subscription_id/providers/Microsoft.Devices/locations/eastus/operationResults/aWQ9b3NfaWhfMWFiNTIxY2QtZjI1Ny00MzBkLWI3ZGQtYzJmMmFhMTA0NDJhO3JlZ2lvbj1lYXN0dXM=') + .query(true) + .reply(200, ["1f8b0800000000000400edbd07601c499625262f6dca7b7f4af54ad7e074a10880601324d8904010ecc188cde692ec1d69472329ab2a81ca6556655d661640cced9dbcf7de7befbdf7de7befbdf7ba3b9d4e27f7dfff3f5c6664016cf6ce4adac99e2180aac81f3f7e7c1f3f227ef1474d9bb5ebe6a3471fbd5a2f97c5f2e2a3","5ff2ff0089ccbd4914000000"], [ + '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', + 'Server', + 'Microsoft-HTTPAPI/2.0', + 'x-ms-ratelimit-remaining-subscription-reads', + '11994', + 'x-ms-request-id', + 'd16a1cf3-993b-4706-822e-b22bd5c652ff', + 'x-ms-correlation-request-id', + 'd16a1cf3-993b-4706-822e-b22bd5c652ff', + 'x-ms-routing-request-id', + 'JAPANEAST:20211217T064232Z:d16a1cf3-993b-4706-822e-b22bd5c652ff', + 'Strict-Transport-Security', + 'max-age=31536000; includeSubDomains', + 'X-Content-Type-Options', + 'nosniff', + 'Date', + 'Fri, 17 Dec 2021 06:42:32 GMT' +]); + +nock('https://management.azure.com:443', {"encodedQueryParams":true}) + .get('/subscriptions/azure_subscription_id/providers/Microsoft.Devices/locations/eastus/operationResults/aWQ9b3NfaWhfMWFiNTIxY2QtZjI1Ny00MzBkLWI3ZGQtYzJmMmFhMTA0NDJhO3JlZ2lvbj1lYXN0dXM=') + .query(true) + .reply(200, ["1f8b0800000000000400edbd07601c499625262f6dca7b7f4af54ad7e074a10880601324d8904010ecc188cde692ec1d69472329ab2a81ca6556655d661640cced9dbcf7de7befbdf7de7befbdf7ba3b9d4e27f7dfff3f5c6664016cf6ce4adac99e2180aac81f3f7e7c1f3f227ef1474d9bb5ebe6a3471fbd5a2f97c5f2e2a3","5ff2ff0089ccbd4914000000"], [ + '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', + 'Server', + 'Microsoft-HTTPAPI/2.0', + 'x-ms-ratelimit-remaining-subscription-reads', + '11993', + 'x-ms-request-id', + '5fad08a9-99c2-437e-a690-fe448ba35036', + 'x-ms-correlation-request-id', + '5fad08a9-99c2-437e-a690-fe448ba35036', + 'x-ms-routing-request-id', + 'JAPANEAST:20211217T064234Z:5fad08a9-99c2-437e-a690-fe448ba35036', + 'Strict-Transport-Security', + 'max-age=31536000; includeSubDomains', + 'X-Content-Type-Options', + 'nosniff', + 'Date', + 'Fri, 17 Dec 2021 06:42:34 GMT' +]); + +nock('https://management.azure.com:443', {"encodedQueryParams":true}) + .get('/subscriptions/azure_subscription_id/providers/Microsoft.Devices/locations/eastus/operationResults/aWQ9b3NfaWhfMWFiNTIxY2QtZjI1Ny00MzBkLWI3ZGQtYzJmMmFhMTA0NDJhO3JlZ2lvbj1lYXN0dXM=') + .query(true) + .reply(200, ["1f8b0800000000000400edbd07601c499625262f6dca7b7f4af54ad7e074a10880601324d8904010ecc188cde692ec1d69472329ab2a81ca6556655d661640cced9dbcf7de7befbdf7de7befbdf7ba3b9d4e27f7dfff3f5c6664016cf6ce4adac99e2180aac81f3f7e7c1f3f227ef1474d9bb5ebe6a3471fbd5a2f97c5f2e2a3","5ff2ff0089ccbd4914000000"], [ + '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', + 'Server', + 'Microsoft-HTTPAPI/2.0', + 'x-ms-ratelimit-remaining-subscription-reads', + '11992', + 'x-ms-request-id', + '16ed3f91-b610-4fcc-bcf8-db764732ed16', + 'x-ms-correlation-request-id', + '16ed3f91-b610-4fcc-bcf8-db764732ed16', + 'x-ms-routing-request-id', + 'JAPANEAST:20211217T064237Z:16ed3f91-b610-4fcc-bcf8-db764732ed16', + 'Strict-Transport-Security', + 'max-age=31536000; includeSubDomains', + 'X-Content-Type-Options', + 'nosniff', + 'Date', + 'Fri, 17 Dec 2021 06:42:36 GMT' +]); + +nock('https://management.azure.com:443', {"encodedQueryParams":true}) + .get('/subscriptions/azure_subscription_id/providers/Microsoft.Devices/locations/eastus/operationResults/aWQ9b3NfaWhfMWFiNTIxY2QtZjI1Ny00MzBkLWI3ZGQtYzJmMmFhMTA0NDJhO3JlZ2lvbj1lYXN0dXM=') + .query(true) + .reply(200, ["1f8b0800000000000400edbd07601c499625262f6dca7b7f4af54ad7e074a10880601324d8904010ecc188cde692ec1d69472329ab2a81ca6556655d661640cced9dbcf7de7befbdf7de7befbdf7ba3b9d4e27f7dfff3f5c6664016cf6ce4adac99e2180aac81f3f7e7c1f3f227ef1474d9bb5ebe6a3471fbd5a2f97c5f2e2a3","5ff2ff0089ccbd4914000000"], [ + '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', + 'Server', + 'Microsoft-HTTPAPI/2.0', + 'x-ms-ratelimit-remaining-subscription-reads', + '11991', + 'x-ms-request-id', + '2607ce60-3f1c-4eaf-9ddb-a6a6dbdcf0ff', + 'x-ms-correlation-request-id', + '2607ce60-3f1c-4eaf-9ddb-a6a6dbdcf0ff', + 'x-ms-routing-request-id', + 'JAPANEAST:20211217T064239Z:2607ce60-3f1c-4eaf-9ddb-a6a6dbdcf0ff', + 'Strict-Transport-Security', + 'max-age=31536000; includeSubDomains', + 'X-Content-Type-Options', + 'nosniff', + 'Date', + 'Fri, 17 Dec 2021 06:42:38 GMT' +]); + +nock('https://management.azure.com:443', {"encodedQueryParams":true}) + .get('/subscriptions/azure_subscription_id/providers/Microsoft.Devices/locations/eastus/operationResults/aWQ9b3NfaWhfMWFiNTIxY2QtZjI1Ny00MzBkLWI3ZGQtYzJmMmFhMTA0NDJhO3JlZ2lvbj1lYXN0dXM=') + .query(true) + .reply(200, ["1f8b0800000000000400edbd07601c499625262f6dca7b7f4af54ad7e074a10880601324d8904010ecc188cde692ec1d69472329ab2a81ca6556655d661640cced9dbcf7de7befbdf7de7befbdf7ba3b9d4e27f7dfff3f5c6664016cf6ce4adac99e2180aac81f3f7e7c1f3f227ef1474d9bb5ebe6a3471fbd5a2f97c5f2e2a3","5ff2ff0089ccbd4914000000"], [ + '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', + 'Server', + 'Microsoft-HTTPAPI/2.0', + 'x-ms-ratelimit-remaining-subscription-reads', + '11990', + 'x-ms-request-id', + 'a1463920-db8a-4b0a-b127-a3030232af6d', + 'x-ms-correlation-request-id', + 'a1463920-db8a-4b0a-b127-a3030232af6d', + 'x-ms-routing-request-id', + 'JAPANEAST:20211217T064241Z:a1463920-db8a-4b0a-b127-a3030232af6d', + 'Strict-Transport-Security', + 'max-age=31536000; includeSubDomains', + 'X-Content-Type-Options', + 'nosniff', + 'Date', + 'Fri, 17 Dec 2021 06:42:41 GMT' +]); + +nock('https://management.azure.com:443', {"encodedQueryParams":true}) + .get('/subscriptions/azure_subscription_id/providers/Microsoft.Devices/locations/eastus/operationResults/aWQ9b3NfaWhfMWFiNTIxY2QtZjI1Ny00MzBkLWI3ZGQtYzJmMmFhMTA0NDJhO3JlZ2lvbj1lYXN0dXM=') + .query(true) + .reply(200, ["1f8b0800000000000400edbd07601c499625262f6dca7b7f4af54ad7e074a10880601324d8904010ecc188cde692ec1d69472329ab2a81ca6556655d661640cced9dbcf7de7befbdf7de7befbdf7ba3b9d4e27f7dfff3f5c6664016cf6ce4adac99e2180aac81f3f7e7c1f3f227ef1474d9bb5ebe6a3471fbd5a2f97c5f2e2a3","5ff2ff0089ccbd4914000000"], [ + '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', + 'Server', + 'Microsoft-HTTPAPI/2.0', + 'x-ms-ratelimit-remaining-subscription-reads', + '11989', + 'x-ms-request-id', + '2cb40794-df08-424e-9581-190d4f653774', + 'x-ms-correlation-request-id', + '2cb40794-df08-424e-9581-190d4f653774', + 'x-ms-routing-request-id', + 'JAPANEAST:20211217T064243Z:2cb40794-df08-424e-9581-190d4f653774', + 'Strict-Transport-Security', + 'max-age=31536000; includeSubDomains', + 'X-Content-Type-Options', + 'nosniff', + 'Date', + 'Fri, 17 Dec 2021 06:42:43 GMT' +]); + +nock('https://management.azure.com:443', {"encodedQueryParams":true}) + .get('/subscriptions/azure_subscription_id/providers/Microsoft.Devices/locations/eastus/operationResults/aWQ9b3NfaWhfMWFiNTIxY2QtZjI1Ny00MzBkLWI3ZGQtYzJmMmFhMTA0NDJhO3JlZ2lvbj1lYXN0dXM=') + .query(true) + .reply(200, ["1f8b0800000000000400edbd07601c499625262f6dca7b7f4af54ad7e074a10880601324d8904010ecc188cde692ec1d69472329ab2a81ca6556655d661640cced9dbcf7de7befbdf7de7befbdf7ba3b9d4e27f7dfff3f5c6664016cf6ce4adac99e2180aac81f3f7e7c1f3f227ef1474d9bb5ebe6a3471fbd5a2f97c5f2e2a3","5ff2ff0089ccbd4914000000"], [ + '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', + 'Server', + 'Microsoft-HTTPAPI/2.0', + 'x-ms-ratelimit-remaining-subscription-reads', + '11988', + 'x-ms-request-id', + '0ebf0e53-9add-4f4b-b45b-678235663b4a', + 'x-ms-correlation-request-id', + '0ebf0e53-9add-4f4b-b45b-678235663b4a', + 'x-ms-routing-request-id', + 'JAPANEAST:20211217T064246Z:0ebf0e53-9add-4f4b-b45b-678235663b4a', + 'Strict-Transport-Security', + 'max-age=31536000; includeSubDomains', + 'X-Content-Type-Options', + 'nosniff', + 'Date', + 'Fri, 17 Dec 2021 06:42:45 GMT' +]); + +nock('https://management.azure.com:443', {"encodedQueryParams":true}) + .get('/subscriptions/azure_subscription_id/providers/Microsoft.Devices/locations/eastus/operationResults/aWQ9b3NfaWhfMWFiNTIxY2QtZjI1Ny00MzBkLWI3ZGQtYzJmMmFhMTA0NDJhO3JlZ2lvbj1lYXN0dXM=') + .query(true) + .reply(200, ["1f8b0800000000000400edbd07601c499625262f6dca7b7f4af54ad7e074a10880601324d8904010ecc188cde692ec1d69472329ab2a81ca6556655d661640cced9dbcf7de7befbdf7de7befbdf7ba3b9d4e27f7dfff3f5c6664016cf6ce4adac99e2180aac81f3f7e7c1f3f227ef1474d9bb5ebe6a3471fbd5a2f97c5f2e2a3","5ff2ff0089ccbd4914000000"], [ + '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', + 'Server', + 'Microsoft-HTTPAPI/2.0', + 'x-ms-ratelimit-remaining-subscription-reads', + '11987', + 'x-ms-request-id', + 'eda76ef1-4337-4b27-ba76-3b8a54d53a09', + 'x-ms-correlation-request-id', + 'eda76ef1-4337-4b27-ba76-3b8a54d53a09', + 'x-ms-routing-request-id', + 'JAPANEAST:20211217T064248Z:eda76ef1-4337-4b27-ba76-3b8a54d53a09', + 'Strict-Transport-Security', + 'max-age=31536000; includeSubDomains', + 'X-Content-Type-Options', + 'nosniff', + 'Date', + 'Fri, 17 Dec 2021 06:42:48 GMT' +]); + +nock('https://management.azure.com:443', {"encodedQueryParams":true}) + .get('/subscriptions/azure_subscription_id/providers/Microsoft.Devices/locations/eastus/operationResults/aWQ9b3NfaWhfMWFiNTIxY2QtZjI1Ny00MzBkLWI3ZGQtYzJmMmFhMTA0NDJhO3JlZ2lvbj1lYXN0dXM=') + .query(true) + .reply(200, ["1f8b0800000000000400edbd07601c499625262f6dca7b7f4af54ad7e074a10880601324d8904010ecc188cde692ec1d69472329ab2a81ca6556655d661640cced9dbcf7de7befbdf7de7befbdf7ba3b9d4e27f7dfff3f5c6664016cf6ce4adac99e2180aac81f3f7e7c1f3f227ef1474d9bb5ebe6a3471fbd5a2f97c5f2e2a3","5ff2ff0089ccbd4914000000"], [ + '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', + 'Server', + 'Microsoft-HTTPAPI/2.0', + 'x-ms-ratelimit-remaining-subscription-reads', + '11986', + 'x-ms-request-id', + '5e65a24c-e0b5-473b-91dd-866bcc18ae1b', + 'x-ms-correlation-request-id', + '5e65a24c-e0b5-473b-91dd-866bcc18ae1b', + 'x-ms-routing-request-id', + 'JAPANEAST:20211217T064250Z:5e65a24c-e0b5-473b-91dd-866bcc18ae1b', + 'Strict-Transport-Security', + 'max-age=31536000; includeSubDomains', + 'X-Content-Type-Options', + 'nosniff', + 'Date', + 'Fri, 17 Dec 2021 06:42:50 GMT' +]); + +nock('https://management.azure.com:443', {"encodedQueryParams":true}) + .get('/subscriptions/azure_subscription_id/providers/Microsoft.Devices/locations/eastus/operationResults/aWQ9b3NfaWhfMWFiNTIxY2QtZjI1Ny00MzBkLWI3ZGQtYzJmMmFhMTA0NDJhO3JlZ2lvbj1lYXN0dXM=') + .query(true) + .reply(200, ["1f8b0800000000000400edbd07601c499625262f6dca7b7f4af54ad7e074a10880601324d8904010ecc188cde692ec1d69472329ab2a81ca6556655d661640cced9dbcf7de7befbdf7de7befbdf7ba3b9d4e27f7dfff3f5c6664016cf6ce4adac99e2180aac81f3f7e7c1f3f227ef1474d9bb5ebe6a3471fbd5a2f97c5f2e2a3","5ff2ff0089ccbd4914000000"], [ + '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', + 'Server', + 'Microsoft-HTTPAPI/2.0', + 'x-ms-ratelimit-remaining-subscription-reads', + '11985', + 'x-ms-request-id', + 'c421a69d-e11b-4972-8d3d-29d57366f43b', + 'x-ms-correlation-request-id', + 'c421a69d-e11b-4972-8d3d-29d57366f43b', + 'x-ms-routing-request-id', + 'JAPANEAST:20211217T064253Z:c421a69d-e11b-4972-8d3d-29d57366f43b', + 'Strict-Transport-Security', + 'max-age=31536000; includeSubDomains', + 'X-Content-Type-Options', + 'nosniff', + 'Date', + 'Fri, 17 Dec 2021 06:42:52 GMT' +]); + +nock('https://management.azure.com:443', {"encodedQueryParams":true}) + .get('/subscriptions/azure_subscription_id/providers/Microsoft.Devices/locations/eastus/operationResults/aWQ9b3NfaWhfMWFiNTIxY2QtZjI1Ny00MzBkLWI3ZGQtYzJmMmFhMTA0NDJhO3JlZ2lvbj1lYXN0dXM=') + .query(true) + .reply(200, ["1f8b0800000000000400edbd07601c499625262f6dca7b7f4af54ad7e074a10880601324d8904010ecc188cde692ec1d69472329ab2a81ca6556655d661640cced9dbcf7de7befbdf7de7befbdf7ba3b9d4e27f7dfff3f5c6664016cf6ce4adac99e2180aac81f3f7e7c1f3f227ef1474d9bb5ebe6a3471fbd5a2f97c5f2e2a3","5ff2ff0089ccbd4914000000"], [ + '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', + 'Server', + 'Microsoft-HTTPAPI/2.0', + 'x-ms-ratelimit-remaining-subscription-reads', + '11984', + 'x-ms-request-id', + 'f25f0e7d-59b2-4a01-ab19-954618b691b8', + 'x-ms-correlation-request-id', + 'f25f0e7d-59b2-4a01-ab19-954618b691b8', + 'x-ms-routing-request-id', + 'JAPANEAST:20211217T064255Z:f25f0e7d-59b2-4a01-ab19-954618b691b8', + 'Strict-Transport-Security', + 'max-age=31536000; includeSubDomains', + 'X-Content-Type-Options', + 'nosniff', + 'Date', + 'Fri, 17 Dec 2021 06:42:54 GMT' +]); + +nock('https://management.azure.com:443', {"encodedQueryParams":true}) + .get('/subscriptions/azure_subscription_id/providers/Microsoft.Devices/locations/eastus/operationResults/aWQ9b3NfaWhfMWFiNTIxY2QtZjI1Ny00MzBkLWI3ZGQtYzJmMmFhMTA0NDJhO3JlZ2lvbj1lYXN0dXM=') + .query(true) + .reply(200, ["1f8b0800000000000400edbd07601c499625262f6dca7b7f4af54ad7e074a10880601324d8904010ecc188cde692ec1d69472329ab2a81ca6556655d661640cced9dbcf7de7befbdf7de7befbdf7ba3b9d4e27f7dfff3f5c6664016cf6ce4adac99e2180aac81f3f7e7c1f3f227ef1474d9bb5ebe6a3471fbd5a2f97c5f2e2a3","5ff2ff0089ccbd4914000000"], [ + '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', + 'Server', + 'Microsoft-HTTPAPI/2.0', + 'x-ms-ratelimit-remaining-subscription-reads', + '11983', + 'x-ms-request-id', + 'ee428f6a-6c4a-4af2-a688-8d724bfff7ca', + 'x-ms-correlation-request-id', + 'ee428f6a-6c4a-4af2-a688-8d724bfff7ca', + 'x-ms-routing-request-id', + 'JAPANEAST:20211217T064257Z:ee428f6a-6c4a-4af2-a688-8d724bfff7ca', + 'Strict-Transport-Security', + 'max-age=31536000; includeSubDomains', + 'X-Content-Type-Options', + 'nosniff', + 'Date', + 'Fri, 17 Dec 2021 06:42:57 GMT' +]); + +nock('https://management.azure.com:443', {"encodedQueryParams":true}) + .get('/subscriptions/azure_subscription_id/providers/Microsoft.Devices/locations/eastus/operationResults/aWQ9b3NfaWhfMWFiNTIxY2QtZjI1Ny00MzBkLWI3ZGQtYzJmMmFhMTA0NDJhO3JlZ2lvbj1lYXN0dXM=') + .query(true) + .reply(200, ["1f8b0800000000000400edbd07601c499625262f6dca7b7f4af54ad7e074a10880601324d8904010ecc188cde692ec1d69472329ab2a81ca6556655d661640cced9dbcf7de7befbdf7de7befbdf7ba3b9d4e27f7dfff3f5c6664016cf6ce4adac99e2180aac81f3f7e7c1f3f227ef1474d9bb5ebe6a3471fbd5a2f97c5f2e2a3","5ff2ff0089ccbd4914000000"], [ + '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', + 'Server', + 'Microsoft-HTTPAPI/2.0', + 'x-ms-ratelimit-remaining-subscription-reads', + '11982', + 'x-ms-request-id', + '93e6e81b-4b9f-44c1-8f93-aeedee2669bc', + 'x-ms-correlation-request-id', + '93e6e81b-4b9f-44c1-8f93-aeedee2669bc', + 'x-ms-routing-request-id', + 'JAPANEAST:20211217T064259Z:93e6e81b-4b9f-44c1-8f93-aeedee2669bc', + 'Strict-Transport-Security', + 'max-age=31536000; includeSubDomains', + 'X-Content-Type-Options', + 'nosniff', + 'Date', + 'Fri, 17 Dec 2021 06:42:59 GMT' +]); + +nock('https://management.azure.com:443', {"encodedQueryParams":true}) + .get('/subscriptions/azure_subscription_id/providers/Microsoft.Devices/locations/eastus/operationResults/aWQ9b3NfaWhfMWFiNTIxY2QtZjI1Ny00MzBkLWI3ZGQtYzJmMmFhMTA0NDJhO3JlZ2lvbj1lYXN0dXM=') + .query(true) + .reply(200, ["1f8b0800000000000400edbd07601c499625262f6dca7b7f4af54ad7e074a10880601324d8904010ecc188cde692ec1d69472329ab2a81ca6556655d661640cced9dbcf7de7befbdf7de7befbdf7ba3b9d4e27f7dfff3f5c6664016cf6ce4adac99e2180aac81f3f7e7c1f3f227ef1474d9bb5ebe6a3471fbd5a2f97c5f2e2a3","5ff2ff0089ccbd4914000000"], [ + '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', + 'Server', + 'Microsoft-HTTPAPI/2.0', + 'x-ms-ratelimit-remaining-subscription-reads', + '11981', + 'x-ms-request-id', + '3a89af8e-4319-49d4-bf23-0a89a23ef52a', + 'x-ms-correlation-request-id', + '3a89af8e-4319-49d4-bf23-0a89a23ef52a', + 'x-ms-routing-request-id', + 'JAPANEAST:20211217T064302Z:3a89af8e-4319-49d4-bf23-0a89a23ef52a', + 'Strict-Transport-Security', + 'max-age=31536000; includeSubDomains', + 'X-Content-Type-Options', + 'nosniff', + 'Date', + 'Fri, 17 Dec 2021 06:43:01 GMT' +]); + +nock('https://management.azure.com:443', {"encodedQueryParams":true}) + .get('/subscriptions/azure_subscription_id/providers/Microsoft.Devices/locations/eastus/operationResults/aWQ9b3NfaWhfMWFiNTIxY2QtZjI1Ny00MzBkLWI3ZGQtYzJmMmFhMTA0NDJhO3JlZ2lvbj1lYXN0dXM=') + .query(true) + .reply(200, ["1f8b0800000000000400edbd07601c499625262f6dca7b7f4af54ad7e074a10880601324d8904010ecc188cde692ec1d69472329ab2a81ca6556655d661640cced9dbcf7de7befbdf7de7befbdf7ba3b9d4e27f7dfff3f5c6664016cf6ce4adac99e2180aac81f3f7e7c1f3f227ef1474d9bb5ebe6a3471fbd5a2f97c5f2e2a3","5ff2ff0089ccbd4914000000"], [ + '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', + 'Server', + 'Microsoft-HTTPAPI/2.0', + 'x-ms-ratelimit-remaining-subscription-reads', + '11980', + 'x-ms-request-id', + '5e3948cd-f69e-4c3b-bf8f-c2ce723d519f', + 'x-ms-correlation-request-id', + '5e3948cd-f69e-4c3b-bf8f-c2ce723d519f', + 'x-ms-routing-request-id', + 'JAPANEAST:20211217T064304Z:5e3948cd-f69e-4c3b-bf8f-c2ce723d519f', + 'Strict-Transport-Security', + 'max-age=31536000; includeSubDomains', + 'X-Content-Type-Options', + 'nosniff', + 'Date', + 'Fri, 17 Dec 2021 06:43:03 GMT' +]); + +nock('https://management.azure.com:443', {"encodedQueryParams":true}) + .get('/subscriptions/azure_subscription_id/providers/Microsoft.Devices/locations/eastus/operationResults/aWQ9b3NfaWhfMWFiNTIxY2QtZjI1Ny00MzBkLWI3ZGQtYzJmMmFhMTA0NDJhO3JlZ2lvbj1lYXN0dXM=') + .query(true) + .reply(200, ["1f8b0800000000000400edbd07601c499625262f6dca7b7f4af54ad7e074a10880601324d8904010ecc188cde692ec1d69472329ab2a81ca6556655d661640cced9dbcf7de7befbdf7de7befbdf7ba3b9d4e27f7dfff3f5c6664016cf6ce4adac99e2180aac81f3f7e7c1f3f227ef1474d9bb5ebe6a3471fbd5a2f97c5f2e2a3","5ff2ff0089ccbd4914000000"], [ + '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', + 'Server', + 'Microsoft-HTTPAPI/2.0', + 'x-ms-ratelimit-remaining-subscription-reads', + '11979', + 'x-ms-request-id', + 'bb19421f-379d-4adf-baf9-d2f18ae80786', + 'x-ms-correlation-request-id', + 'bb19421f-379d-4adf-baf9-d2f18ae80786', + 'x-ms-routing-request-id', + 'JAPANEAST:20211217T064306Z:bb19421f-379d-4adf-baf9-d2f18ae80786', + 'Strict-Transport-Security', + 'max-age=31536000; includeSubDomains', + 'X-Content-Type-Options', + 'nosniff', + 'Date', + 'Fri, 17 Dec 2021 06:43:06 GMT' +]); + +nock('https://management.azure.com:443', {"encodedQueryParams":true}) + .get('/subscriptions/azure_subscription_id/providers/Microsoft.Devices/locations/eastus/operationResults/aWQ9b3NfaWhfMWFiNTIxY2QtZjI1Ny00MzBkLWI3ZGQtYzJmMmFhMTA0NDJhO3JlZ2lvbj1lYXN0dXM=') + .query(true) + .reply(200, ["1f8b0800000000000400edbd07601c499625262f6dca7b7f4af54ad7e074a10880601324d8904010ecc188cde692ec1d69472329ab2a81ca6556655d661640cced9dbcf7de7befbdf7de7befbdf7ba3b9d4e27f7dfff3f5c6664016cf6ce4adac99e2180aac81f3f7e7c1f3f227ef1474d9bb5ebe6a3471fbd5a2f97c5f2e2a3","5ff2ff0089ccbd4914000000"], [ + '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', + 'Server', + 'Microsoft-HTTPAPI/2.0', + 'x-ms-ratelimit-remaining-subscription-reads', + '11978', + 'x-ms-request-id', + 'aba51d0d-8365-4c5b-adf3-3d3af5e7dd1b', + 'x-ms-correlation-request-id', + 'aba51d0d-8365-4c5b-adf3-3d3af5e7dd1b', + 'x-ms-routing-request-id', + 'JAPANEAST:20211217T064309Z:aba51d0d-8365-4c5b-adf3-3d3af5e7dd1b', + 'Strict-Transport-Security', + 'max-age=31536000; includeSubDomains', + 'X-Content-Type-Options', + 'nosniff', + 'Date', + 'Fri, 17 Dec 2021 06:43:08 GMT' +]); + +nock('https://management.azure.com:443', {"encodedQueryParams":true}) + .get('/subscriptions/azure_subscription_id/providers/Microsoft.Devices/locations/eastus/operationResults/aWQ9b3NfaWhfMWFiNTIxY2QtZjI1Ny00MzBkLWI3ZGQtYzJmMmFhMTA0NDJhO3JlZ2lvbj1lYXN0dXM=') + .query(true) + .reply(200, ["1f8b0800000000000400edbd07601c499625262f6dca7b7f4af54ad7e074a10880601324d8904010ecc188cde692ec1d69472329ab2a81ca6556655d661640cced9dbcf7de7befbdf7de7befbdf7ba3b9d4e27f7dfff3f5c6664016cf6ce4adac99e2180aac81f3f7e7c1f3f227ef1474d9bb5ebe6a3471fbd5a2f97c5f2e2a3","5ff2ff0089ccbd4914000000"], [ + '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', + 'Server', + 'Microsoft-HTTPAPI/2.0', + 'x-ms-ratelimit-remaining-subscription-reads', + '11977', + 'x-ms-request-id', + '173f9ca4-8015-4ba0-b1e6-01dd4930306b', + 'x-ms-correlation-request-id', + '173f9ca4-8015-4ba0-b1e6-01dd4930306b', + 'x-ms-routing-request-id', + 'JAPANEAST:20211217T064311Z:173f9ca4-8015-4ba0-b1e6-01dd4930306b', + 'Strict-Transport-Security', + 'max-age=31536000; includeSubDomains', + 'X-Content-Type-Options', + 'nosniff', + 'Date', + 'Fri, 17 Dec 2021 06:43:10 GMT' +]); + +nock('https://management.azure.com:443', {"encodedQueryParams":true}) + .get('/subscriptions/azure_subscription_id/providers/Microsoft.Devices/locations/eastus/operationResults/aWQ9b3NfaWhfMWFiNTIxY2QtZjI1Ny00MzBkLWI3ZGQtYzJmMmFhMTA0NDJhO3JlZ2lvbj1lYXN0dXM=') + .query(true) + .reply(200, ["1f8b0800000000000400edbd07601c499625262f6dca7b7f4af54ad7e074a10880601324d8904010ecc188cde692ec1d69472329ab2a81ca6556655d661640cced9dbcf7de7befbdf7de7befbdf7ba3b9d4e27f7dfff3f5c6664016cf6ce4adac99e2180aac81f3f7e7c1f3f227ef1474d9bb5ebe6a3471fbd5a2f97c5f2e2a3","5ff2ff0089ccbd4914000000"], [ + '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', + 'Server', + 'Microsoft-HTTPAPI/2.0', + 'x-ms-ratelimit-remaining-subscription-reads', + '11976', + 'x-ms-request-id', + 'a2f5bdfc-1bf2-49b7-8caa-4a72bd0afce7', + 'x-ms-correlation-request-id', + 'a2f5bdfc-1bf2-49b7-8caa-4a72bd0afce7', + 'x-ms-routing-request-id', + 'JAPANEAST:20211217T064313Z:a2f5bdfc-1bf2-49b7-8caa-4a72bd0afce7', + 'Strict-Transport-Security', + 'max-age=31536000; includeSubDomains', + 'X-Content-Type-Options', + 'nosniff', + 'Date', + 'Fri, 17 Dec 2021 06:43:12 GMT' +]); + +nock('https://management.azure.com:443', {"encodedQueryParams":true}) + .get('/subscriptions/azure_subscription_id/providers/Microsoft.Devices/locations/eastus/operationResults/aWQ9b3NfaWhfMWFiNTIxY2QtZjI1Ny00MzBkLWI3ZGQtYzJmMmFhMTA0NDJhO3JlZ2lvbj1lYXN0dXM=') + .query(true) + .reply(200, ["1f8b0800000000000400edbd07601c499625262f6dca7b7f4af54ad7e074a10880601324d8904010ecc188cde692ec1d69472329ab2a81ca6556655d661640cced9dbcf7de7befbdf7de7befbdf7ba3b9d4e27f7dfff3f5c6664016cf6ce4adac99e2180aac81f3f7e7c1f3f227ef1474d9bb5ebe6a3471fbd5a2f97c5f2e2a3","5ff2ff0089ccbd4914000000"], [ + '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', + 'Server', + 'Microsoft-HTTPAPI/2.0', + 'x-ms-ratelimit-remaining-subscription-reads', + '11975', + 'x-ms-request-id', + '854c48f9-0ac6-4d40-9749-ff50b5020c06', + 'x-ms-correlation-request-id', + '854c48f9-0ac6-4d40-9749-ff50b5020c06', + 'x-ms-routing-request-id', + 'JAPANEAST:20211217T064316Z:854c48f9-0ac6-4d40-9749-ff50b5020c06', + 'Strict-Transport-Security', + 'max-age=31536000; includeSubDomains', + 'X-Content-Type-Options', + 'nosniff', + 'Date', + 'Fri, 17 Dec 2021 06:43:15 GMT' +]); + +nock('https://management.azure.com:443', {"encodedQueryParams":true}) + .get('/subscriptions/azure_subscription_id/providers/Microsoft.Devices/locations/eastus/operationResults/aWQ9b3NfaWhfMWFiNTIxY2QtZjI1Ny00MzBkLWI3ZGQtYzJmMmFhMTA0NDJhO3JlZ2lvbj1lYXN0dXM=') + .query(true) + .reply(200, ["1f8b0800000000000400edbd07601c499625262f6dca7b7f4af54ad7e074a10880601324d8904010ecc188cde692ec1d69472329ab2a81ca6556655d661640cced9dbcf7de7befbdf7de7befbdf7ba3b9d4e27f7dfff3f5c6664016cf6ce4adac99e2180aac81f3f7e7c1f3f227ef1474d9bb5ebe6a3471fbd5a2f97c5f2e2a3","5ff2ff0089ccbd4914000000"], [ + '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', + 'Server', + 'Microsoft-HTTPAPI/2.0', + 'x-ms-ratelimit-remaining-subscription-reads', + '11974', + 'x-ms-request-id', + 'e49c5724-d10e-417d-85ae-43187fa15ded', + 'x-ms-correlation-request-id', + 'e49c5724-d10e-417d-85ae-43187fa15ded', + 'x-ms-routing-request-id', + 'JAPANEAST:20211217T064318Z:e49c5724-d10e-417d-85ae-43187fa15ded', + 'Strict-Transport-Security', + 'max-age=31536000; includeSubDomains', + 'X-Content-Type-Options', + 'nosniff', + 'Date', + 'Fri, 17 Dec 2021 06:43:17 GMT' +]); + +nock('https://management.azure.com:443', {"encodedQueryParams":true}) + .get('/subscriptions/azure_subscription_id/providers/Microsoft.Devices/locations/eastus/operationResults/aWQ9b3NfaWhfMWFiNTIxY2QtZjI1Ny00MzBkLWI3ZGQtYzJmMmFhMTA0NDJhO3JlZ2lvbj1lYXN0dXM=') + .query(true) + .reply(200, ["1f8b0800000000000400edbd07601c499625262f6dca7b7f4af54ad7e074a10880601324d8904010ecc188cde692ec1d69472329ab2a81ca6556655d661640cced9dbcf7de7befbdf7de7befbdf7ba3b9d4e27f7dfff3f5c6664016cf6ce4adac99e2180aac81f3f7e7c1f3f227ef1474d9bb5ebe6a3471fbd5a2f97c5f2e2a3","5ff2ff0089ccbd4914000000"], [ + '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', + 'Server', + 'Microsoft-HTTPAPI/2.0', + 'x-ms-ratelimit-remaining-subscription-reads', + '11973', + 'x-ms-request-id', + 'baa7397c-67e1-4d09-94c5-dbe1bc058457', + 'x-ms-correlation-request-id', + 'baa7397c-67e1-4d09-94c5-dbe1bc058457', + 'x-ms-routing-request-id', + 'JAPANEAST:20211217T064320Z:baa7397c-67e1-4d09-94c5-dbe1bc058457', + 'Strict-Transport-Security', + 'max-age=31536000; includeSubDomains', + 'X-Content-Type-Options', + 'nosniff', + 'Date', + 'Fri, 17 Dec 2021 06:43:19 GMT' +]); + +nock('https://management.azure.com:443', {"encodedQueryParams":true}) + .get('/subscriptions/azure_subscription_id/providers/Microsoft.Devices/locations/eastus/operationResults/aWQ9b3NfaWhfMWFiNTIxY2QtZjI1Ny00MzBkLWI3ZGQtYzJmMmFhMTA0NDJhO3JlZ2lvbj1lYXN0dXM=') + .query(true) + .reply(200, ["1f8b0800000000000400edbd07601c499625262f6dca7b7f4af54ad7e074a10880601324d8904010ecc188cde692ec1d69472329ab2a81ca6556655d661640cced9dbcf7de7befbdf7de7befbdf7ba3b9d4e27f7dfff3f5c6664016cf6ce4adac99e2180aac81f3f7e7c1f3f227ef1474d9bb5ebe6a3471fbd5a2f97c5f2e2a3","5ff2ff0089ccbd4914000000"], [ + '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', + 'Server', + 'Microsoft-HTTPAPI/2.0', + 'x-ms-ratelimit-remaining-subscription-reads', + '11972', + 'x-ms-request-id', + 'd347046a-9bad-4e5e-a867-99f47f345378', + 'x-ms-correlation-request-id', + 'd347046a-9bad-4e5e-a867-99f47f345378', + 'x-ms-routing-request-id', + 'JAPANEAST:20211217T064322Z:d347046a-9bad-4e5e-a867-99f47f345378', + 'Strict-Transport-Security', + 'max-age=31536000; includeSubDomains', + 'X-Content-Type-Options', + 'nosniff', + 'Date', + 'Fri, 17 Dec 2021 06:43:22 GMT' +]); + +nock('https://management.azure.com:443', {"encodedQueryParams":true}) + .get('/subscriptions/azure_subscription_id/providers/Microsoft.Devices/locations/eastus/operationResults/aWQ9b3NfaWhfMWFiNTIxY2QtZjI1Ny00MzBkLWI3ZGQtYzJmMmFhMTA0NDJhO3JlZ2lvbj1lYXN0dXM=') + .query(true) + .reply(200, ["1f8b0800000000000400edbd07601c499625262f6dca7b7f4af54ad7e074a10880601324d8904010ecc188cde692ec1d69472329ab2a81ca6556655d661640cced9dbcf7de7befbdf7de7befbdf7ba3b9d4e27f7dfff3f5c6664016cf6ce4adac99e2180aac81f3f7e7c1f3f227ef1474d9bb5ebe6a3471fbd5a2f97c5f2e2a3","5ff2ff0089ccbd4914000000"], [ + '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', + 'Server', + 'Microsoft-HTTPAPI/2.0', + 'x-ms-ratelimit-remaining-subscription-reads', + '11971', + 'x-ms-request-id', + '11271384-dc71-4923-9f6a-77fd50bad41f', + 'x-ms-correlation-request-id', + '11271384-dc71-4923-9f6a-77fd50bad41f', + 'x-ms-routing-request-id', + 'JAPANEAST:20211217T064325Z:11271384-dc71-4923-9f6a-77fd50bad41f', + 'Strict-Transport-Security', + 'max-age=31536000; includeSubDomains', + 'X-Content-Type-Options', + 'nosniff', + 'Date', + 'Fri, 17 Dec 2021 06:43:24 GMT' +]); + +nock('https://management.azure.com:443', {"encodedQueryParams":true}) + .get('/subscriptions/azure_subscription_id/providers/Microsoft.Devices/locations/eastus/operationResults/aWQ9b3NfaWhfMWFiNTIxY2QtZjI1Ny00MzBkLWI3ZGQtYzJmMmFhMTA0NDJhO3JlZ2lvbj1lYXN0dXM=') + .query(true) + .reply(200, ["1f8b0800000000000400edbd07601c499625262f6dca7b7f4af54ad7e074a10880601324d8904010ecc188cde692ec1d69472329ab2a81ca6556655d661640cced9dbcf7de7befbdf7de7befbdf7ba3b9d4e27f7dfff3f5c6664016cf6ce4adac99e2180aac81f3f7e7c1f3f227ef1474d9bb5ebe6a3471fbd5a2f97c5f2e2a3","5ff2ff0089ccbd4914000000"], [ + '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', + 'Server', + 'Microsoft-HTTPAPI/2.0', + 'x-ms-ratelimit-remaining-subscription-reads', + '11970', + 'x-ms-request-id', + '9bf0c515-627b-4fd5-9ec2-1100ff6a8747', + 'x-ms-correlation-request-id', + '9bf0c515-627b-4fd5-9ec2-1100ff6a8747', + 'x-ms-routing-request-id', + 'JAPANEAST:20211217T064327Z:9bf0c515-627b-4fd5-9ec2-1100ff6a8747', + 'Strict-Transport-Security', + 'max-age=31536000; includeSubDomains', + 'X-Content-Type-Options', + 'nosniff', + 'Date', + 'Fri, 17 Dec 2021 06:43:26 GMT' +]); + +nock('https://management.azure.com:443', {"encodedQueryParams":true}) + .get('/subscriptions/azure_subscription_id/providers/Microsoft.Devices/locations/eastus/operationResults/aWQ9b3NfaWhfMWFiNTIxY2QtZjI1Ny00MzBkLWI3ZGQtYzJmMmFhMTA0NDJhO3JlZ2lvbj1lYXN0dXM=') + .query(true) + .reply(200, ["1f8b0800000000000400edbd07601c499625262f6dca7b7f4af54ad7e074a10880601324d8904010ecc188cde692ec1d69472329ab2a81ca6556655d661640cced9dbcf7de7befbdf7de7befbdf7ba3b9d4e27f7dfff3f5c6664016cf6ce4adac99e2180aac81f3f7e7c1f3f227ef1474d9bb5ebe6a3471fbd5a2f97c5f2e2a3","5ff2ff0089ccbd4914000000"], [ + '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', + 'Server', + 'Microsoft-HTTPAPI/2.0', + 'x-ms-ratelimit-remaining-subscription-reads', + '11969', + 'x-ms-request-id', + 'd277cdd5-a5eb-4a39-a832-13396a41c0f8', + 'x-ms-correlation-request-id', + 'd277cdd5-a5eb-4a39-a832-13396a41c0f8', + 'x-ms-routing-request-id', + 'JAPANEAST:20211217T064329Z:d277cdd5-a5eb-4a39-a832-13396a41c0f8', + 'Strict-Transport-Security', + 'max-age=31536000; includeSubDomains', + 'X-Content-Type-Options', + 'nosniff', + 'Date', + 'Fri, 17 Dec 2021 06:43:28 GMT' +]); + +nock('https://management.azure.com:443', {"encodedQueryParams":true}) + .get('/subscriptions/azure_subscription_id/providers/Microsoft.Devices/locations/eastus/operationResults/aWQ9b3NfaWhfMWFiNTIxY2QtZjI1Ny00MzBkLWI3ZGQtYzJmMmFhMTA0NDJhO3JlZ2lvbj1lYXN0dXM=') + .query(true) + .reply(200, ["1f8b0800000000000400edbd07601c499625262f6dca7b7f4af54ad7e074a10880601324d8904010ecc188cde692ec1d69472329ab2a81ca6556655d661640cced9dbcf7de7befbdf7de7befbdf7ba3b9d4e27f7dfff3f5c6664016cf6ce4adac99e2180aac81f3f7e7c1f3f227ef1474d9bb5ebe6a3471fbd5a2f97c5f2e2a3","5ff2ff0089ccbd4914000000"], [ + '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', + 'Server', + 'Microsoft-HTTPAPI/2.0', + 'x-ms-ratelimit-remaining-subscription-reads', + '11968', + 'x-ms-request-id', + 'af7b1907-e13f-4f1e-b974-d50c77f67333', + 'x-ms-correlation-request-id', + 'af7b1907-e13f-4f1e-b974-d50c77f67333', + 'x-ms-routing-request-id', + 'JAPANEAST:20211217T064332Z:af7b1907-e13f-4f1e-b974-d50c77f67333', + 'Strict-Transport-Security', + 'max-age=31536000; includeSubDomains', + 'X-Content-Type-Options', + 'nosniff', + 'Date', + 'Fri, 17 Dec 2021 06:43:31 GMT' +]); + +nock('https://management.azure.com:443', {"encodedQueryParams":true}) + .get('/subscriptions/azure_subscription_id/providers/Microsoft.Devices/locations/eastus/operationResults/aWQ9b3NfaWhfMWFiNTIxY2QtZjI1Ny00MzBkLWI3ZGQtYzJmMmFhMTA0NDJhO3JlZ2lvbj1lYXN0dXM=') + .query(true) + .reply(200, ["1f8b0800000000000400edbd07601c499625262f6dca7b7f4af54ad7e074a10880601324d8904010ecc188cde692ec1d69472329ab2a81ca6556655d661640cced9dbcf7de7befbdf7de7befbdf7ba3b9d4e27f7dfff3f5c6664016cf6ce4adac99e2180aac81f3f7e7c1f3f227ef1474d9bb5ebe6a3471fbd5a2f97c5f2e2a3","5ff2ff0089ccbd4914000000"], [ + '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', + 'Server', + 'Microsoft-HTTPAPI/2.0', + 'x-ms-ratelimit-remaining-subscription-reads', + '11967', + 'x-ms-request-id', + '854183cc-ae8a-46db-a766-4c334d06bfb7', + 'x-ms-correlation-request-id', + '854183cc-ae8a-46db-a766-4c334d06bfb7', + 'x-ms-routing-request-id', + 'JAPANEAST:20211217T064334Z:854183cc-ae8a-46db-a766-4c334d06bfb7', + 'Strict-Transport-Security', + 'max-age=31536000; includeSubDomains', + 'X-Content-Type-Options', + 'nosniff', + 'Date', + 'Fri, 17 Dec 2021 06:43:33 GMT' +]); + +nock('https://management.azure.com:443', {"encodedQueryParams":true}) + .get('/subscriptions/azure_subscription_id/providers/Microsoft.Devices/locations/eastus/operationResults/aWQ9b3NfaWhfMWFiNTIxY2QtZjI1Ny00MzBkLWI3ZGQtYzJmMmFhMTA0NDJhO3JlZ2lvbj1lYXN0dXM=') + .query(true) + .reply(200, ["1f8b0800000000000400edbd07601c499625262f6dca7b7f4af54ad7e074a10880601324d8904010ecc188cde692ec1d69472329ab2a81ca6556655d661640cced9dbcf7de7befbdf7de7befbdf7ba3b9d4e27f7dfff3f5c6664016cf6ce4adac99e2180aac81f3f7e7c1f3f227ef1474d9bb5ebe6a3471fbd5a2f97c5f2e2a3","5ff2ff0089ccbd4914000000"], [ + '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', + 'Server', + 'Microsoft-HTTPAPI/2.0', + 'x-ms-ratelimit-remaining-subscription-reads', + '11966', + 'x-ms-request-id', + 'adfa4baf-48a5-437d-b167-544c3a3d05ad', + 'x-ms-correlation-request-id', + 'adfa4baf-48a5-437d-b167-544c3a3d05ad', + 'x-ms-routing-request-id', + 'JAPANEAST:20211217T064336Z:adfa4baf-48a5-437d-b167-544c3a3d05ad', + 'Strict-Transport-Security', + 'max-age=31536000; includeSubDomains', + 'X-Content-Type-Options', + 'nosniff', + 'Date', + 'Fri, 17 Dec 2021 06:43:35 GMT' +]); + +nock('https://management.azure.com:443', {"encodedQueryParams":true}) + .get('/subscriptions/azure_subscription_id/providers/Microsoft.Devices/locations/eastus/operationResults/aWQ9b3NfaWhfMWFiNTIxY2QtZjI1Ny00MzBkLWI3ZGQtYzJmMmFhMTA0NDJhO3JlZ2lvbj1lYXN0dXM=') + .query(true) + .reply(200, ["1f8b0800000000000400edbd07601c499625262f6dca7b7f4af54ad7e074a10880601324d8904010ecc188cde692ec1d69472329ab2a81ca6556655d661640cced9dbcf7de7befbdf7de7befbdf7ba3b9d4e27f7dfff3f5c6664016cf6ce4adac99e2180aac81f3f7e7c1f3f227ef1474d9bb5ebe6a3471fbd5a2f97c5f2e2a3","5ff2ff0089ccbd4914000000"], [ + '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', + 'Server', + 'Microsoft-HTTPAPI/2.0', + 'x-ms-ratelimit-remaining-subscription-reads', + '11965', + 'x-ms-request-id', + 'b4568a61-9b09-49de-97b3-fc70ee98b434', + 'x-ms-correlation-request-id', + 'b4568a61-9b09-49de-97b3-fc70ee98b434', + 'x-ms-routing-request-id', + 'JAPANEAST:20211217T064338Z:b4568a61-9b09-49de-97b3-fc70ee98b434', + 'Strict-Transport-Security', + 'max-age=31536000; includeSubDomains', + 'X-Content-Type-Options', + 'nosniff', + 'Date', + 'Fri, 17 Dec 2021 06:43:37 GMT' +]); + +nock('https://management.azure.com:443', {"encodedQueryParams":true}) + .get('/subscriptions/azure_subscription_id/providers/Microsoft.Devices/locations/eastus/operationResults/aWQ9b3NfaWhfMWFiNTIxY2QtZjI1Ny00MzBkLWI3ZGQtYzJmMmFhMTA0NDJhO3JlZ2lvbj1lYXN0dXM=') + .query(true) + .reply(200, ["1f8b0800000000000400edbd07601c499625262f6dca7b7f4af54ad7e074a10880601324d8904010ecc188cde692ec1d69472329ab2a81ca6556655d661640cced9dbcf7de7befbdf7de7befbdf7ba3b9d4e27f7dfff3f5c6664016cf6ce4adac99e2180aac81f3f7e7c1f3f227ef1474d9bb5ebe6a3471fbd5a2f97c5f2e2a3","5ff2ff0089ccbd4914000000"], [ + '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', + 'Server', + 'Microsoft-HTTPAPI/2.0', + 'x-ms-ratelimit-remaining-subscription-reads', + '11964', + 'x-ms-request-id', + 'a4827807-1573-4b57-b335-dc4b09fa2d5a', + 'x-ms-correlation-request-id', + 'a4827807-1573-4b57-b335-dc4b09fa2d5a', + 'x-ms-routing-request-id', + 'JAPANEAST:20211217T064341Z:a4827807-1573-4b57-b335-dc4b09fa2d5a', + 'Strict-Transport-Security', + 'max-age=31536000; includeSubDomains', + 'X-Content-Type-Options', + 'nosniff', + 'Date', + 'Fri, 17 Dec 2021 06:43:41 GMT' +]); + +nock('https://management.azure.com:443', {"encodedQueryParams":true}) + .get('/subscriptions/azure_subscription_id/providers/Microsoft.Devices/locations/eastus/operationResults/aWQ9b3NfaWhfMWFiNTIxY2QtZjI1Ny00MzBkLWI3ZGQtYzJmMmFhMTA0NDJhO3JlZ2lvbj1lYXN0dXM=') + .query(true) + .reply(200, ["1f8b0800000000000400edbd07601c499625262f6dca7b7f4af54ad7e074a10880601324d8904010ecc188cde692ec1d69472329ab2a81ca6556655d661640cced9dbcf7de7befbdf7de7befbdf7ba3b9d4e27f7dfff3f5c6664016cf6ce4adac99e2180aac81f3f7e7c1f3f227ef1474d9bb5ebe6a3471fbd5a2f97c5f2e2a3","5ff2ff0089ccbd4914000000"], [ + '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', + 'Server', + 'Microsoft-HTTPAPI/2.0', + 'x-ms-ratelimit-remaining-subscription-reads', + '11963', + 'x-ms-request-id', + 'e5a8fa08-21cb-42a2-86ce-b403333e6525', + 'x-ms-correlation-request-id', + 'e5a8fa08-21cb-42a2-86ce-b403333e6525', + 'x-ms-routing-request-id', + 'JAPANEAST:20211217T064343Z:e5a8fa08-21cb-42a2-86ce-b403333e6525', + 'Strict-Transport-Security', + 'max-age=31536000; includeSubDomains', + 'X-Content-Type-Options', + 'nosniff', + 'Date', + 'Fri, 17 Dec 2021 06:43:43 GMT' +]); + +nock('https://management.azure.com:443', {"encodedQueryParams":true}) + .get('/subscriptions/azure_subscription_id/providers/Microsoft.Devices/locations/eastus/operationResults/aWQ9b3NfaWhfMWFiNTIxY2QtZjI1Ny00MzBkLWI3ZGQtYzJmMmFhMTA0NDJhO3JlZ2lvbj1lYXN0dXM=') + .query(true) + .reply(200, ["1f8b0800000000000400edbd07601c499625262f6dca7b7f4af54ad7e074a10880601324d8904010ecc188cde692ec1d69472329ab2a81ca6556655d661640cced9dbcf7de7befbdf7de7befbdf7ba3b9d4e27f7dfff3f5c6664016cf6ce4adac99e2180aac81f3f7e7c1f3f227ef1474d9bb5ebe6a3471fbd5a2f97c5f2e2a3","5ff2ff0089ccbd4914000000"], [ + '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', + 'Server', + 'Microsoft-HTTPAPI/2.0', + 'x-ms-ratelimit-remaining-subscription-reads', + '11962', + 'x-ms-request-id', + '48a2a377-3879-4b2e-b10a-9445e8b4711f', + 'x-ms-correlation-request-id', + '48a2a377-3879-4b2e-b10a-9445e8b4711f', + 'x-ms-routing-request-id', + 'JAPANEAST:20211217T064345Z:48a2a377-3879-4b2e-b10a-9445e8b4711f', + 'Strict-Transport-Security', + 'max-age=31536000; includeSubDomains', + 'X-Content-Type-Options', + 'nosniff', + 'Date', + 'Fri, 17 Dec 2021 06:43:45 GMT' +]); + +nock('https://management.azure.com:443', {"encodedQueryParams":true}) + .get('/subscriptions/azure_subscription_id/providers/Microsoft.Devices/locations/eastus/operationResults/aWQ9b3NfaWhfMWFiNTIxY2QtZjI1Ny00MzBkLWI3ZGQtYzJmMmFhMTA0NDJhO3JlZ2lvbj1lYXN0dXM=') + .query(true) + .reply(200, ["1f8b0800000000000400edbd07601c499625262f6dca7b7f4af54ad7e074a10880601324d8904010ecc188cde692ec1d69472329ab2a81ca6556655d661640cced9dbcf7de7befbdf7de7befbdf7ba3b9d4e27f7dfff3f5c6664016cf6ce4adac99e2180aac81f3f7e7c1f3f227ef1474d9bb5ebe6a3471fbd5a2f97c5f2e2a3","5ff2ff0089ccbd4914000000"], [ + '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', + 'Server', + 'Microsoft-HTTPAPI/2.0', + 'x-ms-ratelimit-remaining-subscription-reads', + '11961', + 'x-ms-request-id', + '012379ff-ebfc-46b8-b8d8-1c286861a542', + 'x-ms-correlation-request-id', + '012379ff-ebfc-46b8-b8d8-1c286861a542', + 'x-ms-routing-request-id', + 'JAPANEAST:20211217T064348Z:012379ff-ebfc-46b8-b8d8-1c286861a542', + 'Strict-Transport-Security', + 'max-age=31536000; includeSubDomains', + 'X-Content-Type-Options', + 'nosniff', + 'Date', + 'Fri, 17 Dec 2021 06:43:48 GMT' +]); + +nock('https://management.azure.com:443', {"encodedQueryParams":true}) + .get('/subscriptions/azure_subscription_id/providers/Microsoft.Devices/locations/eastus/operationResults/aWQ9b3NfaWhfMWFiNTIxY2QtZjI1Ny00MzBkLWI3ZGQtYzJmMmFhMTA0NDJhO3JlZ2lvbj1lYXN0dXM=') + .query(true) + .reply(200, ["1f8b0800000000000400edbd07601c499625262f6dca7b7f4af54ad7e074a10880601324d8904010ecc188cde692ec1d69472329ab2a81ca6556655d661640cced9dbcf7de7befbdf7de7befbdf7ba3b9d4e27f7dfff3f5c6664016cf6ce4adac99e2180aac81f3f7e7c1f3f227ef1474d9bb5ebe6a3471fbd5a2f97c5f2e2a3","5ff2ff0089ccbd4914000000"], [ + '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', + 'Server', + 'Microsoft-HTTPAPI/2.0', + 'x-ms-ratelimit-remaining-subscription-reads', + '11960', + 'x-ms-request-id', + '4ad22438-5fb6-4418-8496-7fa57404cdf5', + 'x-ms-correlation-request-id', + '4ad22438-5fb6-4418-8496-7fa57404cdf5', + 'x-ms-routing-request-id', + 'JAPANEAST:20211217T064350Z:4ad22438-5fb6-4418-8496-7fa57404cdf5', + 'Strict-Transport-Security', + 'max-age=31536000; includeSubDomains', + 'X-Content-Type-Options', + 'nosniff', + 'Date', + 'Fri, 17 Dec 2021 06:43:50 GMT' +]); + +nock('https://management.azure.com:443', {"encodedQueryParams":true}) + .get('/subscriptions/azure_subscription_id/providers/Microsoft.Devices/locations/eastus/operationResults/aWQ9b3NfaWhfMWFiNTIxY2QtZjI1Ny00MzBkLWI3ZGQtYzJmMmFhMTA0NDJhO3JlZ2lvbj1lYXN0dXM=') + .query(true) + .reply(200, ["1f8b0800000000000400edbd07601c499625262f6dca7b7f4af54ad7e074a10880601324d8904010ecc188cde692ec1d69472329ab2a81ca6556655d661640cced9dbcf7de7befbdf7de7befbdf7ba3b9d4e27f7dfff3f5c6664016cf6ce4adac99e2180aac81f3f7e7c1f3f227ef1474d9bb5ebe6a3471fbd5a2f97c5f2e2a3","5ff2ff0089ccbd4914000000"], [ + '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', + 'Server', + 'Microsoft-HTTPAPI/2.0', + 'x-ms-ratelimit-remaining-subscription-reads', + '11959', + 'x-ms-request-id', + 'd4a2c1cb-35c7-464f-afab-7664bb7809eb', + 'x-ms-correlation-request-id', + 'd4a2c1cb-35c7-464f-afab-7664bb7809eb', + 'x-ms-routing-request-id', + 'JAPANEAST:20211217T064352Z:d4a2c1cb-35c7-464f-afab-7664bb7809eb', + 'Strict-Transport-Security', + 'max-age=31536000; includeSubDomains', + 'X-Content-Type-Options', + 'nosniff', + 'Date', + 'Fri, 17 Dec 2021 06:43:52 GMT' +]); + +nock('https://management.azure.com:443', {"encodedQueryParams":true}) + .get('/subscriptions/azure_subscription_id/providers/Microsoft.Devices/locations/eastus/operationResults/aWQ9b3NfaWhfMWFiNTIxY2QtZjI1Ny00MzBkLWI3ZGQtYzJmMmFhMTA0NDJhO3JlZ2lvbj1lYXN0dXM=') + .query(true) + .reply(200, ["1f8b0800000000000400edbd07601c499625262f6dca7b7f4af54ad7e074a10880601324d8904010ecc188cde692ec1d69472329ab2a81ca6556655d661640cced9dbcf7de7befbdf7de7befbdf7ba3b9d4e27f7dfff3f5c6664016cf6ce4adac99e2180aac81f3f7e7c1f3f227ef1474d9bb5ebe6a3471fbd5a2f97c5f2e2a3","5ff2ff0089ccbd4914000000"], [ + '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', + 'Server', + 'Microsoft-HTTPAPI/2.0', + 'x-ms-ratelimit-remaining-subscription-reads', + '11958', + 'x-ms-request-id', + 'aa274c04-624b-4344-bc42-343b73deffbf', + 'x-ms-correlation-request-id', + 'aa274c04-624b-4344-bc42-343b73deffbf', + 'x-ms-routing-request-id', + 'JAPANEAST:20211217T064354Z:aa274c04-624b-4344-bc42-343b73deffbf', + 'Strict-Transport-Security', + 'max-age=31536000; includeSubDomains', + 'X-Content-Type-Options', + 'nosniff', + 'Date', + 'Fri, 17 Dec 2021 06:43:54 GMT' +]); + +nock('https://management.azure.com:443', {"encodedQueryParams":true}) + .get('/subscriptions/azure_subscription_id/providers/Microsoft.Devices/locations/eastus/operationResults/aWQ9b3NfaWhfMWFiNTIxY2QtZjI1Ny00MzBkLWI3ZGQtYzJmMmFhMTA0NDJhO3JlZ2lvbj1lYXN0dXM=') + .query(true) + .reply(200, ["1f8b0800000000000400edbd07601c499625262f6dca7b7f4af54ad7e074a10880601324d8904010ecc188cde692ec1d69472329ab2a81ca6556655d661640cced9dbcf7de7befbdf7de7befbdf7ba3b9d4e27f7dfff3f5c6664016cf6ce4adac99e2180aac81f3f7e7c1f3f227ef1474d9bb5ebe6a3471fbd5a2f97c5f2e2a3","5ff2ff0089ccbd4914000000"], [ + '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', + 'Server', + 'Microsoft-HTTPAPI/2.0', + 'x-ms-ratelimit-remaining-subscription-reads', + '11957', + 'x-ms-request-id', + 'efc067fc-e48c-41e0-8af9-d42591c4fad0', + 'x-ms-correlation-request-id', + 'efc067fc-e48c-41e0-8af9-d42591c4fad0', + 'x-ms-routing-request-id', + 'JAPANEAST:20211217T064357Z:efc067fc-e48c-41e0-8af9-d42591c4fad0', + 'Strict-Transport-Security', + 'max-age=31536000; includeSubDomains', + 'X-Content-Type-Options', + 'nosniff', + 'Date', + 'Fri, 17 Dec 2021 06:43:57 GMT' +]); + +nock('https://management.azure.com:443', {"encodedQueryParams":true}) + .get('/subscriptions/azure_subscription_id/providers/Microsoft.Devices/locations/eastus/operationResults/aWQ9b3NfaWhfMWFiNTIxY2QtZjI1Ny00MzBkLWI3ZGQtYzJmMmFhMTA0NDJhO3JlZ2lvbj1lYXN0dXM=') + .query(true) + .reply(200, ["1f8b0800000000000400edbd07601c499625262f6dca7b7f4af54ad7e074a10880601324d8904010ecc188cde692ec1d69472329ab2a81ca6556655d661640cced9dbcf7de7befbdf7de7befbdf7ba3b9d4e27f7dfff3f5c6664016cf6ce4adac99e2180aac81f3f7e7c1f3f227ef1474d9bb5ebe6a3471fbd5a2f97c5f2e2a3","5ff2ff0089ccbd4914000000"], [ + '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', + 'Server', + 'Microsoft-HTTPAPI/2.0', + 'x-ms-ratelimit-remaining-subscription-reads', + '11956', + 'x-ms-request-id', + '908ff09c-df2e-4a09-b0d5-f94f312d1171', + 'x-ms-correlation-request-id', + '908ff09c-df2e-4a09-b0d5-f94f312d1171', + 'x-ms-routing-request-id', + 'JAPANEAST:20211217T064359Z:908ff09c-df2e-4a09-b0d5-f94f312d1171', + 'Strict-Transport-Security', + 'max-age=31536000; includeSubDomains', + 'X-Content-Type-Options', + 'nosniff', + 'Date', + 'Fri, 17 Dec 2021 06:43:59 GMT' +]); + +nock('https://management.azure.com:443', {"encodedQueryParams":true}) + .get('/subscriptions/azure_subscription_id/providers/Microsoft.Devices/locations/eastus/operationResults/aWQ9b3NfaWhfMWFiNTIxY2QtZjI1Ny00MzBkLWI3ZGQtYzJmMmFhMTA0NDJhO3JlZ2lvbj1lYXN0dXM=') + .query(true) + .reply(200, ["1f8b0800000000000400edbd07601c499625262f6dca7b7f4af54ad7e074a10880601324d8904010ecc188cde692ec1d69472329ab2a81ca6556655d661640cced9dbcf7de7befbdf7de7befbdf7ba3b9d4e27f7dfff3f5c6664016cf6ce4adac99e2180aac81f3f7e7c1f3f227ef1474d9bb5ebe6a3471fbd5a2f97c5f2e2a3","5ff2ff0089ccbd4914000000"], [ + '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', + 'Server', + 'Microsoft-HTTPAPI/2.0', + 'x-ms-ratelimit-remaining-subscription-reads', + '11955', + 'x-ms-request-id', + '7ee5d679-df27-45b6-a94b-d0c2a2e936fc', + 'x-ms-correlation-request-id', + '7ee5d679-df27-45b6-a94b-d0c2a2e936fc', + 'x-ms-routing-request-id', + 'JAPANEAST:20211217T064401Z:7ee5d679-df27-45b6-a94b-d0c2a2e936fc', + 'Strict-Transport-Security', + 'max-age=31536000; includeSubDomains', + 'X-Content-Type-Options', + 'nosniff', + 'Date', + 'Fri, 17 Dec 2021 06:44:01 GMT' +]); + +nock('https://management.azure.com:443', {"encodedQueryParams":true}) + .get('/subscriptions/azure_subscription_id/providers/Microsoft.Devices/locations/eastus/operationResults/aWQ9b3NfaWhfMWFiNTIxY2QtZjI1Ny00MzBkLWI3ZGQtYzJmMmFhMTA0NDJhO3JlZ2lvbj1lYXN0dXM=') + .query(true) + .reply(200, ["1f8b0800000000000400edbd07601c499625262f6dca7b7f4af54ad7e074a10880601324d8904010ecc188cde692ec1d69472329ab2a81ca6556655d661640cced9dbcf7de7befbdf7de7befbdf7ba3b9d4e27f7dfff3f5c6664016cf6ce4adac99e2180aac81f3f7e7c1f3f227ef1474d9bb5ebe6a3471fbd5a2f97c5f2e2a3","5ff2ff0089ccbd4914000000"], [ + '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', + 'Server', + 'Microsoft-HTTPAPI/2.0', + 'x-ms-ratelimit-remaining-subscription-reads', + '11954', + 'x-ms-request-id', + 'fb0587bf-bec6-489e-bff2-4f8ec12d1da2', + 'x-ms-correlation-request-id', + 'fb0587bf-bec6-489e-bff2-4f8ec12d1da2', + 'x-ms-routing-request-id', + 'JAPANEAST:20211217T064404Z:fb0587bf-bec6-489e-bff2-4f8ec12d1da2', + 'Strict-Transport-Security', + 'max-age=31536000; includeSubDomains', + 'X-Content-Type-Options', + 'nosniff', + 'Date', + 'Fri, 17 Dec 2021 06:44:03 GMT' +]); + +nock('https://management.azure.com:443', {"encodedQueryParams":true}) + .get('/subscriptions/azure_subscription_id/providers/Microsoft.Devices/locations/eastus/operationResults/aWQ9b3NfaWhfMWFiNTIxY2QtZjI1Ny00MzBkLWI3ZGQtYzJmMmFhMTA0NDJhO3JlZ2lvbj1lYXN0dXM=') + .query(true) + .reply(200, ["1f8b0800000000000400edbd07601c499625262f6dca7b7f4af54ad7e074a10880601324d8904010ecc188cde692ec1d69472329ab2a81ca6556655d661640cced9dbcf7de7befbdf7de7befbdf7ba3b9d4e27f7dfff3f5c6664016cf6ce4adac99e2180aac81f3f7e7c1f3f227ef1474d9bb5ebe6a3471fbd5a2f97c5f2e2a3","5ff2ff0089ccbd4914000000"], [ + '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', + 'Server', + 'Microsoft-HTTPAPI/2.0', + 'x-ms-ratelimit-remaining-subscription-reads', + '11953', + 'x-ms-request-id', + 'c9cd9555-03a3-4972-96fb-7ccacc659a1e', + 'x-ms-correlation-request-id', + 'c9cd9555-03a3-4972-96fb-7ccacc659a1e', + 'x-ms-routing-request-id', + 'JAPANEAST:20211217T064406Z:c9cd9555-03a3-4972-96fb-7ccacc659a1e', + 'Strict-Transport-Security', + 'max-age=31536000; includeSubDomains', + 'X-Content-Type-Options', + 'nosniff', + 'Date', + 'Fri, 17 Dec 2021 06:44:06 GMT' +]); + +nock('https://management.azure.com:443', {"encodedQueryParams":true}) + .get('/subscriptions/azure_subscription_id/providers/Microsoft.Devices/locations/eastus/operationResults/aWQ9b3NfaWhfMWFiNTIxY2QtZjI1Ny00MzBkLWI3ZGQtYzJmMmFhMTA0NDJhO3JlZ2lvbj1lYXN0dXM=') + .query(true) + .reply(200, ["1f8b0800000000000400edbd07601c499625262f6dca7b7f4af54ad7e074a10880601324d8904010ecc188cde692ec1d69472329ab2a81ca6556655d661640cced9dbcf7de7befbdf7de7befbdf7ba3b9d4e27f7dfff3f5c6664016cf6ce4adac99e2180aac81f3f7e7c1f3f227ef1474d9bb5ebe6a3471fbd5a2f97c5f2e2a3","5ff2ff0089ccbd4914000000"], [ + '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', + 'Server', + 'Microsoft-HTTPAPI/2.0', + 'x-ms-ratelimit-remaining-subscription-reads', + '11952', + 'x-ms-request-id', + '2a760c20-827e-4e03-8096-bfd5fc4d98e0', + 'x-ms-correlation-request-id', + '2a760c20-827e-4e03-8096-bfd5fc4d98e0', + 'x-ms-routing-request-id', + 'JAPANEAST:20211217T064408Z:2a760c20-827e-4e03-8096-bfd5fc4d98e0', + 'Strict-Transport-Security', + 'max-age=31536000; includeSubDomains', + 'X-Content-Type-Options', + 'nosniff', + 'Date', + 'Fri, 17 Dec 2021 06:44:08 GMT' +]); + +nock('https://management.azure.com:443', {"encodedQueryParams":true}) + .get('/subscriptions/azure_subscription_id/providers/Microsoft.Devices/locations/eastus/operationResults/aWQ9b3NfaWhfMWFiNTIxY2QtZjI1Ny00MzBkLWI3ZGQtYzJmMmFhMTA0NDJhO3JlZ2lvbj1lYXN0dXM=') + .query(true) + .reply(200, ["1f8b0800000000000400edbd07601c499625262f6dca7b7f4af54ad7e074a10880601324d8904010ecc188cde692ec1d69472329ab2a81ca6556655d661640cced9dbcf7de7befbdf7de7befbdf7ba3b9d4e27f7dfff3f5c6664016cf6ce4adac99e2180aac81f3f7e7c1f3f227ef1474d9bb5ebe6a3471fbd5a2f97c5f2e2a3","5ff2ff0089ccbd4914000000"], [ + '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', + 'Server', + 'Microsoft-HTTPAPI/2.0', + 'x-ms-ratelimit-remaining-subscription-reads', + '11951', + 'x-ms-request-id', + '2a7b551b-1444-4a27-a01a-9adb1e848903', + 'x-ms-correlation-request-id', + '2a7b551b-1444-4a27-a01a-9adb1e848903', + 'x-ms-routing-request-id', + 'JAPANEAST:20211217T064411Z:2a7b551b-1444-4a27-a01a-9adb1e848903', + 'Strict-Transport-Security', + 'max-age=31536000; includeSubDomains', + 'X-Content-Type-Options', + 'nosniff', + 'Date', + 'Fri, 17 Dec 2021 06:44:10 GMT' +]); + +nock('https://management.azure.com:443', {"encodedQueryParams":true}) + .get('/subscriptions/azure_subscription_id/providers/Microsoft.Devices/locations/eastus/operationResults/aWQ9b3NfaWhfMWFiNTIxY2QtZjI1Ny00MzBkLWI3ZGQtYzJmMmFhMTA0NDJhO3JlZ2lvbj1lYXN0dXM=') + .query(true) + .reply(200, ["1f8b0800000000000400edbd07601c499625262f6dca7b7f4af54ad7e074a10880601324d8904010ecc188cde692ec1d69472329ab2a81ca6556655d661640cced9dbcf7de7befbdf7de7befbdf7ba3b9d4e27f7dfff3f5c6664016cf6ce4adac99e2180aac81f3f7e7c1f3f227ef1474d9bb5ebe6a3471fbd5a2f97c5f2e2a3","5ff2ff0089ccbd4914000000"], [ + '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', + 'Server', + 'Microsoft-HTTPAPI/2.0', + 'x-ms-ratelimit-remaining-subscription-reads', + '11950', + 'x-ms-request-id', + '47212d7f-9e87-48db-af48-161b47053e97', + 'x-ms-correlation-request-id', + '47212d7f-9e87-48db-af48-161b47053e97', + 'x-ms-routing-request-id', + 'JAPANEAST:20211217T064413Z:47212d7f-9e87-48db-af48-161b47053e97', + 'Strict-Transport-Security', + 'max-age=31536000; includeSubDomains', + 'X-Content-Type-Options', + 'nosniff', + 'Date', + 'Fri, 17 Dec 2021 06:44:13 GMT' +]); + +nock('https://management.azure.com:443', {"encodedQueryParams":true}) + .get('/subscriptions/azure_subscription_id/providers/Microsoft.Devices/locations/eastus/operationResults/aWQ9b3NfaWhfMWFiNTIxY2QtZjI1Ny00MzBkLWI3ZGQtYzJmMmFhMTA0NDJhO3JlZ2lvbj1lYXN0dXM=') + .query(true) + .reply(200, ["1f8b0800000000000400edbd07601c499625262f6dca7b7f4af54ad7e074a10880601324d8904010ecc188cde692ec1d69472329ab2a81ca6556655d661640cced9dbcf7de7befbdf7de7befbdf7ba3b9d4e27f7dfff3f5c6664016cf6ce4adac99e2180aac81f3f7e7c1f3f227ef1474d9bb5ebe6a3471fbd5a2f97c5f2e2a3","5ff2ff0089ccbd4914000000"], [ + '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', + 'Server', + 'Microsoft-HTTPAPI/2.0', + 'x-ms-ratelimit-remaining-subscription-reads', + '11949', + 'x-ms-request-id', + '54d2e8d6-096c-49e8-a66c-1dbc1760edd3', + 'x-ms-correlation-request-id', + '54d2e8d6-096c-49e8-a66c-1dbc1760edd3', + 'x-ms-routing-request-id', + 'JAPANEAST:20211217T064415Z:54d2e8d6-096c-49e8-a66c-1dbc1760edd3', + 'Strict-Transport-Security', + 'max-age=31536000; includeSubDomains', + 'X-Content-Type-Options', + 'nosniff', + 'Date', + 'Fri, 17 Dec 2021 06:44:15 GMT' +]); + +nock('https://management.azure.com:443', {"encodedQueryParams":true}) + .get('/subscriptions/azure_subscription_id/providers/Microsoft.Devices/locations/eastus/operationResults/aWQ9b3NfaWhfMWFiNTIxY2QtZjI1Ny00MzBkLWI3ZGQtYzJmMmFhMTA0NDJhO3JlZ2lvbj1lYXN0dXM=') + .query(true) + .reply(200, ["1f8b0800000000000400edbd07601c499625262f6dca7b7f4af54ad7e074a10880601324d8904010ecc188cde692ec1d69472329ab2a81ca6556655d661640cced9dbcf7de7befbdf7de7befbdf7ba3b9d4e27f7dfff3f5c6664016cf6ce4adac99e2180aac81f3f7e7c1f3f227ef1474d9bb5ebe6a3471fbd5a2f97c5f2e2a3","5ff2ff0089ccbd4914000000"], [ + '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', + 'Server', + 'Microsoft-HTTPAPI/2.0', + 'x-ms-ratelimit-remaining-subscription-reads', + '11948', + 'x-ms-request-id', + '83bc8de6-3a2c-4cad-a4c9-1c4f3742bd7b', + 'x-ms-correlation-request-id', + '83bc8de6-3a2c-4cad-a4c9-1c4f3742bd7b', + 'x-ms-routing-request-id', + 'JAPANEAST:20211217T064417Z:83bc8de6-3a2c-4cad-a4c9-1c4f3742bd7b', + 'Strict-Transport-Security', + 'max-age=31536000; includeSubDomains', + 'X-Content-Type-Options', + 'nosniff', + 'Date', + 'Fri, 17 Dec 2021 06:44:17 GMT' +]); + +nock('https://management.azure.com:443', {"encodedQueryParams":true}) + .get('/subscriptions/azure_subscription_id/providers/Microsoft.Devices/locations/eastus/operationResults/aWQ9b3NfaWhfMWFiNTIxY2QtZjI1Ny00MzBkLWI3ZGQtYzJmMmFhMTA0NDJhO3JlZ2lvbj1lYXN0dXM=') + .query(true) + .reply(200, ["1f8b0800000000000400edbd07601c499625262f6dca7b7f4af54ad7e074a10880601324d8904010ecc188cde692ec1d69472329ab2a81ca6556655d661640cced9dbcf7de7befbdf7de7befbdf7ba3b9d4e27f7dfff3f5c6664016cf6ce4adac99e2180aac81f3f7e7c1f3f227ef1474d9bb5ebe6a3471fbd5a2f97c5f2e2a3","5ff2ff0089ccbd4914000000"], [ + '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', + 'Server', + 'Microsoft-HTTPAPI/2.0', + 'x-ms-ratelimit-remaining-subscription-reads', + '11947', + 'x-ms-request-id', + '416c18d1-0ed4-4676-8587-3403a5a28f40', + 'x-ms-correlation-request-id', + '416c18d1-0ed4-4676-8587-3403a5a28f40', + 'x-ms-routing-request-id', + 'JAPANEAST:20211217T064420Z:416c18d1-0ed4-4676-8587-3403a5a28f40', + 'Strict-Transport-Security', + 'max-age=31536000; includeSubDomains', + 'X-Content-Type-Options', + 'nosniff', + 'Date', + 'Fri, 17 Dec 2021 06:44:19 GMT' +]); + +nock('https://management.azure.com:443', {"encodedQueryParams":true}) + .get('/subscriptions/azure_subscription_id/providers/Microsoft.Devices/locations/eastus/operationResults/aWQ9b3NfaWhfMWFiNTIxY2QtZjI1Ny00MzBkLWI3ZGQtYzJmMmFhMTA0NDJhO3JlZ2lvbj1lYXN0dXM=') + .query(true) + .reply(200, ["1f8b0800000000000400edbd07601c499625262f6dca7b7f4af54ad7e074a10880601324d8904010ecc188cde692ec1d69472329ab2a81ca6556655d661640cced9dbcf7de7befbdf7de7befbdf7ba3b9d4e27f7dfff3f5c6664016cf6ce4adac99e2180aac81f3f7e7c1f3f227ef1474d9bb5ebe6a3471fbd5e4fa7793ecb671ffd","92ff0720887be416000000"], [ + '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', + 'Server', + 'Microsoft-HTTPAPI/2.0', + 'x-ms-ratelimit-remaining-subscription-reads', + '11946', + 'x-ms-request-id', + '04dea6fc-459e-411b-aef6-0e322d623e9a', + 'x-ms-correlation-request-id', + '04dea6fc-459e-411b-aef6-0e322d623e9a', + 'x-ms-routing-request-id', + 'JAPANEAST:20211217T064422Z:04dea6fc-459e-411b-aef6-0e322d623e9a', + 'Strict-Transport-Security', + 'max-age=31536000; includeSubDomains', + 'X-Content-Type-Options', + 'nosniff', + 'Date', + 'Fri, 17 Dec 2021 06:44:22 GMT' +]); + +nock('https://management.azure.com:443', {"encodedQueryParams":true}) + .get('/subscriptions/azure_subscription_id/resourceGroups/myjstest/providers/Microsoft.Devices/IotHubs/myiothubxxxxyyyjjrr') + .query(true) + .reply(200, ["1f8b0800000000000400edbd07601c499625262f6dca7b7f4af54ad7e074a10880601324d8904010ecc188cde692ec1d69472329ab2a81ca6556655d661640cced9dbcf7de7befbdf7de7befbdf7ba3b9d4e27f7dfff3f5c6664016cf6ce4adac99e2180aac81f3f7e7c1f3f227ef147c5eca3471fdd6dd693665a17abb6a896cddd877be70fefcf0eceb7ef4d3f7db0bdbfbbb7bffd7077fa60fb607abef3603a9b9cefedefdeadf3a65ad7d3fcf3ba5aaf9abb8beb9f6edabc69efaeeaeab298e57573f78b625a574d75de8e9fe697c5346fee9e55edb7a9276a5c54ed7c3d7947cff5f5f54fff745d7f34fa68992d724226fe657bbdc2978330a949594d330c809ae559d3aef1599b5d341f3dfac51fbdcdafe9e3cbac5ce7bb1ffd92d147fe809904b71933c133a3bec0a8e935336cfa2aa7bee893637a9e3efb7471f5faec33fa94c8b1caebb6c8190d8322fdf13df717bd754a08a75fbda617eaaac4405775b1c8ea6bc23568f75dea2b68d7e4d36a39e396dfa761b5598b4f8fa76d7199532beafeb268e8dd6279f15abf7cbd9e4ef37c96cfe8fb62f5ac28dbbc7eb52e81212175ce7fbfc8782e6afa18c3ce081ef77f4cafae30da62f545d6bca54f76efed8e77771f8c77ef3f1cdfbfc7582cf3f6aaaadf02e6ebbc25b0bff8a3597e9eadcb1678319ca7f9f29aa064ab5579fda67ab2a64ecf96a797f9129379ba9cadaa62d97ef4a8add739fa02288273337a65595dd107c3d8d1dccfaba65500115e1b673f58d7f9f64cd86b4c632178790733c2e517cb87fc5b9db7f42ba1f0a658e467cba7d9357dbc4bd4cf68e6f1f949b5c670f6bc8fce66d4e67b1fed10f4dd8f8868abac9dc731a216b9f64b0d9ac9a3bb77a5cdf6b2d976edb7773fddbfb777ffdedef6c18387f974b2bf933f1837798d714cd6cdf8aa58ceaa2b1ed1dd8f7e09d18158b825b6c0000c7c42e9177fa4ef3c59373fb1ced74c77c2cf7dfaa65a1553fd94694084d13f9bb6aab38bfca45ab659b12425808fb52b03e83c2bcb49367dfb0a9fa13f95fbdfcd7c41e31521a30f45cabfc89b86c042a0c1ed4c3ffa12dc411f19e431a7e843906a40d4a2395d66939258fd11416f720c5b710ca6f27753fec4ef4dd6bc69cbe3e6aca90e3eddd9a57e5ebed9fd36f5435d2f73e6b4d76dcd84fb483e95b1a27b7c843e08114298da04bd10efe62faab6382f449ef94312eeb74fd7357fd0e9f40b02df46515964ef9ee62589787dadacb5bb837e731e2d8974fed5aaacb259a737a601a15c56ebd99b4a680b1c62e0464666e3c438270dc29345af7fa34338cfb3960490b0fde845b5c4fc2e8ae59bb2f949e226824f1fef8ef7e8536296ea2a9f3dfb45b3e5f3821430f116bdddbc5d032365a9d7500e6d91d7f8bdcda027a1f4a6d92a9b162d59845d7a858c15c92efefac5c6ca70c7bfe497","fc3f03e74d631e070000"], [ + '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', + 'Server', + 'Microsoft-HTTPAPI/2.0', + 'x-ms-ratelimit-remaining-subscription-reads', + '11945', + 'x-ms-request-id', + 'a3a07955-6ee4-484a-a7fd-93ea0bd978ae', + 'x-ms-correlation-request-id', + 'a3a07955-6ee4-484a-a7fd-93ea0bd978ae', + 'x-ms-routing-request-id', + 'JAPANEAST:20211217T064424Z:a3a07955-6ee4-484a-a7fd-93ea0bd978ae', + 'Strict-Transport-Security', + 'max-age=31536000; includeSubDomains', + 'X-Content-Type-Options', + 'nosniff', + 'Date', + 'Fri, 17 Dec 2021 06:44:24 GMT' +]); diff --git a/sdk/iothub/arm-iothub/recordings/node/iothub_test/recording_iothubresource_delete_test.js b/sdk/iothub/arm-iothub/recordings/node/iothub_test/recording_iothubresource_delete_test.js new file mode 100644 index 000000000000..b90539179410 --- /dev/null +++ b/sdk/iothub/arm-iothub/recordings/node/iothub_test/recording_iothubresource_delete_test.js @@ -0,0 +1,293 @@ +let nock = require('nock'); + +module.exports.hash = "d67edb5c49e1b89a9794527c1a3680b1"; + +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', + 'd3033c4a-b30b-4222-a25d-93df37770a00', + 'x-ms-ests-server', + '2.1.12261.15 - KRSLR2 ProdSlices', + 'Set-Cookie', + 'fpc=AsXV0cT59CpMmgjpa4P3AdU; expires=Sun, 16-Jan-2022 06:44:30 GMT; path=/; secure; HttpOnly; SameSite=None', + 'Set-Cookie', + 'esctx=AQABAAAAAAD--DLA3VO7QrddgJg7Wevr5zdxeoO5BKcwQMnpA7CP5cNlEsXdW_fZGgqVldOpKi3dAw4f2Q4PdfhX6YOQt2NZ868ezPXMz6v4bN_Wx378gVKKjrlphMGFcAraLrSKrZ3A6sGZLT3RpgEgaKYX9Yj4yIDwENJmJ5co9DlY1KVkkE7mdQv55W4uv3sDZmgwRmEgAA; 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, 17 Dec 2021 06:44:29 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', + '53945eb4-3dd6-4ced-b70e-f5e5ecec0a00', + 'x-ms-ests-server', + '2.1.12261.15 - SEASLR2 ProdSlices', + 'Set-Cookie', + 'fpc=AlHRFvl6pi1NrSu6fR3uaI0; expires=Sun, 16-Jan-2022 06:44:30 GMT; path=/; secure; HttpOnly; SameSite=None', + 'Set-Cookie', + 'esctx=AQABAAAAAAD--DLA3VO7QrddgJg7Wevr-HoX41saGOmcQB1Be5TFuKyyelxEceu4NRT5MkVaFsPmJO5Zm7ECBAbG9fOKgq-HJOTXVS5DPHsrnlvm9oHHMyB2HcwWviT4ALJW4dWxRsxkGMq-45YPuW3bNHXHipfy7DdZZt9viAFWsZPKJF1EjfpfA8ZEDaJFoCmJtGEpjjogAA; 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, 17 Dec 2021 06:44:30 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.4.0&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=e624348c-21f6-44ca-8fbc-58aeff9a4041&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', + '53945eb4-3dd6-4ced-b70e-f5e5eeec0a00', + 'x-ms-ests-server', + '2.1.12261.15 - SEASLR2 ProdSlices', + 'x-ms-clitelem', + '1,0,0,,', + 'Set-Cookie', + 'fpc=Ao8Nux78KF5FqwHejb9-4s3Lj78gAQAAAM4oTtkOAAAA; expires=Sun, 16-Jan-2022 06:44:31 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, 17 Dec 2021 06:44:30 GMT', + 'Content-Length', + '1393' +]); + +nock('https://management.azure.com:443', {"encodedQueryParams":true}) + .delete('/subscriptions/azure_subscription_id/resourceGroups/myjstest/providers/Microsoft.Devices/IotHubs/myiothubxxxxyyyjjrr') + .query(true) + .reply(202, null, [ + 'Cache-Control', + 'no-cache', + 'Pragma', + 'no-cache', + 'Content-Length', + '4', + 'Content-Type', + 'application/json; charset=utf-8', + 'Expires', + '-1', + 'Location', + 'https://management.azure.com/subscriptions/azure_subscription_id/providers/Microsoft.Devices/locations/eastus/operationResults/aWQ9b3NfaWhfNmQ0ZjY4NzItMzQwZC00NmZiLWIyZjEtNzkzY2MxOWNlZmM0O3JlZ2lvbj1lYXN0dXM=?api-version=2021-07-01&operationSource=other', + 'Retry-After', + '15', + 'Azure-AsyncOperation', + 'https://management.azure.com/subscriptions/azure_subscription_id/providers/Microsoft.Devices/locations/eastus/operationResults/aWQ9b3NfaWhfNmQ0ZjY4NzItMzQwZC00NmZiLWIyZjEtNzkzY2MxOWNlZmM0O3JlZ2lvbj1lYXN0dXM=?api-version=2021-07-01&operationSource=other&asyncinfo', + 'Server', + 'Microsoft-HTTPAPI/2.0', + 'x-ms-ratelimit-remaining-subscription-deletes', + '14999', + 'x-ms-request-id', + '8819d82e-dbef-4a9a-8230-b8a392ba3d6e', + 'x-ms-correlation-request-id', + '8819d82e-dbef-4a9a-8230-b8a392ba3d6e', + 'x-ms-routing-request-id', + 'JAPANEAST:20211217T064432Z:8819d82e-dbef-4a9a-8230-b8a392ba3d6e', + 'Strict-Transport-Security', + 'max-age=31536000; includeSubDomains', + 'X-Content-Type-Options', + 'nosniff', + 'Date', + 'Fri, 17 Dec 2021 06:44:31 GMT' +]); + +nock('https://management.azure.com:443', {"encodedQueryParams":true}) + .get('/subscriptions/azure_subscription_id/providers/Microsoft.Devices/locations/eastus/operationResults/aWQ9b3NfaWhfNmQ0ZjY4NzItMzQwZC00NmZiLWIyZjEtNzkzY2MxOWNlZmM0O3JlZ2lvbj1lYXN0dXM=') + .query(true) + .reply(200, ["1f8b0800000000000400edbd07601c499625262f6dca7b7f4af54ad7e074a10880601324d8904010ecc188cde692ec1d69472329ab2a81ca6556655d661640cced9dbcf7de7befbdf7de7befbdf7ba3b9d4e27f7dfff3f5c6664016cf6ce4adac99e2180aac81f3f7e7c1f3f227ef1474d9bb5ebe6a3471fbd5a2f97c5f2e2a3","5ff2ff0089ccbd4914000000"], [ + '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', + 'Server', + 'Microsoft-HTTPAPI/2.0', + 'x-ms-ratelimit-remaining-subscription-reads', + '11942', + 'x-ms-request-id', + '2545db46-8aa1-4bae-ba96-3ee428e03e3d', + 'x-ms-correlation-request-id', + '2545db46-8aa1-4bae-ba96-3ee428e03e3d', + 'x-ms-routing-request-id', + 'JAPANEAST:20211217T064432Z:2545db46-8aa1-4bae-ba96-3ee428e03e3d', + 'Strict-Transport-Security', + 'max-age=31536000; includeSubDomains', + 'X-Content-Type-Options', + 'nosniff', + 'Date', + 'Fri, 17 Dec 2021 06:44:31 GMT' +]); + +nock('https://management.azure.com:443', {"encodedQueryParams":true}) + .get('/subscriptions/azure_subscription_id/providers/Microsoft.Devices/locations/eastus/operationResults/aWQ9b3NfaWhfNmQ0ZjY4NzItMzQwZC00NmZiLWIyZjEtNzkzY2MxOWNlZmM0O3JlZ2lvbj1lYXN0dXM=') + .query(true) + .reply(200, ["1f8b0800000000000400edbd07601c499625262f6dca7b7f4af54ad7e074a10880601324d8904010ecc188cde692ec1d69472329ab2a81ca6556655d661640cced9dbcf7de7befbdf7de7befbdf7ba3b9d4e27f7dfff3f5c6664016cf6ce4adac99e2180aac81f3f7e7c1f3f227ef1474d9bb5ebe6a3471fbd5a2f97c5f2e2a3","5ff2ff0089ccbd4914000000"], [ + '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', + 'Server', + 'Microsoft-HTTPAPI/2.0', + 'x-ms-ratelimit-remaining-subscription-reads', + '11941', + 'x-ms-request-id', + '5561d8b2-b2d7-4bf7-83ce-e76da991e507', + 'x-ms-correlation-request-id', + '5561d8b2-b2d7-4bf7-83ce-e76da991e507', + 'x-ms-routing-request-id', + 'JAPANEAST:20211217T064434Z:5561d8b2-b2d7-4bf7-83ce-e76da991e507', + 'Strict-Transport-Security', + 'max-age=31536000; includeSubDomains', + 'X-Content-Type-Options', + 'nosniff', + 'Date', + 'Fri, 17 Dec 2021 06:44:34 GMT' +]); + +nock('https://management.azure.com:443', {"encodedQueryParams":true}) + .get('/subscriptions/azure_subscription_id/providers/Microsoft.Devices/locations/eastus/operationResults/aWQ9b3NfaWhfNmQ0ZjY4NzItMzQwZC00NmZiLWIyZjEtNzkzY2MxOWNlZmM0O3JlZ2lvbj1lYXN0dXM=') + .query(true) + .reply(200, ["1f8b0800000000000400edbd07601c499625262f6dca7b7f4af54ad7e074a10880601324d8904010ecc188cde692ec1d69472329ab2a81ca6556655d661640cced9dbcf7de7befbdf7de7befbdf7ba3b9d4e27f7dfff3f5c6664016cf6ce4adac99e2180aac81f3f7e7c1f3f227ef1474d9bb5ebe6a3471fbd5e4fa7793ecb671ffd","92ff0720887be416000000"], [ + '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', + 'Server', + 'Microsoft-HTTPAPI/2.0', + 'x-ms-ratelimit-remaining-subscription-reads', + '11940', + 'x-ms-request-id', + '1cd9acdf-3385-41d4-9e1e-9d2762a26cbd', + 'x-ms-correlation-request-id', + '1cd9acdf-3385-41d4-9e1e-9d2762a26cbd', + 'x-ms-routing-request-id', + 'JAPANEAST:20211217T064436Z:1cd9acdf-3385-41d4-9e1e-9d2762a26cbd', + 'Strict-Transport-Security', + 'max-age=31536000; includeSubDomains', + 'X-Content-Type-Options', + 'nosniff', + 'Date', + 'Fri, 17 Dec 2021 06:44:36 GMT' +]); + +nock('https://management.azure.com:443', {"encodedQueryParams":true}) + .get('/subscriptions/azure_subscription_id/resourceGroups/myjstest/providers/Microsoft.Devices/IotHubs') + .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', + 'Server', + 'Microsoft-HTTPAPI/2.0', + 'x-ms-ratelimit-remaining-subscription-reads', + '11939', + 'x-ms-request-id', + 'c47eb2c0-656a-46cd-af85-c794c3cc8b4b', + 'x-ms-correlation-request-id', + 'c47eb2c0-656a-46cd-af85-c794c3cc8b4b', + 'x-ms-routing-request-id', + 'JAPANEAST:20211217T064437Z:c47eb2c0-656a-46cd-af85-c794c3cc8b4b', + 'Strict-Transport-Security', + 'max-age=31536000; includeSubDomains', + 'X-Content-Type-Options', + 'nosniff', + 'Date', + 'Fri, 17 Dec 2021 06:44:36 GMT' +]); diff --git a/sdk/iothub/arm-iothub/recordings/node/iothub_test/recording_iothubresource_get_test.js b/sdk/iothub/arm-iothub/recordings/node/iothub_test/recording_iothubresource_get_test.js new file mode 100644 index 000000000000..f03827ac6108 --- /dev/null +++ b/sdk/iothub/arm-iothub/recordings/node/iothub_test/recording_iothubresource_get_test.js @@ -0,0 +1,147 @@ +let nock = require('nock'); + +module.exports.hash = "37a08100ed6592cd54bb718b89d4b663"; + +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', + '414eea9f-1cc9-485f-a776-546cf12b0f00', + 'x-ms-ests-server', + '2.1.12261.15 - KRSLR1 ProdSlices', + 'Set-Cookie', + 'fpc=AlKTlj9cLt5GvLZIDJ9nA1w; expires=Sun, 16-Jan-2022 06:44:25 GMT; path=/; secure; HttpOnly; SameSite=None', + 'Set-Cookie', + 'esctx=AQABAAAAAAD--DLA3VO7QrddgJg7WevrIchzCH9lE4rscGfuSlPJzA5wZc_KCaSSg4SCygNw4zRyjP9UYZGfWyB20qTLbv5HRlLCBsMDTQQnMRSRh7jSkhf9UU4B4bR8qHCjFxjcF1K4cP7HHeeAOFS-ylh7UqljrYObYb3RwSjZQfGxN_bDOGL5IGpq8O6RUSrB8KliRcUgAA; 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, 17 Dec 2021 06:44: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', + '4150cca7-f51d-4a39-827d-43dba6c10f00', + 'x-ms-ests-server', + '2.1.12261.15 - KRSLR1 ProdSlices', + 'Set-Cookie', + 'fpc=AlfcWs6EvTZHvcfNh5p2ugc; expires=Sun, 16-Jan-2022 06:44:25 GMT; path=/; secure; HttpOnly; SameSite=None', + 'Set-Cookie', + 'esctx=AQABAAAAAAD--DLA3VO7QrddgJg7WevrlZoL-FHEvfEaCDDjln3rfhCtUe99ZIPh_nlJUSxh9g0CQos0JgVGgGkwxLqxy3_yq8370Rn980Gyj66UuEnATIn9R2RMp_mHXPognSFYSxrmeZ7kIPaWnnP2NBbLnTGTazxu7CyfZ7C9QojAP2sBh5f8hy2HC3Fo-PF63aQcdCIgAA; 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, 17 Dec 2021 06:44: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.4.0&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=ebd2f7e0-886b-4ea9-ad76-ca8cff21cf95&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', + '4150cca7-f51d-4a39-827d-43dba8c10f00', + 'x-ms-ests-server', + '2.1.12261.15 - KRSLR1 ProdSlices', + 'x-ms-clitelem', + '1,0,0,,', + 'Set-Cookie', + 'fpc=AmE3cB26FkJPlLYM13IhlTzLj78gAQAAAMgoTtkOAAAA; expires=Sun, 16-Jan-2022 06:44: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, 17 Dec 2021 06:44:24 GMT', + 'Content-Length', + '1393' +]); + +nock('https://management.azure.com:443', {"encodedQueryParams":true}) + .get('/subscriptions/azure_subscription_id/resourceGroups/myjstest/providers/Microsoft.Devices/IotHubs/myiothubxxxxyyyjjrr') + .query(true) + .reply(200, ["1f8b0800000000000400edbd07601c499625262f6dca7b7f4af54ad7e074a10880601324d8904010ecc188cde692ec1d69472329ab2a81ca6556655d661640cced9dbcf7de7befbdf7de7befbdf7ba3b9d4e27f7dfff3f5c6664016cf6ce4adac99e2180aac81f3f7e7c1f3f227ef147c5eca3471fdd6dd693665a17abb6a896cddd877be70fefcf0eceb7ef4d3f7db0bdbfbbb7bffd7077fa60fb607abef3603a9b9cefedefdeadf3a65ad7d3fcf3ba5aaf9abb8beb9f6edabc69efaeeaeab298e57573f78b625a574d75de8e9fe697c5346fee9e55edb7a9276a5c54ed7c3d7947cff5f5f54fff745d7f34fa68992d724226fe657bbdc2978330a949594d330c809ae559d3aef1599b5d341f3dfac51fbdcdafe9e3cbac5ce7bb1ffd92d147fe809904b71933c133a3bec0a8e935336cfa2aa7bee893637a9e3efb7471f5faec33fa94c8b1caebb6c8190d8322fdf13df717bd754a08a75fbda617eaaac4405775b1c8ea6bc23568f75dea2b68d7e4d36a39e396dfa761b5598b4f8fa76d7199532beafeb268e8dd6279f15abf7cbd9e4ef37c96cfe8fb62f5ac28dbbc7eb52e81212175ce7fbfc8782e6afa18c3ce081ef77f4cafae30da62f545d6bca54f76efed8e77771f8c77ef3f1cdfbfc7582cf3f6aaaadf02e6ebbc25b0bff8a3597e9eadcb1678319ca7f9f29aa064ab5579fda67ab2a64ecf96a797f9129379ba9cadaa62d97ef4a8add739fa02288273337a65595dd107c3d8d1dccfaba65500115e1b673f58d7f9f64cd86b4c632178790733c2e517cb87fc5b9db7f42ba1f0a658e467cba7d9357dbc4bd4cf68e6f1f949b5c670f6bc8fce66d4e67b1fed10f4dd8f8868abac9dc731a216b9f64b0d9ac9a3bb77a5cdf6b2d976edb7773fddbfb777ffdedef6c18387f974b2bf933f1837798d714cd6cdf8aa58ceaa2b1ed1dd8f7e09d18158b825b6c0000c7c42e9177fa4ef3c59373fb1ced74c77c2cf7dfaa65a1553fd94694084d13f9bb6aab38bfca45ab659b12425808fb52b03e83c2bcb49367dfb0a9fa13f95fbdfcd7c41e31521a30f45cabfc89b86c042a0c1ed4c3ffa12dc411f19e431a7e843906a40d4a2395d66939258fd11416f720c5b710ca6f27753fec4ef4dd6bc69cbe3e6aca90e3eddd9a57e5ebed9fd36f5435d2f73e6b4d76dcd84fb483e95b1a27b7c843e08114298da04bd10efe62faab6382f449ef94312eeb74fd7357fd0e9f40b02df46515964ef9ee62589787dadacb5bb837e731e2d8974fed5aaacb259a737a601a15c56ebd99b4a680b1c62e0464666e3c438270dc29345af7fa34338cfb3960490b0fde845b5c4fc2e8ae59bb2f949e226824f1fef8ef7e8536296ea2a9f3dfb45b3e5f3821430f116bdddbc5d032365a9d7500e6d91d7f8bdcda027a1f4a6d92a9b162d59845d7a858c15c92efefac5c6ca70c7bfe497","fc3f03e74d631e070000"], [ + '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', + 'Server', + 'Microsoft-HTTPAPI/2.0', + 'x-ms-ratelimit-remaining-subscription-reads', + '11944', + 'x-ms-request-id', + '1212fa4b-8fc4-4688-af60-d15721e5adf8', + 'x-ms-correlation-request-id', + '1212fa4b-8fc4-4688-af60-d15721e5adf8', + 'x-ms-routing-request-id', + 'JAPANEAST:20211217T064426Z:1212fa4b-8fc4-4688-af60-d15721e5adf8', + 'Strict-Transport-Security', + 'max-age=31536000; includeSubDomains', + 'X-Content-Type-Options', + 'nosniff', + 'Date', + 'Fri, 17 Dec 2021 06:44:25 GMT' +]); diff --git a/sdk/iothub/arm-iothub/recordings/node/iothub_test/recording_iothubresource_list_test.js b/sdk/iothub/arm-iothub/recordings/node/iothub_test/recording_iothubresource_list_test.js new file mode 100644 index 000000000000..d419adb73fb0 --- /dev/null +++ b/sdk/iothub/arm-iothub/recordings/node/iothub_test/recording_iothubresource_list_test.js @@ -0,0 +1,147 @@ +let nock = require('nock'); + +module.exports.hash = "8e5894c76622a8c97acb6ec3ef36fa63"; + +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', + 'd3033c4a-b30b-4222-a25d-93df17770a00', + 'x-ms-ests-server', + '2.1.12261.15 - KRSLR2 ProdSlices', + 'Set-Cookie', + 'fpc=AvH9zNoTYwVDuuzp65Q4DVQ; expires=Sun, 16-Jan-2022 06:44:26 GMT; path=/; secure; HttpOnly; SameSite=None', + 'Set-Cookie', + 'esctx=AQABAAAAAAD--DLA3VO7QrddgJg7WevrT3FAngV0gtvl9AjjxaQuL4NLp3b6nrSxoy1M30Ft0TayMnu7uwrHGm5GgeRdReQr6l-qKBt7_6CKciaI2pVqHCriPRo8Wqh-iUuIeVqnZL0FVhn6X2ce_SP8kTFB0tBHJjDCkOtqwGx5gOW3HVCjXAOyCk8ZYPNDFhuxIzjqoe8gAA; 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, 17 Dec 2021 06:44:25 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', + 'd0c9695e-6cfc-4eda-9b3f-58d3aa110b00', + 'x-ms-ests-server', + '2.1.12261.15 - KRSLR2 ProdSlices', + 'Set-Cookie', + 'fpc=AhrD-SeJQg9Gt0Vs0otVLNA; expires=Sun, 16-Jan-2022 06:44:26 GMT; path=/; secure; HttpOnly; SameSite=None', + 'Set-Cookie', + 'esctx=AQABAAAAAAD--DLA3VO7QrddgJg7WevrpUxLoai2PuEL8g4AzCvuk3aOEw1tBXqAgb2-o8_sHVloyBGIFBkjCSUnWozD4nSDlGBklkOYTZf9NkckErpUhzxDBVbMvd8l5PI1UfPvKXqaxa3LKTraNSpdJfwDos3myHj0fdThK4VMvCWdjSwRFBRTSM23bm4RI1DBl6YlTZggAA; 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, 17 Dec 2021 06:44:25 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.4.0&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=238344f3-70ff-4663-ad11-1518a32db617&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', + 'e9fffaaa-ac72-407c-a105-da26e06b0a00', + 'x-ms-ests-server', + '2.1.12261.15 - SEASLR1 ProdSlices', + 'x-ms-clitelem', + '1,0,0,,', + 'Set-Cookie', + 'fpc=AtAYvBVDGBBGimqN2jSNgAbLj78gAQAAAMooTtkOAAAA; expires=Sun, 16-Jan-2022 06:44:26 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, 17 Dec 2021 06:44:25 GMT', + 'Content-Length', + '1393' +]); + +nock('https://management.azure.com:443', {"encodedQueryParams":true}) + .get('/subscriptions/azure_subscription_id/resourceGroups/myjstest/providers/Microsoft.Devices/IotHubs') + .query(true) + .reply(200, ["1f8b0800000000000400edbd07601c499625262f6dca7b7f4af54ad7e074a10880601324d8904010ecc188cde692ec1d69472329ab2a81ca6556655d661640cced9dbcf7de7befbdf7de7befbdf7ba3b9d4e27f7dfff3f5c6664016cf6ce4adac99e2180aac81f3f7e7c1f3f227ef1479759b9ce3f7af4bd5ffc5131fbe8d147779bf5a499d6c5aa2daa6573f7e1def9c3fbb383f3ed7bd34f1f6cefefeeed6f3fdc9d3ed83e989eef3c98ce26e77bfbbb77ebbca9d6f534ffbcaed6abe6eee2faa79b366fdabbabbaba2c6679dddcfda298d655539db7e3a7f96531cd9bbb6755fb6dea891a17553b5f4fded1737d7dfdd33f5dd71f8d3e5a660bc2e9a3f897edf50a5f0ec2a4266535cd30006a96674dbbc6676d76d17cf4e8177ff436bfa68f79d8bb1ffd92d147fe809904b71933c133a3bec0a8e935336cfa2aa7bee893637a9e3efb7471f5faec33fa94c8b1caebb6c8190d8322fd41b4377fd15ba78470fad56b7aa1ae4a0c7455178bacbe265c8376dfa5be82764d3ead96336ef97d1a569bb5f8f478da169739b5a2ee2f8b86de2d9617aff5cbd7ebe934cf67f98cbe2f56cf8ab2cdeb57eb12181252e7fcf78b8ce7a2a68f31ec8ce071ffc7f4ea0aa32d565f64cd5bfa64f7deee7877f7c178f7fec3f1fd7b8cc5326fafaafa2d60bece5b02fb8b3f9ae5e7d9ba6c8117c3799a2faf094ab65a95d76faa276beaf46c797a992f3199a7cbd9aa2a96ed478fda7a9da32f80223837a35796d5157d308c1dcdfdbc6a5a0510e1b571f683759d6fcf84bdc6341682977730235c7eb17cc8bfd5794bbf120a6f8a457eb67c9a5dd3c7bb44fd8c661e9f9f546b0c67cffbe86c466dbef7d10e41dffd8888b6cada791c236a916bbfd4a0993cba7b57da6c2f9b6dd77e7bf7d3fd7b7bf7efed6d1f3c78984f27fb3bf9837193d718c764dd8caf8ae5acbae211ddfde897101d88855b620b0cc0c027947ef147face9375f313eb7ccd7427fcdca76faa5531d54f99064418fdb369ab3abbc84faa659b154b5202f858bb3280ceb3b29c64d3b7aff019fa53b9ffddcc17345e1132fa50a4fc8bbc69082c041adccef4a32fc11df491411e738a3e04a906442d9ad365362989d51f11f426c7b015c7602a7f37e54ffcde64cd9bb63c6ece9aeae0d39d5deae7e59bdd6f533fd4f532674e7bddd64cb88fe453192bbac747e883102184a94dd00bf16efea26a8bf342e4993f24e17efb745df3079d4ebf20f06d149545f6ee695e9288d7d7ca5abb3be837e7d19248e75fadca2a9b757a631a10ca65b59ebda984b6c021066e6464364e8c73d2203c59f4fa373a84f33c6b490009db8f5e544bccefa258be299b9f246e22f8f4f1ee788f3e2566a9aef2d9b35f345b3e2f4801136fd1dbcddb353052967a0de5d016798ddfdb0c7a124a6f9aadb269d19245d8a557c85891ece2af5f6cac0c77fc4b7ec9f77f","c9ff03fba1aa0d2a070000"], [ + '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', + 'Server', + 'Microsoft-HTTPAPI/2.0', + 'x-ms-ratelimit-remaining-subscription-reads', + '11943', + 'x-ms-request-id', + '9107796e-1f6f-40a1-8394-f5f7ff1e74cb', + 'x-ms-correlation-request-id', + '9107796e-1f6f-40a1-8394-f5f7ff1e74cb', + 'x-ms-routing-request-id', + 'JAPANEAST:20211217T064426Z:9107796e-1f6f-40a1-8394-f5f7ff1e74cb', + 'Strict-Transport-Security', + 'max-age=31536000; includeSubDomains', + 'X-Content-Type-Options', + 'nosniff', + 'Date', + 'Fri, 17 Dec 2021 06:44:26 GMT' +]); diff --git a/sdk/iothub/arm-iothub/recordings/node/iothub_test/recording_iothubresource_update_test.js b/sdk/iothub/arm-iothub/recordings/node/iothub_test/recording_iothubresource_update_test.js new file mode 100644 index 000000000000..d3b811acbbbb --- /dev/null +++ b/sdk/iothub/arm-iothub/recordings/node/iothub_test/recording_iothubresource_update_test.js @@ -0,0 +1,147 @@ +let nock = require('nock'); + +module.exports.hash = "e3cd214a3cbe23dd7ad2cb121caa5d1a"; + +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', + '4150cca7-f51d-4a39-827d-43dbafc10f00', + 'x-ms-ests-server', + '2.1.12261.15 - KRSLR1 ProdSlices', + 'Set-Cookie', + 'fpc=AsqrYJbCBPNGuofLlZaFOLg; expires=Sun, 16-Jan-2022 06:44:27 GMT; path=/; secure; HttpOnly; SameSite=None', + 'Set-Cookie', + 'esctx=AQABAAAAAAD--DLA3VO7QrddgJg7Wevr79VTas2biSySqB-BVP5p3cmM4P_w2iMLIIWCrKWYtDMBOzFnIf0Qfs6XTPvjr8dKukI3qORLoPnjeeoDkuHMBqIBOKtLM5um1zKDQVx4Gj3aZhJBMU3e3q20jn_TZprfPTsalua6gn62RiFm4EU1zRm0oaetEtWIfXBsocfZbYggAA; 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, 17 Dec 2021 06:44:26 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', + '653645f0-3ec7-4ea4-98be-8ae41f150b00', + 'x-ms-ests-server', + '2.1.12261.15 - KRSLR2 ProdSlices', + 'Set-Cookie', + 'fpc=Asi3yICY47FFgiKHmVy_Dmo; expires=Sun, 16-Jan-2022 06:44:27 GMT; path=/; secure; HttpOnly; SameSite=None', + 'Set-Cookie', + 'esctx=AQABAAAAAAD--DLA3VO7QrddgJg7Wevrhf6rAU7u8aeLCh2MYNFDHyIJvd9XiZQKP5Zedj9fBeZyQG-a-GVQFa0VgHtbi6IHvh5e7n2JfazXVaQNWORWclXe7R1PU7LiWOQKIvVazqaSEUgV4_NtxkHLbQ4401A0qkXKUF1p8R2XKuyW6XEwMh9T0OfLj0-Ubvo-usMEAMMgAA; 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, 17 Dec 2021 06:44:26 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.4.0&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=3f3f1031-f0d8-44ce-a07e-214989462ef3&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', + 'd3033c4a-b30b-4222-a25d-93df20770a00', + 'x-ms-ests-server', + '2.1.12261.15 - KRSLR2 ProdSlices', + 'x-ms-clitelem', + '1,0,0,,', + 'Set-Cookie', + 'fpc=AkNvo0gZSkBAlVptCrkrVazLj78gAQAAAMooTtkOAAAA; expires=Sun, 16-Jan-2022 06:44:27 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, 17 Dec 2021 06:44:26 GMT', + 'Content-Length', + '1393' +]); + +nock('https://management.azure.com:443', {"encodedQueryParams":true}) + .patch('/subscriptions/azure_subscription_id/resourceGroups/myjstest/providers/Microsoft.Devices/IotHubs/myiothubxxxxyyyjjrr', {"tags":{"tag1":"value1"}}) + .query(true) + .reply(200, ["1f8b0800000000000400edbd07601c499625262f6dca7b7f4af54ad7e074a10880601324d8904010ecc188cde692ec1d69472329ab2a81ca6556655d661640cced9dbcf7de7befbdf7de7befbdf7ba3b9d4e27f7dfff3f5c6664016cf6ce4adac99e2180aac81f3f7e7c1f3f227ef147c5eca3471fdd6dd693665a17abb6a896cddd877be70fefcf0eceb7ef4d3f7db0bdbfbbb7bffd7077fa60fb607abef3603a9b9cefedefdeadf3a65ad7d3fcf3ba5aaf9abb8beb9f6edabc69efaeeaeab298e57573f78b625a574d75de8e9fe697c5346fee9e55edb7a9276a5c54ed7c3d7947cff5f5f54fff745d7f34fa68992d724226fe657bbdc2978330a949594d330c809ae559d3aef1599b5d341f3dfac5f8b94b9f5f66e53adffde8978c3ef247cc34b8cda009a019f605864daf9971d3573975429fd06f4483555eb745ce7d1bbce88fefb9bfa8e52961997ef59a5ea8ab12a35bd5c522abaf09bfa0dd77097ed0aec9a7d572c62dbf4f4369b3169f1e4fdbe232a756d4fd65d1d0bbc5f2e2b57ef97a3d9de6f92c9fd1f7c5ea5951b679fd6a5d024342ea9cff7e91f104d4f431869a113ceeff985e5d6184c5ea8bac794b9fecdedb1defee3e18efde7f38be7f8fb158e6ed5555bf05ccd7794b607ff147b3fc3c5b972df062384ff3e53541c956abf2fa4df5644d9d9e2d4f2ff32566f074395b55c5b2fde8515baf73f4055004e766f4cab2baa20f86b1a3f99e574dab00220c36ce7eb0aef3ed99f0d498c642f0f20e6684cb2f960ff9b73a6fe95742e14db1c8cf964fb36bfa7897a89fd1cce3f3936a8de1ec791f9dcda8cdf73eda21e8bb1f11d156593b8f63442d72ed971a34934777ef4a9bed65b3edda6fef7eba7f6feffebdbded83070ff3e9647f277f306ef21ae398ac9bf155b19c55573ca2bb1ffd12a203b16d4b6c810118f884d22ffe48df79b26e7e629daf99ee849ffbf44db52aa6fa29d38008a37f366d556717f949b56cb36249928f8fb52b03e83c2bcb49367dfb0a9fa13f15f6dfcd7c41e315c1a20f45b4bfc89b86c0428ac1ed4c3ffa12dc411f19e431a7e843906a40d4a2395d66939258fd11416f720c5b710ca6f27753fec4ef4dd6bc69cbe3e6aca90e3edd81aa78f966f7dbd40f75bdcc99d35eb735130e024e9fca58d13d3e421f8408214c6d825e8877f317555b9c1722cffc2109f7dba7eb9a3fe874fa05816fa3a82cb2774ff39244bcbe56d6dadd41bf398f96443aff6a5556d9acd31bd380502eabf5ec4d25b4050e31702323b371629c9306e1c9a2d7bfd1219ce7594b0248d87ef4a25a627e17c5f24dd9fc247113c1a78f77c77bf429314b7595cf9efda2d9f279414a97788bde6edeae8191b2d46b2887b6c86bfcde66d093507ad36c954d8bf69abaa457c84291ece22fb20d625ab8e35ff2","4bfe1f97e5720713070000"], [ + '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', + 'Server', + 'Microsoft-HTTPAPI/2.0', + 'x-ms-ratelimit-remaining-subscription-resource-requests', + '4998', + 'x-ms-request-id', + '3f766c8b-3cbc-475e-9d39-036311c76ada', + 'x-ms-correlation-request-id', + '3f766c8b-3cbc-475e-9d39-036311c76ada', + 'x-ms-routing-request-id', + 'JAPANEAST:20211217T064430Z:3f766c8b-3cbc-475e-9d39-036311c76ada', + 'Strict-Transport-Security', + 'max-age=31536000; includeSubDomains', + 'X-Content-Type-Options', + 'nosniff', + 'Date', + 'Fri, 17 Dec 2021 06:44:30 GMT' +]); diff --git a/sdk/iothub/arm-iothub/review/arm-iothub.api.md b/sdk/iothub/arm-iothub/review/arm-iothub.api.md new file mode 100644 index 000000000000..94a542ae6415 --- /dev/null +++ b/sdk/iothub/arm-iothub/review/arm-iothub.api.md @@ -0,0 +1,1318 @@ +## API Report File for "@azure/arm-iothub" + +> 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 type AccessRights = "RegistryRead" | "RegistryWrite" | "ServiceConnect" | "DeviceConnect" | "RegistryRead, RegistryWrite" | "RegistryRead, ServiceConnect" | "RegistryRead, DeviceConnect" | "RegistryWrite, ServiceConnect" | "RegistryWrite, DeviceConnect" | "ServiceConnect, DeviceConnect" | "RegistryRead, RegistryWrite, ServiceConnect" | "RegistryRead, RegistryWrite, DeviceConnect" | "RegistryRead, ServiceConnect, DeviceConnect" | "RegistryWrite, ServiceConnect, DeviceConnect" | "RegistryRead, RegistryWrite, ServiceConnect, DeviceConnect"; + +// @public (undocumented) +export interface ArmIdentity { + readonly principalId?: string; + readonly tenantId?: string; + type?: ResourceIdentityType; + userAssignedIdentities?: { + [propertyName: string]: ArmUserIdentity; + }; +} + +// @public (undocumented) +export interface ArmUserIdentity { + readonly clientId?: string; + readonly principalId?: string; +} + +// @public +export type AuthenticationType = string; + +// @public +export type Capabilities = string; + +// @public +export interface CertificateBodyDescription { + certificate?: string; + isVerified?: boolean; +} + +// @public +export interface CertificateDescription { + readonly etag?: string; + readonly id?: string; + readonly name?: string; + properties?: CertificateProperties; + readonly type?: string; +} + +// @public +export interface CertificateListDescription { + value?: CertificateDescription[]; +} + +// @public +export interface CertificateProperties { + certificate?: string; + readonly created?: Date; + readonly expiry?: Date; + isVerified?: boolean; + readonly subject?: string; + readonly thumbprint?: string; + readonly updated?: Date; +} + +// @public +export interface CertificatePropertiesWithNonce { + readonly certificate?: string; + readonly created?: Date; + readonly expiry?: Date; + readonly isVerified?: boolean; + readonly subject?: string; + readonly thumbprint?: string; + readonly updated?: Date; + readonly verificationCode?: string; +} + +// @public +export interface Certificates { + createOrUpdate(resourceGroupName: string, resourceName: string, certificateName: string, certificateDescription: CertificateDescription, options?: CertificatesCreateOrUpdateOptionalParams): Promise; + delete(resourceGroupName: string, resourceName: string, certificateName: string, ifMatch: string, options?: CertificatesDeleteOptionalParams): Promise; + generateVerificationCode(resourceGroupName: string, resourceName: string, certificateName: string, ifMatch: string, options?: CertificatesGenerateVerificationCodeOptionalParams): Promise; + get(resourceGroupName: string, resourceName: string, certificateName: string, options?: CertificatesGetOptionalParams): Promise; + listByIotHub(resourceGroupName: string, resourceName: string, options?: CertificatesListByIotHubOptionalParams): Promise; + verify(resourceGroupName: string, resourceName: string, certificateName: string, ifMatch: string, certificateVerificationBody: CertificateVerificationDescription, options?: CertificatesVerifyOptionalParams): Promise; +} + +// @public +export interface CertificatesCreateOrUpdateOptionalParams extends coreClient.OperationOptions { + ifMatch?: string; +} + +// @public +export type CertificatesCreateOrUpdateResponse = CertificateDescription; + +// @public +export interface CertificatesDeleteOptionalParams extends coreClient.OperationOptions { +} + +// @public +export interface CertificatesGenerateVerificationCodeOptionalParams extends coreClient.OperationOptions { +} + +// @public +export type CertificatesGenerateVerificationCodeResponse = CertificateWithNonceDescription; + +// @public +export interface CertificatesGetOptionalParams extends coreClient.OperationOptions { +} + +// @public +export type CertificatesGetResponse = CertificateDescription; + +// @public +export interface CertificatesListByIotHubOptionalParams extends coreClient.OperationOptions { +} + +// @public +export type CertificatesListByIotHubResponse = CertificateListDescription; + +// @public +export interface CertificatesVerifyOptionalParams extends coreClient.OperationOptions { +} + +// @public +export type CertificatesVerifyResponse = CertificateDescription; + +// @public +export interface CertificateVerificationDescription { + certificate?: string; +} + +// @public +export interface CertificateWithNonceDescription { + readonly etag?: string; + readonly id?: string; + readonly name?: string; + properties?: CertificatePropertiesWithNonce; + readonly type?: string; +} + +// @public +export interface CloudToDeviceProperties { + defaultTtlAsIso8601?: string; + feedback?: FeedbackProperties; + maxDeliveryCount?: number; +} + +// @public +export type DefaultAction = string; + +// @public +export interface EndpointHealthData { + endpointId?: string; + healthStatus?: EndpointHealthStatus; + lastKnownError?: string; + lastKnownErrorTime?: Date; + lastSendAttemptTime?: Date; + lastSuccessfulSendAttemptTime?: Date; +} + +// @public +export interface EndpointHealthDataListResult { + readonly nextLink?: string; + value?: EndpointHealthData[]; +} + +// @public +export type EndpointHealthStatus = string; + +// @public +export interface EnrichmentProperties { + endpointNames: string[]; + key: string; + value: string; +} + +// @public +export interface ErrorDetails { + readonly code?: string; + readonly details?: string; + readonly httpStatusCode?: string; + readonly message?: string; +} + +// @public +export interface EventHubConsumerGroupBodyDescription { + properties: EventHubConsumerGroupName; +} + +// @public +export interface EventHubConsumerGroupInfo { + readonly etag?: string; + readonly id?: string; + readonly name?: string; + properties?: { + [propertyName: string]: any; + }; + readonly type?: string; +} + +// @public +export interface EventHubConsumerGroupName { + name: string; +} + +// @public +export interface EventHubConsumerGroupsListResult { + readonly nextLink?: string; + value?: EventHubConsumerGroupInfo[]; +} + +// @public +export interface EventHubProperties { + readonly endpoint?: string; + partitionCount?: number; + readonly partitionIds?: string[]; + readonly path?: string; + retentionTimeInDays?: number; +} + +// @public +export interface ExportDevicesRequest { + authenticationType?: AuthenticationType; + configurationsBlobName?: string; + excludeKeys: boolean; + exportBlobContainerUri: string; + exportBlobName?: string; + identity?: ManagedIdentity; + includeConfigurations?: boolean; +} + +// @public +export interface FailoverInput { + failoverRegion: string; +} + +// @public +export interface FallbackRouteProperties { + condition?: string; + endpointNames: string[]; + isEnabled: boolean; + name?: string; + source: RoutingSource; +} + +// @public +export interface FeedbackProperties { + lockDurationAsIso8601?: string; + maxDeliveryCount?: number; + ttlAsIso8601?: string; +} + +// @public +export interface GroupIdInformation { + readonly id?: string; + readonly name?: string; + properties: GroupIdInformationProperties; + readonly type?: string; +} + +// @public +export interface GroupIdInformationProperties { + groupId?: string; + requiredMembers?: string[]; + requiredZoneNames?: string[]; +} + +// @public +export interface ImportDevicesRequest { + authenticationType?: AuthenticationType; + configurationsBlobName?: string; + identity?: ManagedIdentity; + includeConfigurations?: boolean; + inputBlobContainerUri: string; + inputBlobName?: string; + outputBlobContainerUri: string; + outputBlobName?: string; +} + +// @public +export interface IotHub { + beginManualFailover(iotHubName: string, resourceGroupName: string, failoverInput: FailoverInput, options?: IotHubManualFailoverOptionalParams): Promise, void>>; + beginManualFailoverAndWait(iotHubName: string, resourceGroupName: string, failoverInput: FailoverInput, options?: IotHubManualFailoverOptionalParams): Promise; +} + +// @public +export interface IotHubCapacity { + readonly default?: number; + readonly maximum?: number; + readonly minimum?: number; + readonly scaleType?: IotHubScaleType; +} + +// @public (undocumented) +export class IotHubClient extends coreClient.ServiceClient { + // (undocumented) + $host: string; + constructor(credentials: coreAuth.TokenCredential, subscriptionId: string, options?: IotHubClientOptionalParams); + // (undocumented) + apiVersion: string; + // (undocumented) + certificates: Certificates; + // (undocumented) + iotHub: IotHub; + // (undocumented) + iotHubResource: IotHubResource; + // (undocumented) + operations: Operations; + // (undocumented) + privateEndpointConnections: PrivateEndpointConnections; + // (undocumented) + privateLinkResourcesOperations: PrivateLinkResourcesOperations; + // (undocumented) + resourceProviderCommon: ResourceProviderCommon; + // (undocumented) + subscriptionId: string; +} + +// @public +export interface IotHubClientOptionalParams extends coreClient.ServiceClientOptions { + $host?: string; + apiVersion?: string; + endpoint?: string; +} + +// @public +export type IotHubDescription = Resource & { + etag?: string; + properties?: IotHubProperties; + sku: IotHubSkuInfo; + identity?: ArmIdentity; +}; + +// @public +export interface IotHubDescriptionListResult { + readonly nextLink?: string; + value?: IotHubDescription[]; +} + +// @public +export interface IotHubLocationDescription { + location?: string; + role?: IotHubReplicaRoleType; +} + +// @public +export interface IotHubManualFailoverOptionalParams extends coreClient.OperationOptions { + resumeFrom?: string; + updateIntervalInMs?: number; +} + +// @public +export interface IotHubNameAvailabilityInfo { + message?: string; + readonly nameAvailable?: boolean; + readonly reason?: IotHubNameUnavailabilityReason; +} + +// @public +export type IotHubNameUnavailabilityReason = "Invalid" | "AlreadyExists"; + +// @public +export interface IotHubProperties { + allowedFqdnList?: string[]; + authorizationPolicies?: SharedAccessSignatureAuthorizationRule[]; + cloudToDevice?: CloudToDeviceProperties; + comments?: string; + disableDeviceSAS?: boolean; + disableLocalAuth?: boolean; + disableModuleSAS?: boolean; + enableFileUploadNotifications?: boolean; + eventHubEndpoints?: { + [propertyName: string]: EventHubProperties; + }; + features?: Capabilities; + readonly hostName?: string; + ipFilterRules?: IpFilterRule[]; + readonly locations?: IotHubLocationDescription[]; + messagingEndpoints?: { + [propertyName: string]: MessagingEndpointProperties; + }; + minTlsVersion?: string; + networkRuleSets?: NetworkRuleSetProperties; + privateEndpointConnections?: PrivateEndpointConnection[]; + readonly provisioningState?: string; + publicNetworkAccess?: PublicNetworkAccess; + restrictOutboundNetworkAccess?: boolean; + routing?: RoutingProperties; + readonly state?: string; + storageEndpoints?: { + [propertyName: string]: StorageEndpointProperties; + }; +} + +// @public +export interface IotHubQuotaMetricInfo { + readonly currentValue?: number; + readonly maxValue?: number; + readonly name?: string; +} + +// @public +export interface IotHubQuotaMetricInfoListResult { + readonly nextLink?: string; + value?: IotHubQuotaMetricInfo[]; +} + +// @public +export type IotHubReplicaRoleType = string; + +// @public +export interface IotHubResource { + beginCreateOrUpdate(resourceGroupName: string, resourceName: string, iotHubDescription: IotHubDescription, options?: IotHubResourceCreateOrUpdateOptionalParams): Promise, IotHubResourceCreateOrUpdateResponse>>; + beginCreateOrUpdateAndWait(resourceGroupName: string, resourceName: string, iotHubDescription: IotHubDescription, options?: IotHubResourceCreateOrUpdateOptionalParams): Promise; + beginDelete(resourceGroupName: string, resourceName: string, options?: IotHubResourceDeleteOptionalParams): Promise, IotHubResourceDeleteResponse>>; + beginDeleteAndWait(resourceGroupName: string, resourceName: string, options?: IotHubResourceDeleteOptionalParams): Promise; + beginUpdate(resourceGroupName: string, resourceName: string, iotHubTags: TagsResource, options?: IotHubResourceUpdateOptionalParams): Promise, IotHubResourceUpdateResponse>>; + beginUpdateAndWait(resourceGroupName: string, resourceName: string, iotHubTags: TagsResource, options?: IotHubResourceUpdateOptionalParams): Promise; + checkNameAvailability(operationInputs: OperationInputs, options?: IotHubResourceCheckNameAvailabilityOptionalParams): Promise; + createEventHubConsumerGroup(resourceGroupName: string, resourceName: string, eventHubEndpointName: string, name: string, consumerGroupBody: EventHubConsumerGroupBodyDescription, options?: IotHubResourceCreateEventHubConsumerGroupOptionalParams): Promise; + deleteEventHubConsumerGroup(resourceGroupName: string, resourceName: string, eventHubEndpointName: string, name: string, options?: IotHubResourceDeleteEventHubConsumerGroupOptionalParams): Promise; + exportDevices(resourceGroupName: string, resourceName: string, exportDevicesParameters: ExportDevicesRequest, options?: IotHubResourceExportDevicesOptionalParams): Promise; + get(resourceGroupName: string, resourceName: string, options?: IotHubResourceGetOptionalParams): Promise; + getEventHubConsumerGroup(resourceGroupName: string, resourceName: string, eventHubEndpointName: string, name: string, options?: IotHubResourceGetEventHubConsumerGroupOptionalParams): Promise; + getJob(resourceGroupName: string, resourceName: string, jobId: string, options?: IotHubResourceGetJobOptionalParams): Promise; + getKeysForKeyName(resourceGroupName: string, resourceName: string, keyName: string, options?: IotHubResourceGetKeysForKeyNameOptionalParams): Promise; + getStats(resourceGroupName: string, resourceName: string, options?: IotHubResourceGetStatsOptionalParams): Promise; + importDevices(resourceGroupName: string, resourceName: string, importDevicesParameters: ImportDevicesRequest, options?: IotHubResourceImportDevicesOptionalParams): Promise; + listByResourceGroup(resourceGroupName: string, options?: IotHubResourceListByResourceGroupOptionalParams): PagedAsyncIterableIterator; + listBySubscription(options?: IotHubResourceListBySubscriptionOptionalParams): PagedAsyncIterableIterator; + listEndpointHealth(resourceGroupName: string, iotHubName: string, options?: IotHubResourceGetEndpointHealthOptionalParams): PagedAsyncIterableIterator; + listEventHubConsumerGroups(resourceGroupName: string, resourceName: string, eventHubEndpointName: string, options?: IotHubResourceListEventHubConsumerGroupsOptionalParams): PagedAsyncIterableIterator; + listJobs(resourceGroupName: string, resourceName: string, options?: IotHubResourceListJobsOptionalParams): PagedAsyncIterableIterator; + listKeys(resourceGroupName: string, resourceName: string, options?: IotHubResourceListKeysOptionalParams): PagedAsyncIterableIterator; + listQuotaMetrics(resourceGroupName: string, resourceName: string, options?: IotHubResourceGetQuotaMetricsOptionalParams): PagedAsyncIterableIterator; + listValidSkus(resourceGroupName: string, resourceName: string, options?: IotHubResourceGetValidSkusOptionalParams): PagedAsyncIterableIterator; + testAllRoutes(iotHubName: string, resourceGroupName: string, input: TestAllRoutesInput, options?: IotHubResourceTestAllRoutesOptionalParams): Promise; + testRoute(iotHubName: string, resourceGroupName: string, input: TestRouteInput, options?: IotHubResourceTestRouteOptionalParams): Promise; +} + +// @public +export interface IotHubResourceCheckNameAvailabilityOptionalParams extends coreClient.OperationOptions { +} + +// @public +export type IotHubResourceCheckNameAvailabilityResponse = IotHubNameAvailabilityInfo; + +// @public +export interface IotHubResourceCreateEventHubConsumerGroupOptionalParams extends coreClient.OperationOptions { +} + +// @public +export type IotHubResourceCreateEventHubConsumerGroupResponse = EventHubConsumerGroupInfo; + +// @public +export interface IotHubResourceCreateOrUpdateOptionalParams extends coreClient.OperationOptions { + ifMatch?: string; + resumeFrom?: string; + updateIntervalInMs?: number; +} + +// @public +export type IotHubResourceCreateOrUpdateResponse = IotHubDescription; + +// @public +export interface IotHubResourceDeleteEventHubConsumerGroupOptionalParams extends coreClient.OperationOptions { +} + +// @public +export interface IotHubResourceDeleteOptionalParams extends coreClient.OperationOptions { + resumeFrom?: string; + updateIntervalInMs?: number; +} + +// @public +export type IotHubResourceDeleteResponse = IotHubDescription; + +// @public +export interface IotHubResourceExportDevicesOptionalParams extends coreClient.OperationOptions { +} + +// @public +export type IotHubResourceExportDevicesResponse = JobResponse; + +// @public +export interface IotHubResourceGetEndpointHealthNextOptionalParams extends coreClient.OperationOptions { +} + +// @public +export type IotHubResourceGetEndpointHealthNextResponse = EndpointHealthDataListResult; + +// @public +export interface IotHubResourceGetEndpointHealthOptionalParams extends coreClient.OperationOptions { +} + +// @public +export type IotHubResourceGetEndpointHealthResponse = EndpointHealthDataListResult; + +// @public +export interface IotHubResourceGetEventHubConsumerGroupOptionalParams extends coreClient.OperationOptions { +} + +// @public +export type IotHubResourceGetEventHubConsumerGroupResponse = EventHubConsumerGroupInfo; + +// @public +export interface IotHubResourceGetJobOptionalParams extends coreClient.OperationOptions { +} + +// @public +export type IotHubResourceGetJobResponse = JobResponse; + +// @public +export interface IotHubResourceGetKeysForKeyNameOptionalParams extends coreClient.OperationOptions { +} + +// @public +export type IotHubResourceGetKeysForKeyNameResponse = SharedAccessSignatureAuthorizationRule; + +// @public +export interface IotHubResourceGetOptionalParams extends coreClient.OperationOptions { +} + +// @public +export interface IotHubResourceGetQuotaMetricsNextOptionalParams extends coreClient.OperationOptions { +} + +// @public +export type IotHubResourceGetQuotaMetricsNextResponse = IotHubQuotaMetricInfoListResult; + +// @public +export interface IotHubResourceGetQuotaMetricsOptionalParams extends coreClient.OperationOptions { +} + +// @public +export type IotHubResourceGetQuotaMetricsResponse = IotHubQuotaMetricInfoListResult; + +// @public +export type IotHubResourceGetResponse = IotHubDescription; + +// @public +export interface IotHubResourceGetStatsOptionalParams extends coreClient.OperationOptions { +} + +// @public +export type IotHubResourceGetStatsResponse = RegistryStatistics; + +// @public +export interface IotHubResourceGetValidSkusNextOptionalParams extends coreClient.OperationOptions { +} + +// @public +export type IotHubResourceGetValidSkusNextResponse = IotHubSkuDescriptionListResult; + +// @public +export interface IotHubResourceGetValidSkusOptionalParams extends coreClient.OperationOptions { +} + +// @public +export type IotHubResourceGetValidSkusResponse = IotHubSkuDescriptionListResult; + +// @public +export interface IotHubResourceImportDevicesOptionalParams extends coreClient.OperationOptions { +} + +// @public +export type IotHubResourceImportDevicesResponse = JobResponse; + +// @public +export interface IotHubResourceListByResourceGroupNextOptionalParams extends coreClient.OperationOptions { +} + +// @public +export type IotHubResourceListByResourceGroupNextResponse = IotHubDescriptionListResult; + +// @public +export interface IotHubResourceListByResourceGroupOptionalParams extends coreClient.OperationOptions { +} + +// @public +export type IotHubResourceListByResourceGroupResponse = IotHubDescriptionListResult; + +// @public +export interface IotHubResourceListBySubscriptionNextOptionalParams extends coreClient.OperationOptions { +} + +// @public +export type IotHubResourceListBySubscriptionNextResponse = IotHubDescriptionListResult; + +// @public +export interface IotHubResourceListBySubscriptionOptionalParams extends coreClient.OperationOptions { +} + +// @public +export type IotHubResourceListBySubscriptionResponse = IotHubDescriptionListResult; + +// @public +export interface IotHubResourceListEventHubConsumerGroupsNextOptionalParams extends coreClient.OperationOptions { +} + +// @public +export type IotHubResourceListEventHubConsumerGroupsNextResponse = EventHubConsumerGroupsListResult; + +// @public +export interface IotHubResourceListEventHubConsumerGroupsOptionalParams extends coreClient.OperationOptions { +} + +// @public +export type IotHubResourceListEventHubConsumerGroupsResponse = EventHubConsumerGroupsListResult; + +// @public +export interface IotHubResourceListJobsNextOptionalParams extends coreClient.OperationOptions { +} + +// @public +export type IotHubResourceListJobsNextResponse = JobResponseListResult; + +// @public +export interface IotHubResourceListJobsOptionalParams extends coreClient.OperationOptions { +} + +// @public +export type IotHubResourceListJobsResponse = JobResponseListResult; + +// @public +export interface IotHubResourceListKeysNextOptionalParams extends coreClient.OperationOptions { +} + +// @public +export type IotHubResourceListKeysNextResponse = SharedAccessSignatureAuthorizationRuleListResult; + +// @public +export interface IotHubResourceListKeysOptionalParams extends coreClient.OperationOptions { +} + +// @public +export type IotHubResourceListKeysResponse = SharedAccessSignatureAuthorizationRuleListResult; + +// @public +export interface IotHubResourceTestAllRoutesOptionalParams extends coreClient.OperationOptions { +} + +// @public +export type IotHubResourceTestAllRoutesResponse = TestAllRoutesResult; + +// @public +export interface IotHubResourceTestRouteOptionalParams extends coreClient.OperationOptions { +} + +// @public +export type IotHubResourceTestRouteResponse = TestRouteResult; + +// @public +export interface IotHubResourceUpdateOptionalParams extends coreClient.OperationOptions { + resumeFrom?: string; + updateIntervalInMs?: number; +} + +// @public +export type IotHubResourceUpdateResponse = IotHubDescription; + +// @public +export type IotHubScaleType = "Automatic" | "Manual" | "None"; + +// @public +export type IotHubSku = string; + +// @public +export interface IotHubSkuDescription { + capacity: IotHubCapacity; + readonly resourceType?: string; + sku: IotHubSkuInfo; +} + +// @public +export interface IotHubSkuDescriptionListResult { + readonly nextLink?: string; + value?: IotHubSkuDescription[]; +} + +// @public +export interface IotHubSkuInfo { + capacity?: number; + name: IotHubSku; + readonly tier?: IotHubSkuTier; +} + +// @public +export type IotHubSkuTier = "Free" | "Standard" | "Basic"; + +// @public +export type IpFilterActionType = "Accept" | "Reject"; + +// @public +export interface IpFilterRule { + action: IpFilterActionType; + filterName: string; + ipMask: string; +} + +// @public +export interface JobResponse { + readonly endTimeUtc?: Date; + readonly failureReason?: string; + readonly jobId?: string; + readonly parentJobId?: string; + readonly startTimeUtc?: Date; + readonly status?: JobStatus; + readonly statusMessage?: string; + readonly type?: JobType; +} + +// @public +export interface JobResponseListResult { + readonly nextLink?: string; + value?: JobResponse[]; +} + +// @public +export type JobStatus = "unknown" | "enqueued" | "running" | "completed" | "failed" | "cancelled"; + +// @public +export type JobType = string; + +// @public +export enum KnownAuthenticationType { + // (undocumented) + IdentityBased = "identityBased", + // (undocumented) + KeyBased = "keyBased" +} + +// @public +export enum KnownCapabilities { + // (undocumented) + DeviceManagement = "DeviceManagement", + // (undocumented) + None = "None" +} + +// @public +export enum KnownDefaultAction { + // (undocumented) + Allow = "Allow", + // (undocumented) + Deny = "Deny" +} + +// @public +export enum KnownEndpointHealthStatus { + // (undocumented) + Dead = "dead", + // (undocumented) + Degraded = "degraded", + // (undocumented) + Healthy = "healthy", + // (undocumented) + Unhealthy = "unhealthy", + // (undocumented) + Unknown = "unknown" +} + +// @public +export enum KnownIotHubReplicaRoleType { + // (undocumented) + Primary = "primary", + // (undocumented) + Secondary = "secondary" +} + +// @public +export enum KnownIotHubSku { + // (undocumented) + B1 = "B1", + // (undocumented) + B2 = "B2", + // (undocumented) + B3 = "B3", + // (undocumented) + F1 = "F1", + // (undocumented) + S1 = "S1", + // (undocumented) + S2 = "S2", + // (undocumented) + S3 = "S3" +} + +// @public +export enum KnownJobType { + // (undocumented) + Backup = "backup", + // (undocumented) + Export = "export", + // (undocumented) + FactoryResetDevice = "factoryResetDevice", + // (undocumented) + FirmwareUpdate = "firmwareUpdate", + // (undocumented) + Import = "import", + // (undocumented) + ReadDeviceProperties = "readDeviceProperties", + // (undocumented) + RebootDevice = "rebootDevice", + // (undocumented) + Unknown = "unknown", + // (undocumented) + UpdateDeviceConfiguration = "updateDeviceConfiguration", + // (undocumented) + WriteDeviceProperties = "writeDeviceProperties" +} + +// @public +export enum KnownNetworkRuleIPAction { + // (undocumented) + Allow = "Allow" +} + +// @public +export enum KnownPrivateLinkServiceConnectionStatus { + // (undocumented) + Approved = "Approved", + // (undocumented) + Disconnected = "Disconnected", + // (undocumented) + Pending = "Pending", + // (undocumented) + Rejected = "Rejected" +} + +// @public +export enum KnownPublicNetworkAccess { + // (undocumented) + Disabled = "Disabled", + // (undocumented) + Enabled = "Enabled" +} + +// @public +export enum KnownRouteErrorSeverity { + // (undocumented) + Error = "error", + // (undocumented) + Warning = "warning" +} + +// @public +export enum KnownRoutingSource { + // (undocumented) + DeviceConnectionStateEvents = "DeviceConnectionStateEvents", + // (undocumented) + DeviceJobLifecycleEvents = "DeviceJobLifecycleEvents", + // (undocumented) + DeviceLifecycleEvents = "DeviceLifecycleEvents", + // (undocumented) + DeviceMessages = "DeviceMessages", + // (undocumented) + Invalid = "Invalid", + // (undocumented) + TwinChangeEvents = "TwinChangeEvents" +} + +// @public +export enum KnownRoutingStorageContainerPropertiesEncoding { + // (undocumented) + Avro = "Avro", + // (undocumented) + AvroDeflate = "AvroDeflate", + // (undocumented) + Json = "JSON" +} + +// @public +export enum KnownTestResultStatus { + // (undocumented) + False = "false", + // (undocumented) + True = "true", + // (undocumented) + Undefined = "undefined" +} + +// @public +export interface ManagedIdentity { + userAssignedIdentity?: string; +} + +// @public +export interface MatchedRoute { + properties?: RouteProperties; +} + +// @public +export interface MessagingEndpointProperties { + lockDurationAsIso8601?: string; + maxDeliveryCount?: number; + ttlAsIso8601?: string; +} + +// @public +export interface Name { + localizedValue?: string; + value?: string; +} + +// @public +export type NetworkRuleIPAction = string; + +// @public +export interface NetworkRuleSetIpRule { + action?: NetworkRuleIPAction; + filterName: string; + ipMask: string; +} + +// @public +export interface NetworkRuleSetProperties { + applyToBuiltInEventHubEndpoint: boolean; + defaultAction?: DefaultAction; + ipRules: NetworkRuleSetIpRule[]; +} + +// @public +export interface Operation { + display?: OperationDisplay; + readonly name?: string; +} + +// @public +export interface OperationDisplay { + readonly description?: string; + readonly operation?: string; + readonly provider?: string; + readonly resource?: string; +} + +// @public +export interface OperationInputs { + name: string; +} + +// @public +export interface OperationListResult { + readonly nextLink?: string; + readonly value?: Operation[]; +} + +// @public +export interface Operations { + list(options?: OperationsListOptionalParams): PagedAsyncIterableIterator; +} + +// @public +export interface OperationsListNextOptionalParams extends coreClient.OperationOptions { +} + +// @public +export type OperationsListNextResponse = OperationListResult; + +// @public +export interface OperationsListOptionalParams extends coreClient.OperationOptions { +} + +// @public +export type OperationsListResponse = OperationListResult; + +// @public +export interface PrivateEndpoint { + readonly id?: string; +} + +// @public +export interface PrivateEndpointConnection { + readonly id?: string; + readonly name?: string; + properties: PrivateEndpointConnectionProperties; + readonly type?: string; +} + +// @public +export interface PrivateEndpointConnectionProperties { + privateEndpoint?: PrivateEndpoint; + privateLinkServiceConnectionState: PrivateLinkServiceConnectionState; +} + +// @public +export interface PrivateEndpointConnections { + beginDelete(resourceGroupName: string, resourceName: string, privateEndpointConnectionName: string, options?: PrivateEndpointConnectionsDeleteOptionalParams): Promise, PrivateEndpointConnectionsDeleteResponse>>; + beginDeleteAndWait(resourceGroupName: string, resourceName: string, privateEndpointConnectionName: string, options?: PrivateEndpointConnectionsDeleteOptionalParams): Promise; + beginUpdate(resourceGroupName: string, resourceName: string, privateEndpointConnectionName: string, privateEndpointConnection: PrivateEndpointConnection, options?: PrivateEndpointConnectionsUpdateOptionalParams): Promise, PrivateEndpointConnectionsUpdateResponse>>; + beginUpdateAndWait(resourceGroupName: string, resourceName: string, privateEndpointConnectionName: string, privateEndpointConnection: PrivateEndpointConnection, options?: PrivateEndpointConnectionsUpdateOptionalParams): Promise; + get(resourceGroupName: string, resourceName: string, privateEndpointConnectionName: string, options?: PrivateEndpointConnectionsGetOptionalParams): Promise; + list(resourceGroupName: string, resourceName: string, options?: PrivateEndpointConnectionsListOptionalParams): Promise; +} + +// @public +export interface PrivateEndpointConnectionsDeleteOptionalParams extends coreClient.OperationOptions { + resumeFrom?: string; + updateIntervalInMs?: number; +} + +// @public +export type PrivateEndpointConnectionsDeleteResponse = PrivateEndpointConnection; + +// @public +export interface PrivateEndpointConnectionsGetOptionalParams extends coreClient.OperationOptions { +} + +// @public +export type PrivateEndpointConnectionsGetResponse = PrivateEndpointConnection; + +// @public +export interface PrivateEndpointConnectionsListOptionalParams extends coreClient.OperationOptions { +} + +// @public +export type PrivateEndpointConnectionsListResponse = PrivateEndpointConnection[]; + +// @public +export interface PrivateEndpointConnectionsUpdateOptionalParams extends coreClient.OperationOptions { + resumeFrom?: string; + updateIntervalInMs?: number; +} + +// @public +export type PrivateEndpointConnectionsUpdateResponse = PrivateEndpointConnection; + +// @public +export interface PrivateLinkResources { + value?: GroupIdInformation[]; +} + +// @public +export interface PrivateLinkResourcesGetOptionalParams extends coreClient.OperationOptions { +} + +// @public +export type PrivateLinkResourcesGetResponse = GroupIdInformation; + +// @public +export interface PrivateLinkResourcesListOptionalParams extends coreClient.OperationOptions { +} + +// @public +export type PrivateLinkResourcesListResponse = PrivateLinkResources; + +// @public +export interface PrivateLinkResourcesOperations { + get(resourceGroupName: string, resourceName: string, groupId: string, options?: PrivateLinkResourcesGetOptionalParams): Promise; + list(resourceGroupName: string, resourceName: string, options?: PrivateLinkResourcesListOptionalParams): Promise; +} + +// @public +export interface PrivateLinkServiceConnectionState { + actionsRequired?: string; + description: string; + status: PrivateLinkServiceConnectionStatus; +} + +// @public +export type PrivateLinkServiceConnectionStatus = string; + +// @public +export type PublicNetworkAccess = string; + +// @public +export interface RegistryStatistics { + readonly disabledDeviceCount?: number; + readonly enabledDeviceCount?: number; + readonly totalDeviceCount?: number; +} + +// @public +export interface Resource { + readonly id?: string; + location: string; + readonly name?: string; + tags?: { + [propertyName: string]: string; + }; + readonly type?: string; +} + +// @public +export type ResourceIdentityType = "SystemAssigned" | "UserAssigned" | "SystemAssigned, UserAssigned" | "None"; + +// @public +export interface ResourceProviderCommon { + getSubscriptionQuota(options?: ResourceProviderCommonGetSubscriptionQuotaOptionalParams): Promise; +} + +// @public +export interface ResourceProviderCommonGetSubscriptionQuotaOptionalParams extends coreClient.OperationOptions { +} + +// @public +export type ResourceProviderCommonGetSubscriptionQuotaResponse = UserSubscriptionQuotaListResult; + +// @public +export interface RouteCompilationError { + location?: RouteErrorRange; + message?: string; + severity?: RouteErrorSeverity; +} + +// @public +export interface RouteErrorPosition { + column?: number; + line?: number; +} + +// @public +export interface RouteErrorRange { + end?: RouteErrorPosition; + start?: RouteErrorPosition; +} + +// @public +export type RouteErrorSeverity = string; + +// @public +export interface RouteProperties { + condition?: string; + endpointNames: string[]; + isEnabled: boolean; + name: string; + source: RoutingSource; +} + +// @public +export interface RoutingEndpoints { + eventHubs?: RoutingEventHubProperties[]; + serviceBusQueues?: RoutingServiceBusQueueEndpointProperties[]; + serviceBusTopics?: RoutingServiceBusTopicEndpointProperties[]; + storageContainers?: RoutingStorageContainerProperties[]; +} + +// @public +export interface RoutingEventHubProperties { + authenticationType?: AuthenticationType; + connectionString?: string; + endpointUri?: string; + entityPath?: string; + id?: string; + identity?: ManagedIdentity; + name: string; + resourceGroup?: string; + subscriptionId?: string; +} + +// @public +export interface RoutingMessage { + appProperties?: { + [propertyName: string]: string; + }; + body?: string; + systemProperties?: { + [propertyName: string]: string; + }; +} + +// @public +export interface RoutingProperties { + endpoints?: RoutingEndpoints; + enrichments?: EnrichmentProperties[]; + fallbackRoute?: FallbackRouteProperties; + routes?: RouteProperties[]; +} + +// @public +export interface RoutingServiceBusQueueEndpointProperties { + authenticationType?: AuthenticationType; + connectionString?: string; + endpointUri?: string; + entityPath?: string; + id?: string; + identity?: ManagedIdentity; + name: string; + resourceGroup?: string; + subscriptionId?: string; +} + +// @public +export interface RoutingServiceBusTopicEndpointProperties { + authenticationType?: AuthenticationType; + connectionString?: string; + endpointUri?: string; + entityPath?: string; + id?: string; + identity?: ManagedIdentity; + name: string; + resourceGroup?: string; + subscriptionId?: string; +} + +// @public +export type RoutingSource = string; + +// @public +export interface RoutingStorageContainerProperties { + authenticationType?: AuthenticationType; + batchFrequencyInSeconds?: number; + connectionString?: string; + containerName: string; + encoding?: RoutingStorageContainerPropertiesEncoding; + endpointUri?: string; + fileNameFormat?: string; + id?: string; + identity?: ManagedIdentity; + maxChunkSizeInBytes?: number; + name: string; + resourceGroup?: string; + subscriptionId?: string; +} + +// @public +export type RoutingStorageContainerPropertiesEncoding = string; + +// @public +export interface RoutingTwin { + // (undocumented) + properties?: RoutingTwinProperties; + tags?: Record; +} + +// @public (undocumented) +export interface RoutingTwinProperties { + desired?: Record; + reported?: Record; +} + +// @public +export interface SharedAccessSignatureAuthorizationRule { + keyName: string; + primaryKey?: string; + rights: AccessRights; + secondaryKey?: string; +} + +// @public +export interface SharedAccessSignatureAuthorizationRuleListResult { + readonly nextLink?: string; + value?: SharedAccessSignatureAuthorizationRule[]; +} + +// @public +export interface StorageEndpointProperties { + authenticationType?: AuthenticationType; + connectionString: string; + containerName: string; + identity?: ManagedIdentity; + sasTtlAsIso8601?: string; +} + +// @public +export interface TagsResource { + tags?: { + [propertyName: string]: string; + }; +} + +// @public +export interface TestAllRoutesInput { + message?: RoutingMessage; + routingSource?: RoutingSource; + twin?: RoutingTwin; +} + +// @public +export interface TestAllRoutesResult { + routes?: MatchedRoute[]; +} + +// @public +export type TestResultStatus = string; + +// @public +export interface TestRouteInput { + message?: RoutingMessage; + route: RouteProperties; + twin?: RoutingTwin; +} + +// @public +export interface TestRouteResult { + details?: TestRouteResultDetails; + result?: TestResultStatus; +} + +// @public +export interface TestRouteResultDetails { + compilationErrors?: RouteCompilationError[]; +} + +// @public +export interface UserSubscriptionQuota { + currentValue?: number; + id?: string; + limit?: number; + name?: Name; + type?: string; + unit?: string; +} + +// @public +export interface UserSubscriptionQuotaListResult { + readonly nextLink?: string; + // (undocumented) + value?: UserSubscriptionQuota[]; +} + +// (No @packageDocumentation comment for this package) + +``` diff --git a/sdk/iothub/arm-iothub/rollup.config.js b/sdk/iothub/arm-iothub/rollup.config.js index 23da7f53f189..9be1955eb7f1 100644 --- a/sdk/iothub/arm-iothub/rollup.config.js +++ b/sdk/iothub/arm-iothub/rollup.config.js @@ -1,31 +1,188 @@ -import rollup from "rollup"; -import nodeResolve from "rollup-plugin-node-resolve"; -import sourcemaps from "rollup-plugin-sourcemaps"; - -/** - * @type {rollup.RollupFileOptions} - */ -const config = { - input: "./esm/iotHubClient.js", - external: ["@azure/ms-rest-js", "@azure/ms-rest-azure-js"], - output: { - file: "./dist/arm-iothub.js", - format: "umd", - name: "Azure.ArmIothub", - sourcemap: true, - globals: { - "@azure/ms-rest-js": "msRest", - "@azure/ms-rest-azure-js": "msRestAzure" - }, - banner: `/* +/* * 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. - */` - }, - plugins: [nodeResolve({ mainFields: ["module", "main"] }), sourcemaps()] + */ + +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 +]; + +/** + * Construct a warning handler for the shared rollup configuration + * that ignores certain warnings that are not relevant to testing. + */ +function makeOnWarnForTesting() { + return (warning, warn) => { + // If every inhibitor returns false (i.e. no inhibitors), then show the warning + if (warningInhibitors.every((inhib) => !inhib(warning))) { + warn(warning); + } + }; +} + +// #endregion + +function makeBrowserTestConfig() { + const config = { + input: { + include: ["dist-esm/test/**/*.spec.js"], + exclude: ["dist-esm/test/**/node/**"] + }, + output: { + file: `dist-test/index.browser.js`, + format: "umd", + sourcemap: true + }, + preserveSymlinks: false, + plugins: [ + multiEntry({ exports: false }), + nodeResolve({ + mainFields: ["module", "browser"] + }), + cjs({ + 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/iothub/arm-iothub/src/models/operationsMappers.ts b/sdk/iothub/arm-iothub/src/index.ts similarity index 59% rename from sdk/iothub/arm-iothub/src/models/operationsMappers.ts rename to sdk/iothub/arm-iothub/src/index.ts index 746eeddc3d6b..21c1f0032156 100644 --- a/sdk/iothub/arm-iothub/src/models/operationsMappers.ts +++ b/sdk/iothub/arm-iothub/src/index.ts @@ -6,4 +6,7 @@ * Changes may cause incorrect behavior and will be lost if the code is regenerated. */ -export { ErrorDetails, Operation, OperationDisplay, OperationListResult } from "../models/mappers"; +/// +export * from "./models"; +export { IotHubClient } from "./iotHubClient"; +export * from "./operationsInterfaces"; diff --git a/sdk/iothub/arm-iothub/src/iotHubClient.ts b/sdk/iothub/arm-iothub/src/iotHubClient.ts index a21e31f2cd97..e07d85b093e4 100644 --- a/sdk/iothub/arm-iothub/src/iotHubClient.ts +++ b/sdk/iothub/arm-iothub/src/iotHubClient.ts @@ -3,49 +3,103 @@ * 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/mappers"; -import * as operations from "./operations"; -import { IotHubClientContext } from "./iotHubClientContext"; - -class IotHubClient extends IotHubClientContext { - // Operation groups - operations: operations.Operations; - iotHubResource: operations.IotHubResource; - resourceProviderCommon: operations.ResourceProviderCommon; - certificates: operations.Certificates; - iotHub: operations.IotHub; - privateLinkResources: operations.PrivateLinkResourcesOperations; - privateEndpointConnections: operations.PrivateEndpointConnections; +import * as coreClient from "@azure/core-client"; +import * as coreAuth from "@azure/core-auth"; +import { + OperationsImpl, + IotHubResourceImpl, + ResourceProviderCommonImpl, + CertificatesImpl, + IotHubImpl, + PrivateLinkResourcesOperationsImpl, + PrivateEndpointConnectionsImpl +} from "./operations"; +import { + Operations, + IotHubResource, + ResourceProviderCommon, + Certificates, + IotHub, + PrivateLinkResourcesOperations, + PrivateEndpointConnections +} from "./operationsInterfaces"; +import { IotHubClientOptionalParams } from "./models"; + +export class IotHubClient extends coreClient.ServiceClient { + $host: string; + apiVersion: string; + subscriptionId: string; /** * Initializes a new instance of the IotHubClient class. - * @param credentials Credentials needed for the client to connect to Azure. + * @param credentials Subscription credentials which uniquely identify client subscription. * @param subscriptionId The subscription identifier. - * @param [options] The parameter options + * @param options The parameter options */ constructor( - credentials: msRest.ServiceClientCredentials, + credentials: coreAuth.TokenCredential, subscriptionId: string, - options?: Models.IotHubClientOptions + options?: IotHubClientOptionalParams ) { - super(credentials, subscriptionId, options); - this.operations = new operations.Operations(this); - this.iotHubResource = new operations.IotHubResource(this); - this.resourceProviderCommon = new operations.ResourceProviderCommon(this); - this.certificates = new operations.Certificates(this); - this.iotHub = new operations.IotHub(this); - this.privateLinkResources = new operations.PrivateLinkResourcesOperations(this); - this.privateEndpointConnections = new operations.PrivateEndpointConnections(this); - } -} + 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: IotHubClientOptionalParams = { + requestContentType: "application/json; charset=utf-8", + credential: credentials + }; -// Operation Specifications + const packageDetails = `azsdk-js-arm-iothub/6.0.0`; + const userAgentPrefix = + options.userAgentOptions && options.userAgentOptions.userAgentPrefix + ? `${options.userAgentOptions.userAgentPrefix} ${packageDetails}` + : `${packageDetails}`; -export { IotHubClient, IotHubClientContext, Models as IotHubModels, Mappers as IotHubMappers }; -export * from "./operations"; + 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 || "2021-07-01"; + this.operations = new OperationsImpl(this); + this.iotHubResource = new IotHubResourceImpl(this); + this.resourceProviderCommon = new ResourceProviderCommonImpl(this); + this.certificates = new CertificatesImpl(this); + this.iotHub = new IotHubImpl(this); + this.privateLinkResourcesOperations = new PrivateLinkResourcesOperationsImpl( + this + ); + this.privateEndpointConnections = new PrivateEndpointConnectionsImpl(this); + } + + operations: Operations; + iotHubResource: IotHubResource; + resourceProviderCommon: ResourceProviderCommon; + certificates: Certificates; + iotHub: IotHub; + privateLinkResourcesOperations: PrivateLinkResourcesOperations; + privateEndpointConnections: PrivateEndpointConnections; +} diff --git a/sdk/iothub/arm-iothub/src/iotHubClientContext.ts b/sdk/iothub/arm-iothub/src/iotHubClientContext.ts deleted file mode 100644 index 22840bd1bf8e..000000000000 --- a/sdk/iothub/arm-iothub/src/iotHubClientContext.ts +++ /dev/null @@ -1,68 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is - * regenerated. - */ - -import * as Models from "./models"; -import * as msRest from "@azure/ms-rest-js"; -import * as msRestAzure from "@azure/ms-rest-azure-js"; - -const packageName = "@azure/arm-iothub"; -const packageVersion = "5.0.0"; - -export class IotHubClientContext extends msRestAzure.AzureServiceClient { - credentials: msRest.ServiceClientCredentials; - subscriptionId: string; - apiVersion?: string; - - /** - * Initializes a new instance of the IotHubClient class. - * @param credentials Credentials needed for the client to connect to Azure. - * @param subscriptionId The subscription identifier. - * @param [options] The parameter options - */ - constructor( - credentials: msRest.ServiceClientCredentials, - subscriptionId: string, - options?: Models.IotHubClientOptions - ) { - 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 = "2021-03-31"; - 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/iothub/arm-iothub/src/lroImpl.ts b/sdk/iothub/arm-iothub/src/lroImpl.ts new file mode 100644 index 000000000000..518d5f053b4e --- /dev/null +++ b/sdk/iothub/arm-iothub/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/iothub/arm-iothub/src/models/certificatesMappers.ts b/sdk/iothub/arm-iothub/src/models/certificatesMappers.ts deleted file mode 100644 index 9dcee9e45ec3..000000000000 --- a/sdk/iothub/arm-iothub/src/models/certificatesMappers.ts +++ /dev/null @@ -1,49 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -export { - ArmIdentity, - ArmUserIdentity, - BaseResource, - CertificateDescription, - CertificateListDescription, - CertificateProperties, - CertificatePropertiesWithNonce, - CertificateVerificationDescription, - CertificateWithNonceDescription, - CloudToDeviceProperties, - EnrichmentProperties, - ErrorDetails, - EventHubConsumerGroupInfo, - EventHubProperties, - FallbackRouteProperties, - FeedbackProperties, - IotHubDescription, - IotHubLocationDescription, - IotHubProperties, - IotHubSkuInfo, - IpFilterRule, - ManagedIdentity, - MessagingEndpointProperties, - NetworkRuleSetIpRule, - NetworkRuleSetProperties, - PrivateEndpoint, - PrivateEndpointConnection, - PrivateEndpointConnectionProperties, - PrivateLinkServiceConnectionState, - Resource, - RouteProperties, - RoutingEndpoints, - RoutingEventHubProperties, - RoutingProperties, - RoutingServiceBusQueueEndpointProperties, - RoutingServiceBusTopicEndpointProperties, - RoutingStorageContainerProperties, - SharedAccessSignatureAuthorizationRule, - StorageEndpointProperties -} from "../models/mappers"; diff --git a/sdk/iothub/arm-iothub/src/models/index.ts b/sdk/iothub/arm-iothub/src/models/index.ts index 5404171a2105..ea885397feb4 100644 --- a/sdk/iothub/arm-iothub/src/models/index.ts +++ b/sdk/iothub/arm-iothub/src/models/index.ts @@ -6,3071 +6,1850 @@ * 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 }; - -/** - * The JSON-serialized leaf certificate - */ -export interface CertificateVerificationDescription { - /** - * base-64 representation of X509 certificate .cer file or just .pem file content. - */ - certificate?: string; -} - -/** - * The description of an X509 CA Certificate. - */ -export interface CertificateProperties { - /** - * The certificate's subject name. - * **NOTE: This property will not be serialized. It can only be populated by the server.** - */ - readonly subject?: string; - /** - * The certificate's expiration date and time. - * **NOTE: This property will not be serialized. It can only be populated by the server.** - */ - readonly expiry?: Date; - /** - * The certificate's thumbprint. - * **NOTE: This property will not be serialized. It can only be populated by the server.** - */ - readonly thumbprint?: string; - /** - * Determines whether certificate has been verified. - * **NOTE: This property will not be serialized. It can only be populated by the server.** - */ - readonly isVerified?: boolean; - /** - * The certificate's create date and time. - * **NOTE: This property will not be serialized. It can only be populated by the server.** - */ - readonly created?: Date; +/** Result of the request to list IoT Hub operations. It contains a list of operations and a URL link to get the next set of results. */ +export interface OperationListResult { /** - * The certificate's last update date and time. - * **NOTE: This property will not be serialized. It can only be populated by the server.** + * List of IoT Hub operations supported by the Microsoft.Devices resource provider. + * NOTE: This property will not be serialized. It can only be populated by the server. */ - readonly updated?: Date; + readonly value?: Operation[]; /** - * The certificate content + * 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. */ - certificate?: string; + readonly nextLink?: string; } -/** - * The X509 Certificate. - */ -export interface CertificateDescription extends BaseResource { - properties?: CertificateProperties; - /** - * The resource identifier. - * **NOTE: This property will not be serialized. It can only be populated by the server.** - */ - readonly id?: string; +/** IoT Hub REST API operation */ +export interface Operation { /** - * The name of the certificate. - * **NOTE: This property will not be serialized. It can only be populated by the server.** + * Operation name: {provider}/{resource}/{read | write | action | delete} + * NOTE: This property will not be serialized. It can only be populated by the server. */ readonly name?: string; - /** - * The entity tag. - * **NOTE: This property will not be serialized. It can only be populated by the server.** - */ - readonly etag?: string; - /** - * The resource type. - * **NOTE: This property will not be serialized. It can only be populated by the server.** - */ - readonly type?: string; -} - -/** - * The JSON-serialized array of Certificate objects. - */ -export interface CertificateListDescription { - /** - * The array of Certificate objects. - */ - value?: CertificateDescription[]; -} - -/** - * The JSON-serialized X509 Certificate. - */ -export interface CertificateBodyDescription { - /** - * base-64 representation of the X509 leaf certificate .cer file or just .pem file content. - */ - certificate?: string; + /** The object that represents the operation. */ + display?: OperationDisplay; } -/** - * The description of an X509 CA Certificate including the challenge nonce issued for the - * Proof-Of-Possession flow. - */ -export interface CertificatePropertiesWithNonce { +/** The object that represents the operation. */ +export interface OperationDisplay { /** - * The certificate's subject name. - * **NOTE: This property will not be serialized. It can only be populated by the server.** + * Service provider: Microsoft Devices + * NOTE: This property will not be serialized. It can only be populated by the server. */ - readonly subject?: string; + readonly provider?: string; /** - * The certificate's expiration date and time. - * **NOTE: This property will not be serialized. It can only be populated by the server.** + * Resource Type: IotHubs + * NOTE: This property will not be serialized. It can only be populated by the server. */ - readonly expiry?: Date; + readonly resource?: string; /** - * The certificate's thumbprint. - * **NOTE: This property will not be serialized. It can only be populated by the server.** + * Name of the operation + * NOTE: This property will not be serialized. It can only be populated by the server. */ - readonly thumbprint?: string; + readonly operation?: string; /** - * Determines whether certificate has been verified. - * **NOTE: This property will not be serialized. It can only be populated by the server.** + * Description of the operation + * NOTE: This property will not be serialized. It can only be populated by the server. */ - readonly isVerified?: boolean; + readonly description?: string; +} + +/** Error details. */ +export interface ErrorDetails { /** - * The certificate's create date and time. - * **NOTE: This property will not be serialized. It can only be populated by the server.** + * The error code. + * NOTE: This property will not be serialized. It can only be populated by the server. */ - readonly created?: Date; + readonly code?: string; /** - * The certificate's last update date and time. - * **NOTE: This property will not be serialized. It can only be populated by the server.** + * The HTTP status code. + * NOTE: This property will not be serialized. It can only be populated by the server. */ - readonly updated?: Date; + readonly httpStatusCode?: string; /** - * The certificate's verification code that will be used for proof of possession. - * **NOTE: This property will not be serialized. It can only be populated by the server.** + * The error message. + * NOTE: This property will not be serialized. It can only be populated by the server. */ - readonly verificationCode?: string; + readonly message?: string; /** - * The certificate content - * **NOTE: This property will not be serialized. It can only be populated by the server.** + * The error details. + * NOTE: This property will not be serialized. It can only be populated by the server. */ - readonly certificate?: string; + readonly details?: string; } -/** - * The X509 Certificate. - */ -export interface CertificateWithNonceDescription extends BaseResource { - properties?: CertificatePropertiesWithNonce; +/** The properties of an IoT hub. */ +export interface IotHubProperties { + /** The shared access policies you can use to secure a connection to the IoT hub. */ + authorizationPolicies?: SharedAccessSignatureAuthorizationRule[]; + /** If true, SAS tokens with Iot hub scoped SAS keys cannot be used for authentication. */ + disableLocalAuth?: boolean; + /** If true, all device(including Edge devices but excluding modules) scoped SAS keys cannot be used for authentication. */ + disableDeviceSAS?: boolean; + /** If true, all module scoped SAS keys cannot be used for authentication. */ + disableModuleSAS?: boolean; + /** If true, egress from IotHub will be restricted to only the allowed FQDNs that are configured via allowedFqdnList. */ + restrictOutboundNetworkAccess?: boolean; + /** List of allowed FQDNs(Fully Qualified Domain Name) for egress from Iot Hub. */ + allowedFqdnList?: string[]; + /** Whether requests from Public Network are allowed */ + publicNetworkAccess?: PublicNetworkAccess; + /** The IP filter rules. */ + ipFilterRules?: IpFilterRule[]; + /** Network Rule Set Properties of IotHub */ + networkRuleSets?: NetworkRuleSetProperties; + /** Specifies the minimum TLS version to support for this hub. Can be set to "1.2" to have clients that use a TLS version below 1.2 to be rejected. */ + minTlsVersion?: string; + /** Private endpoint connections created on this IotHub */ + privateEndpointConnections?: PrivateEndpointConnection[]; /** - * The resource identifier. - * **NOTE: This property will not be serialized. It can only be populated by the server.** + * The provisioning state. + * NOTE: This property will not be serialized. It can only be populated by the server. */ - readonly id?: string; + readonly provisioningState?: string; /** - * The name of the certificate. - * **NOTE: This property will not be serialized. It can only be populated by the server.** + * The hub state. + * NOTE: This property will not be serialized. It can only be populated by the server. */ - readonly name?: string; + readonly state?: string; /** - * The entity tag. - * **NOTE: This property will not be serialized. It can only be populated by the server.** + * The name of the host. + * NOTE: This property will not be serialized. It can only be populated by the server. */ - readonly etag?: string; + readonly hostName?: string; + /** The Event Hub-compatible endpoint properties. The only possible keys to this dictionary is events. This key has to be present in the dictionary while making create or update calls for the IoT hub. */ + eventHubEndpoints?: { [propertyName: string]: EventHubProperties }; + /** The routing related properties of the IoT hub. See: https://docs.microsoft.com/azure/iot-hub/iot-hub-devguide-messaging */ + routing?: RoutingProperties; + /** The list of Azure Storage endpoints where you can upload files. Currently you can configure only one Azure Storage account and that MUST have its key as $default. Specifying more than one storage account causes an error to be thrown. Not specifying a value for this property when the enableFileUploadNotifications property is set to True, causes an error to be thrown. */ + storageEndpoints?: { [propertyName: string]: StorageEndpointProperties }; + /** The messaging endpoint properties for the file upload notification queue. */ + messagingEndpoints?: { [propertyName: string]: MessagingEndpointProperties }; + /** If True, file upload notifications are enabled. */ + enableFileUploadNotifications?: boolean; + /** The IoT hub cloud-to-device messaging properties. */ + cloudToDevice?: CloudToDeviceProperties; + /** IoT hub comments. */ + comments?: string; + /** The capabilities and features enabled for the IoT hub. */ + features?: Capabilities; /** - * The resource type. - * **NOTE: This property will not be serialized. It can only be populated by the server.** + * Primary and secondary location for iot hub + * NOTE: This property will not be serialized. It can only be populated by the server. */ - readonly type?: string; + readonly locations?: IotHubLocationDescription[]; } -/** - * The properties of an IoT hub shared access policy. - */ +/** The properties of an IoT hub shared access policy. */ export interface SharedAccessSignatureAuthorizationRule { - /** - * The name of the shared access policy. - */ + /** The name of the shared access policy. */ keyName: string; - /** - * The primary key. - */ + /** The primary key. */ primaryKey?: string; - /** - * The secondary key. - */ + /** The secondary key. */ secondaryKey?: string; - /** - * The permissions assigned to the shared access policy. Possible values include: 'RegistryRead', - * 'RegistryWrite', 'ServiceConnect', 'DeviceConnect', 'RegistryRead, RegistryWrite', - * 'RegistryRead, ServiceConnect', 'RegistryRead, DeviceConnect', 'RegistryWrite, - * ServiceConnect', 'RegistryWrite, DeviceConnect', 'ServiceConnect, DeviceConnect', - * 'RegistryRead, RegistryWrite, ServiceConnect', 'RegistryRead, RegistryWrite, DeviceConnect', - * 'RegistryRead, ServiceConnect, DeviceConnect', 'RegistryWrite, ServiceConnect, DeviceConnect', - * 'RegistryRead, RegistryWrite, ServiceConnect, DeviceConnect' - */ + /** The permissions assigned to the shared access policy. */ rights: AccessRights; } -/** - * The IP filter rules for the IoT hub. - */ +/** The IP filter rules for the IoT hub. */ export interface IpFilterRule { - /** - * The name of the IP filter rule. - */ + /** The name of the IP filter rule. */ filterName: string; - /** - * The desired action for requests captured by this rule. Possible values include: 'Accept', - * 'Reject' - */ + /** The desired action for requests captured by this rule. */ action: IpFilterActionType; - /** - * A string that contains the IP address range in CIDR notation for the rule. - */ - ipMask: string; -} - -/** - * IP Rule to be applied as part of Network Rule Set - */ -export interface NetworkRuleSetIpRule { - /** - * Name of the IP filter rule. - */ - filterName: string; - /** - * IP Filter Action. Possible values include: 'Allow'. Default value: 'Allow'. - */ - action?: NetworkRuleIPAction; - /** - * A string that contains the IP address range in CIDR notation for the rule. - */ + /** A string that contains the IP address range in CIDR notation for the rule. */ ipMask: string; } -/** - * Network Rule Set Properties of IotHub - */ +/** Network Rule Set Properties of IotHub */ export interface NetworkRuleSetProperties { - /** - * Default Action for Network Rule Set. Possible values include: 'Deny', 'Allow'. Default value: - * 'Deny'. - */ + /** Default Action for Network Rule Set */ defaultAction?: DefaultAction; - /** - * If True, then Network Rule Set is also applied to BuiltIn EventHub EndPoint of IotHub - */ + /** If True, then Network Rule Set is also applied to BuiltIn EventHub EndPoint of IotHub */ applyToBuiltInEventHubEndpoint: boolean; - /** - * List of IP Rules - */ + /** List of IP Rules */ ipRules: NetworkRuleSetIpRule[]; } -/** - * The private endpoint property of a private endpoint connection - */ -export interface PrivateEndpoint { - /** - * The resource identifier. - * **NOTE: This property will not be serialized. It can only be populated by the server.** - */ - readonly id?: string; +/** IP Rule to be applied as part of Network Rule Set */ +export interface NetworkRuleSetIpRule { + /** Name of the IP filter rule. */ + filterName: string; + /** IP Filter Action */ + action?: NetworkRuleIPAction; + /** A string that contains the IP address range in CIDR notation for the rule. */ + ipMask: string; } -/** - * The current state of a private endpoint connection - */ -export interface PrivateLinkServiceConnectionState { +/** The private endpoint connection of an IotHub */ +export interface PrivateEndpointConnection { /** - * The status of a private endpoint connection. Possible values include: 'Pending', 'Approved', - * 'Rejected', 'Disconnected' + * The resource identifier. + * NOTE: This property will not be serialized. It can only be populated by the server. */ - status: PrivateLinkServiceConnectionStatus; + readonly id?: string; /** - * The description for the current state of a private endpoint connection + * The resource name. + * NOTE: This property will not be serialized. It can only be populated by the server. */ - description: string; + readonly name?: string; /** - * Actions required for a private endpoint connection + * The resource type. + * NOTE: This property will not be serialized. It can only be populated by the server. */ - actionsRequired?: string; + readonly type?: string; + /** The properties of a private endpoint connection */ + properties: PrivateEndpointConnectionProperties; } -/** - * The properties of a private endpoint connection - */ +/** The properties of a private endpoint connection */ export interface PrivateEndpointConnectionProperties { + /** The private endpoint property of a private endpoint connection */ privateEndpoint?: PrivateEndpoint; + /** The current state of a private endpoint connection */ privateLinkServiceConnectionState: PrivateLinkServiceConnectionState; } -/** - * The private endpoint connection of an IotHub - */ -export interface PrivateEndpointConnection extends BaseResource { +/** The private endpoint property of a private endpoint connection */ +export interface PrivateEndpoint { /** * The resource identifier. - * **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 id?: string; - /** - * The resource name. - * **NOTE: This property will not be serialized. It can only be populated by the server.** - */ - readonly name?: string; - /** - * The resource type. - * **NOTE: This property will not be serialized. It can only be populated by the server.** - */ - readonly type?: string; - properties: PrivateEndpointConnectionProperties; } -/** - * The properties of the provisioned Event Hub-compatible endpoint used by the IoT hub. - */ +/** The current state of a private endpoint connection */ +export interface PrivateLinkServiceConnectionState { + /** The status of a private endpoint connection */ + status: PrivateLinkServiceConnectionStatus; + /** The description for the current state of a private endpoint connection */ + description: string; + /** Actions required for a private endpoint connection */ + actionsRequired?: string; +} + +/** The properties of the provisioned Event Hub-compatible endpoint used by the IoT hub. */ export interface EventHubProperties { - /** - * The retention time for device-to-cloud messages in days. See: - * https://docs.microsoft.com/azure/iot-hub/iot-hub-devguide-messaging#device-to-cloud-messages - */ + /** The retention time for device-to-cloud messages in days. See: https://docs.microsoft.com/azure/iot-hub/iot-hub-devguide-messaging#device-to-cloud-messages */ retentionTimeInDays?: number; - /** - * The number of partitions for receiving device-to-cloud messages in the Event Hub-compatible - * endpoint. See: - * https://docs.microsoft.com/azure/iot-hub/iot-hub-devguide-messaging#device-to-cloud-messages. - */ + /** The number of partitions for receiving device-to-cloud messages in the Event Hub-compatible endpoint. See: https://docs.microsoft.com/azure/iot-hub/iot-hub-devguide-messaging#device-to-cloud-messages. */ partitionCount?: number; /** * The partition ids in the Event Hub-compatible endpoint. - * **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 partitionIds?: string[]; /** * The Event Hub-compatible name. - * **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 path?: string; /** * The Event Hub-compatible endpoint. - * **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 endpoint?: string; } -/** - * The properties of the Managed identity. - */ -export interface ManagedIdentity { - /** - * The user assigned identity. - */ - userAssignedIdentity?: string; +/** The routing related properties of the IoT hub. See: https://docs.microsoft.com/azure/iot-hub/iot-hub-devguide-messaging */ +export interface RoutingProperties { + /** The properties related to the custom endpoints to which your IoT hub routes messages based on the routing rules. A maximum of 10 custom endpoints are allowed across all endpoint types for paid hubs and only 1 custom endpoint is allowed across all endpoint types for free hubs. */ + endpoints?: RoutingEndpoints; + /** The list of user-provided routing rules that the IoT hub uses to route messages to built-in and custom endpoints. A maximum of 100 routing rules are allowed for paid hubs and a maximum of 5 routing rules are allowed for free hubs. */ + routes?: RouteProperties[]; + /** The properties of the route that is used as a fall-back route when none of the conditions specified in the 'routes' section are met. This is an optional parameter. When this property is not set, the messages which do not meet any of the conditions specified in the 'routes' section get routed to the built-in eventhub endpoint. */ + fallbackRoute?: FallbackRouteProperties; + /** The list of user-provided enrichments that the IoT hub applies to messages to be delivered to built-in and custom endpoints. See: https://aka.ms/telemetryoneventgrid */ + enrichments?: EnrichmentProperties[]; } -/** - * The properties related to service bus queue endpoint types. - */ +/** The properties related to the custom endpoints to which your IoT hub routes messages based on the routing rules. A maximum of 10 custom endpoints are allowed across all endpoint types for paid hubs and only 1 custom endpoint is allowed across all endpoint types for free hubs. */ +export interface RoutingEndpoints { + /** The list of Service Bus queue endpoints that IoT hub routes the messages to, based on the routing rules. */ + serviceBusQueues?: RoutingServiceBusQueueEndpointProperties[]; + /** The list of Service Bus topic endpoints that the IoT hub routes the messages to, based on the routing rules. */ + serviceBusTopics?: RoutingServiceBusTopicEndpointProperties[]; + /** The list of Event Hubs endpoints that IoT hub routes messages to, based on the routing rules. This list does not include the built-in Event Hubs endpoint. */ + eventHubs?: RoutingEventHubProperties[]; + /** The list of storage container endpoints that IoT hub routes messages to, based on the routing rules. */ + storageContainers?: RoutingStorageContainerProperties[]; +} + +/** The properties related to service bus queue endpoint types. */ export interface RoutingServiceBusQueueEndpointProperties { - /** - * Id of the service bus queue endpoint - */ + /** Id of the service bus queue endpoint */ id?: string; - /** - * The connection string of the service bus queue endpoint. - */ + /** The connection string of the service bus queue endpoint. */ connectionString?: string; - /** - * The url of the service bus queue endpoint. It must include the protocol sb:// - */ + /** The url of the service bus queue endpoint. It must include the protocol sb:// */ endpointUri?: string; - /** - * Queue name on the service bus namespace - */ + /** Queue name on the service bus namespace */ entityPath?: string; - /** - * Method used to authenticate against the service bus queue endpoint. Possible values include: - * 'keyBased', 'identityBased' - */ + /** Method used to authenticate against the service bus queue endpoint */ authenticationType?: AuthenticationType; - /** - * Managed identity properties of routing service bus queue endpoint. - */ + /** Managed identity properties of routing service bus queue endpoint. */ identity?: ManagedIdentity; - /** - * The name that identifies this endpoint. The name can only include alphanumeric characters, - * periods, underscores, hyphens and has a maximum length of 64 characters. The following names - * are reserved: events, fileNotifications, $default. Endpoint names must be unique across - * endpoint types. The name need not be the same as the actual queue name. - */ + /** The name that identifies this endpoint. The name can only include alphanumeric characters, periods, underscores, hyphens and has a maximum length of 64 characters. The following names are reserved: events, fileNotifications, $default. Endpoint names must be unique across endpoint types. The name need not be the same as the actual queue name. */ name: string; - /** - * The subscription identifier of the service bus queue endpoint. - */ + /** The subscription identifier of the service bus queue endpoint. */ subscriptionId?: string; - /** - * The name of the resource group of the service bus queue endpoint. - */ + /** The name of the resource group of the service bus queue endpoint. */ resourceGroup?: string; } -/** - * The properties related to service bus topic endpoint types. - */ +/** The properties of the Managed identity. */ +export interface ManagedIdentity { + /** The user assigned identity. */ + userAssignedIdentity?: string; +} + +/** The properties related to service bus topic endpoint types. */ export interface RoutingServiceBusTopicEndpointProperties { - /** - * Id of the service bus topic endpoint - */ + /** Id of the service bus topic endpoint */ id?: string; - /** - * The connection string of the service bus topic endpoint. - */ + /** The connection string of the service bus topic endpoint. */ connectionString?: string; - /** - * The url of the service bus topic endpoint. It must include the protocol sb:// - */ + /** The url of the service bus topic endpoint. It must include the protocol sb:// */ endpointUri?: string; - /** - * Queue name on the service bus topic - */ + /** Queue name on the service bus topic */ entityPath?: string; - /** - * Method used to authenticate against the service bus topic endpoint. Possible values include: - * 'keyBased', 'identityBased' - */ + /** Method used to authenticate against the service bus topic endpoint */ authenticationType?: AuthenticationType; - /** - * Managed identity properties of routing service bus topic endpoint. - */ + /** Managed identity properties of routing service bus topic endpoint. */ identity?: ManagedIdentity; - /** - * The name that identifies this endpoint. The name can only include alphanumeric characters, - * periods, underscores, hyphens and has a maximum length of 64 characters. The following names - * are reserved: events, fileNotifications, $default. Endpoint names must be unique across - * endpoint types. The name need not be the same as the actual topic name. - */ + /** The name that identifies this endpoint. The name can only include alphanumeric characters, periods, underscores, hyphens and has a maximum length of 64 characters. The following names are reserved: events, fileNotifications, $default. Endpoint names must be unique across endpoint types. The name need not be the same as the actual topic name. */ name: string; - /** - * The subscription identifier of the service bus topic endpoint. - */ + /** The subscription identifier of the service bus topic endpoint. */ subscriptionId?: string; - /** - * The name of the resource group of the service bus topic endpoint. - */ + /** The name of the resource group of the service bus topic endpoint. */ resourceGroup?: string; } -/** - * The properties related to an event hub endpoint. - */ +/** The properties related to an event hub endpoint. */ export interface RoutingEventHubProperties { - /** - * Id of the event hub endpoint - */ + /** Id of the event hub endpoint */ id?: string; - /** - * The connection string of the event hub endpoint. - */ + /** The connection string of the event hub endpoint. */ connectionString?: string; - /** - * The url of the event hub endpoint. It must include the protocol sb:// - */ + /** The url of the event hub endpoint. It must include the protocol sb:// */ endpointUri?: string; - /** - * Event hub name on the event hub namespace - */ + /** Event hub name on the event hub namespace */ entityPath?: string; - /** - * Method used to authenticate against the event hub endpoint. Possible values include: - * 'keyBased', 'identityBased' - */ + /** Method used to authenticate against the event hub endpoint */ authenticationType?: AuthenticationType; - /** - * Managed identity properties of routing event hub endpoint. - */ + /** Managed identity properties of routing event hub endpoint. */ identity?: ManagedIdentity; - /** - * The name that identifies this endpoint. The name can only include alphanumeric characters, - * periods, underscores, hyphens and has a maximum length of 64 characters. The following names - * are reserved: events, fileNotifications, $default. Endpoint names must be unique across - * endpoint types. - */ + /** The name that identifies this endpoint. The name can only include alphanumeric characters, periods, underscores, hyphens and has a maximum length of 64 characters. The following names are reserved: events, fileNotifications, $default. Endpoint names must be unique across endpoint types. */ name: string; - /** - * The subscription identifier of the event hub endpoint. - */ + /** The subscription identifier of the event hub endpoint. */ subscriptionId?: string; - /** - * The name of the resource group of the event hub endpoint. - */ + /** The name of the resource group of the event hub endpoint. */ resourceGroup?: string; } -/** - * The properties related to a storage container endpoint. - */ +/** The properties related to a storage container endpoint. */ export interface RoutingStorageContainerProperties { - /** - * Id of the storage container endpoint - */ + /** Id of the storage container endpoint */ id?: string; - /** - * The connection string of the storage account. - */ + /** The connection string of the storage account. */ connectionString?: string; - /** - * The url of the storage endpoint. It must include the protocol https:// - */ + /** The url of the storage endpoint. It must include the protocol https:// */ endpointUri?: string; - /** - * Method used to authenticate against the storage endpoint. Possible values include: 'keyBased', - * 'identityBased' - */ + /** Method used to authenticate against the storage endpoint */ authenticationType?: AuthenticationType; - /** - * Managed identity properties of routing storage endpoint. - */ + /** Managed identity properties of routing storage endpoint. */ identity?: ManagedIdentity; - /** - * The name that identifies this endpoint. The name can only include alphanumeric characters, - * periods, underscores, hyphens and has a maximum length of 64 characters. The following names - * are reserved: events, fileNotifications, $default. Endpoint names must be unique across - * endpoint types. - */ + /** The name that identifies this endpoint. The name can only include alphanumeric characters, periods, underscores, hyphens and has a maximum length of 64 characters. The following names are reserved: events, fileNotifications, $default. Endpoint names must be unique across endpoint types. */ name: string; - /** - * The subscription identifier of the storage account. - */ + /** The subscription identifier of the storage account. */ subscriptionId?: string; - /** - * The name of the resource group of the storage account. - */ + /** The name of the resource group of the storage account. */ resourceGroup?: string; - /** - * The name of storage container in the storage account. - */ + /** The name of storage container in the storage account. */ containerName: string; - /** - * File name format for the blob. Default format is - * {iothub}/{partition}/{YYYY}/{MM}/{DD}/{HH}/{mm}. All parameters are mandatory but can be - * reordered. - */ + /** File name format for the blob. Default format is {iothub}/{partition}/{YYYY}/{MM}/{DD}/{HH}/{mm}. All parameters are mandatory but can be reordered. */ fileNameFormat?: string; - /** - * Time interval at which blobs are written to storage. Value should be between 60 and 720 - * seconds. Default value is 300 seconds. - */ + /** Time interval at which blobs are written to storage. Value should be between 60 and 720 seconds. Default value is 300 seconds. */ batchFrequencyInSeconds?: number; - /** - * Maximum number of bytes for each blob written to storage. Value should be between - * 10485760(10MB) and 524288000(500MB). Default value is 314572800(300MB). - */ + /** Maximum number of bytes for each blob written to storage. Value should be between 10485760(10MB) and 524288000(500MB). Default value is 314572800(300MB). */ maxChunkSizeInBytes?: number; - /** - * Encoding that is used to serialize messages to blobs. Supported values are 'avro', - * 'avrodeflate', and 'JSON'. Default value is 'avro'. Possible values include: 'Avro', - * 'AvroDeflate', 'JSON' - */ - encoding?: Encoding; -} - -/** - * The properties related to the custom endpoints to which your IoT hub routes messages based on - * the routing rules. A maximum of 10 custom endpoints are allowed across all endpoint types for - * paid hubs and only 1 custom endpoint is allowed across all endpoint types for free hubs. - */ -export interface RoutingEndpoints { - /** - * The list of Service Bus queue endpoints that IoT hub routes the messages to, based on the - * routing rules. - */ - serviceBusQueues?: RoutingServiceBusQueueEndpointProperties[]; - /** - * The list of Service Bus topic endpoints that the IoT hub routes the messages to, based on the - * routing rules. - */ - serviceBusTopics?: RoutingServiceBusTopicEndpointProperties[]; - /** - * The list of Event Hubs endpoints that IoT hub routes messages to, based on the routing rules. - * This list does not include the built-in Event Hubs endpoint. - */ - eventHubs?: RoutingEventHubProperties[]; - /** - * The list of storage container endpoints that IoT hub routes messages to, based on the routing - * rules. - */ - storageContainers?: RoutingStorageContainerProperties[]; + /** Encoding that is used to serialize messages to blobs. Supported values are 'avro', 'avrodeflate', and 'JSON'. Default value is 'avro'. */ + encoding?: RoutingStorageContainerPropertiesEncoding; } -/** - * The properties of a routing rule that your IoT hub uses to route messages to endpoints. - */ +/** The properties of a routing rule that your IoT hub uses to route messages to endpoints. */ export interface RouteProperties { - /** - * The name of the route. The name can only include alphanumeric characters, periods, - * underscores, hyphens, has a maximum length of 64 characters, and must be unique. - */ + /** The name of the route. The name can only include alphanumeric characters, periods, underscores, hyphens, has a maximum length of 64 characters, and must be unique. */ name: string; - /** - * The source that the routing rule is to be applied to, such as DeviceMessages. Possible values - * include: 'Invalid', 'DeviceMessages', 'TwinChangeEvents', 'DeviceLifecycleEvents', - * 'DeviceJobLifecycleEvents', 'DeviceConnectionStateEvents' - */ + /** The source that the routing rule is to be applied to, such as DeviceMessages. */ source: RoutingSource; - /** - * The condition that is evaluated to apply the routing rule. If no condition is provided, it - * evaluates to true by default. For grammar, see: - * https://docs.microsoft.com/azure/iot-hub/iot-hub-devguide-query-language - */ + /** The condition that is evaluated to apply the routing rule. If no condition is provided, it evaluates to true by default. For grammar, see: https://docs.microsoft.com/azure/iot-hub/iot-hub-devguide-query-language */ condition?: string; - /** - * The list of endpoints to which messages that satisfy the condition are routed. Currently only - * one endpoint is allowed. - */ + /** The list of endpoints to which messages that satisfy the condition are routed. Currently only one endpoint is allowed. */ endpointNames: string[]; - /** - * Used to specify whether a route is enabled. - */ + /** Used to specify whether a route is enabled. */ isEnabled: boolean; } -/** - * The properties of the fallback route. IoT Hub uses these properties when it routes messages to - * the fallback endpoint. - */ +/** The properties of the fallback route. IoT Hub uses these properties when it routes messages to the fallback endpoint. */ export interface FallbackRouteProperties { - /** - * The name of the route. The name can only include alphanumeric characters, periods, - * underscores, hyphens, has a maximum length of 64 characters, and must be unique. - */ + /** The name of the route. The name can only include alphanumeric characters, periods, underscores, hyphens, has a maximum length of 64 characters, and must be unique. */ name?: string; - /** - * The condition which is evaluated in order to apply the fallback route. If the condition is not - * provided it will evaluate to true by default. For grammar, See: - * https://docs.microsoft.com/azure/iot-hub/iot-hub-devguide-query-language - */ + /** The source to which the routing rule is to be applied to. For example, DeviceMessages */ + source: RoutingSource; + /** The condition which is evaluated in order to apply the fallback route. If the condition is not provided it will evaluate to true by default. For grammar, See: https://docs.microsoft.com/azure/iot-hub/iot-hub-devguide-query-language */ condition?: string; - /** - * The list of endpoints to which the messages that satisfy the condition are routed to. - * Currently only 1 endpoint is allowed. - */ + /** The list of endpoints to which the messages that satisfy the condition are routed to. Currently only 1 endpoint is allowed. */ endpointNames: string[]; - /** - * Used to specify whether the fallback route is enabled. - */ + /** Used to specify whether the fallback route is enabled. */ isEnabled: boolean; } -/** - * The properties of an enrichment that your IoT hub applies to messages delivered to endpoints. - */ +/** The properties of an enrichment that your IoT hub applies to messages delivered to endpoints. */ export interface EnrichmentProperties { - /** - * The key or name for the enrichment property. - */ + /** The key or name for the enrichment property. */ key: string; - /** - * The value for the enrichment property. - */ + /** The value for the enrichment property. */ value: string; - /** - * The list of endpoints for which the enrichment is applied to the message. - */ + /** The list of endpoints for which the enrichment is applied to the message. */ endpointNames: string[]; } -/** - * The routing related properties of the IoT hub. See: - * https://docs.microsoft.com/azure/iot-hub/iot-hub-devguide-messaging - */ -export interface RoutingProperties { - endpoints?: RoutingEndpoints; - /** - * The list of user-provided routing rules that the IoT hub uses to route messages to built-in - * and custom endpoints. A maximum of 100 routing rules are allowed for paid hubs and a maximum - * of 5 routing rules are allowed for free hubs. - */ - routes?: RouteProperties[]; - /** - * The properties of the route that is used as a fall-back route when none of the conditions - * specified in the 'routes' section are met. This is an optional parameter. When this property - * is not set, the messages which do not meet any of the conditions specified in the 'routes' - * section get routed to the built-in eventhub endpoint. - */ - fallbackRoute?: FallbackRouteProperties; - /** - * The list of user-provided enrichments that the IoT hub applies to messages to be delivered to - * built-in and custom endpoints. See: https://aka.ms/telemetryoneventgrid - */ - enrichments?: EnrichmentProperties[]; -} - -/** - * The properties of the Azure Storage endpoint for file upload. - */ +/** The properties of the Azure Storage endpoint for file upload. */ export interface StorageEndpointProperties { - /** - * The period of time for which the SAS URI generated by IoT Hub for file upload is valid. See: - * https://docs.microsoft.com/azure/iot-hub/iot-hub-devguide-file-upload#file-upload-notification-configuration-options. - */ + /** The period of time for which the SAS URI generated by IoT Hub for file upload is valid. See: https://docs.microsoft.com/azure/iot-hub/iot-hub-devguide-file-upload#file-upload-notification-configuration-options. */ sasTtlAsIso8601?: string; - /** - * The connection string for the Azure Storage account to which files are uploaded. - */ + /** The connection string for the Azure Storage account to which files are uploaded. */ connectionString: string; - /** - * The name of the root container where you upload files. The container need not exist but should - * be creatable using the connectionString specified. - */ + /** The name of the root container where you upload files. The container need not exist but should be creatable using the connectionString specified. */ containerName: string; - /** - * Specifies authentication type being used for connecting to the storage account. Possible - * values include: 'keyBased', 'identityBased' - */ + /** Specifies authentication type being used for connecting to the storage account. */ authenticationType?: AuthenticationType; - /** - * Managed identity properties of storage endpoint for file upload. - */ + /** Managed identity properties of storage endpoint for file upload. */ identity?: ManagedIdentity; } -/** - * The properties of the messaging endpoints used by this IoT hub. - */ +/** The properties of the messaging endpoints used by this IoT hub. */ export interface MessagingEndpointProperties { - /** - * The lock duration. See: https://docs.microsoft.com/azure/iot-hub/iot-hub-devguide-file-upload. - */ + /** The lock duration. See: https://docs.microsoft.com/azure/iot-hub/iot-hub-devguide-file-upload. */ lockDurationAsIso8601?: string; - /** - * The period of time for which a message is available to consume before it is expired by the IoT - * hub. See: https://docs.microsoft.com/azure/iot-hub/iot-hub-devguide-file-upload. - */ + /** The period of time for which a message is available to consume before it is expired by the IoT hub. See: https://docs.microsoft.com/azure/iot-hub/iot-hub-devguide-file-upload. */ ttlAsIso8601?: string; - /** - * The number of times the IoT hub attempts to deliver a message. See: - * https://docs.microsoft.com/azure/iot-hub/iot-hub-devguide-file-upload. - */ + /** The number of times the IoT hub attempts to deliver a message. See: https://docs.microsoft.com/azure/iot-hub/iot-hub-devguide-file-upload. */ maxDeliveryCount?: number; } -/** - * The properties of the feedback queue for cloud-to-device messages. - */ +/** The IoT hub cloud-to-device messaging properties. */ +export interface CloudToDeviceProperties { + /** The max delivery count for cloud-to-device messages in the device queue. See: https://docs.microsoft.com/azure/iot-hub/iot-hub-devguide-messaging#cloud-to-device-messages. */ + maxDeliveryCount?: number; + /** The default time to live for cloud-to-device messages in the device queue. See: https://docs.microsoft.com/azure/iot-hub/iot-hub-devguide-messaging#cloud-to-device-messages. */ + defaultTtlAsIso8601?: string; + /** The properties of the feedback queue for cloud-to-device messages. */ + feedback?: FeedbackProperties; +} + +/** The properties of the feedback queue for cloud-to-device messages. */ export interface FeedbackProperties { - /** - * The lock duration for the feedback queue. See: - * https://docs.microsoft.com/azure/iot-hub/iot-hub-devguide-messaging#cloud-to-device-messages. - */ + /** The lock duration for the feedback queue. See: https://docs.microsoft.com/azure/iot-hub/iot-hub-devguide-messaging#cloud-to-device-messages. */ lockDurationAsIso8601?: string; - /** - * The period of time for which a message is available to consume before it is expired by the IoT - * hub. See: - * https://docs.microsoft.com/azure/iot-hub/iot-hub-devguide-messaging#cloud-to-device-messages. - */ + /** The period of time for which a message is available to consume before it is expired by the IoT hub. See: https://docs.microsoft.com/azure/iot-hub/iot-hub-devguide-messaging#cloud-to-device-messages. */ ttlAsIso8601?: string; - /** - * The number of times the IoT hub attempts to deliver a message on the feedback queue. See: - * https://docs.microsoft.com/azure/iot-hub/iot-hub-devguide-messaging#cloud-to-device-messages. - */ + /** The number of times the IoT hub attempts to deliver a message on the feedback queue. See: https://docs.microsoft.com/azure/iot-hub/iot-hub-devguide-messaging#cloud-to-device-messages. */ maxDeliveryCount?: number; } -/** - * The IoT hub cloud-to-device messaging properties. - */ -export interface CloudToDeviceProperties { - /** - * The max delivery count for cloud-to-device messages in the device queue. See: - * https://docs.microsoft.com/azure/iot-hub/iot-hub-devguide-messaging#cloud-to-device-messages. - */ - maxDeliveryCount?: number; +/** Public representation of one of the locations where a resource is provisioned. */ +export interface IotHubLocationDescription { + /** The name of the Azure region */ + location?: string; + /** The role of the region, can be either primary or secondary. The primary region is where the IoT hub is currently provisioned. The secondary region is the Azure disaster recovery (DR) paired region and also the region where the IoT hub can failover to. */ + role?: IotHubReplicaRoleType; +} + +/** Information about the SKU of the IoT hub. */ +export interface IotHubSkuInfo { + /** The name of the SKU. */ + name: IotHubSku; /** - * The default time to live for cloud-to-device messages in the device queue. See: - * https://docs.microsoft.com/azure/iot-hub/iot-hub-devguide-messaging#cloud-to-device-messages. + * The billing tier for the IoT hub. + * NOTE: This property will not be serialized. It can only be populated by the server. */ - defaultTtlAsIso8601?: string; - feedback?: FeedbackProperties; + readonly tier?: IotHubSkuTier; + /** The number of provisioned IoT Hub units. See: https://docs.microsoft.com/azure/azure-subscription-service-limits#iot-hub-limits. */ + capacity?: number; } -/** - * Public representation of one of the locations where a resource is provisioned. - */ -export interface IotHubLocationDescription { +export interface ArmIdentity { /** - * The name of the Azure region + * Principal Id + * NOTE: This property will not be serialized. It can only be populated by the server. */ - location?: string; + readonly principalId?: string; /** - * The role of the region, can be either primary or secondary. The primary region is where the - * IoT hub is currently provisioned. The secondary region is the Azure disaster recovery (DR) - * paired region and also the region where the IoT hub can failover to. Possible values include: - * 'primary', 'secondary' + * Tenant Id + * NOTE: This property will not be serialized. It can only be populated by the server. */ - role?: IotHubReplicaRoleType; + readonly tenantId?: string; + /** The type of identity used for the resource. The type 'SystemAssigned, UserAssigned' includes both an implicitly created identity and a set of user assigned identities. The type 'None' will remove any identities from the service. */ + type?: ResourceIdentityType; + /** Dictionary of */ + userAssignedIdentities?: { [propertyName: string]: ArmUserIdentity }; } -/** - * The properties of an IoT hub. - */ -export interface IotHubProperties { +export interface ArmUserIdentity { + /** NOTE: This property will not be serialized. It can only be populated by the server. */ + readonly principalId?: string; + /** NOTE: This property will not be serialized. It can only be populated by the server. */ + readonly clientId?: string; +} + +/** The common properties of an Azure resource. */ +export interface Resource { /** - * The shared access policies you can use to secure a connection to the IoT hub. + * The resource identifier. + * NOTE: This property will not be serialized. It can only be populated by the server. */ - authorizationPolicies?: SharedAccessSignatureAuthorizationRule[]; + readonly id?: string; /** - * Whether requests from Public Network are allowed. Possible values include: 'Enabled', - * 'Disabled' + * The resource name. + * NOTE: This property will not be serialized. It can only be populated by the server. */ - publicNetworkAccess?: PublicNetworkAccess; + readonly name?: string; /** - * The IP filter rules. + * The resource type. + * NOTE: This property will not be serialized. It can only be populated by the server. */ - ipFilterRules?: IpFilterRule[]; - networkRuleSets?: NetworkRuleSetProperties; + readonly type?: string; + /** The resource location. */ + location: string; + /** The resource tags. */ + tags?: { [propertyName: string]: string }; +} + +/** A container holding only the Tags for a resource, allowing the user to update the tags on an IoT Hub instance. */ +export interface TagsResource { + /** Resource tags */ + tags?: { [propertyName: string]: string }; +} + +/** The JSON-serialized array of IotHubDescription objects with a next link. */ +export interface IotHubDescriptionListResult { + /** The array of IotHubDescription objects. */ + value?: IotHubDescription[]; /** - * Specifies the minimum TLS version to support for this hub. Can be set to "1.2" to have clients - * that use a TLS version below 1.2 to be rejected. + * The next link. + * NOTE: This property will not be serialized. It can only be populated by the server. */ - minTlsVersion?: string; + readonly nextLink?: string; +} + +/** Identity registry statistics. */ +export interface RegistryStatistics { /** - * Private endpoint connections created on this IotHub + * The total count of devices in the identity registry. + * NOTE: This property will not be serialized. It can only be populated by the server. */ - privateEndpointConnections?: PrivateEndpointConnection[]; + readonly totalDeviceCount?: number; /** - * The provisioning state. - * **NOTE: This property will not be serialized. It can only be populated by the server.** + * The count of enabled devices in the identity registry. + * NOTE: This property will not be serialized. It can only be populated by the server. */ - readonly provisioningState?: string; + readonly enabledDeviceCount?: number; /** - * The hub state. - * **NOTE: This property will not be serialized. It can only be populated by the server.** - */ - readonly state?: string; - /** - * The name of the host. - * **NOTE: This property will not be serialized. It can only be populated by the server.** - */ - readonly hostName?: string; - /** - * The Event Hub-compatible endpoint properties. The only possible keys to this dictionary is - * events. This key has to be present in the dictionary while making create or update calls for - * the IoT hub. - */ - eventHubEndpoints?: { [propertyName: string]: EventHubProperties }; - routing?: RoutingProperties; - /** - * The list of Azure Storage endpoints where you can upload files. Currently you can configure - * only one Azure Storage account and that MUST have its key as $default. Specifying more than - * one storage account causes an error to be thrown. Not specifying a value for this property - * when the enableFileUploadNotifications property is set to True, causes an error to be thrown. - */ - storageEndpoints?: { [propertyName: string]: StorageEndpointProperties }; - /** - * The messaging endpoint properties for the file upload notification queue. - */ - messagingEndpoints?: { [propertyName: string]: MessagingEndpointProperties }; - /** - * If True, file upload notifications are enabled. - */ - enableFileUploadNotifications?: boolean; - cloudToDevice?: CloudToDeviceProperties; - /** - * IoT hub comments. - */ - comments?: string; - /** - * The capabilities and features enabled for the IoT hub. Possible values include: 'None', - * 'DeviceManagement' - */ - features?: Capabilities; - /** - * Primary and secondary location for iot hub - * **NOTE: This property will not be serialized. It can only be populated by the server.** + * The count of disabled devices in the identity registry. + * NOTE: This property will not be serialized. It can only be populated by the server. */ - readonly locations?: IotHubLocationDescription[]; + readonly disabledDeviceCount?: number; } -/** - * Information about the SKU of the IoT hub. - */ -export interface IotHubSkuInfo { - /** - * The name of the SKU. Possible values include: 'F1', 'S1', 'S2', 'S3', 'B1', 'B2', 'B3' - */ - name: IotHubSku; - /** - * The billing tier for the IoT hub. Possible values include: 'Free', 'Standard', 'Basic' - * **NOTE: This property will not be serialized. It can only be populated by the server.** - */ - readonly tier?: IotHubSkuTier; +/** The JSON-serialized array of IotHubSkuDescription objects with a next link. */ +export interface IotHubSkuDescriptionListResult { + /** The array of IotHubSkuDescription. */ + value?: IotHubSkuDescription[]; /** - * The number of provisioned IoT Hub units. See: - * https://docs.microsoft.com/azure/azure-subscription-service-limits#iot-hub-limits. + * The next link. + * NOTE: This property will not be serialized. It can only be populated by the server. */ - capacity?: number; + readonly nextLink?: string; } -/** - * The properties for a group information object - */ -export interface GroupIdInformationProperties { - /** - * The group id - */ - groupId?: string; - /** - * The required members for a specific group id - */ - requiredMembers?: string[]; +/** SKU properties. */ +export interface IotHubSkuDescription { /** - * The required DNS zones for a specific group id + * The type of the resource. + * NOTE: This property will not be serialized. It can only be populated by the server. */ - requiredZoneNames?: string[]; + readonly resourceType?: string; + /** The type of the resource. */ + sku: IotHubSkuInfo; + /** IotHub capacity */ + capacity: IotHubCapacity; } -/** - * The group information for creating a private endpoint on an IotHub - */ -export interface GroupIdInformation { - /** - * The resource identifier. - * **NOTE: This property will not be serialized. It can only be populated by the server.** - */ - readonly id?: string; - /** - * The resource name. - * **NOTE: This property will not be serialized. It can only be populated by the server.** - */ - readonly name?: string; +/** IoT Hub capacity information. */ +export interface IotHubCapacity { /** - * The resource type. - * **NOTE: This property will not be serialized. It can only be populated by the server.** + * The minimum number of units. + * NOTE: This property will not be serialized. It can only be populated by the server. */ - readonly type?: string; - properties: GroupIdInformationProperties; -} - -/** - * The available private link resources for an IotHub - */ -export interface PrivateLinkResources { + readonly minimum?: number; /** - * The list of available private link resources for an IotHub + * The maximum number of units. + * NOTE: This property will not be serialized. It can only be populated by the server. */ - value?: GroupIdInformation[]; -} - -/** - * An interface representing ArmUserIdentity. - */ -export interface ArmUserIdentity { + readonly maximum?: number; /** - * **NOTE: This property will not be serialized. It can only be populated by the server.** + * The default number of units. + * NOTE: This property will not be serialized. It can only be populated by the server. */ - readonly principalId?: string; + readonly default?: number; /** - * **NOTE: This property will not be serialized. It can only be populated by the server.** + * The type of the scaling enabled. + * NOTE: This property will not be serialized. It can only be populated by the server. */ - readonly clientId?: string; + readonly scaleType?: IotHubScaleType; } -/** - * An interface representing ArmIdentity. - */ -export interface ArmIdentity { +/** The JSON-serialized array of Event Hub-compatible consumer group names with a next link. */ +export interface EventHubConsumerGroupsListResult { + /** List of consumer groups objects */ + value?: EventHubConsumerGroupInfo[]; /** - * Principal Id - * **NOTE: This property will not be serialized. It can only be populated by the server.** - */ - readonly principalId?: string; - /** - * Tenant Id - * **NOTE: This property will not be serialized. It can only be populated by the server.** - */ - readonly tenantId?: string; - /** - * The type of identity used for the resource. The type 'SystemAssigned, UserAssigned' includes - * both an implicitly created identity and a set of user assigned identities. The type 'None' - * will remove any identities from the service. Possible values include: 'SystemAssigned', - * 'UserAssigned', 'SystemAssigned, UserAssigned', 'None' + * The next link. + * NOTE: This property will not be serialized. It can only be populated by the server. */ - type?: ResourceIdentityType; - userAssignedIdentities?: { [propertyName: string]: ArmUserIdentity }; + readonly nextLink?: string; } -/** - * The common properties of an Azure resource. - */ -export interface Resource extends BaseResource { +/** The properties of the EventHubConsumerGroupInfo object. */ +export interface EventHubConsumerGroupInfo { + /** The tags. */ + properties?: { [propertyName: string]: any }; /** - * The resource identifier. - * **NOTE: This property will not be serialized. It can only be populated by the server.** + * The Event Hub-compatible consumer group identifier. + * NOTE: This property will not be serialized. It can only be populated by the server. */ readonly id?: string; /** - * The resource name. - * **NOTE: This property will not be serialized. It can only be populated by the server.** + * The Event Hub-compatible consumer group name. + * NOTE: This property will not be serialized. It can only be populated by the server. */ readonly name?: string; /** - * The resource type. - * **NOTE: This property will not be serialized. It can only be populated by the server.** + * the resource type. + * NOTE: This property will not be serialized. It can only be populated by the server. */ readonly type?: string; /** - * The resource location. - */ - location: string; - /** - * The resource tags. + * The etag. + * NOTE: This property will not be serialized. It can only be populated by the server. */ - tags?: { [propertyName: string]: string }; + readonly etag?: string; } -/** - * The description of the IoT hub. - */ -export interface IotHubDescription extends Resource { - /** - * The Etag field is *not* required. If it is provided in the response body, it must also be - * provided as a header per the normal ETag convention. - */ - etag?: string; - /** - * IotHub properties - */ - properties?: IotHubProperties; - /** - * IotHub SKU info - */ - sku: IotHubSkuInfo; - /** - * The managed identities for the IotHub. - */ - identity?: ArmIdentity; +/** The EventHub consumer group. */ +export interface EventHubConsumerGroupBodyDescription { + /** The EventHub consumer group name. */ + properties: EventHubConsumerGroupName; } -/** - * The object that represents the operation. - */ -export interface OperationDisplay { +/** The EventHub consumer group name. */ +export interface EventHubConsumerGroupName { + /** EventHub consumer group name */ + name: string; +} + +/** The JSON-serialized array of JobResponse objects with a next link. */ +export interface JobResponseListResult { + /** The array of JobResponse objects. */ + value?: JobResponse[]; /** - * Service provider: Microsoft Devices - * **NOTE: This property will not be serialized. It can only be populated by the server.** + * The next link. + * NOTE: This property will not be serialized. It can only be populated by the server. */ - readonly provider?: string; + readonly nextLink?: string; +} + +/** The properties of the Job Response object. */ +export interface JobResponse { /** - * Resource Type: IotHubs - * **NOTE: This property will not be serialized. It can only be populated by the server.** + * The job identifier. + * NOTE: This property will not be serialized. It can only be populated by the server. */ - readonly resource?: string; + readonly jobId?: string; /** - * Name of the operation - * **NOTE: This property will not be serialized. It can only be populated by the server.** + * The start time of the job. + * NOTE: This property will not be serialized. It can only be populated by the server. */ - readonly operation?: string; + readonly startTimeUtc?: Date; /** - * Description of the operation - * **NOTE: This property will not be serialized. It can only be populated by the server.** + * The time the job stopped processing. + * NOTE: This property will not be serialized. It can only be populated by the server. */ - readonly description?: string; -} - -/** - * IoT Hub REST API operation - */ -export interface Operation { + readonly endTimeUtc?: Date; /** - * Operation name: {provider}/{resource}/{read | write | action | delete} - * **NOTE: This property will not be serialized. It can only be populated by the server.** + * The type of the job. + * NOTE: This property will not be serialized. It can only be populated by the server. */ - readonly name?: string; + readonly type?: JobType; /** - * The object that represents the operation. + * The status of the job. + * NOTE: This property will not be serialized. It can only be populated by the server. */ - display?: OperationDisplay; -} - -/** - * Error details. - */ -export interface ErrorDetails { + readonly status?: JobStatus; /** - * The error code. - * **NOTE: This property will not be serialized. It can only be populated by the server.** + * If status == failed, this string containing the reason for the failure. + * NOTE: This property will not be serialized. It can only be populated by the server. */ - readonly code?: string; + readonly failureReason?: string; /** - * The HTTP status code. - * **NOTE: This property will not be serialized. It can only be populated by the server.** + * The status message for the job. + * NOTE: This property will not be serialized. It can only be populated by the server. */ - readonly httpStatusCode?: string; + readonly statusMessage?: string; /** - * The error message. - * **NOTE: This property will not be serialized. It can only be populated by the server.** + * The job identifier of the parent job, if any. + * NOTE: This property will not be serialized. It can only be populated by the server. */ - readonly message?: string; + readonly parentJobId?: string; +} + +/** The JSON-serialized array of IotHubQuotaMetricInfo objects with a next link. */ +export interface IotHubQuotaMetricInfoListResult { + /** The array of quota metrics objects. */ + value?: IotHubQuotaMetricInfo[]; /** - * The error details. - * **NOTE: This property will not be serialized. It can only be populated by the server.** + * The next link. + * NOTE: This property will not be serialized. It can only be populated by the server. */ - readonly details?: string; + readonly nextLink?: string; } -/** - * Quota metrics properties. - */ +/** Quota metrics properties. */ export interface IotHubQuotaMetricInfo { /** * The name of the quota metric. - * **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 name?: string; /** * The current value for the quota metric. - * **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 currentValue?: number; /** * The maximum value of the quota metric. - * **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 maxValue?: number; } -/** - * The health data for an endpoint - */ -export interface EndpointHealthData { +/** The JSON-serialized array of EndpointHealthData objects with a next link. */ +export interface EndpointHealthDataListResult { + /** JSON-serialized array of Endpoint health data */ + value?: EndpointHealthData[]; /** - * Id of the endpoint + * Link to more results + * NOTE: This property will not be serialized. It can only be populated by the server. */ + readonly nextLink?: string; +} + +/** The health data for an endpoint */ +export interface EndpointHealthData { + /** Id of the endpoint */ endpointId?: string; - /** - * Health statuses have following meanings. The 'healthy' status shows that the endpoint is - * accepting messages as expected. The 'unhealthy' status shows that the endpoint is not - * accepting messages as expected and IoT Hub is retrying to send data to this endpoint. The - * status of an unhealthy endpoint will be updated to healthy when IoT Hub has established an - * eventually consistent state of health. The 'dead' status shows that the endpoint is not - * accepting messages, after IoT Hub retried sending messages for the retrial period. See IoT Hub - * metrics to identify errors and monitor issues with endpoints. The 'unknown' status shows that - * the IoT Hub has not established a connection with the endpoint. No messages have been - * delivered to or rejected from this endpoint. Possible values include: 'unknown', 'healthy', - * 'degraded', 'unhealthy', 'dead' - */ + /** Health statuses have following meanings. The 'healthy' status shows that the endpoint is accepting messages as expected. The 'unhealthy' status shows that the endpoint is not accepting messages as expected and IoT Hub is retrying to send data to this endpoint. The status of an unhealthy endpoint will be updated to healthy when IoT Hub has established an eventually consistent state of health. The 'dead' status shows that the endpoint is not accepting messages, after IoT Hub retried sending messages for the retrial period. See IoT Hub metrics to identify errors and monitor issues with endpoints. The 'unknown' status shows that the IoT Hub has not established a connection with the endpoint. No messages have been delivered to or rejected from this endpoint */ healthStatus?: EndpointHealthStatus; - /** - * Last error obtained when a message failed to be delivered to iot hub - */ + /** Last error obtained when a message failed to be delivered to iot hub */ lastKnownError?: string; - /** - * Time at which the last known error occurred - */ + /** Time at which the last known error occurred */ lastKnownErrorTime?: Date; - /** - * Last time iot hub successfully sent a message to the endpoint - */ + /** Last time iot hub successfully sent a message to the endpoint */ lastSuccessfulSendAttemptTime?: Date; - /** - * Last time iot hub tried to send a message to the endpoint - */ + /** Last time iot hub tried to send a message to the endpoint */ lastSendAttemptTime?: Date; } -/** - * Identity registry statistics. - */ -export interface RegistryStatistics { - /** - * The total count of devices in the identity registry. - * **NOTE: This property will not be serialized. It can only be populated by the server.** - */ - readonly totalDeviceCount?: number; - /** - * The count of enabled devices in the identity registry. - * **NOTE: This property will not be serialized. It can only be populated by the server.** - */ - readonly enabledDeviceCount?: number; - /** - * The count of disabled devices in the identity registry. - * **NOTE: This property will not be serialized. It can only be populated by the server.** - */ - readonly disabledDeviceCount?: number; +/** Input values. */ +export interface OperationInputs { + /** The name of the IoT hub to check. */ + name: string; } -/** - * The properties of the Job Response object. - */ -export interface JobResponse { - /** - * The job identifier. - * **NOTE: This property will not be serialized. It can only be populated by the server.** - */ - readonly jobId?: string; - /** - * The start time of the job. - * **NOTE: This property will not be serialized. It can only be populated by the server.** - */ - readonly startTimeUtc?: Date; - /** - * The time the job stopped processing. - * **NOTE: This property will not be serialized. It can only be populated by the server.** - */ - readonly endTimeUtc?: Date; +/** The properties indicating whether a given IoT hub name is available. */ +export interface IotHubNameAvailabilityInfo { /** - * The type of the job. Possible values include: 'unknown', 'export', 'import', 'backup', - * 'readDeviceProperties', 'writeDeviceProperties', 'updateDeviceConfiguration', 'rebootDevice', - * 'factoryResetDevice', 'firmwareUpdate' - * **NOTE: This property will not be serialized. It can only be populated by the server.** + * The value which indicates whether the provided name is available. + * NOTE: This property will not be serialized. It can only be populated by the server. */ - readonly type?: JobType; + readonly nameAvailable?: boolean; /** - * The status of the job. Possible values include: 'unknown', 'enqueued', 'running', 'completed', - * 'failed', 'cancelled' - * **NOTE: This property will not be serialized. It can only be populated by the server.** + * The reason for unavailability. + * NOTE: This property will not be serialized. It can only be populated by the server. */ - readonly status?: JobStatus; - /** - * If status == failed, this string containing the reason for the failure. - * **NOTE: This property will not be serialized. It can only be populated by the server.** - */ - readonly failureReason?: string; - /** - * The status message for the job. - * **NOTE: This property will not be serialized. It can only be populated by the server.** - */ - readonly statusMessage?: string; + readonly reason?: IotHubNameUnavailabilityReason; + /** The detailed reason message. */ + message?: string; +} + +/** Json-serialized array of User subscription quota response */ +export interface UserSubscriptionQuotaListResult { + value?: UserSubscriptionQuota[]; + /** NOTE: This property will not be serialized. It can only be populated by the server. */ + readonly nextLink?: string; +} + +/** User subscription quota response */ +export interface UserSubscriptionQuota { + /** IotHub type id */ + id?: string; + /** Response type */ + type?: string; + /** Unit of IotHub type */ + unit?: string; + /** Current number of IotHub type */ + currentValue?: number; + /** Numerical limit on IotHub type */ + limit?: number; + /** IotHub type */ + name?: Name; +} + +/** Name of Iot Hub type */ +export interface Name { + /** IotHub type */ + value?: string; + /** Localized value of name */ + localizedValue?: string; +} + +/** Input for testing all routes */ +export interface TestAllRoutesInput { + /** Routing source */ + routingSource?: RoutingSource; + /** Routing message */ + message?: RoutingMessage; + /** Routing Twin Reference */ + twin?: RoutingTwin; +} + +/** Routing message */ +export interface RoutingMessage { + /** Body of routing message */ + body?: string; + /** App properties */ + appProperties?: { [propertyName: string]: string }; + /** System properties */ + systemProperties?: { [propertyName: string]: string }; +} + +/** Twin reference input parameter. This is an optional parameter */ +export interface RoutingTwin { + /** Twin Tags */ + tags?: Record; + properties?: RoutingTwinProperties; +} + +export interface RoutingTwinProperties { + /** Twin desired properties */ + desired?: Record; + /** Twin desired properties */ + reported?: Record; +} + +/** Result of testing all routes */ +export interface TestAllRoutesResult { + /** JSON-serialized array of matched routes */ + routes?: MatchedRoute[]; +} + +/** Routes that matched */ +export interface MatchedRoute { + /** Properties of routes that matched */ + properties?: RouteProperties; +} + +/** Input for testing route */ +export interface TestRouteInput { + /** Routing message */ + message?: RoutingMessage; + /** Route properties */ + route: RouteProperties; + /** Routing Twin Reference */ + twin?: RoutingTwin; +} + +/** Result of testing one route */ +export interface TestRouteResult { + /** Result of testing route */ + result?: TestResultStatus; + /** Detailed result of testing route */ + details?: TestRouteResultDetails; +} + +/** Detailed result of testing a route */ +export interface TestRouteResultDetails { + /** JSON-serialized list of route compilation errors */ + compilationErrors?: RouteCompilationError[]; +} + +/** Compilation error when evaluating route */ +export interface RouteCompilationError { + /** Route error message */ + message?: string; + /** Severity of the route error */ + severity?: RouteErrorSeverity; + /** Location where the route error happened */ + location?: RouteErrorRange; +} + +/** Range of route errors */ +export interface RouteErrorRange { + /** Start where the route error happened */ + start?: RouteErrorPosition; + /** End where the route error happened */ + end?: RouteErrorPosition; +} + +/** Position where the route error happened */ +export interface RouteErrorPosition { + /** Line where the route error happened */ + line?: number; + /** Column where the route error happened */ + column?: number; +} + +/** The list of shared access policies with a next link. */ +export interface SharedAccessSignatureAuthorizationRuleListResult { + /** The list of shared access policies. */ + value?: SharedAccessSignatureAuthorizationRule[]; /** - * The job identifier of the parent job, if any. - * **NOTE: This property will not be serialized. It can only be populated by the server.** + * The next link. + * NOTE: This property will not be serialized. It can only be populated by the server. */ - readonly parentJobId?: string; + readonly nextLink?: string; } -/** - * IoT Hub capacity information. - */ -export interface IotHubCapacity { +/** Use to provide parameters when requesting an export of all devices in the IoT hub. */ +export interface ExportDevicesRequest { + /** The export blob container URI. */ + exportBlobContainerUri: string; + /** The value indicating whether keys should be excluded during export. */ + excludeKeys: boolean; + /** The name of the blob that will be created in the provided output blob container. This blob will contain the exported device registry information for the IoT Hub. */ + exportBlobName?: string; + /** Specifies authentication type being used for connecting to the storage account. */ + authenticationType?: AuthenticationType; + /** Managed identity properties of storage endpoint for export devices. */ + identity?: ManagedIdentity; + /** The value indicating whether configurations should be exported. */ + includeConfigurations?: boolean; + /** The name of the blob that will be created in the provided output blob container. This blob will contain the exported configurations for the Iot Hub. */ + configurationsBlobName?: string; +} + +/** Use to provide parameters when requesting an import of all devices in the hub. */ +export interface ImportDevicesRequest { + /** The input blob container URI. */ + inputBlobContainerUri: string; + /** The output blob container URI. */ + outputBlobContainerUri: string; + /** The blob name to be used when importing from the provided input blob container. */ + inputBlobName?: string; + /** The blob name to use for storing the status of the import job. */ + outputBlobName?: string; + /** Specifies authentication type being used for connecting to the storage account. */ + authenticationType?: AuthenticationType; + /** Managed identity properties of storage endpoint for import devices. */ + identity?: ManagedIdentity; + /** The value indicating whether configurations should be imported. */ + includeConfigurations?: boolean; + /** The blob name to be used when importing configurations from the provided input blob container. */ + configurationsBlobName?: string; +} + +/** The JSON-serialized array of Certificate objects. */ +export interface CertificateListDescription { + /** The array of Certificate objects. */ + value?: CertificateDescription[]; +} + +/** The X509 Certificate. */ +export interface CertificateDescription { + /** The description of an X509 CA Certificate. */ + properties?: CertificateProperties; /** - * The minimum number of units. - * **NOTE: This property will not be serialized. It can only be populated by the server.** + * The resource identifier. + * NOTE: This property will not be serialized. It can only be populated by the server. */ - readonly minimum?: number; + readonly id?: string; /** - * The maximum number of units. - * **NOTE: This property will not be serialized. It can only be populated by the server.** + * The name of the certificate. + * NOTE: This property will not be serialized. It can only be populated by the server. */ - readonly maximum?: number; + readonly name?: string; /** - * The default number of units. - * **NOTE: This property will not be serialized. It can only be populated by the server.** + * The entity tag. + * NOTE: This property will not be serialized. It can only be populated by the server. */ - readonly default?: number; + readonly etag?: string; /** - * The type of the scaling enabled. Possible values include: 'Automatic', 'Manual', 'None' - * **NOTE: This property will not be serialized. It can only be populated by the server.** + * The resource type. + * NOTE: This property will not be serialized. It can only be populated by the server. */ - readonly scaleType?: IotHubScaleType; + readonly type?: string; } -/** - * SKU properties. - */ -export interface IotHubSkuDescription { +/** The description of an X509 CA Certificate. */ +export interface CertificateProperties { /** - * The type of the resource. - * **NOTE: This property will not be serialized. It can only be populated by the server.** + * The certificate's subject name. + * NOTE: This property will not be serialized. It can only be populated by the server. */ - readonly resourceType?: string; + readonly subject?: string; /** - * The type of the resource. + * The certificate's expiration date and time. + * NOTE: This property will not be serialized. It can only be populated by the server. */ - sku: IotHubSkuInfo; + readonly expiry?: Date; /** - * IotHub capacity + * The certificate's thumbprint. + * NOTE: This property will not be serialized. It can only be populated by the server. */ - capacity: IotHubCapacity; -} - -/** - * A container holding only the Tags for a resource, allowing the user to update the tags on an IoT - * Hub instance. - */ -export interface TagsResource { + readonly thumbprint?: string; + /** Determines whether certificate has been verified. */ + isVerified?: boolean; /** - * Resource tags + * The certificate's create date and time. + * NOTE: This property will not be serialized. It can only be populated by the server. */ - tags?: { [propertyName: string]: string }; -} - -/** - * The properties of the EventHubConsumerGroupInfo object. - */ -export interface EventHubConsumerGroupInfo extends BaseResource { + readonly created?: Date; /** - * The tags. + * The certificate's last update date and time. + * NOTE: This property will not be serialized. It can only be populated by the server. */ - properties?: { [propertyName: string]: any }; + readonly updated?: Date; + /** The certificate content */ + certificate?: string; +} + +/** The X509 Certificate. */ +export interface CertificateWithNonceDescription { + /** The description of an X509 CA Certificate including the challenge nonce issued for the Proof-Of-Possession flow. */ + properties?: CertificatePropertiesWithNonce; /** - * The Event Hub-compatible consumer group identifier. - * **NOTE: This property will not be serialized. It can only be populated by the server.** + * The resource identifier. + * NOTE: This property will not be serialized. It can only be populated by the server. */ readonly id?: string; /** - * The Event Hub-compatible consumer group name. - * **NOTE: This property will not be serialized. It can only be populated by the server.** + * The name of the certificate. + * NOTE: This property will not be serialized. It can only be populated by the server. */ readonly name?: string; /** - * the resource type. - * **NOTE: This property will not be serialized. It can only be populated by the server.** + * The entity tag. + * NOTE: This property will not be serialized. It can only be populated by the server. */ - readonly type?: string; + readonly etag?: string; /** - * The etag. - * **NOTE: This property will not be serialized. It can only be populated by the server.** + * The resource type. + * NOTE: This property will not be serialized. It can only be populated by the server. */ - readonly etag?: string; + readonly type?: string; } -/** - * The EventHub consumer group name. - */ -export interface EventHubConsumerGroupName { +/** The description of an X509 CA Certificate including the challenge nonce issued for the Proof-Of-Possession flow. */ +export interface CertificatePropertiesWithNonce { /** - * EventHub consumer group name + * The certificate's subject name. + * NOTE: This property will not be serialized. It can only be populated by the server. */ - name: string; -} - -/** - * The EventHub consumer group. - */ -export interface EventHubConsumerGroupBodyDescription { - properties: EventHubConsumerGroupName; -} - -/** - * Input values. - */ -export interface OperationInputs { + readonly subject?: string; /** - * The name of the IoT hub to check. + * The certificate's expiration date and time. + * NOTE: This property will not be serialized. It can only be populated by the server. */ - name: string; -} - -/** - * The properties indicating whether a given IoT hub name is available. - */ -export interface IotHubNameAvailabilityInfo { + readonly expiry?: Date; /** - * The value which indicates whether the provided name is available. - * **NOTE: This property will not be serialized. It can only be populated by the server.** + * The certificate's thumbprint. + * NOTE: This property will not be serialized. It can only be populated by the server. */ - readonly nameAvailable?: boolean; + readonly thumbprint?: string; /** - * The reason for unavailability. Possible values include: 'Invalid', 'AlreadyExists' - * **NOTE: This property will not be serialized. It can only be populated by the server.** + * Determines whether certificate has been verified. + * NOTE: This property will not be serialized. It can only be populated by the server. */ - readonly reason?: IotHubNameUnavailabilityReason; + readonly isVerified?: boolean; /** - * The detailed reason message. + * The certificate's create date and time. + * NOTE: This property will not be serialized. It can only be populated by the server. */ - message?: string; -} - -/** - * Name of Iot Hub type - */ -export interface Name { + readonly created?: Date; + /** + * The certificate's last update date and time. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly updated?: Date; /** - * IotHub type + * The certificate's verification code that will be used for proof of possession. + * NOTE: This property will not be serialized. It can only be populated by the server. */ - value?: string; + readonly verificationCode?: string; /** - * Localized value of name + * The certificate content + * NOTE: This property will not be serialized. It can only be populated by the server. */ - localizedValue?: string; + readonly certificate?: string; } -/** - * User subscription quota response - */ -export interface UserSubscriptionQuota { +/** The JSON-serialized leaf certificate */ +export interface CertificateVerificationDescription { + /** base-64 representation of X509 certificate .cer file or just .pem file content. */ + certificate?: string; +} + +/** Use to provide failover region when requesting manual Failover for a hub. */ +export interface FailoverInput { + /** Region the hub will be failed over to */ + failoverRegion: string; +} + +/** The available private link resources for an IotHub */ +export interface PrivateLinkResources { + /** The list of available private link resources for an IotHub */ + value?: GroupIdInformation[]; +} + +/** The group information for creating a private endpoint on an IotHub */ +export interface GroupIdInformation { /** - * IotHub type id + * The resource identifier. + * NOTE: This property will not be serialized. It can only be populated by the server. */ - id?: string; + readonly id?: string; /** - * Response type + * The resource name. + * NOTE: This property will not be serialized. It can only be populated by the server. */ - type?: string; + readonly name?: string; /** - * Unit of IotHub type + * The resource type. + * NOTE: This property will not be serialized. It can only be populated by the server. */ - unit?: string; - /** - * Current number of IotHub type - */ - currentValue?: number; - /** - * Numerical limit on IotHub type - */ - limit?: number; - /** - * IotHub type - */ - name?: Name; -} - -/** - * Json-serialized array of User subscription quota response - */ -export interface UserSubscriptionQuotaListResult { - value?: UserSubscriptionQuota[]; - /** - * **NOTE: This property will not be serialized. It can only be populated by the server.** - */ - readonly nextLink?: string; -} - -/** - * Routing message - */ -export interface RoutingMessage { - /** - * Body of routing message - */ - body?: string; - /** - * App properties - */ - appProperties?: { [propertyName: string]: string }; - /** - * System properties - */ - systemProperties?: { [propertyName: string]: string }; -} - -/** - * An interface representing RoutingTwinProperties. - */ -export interface RoutingTwinProperties { - /** - * Twin desired properties - */ - desired?: any; - /** - * Twin desired properties - */ - reported?: any; -} - -/** - * Twin reference input parameter. This is an optional parameter - */ -export interface RoutingTwin { - /** - * Twin Tags - */ - tags?: any; - properties?: RoutingTwinProperties; -} - -/** - * Input for testing all routes - */ -export interface TestAllRoutesInput { - /** - * Routing source. Possible values include: 'Invalid', 'DeviceMessages', 'TwinChangeEvents', - * 'DeviceLifecycleEvents', 'DeviceJobLifecycleEvents', 'DeviceConnectionStateEvents' - */ - routingSource?: RoutingSource; - /** - * Routing message - */ - message?: RoutingMessage; - /** - * Routing Twin Reference - */ - twin?: RoutingTwin; -} - -/** - * Routes that matched - */ -export interface MatchedRoute { - /** - * Properties of routes that matched - */ - properties?: RouteProperties; -} - -/** - * Result of testing all routes - */ -export interface TestAllRoutesResult { - /** - * JSON-serialized array of matched routes - */ - routes?: MatchedRoute[]; -} - -/** - * Input for testing route - */ -export interface TestRouteInput { - /** - * Routing message - */ - message?: RoutingMessage; - /** - * Route properties - */ - route: RouteProperties; - /** - * Routing Twin Reference - */ - twin?: RoutingTwin; -} - -/** - * Position where the route error happened - */ -export interface RouteErrorPosition { - /** - * Line where the route error happened - */ - line?: number; - /** - * Column where the route error happened - */ - column?: number; -} - -/** - * Range of route errors - */ -export interface RouteErrorRange { - /** - * Start where the route error happened - */ - start?: RouteErrorPosition; - /** - * End where the route error happened - */ - end?: RouteErrorPosition; -} - -/** - * Compilation error when evaluating route - */ -export interface RouteCompilationError { - /** - * Route error message - */ - message?: string; - /** - * Severity of the route error. Possible values include: 'error', 'warning' - */ - severity?: RouteErrorSeverity; - /** - * Location where the route error happened - */ - location?: RouteErrorRange; -} - -/** - * Detailed result of testing a route - */ -export interface TestRouteResultDetails { - /** - * JSON-serialized list of route compilation errors - */ - compilationErrors?: RouteCompilationError[]; -} - -/** - * Result of testing one route - */ -export interface TestRouteResult { - /** - * Result of testing route. Possible values include: 'undefined', 'false', 'true' - */ - result?: TestResultStatus; - /** - * Detailed result of testing route - */ - details?: TestRouteResultDetails; -} - -/** - * Use to provide parameters when requesting an export of all devices in the IoT hub. - */ -export interface ExportDevicesRequest { - /** - * The export blob container URI. - */ - exportBlobContainerUri: string; - /** - * The value indicating whether keys should be excluded during export. - */ - excludeKeys: boolean; - /** - * The name of the blob that will be created in the provided output blob container. This blob - * will contain the exported device registry information for the IoT Hub. - */ - exportBlobName?: string; - /** - * Specifies authentication type being used for connecting to the storage account. Possible - * values include: 'keyBased', 'identityBased' - */ - authenticationType?: AuthenticationType; - /** - * Managed identity properties of storage endpoint for export devices. - */ - identity?: ManagedIdentity; - /** - * The value indicating whether configurations should be exported. - */ - includeConfigurations?: boolean; - /** - * The name of the blob that will be created in the provided output blob container. This blob - * will contain the exported configurations for the Iot Hub. - */ - configurationsBlobName?: string; -} - -/** - * Use to provide parameters when requesting an import of all devices in the hub. - */ -export interface ImportDevicesRequest { - /** - * The input blob container URI. - */ - inputBlobContainerUri: string; - /** - * The output blob container URI. - */ - outputBlobContainerUri: string; - /** - * The blob name to be used when importing from the provided input blob container. - */ - inputBlobName?: string; - /** - * The blob name to use for storing the status of the import job. - */ - outputBlobName?: string; - /** - * Specifies authentication type being used for connecting to the storage account. Possible - * values include: 'keyBased', 'identityBased' - */ - authenticationType?: AuthenticationType; - /** - * Managed identity properties of storage endpoint for import devices. - */ - identity?: ManagedIdentity; - /** - * The value indicating whether configurations should be imported. - */ - includeConfigurations?: boolean; - /** - * The blob name to be used when importing configurations from the provided input blob container. - */ - configurationsBlobName?: string; -} - -/** - * Use to provide failover region when requesting manual Failover for a hub. - */ -export interface FailoverInput { - /** - * Region the hub will be failed over to - */ - failoverRegion: string; -} - -/** - * Optional Parameters. - */ -export interface IotHubResourceCreateOrUpdateOptionalParams extends msRest.RequestOptionsBase { - /** - * ETag of the IoT Hub. Do not specify for creating a brand new IoT Hub. Required to update an - * existing IoT Hub. - */ - ifMatch?: string; -} - -/** - * Optional Parameters. - */ -export interface IotHubResourceUpdateOptionalParams extends msRest.RequestOptionsBase { - /** - * Resource tags - */ - tags?: { [propertyName: string]: string }; -} - -/** - * Optional Parameters. - */ -export interface IotHubResourceBeginCreateOrUpdateOptionalParams extends msRest.RequestOptionsBase { - /** - * ETag of the IoT Hub. Do not specify for creating a brand new IoT Hub. Required to update an - * existing IoT Hub. - */ - ifMatch?: string; -} - -/** - * Optional Parameters. - */ -export interface IotHubResourceBeginUpdateOptionalParams extends msRest.RequestOptionsBase { - /** - * Resource tags - */ - tags?: { [propertyName: string]: string }; + readonly type?: string; + /** The properties for a group information object */ + properties: GroupIdInformationProperties; } -/** - * Optional Parameters. - */ -export interface CertificatesCreateOrUpdateOptionalParams extends msRest.RequestOptionsBase { - /** - * ETag of the Certificate. Do not specify for creating a brand new certificate. Required to - * update an existing certificate. - */ - ifMatch?: string; - properties?: CertificateProperties; +/** The properties for a group information object */ +export interface GroupIdInformationProperties { + /** The group id */ + groupId?: string; + /** The required members for a specific group id */ + requiredMembers?: string[]; + /** The required DNS zones for a specific group id */ + requiredZoneNames?: string[]; } -/** - * Optional Parameters. - */ -export interface CertificatesVerifyOptionalParams extends msRest.RequestOptionsBase { - /** - * base-64 representation of X509 certificate .cer file or just .pem file content. - */ +/** The JSON-serialized X509 Certificate. */ +export interface CertificateBodyDescription { + /** base-64 representation of the X509 leaf certificate .cer file or just .pem file content. */ certificate?: string; + /** True indicates that the certificate will be created in verified state and proof of possession will not be required. */ + isVerified?: boolean; } -/** - * An interface representing IotHubClientOptions. - */ -export interface IotHubClientOptions extends AzureServiceClientOptions { - baseUri?: string; -} - -/** - * @interface - * Result of the request to list IoT Hub 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 { - /** - * 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; -} - -/** - * @interface - * The JSON-serialized array of IotHubDescription objects with a next link. - * @extends Array - */ -export interface IotHubDescriptionListResult extends Array { - /** - * The next link. - * **NOTE: This property will not be serialized. It can only be populated by the server.** - */ - readonly nextLink?: string; -} - -/** - * @interface - * The JSON-serialized array of IotHubSkuDescription objects with a next link. - * @extends Array - */ -export interface IotHubSkuDescriptionListResult extends Array { - /** - * The next link. - * **NOTE: This property will not be serialized. It can only be populated by the server.** - */ - readonly nextLink?: string; -} - -/** - * @interface - * The JSON-serialized array of Event Hub-compatible consumer group names with a next link. - * @extends Array - */ -export interface EventHubConsumerGroupsListResult extends Array { - /** - * The next link. - * **NOTE: This property will not be serialized. It can only be populated by the server.** - */ - readonly nextLink?: string; -} - -/** - * @interface - * The JSON-serialized array of JobResponse objects with a next link. - * @extends Array - */ -export interface JobResponseListResult extends Array { - /** - * The next link. - * **NOTE: This property will not be serialized. It can only be populated by the server.** - */ - readonly nextLink?: string; -} - -/** - * @interface - * The JSON-serialized array of IotHubQuotaMetricInfo objects with a next link. - * @extends Array - */ -export interface IotHubQuotaMetricInfoListResult extends Array { - /** - * The next link. - * **NOTE: This property will not be serialized. It can only be populated by the server.** - */ - readonly nextLink?: string; -} - -/** - * @interface - * The JSON-serialized array of EndpointHealthData objects with a next link. - * @extends Array - */ -export interface EndpointHealthDataListResult extends Array { - /** - * Link to more results - * **NOTE: This property will not be serialized. It can only be populated by the server.** - */ - readonly nextLink?: string; -} - -/** - * @interface - * The list of shared access policies with a next link. - * @extends Array - */ -export interface SharedAccessSignatureAuthorizationRuleListResult - extends Array { - /** - * The next link. - * **NOTE: This property will not be serialized. It can only be populated by the server.** - */ - readonly nextLink?: string; -} - -/** - * Defines values for AccessRights. - * Possible values include: 'RegistryRead', 'RegistryWrite', 'ServiceConnect', 'DeviceConnect', - * 'RegistryRead, RegistryWrite', 'RegistryRead, ServiceConnect', 'RegistryRead, DeviceConnect', - * 'RegistryWrite, ServiceConnect', 'RegistryWrite, DeviceConnect', 'ServiceConnect, - * DeviceConnect', 'RegistryRead, RegistryWrite, ServiceConnect', 'RegistryRead, RegistryWrite, - * DeviceConnect', 'RegistryRead, ServiceConnect, DeviceConnect', 'RegistryWrite, ServiceConnect, - * DeviceConnect', 'RegistryRead, RegistryWrite, ServiceConnect, DeviceConnect' - * @readonly - * @enum {string} - */ -export type AccessRights = - | "RegistryRead" - | "RegistryWrite" - | "ServiceConnect" - | "DeviceConnect" - | "RegistryRead, RegistryWrite" - | "RegistryRead, ServiceConnect" - | "RegistryRead, DeviceConnect" - | "RegistryWrite, ServiceConnect" - | "RegistryWrite, DeviceConnect" - | "ServiceConnect, DeviceConnect" - | "RegistryRead, RegistryWrite, ServiceConnect" - | "RegistryRead, RegistryWrite, DeviceConnect" - | "RegistryRead, ServiceConnect, DeviceConnect" - | "RegistryWrite, ServiceConnect, DeviceConnect" - | "RegistryRead, RegistryWrite, ServiceConnect, DeviceConnect"; - -/** - * Defines values for PublicNetworkAccess. - * Possible values include: 'Enabled', 'Disabled' - * @readonly - * @enum {string} - */ -export type PublicNetworkAccess = "Enabled" | "Disabled"; - -/** - * Defines values for IpFilterActionType. - * Possible values include: 'Accept', 'Reject' - * @readonly - * @enum {string} - */ -export type IpFilterActionType = "Accept" | "Reject"; - -/** - * Defines values for DefaultAction. - * Possible values include: 'Deny', 'Allow' - * @readonly - * @enum {string} - */ -export type DefaultAction = "Deny" | "Allow"; - -/** - * Defines values for NetworkRuleIPAction. - * Possible values include: 'Allow' - * @readonly - * @enum {string} - */ -export type NetworkRuleIPAction = "Allow"; - -/** - * Defines values for PrivateLinkServiceConnectionStatus. - * Possible values include: 'Pending', 'Approved', 'Rejected', 'Disconnected' - * @readonly - * @enum {string} - */ -export type PrivateLinkServiceConnectionStatus = - | "Pending" - | "Approved" - | "Rejected" - | "Disconnected"; - -/** - * Defines values for AuthenticationType. - * Possible values include: 'keyBased', 'identityBased' - * @readonly - * @enum {string} - */ -export type AuthenticationType = "keyBased" | "identityBased"; - -/** - * Defines values for RoutingSource. - * Possible values include: 'Invalid', 'DeviceMessages', 'TwinChangeEvents', - * 'DeviceLifecycleEvents', 'DeviceJobLifecycleEvents', 'DeviceConnectionStateEvents' - * @readonly - * @enum {string} - */ -export type RoutingSource = - | "Invalid" - | "DeviceMessages" - | "TwinChangeEvents" - | "DeviceLifecycleEvents" - | "DeviceJobLifecycleEvents" - | "DeviceConnectionStateEvents"; - -/** - * Defines values for Capabilities. - * Possible values include: 'None', 'DeviceManagement' - * @readonly - * @enum {string} - */ -export type Capabilities = "None" | "DeviceManagement"; - -/** - * Defines values for IotHubReplicaRoleType. - * Possible values include: 'primary', 'secondary' - * @readonly - * @enum {string} - */ -export type IotHubReplicaRoleType = "primary" | "secondary"; - -/** - * Defines values for IotHubSku. - * Possible values include: 'F1', 'S1', 'S2', 'S3', 'B1', 'B2', 'B3' - * @readonly - * @enum {string} - */ -export type IotHubSku = "F1" | "S1" | "S2" | "S3" | "B1" | "B2" | "B3"; - -/** - * Defines values for IotHubSkuTier. - * Possible values include: 'Free', 'Standard', 'Basic' - * @readonly - * @enum {string} - */ -export type IotHubSkuTier = "Free" | "Standard" | "Basic"; - -/** - * Defines values for ResourceIdentityType. - * Possible values include: 'SystemAssigned', 'UserAssigned', 'SystemAssigned, UserAssigned', - * 'None' - * @readonly - * @enum {string} - */ -export type ResourceIdentityType = - | "SystemAssigned" - | "UserAssigned" - | "SystemAssigned, UserAssigned" - | "None"; - -/** - * Defines values for EndpointHealthStatus. - * Possible values include: 'unknown', 'healthy', 'degraded', 'unhealthy', 'dead' - * @readonly - * @enum {string} - */ -export type EndpointHealthStatus = "unknown" | "healthy" | "degraded" | "unhealthy" | "dead"; - -/** - * Defines values for JobType. - * Possible values include: 'unknown', 'export', 'import', 'backup', 'readDeviceProperties', - * 'writeDeviceProperties', 'updateDeviceConfiguration', 'rebootDevice', 'factoryResetDevice', - * 'firmwareUpdate' - * @readonly - * @enum {string} - */ -export type JobType = - | "unknown" - | "export" - | "import" - | "backup" - | "readDeviceProperties" - | "writeDeviceProperties" - | "updateDeviceConfiguration" - | "rebootDevice" - | "factoryResetDevice" - | "firmwareUpdate"; - -/** - * Defines values for JobStatus. - * Possible values include: 'unknown', 'enqueued', 'running', 'completed', 'failed', 'cancelled' - * @readonly - * @enum {string} - */ -export type JobStatus = "unknown" | "enqueued" | "running" | "completed" | "failed" | "cancelled"; - -/** - * Defines values for IotHubScaleType. - * Possible values include: 'Automatic', 'Manual', 'None' - * @readonly - * @enum {string} - */ -export type IotHubScaleType = "Automatic" | "Manual" | "None"; - -/** - * Defines values for IotHubNameUnavailabilityReason. - * Possible values include: 'Invalid', 'AlreadyExists' - * @readonly - * @enum {string} - */ -export type IotHubNameUnavailabilityReason = "Invalid" | "AlreadyExists"; - -/** - * Defines values for TestResultStatus. - * Possible values include: 'undefined', 'false', 'true' - * @readonly - * @enum {string} - */ -export type TestResultStatus = "undefined" | "false" | "true"; - -/** - * Defines values for RouteErrorSeverity. - * Possible values include: 'error', 'warning' - * @readonly - * @enum {string} - */ -export type RouteErrorSeverity = "error" | "warning"; - -/** - * Defines values for Encoding. - * Possible values include: 'Avro', 'AvroDeflate', 'JSON' - * @readonly - * @enum {string} - */ -export type Encoding = "Avro" | "AvroDeflate" | "JSON"; - -/** - * 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 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; - }; -}; - -/** - * Contains response data for the get operation. - */ -export type IotHubResourceGetResponse = IotHubDescription & { - /** - * 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: IotHubDescription; - }; -}; - -/** - * Contains response data for the createOrUpdate operation. - */ -export type IotHubResourceCreateOrUpdateResponse = IotHubDescription & { - /** - * 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: IotHubDescription; - }; -}; - -/** - * Contains response data for the update operation. - */ -export type IotHubResourceUpdateResponse = IotHubDescription & { - /** - * 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: IotHubDescription; - }; -}; - -/** - * Contains response data for the deleteMethod operation. - */ -export type IotHubResourceDeleteMethodResponse = { - /** - * The parsed response body. - */ - body: any; - - /** - * 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: any; - }; -}; - -/** - * Contains response data for the listBySubscription operation. - */ -export type IotHubResourceListBySubscriptionResponse = IotHubDescriptionListResult & { - /** - * 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: IotHubDescriptionListResult; - }; -}; - -/** - * Contains response data for the listByResourceGroup operation. - */ -export type IotHubResourceListByResourceGroupResponse = IotHubDescriptionListResult & { - /** - * 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: IotHubDescriptionListResult; - }; -}; - -/** - * Contains response data for the getStats operation. - */ -export type IotHubResourceGetStatsResponse = RegistryStatistics & { - /** - * 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: RegistryStatistics; - }; -}; - -/** - * Contains response data for the getValidSkus operation. - */ -export type IotHubResourceGetValidSkusResponse = IotHubSkuDescriptionListResult & { - /** - * 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: IotHubSkuDescriptionListResult; - }; +/** The description of the IoT hub. */ +export type IotHubDescription = Resource & { + /** The Etag field is *not* required. If it is provided in the response body, it must also be provided as a header per the normal ETag convention. */ + etag?: string; + /** IotHub properties */ + properties?: IotHubProperties; + /** IotHub SKU info */ + sku: IotHubSkuInfo; + /** The managed identities for the IotHub. */ + identity?: ArmIdentity; }; +/** Known values of {@link PublicNetworkAccess} that the service accepts. */ +export enum KnownPublicNetworkAccess { + Enabled = "Enabled", + Disabled = "Disabled" +} + /** - * Contains response data for the listEventHubConsumerGroups operation. + * Defines values for PublicNetworkAccess. \ + * {@link KnownPublicNetworkAccess} can be used interchangeably with PublicNetworkAccess, + * this enum contains the known values that the service supports. + * ### Known values supported by the service + * **Enabled** \ + * **Disabled** */ -export type IotHubResourceListEventHubConsumerGroupsResponse = EventHubConsumerGroupsListResult & { - /** - * The underlying HTTP response. - */ - _response: msRest.HttpResponse & { - /** - * The response body as text (string format) - */ - bodyAsText: string; +export type PublicNetworkAccess = string; - /** - * The response body as parsed JSON or XML - */ - parsedBody: EventHubConsumerGroupsListResult; - }; -}; +/** Known values of {@link DefaultAction} that the service accepts. */ +export enum KnownDefaultAction { + Deny = "Deny", + Allow = "Allow" +} /** - * Contains response data for the getEventHubConsumerGroup operation. + * Defines values for DefaultAction. \ + * {@link KnownDefaultAction} can be used interchangeably with DefaultAction, + * this enum contains the known values that the service supports. + * ### Known values supported by the service + * **Deny** \ + * **Allow** */ -export type IotHubResourceGetEventHubConsumerGroupResponse = EventHubConsumerGroupInfo & { - /** - * The underlying HTTP response. - */ - _response: msRest.HttpResponse & { - /** - * The response body as text (string format) - */ - bodyAsText: string; +export type DefaultAction = string; - /** - * The response body as parsed JSON or XML - */ - parsedBody: EventHubConsumerGroupInfo; - }; -}; +/** Known values of {@link NetworkRuleIPAction} that the service accepts. */ +export enum KnownNetworkRuleIPAction { + Allow = "Allow" +} /** - * Contains response data for the createEventHubConsumerGroup operation. + * Defines values for NetworkRuleIPAction. \ + * {@link KnownNetworkRuleIPAction} can be used interchangeably with NetworkRuleIPAction, + * this enum contains the known values that the service supports. + * ### Known values supported by the service + * **Allow** */ -export type IotHubResourceCreateEventHubConsumerGroupResponse = EventHubConsumerGroupInfo & { - /** - * The underlying HTTP response. - */ - _response: msRest.HttpResponse & { - /** - * The response body as text (string format) - */ - bodyAsText: string; +export type NetworkRuleIPAction = string; - /** - * The response body as parsed JSON or XML - */ - parsedBody: EventHubConsumerGroupInfo; - }; -}; +/** Known values of {@link PrivateLinkServiceConnectionStatus} that the service accepts. */ +export enum KnownPrivateLinkServiceConnectionStatus { + Pending = "Pending", + Approved = "Approved", + Rejected = "Rejected", + Disconnected = "Disconnected" +} /** - * Contains response data for the listJobs operation. + * Defines values for PrivateLinkServiceConnectionStatus. \ + * {@link KnownPrivateLinkServiceConnectionStatus} can be used interchangeably with PrivateLinkServiceConnectionStatus, + * this enum contains the known values that the service supports. + * ### Known values supported by the service + * **Pending** \ + * **Approved** \ + * **Rejected** \ + * **Disconnected** */ -export type IotHubResourceListJobsResponse = JobResponseListResult & { - /** - * The underlying HTTP response. - */ - _response: msRest.HttpResponse & { - /** - * The response body as text (string format) - */ - bodyAsText: string; +export type PrivateLinkServiceConnectionStatus = string; - /** - * The response body as parsed JSON or XML - */ - parsedBody: JobResponseListResult; - }; -}; +/** Known values of {@link AuthenticationType} that the service accepts. */ +export enum KnownAuthenticationType { + KeyBased = "keyBased", + IdentityBased = "identityBased" +} /** - * Contains response data for the getJob operation. + * Defines values for AuthenticationType. \ + * {@link KnownAuthenticationType} can be used interchangeably with AuthenticationType, + * this enum contains the known values that the service supports. + * ### Known values supported by the service + * **keyBased** \ + * **identityBased** */ -export type IotHubResourceGetJobResponse = JobResponse & { - /** - * The underlying HTTP response. - */ - _response: msRest.HttpResponse & { - /** - * The response body as text (string format) - */ - bodyAsText: string; +export type AuthenticationType = string; - /** - * The response body as parsed JSON or XML - */ - parsedBody: JobResponse; - }; -}; +/** Known values of {@link RoutingStorageContainerPropertiesEncoding} that the service accepts. */ +export enum KnownRoutingStorageContainerPropertiesEncoding { + Avro = "Avro", + AvroDeflate = "AvroDeflate", + Json = "JSON" +} /** - * Contains response data for the getQuotaMetrics operation. + * Defines values for RoutingStorageContainerPropertiesEncoding. \ + * {@link KnownRoutingStorageContainerPropertiesEncoding} can be used interchangeably with RoutingStorageContainerPropertiesEncoding, + * this enum contains the known values that the service supports. + * ### Known values supported by the service + * **Avro** \ + * **AvroDeflate** \ + * **JSON** */ -export type IotHubResourceGetQuotaMetricsResponse = IotHubQuotaMetricInfoListResult & { - /** - * The underlying HTTP response. - */ - _response: msRest.HttpResponse & { - /** - * The response body as text (string format) - */ - bodyAsText: string; +export type RoutingStorageContainerPropertiesEncoding = string; - /** - * The response body as parsed JSON or XML - */ - parsedBody: IotHubQuotaMetricInfoListResult; - }; -}; +/** Known values of {@link RoutingSource} that the service accepts. */ +export enum KnownRoutingSource { + Invalid = "Invalid", + DeviceMessages = "DeviceMessages", + TwinChangeEvents = "TwinChangeEvents", + DeviceLifecycleEvents = "DeviceLifecycleEvents", + DeviceJobLifecycleEvents = "DeviceJobLifecycleEvents", + DeviceConnectionStateEvents = "DeviceConnectionStateEvents" +} /** - * Contains response data for the getEndpointHealth operation. + * Defines values for RoutingSource. \ + * {@link KnownRoutingSource} can be used interchangeably with RoutingSource, + * this enum contains the known values that the service supports. + * ### Known values supported by the service + * **Invalid** \ + * **DeviceMessages** \ + * **TwinChangeEvents** \ + * **DeviceLifecycleEvents** \ + * **DeviceJobLifecycleEvents** \ + * **DeviceConnectionStateEvents** */ -export type IotHubResourceGetEndpointHealthResponse = EndpointHealthDataListResult & { - /** - * The underlying HTTP response. - */ - _response: msRest.HttpResponse & { - /** - * The response body as text (string format) - */ - bodyAsText: string; +export type RoutingSource = string; - /** - * The response body as parsed JSON or XML - */ - parsedBody: EndpointHealthDataListResult; - }; -}; +/** Known values of {@link Capabilities} that the service accepts. */ +export enum KnownCapabilities { + None = "None", + DeviceManagement = "DeviceManagement" +} -/** - * Contains response data for the checkNameAvailability operation. - */ -export type IotHubResourceCheckNameAvailabilityResponse = IotHubNameAvailabilityInfo & { - /** - * The underlying HTTP response. - */ - _response: msRest.HttpResponse & { - /** - * The response body as text (string format) - */ - bodyAsText: string; +/** + * Defines values for Capabilities. \ + * {@link KnownCapabilities} can be used interchangeably with Capabilities, + * this enum contains the known values that the service supports. + * ### Known values supported by the service + * **None** \ + * **DeviceManagement** + */ +export type Capabilities = string; + +/** Known values of {@link IotHubReplicaRoleType} that the service accepts. */ +export enum KnownIotHubReplicaRoleType { + Primary = "primary", + Secondary = "secondary" +} + +/** + * Defines values for IotHubReplicaRoleType. \ + * {@link KnownIotHubReplicaRoleType} can be used interchangeably with IotHubReplicaRoleType, + * this enum contains the known values that the service supports. + * ### Known values supported by the service + * **primary** \ + * **secondary** + */ +export type IotHubReplicaRoleType = string; + +/** Known values of {@link IotHubSku} that the service accepts. */ +export enum KnownIotHubSku { + F1 = "F1", + S1 = "S1", + S2 = "S2", + S3 = "S3", + B1 = "B1", + B2 = "B2", + B3 = "B3" +} + +/** + * Defines values for IotHubSku. \ + * {@link KnownIotHubSku} can be used interchangeably with IotHubSku, + * this enum contains the known values that the service supports. + * ### Known values supported by the service + * **F1** \ + * **S1** \ + * **S2** \ + * **S3** \ + * **B1** \ + * **B2** \ + * **B3** + */ +export type IotHubSku = string; + +/** Known values of {@link JobType} that the service accepts. */ +export enum KnownJobType { + Unknown = "unknown", + Export = "export", + Import = "import", + Backup = "backup", + ReadDeviceProperties = "readDeviceProperties", + WriteDeviceProperties = "writeDeviceProperties", + UpdateDeviceConfiguration = "updateDeviceConfiguration", + RebootDevice = "rebootDevice", + FactoryResetDevice = "factoryResetDevice", + FirmwareUpdate = "firmwareUpdate" +} + +/** + * Defines values for JobType. \ + * {@link KnownJobType} can be used interchangeably with JobType, + * this enum contains the known values that the service supports. + * ### Known values supported by the service + * **unknown** \ + * **export** \ + * **import** \ + * **backup** \ + * **readDeviceProperties** \ + * **writeDeviceProperties** \ + * **updateDeviceConfiguration** \ + * **rebootDevice** \ + * **factoryResetDevice** \ + * **firmwareUpdate** + */ +export type JobType = string; + +/** Known values of {@link EndpointHealthStatus} that the service accepts. */ +export enum KnownEndpointHealthStatus { + Unknown = "unknown", + Healthy = "healthy", + Degraded = "degraded", + Unhealthy = "unhealthy", + Dead = "dead" +} + +/** + * Defines values for EndpointHealthStatus. \ + * {@link KnownEndpointHealthStatus} can be used interchangeably with EndpointHealthStatus, + * this enum contains the known values that the service supports. + * ### Known values supported by the service + * **unknown** \ + * **healthy** \ + * **degraded** \ + * **unhealthy** \ + * **dead** + */ +export type EndpointHealthStatus = string; + +/** Known values of {@link TestResultStatus} that the service accepts. */ +export enum KnownTestResultStatus { + Undefined = "undefined", + False = "false", + True = "true" +} + +/** + * Defines values for TestResultStatus. \ + * {@link KnownTestResultStatus} can be used interchangeably with TestResultStatus, + * this enum contains the known values that the service supports. + * ### Known values supported by the service + * **undefined** \ + * **false** \ + * **true** + */ +export type TestResultStatus = string; + +/** Known values of {@link RouteErrorSeverity} that the service accepts. */ +export enum KnownRouteErrorSeverity { + Error = "error", + Warning = "warning" +} + +/** + * Defines values for RouteErrorSeverity. \ + * {@link KnownRouteErrorSeverity} can be used interchangeably with RouteErrorSeverity, + * this enum contains the known values that the service supports. + * ### Known values supported by the service + * **error** \ + * **warning** + */ +export type RouteErrorSeverity = string; +/** Defines values for AccessRights. */ +export type AccessRights = + | "RegistryRead" + | "RegistryWrite" + | "ServiceConnect" + | "DeviceConnect" + | "RegistryRead, RegistryWrite" + | "RegistryRead, ServiceConnect" + | "RegistryRead, DeviceConnect" + | "RegistryWrite, ServiceConnect" + | "RegistryWrite, DeviceConnect" + | "ServiceConnect, DeviceConnect" + | "RegistryRead, RegistryWrite, ServiceConnect" + | "RegistryRead, RegistryWrite, DeviceConnect" + | "RegistryRead, ServiceConnect, DeviceConnect" + | "RegistryWrite, ServiceConnect, DeviceConnect" + | "RegistryRead, RegistryWrite, ServiceConnect, DeviceConnect"; +/** Defines values for IpFilterActionType. */ +export type IpFilterActionType = "Accept" | "Reject"; +/** Defines values for IotHubSkuTier. */ +export type IotHubSkuTier = "Free" | "Standard" | "Basic"; +/** Defines values for ResourceIdentityType. */ +export type ResourceIdentityType = + | "SystemAssigned" + | "UserAssigned" + | "SystemAssigned, UserAssigned" + | "None"; +/** Defines values for IotHubScaleType. */ +export type IotHubScaleType = "Automatic" | "Manual" | "None"; +/** Defines values for JobStatus. */ +export type JobStatus = + | "unknown" + | "enqueued" + | "running" + | "completed" + | "failed" + | "cancelled"; +/** Defines values for IotHubNameUnavailabilityReason. */ +export type IotHubNameUnavailabilityReason = "Invalid" | "AlreadyExists"; - /** - * The response body as parsed JSON or XML - */ - parsedBody: IotHubNameAvailabilityInfo; - }; -}; +/** Optional parameters. */ +export interface OperationsListOptionalParams + extends coreClient.OperationOptions {} -/** - * Contains response data for the testAllRoutes operation. - */ -export type IotHubResourceTestAllRoutesResponse = TestAllRoutesResult & { - /** - * The underlying HTTP response. - */ - _response: msRest.HttpResponse & { - /** - * The response body as text (string format) - */ - bodyAsText: string; +/** Contains response data for the list operation. */ +export type OperationsListResponse = OperationListResult; - /** - * The response body as parsed JSON or XML - */ - parsedBody: TestAllRoutesResult; - }; -}; +/** Optional parameters. */ +export interface OperationsListNextOptionalParams + extends coreClient.OperationOptions {} -/** - * Contains response data for the testRoute operation. - */ -export type IotHubResourceTestRouteResponse = TestRouteResult & { - /** - * The underlying HTTP response. - */ - _response: msRest.HttpResponse & { - /** - * The response body as text (string format) - */ - bodyAsText: string; +/** Contains response data for the listNext operation. */ +export type OperationsListNextResponse = OperationListResult; - /** - * The response body as parsed JSON or XML - */ - parsedBody: TestRouteResult; - }; -}; +/** Optional parameters. */ +export interface IotHubResourceGetOptionalParams + extends coreClient.OperationOptions {} -/** - * Contains response data for the listKeys operation. - */ -export type IotHubResourceListKeysResponse = SharedAccessSignatureAuthorizationRuleListResult & { - /** - * The underlying HTTP response. - */ - _response: msRest.HttpResponse & { - /** - * The response body as text (string format) - */ - bodyAsText: string; +/** Contains response data for the get operation. */ +export type IotHubResourceGetResponse = IotHubDescription; - /** - * The response body as parsed JSON or XML - */ - parsedBody: SharedAccessSignatureAuthorizationRuleListResult; - }; -}; +/** Optional parameters. */ +export interface IotHubResourceCreateOrUpdateOptionalParams + extends coreClient.OperationOptions { + /** ETag of the IoT Hub. Do not specify for creating a brand new IoT Hub. Required to update an existing IoT Hub. */ + ifMatch?: string; + /** Delay to wait until next poll, in milliseconds. */ + updateIntervalInMs?: number; + /** A serialized poller which can be used to resume an existing paused Long-Running-Operation. */ + resumeFrom?: string; +} -/** - * Contains response data for the getKeysForKeyName operation. - */ -export type IotHubResourceGetKeysForKeyNameResponse = SharedAccessSignatureAuthorizationRule & { - /** - * The underlying HTTP response. - */ - _response: msRest.HttpResponse & { - /** - * The response body as text (string format) - */ - bodyAsText: string; +/** Contains response data for the createOrUpdate operation. */ +export type IotHubResourceCreateOrUpdateResponse = IotHubDescription; - /** - * The response body as parsed JSON or XML - */ - parsedBody: SharedAccessSignatureAuthorizationRule; - }; -}; +/** Optional parameters. */ +export interface IotHubResourceUpdateOptionalParams + extends coreClient.OperationOptions { + /** Delay to wait until next poll, in milliseconds. */ + updateIntervalInMs?: number; + /** A serialized poller which can be used to resume an existing paused Long-Running-Operation. */ + resumeFrom?: string; +} -/** - * Contains response data for the exportDevices operation. - */ -export type IotHubResourceExportDevicesResponse = JobResponse & { - /** - * The underlying HTTP response. - */ - _response: msRest.HttpResponse & { - /** - * The response body as text (string format) - */ - bodyAsText: string; +/** Contains response data for the update operation. */ +export type IotHubResourceUpdateResponse = IotHubDescription; - /** - * The response body as parsed JSON or XML - */ - parsedBody: JobResponse; - }; -}; +/** Optional parameters. */ +export interface IotHubResourceDeleteOptionalParams + extends coreClient.OperationOptions { + /** Delay to wait until next poll, in milliseconds. */ + updateIntervalInMs?: number; + /** A serialized poller which can be used to resume an existing paused Long-Running-Operation. */ + resumeFrom?: string; +} -/** - * Contains response data for the importDevices operation. - */ -export type IotHubResourceImportDevicesResponse = JobResponse & { - /** - * The underlying HTTP response. - */ - _response: msRest.HttpResponse & { - /** - * The response body as text (string format) - */ - bodyAsText: string; +/** Contains response data for the delete operation. */ +export type IotHubResourceDeleteResponse = IotHubDescription; - /** - * The response body as parsed JSON or XML - */ - parsedBody: JobResponse; - }; -}; +/** Optional parameters. */ +export interface IotHubResourceListBySubscriptionOptionalParams + extends coreClient.OperationOptions {} -/** - * Contains response data for the beginCreateOrUpdate operation. - */ -export type IotHubResourceBeginCreateOrUpdateResponse = IotHubDescription & { - /** - * The underlying HTTP response. - */ - _response: msRest.HttpResponse & { - /** - * The response body as text (string format) - */ - bodyAsText: string; +/** Contains response data for the listBySubscription operation. */ +export type IotHubResourceListBySubscriptionResponse = IotHubDescriptionListResult; - /** - * The response body as parsed JSON or XML - */ - parsedBody: IotHubDescription; - }; -}; +/** Optional parameters. */ +export interface IotHubResourceListByResourceGroupOptionalParams + extends coreClient.OperationOptions {} -/** - * Contains response data for the beginUpdate operation. - */ -export type IotHubResourceBeginUpdateResponse = IotHubDescription & { - /** - * The underlying HTTP response. - */ - _response: msRest.HttpResponse & { - /** - * The response body as text (string format) - */ - bodyAsText: string; +/** Contains response data for the listByResourceGroup operation. */ +export type IotHubResourceListByResourceGroupResponse = IotHubDescriptionListResult; - /** - * The response body as parsed JSON or XML - */ - parsedBody: IotHubDescription; - }; -}; +/** Optional parameters. */ +export interface IotHubResourceGetStatsOptionalParams + extends coreClient.OperationOptions {} -/** - * Contains response data for the beginDeleteMethod operation. - */ -export type IotHubResourceBeginDeleteMethodResponse = { - /** - * The parsed response body. - */ - body: any; +/** Contains response data for the getStats operation. */ +export type IotHubResourceGetStatsResponse = RegistryStatistics; - /** - * The underlying HTTP response. - */ - _response: msRest.HttpResponse & { - /** - * The response body as text (string format) - */ - bodyAsText: string; +/** Optional parameters. */ +export interface IotHubResourceGetValidSkusOptionalParams + extends coreClient.OperationOptions {} - /** - * The response body as parsed JSON or XML - */ - parsedBody: any; - }; -}; +/** Contains response data for the getValidSkus operation. */ +export type IotHubResourceGetValidSkusResponse = IotHubSkuDescriptionListResult; -/** - * Contains response data for the listBySubscriptionNext operation. - */ -export type IotHubResourceListBySubscriptionNextResponse = IotHubDescriptionListResult & { - /** - * The underlying HTTP response. - */ - _response: msRest.HttpResponse & { - /** - * The response body as text (string format) - */ - bodyAsText: string; +/** Optional parameters. */ +export interface IotHubResourceListEventHubConsumerGroupsOptionalParams + extends coreClient.OperationOptions {} - /** - * The response body as parsed JSON or XML - */ - parsedBody: IotHubDescriptionListResult; - }; -}; +/** Contains response data for the listEventHubConsumerGroups operation. */ +export type IotHubResourceListEventHubConsumerGroupsResponse = EventHubConsumerGroupsListResult; -/** - * Contains response data for the listByResourceGroupNext operation. - */ -export type IotHubResourceListByResourceGroupNextResponse = IotHubDescriptionListResult & { - /** - * The underlying HTTP response. - */ - _response: msRest.HttpResponse & { - /** - * The response body as text (string format) - */ - bodyAsText: string; +/** Optional parameters. */ +export interface IotHubResourceGetEventHubConsumerGroupOptionalParams + extends coreClient.OperationOptions {} - /** - * The response body as parsed JSON or XML - */ - parsedBody: IotHubDescriptionListResult; - }; -}; +/** Contains response data for the getEventHubConsumerGroup operation. */ +export type IotHubResourceGetEventHubConsumerGroupResponse = EventHubConsumerGroupInfo; -/** - * Contains response data for the getValidSkusNext operation. - */ -export type IotHubResourceGetValidSkusNextResponse = IotHubSkuDescriptionListResult & { - /** - * The underlying HTTP response. - */ - _response: msRest.HttpResponse & { - /** - * The response body as text (string format) - */ - bodyAsText: string; +/** Optional parameters. */ +export interface IotHubResourceCreateEventHubConsumerGroupOptionalParams + extends coreClient.OperationOptions {} - /** - * The response body as parsed JSON or XML - */ - parsedBody: IotHubSkuDescriptionListResult; - }; -}; +/** Contains response data for the createEventHubConsumerGroup operation. */ +export type IotHubResourceCreateEventHubConsumerGroupResponse = EventHubConsumerGroupInfo; -/** - * Contains response data for the listEventHubConsumerGroupsNext operation. - */ -export type IotHubResourceListEventHubConsumerGroupsNextResponse = EventHubConsumerGroupsListResult & { - /** - * The underlying HTTP response. - */ - _response: msRest.HttpResponse & { - /** - * The response body as text (string format) - */ - bodyAsText: string; +/** Optional parameters. */ +export interface IotHubResourceDeleteEventHubConsumerGroupOptionalParams + extends coreClient.OperationOptions {} - /** - * The response body as parsed JSON or XML - */ - parsedBody: EventHubConsumerGroupsListResult; - }; -}; +/** Optional parameters. */ +export interface IotHubResourceListJobsOptionalParams + extends coreClient.OperationOptions {} -/** - * Contains response data for the listJobsNext operation. - */ -export type IotHubResourceListJobsNextResponse = JobResponseListResult & { - /** - * The underlying HTTP response. - */ - _response: msRest.HttpResponse & { - /** - * The response body as text (string format) - */ - bodyAsText: string; +/** Contains response data for the listJobs operation. */ +export type IotHubResourceListJobsResponse = JobResponseListResult; - /** - * The response body as parsed JSON or XML - */ - parsedBody: JobResponseListResult; - }; -}; +/** Optional parameters. */ +export interface IotHubResourceGetJobOptionalParams + extends coreClient.OperationOptions {} -/** - * Contains response data for the getQuotaMetricsNext operation. - */ -export type IotHubResourceGetQuotaMetricsNextResponse = IotHubQuotaMetricInfoListResult & { - /** - * The underlying HTTP response. - */ - _response: msRest.HttpResponse & { - /** - * The response body as text (string format) - */ - bodyAsText: string; +/** Contains response data for the getJob operation. */ +export type IotHubResourceGetJobResponse = JobResponse; - /** - * The response body as parsed JSON or XML - */ - parsedBody: IotHubQuotaMetricInfoListResult; - }; -}; +/** Optional parameters. */ +export interface IotHubResourceGetQuotaMetricsOptionalParams + extends coreClient.OperationOptions {} -/** - * Contains response data for the getEndpointHealthNext operation. - */ -export type IotHubResourceGetEndpointHealthNextResponse = EndpointHealthDataListResult & { - /** - * The underlying HTTP response. - */ - _response: msRest.HttpResponse & { - /** - * The response body as text (string format) - */ - bodyAsText: string; +/** Contains response data for the getQuotaMetrics operation. */ +export type IotHubResourceGetQuotaMetricsResponse = IotHubQuotaMetricInfoListResult; - /** - * The response body as parsed JSON or XML - */ - parsedBody: EndpointHealthDataListResult; - }; -}; +/** Optional parameters. */ +export interface IotHubResourceGetEndpointHealthOptionalParams + extends coreClient.OperationOptions {} -/** - * Contains response data for the listKeysNext operation. - */ -export type IotHubResourceListKeysNextResponse = SharedAccessSignatureAuthorizationRuleListResult & { - /** - * The underlying HTTP response. - */ - _response: msRest.HttpResponse & { - /** - * The response body as text (string format) - */ - bodyAsText: string; +/** Contains response data for the getEndpointHealth operation. */ +export type IotHubResourceGetEndpointHealthResponse = EndpointHealthDataListResult; - /** - * The response body as parsed JSON or XML - */ - parsedBody: SharedAccessSignatureAuthorizationRuleListResult; - }; -}; +/** Optional parameters. */ +export interface IotHubResourceCheckNameAvailabilityOptionalParams + extends coreClient.OperationOptions {} -/** - * Contains response data for the getSubscriptionQuota operation. - */ -export type ResourceProviderCommonGetSubscriptionQuotaResponse = UserSubscriptionQuotaListResult & { - /** - * The underlying HTTP response. - */ - _response: msRest.HttpResponse & { - /** - * The response body as text (string format) - */ - bodyAsText: string; +/** Contains response data for the checkNameAvailability operation. */ +export type IotHubResourceCheckNameAvailabilityResponse = IotHubNameAvailabilityInfo; - /** - * The response body as parsed JSON or XML - */ - parsedBody: UserSubscriptionQuotaListResult; - }; -}; +/** Optional parameters. */ +export interface IotHubResourceTestAllRoutesOptionalParams + extends coreClient.OperationOptions {} -/** - * Contains response data for the listByIotHub operation. - */ -export type CertificatesListByIotHubResponse = CertificateListDescription & { - /** - * The underlying HTTP response. - */ - _response: msRest.HttpResponse & { - /** - * The response body as text (string format) - */ - bodyAsText: string; +/** Contains response data for the testAllRoutes operation. */ +export type IotHubResourceTestAllRoutesResponse = TestAllRoutesResult; - /** - * The response body as parsed JSON or XML - */ - parsedBody: CertificateListDescription; - }; -}; +/** Optional parameters. */ +export interface IotHubResourceTestRouteOptionalParams + extends coreClient.OperationOptions {} -/** - * Contains response data for the get operation. - */ -export type CertificatesGetResponse = CertificateDescription & { - /** - * The underlying HTTP response. - */ - _response: msRest.HttpResponse & { - /** - * The response body as text (string format) - */ - bodyAsText: string; +/** Contains response data for the testRoute operation. */ +export type IotHubResourceTestRouteResponse = TestRouteResult; - /** - * The response body as parsed JSON or XML - */ - parsedBody: CertificateDescription; - }; -}; +/** Optional parameters. */ +export interface IotHubResourceListKeysOptionalParams + extends coreClient.OperationOptions {} -/** - * Contains response data for the createOrUpdate operation. - */ -export type CertificatesCreateOrUpdateResponse = CertificateDescription & { - /** - * The underlying HTTP response. - */ - _response: msRest.HttpResponse & { - /** - * The response body as text (string format) - */ - bodyAsText: string; +/** Contains response data for the listKeys operation. */ +export type IotHubResourceListKeysResponse = SharedAccessSignatureAuthorizationRuleListResult; - /** - * The response body as parsed JSON or XML - */ - parsedBody: CertificateDescription; - }; -}; +/** Optional parameters. */ +export interface IotHubResourceGetKeysForKeyNameOptionalParams + extends coreClient.OperationOptions {} -/** - * Contains response data for the generateVerificationCode operation. - */ -export type CertificatesGenerateVerificationCodeResponse = CertificateWithNonceDescription & { - /** - * The underlying HTTP response. - */ - _response: msRest.HttpResponse & { - /** - * The response body as text (string format) - */ - bodyAsText: string; +/** Contains response data for the getKeysForKeyName operation. */ +export type IotHubResourceGetKeysForKeyNameResponse = SharedAccessSignatureAuthorizationRule; - /** - * The response body as parsed JSON or XML - */ - parsedBody: CertificateWithNonceDescription; - }; -}; +/** Optional parameters. */ +export interface IotHubResourceExportDevicesOptionalParams + extends coreClient.OperationOptions {} -/** - * Contains response data for the verify operation. - */ -export type CertificatesVerifyResponse = CertificateDescription & { - /** - * The underlying HTTP response. - */ - _response: msRest.HttpResponse & { - /** - * The response body as text (string format) - */ - bodyAsText: string; +/** Contains response data for the exportDevices operation. */ +export type IotHubResourceExportDevicesResponse = JobResponse; - /** - * The response body as parsed JSON or XML - */ - parsedBody: CertificateDescription; - }; -}; +/** Optional parameters. */ +export interface IotHubResourceImportDevicesOptionalParams + extends coreClient.OperationOptions {} -/** - * Contains response data for the list operation. - */ -export type PrivateLinkResourcesListResponse = PrivateLinkResources & { - /** - * The underlying HTTP response. - */ - _response: msRest.HttpResponse & { - /** - * The response body as text (string format) - */ - bodyAsText: string; +/** Contains response data for the importDevices operation. */ +export type IotHubResourceImportDevicesResponse = JobResponse; - /** - * The response body as parsed JSON or XML - */ - parsedBody: PrivateLinkResources; - }; -}; +/** Optional parameters. */ +export interface IotHubResourceListBySubscriptionNextOptionalParams + extends coreClient.OperationOptions {} -/** - * Contains response data for the get operation. - */ -export type PrivateLinkResourcesGetResponse = GroupIdInformation & { - /** - * The underlying HTTP response. - */ - _response: msRest.HttpResponse & { - /** - * The response body as text (string format) - */ - bodyAsText: string; +/** Contains response data for the listBySubscriptionNext operation. */ +export type IotHubResourceListBySubscriptionNextResponse = IotHubDescriptionListResult; - /** - * The response body as parsed JSON or XML - */ - parsedBody: GroupIdInformation; - }; -}; +/** Optional parameters. */ +export interface IotHubResourceListByResourceGroupNextOptionalParams + extends coreClient.OperationOptions {} -/** - * Contains response data for the list operation. - */ -export type PrivateEndpointConnectionsListResponse = Array & { - /** - * The underlying HTTP response. - */ - _response: msRest.HttpResponse & { - /** - * The response body as text (string format) - */ - bodyAsText: string; +/** Contains response data for the listByResourceGroupNext operation. */ +export type IotHubResourceListByResourceGroupNextResponse = IotHubDescriptionListResult; - /** - * The response body as parsed JSON or XML - */ - parsedBody: PrivateEndpointConnection[]; - }; -}; +/** Optional parameters. */ +export interface IotHubResourceGetValidSkusNextOptionalParams + extends coreClient.OperationOptions {} -/** - * Contains response data for the get operation. - */ -export type PrivateEndpointConnectionsGetResponse = PrivateEndpointConnection & { - /** - * The underlying HTTP response. - */ - _response: msRest.HttpResponse & { - /** - * The response body as text (string format) - */ - bodyAsText: string; +/** Contains response data for the getValidSkusNext operation. */ +export type IotHubResourceGetValidSkusNextResponse = IotHubSkuDescriptionListResult; - /** - * The response body as parsed JSON or XML - */ - parsedBody: PrivateEndpointConnection; - }; -}; +/** Optional parameters. */ +export interface IotHubResourceListEventHubConsumerGroupsNextOptionalParams + extends coreClient.OperationOptions {} -/** - * Contains response data for the update operation. - */ -export type PrivateEndpointConnectionsUpdateResponse = PrivateEndpointConnection & { - /** - * The underlying HTTP response. - */ - _response: msRest.HttpResponse & { - /** - * The response body as text (string format) - */ - bodyAsText: string; +/** Contains response data for the listEventHubConsumerGroupsNext operation. */ +export type IotHubResourceListEventHubConsumerGroupsNextResponse = EventHubConsumerGroupsListResult; - /** - * The response body as parsed JSON or XML - */ - parsedBody: PrivateEndpointConnection; - }; -}; +/** Optional parameters. */ +export interface IotHubResourceListJobsNextOptionalParams + extends coreClient.OperationOptions {} -/** - * Contains response data for the deleteMethod operation. - */ -export type PrivateEndpointConnectionsDeleteMethodResponse = PrivateEndpointConnection & { - /** - * The underlying HTTP response. - */ - _response: msRest.HttpResponse & { - /** - * The response body as text (string format) - */ - bodyAsText: string; +/** Contains response data for the listJobsNext operation. */ +export type IotHubResourceListJobsNextResponse = JobResponseListResult; - /** - * The response body as parsed JSON or XML - */ - parsedBody: PrivateEndpointConnection; - }; -}; +/** Optional parameters. */ +export interface IotHubResourceGetQuotaMetricsNextOptionalParams + extends coreClient.OperationOptions {} -/** - * Contains response data for the beginUpdate operation. - */ -export type PrivateEndpointConnectionsBeginUpdateResponse = PrivateEndpointConnection & { - /** - * The underlying HTTP response. - */ - _response: msRest.HttpResponse & { - /** - * The response body as text (string format) - */ - bodyAsText: string; +/** Contains response data for the getQuotaMetricsNext operation. */ +export type IotHubResourceGetQuotaMetricsNextResponse = IotHubQuotaMetricInfoListResult; - /** - * The response body as parsed JSON or XML - */ - parsedBody: PrivateEndpointConnection; - }; -}; +/** Optional parameters. */ +export interface IotHubResourceGetEndpointHealthNextOptionalParams + extends coreClient.OperationOptions {} -/** - * Contains response data for the beginDeleteMethod operation. - */ -export type PrivateEndpointConnectionsBeginDeleteMethodResponse = PrivateEndpointConnection & { - /** - * The underlying HTTP response. - */ - _response: msRest.HttpResponse & { - /** - * The response body as text (string format) - */ - bodyAsText: string; +/** Contains response data for the getEndpointHealthNext operation. */ +export type IotHubResourceGetEndpointHealthNextResponse = EndpointHealthDataListResult; - /** - * The response body as parsed JSON or XML - */ - parsedBody: PrivateEndpointConnection; - }; -}; +/** Optional parameters. */ +export interface IotHubResourceListKeysNextOptionalParams + extends coreClient.OperationOptions {} + +/** Contains response data for the listKeysNext operation. */ +export type IotHubResourceListKeysNextResponse = SharedAccessSignatureAuthorizationRuleListResult; + +/** Optional parameters. */ +export interface ResourceProviderCommonGetSubscriptionQuotaOptionalParams + extends coreClient.OperationOptions {} + +/** Contains response data for the getSubscriptionQuota operation. */ +export type ResourceProviderCommonGetSubscriptionQuotaResponse = UserSubscriptionQuotaListResult; + +/** Optional parameters. */ +export interface CertificatesListByIotHubOptionalParams + extends coreClient.OperationOptions {} + +/** Contains response data for the listByIotHub operation. */ +export type CertificatesListByIotHubResponse = CertificateListDescription; + +/** Optional parameters. */ +export interface CertificatesGetOptionalParams + extends coreClient.OperationOptions {} + +/** Contains response data for the get operation. */ +export type CertificatesGetResponse = CertificateDescription; + +/** Optional parameters. */ +export interface CertificatesCreateOrUpdateOptionalParams + extends coreClient.OperationOptions { + /** ETag of the Certificate. Do not specify for creating a brand new certificate. Required to update an existing certificate. */ + ifMatch?: string; +} + +/** Contains response data for the createOrUpdate operation. */ +export type CertificatesCreateOrUpdateResponse = CertificateDescription; + +/** Optional parameters. */ +export interface CertificatesDeleteOptionalParams + extends coreClient.OperationOptions {} + +/** Optional parameters. */ +export interface CertificatesGenerateVerificationCodeOptionalParams + extends coreClient.OperationOptions {} + +/** Contains response data for the generateVerificationCode operation. */ +export type CertificatesGenerateVerificationCodeResponse = CertificateWithNonceDescription; + +/** Optional parameters. */ +export interface CertificatesVerifyOptionalParams + extends coreClient.OperationOptions {} + +/** Contains response data for the verify operation. */ +export type CertificatesVerifyResponse = CertificateDescription; + +/** Optional parameters. */ +export interface IotHubManualFailoverOptionalParams + 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; +} + +/** Optional parameters. */ +export interface PrivateLinkResourcesListOptionalParams + extends coreClient.OperationOptions {} + +/** Contains response data for the list operation. */ +export type PrivateLinkResourcesListResponse = PrivateLinkResources; + +/** Optional parameters. */ +export interface PrivateLinkResourcesGetOptionalParams + extends coreClient.OperationOptions {} + +/** Contains response data for the get operation. */ +export type PrivateLinkResourcesGetResponse = GroupIdInformation; + +/** Optional parameters. */ +export interface PrivateEndpointConnectionsListOptionalParams + extends coreClient.OperationOptions {} + +/** Contains response data for the list operation. */ +export type PrivateEndpointConnectionsListResponse = PrivateEndpointConnection[]; + +/** Optional parameters. */ +export interface PrivateEndpointConnectionsGetOptionalParams + extends coreClient.OperationOptions {} + +/** Contains response data for the get operation. */ +export type PrivateEndpointConnectionsGetResponse = PrivateEndpointConnection; + +/** Optional parameters. */ +export interface PrivateEndpointConnectionsUpdateOptionalParams + extends coreClient.OperationOptions { + /** Delay to wait until next poll, in milliseconds. */ + updateIntervalInMs?: number; + /** A serialized poller which can be used to resume an existing paused Long-Running-Operation. */ + resumeFrom?: string; +} + +/** Contains response data for the update operation. */ +export type PrivateEndpointConnectionsUpdateResponse = PrivateEndpointConnection; + +/** Optional parameters. */ +export interface PrivateEndpointConnectionsDeleteOptionalParams + extends coreClient.OperationOptions { + /** Delay to wait until next poll, in milliseconds. */ + updateIntervalInMs?: number; + /** A serialized poller which can be used to resume an existing paused Long-Running-Operation. */ + resumeFrom?: string; +} + +/** Contains response data for the delete operation. */ +export type PrivateEndpointConnectionsDeleteResponse = PrivateEndpointConnection; + +/** Optional parameters. */ +export interface IotHubClientOptionalParams + extends coreClient.ServiceClientOptions { + /** server parameter */ + $host?: string; + /** Api Version */ + apiVersion?: string; + /** Overrides client endpoint. */ + endpoint?: string; +} diff --git a/sdk/iothub/arm-iothub/src/models/iotHubMappers.ts b/sdk/iothub/arm-iothub/src/models/iotHubMappers.ts deleted file mode 100644 index 849d8942b406..000000000000 --- a/sdk/iothub/arm-iothub/src/models/iotHubMappers.ts +++ /dev/null @@ -1,9 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -export { ErrorDetails, FailoverInput } from "../models/mappers"; diff --git a/sdk/iothub/arm-iothub/src/models/iotHubResourceMappers.ts b/sdk/iothub/arm-iothub/src/models/iotHubResourceMappers.ts deleted file mode 100644 index b5969644a878..000000000000 --- a/sdk/iothub/arm-iothub/src/models/iotHubResourceMappers.ts +++ /dev/null @@ -1,80 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -export { - ArmIdentity, - ArmUserIdentity, - BaseResource, - CertificateDescription, - CertificateProperties, - CertificatePropertiesWithNonce, - CertificateWithNonceDescription, - CloudError, - CloudToDeviceProperties, - EndpointHealthData, - EndpointHealthDataListResult, - EnrichmentProperties, - ErrorDetails, - EventHubConsumerGroupBodyDescription, - EventHubConsumerGroupInfo, - EventHubConsumerGroupName, - EventHubConsumerGroupsListResult, - EventHubProperties, - ExportDevicesRequest, - FallbackRouteProperties, - FeedbackProperties, - ImportDevicesRequest, - IotHubCapacity, - IotHubDescription, - IotHubDescriptionListResult, - IotHubLocationDescription, - IotHubNameAvailabilityInfo, - IotHubProperties, - IotHubQuotaMetricInfo, - IotHubQuotaMetricInfoListResult, - IotHubSkuDescription, - IotHubSkuDescriptionListResult, - IotHubSkuInfo, - IpFilterRule, - JobResponse, - JobResponseListResult, - ManagedIdentity, - MatchedRoute, - MessagingEndpointProperties, - NetworkRuleSetIpRule, - NetworkRuleSetProperties, - OperationInputs, - PrivateEndpoint, - PrivateEndpointConnection, - PrivateEndpointConnectionProperties, - PrivateLinkServiceConnectionState, - RegistryStatistics, - Resource, - RouteCompilationError, - RouteErrorPosition, - RouteErrorRange, - RouteProperties, - RoutingEndpoints, - RoutingEventHubProperties, - RoutingMessage, - RoutingProperties, - RoutingServiceBusQueueEndpointProperties, - RoutingServiceBusTopicEndpointProperties, - RoutingStorageContainerProperties, - RoutingTwin, - RoutingTwinProperties, - SharedAccessSignatureAuthorizationRule, - SharedAccessSignatureAuthorizationRuleListResult, - StorageEndpointProperties, - TagsResource, - TestAllRoutesInput, - TestAllRoutesResult, - TestRouteInput, - TestRouteResult, - TestRouteResultDetails -} from "../models/mappers"; diff --git a/sdk/iothub/arm-iothub/src/models/mappers.ts b/sdk/iothub/arm-iothub/src/models/mappers.ts index c552352b03da..2fcb7be870c6 100644 --- a/sdk/iothub/arm-iothub/src/models/mappers.ts +++ b/sdk/iothub/arm-iothub/src/models/mappers.ts @@ -6,20 +6,29 @@ * 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 CertificateVerificationDescription: msRest.CompositeMapper = { - serializedName: "CertificateVerificationDescription", +export const OperationListResult: coreClient.CompositeMapper = { type: { name: "Composite", - className: "CertificateVerificationDescription", + className: "OperationListResult", modelProperties: { - certificate: { - serializedName: "certificate", + value: { + serializedName: "value", + readOnly: true, + type: { + name: "Sequence", + element: { + type: { + name: "Composite", + className: "Operation" + } + } + } + }, + nextLink: { + serializedName: "nextLink", + readOnly: true, type: { name: "String" } @@ -28,56 +37,58 @@ export const CertificateVerificationDescription: msRest.CompositeMapper = { } }; -export const CertificateProperties: msRest.CompositeMapper = { - serializedName: "CertificateProperties", +export const Operation: coreClient.CompositeMapper = { type: { name: "Composite", - className: "CertificateProperties", + className: "Operation", modelProperties: { - subject: { + name: { + serializedName: "name", readOnly: true, - serializedName: "subject", type: { name: "String" } }, - expiry: { - readOnly: true, - serializedName: "expiry", + display: { + serializedName: "display", type: { - name: "DateTimeRfc1123" + name: "Composite", + className: "OperationDisplay" } - }, - thumbprint: { + } + } + } +}; + +export const OperationDisplay: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "OperationDisplay", + modelProperties: { + provider: { + serializedName: "provider", readOnly: true, - serializedName: "thumbprint", type: { name: "String" } }, - isVerified: { + resource: { + serializedName: "resource", readOnly: true, - serializedName: "isVerified", type: { - name: "Boolean" + name: "String" } }, - created: { + operation: { + serializedName: "operation", readOnly: true, - serializedName: "created", type: { - name: "DateTimeRfc1123" + name: "String" } }, - updated: { + description: { + serializedName: "description", readOnly: true, - serializedName: "updated", - type: { - name: "DateTimeRfc1123" - } - }, - certificate: { - serializedName: "certificate", type: { name: "String" } @@ -86,43 +97,35 @@ export const CertificateProperties: msRest.CompositeMapper = { } }; -export const CertificateDescription: msRest.CompositeMapper = { - serializedName: "CertificateDescription", +export const ErrorDetails: coreClient.CompositeMapper = { type: { name: "Composite", - className: "CertificateDescription", + className: "ErrorDetails", modelProperties: { - properties: { - serializedName: "properties", - type: { - name: "Composite", - className: "CertificateProperties" - } - }, - id: { + code: { + serializedName: "code", readOnly: true, - serializedName: "id", type: { name: "String" } }, - name: { + httpStatusCode: { + serializedName: "httpStatusCode", readOnly: true, - serializedName: "name", type: { name: "String" } }, - etag: { + message: { + serializedName: "message", readOnly: true, - serializedName: "etag", type: { name: "String" } }, - type: { + details: { + serializedName: "details", readOnly: true, - serializedName: "type", type: { name: "String" } @@ -131,184 +134,229 @@ export const CertificateDescription: msRest.CompositeMapper = { } }; -export const CertificateListDescription: msRest.CompositeMapper = { - serializedName: "CertificateListDescription", +export const IotHubProperties: coreClient.CompositeMapper = { type: { name: "Composite", - className: "CertificateListDescription", + className: "IotHubProperties", modelProperties: { - value: { - serializedName: "value", + authorizationPolicies: { + serializedName: "authorizationPolicies", type: { name: "Sequence", element: { type: { name: "Composite", - className: "CertificateDescription" + className: "SharedAccessSignatureAuthorizationRule" } } } - } - } - } -}; - -export const CertificateBodyDescription: msRest.CompositeMapper = { - serializedName: "CertificateBodyDescription", - type: { - name: "Composite", - className: "CertificateBodyDescription", - modelProperties: { - certificate: { - serializedName: "certificate", - type: { - name: "String" - } - } - } - } -}; - -export const CertificatePropertiesWithNonce: msRest.CompositeMapper = { - serializedName: "CertificatePropertiesWithNonce", - type: { - name: "Composite", - className: "CertificatePropertiesWithNonce", - modelProperties: { - subject: { - readOnly: true, - serializedName: "subject", - type: { - name: "String" - } }, - expiry: { - readOnly: true, - serializedName: "expiry", + disableLocalAuth: { + serializedName: "disableLocalAuth", type: { - name: "DateTimeRfc1123" + name: "Boolean" } }, - thumbprint: { - readOnly: true, - serializedName: "thumbprint", + disableDeviceSAS: { + serializedName: "disableDeviceSAS", type: { - name: "String" + name: "Boolean" } }, - isVerified: { - readOnly: true, - serializedName: "isVerified", + disableModuleSAS: { + serializedName: "disableModuleSAS", type: { name: "Boolean" } }, - created: { - readOnly: true, - serializedName: "created", + restrictOutboundNetworkAccess: { + serializedName: "restrictOutboundNetworkAccess", type: { - name: "DateTimeRfc1123" + name: "Boolean" } }, - updated: { - readOnly: true, - serializedName: "updated", + allowedFqdnList: { + serializedName: "allowedFqdnList", type: { - name: "DateTimeRfc1123" + name: "Sequence", + element: { + type: { + name: "String" + } + } } }, - verificationCode: { - readOnly: true, - serializedName: "verificationCode", + publicNetworkAccess: { + serializedName: "publicNetworkAccess", type: { name: "String" } }, - certificate: { - readOnly: true, - serializedName: "certificate", + ipFilterRules: { + serializedName: "ipFilterRules", type: { - name: "String" + name: "Sequence", + element: { + type: { + name: "Composite", + className: "IpFilterRule" + } + } } - } - } - } -}; - -export const CertificateWithNonceDescription: msRest.CompositeMapper = { - serializedName: "CertificateWithNonceDescription", - type: { - name: "Composite", - className: "CertificateWithNonceDescription", - modelProperties: { - properties: { - serializedName: "properties", + }, + networkRuleSets: { + serializedName: "networkRuleSets", type: { name: "Composite", - className: "CertificatePropertiesWithNonce" + className: "NetworkRuleSetProperties" } }, - id: { - readOnly: true, - serializedName: "id", + minTlsVersion: { + serializedName: "minTlsVersion", type: { name: "String" } }, - name: { - readOnly: true, - serializedName: "name", + privateEndpointConnections: { + serializedName: "privateEndpointConnections", type: { - name: "String" + name: "Sequence", + element: { + type: { + name: "Composite", + className: "PrivateEndpointConnection" + } + } } }, - etag: { + provisioningState: { + serializedName: "provisioningState", readOnly: true, - serializedName: "etag", type: { name: "String" } }, - type: { + state: { + serializedName: "state", readOnly: true, - serializedName: "type", type: { name: "String" } - } - } - } -}; - -export const SharedAccessSignatureAuthorizationRule: msRest.CompositeMapper = { - serializedName: "SharedAccessSignatureAuthorizationRule", - type: { - name: "Composite", - className: "SharedAccessSignatureAuthorizationRule", - modelProperties: { - keyName: { - required: true, - serializedName: "keyName", + }, + hostName: { + serializedName: "hostName", + readOnly: true, type: { name: "String" } }, - primaryKey: { - serializedName: "primaryKey", + eventHubEndpoints: { + serializedName: "eventHubEndpoints", type: { - name: "String" + name: "Dictionary", + value: { + type: { name: "Composite", className: "EventHubProperties" } + } } }, - secondaryKey: { - serializedName: "secondaryKey", + routing: { + serializedName: "routing", type: { - name: "String" + name: "Composite", + className: "RoutingProperties" } }, - rights: { - required: true, - serializedName: "rights", - type: { + storageEndpoints: { + serializedName: "storageEndpoints", + type: { + name: "Dictionary", + value: { + type: { name: "Composite", className: "StorageEndpointProperties" } + } + } + }, + messagingEndpoints: { + serializedName: "messagingEndpoints", + type: { + name: "Dictionary", + value: { + type: { + name: "Composite", + className: "MessagingEndpointProperties" + } + } + } + }, + enableFileUploadNotifications: { + serializedName: "enableFileUploadNotifications", + type: { + name: "Boolean" + } + }, + cloudToDevice: { + serializedName: "cloudToDevice", + type: { + name: "Composite", + className: "CloudToDeviceProperties" + } + }, + comments: { + serializedName: "comments", + type: { + name: "String" + } + }, + features: { + serializedName: "features", + type: { + name: "String" + } + }, + locations: { + serializedName: "locations", + readOnly: true, + type: { + name: "Sequence", + element: { + type: { + name: "Composite", + className: "IotHubLocationDescription" + } + } + } + } + } + } +}; + +export const SharedAccessSignatureAuthorizationRule: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "SharedAccessSignatureAuthorizationRule", + modelProperties: { + keyName: { + serializedName: "keyName", + required: true, + type: { + name: "String" + } + }, + primaryKey: { + serializedName: "primaryKey", + type: { + name: "String" + } + }, + secondaryKey: { + serializedName: "secondaryKey", + type: { + name: "String" + } + }, + rights: { + serializedName: "rights", + required: true, + type: { name: "Enum", allowedValues: [ "RegistryRead", @@ -333,61 +381,29 @@ export const SharedAccessSignatureAuthorizationRule: msRest.CompositeMapper = { } }; -export const IpFilterRule: msRest.CompositeMapper = { - serializedName: "IpFilterRule", +export const IpFilterRule: coreClient.CompositeMapper = { type: { name: "Composite", className: "IpFilterRule", modelProperties: { filterName: { - required: true, serializedName: "filterName", + required: true, type: { name: "String" } }, action: { - required: true, serializedName: "action", + required: true, type: { name: "Enum", allowedValues: ["Accept", "Reject"] } }, ipMask: { - required: true, serializedName: "ipMask", - type: { - name: "String" - } - } - } - } -}; - -export const NetworkRuleSetIpRule: msRest.CompositeMapper = { - serializedName: "NetworkRuleSetIpRule", - type: { - name: "Composite", - className: "NetworkRuleSetIpRule", - modelProperties: { - filterName: { - required: true, - serializedName: "filterName", - type: { - name: "String" - } - }, - action: { - serializedName: "action", - defaultValue: "Allow", - type: { - name: "String" - } - }, - ipMask: { required: true, - serializedName: "ipMask", type: { name: "String" } @@ -396,29 +412,28 @@ export const NetworkRuleSetIpRule: msRest.CompositeMapper = { } }; -export const NetworkRuleSetProperties: msRest.CompositeMapper = { - serializedName: "NetworkRuleSetProperties", +export const NetworkRuleSetProperties: coreClient.CompositeMapper = { type: { name: "Composite", className: "NetworkRuleSetProperties", modelProperties: { defaultAction: { - serializedName: "defaultAction", defaultValue: "Deny", + serializedName: "defaultAction", type: { name: "String" } }, applyToBuiltInEventHubEndpoint: { - required: true, serializedName: "applyToBuiltInEventHubEndpoint", + required: true, type: { name: "Boolean" } }, ipRules: { - required: true, serializedName: "ipRules", + required: true, type: { name: "Sequence", element: { @@ -433,15 +448,28 @@ export const NetworkRuleSetProperties: msRest.CompositeMapper = { } }; -export const PrivateEndpoint: msRest.CompositeMapper = { - serializedName: "PrivateEndpoint", +export const NetworkRuleSetIpRule: coreClient.CompositeMapper = { type: { name: "Composite", - className: "PrivateEndpoint", + className: "NetworkRuleSetIpRule", modelProperties: { - id: { - readOnly: true, - serializedName: "id", + filterName: { + serializedName: "filterName", + required: true, + type: { + name: "String" + } + }, + action: { + defaultValue: "Allow", + serializedName: "action", + type: { + name: "String" + } + }, + ipMask: { + serializedName: "ipMask", + required: true, type: { name: "String" } @@ -450,38 +478,44 @@ export const PrivateEndpoint: msRest.CompositeMapper = { } }; -export const PrivateLinkServiceConnectionState: msRest.CompositeMapper = { - serializedName: "PrivateLinkServiceConnectionState", +export const PrivateEndpointConnection: coreClient.CompositeMapper = { type: { name: "Composite", - className: "PrivateLinkServiceConnectionState", + className: "PrivateEndpointConnection", modelProperties: { - status: { - required: true, - serializedName: "status", + id: { + serializedName: "id", + readOnly: true, type: { name: "String" } }, - description: { - required: true, - serializedName: "description", + name: { + serializedName: "name", + readOnly: true, type: { name: "String" } }, - actionsRequired: { - serializedName: "actionsRequired", + type: { + serializedName: "type", + readOnly: true, type: { name: "String" } + }, + properties: { + serializedName: "properties", + type: { + name: "Composite", + className: "PrivateEndpointConnectionProperties" + } } } } }; -export const PrivateEndpointConnectionProperties: msRest.CompositeMapper = { - serializedName: "PrivateEndpointConnectionProperties", +export const PrivateEndpointConnectionProperties: coreClient.CompositeMapper = { type: { name: "Composite", className: "PrivateEndpointConnectionProperties", @@ -494,7 +528,6 @@ export const PrivateEndpointConnectionProperties: msRest.CompositeMapper = { } }, privateLinkServiceConnectionState: { - required: true, serializedName: "privateLinkServiceConnectionState", type: { name: "Composite", @@ -505,47 +538,52 @@ export const PrivateEndpointConnectionProperties: msRest.CompositeMapper = { } }; -export const PrivateEndpointConnection: msRest.CompositeMapper = { - serializedName: "PrivateEndpointConnection", +export const PrivateEndpoint: coreClient.CompositeMapper = { type: { name: "Composite", - className: "PrivateEndpointConnection", + className: "PrivateEndpoint", modelProperties: { id: { - readOnly: true, serializedName: "id", + readOnly: true, type: { name: "String" } - }, - name: { - readOnly: true, - serializedName: "name", + } + } + } +}; + +export const PrivateLinkServiceConnectionState: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "PrivateLinkServiceConnectionState", + modelProperties: { + status: { + serializedName: "status", + required: true, type: { name: "String" } }, - type: { - readOnly: true, - serializedName: "type", + description: { + serializedName: "description", + required: true, type: { name: "String" } }, - properties: { - required: true, - serializedName: "properties", + actionsRequired: { + serializedName: "actionsRequired", type: { - name: "Composite", - className: "PrivateEndpointConnectionProperties" + name: "String" } } } } }; -export const EventHubProperties: msRest.CompositeMapper = { - serializedName: "EventHubProperties", +export const EventHubProperties: coreClient.CompositeMapper = { type: { name: "Composite", className: "EventHubProperties", @@ -563,8 +601,8 @@ export const EventHubProperties: msRest.CompositeMapper = { } }, partitionIds: { - readOnly: true, serializedName: "partitionIds", + readOnly: true, type: { name: "Sequence", element: { @@ -575,15 +613,15 @@ export const EventHubProperties: msRest.CompositeMapper = { } }, path: { - readOnly: true, serializedName: "path", + readOnly: true, type: { name: "String" } }, endpoint: { - readOnly: true, serializedName: "endpoint", + readOnly: true, type: { name: "String" } @@ -592,41 +630,128 @@ export const EventHubProperties: msRest.CompositeMapper = { } }; -export const ManagedIdentity: msRest.CompositeMapper = { - serializedName: "ManagedIdentity", +export const RoutingProperties: coreClient.CompositeMapper = { type: { name: "Composite", - className: "ManagedIdentity", + className: "RoutingProperties", modelProperties: { - userAssignedIdentity: { - serializedName: "userAssignedIdentity", + endpoints: { + serializedName: "endpoints", type: { - name: "String" + name: "Composite", + className: "RoutingEndpoints" } - } - } - } -}; - -export const RoutingServiceBusQueueEndpointProperties: msRest.CompositeMapper = { - serializedName: "RoutingServiceBusQueueEndpointProperties", - type: { - name: "Composite", - className: "RoutingServiceBusQueueEndpointProperties", - modelProperties: { - id: { - serializedName: "id", + }, + routes: { + serializedName: "routes", type: { - name: "String" + name: "Sequence", + element: { + type: { + name: "Composite", + className: "RouteProperties" + } + } } }, - connectionString: { - serializedName: "connectionString", + fallbackRoute: { + serializedName: "fallbackRoute", type: { - name: "String" + name: "Composite", + className: "FallbackRouteProperties" } }, - endpointUri: { + enrichments: { + serializedName: "enrichments", + type: { + name: "Sequence", + element: { + type: { + name: "Composite", + className: "EnrichmentProperties" + } + } + } + } + } + } +}; + +export const RoutingEndpoints: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "RoutingEndpoints", + modelProperties: { + serviceBusQueues: { + serializedName: "serviceBusQueues", + type: { + name: "Sequence", + element: { + type: { + name: "Composite", + className: "RoutingServiceBusQueueEndpointProperties" + } + } + } + }, + serviceBusTopics: { + serializedName: "serviceBusTopics", + type: { + name: "Sequence", + element: { + type: { + name: "Composite", + className: "RoutingServiceBusTopicEndpointProperties" + } + } + } + }, + eventHubs: { + serializedName: "eventHubs", + type: { + name: "Sequence", + element: { + type: { + name: "Composite", + className: "RoutingEventHubProperties" + } + } + } + }, + storageContainers: { + serializedName: "storageContainers", + type: { + name: "Sequence", + element: { + type: { + name: "Composite", + className: "RoutingStorageContainerProperties" + } + } + } + } + } + } +}; + +export const RoutingServiceBusQueueEndpointProperties: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "RoutingServiceBusQueueEndpointProperties", + modelProperties: { + id: { + serializedName: "id", + type: { + name: "String" + } + }, + connectionString: { + serializedName: "connectionString", + type: { + name: "String" + } + }, + endpointUri: { serializedName: "endpointUri", type: { name: "String" @@ -652,11 +777,11 @@ export const RoutingServiceBusQueueEndpointProperties: msRest.CompositeMapper = } }, name: { - required: true, - serializedName: "name", constraints: { - Pattern: /^[A-Za-z0-9-._]{1,64}$/ + Pattern: new RegExp("^[A-Za-z0-9-._]{1,64}$") }, + serializedName: "name", + required: true, type: { name: "String" } @@ -677,8 +802,22 @@ export const RoutingServiceBusQueueEndpointProperties: msRest.CompositeMapper = } }; -export const RoutingServiceBusTopicEndpointProperties: msRest.CompositeMapper = { - serializedName: "RoutingServiceBusTopicEndpointProperties", +export const ManagedIdentity: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "ManagedIdentity", + modelProperties: { + userAssignedIdentity: { + serializedName: "userAssignedIdentity", + type: { + name: "String" + } + } + } + } +}; + +export const RoutingServiceBusTopicEndpointProperties: coreClient.CompositeMapper = { type: { name: "Composite", className: "RoutingServiceBusTopicEndpointProperties", @@ -721,11 +860,11 @@ export const RoutingServiceBusTopicEndpointProperties: msRest.CompositeMapper = } }, name: { - required: true, - serializedName: "name", constraints: { - Pattern: /^[A-Za-z0-9-._]{1,64}$/ + Pattern: new RegExp("^[A-Za-z0-9-._]{1,64}$") }, + serializedName: "name", + required: true, type: { name: "String" } @@ -746,8 +885,7 @@ export const RoutingServiceBusTopicEndpointProperties: msRest.CompositeMapper = } }; -export const RoutingEventHubProperties: msRest.CompositeMapper = { - serializedName: "RoutingEventHubProperties", +export const RoutingEventHubProperties: coreClient.CompositeMapper = { type: { name: "Composite", className: "RoutingEventHubProperties", @@ -790,11 +928,11 @@ export const RoutingEventHubProperties: msRest.CompositeMapper = { } }, name: { - required: true, - serializedName: "name", constraints: { - Pattern: /^[A-Za-z0-9-._]{1,64}$/ + Pattern: new RegExp("^[A-Za-z0-9-._]{1,64}$") }, + serializedName: "name", + required: true, type: { name: "String" } @@ -815,8 +953,7 @@ export const RoutingEventHubProperties: msRest.CompositeMapper = { } }; -export const RoutingStorageContainerProperties: msRest.CompositeMapper = { - serializedName: "RoutingStorageContainerProperties", +export const RoutingStorageContainerProperties: coreClient.CompositeMapper = { type: { name: "Composite", className: "RoutingStorageContainerProperties", @@ -853,11 +990,11 @@ export const RoutingStorageContainerProperties: msRest.CompositeMapper = { } }, name: { - required: true, - serializedName: "name", constraints: { - Pattern: /^[A-Za-z0-9-._]{1,64}$/ + Pattern: new RegExp("^[A-Za-z0-9-._]{1,64}$") }, + serializedName: "name", + required: true, type: { name: "String" } @@ -875,8 +1012,8 @@ export const RoutingStorageContainerProperties: msRest.CompositeMapper = { } }, containerName: { - required: true, serializedName: "containerName", + required: true, type: { name: "String" } @@ -888,21 +1025,21 @@ export const RoutingStorageContainerProperties: msRest.CompositeMapper = { } }, batchFrequencyInSeconds: { - serializedName: "batchFrequencyInSeconds", constraints: { InclusiveMaximum: 720, InclusiveMinimum: 60 }, + serializedName: "batchFrequencyInSeconds", type: { name: "Number" } }, maxChunkSizeInBytes: { - serializedName: "maxChunkSizeInBytes", constraints: { InclusiveMaximum: 524288000, InclusiveMinimum: 10485760 }, + serializedName: "maxChunkSizeInBytes", type: { name: "Number" } @@ -917,83 +1054,24 @@ export const RoutingStorageContainerProperties: msRest.CompositeMapper = { } }; -export const RoutingEndpoints: msRest.CompositeMapper = { - serializedName: "RoutingEndpoints", - type: { - name: "Composite", - className: "RoutingEndpoints", - modelProperties: { - serviceBusQueues: { - serializedName: "serviceBusQueues", - type: { - name: "Sequence", - element: { - type: { - name: "Composite", - className: "RoutingServiceBusQueueEndpointProperties" - } - } - } - }, - serviceBusTopics: { - serializedName: "serviceBusTopics", - type: { - name: "Sequence", - element: { - type: { - name: "Composite", - className: "RoutingServiceBusTopicEndpointProperties" - } - } - } - }, - eventHubs: { - serializedName: "eventHubs", - type: { - name: "Sequence", - element: { - type: { - name: "Composite", - className: "RoutingEventHubProperties" - } - } - } - }, - storageContainers: { - serializedName: "storageContainers", - type: { - name: "Sequence", - element: { - type: { - name: "Composite", - className: "RoutingStorageContainerProperties" - } - } - } - } - } - } -}; - -export const RouteProperties: msRest.CompositeMapper = { - serializedName: "RouteProperties", +export const RouteProperties: coreClient.CompositeMapper = { type: { name: "Composite", className: "RouteProperties", modelProperties: { name: { - required: true, - serializedName: "name", constraints: { - Pattern: /^[A-Za-z0-9-._]{1,64}$/ + Pattern: new RegExp("^[A-Za-z0-9-._]{1,64}$") }, + serializedName: "name", + required: true, type: { name: "String" } }, source: { - required: true, serializedName: "source", + required: true, type: { name: "String" } @@ -1005,12 +1083,12 @@ export const RouteProperties: msRest.CompositeMapper = { } }, endpointNames: { - required: true, - serializedName: "endpointNames", constraints: { - MaxItems: 1, - MinItems: 1 + MinItems: 1, + MaxItems: 1 }, + serializedName: "endpointNames", + required: true, type: { name: "Sequence", element: { @@ -1021,8 +1099,8 @@ export const RouteProperties: msRest.CompositeMapper = { } }, isEnabled: { - required: true, serializedName: "isEnabled", + required: true, type: { name: "Boolean" } @@ -1031,8 +1109,7 @@ export const RouteProperties: msRest.CompositeMapper = { } }; -export const FallbackRouteProperties: msRest.CompositeMapper = { - serializedName: "FallbackRouteProperties", +export const FallbackRouteProperties: coreClient.CompositeMapper = { type: { name: "Composite", className: "FallbackRouteProperties", @@ -1044,10 +1121,8 @@ export const FallbackRouteProperties: msRest.CompositeMapper = { } }, source: { - required: true, - isConstant: true, serializedName: "source", - defaultValue: "DeviceMessages", + required: true, type: { name: "String" } @@ -1059,12 +1134,12 @@ export const FallbackRouteProperties: msRest.CompositeMapper = { } }, endpointNames: { - required: true, - serializedName: "endpointNames", constraints: { - MaxItems: 1, - MinItems: 1 + MinItems: 1, + MaxItems: 1 }, + serializedName: "endpointNames", + required: true, type: { name: "Sequence", element: { @@ -1075,8 +1150,8 @@ export const FallbackRouteProperties: msRest.CompositeMapper = { } }, isEnabled: { - required: true, serializedName: "isEnabled", + required: true, type: { name: "Boolean" } @@ -1085,32 +1160,31 @@ export const FallbackRouteProperties: msRest.CompositeMapper = { } }; -export const EnrichmentProperties: msRest.CompositeMapper = { - serializedName: "EnrichmentProperties", +export const EnrichmentProperties: coreClient.CompositeMapper = { type: { name: "Composite", className: "EnrichmentProperties", modelProperties: { key: { - required: true, serializedName: "key", + required: true, type: { name: "String" } }, value: { - required: true, serializedName: "value", + required: true, type: { name: "String" } }, endpointNames: { - required: true, - serializedName: "endpointNames", constraints: { MinItems: 1 }, + serializedName: "endpointNames", + required: true, type: { name: "Sequence", element: { @@ -1124,84 +1198,35 @@ export const EnrichmentProperties: msRest.CompositeMapper = { } }; -export const RoutingProperties: msRest.CompositeMapper = { - serializedName: "RoutingProperties", +export const StorageEndpointProperties: coreClient.CompositeMapper = { type: { name: "Composite", - className: "RoutingProperties", + className: "StorageEndpointProperties", modelProperties: { - endpoints: { - serializedName: "endpoints", + sasTtlAsIso8601: { + serializedName: "sasTtlAsIso8601", type: { - name: "Composite", - className: "RoutingEndpoints" + name: "TimeSpan" } }, - routes: { - serializedName: "routes", + connectionString: { + serializedName: "connectionString", + required: true, type: { - name: "Sequence", - element: { - type: { - name: "Composite", - className: "RouteProperties" - } - } + name: "String" } }, - fallbackRoute: { - serializedName: "fallbackRoute", + containerName: { + serializedName: "containerName", + required: true, type: { - name: "Composite", - className: "FallbackRouteProperties" + name: "String" } }, - enrichments: { - serializedName: "enrichments", + authenticationType: { + serializedName: "authenticationType", type: { - name: "Sequence", - element: { - type: { - name: "Composite", - className: "EnrichmentProperties" - } - } - } - } - } - } -}; - -export const StorageEndpointProperties: msRest.CompositeMapper = { - serializedName: "StorageEndpointProperties", - type: { - name: "Composite", - className: "StorageEndpointProperties", - modelProperties: { - sasTtlAsIso8601: { - serializedName: "sasTtlAsIso8601", - type: { - name: "TimeSpan" - } - }, - connectionString: { - required: true, - serializedName: "connectionString", - type: { - name: "String" - } - }, - containerName: { - required: true, - serializedName: "containerName", - type: { - name: "String" - } - }, - authenticationType: { - serializedName: "authenticationType", - type: { - name: "String" + name: "String" } }, identity: { @@ -1215,8 +1240,7 @@ export const StorageEndpointProperties: msRest.CompositeMapper = { } }; -export const MessagingEndpointProperties: msRest.CompositeMapper = { - serializedName: "MessagingEndpointProperties", +export const MessagingEndpointProperties: coreClient.CompositeMapper = { type: { name: "Composite", className: "MessagingEndpointProperties", @@ -1234,21 +1258,52 @@ export const MessagingEndpointProperties: msRest.CompositeMapper = { } }, maxDeliveryCount: { + constraints: { + InclusiveMaximum: 100, + InclusiveMinimum: 1 + }, serializedName: "maxDeliveryCount", + type: { + name: "Number" + } + } + } + } +}; + +export const CloudToDeviceProperties: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "CloudToDeviceProperties", + modelProperties: { + maxDeliveryCount: { constraints: { InclusiveMaximum: 100, InclusiveMinimum: 1 }, + serializedName: "maxDeliveryCount", type: { name: "Number" } + }, + defaultTtlAsIso8601: { + serializedName: "defaultTtlAsIso8601", + type: { + name: "TimeSpan" + } + }, + feedback: { + serializedName: "feedback", + type: { + name: "Composite", + className: "FeedbackProperties" + } } } } }; -export const FeedbackProperties: msRest.CompositeMapper = { - serializedName: "FeedbackProperties", +export const FeedbackProperties: coreClient.CompositeMapper = { type: { name: "Composite", className: "FeedbackProperties", @@ -1266,11 +1321,11 @@ export const FeedbackProperties: msRest.CompositeMapper = { } }, maxDeliveryCount: { - serializedName: "maxDeliveryCount", constraints: { InclusiveMaximum: 100, InclusiveMinimum: 1 }, + serializedName: "maxDeliveryCount", type: { name: "Number" } @@ -1279,374 +1334,467 @@ export const FeedbackProperties: msRest.CompositeMapper = { } }; -export const CloudToDeviceProperties: msRest.CompositeMapper = { - serializedName: "CloudToDeviceProperties", +export const IotHubLocationDescription: coreClient.CompositeMapper = { type: { name: "Composite", - className: "CloudToDeviceProperties", + className: "IotHubLocationDescription", modelProperties: { - maxDeliveryCount: { - serializedName: "maxDeliveryCount", - constraints: { - InclusiveMaximum: 100, - InclusiveMinimum: 1 - }, - type: { - name: "Number" - } - }, - defaultTtlAsIso8601: { - serializedName: "defaultTtlAsIso8601", + location: { + serializedName: "location", type: { - name: "TimeSpan" + name: "String" } }, - feedback: { - serializedName: "feedback", + role: { + serializedName: "role", type: { - name: "Composite", - className: "FeedbackProperties" + name: "String" } } } } }; -export const IotHubLocationDescription: msRest.CompositeMapper = { - serializedName: "IotHubLocationDescription", +export const IotHubSkuInfo: coreClient.CompositeMapper = { type: { name: "Composite", - className: "IotHubLocationDescription", + className: "IotHubSkuInfo", modelProperties: { - location: { - serializedName: "location", + name: { + serializedName: "name", + required: true, type: { name: "String" } }, - role: { - serializedName: "role", + tier: { + serializedName: "tier", + readOnly: true, type: { - name: "String" + name: "Enum", + allowedValues: ["Free", "Standard", "Basic"] + } + }, + capacity: { + serializedName: "capacity", + type: { + name: "Number" } } } } }; -export const IotHubProperties: msRest.CompositeMapper = { - serializedName: "IotHubProperties", +export const ArmIdentity: coreClient.CompositeMapper = { type: { name: "Composite", - className: "IotHubProperties", + className: "ArmIdentity", modelProperties: { - authorizationPolicies: { - serializedName: "authorizationPolicies", + principalId: { + serializedName: "principalId", + readOnly: true, type: { - name: "Sequence", - element: { - type: { - name: "Composite", - className: "SharedAccessSignatureAuthorizationRule" - } - } + name: "String" } }, - publicNetworkAccess: { - serializedName: "publicNetworkAccess", + tenantId: { + serializedName: "tenantId", + readOnly: true, type: { name: "String" } }, - ipFilterRules: { - serializedName: "ipFilterRules", + type: { + serializedName: "type", type: { - name: "Sequence", - element: { - type: { - name: "Composite", - className: "IpFilterRule" - } - } + name: "Enum", + allowedValues: [ + "SystemAssigned", + "UserAssigned", + "SystemAssigned, UserAssigned", + "None" + ] } }, - networkRuleSets: { - serializedName: "networkRuleSets", + userAssignedIdentities: { + serializedName: "userAssignedIdentities", type: { - name: "Composite", - className: "NetworkRuleSetProperties" + name: "Dictionary", + value: { type: { name: "Composite", className: "ArmUserIdentity" } } } - }, - minTlsVersion: { - serializedName: "minTlsVersion", + } + } + } +}; + +export const ArmUserIdentity: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "ArmUserIdentity", + modelProperties: { + principalId: { + serializedName: "principalId", + readOnly: true, type: { name: "String" } }, - privateEndpointConnections: { - serializedName: "privateEndpointConnections", + clientId: { + serializedName: "clientId", + readOnly: true, type: { - name: "Sequence", - element: { - type: { - name: "Composite", - className: "PrivateEndpointConnection" - } - } + name: "String" } - }, - provisioningState: { + } + } + } +}; + +export const Resource: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "Resource", + modelProperties: { + id: { + serializedName: "id", readOnly: true, - serializedName: "provisioningState", type: { name: "String" } }, - state: { + name: { + constraints: { + Pattern: new RegExp("^(?![0-9]+$)(?!-)[a-zA-Z0-9-]{2,49}[a-zA-Z0-9]$") + }, + serializedName: "name", readOnly: true, - serializedName: "state", type: { name: "String" } }, - hostName: { + type: { + serializedName: "type", readOnly: true, - serializedName: "hostName", type: { name: "String" } }, - eventHubEndpoints: { - serializedName: "eventHubEndpoints", + location: { + serializedName: "location", + required: true, type: { - name: "Dictionary", - value: { - type: { - name: "Composite", - className: "EventHubProperties" - } - } + name: "String" } }, - routing: { - serializedName: "routing", + tags: { + serializedName: "tags", type: { - name: "Composite", - className: "RoutingProperties" + name: "Dictionary", + value: { type: { name: "String" } } } - }, - storageEndpoints: { - serializedName: "storageEndpoints", + } + } + } +}; + +export const TagsResource: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "TagsResource", + modelProperties: { + tags: { + serializedName: "tags", type: { name: "Dictionary", - value: { + value: { type: { name: "String" } } + } + } + } + } +}; + +export const IotHubDescriptionListResult: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "IotHubDescriptionListResult", + modelProperties: { + value: { + serializedName: "value", + type: { + name: "Sequence", + element: { type: { name: "Composite", - className: "StorageEndpointProperties" + className: "IotHubDescription" } } } }, - messagingEndpoints: { - serializedName: "messagingEndpoints", - type: { - name: "Dictionary", - value: { - type: { - name: "Composite", - className: "MessagingEndpointProperties" - } - } - } - }, - enableFileUploadNotifications: { - serializedName: "enableFileUploadNotifications", + nextLink: { + serializedName: "nextLink", + readOnly: true, type: { - name: "Boolean" + name: "String" } - }, - cloudToDevice: { - serializedName: "cloudToDevice", + } + } + } +}; + +export const RegistryStatistics: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "RegistryStatistics", + modelProperties: { + totalDeviceCount: { + serializedName: "totalDeviceCount", + readOnly: true, type: { - name: "Composite", - className: "CloudToDeviceProperties" + name: "Number" } }, - comments: { - serializedName: "comments", + enabledDeviceCount: { + serializedName: "enabledDeviceCount", + readOnly: true, type: { - name: "String" + name: "Number" } }, - features: { - serializedName: "features", + disabledDeviceCount: { + serializedName: "disabledDeviceCount", + readOnly: true, type: { - name: "String" + name: "Number" } - }, - locations: { - readOnly: true, - serializedName: "locations", + } + } + } +}; + +export const IotHubSkuDescriptionListResult: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "IotHubSkuDescriptionListResult", + modelProperties: { + value: { + serializedName: "value", type: { name: "Sequence", element: { type: { name: "Composite", - className: "IotHubLocationDescription" + className: "IotHubSkuDescription" } } } + }, + nextLink: { + serializedName: "nextLink", + readOnly: true, + type: { + name: "String" + } } } } }; -export const IotHubSkuInfo: msRest.CompositeMapper = { - serializedName: "IotHubSkuInfo", +export const IotHubSkuDescription: coreClient.CompositeMapper = { type: { name: "Composite", - className: "IotHubSkuInfo", + className: "IotHubSkuDescription", modelProperties: { - name: { - required: true, - serializedName: "name", + resourceType: { + serializedName: "resourceType", + readOnly: true, type: { name: "String" } }, - tier: { - readOnly: true, - serializedName: "tier", + sku: { + serializedName: "sku", type: { - name: "Enum", - allowedValues: ["Free", "Standard", "Basic"] + name: "Composite", + className: "IotHubSkuInfo" } }, capacity: { serializedName: "capacity", type: { - name: "Number" + name: "Composite", + className: "IotHubCapacity" } } } } }; -export const GroupIdInformationProperties: msRest.CompositeMapper = { - serializedName: "GroupIdInformationProperties", +export const IotHubCapacity: coreClient.CompositeMapper = { type: { name: "Composite", - className: "GroupIdInformationProperties", + className: "IotHubCapacity", modelProperties: { - groupId: { - serializedName: "groupId", + minimum: { + constraints: { + InclusiveMaximum: 1, + InclusiveMinimum: 1 + }, + serializedName: "minimum", + readOnly: true, type: { - name: "String" + name: "Number" } }, - requiredMembers: { - serializedName: "requiredMembers", + maximum: { + serializedName: "maximum", + readOnly: true, type: { - name: "Sequence", - element: { - type: { - name: "String" - } - } + name: "Number" } }, - requiredZoneNames: { - serializedName: "requiredZoneNames", + default: { + serializedName: "default", + readOnly: true, + type: { + name: "Number" + } + }, + scaleType: { + serializedName: "scaleType", + readOnly: true, + type: { + name: "Enum", + allowedValues: ["Automatic", "Manual", "None"] + } + } + } + } +}; + +export const EventHubConsumerGroupsListResult: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "EventHubConsumerGroupsListResult", + modelProperties: { + value: { + serializedName: "value", type: { name: "Sequence", element: { type: { - name: "String" + name: "Composite", + className: "EventHubConsumerGroupInfo" } } } + }, + nextLink: { + serializedName: "nextLink", + readOnly: true, + type: { + name: "String" + } } } } }; -export const GroupIdInformation: msRest.CompositeMapper = { - serializedName: "GroupIdInformation", +export const EventHubConsumerGroupInfo: coreClient.CompositeMapper = { type: { name: "Composite", - className: "GroupIdInformation", + className: "EventHubConsumerGroupInfo", modelProperties: { + properties: { + serializedName: "properties", + type: { + name: "Dictionary", + value: { type: { name: "any" } } + } + }, id: { - readOnly: true, serializedName: "id", + readOnly: true, type: { name: "String" } }, name: { - readOnly: true, serializedName: "name", + readOnly: true, type: { name: "String" } }, type: { - readOnly: true, serializedName: "type", + readOnly: true, type: { name: "String" } }, + etag: { + serializedName: "etag", + readOnly: true, + type: { + name: "String" + } + } + } + } +}; + +export const EventHubConsumerGroupBodyDescription: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "EventHubConsumerGroupBodyDescription", + modelProperties: { properties: { - required: true, serializedName: "properties", type: { name: "Composite", - className: "GroupIdInformationProperties" + className: "EventHubConsumerGroupName" } } } } }; -export const PrivateLinkResources: msRest.CompositeMapper = { - serializedName: "PrivateLinkResources", +export const EventHubConsumerGroupName: coreClient.CompositeMapper = { type: { name: "Composite", - className: "PrivateLinkResources", + className: "EventHubConsumerGroupName", modelProperties: { - value: { - serializedName: "value", + name: { + serializedName: "name", + required: true, type: { - name: "Sequence", - element: { - type: { - name: "Composite", - className: "GroupIdInformation" - } - } + name: "String" } } } } }; -export const ArmUserIdentity: msRest.CompositeMapper = { - serializedName: "ArmUserIdentity", +export const JobResponseListResult: coreClient.CompositeMapper = { type: { name: "Composite", - className: "ArmUserIdentity", + className: "JobResponseListResult", modelProperties: { - principalId: { - readOnly: true, - serializedName: "principalId", + value: { + serializedName: "value", type: { - name: "String" + name: "Sequence", + element: { + type: { + name: "Composite", + className: "JobResponse" + } + } } }, - clientId: { + nextLink: { + serializedName: "nextLink", readOnly: true, - serializedName: "clientId", type: { name: "String" } @@ -1655,504 +1803,468 @@ export const ArmUserIdentity: msRest.CompositeMapper = { } }; -export const ArmIdentity: msRest.CompositeMapper = { - serializedName: "ArmIdentity", +export const JobResponse: coreClient.CompositeMapper = { type: { name: "Composite", - className: "ArmIdentity", + className: "JobResponse", modelProperties: { - principalId: { + jobId: { + serializedName: "jobId", readOnly: true, - serializedName: "principalId", type: { name: "String" } }, - tenantId: { + startTimeUtc: { + serializedName: "startTimeUtc", readOnly: true, - serializedName: "tenantId", type: { - name: "String" + name: "DateTimeRfc1123" + } + }, + endTimeUtc: { + serializedName: "endTimeUtc", + readOnly: true, + type: { + name: "DateTimeRfc1123" } }, type: { serializedName: "type", + readOnly: true, type: { - name: "Enum", - allowedValues: ["SystemAssigned", "UserAssigned", "SystemAssigned, UserAssigned", "None"] + name: "String" } }, - userAssignedIdentities: { - serializedName: "userAssignedIdentities", + status: { + serializedName: "status", + readOnly: true, type: { - name: "Dictionary", - value: { - type: { - name: "Composite", - className: "ArmUserIdentity" - } - } - } - } - } - } -}; - -export const Resource: msRest.CompositeMapper = { - serializedName: "Resource", - type: { - name: "Composite", - className: "Resource", - modelProperties: { - id: { - readOnly: true, - serializedName: "id", - type: { - name: "String" + name: "Enum", + allowedValues: [ + "unknown", + "enqueued", + "running", + "completed", + "failed", + "cancelled" + ] } }, - name: { + failureReason: { + serializedName: "failureReason", readOnly: true, - serializedName: "name", - constraints: { - Pattern: /^(?![0-9]+$)(?!-)[a-zA-Z0-9-]{2,49}[a-zA-Z0-9]$/ - }, type: { name: "String" } }, - type: { + statusMessage: { + serializedName: "statusMessage", readOnly: true, - serializedName: "type", type: { name: "String" } }, - location: { - required: true, - serializedName: "location", + parentJobId: { + serializedName: "parentJobId", + readOnly: true, type: { name: "String" } - }, - tags: { - serializedName: "tags", + } + } + } +}; + +export const IotHubQuotaMetricInfoListResult: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "IotHubQuotaMetricInfoListResult", + modelProperties: { + value: { + serializedName: "value", type: { - name: "Dictionary", - value: { + name: "Sequence", + element: { type: { - name: "String" + name: "Composite", + className: "IotHubQuotaMetricInfo" } } } + }, + nextLink: { + serializedName: "nextLink", + readOnly: true, + type: { + name: "String" + } } } } }; -export const IotHubDescription: msRest.CompositeMapper = { - serializedName: "IotHubDescription", +export const IotHubQuotaMetricInfo: coreClient.CompositeMapper = { type: { name: "Composite", - className: "IotHubDescription", + className: "IotHubQuotaMetricInfo", modelProperties: { - ...Resource.type.modelProperties, - etag: { - serializedName: "etag", + name: { + serializedName: "name", + readOnly: true, type: { name: "String" } }, - properties: { - serializedName: "properties", + currentValue: { + serializedName: "currentValue", + readOnly: true, type: { - name: "Composite", - className: "IotHubProperties" + name: "Number" } }, - sku: { - required: true, - serializedName: "sku", + maxValue: { + serializedName: "maxValue", + readOnly: true, type: { - name: "Composite", - className: "IotHubSkuInfo" + name: "Number" + } + } + } + } +}; + +export const EndpointHealthDataListResult: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "EndpointHealthDataListResult", + modelProperties: { + value: { + serializedName: "value", + type: { + name: "Sequence", + element: { + type: { + name: "Composite", + className: "EndpointHealthData" + } + } } }, - identity: { - serializedName: "identity", + nextLink: { + serializedName: "nextLink", + readOnly: true, type: { - name: "Composite", - className: "ArmIdentity" + name: "String" } } } } }; -export const OperationDisplay: msRest.CompositeMapper = { - serializedName: "Operation_display", +export const EndpointHealthData: coreClient.CompositeMapper = { type: { name: "Composite", - className: "OperationDisplay", + className: "EndpointHealthData", modelProperties: { - provider: { - readOnly: true, - serializedName: "provider", + endpointId: { + serializedName: "endpointId", type: { name: "String" } }, - resource: { - readOnly: true, - serializedName: "resource", + healthStatus: { + serializedName: "healthStatus", type: { name: "String" } }, - operation: { - readOnly: true, - serializedName: "operation", + lastKnownError: { + serializedName: "lastKnownError", type: { name: "String" } }, - description: { - readOnly: true, - serializedName: "description", + lastKnownErrorTime: { + serializedName: "lastKnownErrorTime", type: { - name: "String" + name: "DateTimeRfc1123" + } + }, + lastSuccessfulSendAttemptTime: { + serializedName: "lastSuccessfulSendAttemptTime", + type: { + name: "DateTimeRfc1123" + } + }, + lastSendAttemptTime: { + serializedName: "lastSendAttemptTime", + type: { + name: "DateTimeRfc1123" } } } } }; -export const Operation: msRest.CompositeMapper = { - serializedName: "Operation", +export const OperationInputs: coreClient.CompositeMapper = { type: { name: "Composite", - className: "Operation", + className: "OperationInputs", modelProperties: { name: { - readOnly: true, serializedName: "name", + required: true, type: { name: "String" } - }, - display: { - serializedName: "display", - type: { - name: "Composite", - className: "OperationDisplay" - } } } } }; -export const ErrorDetails: msRest.CompositeMapper = { - serializedName: "ErrorDetails", +export const IotHubNameAvailabilityInfo: coreClient.CompositeMapper = { type: { name: "Composite", - className: "ErrorDetails", + className: "IotHubNameAvailabilityInfo", modelProperties: { - code: { + nameAvailable: { + serializedName: "nameAvailable", readOnly: true, - serializedName: "code", type: { - name: "String" + name: "Boolean" } }, - httpStatusCode: { + reason: { + serializedName: "reason", readOnly: true, - serializedName: "httpStatusCode", type: { - name: "String" + name: "Enum", + allowedValues: ["Invalid", "AlreadyExists"] } }, message: { - readOnly: true, serializedName: "message", type: { name: "String" } - }, - details: { - readOnly: true, - serializedName: "details", - type: { - name: "String" - } } } } }; -export const IotHubQuotaMetricInfo: msRest.CompositeMapper = { - serializedName: "IotHubQuotaMetricInfo", +export const UserSubscriptionQuotaListResult: coreClient.CompositeMapper = { type: { name: "Composite", - className: "IotHubQuotaMetricInfo", + className: "UserSubscriptionQuotaListResult", modelProperties: { - name: { - readOnly: true, - serializedName: "name", - type: { - name: "String" - } - }, - currentValue: { - readOnly: true, - serializedName: "currentValue", + value: { + serializedName: "value", type: { - name: "Number" + name: "Sequence", + element: { + type: { + name: "Composite", + className: "UserSubscriptionQuota" + } + } } }, - maxValue: { + nextLink: { + serializedName: "nextLink", readOnly: true, - serializedName: "maxValue", type: { - name: "Number" + name: "String" } } } } }; -export const EndpointHealthData: msRest.CompositeMapper = { - serializedName: "EndpointHealthData", +export const UserSubscriptionQuota: coreClient.CompositeMapper = { type: { name: "Composite", - className: "EndpointHealthData", + className: "UserSubscriptionQuota", modelProperties: { - endpointId: { - serializedName: "endpointId", + id: { + serializedName: "id", type: { name: "String" } }, - healthStatus: { - serializedName: "healthStatus", + type: { + serializedName: "type", type: { name: "String" } }, - lastKnownError: { - serializedName: "lastKnownError", + unit: { + serializedName: "unit", type: { name: "String" } }, - lastKnownErrorTime: { - serializedName: "lastKnownErrorTime", + currentValue: { + serializedName: "currentValue", type: { - name: "DateTimeRfc1123" + name: "Number" } }, - lastSuccessfulSendAttemptTime: { - serializedName: "lastSuccessfulSendAttemptTime", + limit: { + serializedName: "limit", type: { - name: "DateTimeRfc1123" + name: "Number" } }, - lastSendAttemptTime: { - serializedName: "lastSendAttemptTime", + name: { + serializedName: "name", type: { - name: "DateTimeRfc1123" + name: "Composite", + className: "Name" } } } } }; -export const RegistryStatistics: msRest.CompositeMapper = { - serializedName: "RegistryStatistics", +export const Name: coreClient.CompositeMapper = { type: { name: "Composite", - className: "RegistryStatistics", + className: "Name", modelProperties: { - totalDeviceCount: { - readOnly: true, - serializedName: "totalDeviceCount", + value: { + serializedName: "value", type: { - name: "Number" + name: "String" } }, - enabledDeviceCount: { - readOnly: true, - serializedName: "enabledDeviceCount", - type: { - name: "Number" - } - }, - disabledDeviceCount: { - readOnly: true, - serializedName: "disabledDeviceCount", + localizedValue: { + serializedName: "localizedValue", type: { - name: "Number" + name: "String" } } } } }; -export const JobResponse: msRest.CompositeMapper = { - serializedName: "JobResponse", +export const TestAllRoutesInput: coreClient.CompositeMapper = { type: { name: "Composite", - className: "JobResponse", + className: "TestAllRoutesInput", modelProperties: { - jobId: { - readOnly: true, - serializedName: "jobId", + routingSource: { + serializedName: "routingSource", type: { name: "String" } }, - startTimeUtc: { - readOnly: true, - serializedName: "startTimeUtc", - type: { - name: "DateTimeRfc1123" - } - }, - endTimeUtc: { - readOnly: true, - serializedName: "endTimeUtc", - type: { - name: "DateTimeRfc1123" - } - }, - type: { - readOnly: true, - serializedName: "type", + message: { + serializedName: "message", type: { - name: "String" + name: "Composite", + className: "RoutingMessage" } }, - status: { - readOnly: true, - serializedName: "status", + twin: { + serializedName: "twin", type: { - name: "Enum", - allowedValues: ["unknown", "enqueued", "running", "completed", "failed", "cancelled"] + name: "Composite", + className: "RoutingTwin" } - }, - failureReason: { - readOnly: true, - serializedName: "failureReason", + } + } + } +}; + +export const RoutingMessage: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "RoutingMessage", + modelProperties: { + body: { + serializedName: "body", type: { name: "String" } }, - statusMessage: { - readOnly: true, - serializedName: "statusMessage", + appProperties: { + serializedName: "appProperties", type: { - name: "String" + name: "Dictionary", + value: { type: { name: "String" } } } }, - parentJobId: { - readOnly: true, - serializedName: "parentJobId", + systemProperties: { + serializedName: "systemProperties", type: { - name: "String" + name: "Dictionary", + value: { type: { name: "String" } } } } } } }; -export const IotHubCapacity: msRest.CompositeMapper = { - serializedName: "IotHubCapacity", +export const RoutingTwin: coreClient.CompositeMapper = { type: { name: "Composite", - className: "IotHubCapacity", + className: "RoutingTwin", modelProperties: { - minimum: { - readOnly: true, - serializedName: "minimum", - constraints: { - InclusiveMaximum: 1, - InclusiveMinimum: 1 - }, - type: { - name: "Number" - } - }, - maximum: { - readOnly: true, - serializedName: "maximum", - type: { - name: "Number" - } - }, - default: { - readOnly: true, - serializedName: "default", + tags: { + serializedName: "tags", type: { - name: "Number" + name: "Dictionary", + value: { type: { name: "any" } } } }, - scaleType: { - readOnly: true, - serializedName: "scaleType", + properties: { + serializedName: "properties", type: { - name: "Enum", - allowedValues: ["Automatic", "Manual", "None"] + name: "Composite", + className: "RoutingTwinProperties" } } } } }; -export const IotHubSkuDescription: msRest.CompositeMapper = { - serializedName: "IotHubSkuDescription", +export const RoutingTwinProperties: coreClient.CompositeMapper = { type: { name: "Composite", - className: "IotHubSkuDescription", + className: "RoutingTwinProperties", modelProperties: { - resourceType: { - readOnly: true, - serializedName: "resourceType", - type: { - name: "String" - } - }, - sku: { - required: true, - serializedName: "sku", + desired: { + serializedName: "desired", type: { - name: "Composite", - className: "IotHubSkuInfo" + name: "Dictionary", + value: { type: { name: "any" } } } }, - capacity: { - required: true, - serializedName: "capacity", + reported: { + serializedName: "reported", type: { - name: "Composite", - className: "IotHubCapacity" + name: "Dictionary", + value: { type: { name: "any" } } } } } } }; -export const TagsResource: msRest.CompositeMapper = { - serializedName: "TagsResource", +export const TestAllRoutesResult: coreClient.CompositeMapper = { type: { name: "Composite", - className: "TagsResource", + className: "TestAllRoutesResult", modelProperties: { - tags: { - serializedName: "tags", + routes: { + serializedName: "routes", type: { - name: "Dictionary", - value: { + name: "Sequence", + element: { type: { - name: "String" + name: "Composite", + className: "MatchedRoute" } } } @@ -2161,212 +2273,171 @@ export const TagsResource: msRest.CompositeMapper = { } }; -export const EventHubConsumerGroupInfo: msRest.CompositeMapper = { - serializedName: "EventHubConsumerGroupInfo", +export const MatchedRoute: coreClient.CompositeMapper = { type: { name: "Composite", - className: "EventHubConsumerGroupInfo", + className: "MatchedRoute", modelProperties: { properties: { serializedName: "properties", type: { - name: "Dictionary", - value: { - type: { - name: "Object" - } - } - } - }, - id: { - readOnly: true, - serializedName: "id", - type: { - name: "String" + name: "Composite", + className: "RouteProperties" } - }, - name: { - readOnly: true, - serializedName: "name", + } + } + } +}; + +export const TestRouteInput: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "TestRouteInput", + modelProperties: { + message: { + serializedName: "message", type: { - name: "String" + name: "Composite", + className: "RoutingMessage" } }, - type: { - readOnly: true, - serializedName: "type", + route: { + serializedName: "route", type: { - name: "String" + name: "Composite", + className: "RouteProperties" } }, - etag: { - readOnly: true, - serializedName: "etag", + twin: { + serializedName: "twin", type: { - name: "String" + name: "Composite", + className: "RoutingTwin" } } } } }; -export const EventHubConsumerGroupName: msRest.CompositeMapper = { - serializedName: "EventHubConsumerGroupName", +export const TestRouteResult: coreClient.CompositeMapper = { type: { name: "Composite", - className: "EventHubConsumerGroupName", + className: "TestRouteResult", modelProperties: { - name: { - required: true, - serializedName: "name", + result: { + serializedName: "result", type: { name: "String" } + }, + details: { + serializedName: "details", + type: { + name: "Composite", + className: "TestRouteResultDetails" + } } } } }; -export const EventHubConsumerGroupBodyDescription: msRest.CompositeMapper = { - serializedName: "EventHubConsumerGroupBodyDescription", +export const TestRouteResultDetails: coreClient.CompositeMapper = { type: { name: "Composite", - className: "EventHubConsumerGroupBodyDescription", + className: "TestRouteResultDetails", modelProperties: { - properties: { - required: true, - serializedName: "properties", + compilationErrors: { + serializedName: "compilationErrors", type: { - name: "Composite", - className: "EventHubConsumerGroupName" + name: "Sequence", + element: { + type: { + name: "Composite", + className: "RouteCompilationError" + } + } } } } } }; -export const OperationInputs: msRest.CompositeMapper = { - serializedName: "OperationInputs", +export const RouteCompilationError: coreClient.CompositeMapper = { type: { name: "Composite", - className: "OperationInputs", + className: "RouteCompilationError", modelProperties: { - name: { - required: true, - serializedName: "name", + message: { + serializedName: "message", + type: { + name: "String" + } + }, + severity: { + serializedName: "severity", type: { name: "String" } + }, + location: { + serializedName: "location", + type: { + name: "Composite", + className: "RouteErrorRange" + } } } } }; -export const IotHubNameAvailabilityInfo: msRest.CompositeMapper = { - serializedName: "IotHubNameAvailabilityInfo", +export const RouteErrorRange: coreClient.CompositeMapper = { type: { name: "Composite", - className: "IotHubNameAvailabilityInfo", + className: "RouteErrorRange", modelProperties: { - nameAvailable: { - readOnly: true, - serializedName: "nameAvailable", - type: { - name: "Boolean" - } - }, - reason: { - readOnly: true, - serializedName: "reason", - type: { - name: "Enum", - allowedValues: ["Invalid", "AlreadyExists"] - } - }, - message: { - serializedName: "message", - type: { - name: "String" - } - } - } - } -}; - -export const Name: msRest.CompositeMapper = { - serializedName: "Name", - type: { - name: "Composite", - className: "Name", - modelProperties: { - value: { - serializedName: "value", + start: { + serializedName: "start", type: { - name: "String" + name: "Composite", + className: "RouteErrorPosition" } }, - localizedValue: { - serializedName: "localizedValue", + end: { + serializedName: "end", type: { - name: "String" + name: "Composite", + className: "RouteErrorPosition" } } } } }; -export const UserSubscriptionQuota: msRest.CompositeMapper = { - serializedName: "UserSubscriptionQuota", +export const RouteErrorPosition: coreClient.CompositeMapper = { type: { name: "Composite", - className: "UserSubscriptionQuota", + className: "RouteErrorPosition", modelProperties: { - id: { - serializedName: "id", - type: { - name: "String" - } - }, - type: { - serializedName: "type", - type: { - name: "String" - } - }, - unit: { - serializedName: "unit", - type: { - name: "String" - } - }, - currentValue: { - serializedName: "currentValue", + line: { + serializedName: "line", type: { name: "Number" } }, - limit: { - serializedName: "limit", + column: { + serializedName: "column", type: { name: "Number" } - }, - name: { - serializedName: "name", - type: { - name: "Composite", - className: "Name" - } } } } }; -export const UserSubscriptionQuotaListResult: msRest.CompositeMapper = { - serializedName: "UserSubscriptionQuotaListResult", +export const SharedAccessSignatureAuthorizationRuleListResult: coreClient.CompositeMapper = { type: { name: "Composite", - className: "UserSubscriptionQuotaListResult", + className: "SharedAccessSignatureAuthorizationRuleListResult", modelProperties: { value: { serializedName: "value", @@ -2375,14 +2446,14 @@ export const UserSubscriptionQuotaListResult: msRest.CompositeMapper = { element: { type: { name: "Composite", - className: "UserSubscriptionQuota" + className: "SharedAccessSignatureAuthorizationRule" } } } }, nextLink: { - readOnly: true, serializedName: "nextLink", + readOnly: true, type: { name: "String" } @@ -2391,150 +2462,133 @@ export const UserSubscriptionQuotaListResult: msRest.CompositeMapper = { } }; -export const RoutingMessage: msRest.CompositeMapper = { - serializedName: "RoutingMessage", +export const ExportDevicesRequest: coreClient.CompositeMapper = { type: { name: "Composite", - className: "RoutingMessage", + className: "ExportDevicesRequest", modelProperties: { - body: { - serializedName: "body", + exportBlobContainerUri: { + serializedName: "exportBlobContainerUri", + required: true, type: { name: "String" } }, - appProperties: { - serializedName: "appProperties", + excludeKeys: { + serializedName: "excludeKeys", + required: true, type: { - name: "Dictionary", - value: { - type: { - name: "String" - } - } + name: "Boolean" } }, - systemProperties: { - serializedName: "systemProperties", + exportBlobName: { + serializedName: "exportBlobName", type: { - name: "Dictionary", - value: { - type: { - name: "String" - } - } + name: "String" } - } - } - } -}; - -export const RoutingTwinProperties: msRest.CompositeMapper = { - serializedName: "RoutingTwin_properties", - type: { - name: "Composite", - className: "RoutingTwinProperties", - modelProperties: { - desired: { - serializedName: "desired", + }, + authenticationType: { + serializedName: "authenticationType", type: { - name: "Object" + name: "String" } }, - reported: { - serializedName: "reported", + identity: { + serializedName: "identity", type: { - name: "Object" + name: "Composite", + className: "ManagedIdentity" } - } - } - } -}; - -export const RoutingTwin: msRest.CompositeMapper = { - serializedName: "RoutingTwin", - type: { - name: "Composite", - className: "RoutingTwin", - modelProperties: { - tags: { - serializedName: "tags", + }, + includeConfigurations: { + serializedName: "includeConfigurations", type: { - name: "Object" + name: "Boolean" } }, - properties: { - serializedName: "properties", + configurationsBlobName: { + serializedName: "configurationsBlobName", type: { - name: "Composite", - className: "RoutingTwinProperties" + name: "String" } } } } }; -export const TestAllRoutesInput: msRest.CompositeMapper = { - serializedName: "TestAllRoutesInput", +export const ImportDevicesRequest: coreClient.CompositeMapper = { type: { name: "Composite", - className: "TestAllRoutesInput", + className: "ImportDevicesRequest", modelProperties: { - routingSource: { - serializedName: "routingSource", + inputBlobContainerUri: { + serializedName: "inputBlobContainerUri", + required: true, type: { name: "String" } }, - message: { - serializedName: "message", + outputBlobContainerUri: { + serializedName: "outputBlobContainerUri", + required: true, type: { - name: "Composite", - className: "RoutingMessage" + name: "String" } }, - twin: { - serializedName: "twin", + inputBlobName: { + serializedName: "inputBlobName", type: { - name: "Composite", - className: "RoutingTwin" + name: "String" } - } - } - } -}; - -export const MatchedRoute: msRest.CompositeMapper = { - serializedName: "MatchedRoute", - type: { - name: "Composite", - className: "MatchedRoute", - modelProperties: { - properties: { - serializedName: "properties", + }, + outputBlobName: { + serializedName: "outputBlobName", + type: { + name: "String" + } + }, + authenticationType: { + serializedName: "authenticationType", + type: { + name: "String" + } + }, + identity: { + serializedName: "identity", type: { name: "Composite", - className: "RouteProperties" + className: "ManagedIdentity" + } + }, + includeConfigurations: { + serializedName: "includeConfigurations", + type: { + name: "Boolean" + } + }, + configurationsBlobName: { + serializedName: "configurationsBlobName", + type: { + name: "String" } } } } }; -export const TestAllRoutesResult: msRest.CompositeMapper = { - serializedName: "TestAllRoutesResult", +export const CertificateListDescription: coreClient.CompositeMapper = { type: { name: "Composite", - className: "TestAllRoutesResult", + className: "CertificateListDescription", modelProperties: { - routes: { - serializedName: "routes", + value: { + serializedName: "value", type: { name: "Sequence", element: { type: { name: "Composite", - className: "MatchedRoute" + className: "CertificateDescription" } } } @@ -2543,205 +2597,142 @@ export const TestAllRoutesResult: msRest.CompositeMapper = { } }; -export const TestRouteInput: msRest.CompositeMapper = { - serializedName: "TestRouteInput", +export const CertificateDescription: coreClient.CompositeMapper = { type: { name: "Composite", - className: "TestRouteInput", + className: "CertificateDescription", modelProperties: { - message: { - serializedName: "message", + properties: { + serializedName: "properties", type: { name: "Composite", - className: "RoutingMessage" + className: "CertificateProperties" } }, - route: { - required: true, - serializedName: "route", + id: { + serializedName: "id", + readOnly: true, type: { - name: "Composite", - className: "RouteProperties" + name: "String" } }, - twin: { - serializedName: "twin", + name: { + serializedName: "name", + readOnly: true, type: { - name: "Composite", - className: "RoutingTwin" + name: "String" } - } - } - } -}; - -export const RouteErrorPosition: msRest.CompositeMapper = { - serializedName: "RouteErrorPosition", - type: { - name: "Composite", - className: "RouteErrorPosition", - modelProperties: { - line: { - serializedName: "line", + }, + etag: { + serializedName: "etag", + readOnly: true, type: { - name: "Number" + name: "String" } }, - column: { - serializedName: "column", + type: { + serializedName: "type", + readOnly: true, type: { - name: "Number" + name: "String" } } } } }; -export const RouteErrorRange: msRest.CompositeMapper = { - serializedName: "RouteErrorRange", +export const CertificateProperties: coreClient.CompositeMapper = { type: { name: "Composite", - className: "RouteErrorRange", + className: "CertificateProperties", modelProperties: { - start: { - serializedName: "start", + subject: { + serializedName: "subject", + readOnly: true, type: { - name: "Composite", - className: "RouteErrorPosition" + name: "String" } }, - end: { - serializedName: "end", - type: { - name: "Composite", - className: "RouteErrorPosition" - } - } - } - } -}; - -export const RouteCompilationError: msRest.CompositeMapper = { - serializedName: "RouteCompilationError", - type: { - name: "Composite", - className: "RouteCompilationError", - modelProperties: { - message: { - serializedName: "message", + expiry: { + serializedName: "expiry", + readOnly: true, type: { - name: "String" + name: "DateTimeRfc1123" } }, - severity: { - serializedName: "severity", + thumbprint: { + serializedName: "thumbprint", + readOnly: true, type: { name: "String" } }, - location: { - serializedName: "location", + isVerified: { + serializedName: "isVerified", type: { - name: "Composite", - className: "RouteErrorRange" + name: "Boolean" } - } - } - } -}; - -export const TestRouteResultDetails: msRest.CompositeMapper = { - serializedName: "TestRouteResultDetails", - type: { - name: "Composite", - className: "TestRouteResultDetails", - modelProperties: { - compilationErrors: { - serializedName: "compilationErrors", + }, + created: { + serializedName: "created", + readOnly: true, type: { - name: "Sequence", - element: { - type: { - name: "Composite", - className: "RouteCompilationError" - } - } + name: "DateTimeRfc1123" } - } - } - } -}; - -export const TestRouteResult: msRest.CompositeMapper = { - serializedName: "TestRouteResult", - type: { - name: "Composite", - className: "TestRouteResult", - modelProperties: { - result: { - serializedName: "result", + }, + updated: { + serializedName: "updated", + readOnly: true, type: { - name: "String" + name: "DateTimeRfc1123" } }, - details: { - serializedName: "details", + certificate: { + serializedName: "certificate", type: { - name: "Composite", - className: "TestRouteResultDetails" + name: "String" } } } } }; -export const ExportDevicesRequest: msRest.CompositeMapper = { - serializedName: "ExportDevicesRequest", +export const CertificateWithNonceDescription: coreClient.CompositeMapper = { type: { name: "Composite", - className: "ExportDevicesRequest", + className: "CertificateWithNonceDescription", modelProperties: { - exportBlobContainerUri: { - required: true, - serializedName: "exportBlobContainerUri", - type: { - name: "String" - } - }, - excludeKeys: { - required: true, - serializedName: "excludeKeys", - type: { - name: "Boolean" - } - }, - exportBlobName: { - serializedName: "exportBlobName", + properties: { + serializedName: "properties", type: { - name: "String" + name: "Composite", + className: "CertificatePropertiesWithNonce" } }, - authenticationType: { - serializedName: "authenticationType", + id: { + serializedName: "id", + readOnly: true, type: { name: "String" } }, - identity: { - serializedName: "identity", + name: { + serializedName: "name", + readOnly: true, type: { - name: "Composite", - className: "ManagedIdentity" + name: "String" } }, - includeConfigurations: { - serializedName: "includeConfigurations", + etag: { + serializedName: "etag", + readOnly: true, type: { - name: "Boolean" + name: "String" } }, - configurationsBlobName: { - serializedName: "configurationsBlobName", + type: { + serializedName: "type", + readOnly: true, type: { name: "String" } @@ -2750,59 +2741,63 @@ export const ExportDevicesRequest: msRest.CompositeMapper = { } }; -export const ImportDevicesRequest: msRest.CompositeMapper = { - serializedName: "ImportDevicesRequest", +export const CertificatePropertiesWithNonce: coreClient.CompositeMapper = { type: { name: "Composite", - className: "ImportDevicesRequest", + className: "CertificatePropertiesWithNonce", modelProperties: { - inputBlobContainerUri: { - required: true, - serializedName: "inputBlobContainerUri", + subject: { + serializedName: "subject", + readOnly: true, type: { name: "String" } }, - outputBlobContainerUri: { - required: true, - serializedName: "outputBlobContainerUri", + expiry: { + serializedName: "expiry", + readOnly: true, type: { - name: "String" + name: "DateTimeRfc1123" } }, - inputBlobName: { - serializedName: "inputBlobName", + thumbprint: { + serializedName: "thumbprint", + readOnly: true, type: { name: "String" } }, - outputBlobName: { - serializedName: "outputBlobName", + isVerified: { + serializedName: "isVerified", + readOnly: true, type: { - name: "String" + name: "Boolean" } }, - authenticationType: { - serializedName: "authenticationType", + created: { + serializedName: "created", + readOnly: true, type: { - name: "String" + name: "DateTimeRfc1123" } }, - identity: { - serializedName: "identity", + updated: { + serializedName: "updated", + readOnly: true, type: { - name: "Composite", - className: "ManagedIdentity" + name: "DateTimeRfc1123" } }, - includeConfigurations: { - serializedName: "includeConfigurations", + verificationCode: { + serializedName: "verificationCode", + readOnly: true, type: { - name: "Boolean" + name: "String" } }, - configurationsBlobName: { - serializedName: "configurationsBlobName", + certificate: { + serializedName: "certificate", + readOnly: true, type: { name: "String" } @@ -2811,15 +2806,13 @@ export const ImportDevicesRequest: msRest.CompositeMapper = { } }; -export const FailoverInput: msRest.CompositeMapper = { - serializedName: "FailoverInput", +export const CertificateVerificationDescription: coreClient.CompositeMapper = { type: { name: "Composite", - className: "FailoverInput", + className: "CertificateVerificationDescription", modelProperties: { - failoverRegion: { - required: true, - serializedName: "failoverRegion", + certificate: { + serializedName: "certificate", type: { name: "String" } @@ -2828,28 +2821,14 @@ export const FailoverInput: msRest.CompositeMapper = { } }; -export const OperationListResult: msRest.CompositeMapper = { - serializedName: "OperationListResult", +export const FailoverInput: coreClient.CompositeMapper = { type: { name: "Composite", - className: "OperationListResult", + className: "FailoverInput", modelProperties: { - value: { - readOnly: true, - serializedName: "", - type: { - name: "Sequence", - element: { - type: { - name: "Composite", - className: "Operation" - } - } - } - }, - nextLink: { - readOnly: true, - serializedName: "nextLink", + failoverRegion: { + serializedName: "failoverRegion", + required: true, type: { name: "String" } @@ -2858,203 +2837,153 @@ export const OperationListResult: msRest.CompositeMapper = { } }; -export const IotHubDescriptionListResult: msRest.CompositeMapper = { - serializedName: "IotHubDescriptionListResult", +export const PrivateLinkResources: coreClient.CompositeMapper = { type: { name: "Composite", - className: "IotHubDescriptionListResult", + className: "PrivateLinkResources", modelProperties: { value: { - serializedName: "", + serializedName: "value", type: { name: "Sequence", element: { type: { name: "Composite", - className: "IotHubDescription" + className: "GroupIdInformation" } } } - }, - nextLink: { - readOnly: true, - serializedName: "nextLink", - type: { - name: "String" - } } } } }; -export const IotHubSkuDescriptionListResult: msRest.CompositeMapper = { - serializedName: "IotHubSkuDescriptionListResult", +export const GroupIdInformation: coreClient.CompositeMapper = { type: { name: "Composite", - className: "IotHubSkuDescriptionListResult", + className: "GroupIdInformation", modelProperties: { - value: { - serializedName: "", + id: { + serializedName: "id", + readOnly: true, type: { - name: "Sequence", - element: { - type: { - name: "Composite", - className: "IotHubSkuDescription" - } - } + name: "String" } }, - nextLink: { + name: { + serializedName: "name", readOnly: true, - serializedName: "nextLink", type: { name: "String" } - } - } - } -}; - -export const EventHubConsumerGroupsListResult: msRest.CompositeMapper = { - serializedName: "EventHubConsumerGroupsListResult", - type: { - name: "Composite", - className: "EventHubConsumerGroupsListResult", - modelProperties: { - value: { - serializedName: "", - type: { - name: "Sequence", - element: { - type: { - name: "Composite", - className: "EventHubConsumerGroupInfo" - } - } - } }, - nextLink: { + type: { + serializedName: "type", readOnly: true, - serializedName: "nextLink", type: { name: "String" } + }, + properties: { + serializedName: "properties", + type: { + name: "Composite", + className: "GroupIdInformationProperties" + } } } } }; -export const JobResponseListResult: msRest.CompositeMapper = { - serializedName: "JobResponseListResult", +export const GroupIdInformationProperties: coreClient.CompositeMapper = { type: { name: "Composite", - className: "JobResponseListResult", + className: "GroupIdInformationProperties", modelProperties: { - value: { - serializedName: "", + groupId: { + serializedName: "groupId", + type: { + name: "String" + } + }, + requiredMembers: { + serializedName: "requiredMembers", type: { name: "Sequence", element: { type: { - name: "Composite", - className: "JobResponse" + name: "String" } } } }, - nextLink: { - readOnly: true, - serializedName: "nextLink", - type: { - name: "String" - } - } - } - } -}; - -export const IotHubQuotaMetricInfoListResult: msRest.CompositeMapper = { - serializedName: "IotHubQuotaMetricInfoListResult", - type: { - name: "Composite", - className: "IotHubQuotaMetricInfoListResult", - modelProperties: { - value: { - serializedName: "", + requiredZoneNames: { + serializedName: "requiredZoneNames", type: { name: "Sequence", element: { type: { - name: "Composite", - className: "IotHubQuotaMetricInfo" + name: "String" } } } - }, - nextLink: { - readOnly: true, - serializedName: "nextLink", - type: { - name: "String" - } } } } }; -export const EndpointHealthDataListResult: msRest.CompositeMapper = { - serializedName: "EndpointHealthDataListResult", +export const CertificateBodyDescription: coreClient.CompositeMapper = { type: { name: "Composite", - className: "EndpointHealthDataListResult", + className: "CertificateBodyDescription", modelProperties: { - value: { - serializedName: "", + certificate: { + serializedName: "certificate", type: { - name: "Sequence", - element: { - type: { - name: "Composite", - className: "EndpointHealthData" - } - } + name: "String" } }, - nextLink: { - readOnly: true, - serializedName: "nextLink", + isVerified: { + serializedName: "isVerified", type: { - name: "String" + name: "Boolean" } } } } }; -export const SharedAccessSignatureAuthorizationRuleListResult: msRest.CompositeMapper = { - serializedName: "SharedAccessSignatureAuthorizationRuleListResult", +export const IotHubDescription: coreClient.CompositeMapper = { type: { name: "Composite", - className: "SharedAccessSignatureAuthorizationRuleListResult", + className: "IotHubDescription", modelProperties: { - value: { - serializedName: "", + ...Resource.type.modelProperties, + etag: { + serializedName: "etag", type: { - name: "Sequence", - element: { - type: { - name: "Composite", - className: "SharedAccessSignatureAuthorizationRule" - } - } + name: "String" } }, - nextLink: { - readOnly: true, - serializedName: "nextLink", + properties: { + serializedName: "properties", type: { - name: "String" + name: "Composite", + className: "IotHubProperties" + } + }, + sku: { + serializedName: "sku", + type: { + name: "Composite", + className: "IotHubSkuInfo" + } + }, + identity: { + serializedName: "identity", + type: { + name: "Composite", + className: "ArmIdentity" } } } diff --git a/sdk/iothub/arm-iothub/src/models/parameters.ts b/sdk/iothub/arm-iothub/src/models/parameters.ts index 35d29acb96c4..14646b843a2e 100644 --- a/sdk/iothub/arm-iothub/src/models/parameters.ts +++ b/sdk/iothub/arm-iothub/src/models/parameters.ts @@ -3,172 +3,290 @@ * 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 { + IotHubDescription as IotHubDescriptionMapper, + TagsResource as TagsResourceMapper, + EventHubConsumerGroupBodyDescription as EventHubConsumerGroupBodyDescriptionMapper, + OperationInputs as OperationInputsMapper, + TestAllRoutesInput as TestAllRoutesInputMapper, + TestRouteInput as TestRouteInputMapper, + ExportDevicesRequest as ExportDevicesRequestMapper, + ImportDevicesRequest as ImportDevicesRequestMapper, + CertificateDescription as CertificateDescriptionMapper, + CertificateVerificationDescription as CertificateVerificationDescriptionMapper, + FailoverInput as FailoverInputMapper, + PrivateEndpointConnection as PrivateEndpointConnectionMapper +} 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: "2021-07-01", + isConstant: true, serializedName: "api-version", type: { name: "String" } } }; -export const certificateName: msRest.OperationURLParameter = { - parameterPath: "certificateName", + +export const nextLink: OperationURLParameter = { + parameterPath: "nextLink", mapper: { + serializedName: "nextLink", + required: true, + type: { + name: "String" + } + }, + skipEncoding: true +}; + +export const subscriptionId: OperationURLParameter = { + parameterPath: "subscriptionId", + mapper: { + serializedName: "subscriptionId", required: true, - serializedName: "certificateName", - constraints: { - Pattern: /^[A-Za-z0-9-._]{1,64}$/ - }, type: { name: "String" } } }; -export const eventHubEndpointName: msRest.OperationURLParameter = { - parameterPath: "eventHubEndpointName", + +export const resourceGroupName: OperationURLParameter = { + parameterPath: "resourceGroupName", mapper: { + serializedName: "resourceGroupName", required: true, - serializedName: "eventHubEndpointName", type: { name: "String" } } }; -export const groupId: msRest.OperationURLParameter = { - parameterPath: "groupId", + +export const resourceName: OperationURLParameter = { + parameterPath: "resourceName", mapper: { + serializedName: "resourceName", required: true, - serializedName: "groupId", type: { name: "String" } } }; -export const ifMatch0: msRest.OperationParameter = { - parameterPath: ["options", "ifMatch"], + +export const contentType: OperationParameter = { + parameterPath: ["options", "contentType"], mapper: { - serializedName: "If-Match", + defaultValue: "application/json", + isConstant: true, + serializedName: "Content-Type", type: { name: "String" } } }; -export const ifMatch1: msRest.OperationParameter = { - parameterPath: "ifMatch", + +export const iotHubDescription: OperationParameter = { + parameterPath: "iotHubDescription", + mapper: IotHubDescriptionMapper +}; + +export const ifMatch: OperationParameter = { + parameterPath: ["options", "ifMatch"], mapper: { - required: true, serializedName: "If-Match", type: { name: "String" } } }; -export const iotHubName: msRest.OperationURLParameter = { - parameterPath: "iotHubName", + +export const iotHubTags: OperationParameter = { + parameterPath: "iotHubTags", + mapper: TagsResourceMapper +}; + +export const eventHubEndpointName: OperationURLParameter = { + parameterPath: "eventHubEndpointName", mapper: { + serializedName: "eventHubEndpointName", required: true, - serializedName: "iotHubName", type: { name: "String" } } }; -export const jobId: msRest.OperationURLParameter = { - parameterPath: "jobId", + +export const name: OperationURLParameter = { + parameterPath: "name", mapper: { + serializedName: "name", required: true, - serializedName: "jobId", type: { name: "String" } } }; -export const keyName: msRest.OperationURLParameter = { - parameterPath: "keyName", + +export const consumerGroupBody: OperationParameter = { + parameterPath: "consumerGroupBody", + mapper: EventHubConsumerGroupBodyDescriptionMapper +}; + +export const jobId: OperationURLParameter = { + parameterPath: "jobId", mapper: { + serializedName: "jobId", required: true, - serializedName: "keyName", type: { name: "String" } } }; -export const name: msRest.OperationURLParameter = { - parameterPath: "name", + +export const iotHubName: OperationURLParameter = { + parameterPath: "iotHubName", mapper: { + serializedName: "iotHubName", required: true, - serializedName: "name", type: { name: "String" } } }; -export const nextPageLink: msRest.OperationURLParameter = { - parameterPath: "nextPageLink", + +export const operationInputs: OperationParameter = { + parameterPath: "operationInputs", + mapper: OperationInputsMapper +}; + +export const input: OperationParameter = { + parameterPath: "input", + mapper: TestAllRoutesInputMapper +}; + +export const input1: OperationParameter = { + parameterPath: "input", + mapper: TestRouteInputMapper +}; + +export const keyName: OperationURLParameter = { + parameterPath: "keyName", mapper: { + serializedName: "keyName", required: true, - serializedName: "nextLink", type: { name: "String" } - }, - skipEncoding: true + } }; -export const privateEndpointConnectionName: msRest.OperationURLParameter = { - parameterPath: "privateEndpointConnectionName", + +export const exportDevicesParameters: OperationParameter = { + parameterPath: "exportDevicesParameters", + mapper: ExportDevicesRequestMapper +}; + +export const importDevicesParameters: OperationParameter = { + parameterPath: "importDevicesParameters", + mapper: ImportDevicesRequestMapper +}; + +export const certificateName: OperationURLParameter = { + parameterPath: "certificateName", mapper: { + constraints: { + Pattern: new RegExp("^[A-Za-z0-9-._]{1,64}$") + }, + serializedName: "certificateName", required: true, - serializedName: "privateEndpointConnectionName", type: { name: "String" } } }; -export const resourceGroupName: msRest.OperationURLParameter = { - parameterPath: "resourceGroupName", + +export const certificateDescription: OperationParameter = { + parameterPath: "certificateDescription", + mapper: CertificateDescriptionMapper +}; + +export const ifMatch1: OperationParameter = { + parameterPath: "ifMatch", mapper: { + serializedName: "If-Match", required: true, - serializedName: "resourceGroupName", type: { name: "String" } } }; -export const resourceName: msRest.OperationURLParameter = { - parameterPath: "resourceName", + +export const certificateVerificationBody: OperationParameter = { + parameterPath: "certificateVerificationBody", + mapper: CertificateVerificationDescriptionMapper +}; + +export const failoverInput: OperationParameter = { + parameterPath: "failoverInput", + mapper: FailoverInputMapper +}; + +export const groupId: OperationURLParameter = { + parameterPath: "groupId", mapper: { + serializedName: "groupId", required: true, - serializedName: "resourceName", type: { name: "String" } } }; -export const subscriptionId: msRest.OperationURLParameter = { - parameterPath: "subscriptionId", + +export const privateEndpointConnectionName: OperationURLParameter = { + parameterPath: "privateEndpointConnectionName", mapper: { + serializedName: "privateEndpointConnectionName", required: true, - serializedName: "subscriptionId", type: { name: "String" } } }; + +export const privateEndpointConnection: OperationParameter = { + parameterPath: "privateEndpointConnection", + mapper: PrivateEndpointConnectionMapper +}; diff --git a/sdk/iothub/arm-iothub/src/models/privateEndpointConnectionsMappers.ts b/sdk/iothub/arm-iothub/src/models/privateEndpointConnectionsMappers.ts deleted file mode 100644 index 95eafe0d4d86..000000000000 --- a/sdk/iothub/arm-iothub/src/models/privateEndpointConnectionsMappers.ts +++ /dev/null @@ -1,47 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -export { - ArmIdentity, - ArmUserIdentity, - BaseResource, - CertificateDescription, - CertificateProperties, - CertificatePropertiesWithNonce, - CertificateWithNonceDescription, - CloudToDeviceProperties, - EnrichmentProperties, - ErrorDetails, - EventHubConsumerGroupInfo, - EventHubProperties, - FallbackRouteProperties, - FeedbackProperties, - IotHubDescription, - IotHubLocationDescription, - IotHubProperties, - IotHubSkuInfo, - IpFilterRule, - ManagedIdentity, - MessagingEndpointProperties, - NetworkRuleSetIpRule, - NetworkRuleSetProperties, - PrivateEndpoint, - PrivateEndpointConnection, - PrivateEndpointConnectionProperties, - PrivateLinkServiceConnectionState, - Resource, - RouteProperties, - RoutingEndpoints, - RoutingEventHubProperties, - RoutingProperties, - RoutingServiceBusQueueEndpointProperties, - RoutingServiceBusTopicEndpointProperties, - RoutingStorageContainerProperties, - SharedAccessSignatureAuthorizationRule, - StorageEndpointProperties -} from "../models/mappers"; diff --git a/sdk/iothub/arm-iothub/src/models/privateLinkResourcesOperationsMappers.ts b/sdk/iothub/arm-iothub/src/models/privateLinkResourcesOperationsMappers.ts deleted file mode 100644 index 97770ac159b2..000000000000 --- a/sdk/iothub/arm-iothub/src/models/privateLinkResourcesOperationsMappers.ts +++ /dev/null @@ -1,14 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -export { - ErrorDetails, - GroupIdInformation, - GroupIdInformationProperties, - PrivateLinkResources -} from "../models/mappers"; diff --git a/sdk/iothub/arm-iothub/src/models/resourceProviderCommonMappers.ts b/sdk/iothub/arm-iothub/src/models/resourceProviderCommonMappers.ts deleted file mode 100644 index ba9ba8659584..000000000000 --- a/sdk/iothub/arm-iothub/src/models/resourceProviderCommonMappers.ts +++ /dev/null @@ -1,14 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -export { - ErrorDetails, - Name, - UserSubscriptionQuota, - UserSubscriptionQuotaListResult -} from "../models/mappers"; diff --git a/sdk/iothub/arm-iothub/src/operations/certificates.ts b/sdk/iothub/arm-iothub/src/operations/certificates.ts index 6a923c80d751..d6c700d3182c 100644 --- a/sdk/iothub/arm-iothub/src/operations/certificates.ts +++ b/sdk/iothub/arm-iothub/src/operations/certificates.ts @@ -3,422 +3,186 @@ * 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/certificatesMappers"; +import { Certificates } from "../operationsInterfaces"; +import * as coreClient from "@azure/core-client"; +import * as Mappers from "../models/mappers"; import * as Parameters from "../models/parameters"; -import { IotHubClientContext } from "../iotHubClientContext"; +import { IotHubClient } from "../iotHubClient"; +import { + CertificatesListByIotHubOptionalParams, + CertificatesListByIotHubResponse, + CertificatesGetOptionalParams, + CertificatesGetResponse, + CertificateDescription, + CertificatesCreateOrUpdateOptionalParams, + CertificatesCreateOrUpdateResponse, + CertificatesDeleteOptionalParams, + CertificatesGenerateVerificationCodeOptionalParams, + CertificatesGenerateVerificationCodeResponse, + CertificateVerificationDescription, + CertificatesVerifyOptionalParams, + CertificatesVerifyResponse +} from "../models"; -/** Class representing a Certificates. */ -export class Certificates { - private readonly client: IotHubClientContext; +/** Class containing Certificates operations. */ +export class CertificatesImpl implements Certificates { + private readonly client: IotHubClient; /** - * Create a Certificates. - * @param {IotHubClientContext} client Reference to the service client. + * Initialize a new instance of the class Certificates class. + * @param client Reference to the service client */ - constructor(client: IotHubClientContext) { + constructor(client: IotHubClient) { this.client = client; } /** * Returns the list of certificates. - * @summary Get the certificate list. * @param resourceGroupName The name of the resource group that contains the IoT hub. * @param resourceName The name of the IoT hub. - * @param [options] The optional parameters - * @returns Promise + * @param options The options parameters. */ listByIotHub( resourceGroupName: string, resourceName: string, - options?: msRest.RequestOptionsBase - ): Promise; - /** - * @param resourceGroupName The name of the resource group that contains the IoT hub. - * @param resourceName The name of the IoT hub. - * @param callback The callback - */ - listByIotHub( - resourceGroupName: string, - resourceName: string, - callback: msRest.ServiceCallback - ): void; - /** - * @param resourceGroupName The name of the resource group that contains the IoT hub. - * @param resourceName The name of the IoT hub. - * @param options The optional parameters - * @param callback The callback - */ - listByIotHub( - resourceGroupName: string, - resourceName: string, - options: msRest.RequestOptionsBase, - callback: msRest.ServiceCallback - ): void; - listByIotHub( - resourceGroupName: string, - resourceName: string, - options?: msRest.RequestOptionsBase | msRest.ServiceCallback, - callback?: msRest.ServiceCallback - ): Promise { + options?: CertificatesListByIotHubOptionalParams + ): Promise { return this.client.sendOperationRequest( - { - resourceGroupName, - resourceName, - options - }, - listByIotHubOperationSpec, - callback - ) as Promise; + { resourceGroupName, resourceName, options }, + listByIotHubOperationSpec + ); } /** * Returns the certificate. - * @summary Get the certificate. - * @param resourceGroupName The name of the resource group that contains the IoT hub. - * @param resourceName The name of the IoT hub. - * @param certificateName The name of the certificate - * @param [options] The optional parameters - * @returns Promise - */ - get( - resourceGroupName: string, - resourceName: string, - certificateName: string, - options?: msRest.RequestOptionsBase - ): Promise; - /** - * @param resourceGroupName The name of the resource group that contains the IoT hub. - * @param resourceName The name of the IoT hub. - * @param certificateName The name of the certificate - * @param callback The callback - */ - get( - resourceGroupName: string, - resourceName: string, - certificateName: string, - callback: msRest.ServiceCallback - ): void; - /** * @param resourceGroupName The name of the resource group that contains the IoT hub. * @param resourceName The name of the IoT hub. * @param certificateName The name of the certificate - * @param options The optional parameters - * @param callback The callback + * @param options The options parameters. */ get( resourceGroupName: string, resourceName: string, certificateName: string, - options: msRest.RequestOptionsBase, - callback: msRest.ServiceCallback - ): void; - get( - resourceGroupName: string, - resourceName: string, - certificateName: string, - options?: msRest.RequestOptionsBase | msRest.ServiceCallback, - callback?: msRest.ServiceCallback - ): Promise { + options?: CertificatesGetOptionalParams + ): Promise { return this.client.sendOperationRequest( - { - resourceGroupName, - resourceName, - certificateName, - options - }, - getOperationSpec, - callback - ) as Promise; + { resourceGroupName, resourceName, certificateName, options }, + getOperationSpec + ); } /** * Adds new or replaces existing certificate. - * @summary Upload the certificate to the IoT hub. * @param resourceGroupName The name of the resource group that contains the IoT hub. * @param resourceName The name of the IoT hub. * @param certificateName The name of the certificate - * @param [options] The optional parameters - * @returns Promise + * @param certificateDescription The certificate body. + * @param options The options parameters. */ createOrUpdate( resourceGroupName: string, resourceName: string, certificateName: string, - options?: Models.CertificatesCreateOrUpdateOptionalParams - ): Promise; - /** - * @param resourceGroupName The name of the resource group that contains the IoT hub. - * @param resourceName The name of the IoT hub. - * @param certificateName The name of the certificate - * @param callback The callback - */ - createOrUpdate( - resourceGroupName: string, - resourceName: string, - certificateName: string, - callback: msRest.ServiceCallback - ): void; - /** - * @param resourceGroupName The name of the resource group that contains the IoT hub. - * @param resourceName The name of the IoT hub. - * @param certificateName The name of the certificate - * @param options The optional parameters - * @param callback The callback - */ - createOrUpdate( - resourceGroupName: string, - resourceName: string, - certificateName: string, - options: Models.CertificatesCreateOrUpdateOptionalParams, - callback: msRest.ServiceCallback - ): void; - createOrUpdate( - resourceGroupName: string, - resourceName: string, - certificateName: string, - options?: - | Models.CertificatesCreateOrUpdateOptionalParams - | msRest.ServiceCallback, - callback?: msRest.ServiceCallback - ): Promise { + certificateDescription: CertificateDescription, + options?: CertificatesCreateOrUpdateOptionalParams + ): Promise { return this.client.sendOperationRequest( { resourceGroupName, resourceName, certificateName, + certificateDescription, options }, - createOrUpdateOperationSpec, - callback - ) as Promise; + createOrUpdateOperationSpec + ); } /** * Deletes an existing X509 certificate or does nothing if it does not exist. - * @summary Delete an X509 certificate. * @param resourceGroupName The name of the resource group that contains the IoT hub. * @param resourceName The name of the IoT hub. * @param certificateName The name of the certificate * @param ifMatch ETag of the Certificate. - * @param [options] The optional parameters - * @returns Promise + * @param options The options parameters. */ - deleteMethod( + delete( resourceGroupName: string, resourceName: string, certificateName: string, ifMatch: string, - options?: msRest.RequestOptionsBase - ): Promise; - /** - * @param resourceGroupName The name of the resource group that contains the IoT hub. - * @param resourceName The name of the IoT hub. - * @param certificateName The name of the certificate - * @param ifMatch ETag of the Certificate. - * @param callback The callback - */ - deleteMethod( - resourceGroupName: string, - resourceName: string, - certificateName: string, - ifMatch: string, - callback: msRest.ServiceCallback - ): void; - /** - * @param resourceGroupName The name of the resource group that contains the IoT hub. - * @param resourceName The name of the IoT hub. - * @param certificateName The name of the certificate - * @param ifMatch ETag of the Certificate. - * @param options The optional parameters - * @param callback The callback - */ - deleteMethod( - resourceGroupName: string, - resourceName: string, - certificateName: string, - ifMatch: string, - options: msRest.RequestOptionsBase, - callback: msRest.ServiceCallback - ): void; - deleteMethod( - resourceGroupName: string, - resourceName: string, - certificateName: string, - ifMatch: string, - options?: msRest.RequestOptionsBase | msRest.ServiceCallback, - callback?: msRest.ServiceCallback - ): Promise { + options?: CertificatesDeleteOptionalParams + ): Promise { return this.client.sendOperationRequest( - { - resourceGroupName, - resourceName, - certificateName, - ifMatch, - options - }, - deleteMethodOperationSpec, - callback + { resourceGroupName, resourceName, certificateName, ifMatch, options }, + deleteOperationSpec ); } /** * Generates verification code for proof of possession flow. The verification code will be used to * generate a leaf certificate. - * @summary Generate verification code for proof of possession flow. - * @param resourceGroupName The name of the resource group that contains the IoT hub. - * @param resourceName The name of the IoT hub. - * @param certificateName The name of the certificate - * @param ifMatch ETag of the Certificate. - * @param [options] The optional parameters - * @returns Promise - */ - generateVerificationCode( - resourceGroupName: string, - resourceName: string, - certificateName: string, - ifMatch: string, - options?: msRest.RequestOptionsBase - ): Promise; - /** - * @param resourceGroupName The name of the resource group that contains the IoT hub. - * @param resourceName The name of the IoT hub. - * @param certificateName The name of the certificate - * @param ifMatch ETag of the Certificate. - * @param callback The callback - */ - generateVerificationCode( - resourceGroupName: string, - resourceName: string, - certificateName: string, - ifMatch: string, - callback: msRest.ServiceCallback - ): void; - /** * @param resourceGroupName The name of the resource group that contains the IoT hub. * @param resourceName The name of the IoT hub. * @param certificateName The name of the certificate * @param ifMatch ETag of the Certificate. - * @param options The optional parameters - * @param callback The callback + * @param options The options parameters. */ generateVerificationCode( resourceGroupName: string, resourceName: string, certificateName: string, ifMatch: string, - options: msRest.RequestOptionsBase, - callback: msRest.ServiceCallback - ): void; - generateVerificationCode( - resourceGroupName: string, - resourceName: string, - certificateName: string, - ifMatch: string, - options?: - | msRest.RequestOptionsBase - | msRest.ServiceCallback, - callback?: msRest.ServiceCallback - ): Promise { + options?: CertificatesGenerateVerificationCodeOptionalParams + ): Promise { return this.client.sendOperationRequest( - { - resourceGroupName, - resourceName, - certificateName, - ifMatch, - options - }, - generateVerificationCodeOperationSpec, - callback - ) as Promise; + { resourceGroupName, resourceName, certificateName, ifMatch, options }, + generateVerificationCodeOperationSpec + ); } /** - * Verifies the certificate's private key possession by providing the leaf cert issued by the - * verifying pre uploaded certificate. - * @summary Verify certificate's private key possession. - * @param resourceGroupName The name of the resource group that contains the IoT hub. - * @param resourceName The name of the IoT hub. - * @param certificateName The name of the certificate - * @param ifMatch ETag of the Certificate. - * @param [options] The optional parameters - * @returns Promise - */ - verify( - resourceGroupName: string, - resourceName: string, - certificateName: string, - ifMatch: string, - options?: Models.CertificatesVerifyOptionalParams - ): Promise; - /** - * @param resourceGroupName The name of the resource group that contains the IoT hub. - * @param resourceName The name of the IoT hub. - * @param certificateName The name of the certificate - * @param ifMatch ETag of the Certificate. - * @param callback The callback - */ - verify( - resourceGroupName: string, - resourceName: string, - certificateName: string, - ifMatch: string, - callback: msRest.ServiceCallback - ): void; - /** + * Verifies the certificate's private key possession by providing the leaf cert issued by the verifying + * pre uploaded certificate. * @param resourceGroupName The name of the resource group that contains the IoT hub. * @param resourceName The name of the IoT hub. * @param certificateName The name of the certificate * @param ifMatch ETag of the Certificate. - * @param options The optional parameters - * @param callback The callback + * @param certificateVerificationBody The name of the certificate + * @param options The options parameters. */ verify( resourceGroupName: string, resourceName: string, certificateName: string, ifMatch: string, - options: Models.CertificatesVerifyOptionalParams, - callback: msRest.ServiceCallback - ): void; - verify( - resourceGroupName: string, - resourceName: string, - certificateName: string, - ifMatch: string, - options?: - | Models.CertificatesVerifyOptionalParams - | msRest.ServiceCallback, - callback?: msRest.ServiceCallback - ): Promise { + certificateVerificationBody: CertificateVerificationDescription, + options?: CertificatesVerifyOptionalParams + ): Promise { return this.client.sendOperationRequest( { resourceGroupName, resourceName, certificateName, ifMatch, + certificateVerificationBody, options }, - verifyOperationSpec, - callback - ) as Promise; + verifyOperationSpec + ); } } - // Operation Specifications -const serializer = new msRest.Serializer(Mappers); -const listByIotHubOperationSpec: msRest.OperationSpec = { - httpMethod: "GET", +const serializer = coreClient.createSerializer(Mappers, /* isXml */ false); + +const listByIotHubOperationSpec: coreClient.OperationSpec = { path: - "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Devices/IotHubs/{resourceName}/certificates", - urlParameters: [Parameters.subscriptionId, Parameters.resourceGroupName, Parameters.resourceName], - queryParameters: [Parameters.apiVersion], - headerParameters: [Parameters.acceptLanguage], + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Devices/IotHubs/{resourceName}/certificates", + httpMethod: "GET", responses: { 200: { bodyMapper: Mappers.CertificateListDescription @@ -427,21 +191,20 @@ const listByIotHubOperationSpec: msRest.OperationSpec = { bodyMapper: Mappers.ErrorDetails } }, - serializer -}; - -const getOperationSpec: msRest.OperationSpec = { - httpMethod: "GET", - path: - "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Devices/IotHubs/{resourceName}/certificates/{certificateName}", + queryParameters: [Parameters.apiVersion], urlParameters: [ + Parameters.$host, Parameters.subscriptionId, Parameters.resourceGroupName, - Parameters.resourceName, - Parameters.certificateName + Parameters.resourceName ], - queryParameters: [Parameters.apiVersion], - headerParameters: [Parameters.acceptLanguage], + headerParameters: [Parameters.accept], + serializer +}; +const getOperationSpec: coreClient.OperationSpec = { + path: + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Devices/IotHubs/{resourceName}/certificates/{certificateName}", + httpMethod: "GET", responses: { 200: { bodyMapper: Mappers.CertificateDescription @@ -450,30 +213,21 @@ const getOperationSpec: msRest.OperationSpec = { bodyMapper: Mappers.ErrorDetails } }, - serializer -}; - -const createOrUpdateOperationSpec: msRest.OperationSpec = { - httpMethod: "PUT", - path: - "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Devices/IotHubs/{resourceName}/certificates/{certificateName}", + queryParameters: [Parameters.apiVersion], urlParameters: [ + Parameters.$host, Parameters.subscriptionId, Parameters.resourceGroupName, Parameters.resourceName, Parameters.certificateName ], - queryParameters: [Parameters.apiVersion], - headerParameters: [Parameters.ifMatch0, Parameters.acceptLanguage], - requestBody: { - parameterPath: { - properties: ["options", "properties"] - }, - mapper: { - ...Mappers.CertificateDescription, - required: true - } - }, + headerParameters: [Parameters.accept], + serializer +}; +const createOrUpdateOperationSpec: coreClient.OperationSpec = { + path: + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Devices/IotHubs/{resourceName}/certificates/{certificateName}", + httpMethod: "PUT", responses: { 200: { bodyMapper: Mappers.CertificateDescription @@ -485,21 +239,27 @@ const createOrUpdateOperationSpec: msRest.OperationSpec = { bodyMapper: Mappers.ErrorDetails } }, - serializer -}; - -const deleteMethodOperationSpec: msRest.OperationSpec = { - httpMethod: "DELETE", - path: - "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Devices/IotHubs/{resourceName}/certificates/{certificateName}", + requestBody: Parameters.certificateDescription, + queryParameters: [Parameters.apiVersion], urlParameters: [ + Parameters.$host, Parameters.subscriptionId, Parameters.resourceGroupName, Parameters.resourceName, Parameters.certificateName ], - queryParameters: [Parameters.apiVersion], - headerParameters: [Parameters.ifMatch1, Parameters.acceptLanguage], + headerParameters: [ + Parameters.accept, + Parameters.contentType, + Parameters.ifMatch + ], + mediaType: "json", + serializer +}; +const deleteOperationSpec: coreClient.OperationSpec = { + path: + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Devices/IotHubs/{resourceName}/certificates/{certificateName}", + httpMethod: "DELETE", responses: { 200: {}, 204: {}, @@ -507,21 +267,21 @@ const deleteMethodOperationSpec: msRest.OperationSpec = { bodyMapper: Mappers.ErrorDetails } }, - serializer -}; - -const generateVerificationCodeOperationSpec: msRest.OperationSpec = { - httpMethod: "POST", - path: - "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Devices/IotHubs/{resourceName}/certificates/{certificateName}/generateVerificationCode", + queryParameters: [Parameters.apiVersion], urlParameters: [ + Parameters.$host, Parameters.subscriptionId, Parameters.resourceGroupName, Parameters.resourceName, Parameters.certificateName ], - queryParameters: [Parameters.apiVersion], - headerParameters: [Parameters.ifMatch1, Parameters.acceptLanguage], + headerParameters: [Parameters.accept, Parameters.ifMatch1], + serializer +}; +const generateVerificationCodeOperationSpec: coreClient.OperationSpec = { + path: + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Devices/IotHubs/{resourceName}/certificates/{certificateName}/generateVerificationCode", + httpMethod: "POST", responses: { 200: { bodyMapper: Mappers.CertificateWithNonceDescription @@ -530,30 +290,21 @@ const generateVerificationCodeOperationSpec: msRest.OperationSpec = { bodyMapper: Mappers.ErrorDetails } }, - serializer -}; - -const verifyOperationSpec: msRest.OperationSpec = { - httpMethod: "POST", - path: - "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Devices/IotHubs/{resourceName}/certificates/{certificateName}/verify", + queryParameters: [Parameters.apiVersion], urlParameters: [ + Parameters.$host, Parameters.subscriptionId, Parameters.resourceGroupName, Parameters.resourceName, Parameters.certificateName ], - queryParameters: [Parameters.apiVersion], - headerParameters: [Parameters.ifMatch1, Parameters.acceptLanguage], - requestBody: { - parameterPath: { - certificate: ["options", "certificate"] - }, - mapper: { - ...Mappers.CertificateVerificationDescription, - required: true - } - }, + headerParameters: [Parameters.accept, Parameters.ifMatch1], + serializer +}; +const verifyOperationSpec: coreClient.OperationSpec = { + path: + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Devices/IotHubs/{resourceName}/certificates/{certificateName}/verify", + httpMethod: "POST", responses: { 200: { bodyMapper: Mappers.CertificateDescription @@ -562,5 +313,20 @@ const verifyOperationSpec: msRest.OperationSpec = { bodyMapper: Mappers.ErrorDetails } }, + requestBody: Parameters.certificateVerificationBody, + queryParameters: [Parameters.apiVersion], + urlParameters: [ + Parameters.$host, + Parameters.subscriptionId, + Parameters.resourceGroupName, + Parameters.resourceName, + Parameters.certificateName + ], + headerParameters: [ + Parameters.accept, + Parameters.contentType, + Parameters.ifMatch1 + ], + mediaType: "json", serializer }; diff --git a/sdk/iothub/arm-iothub/src/operations/index.ts b/sdk/iothub/arm-iothub/src/operations/index.ts index 3b1febaa937b..2e8c735dc1bc 100644 --- a/sdk/iothub/arm-iothub/src/operations/index.ts +++ b/sdk/iothub/arm-iothub/src/operations/index.ts @@ -3,8 +3,7 @@ * 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/iothub/arm-iothub/src/operations/iotHub.ts b/sdk/iothub/arm-iothub/src/operations/iotHub.ts index 4613127cff36..3a56be38c504 100644 --- a/sdk/iothub/arm-iothub/src/operations/iotHub.ts +++ b/sdk/iothub/arm-iothub/src/operations/iotHub.ts @@ -3,105 +3,146 @@ * 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 Mappers from "../models/iotHubMappers"; +import { IotHub } from "../operationsInterfaces"; +import * as coreClient from "@azure/core-client"; +import * as Mappers from "../models/mappers"; import * as Parameters from "../models/parameters"; -import { IotHubClientContext } from "../iotHubClientContext"; +import { IotHubClient } from "../iotHubClient"; +import { PollerLike, PollOperationState, LroEngine } from "@azure/core-lro"; +import { LroImpl } from "../lroImpl"; +import { FailoverInput, IotHubManualFailoverOptionalParams } from "../models"; -/** Class representing a IotHub. */ -export class IotHub { - private readonly client: IotHubClientContext; +/** Class containing IotHub operations. */ +export class IotHubImpl implements IotHub { + private readonly client: IotHubClient; /** - * Create a IotHub. - * @param {IotHubClientContext} client Reference to the service client. + * Initialize a new instance of the class IotHub class. + * @param client Reference to the service client */ - constructor(client: IotHubClientContext) { + constructor(client: IotHubClient) { this.client = client; } /** * Manually initiate a failover for the IoT Hub to its secondary region. To learn more, see * https://aka.ms/manualfailover - * @summary Manually initiate a failover for the IoT Hub to its secondary region * @param iotHubName Name of the IoT hub to failover * @param resourceGroupName Name of the resource group containing the IoT hub resource - * @param failoverRegion Region the hub will be failed over to - * @param [options] The optional parameters - * @returns Promise + * @param failoverInput Region to failover to. Must be the Azure paired region. Get the value from the + * secondary location in the locations property. To learn more, see + * https://aka.ms/manualfailover/region + * @param options The options parameters. */ - manualFailover( + async beginManualFailover( iotHubName: string, resourceGroupName: string, - failoverRegion: string, - options?: msRest.RequestOptionsBase - ): Promise { - return this.beginManualFailover( - iotHubName, - resourceGroupName, - failoverRegion, - options - ).then((lroPoller) => lroPoller.pollUntilFinished()); + failoverInput: FailoverInput, + options?: IotHubManualFailoverOptionalParams + ): 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, + { iotHubName, resourceGroupName, failoverInput, options }, + manualFailoverOperationSpec + ); + return new LroEngine(lro, { + resumeFrom: options?.resumeFrom, + intervalInMs: options?.updateIntervalInMs + }); } /** * Manually initiate a failover for the IoT Hub to its secondary region. To learn more, see * https://aka.ms/manualfailover - * @summary Manually initiate a failover for the IoT Hub to its secondary region * @param iotHubName Name of the IoT hub to failover * @param resourceGroupName Name of the resource group containing the IoT hub resource - * @param failoverRegion Region the hub will be failed over to - * @param [options] The optional parameters - * @returns Promise + * @param failoverInput Region to failover to. Must be the Azure paired region. Get the value from the + * secondary location in the locations property. To learn more, see + * https://aka.ms/manualfailover/region + * @param options The options parameters. */ - beginManualFailover( + async beginManualFailoverAndWait( iotHubName: string, resourceGroupName: string, - failoverRegion: string, - options?: msRest.RequestOptionsBase - ): Promise { - return this.client.sendLRORequest( - { - iotHubName, - resourceGroupName, - failoverRegion, - options - }, - beginManualFailoverOperationSpec, + failoverInput: FailoverInput, + options?: IotHubManualFailoverOptionalParams + ): Promise { + const poller = await this.beginManualFailover( + iotHubName, + resourceGroupName, + failoverInput, options ); + return poller.pollUntilDone(); } } - // Operation Specifications -const serializer = new msRest.Serializer(Mappers); -const beginManualFailoverOperationSpec: msRest.OperationSpec = { - httpMethod: "POST", +const serializer = coreClient.createSerializer(Mappers, /* isXml */ false); + +const manualFailoverOperationSpec: coreClient.OperationSpec = { path: - "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Devices/IotHubs/{iotHubName}/failover", - urlParameters: [Parameters.iotHubName, Parameters.subscriptionId, Parameters.resourceGroupName], - queryParameters: [Parameters.apiVersion], - headerParameters: [Parameters.acceptLanguage], - requestBody: { - parameterPath: { - failoverRegion: "failoverRegion" - }, - mapper: { - ...Mappers.FailoverInput, - required: true - } - }, + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Devices/IotHubs/{iotHubName}/failover", + httpMethod: "POST", responses: { 200: {}, + 201: {}, 202: {}, + 204: {}, default: { bodyMapper: Mappers.ErrorDetails } }, + requestBody: Parameters.failoverInput, + queryParameters: [Parameters.apiVersion], + urlParameters: [ + Parameters.$host, + Parameters.subscriptionId, + Parameters.resourceGroupName, + Parameters.iotHubName + ], + headerParameters: [Parameters.accept, Parameters.contentType], + mediaType: "json", serializer }; diff --git a/sdk/iothub/arm-iothub/src/operations/iotHubResource.ts b/sdk/iothub/arm-iothub/src/operations/iotHubResource.ts index d6348e15e785..2725e248063f 100644 --- a/sdk/iothub/arm-iothub/src/operations/iotHubResource.ts +++ b/sdk/iothub/arm-iothub/src/operations/iotHubResource.ts @@ -3,1725 +3,1562 @@ * 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/iotHubResourceMappers"; +import { PagedAsyncIterableIterator } from "@azure/core-paging"; +import { IotHubResource } from "../operationsInterfaces"; +import * as coreClient from "@azure/core-client"; +import * as Mappers from "../models/mappers"; import * as Parameters from "../models/parameters"; -import { IotHubClientContext } from "../iotHubClientContext"; - -/** Class representing a IotHubResource. */ -export class IotHubResource { - private readonly client: IotHubClientContext; +import { IotHubClient } from "../iotHubClient"; +import { PollerLike, PollOperationState, LroEngine } from "@azure/core-lro"; +import { LroImpl } from "../lroImpl"; +import { + IotHubDescription, + IotHubResourceListBySubscriptionNextOptionalParams, + IotHubResourceListBySubscriptionOptionalParams, + IotHubResourceListByResourceGroupNextOptionalParams, + IotHubResourceListByResourceGroupOptionalParams, + IotHubSkuDescription, + IotHubResourceGetValidSkusNextOptionalParams, + IotHubResourceGetValidSkusOptionalParams, + EventHubConsumerGroupInfo, + IotHubResourceListEventHubConsumerGroupsNextOptionalParams, + IotHubResourceListEventHubConsumerGroupsOptionalParams, + JobResponse, + IotHubResourceListJobsNextOptionalParams, + IotHubResourceListJobsOptionalParams, + IotHubQuotaMetricInfo, + IotHubResourceGetQuotaMetricsNextOptionalParams, + IotHubResourceGetQuotaMetricsOptionalParams, + EndpointHealthData, + IotHubResourceGetEndpointHealthNextOptionalParams, + IotHubResourceGetEndpointHealthOptionalParams, + SharedAccessSignatureAuthorizationRule, + IotHubResourceListKeysNextOptionalParams, + IotHubResourceListKeysOptionalParams, + IotHubResourceGetOptionalParams, + IotHubResourceGetResponse, + IotHubResourceCreateOrUpdateOptionalParams, + IotHubResourceCreateOrUpdateResponse, + TagsResource, + IotHubResourceUpdateOptionalParams, + IotHubResourceUpdateResponse, + IotHubResourceDeleteOptionalParams, + IotHubResourceDeleteResponse, + IotHubResourceListBySubscriptionResponse, + IotHubResourceListByResourceGroupResponse, + IotHubResourceGetStatsOptionalParams, + IotHubResourceGetStatsResponse, + IotHubResourceGetValidSkusResponse, + IotHubResourceListEventHubConsumerGroupsResponse, + IotHubResourceGetEventHubConsumerGroupOptionalParams, + IotHubResourceGetEventHubConsumerGroupResponse, + EventHubConsumerGroupBodyDescription, + IotHubResourceCreateEventHubConsumerGroupOptionalParams, + IotHubResourceCreateEventHubConsumerGroupResponse, + IotHubResourceDeleteEventHubConsumerGroupOptionalParams, + IotHubResourceListJobsResponse, + IotHubResourceGetJobOptionalParams, + IotHubResourceGetJobResponse, + IotHubResourceGetQuotaMetricsResponse, + IotHubResourceGetEndpointHealthResponse, + OperationInputs, + IotHubResourceCheckNameAvailabilityOptionalParams, + IotHubResourceCheckNameAvailabilityResponse, + TestAllRoutesInput, + IotHubResourceTestAllRoutesOptionalParams, + IotHubResourceTestAllRoutesResponse, + TestRouteInput, + IotHubResourceTestRouteOptionalParams, + IotHubResourceTestRouteResponse, + IotHubResourceListKeysResponse, + IotHubResourceGetKeysForKeyNameOptionalParams, + IotHubResourceGetKeysForKeyNameResponse, + ExportDevicesRequest, + IotHubResourceExportDevicesOptionalParams, + IotHubResourceExportDevicesResponse, + ImportDevicesRequest, + IotHubResourceImportDevicesOptionalParams, + IotHubResourceImportDevicesResponse, + IotHubResourceListBySubscriptionNextResponse, + IotHubResourceListByResourceGroupNextResponse, + IotHubResourceGetValidSkusNextResponse, + IotHubResourceListEventHubConsumerGroupsNextResponse, + IotHubResourceListJobsNextResponse, + IotHubResourceGetQuotaMetricsNextResponse, + IotHubResourceGetEndpointHealthNextResponse, + IotHubResourceListKeysNextResponse +} from "../models"; + +/// +/** Class containing IotHubResource operations. */ +export class IotHubResourceImpl implements IotHubResource { + private readonly client: IotHubClient; + + /** + * Initialize a new instance of the class IotHubResource class. + * @param client Reference to the service client + */ + constructor(client: IotHubClient) { + this.client = client; + } /** - * Create a IotHubResource. - * @param {IotHubClientContext} client Reference to the service client. - */ - constructor(client: IotHubClientContext) { - this.client = client; + * Get all the IoT hubs in a subscription. + * @param options The options parameters. + */ + public listBySubscription( + options?: IotHubResourceListBySubscriptionOptionalParams + ): PagedAsyncIterableIterator { + const iter = this.listBySubscriptionPagingAll(options); + return { + next() { + return iter.next(); + }, + [Symbol.asyncIterator]() { + return this; + }, + byPage: () => { + return this.listBySubscriptionPagingPage(options); + } + }; + } + + private async *listBySubscriptionPagingPage( + options?: IotHubResourceListBySubscriptionOptionalParams + ): AsyncIterableIterator { + let result = await this._listBySubscription(options); + yield result.value || []; + let continuationToken = result.nextLink; + while (continuationToken) { + result = await this._listBySubscriptionNext(continuationToken, options); + continuationToken = result.nextLink; + yield result.value || []; + } + } + + private async *listBySubscriptionPagingAll( + options?: IotHubResourceListBySubscriptionOptionalParams + ): AsyncIterableIterator { + for await (const page of this.listBySubscriptionPagingPage(options)) { + yield* page; + } } /** - * Get the non-security related metadata of an IoT hub. - * @summary Get the non-security related metadata of an IoT hub + * Get all the IoT hubs in a resource group. * @param resourceGroupName The name of the resource group that contains the IoT hub. - * @param resourceName The name of the IoT hub. - * @param [options] The optional parameters - * @returns Promise + * @param options The options parameters. */ - get( + public listByResourceGroup( resourceGroupName: string, - resourceName: string, - options?: msRest.RequestOptionsBase - ): Promise; - /** - * @param resourceGroupName The name of the resource group that contains the IoT hub. - * @param resourceName The name of the IoT hub. - * @param callback The callback - */ - get( + options?: IotHubResourceListByResourceGroupOptionalParams + ): 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, - resourceName: string, - callback: msRest.ServiceCallback - ): void; + options?: IotHubResourceListByResourceGroupOptionalParams + ): 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?: IotHubResourceListByResourceGroupOptionalParams + ): AsyncIterableIterator { + for await (const page of this.listByResourceGroupPagingPage( + resourceGroupName, + options + )) { + yield* page; + } + } + /** + * Get the list of valid SKUs for an IoT hub. * @param resourceGroupName The name of the resource group that contains the IoT hub. * @param resourceName The name of the IoT hub. - * @param options The optional parameters - * @param callback The callback + * @param options The options parameters. */ - get( + public listValidSkus( resourceGroupName: string, resourceName: string, - options: msRest.RequestOptionsBase, - callback: msRest.ServiceCallback - ): void; - get( + options?: IotHubResourceGetValidSkusOptionalParams + ): PagedAsyncIterableIterator { + const iter = this.getValidSkusPagingAll( + resourceGroupName, + resourceName, + options + ); + return { + next() { + return iter.next(); + }, + [Symbol.asyncIterator]() { + return this; + }, + byPage: () => { + return this.getValidSkusPagingPage( + resourceGroupName, + resourceName, + options + ); + } + }; + } + + private async *getValidSkusPagingPage( resourceGroupName: string, resourceName: string, - options?: msRest.RequestOptionsBase | msRest.ServiceCallback, - callback?: msRest.ServiceCallback - ): Promise { - return this.client.sendOperationRequest( - { + options?: IotHubResourceGetValidSkusOptionalParams + ): AsyncIterableIterator { + let result = await this._getValidSkus( + resourceGroupName, + resourceName, + options + ); + yield result.value || []; + let continuationToken = result.nextLink; + while (continuationToken) { + result = await this._getValidSkusNext( resourceGroupName, resourceName, + continuationToken, options - }, - getOperationSpec, - callback - ) as Promise; + ); + continuationToken = result.nextLink; + yield result.value || []; + } + } + + private async *getValidSkusPagingAll( + resourceGroupName: string, + resourceName: string, + options?: IotHubResourceGetValidSkusOptionalParams + ): AsyncIterableIterator { + for await (const page of this.getValidSkusPagingPage( + resourceGroupName, + resourceName, + options + )) { + yield* page; + } } /** - * Create or update the metadata of an Iot hub. The usual pattern to modify a property is to - * retrieve the IoT hub metadata and security metadata, and then combine them with the modified - * values in a new body to update the IoT hub. If certain properties are missing in the JSON, - * updating IoT Hub may cause these values to fallback to default, which may lead to unexpected - * behavior. - * @summary Create or update the metadata of an IoT hub. + * Get a list of the consumer groups in the Event Hub-compatible device-to-cloud endpoint in an IoT + * hub. * @param resourceGroupName The name of the resource group that contains the IoT hub. * @param resourceName The name of the IoT hub. - * @param iotHubDescription The IoT hub metadata and security metadata. - * @param [options] The optional parameters - * @returns Promise + * @param eventHubEndpointName The name of the Event Hub-compatible endpoint. + * @param options The options parameters. */ - createOrUpdate( + public listEventHubConsumerGroups( resourceGroupName: string, resourceName: string, - iotHubDescription: Models.IotHubDescription, - options?: Models.IotHubResourceCreateOrUpdateOptionalParams - ): Promise { - return this.beginCreateOrUpdate( + eventHubEndpointName: string, + options?: IotHubResourceListEventHubConsumerGroupsOptionalParams + ): PagedAsyncIterableIterator { + const iter = this.listEventHubConsumerGroupsPagingAll( resourceGroupName, resourceName, - iotHubDescription, + eventHubEndpointName, options - ).then((lroPoller) => lroPoller.pollUntilFinished()) as Promise< - Models.IotHubResourceCreateOrUpdateResponse - >; + ); + return { + next() { + return iter.next(); + }, + [Symbol.asyncIterator]() { + return this; + }, + byPage: () => { + return this.listEventHubConsumerGroupsPagingPage( + resourceGroupName, + resourceName, + eventHubEndpointName, + options + ); + } + }; } - /** - * Update an existing IoT Hub tags. to update other fields use the CreateOrUpdate method - * @summary Update an existing IoT Hubs tags. - * @param resourceGroupName Resource group identifier. - * @param resourceName Name of iot hub to update. - * @param [options] The optional parameters - * @returns Promise - */ - update( + private async *listEventHubConsumerGroupsPagingPage( + resourceGroupName: string, + resourceName: string, + eventHubEndpointName: string, + options?: IotHubResourceListEventHubConsumerGroupsOptionalParams + ): AsyncIterableIterator { + let result = await this._listEventHubConsumerGroups( + resourceGroupName, + resourceName, + eventHubEndpointName, + options + ); + yield result.value || []; + let continuationToken = result.nextLink; + while (continuationToken) { + result = await this._listEventHubConsumerGroupsNext( + resourceGroupName, + resourceName, + eventHubEndpointName, + continuationToken, + options + ); + continuationToken = result.nextLink; + yield result.value || []; + } + } + + private async *listEventHubConsumerGroupsPagingAll( resourceGroupName: string, resourceName: string, - options?: Models.IotHubResourceUpdateOptionalParams - ): Promise { - return this.beginUpdate(resourceGroupName, resourceName, options).then((lroPoller) => - lroPoller.pollUntilFinished() - ) as Promise; + eventHubEndpointName: string, + options?: IotHubResourceListEventHubConsumerGroupsOptionalParams + ): AsyncIterableIterator { + for await (const page of this.listEventHubConsumerGroupsPagingPage( + resourceGroupName, + resourceName, + eventHubEndpointName, + options + )) { + yield* page; + } } /** - * Delete an IoT hub. - * @summary Delete an IoT hub + * Get a list of all the jobs in an IoT hub. For more information, see: + * https://docs.microsoft.com/azure/iot-hub/iot-hub-devguide-identity-registry. * @param resourceGroupName The name of the resource group that contains the IoT hub. * @param resourceName The name of the IoT hub. - * @param [options] The optional parameters - * @returns Promise + * @param options The options parameters. */ - deleteMethod( + public listJobs( resourceGroupName: string, resourceName: string, - options?: msRest.RequestOptionsBase - ): Promise { - return this.beginDeleteMethod(resourceGroupName, resourceName, options).then((lroPoller) => - lroPoller.pollUntilFinished() - ) as Promise; + options?: IotHubResourceListJobsOptionalParams + ): PagedAsyncIterableIterator { + const iter = this.listJobsPagingAll( + resourceGroupName, + resourceName, + options + ); + return { + next() { + return iter.next(); + }, + [Symbol.asyncIterator]() { + return this; + }, + byPage: () => { + return this.listJobsPagingPage( + resourceGroupName, + resourceName, + options + ); + } + }; } - /** - * Get all the IoT hubs in a subscription. - * @summary Get all the IoT hubs in a subscription - * @param [options] The optional parameters - * @returns Promise - */ - listBySubscription( - options?: msRest.RequestOptionsBase - ): Promise; - /** - * @param callback The callback - */ - listBySubscription(callback: msRest.ServiceCallback): void; - /** - * @param options The optional parameters - * @param callback The callback - */ - listBySubscription( - options: msRest.RequestOptionsBase, - callback: msRest.ServiceCallback - ): void; - listBySubscription( - options?: - | msRest.RequestOptionsBase - | msRest.ServiceCallback, - callback?: msRest.ServiceCallback - ): Promise { - return this.client.sendOperationRequest( - { + private async *listJobsPagingPage( + resourceGroupName: string, + resourceName: string, + options?: IotHubResourceListJobsOptionalParams + ): AsyncIterableIterator { + let result = await this._listJobs(resourceGroupName, resourceName, options); + yield result.value || []; + let continuationToken = result.nextLink; + while (continuationToken) { + result = await this._listJobsNext( + resourceGroupName, + resourceName, + continuationToken, options - }, - listBySubscriptionOperationSpec, - callback - ) as Promise; + ); + continuationToken = result.nextLink; + yield result.value || []; + } } - /** - * Get all the IoT hubs in a resource group. - * @summary Get all the IoT hubs in a resource group - * @param resourceGroupName The name of the resource group that contains the IoT hub. - * @param [options] The optional parameters - * @returns Promise - */ - listByResourceGroup( + private async *listJobsPagingAll( resourceGroupName: string, - options?: msRest.RequestOptionsBase - ): Promise; - /** - * @param resourceGroupName The name of the resource group that contains the IoT hub. - * @param callback The callback - */ - listByResourceGroup( - resourceGroupName: string, - callback: msRest.ServiceCallback - ): void; + resourceName: string, + options?: IotHubResourceListJobsOptionalParams + ): AsyncIterableIterator { + for await (const page of this.listJobsPagingPage( + resourceGroupName, + resourceName, + options + )) { + yield* page; + } + } + /** + * Get the quota metrics for an IoT hub. * @param resourceGroupName The name of the resource group that contains the IoT hub. - * @param options The optional parameters - * @param callback The callback + * @param resourceName The name of the IoT hub. + * @param options The options parameters. */ - listByResourceGroup( + public listQuotaMetrics( resourceGroupName: string, - options: msRest.RequestOptionsBase, - callback: msRest.ServiceCallback - ): void; - listByResourceGroup( + resourceName: string, + options?: IotHubResourceGetQuotaMetricsOptionalParams + ): PagedAsyncIterableIterator { + const iter = this.getQuotaMetricsPagingAll( + resourceGroupName, + resourceName, + options + ); + return { + next() { + return iter.next(); + }, + [Symbol.asyncIterator]() { + return this; + }, + byPage: () => { + return this.getQuotaMetricsPagingPage( + resourceGroupName, + resourceName, + options + ); + } + }; + } + + private async *getQuotaMetricsPagingPage( resourceGroupName: string, - options?: - | msRest.RequestOptionsBase - | msRest.ServiceCallback, - callback?: msRest.ServiceCallback - ): Promise { - return this.client.sendOperationRequest( - { + resourceName: string, + options?: IotHubResourceGetQuotaMetricsOptionalParams + ): AsyncIterableIterator { + let result = await this._getQuotaMetrics( + resourceGroupName, + resourceName, + options + ); + yield result.value || []; + let continuationToken = result.nextLink; + while (continuationToken) { + result = await this._getQuotaMetricsNext( resourceGroupName, + resourceName, + continuationToken, options - }, - listByResourceGroupOperationSpec, - callback - ) as Promise; + ); + continuationToken = result.nextLink; + yield result.value || []; + } } - /** - * Get the statistics from an IoT hub. - * @summary Get the statistics from an IoT hub - * @param resourceGroupName The name of the resource group that contains the IoT hub. - * @param resourceName The name of the IoT hub. - * @param [options] The optional parameters - * @returns Promise - */ - getStats( + private async *getQuotaMetricsPagingAll( resourceGroupName: string, resourceName: string, - options?: msRest.RequestOptionsBase - ): Promise; + options?: IotHubResourceGetQuotaMetricsOptionalParams + ): AsyncIterableIterator { + for await (const page of this.getQuotaMetricsPagingPage( + resourceGroupName, + resourceName, + options + )) { + yield* page; + } + } + /** - * @param resourceGroupName The name of the resource group that contains the IoT hub. - * @param resourceName The name of the IoT hub. - * @param callback The callback + * Get the health for routing endpoints. + * @param resourceGroupName + * @param iotHubName + * @param options The options parameters. */ - getStats( + public listEndpointHealth( resourceGroupName: string, - resourceName: string, - callback: msRest.ServiceCallback - ): void; + iotHubName: string, + options?: IotHubResourceGetEndpointHealthOptionalParams + ): PagedAsyncIterableIterator { + const iter = this.getEndpointHealthPagingAll( + resourceGroupName, + iotHubName, + options + ); + return { + next() { + return iter.next(); + }, + [Symbol.asyncIterator]() { + return this; + }, + byPage: () => { + return this.getEndpointHealthPagingPage( + resourceGroupName, + iotHubName, + options + ); + } + }; + } + + private async *getEndpointHealthPagingPage( + resourceGroupName: string, + iotHubName: string, + options?: IotHubResourceGetEndpointHealthOptionalParams + ): AsyncIterableIterator { + let result = await this._getEndpointHealth( + resourceGroupName, + iotHubName, + options + ); + yield result.value || []; + let continuationToken = result.nextLink; + while (continuationToken) { + result = await this._getEndpointHealthNext( + resourceGroupName, + iotHubName, + continuationToken, + options + ); + continuationToken = result.nextLink; + yield result.value || []; + } + } + + private async *getEndpointHealthPagingAll( + resourceGroupName: string, + iotHubName: string, + options?: IotHubResourceGetEndpointHealthOptionalParams + ): AsyncIterableIterator { + for await (const page of this.getEndpointHealthPagingPage( + resourceGroupName, + iotHubName, + options + )) { + yield* page; + } + } + /** + * Get the security metadata for an IoT hub. For more information, see: + * https://docs.microsoft.com/azure/iot-hub/iot-hub-devguide-security. * @param resourceGroupName The name of the resource group that contains the IoT hub. * @param resourceName The name of the IoT hub. - * @param options The optional parameters - * @param callback The callback + * @param options The options parameters. */ - getStats( + public listKeys( resourceGroupName: string, resourceName: string, - options: msRest.RequestOptionsBase, - callback: msRest.ServiceCallback - ): void; - getStats( + options?: IotHubResourceListKeysOptionalParams + ): PagedAsyncIterableIterator { + const iter = this.listKeysPagingAll( + resourceGroupName, + resourceName, + options + ); + return { + next() { + return iter.next(); + }, + [Symbol.asyncIterator]() { + return this; + }, + byPage: () => { + return this.listKeysPagingPage( + resourceGroupName, + resourceName, + options + ); + } + }; + } + + private async *listKeysPagingPage( resourceGroupName: string, resourceName: string, - options?: msRest.RequestOptionsBase | msRest.ServiceCallback, - callback?: msRest.ServiceCallback - ): Promise { - return this.client.sendOperationRequest( - { + options?: IotHubResourceListKeysOptionalParams + ): AsyncIterableIterator { + let result = await this._listKeys(resourceGroupName, resourceName, options); + yield result.value || []; + let continuationToken = result.nextLink; + while (continuationToken) { + result = await this._listKeysNext( resourceGroupName, resourceName, + continuationToken, options - }, - getStatsOperationSpec, - callback - ) as Promise; + ); + continuationToken = result.nextLink; + yield result.value || []; + } } - /** - * Get the list of valid SKUs for an IoT hub. - * @summary Get the list of valid SKUs for an IoT hub - * @param resourceGroupName The name of the resource group that contains the IoT hub. - * @param resourceName The name of the IoT hub. - * @param [options] The optional parameters - * @returns Promise - */ - getValidSkus( + private async *listKeysPagingAll( resourceGroupName: string, resourceName: string, - options?: msRest.RequestOptionsBase - ): Promise; + options?: IotHubResourceListKeysOptionalParams + ): AsyncIterableIterator { + for await (const page of this.listKeysPagingPage( + resourceGroupName, + resourceName, + options + )) { + yield* page; + } + } + /** + * Get the non-security related metadata of an IoT hub. * @param resourceGroupName The name of the resource group that contains the IoT hub. * @param resourceName The name of the IoT hub. - * @param callback The callback + * @param options The options parameters. */ - getValidSkus( + get( resourceGroupName: string, resourceName: string, - callback: msRest.ServiceCallback - ): void; + options?: IotHubResourceGetOptionalParams + ): Promise { + return this.client.sendOperationRequest( + { resourceGroupName, resourceName, options }, + getOperationSpec + ); + } + /** + * Create or update the metadata of an Iot hub. The usual pattern to modify a property is to retrieve + * the IoT hub metadata and security metadata, and then combine them with the modified values in a new + * body to update the IoT hub. If certain properties are missing in the JSON, updating IoT Hub may + * cause these values to fallback to default, which may lead to unexpected behavior. * @param resourceGroupName The name of the resource group that contains the IoT hub. * @param resourceName The name of the IoT hub. - * @param options The optional parameters - * @param callback The callback + * @param iotHubDescription The IoT hub metadata and security metadata. + * @param options The options parameters. */ - getValidSkus( - resourceGroupName: string, - resourceName: string, - options: msRest.RequestOptionsBase, - callback: msRest.ServiceCallback - ): void; - getValidSkus( + async beginCreateOrUpdate( resourceGroupName: string, resourceName: string, - options?: - | msRest.RequestOptionsBase - | msRest.ServiceCallback, - callback?: msRest.ServiceCallback - ): Promise { - return this.client.sendOperationRequest( - { - resourceGroupName, - resourceName, - options - }, - getValidSkusOperationSpec, - callback - ) as Promise; + iotHubDescription: IotHubDescription, + options?: IotHubResourceCreateOrUpdateOptionalParams + ): Promise< + PollerLike< + PollOperationState, + IotHubResourceCreateOrUpdateResponse + > + > { + 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, resourceName, iotHubDescription, options }, + createOrUpdateOperationSpec + ); + return new LroEngine(lro, { + resumeFrom: options?.resumeFrom, + intervalInMs: options?.updateIntervalInMs + }); } /** - * Get a list of the consumer groups in the Event Hub-compatible device-to-cloud endpoint in an IoT - * hub. - * @summary Get a list of the consumer groups in the Event Hub-compatible device-to-cloud endpoint - * in an IoT hub + * Create or update the metadata of an Iot hub. The usual pattern to modify a property is to retrieve + * the IoT hub metadata and security metadata, and then combine them with the modified values in a new + * body to update the IoT hub. If certain properties are missing in the JSON, updating IoT Hub may + * cause these values to fallback to default, which may lead to unexpected behavior. * @param resourceGroupName The name of the resource group that contains the IoT hub. * @param resourceName The name of the IoT hub. - * @param eventHubEndpointName The name of the Event Hub-compatible endpoint. - * @param [options] The optional parameters - * @returns Promise + * @param iotHubDescription The IoT hub metadata and security metadata. + * @param options The options parameters. */ - listEventHubConsumerGroups( + async beginCreateOrUpdateAndWait( resourceGroupName: string, resourceName: string, - eventHubEndpointName: string, - options?: msRest.RequestOptionsBase - ): Promise; - /** - * @param resourceGroupName The name of the resource group that contains the IoT hub. - * @param resourceName The name of the IoT hub. - * @param eventHubEndpointName The name of the Event Hub-compatible endpoint. - * @param callback The callback - */ - listEventHubConsumerGroups( - resourceGroupName: string, - resourceName: string, - eventHubEndpointName: string, - callback: msRest.ServiceCallback - ): void; - /** - * @param resourceGroupName The name of the resource group that contains the IoT hub. - * @param resourceName The name of the IoT hub. - * @param eventHubEndpointName The name of the Event Hub-compatible endpoint. - * @param options The optional parameters - * @param callback The callback - */ - listEventHubConsumerGroups( - resourceGroupName: string, - resourceName: string, - eventHubEndpointName: string, - options: msRest.RequestOptionsBase, - callback: msRest.ServiceCallback - ): void; - listEventHubConsumerGroups( - resourceGroupName: string, - resourceName: string, - eventHubEndpointName: string, - options?: - | msRest.RequestOptionsBase - | msRest.ServiceCallback, - callback?: msRest.ServiceCallback - ): Promise { - return this.client.sendOperationRequest( - { - resourceGroupName, - resourceName, - eventHubEndpointName, - options - }, - listEventHubConsumerGroupsOperationSpec, - callback - ) as Promise; - } - - /** - * Get a consumer group from the Event Hub-compatible device-to-cloud endpoint for an IoT hub. - * @summary Get a consumer group from the Event Hub-compatible device-to-cloud endpoint for an IoT - * hub - * @param resourceGroupName The name of the resource group that contains the IoT hub. - * @param resourceName The name of the IoT hub. - * @param eventHubEndpointName The name of the Event Hub-compatible endpoint in the IoT hub. - * @param name The name of the consumer group to retrieve. - * @param [options] The optional parameters - * @returns Promise - */ - getEventHubConsumerGroup( - resourceGroupName: string, - resourceName: string, - eventHubEndpointName: string, - name: string, - options?: msRest.RequestOptionsBase - ): Promise; - /** - * @param resourceGroupName The name of the resource group that contains the IoT hub. - * @param resourceName The name of the IoT hub. - * @param eventHubEndpointName The name of the Event Hub-compatible endpoint in the IoT hub. - * @param name The name of the consumer group to retrieve. - * @param callback The callback - */ - getEventHubConsumerGroup( - resourceGroupName: string, - resourceName: string, - eventHubEndpointName: string, - name: string, - callback: msRest.ServiceCallback - ): void; - /** - * @param resourceGroupName The name of the resource group that contains the IoT hub. - * @param resourceName The name of the IoT hub. - * @param eventHubEndpointName The name of the Event Hub-compatible endpoint in the IoT hub. - * @param name The name of the consumer group to retrieve. - * @param options The optional parameters - * @param callback The callback - */ - getEventHubConsumerGroup( - resourceGroupName: string, - resourceName: string, - eventHubEndpointName: string, - name: string, - options: msRest.RequestOptionsBase, - callback: msRest.ServiceCallback - ): void; - getEventHubConsumerGroup( - resourceGroupName: string, - resourceName: string, - eventHubEndpointName: string, - name: string, - options?: msRest.RequestOptionsBase | msRest.ServiceCallback, - callback?: msRest.ServiceCallback - ): Promise { - return this.client.sendOperationRequest( - { - resourceGroupName, - resourceName, - eventHubEndpointName, - name, - options - }, - getEventHubConsumerGroupOperationSpec, - callback - ) as Promise; - } - - /** - * Add a consumer group to an Event Hub-compatible endpoint in an IoT hub. - * @summary Add a consumer group to an Event Hub-compatible endpoint in an IoT hub - * @param resourceGroupName The name of the resource group that contains the IoT hub. - * @param resourceName The name of the IoT hub. - * @param eventHubEndpointName The name of the Event Hub-compatible endpoint in the IoT hub. - * @param name The name of the consumer group to add. - * @param properties - * @param [options] The optional parameters - * @returns Promise - */ - createEventHubConsumerGroup( - resourceGroupName: string, - resourceName: string, - eventHubEndpointName: string, - name: string, - properties: Models.EventHubConsumerGroupName, - options?: msRest.RequestOptionsBase - ): Promise; - /** - * @param resourceGroupName The name of the resource group that contains the IoT hub. - * @param resourceName The name of the IoT hub. - * @param eventHubEndpointName The name of the Event Hub-compatible endpoint in the IoT hub. - * @param name The name of the consumer group to add. - * @param properties - * @param callback The callback - */ - createEventHubConsumerGroup( - resourceGroupName: string, - resourceName: string, - eventHubEndpointName: string, - name: string, - properties: Models.EventHubConsumerGroupName, - callback: msRest.ServiceCallback - ): void; - /** - * @param resourceGroupName The name of the resource group that contains the IoT hub. - * @param resourceName The name of the IoT hub. - * @param eventHubEndpointName The name of the Event Hub-compatible endpoint in the IoT hub. - * @param name The name of the consumer group to add. - * @param properties - * @param options The optional parameters - * @param callback The callback - */ - createEventHubConsumerGroup( - resourceGroupName: string, - resourceName: string, - eventHubEndpointName: string, - name: string, - properties: Models.EventHubConsumerGroupName, - options: msRest.RequestOptionsBase, - callback: msRest.ServiceCallback - ): void; - createEventHubConsumerGroup( - resourceGroupName: string, - resourceName: string, - eventHubEndpointName: string, - name: string, - properties: Models.EventHubConsumerGroupName, - options?: msRest.RequestOptionsBase | msRest.ServiceCallback, - callback?: msRest.ServiceCallback - ): Promise { - return this.client.sendOperationRequest( - { - resourceGroupName, - resourceName, - eventHubEndpointName, - name, - properties, - options - }, - createEventHubConsumerGroupOperationSpec, - callback - ) as Promise; - } - - /** - * Delete a consumer group from an Event Hub-compatible endpoint in an IoT hub. - * @summary Delete a consumer group from an Event Hub-compatible endpoint in an IoT hub - * @param resourceGroupName The name of the resource group that contains the IoT hub. - * @param resourceName The name of the IoT hub. - * @param eventHubEndpointName The name of the Event Hub-compatible endpoint in the IoT hub. - * @param name The name of the consumer group to delete. - * @param [options] The optional parameters - * @returns Promise - */ - deleteEventHubConsumerGroup( - resourceGroupName: string, - resourceName: string, - eventHubEndpointName: string, - name: string, - options?: msRest.RequestOptionsBase - ): Promise; - /** - * @param resourceGroupName The name of the resource group that contains the IoT hub. - * @param resourceName The name of the IoT hub. - * @param eventHubEndpointName The name of the Event Hub-compatible endpoint in the IoT hub. - * @param name The name of the consumer group to delete. - * @param callback The callback - */ - deleteEventHubConsumerGroup( - resourceGroupName: string, - resourceName: string, - eventHubEndpointName: string, - name: string, - callback: msRest.ServiceCallback - ): void; - /** - * @param resourceGroupName The name of the resource group that contains the IoT hub. - * @param resourceName The name of the IoT hub. - * @param eventHubEndpointName The name of the Event Hub-compatible endpoint in the IoT hub. - * @param name The name of the consumer group to delete. - * @param options The optional parameters - * @param callback The callback - */ - deleteEventHubConsumerGroup( - resourceGroupName: string, - resourceName: string, - eventHubEndpointName: string, - name: string, - options: msRest.RequestOptionsBase, - callback: msRest.ServiceCallback - ): void; - deleteEventHubConsumerGroup( - resourceGroupName: string, - resourceName: string, - eventHubEndpointName: string, - name: string, - options?: msRest.RequestOptionsBase | msRest.ServiceCallback, - callback?: msRest.ServiceCallback - ): Promise { - return this.client.sendOperationRequest( - { - resourceGroupName, - resourceName, - eventHubEndpointName, - name, - options - }, - deleteEventHubConsumerGroupOperationSpec, - callback + iotHubDescription: IotHubDescription, + options?: IotHubResourceCreateOrUpdateOptionalParams + ): Promise { + const poller = await this.beginCreateOrUpdate( + resourceGroupName, + resourceName, + iotHubDescription, + options ); + return poller.pollUntilDone(); } /** - * Get a list of all the jobs in an IoT hub. For more information, see: - * https://docs.microsoft.com/azure/iot-hub/iot-hub-devguide-identity-registry. - * @summary Get a list of all the jobs in an IoT hub. For more information, see: - * https://docs.microsoft.com/azure/iot-hub/iot-hub-devguide-identity-registry - * @param resourceGroupName The name of the resource group that contains the IoT hub. - * @param resourceName The name of the IoT hub. - * @param [options] The optional parameters - * @returns Promise - */ - listJobs( - resourceGroupName: string, - resourceName: string, - options?: msRest.RequestOptionsBase - ): Promise; - /** - * @param resourceGroupName The name of the resource group that contains the IoT hub. - * @param resourceName The name of the IoT hub. - * @param callback The callback - */ - listJobs( - resourceGroupName: string, - resourceName: string, - callback: msRest.ServiceCallback - ): void; - /** - * @param resourceGroupName The name of the resource group that contains the IoT hub. - * @param resourceName The name of the IoT hub. - * @param options The optional parameters - * @param callback The callback - */ - listJobs( - resourceGroupName: string, - resourceName: string, - options: msRest.RequestOptionsBase, - callback: msRest.ServiceCallback - ): void; - listJobs( - resourceGroupName: string, - resourceName: string, - options?: msRest.RequestOptionsBase | msRest.ServiceCallback, - callback?: msRest.ServiceCallback - ): Promise { - return this.client.sendOperationRequest( - { - resourceGroupName, - resourceName, - options - }, - listJobsOperationSpec, - callback - ) as Promise; - } - - /** - * Get the details of a job from an IoT hub. For more information, see: - * https://docs.microsoft.com/azure/iot-hub/iot-hub-devguide-identity-registry. - * @summary Get the details of a job from an IoT hub. For more information, see: - * https://docs.microsoft.com/azure/iot-hub/iot-hub-devguide-identity-registry - * @param resourceGroupName The name of the resource group that contains the IoT hub. - * @param resourceName The name of the IoT hub. - * @param jobId The job identifier. - * @param [options] The optional parameters - * @returns Promise - */ - getJob( - resourceGroupName: string, - resourceName: string, - jobId: string, - options?: msRest.RequestOptionsBase - ): Promise; - /** - * @param resourceGroupName The name of the resource group that contains the IoT hub. - * @param resourceName The name of the IoT hub. - * @param jobId The job identifier. - * @param callback The callback - */ - getJob( - resourceGroupName: string, - resourceName: string, - jobId: string, - callback: msRest.ServiceCallback - ): void; - /** - * @param resourceGroupName The name of the resource group that contains the IoT hub. - * @param resourceName The name of the IoT hub. - * @param jobId The job identifier. - * @param options The optional parameters - * @param callback The callback + * Update an existing IoT Hub tags. to update other fields use the CreateOrUpdate method + * @param resourceGroupName Resource group identifier. + * @param resourceName Name of iot hub to update. + * @param iotHubTags Updated tag information to set into the iot hub instance. + * @param options The options parameters. */ - getJob( - resourceGroupName: string, - resourceName: string, - jobId: string, - options: msRest.RequestOptionsBase, - callback: msRest.ServiceCallback - ): void; - getJob( + async beginUpdate( resourceGroupName: string, resourceName: string, - jobId: string, - options?: msRest.RequestOptionsBase | msRest.ServiceCallback, - callback?: msRest.ServiceCallback - ): Promise { - return this.client.sendOperationRequest( - { - resourceGroupName, - resourceName, - jobId, - options - }, - getJobOperationSpec, - callback - ) as Promise; + iotHubTags: TagsResource, + options?: IotHubResourceUpdateOptionalParams + ): Promise< + PollerLike< + PollOperationState, + IotHubResourceUpdateResponse + > + > { + 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, resourceName, iotHubTags, options }, + updateOperationSpec + ); + return new LroEngine(lro, { + resumeFrom: options?.resumeFrom, + intervalInMs: options?.updateIntervalInMs + }); } /** - * Get the quota metrics for an IoT hub. - * @summary Get the quota metrics for an IoT hub - * @param resourceGroupName The name of the resource group that contains the IoT hub. - * @param resourceName The name of the IoT hub. - * @param [options] The optional parameters - * @returns Promise - */ - getQuotaMetrics( - resourceGroupName: string, - resourceName: string, - options?: msRest.RequestOptionsBase - ): Promise; - /** - * @param resourceGroupName The name of the resource group that contains the IoT hub. - * @param resourceName The name of the IoT hub. - * @param callback The callback - */ - getQuotaMetrics( - resourceGroupName: string, - resourceName: string, - callback: msRest.ServiceCallback - ): void; - /** - * @param resourceGroupName The name of the resource group that contains the IoT hub. - * @param resourceName The name of the IoT hub. - * @param options The optional parameters - * @param callback The callback + * Update an existing IoT Hub tags. to update other fields use the CreateOrUpdate method + * @param resourceGroupName Resource group identifier. + * @param resourceName Name of iot hub to update. + * @param iotHubTags Updated tag information to set into the iot hub instance. + * @param options The options parameters. */ - getQuotaMetrics( + async beginUpdateAndWait( resourceGroupName: string, resourceName: string, - options: msRest.RequestOptionsBase, - callback: msRest.ServiceCallback - ): void; - getQuotaMetrics( - resourceGroupName: string, - resourceName: string, - options?: - | msRest.RequestOptionsBase - | msRest.ServiceCallback, - callback?: msRest.ServiceCallback - ): Promise { - return this.client.sendOperationRequest( - { - resourceGroupName, - resourceName, - options - }, - getQuotaMetricsOperationSpec, - callback - ) as Promise; - } - - /** - * Get the health for routing endpoints. - * @summary Get the health for routing endpoints - * @param resourceGroupName - * @param iotHubName - * @param [options] The optional parameters - * @returns Promise - */ - getEndpointHealth( - resourceGroupName: string, - iotHubName: string, - options?: msRest.RequestOptionsBase - ): Promise; - /** - * @param resourceGroupName - * @param iotHubName - * @param callback The callback - */ - getEndpointHealth( - resourceGroupName: string, - iotHubName: string, - callback: msRest.ServiceCallback - ): void; - /** - * @param resourceGroupName - * @param iotHubName - * @param options The optional parameters - * @param callback The callback - */ - getEndpointHealth( - resourceGroupName: string, - iotHubName: string, - options: msRest.RequestOptionsBase, - callback: msRest.ServiceCallback - ): void; - getEndpointHealth( - resourceGroupName: string, - iotHubName: string, - options?: - | msRest.RequestOptionsBase - | msRest.ServiceCallback, - callback?: msRest.ServiceCallback - ): Promise { - return this.client.sendOperationRequest( - { - resourceGroupName, - iotHubName, - options - }, - getEndpointHealthOperationSpec, - callback - ) as Promise; - } - - /** - * Check if an IoT hub name is available. - * @summary Check if an IoT hub name is available - * @param name The name of the IoT hub to check. - * @param [options] The optional parameters - * @returns Promise - */ - checkNameAvailability( - name: string, - options?: msRest.RequestOptionsBase - ): Promise; - /** - * @param name The name of the IoT hub to check. - * @param callback The callback - */ - checkNameAvailability( - name: string, - callback: msRest.ServiceCallback - ): void; - /** - * @param name The name of the IoT hub to check. - * @param options The optional parameters - * @param callback The callback - */ - checkNameAvailability( - name: string, - options: msRest.RequestOptionsBase, - callback: msRest.ServiceCallback - ): void; - checkNameAvailability( - name: string, - options?: msRest.RequestOptionsBase | msRest.ServiceCallback, - callback?: msRest.ServiceCallback - ): Promise { - return this.client.sendOperationRequest( - { - name, - options - }, - checkNameAvailabilityOperationSpec, - callback - ) as Promise; - } - - /** - * Test all routes configured in this Iot Hub - * @summary Test all routes - * @param input Input for testing all routes - * @param iotHubName IotHub to be tested - * @param resourceGroupName resource group which Iot Hub belongs to - * @param [options] The optional parameters - * @returns Promise - */ - testAllRoutes( - input: Models.TestAllRoutesInput, - iotHubName: string, - resourceGroupName: string, - options?: msRest.RequestOptionsBase - ): Promise; - /** - * @param input Input for testing all routes - * @param iotHubName IotHub to be tested - * @param resourceGroupName resource group which Iot Hub belongs to - * @param callback The callback - */ - testAllRoutes( - input: Models.TestAllRoutesInput, - iotHubName: string, - resourceGroupName: string, - callback: msRest.ServiceCallback - ): void; - /** - * @param input Input for testing all routes - * @param iotHubName IotHub to be tested - * @param resourceGroupName resource group which Iot Hub belongs to - * @param options The optional parameters - * @param callback The callback - */ - testAllRoutes( - input: Models.TestAllRoutesInput, - iotHubName: string, - resourceGroupName: string, - options: msRest.RequestOptionsBase, - callback: msRest.ServiceCallback - ): void; - testAllRoutes( - input: Models.TestAllRoutesInput, - iotHubName: string, - resourceGroupName: string, - options?: msRest.RequestOptionsBase | msRest.ServiceCallback, - callback?: msRest.ServiceCallback - ): Promise { - return this.client.sendOperationRequest( - { - input, - iotHubName, - resourceGroupName, - options - }, - testAllRoutesOperationSpec, - callback - ) as Promise; + iotHubTags: TagsResource, + options?: IotHubResourceUpdateOptionalParams + ): Promise { + const poller = await this.beginUpdate( + resourceGroupName, + resourceName, + iotHubTags, + options + ); + return poller.pollUntilDone(); } - - /** - * Test the new route for this Iot Hub - * @summary Test the new route - * @param input Route that needs to be tested - * @param iotHubName IotHub to be tested - * @param resourceGroupName resource group which Iot Hub belongs to - * @param [options] The optional parameters - * @returns Promise + + /** + * Delete an IoT hub. + * @param resourceGroupName The name of the resource group that contains the IoT hub. + * @param resourceName The name of the IoT hub. + * @param options The options parameters. */ - testRoute( - input: Models.TestRouteInput, - iotHubName: string, + async beginDelete( resourceGroupName: string, - options?: msRest.RequestOptionsBase - ): Promise; + resourceName: string, + options?: IotHubResourceDeleteOptionalParams + ): Promise< + PollerLike< + PollOperationState, + IotHubResourceDeleteResponse + > + > { + 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, resourceName, options }, + deleteOperationSpec + ); + return new LroEngine(lro, { + resumeFrom: options?.resumeFrom, + intervalInMs: options?.updateIntervalInMs + }); + } + /** - * @param input Route that needs to be tested - * @param iotHubName IotHub to be tested - * @param resourceGroupName resource group which Iot Hub belongs to - * @param callback The callback + * Delete an IoT hub. + * @param resourceGroupName The name of the resource group that contains the IoT hub. + * @param resourceName The name of the IoT hub. + * @param options The options parameters. */ - testRoute( - input: Models.TestRouteInput, - iotHubName: string, + async beginDeleteAndWait( resourceGroupName: string, - callback: msRest.ServiceCallback - ): void; + resourceName: string, + options?: IotHubResourceDeleteOptionalParams + ): Promise { + const poller = await this.beginDelete( + resourceGroupName, + resourceName, + options + ); + return poller.pollUntilDone(); + } + /** - * @param input Route that needs to be tested - * @param iotHubName IotHub to be tested - * @param resourceGroupName resource group which Iot Hub belongs to - * @param options The optional parameters - * @param callback The callback + * Get all the IoT hubs in a subscription. + * @param options The options parameters. */ - testRoute( - input: Models.TestRouteInput, - iotHubName: string, - resourceGroupName: string, - options: msRest.RequestOptionsBase, - callback: msRest.ServiceCallback - ): void; - testRoute( - input: Models.TestRouteInput, - iotHubName: string, - resourceGroupName: string, - options?: msRest.RequestOptionsBase | msRest.ServiceCallback, - callback?: msRest.ServiceCallback - ): Promise { + private _listBySubscription( + options?: IotHubResourceListBySubscriptionOptionalParams + ): Promise { return this.client.sendOperationRequest( - { - input, - iotHubName, - resourceGroupName, - options - }, - testRouteOperationSpec, - callback - ) as Promise; + { options }, + listBySubscriptionOperationSpec + ); } /** - * Get the security metadata for an IoT hub. For more information, see: - * https://docs.microsoft.com/azure/iot-hub/iot-hub-devguide-security. - * @summary Get the security metadata for an IoT hub. For more information, see: - * https://docs.microsoft.com/azure/iot-hub/iot-hub-devguide-security + * Get all the IoT hubs in a resource group. * @param resourceGroupName The name of the resource group that contains the IoT hub. - * @param resourceName The name of the IoT hub. - * @param [options] The optional parameters - * @returns Promise + * @param options The options parameters. */ - listKeys( + private _listByResourceGroup( resourceGroupName: string, - resourceName: string, - options?: msRest.RequestOptionsBase - ): Promise; + options?: IotHubResourceListByResourceGroupOptionalParams + ): Promise { + return this.client.sendOperationRequest( + { resourceGroupName, options }, + listByResourceGroupOperationSpec + ); + } + /** + * Get the statistics from an IoT hub. * @param resourceGroupName The name of the resource group that contains the IoT hub. * @param resourceName The name of the IoT hub. - * @param callback The callback + * @param options The options parameters. */ - listKeys( + getStats( resourceGroupName: string, resourceName: string, - callback: msRest.ServiceCallback - ): void; + options?: IotHubResourceGetStatsOptionalParams + ): Promise { + return this.client.sendOperationRequest( + { resourceGroupName, resourceName, options }, + getStatsOperationSpec + ); + } + /** + * Get the list of valid SKUs for an IoT hub. * @param resourceGroupName The name of the resource group that contains the IoT hub. * @param resourceName The name of the IoT hub. - * @param options The optional parameters - * @param callback The callback + * @param options The options parameters. */ - listKeys( - resourceGroupName: string, - resourceName: string, - options: msRest.RequestOptionsBase, - callback: msRest.ServiceCallback - ): void; - listKeys( + private _getValidSkus( resourceGroupName: string, resourceName: string, - options?: - | msRest.RequestOptionsBase - | msRest.ServiceCallback, - callback?: msRest.ServiceCallback - ): Promise { + options?: IotHubResourceGetValidSkusOptionalParams + ): Promise { return this.client.sendOperationRequest( - { - resourceGroupName, - resourceName, - options - }, - listKeysOperationSpec, - callback - ) as Promise; + { resourceGroupName, resourceName, options }, + getValidSkusOperationSpec + ); } /** - * Get a shared access policy by name from an IoT hub. For more information, see: - * https://docs.microsoft.com/azure/iot-hub/iot-hub-devguide-security. - * @summary Get a shared access policy by name from an IoT hub. For more information, see: - * https://docs.microsoft.com/azure/iot-hub/iot-hub-devguide-security + * Get a list of the consumer groups in the Event Hub-compatible device-to-cloud endpoint in an IoT + * hub. * @param resourceGroupName The name of the resource group that contains the IoT hub. * @param resourceName The name of the IoT hub. - * @param keyName The name of the shared access policy. - * @param [options] The optional parameters - * @returns Promise + * @param eventHubEndpointName The name of the Event Hub-compatible endpoint. + * @param options The options parameters. */ - getKeysForKeyName( + private _listEventHubConsumerGroups( resourceGroupName: string, resourceName: string, - keyName: string, - options?: msRest.RequestOptionsBase - ): Promise; + eventHubEndpointName: string, + options?: IotHubResourceListEventHubConsumerGroupsOptionalParams + ): Promise { + return this.client.sendOperationRequest( + { resourceGroupName, resourceName, eventHubEndpointName, options }, + listEventHubConsumerGroupsOperationSpec + ); + } + /** + * Get a consumer group from the Event Hub-compatible device-to-cloud endpoint for an IoT hub. * @param resourceGroupName The name of the resource group that contains the IoT hub. * @param resourceName The name of the IoT hub. - * @param keyName The name of the shared access policy. - * @param callback The callback + * @param eventHubEndpointName The name of the Event Hub-compatible endpoint in the IoT hub. + * @param name The name of the consumer group to retrieve. + * @param options The options parameters. */ - getKeysForKeyName( + getEventHubConsumerGroup( resourceGroupName: string, resourceName: string, - keyName: string, - callback: msRest.ServiceCallback - ): void; + eventHubEndpointName: string, + name: string, + options?: IotHubResourceGetEventHubConsumerGroupOptionalParams + ): Promise { + return this.client.sendOperationRequest( + { resourceGroupName, resourceName, eventHubEndpointName, name, options }, + getEventHubConsumerGroupOperationSpec + ); + } + /** + * Add a consumer group to an Event Hub-compatible endpoint in an IoT hub. * @param resourceGroupName The name of the resource group that contains the IoT hub. * @param resourceName The name of the IoT hub. - * @param keyName The name of the shared access policy. - * @param options The optional parameters - * @param callback The callback + * @param eventHubEndpointName The name of the Event Hub-compatible endpoint in the IoT hub. + * @param name The name of the consumer group to add. + * @param consumerGroupBody The consumer group to add. + * @param options The options parameters. */ - getKeysForKeyName( - resourceGroupName: string, - resourceName: string, - keyName: string, - options: msRest.RequestOptionsBase, - callback: msRest.ServiceCallback - ): void; - getKeysForKeyName( + createEventHubConsumerGroup( resourceGroupName: string, resourceName: string, - keyName: string, - options?: - | msRest.RequestOptionsBase - | msRest.ServiceCallback, - callback?: msRest.ServiceCallback - ): Promise { + eventHubEndpointName: string, + name: string, + consumerGroupBody: EventHubConsumerGroupBodyDescription, + options?: IotHubResourceCreateEventHubConsumerGroupOptionalParams + ): Promise { return this.client.sendOperationRequest( { resourceGroupName, resourceName, - keyName, + eventHubEndpointName, + name, + consumerGroupBody, options }, - getKeysForKeyNameOperationSpec, - callback - ) as Promise; + createEventHubConsumerGroupOperationSpec + ); } /** - * Exports all the device identities in the IoT hub identity registry to an Azure Storage blob - * container. For more information, see: - * https://docs.microsoft.com/azure/iot-hub/iot-hub-devguide-identity-registry#import-and-export-device-identities. - * @summary Exports all the device identities in the IoT hub identity registry to an Azure Storage - * blob container. For more information, see: - * https://docs.microsoft.com/azure/iot-hub/iot-hub-devguide-identity-registry#import-and-export-device-identities + * Delete a consumer group from an Event Hub-compatible endpoint in an IoT hub. * @param resourceGroupName The name of the resource group that contains the IoT hub. * @param resourceName The name of the IoT hub. - * @param exportDevicesParameters The parameters that specify the export devices operation. - * @param [options] The optional parameters - * @returns Promise + * @param eventHubEndpointName The name of the Event Hub-compatible endpoint in the IoT hub. + * @param name The name of the consumer group to delete. + * @param options The options parameters. */ - exportDevices( + deleteEventHubConsumerGroup( resourceGroupName: string, resourceName: string, - exportDevicesParameters: Models.ExportDevicesRequest, - options?: msRest.RequestOptionsBase - ): Promise; + eventHubEndpointName: string, + name: string, + options?: IotHubResourceDeleteEventHubConsumerGroupOptionalParams + ): Promise { + return this.client.sendOperationRequest( + { resourceGroupName, resourceName, eventHubEndpointName, name, options }, + deleteEventHubConsumerGroupOperationSpec + ); + } + /** + * Get a list of all the jobs in an IoT hub. For more information, see: + * https://docs.microsoft.com/azure/iot-hub/iot-hub-devguide-identity-registry. * @param resourceGroupName The name of the resource group that contains the IoT hub. * @param resourceName The name of the IoT hub. - * @param exportDevicesParameters The parameters that specify the export devices operation. - * @param callback The callback + * @param options The options parameters. */ - exportDevices( + private _listJobs( resourceGroupName: string, resourceName: string, - exportDevicesParameters: Models.ExportDevicesRequest, - callback: msRest.ServiceCallback - ): void; + options?: IotHubResourceListJobsOptionalParams + ): Promise { + return this.client.sendOperationRequest( + { resourceGroupName, resourceName, options }, + listJobsOperationSpec + ); + } + /** + * Get the details of a job from an IoT hub. For more information, see: + * https://docs.microsoft.com/azure/iot-hub/iot-hub-devguide-identity-registry. * @param resourceGroupName The name of the resource group that contains the IoT hub. * @param resourceName The name of the IoT hub. - * @param exportDevicesParameters The parameters that specify the export devices operation. - * @param options The optional parameters - * @param callback The callback + * @param jobId The job identifier. + * @param options The options parameters. */ - exportDevices( - resourceGroupName: string, - resourceName: string, - exportDevicesParameters: Models.ExportDevicesRequest, - options: msRest.RequestOptionsBase, - callback: msRest.ServiceCallback - ): void; - exportDevices( + getJob( resourceGroupName: string, resourceName: string, - exportDevicesParameters: Models.ExportDevicesRequest, - options?: msRest.RequestOptionsBase | msRest.ServiceCallback, - callback?: msRest.ServiceCallback - ): Promise { + jobId: string, + options?: IotHubResourceGetJobOptionalParams + ): Promise { return this.client.sendOperationRequest( - { - resourceGroupName, - resourceName, - exportDevicesParameters, - options - }, - exportDevicesOperationSpec, - callback - ) as Promise; + { resourceGroupName, resourceName, jobId, options }, + getJobOperationSpec + ); } /** - * Import, update, or delete device identities in the IoT hub identity registry from a blob. For - * more information, see: - * https://docs.microsoft.com/azure/iot-hub/iot-hub-devguide-identity-registry#import-and-export-device-identities. - * @summary Import, update, or delete device identities in the IoT hub identity registry from a - * blob. For more information, see: - * https://docs.microsoft.com/azure/iot-hub/iot-hub-devguide-identity-registry#import-and-export-device-identities + * Get the quota metrics for an IoT hub. * @param resourceGroupName The name of the resource group that contains the IoT hub. * @param resourceName The name of the IoT hub. - * @param importDevicesParameters The parameters that specify the import devices operation. - * @param [options] The optional parameters - * @returns Promise + * @param options The options parameters. */ - importDevices( + private _getQuotaMetrics( resourceGroupName: string, resourceName: string, - importDevicesParameters: Models.ImportDevicesRequest, - options?: msRest.RequestOptionsBase - ): Promise; + options?: IotHubResourceGetQuotaMetricsOptionalParams + ): Promise { + return this.client.sendOperationRequest( + { resourceGroupName, resourceName, options }, + getQuotaMetricsOperationSpec + ); + } + /** - * @param resourceGroupName The name of the resource group that contains the IoT hub. - * @param resourceName The name of the IoT hub. - * @param importDevicesParameters The parameters that specify the import devices operation. - * @param callback The callback + * Get the health for routing endpoints. + * @param resourceGroupName + * @param iotHubName + * @param options The options parameters. */ - importDevices( + private _getEndpointHealth( resourceGroupName: string, - resourceName: string, - importDevicesParameters: Models.ImportDevicesRequest, - callback: msRest.ServiceCallback - ): void; + iotHubName: string, + options?: IotHubResourceGetEndpointHealthOptionalParams + ): Promise { + return this.client.sendOperationRequest( + { resourceGroupName, iotHubName, options }, + getEndpointHealthOperationSpec + ); + } + + /** + * Check if an IoT hub name is available. + * @param operationInputs Set the name parameter in the OperationInputs structure to the name of the + * IoT hub to check. + * @param options The options parameters. + */ + checkNameAvailability( + operationInputs: OperationInputs, + options?: IotHubResourceCheckNameAvailabilityOptionalParams + ): Promise { + return this.client.sendOperationRequest( + { operationInputs, options }, + checkNameAvailabilityOperationSpec + ); + } + + /** + * Test all routes configured in this Iot Hub + * @param iotHubName IotHub to be tested + * @param resourceGroupName resource group which Iot Hub belongs to + * @param input Input for testing all routes + * @param options The options parameters. + */ + testAllRoutes( + iotHubName: string, + resourceGroupName: string, + input: TestAllRoutesInput, + options?: IotHubResourceTestAllRoutesOptionalParams + ): Promise { + return this.client.sendOperationRequest( + { iotHubName, resourceGroupName, input, options }, + testAllRoutesOperationSpec + ); + } + + /** + * Test the new route for this Iot Hub + * @param iotHubName IotHub to be tested + * @param resourceGroupName resource group which Iot Hub belongs to + * @param input Route that needs to be tested + * @param options The options parameters. + */ + testRoute( + iotHubName: string, + resourceGroupName: string, + input: TestRouteInput, + options?: IotHubResourceTestRouteOptionalParams + ): Promise { + return this.client.sendOperationRequest( + { iotHubName, resourceGroupName, input, options }, + testRouteOperationSpec + ); + } + /** + * Get the security metadata for an IoT hub. For more information, see: + * https://docs.microsoft.com/azure/iot-hub/iot-hub-devguide-security. * @param resourceGroupName The name of the resource group that contains the IoT hub. * @param resourceName The name of the IoT hub. - * @param importDevicesParameters The parameters that specify the import devices operation. - * @param options The optional parameters - * @param callback The callback + * @param options The options parameters. */ - importDevices( - resourceGroupName: string, - resourceName: string, - importDevicesParameters: Models.ImportDevicesRequest, - options: msRest.RequestOptionsBase, - callback: msRest.ServiceCallback - ): void; - importDevices( + private _listKeys( resourceGroupName: string, resourceName: string, - importDevicesParameters: Models.ImportDevicesRequest, - options?: msRest.RequestOptionsBase | msRest.ServiceCallback, - callback?: msRest.ServiceCallback - ): Promise { + options?: IotHubResourceListKeysOptionalParams + ): Promise { return this.client.sendOperationRequest( - { - resourceGroupName, - resourceName, - importDevicesParameters, - options - }, - importDevicesOperationSpec, - callback - ) as Promise; + { resourceGroupName, resourceName, options }, + listKeysOperationSpec + ); } /** - * Create or update the metadata of an Iot hub. The usual pattern to modify a property is to - * retrieve the IoT hub metadata and security metadata, and then combine them with the modified - * values in a new body to update the IoT hub. If certain properties are missing in the JSON, - * updating IoT Hub may cause these values to fallback to default, which may lead to unexpected - * behavior. - * @summary Create or update the metadata of an IoT hub. + * Get a shared access policy by name from an IoT hub. For more information, see: + * https://docs.microsoft.com/azure/iot-hub/iot-hub-devguide-security. * @param resourceGroupName The name of the resource group that contains the IoT hub. * @param resourceName The name of the IoT hub. - * @param iotHubDescription The IoT hub metadata and security metadata. - * @param [options] The optional parameters - * @returns Promise + * @param keyName The name of the shared access policy. + * @param options The options parameters. */ - beginCreateOrUpdate( + getKeysForKeyName( resourceGroupName: string, resourceName: string, - iotHubDescription: Models.IotHubDescription, - options?: Models.IotHubResourceBeginCreateOrUpdateOptionalParams - ): Promise { - return this.client.sendLRORequest( - { - resourceGroupName, - resourceName, - iotHubDescription, - options - }, - beginCreateOrUpdateOperationSpec, - options + keyName: string, + options?: IotHubResourceGetKeysForKeyNameOptionalParams + ): Promise { + return this.client.sendOperationRequest( + { resourceGroupName, resourceName, keyName, options }, + getKeysForKeyNameOperationSpec ); } /** - * Update an existing IoT Hub tags. to update other fields use the CreateOrUpdate method - * @summary Update an existing IoT Hubs tags. - * @param resourceGroupName Resource group identifier. - * @param resourceName Name of iot hub to update. - * @param [options] The optional parameters - * @returns Promise + * Exports all the device identities in the IoT hub identity registry to an Azure Storage blob + * container. For more information, see: + * https://docs.microsoft.com/azure/iot-hub/iot-hub-devguide-identity-registry#import-and-export-device-identities. + * @param resourceGroupName The name of the resource group that contains the IoT hub. + * @param resourceName The name of the IoT hub. + * @param exportDevicesParameters The parameters that specify the export devices operation. + * @param options The options parameters. */ - beginUpdate( + exportDevices( resourceGroupName: string, resourceName: string, - options?: Models.IotHubResourceBeginUpdateOptionalParams - ): Promise { - return this.client.sendLRORequest( - { - resourceGroupName, - resourceName, - options - }, - beginUpdateOperationSpec, - options + exportDevicesParameters: ExportDevicesRequest, + options?: IotHubResourceExportDevicesOptionalParams + ): Promise { + return this.client.sendOperationRequest( + { resourceGroupName, resourceName, exportDevicesParameters, options }, + exportDevicesOperationSpec ); } /** - * Delete an IoT hub. - * @summary Delete an IoT hub + * Import, update, or delete device identities in the IoT hub identity registry from a blob. For more + * information, see: + * https://docs.microsoft.com/azure/iot-hub/iot-hub-devguide-identity-registry#import-and-export-device-identities. * @param resourceGroupName The name of the resource group that contains the IoT hub. * @param resourceName The name of the IoT hub. - * @param [options] The optional parameters - * @returns Promise + * @param importDevicesParameters The parameters that specify the import devices operation. + * @param options The options parameters. */ - beginDeleteMethod( + importDevices( resourceGroupName: string, resourceName: string, - options?: msRest.RequestOptionsBase - ): Promise { - return this.client.sendLRORequest( - { - resourceGroupName, - resourceName, - options - }, - beginDeleteMethodOperationSpec, - options + importDevicesParameters: ImportDevicesRequest, + options?: IotHubResourceImportDevicesOptionalParams + ): Promise { + return this.client.sendOperationRequest( + { resourceGroupName, resourceName, importDevicesParameters, options }, + importDevicesOperationSpec ); } /** - * Get all the IoT hubs in a subscription. - * @summary Get all the IoT hubs in a subscription - * @param nextPageLink The NextLink from the previous successful call to List operation. - * @param [options] The optional parameters - * @returns Promise - */ - listBySubscriptionNext( - nextPageLink: string, - options?: msRest.RequestOptionsBase - ): Promise; - /** - * @param nextPageLink The NextLink from the previous successful call to List operation. - * @param callback The callback - */ - listBySubscriptionNext( - 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 + * ListBySubscriptionNext + * @param nextLink The nextLink from the previous successful call to the ListBySubscription method. + * @param options The options parameters. */ - listBySubscriptionNext( - nextPageLink: string, - options: msRest.RequestOptionsBase, - callback: msRest.ServiceCallback - ): void; - listBySubscriptionNext( - nextPageLink: string, - options?: - | msRest.RequestOptionsBase - | msRest.ServiceCallback, - callback?: msRest.ServiceCallback - ): Promise { + private _listBySubscriptionNext( + nextLink: string, + options?: IotHubResourceListBySubscriptionNextOptionalParams + ): Promise { return this.client.sendOperationRequest( - { - nextPageLink, - options - }, - listBySubscriptionNextOperationSpec, - callback - ) as Promise; + { nextLink, options }, + listBySubscriptionNextOperationSpec + ); } /** - * Get all the IoT hubs in a resource group. - * @summary Get all the IoT hubs in a resource group - * @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 The name of the resource group that contains the IoT hub. + * @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?: IotHubResourceListByResourceGroupNextOptionalParams + ): Promise { return this.client.sendOperationRequest( - { - nextPageLink, - options - }, - listByResourceGroupNextOperationSpec, - callback - ) as Promise; + { resourceGroupName, nextLink, options }, + listByResourceGroupNextOperationSpec + ); } /** - * Get the list of valid SKUs for an IoT hub. - * @summary Get the list of valid SKUs for an IoT hub - * @param nextPageLink The NextLink from the previous successful call to List operation. - * @param [options] The optional parameters - * @returns Promise - */ - getValidSkusNext( - nextPageLink: string, - options?: msRest.RequestOptionsBase - ): Promise; - /** - * @param nextPageLink The NextLink from the previous successful call to List operation. - * @param callback The callback - */ - getValidSkusNext( - 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 + * GetValidSkusNext + * @param resourceGroupName The name of the resource group that contains the IoT hub. + * @param resourceName The name of the IoT hub. + * @param nextLink The nextLink from the previous successful call to the GetValidSkus method. + * @param options The options parameters. */ - getValidSkusNext( - nextPageLink: string, - options: msRest.RequestOptionsBase, - callback: msRest.ServiceCallback - ): void; - getValidSkusNext( - nextPageLink: string, - options?: - | msRest.RequestOptionsBase - | msRest.ServiceCallback, - callback?: msRest.ServiceCallback - ): Promise { + private _getValidSkusNext( + resourceGroupName: string, + resourceName: string, + nextLink: string, + options?: IotHubResourceGetValidSkusNextOptionalParams + ): Promise { return this.client.sendOperationRequest( - { - nextPageLink, - options - }, - getValidSkusNextOperationSpec, - callback - ) as Promise; + { resourceGroupName, resourceName, nextLink, options }, + getValidSkusNextOperationSpec + ); } /** - * Get a list of the consumer groups in the Event Hub-compatible device-to-cloud endpoint in an IoT - * hub. - * @summary Get a list of the consumer groups in the Event Hub-compatible device-to-cloud endpoint - * in an IoT hub - * @param nextPageLink The NextLink from the previous successful call to List operation. - * @param [options] The optional parameters - * @returns Promise - */ - listEventHubConsumerGroupsNext( - nextPageLink: string, - options?: msRest.RequestOptionsBase - ): Promise; - /** - * @param nextPageLink The NextLink from the previous successful call to List operation. - * @param callback The callback - */ - listEventHubConsumerGroupsNext( - 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 + * ListEventHubConsumerGroupsNext + * @param resourceGroupName The name of the resource group that contains the IoT hub. + * @param resourceName The name of the IoT hub. + * @param eventHubEndpointName The name of the Event Hub-compatible endpoint. + * @param nextLink The nextLink from the previous successful call to the ListEventHubConsumerGroups + * method. + * @param options The options parameters. */ - listEventHubConsumerGroupsNext( - nextPageLink: string, - options: msRest.RequestOptionsBase, - callback: msRest.ServiceCallback - ): void; - listEventHubConsumerGroupsNext( - nextPageLink: string, - options?: - | msRest.RequestOptionsBase - | msRest.ServiceCallback, - callback?: msRest.ServiceCallback - ): Promise { + private _listEventHubConsumerGroupsNext( + resourceGroupName: string, + resourceName: string, + eventHubEndpointName: string, + nextLink: string, + options?: IotHubResourceListEventHubConsumerGroupsNextOptionalParams + ): Promise { return this.client.sendOperationRequest( { - nextPageLink, + resourceGroupName, + resourceName, + eventHubEndpointName, + nextLink, options }, - listEventHubConsumerGroupsNextOperationSpec, - callback - ) as Promise; + listEventHubConsumerGroupsNextOperationSpec + ); } /** - * Get a list of all the jobs in an IoT hub. For more information, see: - * https://docs.microsoft.com/azure/iot-hub/iot-hub-devguide-identity-registry. - * @summary Get a list of all the jobs in an IoT hub. For more information, see: - * https://docs.microsoft.com/azure/iot-hub/iot-hub-devguide-identity-registry - * @param nextPageLink The NextLink from the previous successful call to List operation. - * @param [options] The optional parameters - * @returns Promise - */ - listJobsNext( - nextPageLink: string, - options?: msRest.RequestOptionsBase - ): Promise; - /** - * @param nextPageLink The NextLink from the previous successful call to List operation. - * @param callback The callback - */ - listJobsNext( - 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 + * ListJobsNext + * @param resourceGroupName The name of the resource group that contains the IoT hub. + * @param resourceName The name of the IoT hub. + * @param nextLink The nextLink from the previous successful call to the ListJobs method. + * @param options The options parameters. */ - listJobsNext( - nextPageLink: string, - options: msRest.RequestOptionsBase, - callback: msRest.ServiceCallback - ): void; - listJobsNext( - nextPageLink: string, - options?: msRest.RequestOptionsBase | msRest.ServiceCallback, - callback?: msRest.ServiceCallback - ): Promise { + private _listJobsNext( + resourceGroupName: string, + resourceName: string, + nextLink: string, + options?: IotHubResourceListJobsNextOptionalParams + ): Promise { return this.client.sendOperationRequest( - { - nextPageLink, - options - }, - listJobsNextOperationSpec, - callback - ) as Promise; + { resourceGroupName, resourceName, nextLink, options }, + listJobsNextOperationSpec + ); } /** - * Get the quota metrics for an IoT hub. - * @summary Get the quota metrics for an IoT hub - * @param nextPageLink The NextLink from the previous successful call to List operation. - * @param [options] The optional parameters - * @returns Promise - */ - getQuotaMetricsNext( - nextPageLink: string, - options?: msRest.RequestOptionsBase - ): Promise; - /** - * @param nextPageLink The NextLink from the previous successful call to List operation. - * @param callback The callback - */ - getQuotaMetricsNext( - 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 + * GetQuotaMetricsNext + * @param resourceGroupName The name of the resource group that contains the IoT hub. + * @param resourceName The name of the IoT hub. + * @param nextLink The nextLink from the previous successful call to the GetQuotaMetrics method. + * @param options The options parameters. */ - getQuotaMetricsNext( - nextPageLink: string, - options: msRest.RequestOptionsBase, - callback: msRest.ServiceCallback - ): void; - getQuotaMetricsNext( - nextPageLink: string, - options?: - | msRest.RequestOptionsBase - | msRest.ServiceCallback, - callback?: msRest.ServiceCallback - ): Promise { + private _getQuotaMetricsNext( + resourceGroupName: string, + resourceName: string, + nextLink: string, + options?: IotHubResourceGetQuotaMetricsNextOptionalParams + ): Promise { return this.client.sendOperationRequest( - { - nextPageLink, - options - }, - getQuotaMetricsNextOperationSpec, - callback - ) as Promise; + { resourceGroupName, resourceName, nextLink, options }, + getQuotaMetricsNextOperationSpec + ); } /** - * Get the health for routing endpoints. - * @summary Get the health for routing endpoints - * @param nextPageLink The NextLink from the previous successful call to List operation. - * @param [options] The optional parameters - * @returns Promise - */ - getEndpointHealthNext( - nextPageLink: string, - options?: msRest.RequestOptionsBase - ): Promise; - /** - * @param nextPageLink The NextLink from the previous successful call to List operation. - * @param callback The callback - */ - getEndpointHealthNext( - 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 + * GetEndpointHealthNext + * @param resourceGroupName + * @param iotHubName + * @param nextLink The nextLink from the previous successful call to the GetEndpointHealth method. + * @param options The options parameters. */ - getEndpointHealthNext( - nextPageLink: string, - options: msRest.RequestOptionsBase, - callback: msRest.ServiceCallback - ): void; - getEndpointHealthNext( - nextPageLink: string, - options?: - | msRest.RequestOptionsBase - | msRest.ServiceCallback, - callback?: msRest.ServiceCallback - ): Promise { + private _getEndpointHealthNext( + resourceGroupName: string, + iotHubName: string, + nextLink: string, + options?: IotHubResourceGetEndpointHealthNextOptionalParams + ): Promise { return this.client.sendOperationRequest( - { - nextPageLink, - options - }, - getEndpointHealthNextOperationSpec, - callback - ) as Promise; + { resourceGroupName, iotHubName, nextLink, options }, + getEndpointHealthNextOperationSpec + ); } /** - * Get the security metadata for an IoT hub. For more information, see: - * https://docs.microsoft.com/azure/iot-hub/iot-hub-devguide-security. - * @summary Get the security metadata for an IoT hub. For more information, see: - * https://docs.microsoft.com/azure/iot-hub/iot-hub-devguide-security - * @param nextPageLink The NextLink from the previous successful call to List operation. - * @param [options] The optional parameters - * @returns Promise - */ - listKeysNext( - nextPageLink: string, - options?: msRest.RequestOptionsBase - ): Promise; - /** - * @param nextPageLink The NextLink from the previous successful call to List operation. - * @param callback The callback - */ - listKeysNext( - 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 + * ListKeysNext + * @param resourceGroupName The name of the resource group that contains the IoT hub. + * @param resourceName The name of the IoT hub. + * @param nextLink The nextLink from the previous successful call to the ListKeys method. + * @param options The options parameters. */ - listKeysNext( - nextPageLink: string, - options: msRest.RequestOptionsBase, - callback: msRest.ServiceCallback - ): void; - listKeysNext( - nextPageLink: string, - options?: - | msRest.RequestOptionsBase - | msRest.ServiceCallback, - callback?: msRest.ServiceCallback - ): Promise { + private _listKeysNext( + resourceGroupName: string, + resourceName: string, + nextLink: string, + options?: IotHubResourceListKeysNextOptionalParams + ): Promise { return this.client.sendOperationRequest( - { - nextPageLink, - options - }, - listKeysNextOperationSpec, - callback - ) as Promise; + { resourceGroupName, resourceName, nextLink, options }, + listKeysNextOperationSpec + ); } } - // Operation Specifications -const serializer = new msRest.Serializer(Mappers); -const getOperationSpec: msRest.OperationSpec = { +const serializer = coreClient.createSerializer(Mappers, /* isXml */ false); + +const getOperationSpec: coreClient.OperationSpec = { + path: + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Devices/IotHubs/{resourceName}", httpMethod: "GET", + responses: { + 200: { + bodyMapper: Mappers.IotHubDescription + }, + default: { + bodyMapper: Mappers.ErrorDetails + } + }, + queryParameters: [Parameters.apiVersion], + urlParameters: [ + Parameters.$host, + Parameters.subscriptionId, + Parameters.resourceGroupName, + Parameters.resourceName + ], + headerParameters: [Parameters.accept], + serializer +}; +const createOrUpdateOperationSpec: coreClient.OperationSpec = { + path: + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Devices/IotHubs/{resourceName}", + httpMethod: "PUT", + responses: { + 200: { + bodyMapper: Mappers.IotHubDescription + }, + 201: { + bodyMapper: Mappers.IotHubDescription + }, + 202: { + bodyMapper: Mappers.IotHubDescription + }, + 204: { + bodyMapper: Mappers.IotHubDescription + }, + default: { + bodyMapper: Mappers.ErrorDetails + } + }, + requestBody: Parameters.iotHubDescription, + queryParameters: [Parameters.apiVersion], + urlParameters: [ + Parameters.$host, + Parameters.subscriptionId, + Parameters.resourceGroupName, + Parameters.resourceName + ], + headerParameters: [ + Parameters.accept, + Parameters.contentType, + Parameters.ifMatch + ], + mediaType: "json", + serializer +}; +const updateOperationSpec: coreClient.OperationSpec = { path: - "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Devices/IotHubs/{resourceName}", - urlParameters: [Parameters.subscriptionId, Parameters.resourceGroupName, Parameters.resourceName], + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Devices/IotHubs/{resourceName}", + httpMethod: "PATCH", + responses: { + 200: { + bodyMapper: Mappers.IotHubDescription + }, + 201: { + bodyMapper: Mappers.IotHubDescription + }, + 202: { + bodyMapper: Mappers.IotHubDescription + }, + 204: { + bodyMapper: Mappers.IotHubDescription + } + }, + requestBody: Parameters.iotHubTags, queryParameters: [Parameters.apiVersion], - headerParameters: [Parameters.acceptLanguage], + urlParameters: [ + Parameters.$host, + Parameters.subscriptionId, + Parameters.resourceGroupName, + Parameters.resourceName + ], + headerParameters: [Parameters.accept, Parameters.contentType], + mediaType: "json", + serializer +}; +const deleteOperationSpec: coreClient.OperationSpec = { + path: + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Devices/IotHubs/{resourceName}", + httpMethod: "DELETE", responses: { 200: { bodyMapper: Mappers.IotHubDescription }, + 201: { + bodyMapper: Mappers.IotHubDescription + }, + 202: { + bodyMapper: Mappers.IotHubDescription + }, + 204: { + bodyMapper: Mappers.IotHubDescription + }, default: { bodyMapper: Mappers.ErrorDetails } }, + queryParameters: [Parameters.apiVersion], + urlParameters: [ + Parameters.$host, + Parameters.subscriptionId, + Parameters.resourceGroupName, + Parameters.resourceName + ], + headerParameters: [Parameters.accept], serializer }; - -const listBySubscriptionOperationSpec: msRest.OperationSpec = { +const listBySubscriptionOperationSpec: coreClient.OperationSpec = { + path: "/subscriptions/{subscriptionId}/providers/Microsoft.Devices/IotHubs", httpMethod: "GET", - path: "subscriptions/{subscriptionId}/providers/Microsoft.Devices/IotHubs", - urlParameters: [Parameters.subscriptionId], - queryParameters: [Parameters.apiVersion], - headerParameters: [Parameters.acceptLanguage], responses: { 200: { bodyMapper: Mappers.IotHubDescriptionListResult @@ -1730,16 +1567,15 @@ const listBySubscriptionOperationSpec: msRest.OperationSpec = { bodyMapper: Mappers.ErrorDetails } }, + queryParameters: [Parameters.apiVersion], + urlParameters: [Parameters.$host, Parameters.subscriptionId], + headerParameters: [Parameters.accept], serializer }; - -const listByResourceGroupOperationSpec: msRest.OperationSpec = { - httpMethod: "GET", +const listByResourceGroupOperationSpec: coreClient.OperationSpec = { path: - "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Devices/IotHubs", - urlParameters: [Parameters.subscriptionId, Parameters.resourceGroupName], - queryParameters: [Parameters.apiVersion], - headerParameters: [Parameters.acceptLanguage], + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Devices/IotHubs", + httpMethod: "GET", responses: { 200: { bodyMapper: Mappers.IotHubDescriptionListResult @@ -1748,16 +1584,19 @@ const listByResourceGroupOperationSpec: msRest.OperationSpec = { bodyMapper: Mappers.ErrorDetails } }, + queryParameters: [Parameters.apiVersion], + urlParameters: [ + Parameters.$host, + Parameters.subscriptionId, + Parameters.resourceGroupName + ], + headerParameters: [Parameters.accept], serializer }; - -const getStatsOperationSpec: msRest.OperationSpec = { - httpMethod: "GET", +const getStatsOperationSpec: coreClient.OperationSpec = { path: - "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Devices/IotHubs/{resourceName}/IotHubStats", - urlParameters: [Parameters.subscriptionId, Parameters.resourceGroupName, Parameters.resourceName], - queryParameters: [Parameters.apiVersion], - headerParameters: [Parameters.acceptLanguage], + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Devices/IotHubs/{resourceName}/IotHubStats", + httpMethod: "GET", responses: { 200: { bodyMapper: Mappers.RegistryStatistics @@ -1766,16 +1605,20 @@ const getStatsOperationSpec: msRest.OperationSpec = { bodyMapper: Mappers.ErrorDetails } }, + queryParameters: [Parameters.apiVersion], + urlParameters: [ + Parameters.$host, + Parameters.subscriptionId, + Parameters.resourceGroupName, + Parameters.resourceName + ], + headerParameters: [Parameters.accept], serializer }; - -const getValidSkusOperationSpec: msRest.OperationSpec = { - httpMethod: "GET", +const getValidSkusOperationSpec: coreClient.OperationSpec = { path: - "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Devices/IotHubs/{resourceName}/skus", - urlParameters: [Parameters.subscriptionId, Parameters.resourceGroupName, Parameters.resourceName], - queryParameters: [Parameters.apiVersion], - headerParameters: [Parameters.acceptLanguage], + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Devices/IotHubs/{resourceName}/skus", + httpMethod: "GET", responses: { 200: { bodyMapper: Mappers.IotHubSkuDescriptionListResult @@ -1784,21 +1627,20 @@ const getValidSkusOperationSpec: msRest.OperationSpec = { bodyMapper: Mappers.ErrorDetails } }, - serializer -}; - -const listEventHubConsumerGroupsOperationSpec: msRest.OperationSpec = { - httpMethod: "GET", - path: - "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Devices/IotHubs/{resourceName}/eventHubEndpoints/{eventHubEndpointName}/ConsumerGroups", + queryParameters: [Parameters.apiVersion], urlParameters: [ + Parameters.$host, Parameters.subscriptionId, Parameters.resourceGroupName, - Parameters.resourceName, - Parameters.eventHubEndpointName + Parameters.resourceName ], - queryParameters: [Parameters.apiVersion], - headerParameters: [Parameters.acceptLanguage], + headerParameters: [Parameters.accept], + serializer +}; +const listEventHubConsumerGroupsOperationSpec: coreClient.OperationSpec = { + path: + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Devices/IotHubs/{resourceName}/eventHubEndpoints/{eventHubEndpointName}/ConsumerGroups", + httpMethod: "GET", responses: { 200: { bodyMapper: Mappers.EventHubConsumerGroupsListResult @@ -1807,22 +1649,21 @@ const listEventHubConsumerGroupsOperationSpec: msRest.OperationSpec = { bodyMapper: Mappers.ErrorDetails } }, - serializer -}; - -const getEventHubConsumerGroupOperationSpec: msRest.OperationSpec = { - httpMethod: "GET", - path: - "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Devices/IotHubs/{resourceName}/eventHubEndpoints/{eventHubEndpointName}/ConsumerGroups/{name}", + queryParameters: [Parameters.apiVersion], urlParameters: [ + Parameters.$host, Parameters.subscriptionId, Parameters.resourceGroupName, Parameters.resourceName, - Parameters.eventHubEndpointName, - Parameters.name + Parameters.eventHubEndpointName ], - queryParameters: [Parameters.apiVersion], - headerParameters: [Parameters.acceptLanguage], + headerParameters: [Parameters.accept], + serializer +}; +const getEventHubConsumerGroupOperationSpec: coreClient.OperationSpec = { + path: + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Devices/IotHubs/{resourceName}/eventHubEndpoints/{eventHubEndpointName}/ConsumerGroups/{name}", + httpMethod: "GET", responses: { 200: { bodyMapper: Mappers.EventHubConsumerGroupInfo @@ -1831,71 +1672,70 @@ const getEventHubConsumerGroupOperationSpec: msRest.OperationSpec = { bodyMapper: Mappers.ErrorDetails } }, - serializer -}; - -const createEventHubConsumerGroupOperationSpec: msRest.OperationSpec = { - httpMethod: "PUT", - path: - "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Devices/IotHubs/{resourceName}/eventHubEndpoints/{eventHubEndpointName}/ConsumerGroups/{name}", + queryParameters: [Parameters.apiVersion], urlParameters: [ + Parameters.$host, Parameters.subscriptionId, Parameters.resourceGroupName, Parameters.resourceName, Parameters.eventHubEndpointName, Parameters.name ], - queryParameters: [Parameters.apiVersion], - headerParameters: [Parameters.acceptLanguage], - requestBody: { - parameterPath: { - properties: "properties" - }, - mapper: { - ...Mappers.EventHubConsumerGroupBodyDescription, - required: true - } - }, + headerParameters: [Parameters.accept], + serializer +}; +const createEventHubConsumerGroupOperationSpec: coreClient.OperationSpec = { + path: + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Devices/IotHubs/{resourceName}/eventHubEndpoints/{eventHubEndpointName}/ConsumerGroups/{name}", + httpMethod: "PUT", responses: { 200: { bodyMapper: Mappers.EventHubConsumerGroupInfo }, - default: { - bodyMapper: Mappers.ErrorDetails - } - }, - serializer -}; - -const deleteEventHubConsumerGroupOperationSpec: msRest.OperationSpec = { - httpMethod: "DELETE", - path: - "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Devices/IotHubs/{resourceName}/eventHubEndpoints/{eventHubEndpointName}/ConsumerGroups/{name}", + default: { + bodyMapper: Mappers.ErrorDetails + } + }, + requestBody: Parameters.consumerGroupBody, + queryParameters: [Parameters.apiVersion], urlParameters: [ + Parameters.$host, Parameters.subscriptionId, Parameters.resourceGroupName, Parameters.resourceName, Parameters.eventHubEndpointName, Parameters.name ], - queryParameters: [Parameters.apiVersion], - headerParameters: [Parameters.acceptLanguage], + headerParameters: [Parameters.accept, Parameters.contentType], + mediaType: "json", + serializer +}; +const deleteEventHubConsumerGroupOperationSpec: coreClient.OperationSpec = { + path: + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Devices/IotHubs/{resourceName}/eventHubEndpoints/{eventHubEndpointName}/ConsumerGroups/{name}", + httpMethod: "DELETE", responses: { 200: {}, default: { bodyMapper: Mappers.ErrorDetails } }, + queryParameters: [Parameters.apiVersion], + urlParameters: [ + Parameters.$host, + Parameters.subscriptionId, + Parameters.resourceGroupName, + Parameters.resourceName, + Parameters.eventHubEndpointName, + Parameters.name + ], + headerParameters: [Parameters.accept], serializer }; - -const listJobsOperationSpec: msRest.OperationSpec = { - httpMethod: "GET", +const listJobsOperationSpec: coreClient.OperationSpec = { path: - "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Devices/IotHubs/{resourceName}/jobs", - urlParameters: [Parameters.subscriptionId, Parameters.resourceGroupName, Parameters.resourceName], - queryParameters: [Parameters.apiVersion], - headerParameters: [Parameters.acceptLanguage], + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Devices/IotHubs/{resourceName}/jobs", + httpMethod: "GET", responses: { 200: { bodyMapper: Mappers.JobResponseListResult @@ -1904,21 +1744,20 @@ const listJobsOperationSpec: msRest.OperationSpec = { bodyMapper: Mappers.ErrorDetails } }, - serializer -}; - -const getJobOperationSpec: msRest.OperationSpec = { - httpMethod: "GET", - path: - "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Devices/IotHubs/{resourceName}/jobs/{jobId}", + queryParameters: [Parameters.apiVersion], urlParameters: [ + Parameters.$host, Parameters.subscriptionId, Parameters.resourceGroupName, - Parameters.resourceName, - Parameters.jobId + Parameters.resourceName ], - queryParameters: [Parameters.apiVersion], - headerParameters: [Parameters.acceptLanguage], + headerParameters: [Parameters.accept], + serializer +}; +const getJobOperationSpec: coreClient.OperationSpec = { + path: + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Devices/IotHubs/{resourceName}/jobs/{jobId}", + httpMethod: "GET", responses: { 200: { bodyMapper: Mappers.JobResponse @@ -1927,16 +1766,21 @@ const getJobOperationSpec: msRest.OperationSpec = { bodyMapper: Mappers.ErrorDetails } }, + queryParameters: [Parameters.apiVersion], + urlParameters: [ + Parameters.$host, + Parameters.subscriptionId, + Parameters.resourceGroupName, + Parameters.resourceName, + Parameters.jobId + ], + headerParameters: [Parameters.accept], serializer }; - -const getQuotaMetricsOperationSpec: msRest.OperationSpec = { - httpMethod: "GET", +const getQuotaMetricsOperationSpec: coreClient.OperationSpec = { path: - "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Devices/IotHubs/{resourceName}/quotaMetrics", - urlParameters: [Parameters.subscriptionId, Parameters.resourceGroupName, Parameters.resourceName], - queryParameters: [Parameters.apiVersion], - headerParameters: [Parameters.acceptLanguage], + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Devices/IotHubs/{resourceName}/quotaMetrics", + httpMethod: "GET", responses: { 200: { bodyMapper: Mappers.IotHubQuotaMetricInfoListResult @@ -1945,16 +1789,20 @@ const getQuotaMetricsOperationSpec: msRest.OperationSpec = { bodyMapper: Mappers.ErrorDetails } }, + queryParameters: [Parameters.apiVersion], + urlParameters: [ + Parameters.$host, + Parameters.subscriptionId, + Parameters.resourceGroupName, + Parameters.resourceName + ], + headerParameters: [Parameters.accept], serializer }; - -const getEndpointHealthOperationSpec: msRest.OperationSpec = { - httpMethod: "GET", +const getEndpointHealthOperationSpec: coreClient.OperationSpec = { path: - "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Devices/IotHubs/{iotHubName}/routingEndpointsHealth", - urlParameters: [Parameters.subscriptionId, Parameters.resourceGroupName, Parameters.iotHubName], - queryParameters: [Parameters.apiVersion], - headerParameters: [Parameters.acceptLanguage], + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Devices/IotHubs/{iotHubName}/routingEndpointsHealth", + httpMethod: "GET", responses: { 200: { bodyMapper: Mappers.EndpointHealthDataListResult @@ -1963,24 +1811,20 @@ const getEndpointHealthOperationSpec: msRest.OperationSpec = { bodyMapper: Mappers.ErrorDetails } }, + queryParameters: [Parameters.apiVersion], + urlParameters: [ + Parameters.$host, + Parameters.subscriptionId, + Parameters.resourceGroupName, + Parameters.iotHubName + ], + headerParameters: [Parameters.accept], serializer }; - -const checkNameAvailabilityOperationSpec: msRest.OperationSpec = { +const checkNameAvailabilityOperationSpec: coreClient.OperationSpec = { + path: + "/subscriptions/{subscriptionId}/providers/Microsoft.Devices/checkNameAvailability", httpMethod: "POST", - path: "subscriptions/{subscriptionId}/providers/Microsoft.Devices/checkNameAvailability", - urlParameters: [Parameters.subscriptionId], - queryParameters: [Parameters.apiVersion], - headerParameters: [Parameters.acceptLanguage], - requestBody: { - parameterPath: { - name: "name" - }, - mapper: { - ...Mappers.OperationInputs, - required: true - } - }, responses: { 200: { bodyMapper: Mappers.IotHubNameAvailabilityInfo @@ -1989,23 +1833,17 @@ const checkNameAvailabilityOperationSpec: msRest.OperationSpec = { bodyMapper: Mappers.ErrorDetails } }, + requestBody: Parameters.operationInputs, + queryParameters: [Parameters.apiVersion], + urlParameters: [Parameters.$host, Parameters.subscriptionId], + headerParameters: [Parameters.accept, Parameters.contentType], + mediaType: "json", serializer }; - -const testAllRoutesOperationSpec: msRest.OperationSpec = { - httpMethod: "POST", +const testAllRoutesOperationSpec: coreClient.OperationSpec = { path: - "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Devices/IotHubs/{iotHubName}/routing/routes/$testall", - urlParameters: [Parameters.iotHubName, Parameters.subscriptionId, Parameters.resourceGroupName], - queryParameters: [Parameters.apiVersion], - headerParameters: [Parameters.acceptLanguage], - requestBody: { - parameterPath: "input", - mapper: { - ...Mappers.TestAllRoutesInput, - required: true - } - }, + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Devices/IotHubs/{iotHubName}/routing/routes/$testall", + httpMethod: "POST", responses: { 200: { bodyMapper: Mappers.TestAllRoutesResult @@ -2014,23 +1852,22 @@ const testAllRoutesOperationSpec: msRest.OperationSpec = { bodyMapper: Mappers.ErrorDetails } }, + requestBody: Parameters.input, + queryParameters: [Parameters.apiVersion], + urlParameters: [ + Parameters.$host, + Parameters.subscriptionId, + Parameters.resourceGroupName, + Parameters.iotHubName + ], + headerParameters: [Parameters.accept, Parameters.contentType], + mediaType: "json", serializer }; - -const testRouteOperationSpec: msRest.OperationSpec = { - httpMethod: "POST", +const testRouteOperationSpec: coreClient.OperationSpec = { path: - "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Devices/IotHubs/{iotHubName}/routing/routes/$testnew", - urlParameters: [Parameters.iotHubName, Parameters.subscriptionId, Parameters.resourceGroupName], - queryParameters: [Parameters.apiVersion], - headerParameters: [Parameters.acceptLanguage], - requestBody: { - parameterPath: "input", - mapper: { - ...Mappers.TestRouteInput, - required: true - } - }, + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Devices/IotHubs/{iotHubName}/routing/routes/$testnew", + httpMethod: "POST", responses: { 200: { bodyMapper: Mappers.TestRouteResult @@ -2039,16 +1876,22 @@ const testRouteOperationSpec: msRest.OperationSpec = { bodyMapper: Mappers.ErrorDetails } }, + requestBody: Parameters.input1, + queryParameters: [Parameters.apiVersion], + urlParameters: [ + Parameters.$host, + Parameters.subscriptionId, + Parameters.resourceGroupName, + Parameters.iotHubName + ], + headerParameters: [Parameters.accept, Parameters.contentType], + mediaType: "json", serializer }; - -const listKeysOperationSpec: msRest.OperationSpec = { - httpMethod: "POST", +const listKeysOperationSpec: coreClient.OperationSpec = { path: - "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Devices/IotHubs/{resourceName}/listkeys", - urlParameters: [Parameters.subscriptionId, Parameters.resourceGroupName, Parameters.resourceName], - queryParameters: [Parameters.apiVersion], - headerParameters: [Parameters.acceptLanguage], + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Devices/IotHubs/{resourceName}/listkeys", + httpMethod: "POST", responses: { 200: { bodyMapper: Mappers.SharedAccessSignatureAuthorizationRuleListResult @@ -2057,169 +1900,90 @@ const listKeysOperationSpec: msRest.OperationSpec = { bodyMapper: Mappers.ErrorDetails } }, - serializer -}; - -const getKeysForKeyNameOperationSpec: msRest.OperationSpec = { - httpMethod: "POST", - path: - "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Devices/IotHubs/{resourceName}/IotHubKeys/{keyName}/listkeys", + queryParameters: [Parameters.apiVersion], urlParameters: [ + Parameters.$host, Parameters.subscriptionId, Parameters.resourceGroupName, - Parameters.resourceName, - Parameters.keyName + Parameters.resourceName ], - queryParameters: [Parameters.apiVersion], - headerParameters: [Parameters.acceptLanguage], - responses: { - 200: { - bodyMapper: Mappers.SharedAccessSignatureAuthorizationRule - }, - default: { - bodyMapper: Mappers.ErrorDetails - } - }, + headerParameters: [Parameters.accept], serializer }; - -const exportDevicesOperationSpec: msRest.OperationSpec = { - httpMethod: "POST", +const getKeysForKeyNameOperationSpec: coreClient.OperationSpec = { path: - "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Devices/IotHubs/{resourceName}/exportDevices", - urlParameters: [Parameters.subscriptionId, Parameters.resourceGroupName, Parameters.resourceName], - queryParameters: [Parameters.apiVersion], - headerParameters: [Parameters.acceptLanguage], - requestBody: { - parameterPath: "exportDevicesParameters", - mapper: { - ...Mappers.ExportDevicesRequest, - required: true - } - }, - responses: { - 200: { - bodyMapper: Mappers.JobResponse - }, - default: { - bodyMapper: Mappers.ErrorDetails - } - }, - serializer -}; - -const importDevicesOperationSpec: msRest.OperationSpec = { + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Devices/IotHubs/{resourceName}/IotHubKeys/{keyName}/listkeys", httpMethod: "POST", - path: - "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Devices/IotHubs/{resourceName}/importDevices", - urlParameters: [Parameters.subscriptionId, Parameters.resourceGroupName, Parameters.resourceName], - queryParameters: [Parameters.apiVersion], - headerParameters: [Parameters.acceptLanguage], - requestBody: { - parameterPath: "importDevicesParameters", - mapper: { - ...Mappers.ImportDevicesRequest, - required: true - } - }, responses: { 200: { - bodyMapper: Mappers.JobResponse + bodyMapper: Mappers.SharedAccessSignatureAuthorizationRule }, default: { bodyMapper: Mappers.ErrorDetails } }, + queryParameters: [Parameters.apiVersion], + urlParameters: [ + Parameters.$host, + Parameters.subscriptionId, + Parameters.resourceGroupName, + Parameters.resourceName, + Parameters.keyName + ], + headerParameters: [Parameters.accept], serializer }; - -const beginCreateOrUpdateOperationSpec: msRest.OperationSpec = { - httpMethod: "PUT", +const exportDevicesOperationSpec: coreClient.OperationSpec = { path: - "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Devices/IotHubs/{resourceName}", - urlParameters: [Parameters.subscriptionId, Parameters.resourceGroupName, Parameters.resourceName], - queryParameters: [Parameters.apiVersion], - headerParameters: [Parameters.ifMatch0, Parameters.acceptLanguage], - requestBody: { - parameterPath: "iotHubDescription", - mapper: { - ...Mappers.IotHubDescription, - required: true - } - }, + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Devices/IotHubs/{resourceName}/exportDevices", + httpMethod: "POST", responses: { 200: { - bodyMapper: Mappers.IotHubDescription - }, - 201: { - bodyMapper: Mappers.IotHubDescription + bodyMapper: Mappers.JobResponse }, default: { bodyMapper: Mappers.ErrorDetails } }, - serializer -}; - -const beginUpdateOperationSpec: msRest.OperationSpec = { - httpMethod: "PATCH", - path: - "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Devices/IotHubs/{resourceName}", - urlParameters: [Parameters.subscriptionId, Parameters.resourceGroupName, Parameters.resourceName], + requestBody: Parameters.exportDevicesParameters, queryParameters: [Parameters.apiVersion], - headerParameters: [Parameters.acceptLanguage], - requestBody: { - parameterPath: { - tags: ["options", "tags"] - }, - mapper: { - ...Mappers.TagsResource, - required: true - } - }, - responses: { - 200: { - bodyMapper: Mappers.IotHubDescription - }, - default: { - bodyMapper: Mappers.CloudError - } - }, + urlParameters: [ + Parameters.$host, + Parameters.subscriptionId, + Parameters.resourceGroupName, + Parameters.resourceName + ], + headerParameters: [Parameters.accept, Parameters.contentType], + mediaType: "json", serializer }; - -const beginDeleteMethodOperationSpec: msRest.OperationSpec = { - httpMethod: "DELETE", +const importDevicesOperationSpec: coreClient.OperationSpec = { path: - "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Devices/IotHubs/{resourceName}", - urlParameters: [Parameters.subscriptionId, Parameters.resourceGroupName, Parameters.resourceName], - queryParameters: [Parameters.apiVersion], - headerParameters: [Parameters.acceptLanguage], + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Devices/IotHubs/{resourceName}/importDevices", + httpMethod: "POST", responses: { 200: { - bodyMapper: Mappers.IotHubDescription - }, - 202: { - bodyMapper: Mappers.IotHubDescription - }, - 204: {}, - 404: { - bodyMapper: Mappers.ErrorDetails + bodyMapper: Mappers.JobResponse }, default: { bodyMapper: Mappers.ErrorDetails } }, + requestBody: Parameters.importDevicesParameters, + queryParameters: [Parameters.apiVersion], + urlParameters: [ + Parameters.$host, + Parameters.subscriptionId, + Parameters.resourceGroupName, + Parameters.resourceName + ], + headerParameters: [Parameters.accept, Parameters.contentType], + mediaType: "json", serializer }; - -const listBySubscriptionNextOperationSpec: msRest.OperationSpec = { - httpMethod: "GET", - baseUrl: "https://management.azure.com", +const listBySubscriptionNextOperationSpec: coreClient.OperationSpec = { path: "{nextLink}", - urlParameters: [Parameters.nextPageLink], - queryParameters: [Parameters.apiVersion], - headerParameters: [Parameters.acceptLanguage], + httpMethod: "GET", responses: { 200: { bodyMapper: Mappers.IotHubDescriptionListResult @@ -2228,16 +1992,18 @@ const listBySubscriptionNextOperationSpec: msRest.OperationSpec = { bodyMapper: Mappers.ErrorDetails } }, + 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], - queryParameters: [Parameters.apiVersion], - headerParameters: [Parameters.acceptLanguage], + httpMethod: "GET", responses: { 200: { bodyMapper: Mappers.IotHubDescriptionListResult @@ -2246,16 +2012,19 @@ const listByResourceGroupNextOperationSpec: msRest.OperationSpec = { bodyMapper: Mappers.ErrorDetails } }, + queryParameters: [Parameters.apiVersion], + urlParameters: [ + Parameters.$host, + Parameters.nextLink, + Parameters.subscriptionId, + Parameters.resourceGroupName + ], + headerParameters: [Parameters.accept], serializer }; - -const getValidSkusNextOperationSpec: msRest.OperationSpec = { - httpMethod: "GET", - baseUrl: "https://management.azure.com", +const getValidSkusNextOperationSpec: coreClient.OperationSpec = { path: "{nextLink}", - urlParameters: [Parameters.nextPageLink], - queryParameters: [Parameters.apiVersion], - headerParameters: [Parameters.acceptLanguage], + httpMethod: "GET", responses: { 200: { bodyMapper: Mappers.IotHubSkuDescriptionListResult @@ -2264,16 +2033,20 @@ const getValidSkusNextOperationSpec: msRest.OperationSpec = { bodyMapper: Mappers.ErrorDetails } }, + queryParameters: [Parameters.apiVersion], + urlParameters: [ + Parameters.$host, + Parameters.nextLink, + Parameters.subscriptionId, + Parameters.resourceGroupName, + Parameters.resourceName + ], + headerParameters: [Parameters.accept], serializer }; - -const listEventHubConsumerGroupsNextOperationSpec: msRest.OperationSpec = { - httpMethod: "GET", - baseUrl: "https://management.azure.com", +const listEventHubConsumerGroupsNextOperationSpec: coreClient.OperationSpec = { path: "{nextLink}", - urlParameters: [Parameters.nextPageLink], - queryParameters: [Parameters.apiVersion], - headerParameters: [Parameters.acceptLanguage], + httpMethod: "GET", responses: { 200: { bodyMapper: Mappers.EventHubConsumerGroupsListResult @@ -2282,16 +2055,21 @@ const listEventHubConsumerGroupsNextOperationSpec: msRest.OperationSpec = { bodyMapper: Mappers.ErrorDetails } }, + queryParameters: [Parameters.apiVersion], + urlParameters: [ + Parameters.$host, + Parameters.nextLink, + Parameters.subscriptionId, + Parameters.resourceGroupName, + Parameters.resourceName, + Parameters.eventHubEndpointName + ], + headerParameters: [Parameters.accept], serializer }; - -const listJobsNextOperationSpec: msRest.OperationSpec = { - httpMethod: "GET", - baseUrl: "https://management.azure.com", +const listJobsNextOperationSpec: coreClient.OperationSpec = { path: "{nextLink}", - urlParameters: [Parameters.nextPageLink], - queryParameters: [Parameters.apiVersion], - headerParameters: [Parameters.acceptLanguage], + httpMethod: "GET", responses: { 200: { bodyMapper: Mappers.JobResponseListResult @@ -2300,16 +2078,20 @@ const listJobsNextOperationSpec: msRest.OperationSpec = { bodyMapper: Mappers.ErrorDetails } }, + queryParameters: [Parameters.apiVersion], + urlParameters: [ + Parameters.$host, + Parameters.nextLink, + Parameters.subscriptionId, + Parameters.resourceGroupName, + Parameters.resourceName + ], + headerParameters: [Parameters.accept], serializer }; - -const getQuotaMetricsNextOperationSpec: msRest.OperationSpec = { - httpMethod: "GET", - baseUrl: "https://management.azure.com", +const getQuotaMetricsNextOperationSpec: coreClient.OperationSpec = { path: "{nextLink}", - urlParameters: [Parameters.nextPageLink], - queryParameters: [Parameters.apiVersion], - headerParameters: [Parameters.acceptLanguage], + httpMethod: "GET", responses: { 200: { bodyMapper: Mappers.IotHubQuotaMetricInfoListResult @@ -2318,16 +2100,20 @@ const getQuotaMetricsNextOperationSpec: msRest.OperationSpec = { bodyMapper: Mappers.ErrorDetails } }, + queryParameters: [Parameters.apiVersion], + urlParameters: [ + Parameters.$host, + Parameters.nextLink, + Parameters.subscriptionId, + Parameters.resourceGroupName, + Parameters.resourceName + ], + headerParameters: [Parameters.accept], serializer }; - -const getEndpointHealthNextOperationSpec: msRest.OperationSpec = { - httpMethod: "GET", - baseUrl: "https://management.azure.com", +const getEndpointHealthNextOperationSpec: coreClient.OperationSpec = { path: "{nextLink}", - urlParameters: [Parameters.nextPageLink], - queryParameters: [Parameters.apiVersion], - headerParameters: [Parameters.acceptLanguage], + httpMethod: "GET", responses: { 200: { bodyMapper: Mappers.EndpointHealthDataListResult @@ -2336,16 +2122,20 @@ const getEndpointHealthNextOperationSpec: msRest.OperationSpec = { bodyMapper: Mappers.ErrorDetails } }, + queryParameters: [Parameters.apiVersion], + urlParameters: [ + Parameters.$host, + Parameters.nextLink, + Parameters.subscriptionId, + Parameters.resourceGroupName, + Parameters.iotHubName + ], + headerParameters: [Parameters.accept], serializer }; - -const listKeysNextOperationSpec: msRest.OperationSpec = { - httpMethod: "POST", - baseUrl: "https://management.azure.com", +const listKeysNextOperationSpec: coreClient.OperationSpec = { path: "{nextLink}", - urlParameters: [Parameters.nextPageLink], - queryParameters: [Parameters.apiVersion], - headerParameters: [Parameters.acceptLanguage], + httpMethod: "GET", responses: { 200: { bodyMapper: Mappers.SharedAccessSignatureAuthorizationRuleListResult @@ -2354,5 +2144,14 @@ const listKeysNextOperationSpec: msRest.OperationSpec = { bodyMapper: Mappers.ErrorDetails } }, + queryParameters: [Parameters.apiVersion], + urlParameters: [ + Parameters.$host, + Parameters.nextLink, + Parameters.subscriptionId, + Parameters.resourceGroupName, + Parameters.resourceName + ], + headerParameters: [Parameters.accept], serializer }; diff --git a/sdk/iothub/arm-iothub/src/operations/operations.ts b/sdk/iothub/arm-iothub/src/operations/operations.ts index 7c0b4e591e08..51dd537f61ec 100644 --- a/sdk/iothub/arm-iothub/src/operations/operations.ts +++ b/sdk/iothub/arm-iothub/src/operations/operations.ts @@ -3,110 +3,109 @@ * 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 { IotHubClientContext } from "../iotHubClientContext"; +import { IotHubClient } from "../iotHubClient"; +import { + Operation, + OperationsListNextOptionalParams, + OperationsListOptionalParams, + OperationsListResponse, + OperationsListNextResponse +} from "../models"; -/** Class representing a Operations. */ -export class Operations { - private readonly client: IotHubClientContext; +/// +/** Class containing Operations operations. */ +export class OperationsImpl implements Operations { + private readonly client: IotHubClient; /** - * Create a Operations. - * @param {IotHubClientContext} client Reference to the service client. + * Initialize a new instance of the class Operations class. + * @param client Reference to the service client */ - constructor(client: IotHubClientContext) { + constructor(client: IotHubClient) { this.client = client; } /** * Lists all of the available IoT Hub 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 of the available IoT Hub 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.Devices/operations", httpMethod: "GET", - path: "providers/Microsoft.Devices/operations", - queryParameters: [Parameters.apiVersion], - headerParameters: [Parameters.acceptLanguage], responses: { 200: { bodyMapper: Mappers.OperationListResult @@ -115,16 +114,14 @@ const listOperationSpec: msRest.OperationSpec = { bodyMapper: Mappers.ErrorDetails } }, + 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], - queryParameters: [Parameters.apiVersion], - headerParameters: [Parameters.acceptLanguage], + httpMethod: "GET", responses: { 200: { bodyMapper: Mappers.OperationListResult @@ -133,5 +130,8 @@ const listNextOperationSpec: msRest.OperationSpec = { bodyMapper: Mappers.ErrorDetails } }, + queryParameters: [Parameters.apiVersion], + urlParameters: [Parameters.$host, Parameters.nextLink], + headerParameters: [Parameters.accept], serializer }; diff --git a/sdk/iothub/arm-iothub/src/operations/privateEndpointConnections.ts b/sdk/iothub/arm-iothub/src/operations/privateEndpointConnections.ts index cf32dedde72e..3bc39fff3438 100644 --- a/sdk/iothub/arm-iothub/src/operations/privateEndpointConnections.ts +++ b/sdk/iothub/arm-iothub/src/operations/privateEndpointConnections.ts @@ -3,131 +3,71 @@ * 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/privateEndpointConnectionsMappers"; +import { PrivateEndpointConnections } from "../operationsInterfaces"; +import * as coreClient from "@azure/core-client"; +import * as Mappers from "../models/mappers"; import * as Parameters from "../models/parameters"; -import { IotHubClientContext } from "../iotHubClientContext"; +import { IotHubClient } from "../iotHubClient"; +import { PollerLike, PollOperationState, LroEngine } from "@azure/core-lro"; +import { LroImpl } from "../lroImpl"; +import { + PrivateEndpointConnectionsListOptionalParams, + PrivateEndpointConnectionsListResponse, + PrivateEndpointConnectionsGetOptionalParams, + PrivateEndpointConnectionsGetResponse, + PrivateEndpointConnection, + PrivateEndpointConnectionsUpdateOptionalParams, + PrivateEndpointConnectionsUpdateResponse, + PrivateEndpointConnectionsDeleteOptionalParams, + PrivateEndpointConnectionsDeleteResponse +} from "../models"; -/** Class representing a PrivateEndpointConnections. */ -export class PrivateEndpointConnections { - private readonly client: IotHubClientContext; +/** Class containing PrivateEndpointConnections operations. */ +export class PrivateEndpointConnectionsImpl + implements PrivateEndpointConnections { + private readonly client: IotHubClient; /** - * Create a PrivateEndpointConnections. - * @param {IotHubClientContext} client Reference to the service client. + * Initialize a new instance of the class PrivateEndpointConnections class. + * @param client Reference to the service client */ - constructor(client: IotHubClientContext) { + constructor(client: IotHubClient) { this.client = client; } /** * List private endpoint connection properties - * @summary List private endpoint connections * @param resourceGroupName The name of the resource group that contains the IoT hub. * @param resourceName The name of the IoT hub. - * @param [options] The optional parameters - * @returns Promise + * @param options The options parameters. */ list( resourceGroupName: string, resourceName: string, - options?: msRest.RequestOptionsBase - ): Promise; - /** - * @param resourceGroupName The name of the resource group that contains the IoT hub. - * @param resourceName The name of the IoT hub. - * @param callback The callback - */ - list( - resourceGroupName: string, - resourceName: string, - callback: msRest.ServiceCallback - ): void; - /** - * @param resourceGroupName The name of the resource group that contains the IoT hub. - * @param resourceName The name of the IoT hub. - * @param options The optional parameters - * @param callback The callback - */ - list( - resourceGroupName: string, - resourceName: string, - options: msRest.RequestOptionsBase, - callback: msRest.ServiceCallback - ): void; - list( - resourceGroupName: string, - resourceName: string, - options?: - | msRest.RequestOptionsBase - | msRest.ServiceCallback, - callback?: msRest.ServiceCallback - ): Promise { + options?: PrivateEndpointConnectionsListOptionalParams + ): Promise { return this.client.sendOperationRequest( - { - resourceGroupName, - resourceName, - options - }, - listOperationSpec, - callback - ) as Promise; + { resourceGroupName, resourceName, options }, + listOperationSpec + ); } /** * Get private endpoint connection properties - * @summary Get private endpoint connection * @param resourceGroupName The name of the resource group that contains the IoT hub. * @param resourceName The name of the IoT hub. * @param privateEndpointConnectionName The name of the private endpoint connection - * @param [options] The optional parameters - * @returns Promise + * @param options The options parameters. */ get( resourceGroupName: string, resourceName: string, privateEndpointConnectionName: string, - options?: msRest.RequestOptionsBase - ): Promise; - /** - * @param resourceGroupName The name of the resource group that contains the IoT hub. - * @param resourceName The name of the IoT hub. - * @param privateEndpointConnectionName The name of the private endpoint connection - * @param callback The callback - */ - get( - resourceGroupName: string, - resourceName: string, - privateEndpointConnectionName: string, - callback: msRest.ServiceCallback - ): void; - /** - * @param resourceGroupName The name of the resource group that contains the IoT hub. - * @param resourceName The name of the IoT hub. - * @param privateEndpointConnectionName The name of the private endpoint connection - * @param options The optional parameters - * @param callback The callback - */ - get( - resourceGroupName: string, - resourceName: string, - privateEndpointConnectionName: string, - options: msRest.RequestOptionsBase, - callback: msRest.ServiceCallback - ): void; - get( - resourceGroupName: string, - resourceName: string, - privateEndpointConnectionName: string, - options?: msRest.RequestOptionsBase | msRest.ServiceCallback, - callback?: msRest.ServiceCallback - ): Promise { + options?: PrivateEndpointConnectionsGetOptionalParams + ): Promise { return this.client.sendOperationRequest( { resourceGroupName, @@ -135,142 +75,220 @@ export class PrivateEndpointConnections { privateEndpointConnectionName, options }, - getOperationSpec, - callback - ) as Promise; + getOperationSpec + ); } /** * Update the status of a private endpoint connection with the specified name - * @summary Update private endpoint connection * @param resourceGroupName The name of the resource group that contains the IoT hub. * @param resourceName The name of the IoT hub. * @param privateEndpointConnectionName The name of the private endpoint connection - * @param properties - * @param [options] The optional parameters - * @returns Promise + * @param privateEndpointConnection The private endpoint connection with updated properties + * @param options The options parameters. */ - update( + async beginUpdate( resourceGroupName: string, resourceName: string, privateEndpointConnectionName: string, - properties: Models.PrivateEndpointConnectionProperties, - options?: msRest.RequestOptionsBase - ): Promise { - return this.beginUpdate( - resourceGroupName, - resourceName, - privateEndpointConnectionName, - properties, - options - ).then((lroPoller) => lroPoller.pollUntilFinished()) as Promise< - Models.PrivateEndpointConnectionsUpdateResponse - >; + privateEndpointConnection: PrivateEndpointConnection, + options?: PrivateEndpointConnectionsUpdateOptionalParams + ): Promise< + PollerLike< + PollOperationState, + PrivateEndpointConnectionsUpdateResponse + > + > { + 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, + resourceName, + privateEndpointConnectionName, + privateEndpointConnection, + options + }, + updateOperationSpec + ); + return new LroEngine(lro, { + resumeFrom: options?.resumeFrom, + intervalInMs: options?.updateIntervalInMs + }); } /** - * Delete private endpoint connection with the specified name - * @summary Delete private endpoint connection + * Update the status of a private endpoint connection with the specified name * @param resourceGroupName The name of the resource group that contains the IoT hub. * @param resourceName The name of the IoT hub. * @param privateEndpointConnectionName The name of the private endpoint connection - * @param [options] The optional parameters - * @returns Promise + * @param privateEndpointConnection The private endpoint connection with updated properties + * @param options The options parameters. */ - deleteMethod( + async beginUpdateAndWait( resourceGroupName: string, resourceName: string, privateEndpointConnectionName: string, - options?: msRest.RequestOptionsBase - ): Promise { - return this.beginDeleteMethod( + privateEndpointConnection: PrivateEndpointConnection, + options?: PrivateEndpointConnectionsUpdateOptionalParams + ): Promise { + const poller = await this.beginUpdate( resourceGroupName, resourceName, privateEndpointConnectionName, + privateEndpointConnection, options - ).then((lroPoller) => lroPoller.pollUntilFinished()) as Promise< - Models.PrivateEndpointConnectionsDeleteMethodResponse - >; + ); + return poller.pollUntilDone(); } /** - * Update the status of a private endpoint connection with the specified name - * @summary Update private endpoint connection + * Delete private endpoint connection with the specified name * @param resourceGroupName The name of the resource group that contains the IoT hub. * @param resourceName The name of the IoT hub. * @param privateEndpointConnectionName The name of the private endpoint connection - * @param properties - * @param [options] The optional parameters - * @returns Promise + * @param options The options parameters. */ - beginUpdate( + async beginDelete( resourceGroupName: string, resourceName: string, privateEndpointConnectionName: string, - properties: Models.PrivateEndpointConnectionProperties, - options?: msRest.RequestOptionsBase - ): Promise { - return this.client.sendLRORequest( + options?: PrivateEndpointConnectionsDeleteOptionalParams + ): Promise< + PollerLike< + PollOperationState, + PrivateEndpointConnectionsDeleteResponse + > + > { + 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, resourceName, privateEndpointConnectionName, - properties, options }, - beginUpdateOperationSpec, - options + deleteOperationSpec ); + return new LroEngine(lro, { + resumeFrom: options?.resumeFrom, + intervalInMs: options?.updateIntervalInMs + }); } /** * Delete private endpoint connection with the specified name - * @summary Delete private endpoint connection * @param resourceGroupName The name of the resource group that contains the IoT hub. * @param resourceName The name of the IoT hub. * @param privateEndpointConnectionName The name of the private endpoint connection - * @param [options] The optional parameters - * @returns Promise + * @param options The options parameters. */ - beginDeleteMethod( + async beginDeleteAndWait( resourceGroupName: string, resourceName: string, privateEndpointConnectionName: string, - options?: msRest.RequestOptionsBase - ): Promise { - return this.client.sendLRORequest( - { - resourceGroupName, - resourceName, - privateEndpointConnectionName, - options - }, - beginDeleteMethodOperationSpec, + options?: PrivateEndpointConnectionsDeleteOptionalParams + ): Promise { + const poller = await this.beginDelete( + resourceGroupName, + resourceName, + privateEndpointConnectionName, options ); + return poller.pollUntilDone(); } } - // Operation Specifications -const serializer = new msRest.Serializer(Mappers); -const listOperationSpec: msRest.OperationSpec = { - httpMethod: "GET", +const serializer = coreClient.createSerializer(Mappers, /* isXml */ false); + +const listOperationSpec: coreClient.OperationSpec = { path: - "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Devices/iotHubs/{resourceName}/privateEndpointConnections", - urlParameters: [Parameters.subscriptionId, Parameters.resourceGroupName, Parameters.resourceName], - queryParameters: [Parameters.apiVersion], - headerParameters: [Parameters.acceptLanguage], + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Devices/iotHubs/{resourceName}/privateEndpointConnections", + httpMethod: "GET", responses: { 200: { bodyMapper: { - serializedName: "parsedResponse", type: { name: "Sequence", element: { - type: { - name: "Composite", - className: "PrivateEndpointConnection" - } + type: { name: "Composite", className: "PrivateEndpointConnection" } } } } @@ -279,21 +297,20 @@ const listOperationSpec: msRest.OperationSpec = { bodyMapper: Mappers.ErrorDetails } }, - serializer -}; - -const getOperationSpec: msRest.OperationSpec = { - httpMethod: "GET", - path: - "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Devices/iotHubs/{resourceName}/privateEndpointConnections/{privateEndpointConnectionName}", + queryParameters: [Parameters.apiVersion], urlParameters: [ + Parameters.$host, Parameters.subscriptionId, Parameters.resourceGroupName, - Parameters.resourceName, - Parameters.privateEndpointConnectionName + Parameters.resourceName ], - queryParameters: [Parameters.apiVersion], - headerParameters: [Parameters.acceptLanguage], + headerParameters: [Parameters.accept], + serializer +}; +const getOperationSpec: coreClient.OperationSpec = { + path: + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Devices/iotHubs/{resourceName}/privateEndpointConnections/{privateEndpointConnectionName}", + httpMethod: "GET", responses: { 200: { bodyMapper: Mappers.PrivateEndpointConnection @@ -302,30 +319,21 @@ const getOperationSpec: msRest.OperationSpec = { bodyMapper: Mappers.ErrorDetails } }, - serializer -}; - -const beginUpdateOperationSpec: msRest.OperationSpec = { - httpMethod: "PUT", - path: - "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Devices/iotHubs/{resourceName}/privateEndpointConnections/{privateEndpointConnectionName}", + queryParameters: [Parameters.apiVersion], urlParameters: [ + Parameters.$host, Parameters.subscriptionId, Parameters.resourceGroupName, Parameters.resourceName, Parameters.privateEndpointConnectionName ], - queryParameters: [Parameters.apiVersion], - headerParameters: [Parameters.acceptLanguage], - requestBody: { - parameterPath: { - properties: "properties" - }, - mapper: { - ...Mappers.PrivateEndpointConnection, - required: true - } - }, + headerParameters: [Parameters.accept], + serializer +}; +const updateOperationSpec: coreClient.OperationSpec = { + path: + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Devices/iotHubs/{resourceName}/privateEndpointConnections/{privateEndpointConnectionName}", + httpMethod: "PUT", responses: { 200: { bodyMapper: Mappers.PrivateEndpointConnection @@ -333,36 +341,58 @@ const beginUpdateOperationSpec: msRest.OperationSpec = { 201: { bodyMapper: Mappers.PrivateEndpointConnection }, + 202: { + bodyMapper: Mappers.PrivateEndpointConnection + }, + 204: { + bodyMapper: Mappers.PrivateEndpointConnection + }, default: { bodyMapper: Mappers.ErrorDetails } }, - serializer -}; - -const beginDeleteMethodOperationSpec: msRest.OperationSpec = { - httpMethod: "DELETE", - path: - "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Devices/iotHubs/{resourceName}/privateEndpointConnections/{privateEndpointConnectionName}", + requestBody: Parameters.privateEndpointConnection, + queryParameters: [Parameters.apiVersion], urlParameters: [ + Parameters.$host, Parameters.subscriptionId, Parameters.resourceGroupName, Parameters.resourceName, Parameters.privateEndpointConnectionName ], - queryParameters: [Parameters.apiVersion], - headerParameters: [Parameters.acceptLanguage], + headerParameters: [Parameters.accept, Parameters.contentType], + mediaType: "json", + serializer +}; +const deleteOperationSpec: coreClient.OperationSpec = { + path: + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Devices/iotHubs/{resourceName}/privateEndpointConnections/{privateEndpointConnectionName}", + httpMethod: "DELETE", responses: { 200: { bodyMapper: Mappers.PrivateEndpointConnection }, + 201: { + bodyMapper: Mappers.PrivateEndpointConnection + }, 202: { bodyMapper: Mappers.PrivateEndpointConnection }, - 204: {}, + 204: { + bodyMapper: Mappers.PrivateEndpointConnection + }, default: { bodyMapper: Mappers.ErrorDetails } }, + queryParameters: [Parameters.apiVersion], + urlParameters: [ + Parameters.$host, + Parameters.subscriptionId, + Parameters.resourceGroupName, + Parameters.resourceName, + Parameters.privateEndpointConnectionName + ], + headerParameters: [Parameters.accept], serializer }; diff --git a/sdk/iothub/arm-iothub/src/operations/privateLinkResourcesOperations.ts b/sdk/iothub/arm-iothub/src/operations/privateLinkResourcesOperations.ts index f51e56d506bd..071473cbded9 100644 --- a/sdk/iothub/arm-iothub/src/operations/privateLinkResourcesOperations.ts +++ b/sdk/iothub/arm-iothub/src/operations/privateLinkResourcesOperations.ts @@ -3,150 +3,77 @@ * 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/privateLinkResourcesOperationsMappers"; +import { PrivateLinkResourcesOperations } from "../operationsInterfaces"; +import * as coreClient from "@azure/core-client"; +import * as Mappers from "../models/mappers"; import * as Parameters from "../models/parameters"; -import { IotHubClientContext } from "../iotHubClientContext"; +import { IotHubClient } from "../iotHubClient"; +import { + PrivateLinkResourcesListOptionalParams, + PrivateLinkResourcesListResponse, + PrivateLinkResourcesGetOptionalParams, + PrivateLinkResourcesGetResponse +} from "../models"; -/** Class representing a PrivateLinkResourcesOperations. */ -export class PrivateLinkResourcesOperations { - private readonly client: IotHubClientContext; +/** Class containing PrivateLinkResourcesOperations operations. */ +export class PrivateLinkResourcesOperationsImpl + implements PrivateLinkResourcesOperations { + private readonly client: IotHubClient; /** - * Create a PrivateLinkResourcesOperations. - * @param {IotHubClientContext} client Reference to the service client. + * Initialize a new instance of the class PrivateLinkResourcesOperations class. + * @param client Reference to the service client */ - constructor(client: IotHubClientContext) { + constructor(client: IotHubClient) { this.client = client; } /** * List private link resources for the given IotHub - * @summary List private link resources * @param resourceGroupName The name of the resource group that contains the IoT hub. * @param resourceName The name of the IoT hub. - * @param [options] The optional parameters - * @returns Promise + * @param options The options parameters. */ list( resourceGroupName: string, resourceName: string, - options?: msRest.RequestOptionsBase - ): Promise; - /** - * @param resourceGroupName The name of the resource group that contains the IoT hub. - * @param resourceName The name of the IoT hub. - * @param callback The callback - */ - list( - resourceGroupName: string, - resourceName: string, - callback: msRest.ServiceCallback - ): void; - /** - * @param resourceGroupName The name of the resource group that contains the IoT hub. - * @param resourceName The name of the IoT hub. - * @param options The optional parameters - * @param callback The callback - */ - list( - resourceGroupName: string, - resourceName: string, - options: msRest.RequestOptionsBase, - callback: msRest.ServiceCallback - ): void; - list( - resourceGroupName: string, - resourceName: string, - options?: msRest.RequestOptionsBase | msRest.ServiceCallback, - callback?: msRest.ServiceCallback - ): Promise { + options?: PrivateLinkResourcesListOptionalParams + ): Promise { return this.client.sendOperationRequest( - { - resourceGroupName, - resourceName, - options - }, - listOperationSpec, - callback - ) as Promise; + { resourceGroupName, resourceName, options }, + listOperationSpec + ); } /** * Get the specified private link resource for the given IotHub - * @summary Get the specified private link resource - * @param resourceGroupName The name of the resource group that contains the IoT hub. - * @param resourceName The name of the IoT hub. - * @param groupId The name of the private link resource - * @param [options] The optional parameters - * @returns Promise - */ - get( - resourceGroupName: string, - resourceName: string, - groupId: string, - options?: msRest.RequestOptionsBase - ): Promise; - /** - * @param resourceGroupName The name of the resource group that contains the IoT hub. - * @param resourceName The name of the IoT hub. - * @param groupId The name of the private link resource - * @param callback The callback - */ - get( - resourceGroupName: string, - resourceName: string, - groupId: string, - callback: msRest.ServiceCallback - ): void; - /** * @param resourceGroupName The name of the resource group that contains the IoT hub. * @param resourceName The name of the IoT hub. * @param groupId The name of the private link resource - * @param options The optional parameters - * @param callback The callback + * @param options The options parameters. */ get( resourceGroupName: string, resourceName: string, groupId: string, - options: msRest.RequestOptionsBase, - callback: msRest.ServiceCallback - ): void; - get( - resourceGroupName: string, - resourceName: string, - groupId: string, - options?: msRest.RequestOptionsBase | msRest.ServiceCallback, - callback?: msRest.ServiceCallback - ): Promise { + options?: PrivateLinkResourcesGetOptionalParams + ): Promise { return this.client.sendOperationRequest( - { - resourceGroupName, - resourceName, - groupId, - options - }, - getOperationSpec, - callback - ) as Promise; + { resourceGroupName, resourceName, groupId, options }, + getOperationSpec + ); } } - // Operation Specifications -const serializer = new msRest.Serializer(Mappers); -const listOperationSpec: msRest.OperationSpec = { - httpMethod: "GET", +const serializer = coreClient.createSerializer(Mappers, /* isXml */ false); + +const listOperationSpec: coreClient.OperationSpec = { path: - "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Devices/iotHubs/{resourceName}/privateLinkResources", - urlParameters: [Parameters.subscriptionId, Parameters.resourceGroupName, Parameters.resourceName], - queryParameters: [Parameters.apiVersion], - headerParameters: [Parameters.acceptLanguage], + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Devices/iotHubs/{resourceName}/privateLinkResources", + httpMethod: "GET", responses: { 200: { bodyMapper: Mappers.PrivateLinkResources @@ -155,21 +82,20 @@ const listOperationSpec: msRest.OperationSpec = { bodyMapper: Mappers.ErrorDetails } }, - serializer -}; - -const getOperationSpec: msRest.OperationSpec = { - httpMethod: "GET", - path: - "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Devices/iotHubs/{resourceName}/privateLinkResources/{groupId}", + queryParameters: [Parameters.apiVersion], urlParameters: [ + Parameters.$host, Parameters.subscriptionId, Parameters.resourceGroupName, - Parameters.resourceName, - Parameters.groupId + Parameters.resourceName ], - queryParameters: [Parameters.apiVersion], - headerParameters: [Parameters.acceptLanguage], + headerParameters: [Parameters.accept], + serializer +}; +const getOperationSpec: coreClient.OperationSpec = { + path: + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Devices/iotHubs/{resourceName}/privateLinkResources/{groupId}", + httpMethod: "GET", responses: { 200: { bodyMapper: Mappers.GroupIdInformation @@ -178,5 +104,14 @@ const getOperationSpec: msRest.OperationSpec = { bodyMapper: Mappers.ErrorDetails } }, + queryParameters: [Parameters.apiVersion], + urlParameters: [ + Parameters.$host, + Parameters.subscriptionId, + Parameters.resourceGroupName, + Parameters.resourceName, + Parameters.groupId + ], + headerParameters: [Parameters.accept], serializer }; diff --git a/sdk/iothub/arm-iothub/src/operations/resourceProviderCommon.ts b/sdk/iothub/arm-iothub/src/operations/resourceProviderCommon.ts index 7b50f3344c58..fa2a3f43e047 100644 --- a/sdk/iothub/arm-iothub/src/operations/resourceProviderCommon.ts +++ b/sdk/iothub/arm-iothub/src/operations/resourceProviderCommon.ts @@ -3,75 +3,50 @@ * 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/resourceProviderCommonMappers"; +import { ResourceProviderCommon } from "../operationsInterfaces"; +import * as coreClient from "@azure/core-client"; +import * as Mappers from "../models/mappers"; import * as Parameters from "../models/parameters"; -import { IotHubClientContext } from "../iotHubClientContext"; +import { IotHubClient } from "../iotHubClient"; +import { + ResourceProviderCommonGetSubscriptionQuotaOptionalParams, + ResourceProviderCommonGetSubscriptionQuotaResponse +} from "../models"; -/** Class representing a ResourceProviderCommon. */ -export class ResourceProviderCommon { - private readonly client: IotHubClientContext; +/** Class containing ResourceProviderCommon operations. */ +export class ResourceProviderCommonImpl implements ResourceProviderCommon { + private readonly client: IotHubClient; /** - * Create a ResourceProviderCommon. - * @param {IotHubClientContext} client Reference to the service client. + * Initialize a new instance of the class ResourceProviderCommon class. + * @param client Reference to the service client */ - constructor(client: IotHubClientContext) { + constructor(client: IotHubClient) { this.client = client; } /** * Get the number of free and paid iot hubs in the subscription - * @summary Get the number of iot hubs in the subscription - * @param [options] The optional parameters - * @returns Promise + * @param options The options parameters. */ getSubscriptionQuota( - options?: msRest.RequestOptionsBase - ): Promise; - /** - * @param callback The callback - */ - getSubscriptionQuota( - callback: msRest.ServiceCallback - ): void; - /** - * @param options The optional parameters - * @param callback The callback - */ - getSubscriptionQuota( - options: msRest.RequestOptionsBase, - callback: msRest.ServiceCallback - ): void; - getSubscriptionQuota( - options?: - | msRest.RequestOptionsBase - | msRest.ServiceCallback, - callback?: msRest.ServiceCallback - ): Promise { + options?: ResourceProviderCommonGetSubscriptionQuotaOptionalParams + ): Promise { return this.client.sendOperationRequest( - { - options - }, - getSubscriptionQuotaOperationSpec, - callback - ) as Promise; + { options }, + getSubscriptionQuotaOperationSpec + ); } } - // Operation Specifications -const serializer = new msRest.Serializer(Mappers); -const getSubscriptionQuotaOperationSpec: msRest.OperationSpec = { +const serializer = coreClient.createSerializer(Mappers, /* isXml */ false); + +const getSubscriptionQuotaOperationSpec: coreClient.OperationSpec = { + path: "/subscriptions/{subscriptionId}/providers/Microsoft.Devices/usages", httpMethod: "GET", - path: "subscriptions/{subscriptionId}/providers/Microsoft.Devices/usages", - urlParameters: [Parameters.subscriptionId], - queryParameters: [Parameters.apiVersion], - headerParameters: [Parameters.acceptLanguage], responses: { 200: { bodyMapper: Mappers.UserSubscriptionQuotaListResult @@ -80,5 +55,8 @@ const getSubscriptionQuotaOperationSpec: msRest.OperationSpec = { bodyMapper: Mappers.ErrorDetails } }, + queryParameters: [Parameters.apiVersion], + urlParameters: [Parameters.$host, Parameters.subscriptionId], + headerParameters: [Parameters.accept], serializer }; diff --git a/sdk/iothub/arm-iothub/src/operationsInterfaces/certificates.ts b/sdk/iothub/arm-iothub/src/operationsInterfaces/certificates.ts new file mode 100644 index 000000000000..475e47e3377b --- /dev/null +++ b/sdk/iothub/arm-iothub/src/operationsInterfaces/certificates.ts @@ -0,0 +1,115 @@ +/* + * 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 { + CertificatesListByIotHubOptionalParams, + CertificatesListByIotHubResponse, + CertificatesGetOptionalParams, + CertificatesGetResponse, + CertificateDescription, + CertificatesCreateOrUpdateOptionalParams, + CertificatesCreateOrUpdateResponse, + CertificatesDeleteOptionalParams, + CertificatesGenerateVerificationCodeOptionalParams, + CertificatesGenerateVerificationCodeResponse, + CertificateVerificationDescription, + CertificatesVerifyOptionalParams, + CertificatesVerifyResponse +} from "../models"; + +/** Interface representing a Certificates. */ +export interface Certificates { + /** + * Returns the list of certificates. + * @param resourceGroupName The name of the resource group that contains the IoT hub. + * @param resourceName The name of the IoT hub. + * @param options The options parameters. + */ + listByIotHub( + resourceGroupName: string, + resourceName: string, + options?: CertificatesListByIotHubOptionalParams + ): Promise; + /** + * Returns the certificate. + * @param resourceGroupName The name of the resource group that contains the IoT hub. + * @param resourceName The name of the IoT hub. + * @param certificateName The name of the certificate + * @param options The options parameters. + */ + get( + resourceGroupName: string, + resourceName: string, + certificateName: string, + options?: CertificatesGetOptionalParams + ): Promise; + /** + * Adds new or replaces existing certificate. + * @param resourceGroupName The name of the resource group that contains the IoT hub. + * @param resourceName The name of the IoT hub. + * @param certificateName The name of the certificate + * @param certificateDescription The certificate body. + * @param options The options parameters. + */ + createOrUpdate( + resourceGroupName: string, + resourceName: string, + certificateName: string, + certificateDescription: CertificateDescription, + options?: CertificatesCreateOrUpdateOptionalParams + ): Promise; + /** + * Deletes an existing X509 certificate or does nothing if it does not exist. + * @param resourceGroupName The name of the resource group that contains the IoT hub. + * @param resourceName The name of the IoT hub. + * @param certificateName The name of the certificate + * @param ifMatch ETag of the Certificate. + * @param options The options parameters. + */ + delete( + resourceGroupName: string, + resourceName: string, + certificateName: string, + ifMatch: string, + options?: CertificatesDeleteOptionalParams + ): Promise; + /** + * Generates verification code for proof of possession flow. The verification code will be used to + * generate a leaf certificate. + * @param resourceGroupName The name of the resource group that contains the IoT hub. + * @param resourceName The name of the IoT hub. + * @param certificateName The name of the certificate + * @param ifMatch ETag of the Certificate. + * @param options The options parameters. + */ + generateVerificationCode( + resourceGroupName: string, + resourceName: string, + certificateName: string, + ifMatch: string, + options?: CertificatesGenerateVerificationCodeOptionalParams + ): Promise; + /** + * Verifies the certificate's private key possession by providing the leaf cert issued by the verifying + * pre uploaded certificate. + * @param resourceGroupName The name of the resource group that contains the IoT hub. + * @param resourceName The name of the IoT hub. + * @param certificateName The name of the certificate + * @param ifMatch ETag of the Certificate. + * @param certificateVerificationBody The name of the certificate + * @param options The options parameters. + */ + verify( + resourceGroupName: string, + resourceName: string, + certificateName: string, + ifMatch: string, + certificateVerificationBody: CertificateVerificationDescription, + options?: CertificatesVerifyOptionalParams + ): Promise; +} diff --git a/sdk/iothub/arm-iothub/src/operationsInterfaces/index.ts b/sdk/iothub/arm-iothub/src/operationsInterfaces/index.ts new file mode 100644 index 000000000000..2e8c735dc1bc --- /dev/null +++ b/sdk/iothub/arm-iothub/src/operationsInterfaces/index.ts @@ -0,0 +1,15 @@ +/* + * 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 "./iotHubResource"; +export * from "./resourceProviderCommon"; +export * from "./certificates"; +export * from "./iotHub"; +export * from "./privateLinkResourcesOperations"; +export * from "./privateEndpointConnections"; diff --git a/sdk/iothub/arm-iothub/src/operationsInterfaces/iotHub.ts b/sdk/iothub/arm-iothub/src/operationsInterfaces/iotHub.ts new file mode 100644 index 000000000000..8181784133c5 --- /dev/null +++ b/sdk/iothub/arm-iothub/src/operationsInterfaces/iotHub.ts @@ -0,0 +1,46 @@ +/* + * 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 { PollerLike, PollOperationState } from "@azure/core-lro"; +import { FailoverInput, IotHubManualFailoverOptionalParams } from "../models"; + +/** Interface representing a IotHub. */ +export interface IotHub { + /** + * Manually initiate a failover for the IoT Hub to its secondary region. To learn more, see + * https://aka.ms/manualfailover + * @param iotHubName Name of the IoT hub to failover + * @param resourceGroupName Name of the resource group containing the IoT hub resource + * @param failoverInput Region to failover to. Must be the Azure paired region. Get the value from the + * secondary location in the locations property. To learn more, see + * https://aka.ms/manualfailover/region + * @param options The options parameters. + */ + beginManualFailover( + iotHubName: string, + resourceGroupName: string, + failoverInput: FailoverInput, + options?: IotHubManualFailoverOptionalParams + ): Promise, void>>; + /** + * Manually initiate a failover for the IoT Hub to its secondary region. To learn more, see + * https://aka.ms/manualfailover + * @param iotHubName Name of the IoT hub to failover + * @param resourceGroupName Name of the resource group containing the IoT hub resource + * @param failoverInput Region to failover to. Must be the Azure paired region. Get the value from the + * secondary location in the locations property. To learn more, see + * https://aka.ms/manualfailover/region + * @param options The options parameters. + */ + beginManualFailoverAndWait( + iotHubName: string, + resourceGroupName: string, + failoverInput: FailoverInput, + options?: IotHubManualFailoverOptionalParams + ): Promise; +} diff --git a/sdk/iothub/arm-iothub/src/operationsInterfaces/iotHubResource.ts b/sdk/iothub/arm-iothub/src/operationsInterfaces/iotHubResource.ts new file mode 100644 index 000000000000..f07c95da16b2 --- /dev/null +++ b/sdk/iothub/arm-iothub/src/operationsInterfaces/iotHubResource.ts @@ -0,0 +1,413 @@ +/* + * 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 { + IotHubDescription, + IotHubResourceListBySubscriptionOptionalParams, + IotHubResourceListByResourceGroupOptionalParams, + IotHubSkuDescription, + IotHubResourceGetValidSkusOptionalParams, + EventHubConsumerGroupInfo, + IotHubResourceListEventHubConsumerGroupsOptionalParams, + JobResponse, + IotHubResourceListJobsOptionalParams, + IotHubQuotaMetricInfo, + IotHubResourceGetQuotaMetricsOptionalParams, + EndpointHealthData, + IotHubResourceGetEndpointHealthOptionalParams, + SharedAccessSignatureAuthorizationRule, + IotHubResourceListKeysOptionalParams, + IotHubResourceGetOptionalParams, + IotHubResourceGetResponse, + IotHubResourceCreateOrUpdateOptionalParams, + IotHubResourceCreateOrUpdateResponse, + TagsResource, + IotHubResourceUpdateOptionalParams, + IotHubResourceUpdateResponse, + IotHubResourceDeleteOptionalParams, + IotHubResourceDeleteResponse, + IotHubResourceGetStatsOptionalParams, + IotHubResourceGetStatsResponse, + IotHubResourceGetEventHubConsumerGroupOptionalParams, + IotHubResourceGetEventHubConsumerGroupResponse, + EventHubConsumerGroupBodyDescription, + IotHubResourceCreateEventHubConsumerGroupOptionalParams, + IotHubResourceCreateEventHubConsumerGroupResponse, + IotHubResourceDeleteEventHubConsumerGroupOptionalParams, + IotHubResourceGetJobOptionalParams, + IotHubResourceGetJobResponse, + OperationInputs, + IotHubResourceCheckNameAvailabilityOptionalParams, + IotHubResourceCheckNameAvailabilityResponse, + TestAllRoutesInput, + IotHubResourceTestAllRoutesOptionalParams, + IotHubResourceTestAllRoutesResponse, + TestRouteInput, + IotHubResourceTestRouteOptionalParams, + IotHubResourceTestRouteResponse, + IotHubResourceGetKeysForKeyNameOptionalParams, + IotHubResourceGetKeysForKeyNameResponse, + ExportDevicesRequest, + IotHubResourceExportDevicesOptionalParams, + IotHubResourceExportDevicesResponse, + ImportDevicesRequest, + IotHubResourceImportDevicesOptionalParams, + IotHubResourceImportDevicesResponse +} from "../models"; + +/// +/** Interface representing a IotHubResource. */ +export interface IotHubResource { + /** + * Get all the IoT hubs in a subscription. + * @param options The options parameters. + */ + listBySubscription( + options?: IotHubResourceListBySubscriptionOptionalParams + ): PagedAsyncIterableIterator; + /** + * Get all the IoT hubs in a resource group. + * @param resourceGroupName The name of the resource group that contains the IoT hub. + * @param options The options parameters. + */ + listByResourceGroup( + resourceGroupName: string, + options?: IotHubResourceListByResourceGroupOptionalParams + ): PagedAsyncIterableIterator; + /** + * Get the list of valid SKUs for an IoT hub. + * @param resourceGroupName The name of the resource group that contains the IoT hub. + * @param resourceName The name of the IoT hub. + * @param options The options parameters. + */ + listValidSkus( + resourceGroupName: string, + resourceName: string, + options?: IotHubResourceGetValidSkusOptionalParams + ): PagedAsyncIterableIterator; + /** + * Get a list of the consumer groups in the Event Hub-compatible device-to-cloud endpoint in an IoT + * hub. + * @param resourceGroupName The name of the resource group that contains the IoT hub. + * @param resourceName The name of the IoT hub. + * @param eventHubEndpointName The name of the Event Hub-compatible endpoint. + * @param options The options parameters. + */ + listEventHubConsumerGroups( + resourceGroupName: string, + resourceName: string, + eventHubEndpointName: string, + options?: IotHubResourceListEventHubConsumerGroupsOptionalParams + ): PagedAsyncIterableIterator; + /** + * Get a list of all the jobs in an IoT hub. For more information, see: + * https://docs.microsoft.com/azure/iot-hub/iot-hub-devguide-identity-registry. + * @param resourceGroupName The name of the resource group that contains the IoT hub. + * @param resourceName The name of the IoT hub. + * @param options The options parameters. + */ + listJobs( + resourceGroupName: string, + resourceName: string, + options?: IotHubResourceListJobsOptionalParams + ): PagedAsyncIterableIterator; + /** + * Get the quota metrics for an IoT hub. + * @param resourceGroupName The name of the resource group that contains the IoT hub. + * @param resourceName The name of the IoT hub. + * @param options The options parameters. + */ + listQuotaMetrics( + resourceGroupName: string, + resourceName: string, + options?: IotHubResourceGetQuotaMetricsOptionalParams + ): PagedAsyncIterableIterator; + /** + * Get the health for routing endpoints. + * @param resourceGroupName + * @param iotHubName + * @param options The options parameters. + */ + listEndpointHealth( + resourceGroupName: string, + iotHubName: string, + options?: IotHubResourceGetEndpointHealthOptionalParams + ): PagedAsyncIterableIterator; + /** + * Get the security metadata for an IoT hub. For more information, see: + * https://docs.microsoft.com/azure/iot-hub/iot-hub-devguide-security. + * @param resourceGroupName The name of the resource group that contains the IoT hub. + * @param resourceName The name of the IoT hub. + * @param options The options parameters. + */ + listKeys( + resourceGroupName: string, + resourceName: string, + options?: IotHubResourceListKeysOptionalParams + ): PagedAsyncIterableIterator; + /** + * Get the non-security related metadata of an IoT hub. + * @param resourceGroupName The name of the resource group that contains the IoT hub. + * @param resourceName The name of the IoT hub. + * @param options The options parameters. + */ + get( + resourceGroupName: string, + resourceName: string, + options?: IotHubResourceGetOptionalParams + ): Promise; + /** + * Create or update the metadata of an Iot hub. The usual pattern to modify a property is to retrieve + * the IoT hub metadata and security metadata, and then combine them with the modified values in a new + * body to update the IoT hub. If certain properties are missing in the JSON, updating IoT Hub may + * cause these values to fallback to default, which may lead to unexpected behavior. + * @param resourceGroupName The name of the resource group that contains the IoT hub. + * @param resourceName The name of the IoT hub. + * @param iotHubDescription The IoT hub metadata and security metadata. + * @param options The options parameters. + */ + beginCreateOrUpdate( + resourceGroupName: string, + resourceName: string, + iotHubDescription: IotHubDescription, + options?: IotHubResourceCreateOrUpdateOptionalParams + ): Promise< + PollerLike< + PollOperationState, + IotHubResourceCreateOrUpdateResponse + > + >; + /** + * Create or update the metadata of an Iot hub. The usual pattern to modify a property is to retrieve + * the IoT hub metadata and security metadata, and then combine them with the modified values in a new + * body to update the IoT hub. If certain properties are missing in the JSON, updating IoT Hub may + * cause these values to fallback to default, which may lead to unexpected behavior. + * @param resourceGroupName The name of the resource group that contains the IoT hub. + * @param resourceName The name of the IoT hub. + * @param iotHubDescription The IoT hub metadata and security metadata. + * @param options The options parameters. + */ + beginCreateOrUpdateAndWait( + resourceGroupName: string, + resourceName: string, + iotHubDescription: IotHubDescription, + options?: IotHubResourceCreateOrUpdateOptionalParams + ): Promise; + /** + * Update an existing IoT Hub tags. to update other fields use the CreateOrUpdate method + * @param resourceGroupName Resource group identifier. + * @param resourceName Name of iot hub to update. + * @param iotHubTags Updated tag information to set into the iot hub instance. + * @param options The options parameters. + */ + beginUpdate( + resourceGroupName: string, + resourceName: string, + iotHubTags: TagsResource, + options?: IotHubResourceUpdateOptionalParams + ): Promise< + PollerLike< + PollOperationState, + IotHubResourceUpdateResponse + > + >; + /** + * Update an existing IoT Hub tags. to update other fields use the CreateOrUpdate method + * @param resourceGroupName Resource group identifier. + * @param resourceName Name of iot hub to update. + * @param iotHubTags Updated tag information to set into the iot hub instance. + * @param options The options parameters. + */ + beginUpdateAndWait( + resourceGroupName: string, + resourceName: string, + iotHubTags: TagsResource, + options?: IotHubResourceUpdateOptionalParams + ): Promise; + /** + * Delete an IoT hub. + * @param resourceGroupName The name of the resource group that contains the IoT hub. + * @param resourceName The name of the IoT hub. + * @param options The options parameters. + */ + beginDelete( + resourceGroupName: string, + resourceName: string, + options?: IotHubResourceDeleteOptionalParams + ): Promise< + PollerLike< + PollOperationState, + IotHubResourceDeleteResponse + > + >; + /** + * Delete an IoT hub. + * @param resourceGroupName The name of the resource group that contains the IoT hub. + * @param resourceName The name of the IoT hub. + * @param options The options parameters. + */ + beginDeleteAndWait( + resourceGroupName: string, + resourceName: string, + options?: IotHubResourceDeleteOptionalParams + ): Promise; + /** + * Get the statistics from an IoT hub. + * @param resourceGroupName The name of the resource group that contains the IoT hub. + * @param resourceName The name of the IoT hub. + * @param options The options parameters. + */ + getStats( + resourceGroupName: string, + resourceName: string, + options?: IotHubResourceGetStatsOptionalParams + ): Promise; + /** + * Get a consumer group from the Event Hub-compatible device-to-cloud endpoint for an IoT hub. + * @param resourceGroupName The name of the resource group that contains the IoT hub. + * @param resourceName The name of the IoT hub. + * @param eventHubEndpointName The name of the Event Hub-compatible endpoint in the IoT hub. + * @param name The name of the consumer group to retrieve. + * @param options The options parameters. + */ + getEventHubConsumerGroup( + resourceGroupName: string, + resourceName: string, + eventHubEndpointName: string, + name: string, + options?: IotHubResourceGetEventHubConsumerGroupOptionalParams + ): Promise; + /** + * Add a consumer group to an Event Hub-compatible endpoint in an IoT hub. + * @param resourceGroupName The name of the resource group that contains the IoT hub. + * @param resourceName The name of the IoT hub. + * @param eventHubEndpointName The name of the Event Hub-compatible endpoint in the IoT hub. + * @param name The name of the consumer group to add. + * @param consumerGroupBody The consumer group to add. + * @param options The options parameters. + */ + createEventHubConsumerGroup( + resourceGroupName: string, + resourceName: string, + eventHubEndpointName: string, + name: string, + consumerGroupBody: EventHubConsumerGroupBodyDescription, + options?: IotHubResourceCreateEventHubConsumerGroupOptionalParams + ): Promise; + /** + * Delete a consumer group from an Event Hub-compatible endpoint in an IoT hub. + * @param resourceGroupName The name of the resource group that contains the IoT hub. + * @param resourceName The name of the IoT hub. + * @param eventHubEndpointName The name of the Event Hub-compatible endpoint in the IoT hub. + * @param name The name of the consumer group to delete. + * @param options The options parameters. + */ + deleteEventHubConsumerGroup( + resourceGroupName: string, + resourceName: string, + eventHubEndpointName: string, + name: string, + options?: IotHubResourceDeleteEventHubConsumerGroupOptionalParams + ): Promise; + /** + * Get the details of a job from an IoT hub. For more information, see: + * https://docs.microsoft.com/azure/iot-hub/iot-hub-devguide-identity-registry. + * @param resourceGroupName The name of the resource group that contains the IoT hub. + * @param resourceName The name of the IoT hub. + * @param jobId The job identifier. + * @param options The options parameters. + */ + getJob( + resourceGroupName: string, + resourceName: string, + jobId: string, + options?: IotHubResourceGetJobOptionalParams + ): Promise; + /** + * Check if an IoT hub name is available. + * @param operationInputs Set the name parameter in the OperationInputs structure to the name of the + * IoT hub to check. + * @param options The options parameters. + */ + checkNameAvailability( + operationInputs: OperationInputs, + options?: IotHubResourceCheckNameAvailabilityOptionalParams + ): Promise; + /** + * Test all routes configured in this Iot Hub + * @param iotHubName IotHub to be tested + * @param resourceGroupName resource group which Iot Hub belongs to + * @param input Input for testing all routes + * @param options The options parameters. + */ + testAllRoutes( + iotHubName: string, + resourceGroupName: string, + input: TestAllRoutesInput, + options?: IotHubResourceTestAllRoutesOptionalParams + ): Promise; + /** + * Test the new route for this Iot Hub + * @param iotHubName IotHub to be tested + * @param resourceGroupName resource group which Iot Hub belongs to + * @param input Route that needs to be tested + * @param options The options parameters. + */ + testRoute( + iotHubName: string, + resourceGroupName: string, + input: TestRouteInput, + options?: IotHubResourceTestRouteOptionalParams + ): Promise; + /** + * Get a shared access policy by name from an IoT hub. For more information, see: + * https://docs.microsoft.com/azure/iot-hub/iot-hub-devguide-security. + * @param resourceGroupName The name of the resource group that contains the IoT hub. + * @param resourceName The name of the IoT hub. + * @param keyName The name of the shared access policy. + * @param options The options parameters. + */ + getKeysForKeyName( + resourceGroupName: string, + resourceName: string, + keyName: string, + options?: IotHubResourceGetKeysForKeyNameOptionalParams + ): Promise; + /** + * Exports all the device identities in the IoT hub identity registry to an Azure Storage blob + * container. For more information, see: + * https://docs.microsoft.com/azure/iot-hub/iot-hub-devguide-identity-registry#import-and-export-device-identities. + * @param resourceGroupName The name of the resource group that contains the IoT hub. + * @param resourceName The name of the IoT hub. + * @param exportDevicesParameters The parameters that specify the export devices operation. + * @param options The options parameters. + */ + exportDevices( + resourceGroupName: string, + resourceName: string, + exportDevicesParameters: ExportDevicesRequest, + options?: IotHubResourceExportDevicesOptionalParams + ): Promise; + /** + * Import, update, or delete device identities in the IoT hub identity registry from a blob. For more + * information, see: + * https://docs.microsoft.com/azure/iot-hub/iot-hub-devguide-identity-registry#import-and-export-device-identities. + * @param resourceGroupName The name of the resource group that contains the IoT hub. + * @param resourceName The name of the IoT hub. + * @param importDevicesParameters The parameters that specify the import devices operation. + * @param options The options parameters. + */ + importDevices( + resourceGroupName: string, + resourceName: string, + importDevicesParameters: ImportDevicesRequest, + options?: IotHubResourceImportDevicesOptionalParams + ): Promise; +} diff --git a/sdk/iothub/arm-iothub/src/operationsInterfaces/operations.ts b/sdk/iothub/arm-iothub/src/operationsInterfaces/operations.ts new file mode 100644 index 000000000000..a16512365bfb --- /dev/null +++ b/sdk/iothub/arm-iothub/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 of the available IoT Hub REST API operations. + * @param options The options parameters. + */ + list( + options?: OperationsListOptionalParams + ): PagedAsyncIterableIterator; +} diff --git a/sdk/iothub/arm-iothub/src/operationsInterfaces/privateEndpointConnections.ts b/sdk/iothub/arm-iothub/src/operationsInterfaces/privateEndpointConnections.ts new file mode 100644 index 000000000000..016cd27cb620 --- /dev/null +++ b/sdk/iothub/arm-iothub/src/operationsInterfaces/privateEndpointConnections.ts @@ -0,0 +1,114 @@ +/* + * 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 { PollerLike, PollOperationState } from "@azure/core-lro"; +import { + PrivateEndpointConnectionsListOptionalParams, + PrivateEndpointConnectionsListResponse, + PrivateEndpointConnectionsGetOptionalParams, + PrivateEndpointConnectionsGetResponse, + PrivateEndpointConnection, + PrivateEndpointConnectionsUpdateOptionalParams, + PrivateEndpointConnectionsUpdateResponse, + PrivateEndpointConnectionsDeleteOptionalParams, + PrivateEndpointConnectionsDeleteResponse +} from "../models"; + +/** Interface representing a PrivateEndpointConnections. */ +export interface PrivateEndpointConnections { + /** + * List private endpoint connection properties + * @param resourceGroupName The name of the resource group that contains the IoT hub. + * @param resourceName The name of the IoT hub. + * @param options The options parameters. + */ + list( + resourceGroupName: string, + resourceName: string, + options?: PrivateEndpointConnectionsListOptionalParams + ): Promise; + /** + * Get private endpoint connection properties + * @param resourceGroupName The name of the resource group that contains the IoT hub. + * @param resourceName The name of the IoT hub. + * @param privateEndpointConnectionName The name of the private endpoint connection + * @param options The options parameters. + */ + get( + resourceGroupName: string, + resourceName: string, + privateEndpointConnectionName: string, + options?: PrivateEndpointConnectionsGetOptionalParams + ): Promise; + /** + * Update the status of a private endpoint connection with the specified name + * @param resourceGroupName The name of the resource group that contains the IoT hub. + * @param resourceName The name of the IoT hub. + * @param privateEndpointConnectionName The name of the private endpoint connection + * @param privateEndpointConnection The private endpoint connection with updated properties + * @param options The options parameters. + */ + beginUpdate( + resourceGroupName: string, + resourceName: string, + privateEndpointConnectionName: string, + privateEndpointConnection: PrivateEndpointConnection, + options?: PrivateEndpointConnectionsUpdateOptionalParams + ): Promise< + PollerLike< + PollOperationState, + PrivateEndpointConnectionsUpdateResponse + > + >; + /** + * Update the status of a private endpoint connection with the specified name + * @param resourceGroupName The name of the resource group that contains the IoT hub. + * @param resourceName The name of the IoT hub. + * @param privateEndpointConnectionName The name of the private endpoint connection + * @param privateEndpointConnection The private endpoint connection with updated properties + * @param options The options parameters. + */ + beginUpdateAndWait( + resourceGroupName: string, + resourceName: string, + privateEndpointConnectionName: string, + privateEndpointConnection: PrivateEndpointConnection, + options?: PrivateEndpointConnectionsUpdateOptionalParams + ): Promise; + /** + * Delete private endpoint connection with the specified name + * @param resourceGroupName The name of the resource group that contains the IoT hub. + * @param resourceName The name of the IoT hub. + * @param privateEndpointConnectionName The name of the private endpoint connection + * @param options The options parameters. + */ + beginDelete( + resourceGroupName: string, + resourceName: string, + privateEndpointConnectionName: string, + options?: PrivateEndpointConnectionsDeleteOptionalParams + ): Promise< + PollerLike< + PollOperationState, + PrivateEndpointConnectionsDeleteResponse + > + >; + /** + * Delete private endpoint connection with the specified name + * @param resourceGroupName The name of the resource group that contains the IoT hub. + * @param resourceName The name of the IoT hub. + * @param privateEndpointConnectionName The name of the private endpoint connection + * @param options The options parameters. + */ + beginDeleteAndWait( + resourceGroupName: string, + resourceName: string, + privateEndpointConnectionName: string, + options?: PrivateEndpointConnectionsDeleteOptionalParams + ): Promise; +} diff --git a/sdk/iothub/arm-iothub/src/operationsInterfaces/privateLinkResourcesOperations.ts b/sdk/iothub/arm-iothub/src/operationsInterfaces/privateLinkResourcesOperations.ts new file mode 100644 index 000000000000..49bcce9e1fea --- /dev/null +++ b/sdk/iothub/arm-iothub/src/operationsInterfaces/privateLinkResourcesOperations.ts @@ -0,0 +1,42 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +import { + PrivateLinkResourcesListOptionalParams, + PrivateLinkResourcesListResponse, + PrivateLinkResourcesGetOptionalParams, + PrivateLinkResourcesGetResponse +} from "../models"; + +/** Interface representing a PrivateLinkResourcesOperations. */ +export interface PrivateLinkResourcesOperations { + /** + * List private link resources for the given IotHub + * @param resourceGroupName The name of the resource group that contains the IoT hub. + * @param resourceName The name of the IoT hub. + * @param options The options parameters. + */ + list( + resourceGroupName: string, + resourceName: string, + options?: PrivateLinkResourcesListOptionalParams + ): Promise; + /** + * Get the specified private link resource for the given IotHub + * @param resourceGroupName The name of the resource group that contains the IoT hub. + * @param resourceName The name of the IoT hub. + * @param groupId The name of the private link resource + * @param options The options parameters. + */ + get( + resourceGroupName: string, + resourceName: string, + groupId: string, + options?: PrivateLinkResourcesGetOptionalParams + ): Promise; +} diff --git a/sdk/iothub/arm-iothub/src/operationsInterfaces/resourceProviderCommon.ts b/sdk/iothub/arm-iothub/src/operationsInterfaces/resourceProviderCommon.ts new file mode 100644 index 000000000000..e52319b98e68 --- /dev/null +++ b/sdk/iothub/arm-iothub/src/operationsInterfaces/resourceProviderCommon.ts @@ -0,0 +1,23 @@ +/* + * 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 { + ResourceProviderCommonGetSubscriptionQuotaOptionalParams, + ResourceProviderCommonGetSubscriptionQuotaResponse +} from "../models"; + +/** Interface representing a ResourceProviderCommon. */ +export interface ResourceProviderCommon { + /** + * Get the number of free and paid iot hubs in the subscription + * @param options The options parameters. + */ + getSubscriptionQuota( + options?: ResourceProviderCommonGetSubscriptionQuotaOptionalParams + ): Promise; +} diff --git a/sdk/iothub/arm-iothub/test/iothub_examples.ts b/sdk/iothub/arm-iothub/test/iothub_examples.ts new file mode 100644 index 000000000000..036604439aaf --- /dev/null +++ b/sdk/iothub/arm-iothub/test/iothub_examples.ts @@ -0,0 +1,163 @@ +/* + * 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 { IotHubClient } from "../src/iotHubClient"; + +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("Iothub test", () => { + let recorder: Recorder; + let subscriptionId: string; + let client: IotHubClient; + let location: string; + let resourceGroup: string; + let iothubName: 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 IotHubClient(credential, subscriptionId); + location = "eastus"; + resourceGroup = "myjstest"; + iothubName = "myiothubxxxxyyyjjrr"; + }); + + afterEach(async function() { + await recorder.stop(); + }); + + it("iotHubResource create test", async function() { + const res = await client.iotHubResource.beginCreateOrUpdateAndWait(resourceGroup,iothubName,{ + location: location, + tags: {key: "value1"}, + etag: "AAAAAAFD6M4=", + properties: { + ipFilterRules: [], + networkRuleSets: { + defaultAction: "Deny", + applyToBuiltInEventHubEndpoint: true, + ipRules: [ + { + filterName: "rule1", + action: "Allow", + ipMask: "131.117.159.53" + } + ] + }, + eventHubEndpoints: { + events: { + retentionTimeInDays: 1, + partitionCount: 2 + } + }, + routing: { + endpoints: { + serviceBusQueues: [], + serviceBusTopics: [], + eventHubs: [], + storageContainers: [] + }, + routes: [], + }, + storageEndpoints: { + $default: { + sasTtlAsIso8601: "PT1H", + connectionString: "", + containerName: "" + } + }, + messagingEndpoints: { + fileNotifications: { + lockDurationAsIso8601: "PT1M", + ttlAsIso8601: "PT1H", + maxDeliveryCount: 10 + } + }, + enableFileUploadNotifications: false, + cloudToDevice: { + maxDeliveryCount: 10, + defaultTtlAsIso8601: "PT1H", + feedback: { + lockDurationAsIso8601: "PT1M", + ttlAsIso8601: "PT1H", + maxDeliveryCount: 10 + } + }, + features: "None", + minTlsVersion: "1.2" + }, + sku: { + name: "S1", + capacity: 1 + } + },testPollingOptions); + assert.equal(res.name,iothubName); + }); + + it("iotHubResource get test", async function() { + const res = await client.iotHubResource.get(resourceGroup,iothubName); + assert.equal(res.name,iothubName); + }); + + it("iotHubResource list test", async function() { + const resArray = new Array(); + for await (let item of client.iotHubResource.listByResourceGroup(resourceGroup)){ + resArray.push(item); + } + assert.equal(resArray.length,1); + }); + + it("iotHubResource update test", async function() { + const res = await client.iotHubResource.beginUpdateAndWait(resourceGroup,iothubName,{tags: {tag1 : "value1"}},testPollingOptions); + assert.equal(res.name,iothubName); + }); + + it("iotHubResource delete test", async function() { + const res = await client.iotHubResource.beginDeleteAndWait(resourceGroup,iothubName,testPollingOptions); + const resArray = new Array(); + for await (let item of client.iotHubResource.listByResourceGroup(resourceGroup)){ + resArray.push(item); + } + assert.equal(resArray.length,0); + }); +}); diff --git a/sdk/iothub/arm-iothub/tsconfig.json b/sdk/iothub/arm-iothub/tsconfig.json index 422b584abd5e..6e3251194117 100644 --- a/sdk/iothub/arm-iothub/tsconfig.json +++ b/sdk/iothub/arm-iothub/tsconfig.json @@ -3,7 +3,7 @@ "module": "es6", "moduleResolution": "node", "strict": true, - "target": "es5", + "target": "es6", "sourceMap": true, "declarationMap": true, "esModuleInterop": true, @@ -11,9 +11,9 @@ "forceConsistentCasingInFileNames": true, "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/iothub/ci.yml b/sdk/iothub/ci.yml new file mode 100644 index 000000000000..fdac9f8e30ce --- /dev/null +++ b/sdk/iothub/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/iothub/ + +pr: + branches: + include: + - main + - release/* + - hotfix/* + paths: + include: + - sdk/iothub/ + +extends: + template: ../../eng/pipelines/templates/stages/archetype-sdk-client.yml + parameters: + ServiceDirectory: iothub + Artifacts: + - name: azure-arm-iothub + safeName: azurearmiothub + \ No newline at end of file