diff --git a/common/config/rush/pnpm-lock.yaml b/common/config/rush/pnpm-lock.yaml index d154fecd952c..d58eb67f1035 100644 --- a/common/config/rush/pnpm-lock.yaml +++ b/common/config/rush/pnpm-lock.yaml @@ -74,6 +74,7 @@ specifiers: '@rush-temp/arm-imagebuilder': file:./projects/arm-imagebuilder.tgz '@rush-temp/arm-iotcentral': file:./projects/arm-iotcentral.tgz '@rush-temp/arm-iothub': file:./projects/arm-iothub.tgz + '@rush-temp/arm-iothub-profile-2020-09-01-hybrid': file:./projects/arm-iothub-profile-2020-09-01-hybrid.tgz '@rush-temp/arm-keyvault': file:./projects/arm-keyvault.tgz '@rush-temp/arm-keyvault-profile-2020-09-01-hybrid': file:./projects/arm-keyvault-profile-2020-09-01-hybrid.tgz '@rush-temp/arm-kubernetesconfiguration': file:./projects/arm-kubernetesconfiguration.tgz @@ -342,6 +343,7 @@ dependencies: '@rush-temp/arm-imagebuilder': file:projects/arm-imagebuilder.tgz '@rush-temp/arm-iotcentral': file:projects/arm-iotcentral.tgz '@rush-temp/arm-iothub': file:projects/arm-iothub.tgz + '@rush-temp/arm-iothub-profile-2020-09-01-hybrid': file:projects/arm-iothub-profile-2020-09-01-hybrid.tgz '@rush-temp/arm-keyvault': file:projects/arm-keyvault.tgz '@rush-temp/arm-keyvault-profile-2020-09-01-hybrid': file:projects/arm-keyvault-profile-2020-09-01-hybrid.tgz '@rush-temp/arm-kubernetesconfiguration': file:projects/arm-kubernetesconfiguration.tgz @@ -10804,6 +10806,34 @@ packages: - supports-color dev: false + file:projects/arm-iothub-profile-2020-09-01-hybrid.tgz: + resolution: {integrity: sha512-AMN0ZE/GpgBH4jY4iQqYAC3Cn03GCaDUuCwO/Pgw6YfnkNoZa6n9qKzxbefzLTlkCkIUac+iU76JFuH1/Lb3WQ==, tarball: file:projects/arm-iothub-profile-2020-09-01-hybrid.tgz} + name: '@rush-temp/arm-iothub-profile-2020-09-01-hybrid' + version: 0.0.0 + dependencies: + '@azure-tools/test-recorder': 1.0.2 + '@azure/identity': 2.0.4 + '@microsoft/api-extractor': 7.19.4 + '@rollup/plugin-commonjs': 21.0.2_rollup@2.70.0 + '@rollup/plugin-json': 4.1.0_rollup@2.70.0 + '@rollup/plugin-multi-entry': 4.1.0_rollup@2.70.0 + '@rollup/plugin-node-resolve': 13.1.3_rollup@2.70.0 + cross-env: 7.0.3 + mkdirp: 1.0.4 + mocha: 7.2.0 + rimraf: 3.0.2 + rollup: 2.70.0 + rollup-plugin-sourcemaps: 0.6.3_rollup@2.70.0 + tslib: 2.3.1 + typescript: 4.2.4 + uglify-js: 3.15.2 + transitivePeerDependencies: + - '@types/node' + - debug + - encoding + - supports-color + dev: false + file:projects/arm-iothub.tgz: resolution: {integrity: sha512-NankxyxL83ktVgXV5jQkGZB46AkyIkYtaWXLYw30OkpTKrcCaWzRu6cqKHIe5g2YJsyz6CYxR2inbyEvlGwbXw==, tarball: file:projects/arm-iothub.tgz} name: '@rush-temp/arm-iothub' diff --git a/eng/ignore-links.txt b/eng/ignore-links.txt index 6dbd85f54423..2e6bdfaa5182 100644 --- a/eng/ignore-links.txt +++ b/eng/ignore-links.txt @@ -23,4 +23,5 @@ https://docs.microsoft.com/javascript/api/@azure/arm-commerce-profile-2020-09-01 https://docs.microsoft.com/javascript/api/@azure/arm-compute-profile-2020-09-01-hybrid https://docs.microsoft.com/javascript/api/@azure/arm-eventhub-profile-2020-09-01-hybrid?view=azure-node-preview https://docs.microsoft.com/javascript/api/@azure/arm-authorization-profile-2020-09-01-hybrid +https://docs.microsoft.com/javascript/api/@azure/arm-iothub-profile-2020-09-01-hybrid?view=azure-node-preview https://docs.microsoft.com/javascript/api/@azure/arm-monitor-profile-2020-09-01-hybrid?view=azure-node-preview diff --git a/rush.json b/rush.json index 152eb3e6d6ef..e10d5aa37e79 100644 --- a/rush.json +++ b/rush.json @@ -1649,6 +1649,11 @@ "packageName": "@azure/arm-monitor-profile-2020-09-01-hybrid", "projectFolder": "sdk/monitor/arm-monitor-profile-2020-09-01-hybrid", "versionPolicyName": "management" + }, + { + "packageName": "@azure/arm-iothub-profile-2020-09-01-hybrid", + "projectFolder": "sdk/iothub/arm-iothub-profile-2020-09-01-hybrid", + "versionPolicyName": "management" } ] -} \ No newline at end of file +} diff --git a/sdk/iothub/arm-iothub-profile-2020-09-01-hybrid/CHANGELOG.md b/sdk/iothub/arm-iothub-profile-2020-09-01-hybrid/CHANGELOG.md new file mode 100644 index 000000000000..40b152198767 --- /dev/null +++ b/sdk/iothub/arm-iothub-profile-2020-09-01-hybrid/CHANGELOG.md @@ -0,0 +1,11 @@ +# Release History + +## 2.0.0 (2022-03-11) + +The package of @azure/arm-iothub-profile-2020-09-01-hybrid is using our next generation design principles since version 2.0.0-beta.1, 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-profile-2020-09-01-hybrid/LICENSE b/sdk/iothub/arm-iothub-profile-2020-09-01-hybrid/LICENSE new file mode 100644 index 000000000000..5d1d36e0af80 --- /dev/null +++ b/sdk/iothub/arm-iothub-profile-2020-09-01-hybrid/LICENSE @@ -0,0 +1,21 @@ +The MIT License (MIT) + +Copyright (c) 2022 Microsoft + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. \ No newline at end of file diff --git a/sdk/iothub/arm-iothub-profile-2020-09-01-hybrid/README.md b/sdk/iothub/arm-iothub-profile-2020-09-01-hybrid/README.md index e6a7e35b57c7..1bb74cf632bf 100644 --- a/sdk/iothub/arm-iothub-profile-2020-09-01-hybrid/README.md +++ b/sdk/iothub/arm-iothub-profile-2020-09-01-hybrid/README.md @@ -1,99 +1,109 @@ -## 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-profile-2020-09-01-hybrid) | +[Package (NPM)](https://www.npmjs.com/package/@azure/arm-iothub-profile-2020-09-01-hybrid) | +[API reference documentation](https://docs.microsoft.com/javascript/api/@azure/arm-iothub-profile-2020-09-01-hybrid?view=azure-node-preview) | +[Samples](https://github.com/Azure-Samples/azure-samples-js-management) + +## Getting started ### Currently supported environments - [LTS versions of Node.js](https://nodejs.org/about/releases/) -- Latest versions of Safari, Chrome, Edge, and Firefox. +- Latest versions of Safari, Chrome, Edge and Firefox. + +See our [support policy](https://github.com/Azure/azure-sdk-for-js/blob/main/SUPPORT.md) for more details. + +### Prerequisites + +- An [Azure subscription][azure_sub]. + +### Install the `@azure/arm-iothub-profile-2020-09-01-hybrid` package -### How to Install +Install the Azure iotHub client library for JavaScript with `npm`: ```bash npm install @azure/arm-iothub-profile-2020-09-01-hybrid ``` -### How to use +### Create and authenticate a `IotHubClient` -#### nodejs - Authentication, 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). + +To use the [DefaultAzureCredential][defaultazurecredential] provider shown below, or other credential providers provided with the Azure SDK, please install the `@azure/identity` package: -- Please install minimum version of `"@azure/ms-rest-nodeauth": "^3.0.0"`. ```bash -npm install @azure/ms-rest-nodeauth@"^3.0.0" +npm install @azure/identity ``` -##### Sample code - -```typescript -import * as msRest from "@azure/ms-rest-js"; -import * as msRestAzure from "@azure/ms-rest-azure-js"; -import * as msRestNodeAuth from "@azure/ms-rest-nodeauth"; -import { IotHubClient, IotHubModels, IotHubMappers } from "@azure/arm-iothub-profile-2020-09-01-hybrid"; -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); -}); -``` +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`. -#### browser - Authentication, client creation and list operations as an example written in JavaScript. +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). -##### Install @azure/ms-rest-browserauth +```javascript +const { IotHubClient } = require("@azure/arm-iothub-profile-2020-09-01-hybrid"); +const { DefaultAzureCredential } = require("@azure/identity"); +// For client-side applications running in the browser, use InteractiveBrowserCredential instead of DefaultAzureCredential. See https://aka.ms/azsdk/js/identity/examples for more details. -```bash -npm install @azure/ms-rest-browserauth +const subscriptionId = "00000000-0000-0000-0000-000000000000"; +const client = new IotHubClient(new DefaultAzureCredential(), subscriptionId); + +// For client-side applications running in the browser, use this code instead: +// const credential = new InteractiveBrowserCredential({ +// tenantId: "", +// clientId: "" +// }); +// const client = new IotHubClient(credential, subscriptionId); ``` -##### 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-profile-2020-09-01-hybrid sample - - - - - - - - + +### JavaScript Bundle +To use this client library in the browser, first you need to use a bundler. For details on how to do this, please refer to our [bundling documentation](https://aka.ms/AzureSDKBundling). + +## Key concepts + +### 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. + +## 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-profile-2020-09-01-hybrid%2FREADME.png) -![Impressions](https://azure-sdk-impressions.azurewebsites.net/api/impressions/azure-sdk-for-js/sdk/iothub/arm-iothub-profile-2020-09-01-hybrid/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-profile-2020-09-01-hybrid/_meta.json b/sdk/iothub/arm-iothub-profile-2020-09-01-hybrid/_meta.json new file mode 100644 index 000000000000..47ba2784766e --- /dev/null +++ b/sdk/iothub/arm-iothub-profile-2020-09-01-hybrid/_meta.json @@ -0,0 +1,8 @@ +{ + "commit": "1067b78669466324a1a2666adf053433c61e7f77", + "readme": "specification/iothub/resource-manager/readme.md", + "autorest_command": "autorest --version=3.7.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-beta.16 --tag=profile-hybrid-2020-09-01 --profile-content=profile-hybrid-2020-09-01", + "repository_url": "https://github.com/Azure/azure-rest-api-specs.git", + "release_tool": "@azure-tools/js-sdk-release-tools@2.1.1", + "use": "@autorest/typescript@6.0.0-beta.16" +} \ No newline at end of file diff --git a/sdk/iothub/arm-iothub-profile-2020-09-01-hybrid/api-extractor.json b/sdk/iothub/arm-iothub-profile-2020-09-01-hybrid/api-extractor.json new file mode 100644 index 000000000000..ef9778d76ee7 --- /dev/null +++ b/sdk/iothub/arm-iothub-profile-2020-09-01-hybrid/api-extractor.json @@ -0,0 +1,31 @@ +{ + "$schema": "https://developer.microsoft.com/json-schemas/api-extractor/v7/api-extractor.schema.json", + "mainEntryPointFilePath": "./dist-esm/src/index.d.ts", + "docModel": { + "enabled": true + }, + "apiReport": { + "enabled": true, + "reportFolder": "./review" + }, + "dtsRollup": { + "enabled": true, + "untrimmedFilePath": "", + "publicTrimmedFilePath": "./types/arm-iothub-profile-2020-09-01-hybrid.d.ts" + }, + "messages": { + "tsdocMessageReporting": { + "default": { + "logLevel": "none" + } + }, + "extractorMessageReporting": { + "ae-missing-release-tag": { + "logLevel": "none" + }, + "ae-unresolved-link": { + "logLevel": "none" + } + } + } +} \ No newline at end of file diff --git a/sdk/iothub/arm-iothub-profile-2020-09-01-hybrid/package.json b/sdk/iothub/arm-iothub-profile-2020-09-01-hybrid/package.json index b786b8f407a3..70b9bd23d825 100644 --- a/sdk/iothub/arm-iothub-profile-2020-09-01-hybrid/package.json +++ b/sdk/iothub/arm-iothub-profile-2020-09-01-hybrid/package.json @@ -1,12 +1,20 @@ { "name": "@azure/arm-iothub-profile-2020-09-01-hybrid", + "sdk-type": "mgmt", "author": "Microsoft Corporation", - "description": "IotHubClient Library with typescript type definitions for node.js and browser.", - "version": "1.0.0", + "description": "A generated SDK for IotHubClient.", + "version": "2.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", @@ -16,15 +24,25 @@ "isomorphic" ], "license": "MIT", - "main": "./dist/arm-iothub-profile-2020-09-01-hybrid.js", - "module": "./esm/iotHubClient.js", - "types": "./esm/iotHubClient.d.ts", + "main": "./dist/index.js", + "module": "./dist-esm/src/index.js", + "types": "./types/arm-iothub-profile-2020-09-01-hybrid.d.ts", "devDependencies": { - "typescript": "^3.5.3", - "rollup": "^1.18.0", - "rollup-plugin-node-resolve": "^5.2.0", - "rollup-plugin-sourcemaps": "^0.4.2", - "uglify-js": "^3.6.0" + "@microsoft/api-extractor": "^7.18.11", + "@rollup/plugin-commonjs": "^21.0.1", + "@rollup/plugin-json": "^4.1.0", + "@rollup/plugin-multi-entry": "^4.1.0", + "@rollup/plugin-node-resolve": "^13.1.3", + "mkdirp": "^1.0.4", + "rollup": "^2.66.1", + "rollup-plugin-sourcemaps": "^0.6.3", + "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-profile-2020-09-01-hybrid", "repository": { @@ -39,20 +57,54 @@ "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-profile-2020-09-01-hybrid.js.map'\" -o ./dist/arm-iothub-profile-2020-09-01-hybrid.min.js ./dist/arm-iothub-profile-2020-09-01-hybrid.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, + "//metadata": { + "constantPaths": [ + { + "path": "src/iotHubClient.ts", + "prefix": "packageDetails" + } + ] + }, "autoPublish": true } diff --git a/sdk/iothub/arm-iothub-profile-2020-09-01-hybrid/recordings/node/my_test/recording_sample_test.js b/sdk/iothub/arm-iothub-profile-2020-09-01-hybrid/recordings/node/my_test/recording_sample_test.js new file mode 100644 index 000000000000..0f6ecb857acf --- /dev/null +++ b/sdk/iothub/arm-iothub-profile-2020-09-01-hybrid/recordings/node/my_test/recording_sample_test.js @@ -0,0 +1,5 @@ +let nock = require('nock'); + +module.exports.hash = "7a6be38bb8cb644d64b4094802301751"; + +module.exports.testInfo = {"uniqueName":{},"newDate":{}} diff --git a/sdk/iothub/arm-iothub-profile-2020-09-01-hybrid/review/arm-iothub-profile-2020-09-01-hybrid.api.md b/sdk/iothub/arm-iothub-profile-2020-09-01-hybrid/review/arm-iothub-profile-2020-09-01-hybrid.api.md new file mode 100644 index 000000000000..a5a8b90ef3f7 --- /dev/null +++ b/sdk/iothub/arm-iothub-profile-2020-09-01-hybrid/review/arm-iothub-profile-2020-09-01-hybrid.api.md @@ -0,0 +1,1058 @@ +## API Report File for "@azure/arm-iothub-profile-2020-09-01-hybrid" + +> 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 +export type Capabilities = string; + +// @public +export interface CertificateBodyDescription { + certificate?: string; +} + +// @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; + readonly 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: CertificateBodyDescription, 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 interface EndpointHealthData { + endpointId?: string; + healthStatus?: EndpointHealthStatus; +} + +// @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 EventHubConsumerGroupInfo { + readonly etag?: string; + readonly id?: string; + readonly name?: string; + properties?: { + [propertyName: string]: string; + }; + readonly type?: 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 { + excludeKeys: boolean; + exportBlobContainerUri: string; +} + +// @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 ImportDevicesRequest { + inputBlobContainerUri: string; + outputBlobContainerUri: 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) + 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; +}; + +// @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 { + authorizationPolicies?: SharedAccessSignatureAuthorizationRule[]; + cloudToDevice?: CloudToDeviceProperties; + comments?: string; + deviceStreams?: IotHubPropertiesDeviceStreams; + enableFileUploadNotifications?: boolean; + eventHubEndpoints?: { + [propertyName: string]: EventHubProperties; + }; + features?: Capabilities; + readonly hostName?: string; + ipFilterRules?: IpFilterRule[]; + readonly locations?: IotHubLocationDescription[]; + messagingEndpoints?: { + [propertyName: string]: MessagingEndpointProperties; + }; + readonly provisioningState?: string; + routing?: RoutingProperties; + readonly state?: string; + storageEndpoints?: { + [propertyName: string]: StorageEndpointProperties; + }; +} + +// @public +export interface IotHubPropertiesDeviceStreams { + streamingEndpoints?: string[]; +} + +// @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, 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 KnownCapabilities { + // (undocumented) + DeviceManagement = "DeviceManagement", + // (undocumented) + None = "None" +} + +// @public +export enum KnownEndpointHealthStatus { + // (undocumented) + Dead = "dead", + // (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 KnownRouteErrorSeverity { + // (undocumented) + Error = "error", + // (undocumented) + Warning = "warning" +} + +// @public +export enum KnownRoutingSource { + // (undocumented) + DeviceJobLifecycleEvents = "DeviceJobLifecycleEvents", + // (undocumented) + DeviceLifecycleEvents = "DeviceLifecycleEvents", + // (undocumented) + DeviceMessages = "DeviceMessages", + // (undocumented) + DigitalTwinChangeEvents = "DigitalTwinChangeEvents", + // (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 MatchedRoute { + properties?: RouteProperties; +} + +// @public +export interface MessagingEndpointProperties { + lockDurationAsIso8601?: string; + maxDeliveryCount?: number; + ttlAsIso8601?: string; +} + +// @public +export interface Name { + localizedValue?: string; + value?: string; +} + +// @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 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 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 { + connectionString: string; + 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 { + connectionString: string; + name: string; + resourceGroup?: string; + subscriptionId?: string; +} + +// @public +export interface RoutingServiceBusTopicEndpointProperties { + connectionString: string; + name: string; + resourceGroup?: string; + subscriptionId?: string; +} + +// @public +export type RoutingSource = string; + +// @public +export interface RoutingStorageContainerProperties { + batchFrequencyInSeconds?: number; + connectionString: string; + containerName: string; + encoding?: RoutingStorageContainerPropertiesEncoding; + fileNameFormat?: string; + 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 { + connectionString: string; + containerName: string; + 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-profile-2020-09-01-hybrid/rollup.config.js b/sdk/iothub/arm-iothub-profile-2020-09-01-hybrid/rollup.config.js index 774e362b4f7b..3f89d7309da5 100644 --- a/sdk/iothub/arm-iothub-profile-2020-09-01-hybrid/rollup.config.js +++ b/sdk/iothub/arm-iothub-profile-2020-09-01-hybrid/rollup.config.js @@ -1,37 +1,122 @@ -import rollup from "rollup"; -import nodeResolve from "rollup-plugin-node-resolve"; +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +import nodeResolve from "@rollup/plugin-node-resolve"; +import cjs from "@rollup/plugin-commonjs"; import sourcemaps from "rollup-plugin-sourcemaps"; +import multiEntry from "@rollup/plugin-multi-entry"; +import json from "@rollup/plugin-json"; + +import nodeBuiltins from "builtin-modules"; + +// #region Warning Handler + +/** + * A function that can determine whether a rollup warning should be ignored. If + * the function returns `true`, then the warning will not be displayed. + */ + +function ignoreNiseSinonEval(warning) { + return ( + warning.code === "EVAL" && + warning.id && + (warning.id.includes("node_modules/nise") || + warning.id.includes("node_modules/sinon")) === true + ); +} + +function ignoreChaiCircularDependency(warning) { + return ( + warning.code === "CIRCULAR_DEPENDENCY" && + warning.importer && warning.importer.includes("node_modules/chai") === true + ); +} + +const warningInhibitors = [ignoreChaiCircularDependency, ignoreNiseSinonEval]; /** - * @type {rollup.RollupFileOptions} + * Construct a warning handler for the shared rollup configuration + * that ignores certain warnings that are not relevant to testing. */ -const config = { - input: "./esm/iotHubClient.js", - external: [ - "@azure/ms-rest-js", - "@azure/ms-rest-azure-js" - ], - output: { - file: "./dist/arm-iothub-profile-2020-09-01-hybrid.js", - format: "umd", - name: "Azure.ArmIothubProfile20200901Hybrid", - sourcemap: true, - globals: { - "@azure/ms-rest-js": "msRest", - "@azure/ms-rest-azure-js": "msRestAzure" +function makeOnWarnForTesting() { + return (warning, warn) => { + // If every inhibitor returns false (i.e. no inhibitors), then show the warning + if (warningInhibitors.every((inhib) => !inhib(warning))) { + warn(warning); + } + }; +} + +// #endregion + +function makeBrowserTestConfig() { + const config = { + input: { + include: ["dist-esm/test/**/*.spec.js"], + exclude: ["dist-esm/test/**/node/**"] }, - banner: `/* - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for license information. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */` - }, - plugins: [ - nodeResolve({ mainFields: ['module', 'main'] }), - sourcemaps() - ] + output: { + file: `dist-test/index.browser.js`, + format: "umd", + sourcemap: true + }, + preserveSymlinks: false, + plugins: [ + multiEntry({ exports: false }), + nodeResolve({ + mainFields: ["module", "browser"] + }), + cjs(), + json(), + sourcemaps() + //viz({ filename: "dist-test/browser-stats.html", sourcemap: true }) + ], + onwarn: makeOnWarnForTesting(), + // Disable tree-shaking of test code. In rollup-plugin-node-resolve@5.0.0, + // rollup started respecting the "sideEffects" field in package.json. Since + // our package.json sets "sideEffects=false", this also applies to test + // code, which causes all tests to be removed by tree-shaking. + treeshake: false + }; + + return config; +} + +const defaultConfigurationOptions = { + disableBrowserBundle: false }; -export 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()] + }; + + const config = [baseConfig]; + + if (!options.disableBrowserBundle) { + config.push(makeBrowserTestConfig()); + } + + return config; +} + +export default makeConfig(require("./package.json")); diff --git a/sdk/iothub/arm-iothub-profile-2020-09-01-hybrid/src/index.ts b/sdk/iothub/arm-iothub-profile-2020-09-01-hybrid/src/index.ts new file mode 100644 index 000000000000..21c1f0032156 --- /dev/null +++ b/sdk/iothub/arm-iothub-profile-2020-09-01-hybrid/src/index.ts @@ -0,0 +1,12 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +/// +export * from "./models"; +export { IotHubClient } from "./iotHubClient"; +export * from "./operationsInterfaces"; diff --git a/sdk/iothub/arm-iothub-profile-2020-09-01-hybrid/src/iotHubClient.ts b/sdk/iothub/arm-iothub-profile-2020-09-01-hybrid/src/iotHubClient.ts index acbec4a87d10..5d0b8e9ee227 100644 --- a/sdk/iothub/arm-iothub-profile-2020-09-01-hybrid/src/iotHubClient.ts +++ b/sdk/iothub/arm-iothub-profile-2020-09-01-hybrid/src/iotHubClient.ts @@ -1,50 +1,95 @@ /* - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for - * license information. + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. * * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is - * regenerated. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. */ -import * as msRest from "@azure/ms-rest-js"; -import * as Models from "./models"; -import * as Mappers from "./models/mappers"; -import * as operations from "./operations"; -import { IotHubClientContext } from "./iotHubClientContext"; +import * as coreClient from "@azure/core-client"; +import * as coreAuth from "@azure/core-auth"; +import { + OperationsImpl, + IotHubResourceImpl, + ResourceProviderCommonImpl, + CertificatesImpl, + IotHubImpl +} from "./operations"; +import { + Operations, + IotHubResource, + ResourceProviderCommon, + Certificates, + IotHub +} from "./operationsInterfaces"; +import { IotHubClientOptionalParams } from "./models"; - -class IotHubClient extends IotHubClientContext { - // Operation groups - operations: operations.Operations; - iotHubResource: operations.IotHubResource; - resourceProviderCommon: operations.ResourceProviderCommon; - certificates: operations.Certificates; - iotHub: operations.IotHub; +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, subscriptionId: string, options?: Models.IotHubClientOptions) { - 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); - } -} + constructor( + credentials: coreAuth.TokenCredential, + subscriptionId: string, + options?: IotHubClientOptionalParams + ) { + 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-profile-2020-09-01-hybrid/2.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 || "2019-07-01-preview"; + 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); + } + + operations: Operations; + iotHubResource: IotHubResource; + resourceProviderCommon: ResourceProviderCommon; + certificates: Certificates; + iotHub: IotHub; +} diff --git a/sdk/iothub/arm-iothub-profile-2020-09-01-hybrid/src/iotHubClientContext.ts b/sdk/iothub/arm-iothub-profile-2020-09-01-hybrid/src/iotHubClientContext.ts deleted file mode 100644 index 45b7d0e435bb..000000000000 --- a/sdk/iothub/arm-iothub-profile-2020-09-01-hybrid/src/iotHubClientContext.ts +++ /dev/null @@ -1,62 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for - * license information. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is - * regenerated. - */ - -import * as Models from "./models"; -import * as msRest from "@azure/ms-rest-js"; -import * as msRestAzure from "@azure/ms-rest-azure-js"; - -const packageName = "@azure/arm-iothub-profile-2020-09-01-hybrid"; -const packageVersion = "1.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 = '2019-07-01-preview'; - 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-profile-2020-09-01-hybrid/src/lroImpl.ts b/sdk/iothub/arm-iothub-profile-2020-09-01-hybrid/src/lroImpl.ts new file mode 100644 index 000000000000..518d5f053b4e --- /dev/null +++ b/sdk/iothub/arm-iothub-profile-2020-09-01-hybrid/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-profile-2020-09-01-hybrid/src/models/certificatesMappers.ts b/sdk/iothub/arm-iothub-profile-2020-09-01-hybrid/src/models/certificatesMappers.ts deleted file mode 100644 index c971b904ae91..000000000000 --- a/sdk/iothub/arm-iothub-profile-2020-09-01-hybrid/src/models/certificatesMappers.ts +++ /dev/null @@ -1,42 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for license information. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -export { - BaseResource, - CertificateBodyDescription, - CertificateDescription, - CertificateListDescription, - CertificateProperties, - CertificatePropertiesWithNonce, - CertificateVerificationDescription, - CertificateWithNonceDescription, - CloudToDeviceProperties, - EnrichmentProperties, - ErrorDetails, - EventHubConsumerGroupInfo, - EventHubProperties, - FallbackRouteProperties, - FeedbackProperties, - IotHubDescription, - IotHubLocationDescription, - IotHubProperties, - IotHubPropertiesDeviceStreams, - IotHubSkuInfo, - IpFilterRule, - MessagingEndpointProperties, - Resource, - RouteProperties, - RoutingEndpoints, - RoutingEventHubProperties, - RoutingProperties, - RoutingServiceBusQueueEndpointProperties, - RoutingServiceBusTopicEndpointProperties, - RoutingStorageContainerProperties, - SharedAccessSignatureAuthorizationRule, - StorageEndpointProperties -} from "../models/mappers"; diff --git a/sdk/iothub/arm-iothub-profile-2020-09-01-hybrid/src/models/index.ts b/sdk/iothub/arm-iothub-profile-2020-09-01-hybrid/src/models/index.ts index af814502c149..a6a197c15de8 100644 --- a/sdk/iothub/arm-iothub-profile-2020-09-01-hybrid/src/models/index.ts +++ b/sdk/iothub/arm-iothub-profile-2020-09-01-hybrid/src/models/index.ts @@ -1,2423 +1,1483 @@ /* - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for license information. + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. * * Code generated by Microsoft (R) AutoRest Code Generator. * Changes may cause incorrect behavior and will be lost if the code is regenerated. */ -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[]; + /** The IP filter rules. */ + ipFilterRules?: IpFilterRule[]; /** - * 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 device streams properties of iothub. */ + deviceStreams?: IotHubPropertiesDeviceStreams; + /** 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. - */ + /** A string that contains the IP address range in CIDR notation for the rule. */ ipMask: string; } -/** - * The properties of the provisioned Event Hub-compatible endpoint used by the IoT hub. - */ +/** 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 related to service bus queue endpoint types. - */ +/** 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/iotmsgenrich */ + enrichments?: EnrichmentProperties[]; +} + +/** 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 { - /** - * The connection string of the service bus queue endpoint. - */ + /** The connection string of the service bus queue endpoint. */ connectionString: string; - /** - * 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 related to service bus topic endpoint types. */ export interface RoutingServiceBusTopicEndpointProperties { - /** - * The connection string of the service bus topic endpoint. - */ + /** The connection string of the service bus topic endpoint. */ connectionString: string; - /** - * 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 { - /** - * The connection string of the event hub endpoint. - */ + /** The connection string of the event hub endpoint. */ connectionString: string; - /** - * 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 { - /** - * The connection string of the storage account. - */ + /** The connection string of the storage account. */ connectionString: string; - /** - * 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', 'DigitalTwinChangeEvents' - */ + /** 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/iotmsgenrich - */ - 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; } -/** - * 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. - */ - 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. - */ - 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. - */ - maxDeliveryCount?: number; -} - -/** - * 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. 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-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-file-upload. */ 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. See: https://docs.microsoft.com/azure/iot-hub/iot-hub-devguide-file-upload. */ maxDeliveryCount?: number; } -/** - * The IoT hub cloud-to-device messaging properties. - */ +/** 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. - */ + /** 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. - */ + /** 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 device streams properties of iothub. - */ +/** 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. */ + 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. */ + 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. */ + maxDeliveryCount?: number; +} + +/** The device streams properties of iothub. */ export interface IotHubPropertiesDeviceStreams { - /** - * List of Device Streams Endpoints. - */ + /** List of Device Streams Endpoints. */ streamingEndpoints?: string[]; } -/** - * Public representation of one of the locations where a resource is provisioned. - */ +/** Public representation of one of the locations where a resource is provisioned. */ export interface IotHubLocationDescription { - /** - * Azure Geo Regions - */ + /** Azure Geo Regions */ location?: string; + /** Specific Role assigned to this location */ + role?: IotHubReplicaRoleType; +} + +/** Information about the SKU of the IoT hub. */ +export interface IotHubSkuInfo { + /** The name of the SKU. */ + name: IotHubSku; /** - * Specific Role assigned to this location. Possible values include: 'primary', 'secondary' + * The billing tier for the IoT hub. + * NOTE: This property will not be serialized. It can only be populated by the server. */ - role?: IotHubReplicaRoleType; + 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; } -/** - * The properties of an IoT hub. - */ -export interface IotHubProperties { +/** 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; /** - * The IP filter rules. + * The resource name. + * NOTE: This property will not be serialized. It can only be populated by the server. */ - ipFilterRules?: IpFilterRule[]; + readonly name?: string; /** - * The provisioning state. - * **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 provisioningState?: string; + 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[]; /** - * The hub state. - * **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 state?: string; + readonly nextLink?: string; +} + +/** Identity registry statistics. */ +export interface RegistryStatistics { /** - * The name of the host. - * **NOTE: This property will not be serialized. It can only be populated by the server.** + * 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 hostName?: string; + readonly totalDeviceCount?: number; /** - * 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. + * The count of enabled devices in the identity registry. + * NOTE: This property will not be serialized. It can only be populated by the server. */ - eventHubEndpoints?: { [propertyName: string]: EventHubProperties }; - routing?: RoutingProperties; + readonly enabledDeviceCount?: number; /** - * 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. + * The count of disabled devices in the identity registry. + * NOTE: This property will not be serialized. It can only be populated by the server. */ - storageEndpoints?: { [propertyName: string]: StorageEndpointProperties }; + readonly disabledDeviceCount?: number; +} + +/** The JSON-serialized array of IotHubSkuDescription objects with a next link. */ +export interface IotHubSkuDescriptionListResult { + /** The array of IotHubSkuDescription. */ + value?: IotHubSkuDescription[]; /** - * The messaging endpoint properties for the file upload notification queue. + * The next link. + * NOTE: This property will not be serialized. It can only be populated by the server. */ - messagingEndpoints?: { [propertyName: string]: MessagingEndpointProperties }; + readonly nextLink?: string; +} + +/** SKU properties. */ +export interface IotHubSkuDescription { /** - * If True, file upload notifications are enabled. + * The type of the resource. + * NOTE: This property will not be serialized. It can only be populated by the server. */ - enableFileUploadNotifications?: boolean; - cloudToDevice?: CloudToDeviceProperties; + readonly resourceType?: string; + /** The type of the resource. */ + sku: IotHubSkuInfo; + /** IotHub capacity */ + capacity: IotHubCapacity; +} + +/** IoT Hub capacity information. */ +export interface IotHubCapacity { /** - * IoT hub comments. + * The minimum number of units. + * NOTE: This property will not be serialized. It can only be populated by the server. */ - comments?: string; + readonly minimum?: number; /** - * The device streams properties of iothub. + * The maximum number of units. + * NOTE: This property will not be serialized. It can only be populated by the server. */ - deviceStreams?: IotHubPropertiesDeviceStreams; + readonly maximum?: number; /** - * The capabilities and features enabled for the IoT hub. Possible values include: 'None', - * 'DeviceManagement' + * The default number of units. + * NOTE: This property will not be serialized. It can only be populated by the server. */ - features?: Capabilities; + readonly default?: number; /** - * Primary and secondary location for iot hub - * **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 locations?: IotHubLocationDescription[]; + readonly scaleType?: IotHubScaleType; } -/** - * 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 Event Hub-compatible consumer group names with a next link. */ +export interface EventHubConsumerGroupsListResult { + /** List of consumer groups objects */ + value?: EventHubConsumerGroupInfo[]; /** - * 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 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]: string }; /** - * 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. + * The etag. + * NOTE: This property will not be serialized. It can only be populated by the server. */ - location: string; + readonly etag?: string; +} + +/** The JSON-serialized array of JobResponse objects with a next link. */ +export interface JobResponseListResult { + /** The array of JobResponse objects. */ + value?: JobResponse[]; /** - * The resource tags. + * The next link. + * NOTE: This property will not be serialized. It can only be populated by the server. */ - tags?: { [propertyName: string]: string }; + readonly nextLink?: string; } -/** - * The description of the IoT hub. - */ -export interface IotHubDescription extends Resource { +/** The properties of the Job Response object. */ +export interface JobResponse { /** - * 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. + * The job identifier. + * NOTE: This property will not be serialized. It can only be populated by the server. */ - etag?: string; + readonly jobId?: string; /** - * IotHub properties + * The start time of the job. + * NOTE: This property will not be serialized. It can only be populated by the server. */ - properties?: IotHubProperties; + readonly startTimeUtc?: Date; /** - * IotHub SKU info + * The time the job stopped processing. + * NOTE: This property will not be serialized. It can only be populated by the server. */ - sku: IotHubSkuInfo; -} - -/** - * The object that represents the operation. - */ -export interface OperationDisplay { + readonly endTimeUtc?: Date; /** - * Service provider: Microsoft Devices - * **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 provider?: string; + readonly type?: JobType; /** - * Resource Type: IotHubs - * **NOTE: This property will not be serialized. It can only be populated by the server.** + * The status of the job. + * NOTE: This property will not be serialized. It can only be populated by the server. */ - readonly resource?: string; + readonly status?: JobStatus; /** - * Name of the operation - * **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 operation?: string; + readonly failureReason?: string; /** - * Description of the operation - * **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 description?: string; -} - -/** - * IoT Hub REST API operation - */ -export interface Operation { + readonly statusMessage?: string; /** - * Operation name: {provider}/{resource}/{read | write | action | delete} - * **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 name?: 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 object that represents the operation. + * The next link. + * NOTE: This property will not be serialized. It can only be populated by the server. */ - display?: OperationDisplay; + readonly nextLink?: string; } -/** - * Error details. - */ -export interface ErrorDetails { +/** Quota metrics properties. */ +export interface IotHubQuotaMetricInfo { /** - * The error code. - * **NOTE: This property will not be serialized. It can only be populated by the server.** + * The name of the quota metric. + * NOTE: This property will not be serialized. It can only be populated by the server. */ - readonly code?: string; + readonly name?: string; /** - * The HTTP status code. - * **NOTE: This property will not be serialized. It can only be populated by the server.** + * The current value for the quota metric. + * NOTE: This property will not be serialized. It can only be populated by the server. */ - readonly httpStatusCode?: string; + readonly currentValue?: number; /** - * The error message. - * **NOTE: This property will not be serialized. It can only be populated by the server.** + * The maximum value of the quota metric. + * NOTE: This property will not be serialized. It can only be populated by the server. */ - readonly message?: string; + readonly maxValue?: number; +} + +/** The JSON-serialized array of EndpointHealthData objects with a next link. */ +export interface EndpointHealthDataListResult { + /** JSON-serialized array of Endpoint health data */ + value?: EndpointHealthData[]; /** - * The error details. - * **NOTE: This property will not be serialized. It can only be populated by the server.** - */ - readonly details?: string; -} - -/** - * 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.** - */ - 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.** - */ - 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.** + * Link to more results + * NOTE: This property will not be serialized. It can only be populated by the server. */ - readonly maxValue?: number; + readonly nextLink?: string; } -/** - * The health data for an endpoint - */ +/** The health data for an endpoint */ export interface EndpointHealthData { - /** - * Id of the endpoint - */ + /** 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', - * '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; } -/** - * 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; -} - -/** - * 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 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.** - */ - readonly type?: JobType; - /** - * 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.** - */ - 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; - /** - * 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 parentJobId?: string; -} - -/** - * IoT Hub capacity information. - */ -export interface IotHubCapacity { - /** - * The minimum number of units. - * **NOTE: This property will not be serialized. It can only be populated by the server.** - */ - readonly minimum?: number; - /** - * The maximum number of units. - * **NOTE: This property will not be serialized. It can only be populated by the server.** - */ - readonly maximum?: number; - /** - * The default number of units. - * **NOTE: This property will not be serialized. It can only be populated by the server.** - */ - readonly default?: number; - /** - * 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.** - */ - readonly scaleType?: IotHubScaleType; -} - -/** - * SKU properties. - */ -export interface IotHubSkuDescription { - /** - * The type of the resource. - * **NOTE: This property will not be serialized. It can only be populated by the server.** - */ - readonly resourceType?: string; - /** - * The type of the resource. - */ - sku: IotHubSkuInfo; - /** - * IotHub capacity - */ - 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 { - /** - * Resource tags - */ - tags?: { [propertyName: string]: string }; -} - -/** - * The properties of the EventHubConsumerGroupInfo object. - */ -export interface EventHubConsumerGroupInfo extends BaseResource { - /** - * The tags. - */ - properties?: { [propertyName: string]: string }; - /** - * 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 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.** - */ - readonly type?: string; - /** - * The etag. - * **NOTE: This property will not be serialized. It can only be populated by the server.** - */ - readonly etag?: string; -} - -/** - * Input values. - */ +/** Input values. */ export interface OperationInputs { - /** - * The name of the IoT hub to check. - */ + /** The name of the IoT hub to check. */ name: string; } -/** - * The properties indicating whether a given IoT hub name is available. - */ +/** The properties indicating whether a given IoT hub name is available. */ export interface IotHubNameAvailabilityInfo { /** * 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.** + * NOTE: This property will not be serialized. It can only be populated by the server. */ readonly nameAvailable?: boolean; /** - * The reason for unavailability. Possible values include: 'Invalid', 'AlreadyExists' - * **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 reason?: IotHubNameUnavailabilityReason; - /** - * The detailed reason message. - */ + /** The detailed reason message. */ message?: string; } -/** - * Name of Iot Hub type - */ -export interface Name { - /** - * IotHub type - */ - value?: string; - /** - * Localized value of name - */ - localizedValue?: 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 - */ +/** User subscription quota response */ export interface UserSubscriptionQuota { - /** - * IotHub type id - */ + /** IotHub type id */ id?: string; - /** - * Response type - */ + /** Response type */ type?: string; - /** - * Unit of IotHub type - */ + /** Unit of IotHub type */ unit?: string; - /** - * Current number of IotHub type - */ + /** Current number of IotHub type */ currentValue?: number; - /** - * Numerical limit on IotHub type - */ + /** Numerical limit on IotHub type */ limit?: number; - /** - * IotHub type - */ + /** 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; +/** Name of Iot Hub type */ +export interface Name { + /** IotHub type */ + value?: string; + /** Localized value of name */ + localizedValue?: string; } -/** - * Routing message - */ +/** 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 of routing message */ body?: string; - /** - * App properties - */ + /** App properties */ appProperties?: { [propertyName: string]: string }; - /** - * System properties - */ + /** 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 - */ +/** Twin reference input parameter. This is an optional parameter */ export interface RoutingTwin { - /** - * Twin Tags - */ - tags?: any; + /** Twin Tags */ + tags?: Record; properties?: RoutingTwinProperties; } -/** - * Input for testing all routes - */ -export interface TestAllRoutesInput { - /** - * Routing source. Possible values include: 'Invalid', 'DeviceMessages', 'TwinChangeEvents', - * 'DeviceLifecycleEvents', 'DeviceJobLifecycleEvents', 'DigitalTwinChangeEvents' - */ - routingSource?: RoutingSource; - /** - * Routing message - */ - message?: RoutingMessage; - /** - * Routing Twin Reference - */ - twin?: RoutingTwin; -} - -/** - * Routes that matched - */ -export interface MatchedRoute { - /** - * Properties of routes that matched - */ - properties?: RouteProperties; +export interface RoutingTwinProperties { + /** Twin desired properties */ + desired?: Record; + /** Twin desired properties */ + reported?: Record; } -/** - * Result of testing all routes - */ +/** Result of testing all routes */ export interface TestAllRoutesResult { - /** - * JSON-serialized array of matched routes - */ + /** JSON-serialized array of matched routes */ routes?: MatchedRoute[]; } -/** - * Input for testing route - */ +/** Routes that matched */ +export interface MatchedRoute { + /** Properties of routes that matched */ + properties?: RouteProperties; +} + +/** Input for testing route */ export interface TestRouteInput { - /** - * Routing message - */ + /** Routing message */ message?: RoutingMessage; - /** - * Route properties - */ + /** Route properties */ route: RouteProperties; - /** - * Routing Twin Reference - */ + /** 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; +/** Result of testing one route */ +export interface TestRouteResult { + /** Result of testing route */ + result?: TestResultStatus; + /** Detailed result of testing route */ + details?: TestRouteResultDetails; } -/** - * Range of route errors - */ -export interface RouteErrorRange { - /** - * Start where the route error happened - */ - start?: RouteErrorPosition; - /** - * End where the route error happened - */ - end?: RouteErrorPosition; +/** Detailed result of testing a route */ +export interface TestRouteResultDetails { + /** JSON-serialized list of route compilation errors */ + compilationErrors?: RouteCompilationError[]; } -/** - * Compilation error when evaluating route - */ +/** Compilation error when evaluating route */ export interface RouteCompilationError { - /** - * Route error message - */ + /** Route error message */ message?: string; - /** - * Severity of the route error. Possible values include: 'error', 'warning' - */ + /** Severity of the route error */ severity?: RouteErrorSeverity; - /** - * Location where the route error happened - */ + /** 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[]; +/** Range of route errors */ +export interface RouteErrorRange { + /** Start where the route error happened */ + start?: RouteErrorPosition; + /** End where the route error happened */ + end?: RouteErrorPosition; } -/** - * Result of testing one route - */ -export interface TestRouteResult { - /** - * Result of testing route. Possible values include: 'undefined', 'false', 'true' - */ - result?: TestResultStatus; +/** 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[]; /** - * Detailed result of testing route + * The next link. + * NOTE: This property will not be serialized. It can only be populated by the server. */ - details?: TestRouteResultDetails; + readonly nextLink?: string; } -/** - * Use to provide parameters when requesting an export of all devices in the IoT hub. - */ +/** Use to provide parameters when requesting an export of all devices in the IoT hub. */ export interface ExportDevicesRequest { - /** - * The export blob container URI. - */ + /** The export blob container URI. */ exportBlobContainerUri: string; - /** - * The value indicating whether keys should be excluded during export. - */ + /** The value indicating whether keys should be excluded during export. */ excludeKeys: boolean; } -/** - * Use to provide parameters when requesting an import of all devices in the hub. - */ +/** Use to provide parameters when requesting an import of all devices in the hub. */ export interface ImportDevicesRequest { - /** - * The input blob container URI. - */ + /** The input blob container URI. */ inputBlobContainerUri: string; - /** - * The output blob container URI. - */ + /** The output blob container URI. */ outputBlobContainerUri: 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 JSON-serialized array of Certificate objects. */ +export interface CertificateListDescription { + /** The array of Certificate objects. */ + value?: CertificateDescription[]; } -/** - * Optional Parameters. - */ -export interface IotHubResourceCreateOrUpdateOptionalParams extends msRest.RequestOptionsBase { +/** The X509 Certificate. */ +export interface CertificateDescription { + /** The description of an X509 CA Certificate. */ + properties?: CertificateProperties; /** - * ETag of the IoT Hub. Do not specify for creating a brand new IoT Hub. Required to update an - * existing IoT Hub. + * The resource identifier. + * NOTE: This property will not be serialized. It can only be populated by the server. */ - ifMatch?: string; -} - -/** - * Optional Parameters. - */ -export interface IotHubResourceBeginCreateOrUpdateOptionalParams extends msRest.RequestOptionsBase { + readonly id?: string; /** - * ETag of the IoT Hub. Do not specify for creating a brand new IoT Hub. Required to update an - * existing IoT Hub. + * The name of the certificate. + * NOTE: This property will not be serialized. It can only be populated by the server. */ - ifMatch?: string; -} - -/** - * Optional Parameters. - */ -export interface CertificatesCreateOrUpdateOptionalParams extends msRest.RequestOptionsBase { + readonly name?: string; /** - * ETag of the Certificate. Do not specify for creating a brand new certificate. Required to - * update an existing certificate. + * The entity tag. + * NOTE: This property will not be serialized. It can only be populated by the server. */ - ifMatch?: string; -} - -/** - * 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 { + readonly etag?: string; /** - * 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.** + * The resource type. + * NOTE: This property will not be serialized. It can only be populated by the server. */ - readonly nextLink?: string; + readonly type?: string; } -/** - * @interface - * The JSON-serialized array of IotHubDescription objects with a next link. - * @extends Array - */ -export interface IotHubDescriptionListResult extends Array { +/** The description of an X509 CA Certificate. */ +export interface CertificateProperties { /** - * The next link. - * **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 nextLink?: string; -} - -/** - * @interface - * The JSON-serialized array of IotHubSkuDescription objects with a next link. - * @extends Array - */ -export interface IotHubSkuDescriptionListResult extends Array { + readonly subject?: string; /** - * The next link. - * **NOTE: This property will not be serialized. It can only be populated by the server.** + * The certificate's expiration date and time. + * 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 { + readonly expiry?: Date; /** - * The next link. - * **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 nextLink?: string; -} - -/** - * @interface - * The JSON-serialized array of JobResponse objects with a next link. - * @extends Array - */ -export interface JobResponseListResult extends Array { + readonly thumbprint?: string; /** - * The next link. - * **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 nextLink?: string; -} - -/** - * @interface - * The JSON-serialized array of IotHubQuotaMetricInfo objects with a next link. - * @extends Array - */ -export interface IotHubQuotaMetricInfoListResult extends Array { + readonly isVerified?: boolean; /** - * The next link. - * **NOTE: This property will not be serialized. It can only be populated by the server.** + * The certificate's create date and time. + * 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 { + readonly created?: Date; /** - * Link to more results - * **NOTE: This property will not be serialized. It can only be populated by the server.** + * The certificate's last update date and time. + * NOTE: This property will not be serialized. It can only be populated by the server. */ - readonly nextLink?: string; + readonly updated?: Date; + /** The certificate content */ + certificate?: 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; +/** 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; } -/** - * 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 IpFilterActionType. - * Possible values include: 'Accept', 'Reject' - * @readonly - * @enum {string} - */ -export type IpFilterActionType = 'Accept' | 'Reject'; - -/** - * Defines values for RoutingSource. - * Possible values include: 'Invalid', 'DeviceMessages', 'TwinChangeEvents', - * 'DeviceLifecycleEvents', 'DeviceJobLifecycleEvents', 'DigitalTwinChangeEvents' - * @readonly - * @enum {string} - */ -export type RoutingSource = 'Invalid' | 'DeviceMessages' | 'TwinChangeEvents' | 'DeviceLifecycleEvents' | 'DeviceJobLifecycleEvents' | 'DigitalTwinChangeEvents'; - -/** - * 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 EndpointHealthStatus. - * Possible values include: 'unknown', 'healthy', 'unhealthy', 'dead' - * @readonly - * @enum {string} - */ -export type EndpointHealthStatus = 'unknown' | 'healthy' | '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 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 resource identifier. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly id?: string; + /** + * The name of the certificate. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly name?: string; /** - * The underlying HTTP response. + * The entity tag. + * NOTE: This property will not be serialized. It can only be populated by the server. */ - _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 & { + readonly etag?: string; /** - * The underlying HTTP response. + * The resource type. + * NOTE: This property will not be serialized. It can only be populated by the server. */ - _response: msRest.HttpResponse & { - /** - * The response body as text (string format) - */ - bodyAsText: string; - - /** - * The response body as parsed JSON or XML - */ - parsedBody: OperationListResult; - }; -}; + readonly type?: string; +} -/** - * Contains response data for the get operation. - */ -export type IotHubResourceGetResponse = IotHubDescription & { +/** The description of an X509 CA Certificate including the challenge nonce issued for the Proof-Of-Possession flow. */ +export interface CertificatePropertiesWithNonce { /** - * The underlying HTTP response. + * The certificate's subject name. + * NOTE: This property will not be serialized. It can only be populated by the server. */ - _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 & { + readonly subject?: string; /** - * The underlying HTTP response. + * The certificate's expiration date and time. + * NOTE: This property will not be serialized. It can only be populated by the server. */ - _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 & { + readonly expiry?: Date; /** - * The underlying HTTP response. + * The certificate's thumbprint. + * NOTE: This property will not be serialized. It can only be populated by the server. */ - _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 = { + readonly thumbprint?: string; /** - * The parsed response body. + * Determines whether certificate has been verified. + * NOTE: This property will not be serialized. It can only be populated by the server. */ - body: any; - + readonly isVerified?: boolean; /** - * The underlying HTTP response. + * The certificate's create date and time. + * NOTE: This property will not be serialized. It can only be populated by the server. */ - _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 & { + readonly created?: Date; /** - * The underlying HTTP response. + * The certificate's last update date and time. + * NOTE: This property will not be serialized. It can only be populated by the server. */ - _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 & { + readonly updated?: Date; /** - * The underlying HTTP response. + * 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. */ - _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 & { + readonly verificationCode?: string; /** - * The underlying HTTP response. + * The certificate content + * NOTE: This property will not be serialized. It can only be populated by the server. */ - _response: msRest.HttpResponse & { - /** - * The response body as text (string format) - */ - bodyAsText: string; + readonly certificate?: string; +} - /** - * The response body as parsed JSON or XML - */ - parsedBody: RegistryStatistics; - }; -}; +/** The JSON-serialized leaf certificate */ +export interface CertificateVerificationDescription { + /** base-64 representation of X509 certificate .cer file or just .pem file content. */ + certificate?: string; +} -/** - * 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; +/** 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 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; }; -/** - * Contains response data for the listEventHubConsumerGroups operation. +/** Known values of {@link RoutingStorageContainerPropertiesEncoding} that the service accepts. */ +export enum KnownRoutingStorageContainerPropertiesEncoding { + Avro = "Avro", + AvroDeflate = "AvroDeflate", + Json = "JSON" +} + +/** + * 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 IotHubResourceListEventHubConsumerGroupsResponse = EventHubConsumerGroupsListResult & { - /** - * 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: EventHubConsumerGroupsListResult; - }; -}; +/** Known values of {@link RoutingSource} that the service accepts. */ +export enum KnownRoutingSource { + Invalid = "Invalid", + DeviceMessages = "DeviceMessages", + TwinChangeEvents = "TwinChangeEvents", + DeviceLifecycleEvents = "DeviceLifecycleEvents", + DeviceJobLifecycleEvents = "DeviceJobLifecycleEvents", + DigitalTwinChangeEvents = "DigitalTwinChangeEvents" +} + +/** + * 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** \ + * **DigitalTwinChangeEvents** + */ +export type RoutingSource = string; + +/** Known values of {@link Capabilities} that the service accepts. */ +export enum KnownCapabilities { + None = "None", + DeviceManagement = "DeviceManagement" +} + +/** + * 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", + 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** \ + * **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 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"; + +/** Optional parameters. */ +export interface OperationsListOptionalParams + extends coreClient.OperationOptions {} + +/** Contains response data for the list operation. */ +export type OperationsListResponse = OperationListResult; + +/** Optional parameters. */ +export interface OperationsListNextOptionalParams + extends coreClient.OperationOptions {} + +/** Contains response data for the listNext operation. */ +export type OperationsListNextResponse = OperationListResult; + +/** Optional parameters. */ +export interface IotHubResourceGetOptionalParams + extends coreClient.OperationOptions {} + +/** Contains response data for the get operation. */ +export type IotHubResourceGetResponse = IotHubDescription; + +/** 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 getEventHubConsumerGroup operation. - */ -export type IotHubResourceGetEventHubConsumerGroupResponse = EventHubConsumerGroupInfo & { - /** - * 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: EventHubConsumerGroupInfo; - }; -}; +/** 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 createEventHubConsumerGroup operation. - */ -export type IotHubResourceCreateEventHubConsumerGroupResponse = EventHubConsumerGroupInfo & { - /** - * 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: EventHubConsumerGroupInfo; - }; -}; +/** 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 listJobs operation. - */ -export type IotHubResourceListJobsResponse = JobResponseListResult & { - /** - * 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: JobResponseListResult; - }; -}; +/** Optional parameters. */ +export interface IotHubResourceListBySubscriptionOptionalParams + extends coreClient.OperationOptions {} -/** - * Contains response data for the getJob operation. - */ -export type IotHubResourceGetJobResponse = JobResponse & { - /** - * 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: JobResponse; - }; -}; +/** Optional parameters. */ +export interface IotHubResourceListByResourceGroupOptionalParams + extends coreClient.OperationOptions {} -/** - * Contains response data for the getQuotaMetrics operation. - */ -export type IotHubResourceGetQuotaMetricsResponse = IotHubQuotaMetricInfoListResult & { - /** - * 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: IotHubQuotaMetricInfoListResult; - }; -}; +/** Optional parameters. */ +export interface IotHubResourceGetStatsOptionalParams + extends coreClient.OperationOptions {} -/** - * Contains response data for the getEndpointHealth operation. - */ -export type IotHubResourceGetEndpointHealthResponse = EndpointHealthDataListResult & { - /** - * The underlying HTTP response. - */ - _response: msRest.HttpResponse & { - /** - * The response body as text (string format) - */ - bodyAsText: string; +/** Contains response data for the getStats operation. */ +export type IotHubResourceGetStatsResponse = RegistryStatistics; - /** - * The response body as parsed JSON or XML - */ - parsedBody: EndpointHealthDataListResult; - }; -}; +/** Optional parameters. */ +export interface IotHubResourceGetValidSkusOptionalParams + extends coreClient.OperationOptions {} -/** - * 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; +/** Contains response data for the getValidSkus operation. */ +export type IotHubResourceGetValidSkusResponse = IotHubSkuDescriptionListResult; - /** - * The response body as parsed JSON or XML - */ - parsedBody: IotHubNameAvailabilityInfo; - }; -}; +/** Optional parameters. */ +export interface IotHubResourceListEventHubConsumerGroupsOptionalParams + 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 listEventHubConsumerGroups operation. */ +export type IotHubResourceListEventHubConsumerGroupsResponse = EventHubConsumerGroupsListResult; - /** - * The response body as parsed JSON or XML - */ - parsedBody: TestAllRoutesResult; - }; -}; +/** Optional parameters. */ +export interface IotHubResourceGetEventHubConsumerGroupOptionalParams + 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 getEventHubConsumerGroup operation. */ +export type IotHubResourceGetEventHubConsumerGroupResponse = EventHubConsumerGroupInfo; - /** - * The response body as parsed JSON or XML - */ - parsedBody: TestRouteResult; - }; -}; +/** Optional parameters. */ +export interface IotHubResourceCreateEventHubConsumerGroupOptionalParams + 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 createEventHubConsumerGroup operation. */ +export type IotHubResourceCreateEventHubConsumerGroupResponse = EventHubConsumerGroupInfo; - /** - * The response body as parsed JSON or XML - */ - parsedBody: SharedAccessSignatureAuthorizationRuleListResult; - }; -}; +/** Optional parameters. */ +export interface IotHubResourceDeleteEventHubConsumerGroupOptionalParams + extends coreClient.OperationOptions {} -/** - * 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; +/** Optional parameters. */ +export interface IotHubResourceListJobsOptionalParams + extends coreClient.OperationOptions {} - /** - * The response body as parsed JSON or XML - */ - parsedBody: SharedAccessSignatureAuthorizationRule; - }; -}; +/** Contains response data for the listJobs operation. */ +export type IotHubResourceListJobsResponse = JobResponseListResult; -/** - * 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; +/** Optional parameters. */ +export interface IotHubResourceGetJobOptionalParams + extends coreClient.OperationOptions {} - /** - * The response body as parsed JSON or XML - */ - parsedBody: JobResponse; - }; -}; +/** Contains response data for the getJob operation. */ +export type IotHubResourceGetJobResponse = JobResponse; -/** - * 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; +/** Optional parameters. */ +export interface IotHubResourceGetQuotaMetricsOptionalParams + extends coreClient.OperationOptions {} - /** - * The response body as parsed JSON or XML - */ - parsedBody: JobResponse; - }; -}; +/** Contains response data for the getQuotaMetrics operation. */ +export type IotHubResourceGetQuotaMetricsResponse = IotHubQuotaMetricInfoListResult; -/** - * 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; +/** Optional parameters. */ +export interface IotHubResourceGetEndpointHealthOptionalParams + extends coreClient.OperationOptions {} - /** - * The response body as parsed JSON or XML - */ - parsedBody: IotHubDescription; - }; -}; +/** Contains response data for the getEndpointHealth operation. */ +export type IotHubResourceGetEndpointHealthResponse = EndpointHealthDataListResult; -/** - * 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; +/** Optional parameters. */ +export interface IotHubResourceCheckNameAvailabilityOptionalParams + extends coreClient.OperationOptions {} - /** - * The response body as parsed JSON or XML - */ - parsedBody: IotHubDescription; - }; -}; +/** Contains response data for the checkNameAvailability operation. */ +export type IotHubResourceCheckNameAvailabilityResponse = IotHubNameAvailabilityInfo; -/** - * Contains response data for the beginDeleteMethod operation. - */ -export type IotHubResourceBeginDeleteMethodResponse = { - /** - * The parsed response body. - */ - body: any; +/** Optional parameters. */ +export interface IotHubResourceTestAllRoutesOptionalParams + extends coreClient.OperationOptions {} - /** - * 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: any; - }; -}; +/** Optional parameters. */ +export interface IotHubResourceTestRouteOptionalParams + extends coreClient.OperationOptions {} -/** - * 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; +/** Contains response data for the testRoute operation. */ +export type IotHubResourceTestRouteResponse = TestRouteResult; - /** - * The response body as parsed JSON or XML - */ - parsedBody: IotHubDescriptionListResult; - }; -}; +/** Optional parameters. */ +export interface IotHubResourceListKeysOptionalParams + extends coreClient.OperationOptions {} -/** - * 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; +/** Contains response data for the listKeys operation. */ +export type IotHubResourceListKeysResponse = SharedAccessSignatureAuthorizationRuleListResult; - /** - * The response body as parsed JSON or XML - */ - parsedBody: IotHubDescriptionListResult; - }; -}; +/** Optional parameters. */ +export interface IotHubResourceGetKeysForKeyNameOptionalParams + extends coreClient.OperationOptions {} -/** - * 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; +/** Contains response data for the getKeysForKeyName operation. */ +export type IotHubResourceGetKeysForKeyNameResponse = SharedAccessSignatureAuthorizationRule; - /** - * The response body as parsed JSON or XML - */ - parsedBody: IotHubSkuDescriptionListResult; - }; -}; +/** Optional parameters. */ +export interface IotHubResourceExportDevicesOptionalParams + extends coreClient.OperationOptions {} -/** - * 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; +/** Contains response data for the exportDevices operation. */ +export type IotHubResourceExportDevicesResponse = JobResponse; - /** - * The response body as parsed JSON or XML - */ - parsedBody: EventHubConsumerGroupsListResult; - }; -}; +/** Optional parameters. */ +export interface IotHubResourceImportDevicesOptionalParams + 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 importDevices operation. */ +export type IotHubResourceImportDevicesResponse = JobResponse; - /** - * The response body as parsed JSON or XML - */ - parsedBody: JobResponseListResult; - }; -}; +/** Optional parameters. */ +export interface IotHubResourceListBySubscriptionNextOptionalParams + 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 listBySubscriptionNext operation. */ +export type IotHubResourceListBySubscriptionNextResponse = IotHubDescriptionListResult; - /** - * The response body as parsed JSON or XML - */ - parsedBody: IotHubQuotaMetricInfoListResult; - }; -}; +/** Optional parameters. */ +export interface IotHubResourceListByResourceGroupNextOptionalParams + 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 listByResourceGroupNext operation. */ +export type IotHubResourceListByResourceGroupNextResponse = IotHubDescriptionListResult; - /** - * The response body as parsed JSON or XML - */ - parsedBody: EndpointHealthDataListResult; - }; -}; +/** Optional parameters. */ +export interface IotHubResourceGetValidSkusNextOptionalParams + 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 getValidSkusNext operation. */ +export type IotHubResourceGetValidSkusNextResponse = IotHubSkuDescriptionListResult; - /** - * The response body as parsed JSON or XML - */ - parsedBody: SharedAccessSignatureAuthorizationRuleListResult; - }; -}; +/** Optional parameters. */ +export interface IotHubResourceListEventHubConsumerGroupsNextOptionalParams + 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 listEventHubConsumerGroupsNext operation. */ +export type IotHubResourceListEventHubConsumerGroupsNextResponse = EventHubConsumerGroupsListResult; - /** - * The response body as parsed JSON or XML - */ - parsedBody: UserSubscriptionQuotaListResult; - }; -}; +/** Optional parameters. */ +export interface IotHubResourceListJobsNextOptionalParams + 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 listJobsNext operation. */ +export type IotHubResourceListJobsNextResponse = JobResponseListResult; - /** - * The response body as parsed JSON or XML - */ - parsedBody: CertificateListDescription; - }; -}; +/** Optional parameters. */ +export interface IotHubResourceGetQuotaMetricsNextOptionalParams + 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 getQuotaMetricsNext operation. */ +export type IotHubResourceGetQuotaMetricsNextResponse = IotHubQuotaMetricInfoListResult; - /** - * The response body as parsed JSON or XML - */ - parsedBody: CertificateDescription; - }; -}; +/** Optional parameters. */ +export interface IotHubResourceGetEndpointHealthNextOptionalParams + 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 getEndpointHealthNext operation. */ +export type IotHubResourceGetEndpointHealthNextResponse = EndpointHealthDataListResult; - /** - * The response body as parsed JSON or XML - */ - parsedBody: CertificateDescription; - }; -}; +/** Optional parameters. */ +export interface IotHubResourceListKeysNextOptionalParams + 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 listKeysNext operation. */ +export type IotHubResourceListKeysNextResponse = SharedAccessSignatureAuthorizationRuleListResult; - /** - * The response body as parsed JSON or XML - */ - parsedBody: CertificateWithNonceDescription; - }; -}; +/** Optional parameters. */ +export interface ResourceProviderCommonGetSubscriptionQuotaOptionalParams + 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 getSubscriptionQuota operation. */ +export type ResourceProviderCommonGetSubscriptionQuotaResponse = UserSubscriptionQuotaListResult; - /** - * The response body as parsed JSON or XML - */ - parsedBody: CertificateDescription; - }; -}; +/** 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 IotHubClientOptionalParams + extends coreClient.ServiceClientOptions { + /** server parameter */ + $host?: string; + /** Api Version */ + apiVersion?: string; + /** Overrides client endpoint. */ + endpoint?: string; +} diff --git a/sdk/iothub/arm-iothub-profile-2020-09-01-hybrid/src/models/iotHubMappers.ts b/sdk/iothub/arm-iothub-profile-2020-09-01-hybrid/src/models/iotHubMappers.ts deleted file mode 100644 index 7714701e2033..000000000000 --- a/sdk/iothub/arm-iothub-profile-2020-09-01-hybrid/src/models/iotHubMappers.ts +++ /dev/null @@ -1,12 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for license information. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -export { - ErrorDetails, - FailoverInput -} from "../models/mappers"; diff --git a/sdk/iothub/arm-iothub-profile-2020-09-01-hybrid/src/models/iotHubResourceMappers.ts b/sdk/iothub/arm-iothub-profile-2020-09-01-hybrid/src/models/iotHubResourceMappers.ts deleted file mode 100644 index 235c2d3e08cc..000000000000 --- a/sdk/iothub/arm-iothub-profile-2020-09-01-hybrid/src/models/iotHubResourceMappers.ts +++ /dev/null @@ -1,70 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for license information. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -export { - BaseResource, - CertificateDescription, - CertificateProperties, - CertificatePropertiesWithNonce, - CertificateWithNonceDescription, - CloudError, - CloudToDeviceProperties, - EndpointHealthData, - EndpointHealthDataListResult, - EnrichmentProperties, - ErrorDetails, - EventHubConsumerGroupInfo, - EventHubConsumerGroupsListResult, - EventHubProperties, - ExportDevicesRequest, - FallbackRouteProperties, - FeedbackProperties, - ImportDevicesRequest, - IotHubCapacity, - IotHubDescription, - IotHubDescriptionListResult, - IotHubLocationDescription, - IotHubNameAvailabilityInfo, - IotHubProperties, - IotHubPropertiesDeviceStreams, - IotHubQuotaMetricInfo, - IotHubQuotaMetricInfoListResult, - IotHubSkuDescription, - IotHubSkuDescriptionListResult, - IotHubSkuInfo, - IpFilterRule, - JobResponse, - JobResponseListResult, - MatchedRoute, - MessagingEndpointProperties, - OperationInputs, - 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-profile-2020-09-01-hybrid/src/models/mappers.ts b/sdk/iothub/arm-iothub-profile-2020-09-01-hybrid/src/models/mappers.ts index dab1f893cd88..4183ab3db2c5 100644 --- a/sdk/iothub/arm-iothub-profile-2020-09-01-hybrid/src/models/mappers.ts +++ b/sdk/iothub/arm-iothub-profile-2020-09-01-hybrid/src/models/mappers.ts @@ -1,25 +1,34 @@ /* - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for license information. + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. * * Code generated by Microsoft (R) AutoRest Code Generator. * Changes may cause incorrect behavior and will be lost if the code is regenerated. */ -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,164 +134,150 @@ 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", + }, + ipFilterRules: { + serializedName: "ipFilterRules", type: { - name: "String" + name: "Sequence", + element: { + type: { + name: "Composite", + className: "IpFilterRule" + } + } } - } - } - } -}; - -export const CertificatePropertiesWithNonce: msRest.CompositeMapper = { - serializedName: "CertificatePropertiesWithNonce", - type: { - name: "Composite", - className: "CertificatePropertiesWithNonce", - modelProperties: { - subject: { + }, + provisioningState: { + serializedName: "provisioningState", readOnly: true, - serializedName: "subject", type: { name: "String" } }, - expiry: { + state: { + serializedName: "state", readOnly: true, - serializedName: "expiry", type: { - name: "DateTimeRfc1123" + name: "String" } }, - thumbprint: { + hostName: { + serializedName: "hostName", readOnly: true, - serializedName: "thumbprint", type: { name: "String" } }, - isVerified: { - readOnly: true, - serializedName: "isVerified", + eventHubEndpoints: { + serializedName: "eventHubEndpoints", type: { - name: "Boolean" + name: "Dictionary", + value: { + type: { name: "Composite", className: "EventHubProperties" } + } } }, - created: { - readOnly: true, - serializedName: "created", + routing: { + serializedName: "routing", type: { - name: "DateTimeRfc1123" + name: "Composite", + className: "RoutingProperties" } }, - updated: { - readOnly: true, - serializedName: "updated", + storageEndpoints: { + serializedName: "storageEndpoints", type: { - name: "DateTimeRfc1123" + name: "Dictionary", + value: { + type: { name: "Composite", className: "StorageEndpointProperties" } + } } }, - verificationCode: { - readOnly: true, - serializedName: "verificationCode", + messagingEndpoints: { + serializedName: "messagingEndpoints", type: { - name: "String" + name: "Dictionary", + value: { + type: { + name: "Composite", + className: "MessagingEndpointProperties" + } + } } }, - certificate: { - readOnly: true, - serializedName: "certificate", + enableFileUploadNotifications: { + serializedName: "enableFileUploadNotifications", type: { - name: "String" + name: "Boolean" } - } - } - } -}; - -export const CertificateWithNonceDescription: msRest.CompositeMapper = { - serializedName: "CertificateWithNonceDescription", - type: { - name: "Composite", - className: "CertificateWithNonceDescription", - modelProperties: { - properties: { - serializedName: "properties", + }, + cloudToDevice: { + serializedName: "cloudToDevice", type: { name: "Composite", - className: "CertificatePropertiesWithNonce" + className: "CloudToDeviceProperties" } }, - id: { - readOnly: true, - serializedName: "id", + comments: { + serializedName: "comments", type: { name: "String" } }, - name: { - readOnly: true, - serializedName: "name", + deviceStreams: { + serializedName: "deviceStreams", type: { - name: "String" + name: "Composite", + className: "IotHubPropertiesDeviceStreams" } }, - etag: { - readOnly: true, - serializedName: "etag", + features: { + serializedName: "features", type: { name: "String" } }, - type: { + locations: { + serializedName: "locations", readOnly: true, - serializedName: "type", type: { - name: "String" + name: "Sequence", + element: { + type: { + name: "Composite", + className: "IotHubLocationDescription" + } + } } } } } }; -export const SharedAccessSignatureAuthorizationRule: msRest.CompositeMapper = { - serializedName: "SharedAccessSignatureAuthorizationRule", +export const SharedAccessSignatureAuthorizationRule: coreClient.CompositeMapper = { type: { name: "Composite", className: "SharedAccessSignatureAuthorizationRule", modelProperties: { keyName: { - required: true, serializedName: "keyName", + required: true, type: { name: "String" } @@ -306,8 +295,8 @@ export const SharedAccessSignatureAuthorizationRule: msRest.CompositeMapper = { } }, rights: { - required: true, serializedName: "rights", + required: true, type: { name: "Enum", allowedValues: [ @@ -333,33 +322,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" - ] + allowedValues: ["Accept", "Reject"] } }, ipMask: { - required: true, serializedName: "ipMask", + required: true, type: { name: "String" } @@ -368,8 +353,7 @@ export const IpFilterRule: msRest.CompositeMapper = { } }; -export const EventHubProperties: msRest.CompositeMapper = { - serializedName: "EventHubProperties", +export const EventHubProperties: coreClient.CompositeMapper = { type: { name: "Composite", className: "EventHubProperties", @@ -387,8 +371,8 @@ export const EventHubProperties: msRest.CompositeMapper = { } }, partitionIds: { - readOnly: true, serializedName: "partitionIds", + readOnly: true, type: { name: "Sequence", element: { @@ -399,15 +383,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" } @@ -416,25 +400,128 @@ export const EventHubProperties: msRest.CompositeMapper = { } }; -export const RoutingServiceBusQueueEndpointProperties: msRest.CompositeMapper = { - serializedName: "RoutingServiceBusQueueEndpointProperties", +export const RoutingProperties: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "RoutingProperties", + modelProperties: { + endpoints: { + serializedName: "endpoints", + type: { + name: "Composite", + className: "RoutingEndpoints" + } + }, + routes: { + serializedName: "routes", + type: { + name: "Sequence", + element: { + type: { + name: "Composite", + className: "RouteProperties" + } + } + } + }, + fallbackRoute: { + serializedName: "fallbackRoute", + type: { + name: "Composite", + className: "FallbackRouteProperties" + } + }, + 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: { connectionString: { - required: true, serializedName: "connectionString", + required: true, type: { name: "String" } }, 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" } @@ -455,25 +542,24 @@ export const RoutingServiceBusQueueEndpointProperties: msRest.CompositeMapper = } }; -export const RoutingServiceBusTopicEndpointProperties: msRest.CompositeMapper = { - serializedName: "RoutingServiceBusTopicEndpointProperties", +export const RoutingServiceBusTopicEndpointProperties: coreClient.CompositeMapper = { type: { name: "Composite", className: "RoutingServiceBusTopicEndpointProperties", modelProperties: { connectionString: { - required: true, serializedName: "connectionString", + required: true, type: { name: "String" } }, 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" } @@ -494,25 +580,24 @@ export const RoutingServiceBusTopicEndpointProperties: msRest.CompositeMapper = } }; -export const RoutingEventHubProperties: msRest.CompositeMapper = { - serializedName: "RoutingEventHubProperties", +export const RoutingEventHubProperties: coreClient.CompositeMapper = { type: { name: "Composite", className: "RoutingEventHubProperties", modelProperties: { connectionString: { - required: true, serializedName: "connectionString", + required: true, type: { name: "String" } }, 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" } @@ -533,25 +618,24 @@ export const RoutingEventHubProperties: msRest.CompositeMapper = { } }; -export const RoutingStorageContainerProperties: msRest.CompositeMapper = { - serializedName: "RoutingStorageContainerProperties", +export const RoutingStorageContainerProperties: coreClient.CompositeMapper = { type: { name: "Composite", className: "RoutingStorageContainerProperties", modelProperties: { connectionString: { - required: true, serializedName: "connectionString", + required: true, type: { name: "String" } }, 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" } @@ -569,8 +653,8 @@ export const RoutingStorageContainerProperties: msRest.CompositeMapper = { } }, containerName: { - required: true, serializedName: "containerName", + required: true, type: { name: "String" } @@ -582,21 +666,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" } @@ -611,83 +695,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" } @@ -699,12 +724,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: { @@ -715,8 +740,8 @@ export const RouteProperties: msRest.CompositeMapper = { } }, isEnabled: { - required: true, serializedName: "isEnabled", + required: true, type: { name: "Boolean" } @@ -725,8 +750,7 @@ export const RouteProperties: msRest.CompositeMapper = { } }; -export const FallbackRouteProperties: msRest.CompositeMapper = { - serializedName: "FallbackRouteProperties", +export const FallbackRouteProperties: coreClient.CompositeMapper = { type: { name: "Composite", className: "FallbackRouteProperties", @@ -738,10 +762,8 @@ export const FallbackRouteProperties: msRest.CompositeMapper = { } }, source: { - required: true, - isConstant: true, serializedName: "source", - defaultValue: 'DeviceMessages', + required: true, type: { name: "String" } @@ -753,12 +775,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: { @@ -769,8 +791,8 @@ export const FallbackRouteProperties: msRest.CompositeMapper = { } }, isEnabled: { - required: true, serializedName: "isEnabled", + required: true, type: { name: "Boolean" } @@ -779,32 +801,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: { @@ -818,118 +839,99 @@ 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" - } - }, - enrichments: { - serializedName: "enrichments", - type: { - name: "Sequence", - element: { - type: { - name: "Composite", - className: "EnrichmentProperties" - } - } + name: "String" } } } } }; -export const StorageEndpointProperties: msRest.CompositeMapper = { - serializedName: "StorageEndpointProperties", +export const MessagingEndpointProperties: coreClient.CompositeMapper = { type: { name: "Composite", - className: "StorageEndpointProperties", + className: "MessagingEndpointProperties", modelProperties: { - sasTtlAsIso8601: { - serializedName: "sasTtlAsIso8601", + lockDurationAsIso8601: { + serializedName: "lockDurationAsIso8601", type: { name: "TimeSpan" } }, - connectionString: { - required: true, - serializedName: "connectionString", + ttlAsIso8601: { + serializedName: "ttlAsIso8601", type: { - name: "String" + name: "TimeSpan" } }, - containerName: { - required: true, - serializedName: "containerName", + maxDeliveryCount: { + constraints: { + InclusiveMaximum: 100, + InclusiveMinimum: 1 + }, + serializedName: "maxDeliveryCount", type: { - name: "String" + name: "Number" } } } } }; -export const MessagingEndpointProperties: msRest.CompositeMapper = { - serializedName: "MessagingEndpointProperties", +export const CloudToDeviceProperties: coreClient.CompositeMapper = { type: { name: "Composite", - className: "MessagingEndpointProperties", + className: "CloudToDeviceProperties", modelProperties: { - lockDurationAsIso8601: { - serializedName: "lockDurationAsIso8601", + maxDeliveryCount: { + constraints: { + InclusiveMaximum: 100, + InclusiveMinimum: 1 + }, + serializedName: "maxDeliveryCount", type: { - name: "TimeSpan" + name: "Number" } }, - ttlAsIso8601: { - serializedName: "ttlAsIso8601", + defaultTtlAsIso8601: { + serializedName: "defaultTtlAsIso8601", type: { name: "TimeSpan" } }, - maxDeliveryCount: { - serializedName: "maxDeliveryCount", - constraints: { - InclusiveMaximum: 100, - InclusiveMinimum: 1 - }, + feedback: { + serializedName: "feedback", type: { - name: "Number" + name: "Composite", + className: "FeedbackProperties" } } } } }; -export const FeedbackProperties: msRest.CompositeMapper = { - serializedName: "FeedbackProperties", +export const FeedbackProperties: coreClient.CompositeMapper = { type: { name: "Composite", className: "FeedbackProperties", @@ -947,54 +949,20 @@ export const FeedbackProperties: msRest.CompositeMapper = { } }, maxDeliveryCount: { - serializedName: "maxDeliveryCount", constraints: { InclusiveMaximum: 100, InclusiveMinimum: 1 }, - type: { - name: "Number" - } - } - } - } -}; - -export const CloudToDeviceProperties: msRest.CompositeMapper = { - serializedName: "CloudToDeviceProperties", - type: { - name: "Composite", - className: "CloudToDeviceProperties", - modelProperties: { - maxDeliveryCount: { serializedName: "maxDeliveryCount", - constraints: { - InclusiveMaximum: 100, - InclusiveMinimum: 1 - }, type: { name: "Number" } - }, - defaultTtlAsIso8601: { - serializedName: "defaultTtlAsIso8601", - type: { - name: "TimeSpan" - } - }, - feedback: { - serializedName: "feedback", - type: { - name: "Composite", - className: "FeedbackProperties" - } } } } }; -export const IotHubPropertiesDeviceStreams: msRest.CompositeMapper = { - serializedName: "IotHubProperties_deviceStreams", +export const IotHubPropertiesDeviceStreams: coreClient.CompositeMapper = { type: { name: "Composite", className: "IotHubPropertiesDeviceStreams", @@ -1014,8 +982,7 @@ export const IotHubPropertiesDeviceStreams: msRest.CompositeMapper = { } }; -export const IotHubLocationDescription: msRest.CompositeMapper = { - serializedName: "IotHubLocationDescription", +export const IotHubLocationDescription: coreClient.CompositeMapper = { type: { name: "Composite", className: "IotHubLocationDescription", @@ -1036,172 +1003,24 @@ export const IotHubLocationDescription: msRest.CompositeMapper = { } }; -export const IotHubProperties: msRest.CompositeMapper = { - serializedName: "IotHubProperties", - type: { - name: "Composite", - className: "IotHubProperties", - modelProperties: { - authorizationPolicies: { - serializedName: "authorizationPolicies", - type: { - name: "Sequence", - element: { - type: { - name: "Composite", - className: "SharedAccessSignatureAuthorizationRule" - } - } - } - }, - ipFilterRules: { - serializedName: "ipFilterRules", - type: { - name: "Sequence", - element: { - type: { - name: "Composite", - className: "IpFilterRule" - } - } - } - }, - provisioningState: { - readOnly: true, - serializedName: "provisioningState", - type: { - name: "String" - } - }, - state: { - readOnly: true, - serializedName: "state", - type: { - name: "String" - } - }, - hostName: { - readOnly: true, - serializedName: "hostName", - type: { - name: "String" - } - }, - eventHubEndpoints: { - serializedName: "eventHubEndpoints", - type: { - name: "Dictionary", - value: { - type: { - name: "Composite", - className: "EventHubProperties" - } - } - } - }, - routing: { - serializedName: "routing", - type: { - name: "Composite", - className: "RoutingProperties" - } - }, - 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" - } - }, - deviceStreams: { - serializedName: "deviceStreams", - type: { - name: "Composite", - className: "IotHubPropertiesDeviceStreams" - } - }, - features: { - serializedName: "features", - type: { - name: "String" - } - }, - locations: { - readOnly: true, - serializedName: "locations", - type: { - name: "Sequence", - element: { - type: { - name: "Composite", - className: "IotHubLocationDescription" - } - } - } - } - } - } -}; - -export const IotHubSkuInfo: msRest.CompositeMapper = { - serializedName: "IotHubSkuInfo", +export const IotHubSkuInfo: coreClient.CompositeMapper = { type: { name: "Composite", className: "IotHubSkuInfo", modelProperties: { name: { - required: true, serializedName: "name", + required: true, type: { name: "String" } }, tier: { - readOnly: true, serializedName: "tier", + readOnly: true, type: { name: "Enum", - allowedValues: [ - "Free", - "Standard", - "Basic" - ] + allowedValues: ["Free", "Standard", "Basic"] } }, capacity: { @@ -1214,39 +1033,38 @@ export const IotHubSkuInfo: msRest.CompositeMapper = { } }; -export const Resource: msRest.CompositeMapper = { - serializedName: "Resource", +export const Resource: coreClient.CompositeMapper = { type: { name: "Composite", className: "Resource", modelProperties: { id: { - readOnly: true, serializedName: "id", + readOnly: true, type: { name: "String" } }, name: { - readOnly: true, - serializedName: "name", constraints: { - Pattern: /^(?![0-9]+$)(?!-)[a-zA-Z0-9-]{2,49}[a-zA-Z0-9]$/ + Pattern: new RegExp("^(?![0-9]+$)(?!-)[a-zA-Z0-9-]{2,49}[a-zA-Z0-9]$") }, + serializedName: "name", + readOnly: true, type: { name: "String" } }, type: { - readOnly: true, serializedName: "type", + readOnly: true, type: { name: "String" } }, location: { - required: true, serializedName: "location", + required: true, type: { name: "String" } @@ -1255,79 +1073,107 @@ export const Resource: msRest.CompositeMapper = { serializedName: "tags", type: { name: "Dictionary", - value: { - type: { - name: "String" - } - } + value: { type: { name: "String" } } } } } } }; -export const IotHubDescription: msRest.CompositeMapper = { - serializedName: "IotHubDescription", +export const TagsResource: coreClient.CompositeMapper = { type: { name: "Composite", - className: "IotHubDescription", + className: "TagsResource", modelProperties: { - ...Resource.type.modelProperties, - etag: { - serializedName: "etag", - type: { - name: "String" + tags: { + serializedName: "tags", + type: { + name: "Dictionary", + value: { type: { name: "String" } } } - }, - properties: { - serializedName: "properties", + } + } + } +}; + +export const IotHubDescriptionListResult: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "IotHubDescriptionListResult", + modelProperties: { + value: { + serializedName: "value", type: { - name: "Composite", - className: "IotHubProperties" + name: "Sequence", + element: { + type: { + name: "Composite", + className: "IotHubDescription" + } + } } }, - sku: { - required: true, - serializedName: "sku", + nextLink: { + serializedName: "nextLink", + readOnly: true, type: { - name: "Composite", - className: "IotHubSkuInfo" + name: "String" } } } } }; -export const OperationDisplay: msRest.CompositeMapper = { - serializedName: "Operation_display", +export const RegistryStatistics: coreClient.CompositeMapper = { type: { name: "Composite", - className: "OperationDisplay", + className: "RegistryStatistics", modelProperties: { - provider: { + totalDeviceCount: { + serializedName: "totalDeviceCount", readOnly: true, - serializedName: "provider", type: { - name: "String" + name: "Number" } }, - resource: { + enabledDeviceCount: { + serializedName: "enabledDeviceCount", readOnly: true, - serializedName: "resource", type: { - name: "String" + name: "Number" } }, - operation: { + disabledDeviceCount: { + serializedName: "disabledDeviceCount", readOnly: true, - serializedName: "operation", type: { - name: "String" + name: "Number" + } + } + } + } +}; + +export const IotHubSkuDescriptionListResult: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "IotHubSkuDescriptionListResult", + modelProperties: { + value: { + serializedName: "value", + type: { + name: "Sequence", + element: { + type: { + name: "Composite", + className: "IotHubSkuDescription" + } + } } }, - description: { + nextLink: { + serializedName: "nextLink", readOnly: true, - serializedName: "description", type: { name: "String" } @@ -1336,113 +1182,142 @@ export const OperationDisplay: msRest.CompositeMapper = { } }; -export const Operation: msRest.CompositeMapper = { - serializedName: "Operation", +export const IotHubSkuDescription: coreClient.CompositeMapper = { type: { name: "Composite", - className: "Operation", + className: "IotHubSkuDescription", modelProperties: { - name: { + resourceType: { + serializedName: "resourceType", readOnly: true, - serializedName: "name", type: { name: "String" } }, - display: { - serializedName: "display", + sku: { + serializedName: "sku", type: { name: "Composite", - className: "OperationDisplay" + className: "IotHubSkuInfo" + } + }, + capacity: { + serializedName: "capacity", + type: { + name: "Composite", + className: "IotHubCapacity" } } } } }; -export const ErrorDetails: msRest.CompositeMapper = { - serializedName: "ErrorDetails", +export const IotHubCapacity: coreClient.CompositeMapper = { type: { name: "Composite", - className: "ErrorDetails", + className: "IotHubCapacity", modelProperties: { - code: { + minimum: { + constraints: { + InclusiveMaximum: 1, + InclusiveMinimum: 1 + }, + serializedName: "minimum", readOnly: true, - serializedName: "code", type: { - name: "String" + name: "Number" } }, - httpStatusCode: { + maximum: { + serializedName: "maximum", readOnly: true, - serializedName: "httpStatusCode", type: { - name: "String" + name: "Number" } }, - message: { + default: { + serializedName: "default", readOnly: true, - serializedName: "message", type: { - name: "String" + name: "Number" } }, - details: { + scaleType: { + serializedName: "scaleType", readOnly: true, - serializedName: "details", type: { - name: "String" + name: "Enum", + allowedValues: ["Automatic", "Manual", "None"] } } } } }; -export const IotHubQuotaMetricInfo: msRest.CompositeMapper = { - serializedName: "IotHubQuotaMetricInfo", +export const EventHubConsumerGroupsListResult: coreClient.CompositeMapper = { type: { name: "Composite", - className: "IotHubQuotaMetricInfo", + className: "EventHubConsumerGroupsListResult", 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: "EventHubConsumerGroupInfo" + } + } } }, - maxValue: { + nextLink: { + serializedName: "nextLink", readOnly: true, - serializedName: "maxValue", type: { - name: "Number" + name: "String" } } } } }; -export const EndpointHealthData: msRest.CompositeMapper = { - serializedName: "EndpointHealthData", +export const EventHubConsumerGroupInfo: coreClient.CompositeMapper = { type: { name: "Composite", - className: "EndpointHealthData", + className: "EventHubConsumerGroupInfo", modelProperties: { - endpointId: { - serializedName: "endpointId", + properties: { + serializedName: "properties", + type: { + name: "Dictionary", + value: { type: { name: "String" } } + } + }, + id: { + serializedName: "id", + readOnly: true, type: { name: "String" } }, - healthStatus: { - serializedName: "healthStatus", + name: { + serializedName: "name", + readOnly: true, + type: { + name: "String" + } + }, + type: { + serializedName: "type", + readOnly: true, + type: { + name: "String" + } + }, + etag: { + serializedName: "etag", + readOnly: true, type: { name: "String" } @@ -1451,74 +1326,70 @@ export const EndpointHealthData: msRest.CompositeMapper = { } }; -export const RegistryStatistics: msRest.CompositeMapper = { - serializedName: "RegistryStatistics", +export const JobResponseListResult: coreClient.CompositeMapper = { type: { name: "Composite", - className: "RegistryStatistics", + className: "JobResponseListResult", modelProperties: { - totalDeviceCount: { - readOnly: true, - serializedName: "totalDeviceCount", - type: { - name: "Number" - } - }, - enabledDeviceCount: { - readOnly: true, - serializedName: "enabledDeviceCount", + value: { + serializedName: "value", type: { - name: "Number" + name: "Sequence", + element: { + type: { + name: "Composite", + className: "JobResponse" + } + } } }, - disabledDeviceCount: { + nextLink: { + serializedName: "nextLink", readOnly: true, - serializedName: "disabledDeviceCount", type: { - name: "Number" + name: "String" } } } } }; -export const JobResponse: msRest.CompositeMapper = { - serializedName: "JobResponse", +export const JobResponse: coreClient.CompositeMapper = { type: { name: "Composite", className: "JobResponse", modelProperties: { jobId: { - readOnly: true, serializedName: "jobId", + readOnly: true, type: { name: "String" } }, startTimeUtc: { - readOnly: true, serializedName: "startTimeUtc", + readOnly: true, type: { name: "DateTimeRfc1123" } }, endTimeUtc: { - readOnly: true, serializedName: "endTimeUtc", + readOnly: true, type: { name: "DateTimeRfc1123" } }, type: { - readOnly: true, serializedName: "type", + readOnly: true, type: { name: "String" } }, status: { - readOnly: true, serializedName: "status", + readOnly: true, type: { name: "Enum", allowedValues: [ @@ -1532,22 +1403,22 @@ export const JobResponse: msRest.CompositeMapper = { } }, failureReason: { - readOnly: true, serializedName: "failureReason", + readOnly: true, type: { name: "String" } }, statusMessage: { - readOnly: true, serializedName: "statusMessage", + readOnly: true, type: { name: "String" } }, parentJobId: { - readOnly: true, serializedName: "parentJobId", + readOnly: true, type: { name: "String" } @@ -1556,148 +1427,105 @@ export const JobResponse: msRest.CompositeMapper = { } }; -export const IotHubCapacity: msRest.CompositeMapper = { - serializedName: "IotHubCapacity", +export const IotHubQuotaMetricInfoListResult: coreClient.CompositeMapper = { type: { name: "Composite", - className: "IotHubCapacity", + className: "IotHubQuotaMetricInfoListResult", modelProperties: { - minimum: { - readOnly: true, - serializedName: "minimum", - constraints: { - InclusiveMaximum: 1, - InclusiveMinimum: 1 - }, + value: { + serializedName: "value", type: { - name: "Number" + name: "Sequence", + element: { + type: { + name: "Composite", + className: "IotHubQuotaMetricInfo" + } + } } }, - maximum: { + nextLink: { + serializedName: "nextLink", readOnly: true, - serializedName: "maximum", - type: { - name: "Number" - } - }, - default: { - readOnly: true, - serializedName: "default", type: { - name: "Number" - } - }, - scaleType: { - readOnly: true, - serializedName: "scaleType", - type: { - name: "Enum", - allowedValues: [ - "Automatic", - "Manual", - "None" - ] + name: "String" } } } } }; -export const IotHubSkuDescription: msRest.CompositeMapper = { - serializedName: "IotHubSkuDescription", +export const IotHubQuotaMetricInfo: coreClient.CompositeMapper = { type: { name: "Composite", - className: "IotHubSkuDescription", + className: "IotHubQuotaMetricInfo", modelProperties: { - resourceType: { + name: { + serializedName: "name", readOnly: true, - serializedName: "resourceType", type: { name: "String" } }, - sku: { - required: true, - serializedName: "sku", + currentValue: { + serializedName: "currentValue", + readOnly: true, type: { - name: "Composite", - className: "IotHubSkuInfo" + name: "Number" } }, - capacity: { - required: true, - serializedName: "capacity", + maxValue: { + serializedName: "maxValue", + readOnly: true, type: { - name: "Composite", - className: "IotHubCapacity" + name: "Number" } } } } }; -export const TagsResource: msRest.CompositeMapper = { - serializedName: "TagsResource", +export const EndpointHealthDataListResult: coreClient.CompositeMapper = { type: { name: "Composite", - className: "TagsResource", + className: "EndpointHealthDataListResult", modelProperties: { - tags: { - serializedName: "tags", + value: { + serializedName: "value", type: { - name: "Dictionary", - value: { + name: "Sequence", + element: { type: { - name: "String" + name: "Composite", + className: "EndpointHealthData" } } } + }, + nextLink: { + serializedName: "nextLink", + readOnly: true, + type: { + name: "String" + } } } } }; -export const EventHubConsumerGroupInfo: msRest.CompositeMapper = { - serializedName: "EventHubConsumerGroupInfo", +export const EndpointHealthData: coreClient.CompositeMapper = { type: { name: "Composite", - className: "EventHubConsumerGroupInfo", + className: "EndpointHealthData", modelProperties: { - properties: { - serializedName: "properties", - type: { - name: "Dictionary", - value: { - type: { - name: "String" - } - } - } - }, - id: { - readOnly: true, - serializedName: "id", - type: { - name: "String" - } - }, - name: { - readOnly: true, - serializedName: "name", - type: { - name: "String" - } - }, - type: { - readOnly: true, - serializedName: "type", + endpointId: { + serializedName: "endpointId", type: { name: "String" } }, - etag: { - readOnly: true, - serializedName: "etag", + healthStatus: { + serializedName: "healthStatus", type: { name: "String" } @@ -1706,15 +1534,14 @@ export const EventHubConsumerGroupInfo: msRest.CompositeMapper = { } }; -export const OperationInputs: msRest.CompositeMapper = { - serializedName: "OperationInputs", +export const OperationInputs: coreClient.CompositeMapper = { type: { name: "Composite", className: "OperationInputs", modelProperties: { name: { - required: true, serializedName: "name", + required: true, type: { name: "String" } @@ -1723,28 +1550,24 @@ export const OperationInputs: msRest.CompositeMapper = { } }; -export const IotHubNameAvailabilityInfo: msRest.CompositeMapper = { - serializedName: "IotHubNameAvailabilityInfo", +export const IotHubNameAvailabilityInfo: coreClient.CompositeMapper = { type: { name: "Composite", className: "IotHubNameAvailabilityInfo", modelProperties: { nameAvailable: { - readOnly: true, serializedName: "nameAvailable", + readOnly: true, type: { name: "Boolean" } }, reason: { - readOnly: true, serializedName: "reason", + readOnly: true, type: { name: "Enum", - allowedValues: [ - "Invalid", - "AlreadyExists" - ] + allowedValues: ["Invalid", "AlreadyExists"] } }, message: { @@ -1757,20 +1580,26 @@ export const IotHubNameAvailabilityInfo: msRest.CompositeMapper = { } }; -export const Name: msRest.CompositeMapper = { - serializedName: "Name", +export const UserSubscriptionQuotaListResult: coreClient.CompositeMapper = { type: { name: "Composite", - className: "Name", + className: "UserSubscriptionQuotaListResult", modelProperties: { value: { serializedName: "value", type: { - name: "String" + name: "Sequence", + element: { + type: { + name: "Composite", + className: "UserSubscriptionQuota" + } + } } }, - localizedValue: { - serializedName: "localizedValue", + nextLink: { + serializedName: "nextLink", + readOnly: true, type: { name: "String" } @@ -1779,8 +1608,7 @@ export const Name: msRest.CompositeMapper = { } }; -export const UserSubscriptionQuota: msRest.CompositeMapper = { - serializedName: "UserSubscriptionQuota", +export const UserSubscriptionQuota: coreClient.CompositeMapper = { type: { name: "Composite", className: "UserSubscriptionQuota", @@ -1826,27 +1654,19 @@ export const UserSubscriptionQuota: msRest.CompositeMapper = { } }; -export const UserSubscriptionQuotaListResult: msRest.CompositeMapper = { - serializedName: "UserSubscriptionQuotaListResult", +export const Name: coreClient.CompositeMapper = { type: { name: "Composite", - className: "UserSubscriptionQuotaListResult", + className: "Name", modelProperties: { value: { serializedName: "value", type: { - name: "Sequence", - element: { - type: { - name: "Composite", - className: "UserSubscriptionQuota" - } - } + name: "String" } }, - nextLink: { - readOnly: true, - serializedName: "nextLink", + localizedValue: { + serializedName: "localizedValue", type: { name: "String" } @@ -1855,68 +1675,65 @@ export const UserSubscriptionQuotaListResult: msRest.CompositeMapper = { } }; -export const RoutingMessage: msRest.CompositeMapper = { - serializedName: "RoutingMessage", +export const TestAllRoutesInput: coreClient.CompositeMapper = { type: { name: "Composite", - className: "RoutingMessage", + className: "TestAllRoutesInput", modelProperties: { - body: { - serializedName: "body", + routingSource: { + serializedName: "routingSource", type: { name: "String" } }, - appProperties: { - serializedName: "appProperties", + message: { + serializedName: "message", type: { - name: "Dictionary", - value: { - type: { - name: "String" - } - } + name: "Composite", + className: "RoutingMessage" } }, - systemProperties: { - serializedName: "systemProperties", + twin: { + serializedName: "twin", type: { - name: "Dictionary", - value: { - type: { - name: "String" - } - } + name: "Composite", + className: "RoutingTwin" } } } } }; -export const RoutingTwinProperties: msRest.CompositeMapper = { - serializedName: "RoutingTwin_properties", +export const RoutingMessage: coreClient.CompositeMapper = { type: { name: "Composite", - className: "RoutingTwinProperties", + className: "RoutingMessage", modelProperties: { - desired: { - serializedName: "desired", + body: { + serializedName: "body", type: { - name: "Object" + name: "String" } }, - reported: { - serializedName: "reported", + appProperties: { + serializedName: "appProperties", + type: { + name: "Dictionary", + value: { type: { name: "String" } } + } + }, + systemProperties: { + serializedName: "systemProperties", type: { - name: "Object" + name: "Dictionary", + value: { type: { name: "String" } } } } } } }; -export const RoutingTwin: msRest.CompositeMapper = { - serializedName: "RoutingTwin", +export const RoutingTwin: coreClient.CompositeMapper = { type: { name: "Composite", className: "RoutingTwin", @@ -1924,7 +1741,8 @@ export const RoutingTwin: msRest.CompositeMapper = { tags: { serializedName: "tags", type: { - name: "Object" + name: "Dictionary", + value: { type: { name: "any" } } } }, properties: { @@ -1938,55 +1756,30 @@ export const RoutingTwin: msRest.CompositeMapper = { } }; -export const TestAllRoutesInput: msRest.CompositeMapper = { - serializedName: "TestAllRoutesInput", +export const RoutingTwinProperties: coreClient.CompositeMapper = { type: { name: "Composite", - className: "TestAllRoutesInput", + className: "RoutingTwinProperties", modelProperties: { - routingSource: { - serializedName: "routingSource", - type: { - name: "String" - } - }, - message: { - serializedName: "message", + desired: { + serializedName: "desired", type: { - name: "Composite", - className: "RoutingMessage" + name: "Dictionary", + value: { type: { name: "any" } } } }, - twin: { - serializedName: "twin", - type: { - name: "Composite", - className: "RoutingTwin" - } - } - } - } -}; - -export const MatchedRoute: msRest.CompositeMapper = { - serializedName: "MatchedRoute", - type: { - name: "Composite", - className: "MatchedRoute", - modelProperties: { - properties: { - serializedName: "properties", + reported: { + serializedName: "reported", type: { - name: "Composite", - className: "RouteProperties" + name: "Dictionary", + value: { type: { name: "any" } } } } } } }; -export const TestAllRoutesResult: msRest.CompositeMapper = { - serializedName: "TestAllRoutesResult", +export const TestAllRoutesResult: coreClient.CompositeMapper = { type: { name: "Composite", className: "TestAllRoutesResult", @@ -2007,8 +1800,23 @@ export const TestAllRoutesResult: msRest.CompositeMapper = { } }; -export const TestRouteInput: msRest.CompositeMapper = { - serializedName: "TestRouteInput", +export const MatchedRoute: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "MatchedRoute", + modelProperties: { + properties: { + serializedName: "properties", + type: { + name: "Composite", + className: "RouteProperties" + } + } + } + } +}; + +export const TestRouteInput: coreClient.CompositeMapper = { type: { name: "Composite", className: "TestRouteInput", @@ -2021,7 +1829,6 @@ export const TestRouteInput: msRest.CompositeMapper = { } }, route: { - required: true, serializedName: "route", type: { name: "Composite", @@ -2039,54 +1846,50 @@ export const TestRouteInput: msRest.CompositeMapper = { } }; -export const RouteErrorPosition: msRest.CompositeMapper = { - serializedName: "RouteErrorPosition", +export const TestRouteResult: coreClient.CompositeMapper = { type: { name: "Composite", - className: "RouteErrorPosition", + className: "TestRouteResult", modelProperties: { - line: { - serializedName: "line", + result: { + serializedName: "result", type: { - name: "Number" + name: "String" } }, - column: { - serializedName: "column", + details: { + serializedName: "details", type: { - name: "Number" + name: "Composite", + className: "TestRouteResultDetails" } } } } }; -export const RouteErrorRange: msRest.CompositeMapper = { - serializedName: "RouteErrorRange", +export const TestRouteResultDetails: coreClient.CompositeMapper = { type: { name: "Composite", - className: "RouteErrorRange", + className: "TestRouteResultDetails", modelProperties: { - start: { - serializedName: "start", - type: { - name: "Composite", - className: "RouteErrorPosition" - } - }, - end: { - serializedName: "end", + compilationErrors: { + serializedName: "compilationErrors", type: { - name: "Composite", - className: "RouteErrorPosition" + name: "Sequence", + element: { + type: { + name: "Composite", + className: "RouteCompilationError" + } + } } } } } }; -export const RouteCompilationError: msRest.CompositeMapper = { - serializedName: "RouteCompilationError", +export const RouteCompilationError: coreClient.CompositeMapper = { type: { name: "Composite", className: "RouteCompilationError", @@ -2114,67 +1917,93 @@ export const RouteCompilationError: msRest.CompositeMapper = { } }; -export const TestRouteResultDetails: msRest.CompositeMapper = { - serializedName: "TestRouteResultDetails", +export const RouteErrorRange: coreClient.CompositeMapper = { type: { name: "Composite", - className: "TestRouteResultDetails", + className: "RouteErrorRange", modelProperties: { - compilationErrors: { - serializedName: "compilationErrors", + start: { + serializedName: "start", type: { - name: "Sequence", - element: { - type: { - name: "Composite", - className: "RouteCompilationError" - } - } + name: "Composite", + className: "RouteErrorPosition" + } + }, + end: { + serializedName: "end", + type: { + name: "Composite", + className: "RouteErrorPosition" } } } } }; -export const TestRouteResult: msRest.CompositeMapper = { - serializedName: "TestRouteResult", +export const RouteErrorPosition: coreClient.CompositeMapper = { type: { name: "Composite", - className: "TestRouteResult", + className: "RouteErrorPosition", modelProperties: { - result: { - serializedName: "result", + line: { + serializedName: "line", type: { - name: "String" + name: "Number" } }, - details: { - serializedName: "details", + column: { + serializedName: "column", type: { - name: "Composite", - className: "TestRouteResultDetails" + name: "Number" + } + } + } + } +}; + +export const SharedAccessSignatureAuthorizationRuleListResult: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "SharedAccessSignatureAuthorizationRuleListResult", + modelProperties: { + value: { + serializedName: "value", + type: { + name: "Sequence", + element: { + type: { + name: "Composite", + className: "SharedAccessSignatureAuthorizationRule" + } + } + } + }, + nextLink: { + serializedName: "nextLink", + readOnly: true, + type: { + name: "String" } } } } }; -export const ExportDevicesRequest: msRest.CompositeMapper = { - serializedName: "ExportDevicesRequest", +export const ExportDevicesRequest: coreClient.CompositeMapper = { type: { name: "Composite", className: "ExportDevicesRequest", modelProperties: { exportBlobContainerUri: { - required: true, serializedName: "exportBlobContainerUri", + required: true, type: { name: "String" } }, excludeKeys: { - required: true, serializedName: "excludeKeys", + required: true, type: { name: "Boolean" } @@ -2183,22 +2012,21 @@ export const ExportDevicesRequest: msRest.CompositeMapper = { } }; -export const ImportDevicesRequest: msRest.CompositeMapper = { - serializedName: "ImportDevicesRequest", +export const ImportDevicesRequest: coreClient.CompositeMapper = { type: { name: "Composite", className: "ImportDevicesRequest", modelProperties: { inputBlobContainerUri: { - required: true, serializedName: "inputBlobContainerUri", + required: true, type: { name: "String" } }, outputBlobContainerUri: { - required: true, serializedName: "outputBlobContainerUri", + required: true, type: { name: "String" } @@ -2207,45 +2035,63 @@ export const ImportDevicesRequest: msRest.CompositeMapper = { } }; -export const FailoverInput: msRest.CompositeMapper = { - serializedName: "FailoverInput", +export const CertificateListDescription: coreClient.CompositeMapper = { type: { name: "Composite", - className: "FailoverInput", + className: "CertificateListDescription", modelProperties: { - failoverRegion: { - required: true, - serializedName: "failoverRegion", + value: { + serializedName: "value", type: { - name: "String" + name: "Sequence", + element: { + type: { + name: "Composite", + className: "CertificateDescription" + } + } } } } } }; -export const OperationListResult: msRest.CompositeMapper = { - serializedName: "OperationListResult", +export const CertificateDescription: coreClient.CompositeMapper = { type: { name: "Composite", - className: "OperationListResult", + className: "CertificateDescription", modelProperties: { - value: { + properties: { + serializedName: "properties", + type: { + name: "Composite", + className: "CertificateProperties" + } + }, + id: { + serializedName: "id", readOnly: true, - serializedName: "", type: { - name: "Sequence", - element: { - type: { - name: "Composite", - className: "Operation" - } - } + name: "String" } }, - nextLink: { + name: { + serializedName: "name", + readOnly: true, + type: { + name: "String" + } + }, + etag: { + serializedName: "etag", + readOnly: true, + type: { + name: "String" + } + }, + type: { + serializedName: "type", readOnly: true, - serializedName: "nextLink", type: { name: "String" } @@ -2254,27 +2100,55 @@ export const OperationListResult: msRest.CompositeMapper = { } }; -export const IotHubDescriptionListResult: msRest.CompositeMapper = { - serializedName: "IotHubDescriptionListResult", +export const CertificateProperties: coreClient.CompositeMapper = { type: { name: "Composite", - className: "IotHubDescriptionListResult", + className: "CertificateProperties", modelProperties: { - value: { - serializedName: "", + subject: { + serializedName: "subject", + readOnly: true, type: { - name: "Sequence", - element: { - type: { - name: "Composite", - className: "IotHubDescription" - } - } + name: "String" } }, - nextLink: { + expiry: { + serializedName: "expiry", + readOnly: true, + type: { + name: "DateTimeRfc1123" + } + }, + thumbprint: { + serializedName: "thumbprint", readOnly: true, - serializedName: "nextLink", + type: { + name: "String" + } + }, + isVerified: { + serializedName: "isVerified", + readOnly: true, + type: { + name: "Boolean" + } + }, + created: { + serializedName: "created", + readOnly: true, + type: { + name: "DateTimeRfc1123" + } + }, + updated: { + serializedName: "updated", + readOnly: true, + type: { + name: "DateTimeRfc1123" + } + }, + certificate: { + serializedName: "certificate", type: { name: "String" } @@ -2283,27 +2157,13 @@ export const IotHubDescriptionListResult: msRest.CompositeMapper = { } }; -export const IotHubSkuDescriptionListResult: msRest.CompositeMapper = { - serializedName: "IotHubSkuDescriptionListResult", +export const CertificateBodyDescription: coreClient.CompositeMapper = { type: { name: "Composite", - className: "IotHubSkuDescriptionListResult", + className: "CertificateBodyDescription", modelProperties: { - value: { - serializedName: "", - type: { - name: "Sequence", - element: { - type: { - name: "Composite", - className: "IotHubSkuDescription" - } - } - } - }, - nextLink: { - readOnly: true, - serializedName: "nextLink", + certificate: { + serializedName: "certificate", type: { name: "String" } @@ -2312,27 +2172,42 @@ export const IotHubSkuDescriptionListResult: msRest.CompositeMapper = { } }; -export const EventHubConsumerGroupsListResult: msRest.CompositeMapper = { - serializedName: "EventHubConsumerGroupsListResult", +export const CertificateWithNonceDescription: coreClient.CompositeMapper = { type: { name: "Composite", - className: "EventHubConsumerGroupsListResult", + className: "CertificateWithNonceDescription", modelProperties: { - value: { - serializedName: "", + properties: { + serializedName: "properties", type: { - name: "Sequence", - element: { - type: { - name: "Composite", - className: "EventHubConsumerGroupInfo" - } - } + name: "Composite", + className: "CertificatePropertiesWithNonce" } }, - nextLink: { + id: { + serializedName: "id", + readOnly: true, + type: { + name: "String" + } + }, + name: { + serializedName: "name", + readOnly: true, + type: { + name: "String" + } + }, + etag: { + serializedName: "etag", + readOnly: true, + type: { + name: "String" + } + }, + type: { + serializedName: "type", readOnly: true, - serializedName: "nextLink", type: { name: "String" } @@ -2341,27 +2216,63 @@ export const EventHubConsumerGroupsListResult: msRest.CompositeMapper = { } }; -export const JobResponseListResult: msRest.CompositeMapper = { - serializedName: "JobResponseListResult", +export const CertificatePropertiesWithNonce: coreClient.CompositeMapper = { type: { name: "Composite", - className: "JobResponseListResult", + className: "CertificatePropertiesWithNonce", modelProperties: { - value: { - serializedName: "", + subject: { + serializedName: "subject", + readOnly: true, type: { - name: "Sequence", - element: { - type: { - name: "Composite", - className: "JobResponse" - } - } + name: "String" } }, - nextLink: { + expiry: { + serializedName: "expiry", + readOnly: true, + type: { + name: "DateTimeRfc1123" + } + }, + thumbprint: { + serializedName: "thumbprint", + readOnly: true, + type: { + name: "String" + } + }, + isVerified: { + serializedName: "isVerified", + readOnly: true, + type: { + name: "Boolean" + } + }, + created: { + serializedName: "created", + readOnly: true, + type: { + name: "DateTimeRfc1123" + } + }, + updated: { + serializedName: "updated", + readOnly: true, + type: { + name: "DateTimeRfc1123" + } + }, + verificationCode: { + serializedName: "verificationCode", + readOnly: true, + type: { + name: "String" + } + }, + certificate: { + serializedName: "certificate", readOnly: true, - serializedName: "nextLink", type: { name: "String" } @@ -2370,27 +2281,13 @@ export const JobResponseListResult: msRest.CompositeMapper = { } }; -export const IotHubQuotaMetricInfoListResult: msRest.CompositeMapper = { - serializedName: "IotHubQuotaMetricInfoListResult", +export const CertificateVerificationDescription: coreClient.CompositeMapper = { type: { name: "Composite", - className: "IotHubQuotaMetricInfoListResult", + className: "CertificateVerificationDescription", modelProperties: { - value: { - serializedName: "", - type: { - name: "Sequence", - element: { - type: { - name: "Composite", - className: "IotHubQuotaMetricInfo" - } - } - } - }, - nextLink: { - readOnly: true, - serializedName: "nextLink", + certificate: { + serializedName: "certificate", type: { name: "String" } @@ -2399,27 +2296,14 @@ export const IotHubQuotaMetricInfoListResult: msRest.CompositeMapper = { } }; -export const EndpointHealthDataListResult: msRest.CompositeMapper = { - serializedName: "EndpointHealthDataListResult", +export const FailoverInput: coreClient.CompositeMapper = { type: { name: "Composite", - className: "EndpointHealthDataListResult", + className: "FailoverInput", modelProperties: { - value: { - serializedName: "", - type: { - name: "Sequence", - element: { - type: { - name: "Composite", - className: "EndpointHealthData" - } - } - } - }, - nextLink: { - readOnly: true, - serializedName: "nextLink", + failoverRegion: { + serializedName: "failoverRegion", + required: true, type: { name: "String" } @@ -2428,29 +2312,30 @@ export const EndpointHealthDataListResult: msRest.CompositeMapper = { } }; -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" } } } diff --git a/sdk/iothub/arm-iothub-profile-2020-09-01-hybrid/src/models/operationsMappers.ts b/sdk/iothub/arm-iothub-profile-2020-09-01-hybrid/src/models/operationsMappers.ts deleted file mode 100644 index 5d69c8a954f1..000000000000 --- a/sdk/iothub/arm-iothub-profile-2020-09-01-hybrid/src/models/operationsMappers.ts +++ /dev/null @@ -1,14 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for license information. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -export { - ErrorDetails, - Operation, - OperationDisplay, - OperationListResult -} from "../models/mappers"; diff --git a/sdk/iothub/arm-iothub-profile-2020-09-01-hybrid/src/models/parameters.ts b/sdk/iothub/arm-iothub-profile-2020-09-01-hybrid/src/models/parameters.ts index d31ab76d3439..5c7125aa8be7 100644 --- a/sdk/iothub/arm-iothub-profile-2020-09-01-hybrid/src/models/parameters.ts +++ b/sdk/iothub/arm-iothub-profile-2020-09-01-hybrid/src/models/parameters.ts @@ -1,158 +1,258 @@ /* - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for - * license information. + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. * * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is - * regenerated. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. */ -import * as msRest from "@azure/ms-rest-js"; +import { + OperationParameter, + OperationURLParameter, + OperationQueryParameter +} from "@azure/core-client"; +import { + IotHubDescription as IotHubDescriptionMapper, + TagsResource as TagsResourceMapper, + OperationInputs as OperationInputsMapper, + TestAllRoutesInput as TestAllRoutesInputMapper, + TestRouteInput as TestRouteInputMapper, + ExportDevicesRequest as ExportDevicesRequestMapper, + ImportDevicesRequest as ImportDevicesRequestMapper, + CertificateBodyDescription as CertificateBodyDescriptionMapper, + CertificateVerificationDescription as CertificateVerificationDescriptionMapper, + FailoverInput as FailoverInputMapper +} 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: "2019-07-01-preview", + 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, - serializedName: "certificateName", - constraints: { - Pattern: /^[A-Za-z0-9-._]{1,64}$/ - }, type: { name: "String" } - } + }, + skipEncoding: true }; -export const eventHubEndpointName: msRest.OperationURLParameter = { - parameterPath: "eventHubEndpointName", + +export const subscriptionId: OperationURLParameter = { + parameterPath: "subscriptionId", mapper: { + serializedName: "subscriptionId", required: true, - serializedName: "eventHubEndpointName", type: { name: "String" } } }; -export const ifMatch0: msRest.OperationParameter = { - parameterPath: [ - "options", - "ifMatch" - ], + +export const resourceGroupName: OperationURLParameter = { + parameterPath: "resourceGroupName", mapper: { - serializedName: "If-Match", + serializedName: "resourceGroupName", + required: true, type: { name: "String" } } }; -export const ifMatch1: msRest.OperationParameter = { - parameterPath: "ifMatch", + +export const resourceName: OperationURLParameter = { + parameterPath: "resourceName", mapper: { + serializedName: "resourceName", required: true, - serializedName: "If-Match", type: { name: "String" } } }; -export const iotHubName: msRest.OperationURLParameter = { - parameterPath: "iotHubName", + +export const contentType: OperationParameter = { + parameterPath: ["options", "contentType"], mapper: { - required: true, - serializedName: "iotHubName", + defaultValue: "application/json", + isConstant: true, + serializedName: "Content-Type", type: { name: "String" } } }; -export const jobId: msRest.OperationURLParameter = { - parameterPath: "jobId", + +export const iotHubDescription: OperationParameter = { + parameterPath: "iotHubDescription", + mapper: IotHubDescriptionMapper +}; + +export const ifMatch: OperationParameter = { + parameterPath: ["options", "ifMatch"], mapper: { - required: true, - serializedName: "jobId", + serializedName: "If-Match", type: { name: "String" } } }; -export const keyName: msRest.OperationURLParameter = { - parameterPath: "keyName", + +export const iotHubTags: OperationParameter = { + parameterPath: "iotHubTags", + mapper: TagsResourceMapper +}; + +export const eventHubEndpointName: OperationURLParameter = { + parameterPath: "eventHubEndpointName", mapper: { + serializedName: "eventHubEndpointName", required: true, - serializedName: "keyName", type: { name: "String" } } }; -export const name: msRest.OperationURLParameter = { + +export const name: OperationURLParameter = { parameterPath: "name", mapper: { - required: true, serializedName: "name", + required: true, type: { name: "String" } } }; -export const nextPageLink: msRest.OperationURLParameter = { - parameterPath: "nextPageLink", + +export const jobId: OperationURLParameter = { + parameterPath: "jobId", mapper: { + serializedName: "jobId", required: true, - serializedName: "nextLink", type: { name: "String" } - }, - skipEncoding: true + } }; -export const resourceGroupName: msRest.OperationURLParameter = { - parameterPath: "resourceGroupName", + +export const iotHubName: OperationURLParameter = { + parameterPath: "iotHubName", mapper: { + serializedName: "iotHubName", required: true, - serializedName: "resourceGroupName", type: { name: "String" } } }; -export const resourceName: msRest.OperationURLParameter = { - parameterPath: "resourceName", + +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: "resourceName", type: { name: "String" } } }; -export const subscriptionId: msRest.OperationURLParameter = { - parameterPath: "subscriptionId", + +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, + type: { + name: "String" + } + } +}; + +export const certificateDescription: OperationParameter = { + parameterPath: "certificateDescription", + mapper: CertificateBodyDescriptionMapper +}; + +export const ifMatch1: OperationParameter = { + parameterPath: "ifMatch", + mapper: { + serializedName: "If-Match", required: true, - serializedName: "subscriptionId", type: { name: "String" } } }; + +export const certificateVerificationBody: OperationParameter = { + parameterPath: "certificateVerificationBody", + mapper: CertificateVerificationDescriptionMapper +}; + +export const failoverInput: OperationParameter = { + parameterPath: "failoverInput", + mapper: FailoverInputMapper +}; diff --git a/sdk/iothub/arm-iothub-profile-2020-09-01-hybrid/src/models/resourceProviderCommonMappers.ts b/sdk/iothub/arm-iothub-profile-2020-09-01-hybrid/src/models/resourceProviderCommonMappers.ts deleted file mode 100644 index 232343c4f750..000000000000 --- a/sdk/iothub/arm-iothub-profile-2020-09-01-hybrid/src/models/resourceProviderCommonMappers.ts +++ /dev/null @@ -1,14 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for license information. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -export { - ErrorDetails, - Name, - UserSubscriptionQuota, - UserSubscriptionQuotaListResult -} from "../models/mappers"; diff --git a/sdk/iothub/arm-iothub-profile-2020-09-01-hybrid/src/operations/certificates.ts b/sdk/iothub/arm-iothub-profile-2020-09-01-hybrid/src/operations/certificates.ts index dfcd53e97373..a1822f4a2991 100644 --- a/sdk/iothub/arm-iothub-profile-2020-09-01-hybrid/src/operations/certificates.ts +++ b/sdk/iothub/arm-iothub-profile-2020-09-01-hybrid/src/operations/certificates.ts @@ -1,130 +1,95 @@ /* - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for - * license information. + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. * * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is - * regenerated. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. */ -import * as msRest from "@azure/ms-rest-js"; -import * as Models from "../models"; -import * as Mappers from "../models/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, + CertificateBodyDescription, + 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 { + listByIotHub( + resourceGroupName: string, + resourceName: string, + 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 { + get( + resourceGroupName: string, + resourceName: string, + certificateName: string, + 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 certificateDescription The certificate body. - * @param [options] The optional parameters - * @returns Promise + * @param options The options parameters. */ - createOrUpdate(resourceGroupName: string, resourceName: string, certificateName: string, certificateDescription: Models.CertificateBodyDescription, 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 certificateDescription The certificate body. - * @param callback The callback - */ - createOrUpdate(resourceGroupName: string, resourceName: string, certificateName: string, certificateDescription: Models.CertificateBodyDescription, 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 certificateDescription The certificate body. - * @param options The optional parameters - * @param callback The callback - */ - createOrUpdate(resourceGroupName: string, resourceName: string, certificateName: string, certificateDescription: Models.CertificateBodyDescription, options: Models.CertificatesCreateOrUpdateOptionalParams, callback: msRest.ServiceCallback): void; - createOrUpdate(resourceGroupName: string, resourceName: string, certificateName: string, certificateDescription: Models.CertificateBodyDescription, options?: Models.CertificatesCreateOrUpdateOptionalParams | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { + createOrUpdate( + resourceGroupName: string, + resourceName: string, + certificateName: string, + certificateDescription: CertificateBodyDescription, + options?: CertificatesCreateOrUpdateOptionalParams + ): Promise { return this.client.sendOperationRequest( { resourceGroupName, @@ -133,156 +98,91 @@ export class Certificates { 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 - */ - deleteMethod(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 + * @param options The options parameters. */ - 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 { + delete( + resourceGroupName: string, + resourceName: string, + certificateName: string, + ifMatch: string, + 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 + * @param options The options parameters. */ - 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 - */ - 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 { + generateVerificationCode( + resourceGroupName: string, + resourceName: string, + certificateName: string, + ifMatch: string, + 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 certificateVerificationBody 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, certificateVerificationBody: Models.CertificateVerificationDescription, ifMatch: string, options?: msRest.RequestOptionsBase): 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 certificateVerificationBody The name of the certificate * @param ifMatch ETag of the Certificate. - * @param callback The callback - */ - verify(resourceGroupName: string, resourceName: string, certificateName: string, certificateVerificationBody: Models.CertificateVerificationDescription, 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 certificateVerificationBody 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. */ - verify(resourceGroupName: string, resourceName: string, certificateName: string, certificateVerificationBody: Models.CertificateVerificationDescription, ifMatch: string, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; - verify(resourceGroupName: string, resourceName: string, certificateName: string, certificateVerificationBody: Models.CertificateVerificationDescription, ifMatch: string, options?: msRest.RequestOptionsBase | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { + verify( + resourceGroupName: string, + resourceName: string, + certificateName: string, + ifMatch: string, + certificateVerificationBody: CertificateVerificationDescription, + options?: CertificatesVerifyOptionalParams + ): Promise { return this.client.sendOperationRequest( { resourceGroupName, resourceName, certificateName, - certificateVerificationBody, ifMatch, + certificateVerificationBody, options }, - verifyOperationSpec, - callback) as Promise; + verifyOperationSpec + ); } } - // Operation Specifications -const serializer = new msRest.Serializer(Mappers); -const listByIotHubOperationSpec: msRest.OperationSpec = { +const serializer = coreClient.createSerializer(Mappers, /* isXml */ false); + +const listByIotHubOperationSpec: coreClient.OperationSpec = { + path: + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Devices/IotHubs/{resourceName}/certificates", httpMethod: "GET", - path: "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Devices/IotHubs/{resourceName}/certificates", - urlParameters: [ - Parameters.subscriptionId, - Parameters.resourceGroupName, - Parameters.resourceName - ], - queryParameters: [ - Parameters.apiVersion - ], - headerParameters: [ - Parameters.acceptLanguage - ], responses: { 200: { bodyMapper: Mappers.CertificateListDescription @@ -291,24 +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 - ], - queryParameters: [ - Parameters.apiVersion - ], - headerParameters: [ - Parameters.acceptLanguage + Parameters.resourceName ], + 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 @@ -317,32 +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: "certificateDescription", - mapper: { - ...Mappers.CertificateBodyDescription, - 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 @@ -354,25 +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 + 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: {}, @@ -380,25 +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 @@ -407,32 +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: "certificateVerificationBody", - 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 @@ -441,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-profile-2020-09-01-hybrid/src/operations/index.ts b/sdk/iothub/arm-iothub-profile-2020-09-01-hybrid/src/operations/index.ts index 9c561acd7985..62d8108cc3cd 100644 --- a/sdk/iothub/arm-iothub-profile-2020-09-01-hybrid/src/operations/index.ts +++ b/sdk/iothub/arm-iothub-profile-2020-09-01-hybrid/src/operations/index.ts @@ -1,11 +1,9 @@ /* - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for - * license information. + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. * * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is - * regenerated. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. */ export * from "./operations"; diff --git a/sdk/iothub/arm-iothub-profile-2020-09-01-hybrid/src/operations/iotHub.ts b/sdk/iothub/arm-iothub-profile-2020-09-01-hybrid/src/operations/iotHub.ts index ebb6580774a2..fd68b20f0a56 100644 --- a/sdk/iothub/arm-iothub-profile-2020-09-01-hybrid/src/operations/iotHub.ts +++ b/sdk/iothub/arm-iothub-profile-2020-09-01-hybrid/src/operations/iotHub.ts @@ -1,97 +1,142 @@ /* - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for - * license information. + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. * * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is - * regenerated. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. */ -import * as msRest from "@azure/ms-rest-js"; -import * as msRestAzure from "@azure/ms-rest-azure-js"; -import * as Models from "../models"; -import * as Mappers from "../models/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; } /** * Perform manual fail over of given hub - * @summary Manual Failover Fail over * @param iotHubName IotHub to fail over - * @param failoverInput Region to failover to. Must be a azure DR pair * @param resourceGroupName resource group which Iot Hub belongs to - * @param [options] The optional parameters - * @returns Promise + * @param failoverInput Region to failover to. Must be a azure DR pair + * @param options The options parameters. */ - manualFailover(iotHubName: string, failoverInput: Models.FailoverInput, resourceGroupName: string, options?: msRest.RequestOptionsBase): Promise { - return this.beginManualFailover(iotHubName,failoverInput,resourceGroupName,options) - .then(lroPoller => lroPoller.pollUntilFinished()); + async beginManualFailover( + iotHubName: string, + resourceGroupName: string, + 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 + }); } /** * Perform manual fail over of given hub - * @summary Manual Failover Fail over * @param iotHubName IotHub to fail over - * @param failoverInput Region to failover to. Must be a azure DR pair * @param resourceGroupName resource group which Iot Hub belongs to - * @param [options] The optional parameters - * @returns Promise + * @param failoverInput Region to failover to. Must be a azure DR pair + * @param options The options parameters. */ - beginManualFailover(iotHubName: string, failoverInput: Models.FailoverInput, resourceGroupName: string, options?: msRest.RequestOptionsBase): Promise { - return this.client.sendLRORequest( - { - iotHubName, - failoverInput, - resourceGroupName, - options - }, - beginManualFailoverOperationSpec, - options); + async beginManualFailoverAndWait( + iotHubName: string, + resourceGroupName: string, + 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 = { +const serializer = coreClient.createSerializer(Mappers, /* isXml */ false); + +const manualFailoverOperationSpec: coreClient.OperationSpec = { + path: + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Devices/IotHubs/{iotHubName}/failover", httpMethod: "POST", - 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: "failoverInput", - mapper: { - ...Mappers.FailoverInput, - required: true - } - }, 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-profile-2020-09-01-hybrid/src/operations/iotHubResource.ts b/sdk/iothub/arm-iothub-profile-2020-09-01-hybrid/src/operations/iotHubResource.ts index b89d7ec3f430..9a21145a7450 100644 --- a/sdk/iothub/arm-iothub-profile-2020-09-01-hybrid/src/operations/iotHubResource.ts +++ b/sdk/iothub/arm-iothub-profile-2020-09-01-hybrid/src/operations/iotHubResource.ts @@ -1,1111 +1,1435 @@ /* - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for - * license information. + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. * * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is - * regenerated. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. */ -import * as msRest from "@azure/ms-rest-js"; -import * as msRestAzure from "@azure/ms-rest-azure-js"; -import * as Models from "../models"; -import * as Mappers from "../models/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, + 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 - */ - get(resourceGroupName: string, resourceName: string, options?: msRest.RequestOptionsBase): Promise; + * @param options The options parameters. + */ + public listByResourceGroup( + resourceGroupName: string, + 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, + 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 callback The callback - */ - get(resourceGroupName: string, resourceName: string, callback: msRest.ServiceCallback): void; + * @param options The options parameters. + */ + public listValidSkus( + resourceGroupName: string, + resourceName: string, + 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?: 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 + ); + 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; + } + } + /** + * 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 options The optional parameters - * @param callback The callback - */ - get(resourceGroupName: string, resourceName: string, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; - get(resourceGroupName: string, resourceName: string, options?: msRest.RequestOptionsBase | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { - return this.client.sendOperationRequest( - { + * @param eventHubEndpointName The name of the Event Hub-compatible endpoint. + * @param options The options parameters. + */ + public listEventHubConsumerGroups( + resourceGroupName: string, + resourceName: string, + eventHubEndpointName: string, + options?: IotHubResourceListEventHubConsumerGroupsOptionalParams + ): PagedAsyncIterableIterator { + const iter = this.listEventHubConsumerGroupsPagingAll( + resourceGroupName, + resourceName, + eventHubEndpointName, + options + ); + return { + next() { + return iter.next(); + }, + [Symbol.asyncIterator]() { + return this; + }, + byPage: () => { + return this.listEventHubConsumerGroupsPagingPage( + resourceGroupName, + resourceName, + eventHubEndpointName, + options + ); + } + }; + } + + 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 - }, - getOperationSpec, - callback) as Promise; + ); + continuationToken = result.nextLink; + yield result.value || []; + } + } + + private async *listEventHubConsumerGroupsPagingAll( + resourceGroupName: string, + resourceName: string, + eventHubEndpointName: string, + options?: IotHubResourceListEventHubConsumerGroupsOptionalParams + ): AsyncIterableIterator { + for await (const page of this.listEventHubConsumerGroupsPagingPage( + resourceGroupName, + resourceName, + eventHubEndpointName, + 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. - * @summary Create or update the metadata of 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 iotHubDescription The IoT hub metadata and security metadata. - * @param [options] The optional parameters - * @returns Promise - */ - createOrUpdate(resourceGroupName: string, resourceName: string, iotHubDescription: Models.IotHubDescription, options?: Models.IotHubResourceCreateOrUpdateOptionalParams): Promise { - return this.beginCreateOrUpdate(resourceGroupName,resourceName,iotHubDescription,options) - .then(lroPoller => lroPoller.pollUntilFinished()) as Promise; + * @param options The options parameters. + */ + public listJobs( + resourceGroupName: string, + resourceName: string, + 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 + ); + } + }; } - /** - * 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 iotHubTags Updated tag information to set into the iot hub instance. - * @param [options] The optional parameters - * @returns Promise - */ - update(resourceGroupName: string, resourceName: string, iotHubTags: Models.TagsResource, options?: msRest.RequestOptionsBase): Promise { - return this.beginUpdate(resourceGroupName,resourceName,iotHubTags,options) - .then(lroPoller => lroPoller.pollUntilFinished()) as Promise; + 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 + ); + continuationToken = result.nextLink; + yield result.value || []; + } + } + + private async *listJobsPagingAll( + resourceGroupName: string, + resourceName: string, + options?: IotHubResourceListJobsOptionalParams + ): AsyncIterableIterator { + for await (const page of this.listJobsPagingPage( + resourceGroupName, + resourceName, + options + )) { + yield* page; + } } /** - * Delete an IoT hub. - * @summary Delete an IoT hub + * 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 - */ - deleteMethod(resourceGroupName: string, resourceName: string, options?: msRest.RequestOptionsBase): Promise { - return this.beginDeleteMethod(resourceGroupName,resourceName,options) - .then(lroPoller => lroPoller.pollUntilFinished()) as Promise; + * @param options The options parameters. + */ + public listQuotaMetrics( + resourceGroupName: string, + 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 + ); + } + }; } - /** - * 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 *getQuotaMetricsPagingPage( + resourceGroupName: string, + 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 - }, - listBySubscriptionOperationSpec, - callback) as Promise; + ); + continuationToken = result.nextLink; + yield result.value || []; + } + } + + private async *getQuotaMetricsPagingAll( + resourceGroupName: string, + resourceName: string, + options?: IotHubResourceGetQuotaMetricsOptionalParams + ): AsyncIterableIterator { + for await (const page of this.getQuotaMetricsPagingPage( + resourceGroupName, + resourceName, + options + )) { + yield* page; + } } /** - * 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(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; + * Get the health for routing endpoints. + * @param resourceGroupName + * @param iotHubName + * @param options The options parameters. + */ + public listEndpointHealth( + resourceGroupName: string, + 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 options The optional parameters - * @param callback The callback - */ - listByResourceGroup(resourceGroupName: string, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; - listByResourceGroup(resourceGroupName: string, options?: msRest.RequestOptionsBase | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { - return this.client.sendOperationRequest( - { + * @param resourceName The name of the IoT hub. + * @param options The options parameters. + */ + public listKeys( + resourceGroupName: string, + resourceName: string, + 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?: 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 - }, - listByResourceGroupOperationSpec, - callback) as Promise; + ); + continuationToken = result.nextLink; + yield result.value || []; + } + } + + private async *listKeysPagingAll( + resourceGroupName: string, + resourceName: string, + options?: IotHubResourceListKeysOptionalParams + ): AsyncIterableIterator { + for await (const page of this.listKeysPagingPage( + resourceGroupName, + resourceName, + options + )) { + yield* page; + } } /** - * Get the statistics from an IoT hub. - * @summary Get the statistics from an IoT hub + * 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 optional parameters - * @returns Promise + * @param options The options parameters. */ - getStats(resourceGroupName: string, resourceName: string, options?: msRest.RequestOptionsBase): Promise; + get( + resourceGroupName: string, + resourceName: string, + 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 callback The callback - */ - getStats(resourceGroupName: string, resourceName: string, callback: msRest.ServiceCallback): void; + * @param iotHubDescription The IoT hub metadata and security metadata. + * @param options The options parameters. + */ + async beginCreateOrUpdate( + resourceGroupName: string, + resourceName: string, + 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 + }); + } + /** + * 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 - */ - getStats(resourceGroupName: string, resourceName: string, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; - getStats(resourceGroupName: string, resourceName: string, options?: msRest.RequestOptionsBase | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { - return this.client.sendOperationRequest( - { - resourceGroupName, - resourceName, - options - }, - getStatsOperationSpec, - callback) as Promise; + * @param iotHubDescription The IoT hub metadata and security metadata. + * @param options The options parameters. + */ + async beginCreateOrUpdateAndWait( + resourceGroupName: string, + resourceName: string, + iotHubDescription: IotHubDescription, + options?: IotHubResourceCreateOrUpdateOptionalParams + ): Promise { + const poller = await this.beginCreateOrUpdate( + resourceGroupName, + resourceName, + iotHubDescription, + options + ); + return poller.pollUntilDone(); } /** - * Get the list of valid SKUs for an IoT hub. - * @summary Get the list of valid SKUs for an IoT hub + * 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. + */ + async beginUpdate( + resourceGroupName: string, + resourceName: string, + 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 + }); + } + + /** + * 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. + */ + async beginUpdateAndWait( + resourceGroupName: string, + resourceName: string, + iotHubTags: TagsResource, + options?: IotHubResourceUpdateOptionalParams + ): Promise { + const poller = await this.beginUpdate( + resourceGroupName, + resourceName, + iotHubTags, + options + ); + return poller.pollUntilDone(); + } + + /** + * 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 optional parameters - * @returns Promise - */ - getValidSkus(resourceGroupName: string, resourceName: string, options?: msRest.RequestOptionsBase): Promise; + * @param options The options parameters. + */ + async beginDelete( + resourceGroupName: string, + 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 + }); + } + /** + * 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 callback The callback + * @param options The options parameters. + */ + async beginDeleteAndWait( + resourceGroupName: string, + resourceName: string, + options?: IotHubResourceDeleteOptionalParams + ): Promise { + const poller = await this.beginDelete( + resourceGroupName, + resourceName, + options + ); + return poller.pollUntilDone(); + } + + /** + * Get all the IoT hubs in a subscription. + * @param options The options parameters. */ - getValidSkus(resourceGroupName: string, resourceName: string, callback: msRest.ServiceCallback): void; + private _listBySubscription( + options?: IotHubResourceListBySubscriptionOptionalParams + ): Promise { + return this.client.sendOperationRequest( + { options }, + listBySubscriptionOperationSpec + ); + } + /** + * 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 - * @param callback The callback + * @param options The options parameters. */ - getValidSkus(resourceGroupName: string, resourceName: string, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; - getValidSkus(resourceGroupName: string, resourceName: string, options?: msRest.RequestOptionsBase | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { + private _listByResourceGroup( + resourceGroupName: string, + options?: IotHubResourceListByResourceGroupOptionalParams + ): Promise { return this.client.sendOperationRequest( - { - resourceGroupName, - resourceName, - options - }, - getValidSkusOperationSpec, - callback) as Promise; + { resourceGroupName, options }, + listByResourceGroupOperationSpec + ); } /** - * 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 + * 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 eventHubEndpointName The name of the Event Hub-compatible endpoint. - * @param [options] The optional parameters - * @returns Promise + * @param options The options parameters. */ - listEventHubConsumerGroups(resourceGroupName: string, resourceName: string, eventHubEndpointName: string, options?: msRest.RequestOptionsBase): Promise; + getStats( + resourceGroupName: string, + resourceName: string, + 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 eventHubEndpointName The name of the Event Hub-compatible endpoint. - * @param callback The callback + * @param options The options parameters. */ - listEventHubConsumerGroups(resourceGroupName: string, resourceName: string, eventHubEndpointName: string, callback: msRest.ServiceCallback): void; + private _getValidSkus( + resourceGroupName: string, + resourceName: string, + options?: IotHubResourceGetValidSkusOptionalParams + ): Promise { + return this.client.sendOperationRequest( + { resourceGroupName, resourceName, options }, + getValidSkusOperationSpec + ); + } + /** + * 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 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 { + * @param options The options parameters. + */ + private _listEventHubConsumerGroups( + resourceGroupName: string, + resourceName: string, + eventHubEndpointName: string, + options?: IotHubResourceListEventHubConsumerGroupsOptionalParams + ): Promise { return this.client.sendOperationRequest( - { - resourceGroupName, - resourceName, - eventHubEndpointName, - options - }, - listEventHubConsumerGroupsOperationSpec, - callback) as Promise; + { resourceGroupName, resourceName, eventHubEndpointName, options }, + listEventHubConsumerGroupsOperationSpec + ); } /** * 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 { + * @param options The options parameters. + */ + getEventHubConsumerGroup( + resourceGroupName: string, + resourceName: string, + eventHubEndpointName: string, + name: string, + options?: IotHubResourceGetEventHubConsumerGroupOptionalParams + ): Promise { return this.client.sendOperationRequest( - { - resourceGroupName, - resourceName, - eventHubEndpointName, - name, - options - }, - getEventHubConsumerGroupOperationSpec, - callback) as Promise; + { resourceGroupName, resourceName, eventHubEndpointName, name, options }, + getEventHubConsumerGroupOperationSpec + ); } /** * 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 [options] The optional parameters - * @returns Promise - */ - createEventHubConsumerGroup(resourceGroupName: string, resourceName: string, eventHubEndpointName: string, name: string, options?: msRest.RequestOptionsBase): Promise; + * @param options The options parameters. + */ + createEventHubConsumerGroup( + resourceGroupName: string, + resourceName: string, + eventHubEndpointName: string, + name: string, + options?: IotHubResourceCreateEventHubConsumerGroupOptionalParams + ): Promise { + return this.client.sendOperationRequest( + { resourceGroupName, resourceName, eventHubEndpointName, name, options }, + createEventHubConsumerGroupOperationSpec + ); + } + /** + * 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 add. - * @param callback The callback - */ - createEventHubConsumerGroup(resourceGroupName: string, resourceName: string, eventHubEndpointName: string, name: string, callback: msRest.ServiceCallback): void; + * @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 { + 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 eventHubEndpointName The name of the Event Hub-compatible endpoint in the IoT hub. - * @param name The name of the consumer group to add. - * @param options The optional parameters - * @param callback The callback + * @param options The options parameters. */ - createEventHubConsumerGroup(resourceGroupName: string, resourceName: string, eventHubEndpointName: string, name: string, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; - createEventHubConsumerGroup(resourceGroupName: string, resourceName: string, eventHubEndpointName: string, name: string, options?: msRest.RequestOptionsBase | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { + private _listJobs( + resourceGroupName: string, + resourceName: string, + options?: IotHubResourceListJobsOptionalParams + ): Promise { return this.client.sendOperationRequest( - { - resourceGroupName, - resourceName, - eventHubEndpointName, - name, - options - }, - createEventHubConsumerGroupOperationSpec, - callback) as Promise; + { resourceGroupName, resourceName, options }, + listJobsOperationSpec + ); } /** - * 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); - } - - /** - * 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 + * 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 - */ - getJob(resourceGroupName: string, resourceName: string, jobId: string, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; - getJob(resourceGroupName: string, resourceName: string, jobId: string, options?: msRest.RequestOptionsBase | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { + * @param options The options parameters. + */ + getJob( + resourceGroupName: string, + resourceName: string, + jobId: string, + options?: IotHubResourceGetJobOptionalParams + ): Promise { return this.client.sendOperationRequest( - { - resourceGroupName, - resourceName, - jobId, - options - }, - getJobOperationSpec, - callback) as Promise; + { resourceGroupName, resourceName, jobId, options }, + getJobOperationSpec + ); } /** * 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 + * @param options The options parameters. */ - 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 - */ - getQuotaMetrics(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 { + private _getQuotaMetrics( + resourceGroupName: string, + resourceName: string, + options?: IotHubResourceGetQuotaMetricsOptionalParams + ): Promise { return this.client.sendOperationRequest( - { - resourceGroupName, - resourceName, - options - }, - getQuotaMetricsOperationSpec, - callback) as Promise; + { resourceGroupName, resourceName, options }, + getQuotaMetricsOperationSpec + ); } /** * 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 + * @param options The options parameters. */ - 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 { + private _getEndpointHealth( + resourceGroupName: string, + iotHubName: string, + options?: IotHubResourceGetEndpointHealthOptionalParams + ): Promise { return this.client.sendOperationRequest( - { - resourceGroupName, - iotHubName, - options - }, - getEndpointHealthOperationSpec, - callback) as Promise; + { resourceGroupName, iotHubName, options }, + getEndpointHealthOperationSpec + ); } /** * Check if an IoT hub name is available. - * @summary 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 optional parameters - * @returns Promise - */ - checkNameAvailability(operationInputs: Models.OperationInputs, options?: msRest.RequestOptionsBase): Promise; - /** - * @param operationInputs Set the name parameter in the OperationInputs structure to the name of - * the IoT hub to check. - * @param callback The callback - */ - checkNameAvailability(operationInputs: Models.OperationInputs, callback: msRest.ServiceCallback): void; - /** - * @param operationInputs Set the name parameter in the OperationInputs structure to the name of - * the IoT hub to check. - * @param options The optional parameters - * @param callback The callback - */ - checkNameAvailability(operationInputs: Models.OperationInputs, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; - checkNameAvailability(operationInputs: Models.OperationInputs, options?: msRest.RequestOptionsBase | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { + * @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, - callback) as Promise; + { operationInputs, options }, + checkNameAvailabilityOperationSpec + ); } /** * 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 { + * @param options The options parameters. + */ + testAllRoutes( + iotHubName: string, + resourceGroupName: string, + input: TestAllRoutesInput, + options?: IotHubResourceTestAllRoutesOptionalParams + ): Promise { return this.client.sendOperationRequest( - { - input, - iotHubName, - resourceGroupName, - options - }, - testAllRoutesOperationSpec, - callback) as Promise; + { iotHubName, resourceGroupName, input, options }, + testAllRoutesOperationSpec + ); } /** * 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 - */ - testRoute(input: Models.TestRouteInput, iotHubName: string, resourceGroupName: string, options?: msRest.RequestOptionsBase): Promise; - /** * @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 - */ - testRoute(input: Models.TestRouteInput, iotHubName: string, resourceGroupName: string, callback: msRest.ServiceCallback): void; - /** - * @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 - */ - 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 { + * @param options The options parameters. + */ + testRoute( + iotHubName: string, + resourceGroupName: string, + input: TestRouteInput, + options?: IotHubResourceTestRouteOptionalParams + ): Promise { return this.client.sendOperationRequest( - { - input, - iotHubName, - resourceGroupName, - options - }, - testRouteOperationSpec, - callback) as Promise; + { 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. - * @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 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(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 - */ - listKeys(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 - */ - listKeys(resourceGroupName: string, resourceName: string, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; - listKeys(resourceGroupName: string, resourceName: string, options?: msRest.RequestOptionsBase | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { + private _listKeys( + resourceGroupName: string, + resourceName: string, + options?: IotHubResourceListKeysOptionalParams + ): Promise { return this.client.sendOperationRequest( - { - resourceGroupName, - resourceName, - options - }, - listKeysOperationSpec, - callback) as Promise; + { resourceGroupName, resourceName, options }, + listKeysOperationSpec + ); } /** * 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 - * @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 - */ - getKeysForKeyName(resourceGroupName: string, resourceName: string, keyName: 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 keyName The name of the shared access policy. - * @param callback The callback - */ - getKeysForKeyName(resourceGroupName: string, resourceName: string, keyName: 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 keyName The name of the shared access policy. - * @param options The optional parameters - * @param callback The callback - */ - getKeysForKeyName(resourceGroupName: string, resourceName: string, keyName: string, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; - getKeysForKeyName(resourceGroupName: string, resourceName: string, keyName: string, options?: msRest.RequestOptionsBase | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { + * @param options The options parameters. + */ + getKeysForKeyName( + resourceGroupName: string, + resourceName: string, + keyName: string, + options?: IotHubResourceGetKeysForKeyNameOptionalParams + ): Promise { return this.client.sendOperationRequest( - { - resourceGroupName, - resourceName, - keyName, - options - }, - getKeysForKeyNameOperationSpec, - callback) as Promise; + { resourceGroupName, resourceName, keyName, options }, + getKeysForKeyNameOperationSpec + ); } /** * 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 - * @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 - */ - exportDevices(resourceGroupName: string, resourceName: string, exportDevicesParameters: Models.ExportDevicesRequest, 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 exportDevicesParameters The parameters that specify the export devices operation. - * @param callback The callback - */ - exportDevices(resourceGroupName: string, resourceName: string, exportDevicesParameters: Models.ExportDevicesRequest, 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 exportDevicesParameters The parameters that specify the export devices operation. - * @param options The optional parameters - * @param callback The callback - */ - exportDevices(resourceGroupName: string, resourceName: string, exportDevicesParameters: Models.ExportDevicesRequest, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; - exportDevices(resourceGroupName: string, resourceName: string, exportDevicesParameters: Models.ExportDevicesRequest, options?: msRest.RequestOptionsBase | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { + * @param options The options parameters. + */ + exportDevices( + resourceGroupName: string, + resourceName: string, + exportDevicesParameters: ExportDevicesRequest, + options?: IotHubResourceExportDevicesOptionalParams + ): Promise { return this.client.sendOperationRequest( - { - resourceGroupName, - resourceName, - exportDevicesParameters, - options - }, - exportDevicesOperationSpec, - callback) as Promise; + { resourceGroupName, resourceName, exportDevicesParameters, options }, + exportDevicesOperationSpec + ); } /** - * Import, update, or delete device identities in the IoT hub identity registry from a blob. For - * more information, see: + * 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 * @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 - */ - importDevices(resourceGroupName: string, resourceName: string, importDevicesParameters: Models.ImportDevicesRequest, 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 importDevicesParameters The parameters that specify the import devices operation. - * @param callback The callback - */ - importDevices(resourceGroupName: string, resourceName: string, importDevicesParameters: Models.ImportDevicesRequest, 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 importDevicesParameters The parameters that specify the import devices operation. - * @param options The optional parameters - * @param callback The callback - */ - importDevices(resourceGroupName: string, resourceName: string, importDevicesParameters: Models.ImportDevicesRequest, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; - importDevices(resourceGroupName: string, resourceName: string, importDevicesParameters: Models.ImportDevicesRequest, options?: msRest.RequestOptionsBase | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { + * @param options The options parameters. + */ + importDevices( + resourceGroupName: string, + resourceName: string, + importDevicesParameters: ImportDevicesRequest, + options?: IotHubResourceImportDevicesOptionalParams + ): Promise { return this.client.sendOperationRequest( - { - resourceGroupName, - resourceName, - importDevicesParameters, - options - }, - importDevicesOperationSpec, - callback) as Promise; + { resourceGroupName, resourceName, importDevicesParameters, options }, + importDevicesOperationSpec + ); } /** - * 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. - * @summary Create or update the 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 iotHubDescription The IoT hub metadata and security metadata. - * @param [options] The optional parameters - * @returns Promise + * ListBySubscriptionNext + * @param nextLink The nextLink from the previous successful call to the ListBySubscription method. + * @param options The options parameters. */ - beginCreateOrUpdate(resourceGroupName: string, resourceName: string, iotHubDescription: Models.IotHubDescription, options?: Models.IotHubResourceBeginCreateOrUpdateOptionalParams): Promise { - return this.client.sendLRORequest( - { - resourceGroupName, - resourceName, - iotHubDescription, - options - }, - beginCreateOrUpdateOperationSpec, - 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 iotHubTags Updated tag information to set into the iot hub instance. - * @param [options] The optional parameters - * @returns Promise - */ - beginUpdate(resourceGroupName: string, resourceName: string, iotHubTags: Models.TagsResource, options?: msRest.RequestOptionsBase): Promise { - return this.client.sendLRORequest( - { - resourceGroupName, - resourceName, - iotHubTags, - options - }, - beginUpdateOperationSpec, - options); - } - - /** - * Delete an IoT hub. - * @summary 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 optional parameters - * @returns Promise - */ - beginDeleteMethod(resourceGroupName: string, resourceName: string, options?: msRest.RequestOptionsBase): Promise { - return this.client.sendLRORequest( - { - resourceGroupName, - resourceName, - options - }, - beginDeleteMethodOperationSpec, - options); - } - - /** - * 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(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; - } - - /** - * 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(nextPageLink: string, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; - listByResourceGroupNext(nextPageLink: string, options?: msRest.RequestOptionsBase | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { - return this.client.sendOperationRequest( - { - nextPageLink, - options - }, - listByResourceGroupNextOperationSpec, - callback) as Promise; - } - - /** - * 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(nextPageLink: string, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; - getValidSkusNext(nextPageLink: string, options?: msRest.RequestOptionsBase | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { - return this.client.sendOperationRequest( - { - nextPageLink, - options - }, - getValidSkusNextOperationSpec, - callback) as Promise; + { nextLink, options }, + listBySubscriptionNextOperationSpec + ); } /** - * 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(nextPageLink: string, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; - listEventHubConsumerGroupsNext(nextPageLink: string, options?: msRest.RequestOptionsBase | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { + * 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. + */ + private _listByResourceGroupNext( + resourceGroupName: string, + nextLink: string, + options?: IotHubResourceListByResourceGroupNextOptionalParams + ): Promise { return this.client.sendOperationRequest( - { - nextPageLink, - options - }, - listEventHubConsumerGroupsNextOperationSpec, - callback) as Promise; + { resourceGroupName, nextLink, options }, + listByResourceGroupNextOperationSpec + ); } /** - * 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(nextPageLink: string, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; - listJobsNext(nextPageLink: string, options?: msRest.RequestOptionsBase | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { + * 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. + */ + private _getValidSkusNext( + resourceGroupName: string, + resourceName: string, + nextLink: string, + options?: IotHubResourceGetValidSkusNextOptionalParams + ): Promise { return this.client.sendOperationRequest( - { - nextPageLink, - options - }, - listJobsNextOperationSpec, - callback) as Promise; + { resourceGroupName, resourceName, nextLink, options }, + getValidSkusNextOperationSpec + ); } /** - * 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(nextPageLink: string, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; - getQuotaMetricsNext(nextPageLink: string, options?: msRest.RequestOptionsBase | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { + * 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. + */ + private _listEventHubConsumerGroupsNext( + resourceGroupName: string, + resourceName: string, + eventHubEndpointName: string, + nextLink: string, + options?: IotHubResourceListEventHubConsumerGroupsNextOptionalParams + ): Promise { return this.client.sendOperationRequest( { - nextPageLink, + resourceGroupName, + resourceName, + eventHubEndpointName, + nextLink, options }, - getQuotaMetricsNextOperationSpec, - callback) as Promise; + listEventHubConsumerGroupsNextOperationSpec + ); } /** - * 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(nextPageLink: string, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; - getEndpointHealthNext(nextPageLink: string, options?: msRest.RequestOptionsBase | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { + * 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. + */ + private _listJobsNext( + resourceGroupName: string, + resourceName: string, + nextLink: string, + options?: IotHubResourceListJobsNextOptionalParams + ): Promise { return this.client.sendOperationRequest( - { - nextPageLink, - options - }, - getEndpointHealthNextOperationSpec, - callback) as Promise; + { resourceGroupName, resourceName, nextLink, options }, + listJobsNextOperationSpec + ); } /** - * 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; + * 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. + */ + private _getQuotaMetricsNext( + resourceGroupName: string, + resourceName: string, + nextLink: string, + options?: IotHubResourceGetQuotaMetricsNextOptionalParams + ): Promise { + return this.client.sendOperationRequest( + { resourceGroupName, resourceName, nextLink, options }, + getQuotaMetricsNextOperationSpec + ); + } + /** - * @param nextPageLink The NextLink from the previous successful call to List operation. - * @param callback The callback - */ - listKeysNext(nextPageLink: string, callback: msRest.ServiceCallback): void; + * GetEndpointHealthNext + * @param resourceGroupName + * @param iotHubName + * @param nextLink The nextLink from the previous successful call to the GetEndpointHealth method. + * @param options The options parameters. + */ + private _getEndpointHealthNext( + resourceGroupName: string, + iotHubName: string, + nextLink: string, + options?: IotHubResourceGetEndpointHealthNextOptionalParams + ): Promise { + return this.client.sendOperationRequest( + { resourceGroupName, iotHubName, nextLink, options }, + getEndpointHealthNextOperationSpec + ); + } + /** - * @param nextPageLink The NextLink from the previous successful call to List operation. - * @param options The optional parameters - * @param callback The callback - */ - listKeysNext(nextPageLink: string, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; - listKeysNext(nextPageLink: string, options?: msRest.RequestOptionsBase | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { + * 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. + */ + 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", - path: "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Devices/IotHubs/{resourceName}", - urlParameters: [ - Parameters.subscriptionId, - Parameters.resourceGroupName, - Parameters.resourceName - ], - queryParameters: [ - Parameters.apiVersion - ], - headerParameters: [ - Parameters.acceptLanguage - ], responses: { 200: { bodyMapper: Mappers.IotHubDescription @@ -1114,631 +1438,540 @@ const getOperationSpec: msRest.OperationSpec = { bodyMapper: Mappers.ErrorDetails } }, - serializer -}; - -const listBySubscriptionOperationSpec: msRest.OperationSpec = { - httpMethod: "GET", - path: "subscriptions/{subscriptionId}/providers/Microsoft.Devices/IotHubs", + queryParameters: [Parameters.apiVersion], urlParameters: [ - Parameters.subscriptionId - ], - queryParameters: [ - Parameters.apiVersion - ], - headerParameters: [ - Parameters.acceptLanguage + 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.IotHubDescriptionListResult + bodyMapper: Mappers.IotHubDescription + }, + 201: { + bodyMapper: Mappers.IotHubDescription + }, + 202: { + bodyMapper: Mappers.IotHubDescription + }, + 204: { + bodyMapper: Mappers.IotHubDescription }, default: { bodyMapper: Mappers.ErrorDetails } }, - serializer -}; - -const listByResourceGroupOperationSpec: msRest.OperationSpec = { - httpMethod: "GET", - path: "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Devices/IotHubs", + requestBody: Parameters.iotHubDescription, + queryParameters: [Parameters.apiVersion], urlParameters: [ + Parameters.$host, Parameters.subscriptionId, - Parameters.resourceGroupName - ], - queryParameters: [ - Parameters.apiVersion + Parameters.resourceGroupName, + Parameters.resourceName ], headerParameters: [ - Parameters.acceptLanguage + Parameters.accept, + Parameters.contentType, + Parameters.ifMatch ], + mediaType: "json", + serializer +}; +const updateOperationSpec: coreClient.OperationSpec = { + path: + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Devices/IotHubs/{resourceName}", + httpMethod: "PATCH", responses: { 200: { - bodyMapper: Mappers.IotHubDescriptionListResult + bodyMapper: Mappers.IotHubDescription }, - default: { - bodyMapper: Mappers.ErrorDetails + 201: { + bodyMapper: Mappers.IotHubDescription + }, + 202: { + bodyMapper: Mappers.IotHubDescription + }, + 204: { + bodyMapper: Mappers.IotHubDescription } }, - serializer -}; - -const getStatsOperationSpec: msRest.OperationSpec = { - httpMethod: "GET", - path: "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Devices/IotHubs/{resourceName}/IotHubStats", + requestBody: Parameters.iotHubTags, + queryParameters: [Parameters.apiVersion], urlParameters: [ + Parameters.$host, Parameters.subscriptionId, Parameters.resourceGroupName, Parameters.resourceName ], - 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}", + httpMethod: "DELETE", responses: { 200: { - bodyMapper: Mappers.RegistryStatistics + bodyMapper: Mappers.IotHubDescription + }, + 201: { + bodyMapper: Mappers.IotHubDescription + }, + 202: { + bodyMapper: Mappers.IotHubDescription + }, + 204: { + bodyMapper: Mappers.IotHubDescription }, default: { bodyMapper: Mappers.ErrorDetails } }, - serializer -}; - -const getValidSkusOperationSpec: msRest.OperationSpec = { - httpMethod: "GET", - path: "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Devices/IotHubs/{resourceName}/skus", + queryParameters: [Parameters.apiVersion], urlParameters: [ + Parameters.$host, Parameters.subscriptionId, Parameters.resourceGroupName, Parameters.resourceName ], - queryParameters: [ - Parameters.apiVersion - ], - headerParameters: [ - Parameters.acceptLanguage - ], + headerParameters: [Parameters.accept], + serializer +}; +const listBySubscriptionOperationSpec: coreClient.OperationSpec = { + path: "/subscriptions/{subscriptionId}/providers/Microsoft.Devices/IotHubs", + httpMethod: "GET", responses: { 200: { - bodyMapper: Mappers.IotHubSkuDescriptionListResult + bodyMapper: Mappers.IotHubDescriptionListResult }, default: { bodyMapper: Mappers.ErrorDetails } }, + queryParameters: [Parameters.apiVersion], + urlParameters: [Parameters.$host, Parameters.subscriptionId], + headerParameters: [Parameters.accept], serializer }; - -const listEventHubConsumerGroupsOperationSpec: msRest.OperationSpec = { +const listByResourceGroupOperationSpec: coreClient.OperationSpec = { + path: + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Devices/IotHubs", httpMethod: "GET", - path: "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Devices/IotHubs/{resourceName}/eventHubEndpoints/{eventHubEndpointName}/ConsumerGroups", - urlParameters: [ - Parameters.subscriptionId, - Parameters.resourceGroupName, - Parameters.resourceName, - Parameters.eventHubEndpointName - ], - queryParameters: [ - Parameters.apiVersion - ], - headerParameters: [ - Parameters.acceptLanguage - ], responses: { 200: { - bodyMapper: Mappers.EventHubConsumerGroupsListResult + bodyMapper: Mappers.IotHubDescriptionListResult }, default: { 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 - ], - queryParameters: [ - Parameters.apiVersion - ], - headerParameters: [ - Parameters.acceptLanguage + Parameters.resourceGroupName ], + headerParameters: [Parameters.accept], + serializer +}; +const getStatsOperationSpec: coreClient.OperationSpec = { + path: + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Devices/IotHubs/{resourceName}/IotHubStats", + httpMethod: "GET", responses: { 200: { - bodyMapper: Mappers.EventHubConsumerGroupInfo + bodyMapper: Mappers.RegistryStatistics }, default: { 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 + Parameters.resourceName ], + headerParameters: [Parameters.accept], + serializer +}; +const getValidSkusOperationSpec: coreClient.OperationSpec = { + path: + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Devices/IotHubs/{resourceName}/skus", + httpMethod: "GET", responses: { 200: { - bodyMapper: Mappers.EventHubConsumerGroupInfo + bodyMapper: Mappers.IotHubSkuDescriptionListResult }, 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}", + queryParameters: [Parameters.apiVersion], urlParameters: [ + Parameters.$host, Parameters.subscriptionId, Parameters.resourceGroupName, - Parameters.resourceName, - Parameters.eventHubEndpointName, - Parameters.name - ], - queryParameters: [ - Parameters.apiVersion - ], - headerParameters: [ - Parameters.acceptLanguage + Parameters.resourceName ], - responses: { - 200: {}, - default: { - bodyMapper: Mappers.ErrorDetails - } - }, + headerParameters: [Parameters.accept], serializer }; - -const listJobsOperationSpec: msRest.OperationSpec = { +const listEventHubConsumerGroupsOperationSpec: coreClient.OperationSpec = { + path: + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Devices/IotHubs/{resourceName}/eventHubEndpoints/{eventHubEndpointName}/ConsumerGroups", httpMethod: "GET", - path: "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Devices/IotHubs/{resourceName}/jobs", - urlParameters: [ - Parameters.subscriptionId, - Parameters.resourceGroupName, - Parameters.resourceName - ], - queryParameters: [ - Parameters.apiVersion - ], - headerParameters: [ - Parameters.acceptLanguage - ], responses: { 200: { - bodyMapper: Mappers.JobResponseListResult + bodyMapper: Mappers.EventHubConsumerGroupsListResult }, default: { 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 - ], - queryParameters: [ - Parameters.apiVersion - ], - headerParameters: [ - Parameters.acceptLanguage + Parameters.eventHubEndpointName ], + 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.JobResponse + bodyMapper: Mappers.EventHubConsumerGroupInfo }, default: { bodyMapper: Mappers.ErrorDetails } }, - serializer -}; - -const getQuotaMetricsOperationSpec: msRest.OperationSpec = { - httpMethod: "GET", - path: "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Devices/IotHubs/{resourceName}/quotaMetrics", + queryParameters: [Parameters.apiVersion], urlParameters: [ + Parameters.$host, Parameters.subscriptionId, Parameters.resourceGroupName, - Parameters.resourceName - ], - queryParameters: [ - Parameters.apiVersion - ], - headerParameters: [ - Parameters.acceptLanguage + Parameters.resourceName, + Parameters.eventHubEndpointName, + Parameters.name ], + 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.IotHubQuotaMetricInfoListResult + bodyMapper: Mappers.EventHubConsumerGroupInfo }, default: { bodyMapper: Mappers.ErrorDetails } }, - serializer -}; - -const getEndpointHealthOperationSpec: msRest.OperationSpec = { - httpMethod: "GET", - path: "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Devices/IotHubs/{iotHubName}/routingEndpointsHealth", + queryParameters: [Parameters.apiVersion], urlParameters: [ + Parameters.$host, Parameters.subscriptionId, Parameters.resourceGroupName, - Parameters.iotHubName - ], - queryParameters: [ - Parameters.apiVersion - ], - headerParameters: [ - Parameters.acceptLanguage + Parameters.resourceName, + Parameters.eventHubEndpointName, + Parameters.name ], + headerParameters: [Parameters.accept], + serializer +}; +const deleteEventHubConsumerGroupOperationSpec: coreClient.OperationSpec = { + path: + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Devices/IotHubs/{resourceName}/eventHubEndpoints/{eventHubEndpointName}/ConsumerGroups/{name}", + httpMethod: "DELETE", responses: { - 200: { - bodyMapper: Mappers.EndpointHealthDataListResult - }, + 200: {}, default: { bodyMapper: Mappers.ErrorDetails } }, - serializer -}; - -const checkNameAvailabilityOperationSpec: msRest.OperationSpec = { - httpMethod: "POST", - path: "subscriptions/{subscriptionId}/providers/Microsoft.Devices/checkNameAvailability", + queryParameters: [Parameters.apiVersion], urlParameters: [ - Parameters.subscriptionId - ], - queryParameters: [ - Parameters.apiVersion - ], - headerParameters: [ - Parameters.acceptLanguage - ], - requestBody: { - parameterPath: "operationInputs", - mapper: { - ...Mappers.OperationInputs, - required: true - } - }, + Parameters.$host, + Parameters.subscriptionId, + Parameters.resourceGroupName, + Parameters.resourceName, + Parameters.eventHubEndpointName, + Parameters.name + ], + headerParameters: [Parameters.accept], + serializer +}; +const listJobsOperationSpec: coreClient.OperationSpec = { + path: + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Devices/IotHubs/{resourceName}/jobs", + httpMethod: "GET", responses: { 200: { - bodyMapper: Mappers.IotHubNameAvailabilityInfo + bodyMapper: Mappers.JobResponseListResult }, default: { bodyMapper: Mappers.ErrorDetails } }, - serializer -}; - -const testAllRoutesOperationSpec: msRest.OperationSpec = { - httpMethod: "POST", - path: "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Devices/IotHubs/{iotHubName}/routing/routes/$testall", + queryParameters: [Parameters.apiVersion], urlParameters: [ - Parameters.iotHubName, + Parameters.$host, Parameters.subscriptionId, - Parameters.resourceGroupName - ], - queryParameters: [ - Parameters.apiVersion - ], - headerParameters: [ - Parameters.acceptLanguage + Parameters.resourceGroupName, + Parameters.resourceName ], - requestBody: { - parameterPath: "input", - mapper: { - ...Mappers.TestAllRoutesInput, - required: true - } - }, + 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.TestAllRoutesResult + bodyMapper: Mappers.JobResponse }, default: { bodyMapper: Mappers.ErrorDetails } }, - serializer -}; - -const testRouteOperationSpec: msRest.OperationSpec = { - httpMethod: "POST", - path: "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Devices/IotHubs/{iotHubName}/routing/routes/$testnew", + queryParameters: [Parameters.apiVersion], urlParameters: [ - Parameters.iotHubName, + Parameters.$host, Parameters.subscriptionId, - Parameters.resourceGroupName - ], - queryParameters: [ - Parameters.apiVersion - ], - headerParameters: [ - Parameters.acceptLanguage + Parameters.resourceGroupName, + Parameters.resourceName, + Parameters.jobId ], - requestBody: { - parameterPath: "input", - mapper: { - ...Mappers.TestRouteInput, - required: true - } - }, + headerParameters: [Parameters.accept], + serializer +}; +const getQuotaMetricsOperationSpec: coreClient.OperationSpec = { + path: + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Devices/IotHubs/{resourceName}/quotaMetrics", + httpMethod: "GET", responses: { 200: { - bodyMapper: Mappers.TestRouteResult + bodyMapper: Mappers.IotHubQuotaMetricInfoListResult }, default: { bodyMapper: Mappers.ErrorDetails } }, - serializer -}; - -const listKeysOperationSpec: msRest.OperationSpec = { - httpMethod: "POST", - path: "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Devices/IotHubs/{resourceName}/listkeys", + queryParameters: [Parameters.apiVersion], urlParameters: [ + Parameters.$host, Parameters.subscriptionId, Parameters.resourceGroupName, Parameters.resourceName ], - queryParameters: [ - Parameters.apiVersion - ], - headerParameters: [ - Parameters.acceptLanguage - ], + headerParameters: [Parameters.accept], + serializer +}; +const getEndpointHealthOperationSpec: coreClient.OperationSpec = { + path: + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Devices/IotHubs/{iotHubName}/routingEndpointsHealth", + httpMethod: "GET", responses: { 200: { - bodyMapper: Mappers.SharedAccessSignatureAuthorizationRuleListResult + bodyMapper: Mappers.EndpointHealthDataListResult }, default: { 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 - ], - queryParameters: [ - Parameters.apiVersion - ], - headerParameters: [ - Parameters.acceptLanguage + Parameters.iotHubName ], + headerParameters: [Parameters.accept], + serializer +}; +const checkNameAvailabilityOperationSpec: coreClient.OperationSpec = { + path: + "/subscriptions/{subscriptionId}/providers/Microsoft.Devices/checkNameAvailability", + httpMethod: "POST", responses: { 200: { - bodyMapper: Mappers.SharedAccessSignatureAuthorizationRule + bodyMapper: Mappers.IotHubNameAvailabilityInfo }, default: { bodyMapper: Mappers.ErrorDetails } }, + requestBody: Parameters.operationInputs, + queryParameters: [Parameters.apiVersion], + urlParameters: [Parameters.$host, Parameters.subscriptionId], + headerParameters: [Parameters.accept, Parameters.contentType], + mediaType: "json", serializer }; - -const exportDevicesOperationSpec: msRest.OperationSpec = { +const testAllRoutesOperationSpec: coreClient.OperationSpec = { + path: + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Devices/IotHubs/{iotHubName}/routing/routes/$testall", httpMethod: "POST", - path: "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Devices/IotHubs/{resourceName}/exportDevices", + responses: { + 200: { + bodyMapper: Mappers.TestAllRoutesResult + }, + default: { + bodyMapper: Mappers.ErrorDetails + } + }, + requestBody: Parameters.input, + queryParameters: [Parameters.apiVersion], urlParameters: [ + Parameters.$host, Parameters.subscriptionId, Parameters.resourceGroupName, - Parameters.resourceName - ], - queryParameters: [ - Parameters.apiVersion - ], - headerParameters: [ - Parameters.acceptLanguage + Parameters.iotHubName ], - requestBody: { - parameterPath: "exportDevicesParameters", - mapper: { - ...Mappers.ExportDevicesRequest, - required: true - } - }, + headerParameters: [Parameters.accept, Parameters.contentType], + mediaType: "json", + serializer +}; +const testRouteOperationSpec: coreClient.OperationSpec = { + path: + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Devices/IotHubs/{iotHubName}/routing/routes/$testnew", + httpMethod: "POST", responses: { 200: { - bodyMapper: Mappers.JobResponse + bodyMapper: Mappers.TestRouteResult }, default: { bodyMapper: Mappers.ErrorDetails } }, - serializer -}; - -const importDevicesOperationSpec: msRest.OperationSpec = { - httpMethod: "POST", - path: "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Devices/IotHubs/{resourceName}/importDevices", + requestBody: Parameters.input1, + queryParameters: [Parameters.apiVersion], urlParameters: [ + Parameters.$host, Parameters.subscriptionId, Parameters.resourceGroupName, - Parameters.resourceName - ], - queryParameters: [ - Parameters.apiVersion - ], - headerParameters: [ - Parameters.acceptLanguage + Parameters.iotHubName ], - requestBody: { - parameterPath: "importDevicesParameters", - mapper: { - ...Mappers.ImportDevicesRequest, - required: true - } - }, + headerParameters: [Parameters.accept, Parameters.contentType], + mediaType: "json", + serializer +}; +const listKeysOperationSpec: coreClient.OperationSpec = { + path: + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Devices/IotHubs/{resourceName}/listkeys", + httpMethod: "POST", responses: { 200: { - bodyMapper: Mappers.JobResponse + bodyMapper: Mappers.SharedAccessSignatureAuthorizationRuleListResult }, default: { bodyMapper: Mappers.ErrorDetails } }, - serializer -}; - -const beginCreateOrUpdateOperationSpec: msRest.OperationSpec = { - httpMethod: "PUT", - path: "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Devices/IotHubs/{resourceName}", + queryParameters: [Parameters.apiVersion], urlParameters: [ + Parameters.$host, Parameters.subscriptionId, Parameters.resourceGroupName, Parameters.resourceName ], - queryParameters: [ - Parameters.apiVersion - ], - headerParameters: [ - Parameters.ifMatch0, - Parameters.acceptLanguage - ], - requestBody: { - parameterPath: "iotHubDescription", - mapper: { - ...Mappers.IotHubDescription, - required: true - } - }, + headerParameters: [Parameters.accept], + serializer +}; +const getKeysForKeyNameOperationSpec: coreClient.OperationSpec = { + path: + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Devices/IotHubs/{resourceName}/IotHubKeys/{keyName}/listkeys", + httpMethod: "POST", responses: { 200: { - bodyMapper: Mappers.IotHubDescription - }, - 201: { - bodyMapper: Mappers.IotHubDescription + bodyMapper: Mappers.SharedAccessSignatureAuthorizationRule }, default: { bodyMapper: Mappers.ErrorDetails } }, - serializer -}; - -const beginUpdateOperationSpec: msRest.OperationSpec = { - httpMethod: "PATCH", - path: "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Devices/IotHubs/{resourceName}", + queryParameters: [Parameters.apiVersion], urlParameters: [ + Parameters.$host, Parameters.subscriptionId, Parameters.resourceGroupName, - Parameters.resourceName - ], - queryParameters: [ - Parameters.apiVersion - ], - headerParameters: [ - Parameters.acceptLanguage + Parameters.resourceName, + Parameters.keyName ], - requestBody: { - parameterPath: "iotHubTags", - mapper: { - ...Mappers.TagsResource, - required: true - } - }, + headerParameters: [Parameters.accept], + serializer +}; +const exportDevicesOperationSpec: coreClient.OperationSpec = { + path: + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Devices/IotHubs/{resourceName}/exportDevices", + httpMethod: "POST", responses: { 200: { - bodyMapper: Mappers.IotHubDescription + bodyMapper: Mappers.JobResponse }, default: { - bodyMapper: Mappers.CloudError + bodyMapper: Mappers.ErrorDetails } }, - serializer -}; - -const beginDeleteMethodOperationSpec: msRest.OperationSpec = { - httpMethod: "DELETE", - path: "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Devices/IotHubs/{resourceName}", + requestBody: Parameters.exportDevicesParameters, + queryParameters: [Parameters.apiVersion], urlParameters: [ + Parameters.$host, Parameters.subscriptionId, Parameters.resourceGroupName, Parameters.resourceName ], - queryParameters: [ - Parameters.apiVersion - ], - headerParameters: [ - Parameters.acceptLanguage - ], + headerParameters: [Parameters.accept, Parameters.contentType], + mediaType: "json", + serializer +}; +const importDevicesOperationSpec: coreClient.OperationSpec = { + path: + "/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 - ], - headerParameters: [ - Parameters.acceptLanguage - ], + httpMethod: "GET", responses: { 200: { bodyMapper: Mappers.IotHubDescriptionListResult @@ -1747,19 +1980,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 - ], - headerParameters: [ - Parameters.acceptLanguage - ], + httpMethod: "GET", responses: { 200: { bodyMapper: Mappers.IotHubDescriptionListResult @@ -1768,19 +2000,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 - ], - headerParameters: [ - Parameters.acceptLanguage - ], + httpMethod: "GET", responses: { 200: { bodyMapper: Mappers.IotHubSkuDescriptionListResult @@ -1789,19 +2021,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 - ], - headerParameters: [ - Parameters.acceptLanguage - ], + httpMethod: "GET", responses: { 200: { bodyMapper: Mappers.EventHubConsumerGroupsListResult @@ -1810,19 +2043,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 - ], - headerParameters: [ - Parameters.acceptLanguage - ], + httpMethod: "GET", responses: { 200: { bodyMapper: Mappers.JobResponseListResult @@ -1831,19 +2066,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 - ], - headerParameters: [ - Parameters.acceptLanguage - ], + httpMethod: "GET", responses: { 200: { bodyMapper: Mappers.IotHubQuotaMetricInfoListResult @@ -1852,19 +2088,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 - ], - headerParameters: [ - Parameters.acceptLanguage - ], + httpMethod: "GET", responses: { 200: { bodyMapper: Mappers.EndpointHealthDataListResult @@ -1873,19 +2110,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 - ], - headerParameters: [ - Parameters.acceptLanguage - ], + httpMethod: "GET", responses: { 200: { bodyMapper: Mappers.SharedAccessSignatureAuthorizationRuleListResult @@ -1894,5 +2132,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-profile-2020-09-01-hybrid/src/operations/operations.ts b/sdk/iothub/arm-iothub-profile-2020-09-01-hybrid/src/operations/operations.ts index 1c9480e71f7b..51dd537f61ec 100644 --- a/sdk/iothub/arm-iothub-profile-2020-09-01-hybrid/src/operations/operations.ts +++ b/sdk/iothub/arm-iothub-profile-2020-09-01-hybrid/src/operations/operations.ts @@ -1,95 +1,111 @@ /* - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for - * license information. + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. * * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is - * regenerated. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. */ -import * as msRest from "@azure/ms-rest-js"; -import * as Models from "../models"; -import * as Mappers from "../models/operationsMappers"; +import { PagedAsyncIterableIterator } from "@azure/core-paging"; +import { Operations } from "../operationsInterfaces"; +import * as coreClient from "@azure/core-client"; +import * as Mappers from "../models/mappers"; import * as Parameters from "../models/parameters"; -import { 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 @@ -98,19 +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 - ], - headerParameters: [ - Parameters.acceptLanguage - ], + httpMethod: "GET", responses: { 200: { bodyMapper: Mappers.OperationListResult @@ -119,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-profile-2020-09-01-hybrid/src/operations/resourceProviderCommon.ts b/sdk/iothub/arm-iothub-profile-2020-09-01-hybrid/src/operations/resourceProviderCommon.ts index 40d9058c47cd..fa2a3f43e047 100644 --- a/sdk/iothub/arm-iothub-profile-2020-09-01-hybrid/src/operations/resourceProviderCommon.ts +++ b/sdk/iothub/arm-iothub-profile-2020-09-01-hybrid/src/operations/resourceProviderCommon.ts @@ -1,71 +1,52 @@ /* - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for - * license information. + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. * * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is - * regenerated. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. */ -import * as msRest from "@azure/ms-rest-js"; -import * as Models from "../models"; -import * as Mappers from "../models/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 { + getSubscriptionQuota( + 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 @@ -74,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-profile-2020-09-01-hybrid/src/operationsInterfaces/certificates.ts b/sdk/iothub/arm-iothub-profile-2020-09-01-hybrid/src/operationsInterfaces/certificates.ts new file mode 100644 index 000000000000..9a891703ba42 --- /dev/null +++ b/sdk/iothub/arm-iothub-profile-2020-09-01-hybrid/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, + CertificateBodyDescription, + 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: CertificateBodyDescription, + 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-profile-2020-09-01-hybrid/src/operationsInterfaces/index.ts b/sdk/iothub/arm-iothub-profile-2020-09-01-hybrid/src/operationsInterfaces/index.ts new file mode 100644 index 000000000000..62d8108cc3cd --- /dev/null +++ b/sdk/iothub/arm-iothub-profile-2020-09-01-hybrid/src/operationsInterfaces/index.ts @@ -0,0 +1,13 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +export * from "./operations"; +export * from "./iotHubResource"; +export * from "./resourceProviderCommon"; +export * from "./certificates"; +export * from "./iotHub"; diff --git a/sdk/iothub/arm-iothub-profile-2020-09-01-hybrid/src/operationsInterfaces/iotHub.ts b/sdk/iothub/arm-iothub-profile-2020-09-01-hybrid/src/operationsInterfaces/iotHub.ts new file mode 100644 index 000000000000..bad03e9d14cb --- /dev/null +++ b/sdk/iothub/arm-iothub-profile-2020-09-01-hybrid/src/operationsInterfaces/iotHub.ts @@ -0,0 +1,40 @@ +/* + * 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 { + /** + * Perform manual fail over of given hub + * @param iotHubName IotHub to fail over + * @param resourceGroupName resource group which Iot Hub belongs to + * @param failoverInput Region to failover to. Must be a azure DR pair + * @param options The options parameters. + */ + beginManualFailover( + iotHubName: string, + resourceGroupName: string, + failoverInput: FailoverInput, + options?: IotHubManualFailoverOptionalParams + ): Promise, void>>; + /** + * Perform manual fail over of given hub + * @param iotHubName IotHub to fail over + * @param resourceGroupName resource group which Iot Hub belongs to + * @param failoverInput Region to failover to. Must be a azure DR pair + * @param options The options parameters. + */ + beginManualFailoverAndWait( + iotHubName: string, + resourceGroupName: string, + failoverInput: FailoverInput, + options?: IotHubManualFailoverOptionalParams + ): Promise; +} diff --git a/sdk/iothub/arm-iothub-profile-2020-09-01-hybrid/src/operationsInterfaces/iotHubResource.ts b/sdk/iothub/arm-iothub-profile-2020-09-01-hybrid/src/operationsInterfaces/iotHubResource.ts new file mode 100644 index 000000000000..6c23c346cb60 --- /dev/null +++ b/sdk/iothub/arm-iothub-profile-2020-09-01-hybrid/src/operationsInterfaces/iotHubResource.ts @@ -0,0 +1,410 @@ +/* + * 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, + 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 options The options parameters. + */ + createEventHubConsumerGroup( + resourceGroupName: string, + resourceName: string, + eventHubEndpointName: string, + name: string, + 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-profile-2020-09-01-hybrid/src/operationsInterfaces/operations.ts b/sdk/iothub/arm-iothub-profile-2020-09-01-hybrid/src/operationsInterfaces/operations.ts new file mode 100644 index 000000000000..a16512365bfb --- /dev/null +++ b/sdk/iothub/arm-iothub-profile-2020-09-01-hybrid/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-profile-2020-09-01-hybrid/src/operationsInterfaces/resourceProviderCommon.ts b/sdk/iothub/arm-iothub-profile-2020-09-01-hybrid/src/operationsInterfaces/resourceProviderCommon.ts new file mode 100644 index 000000000000..e52319b98e68 --- /dev/null +++ b/sdk/iothub/arm-iothub-profile-2020-09-01-hybrid/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-profile-2020-09-01-hybrid/test/sampleTest.ts b/sdk/iothub/arm-iothub-profile-2020-09-01-hybrid/test/sampleTest.ts new file mode 100644 index 000000000000..7ed89b043e1b --- /dev/null +++ b/sdk/iothub/arm-iothub-profile-2020-09-01-hybrid/test/sampleTest.ts @@ -0,0 +1,48 @@ +/* + * 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 +} from "@azure-tools/test-recorder"; +import * as assert from "assert"; + +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: [] +}; + +describe("My test", () => { + let recorder: Recorder; + + beforeEach(async function() { + recorder = record(this, recorderEnvSetup); + }); + + afterEach(async function() { + await recorder.stop(); + }); + + it("sample test", async function() { + console.log("Hi, I'm a test!"); + }); +}); diff --git a/sdk/iothub/arm-iothub-profile-2020-09-01-hybrid/tsconfig.json b/sdk/iothub/arm-iothub-profile-2020-09-01-hybrid/tsconfig.json index 422b584abd5e..3e6ae96443f3 100644 --- a/sdk/iothub/arm-iothub-profile-2020-09-01-hybrid/tsconfig.json +++ b/sdk/iothub/arm-iothub-profile-2020-09-01-hybrid/tsconfig.json @@ -3,17 +3,25 @@ "module": "es6", "moduleResolution": "node", "strict": true, - "target": "es5", + "target": "es6", "sourceMap": true, "declarationMap": true, "esModuleInterop": true, "allowSyntheticDefaultImports": true, "forceConsistentCasingInFileNames": true, - "lib": ["es6", "dom"], + "lib": [ + "es6", + "dom" + ], "declaration": true, - "outDir": "./esm", + "outDir": "./dist-esm", "importHelpers": true }, - "include": ["./src/**/*.ts"], - "exclude": ["node_modules"] -} + "include": [ + "./src/**/*.ts", + "./test/**/*.ts" + ], + "exclude": [ + "node_modules" + ] +} \ No newline at end of file diff --git a/sdk/iothub/ci.mgmt.yml b/sdk/iothub/ci.mgmt.yml index 10e595021727..d880276af560 100644 --- a/sdk/iothub/ci.mgmt.yml +++ b/sdk/iothub/ci.mgmt.yml @@ -1,5 +1,5 @@ # NOTE: Please refer to https://aka.ms/azsdk/engsys/ci-yaml before editing this file. - + trigger: branches: include: @@ -10,6 +10,7 @@ trigger: include: - sdk/iothub/ci.mgmt.yml - sdk/iothub/arm-iothub/ + - sdk/iothub/arm-iothub-profile-2020-09-01-hybrid pr: branches: include: @@ -23,11 +24,13 @@ pr: include: - sdk/iothub/ci.mgmt.yml - sdk/iothub/arm-iothub/ - + - sdk/iothub/arm-iothub-profile-2020-09-01-hybrid 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 + safeName: azurearmiothub + - name: azure-arm-iothub-profile-2020-09-01-hybrid + safeName: azurearmiothubprofile20200901hybrid