From e66175f5f8970d5cc8e27d6efaee965a0c8dc233 Mon Sep 17 00:00:00 2001 From: colawwj <70128817+colawwj@users.noreply.github.com> Date: Thu, 10 Mar 2022 17:34:37 +0800 Subject: [PATCH] [AzureStack][Mgmt]hybrid-profile-2020-09-01-for-eventhub (#20762) * hybrid-for-eventhub * hybrid-for-eventhub * update --- common/config/rush/pnpm-lock.yaml | 30 + eng/ignore-links.txt | 1 + rush.json | 5 + .../CHANGELOG.md | 11 + .../LICENSE | 21 + .../README.md | 160 +- .../_meta.json | 8 + .../api-extractor.json | 31 + .../package.json | 95 +- .../node/my_test/recording_sample_test.js | 5 + ...-eventhub-profile-2020-09-01-hybrid.api.md | 886 ++++++ .../rollup.config.js | 145 +- .../src/eventHubManagementClient.ts | 149 +- .../src/eventHubManagementClientContext.ts | 67 - .../src/index.ts | 12 + .../src/lroImpl.ts | 34 + .../src/models/clustersMappers.ts | 36 - .../src/models/consumerGroupsMappers.ts | 32 - .../models/disasterRecoveryConfigsMappers.ts | 33 - .../src/models/eventHubsMappers.ts | 35 - .../src/models/index.ts | 2366 ++++++----------- .../src/models/mappers.ts | 1118 ++++---- .../src/models/namespacesMappers.ts | 37 - .../src/models/operationsMappers.ts | 14 - .../src/models/parameters.ts | 260 +- .../privateEndpointConnectionsMappers.ts | 32 - .../src/models/privateLinkResourcesMappers.ts | 13 - .../src/models/regionsMappers.ts | 32 - .../src/operations/clusters.ts | 763 +++--- .../src/operations/consumerGroups.ts | 436 +-- .../src/operations/disasterRecoveryConfigs.ts | 353 +-- .../src/operations/eventHubs.ts | 979 ++++--- .../src/operations/index.ts | 8 +- .../src/operations/namespaces.ts | 1358 +++++----- .../src/operations/operations.ts | 160 +- .../operations/privateEndpointConnections.ts | 473 ++-- .../src/operations/privateLinkResources.ts | 93 +- .../src/operations/regions.ts | 183 +- .../src/operationsInterfaces/clusters.ts | 152 ++ .../operationsInterfaces/consumerGroups.ts | 84 + .../disasterRecoveryConfigs.ts | 65 + .../src/operationsInterfaces/eventHubs.ts | 181 ++ .../src/operationsInterfaces/index.ts | 17 + .../src/operationsInterfaces/namespaces.ts | 229 ++ .../src/operationsInterfaces/operations.ts | 22 + .../privateEndpointConnections.ts | 92 + .../privateLinkResources.ts | 27 + .../src/operationsInterfaces/regions.ts | 24 + .../test/sampleTest.ts | 48 + .../tsconfig.json | 20 +- sdk/eventhub/ci.mgmt.yml | 9 +- sdk/eventhub/ci.yml | 6 +- 52 files changed, 6392 insertions(+), 5058 deletions(-) create mode 100644 sdk/eventhub/arm-eventhub-profile-2020-09-01-hybrid/CHANGELOG.md create mode 100644 sdk/eventhub/arm-eventhub-profile-2020-09-01-hybrid/LICENSE create mode 100644 sdk/eventhub/arm-eventhub-profile-2020-09-01-hybrid/_meta.json create mode 100644 sdk/eventhub/arm-eventhub-profile-2020-09-01-hybrid/api-extractor.json create mode 100644 sdk/eventhub/arm-eventhub-profile-2020-09-01-hybrid/recordings/node/my_test/recording_sample_test.js create mode 100644 sdk/eventhub/arm-eventhub-profile-2020-09-01-hybrid/review/arm-eventhub-profile-2020-09-01-hybrid.api.md delete mode 100644 sdk/eventhub/arm-eventhub-profile-2020-09-01-hybrid/src/eventHubManagementClientContext.ts create mode 100644 sdk/eventhub/arm-eventhub-profile-2020-09-01-hybrid/src/index.ts create mode 100644 sdk/eventhub/arm-eventhub-profile-2020-09-01-hybrid/src/lroImpl.ts delete mode 100644 sdk/eventhub/arm-eventhub-profile-2020-09-01-hybrid/src/models/clustersMappers.ts delete mode 100644 sdk/eventhub/arm-eventhub-profile-2020-09-01-hybrid/src/models/consumerGroupsMappers.ts delete mode 100644 sdk/eventhub/arm-eventhub-profile-2020-09-01-hybrid/src/models/disasterRecoveryConfigsMappers.ts delete mode 100644 sdk/eventhub/arm-eventhub-profile-2020-09-01-hybrid/src/models/eventHubsMappers.ts delete mode 100644 sdk/eventhub/arm-eventhub-profile-2020-09-01-hybrid/src/models/namespacesMappers.ts delete mode 100644 sdk/eventhub/arm-eventhub-profile-2020-09-01-hybrid/src/models/operationsMappers.ts delete mode 100644 sdk/eventhub/arm-eventhub-profile-2020-09-01-hybrid/src/models/privateEndpointConnectionsMappers.ts delete mode 100644 sdk/eventhub/arm-eventhub-profile-2020-09-01-hybrid/src/models/privateLinkResourcesMappers.ts delete mode 100644 sdk/eventhub/arm-eventhub-profile-2020-09-01-hybrid/src/models/regionsMappers.ts create mode 100644 sdk/eventhub/arm-eventhub-profile-2020-09-01-hybrid/src/operationsInterfaces/clusters.ts create mode 100644 sdk/eventhub/arm-eventhub-profile-2020-09-01-hybrid/src/operationsInterfaces/consumerGroups.ts create mode 100644 sdk/eventhub/arm-eventhub-profile-2020-09-01-hybrid/src/operationsInterfaces/disasterRecoveryConfigs.ts create mode 100644 sdk/eventhub/arm-eventhub-profile-2020-09-01-hybrid/src/operationsInterfaces/eventHubs.ts create mode 100644 sdk/eventhub/arm-eventhub-profile-2020-09-01-hybrid/src/operationsInterfaces/index.ts create mode 100644 sdk/eventhub/arm-eventhub-profile-2020-09-01-hybrid/src/operationsInterfaces/namespaces.ts create mode 100644 sdk/eventhub/arm-eventhub-profile-2020-09-01-hybrid/src/operationsInterfaces/operations.ts create mode 100644 sdk/eventhub/arm-eventhub-profile-2020-09-01-hybrid/src/operationsInterfaces/privateEndpointConnections.ts create mode 100644 sdk/eventhub/arm-eventhub-profile-2020-09-01-hybrid/src/operationsInterfaces/privateLinkResources.ts create mode 100644 sdk/eventhub/arm-eventhub-profile-2020-09-01-hybrid/src/operationsInterfaces/regions.ts create mode 100644 sdk/eventhub/arm-eventhub-profile-2020-09-01-hybrid/test/sampleTest.ts diff --git a/common/config/rush/pnpm-lock.yaml b/common/config/rush/pnpm-lock.yaml index ae4bad5eadb1..b8b47d70dfba 100644 --- a/common/config/rush/pnpm-lock.yaml +++ b/common/config/rush/pnpm-lock.yaml @@ -60,6 +60,7 @@ specifiers: '@rush-temp/arm-domainservices': file:./projects/arm-domainservices.tgz '@rush-temp/arm-eventgrid': file:./projects/arm-eventgrid.tgz '@rush-temp/arm-eventhub': file:./projects/arm-eventhub.tgz + '@rush-temp/arm-eventhub-profile-2020-09-01-hybrid': file:./projects/arm-eventhub-profile-2020-09-01-hybrid.tgz '@rush-temp/arm-extendedlocation': file:./projects/arm-extendedlocation.tgz '@rush-temp/arm-features': file:./projects/arm-features.tgz '@rush-temp/arm-frontdoor': file:./projects/arm-frontdoor.tgz @@ -325,6 +326,7 @@ dependencies: '@rush-temp/arm-domainservices': file:projects/arm-domainservices.tgz '@rush-temp/arm-eventgrid': file:projects/arm-eventgrid.tgz '@rush-temp/arm-eventhub': file:projects/arm-eventhub.tgz + '@rush-temp/arm-eventhub-profile-2020-09-01-hybrid': file:projects/arm-eventhub-profile-2020-09-01-hybrid.tgz '@rush-temp/arm-extendedlocation': file:projects/arm-extendedlocation.tgz '@rush-temp/arm-features': file:projects/arm-features.tgz '@rush-temp/arm-frontdoor': file:projects/arm-frontdoor.tgz @@ -10418,6 +10420,34 @@ packages: - supports-color dev: false + file:projects/arm-eventhub-profile-2020-09-01-hybrid.tgz: + resolution: {integrity: sha512-Pz9pmtIeZpFJP3OrAAF8VFnYIvLYtzEKPXu4d8rOyg4azrtOjtkr3GqMGYnpUfjmAxvhx7OwFYko03r6ERd/rA==, tarball: file:projects/arm-eventhub-profile-2020-09-01-hybrid.tgz} + name: '@rush-temp/arm-eventhub-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-eventhub.tgz: resolution: {integrity: sha512-PSXQZCbu3khNcog69nSkJIkxY5B/rrJrDzexztWggP8zv739TwQNKg4UU8bQ4D/FguT6lMaqLk/umLu+cQ9/Pg==, tarball: file:projects/arm-eventhub.tgz} name: '@rush-temp/arm-eventhub' diff --git a/eng/ignore-links.txt b/eng/ignore-links.txt index 1328f49cee3f..ee659f1fa098 100644 --- a/eng/ignore-links.txt +++ b/eng/ignore-links.txt @@ -21,3 +21,4 @@ https://docs.microsoft.com/javascript/api/@azure/arm-keyvault-profile-2020-09-01 https://docs.microsoft.com/javascript/api/@azure/arm-network-profile-2020-09-01-hybrid https://docs.microsoft.com/javascript/api/@azure/arm-commerce-profile-2020-09-01-hybrid?view=azure-node-preview 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 diff --git a/rush.json b/rush.json index 9325d10aba96..145122271f96 100644 --- a/rush.json +++ b/rush.json @@ -1634,6 +1634,11 @@ "packageName": "@azure/arm-compute-profile-2020-09-01-hybrid", "projectFolder": "sdk/compute/arm-compute-profile-2020-09-01-hybrid", "versionPolicyName": "management" + }, + { + "packageName": "@azure/arm-eventhub-profile-2020-09-01-hybrid", + "projectFolder": "sdk/eventhub/arm-eventhub-profile-2020-09-01-hybrid", + "versionPolicyName": "management" } ] } \ No newline at end of file diff --git a/sdk/eventhub/arm-eventhub-profile-2020-09-01-hybrid/CHANGELOG.md b/sdk/eventhub/arm-eventhub-profile-2020-09-01-hybrid/CHANGELOG.md new file mode 100644 index 000000000000..f19ab7416e29 --- /dev/null +++ b/sdk/eventhub/arm-eventhub-profile-2020-09-01-hybrid/CHANGELOG.md @@ -0,0 +1,11 @@ +# Release History + +## 2.0.0 (2022-03-10) + +The package of @azure/arm-eventhub-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/eventhub/arm-eventhub-profile-2020-09-01-hybrid/LICENSE b/sdk/eventhub/arm-eventhub-profile-2020-09-01-hybrid/LICENSE new file mode 100644 index 000000000000..5d1d36e0af80 --- /dev/null +++ b/sdk/eventhub/arm-eventhub-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/eventhub/arm-eventhub-profile-2020-09-01-hybrid/README.md b/sdk/eventhub/arm-eventhub-profile-2020-09-01-hybrid/README.md index 4783a31e606a..12190b66f3e6 100644 --- a/sdk/eventhub/arm-eventhub-profile-2020-09-01-hybrid/README.md +++ b/sdk/eventhub/arm-eventhub-profile-2020-09-01-hybrid/README.md @@ -1,109 +1,109 @@ -## Azure EventHubManagementClient SDK for JavaScript +# Azure EventHubManagement client library for JavaScript -This package contains an isomorphic SDK (runs both in Node.js and in browsers) for EventHubManagementClient. +This package contains an isomorphic SDK (runs both in Node.js and in browsers) for Azure EventHubManagement client. + +Azure Event Hubs client for managing Event Hubs Cluster, IPFilter Rules and VirtualNetworkRules resources. + +[Source code](https://github.com/Azure/azure-sdk-for-js/tree/main/sdk/eventhub/arm-eventhub-profile-2020-09-01-hybrid) | +[Package (NPM)](https://www.npmjs.com/package/@azure/arm-eventhub-profile-2020-09-01-hybrid) | +[API reference documentation](https://docs.microsoft.com/javascript/api/@azure/arm-eventhub-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 -You must have an [Azure subscription](https://azure.microsoft.com/free/). +- An [Azure subscription][azure_sub]. -### How to install +### Install the `@azure/arm-eventhub-profile-2020-09-01-hybrid` package -To use this SDK in your project, you will need to install two packages. -- `@azure/arm-eventhub-profile-2020-09-01-hybrid` that contains the client. -- `@azure/identity` that provides different mechanisms for the client to authenticate your requests using Azure Active Directory. +Install the Azure EventHubManagement client library for JavaScript with `npm`: -Install both packages using the below command: ```bash -npm install --save @azure/arm-eventhub-profile-2020-09-01-hybrid @azure/identity +npm install @azure/arm-eventhub-profile-2020-09-01-hybrid ``` -> **Note**: You may have used either `@azure/ms-rest-nodeauth` or `@azure/ms-rest-browserauth` in the past. These packages are in maintenance mode receiving critical bug fixes, but no new features. -If you are on a [Node.js that has LTS status](https://nodejs.org/about/releases/), or are writing a client side browser application, we strongly encourage you to upgrade to `@azure/identity` which uses the latest versions of Azure Active Directory and MSAL APIs and provides more authentication options. +### Create and authenticate a `EventHubManagementClient` -### How to use +To create a client object to access the Azure EventHubManagement API, you will need the `endpoint` of your Azure EventHubManagement resource and a `credential`. The Azure EventHubManagement client can use Azure Active Directory credentials to authenticate. +You can find the endpoint for your Azure EventHubManagement resource in the [Azure Portal][azure_portal]. -- If you are writing a client side browser application, - - Follow the instructions in the section on Authenticating client side browser applications in [Azure Identity examples](https://aka.ms/azsdk/js/identity/examples) to register your application in the Microsoft identity platform and set the right permissions. - - Copy the client ID and tenant ID from the Overview section of your app registration in Azure portal and use it in the browser sample below. -- If you are writing a server side application, - - [Select a credential from `@azure/identity` based on the authentication method of your choice](https://aka.ms/azsdk/js/identity/examples) - - Complete the set up steps required by the credential if any. - - Use the credential you picked in the place of `DefaultAzureCredential` in the Node.js sample below. +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). -In the below samples, we pass the credential and the Azure subscription id to instantiate the client. -Once the client is created, explore the operations on it either in your favorite editor or in our [API reference documentation](https://docs.microsoft.com/javascript/api) to get started. +To use the [DefaultAzureCredential][defaultazurecredential] provider shown below, or other credential providers provided with the Azure SDK, please install the `@azure/identity` package: + +```bash +npm install @azure/identity +``` -#### nodejs - Authentication, client creation, and listAvailableClusterRegion clusters as an example written in JavaScript. +You will also need to **register a new AAD application and grant access to Azure EventHubManagement** 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`. -##### Sample code +For more information about how to create an Azure AD Application check out [this guide](https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal). ```javascript -const { DefaultAzureCredential } = require("@azure/identity"); const { EventHubManagementClient } = require("@azure/arm-eventhub-profile-2020-09-01-hybrid"); -const subscriptionId = process.env["AZURE_SUBSCRIPTION_ID"]; - -// Use `DefaultAzureCredential` or any other credential of your choice based on https://aka.ms/azsdk/js/identity/examples -// Please note that you can also use credentials from the `@azure/ms-rest-nodeauth` package instead. -const creds = new DefaultAzureCredential(); -const client = new EventHubManagementClient(creds, subscriptionId); - -client.clusters.listAvailableClusterRegion().then((result) => { - console.log("The result is:"); - console.log(result); -}).catch((err) => { - console.log("An error occurred:"); - console.error(err); -}); +const { DefaultAzureCredential } = require("@azure/identity"); +// For client-side applications running in the browser, use InteractiveBrowserCredential instead of DefaultAzureCredential. See https://aka.ms/azsdk/js/identity/examples for more details. + +const subscriptionId = "00000000-0000-0000-0000-000000000000"; +const client = new EventHubManagementClient(new DefaultAzureCredential(), subscriptionId); + +// For client-side applications running in the browser, use this code instead: +// const credential = new InteractiveBrowserCredential({ +// tenantId: "", +// clientId: "" +// }); +// const client = new EventHubManagementClient(credential, subscriptionId); ``` -#### browser - Authentication, client creation, and listAvailableClusterRegion clusters as an example written in JavaScript. - -In browser applications, we recommend using the `InteractiveBrowserCredential` that interactively authenticates using the default system browser. - - See [Single-page application: App registration guide](https://docs.microsoft.com/azure/active-directory/develop/scenario-spa-app-registration) to configure your app registration for the browser. - - Note down the client Id from the previous step and use it in the browser sample below. - -##### Sample code - -- index.html - -```html - - - - @azure/arm-eventhub-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 + +### EventHubManagementClient + +`EventHubManagementClient` is the primary interface for developers using the Azure EventHubManagement client library. Explore the methods on this client object to understand the different features of the Azure EventHubManagement 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%2Feventhub%2Farm-eventhub-profile-2020-09-01-hybrid%2FREADME.png) -![Impressions](https://azure-sdk-impressions.azurewebsites.net/api/impressions/azure-sdk-for-js/sdk/eventhub/arm-eventhub-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/eventhub/arm-eventhub-profile-2020-09-01-hybrid/_meta.json b/sdk/eventhub/arm-eventhub-profile-2020-09-01-hybrid/_meta.json new file mode 100644 index 000000000000..926886005838 --- /dev/null +++ b/sdk/eventhub/arm-eventhub-profile-2020-09-01-hybrid/_meta.json @@ -0,0 +1,8 @@ +{ + "commit": "1067b78669466324a1a2666adf053433c61e7f77", + "readme": "specification/eventhub/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\\eventhub\\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/eventhub/arm-eventhub-profile-2020-09-01-hybrid/api-extractor.json b/sdk/eventhub/arm-eventhub-profile-2020-09-01-hybrid/api-extractor.json new file mode 100644 index 000000000000..cbc47d9031fd --- /dev/null +++ b/sdk/eventhub/arm-eventhub-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-eventhub-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/eventhub/arm-eventhub-profile-2020-09-01-hybrid/package.json b/sdk/eventhub/arm-eventhub-profile-2020-09-01-hybrid/package.json index 45f81359acb0..8eaeb093ff00 100644 --- a/sdk/eventhub/arm-eventhub-profile-2020-09-01-hybrid/package.json +++ b/sdk/eventhub/arm-eventhub-profile-2020-09-01-hybrid/package.json @@ -1,13 +1,20 @@ { "name": "@azure/arm-eventhub-profile-2020-09-01-hybrid", + "sdk-type": "mgmt", "author": "Microsoft Corporation", - "description": "EventHubManagementClient Library with typescript type definitions for node.js and browser.", - "version": "1.1.0", + "description": "A generated SDK for EventHubManagementClient.", + "version": "2.0.0", + "engines": { + "node": ">=12.0.0" + }, "dependencies": { - "@azure/ms-rest-azure-js": "^2.1.0", - "@azure/ms-rest-js": "^2.2.0", - "@azure/core-auth": "^1.1.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", @@ -17,15 +24,25 @@ "isomorphic" ], "license": "MIT", - "main": "./dist/arm-eventhub-profile-2020-09-01-hybrid.js", - "module": "./esm/eventHubManagementClient.js", - "types": "./esm/eventHubManagementClient.d.ts", + "main": "./dist/index.js", + "module": "./dist-esm/src/index.js", + "types": "./types/arm-eventhub-profile-2020-09-01-hybrid.d.ts", "devDependencies": { - "typescript": "^3.6.0", - "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/eventhub/arm-eventhub-profile-2020-09-01-hybrid", "repository": { @@ -40,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-eventhub-profile-2020-09-01-hybrid.js.map'\" -o ./dist/arm-eventhub-profile-2020-09-01-hybrid.min.js ./dist/arm-eventhub-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/eventHubManagementClient.ts", + "prefix": "packageDetails" + } + ] + }, "autoPublish": true } diff --git a/sdk/eventhub/arm-eventhub-profile-2020-09-01-hybrid/recordings/node/my_test/recording_sample_test.js b/sdk/eventhub/arm-eventhub-profile-2020-09-01-hybrid/recordings/node/my_test/recording_sample_test.js new file mode 100644 index 000000000000..0f6ecb857acf --- /dev/null +++ b/sdk/eventhub/arm-eventhub-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/eventhub/arm-eventhub-profile-2020-09-01-hybrid/review/arm-eventhub-profile-2020-09-01-hybrid.api.md b/sdk/eventhub/arm-eventhub-profile-2020-09-01-hybrid/review/arm-eventhub-profile-2020-09-01-hybrid.api.md new file mode 100644 index 000000000000..6d5b4b0ae311 --- /dev/null +++ b/sdk/eventhub/arm-eventhub-profile-2020-09-01-hybrid/review/arm-eventhub-profile-2020-09-01-hybrid.api.md @@ -0,0 +1,886 @@ +## API Report File for "@azure/arm-eventhub-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 interface AccessKeys { + readonly aliasPrimaryConnectionString?: string; + readonly aliasSecondaryConnectionString?: string; + readonly keyName?: string; + readonly primaryConnectionString?: string; + readonly primaryKey?: string; + readonly secondaryConnectionString?: string; + readonly secondaryKey?: string; +} + +// @public +export type AccessRights = string; + +// @public +export type AuthorizationRule = Resource & { + rights?: AccessRights[]; +}; + +// @public +export interface AuthorizationRuleListResult { + nextLink?: string; + value?: AuthorizationRule[]; +} + +// @public +export interface AvailableCluster { + location?: string; +} + +// @public +export interface AvailableClustersList { + value?: AvailableCluster[]; +} + +// @public +export interface CaptureDescription { + destination?: Destination; + enabled?: boolean; + encoding?: EncodingCaptureDescription; + intervalInSeconds?: number; + sizeLimitInBytes?: number; + skipEmptyArchives?: boolean; +} + +// @public +export interface CheckNameAvailabilityParameter { + name: string; +} + +// @public +export interface CheckNameAvailabilityResult { + readonly message?: string; + nameAvailable?: boolean; + reason?: UnavailableReason; +} + +// @public +export type Cluster = TrackedResource & { + sku?: ClusterSku; + readonly createdAt?: string; + readonly updatedAt?: string; + readonly metricId?: string; + readonly status?: string; +}; + +// @public +export interface ClusterListResult { + nextLink?: string; + value?: Cluster[]; +} + +// @public +export interface Clusters { + beginCreateOrUpdate(resourceGroupName: string, clusterName: string, parameters: Cluster, options?: ClustersCreateOrUpdateOptionalParams): Promise, ClustersCreateOrUpdateResponse>>; + beginCreateOrUpdateAndWait(resourceGroupName: string, clusterName: string, parameters: Cluster, options?: ClustersCreateOrUpdateOptionalParams): Promise; + beginDelete(resourceGroupName: string, clusterName: string, options?: ClustersDeleteOptionalParams): Promise, void>>; + beginDeleteAndWait(resourceGroupName: string, clusterName: string, options?: ClustersDeleteOptionalParams): Promise; + beginUpdate(resourceGroupName: string, clusterName: string, parameters: Cluster, options?: ClustersUpdateOptionalParams): Promise, ClustersUpdateResponse>>; + beginUpdateAndWait(resourceGroupName: string, clusterName: string, parameters: Cluster, options?: ClustersUpdateOptionalParams): Promise; + get(resourceGroupName: string, clusterName: string, options?: ClustersGetOptionalParams): Promise; + listAvailableClusterRegion(options?: ClustersListAvailableClusterRegionOptionalParams): Promise; + listByResourceGroup(resourceGroupName: string, options?: ClustersListByResourceGroupOptionalParams): PagedAsyncIterableIterator; + listNamespaces(resourceGroupName: string, clusterName: string, options?: ClustersListNamespacesOptionalParams): Promise; +} + +// @public +export interface ClustersCreateOrUpdateOptionalParams extends coreClient.OperationOptions { + resumeFrom?: string; + updateIntervalInMs?: number; +} + +// @public +export type ClustersCreateOrUpdateResponse = Cluster; + +// @public +export interface ClustersDeleteOptionalParams extends coreClient.OperationOptions { + resumeFrom?: string; + updateIntervalInMs?: number; +} + +// @public +export interface ClustersGetOptionalParams extends coreClient.OperationOptions { +} + +// @public +export type ClustersGetResponse = Cluster; + +// @public +export interface ClusterSku { + capacity?: number; + name: ClusterSkuName; +} + +// @public +export type ClusterSkuName = string; + +// @public +export interface ClustersListAvailableClusterRegionOptionalParams extends coreClient.OperationOptions { +} + +// @public +export type ClustersListAvailableClusterRegionResponse = AvailableClustersList; + +// @public +export interface ClustersListByResourceGroupNextOptionalParams extends coreClient.OperationOptions { +} + +// @public +export type ClustersListByResourceGroupNextResponse = ClusterListResult; + +// @public +export interface ClustersListByResourceGroupOptionalParams extends coreClient.OperationOptions { +} + +// @public +export type ClustersListByResourceGroupResponse = ClusterListResult; + +// @public +export interface ClustersListNamespacesOptionalParams extends coreClient.OperationOptions { +} + +// @public +export type ClustersListNamespacesResponse = EHNamespaceIdListResult; + +// @public +export interface ClustersUpdateOptionalParams extends coreClient.OperationOptions { + resumeFrom?: string; + updateIntervalInMs?: number; +} + +// @public +export type ClustersUpdateResponse = Cluster; + +// @public +export interface ConnectionState { + description?: string; + status?: PrivateLinkConnectionStatus; +} + +// @public +export type ConsumerGroup = Resource & { + readonly createdAt?: Date; + readonly updatedAt?: Date; + userMetadata?: string; +}; + +// @public +export interface ConsumerGroupListResult { + nextLink?: string; + value?: ConsumerGroup[]; +} + +// @public +export interface ConsumerGroups { + createOrUpdate(resourceGroupName: string, namespaceName: string, eventHubName: string, consumerGroupName: string, parameters: ConsumerGroup, options?: ConsumerGroupsCreateOrUpdateOptionalParams): Promise; + delete(resourceGroupName: string, namespaceName: string, eventHubName: string, consumerGroupName: string, options?: ConsumerGroupsDeleteOptionalParams): Promise; + get(resourceGroupName: string, namespaceName: string, eventHubName: string, consumerGroupName: string, options?: ConsumerGroupsGetOptionalParams): Promise; + listByEventHub(resourceGroupName: string, namespaceName: string, eventHubName: string, options?: ConsumerGroupsListByEventHubOptionalParams): PagedAsyncIterableIterator; +} + +// @public +export interface ConsumerGroupsCreateOrUpdateOptionalParams extends coreClient.OperationOptions { +} + +// @public +export type ConsumerGroupsCreateOrUpdateResponse = ConsumerGroup; + +// @public +export interface ConsumerGroupsDeleteOptionalParams extends coreClient.OperationOptions { +} + +// @public +export interface ConsumerGroupsGetOptionalParams extends coreClient.OperationOptions { +} + +// @public +export type ConsumerGroupsGetResponse = ConsumerGroup; + +// @public +export interface ConsumerGroupsListByEventHubNextOptionalParams extends coreClient.OperationOptions { + skip?: number; + top?: number; +} + +// @public +export type ConsumerGroupsListByEventHubNextResponse = ConsumerGroupListResult; + +// @public +export interface ConsumerGroupsListByEventHubOptionalParams extends coreClient.OperationOptions { + skip?: number; + top?: number; +} + +// @public +export type ConsumerGroupsListByEventHubResponse = ConsumerGroupListResult; + +// @public +export interface Destination { + archiveNameFormat?: string; + blobContainer?: string; + name?: string; + storageAccountResourceId?: string; +} + +// @public +export interface DisasterRecoveryConfigs { + getAuthorizationRule(resourceGroupName: string, namespaceName: string, alias: string, authorizationRuleName: string, options?: DisasterRecoveryConfigsGetAuthorizationRuleOptionalParams): Promise; + listAuthorizationRules(resourceGroupName: string, namespaceName: string, alias: string, options?: DisasterRecoveryConfigsListAuthorizationRulesOptionalParams): PagedAsyncIterableIterator; + listKeys(resourceGroupName: string, namespaceName: string, alias: string, authorizationRuleName: string, options?: DisasterRecoveryConfigsListKeysOptionalParams): Promise; +} + +// @public +export interface DisasterRecoveryConfigsGetAuthorizationRuleOptionalParams extends coreClient.OperationOptions { +} + +// @public +export type DisasterRecoveryConfigsGetAuthorizationRuleResponse = AuthorizationRule; + +// @public +export interface DisasterRecoveryConfigsListAuthorizationRulesNextOptionalParams extends coreClient.OperationOptions { +} + +// @public +export type DisasterRecoveryConfigsListAuthorizationRulesNextResponse = AuthorizationRuleListResult; + +// @public +export interface DisasterRecoveryConfigsListAuthorizationRulesOptionalParams extends coreClient.OperationOptions { +} + +// @public +export type DisasterRecoveryConfigsListAuthorizationRulesResponse = AuthorizationRuleListResult; + +// @public +export interface DisasterRecoveryConfigsListKeysOptionalParams extends coreClient.OperationOptions { +} + +// @public +export type DisasterRecoveryConfigsListKeysResponse = AccessKeys; + +// @public +export type EHNamespace = TrackedResource & { + sku?: Sku; + identity?: Identity; + readonly provisioningState?: string; + readonly status?: string; + readonly createdAt?: Date; + readonly updatedAt?: Date; + readonly serviceBusEndpoint?: string; + clusterArmId?: string; + readonly metricId?: string; + isAutoInflateEnabled?: boolean; + maximumThroughputUnits?: number; + kafkaEnabled?: boolean; + zoneRedundant?: boolean; + encryption?: Encryption; +}; + +// @public +export interface EHNamespaceIdContainer { + id?: string; +} + +// @public +export interface EHNamespaceIdListResult { + value?: EHNamespaceIdContainer[]; +} + +// @public +export interface EHNamespaceListResult { + nextLink?: string; + value?: EHNamespace[]; +} + +// @public +export type EncodingCaptureDescription = "Avro" | "AvroDeflate"; + +// @public +export interface Encryption { + keySource?: "Microsoft.KeyVault"; + keyVaultProperties?: KeyVaultProperties[]; +} + +// @public +export type EndPointProvisioningState = string; + +// @public +export type EntityStatus = "Active" | "Disabled" | "Restoring" | "SendDisabled" | "ReceiveDisabled" | "Creating" | "Deleting" | "Renaming" | "Unknown"; + +// @public +export interface ErrorResponse { + code?: string; + message?: string; +} + +// @public +export type Eventhub = Resource & { + readonly partitionIds?: string[]; + readonly createdAt?: Date; + readonly updatedAt?: Date; + messageRetentionInDays?: number; + partitionCount?: number; + status?: EntityStatus; + captureDescription?: CaptureDescription; +}; + +// @public +export interface EventHubListResult { + nextLink?: string; + value?: Eventhub[]; +} + +// @public (undocumented) +export class EventHubManagementClient extends coreClient.ServiceClient { + // (undocumented) + $host: string; + constructor(credentials: coreAuth.TokenCredential, subscriptionId: string, options?: EventHubManagementClientOptionalParams); + // (undocumented) + clusters: Clusters; + // (undocumented) + consumerGroups: ConsumerGroups; + // (undocumented) + disasterRecoveryConfigs: DisasterRecoveryConfigs; + // (undocumented) + eventHubs: EventHubs; + // (undocumented) + namespaces: Namespaces; + // (undocumented) + operations: Operations; + // (undocumented) + privateEndpointConnections: PrivateEndpointConnections; + // (undocumented) + privateLinkResources: PrivateLinkResources; + // (undocumented) + regions: Regions; + // (undocumented) + subscriptionId: string; +} + +// @public +export interface EventHubManagementClientOptionalParams extends coreClient.ServiceClientOptions { + $host?: string; + endpoint?: string; +} + +// @public +export interface EventHubs { + createOrUpdate(resourceGroupName: string, namespaceName: string, eventHubName: string, parameters: Eventhub, options?: EventHubsCreateOrUpdateOptionalParams): Promise; + createOrUpdateAuthorizationRule(resourceGroupName: string, namespaceName: string, eventHubName: string, authorizationRuleName: string, parameters: AuthorizationRule, options?: EventHubsCreateOrUpdateAuthorizationRuleOptionalParams): Promise; + delete(resourceGroupName: string, namespaceName: string, eventHubName: string, options?: EventHubsDeleteOptionalParams): Promise; + deleteAuthorizationRule(resourceGroupName: string, namespaceName: string, eventHubName: string, authorizationRuleName: string, options?: EventHubsDeleteAuthorizationRuleOptionalParams): Promise; + get(resourceGroupName: string, namespaceName: string, eventHubName: string, options?: EventHubsGetOptionalParams): Promise; + getAuthorizationRule(resourceGroupName: string, namespaceName: string, eventHubName: string, authorizationRuleName: string, options?: EventHubsGetAuthorizationRuleOptionalParams): Promise; + listAuthorizationRules(resourceGroupName: string, namespaceName: string, eventHubName: string, options?: EventHubsListAuthorizationRulesOptionalParams): PagedAsyncIterableIterator; + listByNamespace(resourceGroupName: string, namespaceName: string, options?: EventHubsListByNamespaceOptionalParams): PagedAsyncIterableIterator; + listKeys(resourceGroupName: string, namespaceName: string, eventHubName: string, authorizationRuleName: string, options?: EventHubsListKeysOptionalParams): Promise; + regenerateKeys(resourceGroupName: string, namespaceName: string, eventHubName: string, authorizationRuleName: string, parameters: RegenerateAccessKeyParameters, options?: EventHubsRegenerateKeysOptionalParams): Promise; +} + +// @public +export interface EventHubsCreateOrUpdateAuthorizationRuleOptionalParams extends coreClient.OperationOptions { +} + +// @public +export type EventHubsCreateOrUpdateAuthorizationRuleResponse = AuthorizationRule; + +// @public +export interface EventHubsCreateOrUpdateOptionalParams extends coreClient.OperationOptions { +} + +// @public +export type EventHubsCreateOrUpdateResponse = Eventhub; + +// @public +export interface EventHubsDeleteAuthorizationRuleOptionalParams extends coreClient.OperationOptions { +} + +// @public +export interface EventHubsDeleteOptionalParams extends coreClient.OperationOptions { +} + +// @public +export interface EventHubsGetAuthorizationRuleOptionalParams extends coreClient.OperationOptions { +} + +// @public +export type EventHubsGetAuthorizationRuleResponse = AuthorizationRule; + +// @public +export interface EventHubsGetOptionalParams extends coreClient.OperationOptions { +} + +// @public +export type EventHubsGetResponse = Eventhub; + +// @public +export interface EventHubsListAuthorizationRulesNextOptionalParams extends coreClient.OperationOptions { +} + +// @public +export type EventHubsListAuthorizationRulesNextResponse = AuthorizationRuleListResult; + +// @public +export interface EventHubsListAuthorizationRulesOptionalParams extends coreClient.OperationOptions { +} + +// @public +export type EventHubsListAuthorizationRulesResponse = AuthorizationRuleListResult; + +// @public +export interface EventHubsListByNamespaceNextOptionalParams extends coreClient.OperationOptions { + skip?: number; + top?: number; +} + +// @public +export type EventHubsListByNamespaceNextResponse = EventHubListResult; + +// @public +export interface EventHubsListByNamespaceOptionalParams extends coreClient.OperationOptions { + skip?: number; + top?: number; +} + +// @public +export type EventHubsListByNamespaceResponse = EventHubListResult; + +// @public +export interface EventHubsListKeysOptionalParams extends coreClient.OperationOptions { +} + +// @public +export type EventHubsListKeysResponse = AccessKeys; + +// @public +export interface EventHubsRegenerateKeysOptionalParams extends coreClient.OperationOptions { +} + +// @public +export type EventHubsRegenerateKeysResponse = AccessKeys; + +// @public +export interface Identity { + principalId?: string; + tenantId?: string; + type?: "SystemAssigned"; +} + +// @public +type KeyType_2 = "PrimaryKey" | "SecondaryKey"; +export { KeyType_2 as KeyType } + +// @public +export interface KeyVaultProperties { + keyName?: string; + keyVaultUri?: string; + keyVersion?: string; +} + +// @public +export enum KnownAccessRights { + // (undocumented) + Listen = "Listen", + // (undocumented) + Manage = "Manage", + // (undocumented) + Send = "Send" +} + +// @public +export enum KnownClusterSkuName { + // (undocumented) + Dedicated = "Dedicated" +} + +// @public +export enum KnownEndPointProvisioningState { + // (undocumented) + Canceled = "Canceled", + // (undocumented) + Creating = "Creating", + // (undocumented) + Deleting = "Deleting", + // (undocumented) + Failed = "Failed", + // (undocumented) + Succeeded = "Succeeded", + // (undocumented) + Updating = "Updating" +} + +// @public +export enum KnownPrivateLinkConnectionStatus { + // (undocumented) + Approved = "Approved", + // (undocumented) + Disconnected = "Disconnected", + // (undocumented) + Pending = "Pending", + // (undocumented) + Rejected = "Rejected" +} + +// @public +export enum KnownSkuName { + // (undocumented) + Basic = "Basic", + // (undocumented) + Standard = "Standard" +} + +// @public +export enum KnownSkuTier { + // (undocumented) + Basic = "Basic", + // (undocumented) + Standard = "Standard" +} + +// @public +export type MessagingRegions = TrackedResource & { + properties?: MessagingRegionsProperties; +}; + +// @public +export interface MessagingRegionsListResult { + readonly nextLink?: string; + value?: MessagingRegions[]; +} + +// @public +export interface MessagingRegionsProperties { + readonly code?: string; + readonly fullName?: string; +} + +// @public +export interface Namespaces { + beginCreateOrUpdate(resourceGroupName: string, namespaceName: string, parameters: EHNamespace, options?: NamespacesCreateOrUpdateOptionalParams): Promise, NamespacesCreateOrUpdateResponse>>; + beginCreateOrUpdateAndWait(resourceGroupName: string, namespaceName: string, parameters: EHNamespace, options?: NamespacesCreateOrUpdateOptionalParams): Promise; + beginDelete(resourceGroupName: string, namespaceName: string, options?: NamespacesDeleteOptionalParams): Promise, void>>; + beginDeleteAndWait(resourceGroupName: string, namespaceName: string, options?: NamespacesDeleteOptionalParams): Promise; + checkNameAvailability(parameters: CheckNameAvailabilityParameter, options?: NamespacesCheckNameAvailabilityOptionalParams): Promise; + createOrUpdateAuthorizationRule(resourceGroupName: string, namespaceName: string, authorizationRuleName: string, parameters: AuthorizationRule, options?: NamespacesCreateOrUpdateAuthorizationRuleOptionalParams): Promise; + deleteAuthorizationRule(resourceGroupName: string, namespaceName: string, authorizationRuleName: string, options?: NamespacesDeleteAuthorizationRuleOptionalParams): Promise; + get(resourceGroupName: string, namespaceName: string, options?: NamespacesGetOptionalParams): Promise; + getAuthorizationRule(resourceGroupName: string, namespaceName: string, authorizationRuleName: string, options?: NamespacesGetAuthorizationRuleOptionalParams): Promise; + list(options?: NamespacesListOptionalParams): PagedAsyncIterableIterator; + listAuthorizationRules(resourceGroupName: string, namespaceName: string, options?: NamespacesListAuthorizationRulesOptionalParams): PagedAsyncIterableIterator; + listByResourceGroup(resourceGroupName: string, options?: NamespacesListByResourceGroupOptionalParams): PagedAsyncIterableIterator; + listKeys(resourceGroupName: string, namespaceName: string, authorizationRuleName: string, options?: NamespacesListKeysOptionalParams): Promise; + regenerateKeys(resourceGroupName: string, namespaceName: string, authorizationRuleName: string, parameters: RegenerateAccessKeyParameters, options?: NamespacesRegenerateKeysOptionalParams): Promise; + update(resourceGroupName: string, namespaceName: string, parameters: EHNamespace, options?: NamespacesUpdateOptionalParams): Promise; +} + +// @public +export interface NamespacesCheckNameAvailabilityOptionalParams extends coreClient.OperationOptions { +} + +// @public +export type NamespacesCheckNameAvailabilityResponse = CheckNameAvailabilityResult; + +// @public +export interface NamespacesCreateOrUpdateAuthorizationRuleOptionalParams extends coreClient.OperationOptions { +} + +// @public +export type NamespacesCreateOrUpdateAuthorizationRuleResponse = AuthorizationRule; + +// @public +export interface NamespacesCreateOrUpdateOptionalParams extends coreClient.OperationOptions { + resumeFrom?: string; + updateIntervalInMs?: number; +} + +// @public +export type NamespacesCreateOrUpdateResponse = EHNamespace; + +// @public +export interface NamespacesDeleteAuthorizationRuleOptionalParams extends coreClient.OperationOptions { +} + +// @public +export interface NamespacesDeleteOptionalParams extends coreClient.OperationOptions { + resumeFrom?: string; + updateIntervalInMs?: number; +} + +// @public +export interface NamespacesGetAuthorizationRuleOptionalParams extends coreClient.OperationOptions { +} + +// @public +export type NamespacesGetAuthorizationRuleResponse = AuthorizationRule; + +// @public +export interface NamespacesGetOptionalParams extends coreClient.OperationOptions { +} + +// @public +export type NamespacesGetResponse = EHNamespace; + +// @public +export interface NamespacesListAuthorizationRulesNextOptionalParams extends coreClient.OperationOptions { +} + +// @public +export type NamespacesListAuthorizationRulesNextResponse = AuthorizationRuleListResult; + +// @public +export interface NamespacesListAuthorizationRulesOptionalParams extends coreClient.OperationOptions { +} + +// @public +export type NamespacesListAuthorizationRulesResponse = AuthorizationRuleListResult; + +// @public +export interface NamespacesListByResourceGroupNextOptionalParams extends coreClient.OperationOptions { +} + +// @public +export type NamespacesListByResourceGroupNextResponse = EHNamespaceListResult; + +// @public +export interface NamespacesListByResourceGroupOptionalParams extends coreClient.OperationOptions { +} + +// @public +export type NamespacesListByResourceGroupResponse = EHNamespaceListResult; + +// @public +export interface NamespacesListKeysOptionalParams extends coreClient.OperationOptions { +} + +// @public +export type NamespacesListKeysResponse = AccessKeys; + +// @public +export interface NamespacesListNextOptionalParams extends coreClient.OperationOptions { +} + +// @public +export type NamespacesListNextResponse = EHNamespaceListResult; + +// @public +export interface NamespacesListOptionalParams extends coreClient.OperationOptions { +} + +// @public +export type NamespacesListResponse = EHNamespaceListResult; + +// @public +export interface NamespacesRegenerateKeysOptionalParams extends coreClient.OperationOptions { +} + +// @public +export type NamespacesRegenerateKeysResponse = AccessKeys; + +// @public +export interface NamespacesUpdateOptionalParams extends coreClient.OperationOptions { +} + +// @public +export type NamespacesUpdateResponse = EHNamespace; + +// @public +export interface Operation { + display?: OperationDisplay; + readonly name?: string; +} + +// @public +export interface OperationDisplay { + readonly operation?: string; + readonly provider?: string; + readonly resource?: string; +} + +// @public +export interface OperationListResult { + readonly nextLink?: string; + readonly value?: Operation[]; +} + +// @public +export interface Operations { + list(options?: OperationsListOptionalParams): PagedAsyncIterableIterator; +} + +// @public +export interface OperationsListNextOptionalParams extends coreClient.OperationOptions { +} + +// @public +export type OperationsListNextResponse = OperationListResult; + +// @public +export interface OperationsListOptionalParams extends coreClient.OperationOptions { +} + +// @public +export type OperationsListResponse = OperationListResult; + +// @public +export interface PrivateEndpoint { + id?: string; +} + +// @public +export type PrivateEndpointConnection = Resource & { + privateEndpoint?: PrivateEndpoint; + privateLinkServiceConnectionState?: ConnectionState; + provisioningState?: EndPointProvisioningState; +}; + +// @public +export interface PrivateEndpointConnectionListResult { + nextLink?: string; + value?: PrivateEndpointConnection[]; +} + +// @public +export interface PrivateEndpointConnections { + beginDelete(resourceGroupName: string, namespaceName: string, privateEndpointConnectionName: string, options?: PrivateEndpointConnectionsDeleteOptionalParams): Promise, void>>; + beginDeleteAndWait(resourceGroupName: string, namespaceName: string, privateEndpointConnectionName: string, options?: PrivateEndpointConnectionsDeleteOptionalParams): Promise; + createOrUpdate(resourceGroupName: string, namespaceName: string, privateEndpointConnectionName: string, parameters: PrivateEndpointConnection, options?: PrivateEndpointConnectionsCreateOrUpdateOptionalParams): Promise; + get(resourceGroupName: string, namespaceName: string, privateEndpointConnectionName: string, options?: PrivateEndpointConnectionsGetOptionalParams): Promise; + list(resourceGroupName: string, namespaceName: string, options?: PrivateEndpointConnectionsListOptionalParams): PagedAsyncIterableIterator; +} + +// @public +export interface PrivateEndpointConnectionsCreateOrUpdateOptionalParams extends coreClient.OperationOptions { +} + +// @public +export type PrivateEndpointConnectionsCreateOrUpdateResponse = PrivateEndpointConnection; + +// @public +export interface PrivateEndpointConnectionsDeleteOptionalParams extends coreClient.OperationOptions { + resumeFrom?: string; + updateIntervalInMs?: number; +} + +// @public +export interface PrivateEndpointConnectionsGetOptionalParams extends coreClient.OperationOptions { +} + +// @public +export type PrivateEndpointConnectionsGetResponse = PrivateEndpointConnection; + +// @public +export interface PrivateEndpointConnectionsListNextOptionalParams extends coreClient.OperationOptions { +} + +// @public +export type PrivateEndpointConnectionsListNextResponse = PrivateEndpointConnectionListResult; + +// @public +export interface PrivateEndpointConnectionsListOptionalParams extends coreClient.OperationOptions { +} + +// @public +export type PrivateEndpointConnectionsListResponse = PrivateEndpointConnectionListResult; + +// @public +export type PrivateLinkConnectionStatus = string; + +// @public +export interface PrivateLinkResource { + groupId?: string; + id?: string; + name?: string; + requiredMembers?: string[]; + requiredZoneNames?: string[]; + type?: string; +} + +// @public +export interface PrivateLinkResources { + get(resourceGroupName: string, namespaceName: string, options?: PrivateLinkResourcesGetOptionalParams): Promise; +} + +// @public +export interface PrivateLinkResourcesGetOptionalParams extends coreClient.OperationOptions { +} + +// @public +export type PrivateLinkResourcesGetResponse = PrivateLinkResourcesListResult; + +// @public +export interface PrivateLinkResourcesListResult { + nextLink?: string; + value?: PrivateLinkResource[]; +} + +// @public +export interface RegenerateAccessKeyParameters { + key?: string; + keyType: KeyType_2; +} + +// @public +export interface Regions { + listBySku(sku: string, options?: RegionsListBySkuOptionalParams): PagedAsyncIterableIterator; +} + +// @public +export interface RegionsListBySkuNextOptionalParams extends coreClient.OperationOptions { +} + +// @public +export type RegionsListBySkuNextResponse = MessagingRegionsListResult; + +// @public +export interface RegionsListBySkuOptionalParams extends coreClient.OperationOptions { +} + +// @public +export type RegionsListBySkuResponse = MessagingRegionsListResult; + +// @public +export interface Resource { + readonly id?: string; + readonly name?: string; + readonly type?: string; +} + +// @public +export interface Sku { + capacity?: number; + name: SkuName; + tier?: SkuTier; +} + +// @public +export type SkuName = string; + +// @public +export type SkuTier = string; + +// @public +export type TrackedResource = Resource & { + location?: string; + tags?: { + [propertyName: string]: string; + }; +}; + +// @public +export type UnavailableReason = "None" | "InvalidName" | "SubscriptionIsDisabled" | "NameInUse" | "NameInLockdown" | "TooManyNamespaceInCurrentSubscription"; + +// (No @packageDocumentation comment for this package) + +``` diff --git a/sdk/eventhub/arm-eventhub-profile-2020-09-01-hybrid/rollup.config.js b/sdk/eventhub/arm-eventhub-profile-2020-09-01-hybrid/rollup.config.js index aa2213454814..3f89d7309da5 100644 --- a/sdk/eventhub/arm-eventhub-profile-2020-09-01-hybrid/rollup.config.js +++ b/sdk/eventhub/arm-eventhub-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/eventHubManagementClient.js", - external: [ - "@azure/ms-rest-js", - "@azure/ms-rest-azure-js" - ], - output: { - file: "./dist/arm-eventhub-profile-2020-09-01-hybrid.js", - format: "umd", - name: "Azure.ArmEventhubProfile20200901Hybrid", - 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/eventhub/arm-eventhub-profile-2020-09-01-hybrid/src/eventHubManagementClient.ts b/sdk/eventhub/arm-eventhub-profile-2020-09-01-hybrid/src/eventHubManagementClient.ts index 0823baa53944..d14a499541da 100644 --- a/sdk/eventhub/arm-eventhub-profile-2020-09-01-hybrid/src/eventHubManagementClient.ts +++ b/sdk/eventhub/arm-eventhub-profile-2020-09-01-hybrid/src/eventHubManagementClient.ts @@ -1,65 +1,110 @@ /* - * 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 { TokenCredential } from "@azure/core-auth"; -import * as Models from "./models"; -import * as Mappers from "./models/mappers"; -import * as operations from "./operations"; -import { EventHubManagementClientContext } from "./eventHubManagementClientContext"; +import * as coreClient from "@azure/core-client"; +import * as coreAuth from "@azure/core-auth"; +import { + ClustersImpl, + NamespacesImpl, + PrivateEndpointConnectionsImpl, + PrivateLinkResourcesImpl, + DisasterRecoveryConfigsImpl, + EventHubsImpl, + ConsumerGroupsImpl, + OperationsImpl, + RegionsImpl +} from "./operations"; +import { + Clusters, + Namespaces, + PrivateEndpointConnections, + PrivateLinkResources, + DisasterRecoveryConfigs, + EventHubs, + ConsumerGroups, + Operations, + Regions +} from "./operationsInterfaces"; +import { EventHubManagementClientOptionalParams } from "./models"; - -class EventHubManagementClient extends EventHubManagementClientContext { - // Operation groups - clusters: operations.Clusters; - namespaces: operations.Namespaces; - privateEndpointConnections: operations.PrivateEndpointConnections; - privateLinkResources: operations.PrivateLinkResources; - disasterRecoveryConfigs: operations.DisasterRecoveryConfigs; - eventHubs: operations.EventHubs; - consumerGroups: operations.ConsumerGroups; - operations: operations.Operations; - regions: operations.Regions; +export class EventHubManagementClient extends coreClient.ServiceClient { + $host: string; + subscriptionId: string; /** * Initializes a new instance of the EventHubManagementClient class. - * @param credentials Credentials needed for the client to connect to Azure. Credentials - * implementing the TokenCredential interface from the @azure/identity package are recommended. For - * more information about these credentials, see - * {@link https://www.npmjs.com/package/@azure/identity}. Credentials implementing the - * ServiceClientCredentials interface from the older packages @azure/ms-rest-nodeauth and - * @azure/ms-rest-browserauth are also supported. + * @param credentials Subscription credentials which uniquely identify client subscription. * @param subscriptionId Subscription credentials that uniquely identify a Microsoft Azure - * subscription. The subscription ID forms part of the URI for every service call. - * @param [options] The parameter options + * subscription. The subscription ID forms part of the URI for every service call. + * @param options The parameter options */ - constructor(credentials: msRest.ServiceClientCredentials | TokenCredential, subscriptionId: string, options?: Models.EventHubManagementClientOptions) { - super(credentials, subscriptionId, options); - this.clusters = new operations.Clusters(this); - this.namespaces = new operations.Namespaces(this); - this.privateEndpointConnections = new operations.PrivateEndpointConnections(this); - this.privateLinkResources = new operations.PrivateLinkResources(this); - this.disasterRecoveryConfigs = new operations.DisasterRecoveryConfigs(this); - this.eventHubs = new operations.EventHubs(this); - this.consumerGroups = new operations.ConsumerGroups(this); - this.operations = new operations.Operations(this); - this.regions = new operations.Regions(this); - } -} + constructor( + credentials: coreAuth.TokenCredential, + subscriptionId: string, + options?: EventHubManagementClientOptionalParams + ) { + 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: EventHubManagementClientOptionalParams = { + requestContentType: "application/json; charset=utf-8", + credential: credentials + }; -// Operation Specifications + const packageDetails = `azsdk-js-arm-eventhub-profile-2020-09-01-hybrid/2.0.0`; + const userAgentPrefix = + options.userAgentOptions && options.userAgentOptions.userAgentPrefix + ? `${options.userAgentOptions.userAgentPrefix} ${packageDetails}` + : `${packageDetails}`; -export { - EventHubManagementClient, - EventHubManagementClientContext, - Models as EventHubManagementModels, - Mappers as EventHubManagementMappers -}; -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.clusters = new ClustersImpl(this); + this.namespaces = new NamespacesImpl(this); + this.privateEndpointConnections = new PrivateEndpointConnectionsImpl(this); + this.privateLinkResources = new PrivateLinkResourcesImpl(this); + this.disasterRecoveryConfigs = new DisasterRecoveryConfigsImpl(this); + this.eventHubs = new EventHubsImpl(this); + this.consumerGroups = new ConsumerGroupsImpl(this); + this.operations = new OperationsImpl(this); + this.regions = new RegionsImpl(this); + } + + clusters: Clusters; + namespaces: Namespaces; + privateEndpointConnections: PrivateEndpointConnections; + privateLinkResources: PrivateLinkResources; + disasterRecoveryConfigs: DisasterRecoveryConfigs; + eventHubs: EventHubs; + consumerGroups: ConsumerGroups; + operations: Operations; + regions: Regions; +} diff --git a/sdk/eventhub/arm-eventhub-profile-2020-09-01-hybrid/src/eventHubManagementClientContext.ts b/sdk/eventhub/arm-eventhub-profile-2020-09-01-hybrid/src/eventHubManagementClientContext.ts deleted file mode 100644 index acf113afe826..000000000000 --- a/sdk/eventhub/arm-eventhub-profile-2020-09-01-hybrid/src/eventHubManagementClientContext.ts +++ /dev/null @@ -1,67 +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 { TokenCredential } from "@azure/core-auth"; -import * as msRestAzure from "@azure/ms-rest-azure-js"; - -const packageName = "@azure/arm-eventhub-profile-2020-09-01-hybrid"; -const packageVersion = "1.1.0"; - -export class EventHubManagementClientContext extends msRestAzure.AzureServiceClient { - credentials: msRest.ServiceClientCredentials | TokenCredential; - subscriptionId: string; - - /** - * Initializes a new instance of the EventHubManagementClient class. - * @param credentials Credentials needed for the client to connect to Azure. Credentials - * implementing the TokenCredential interface from the @azure/identity package are recommended. For - * more information about these credentials, see - * {@link https://www.npmjs.com/package/@azure/identity}. Credentials implementing the - * ServiceClientCredentials interface from the older packages @azure/ms-rest-nodeauth and - * @azure/ms-rest-browserauth are also supported. - * @param subscriptionId Subscription credentials that uniquely identify a Microsoft Azure - * subscription. The subscription ID forms part of the URI for every service call. - * @param [options] The parameter options - */ - constructor(credentials: msRest.ServiceClientCredentials | TokenCredential, subscriptionId: string, options?: Models.EventHubManagementClientOptions) { - 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.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/eventhub/arm-eventhub-profile-2020-09-01-hybrid/src/index.ts b/sdk/eventhub/arm-eventhub-profile-2020-09-01-hybrid/src/index.ts new file mode 100644 index 000000000000..32b41596414b --- /dev/null +++ b/sdk/eventhub/arm-eventhub-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 { EventHubManagementClient } from "./eventHubManagementClient"; +export * from "./operationsInterfaces"; diff --git a/sdk/eventhub/arm-eventhub-profile-2020-09-01-hybrid/src/lroImpl.ts b/sdk/eventhub/arm-eventhub-profile-2020-09-01-hybrid/src/lroImpl.ts new file mode 100644 index 000000000000..518d5f053b4e --- /dev/null +++ b/sdk/eventhub/arm-eventhub-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/eventhub/arm-eventhub-profile-2020-09-01-hybrid/src/models/clustersMappers.ts b/sdk/eventhub/arm-eventhub-profile-2020-09-01-hybrid/src/models/clustersMappers.ts deleted file mode 100644 index dc4b6eb0a60b..000000000000 --- a/sdk/eventhub/arm-eventhub-profile-2020-09-01-hybrid/src/models/clustersMappers.ts +++ /dev/null @@ -1,36 +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 { - AuthorizationRule, - AvailableCluster, - AvailableClustersList, - BaseResource, - CaptureDescription, - Cluster, - ClusterListResult, - ClusterSku, - ConnectionState, - ConsumerGroup, - Destination, - EHNamespace, - EHNamespaceIdContainer, - EHNamespaceIdListResult, - Encryption, - ErrorResponse, - Eventhub, - Identity, - KeyVaultProperties, - MessagingRegions, - MessagingRegionsProperties, - PrivateEndpoint, - PrivateEndpointConnection, - Resource, - Sku, - TrackedResource -} from "../models/mappers"; diff --git a/sdk/eventhub/arm-eventhub-profile-2020-09-01-hybrid/src/models/consumerGroupsMappers.ts b/sdk/eventhub/arm-eventhub-profile-2020-09-01-hybrid/src/models/consumerGroupsMappers.ts deleted file mode 100644 index 2b94b51adfe3..000000000000 --- a/sdk/eventhub/arm-eventhub-profile-2020-09-01-hybrid/src/models/consumerGroupsMappers.ts +++ /dev/null @@ -1,32 +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 { - AuthorizationRule, - BaseResource, - CaptureDescription, - Cluster, - ClusterSku, - ConnectionState, - ConsumerGroup, - ConsumerGroupListResult, - Destination, - EHNamespace, - Encryption, - ErrorResponse, - Eventhub, - Identity, - KeyVaultProperties, - MessagingRegions, - MessagingRegionsProperties, - PrivateEndpoint, - PrivateEndpointConnection, - Resource, - Sku, - TrackedResource -} from "../models/mappers"; diff --git a/sdk/eventhub/arm-eventhub-profile-2020-09-01-hybrid/src/models/disasterRecoveryConfigsMappers.ts b/sdk/eventhub/arm-eventhub-profile-2020-09-01-hybrid/src/models/disasterRecoveryConfigsMappers.ts deleted file mode 100644 index 78bec222b953..000000000000 --- a/sdk/eventhub/arm-eventhub-profile-2020-09-01-hybrid/src/models/disasterRecoveryConfigsMappers.ts +++ /dev/null @@ -1,33 +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 { - AccessKeys, - AuthorizationRule, - AuthorizationRuleListResult, - BaseResource, - CaptureDescription, - Cluster, - ClusterSku, - ConnectionState, - ConsumerGroup, - Destination, - EHNamespace, - Encryption, - ErrorResponse, - Eventhub, - Identity, - KeyVaultProperties, - MessagingRegions, - MessagingRegionsProperties, - PrivateEndpoint, - PrivateEndpointConnection, - Resource, - Sku, - TrackedResource -} from "../models/mappers"; diff --git a/sdk/eventhub/arm-eventhub-profile-2020-09-01-hybrid/src/models/eventHubsMappers.ts b/sdk/eventhub/arm-eventhub-profile-2020-09-01-hybrid/src/models/eventHubsMappers.ts deleted file mode 100644 index a1304dbf0a45..000000000000 --- a/sdk/eventhub/arm-eventhub-profile-2020-09-01-hybrid/src/models/eventHubsMappers.ts +++ /dev/null @@ -1,35 +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 { - AccessKeys, - AuthorizationRule, - AuthorizationRuleListResult, - BaseResource, - CaptureDescription, - Cluster, - ClusterSku, - ConnectionState, - ConsumerGroup, - Destination, - EHNamespace, - Encryption, - ErrorResponse, - Eventhub, - EventHubListResult, - Identity, - KeyVaultProperties, - MessagingRegions, - MessagingRegionsProperties, - PrivateEndpoint, - PrivateEndpointConnection, - RegenerateAccessKeyParameters, - Resource, - Sku, - TrackedResource -} from "../models/mappers"; diff --git a/sdk/eventhub/arm-eventhub-profile-2020-09-01-hybrid/src/models/index.ts b/sdk/eventhub/arm-eventhub-profile-2020-09-01-hybrid/src/models/index.ts index 39b2e4fd9eae..d59452775109 100644 --- a/sdk/eventhub/arm-eventhub-profile-2020-09-01-hybrid/src/models/index.ts +++ b/sdk/eventhub/arm-eventhub-profile-2020-09-01-hybrid/src/models/index.ts @@ -1,1896 +1,1058 @@ /* - * 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 response of the List Available Clusters operation. */ +export interface AvailableClustersList { + /** The count of readily available and pre-provisioned Event Hubs Clusters per region. */ + value?: AvailableCluster[]; +} -/** - * Pre-provisioned and readily available Event Hubs Cluster count per region. - */ +/** Pre-provisioned and readily available Event Hubs Cluster count per region. */ export interface AvailableCluster { - /** - * Location fo the Available Cluster - */ + /** Location fo the Available Cluster */ location?: string; } -/** - * The response of the List Available Clusters operation. - */ -export interface AvailableClustersList { - /** - * The count of readily available and pre-provisioned Event Hubs Clusters per region. - */ - value?: AvailableCluster[]; -} - -/** - * Error response indicates Event Hub service is not able to process the incoming request. The - * reason is provided in the error message. - */ +/** Error response indicates Event Hub service is not able to process the incoming request. The reason is provided in the error message. */ export interface ErrorResponse { - /** - * Error code. - */ + /** Error code. */ code?: string; - /** - * Error message indicating why the operation failed. - */ + /** Error message indicating why the operation failed. */ message?: string; } -/** - * SKU parameters particular to a cluster instance. - */ +/** The response of the List Event Hubs Clusters operation. */ +export interface ClusterListResult { + /** The Event Hubs Clusters present in the List Event Hubs operation results. */ + value?: Cluster[]; + /** Link to the next set of results. Empty unless the value parameter contains an incomplete list of Event Hubs Clusters. */ + nextLink?: string; +} + +/** SKU parameters particular to a cluster instance. */ export interface ClusterSku { - /** - * The quantity of Event Hubs Cluster Capacity Units contained in this cluster. - */ + /** Name of this SKU. */ + name: ClusterSkuName; + /** The quantity of Event Hubs Cluster Capacity Units contained in this cluster. */ capacity?: number; } -/** - * The resource definition. - */ -export interface Resource extends BaseResource { +/** Common fields that are returned in the response for all Azure Resource Manager resources */ +export interface Resource { /** - * Resource ID. - * **NOTE: This property will not be serialized. It can only be populated by the server.** + * Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} + * NOTE: This property will not be serialized. It can only be populated by the server. */ readonly id?: string; /** - * Resource name. - * **NOTE: This property will not be serialized. It can only be populated by the server.** + * The name of the resource + * NOTE: This property will not be serialized. It can only be populated by the server. */ readonly name?: string; /** - * Resource type. - * **NOTE: This property will not be serialized. It can only be populated by the server.** + * The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts" + * NOTE: This property will not be serialized. It can only be populated by the server. */ readonly type?: string; } -/** - * Definition of resource. - */ -export interface TrackedResource extends Resource { - /** - * Resource location. - */ - location?: string; - /** - * Resource tags. - */ - tags?: { [propertyName: string]: string }; -} - -/** - * Single Event Hubs Cluster resource in List or Get operations. - */ -export interface Cluster extends TrackedResource { - /** - * Properties of the cluster SKU. - */ - sku?: ClusterSku; - /** - * The UTC time when the Event Hubs Cluster was created. - * **NOTE: This property will not be serialized. It can only be populated by the server.** - */ - readonly createdAt?: string; - /** - * The UTC time when the Event Hubs Cluster was last updated. - * **NOTE: This property will not be serialized. It can only be populated by the server.** - */ - readonly updatedAt?: string; - /** - * The metric ID of the cluster resource. Provided by the service and not modifiable by the user. - * **NOTE: This property will not be serialized. It can only be populated by the server.** - */ - readonly metricId?: string; - /** - * Status of the Cluster resource - * **NOTE: This property will not be serialized. It can only be populated by the server.** - */ - readonly status?: string; +/** The response of the List Namespace IDs operation */ +export interface EHNamespaceIdListResult { + /** Result of the List Namespace IDs operation */ + value?: EHNamespaceIdContainer[]; } -/** - * The full ARM ID of an Event Hubs Namespace - */ +/** The full ARM ID of an Event Hubs Namespace */ export interface EHNamespaceIdContainer { - /** - * id parameter - */ + /** id parameter */ id?: string; } -/** - * The response of the List Namespace IDs operation - */ -export interface EHNamespaceIdListResult { - /** - * Result of the List Namespace IDs operation - */ - value?: EHNamespaceIdContainer[]; +/** The response of the List Namespace operation */ +export interface EHNamespaceListResult { + /** Result of the List Namespace operation */ + value?: EHNamespace[]; + /** Link to the next set of results. Not empty if Value contains incomplete list of namespaces. */ + nextLink?: string; } -/** - * SKU parameters supplied to the create namespace operation - */ +/** SKU parameters supplied to the create namespace operation */ export interface Sku { - /** - * Name of this SKU. Possible values include: 'Basic', 'Standard' - */ + /** Name of this SKU. */ name: SkuName; - /** - * The billing tier of this particular SKU. Possible values include: 'Basic', 'Standard' - */ + /** The billing tier of this particular SKU. */ tier?: SkuTier; - /** - * The Event Hubs throughput units, value should be 0 to 20 throughput units. - */ + /** The Event Hubs throughput units, value should be 0 to 20 throughput units. */ capacity?: number; } -/** - * Properties to configure Identity for Bring your Own Keys - */ +/** Properties to configure Identity for Bring your Own Keys */ export interface Identity { - /** - * ObjectId from the KeyVault - */ + /** ObjectId from the KeyVault */ principalId?: string; - /** - * TenantId from the KeyVault - */ + /** TenantId from the KeyVault */ tenantId?: string; - /** - * Enumerates the possible value Identity type, which currently supports only 'SystemAssigned'. - * Possible values include: 'SystemAssigned'. Default value: 'SystemAssigned'. - */ - type?: IdentityType; + /** Enumerates the possible value Identity type, which currently supports only 'SystemAssigned' */ + type?: "SystemAssigned"; } -/** - * Properties to configure keyVault Properties - */ +/** Properties to configure Encryption */ +export interface Encryption { + /** Properties of KeyVault */ + keyVaultProperties?: KeyVaultProperties[]; + /** Enumerates the possible value of keySource for Encryption */ + keySource?: "Microsoft.KeyVault"; +} + +/** Properties to configure keyVault Properties */ export interface KeyVaultProperties { - /** - * Name of the Key from KeyVault - */ + /** Name of the Key from KeyVault */ keyName?: string; - /** - * Uri of KeyVault - */ + /** Uri of KeyVault */ keyVaultUri?: string; - /** - * Key Version - */ + /** Key Version */ keyVersion?: string; } -/** - * Properties to configure Encryption - */ -export interface Encryption { - /** - * Properties of KeyVault - */ - keyVaultProperties?: KeyVaultProperties[]; - /** - * Enumerates the possible value of keySource for Encryption. Possible values include: - * 'Microsoft.KeyVault'. Default value: 'Microsoft.KeyVault'. - */ - keySource?: KeySource; -} - -/** - * Single Namespace item in List or Get Operation - */ -export interface EHNamespace extends TrackedResource { - /** - * Properties of sku resource - */ - sku?: Sku; - /** - * Properties of BYOK Identity description - */ - identity?: Identity; - /** - * Provisioning state of the Namespace. - * **NOTE: This property will not be serialized. It can only be populated by the server.** - */ - readonly provisioningState?: string; - /** - * The time the Namespace was created. - * **NOTE: This property will not be serialized. It can only be populated by the server.** - */ - readonly createdAt?: Date; - /** - * The time the Namespace was updated. - * **NOTE: This property will not be serialized. It can only be populated by the server.** - */ - readonly updatedAt?: Date; - /** - * Endpoint you can use to perform Service Bus operations. - * **NOTE: This property will not be serialized. It can only be populated by the server.** - */ - readonly serviceBusEndpoint?: string; - /** - * Cluster ARM ID of the Namespace. - */ - clusterArmId?: string; - /** - * Identifier for Azure Insights metrics. - * **NOTE: This property will not be serialized. It can only be populated by the server.** - */ - readonly metricId?: string; - /** - * Value that indicates whether AutoInflate is enabled for eventhub namespace. - */ - isAutoInflateEnabled?: boolean; - /** - * Upper limit of throughput units when AutoInflate is enabled, value should be within 0 to 20 - * throughput units. ( '0' if AutoInflateEnabled = true) - */ - maximumThroughputUnits?: number; - /** - * Value that indicates whether Kafka is enabled for eventhub namespace. - */ - kafkaEnabled?: boolean; - /** - * Enabling this property creates a Standard Event Hubs Namespace in regions supported - * availability zones. - */ - zoneRedundant?: boolean; - /** - * Properties of BYOK Encryption description - */ - encryption?: Encryption; +/** Result of the list of all private endpoint connections operation. */ +export interface PrivateEndpointConnectionListResult { + /** A collection of private endpoint connection resources. */ + value?: PrivateEndpointConnection[]; + /** A link for the next page of private endpoint connection resources. */ + nextLink?: string; } -/** - * PrivateEndpoint information. - */ +/** PrivateEndpoint information. */ export interface PrivateEndpoint { - /** - * The ARM identifier for Private Endpoint. - */ + /** The ARM identifier for Private Endpoint. */ id?: string; } -/** - * ConnectionState information. - */ +/** ConnectionState information. */ export interface ConnectionState { - /** - * Status of the connection. Possible values include: 'Pending', 'Approved', 'Rejected', - * 'Disconnected' - */ + /** Status of the connection. */ status?: PrivateLinkConnectionStatus; - /** - * Description of the connection state. - */ + /** Description of the connection state. */ description?: string; } -/** - * Properties of the PrivateEndpointConnection. - */ -export interface PrivateEndpointConnection extends Resource { - /** - * The Private Endpoint resource for this Connection. - */ - privateEndpoint?: PrivateEndpoint; - /** - * Details about the state of the connection. - */ - privateLinkServiceConnectionState?: ConnectionState; - /** - * Provisioning state of the Private Endpoint Connection. Possible values include: 'Creating', - * 'Updating', 'Deleting', 'Succeeded', 'Canceled', 'Failed' - */ - provisioningState?: EndPointProvisioningState; +/** Result of the List private link resources operation. */ +export interface PrivateLinkResourcesListResult { + /** A collection of private link resources */ + value?: PrivateLinkResource[]; + /** A link for the next page of private link resources. */ + nextLink?: string; } -/** - * Information of the private link resource. - */ +/** Information of the private link resource. */ export interface PrivateLinkResource { - /** - * The private link resource group id. - */ - groupId?: string; - /** - * The private link resource required member names. - */ - requiredMembers?: string[]; - /** - * The private link resource Private link DNS zone name. - */ - requiredZoneNames?: string[]; - /** - * Fully qualified identifier of the resource. - */ + /** Fully qualified identifier of the resource. */ id?: string; - /** - * Name of the resource - */ + /** Name of the resource */ name?: string; - /** - * Type of the resource - */ + /** Type of the resource */ type?: string; + /** The private link resource group id. */ + groupId?: string; + /** The private link resource required member names. */ + requiredMembers?: string[]; + /** The private link resource Private link DNS zone name. */ + requiredZoneNames?: string[]; } -/** - * Result of the List private link resources operation. - */ -export interface PrivateLinkResourcesListResult { - /** - * A collection of private link resources - */ - value?: PrivateLinkResource[]; - /** - * A link for the next page of private link resources. - */ +/** The response from the List namespace operation. */ +export interface AuthorizationRuleListResult { + /** Result of the List Authorization Rules operation. */ + value?: AuthorizationRule[]; + /** Link to the next set of results. Not empty if Value contains an incomplete list of Authorization Rules */ nextLink?: string; } -/** - * Single item in a List or Get AuthorizationRule operation - */ -export interface AuthorizationRule extends Resource { - /** - * The rights associated with the rule. - */ - rights: AccessRights[]; -} - -/** - * Namespace/EventHub Connection String - */ +/** Namespace/EventHub Connection String */ export interface AccessKeys { /** * Primary connection string of the created namespace AuthorizationRule. - * **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 primaryConnectionString?: string; /** * Secondary connection string of the created namespace AuthorizationRule. - * **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 secondaryConnectionString?: string; /** * Primary connection string of the alias if GEO DR is enabled - * **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 aliasPrimaryConnectionString?: string; /** * Secondary connection string of the alias if GEO DR is enabled - * **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 aliasSecondaryConnectionString?: string; /** * A base64-encoded 256-bit primary key for signing and validating the SAS token. - * **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 primaryKey?: string; /** * A base64-encoded 256-bit primary key for signing and validating the SAS token. - * **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 secondaryKey?: string; /** * A string that describes the AuthorizationRule. - * **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 keyName?: string; } -/** - * Parameters supplied to the Regenerate Authorization Rule operation, specifies which key needs to - * be reset. - */ +/** Parameters supplied to the Regenerate Authorization Rule operation, specifies which key needs to be reset. */ export interface RegenerateAccessKeyParameters { - /** - * The access key to regenerate. Possible values include: 'PrimaryKey', 'SecondaryKey' - */ + /** The access key to regenerate. */ keyType: KeyType; - /** - * Optional, if the key value provided, is set for KeyType or autogenerated Key value set for - * keyType - */ + /** Optional, if the key value provided, is set for KeyType or autogenerated Key value set for keyType */ key?: string; } -/** - * Parameter supplied to check Namespace name availability operation - */ +/** Parameter supplied to check Namespace name availability operation */ export interface CheckNameAvailabilityParameter { - /** - * Name to check the namespace name availability - */ + /** Name to check the namespace name availability */ name: string; } -/** - * The Result of the CheckNameAvailability operation - */ +/** The Result of the CheckNameAvailability operation */ export interface CheckNameAvailabilityResult { /** * The detailed info regarding the reason associated with the Namespace. - * **NOTE: This property will not be serialized. It can only be populated by the server.** + * NOTE: This property will not be serialized. It can only be populated by the server. */ readonly message?: string; - /** - * Value indicating Namespace is availability, true if the Namespace is available; otherwise, - * false. - */ + /** Value indicating Namespace is availability, true if the Namespace is available; otherwise, false. */ nameAvailable?: boolean; - /** - * The reason for unavailability of a Namespace. Possible values include: 'None', 'InvalidName', - * 'SubscriptionIsDisabled', 'NameInUse', 'NameInLockdown', - * 'TooManyNamespaceInCurrentSubscription' - */ + /** The reason for unavailability of a Namespace. */ reason?: UnavailableReason; } -/** - * Single item in List or Get Consumer group operation - */ -export interface ConsumerGroup extends Resource { +/** The result to the List Consumer Group operation. */ +export interface ConsumerGroupListResult { + /** Result of the List Consumer Group operation. */ + value?: ConsumerGroup[]; + /** Link to the next set of results. Not empty if Value contains incomplete list of Consumer Group */ + nextLink?: string; +} + +/** Result of the request to list Event Hub operations. It contains a list of operations and a URL link to get the next set of results. */ +export interface OperationListResult { /** - * Exact time the message was created. - * **NOTE: This property will not be serialized. It can only be populated by the server.** + * List of Event Hub operations supported by the Microsoft.EventHub resource provider. + * NOTE: This property will not be serialized. It can only be populated by the server. */ - readonly createdAt?: Date; + readonly value?: Operation[]; /** - * The exact time the message was updated. - * **NOTE: This property will not be serialized. It can only be populated by the server.** + * URL to get the next set of operation list results if there are any. + * NOTE: This property will not be serialized. It can only be populated by the server. */ - readonly updatedAt?: Date; + readonly nextLink?: string; +} + +/** A Event Hub REST API operation */ +export interface Operation { /** - * User Metadata is a placeholder to store user-defined string data with maximum length 1024. - * e.g. it can be used to store descriptive data, such as list of teams and their contact - * information also user-defined configuration settings can be stored. + * Operation name: {provider}/{resource}/{operation} + * NOTE: This property will not be serialized. It can only be populated by the server. */ - userMetadata?: string; + readonly name?: string; + /** The object that represents the operation. */ + display?: OperationDisplay; } -/** - * The object that represents the operation. - */ +/** The object that represents the operation. */ export interface OperationDisplay { /** * Service provider: Microsoft.EventHub - * **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 provider?: string; /** * Resource on which the operation is performed: Invoice, etc. - * **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 resource?: string; /** * Operation type: Read, write, delete, etc. - * **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 operation?: string; } -/** - * A Event Hub REST API operation - */ -export interface Operation { - /** - * Operation name: {provider}/{resource}/{operation} - * **NOTE: This property will not be serialized. It can only be populated by the server.** - */ - readonly name?: string; - /** - * The object that represents the operation. - */ - display?: OperationDisplay; +/** The result of the List EventHubs operation. */ +export interface EventHubListResult { + /** Result of the List EventHubs operation. */ + value?: Eventhub[]; + /** Link to the next set of results. Not empty if Value contains incomplete list of EventHubs. */ + nextLink?: string; } -/** - * Capture storage details for capture description - */ +/** Properties to configure capture description for eventhub */ +export interface CaptureDescription { + /** A value that indicates whether capture description is enabled. */ + enabled?: boolean; + /** Enumerates the possible values for the encoding format of capture description. Note: 'AvroDeflate' will be deprecated in New API Version */ + encoding?: EncodingCaptureDescription; + /** The time window allows you to set the frequency with which the capture to Azure Blobs will happen, value should between 60 to 900 seconds */ + intervalInSeconds?: number; + /** The size window defines the amount of data built up in your Event Hub before an capture operation, value should be between 10485760 to 524288000 bytes */ + sizeLimitInBytes?: number; + /** Properties of Destination where capture will be stored. (Storage Account, Blob Names) */ + destination?: Destination; + /** A value that indicates whether to Skip Empty Archives */ + skipEmptyArchives?: boolean; +} + +/** Capture storage details for capture description */ export interface Destination { - /** - * Name for capture destination - */ + /** Name for capture destination */ name?: string; - /** - * Resource id of the storage account to be used to create the blobs - */ + /** Resource id of the storage account to be used to create the blobs */ storageAccountResourceId?: string; - /** - * Blob container Name - */ + /** Blob container Name */ blobContainer?: string; - /** - * Blob naming convention for archive, e.g. - * {Namespace}/{EventHub}/{PartitionId}/{Year}/{Month}/{Day}/{Hour}/{Minute}/{Second}. Here all - * the parameters (Namespace,EventHub .. etc) are mandatory irrespective of order - */ + /** Blob naming convention for archive, e.g. {Namespace}/{EventHub}/{PartitionId}/{Year}/{Month}/{Day}/{Hour}/{Minute}/{Second}. Here all the parameters (Namespace,EventHub .. etc) are mandatory irrespective of order */ archiveNameFormat?: string; } -/** - * Properties to configure capture description for eventhub - */ -export interface CaptureDescription { +/** The response of the List MessagingRegions operation. */ +export interface MessagingRegionsListResult { + /** Result of the List MessagingRegions type. */ + value?: MessagingRegions[]; /** - * A value that indicates whether capture description is enabled. + * Link to the next set of results. Not empty if Value contains incomplete list of MessagingRegions. + * NOTE: This property will not be serialized. It can only be populated by the server. */ - enabled?: boolean; - /** - * Enumerates the possible values for the encoding format of capture description. Note: - * 'AvroDeflate' will be deprecated in New API Version. Possible values include: 'Avro', - * 'AvroDeflate' - */ - encoding?: EncodingCaptureDescription; + readonly nextLink?: string; +} + +/** Properties of Messaging Region */ +export interface MessagingRegionsProperties { /** - * The time window allows you to set the frequency with which the capture to Azure Blobs will - * happen, value should between 60 to 900 seconds + * Region code + * NOTE: This property will not be serialized. It can only be populated by the server. */ - intervalInSeconds?: number; + readonly code?: string; /** - * The size window defines the amount of data built up in your Event Hub before an capture - * operation, value should be between 10485760 to 524288000 bytes + * Full name of the region + * NOTE: This property will not be serialized. It can only be populated by the server. */ - sizeLimitInBytes?: number; + readonly fullName?: string; +} + +/** Definition of resource. */ +export type TrackedResource = Resource & { + /** Resource location. */ + location?: string; + /** Resource tags. */ + tags?: { [propertyName: string]: string }; +}; + +/** Properties of the PrivateEndpointConnection. */ +export type PrivateEndpointConnection = Resource & { + /** The Private Endpoint resource for this Connection. */ + privateEndpoint?: PrivateEndpoint; + /** Details about the state of the connection. */ + privateLinkServiceConnectionState?: ConnectionState; + /** Provisioning state of the Private Endpoint Connection. */ + provisioningState?: EndPointProvisioningState; +}; + +/** Single item in a List or Get AuthorizationRule operation */ +export type AuthorizationRule = Resource & { + /** The rights associated with the rule. */ + rights?: AccessRights[]; +}; + +/** Single item in List or Get Consumer group operation */ +export type ConsumerGroup = Resource & { /** - * Properties of Destination where capture will be stored. (Storage Account, Blob Names) + * Exact time the message was created. + * NOTE: This property will not be serialized. It can only be populated by the server. */ - destination?: Destination; + readonly createdAt?: Date; /** - * A value that indicates whether to Skip Empty Archives + * The exact time the message was updated. + * NOTE: This property will not be serialized. It can only be populated by the server. */ - skipEmptyArchives?: boolean; -} + readonly updatedAt?: Date; + /** User Metadata is a placeholder to store user-defined string data with maximum length 1024. e.g. it can be used to store descriptive data, such as list of teams and their contact information also user-defined configuration settings can be stored. */ + userMetadata?: string; +}; -/** - * Single item in List or Get Event Hub operation - */ -export interface Eventhub extends Resource { +/** Single item in List or Get Event Hub operation */ +export type Eventhub = Resource & { /** * Current number of shards on the Event Hub. - * **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[]; /** * Exact time the Event Hub was created. - * **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 createdAt?: Date; /** * The exact time the message was updated. - * **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 updatedAt?: Date; - /** - * Number of days to retain the events for this Event Hub, value should be 1 to 7 days - */ + /** Number of days to retain the events for this Event Hub, value should be 1 to 7 days */ messageRetentionInDays?: number; - /** - * Number of partitions created for the Event Hub, allowed values are from 1 to 32 partitions. - */ + /** Number of partitions created for the Event Hub, allowed values are from 1 to 32 partitions. */ partitionCount?: number; + /** Enumerates the possible values for the status of the Event Hub. */ + status?: EntityStatus; + /** Properties of capture description */ + captureDescription?: CaptureDescription; +}; + +/** Single Event Hubs Cluster resource in List or Get operations. */ +export type Cluster = TrackedResource & { + /** Properties of the cluster SKU. */ + sku?: ClusterSku; /** - * Enumerates the possible values for the status of the Event Hub. Possible values include: - * 'Active', 'Disabled', 'Restoring', 'SendDisabled', 'ReceiveDisabled', 'Creating', 'Deleting', - * 'Renaming', 'Unknown' + * The UTC time when the Event Hubs Cluster was created. + * NOTE: This property will not be serialized. It can only be populated by the server. */ - status?: EntityStatus; + readonly createdAt?: string; /** - * Properties of capture description + * The UTC time when the Event Hubs Cluster was last updated. + * NOTE: This property will not be serialized. It can only be populated by the server. */ - captureDescription?: CaptureDescription; -} - -/** - * Properties of Messaging Region - */ -export interface MessagingRegionsProperties { + readonly updatedAt?: string; /** - * Region code - * **NOTE: This property will not be serialized. It can only be populated by the server.** + * The metric ID of the cluster resource. Provided by the service and not modifiable by the user. + * NOTE: This property will not be serialized. It can only be populated by the server. */ - readonly code?: string; + readonly metricId?: string; /** - * Full name of the region - * **NOTE: This property will not be serialized. It can only be populated by the server.** + * Status of the Cluster resource + * NOTE: This property will not be serialized. It can only be populated by the server. */ - readonly fullName?: string; -} + readonly status?: string; +}; -/** - * Messaging Region - */ -export interface MessagingRegions extends TrackedResource { +/** Single Namespace item in List or Get Operation */ +export type EHNamespace = TrackedResource & { + /** Properties of sku resource */ + sku?: Sku; + /** Properties of BYOK Identity description */ + identity?: Identity; /** - * Properties of Messaging Region + * Provisioning state of the Namespace. + * NOTE: This property will not be serialized. It can only be populated by the server. */ - properties?: MessagingRegionsProperties; -} - -/** - * Optional Parameters. - */ -export interface EventHubsListByNamespaceOptionalParams extends msRest.RequestOptionsBase { + readonly provisioningState?: string; /** - * Skip is only used if a previous operation returned a partial result. If a previous response - * contains a nextLink element, the value of the nextLink element will include a skip parameter - * that specifies a starting point to use for subsequent calls. + * Status of the Namespace. + * NOTE: This property will not be serialized. It can only be populated by the server. */ - skip?: number; + readonly status?: string; /** - * May be used to limit the number of results to the most recent N usageDetails. + * The time the Namespace was created. + * NOTE: This property will not be serialized. It can only be populated by the server. */ - top?: number; -} - -/** - * Optional Parameters. - */ -export interface ConsumerGroupsListByEventHubOptionalParams extends msRest.RequestOptionsBase { + readonly createdAt?: Date; /** - * Skip is only used if a previous operation returned a partial result. If a previous response - * contains a nextLink element, the value of the nextLink element will include a skip parameter - * that specifies a starting point to use for subsequent calls. + * The time the Namespace was updated. + * NOTE: This property will not be serialized. It can only be populated by the server. */ - skip?: number; + readonly updatedAt?: Date; /** - * May be used to limit the number of results to the most recent N usageDetails. + * Endpoint you can use to perform Service Bus operations. + * NOTE: This property will not be serialized. It can only be populated by the server. */ - top?: number; + readonly serviceBusEndpoint?: string; + /** Cluster ARM ID of the Namespace. */ + clusterArmId?: string; + /** + * Identifier for Azure Insights metrics. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly metricId?: string; + /** Value that indicates whether AutoInflate is enabled for eventhub namespace. */ + isAutoInflateEnabled?: boolean; + /** Upper limit of throughput units when AutoInflate is enabled, value should be within 0 to 20 throughput units. ( '0' if AutoInflateEnabled = true) */ + maximumThroughputUnits?: number; + /** Value that indicates whether Kafka is enabled for eventhub namespace. */ + kafkaEnabled?: boolean; + /** Enabling this property creates a Standard Event Hubs Namespace in regions supported availability zones. */ + zoneRedundant?: boolean; + /** Properties of BYOK Encryption description */ + encryption?: Encryption; +}; + +/** Messaging Region */ +export type MessagingRegions = TrackedResource & { + /** Properties of Messaging Region */ + properties?: MessagingRegionsProperties; +}; + +/** Known values of {@link ClusterSkuName} that the service accepts. */ +export enum KnownClusterSkuName { + Dedicated = "Dedicated" } /** - * An interface representing EventHubManagementClientOptions. + * Defines values for ClusterSkuName. \ + * {@link KnownClusterSkuName} can be used interchangeably with ClusterSkuName, + * this enum contains the known values that the service supports. + * ### Known values supported by the service + * **Dedicated** */ -export interface EventHubManagementClientOptions extends AzureServiceClientOptions { - baseUri?: string; +export type ClusterSkuName = string; + +/** Known values of {@link SkuName} that the service accepts. */ +export enum KnownSkuName { + Basic = "Basic", + Standard = "Standard" } /** - * @interface - * The response of the List Event Hubs Clusters operation. - * @extends Array + * Defines values for SkuName. \ + * {@link KnownSkuName} can be used interchangeably with SkuName, + * this enum contains the known values that the service supports. + * ### Known values supported by the service + * **Basic** \ + * **Standard** */ -export interface ClusterListResult extends Array { - /** - * Link to the next set of results. Empty unless the value parameter contains an incomplete list - * of Event Hubs Clusters. - */ - nextLink?: string; +export type SkuName = string; + +/** Known values of {@link SkuTier} that the service accepts. */ +export enum KnownSkuTier { + Basic = "Basic", + Standard = "Standard" } /** - * @interface - * The response of the List Namespace operation - * @extends Array + * Defines values for SkuTier. \ + * {@link KnownSkuTier} can be used interchangeably with SkuTier, + * this enum contains the known values that the service supports. + * ### Known values supported by the service + * **Basic** \ + * **Standard** */ -export interface EHNamespaceListResult extends Array { - /** - * Link to the next set of results. Not empty if Value contains incomplete list of namespaces. - */ - nextLink?: string; +export type SkuTier = string; + +/** Known values of {@link PrivateLinkConnectionStatus} that the service accepts. */ +export enum KnownPrivateLinkConnectionStatus { + Pending = "Pending", + Approved = "Approved", + Rejected = "Rejected", + Disconnected = "Disconnected" } /** - * @interface - * The response from the List namespace operation. - * @extends Array - */ -export interface AuthorizationRuleListResult extends Array { - /** - * Link to the next set of results. Not empty if Value contains an incomplete list of - * Authorization Rules - */ - nextLink?: string; + * Defines values for PrivateLinkConnectionStatus. \ + * {@link KnownPrivateLinkConnectionStatus} can be used interchangeably with PrivateLinkConnectionStatus, + * this enum contains the known values that the service supports. + * ### Known values supported by the service + * **Pending** \ + * **Approved** \ + * **Rejected** \ + * **Disconnected** + */ +export type PrivateLinkConnectionStatus = string; + +/** Known values of {@link EndPointProvisioningState} that the service accepts. */ +export enum KnownEndPointProvisioningState { + Creating = "Creating", + Updating = "Updating", + Deleting = "Deleting", + Succeeded = "Succeeded", + Canceled = "Canceled", + Failed = "Failed" } /** - * @interface - * Result of the list of all private endpoint connections operation. - * @extends Array - */ -export interface PrivateEndpointConnectionListResult extends Array { - /** - * A link for the next page of private endpoint connection resources. - */ - nextLink?: string; + * Defines values for EndPointProvisioningState. \ + * {@link KnownEndPointProvisioningState} can be used interchangeably with EndPointProvisioningState, + * this enum contains the known values that the service supports. + * ### Known values supported by the service + * **Creating** \ + * **Updating** \ + * **Deleting** \ + * **Succeeded** \ + * **Canceled** \ + * **Failed** + */ +export type EndPointProvisioningState = string; + +/** Known values of {@link AccessRights} that the service accepts. */ +export enum KnownAccessRights { + Manage = "Manage", + Send = "Send", + Listen = "Listen" } /** - * @interface - * The result of the List EventHubs operation. - * @extends Array - */ -export interface EventHubListResult extends Array { - /** - * Link to the next set of results. Not empty if Value contains incomplete list of EventHubs. - */ - nextLink?: string; + * Defines values for AccessRights. \ + * {@link KnownAccessRights} can be used interchangeably with AccessRights, + * this enum contains the known values that the service supports. + * ### Known values supported by the service + * **Manage** \ + * **Send** \ + * **Listen** + */ +export type AccessRights = string; +/** Defines values for KeyType. */ +export type KeyType = "PrimaryKey" | "SecondaryKey"; +/** Defines values for UnavailableReason. */ +export type UnavailableReason = + | "None" + | "InvalidName" + | "SubscriptionIsDisabled" + | "NameInUse" + | "NameInLockdown" + | "TooManyNamespaceInCurrentSubscription"; +/** Defines values for EntityStatus. */ +export type EntityStatus = + | "Active" + | "Disabled" + | "Restoring" + | "SendDisabled" + | "ReceiveDisabled" + | "Creating" + | "Deleting" + | "Renaming" + | "Unknown"; +/** Defines values for EncodingCaptureDescription. */ +export type EncodingCaptureDescription = "Avro" | "AvroDeflate"; + +/** Optional parameters. */ +export interface ClustersListAvailableClusterRegionOptionalParams + extends coreClient.OperationOptions {} + +/** Contains response data for the listAvailableClusterRegion operation. */ +export type ClustersListAvailableClusterRegionResponse = AvailableClustersList; + +/** Optional parameters. */ +export interface ClustersListByResourceGroupOptionalParams + extends coreClient.OperationOptions {} + +/** Contains response data for the listByResourceGroup operation. */ +export type ClustersListByResourceGroupResponse = ClusterListResult; + +/** Optional parameters. */ +export interface ClustersGetOptionalParams + extends coreClient.OperationOptions {} + +/** Contains response data for the get operation. */ +export type ClustersGetResponse = Cluster; + +/** Optional parameters. */ +export interface ClustersCreateOrUpdateOptionalParams + extends coreClient.OperationOptions { + /** Delay to wait until next poll, in milliseconds. */ + updateIntervalInMs?: number; + /** A serialized poller which can be used to resume an existing paused Long-Running-Operation. */ + resumeFrom?: string; } -/** - * @interface - * The result to the List Consumer Group operation. - * @extends Array - */ -export interface ConsumerGroupListResult extends Array { - /** - * Link to the next set of results. Not empty if Value contains incomplete list of Consumer Group - */ - nextLink?: string; +/** Contains response data for the createOrUpdate operation. */ +export type ClustersCreateOrUpdateResponse = Cluster; + +/** Optional parameters. */ +export interface ClustersUpdateOptionalParams + extends coreClient.OperationOptions { + /** Delay to wait until next poll, in milliseconds. */ + updateIntervalInMs?: number; + /** A serialized poller which can be used to resume an existing paused Long-Running-Operation. */ + resumeFrom?: string; } -/** - * @interface - * Result of the request to list Event Hub operations. It contains a list of operations and a URL - * link to get the next set of results. - * @extends Array - */ -export interface OperationListResult extends Array { - /** - * URL to get the next set of operation list results if there are any. - * **NOTE: This property will not be serialized. It can only be populated by the server.** - */ - readonly nextLink?: string; +/** Contains response data for the update operation. */ +export type ClustersUpdateResponse = Cluster; + +/** Optional parameters. */ +export interface ClustersDeleteOptionalParams + extends coreClient.OperationOptions { + /** Delay to wait until next poll, in milliseconds. */ + updateIntervalInMs?: number; + /** A serialized poller which can be used to resume an existing paused Long-Running-Operation. */ + resumeFrom?: string; } -/** - * @interface - * The response of the List MessagingRegions operation. - * @extends Array - */ -export interface MessagingRegionsListResult extends Array { - /** - * Link to the next set of results. Not empty if Value contains incomplete list of - * MessagingRegions. - * **NOTE: This property will not be serialized. It can only be populated by the server.** - */ - readonly nextLink?: string; +/** Optional parameters. */ +export interface ClustersListNamespacesOptionalParams + extends coreClient.OperationOptions {} + +/** Contains response data for the listNamespaces operation. */ +export type ClustersListNamespacesResponse = EHNamespaceIdListResult; + +/** Optional parameters. */ +export interface ClustersListByResourceGroupNextOptionalParams + extends coreClient.OperationOptions {} + +/** Contains response data for the listByResourceGroupNext operation. */ +export type ClustersListByResourceGroupNextResponse = ClusterListResult; + +/** Optional parameters. */ +export interface NamespacesListOptionalParams + extends coreClient.OperationOptions {} + +/** Contains response data for the list operation. */ +export type NamespacesListResponse = EHNamespaceListResult; + +/** Optional parameters. */ +export interface NamespacesListByResourceGroupOptionalParams + extends coreClient.OperationOptions {} + +/** Contains response data for the listByResourceGroup operation. */ +export type NamespacesListByResourceGroupResponse = EHNamespaceListResult; + +/** Optional parameters. */ +export interface NamespacesCreateOrUpdateOptionalParams + extends coreClient.OperationOptions { + /** Delay to wait until next poll, in milliseconds. */ + updateIntervalInMs?: number; + /** A serialized poller which can be used to resume an existing paused Long-Running-Operation. */ + resumeFrom?: string; } -/** - * Defines values for SkuName. - * Possible values include: 'Basic', 'Standard' - * @readonly - * @enum {string} - */ -export type SkuName = 'Basic' | 'Standard'; +/** Contains response data for the createOrUpdate operation. */ +export type NamespacesCreateOrUpdateResponse = EHNamespace; -/** - * Defines values for SkuTier. - * Possible values include: 'Basic', 'Standard' - * @readonly - * @enum {string} - */ -export type SkuTier = 'Basic' | 'Standard'; +/** Optional parameters. */ +export interface NamespacesDeleteOptionalParams + extends coreClient.OperationOptions { + /** Delay to wait until next poll, in milliseconds. */ + updateIntervalInMs?: number; + /** A serialized poller which can be used to resume an existing paused Long-Running-Operation. */ + resumeFrom?: string; +} -/** - * Defines values for IdentityType. - * Possible values include: 'SystemAssigned' - * @readonly - * @enum {string} - */ -export type IdentityType = 'SystemAssigned'; +/** Optional parameters. */ +export interface NamespacesGetOptionalParams + extends coreClient.OperationOptions {} -/** - * Defines values for KeySource. - * Possible values include: 'Microsoft.KeyVault' - * @readonly - * @enum {string} - */ -export type KeySource = 'Microsoft.KeyVault'; +/** Contains response data for the get operation. */ +export type NamespacesGetResponse = EHNamespace; -/** - * Defines values for PrivateLinkConnectionStatus. - * Possible values include: 'Pending', 'Approved', 'Rejected', 'Disconnected' - * @readonly - * @enum {string} - */ -export type PrivateLinkConnectionStatus = 'Pending' | 'Approved' | 'Rejected' | 'Disconnected'; +/** Optional parameters. */ +export interface NamespacesUpdateOptionalParams + extends coreClient.OperationOptions {} -/** - * Defines values for EndPointProvisioningState. - * Possible values include: 'Creating', 'Updating', 'Deleting', 'Succeeded', 'Canceled', 'Failed' - * @readonly - * @enum {string} - */ -export type EndPointProvisioningState = 'Creating' | 'Updating' | 'Deleting' | 'Succeeded' | 'Canceled' | 'Failed'; +/** Contains response data for the update operation. */ +export type NamespacesUpdateResponse = EHNamespace; -/** - * Defines values for AccessRights. - * Possible values include: 'Manage', 'Send', 'Listen' - * @readonly - * @enum {string} - */ -export type AccessRights = 'Manage' | 'Send' | 'Listen'; +/** Optional parameters. */ +export interface NamespacesListAuthorizationRulesOptionalParams + extends coreClient.OperationOptions {} -/** - * Defines values for KeyType. - * Possible values include: 'PrimaryKey', 'SecondaryKey' - * @readonly - * @enum {string} - */ -export type KeyType = 'PrimaryKey' | 'SecondaryKey'; +/** Contains response data for the listAuthorizationRules operation. */ +export type NamespacesListAuthorizationRulesResponse = AuthorizationRuleListResult; -/** - * Defines values for UnavailableReason. - * Possible values include: 'None', 'InvalidName', 'SubscriptionIsDisabled', 'NameInUse', - * 'NameInLockdown', 'TooManyNamespaceInCurrentSubscription' - * @readonly - * @enum {string} - */ -export type UnavailableReason = 'None' | 'InvalidName' | 'SubscriptionIsDisabled' | 'NameInUse' | 'NameInLockdown' | 'TooManyNamespaceInCurrentSubscription'; +/** Optional parameters. */ +export interface NamespacesCreateOrUpdateAuthorizationRuleOptionalParams + extends coreClient.OperationOptions {} -/** - * Defines values for EncodingCaptureDescription. - * Possible values include: 'Avro', 'AvroDeflate' - * @readonly - * @enum {string} - */ -export type EncodingCaptureDescription = 'Avro' | 'AvroDeflate'; +/** Contains response data for the createOrUpdateAuthorizationRule operation. */ +export type NamespacesCreateOrUpdateAuthorizationRuleResponse = AuthorizationRule; -/** - * Defines values for EntityStatus. - * Possible values include: 'Active', 'Disabled', 'Restoring', 'SendDisabled', 'ReceiveDisabled', - * 'Creating', 'Deleting', 'Renaming', 'Unknown' - * @readonly - * @enum {string} - */ -export type EntityStatus = 'Active' | 'Disabled' | 'Restoring' | 'SendDisabled' | 'ReceiveDisabled' | 'Creating' | 'Deleting' | 'Renaming' | 'Unknown'; +/** Optional parameters. */ +export interface NamespacesDeleteAuthorizationRuleOptionalParams + extends coreClient.OperationOptions {} -/** - * Contains response data for the listAvailableClusterRegion operation. - */ -export type ClustersListAvailableClusterRegionResponse = AvailableClustersList & { - /** - * The underlying HTTP response. - */ - _response: msRest.HttpResponse & { - /** - * The response body as text (string format) - */ - bodyAsText: string; - - /** - * The response body as parsed JSON or XML - */ - parsedBody: AvailableClustersList; - }; -}; +/** Optional parameters. */ +export interface NamespacesGetAuthorizationRuleOptionalParams + extends coreClient.OperationOptions {} -/** - * Contains response data for the listByResourceGroup operation. - */ -export type ClustersListByResourceGroupResponse = ClusterListResult & { - /** - * The underlying HTTP response. - */ - _response: msRest.HttpResponse & { - /** - * The response body as text (string format) - */ - bodyAsText: string; - - /** - * The response body as parsed JSON or XML - */ - parsedBody: ClusterListResult; - }; -}; +/** Contains response data for the getAuthorizationRule operation. */ +export type NamespacesGetAuthorizationRuleResponse = AuthorizationRule; -/** - * Contains response data for the get operation. - */ -export type ClustersGetResponse = Cluster & { - /** - * The underlying HTTP response. - */ - _response: msRest.HttpResponse & { - /** - * The response body as text (string format) - */ - bodyAsText: string; - - /** - * The response body as parsed JSON or XML - */ - parsedBody: Cluster; - }; -}; +/** Optional parameters. */ +export interface NamespacesListKeysOptionalParams + extends coreClient.OperationOptions {} -/** - * Contains response data for the createOrUpdate operation. - */ -export type ClustersCreateOrUpdateResponse = Cluster & { - /** - * The underlying HTTP response. - */ - _response: msRest.HttpResponse & { - /** - * The response body as text (string format) - */ - bodyAsText: string; - - /** - * The response body as parsed JSON or XML - */ - parsedBody: Cluster; - }; -}; +/** Contains response data for the listKeys operation. */ +export type NamespacesListKeysResponse = AccessKeys; -/** - * Contains response data for the update operation. - */ -export type ClustersUpdateResponse = Cluster & { - /** - * The underlying HTTP response. - */ - _response: msRest.HttpResponse & { - /** - * The response body as text (string format) - */ - bodyAsText: string; - - /** - * The response body as parsed JSON or XML - */ - parsedBody: Cluster; - }; -}; +/** Optional parameters. */ +export interface NamespacesRegenerateKeysOptionalParams + extends coreClient.OperationOptions {} -/** - * Contains response data for the listNamespaces operation. - */ -export type ClustersListNamespacesResponse = EHNamespaceIdListResult & { - /** - * The underlying HTTP response. - */ - _response: msRest.HttpResponse & { - /** - * The response body as text (string format) - */ - bodyAsText: string; - - /** - * The response body as parsed JSON or XML - */ - parsedBody: EHNamespaceIdListResult; - }; -}; +/** Contains response data for the regenerateKeys operation. */ +export type NamespacesRegenerateKeysResponse = AccessKeys; -/** - * Contains response data for the beginCreateOrUpdate operation. - */ -export type ClustersBeginCreateOrUpdateResponse = Cluster & { - /** - * The underlying HTTP response. - */ - _response: msRest.HttpResponse & { - /** - * The response body as text (string format) - */ - bodyAsText: string; - - /** - * The response body as parsed JSON or XML - */ - parsedBody: Cluster; - }; -}; +/** Optional parameters. */ +export interface NamespacesCheckNameAvailabilityOptionalParams + extends coreClient.OperationOptions {} -/** - * Contains response data for the beginUpdate operation. - */ -export type ClustersBeginUpdateResponse = Cluster & { - /** - * The underlying HTTP response. - */ - _response: msRest.HttpResponse & { - /** - * The response body as text (string format) - */ - bodyAsText: string; - - /** - * The response body as parsed JSON or XML - */ - parsedBody: Cluster; - }; -}; +/** Contains response data for the checkNameAvailability operation. */ +export type NamespacesCheckNameAvailabilityResponse = CheckNameAvailabilityResult; -/** - * Contains response data for the listByResourceGroupNext operation. - */ -export type ClustersListByResourceGroupNextResponse = ClusterListResult & { - /** - * The underlying HTTP response. - */ - _response: msRest.HttpResponse & { - /** - * The response body as text (string format) - */ - bodyAsText: string; - - /** - * The response body as parsed JSON or XML - */ - parsedBody: ClusterListResult; - }; -}; +/** Optional parameters. */ +export interface NamespacesListNextOptionalParams + extends coreClient.OperationOptions {} -/** - * Contains response data for the list operation. - */ -export type NamespacesListResponse = EHNamespaceListResult & { - /** - * The underlying HTTP response. - */ - _response: msRest.HttpResponse & { - /** - * The response body as text (string format) - */ - bodyAsText: string; - - /** - * The response body as parsed JSON or XML - */ - parsedBody: EHNamespaceListResult; - }; -}; +/** Contains response data for the listNext operation. */ +export type NamespacesListNextResponse = EHNamespaceListResult; -/** - * Contains response data for the listByResourceGroup operation. - */ -export type NamespacesListByResourceGroupResponse = EHNamespaceListResult & { - /** - * The underlying HTTP response. - */ - _response: msRest.HttpResponse & { - /** - * The response body as text (string format) - */ - bodyAsText: string; - - /** - * The response body as parsed JSON or XML - */ - parsedBody: EHNamespaceListResult; - }; -}; +/** Optional parameters. */ +export interface NamespacesListByResourceGroupNextOptionalParams + extends coreClient.OperationOptions {} -/** - * Contains response data for the createOrUpdate operation. - */ -export type NamespacesCreateOrUpdateResponse = EHNamespace & { - /** - * The underlying HTTP response. - */ - _response: msRest.HttpResponse & { - /** - * The response body as text (string format) - */ - bodyAsText: string; - - /** - * The response body as parsed JSON or XML - */ - parsedBody: EHNamespace; - }; -}; +/** Contains response data for the listByResourceGroupNext operation. */ +export type NamespacesListByResourceGroupNextResponse = EHNamespaceListResult; -/** - * Contains response data for the get operation. - */ -export type NamespacesGetResponse = EHNamespace & { - /** - * The underlying HTTP response. - */ - _response: msRest.HttpResponse & { - /** - * The response body as text (string format) - */ - bodyAsText: string; - - /** - * The response body as parsed JSON or XML - */ - parsedBody: EHNamespace; - }; -}; +/** Optional parameters. */ +export interface NamespacesListAuthorizationRulesNextOptionalParams + extends coreClient.OperationOptions {} -/** - * Contains response data for the update operation. - */ -export type NamespacesUpdateResponse = EHNamespace & { - /** - * The underlying HTTP response. - */ - _response: msRest.HttpResponse & { - /** - * The response body as text (string format) - */ - bodyAsText: string; - - /** - * The response body as parsed JSON or XML - */ - parsedBody: EHNamespace; - }; -}; +/** Contains response data for the listAuthorizationRulesNext operation. */ +export type NamespacesListAuthorizationRulesNextResponse = AuthorizationRuleListResult; -/** - * Contains response data for the listAuthorizationRules operation. - */ -export type NamespacesListAuthorizationRulesResponse = AuthorizationRuleListResult & { - /** - * The underlying HTTP response. - */ - _response: msRest.HttpResponse & { - /** - * The response body as text (string format) - */ - bodyAsText: string; - - /** - * The response body as parsed JSON or XML - */ - parsedBody: AuthorizationRuleListResult; - }; -}; +/** Optional parameters. */ +export interface PrivateEndpointConnectionsListOptionalParams + extends coreClient.OperationOptions {} -/** - * Contains response data for the createOrUpdateAuthorizationRule operation. - */ -export type NamespacesCreateOrUpdateAuthorizationRuleResponse = AuthorizationRule & { - /** - * The underlying HTTP response. - */ - _response: msRest.HttpResponse & { - /** - * The response body as text (string format) - */ - bodyAsText: string; - - /** - * The response body as parsed JSON or XML - */ - parsedBody: AuthorizationRule; - }; -}; +/** Contains response data for the list operation. */ +export type PrivateEndpointConnectionsListResponse = PrivateEndpointConnectionListResult; -/** - * Contains response data for the getAuthorizationRule operation. - */ -export type NamespacesGetAuthorizationRuleResponse = AuthorizationRule & { - /** - * The underlying HTTP response. - */ - _response: msRest.HttpResponse & { - /** - * The response body as text (string format) - */ - bodyAsText: string; - - /** - * The response body as parsed JSON or XML - */ - parsedBody: AuthorizationRule; - }; -}; +/** Optional parameters. */ +export interface PrivateEndpointConnectionsCreateOrUpdateOptionalParams + extends coreClient.OperationOptions {} -/** - * Contains response data for the listKeys operation. - */ -export type NamespacesListKeysResponse = AccessKeys & { - /** - * The underlying HTTP response. - */ - _response: msRest.HttpResponse & { - /** - * The response body as text (string format) - */ - bodyAsText: string; - - /** - * The response body as parsed JSON or XML - */ - parsedBody: AccessKeys; - }; -}; +/** Contains response data for the createOrUpdate operation. */ +export type PrivateEndpointConnectionsCreateOrUpdateResponse = PrivateEndpointConnection; -/** - * Contains response data for the regenerateKeys operation. - */ -export type NamespacesRegenerateKeysResponse = AccessKeys & { - /** - * The underlying HTTP response. - */ - _response: msRest.HttpResponse & { - /** - * The response body as text (string format) - */ - bodyAsText: string; - - /** - * The response body as parsed JSON or XML - */ - parsedBody: AccessKeys; - }; -}; +/** Optional parameters. */ +export interface PrivateEndpointConnectionsDeleteOptionalParams + extends coreClient.OperationOptions { + /** Delay to wait until next poll, in milliseconds. */ + updateIntervalInMs?: number; + /** A serialized poller which can be used to resume an existing paused Long-Running-Operation. */ + resumeFrom?: string; +} -/** - * Contains response data for the checkNameAvailability operation. - */ -export type NamespacesCheckNameAvailabilityResponse = CheckNameAvailabilityResult & { - /** - * The underlying HTTP response. - */ - _response: msRest.HttpResponse & { - /** - * The response body as text (string format) - */ - bodyAsText: string; - - /** - * The response body as parsed JSON or XML - */ - parsedBody: CheckNameAvailabilityResult; - }; -}; +/** Optional parameters. */ +export interface PrivateEndpointConnectionsGetOptionalParams + extends coreClient.OperationOptions {} -/** - * Contains response data for the beginCreateOrUpdate operation. - */ -export type NamespacesBeginCreateOrUpdateResponse = EHNamespace & { - /** - * The underlying HTTP response. - */ - _response: msRest.HttpResponse & { - /** - * The response body as text (string format) - */ - bodyAsText: string; - - /** - * The response body as parsed JSON or XML - */ - parsedBody: EHNamespace; - }; -}; +/** Contains response data for the get operation. */ +export type PrivateEndpointConnectionsGetResponse = PrivateEndpointConnection; -/** - * Contains response data for the listNext operation. - */ -export type NamespacesListNextResponse = EHNamespaceListResult & { - /** - * The underlying HTTP response. - */ - _response: msRest.HttpResponse & { - /** - * The response body as text (string format) - */ - bodyAsText: string; - - /** - * The response body as parsed JSON or XML - */ - parsedBody: EHNamespaceListResult; - }; -}; +/** Optional parameters. */ +export interface PrivateEndpointConnectionsListNextOptionalParams + extends coreClient.OperationOptions {} -/** - * Contains response data for the listByResourceGroupNext operation. - */ -export type NamespacesListByResourceGroupNextResponse = EHNamespaceListResult & { - /** - * The underlying HTTP response. - */ - _response: msRest.HttpResponse & { - /** - * The response body as text (string format) - */ - bodyAsText: string; - - /** - * The response body as parsed JSON or XML - */ - parsedBody: EHNamespaceListResult; - }; -}; +/** Contains response data for the listNext operation. */ +export type PrivateEndpointConnectionsListNextResponse = PrivateEndpointConnectionListResult; -/** - * Contains response data for the listAuthorizationRulesNext operation. - */ -export type NamespacesListAuthorizationRulesNextResponse = AuthorizationRuleListResult & { - /** - * The underlying HTTP response. - */ - _response: msRest.HttpResponse & { - /** - * The response body as text (string format) - */ - bodyAsText: string; - - /** - * The response body as parsed JSON or XML - */ - parsedBody: AuthorizationRuleListResult; - }; -}; +/** Optional parameters. */ +export interface PrivateLinkResourcesGetOptionalParams + extends coreClient.OperationOptions {} -/** - * Contains response data for the list operation. - */ -export type PrivateEndpointConnectionsListResponse = PrivateEndpointConnectionListResult & { - /** - * The underlying HTTP response. - */ - _response: msRest.HttpResponse & { - /** - * The response body as text (string format) - */ - bodyAsText: string; - - /** - * The response body as parsed JSON or XML - */ - parsedBody: PrivateEndpointConnectionListResult; - }; -}; +/** Contains response data for the get operation. */ +export type PrivateLinkResourcesGetResponse = PrivateLinkResourcesListResult; -/** - * Contains response data for the createOrUpdate operation. - */ -export type PrivateEndpointConnectionsCreateOrUpdateResponse = PrivateEndpointConnection & { - /** - * The underlying HTTP response. - */ - _response: msRest.HttpResponse & { - /** - * The response body as text (string format) - */ - bodyAsText: string; - - /** - * The response body as parsed JSON or XML - */ - parsedBody: PrivateEndpointConnection; - }; -}; +/** Optional parameters. */ +export interface DisasterRecoveryConfigsListAuthorizationRulesOptionalParams + extends coreClient.OperationOptions {} -/** - * Contains response data for the get operation. - */ -export type PrivateEndpointConnectionsGetResponse = PrivateEndpointConnection & { - /** - * The underlying HTTP response. - */ - _response: msRest.HttpResponse & { - /** - * The response body as text (string format) - */ - bodyAsText: string; - - /** - * The response body as parsed JSON or XML - */ - parsedBody: PrivateEndpointConnection; - }; -}; +/** Contains response data for the listAuthorizationRules operation. */ +export type DisasterRecoveryConfigsListAuthorizationRulesResponse = AuthorizationRuleListResult; -/** - * Contains response data for the listNext operation. - */ -export type PrivateEndpointConnectionsListNextResponse = PrivateEndpointConnectionListResult & { - /** - * The underlying HTTP response. - */ - _response: msRest.HttpResponse & { - /** - * The response body as text (string format) - */ - bodyAsText: string; - - /** - * The response body as parsed JSON or XML - */ - parsedBody: PrivateEndpointConnectionListResult; - }; -}; +/** Optional parameters. */ +export interface DisasterRecoveryConfigsGetAuthorizationRuleOptionalParams + extends coreClient.OperationOptions {} -/** - * Contains response data for the get operation. - */ -export type PrivateLinkResourcesGetResponse = PrivateLinkResourcesListResult & { - /** - * The underlying HTTP response. - */ - _response: msRest.HttpResponse & { - /** - * The response body as text (string format) - */ - bodyAsText: string; - - /** - * The response body as parsed JSON or XML - */ - parsedBody: PrivateLinkResourcesListResult; - }; -}; +/** Contains response data for the getAuthorizationRule operation. */ +export type DisasterRecoveryConfigsGetAuthorizationRuleResponse = AuthorizationRule; -/** - * Contains response data for the listAuthorizationRules operation. - */ -export type DisasterRecoveryConfigsListAuthorizationRulesResponse = AuthorizationRuleListResult & { - /** - * The underlying HTTP response. - */ - _response: msRest.HttpResponse & { - /** - * The response body as text (string format) - */ - bodyAsText: string; - - /** - * The response body as parsed JSON or XML - */ - parsedBody: AuthorizationRuleListResult; - }; -}; +/** Optional parameters. */ +export interface DisasterRecoveryConfigsListKeysOptionalParams + extends coreClient.OperationOptions {} -/** - * Contains response data for the getAuthorizationRule operation. - */ -export type DisasterRecoveryConfigsGetAuthorizationRuleResponse = AuthorizationRule & { - /** - * The underlying HTTP response. - */ - _response: msRest.HttpResponse & { - /** - * The response body as text (string format) - */ - bodyAsText: string; - - /** - * The response body as parsed JSON or XML - */ - parsedBody: AuthorizationRule; - }; -}; +/** Contains response data for the listKeys operation. */ +export type DisasterRecoveryConfigsListKeysResponse = AccessKeys; -/** - * Contains response data for the listKeys operation. - */ -export type DisasterRecoveryConfigsListKeysResponse = AccessKeys & { - /** - * The underlying HTTP response. - */ - _response: msRest.HttpResponse & { - /** - * The response body as text (string format) - */ - bodyAsText: string; - - /** - * The response body as parsed JSON or XML - */ - parsedBody: AccessKeys; - }; -}; +/** Optional parameters. */ +export interface DisasterRecoveryConfigsListAuthorizationRulesNextOptionalParams + extends coreClient.OperationOptions {} -/** - * Contains response data for the listAuthorizationRulesNext operation. - */ -export type DisasterRecoveryConfigsListAuthorizationRulesNextResponse = AuthorizationRuleListResult & { - /** - * The underlying HTTP response. - */ - _response: msRest.HttpResponse & { - /** - * The response body as text (string format) - */ - bodyAsText: string; - - /** - * The response body as parsed JSON or XML - */ - parsedBody: AuthorizationRuleListResult; - }; -}; +/** Contains response data for the listAuthorizationRulesNext operation. */ +export type DisasterRecoveryConfigsListAuthorizationRulesNextResponse = AuthorizationRuleListResult; -/** - * Contains response data for the listAuthorizationRules operation. - */ -export type EventHubsListAuthorizationRulesResponse = AuthorizationRuleListResult & { - /** - * The underlying HTTP response. - */ - _response: msRest.HttpResponse & { - /** - * The response body as text (string format) - */ - bodyAsText: string; - - /** - * The response body as parsed JSON or XML - */ - parsedBody: AuthorizationRuleListResult; - }; -}; +/** Optional parameters. */ +export interface EventHubsListAuthorizationRulesOptionalParams + extends coreClient.OperationOptions {} -/** - * Contains response data for the createOrUpdateAuthorizationRule operation. - */ -export type EventHubsCreateOrUpdateAuthorizationRuleResponse = AuthorizationRule & { - /** - * The underlying HTTP response. - */ - _response: msRest.HttpResponse & { - /** - * The response body as text (string format) - */ - bodyAsText: string; - - /** - * The response body as parsed JSON or XML - */ - parsedBody: AuthorizationRule; - }; -}; +/** Contains response data for the listAuthorizationRules operation. */ +export type EventHubsListAuthorizationRulesResponse = AuthorizationRuleListResult; -/** - * Contains response data for the getAuthorizationRule operation. - */ -export type EventHubsGetAuthorizationRuleResponse = AuthorizationRule & { - /** - * The underlying HTTP response. - */ - _response: msRest.HttpResponse & { - /** - * The response body as text (string format) - */ - bodyAsText: string; - - /** - * The response body as parsed JSON or XML - */ - parsedBody: AuthorizationRule; - }; -}; +/** Optional parameters. */ +export interface EventHubsCreateOrUpdateAuthorizationRuleOptionalParams + extends coreClient.OperationOptions {} -/** - * Contains response data for the listKeys operation. - */ -export type EventHubsListKeysResponse = AccessKeys & { - /** - * The underlying HTTP response. - */ - _response: msRest.HttpResponse & { - /** - * The response body as text (string format) - */ - bodyAsText: string; - - /** - * The response body as parsed JSON or XML - */ - parsedBody: AccessKeys; - }; -}; +/** Contains response data for the createOrUpdateAuthorizationRule operation. */ +export type EventHubsCreateOrUpdateAuthorizationRuleResponse = AuthorizationRule; -/** - * Contains response data for the regenerateKeys operation. - */ -export type EventHubsRegenerateKeysResponse = AccessKeys & { - /** - * The underlying HTTP response. - */ - _response: msRest.HttpResponse & { - /** - * The response body as text (string format) - */ - bodyAsText: string; - - /** - * The response body as parsed JSON or XML - */ - parsedBody: AccessKeys; - }; -}; +/** Optional parameters. */ +export interface EventHubsGetAuthorizationRuleOptionalParams + extends coreClient.OperationOptions {} -/** - * Contains response data for the listByNamespace operation. - */ -export type EventHubsListByNamespaceResponse = EventHubListResult & { - /** - * The underlying HTTP response. - */ - _response: msRest.HttpResponse & { - /** - * The response body as text (string format) - */ - bodyAsText: string; - - /** - * The response body as parsed JSON or XML - */ - parsedBody: EventHubListResult; - }; -}; +/** Contains response data for the getAuthorizationRule operation. */ +export type EventHubsGetAuthorizationRuleResponse = AuthorizationRule; -/** - * Contains response data for the createOrUpdate operation. - */ -export type EventHubsCreateOrUpdateResponse = Eventhub & { - /** - * The underlying HTTP response. - */ - _response: msRest.HttpResponse & { - /** - * The response body as text (string format) - */ - bodyAsText: string; - - /** - * The response body as parsed JSON or XML - */ - parsedBody: Eventhub; - }; -}; +/** Optional parameters. */ +export interface EventHubsDeleteAuthorizationRuleOptionalParams + extends coreClient.OperationOptions {} -/** - * Contains response data for the get operation. - */ -export type EventHubsGetResponse = Eventhub & { - /** - * The underlying HTTP response. - */ - _response: msRest.HttpResponse & { - /** - * The response body as text (string format) - */ - bodyAsText: string; - - /** - * The response body as parsed JSON or XML - */ - parsedBody: Eventhub; - }; -}; +/** Optional parameters. */ +export interface EventHubsListKeysOptionalParams + extends coreClient.OperationOptions {} -/** - * Contains response data for the listAuthorizationRulesNext operation. - */ -export type EventHubsListAuthorizationRulesNextResponse = AuthorizationRuleListResult & { - /** - * The underlying HTTP response. - */ - _response: msRest.HttpResponse & { - /** - * The response body as text (string format) - */ - bodyAsText: string; - - /** - * The response body as parsed JSON or XML - */ - parsedBody: AuthorizationRuleListResult; - }; -}; +/** Contains response data for the listKeys operation. */ +export type EventHubsListKeysResponse = AccessKeys; -/** - * Contains response data for the listByNamespaceNext operation. - */ -export type EventHubsListByNamespaceNextResponse = EventHubListResult & { - /** - * The underlying HTTP response. - */ - _response: msRest.HttpResponse & { - /** - * The response body as text (string format) - */ - bodyAsText: string; - - /** - * The response body as parsed JSON or XML - */ - parsedBody: EventHubListResult; - }; -}; +/** Optional parameters. */ +export interface EventHubsRegenerateKeysOptionalParams + extends coreClient.OperationOptions {} -/** - * Contains response data for the createOrUpdate operation. - */ -export type ConsumerGroupsCreateOrUpdateResponse = ConsumerGroup & { - /** - * The underlying HTTP response. - */ - _response: msRest.HttpResponse & { - /** - * The response body as text (string format) - */ - bodyAsText: string; - - /** - * The response body as parsed JSON or XML - */ - parsedBody: ConsumerGroup; - }; -}; +/** Contains response data for the regenerateKeys operation. */ +export type EventHubsRegenerateKeysResponse = AccessKeys; -/** - * Contains response data for the get operation. - */ -export type ConsumerGroupsGetResponse = ConsumerGroup & { - /** - * The underlying HTTP response. - */ - _response: msRest.HttpResponse & { - /** - * The response body as text (string format) - */ - bodyAsText: string; - - /** - * The response body as parsed JSON or XML - */ - parsedBody: ConsumerGroup; - }; -}; +/** Optional parameters. */ +export interface EventHubsListByNamespaceOptionalParams + extends coreClient.OperationOptions { + /** Skip is only used if a previous operation returned a partial result. If a previous response contains a nextLink element, the value of the nextLink element will include a skip parameter that specifies a starting point to use for subsequent calls. */ + skip?: number; + /** May be used to limit the number of results to the most recent N usageDetails. */ + top?: number; +} -/** - * Contains response data for the listByEventHub operation. - */ -export type ConsumerGroupsListByEventHubResponse = ConsumerGroupListResult & { - /** - * The underlying HTTP response. - */ - _response: msRest.HttpResponse & { - /** - * The response body as text (string format) - */ - bodyAsText: string; - - /** - * The response body as parsed JSON or XML - */ - parsedBody: ConsumerGroupListResult; - }; -}; +/** Contains response data for the listByNamespace operation. */ +export type EventHubsListByNamespaceResponse = EventHubListResult; -/** - * Contains response data for the listByEventHubNext operation. - */ -export type ConsumerGroupsListByEventHubNextResponse = ConsumerGroupListResult & { - /** - * The underlying HTTP response. - */ - _response: msRest.HttpResponse & { - /** - * The response body as text (string format) - */ - bodyAsText: string; - - /** - * The response body as parsed JSON or XML - */ - parsedBody: ConsumerGroupListResult; - }; -}; +/** Optional parameters. */ +export interface EventHubsCreateOrUpdateOptionalParams + extends coreClient.OperationOptions {} -/** - * Contains response data for the list operation. - */ -export type OperationsListResponse = OperationListResult & { - /** - * The underlying HTTP response. - */ - _response: msRest.HttpResponse & { - /** - * The response body as text (string format) - */ - bodyAsText: string; - - /** - * The response body as parsed JSON or XML - */ - parsedBody: OperationListResult; - }; -}; +/** Contains response data for the createOrUpdate operation. */ +export type EventHubsCreateOrUpdateResponse = Eventhub; -/** - * Contains response data for the listNext operation. - */ -export type OperationsListNextResponse = OperationListResult & { - /** - * The underlying HTTP response. - */ - _response: msRest.HttpResponse & { - /** - * The response body as text (string format) - */ - bodyAsText: string; - - /** - * The response body as parsed JSON or XML - */ - parsedBody: OperationListResult; - }; -}; +/** Optional parameters. */ +export interface EventHubsDeleteOptionalParams + extends coreClient.OperationOptions {} -/** - * Contains response data for the listBySku operation. - */ -export type RegionsListBySkuResponse = MessagingRegionsListResult & { - /** - * The underlying HTTP response. - */ - _response: msRest.HttpResponse & { - /** - * The response body as text (string format) - */ - bodyAsText: string; - - /** - * The response body as parsed JSON or XML - */ - parsedBody: MessagingRegionsListResult; - }; -}; +/** Optional parameters. */ +export interface EventHubsGetOptionalParams + extends coreClient.OperationOptions {} -/** - * Contains response data for the listBySkuNext operation. - */ -export type RegionsListBySkuNextResponse = MessagingRegionsListResult & { - /** - * The underlying HTTP response. - */ - _response: msRest.HttpResponse & { - /** - * The response body as text (string format) - */ - bodyAsText: string; - - /** - * The response body as parsed JSON or XML - */ - parsedBody: MessagingRegionsListResult; - }; -}; +/** Contains response data for the get operation. */ +export type EventHubsGetResponse = Eventhub; + +/** Optional parameters. */ +export interface EventHubsListAuthorizationRulesNextOptionalParams + extends coreClient.OperationOptions {} + +/** Contains response data for the listAuthorizationRulesNext operation. */ +export type EventHubsListAuthorizationRulesNextResponse = AuthorizationRuleListResult; + +/** Optional parameters. */ +export interface EventHubsListByNamespaceNextOptionalParams + extends coreClient.OperationOptions { + /** Skip is only used if a previous operation returned a partial result. If a previous response contains a nextLink element, the value of the nextLink element will include a skip parameter that specifies a starting point to use for subsequent calls. */ + skip?: number; + /** May be used to limit the number of results to the most recent N usageDetails. */ + top?: number; +} + +/** Contains response data for the listByNamespaceNext operation. */ +export type EventHubsListByNamespaceNextResponse = EventHubListResult; + +/** Optional parameters. */ +export interface ConsumerGroupsCreateOrUpdateOptionalParams + extends coreClient.OperationOptions {} + +/** Contains response data for the createOrUpdate operation. */ +export type ConsumerGroupsCreateOrUpdateResponse = ConsumerGroup; + +/** Optional parameters. */ +export interface ConsumerGroupsDeleteOptionalParams + extends coreClient.OperationOptions {} + +/** Optional parameters. */ +export interface ConsumerGroupsGetOptionalParams + extends coreClient.OperationOptions {} + +/** Contains response data for the get operation. */ +export type ConsumerGroupsGetResponse = ConsumerGroup; + +/** Optional parameters. */ +export interface ConsumerGroupsListByEventHubOptionalParams + extends coreClient.OperationOptions { + /** Skip is only used if a previous operation returned a partial result. If a previous response contains a nextLink element, the value of the nextLink element will include a skip parameter that specifies a starting point to use for subsequent calls. */ + skip?: number; + /** May be used to limit the number of results to the most recent N usageDetails. */ + top?: number; +} + +/** Contains response data for the listByEventHub operation. */ +export type ConsumerGroupsListByEventHubResponse = ConsumerGroupListResult; + +/** Optional parameters. */ +export interface ConsumerGroupsListByEventHubNextOptionalParams + extends coreClient.OperationOptions { + /** Skip is only used if a previous operation returned a partial result. If a previous response contains a nextLink element, the value of the nextLink element will include a skip parameter that specifies a starting point to use for subsequent calls. */ + skip?: number; + /** May be used to limit the number of results to the most recent N usageDetails. */ + top?: number; +} + +/** Contains response data for the listByEventHubNext operation. */ +export type ConsumerGroupsListByEventHubNextResponse = ConsumerGroupListResult; + +/** 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 RegionsListBySkuOptionalParams + extends coreClient.OperationOptions {} + +/** Contains response data for the listBySku operation. */ +export type RegionsListBySkuResponse = MessagingRegionsListResult; + +/** Optional parameters. */ +export interface RegionsListBySkuNextOptionalParams + extends coreClient.OperationOptions {} + +/** Contains response data for the listBySkuNext operation. */ +export type RegionsListBySkuNextResponse = MessagingRegionsListResult; + +/** Optional parameters. */ +export interface EventHubManagementClientOptionalParams + extends coreClient.ServiceClientOptions { + /** server parameter */ + $host?: string; + /** Overrides client endpoint. */ + endpoint?: string; +} diff --git a/sdk/eventhub/arm-eventhub-profile-2020-09-01-hybrid/src/models/mappers.ts b/sdk/eventhub/arm-eventhub-profile-2020-09-01-hybrid/src/models/mappers.ts index 16d68f0da511..ee082b5e42c3 100644 --- a/sdk/eventhub/arm-eventhub-profile-2020-09-01-hybrid/src/models/mappers.ts +++ b/sdk/eventhub/arm-eventhub-profile-2020-09-01-hybrid/src/models/mappers.ts @@ -1,35 +1,14 @@ /* - * 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 AvailableCluster: msRest.CompositeMapper = { - serializedName: "AvailableCluster", - type: { - name: "Composite", - className: "AvailableCluster", - modelProperties: { - location: { - serializedName: "location", - type: { - name: "String" - } - } - } - } -}; - -export const AvailableClustersList: msRest.CompositeMapper = { - serializedName: "AvailableClustersList", +export const AvailableClustersList: coreClient.CompositeMapper = { type: { name: "Composite", className: "AvailableClustersList", @@ -50,8 +29,22 @@ export const AvailableClustersList: msRest.CompositeMapper = { } }; -export const ErrorResponse: msRest.CompositeMapper = { - serializedName: "ErrorResponse", +export const AvailableCluster: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "AvailableCluster", + modelProperties: { + location: { + serializedName: "location", + type: { + name: "String" + } + } + } + } +}; + +export const ErrorResponse: coreClient.CompositeMapper = { type: { name: "Composite", className: "ErrorResponse", @@ -72,27 +65,50 @@ export const ErrorResponse: msRest.CompositeMapper = { } }; -export const ClusterSku: msRest.CompositeMapper = { - serializedName: "ClusterSku", +export const ClusterListResult: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "ClusterListResult", + modelProperties: { + value: { + serializedName: "value", + type: { + name: "Sequence", + element: { + type: { + name: "Composite", + className: "Cluster" + } + } + } + }, + nextLink: { + serializedName: "nextLink", + type: { + name: "String" + } + } + } + } +}; + +export const ClusterSku: coreClient.CompositeMapper = { type: { name: "Composite", className: "ClusterSku", modelProperties: { name: { - required: true, - isConstant: true, serializedName: "name", - defaultValue: 'Dedicated', + required: true, type: { name: "String" } }, capacity: { - serializedName: "capacity", constraints: { - InclusiveMaximum: 32, InclusiveMinimum: 1 }, + serializedName: "capacity", type: { name: "Number" } @@ -101,29 +117,28 @@ export const ClusterSku: 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", + readOnly: true, type: { name: "String" } }, type: { - readOnly: true, serializedName: "type", + readOnly: true, type: { name: "String" } @@ -132,26 +147,19 @@ export const Resource: msRest.CompositeMapper = { } }; -export const TrackedResource: msRest.CompositeMapper = { - serializedName: "TrackedResource", +export const EHNamespaceIdListResult: coreClient.CompositeMapper = { type: { name: "Composite", - className: "TrackedResource", + className: "EHNamespaceIdListResult", modelProperties: { - ...Resource.type.modelProperties, - location: { - serializedName: "location", - type: { - name: "String" - } - }, - tags: { - serializedName: "tags", + value: { + serializedName: "value", type: { - name: "Dictionary", - value: { + name: "Sequence", + element: { type: { - name: "String" + name: "Composite", + className: "EHNamespaceIdContainer" } } } @@ -160,54 +168,7 @@ export const TrackedResource: msRest.CompositeMapper = { } }; -export const Cluster: msRest.CompositeMapper = { - serializedName: "Cluster", - type: { - name: "Composite", - className: "Cluster", - modelProperties: { - ...TrackedResource.type.modelProperties, - sku: { - serializedName: "sku", - type: { - name: "Composite", - className: "ClusterSku" - } - }, - createdAt: { - readOnly: true, - serializedName: "properties.createdAt", - type: { - name: "String" - } - }, - updatedAt: { - readOnly: true, - serializedName: "properties.updatedAt", - type: { - name: "String" - } - }, - metricId: { - readOnly: true, - serializedName: "properties.metricId", - type: { - name: "String" - } - }, - status: { - readOnly: true, - serializedName: "properties.status", - type: { - name: "String" - } - } - } - } -}; - -export const EHNamespaceIdContainer: msRest.CompositeMapper = { - serializedName: "EHNamespaceIdContainer", +export const EHNamespaceIdContainer: coreClient.CompositeMapper = { type: { name: "Composite", className: "EHNamespaceIdContainer", @@ -222,11 +183,10 @@ export const EHNamespaceIdContainer: msRest.CompositeMapper = { } }; -export const EHNamespaceIdListResult: msRest.CompositeMapper = { - serializedName: "EHNamespaceIdListResult", +export const EHNamespaceListResult: coreClient.CompositeMapper = { type: { name: "Composite", - className: "EHNamespaceIdListResult", + className: "EHNamespaceListResult", modelProperties: { value: { serializedName: "value", @@ -235,24 +195,29 @@ export const EHNamespaceIdListResult: msRest.CompositeMapper = { element: { type: { name: "Composite", - className: "EHNamespaceIdContainer" + className: "EHNamespace" } } } + }, + nextLink: { + serializedName: "nextLink", + type: { + name: "String" + } } } } }; -export const Sku: msRest.CompositeMapper = { - serializedName: "Sku", +export const Sku: coreClient.CompositeMapper = { type: { name: "Composite", className: "Sku", modelProperties: { name: { - required: true, serializedName: "name", + required: true, type: { name: "String" } @@ -264,11 +229,10 @@ export const Sku: msRest.CompositeMapper = { } }, capacity: { - serializedName: "capacity", constraints: { - InclusiveMaximum: 20, InclusiveMinimum: 0 }, + serializedName: "capacity", type: { name: "Number" } @@ -277,8 +241,7 @@ export const Sku: msRest.CompositeMapper = { } }; -export const Identity: msRest.CompositeMapper = { - serializedName: "Identity", +export const Identity: coreClient.CompositeMapper = { type: { name: "Composite", className: "Identity", @@ -296,21 +259,47 @@ export const Identity: msRest.CompositeMapper = { } }, type: { + defaultValue: "SystemAssigned", + isConstant: true, serializedName: "type", - defaultValue: 'SystemAssigned', type: { - name: "Enum", - allowedValues: [ - "SystemAssigned" - ] + name: "String" + } + } + } + } +}; + +export const Encryption: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "Encryption", + modelProperties: { + keyVaultProperties: { + serializedName: "keyVaultProperties", + type: { + name: "Sequence", + element: { + type: { + name: "Composite", + className: "KeyVaultProperties" + } + } + } + }, + keySource: { + defaultValue: "Microsoft.KeyVault", + isConstant: true, + serializedName: "keySource", + type: { + name: "String" } } } } }; -export const KeyVaultProperties: msRest.CompositeMapper = { - serializedName: "KeyVaultProperties", +export const KeyVaultProperties: coreClient.CompositeMapper = { type: { name: "Composite", className: "KeyVaultProperties", @@ -337,214 +326,119 @@ export const KeyVaultProperties: msRest.CompositeMapper = { } }; -export const Encryption: msRest.CompositeMapper = { - serializedName: "Encryption", +export const PrivateEndpointConnectionListResult: coreClient.CompositeMapper = { type: { name: "Composite", - className: "Encryption", + className: "PrivateEndpointConnectionListResult", modelProperties: { - keyVaultProperties: { - serializedName: "keyVaultProperties", + value: { + serializedName: "value", type: { name: "Sequence", element: { type: { name: "Composite", - className: "KeyVaultProperties" + className: "PrivateEndpointConnection" } } } }, - keySource: { - serializedName: "keySource", - defaultValue: 'Microsoft.KeyVault', + nextLink: { + serializedName: "nextLink", type: { - name: "Enum", - allowedValues: [ - "Microsoft.KeyVault" - ] + name: "String" } } } } }; -export const EHNamespace: msRest.CompositeMapper = { - serializedName: "EHNamespace", +export const PrivateEndpoint: coreClient.CompositeMapper = { type: { name: "Composite", - className: "EHNamespace", + className: "PrivateEndpoint", modelProperties: { - ...TrackedResource.type.modelProperties, - sku: { - serializedName: "sku", + id: { + serializedName: "id", type: { - name: "Composite", - className: "Sku" + name: "String" } - }, - identity: { - serializedName: "identity", + } + } + } +}; + +export const ConnectionState: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "ConnectionState", + modelProperties: { + status: { + serializedName: "status", type: { - name: "Composite", - className: "Identity" + name: "String" } }, - provisioningState: { - readOnly: true, - serializedName: "properties.provisioningState", + description: { + serializedName: "description", type: { name: "String" } - }, - createdAt: { - readOnly: true, - serializedName: "properties.createdAt", + } + } + } +}; + +export const PrivateLinkResourcesListResult: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "PrivateLinkResourcesListResult", + modelProperties: { + value: { + serializedName: "value", type: { - name: "DateTime" + name: "Sequence", + element: { + type: { + name: "Composite", + className: "PrivateLinkResource" + } + } } }, - updatedAt: { - readOnly: true, - serializedName: "properties.updatedAt", + nextLink: { + serializedName: "nextLink", type: { - name: "DateTime" - } - }, - serviceBusEndpoint: { - readOnly: true, - serializedName: "properties.serviceBusEndpoint", - type: { - name: "String" - } - }, - clusterArmId: { - serializedName: "properties.clusterArmId", - type: { - name: "String" - } - }, - metricId: { - readOnly: true, - serializedName: "properties.metricId", - type: { - name: "String" - } - }, - isAutoInflateEnabled: { - serializedName: "properties.isAutoInflateEnabled", - type: { - name: "Boolean" - } - }, - maximumThroughputUnits: { - serializedName: "properties.maximumThroughputUnits", - constraints: { - InclusiveMaximum: 20, - InclusiveMinimum: 0 - }, - type: { - name: "Number" - } - }, - kafkaEnabled: { - serializedName: "properties.kafkaEnabled", - type: { - name: "Boolean" - } - }, - zoneRedundant: { - serializedName: "properties.zoneRedundant", - type: { - name: "Boolean" - } - }, - encryption: { - serializedName: "properties.encryption", - type: { - name: "Composite", - className: "Encryption" + name: "String" } } } } }; -export const PrivateEndpoint: msRest.CompositeMapper = { - serializedName: "PrivateEndpoint", +export const PrivateLinkResource: coreClient.CompositeMapper = { type: { name: "Composite", - className: "PrivateEndpoint", + className: "PrivateLinkResource", modelProperties: { id: { serializedName: "id", type: { name: "String" } - } - } - } -}; - -export const ConnectionState: msRest.CompositeMapper = { - serializedName: "ConnectionState", - type: { - name: "Composite", - className: "ConnectionState", - modelProperties: { - status: { - serializedName: "status", - type: { - name: "String" - } }, - description: { - serializedName: "description", + name: { + serializedName: "name", type: { name: "String" } - } - } - } -}; - -export const PrivateEndpointConnection: msRest.CompositeMapper = { - serializedName: "PrivateEndpointConnection", - type: { - name: "Composite", - className: "PrivateEndpointConnection", - modelProperties: { - ...Resource.type.modelProperties, - privateEndpoint: { - serializedName: "properties.privateEndpoint", - type: { - name: "Composite", - className: "PrivateEndpoint" - } - }, - privateLinkServiceConnectionState: { - serializedName: "properties.privateLinkServiceConnectionState", - type: { - name: "Composite", - className: "ConnectionState" - } }, - provisioningState: { - serializedName: "properties.provisioningState", + type: { + serializedName: "type", type: { name: "String" } - } - } - } -}; - -export const PrivateLinkResource: msRest.CompositeMapper = { - serializedName: "PrivateLinkResource", - type: { - name: "Composite", - className: "PrivateLinkResource", - modelProperties: { + }, groupId: { serializedName: "properties.groupId", type: { @@ -572,34 +466,15 @@ export const PrivateLinkResource: msRest.CompositeMapper = { } } } - }, - id: { - serializedName: "id", - type: { - name: "String" - } - }, - name: { - serializedName: "name", - type: { - name: "String" - } - }, - type: { - serializedName: "type", - type: { - name: "String" - } } } } }; -export const PrivateLinkResourcesListResult: msRest.CompositeMapper = { - serializedName: "PrivateLinkResourcesListResult", +export const AuthorizationRuleListResult: coreClient.CompositeMapper = { type: { name: "Composite", - className: "PrivateLinkResourcesListResult", + className: "AuthorizationRuleListResult", modelProperties: { value: { serializedName: "value", @@ -608,7 +483,7 @@ export const PrivateLinkResourcesListResult: msRest.CompositeMapper = { element: { type: { name: "Composite", - className: "PrivateLinkResource" + className: "AuthorizationRule" } } } @@ -623,80 +498,56 @@ export const PrivateLinkResourcesListResult: msRest.CompositeMapper = { } }; -export const AuthorizationRule: msRest.CompositeMapper = { - serializedName: "AuthorizationRule", - type: { - name: "Composite", - className: "AuthorizationRule", - modelProperties: { - ...Resource.type.modelProperties, - rights: { - required: true, - serializedName: "properties.rights", - type: { - name: "Sequence", - element: { - type: { - name: "String" - } - } - } - } - } - } -}; - -export const AccessKeys: msRest.CompositeMapper = { - serializedName: "AccessKeys", +export const AccessKeys: coreClient.CompositeMapper = { type: { name: "Composite", className: "AccessKeys", modelProperties: { primaryConnectionString: { - readOnly: true, serializedName: "primaryConnectionString", + readOnly: true, type: { name: "String" } }, secondaryConnectionString: { - readOnly: true, serializedName: "secondaryConnectionString", + readOnly: true, type: { name: "String" } }, aliasPrimaryConnectionString: { - readOnly: true, serializedName: "aliasPrimaryConnectionString", + readOnly: true, type: { name: "String" } }, aliasSecondaryConnectionString: { - readOnly: true, serializedName: "aliasSecondaryConnectionString", + readOnly: true, type: { name: "String" } }, primaryKey: { - readOnly: true, serializedName: "primaryKey", + readOnly: true, type: { name: "String" } }, secondaryKey: { - readOnly: true, serializedName: "secondaryKey", + readOnly: true, type: { name: "String" } }, keyName: { - readOnly: true, serializedName: "keyName", + readOnly: true, type: { name: "String" } @@ -705,21 +556,17 @@ export const AccessKeys: msRest.CompositeMapper = { } }; -export const RegenerateAccessKeyParameters: msRest.CompositeMapper = { - serializedName: "RegenerateAccessKeyParameters", +export const RegenerateAccessKeyParameters: coreClient.CompositeMapper = { type: { name: "Composite", className: "RegenerateAccessKeyParameters", modelProperties: { keyType: { - required: true, serializedName: "keyType", + required: true, type: { name: "Enum", - allowedValues: [ - "PrimaryKey", - "SecondaryKey" - ] + allowedValues: ["PrimaryKey", "SecondaryKey"] } }, key: { @@ -732,15 +579,14 @@ export const RegenerateAccessKeyParameters: msRest.CompositeMapper = { } }; -export const CheckNameAvailabilityParameter: msRest.CompositeMapper = { - serializedName: "CheckNameAvailabilityParameter", +export const CheckNameAvailabilityParameter: coreClient.CompositeMapper = { type: { name: "Composite", className: "CheckNameAvailabilityParameter", modelProperties: { name: { - required: true, serializedName: "name", + required: true, type: { name: "String" } @@ -749,15 +595,14 @@ export const CheckNameAvailabilityParameter: msRest.CompositeMapper = { } }; -export const CheckNameAvailabilityResult: msRest.CompositeMapper = { - serializedName: "CheckNameAvailabilityResult", +export const CheckNameAvailabilityResult: coreClient.CompositeMapper = { type: { name: "Composite", className: "CheckNameAvailabilityResult", modelProperties: { message: { - readOnly: true, serializedName: "message", + readOnly: true, type: { name: "String" } @@ -786,29 +631,25 @@ export const CheckNameAvailabilityResult: msRest.CompositeMapper = { } }; -export const ConsumerGroup: msRest.CompositeMapper = { - serializedName: "ConsumerGroup", +export const ConsumerGroupListResult: coreClient.CompositeMapper = { type: { name: "Composite", - className: "ConsumerGroup", + className: "ConsumerGroupListResult", modelProperties: { - ...Resource.type.modelProperties, - createdAt: { - readOnly: true, - serializedName: "properties.createdAt", - type: { - name: "DateTime" - } - }, - updatedAt: { - readOnly: true, - serializedName: "properties.updatedAt", + value: { + serializedName: "value", type: { - name: "DateTime" + name: "Sequence", + element: { + type: { + name: "Composite", + className: "ConsumerGroup" + } + } } }, - userMetadata: { - serializedName: "properties.userMetadata", + nextLink: { + serializedName: "nextLink", type: { name: "String" } @@ -817,29 +658,27 @@ export const ConsumerGroup: msRest.CompositeMapper = { } }; -export const OperationDisplay: msRest.CompositeMapper = { - serializedName: "Operation_display", +export const OperationListResult: coreClient.CompositeMapper = { type: { name: "Composite", - className: "OperationDisplay", + className: "OperationListResult", modelProperties: { - provider: { - readOnly: true, - serializedName: "provider", - type: { - name: "String" - } - }, - resource: { + value: { + serializedName: "value", readOnly: true, - serializedName: "resource", type: { - name: "String" + name: "Sequence", + element: { + type: { + name: "Composite", + className: "Operation" + } + } } }, - operation: { + nextLink: { + serializedName: "nextLink", readOnly: true, - serializedName: "operation", type: { name: "String" } @@ -848,15 +687,14 @@ export const OperationDisplay: msRest.CompositeMapper = { } }; -export const Operation: msRest.CompositeMapper = { - serializedName: "Operation", +export const Operation: coreClient.CompositeMapper = { type: { name: "Composite", className: "Operation", modelProperties: { name: { - readOnly: true, serializedName: "name", + readOnly: true, type: { name: "String" } @@ -872,32 +710,28 @@ export const Operation: msRest.CompositeMapper = { } }; -export const Destination: msRest.CompositeMapper = { - serializedName: "Destination", +export const OperationDisplay: coreClient.CompositeMapper = { type: { name: "Composite", - className: "Destination", + className: "OperationDisplay", modelProperties: { - name: { - serializedName: "name", - type: { - name: "String" - } - }, - storageAccountResourceId: { - serializedName: "properties.storageAccountResourceId", + provider: { + serializedName: "provider", + readOnly: true, type: { name: "String" } }, - blobContainer: { - serializedName: "properties.blobContainer", + resource: { + serializedName: "resource", + readOnly: true, type: { name: "String" } }, - archiveNameFormat: { - serializedName: "properties.archiveNameFormat", + operation: { + serializedName: "operation", + readOnly: true, type: { name: "String" } @@ -906,14 +740,40 @@ export const Destination: msRest.CompositeMapper = { } }; -export const CaptureDescription: msRest.CompositeMapper = { - serializedName: "CaptureDescription", +export const EventHubListResult: coreClient.CompositeMapper = { type: { name: "Composite", - className: "CaptureDescription", + className: "EventHubListResult", modelProperties: { - enabled: { - serializedName: "enabled", + value: { + serializedName: "value", + type: { + name: "Sequence", + element: { + type: { + name: "Composite", + className: "Eventhub" + } + } + } + }, + nextLink: { + serializedName: "nextLink", + type: { + name: "String" + } + } + } + } +}; + +export const CaptureDescription: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "CaptureDescription", + modelProperties: { + enabled: { + serializedName: "enabled", type: { name: "Boolean" } @@ -922,28 +782,25 @@ export const CaptureDescription: msRest.CompositeMapper = { serializedName: "encoding", type: { name: "Enum", - allowedValues: [ - "Avro", - "AvroDeflate" - ] + allowedValues: ["Avro", "AvroDeflate"] } }, intervalInSeconds: { - serializedName: "intervalInSeconds", constraints: { InclusiveMaximum: 900, InclusiveMinimum: 60 }, + serializedName: "intervalInSeconds", type: { name: "Number" } }, sizeLimitInBytes: { - serializedName: "sizeLimitInBytes", constraints: { InclusiveMaximum: 524288000, InclusiveMinimum: 10485760 }, + serializedName: "sizeLimitInBytes", type: { name: "Number" } @@ -965,101 +822,82 @@ export const CaptureDescription: msRest.CompositeMapper = { } }; -export const Eventhub: msRest.CompositeMapper = { - serializedName: "Eventhub", +export const Destination: coreClient.CompositeMapper = { type: { name: "Composite", - className: "Eventhub", + className: "Destination", modelProperties: { - ...Resource.type.modelProperties, - partitionIds: { - readOnly: true, - serializedName: "properties.partitionIds", - type: { - name: "Sequence", - element: { - type: { - name: "String" - } - } - } - }, - createdAt: { - readOnly: true, - serializedName: "properties.createdAt", + name: { + serializedName: "name", type: { - name: "DateTime" + name: "String" } }, - updatedAt: { - readOnly: true, - serializedName: "properties.updatedAt", + storageAccountResourceId: { + serializedName: "properties.storageAccountResourceId", type: { - name: "DateTime" + name: "String" } }, - messageRetentionInDays: { - serializedName: "properties.messageRetentionInDays", - constraints: { - InclusiveMinimum: 1 - }, + blobContainer: { + serializedName: "properties.blobContainer", type: { - name: "Number" + name: "String" } }, - partitionCount: { - serializedName: "properties.partitionCount", - constraints: { - InclusiveMinimum: 1 - }, + archiveNameFormat: { + serializedName: "properties.archiveNameFormat", type: { - name: "Number" + name: "String" } - }, - status: { - serializedName: "properties.status", + } + } + } +}; + +export const MessagingRegionsListResult: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "MessagingRegionsListResult", + modelProperties: { + value: { + serializedName: "value", type: { - name: "Enum", - allowedValues: [ - "Active", - "Disabled", - "Restoring", - "SendDisabled", - "ReceiveDisabled", - "Creating", - "Deleting", - "Renaming", - "Unknown" - ] + name: "Sequence", + element: { + type: { + name: "Composite", + className: "MessagingRegions" + } + } } }, - captureDescription: { - serializedName: "properties.captureDescription", + nextLink: { + serializedName: "nextLink", + readOnly: true, type: { - name: "Composite", - className: "CaptureDescription" + name: "String" } } } } }; -export const MessagingRegionsProperties: msRest.CompositeMapper = { - serializedName: "MessagingRegions_properties", +export const MessagingRegionsProperties: coreClient.CompositeMapper = { type: { name: "Composite", className: "MessagingRegionsProperties", modelProperties: { code: { - readOnly: true, serializedName: "code", + readOnly: true, type: { name: "String" } }, fullName: { - readOnly: true, serializedName: "fullName", + readOnly: true, type: { name: "String" } @@ -1068,44 +906,51 @@ export const MessagingRegionsProperties: msRest.CompositeMapper = { } }; -export const MessagingRegions: msRest.CompositeMapper = { - serializedName: "MessagingRegions", +export const TrackedResource: coreClient.CompositeMapper = { type: { name: "Composite", - className: "MessagingRegions", + className: "TrackedResource", modelProperties: { - ...TrackedResource.type.modelProperties, - properties: { - serializedName: "properties", + ...Resource.type.modelProperties, + location: { + serializedName: "location", type: { - name: "Composite", - className: "MessagingRegionsProperties" + name: "String" + } + }, + tags: { + serializedName: "tags", + type: { + name: "Dictionary", + value: { type: { name: "String" } } } } } } }; -export const ClusterListResult: msRest.CompositeMapper = { - serializedName: "ClusterListResult", +export const PrivateEndpointConnection: coreClient.CompositeMapper = { type: { name: "Composite", - className: "ClusterListResult", + className: "PrivateEndpointConnection", modelProperties: { - value: { - serializedName: "", + ...Resource.type.modelProperties, + privateEndpoint: { + serializedName: "properties.privateEndpoint", type: { - name: "Sequence", - element: { - type: { - name: "Composite", - className: "Cluster" - } - } + name: "Composite", + className: "PrivateEndpoint" } }, - nextLink: { - serializedName: "nextLink", + privateLinkServiceConnectionState: { + serializedName: "properties.privateLinkServiceConnectionState", + type: { + name: "Composite", + className: "ConnectionState" + } + }, + provisioningState: { + serializedName: "properties.provisioningState", type: { name: "String" } @@ -1114,54 +959,49 @@ export const ClusterListResult: msRest.CompositeMapper = { } }; -export const EHNamespaceListResult: msRest.CompositeMapper = { - serializedName: "EHNamespaceListResult", +export const AuthorizationRule: coreClient.CompositeMapper = { type: { name: "Composite", - className: "EHNamespaceListResult", + className: "AuthorizationRule", modelProperties: { - value: { - serializedName: "", + ...Resource.type.modelProperties, + rights: { + serializedName: "properties.rights", type: { name: "Sequence", element: { type: { - name: "Composite", - className: "EHNamespace" + name: "String" } } } - }, - nextLink: { - serializedName: "nextLink", - type: { - name: "String" - } } } } }; -export const AuthorizationRuleListResult: msRest.CompositeMapper = { - serializedName: "AuthorizationRuleListResult", +export const ConsumerGroup: coreClient.CompositeMapper = { type: { name: "Composite", - className: "AuthorizationRuleListResult", + className: "ConsumerGroup", modelProperties: { - value: { - serializedName: "", + ...Resource.type.modelProperties, + createdAt: { + serializedName: "properties.createdAt", + readOnly: true, type: { - name: "Sequence", - element: { - type: { - name: "Composite", - className: "AuthorizationRule" - } - } + name: "DateTime" } }, - nextLink: { - serializedName: "nextLink", + updatedAt: { + serializedName: "properties.updatedAt", + readOnly: true, + type: { + name: "DateTime" + } + }, + userMetadata: { + serializedName: "properties.userMetadata", type: { name: "String" } @@ -1170,82 +1010,121 @@ export const AuthorizationRuleListResult: msRest.CompositeMapper = { } }; -export const PrivateEndpointConnectionListResult: msRest.CompositeMapper = { - serializedName: "PrivateEndpointConnectionListResult", +export const Eventhub: coreClient.CompositeMapper = { type: { name: "Composite", - className: "PrivateEndpointConnectionListResult", + className: "Eventhub", modelProperties: { - value: { - serializedName: "", + ...Resource.type.modelProperties, + partitionIds: { + serializedName: "properties.partitionIds", + readOnly: true, type: { name: "Sequence", element: { type: { - name: "Composite", - className: "PrivateEndpointConnection" + name: "String" } } } }, - nextLink: { - serializedName: "nextLink", + createdAt: { + serializedName: "properties.createdAt", + readOnly: true, type: { - name: "String" + name: "DateTime" + } + }, + updatedAt: { + serializedName: "properties.updatedAt", + readOnly: true, + type: { + name: "DateTime" + } + }, + messageRetentionInDays: { + constraints: { + InclusiveMinimum: 1 + }, + serializedName: "properties.messageRetentionInDays", + type: { + name: "Number" + } + }, + partitionCount: { + constraints: { + InclusiveMinimum: 1 + }, + serializedName: "properties.partitionCount", + type: { + name: "Number" + } + }, + status: { + serializedName: "properties.status", + type: { + name: "Enum", + allowedValues: [ + "Active", + "Disabled", + "Restoring", + "SendDisabled", + "ReceiveDisabled", + "Creating", + "Deleting", + "Renaming", + "Unknown" + ] + } + }, + captureDescription: { + serializedName: "properties.captureDescription", + type: { + name: "Composite", + className: "CaptureDescription" } } } } }; -export const EventHubListResult: msRest.CompositeMapper = { - serializedName: "EventHubListResult", +export const Cluster: coreClient.CompositeMapper = { type: { name: "Composite", - className: "EventHubListResult", + className: "Cluster", modelProperties: { - value: { - serializedName: "", + ...TrackedResource.type.modelProperties, + sku: { + serializedName: "sku", type: { - name: "Sequence", - element: { - type: { - name: "Composite", - className: "Eventhub" - } - } + name: "Composite", + className: "ClusterSku" } }, - nextLink: { - serializedName: "nextLink", + createdAt: { + serializedName: "properties.createdAt", + readOnly: true, type: { name: "String" } - } - } - } -}; - -export const ConsumerGroupListResult: msRest.CompositeMapper = { - serializedName: "ConsumerGroupListResult", - type: { - name: "Composite", - className: "ConsumerGroupListResult", - modelProperties: { - value: { - serializedName: "", + }, + updatedAt: { + serializedName: "properties.updatedAt", + readOnly: true, type: { - name: "Sequence", - element: { - type: { - name: "Composite", - className: "ConsumerGroup" - } - } + name: "String" } }, - nextLink: { - serializedName: "nextLink", + metricId: { + serializedName: "properties.metricId", + readOnly: true, + type: { + name: "String" + } + }, + status: { + serializedName: "properties.status", + readOnly: true, type: { name: "String" } @@ -1254,59 +1133,124 @@ export const ConsumerGroupListResult: msRest.CompositeMapper = { } }; -export const OperationListResult: msRest.CompositeMapper = { - serializedName: "OperationListResult", +export const EHNamespace: coreClient.CompositeMapper = { type: { name: "Composite", - className: "OperationListResult", + className: "EHNamespace", modelProperties: { - value: { + ...TrackedResource.type.modelProperties, + sku: { + serializedName: "sku", + type: { + name: "Composite", + className: "Sku" + } + }, + identity: { + serializedName: "identity", + type: { + name: "Composite", + className: "Identity" + } + }, + provisioningState: { + serializedName: "properties.provisioningState", readOnly: true, - serializedName: "", type: { - name: "Sequence", - element: { - type: { - name: "Composite", - className: "Operation" - } - } + name: "String" } }, - nextLink: { + status: { + serializedName: "properties.status", readOnly: true, - serializedName: "nextLink", type: { name: "String" } + }, + createdAt: { + serializedName: "properties.createdAt", + readOnly: true, + type: { + name: "DateTime" + } + }, + updatedAt: { + serializedName: "properties.updatedAt", + readOnly: true, + type: { + name: "DateTime" + } + }, + serviceBusEndpoint: { + serializedName: "properties.serviceBusEndpoint", + readOnly: true, + type: { + name: "String" + } + }, + clusterArmId: { + serializedName: "properties.clusterArmId", + type: { + name: "String" + } + }, + metricId: { + serializedName: "properties.metricId", + readOnly: true, + type: { + name: "String" + } + }, + isAutoInflateEnabled: { + serializedName: "properties.isAutoInflateEnabled", + type: { + name: "Boolean" + } + }, + maximumThroughputUnits: { + constraints: { + InclusiveMaximum: 20, + InclusiveMinimum: 0 + }, + serializedName: "properties.maximumThroughputUnits", + type: { + name: "Number" + } + }, + kafkaEnabled: { + serializedName: "properties.kafkaEnabled", + type: { + name: "Boolean" + } + }, + zoneRedundant: { + serializedName: "properties.zoneRedundant", + type: { + name: "Boolean" + } + }, + encryption: { + serializedName: "properties.encryption", + type: { + name: "Composite", + className: "Encryption" + } } } } }; -export const MessagingRegionsListResult: msRest.CompositeMapper = { - serializedName: "MessagingRegionsListResult", +export const MessagingRegions: coreClient.CompositeMapper = { type: { name: "Composite", - className: "MessagingRegionsListResult", + className: "MessagingRegions", modelProperties: { - value: { - serializedName: "", - type: { - name: "Sequence", - element: { - type: { - name: "Composite", - className: "MessagingRegions" - } - } - } - }, - nextLink: { - readOnly: true, - serializedName: "nextLink", + ...TrackedResource.type.modelProperties, + properties: { + serializedName: "properties", type: { - name: "String" + name: "Composite", + className: "MessagingRegionsProperties" } } } diff --git a/sdk/eventhub/arm-eventhub-profile-2020-09-01-hybrid/src/models/namespacesMappers.ts b/sdk/eventhub/arm-eventhub-profile-2020-09-01-hybrid/src/models/namespacesMappers.ts deleted file mode 100644 index ddf036b210d0..000000000000 --- a/sdk/eventhub/arm-eventhub-profile-2020-09-01-hybrid/src/models/namespacesMappers.ts +++ /dev/null @@ -1,37 +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 { - AccessKeys, - AuthorizationRule, - AuthorizationRuleListResult, - BaseResource, - CaptureDescription, - CheckNameAvailabilityParameter, - CheckNameAvailabilityResult, - Cluster, - ClusterSku, - ConnectionState, - ConsumerGroup, - Destination, - EHNamespace, - EHNamespaceListResult, - Encryption, - ErrorResponse, - Eventhub, - Identity, - KeyVaultProperties, - MessagingRegions, - MessagingRegionsProperties, - PrivateEndpoint, - PrivateEndpointConnection, - RegenerateAccessKeyParameters, - Resource, - Sku, - TrackedResource -} from "../models/mappers"; diff --git a/sdk/eventhub/arm-eventhub-profile-2020-09-01-hybrid/src/models/operationsMappers.ts b/sdk/eventhub/arm-eventhub-profile-2020-09-01-hybrid/src/models/operationsMappers.ts deleted file mode 100644 index b8de8606cf9d..000000000000 --- a/sdk/eventhub/arm-eventhub-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 { - ErrorResponse, - Operation, - OperationDisplay, - OperationListResult -} from "../models/mappers"; diff --git a/sdk/eventhub/arm-eventhub-profile-2020-09-01-hybrid/src/models/parameters.ts b/sdk/eventhub/arm-eventhub-profile-2020-09-01-hybrid/src/models/parameters.ts index e66ec5d57f31..737a6a17f6b2 100644 --- a/sdk/eventhub/arm-eventhub-profile-2020-09-01-hybrid/src/models/parameters.ts +++ b/sdk/eventhub/arm-eventhub-profile-2020-09-01-hybrid/src/models/parameters.ts @@ -1,220 +1,304 @@ /* - * 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 { + Cluster as ClusterMapper, + EHNamespace as EHNamespaceMapper, + AuthorizationRule as AuthorizationRuleMapper, + RegenerateAccessKeyParameters as RegenerateAccessKeyParametersMapper, + CheckNameAvailabilityParameter as CheckNameAvailabilityParameterMapper, + PrivateEndpointConnection as PrivateEndpointConnectionMapper, + Eventhub as EventhubMapper, + ConsumerGroup as ConsumerGroupMapper +} 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 alias: msRest.OperationURLParameter = { - parameterPath: "alias", + +export const $host: OperationURLParameter = { + parameterPath: "$host", mapper: { + serializedName: "$host", required: true, - serializedName: "alias", - constraints: { - MaxLength: 50, - MinLength: 1 - }, type: { name: "String" } - } + }, + skipEncoding: true }; -export const apiVersion0: msRest.OperationQueryParameter = { - parameterPath: "apiVersion", + +export const subscriptionId: OperationURLParameter = { + parameterPath: "subscriptionId", mapper: { + serializedName: "subscriptionId", required: true, - isConstant: true, - serializedName: "api-version", - defaultValue: '2018-01-01-preview', type: { name: "String" } } }; -export const apiVersion1: msRest.OperationQueryParameter = { + +export const apiVersion: OperationQueryParameter = { parameterPath: "apiVersion", mapper: { - required: true, + defaultValue: "2018-01-01-preview", isConstant: true, serializedName: "api-version", - defaultValue: '2017-04-01', type: { name: "String" } } }; -export const authorizationRuleName: msRest.OperationURLParameter = { - parameterPath: "authorizationRuleName", + +export const resourceGroupName: OperationURLParameter = { + parameterPath: "resourceGroupName", mapper: { - required: true, - serializedName: "authorizationRuleName", constraints: { + MaxLength: 90, MinLength: 1 }, + serializedName: "resourceGroupName", + required: true, type: { name: "String" } } }; -export const clusterName: msRest.OperationURLParameter = { + +export const clusterName: OperationURLParameter = { parameterPath: "clusterName", mapper: { - required: true, - serializedName: "clusterName", constraints: { MaxLength: 50, MinLength: 6 }, + serializedName: "clusterName", + required: true, type: { name: "String" } } }; -export const consumerGroupName: msRest.OperationURLParameter = { - parameterPath: "consumerGroupName", + +export const contentType: OperationParameter = { + parameterPath: ["options", "contentType"], mapper: { - required: true, - serializedName: "consumerGroupName", - constraints: { - MaxLength: 50, - MinLength: 1 - }, + defaultValue: "application/json", + isConstant: true, + serializedName: "Content-Type", type: { name: "String" } } }; -export const eventHubName: msRest.OperationURLParameter = { - parameterPath: "eventHubName", + +export const parameters: OperationParameter = { + parameterPath: "parameters", + mapper: ClusterMapper +}; + +export const nextLink: OperationURLParameter = { + parameterPath: "nextLink", mapper: { + serializedName: "nextLink", required: true, - serializedName: "eventHubName", - constraints: { - MaxLength: 256, - MinLength: 1 - }, type: { name: "String" } - } + }, + skipEncoding: true +}; + +export const parameters1: OperationParameter = { + parameterPath: "parameters", + mapper: EHNamespaceMapper }; -export const namespaceName: msRest.OperationURLParameter = { + +export const namespaceName: OperationURLParameter = { parameterPath: "namespaceName", mapper: { - required: true, - serializedName: "namespaceName", constraints: { MaxLength: 50, MinLength: 6 }, + serializedName: "namespaceName", + required: true, type: { name: "String" } } }; -export const nextPageLink: msRest.OperationURLParameter = { - parameterPath: "nextPageLink", + +export const apiVersion1: OperationQueryParameter = { + parameterPath: "apiVersion", mapper: { + defaultValue: "2017-04-01", + isConstant: true, + serializedName: "api-version", + type: { + name: "String" + } + } +}; + +export const parameters2: OperationParameter = { + parameterPath: "parameters", + mapper: AuthorizationRuleMapper +}; + +export const authorizationRuleName: OperationURLParameter = { + parameterPath: "authorizationRuleName", + mapper: { + constraints: { + MinLength: 1 + }, + serializedName: "authorizationRuleName", required: true, - serializedName: "nextLink", type: { name: "String" } - }, - skipEncoding: true + } }; -export const privateEndpointConnectionName: msRest.OperationURLParameter = { + +export const parameters3: OperationParameter = { + parameterPath: "parameters", + mapper: RegenerateAccessKeyParametersMapper +}; + +export const parameters4: OperationParameter = { + parameterPath: "parameters", + mapper: CheckNameAvailabilityParameterMapper +}; + +export const parameters5: OperationParameter = { + parameterPath: "parameters", + mapper: PrivateEndpointConnectionMapper +}; + +export const privateEndpointConnectionName: OperationURLParameter = { parameterPath: "privateEndpointConnectionName", mapper: { - required: true, serializedName: "privateEndpointConnectionName", + required: true, type: { name: "String" } } }; -export const resourceGroupName: msRest.OperationURLParameter = { - parameterPath: "resourceGroupName", + +export const alias: OperationURLParameter = { + parameterPath: "alias", mapper: { + constraints: { + MaxLength: 50, + MinLength: 1 + }, + serializedName: "alias", required: true, - serializedName: "resourceGroupName", + type: { + name: "String" + } + } +}; + +export const eventHubName: OperationURLParameter = { + parameterPath: "eventHubName", + mapper: { constraints: { - MaxLength: 90, + MaxLength: 256, MinLength: 1 }, + serializedName: "eventHubName", + required: true, type: { name: "String" } } }; -export const skip: msRest.OperationQueryParameter = { - parameterPath: [ - "options", - "skip" - ], + +export const skip: OperationQueryParameter = { + parameterPath: ["options", "skip"], mapper: { - serializedName: "$skip", constraints: { InclusiveMaximum: 1000, InclusiveMinimum: 0 }, + serializedName: "$skip", type: { name: "Number" } } }; -export const sku: msRest.OperationURLParameter = { - parameterPath: "sku", + +export const top: OperationQueryParameter = { + parameterPath: ["options", "top"], mapper: { - required: true, - serializedName: "sku", constraints: { - MaxLength: 50, - MinLength: 1 + InclusiveMaximum: 1000, + InclusiveMinimum: 1 }, + serializedName: "$top", type: { - name: "String" + name: "Number" } } }; -export const subscriptionId: msRest.OperationURLParameter = { - parameterPath: "subscriptionId", + +export const parameters6: OperationParameter = { + parameterPath: "parameters", + mapper: EventhubMapper +}; + +export const parameters7: OperationParameter = { + parameterPath: "parameters", + mapper: ConsumerGroupMapper +}; + +export const consumerGroupName: OperationURLParameter = { + parameterPath: "consumerGroupName", mapper: { + constraints: { + MaxLength: 50, + MinLength: 1 + }, + serializedName: "consumerGroupName", required: true, - serializedName: "subscriptionId", type: { name: "String" } } }; -export const top: msRest.OperationQueryParameter = { - parameterPath: [ - "options", - "top" - ], + +export const sku: OperationURLParameter = { + parameterPath: "sku", mapper: { - serializedName: "$top", constraints: { - InclusiveMaximum: 1000, - InclusiveMinimum: 1 + MaxLength: 50, + MinLength: 1 }, + serializedName: "sku", + required: true, type: { - name: "Number" + name: "String" } } }; diff --git a/sdk/eventhub/arm-eventhub-profile-2020-09-01-hybrid/src/models/privateEndpointConnectionsMappers.ts b/sdk/eventhub/arm-eventhub-profile-2020-09-01-hybrid/src/models/privateEndpointConnectionsMappers.ts deleted file mode 100644 index 2bfa415b947a..000000000000 --- a/sdk/eventhub/arm-eventhub-profile-2020-09-01-hybrid/src/models/privateEndpointConnectionsMappers.ts +++ /dev/null @@ -1,32 +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 { - AuthorizationRule, - BaseResource, - CaptureDescription, - Cluster, - ClusterSku, - ConnectionState, - ConsumerGroup, - Destination, - EHNamespace, - Encryption, - ErrorResponse, - Eventhub, - Identity, - KeyVaultProperties, - MessagingRegions, - MessagingRegionsProperties, - PrivateEndpoint, - PrivateEndpointConnection, - PrivateEndpointConnectionListResult, - Resource, - Sku, - TrackedResource -} from "../models/mappers"; diff --git a/sdk/eventhub/arm-eventhub-profile-2020-09-01-hybrid/src/models/privateLinkResourcesMappers.ts b/sdk/eventhub/arm-eventhub-profile-2020-09-01-hybrid/src/models/privateLinkResourcesMappers.ts deleted file mode 100644 index abbf6824dd8c..000000000000 --- a/sdk/eventhub/arm-eventhub-profile-2020-09-01-hybrid/src/models/privateLinkResourcesMappers.ts +++ /dev/null @@ -1,13 +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 { - ErrorResponse, - PrivateLinkResource, - PrivateLinkResourcesListResult -} from "../models/mappers"; diff --git a/sdk/eventhub/arm-eventhub-profile-2020-09-01-hybrid/src/models/regionsMappers.ts b/sdk/eventhub/arm-eventhub-profile-2020-09-01-hybrid/src/models/regionsMappers.ts deleted file mode 100644 index 10382769d738..000000000000 --- a/sdk/eventhub/arm-eventhub-profile-2020-09-01-hybrid/src/models/regionsMappers.ts +++ /dev/null @@ -1,32 +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 { - AuthorizationRule, - BaseResource, - CaptureDescription, - Cluster, - ClusterSku, - ConnectionState, - ConsumerGroup, - Destination, - EHNamespace, - Encryption, - ErrorResponse, - Eventhub, - Identity, - KeyVaultProperties, - MessagingRegions, - MessagingRegionsListResult, - MessagingRegionsProperties, - PrivateEndpoint, - PrivateEndpointConnection, - Resource, - Sku, - TrackedResource -} from "../models/mappers"; diff --git a/sdk/eventhub/arm-eventhub-profile-2020-09-01-hybrid/src/operations/clusters.ts b/sdk/eventhub/arm-eventhub-profile-2020-09-01-hybrid/src/operations/clusters.ts index e2f4cc1679fe..ec3b8d8c0b37 100644 --- a/sdk/eventhub/arm-eventhub-profile-2020-09-01-hybrid/src/operations/clusters.ts +++ b/sdk/eventhub/arm-eventhub-profile-2020-09-01-hybrid/src/operations/clusters.ts @@ -1,114 +1,147 @@ /* - * 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/clustersMappers"; +import { PagedAsyncIterableIterator } from "@azure/core-paging"; +import { Clusters } from "../operationsInterfaces"; +import * as coreClient from "@azure/core-client"; +import * as Mappers from "../models/mappers"; import * as Parameters from "../models/parameters"; -import { EventHubManagementClientContext } from "../eventHubManagementClientContext"; +import { EventHubManagementClient } from "../eventHubManagementClient"; +import { PollerLike, PollOperationState, LroEngine } from "@azure/core-lro"; +import { LroImpl } from "../lroImpl"; +import { + Cluster, + ClustersListByResourceGroupNextOptionalParams, + ClustersListByResourceGroupOptionalParams, + ClustersListAvailableClusterRegionOptionalParams, + ClustersListAvailableClusterRegionResponse, + ClustersListByResourceGroupResponse, + ClustersGetOptionalParams, + ClustersGetResponse, + ClustersCreateOrUpdateOptionalParams, + ClustersCreateOrUpdateResponse, + ClustersUpdateOptionalParams, + ClustersUpdateResponse, + ClustersDeleteOptionalParams, + ClustersListNamespacesOptionalParams, + ClustersListNamespacesResponse, + ClustersListByResourceGroupNextResponse +} from "../models"; -/** Class representing a Clusters. */ -export class Clusters { - private readonly client: EventHubManagementClientContext; +/// +/** Class containing Clusters operations. */ +export class ClustersImpl implements Clusters { + private readonly client: EventHubManagementClient; /** - * Create a Clusters. - * @param {EventHubManagementClientContext} client Reference to the service client. + * Initialize a new instance of the class Clusters class. + * @param client Reference to the service client */ - constructor(client: EventHubManagementClientContext) { + constructor(client: EventHubManagementClient) { this.client = client; } /** - * List the quantity of available pre-provisioned Event Hubs Clusters, indexed by Azure region. - * @param [options] The optional parameters - * @returns Promise - */ - listAvailableClusterRegion(options?: msRest.RequestOptionsBase): Promise; - /** - * @param callback The callback + * Lists the available Event Hubs Clusters within an ARM resource group + * @param resourceGroupName Name of the resource group within the azure subscription. + * @param options The options parameters. */ - listAvailableClusterRegion(callback: msRest.ServiceCallback): void; + public listByResourceGroup( + resourceGroupName: string, + options?: ClustersListByResourceGroupOptionalParams + ): 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?: ClustersListByResourceGroupOptionalParams + ): 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?: ClustersListByResourceGroupOptionalParams + ): AsyncIterableIterator { + for await (const page of this.listByResourceGroupPagingPage( + resourceGroupName, + options + )) { + yield* page; + } + } + /** - * @param options The optional parameters - * @param callback The callback + * List the quantity of available pre-provisioned Event Hubs Clusters, indexed by Azure region. + * @param options The options parameters. */ - listAvailableClusterRegion(options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; - listAvailableClusterRegion(options?: msRest.RequestOptionsBase | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { + listAvailableClusterRegion( + options?: ClustersListAvailableClusterRegionOptionalParams + ): Promise { return this.client.sendOperationRequest( - { - options - }, - listAvailableClusterRegionOperationSpec, - callback) as Promise; + { options }, + listAvailableClusterRegionOperationSpec + ); } /** * Lists the available Event Hubs Clusters within an ARM resource group * @param resourceGroupName Name of the resource group within the azure subscription. - * @param [options] The optional parameters - * @returns Promise - */ - listByResourceGroup(resourceGroupName: string, options?: msRest.RequestOptionsBase): Promise; - /** - * @param resourceGroupName Name of the resource group within the azure subscription. - * @param callback The callback - */ - listByResourceGroup(resourceGroupName: string, callback: msRest.ServiceCallback): void; - /** - * @param resourceGroupName Name of the resource group within the azure subscription. - * @param options The optional parameters - * @param callback The callback + * @param options The options parameters. */ - listByResourceGroup(resourceGroupName: string, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; - listByResourceGroup(resourceGroupName: string, options?: msRest.RequestOptionsBase | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { + private _listByResourceGroup( + resourceGroupName: string, + options?: ClustersListByResourceGroupOptionalParams + ): Promise { return this.client.sendOperationRequest( - { - resourceGroupName, - options - }, - listByResourceGroupOperationSpec, - callback) as Promise; + { resourceGroupName, options }, + listByResourceGroupOperationSpec + ); } /** * Gets the resource description of the specified Event Hubs Cluster. * @param resourceGroupName Name of the resource group within the azure subscription. * @param clusterName The name of the Event Hubs Cluster. - * @param [options] The optional parameters - * @returns Promise + * @param options The options parameters. */ - get(resourceGroupName: string, clusterName: string, options?: msRest.RequestOptionsBase): Promise; - /** - * @param resourceGroupName Name of the resource group within the azure subscription. - * @param clusterName The name of the Event Hubs Cluster. - * @param callback The callback - */ - get(resourceGroupName: string, clusterName: string, callback: msRest.ServiceCallback): void; - /** - * @param resourceGroupName Name of the resource group within the azure subscription. - * @param clusterName The name of the Event Hubs Cluster. - * @param options The optional parameters - * @param callback The callback - */ - get(resourceGroupName: string, clusterName: string, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; - get(resourceGroupName: string, clusterName: string, options?: msRest.RequestOptionsBase | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { + get( + resourceGroupName: string, + clusterName: string, + options?: ClustersGetOptionalParams + ): Promise { return this.client.sendOperationRequest( - { - resourceGroupName, - clusterName, - options - }, - getOperationSpec, - callback) as Promise; + { resourceGroupName, clusterName, options }, + getOperationSpec + ); } /** @@ -116,172 +149,302 @@ export class Clusters { * @param resourceGroupName Name of the resource group within the azure subscription. * @param clusterName The name of the Event Hubs Cluster. * @param parameters Parameters for creating a eventhub cluster resource. - * @param [options] The optional parameters - * @returns Promise + * @param options The options parameters. */ - createOrUpdate(resourceGroupName: string, clusterName: string, parameters: Models.Cluster, options?: msRest.RequestOptionsBase): Promise { - return this.beginCreateOrUpdate(resourceGroupName,clusterName,parameters,options) - .then(lroPoller => lroPoller.pollUntilFinished()) as Promise; + async beginCreateOrUpdate( + resourceGroupName: string, + clusterName: string, + parameters: Cluster, + options?: ClustersCreateOrUpdateOptionalParams + ): Promise< + PollerLike< + PollOperationState, + ClustersCreateOrUpdateResponse + > + > { + 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, clusterName, parameters, options }, + createOrUpdateOperationSpec + ); + return new LroEngine(lro, { + resumeFrom: options?.resumeFrom, + intervalInMs: options?.updateIntervalInMs + }); } /** - * Modifies mutable properties on the Event Hubs Cluster. This operation is idempotent. + * Creates or updates an instance of an Event Hubs Cluster. * @param resourceGroupName Name of the resource group within the azure subscription. * @param clusterName The name of the Event Hubs Cluster. - * @param parameters The properties of the Event Hubs Cluster which should be updated. - * @param [options] The optional parameters - * @returns Promise + * @param parameters Parameters for creating a eventhub cluster resource. + * @param options The options parameters. */ - update(resourceGroupName: string, clusterName: string, parameters: Models.Cluster, options?: msRest.RequestOptionsBase): Promise { - return this.beginUpdate(resourceGroupName,clusterName,parameters,options) - .then(lroPoller => lroPoller.pollUntilFinished()) as Promise; + async beginCreateOrUpdateAndWait( + resourceGroupName: string, + clusterName: string, + parameters: Cluster, + options?: ClustersCreateOrUpdateOptionalParams + ): Promise { + const poller = await this.beginCreateOrUpdate( + resourceGroupName, + clusterName, + parameters, + options + ); + return poller.pollUntilDone(); } /** - * Deletes an existing Event Hubs Cluster. This operation is idempotent. + * Modifies mutable properties on the Event Hubs Cluster. This operation is idempotent. * @param resourceGroupName Name of the resource group within the azure subscription. * @param clusterName The name of the Event Hubs Cluster. - * @param [options] The optional parameters - * @returns Promise + * @param parameters The properties of the Event Hubs Cluster which should be updated. + * @param options The options parameters. */ - deleteMethod(resourceGroupName: string, clusterName: string, options?: msRest.RequestOptionsBase): Promise { - return this.beginDeleteMethod(resourceGroupName,clusterName,options) - .then(lroPoller => lroPoller.pollUntilFinished()); + async beginUpdate( + resourceGroupName: string, + clusterName: string, + parameters: Cluster, + options?: ClustersUpdateOptionalParams + ): Promise< + PollerLike< + PollOperationState, + ClustersUpdateResponse + > + > { + 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, clusterName, parameters, options }, + updateOperationSpec + ); + return new LroEngine(lro, { + resumeFrom: options?.resumeFrom, + intervalInMs: options?.updateIntervalInMs + }); } /** - * List all Event Hubs Namespace IDs in an Event Hubs Dedicated Cluster. - * @param resourceGroupName Name of the resource group within the azure subscription. - * @param clusterName The name of the Event Hubs Cluster. - * @param [options] The optional parameters - * @returns Promise - */ - listNamespaces(resourceGroupName: string, clusterName: string, options?: msRest.RequestOptionsBase): Promise; - /** - * @param resourceGroupName Name of the resource group within the azure subscription. - * @param clusterName The name of the Event Hubs Cluster. - * @param callback The callback - */ - listNamespaces(resourceGroupName: string, clusterName: string, callback: msRest.ServiceCallback): void; - /** + * Modifies mutable properties on the Event Hubs Cluster. This operation is idempotent. * @param resourceGroupName Name of the resource group within the azure subscription. * @param clusterName The name of the Event Hubs Cluster. - * @param options The optional parameters - * @param callback The callback + * @param parameters The properties of the Event Hubs Cluster which should be updated. + * @param options The options parameters. */ - listNamespaces(resourceGroupName: string, clusterName: string, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; - listNamespaces(resourceGroupName: string, clusterName: string, options?: msRest.RequestOptionsBase | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { - return this.client.sendOperationRequest( - { - resourceGroupName, - clusterName, - options - }, - listNamespacesOperationSpec, - callback) as Promise; + async beginUpdateAndWait( + resourceGroupName: string, + clusterName: string, + parameters: Cluster, + options?: ClustersUpdateOptionalParams + ): Promise { + const poller = await this.beginUpdate( + resourceGroupName, + clusterName, + parameters, + options + ); + return poller.pollUntilDone(); } /** - * Creates or updates an instance of an Event Hubs Cluster. + * Deletes an existing Event Hubs Cluster. This operation is idempotent. * @param resourceGroupName Name of the resource group within the azure subscription. * @param clusterName The name of the Event Hubs Cluster. - * @param parameters Parameters for creating a eventhub cluster resource. - * @param [options] The optional parameters - * @returns Promise + * @param options The options parameters. */ - beginCreateOrUpdate(resourceGroupName: string, clusterName: string, parameters: Models.Cluster, options?: msRest.RequestOptionsBase): Promise { - return this.client.sendLRORequest( - { - resourceGroupName, - clusterName, - parameters, - options - }, - beginCreateOrUpdateOperationSpec, - options); + async beginDelete( + resourceGroupName: string, + clusterName: string, + options?: ClustersDeleteOptionalParams + ): Promise, void>> { + const directSendOperation = async ( + args: coreClient.OperationArguments, + spec: coreClient.OperationSpec + ): Promise => { + return this.client.sendOperationRequest(args, spec); + }; + const sendOperation = async ( + args: coreClient.OperationArguments, + spec: coreClient.OperationSpec + ) => { + let currentRawResponse: + | coreClient.FullOperationResponse + | undefined = undefined; + const providedCallback = args.options?.onResponse; + const callback: coreClient.RawResponseCallback = ( + rawResponse: coreClient.FullOperationResponse, + flatResponse: unknown + ) => { + currentRawResponse = rawResponse; + providedCallback?.(rawResponse, flatResponse); + }; + const updatedArgs = { + ...args, + options: { + ...args.options, + onResponse: callback + } + }; + const flatResponse = await directSendOperation(updatedArgs, spec); + return { + flatResponse, + rawResponse: { + statusCode: currentRawResponse!.status, + body: currentRawResponse!.parsedBody, + headers: currentRawResponse!.headers.toJSON() + } + }; + }; + + const lro = new LroImpl( + sendOperation, + { resourceGroupName, clusterName, options }, + deleteOperationSpec + ); + return new LroEngine(lro, { + resumeFrom: options?.resumeFrom, + intervalInMs: options?.updateIntervalInMs + }); } /** - * Modifies mutable properties on the Event Hubs Cluster. This operation is idempotent. + * Deletes an existing Event Hubs Cluster. This operation is idempotent. * @param resourceGroupName Name of the resource group within the azure subscription. * @param clusterName The name of the Event Hubs Cluster. - * @param parameters The properties of the Event Hubs Cluster which should be updated. - * @param [options] The optional parameters - * @returns Promise + * @param options The options parameters. */ - beginUpdate(resourceGroupName: string, clusterName: string, parameters: Models.Cluster, options?: msRest.RequestOptionsBase): Promise { - return this.client.sendLRORequest( - { - resourceGroupName, - clusterName, - parameters, - options - }, - beginUpdateOperationSpec, - options); + async beginDeleteAndWait( + resourceGroupName: string, + clusterName: string, + options?: ClustersDeleteOptionalParams + ): Promise { + const poller = await this.beginDelete( + resourceGroupName, + clusterName, + options + ); + return poller.pollUntilDone(); } /** - * Deletes an existing Event Hubs Cluster. This operation is idempotent. + * List all Event Hubs Namespace IDs in an Event Hubs Dedicated Cluster. * @param resourceGroupName Name of the resource group within the azure subscription. * @param clusterName The name of the Event Hubs Cluster. - * @param [options] The optional parameters - * @returns Promise + * @param options The options parameters. */ - beginDeleteMethod(resourceGroupName: string, clusterName: string, options?: msRest.RequestOptionsBase): Promise { - return this.client.sendLRORequest( - { - resourceGroupName, - clusterName, - options - }, - beginDeleteMethodOperationSpec, - options); + listNamespaces( + resourceGroupName: string, + clusterName: string, + options?: ClustersListNamespacesOptionalParams + ): Promise { + return this.client.sendOperationRequest( + { resourceGroupName, clusterName, options }, + listNamespacesOperationSpec + ); } /** - * Lists the available Event Hubs Clusters within an ARM resource group - * @param nextPageLink The NextLink from the previous successful call to List operation. - * @param [options] The optional parameters - * @returns Promise - */ - listByResourceGroupNext(nextPageLink: string, options?: msRest.RequestOptionsBase): Promise; - /** - * @param nextPageLink The NextLink from the previous successful call to List operation. - * @param callback The callback - */ - listByResourceGroupNext(nextPageLink: string, callback: msRest.ServiceCallback): void; - /** - * @param nextPageLink The NextLink from the previous successful call to List operation. - * @param options The optional parameters - * @param callback The callback + * ListByResourceGroupNext + * @param resourceGroupName Name of the resource group within the azure subscription. + * @param nextLink The nextLink from the previous successful call to the ListByResourceGroup method. + * @param options The options parameters. */ - listByResourceGroupNext(nextPageLink: string, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; - listByResourceGroupNext(nextPageLink: string, options?: msRest.RequestOptionsBase | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { + private _listByResourceGroupNext( + resourceGroupName: string, + nextLink: string, + options?: ClustersListByResourceGroupNextOptionalParams + ): Promise { return this.client.sendOperationRequest( - { - nextPageLink, - options - }, - listByResourceGroupNextOperationSpec, - callback) as Promise; + { resourceGroupName, nextLink, options }, + listByResourceGroupNextOperationSpec + ); } } - // Operation Specifications -const serializer = new msRest.Serializer(Mappers); -const listAvailableClusterRegionOperationSpec: msRest.OperationSpec = { +const serializer = coreClient.createSerializer(Mappers, /* isXml */ false); + +const listAvailableClusterRegionOperationSpec: coreClient.OperationSpec = { + path: + "/subscriptions/{subscriptionId}/providers/Microsoft.EventHub/availableClusterRegions", httpMethod: "GET", - path: "subscriptions/{subscriptionId}/providers/Microsoft.EventHub/availableClusterRegions", - urlParameters: [ - Parameters.subscriptionId - ], - queryParameters: [ - Parameters.apiVersion0 - ], - headerParameters: [ - Parameters.acceptLanguage - ], responses: { 200: { bodyMapper: Mappers.AvailableClustersList @@ -290,22 +453,15 @@ const listAvailableClusterRegionOperationSpec: msRest.OperationSpec = { bodyMapper: Mappers.ErrorResponse } }, + queryParameters: [Parameters.apiVersion], + urlParameters: [Parameters.$host, Parameters.subscriptionId], + headerParameters: [Parameters.accept], serializer }; - -const listByResourceGroupOperationSpec: msRest.OperationSpec = { +const listByResourceGroupOperationSpec: coreClient.OperationSpec = { + path: + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventHub/clusters", httpMethod: "GET", - path: "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventHub/clusters", - urlParameters: [ - Parameters.subscriptionId, - Parameters.resourceGroupName - ], - queryParameters: [ - Parameters.apiVersion0 - ], - headerParameters: [ - Parameters.acceptLanguage - ], responses: { 200: { bodyMapper: Mappers.ClusterListResult @@ -314,23 +470,19 @@ const listByResourceGroupOperationSpec: msRest.OperationSpec = { bodyMapper: Mappers.ErrorResponse } }, - serializer -}; - -const getOperationSpec: msRest.OperationSpec = { - httpMethod: "GET", - path: "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventHub/clusters/{clusterName}", + queryParameters: [Parameters.apiVersion], urlParameters: [ + Parameters.$host, Parameters.subscriptionId, - Parameters.resourceGroupName, - Parameters.clusterName - ], - queryParameters: [ - Parameters.apiVersion0 - ], - headerParameters: [ - Parameters.acceptLanguage + Parameters.resourceGroupName ], + headerParameters: [Parameters.accept], + serializer +}; +const getOperationSpec: coreClient.OperationSpec = { + path: + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventHub/clusters/{clusterName}", + httpMethod: "GET", responses: { 200: { bodyMapper: Mappers.Cluster @@ -339,55 +491,20 @@ const getOperationSpec: msRest.OperationSpec = { bodyMapper: Mappers.ErrorResponse } }, - serializer -}; - -const listNamespacesOperationSpec: msRest.OperationSpec = { - httpMethod: "GET", - path: "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventHub/clusters/{clusterName}/namespaces", + queryParameters: [Parameters.apiVersion], urlParameters: [ + Parameters.$host, Parameters.subscriptionId, Parameters.resourceGroupName, Parameters.clusterName ], - queryParameters: [ - Parameters.apiVersion0 - ], - headerParameters: [ - Parameters.acceptLanguage - ], - responses: { - 200: { - bodyMapper: Mappers.EHNamespaceIdListResult - }, - default: { - bodyMapper: Mappers.ErrorResponse - } - }, + headerParameters: [Parameters.accept], serializer }; - -const beginCreateOrUpdateOperationSpec: msRest.OperationSpec = { +const createOrUpdateOperationSpec: coreClient.OperationSpec = { + path: + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventHub/clusters/{clusterName}", httpMethod: "PUT", - path: "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventHub/clusters/{clusterName}", - urlParameters: [ - Parameters.subscriptionId, - Parameters.resourceGroupName, - Parameters.clusterName - ], - queryParameters: [ - Parameters.apiVersion0 - ], - headerParameters: [ - Parameters.acceptLanguage - ], - requestBody: { - parameterPath: "parameters", - mapper: { - ...Mappers.Cluster, - required: true - } - }, responses: { 200: { bodyMapper: Mappers.Cluster @@ -395,35 +512,32 @@ const beginCreateOrUpdateOperationSpec: msRest.OperationSpec = { 201: { bodyMapper: Mappers.Cluster }, - 202: {}, + 202: { + bodyMapper: Mappers.Cluster + }, + 204: { + bodyMapper: Mappers.Cluster + }, default: { bodyMapper: Mappers.ErrorResponse } }, - serializer -}; - -const beginUpdateOperationSpec: msRest.OperationSpec = { - httpMethod: "PATCH", - path: "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventHub/clusters/{clusterName}", + requestBody: Parameters.parameters, + queryParameters: [Parameters.apiVersion], urlParameters: [ + Parameters.$host, Parameters.subscriptionId, Parameters.resourceGroupName, Parameters.clusterName ], - queryParameters: [ - Parameters.apiVersion0 - ], - headerParameters: [ - Parameters.acceptLanguage - ], - requestBody: { - parameterPath: "parameters", - mapper: { - ...Mappers.Cluster, - required: true - } - }, + headerParameters: [Parameters.accept, Parameters.contentType], + mediaType: "json", + serializer +}; +const updateOperationSpec: coreClient.OperationSpec = { + path: + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventHub/clusters/{clusterName}", + httpMethod: "PATCH", responses: { 200: { bodyMapper: Mappers.Cluster @@ -431,49 +545,76 @@ const beginUpdateOperationSpec: msRest.OperationSpec = { 201: { bodyMapper: Mappers.Cluster }, - 202: {}, + 202: { + bodyMapper: Mappers.Cluster + }, + 204: { + bodyMapper: Mappers.Cluster + }, default: { bodyMapper: Mappers.ErrorResponse } }, - serializer -}; - -const beginDeleteMethodOperationSpec: msRest.OperationSpec = { - httpMethod: "DELETE", - path: "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventHub/clusters/{clusterName}", + requestBody: Parameters.parameters, + queryParameters: [Parameters.apiVersion], urlParameters: [ + Parameters.$host, Parameters.subscriptionId, Parameters.resourceGroupName, Parameters.clusterName ], - queryParameters: [ - Parameters.apiVersion0 - ], - headerParameters: [ - Parameters.acceptLanguage - ], + headerParameters: [Parameters.accept, Parameters.contentType], + mediaType: "json", + serializer +}; +const deleteOperationSpec: coreClient.OperationSpec = { + path: + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventHub/clusters/{clusterName}", + httpMethod: "DELETE", responses: { 200: {}, + 201: {}, 202: {}, 204: {}, default: { bodyMapper: Mappers.ErrorResponse } }, + queryParameters: [Parameters.apiVersion], + urlParameters: [ + Parameters.$host, + Parameters.subscriptionId, + Parameters.resourceGroupName, + Parameters.clusterName + ], + headerParameters: [Parameters.accept], serializer }; - -const listByResourceGroupNextOperationSpec: msRest.OperationSpec = { +const listNamespacesOperationSpec: coreClient.OperationSpec = { + path: + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventHub/clusters/{clusterName}/namespaces", httpMethod: "GET", - baseUrl: "https://management.azure.com", - path: "{nextLink}", + responses: { + 200: { + bodyMapper: Mappers.EHNamespaceIdListResult + }, + default: { + bodyMapper: Mappers.ErrorResponse + } + }, + queryParameters: [Parameters.apiVersion], urlParameters: [ - Parameters.nextPageLink - ], - headerParameters: [ - Parameters.acceptLanguage + Parameters.$host, + Parameters.subscriptionId, + Parameters.resourceGroupName, + Parameters.clusterName ], + headerParameters: [Parameters.accept], + serializer +}; +const listByResourceGroupNextOperationSpec: coreClient.OperationSpec = { + path: "{nextLink}", + httpMethod: "GET", responses: { 200: { bodyMapper: Mappers.ClusterListResult @@ -482,5 +623,13 @@ const listByResourceGroupNextOperationSpec: msRest.OperationSpec = { bodyMapper: Mappers.ErrorResponse } }, + queryParameters: [Parameters.apiVersion], + urlParameters: [ + Parameters.$host, + Parameters.subscriptionId, + Parameters.resourceGroupName, + Parameters.nextLink + ], + headerParameters: [Parameters.accept], serializer }; diff --git a/sdk/eventhub/arm-eventhub-profile-2020-09-01-hybrid/src/operations/consumerGroups.ts b/sdk/eventhub/arm-eventhub-profile-2020-09-01-hybrid/src/operations/consumerGroups.ts index 51f097f7b0cb..60f1c7d0be1d 100644 --- a/sdk/eventhub/arm-eventhub-profile-2020-09-01-hybrid/src/operations/consumerGroups.ts +++ b/sdk/eventhub/arm-eventhub-profile-2020-09-01-hybrid/src/operations/consumerGroups.ts @@ -1,62 +1,141 @@ /* - * 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/consumerGroupsMappers"; +import { PagedAsyncIterableIterator } from "@azure/core-paging"; +import { ConsumerGroups } from "../operationsInterfaces"; +import * as coreClient from "@azure/core-client"; +import * as Mappers from "../models/mappers"; import * as Parameters from "../models/parameters"; -import { EventHubManagementClientContext } from "../eventHubManagementClientContext"; +import { EventHubManagementClient } from "../eventHubManagementClient"; +import { + ConsumerGroup, + ConsumerGroupsListByEventHubNextOptionalParams, + ConsumerGroupsListByEventHubOptionalParams, + ConsumerGroupsCreateOrUpdateOptionalParams, + ConsumerGroupsCreateOrUpdateResponse, + ConsumerGroupsDeleteOptionalParams, + ConsumerGroupsGetOptionalParams, + ConsumerGroupsGetResponse, + ConsumerGroupsListByEventHubResponse, + ConsumerGroupsListByEventHubNextResponse +} from "../models"; -/** Class representing a ConsumerGroups. */ -export class ConsumerGroups { - private readonly client: EventHubManagementClientContext; +/// +/** Class containing ConsumerGroups operations. */ +export class ConsumerGroupsImpl implements ConsumerGroups { + private readonly client: EventHubManagementClient; /** - * Create a ConsumerGroups. - * @param {EventHubManagementClientContext} client Reference to the service client. + * Initialize a new instance of the class ConsumerGroups class. + * @param client Reference to the service client */ - constructor(client: EventHubManagementClientContext) { + constructor(client: EventHubManagementClient) { this.client = client; } /** - * Creates or updates an Event Hubs consumer group as a nested resource within a Namespace. - * @param resourceGroupName Name of the resource group within the azure subscription. - * @param namespaceName The Namespace name - * @param eventHubName The Event Hub name - * @param consumerGroupName The consumer group name - * @param parameters Parameters supplied to create or update a consumer group resource. - * @param [options] The optional parameters - * @returns Promise - */ - createOrUpdate(resourceGroupName: string, namespaceName: string, eventHubName: string, consumerGroupName: string, parameters: Models.ConsumerGroup, options?: msRest.RequestOptionsBase): Promise; - /** + * Gets all the consumer groups in a Namespace. An empty feed is returned if no consumer group exists + * in the Namespace. * @param resourceGroupName Name of the resource group within the azure subscription. * @param namespaceName The Namespace name * @param eventHubName The Event Hub name - * @param consumerGroupName The consumer group name - * @param parameters Parameters supplied to create or update a consumer group resource. - * @param callback The callback + * @param options The options parameters. */ - createOrUpdate(resourceGroupName: string, namespaceName: string, eventHubName: string, consumerGroupName: string, parameters: Models.ConsumerGroup, callback: msRest.ServiceCallback): void; + public listByEventHub( + resourceGroupName: string, + namespaceName: string, + eventHubName: string, + options?: ConsumerGroupsListByEventHubOptionalParams + ): PagedAsyncIterableIterator { + const iter = this.listByEventHubPagingAll( + resourceGroupName, + namespaceName, + eventHubName, + options + ); + return { + next() { + return iter.next(); + }, + [Symbol.asyncIterator]() { + return this; + }, + byPage: () => { + return this.listByEventHubPagingPage( + resourceGroupName, + namespaceName, + eventHubName, + options + ); + } + }; + } + + private async *listByEventHubPagingPage( + resourceGroupName: string, + namespaceName: string, + eventHubName: string, + options?: ConsumerGroupsListByEventHubOptionalParams + ): AsyncIterableIterator { + let result = await this._listByEventHub( + resourceGroupName, + namespaceName, + eventHubName, + options + ); + yield result.value || []; + let continuationToken = result.nextLink; + while (continuationToken) { + result = await this._listByEventHubNext( + resourceGroupName, + namespaceName, + eventHubName, + continuationToken, + options + ); + continuationToken = result.nextLink; + yield result.value || []; + } + } + + private async *listByEventHubPagingAll( + resourceGroupName: string, + namespaceName: string, + eventHubName: string, + options?: ConsumerGroupsListByEventHubOptionalParams + ): AsyncIterableIterator { + for await (const page of this.listByEventHubPagingPage( + resourceGroupName, + namespaceName, + eventHubName, + options + )) { + yield* page; + } + } + /** + * Creates or updates an Event Hubs consumer group as a nested resource within a Namespace. * @param resourceGroupName Name of the resource group within the azure subscription. * @param namespaceName The Namespace name * @param eventHubName The Event Hub name * @param consumerGroupName The consumer group name * @param parameters Parameters supplied to create or update a consumer group resource. - * @param options The optional parameters - * @param callback The callback + * @param options The options parameters. */ - createOrUpdate(resourceGroupName: string, namespaceName: string, eventHubName: string, consumerGroupName: string, parameters: Models.ConsumerGroup, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; - createOrUpdate(resourceGroupName: string, namespaceName: string, eventHubName: string, consumerGroupName: string, parameters: Models.ConsumerGroup, options?: msRest.RequestOptionsBase | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { + createOrUpdate( + resourceGroupName: string, + namespaceName: string, + eventHubName: string, + consumerGroupName: string, + parameters: ConsumerGroup, + options?: ConsumerGroupsCreateOrUpdateOptionalParams + ): Promise { return this.client.sendOperationRequest( { resourceGroupName, @@ -66,8 +145,8 @@ export class ConsumerGroups { parameters, options }, - createOrUpdateOperationSpec, - callback) as Promise; + createOrUpdateOperationSpec + ); } /** @@ -76,28 +155,15 @@ export class ConsumerGroups { * @param namespaceName The Namespace name * @param eventHubName The Event Hub name * @param consumerGroupName The consumer group name - * @param [options] The optional parameters - * @returns Promise - */ - deleteMethod(resourceGroupName: string, namespaceName: string, eventHubName: string, consumerGroupName: string, options?: msRest.RequestOptionsBase): Promise; - /** - * @param resourceGroupName Name of the resource group within the azure subscription. - * @param namespaceName The Namespace name - * @param eventHubName The Event Hub name - * @param consumerGroupName The consumer group name - * @param callback The callback - */ - deleteMethod(resourceGroupName: string, namespaceName: string, eventHubName: string, consumerGroupName: string, callback: msRest.ServiceCallback): void; - /** - * @param resourceGroupName Name of the resource group within the azure subscription. - * @param namespaceName The Namespace name - * @param eventHubName The Event Hub name - * @param consumerGroupName The consumer group name - * @param options The optional parameters - * @param callback The callback + * @param options The options parameters. */ - deleteMethod(resourceGroupName: string, namespaceName: string, eventHubName: string, consumerGroupName: string, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; - deleteMethod(resourceGroupName: string, namespaceName: string, eventHubName: string, consumerGroupName: string, options?: msRest.RequestOptionsBase | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { + delete( + resourceGroupName: string, + namespaceName: string, + eventHubName: string, + consumerGroupName: string, + options?: ConsumerGroupsDeleteOptionalParams + ): Promise { return this.client.sendOperationRequest( { resourceGroupName, @@ -106,8 +172,8 @@ export class ConsumerGroups { consumerGroupName, options }, - deleteMethodOperationSpec, - callback); + deleteOperationSpec + ); } /** @@ -116,28 +182,15 @@ export class ConsumerGroups { * @param namespaceName The Namespace name * @param eventHubName The Event Hub name * @param consumerGroupName The consumer group name - * @param [options] The optional parameters - * @returns Promise - */ - get(resourceGroupName: string, namespaceName: string, eventHubName: string, consumerGroupName: string, options?: msRest.RequestOptionsBase): Promise; - /** - * @param resourceGroupName Name of the resource group within the azure subscription. - * @param namespaceName The Namespace name - * @param eventHubName The Event Hub name - * @param consumerGroupName The consumer group name - * @param callback The callback - */ - get(resourceGroupName: string, namespaceName: string, eventHubName: string, consumerGroupName: string, callback: msRest.ServiceCallback): void; - /** - * @param resourceGroupName Name of the resource group within the azure subscription. - * @param namespaceName The Namespace name - * @param eventHubName The Event Hub name - * @param consumerGroupName The consumer group name - * @param options The optional parameters - * @param callback The callback + * @param options The options parameters. */ - get(resourceGroupName: string, namespaceName: string, eventHubName: string, consumerGroupName: string, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; - get(resourceGroupName: string, namespaceName: string, eventHubName: string, consumerGroupName: string, options?: msRest.RequestOptionsBase | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { + get( + resourceGroupName: string, + namespaceName: string, + eventHubName: string, + consumerGroupName: string, + options?: ConsumerGroupsGetOptionalParams + ): Promise { return this.client.sendOperationRequest( { resourceGroupName, @@ -146,102 +199,58 @@ export class ConsumerGroups { consumerGroupName, options }, - getOperationSpec, - callback) as Promise; + getOperationSpec + ); } /** - * Gets all the consumer groups in a Namespace. An empty feed is returned if no consumer group - * exists in the Namespace. - * @param resourceGroupName Name of the resource group within the azure subscription. - * @param namespaceName The Namespace name - * @param eventHubName The Event Hub name - * @param [options] The optional parameters - * @returns Promise - */ - listByEventHub(resourceGroupName: string, namespaceName: string, eventHubName: string, options?: Models.ConsumerGroupsListByEventHubOptionalParams): Promise; - /** - * @param resourceGroupName Name of the resource group within the azure subscription. - * @param namespaceName The Namespace name - * @param eventHubName The Event Hub name - * @param callback The callback - */ - listByEventHub(resourceGroupName: string, namespaceName: string, eventHubName: string, callback: msRest.ServiceCallback): void; - /** + * Gets all the consumer groups in a Namespace. An empty feed is returned if no consumer group exists + * in the Namespace. * @param resourceGroupName Name of the resource group within the azure subscription. * @param namespaceName The Namespace name * @param eventHubName The Event Hub name - * @param options The optional parameters - * @param callback The callback + * @param options The options parameters. */ - listByEventHub(resourceGroupName: string, namespaceName: string, eventHubName: string, options: Models.ConsumerGroupsListByEventHubOptionalParams, callback: msRest.ServiceCallback): void; - listByEventHub(resourceGroupName: string, namespaceName: string, eventHubName: string, options?: Models.ConsumerGroupsListByEventHubOptionalParams | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { + private _listByEventHub( + resourceGroupName: string, + namespaceName: string, + eventHubName: string, + options?: ConsumerGroupsListByEventHubOptionalParams + ): Promise { return this.client.sendOperationRequest( - { - resourceGroupName, - namespaceName, - eventHubName, - options - }, - listByEventHubOperationSpec, - callback) as Promise; + { resourceGroupName, namespaceName, eventHubName, options }, + listByEventHubOperationSpec + ); } /** - * Gets all the consumer groups in a Namespace. An empty feed is returned if no consumer group - * exists in the Namespace. - * @param nextPageLink The NextLink from the previous successful call to List operation. - * @param [options] The optional parameters - * @returns Promise - */ - listByEventHubNext(nextPageLink: string, options?: msRest.RequestOptionsBase): Promise; - /** - * @param nextPageLink The NextLink from the previous successful call to List operation. - * @param callback The callback - */ - listByEventHubNext(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 + * ListByEventHubNext + * @param resourceGroupName Name of the resource group within the azure subscription. + * @param namespaceName The Namespace name + * @param eventHubName The Event Hub name + * @param nextLink The nextLink from the previous successful call to the ListByEventHub method. + * @param options The options parameters. */ - listByEventHubNext(nextPageLink: string, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; - listByEventHubNext(nextPageLink: string, options?: msRest.RequestOptionsBase | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { + private _listByEventHubNext( + resourceGroupName: string, + namespaceName: string, + eventHubName: string, + nextLink: string, + options?: ConsumerGroupsListByEventHubNextOptionalParams + ): Promise { return this.client.sendOperationRequest( - { - nextPageLink, - options - }, - listByEventHubNextOperationSpec, - callback) as Promise; + { resourceGroupName, namespaceName, eventHubName, nextLink, options }, + listByEventHubNextOperationSpec + ); } } - // Operation Specifications -const serializer = new msRest.Serializer(Mappers); -const createOrUpdateOperationSpec: msRest.OperationSpec = { +const serializer = coreClient.createSerializer(Mappers, /* isXml */ false); + +const createOrUpdateOperationSpec: coreClient.OperationSpec = { + path: + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventHub/namespaces/{namespaceName}/eventhubs/{eventHubName}/consumergroups/{consumerGroupName}", httpMethod: "PUT", - path: "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventHub/namespaces/{namespaceName}/eventhubs/{eventHubName}/consumergroups/{consumerGroupName}", - urlParameters: [ - Parameters.resourceGroupName, - Parameters.namespaceName, - Parameters.eventHubName, - Parameters.consumerGroupName, - Parameters.subscriptionId - ], - queryParameters: [ - Parameters.apiVersion1 - ], - headerParameters: [ - Parameters.acceptLanguage - ], - requestBody: { - parameterPath: "parameters", - mapper: { - ...Mappers.ConsumerGroup, - required: true - } - }, responses: { 200: { bodyMapper: Mappers.ConsumerGroup @@ -250,25 +259,24 @@ const createOrUpdateOperationSpec: msRest.OperationSpec = { bodyMapper: Mappers.ErrorResponse } }, - serializer -}; - -const deleteMethodOperationSpec: msRest.OperationSpec = { - httpMethod: "DELETE", - path: "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventHub/namespaces/{namespaceName}/eventhubs/{eventHubName}/consumergroups/{consumerGroupName}", + requestBody: Parameters.parameters7, + queryParameters: [Parameters.apiVersion1], urlParameters: [ + Parameters.$host, + Parameters.subscriptionId, Parameters.resourceGroupName, Parameters.namespaceName, Parameters.eventHubName, - Parameters.consumerGroupName, - Parameters.subscriptionId - ], - queryParameters: [ - Parameters.apiVersion1 - ], - headerParameters: [ - Parameters.acceptLanguage + Parameters.consumerGroupName ], + headerParameters: [Parameters.accept, Parameters.contentType], + mediaType: "json", + serializer +}; +const deleteOperationSpec: coreClient.OperationSpec = { + path: + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventHub/namespaces/{namespaceName}/eventhubs/{eventHubName}/consumergroups/{consumerGroupName}", + httpMethod: "DELETE", responses: { 200: {}, 204: {}, @@ -276,25 +284,22 @@ const deleteMethodOperationSpec: msRest.OperationSpec = { bodyMapper: Mappers.ErrorResponse } }, - serializer -}; - -const getOperationSpec: msRest.OperationSpec = { - httpMethod: "GET", - path: "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventHub/namespaces/{namespaceName}/eventhubs/{eventHubName}/consumergroups/{consumerGroupName}", + queryParameters: [Parameters.apiVersion1], urlParameters: [ + Parameters.$host, + Parameters.subscriptionId, Parameters.resourceGroupName, Parameters.namespaceName, Parameters.eventHubName, - Parameters.consumerGroupName, - Parameters.subscriptionId - ], - queryParameters: [ - Parameters.apiVersion1 - ], - headerParameters: [ - Parameters.acceptLanguage + Parameters.consumerGroupName ], + headerParameters: [Parameters.accept], + serializer +}; +const getOperationSpec: coreClient.OperationSpec = { + path: + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventHub/namespaces/{namespaceName}/eventhubs/{eventHubName}/consumergroups/{consumerGroupName}", + httpMethod: "GET", responses: { 200: { bodyMapper: Mappers.ConsumerGroup @@ -303,26 +308,22 @@ const getOperationSpec: msRest.OperationSpec = { bodyMapper: Mappers.ErrorResponse } }, - serializer -}; - -const listByEventHubOperationSpec: msRest.OperationSpec = { - httpMethod: "GET", - path: "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventHub/namespaces/{namespaceName}/eventhubs/{eventHubName}/consumergroups", + queryParameters: [Parameters.apiVersion1], urlParameters: [ + Parameters.$host, + Parameters.subscriptionId, Parameters.resourceGroupName, Parameters.namespaceName, Parameters.eventHubName, - Parameters.subscriptionId - ], - queryParameters: [ - Parameters.apiVersion1, - Parameters.skip, - Parameters.top - ], - headerParameters: [ - Parameters.acceptLanguage + Parameters.consumerGroupName ], + headerParameters: [Parameters.accept], + serializer +}; +const listByEventHubOperationSpec: coreClient.OperationSpec = { + path: + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventHub/namespaces/{namespaceName}/eventhubs/{eventHubName}/consumergroups", + httpMethod: "GET", responses: { 200: { bodyMapper: Mappers.ConsumerGroupListResult @@ -331,19 +332,20 @@ const listByEventHubOperationSpec: msRest.OperationSpec = { bodyMapper: Mappers.ErrorResponse } }, + queryParameters: [Parameters.apiVersion1, Parameters.skip, Parameters.top], + urlParameters: [ + Parameters.$host, + Parameters.subscriptionId, + Parameters.resourceGroupName, + Parameters.namespaceName, + Parameters.eventHubName + ], + headerParameters: [Parameters.accept], serializer }; - -const listByEventHubNextOperationSpec: msRest.OperationSpec = { - httpMethod: "GET", - baseUrl: "https://management.azure.com", +const listByEventHubNextOperationSpec: coreClient.OperationSpec = { path: "{nextLink}", - urlParameters: [ - Parameters.nextPageLink - ], - headerParameters: [ - Parameters.acceptLanguage - ], + httpMethod: "GET", responses: { 200: { bodyMapper: Mappers.ConsumerGroupListResult @@ -352,5 +354,15 @@ const listByEventHubNextOperationSpec: msRest.OperationSpec = { bodyMapper: Mappers.ErrorResponse } }, + queryParameters: [Parameters.apiVersion1, Parameters.skip, Parameters.top], + urlParameters: [ + Parameters.$host, + Parameters.subscriptionId, + Parameters.resourceGroupName, + Parameters.nextLink, + Parameters.namespaceName, + Parameters.eventHubName + ], + headerParameters: [Parameters.accept], serializer }; diff --git a/sdk/eventhub/arm-eventhub-profile-2020-09-01-hybrid/src/operations/disasterRecoveryConfigs.ts b/sdk/eventhub/arm-eventhub-profile-2020-09-01-hybrid/src/operations/disasterRecoveryConfigs.ts index 14a59ad276ee..bc498af28be4 100644 --- a/sdk/eventhub/arm-eventhub-profile-2020-09-01-hybrid/src/operations/disasterRecoveryConfigs.ts +++ b/sdk/eventhub/arm-eventhub-profile-2020-09-01-hybrid/src/operations/disasterRecoveryConfigs.ts @@ -1,28 +1,39 @@ /* - * 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/disasterRecoveryConfigsMappers"; +import { PagedAsyncIterableIterator } from "@azure/core-paging"; +import { DisasterRecoveryConfigs } from "../operationsInterfaces"; +import * as coreClient from "@azure/core-client"; +import * as Mappers from "../models/mappers"; import * as Parameters from "../models/parameters"; -import { EventHubManagementClientContext } from "../eventHubManagementClientContext"; +import { EventHubManagementClient } from "../eventHubManagementClient"; +import { + AuthorizationRule, + DisasterRecoveryConfigsListAuthorizationRulesNextOptionalParams, + DisasterRecoveryConfigsListAuthorizationRulesOptionalParams, + DisasterRecoveryConfigsListAuthorizationRulesResponse, + DisasterRecoveryConfigsGetAuthorizationRuleOptionalParams, + DisasterRecoveryConfigsGetAuthorizationRuleResponse, + DisasterRecoveryConfigsListKeysOptionalParams, + DisasterRecoveryConfigsListKeysResponse, + DisasterRecoveryConfigsListAuthorizationRulesNextResponse +} from "../models"; -/** Class representing a DisasterRecoveryConfigs. */ -export class DisasterRecoveryConfigs { - private readonly client: EventHubManagementClientContext; +/// +/** Class containing DisasterRecoveryConfigs operations. */ +export class DisasterRecoveryConfigsImpl implements DisasterRecoveryConfigs { + private readonly client: EventHubManagementClient; /** - * Create a DisasterRecoveryConfigs. - * @param {EventHubManagementClientContext} client Reference to the service client. + * Initialize a new instance of the class DisasterRecoveryConfigs class. + * @param client Reference to the service client */ - constructor(client: EventHubManagementClientContext) { + constructor(client: EventHubManagementClient) { this.client = client; } @@ -31,65 +42,115 @@ export class DisasterRecoveryConfigs { * @param resourceGroupName Name of the resource group within the azure subscription. * @param namespaceName The Namespace name * @param alias The Disaster Recovery configuration name - * @param [options] The optional parameters - * @returns Promise + * @param options The options parameters. */ - listAuthorizationRules(resourceGroupName: string, namespaceName: string, alias: string, options?: msRest.RequestOptionsBase): Promise; - /** - * @param resourceGroupName Name of the resource group within the azure subscription. - * @param namespaceName The Namespace name - * @param alias The Disaster Recovery configuration name - * @param callback The callback - */ - listAuthorizationRules(resourceGroupName: string, namespaceName: string, alias: string, callback: msRest.ServiceCallback): void; - /** - * @param resourceGroupName Name of the resource group within the azure subscription. - * @param namespaceName The Namespace name - * @param alias The Disaster Recovery configuration name - * @param options The optional parameters - * @param callback The callback - */ - listAuthorizationRules(resourceGroupName: string, namespaceName: string, alias: string, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; - listAuthorizationRules(resourceGroupName: string, namespaceName: string, alias: string, options?: msRest.RequestOptionsBase | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { - return this.client.sendOperationRequest( - { + public listAuthorizationRules( + resourceGroupName: string, + namespaceName: string, + alias: string, + options?: DisasterRecoveryConfigsListAuthorizationRulesOptionalParams + ): PagedAsyncIterableIterator { + const iter = this.listAuthorizationRulesPagingAll( + resourceGroupName, + namespaceName, + alias, + options + ); + return { + next() { + return iter.next(); + }, + [Symbol.asyncIterator]() { + return this; + }, + byPage: () => { + return this.listAuthorizationRulesPagingPage( + resourceGroupName, + namespaceName, + alias, + options + ); + } + }; + } + + private async *listAuthorizationRulesPagingPage( + resourceGroupName: string, + namespaceName: string, + alias: string, + options?: DisasterRecoveryConfigsListAuthorizationRulesOptionalParams + ): AsyncIterableIterator { + let result = await this._listAuthorizationRules( + resourceGroupName, + namespaceName, + alias, + options + ); + yield result.value || []; + let continuationToken = result.nextLink; + while (continuationToken) { + result = await this._listAuthorizationRulesNext( resourceGroupName, namespaceName, alias, + continuationToken, options - }, - listAuthorizationRulesOperationSpec, - callback) as Promise; + ); + continuationToken = result.nextLink; + yield result.value || []; + } + } + + private async *listAuthorizationRulesPagingAll( + resourceGroupName: string, + namespaceName: string, + alias: string, + options?: DisasterRecoveryConfigsListAuthorizationRulesOptionalParams + ): AsyncIterableIterator { + for await (const page of this.listAuthorizationRulesPagingPage( + resourceGroupName, + namespaceName, + alias, + options + )) { + yield* page; + } } /** - * Gets an AuthorizationRule for a Namespace by rule name. - * @param resourceGroupName Name of the resource group within the azure subscription. - * @param namespaceName The Namespace name - * @param alias The Disaster Recovery configuration name - * @param authorizationRuleName The authorization rule name. - * @param [options] The optional parameters - * @returns Promise - */ - getAuthorizationRule(resourceGroupName: string, namespaceName: string, alias: string, authorizationRuleName: string, options?: msRest.RequestOptionsBase): Promise; - /** + * Gets a list of authorization rules for a Namespace. * @param resourceGroupName Name of the resource group within the azure subscription. * @param namespaceName The Namespace name * @param alias The Disaster Recovery configuration name - * @param authorizationRuleName The authorization rule name. - * @param callback The callback + * @param options The options parameters. */ - getAuthorizationRule(resourceGroupName: string, namespaceName: string, alias: string, authorizationRuleName: string, callback: msRest.ServiceCallback): void; + private _listAuthorizationRules( + resourceGroupName: string, + namespaceName: string, + alias: string, + options?: DisasterRecoveryConfigsListAuthorizationRulesOptionalParams + ): Promise { + return this.client.sendOperationRequest( + { resourceGroupName, namespaceName, alias, options }, + listAuthorizationRulesOperationSpec + ); + } + /** + * Gets an AuthorizationRule for a Namespace by rule name. * @param resourceGroupName Name of the resource group within the azure subscription. * @param namespaceName The Namespace name * @param alias The Disaster Recovery configuration name * @param authorizationRuleName The authorization rule name. - * @param options The optional parameters - * @param callback The callback + * @param options The options parameters. */ - getAuthorizationRule(resourceGroupName: string, namespaceName: string, alias: string, authorizationRuleName: string, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; - getAuthorizationRule(resourceGroupName: string, namespaceName: string, alias: string, authorizationRuleName: string, options?: msRest.RequestOptionsBase | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { + getAuthorizationRule( + resourceGroupName: string, + namespaceName: string, + alias: string, + authorizationRuleName: string, + options?: DisasterRecoveryConfigsGetAuthorizationRuleOptionalParams + ): Promise { return this.client.sendOperationRequest( { resourceGroupName, @@ -98,8 +159,8 @@ export class DisasterRecoveryConfigs { authorizationRuleName, options }, - getAuthorizationRuleOperationSpec, - callback) as Promise; + getAuthorizationRuleOperationSpec + ); } /** @@ -108,28 +169,15 @@ export class DisasterRecoveryConfigs { * @param namespaceName The Namespace name * @param alias The Disaster Recovery configuration name * @param authorizationRuleName The authorization rule name. - * @param [options] The optional parameters - * @returns Promise + * @param options The options parameters. */ - listKeys(resourceGroupName: string, namespaceName: string, alias: string, authorizationRuleName: string, options?: msRest.RequestOptionsBase): Promise; - /** - * @param resourceGroupName Name of the resource group within the azure subscription. - * @param namespaceName The Namespace name - * @param alias The Disaster Recovery configuration name - * @param authorizationRuleName The authorization rule name. - * @param callback The callback - */ - listKeys(resourceGroupName: string, namespaceName: string, alias: string, authorizationRuleName: string, callback: msRest.ServiceCallback): void; - /** - * @param resourceGroupName Name of the resource group within the azure subscription. - * @param namespaceName The Namespace name - * @param alias The Disaster Recovery configuration name - * @param authorizationRuleName The authorization rule name. - * @param options The optional parameters - * @param callback The callback - */ - listKeys(resourceGroupName: string, namespaceName: string, alias: string, authorizationRuleName: string, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; - listKeys(resourceGroupName: string, namespaceName: string, alias: string, authorizationRuleName: string, options?: msRest.RequestOptionsBase | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { + listKeys( + resourceGroupName: string, + namespaceName: string, + alias: string, + authorizationRuleName: string, + options?: DisasterRecoveryConfigsListKeysOptionalParams + ): Promise { return this.client.sendOperationRequest( { resourceGroupName, @@ -138,56 +186,38 @@ export class DisasterRecoveryConfigs { authorizationRuleName, options }, - listKeysOperationSpec, - callback) as Promise; + listKeysOperationSpec + ); } /** - * Gets a list of authorization rules for a Namespace. - * @param nextPageLink The NextLink from the previous successful call to List operation. - * @param [options] The optional parameters - * @returns Promise - */ - listAuthorizationRulesNext(nextPageLink: string, options?: msRest.RequestOptionsBase): Promise; - /** - * @param nextPageLink The NextLink from the previous successful call to List operation. - * @param callback The callback - */ - listAuthorizationRulesNext(nextPageLink: string, callback: msRest.ServiceCallback): void; - /** - * @param nextPageLink The NextLink from the previous successful call to List operation. - * @param options The optional parameters - * @param callback The callback + * ListAuthorizationRulesNext + * @param resourceGroupName Name of the resource group within the azure subscription. + * @param namespaceName The Namespace name + * @param alias The Disaster Recovery configuration name + * @param nextLink The nextLink from the previous successful call to the ListAuthorizationRules method. + * @param options The options parameters. */ - listAuthorizationRulesNext(nextPageLink: string, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; - listAuthorizationRulesNext(nextPageLink: string, options?: msRest.RequestOptionsBase | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { + private _listAuthorizationRulesNext( + resourceGroupName: string, + namespaceName: string, + alias: string, + nextLink: string, + options?: DisasterRecoveryConfigsListAuthorizationRulesNextOptionalParams + ): Promise { return this.client.sendOperationRequest( - { - nextPageLink, - options - }, - listAuthorizationRulesNextOperationSpec, - callback) as Promise; + { resourceGroupName, namespaceName, alias, nextLink, options }, + listAuthorizationRulesNextOperationSpec + ); } } - // Operation Specifications -const serializer = new msRest.Serializer(Mappers); -const listAuthorizationRulesOperationSpec: msRest.OperationSpec = { +const serializer = coreClient.createSerializer(Mappers, /* isXml */ false); + +const listAuthorizationRulesOperationSpec: coreClient.OperationSpec = { + path: + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventHub/namespaces/{namespaceName}/disasterRecoveryConfigs/{alias}/authorizationRules", httpMethod: "GET", - path: "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventHub/namespaces/{namespaceName}/disasterRecoveryConfigs/{alias}/authorizationRules", - urlParameters: [ - Parameters.resourceGroupName, - Parameters.namespaceName, - Parameters.alias, - Parameters.subscriptionId - ], - queryParameters: [ - Parameters.apiVersion1 - ], - headerParameters: [ - Parameters.acceptLanguage - ], responses: { 200: { bodyMapper: Mappers.AuthorizationRuleListResult @@ -196,25 +226,21 @@ const listAuthorizationRulesOperationSpec: msRest.OperationSpec = { bodyMapper: Mappers.ErrorResponse } }, - serializer -}; - -const getAuthorizationRuleOperationSpec: msRest.OperationSpec = { - httpMethod: "GET", - path: "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventHub/namespaces/{namespaceName}/disasterRecoveryConfigs/{alias}/authorizationRules/{authorizationRuleName}", + queryParameters: [Parameters.apiVersion1], urlParameters: [ + Parameters.$host, + Parameters.subscriptionId, Parameters.resourceGroupName, Parameters.namespaceName, - Parameters.alias, - Parameters.authorizationRuleName, - Parameters.subscriptionId - ], - queryParameters: [ - Parameters.apiVersion1 - ], - headerParameters: [ - Parameters.acceptLanguage + Parameters.alias ], + headerParameters: [Parameters.accept], + serializer +}; +const getAuthorizationRuleOperationSpec: coreClient.OperationSpec = { + path: + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventHub/namespaces/{namespaceName}/disasterRecoveryConfigs/{alias}/authorizationRules/{authorizationRuleName}", + httpMethod: "GET", responses: { 200: { bodyMapper: Mappers.AuthorizationRule @@ -223,25 +249,22 @@ const getAuthorizationRuleOperationSpec: msRest.OperationSpec = { bodyMapper: Mappers.ErrorResponse } }, - serializer -}; - -const listKeysOperationSpec: msRest.OperationSpec = { - httpMethod: "POST", - path: "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventHub/namespaces/{namespaceName}/disasterRecoveryConfigs/{alias}/authorizationRules/{authorizationRuleName}/listKeys", + queryParameters: [Parameters.apiVersion1], urlParameters: [ + Parameters.$host, + Parameters.subscriptionId, Parameters.resourceGroupName, Parameters.namespaceName, - Parameters.alias, Parameters.authorizationRuleName, - Parameters.subscriptionId - ], - queryParameters: [ - Parameters.apiVersion1 - ], - headerParameters: [ - Parameters.acceptLanguage + Parameters.alias ], + headerParameters: [Parameters.accept], + serializer +}; +const listKeysOperationSpec: coreClient.OperationSpec = { + path: + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventHub/namespaces/{namespaceName}/disasterRecoveryConfigs/{alias}/authorizationRules/{authorizationRuleName}/listKeys", + httpMethod: "POST", responses: { 200: { bodyMapper: Mappers.AccessKeys @@ -250,19 +273,21 @@ const listKeysOperationSpec: msRest.OperationSpec = { bodyMapper: Mappers.ErrorResponse } }, + queryParameters: [Parameters.apiVersion1], + urlParameters: [ + Parameters.$host, + Parameters.subscriptionId, + Parameters.resourceGroupName, + Parameters.namespaceName, + Parameters.authorizationRuleName, + Parameters.alias + ], + headerParameters: [Parameters.accept], serializer }; - -const listAuthorizationRulesNextOperationSpec: msRest.OperationSpec = { - httpMethod: "GET", - baseUrl: "https://management.azure.com", +const listAuthorizationRulesNextOperationSpec: coreClient.OperationSpec = { path: "{nextLink}", - urlParameters: [ - Parameters.nextPageLink - ], - headerParameters: [ - Parameters.acceptLanguage - ], + httpMethod: "GET", responses: { 200: { bodyMapper: Mappers.AuthorizationRuleListResult @@ -271,5 +296,15 @@ const listAuthorizationRulesNextOperationSpec: msRest.OperationSpec = { bodyMapper: Mappers.ErrorResponse } }, + queryParameters: [Parameters.apiVersion1], + urlParameters: [ + Parameters.$host, + Parameters.subscriptionId, + Parameters.resourceGroupName, + Parameters.nextLink, + Parameters.namespaceName, + Parameters.alias + ], + headerParameters: [Parameters.accept], serializer }; diff --git a/sdk/eventhub/arm-eventhub-profile-2020-09-01-hybrid/src/operations/eventHubs.ts b/sdk/eventhub/arm-eventhub-profile-2020-09-01-hybrid/src/operations/eventHubs.ts index 599e54c2d240..88cd21d15fd1 100644 --- a/sdk/eventhub/arm-eventhub-profile-2020-09-01-hybrid/src/operations/eventHubs.ts +++ b/sdk/eventhub/arm-eventhub-profile-2020-09-01-hybrid/src/operations/eventHubs.ts @@ -1,28 +1,55 @@ /* - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for - * license information. + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. * * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is - * regenerated. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. */ -import * as msRest from "@azure/ms-rest-js"; -import * as Models from "../models"; -import * as Mappers from "../models/eventHubsMappers"; +import { PagedAsyncIterableIterator } from "@azure/core-paging"; +import { EventHubs } from "../operationsInterfaces"; +import * as coreClient from "@azure/core-client"; +import * as Mappers from "../models/mappers"; import * as Parameters from "../models/parameters"; -import { EventHubManagementClientContext } from "../eventHubManagementClientContext"; +import { EventHubManagementClient } from "../eventHubManagementClient"; +import { + AuthorizationRule, + EventHubsListAuthorizationRulesNextOptionalParams, + EventHubsListAuthorizationRulesOptionalParams, + Eventhub, + EventHubsListByNamespaceNextOptionalParams, + EventHubsListByNamespaceOptionalParams, + EventHubsListAuthorizationRulesResponse, + EventHubsCreateOrUpdateAuthorizationRuleOptionalParams, + EventHubsCreateOrUpdateAuthorizationRuleResponse, + EventHubsGetAuthorizationRuleOptionalParams, + EventHubsGetAuthorizationRuleResponse, + EventHubsDeleteAuthorizationRuleOptionalParams, + EventHubsListKeysOptionalParams, + EventHubsListKeysResponse, + RegenerateAccessKeyParameters, + EventHubsRegenerateKeysOptionalParams, + EventHubsRegenerateKeysResponse, + EventHubsListByNamespaceResponse, + EventHubsCreateOrUpdateOptionalParams, + EventHubsCreateOrUpdateResponse, + EventHubsDeleteOptionalParams, + EventHubsGetOptionalParams, + EventHubsGetResponse, + EventHubsListAuthorizationRulesNextResponse, + EventHubsListByNamespaceNextResponse +} from "../models"; -/** Class representing a EventHubs. */ -export class EventHubs { - private readonly client: EventHubManagementClientContext; +/// +/** Class containing EventHubs operations. */ +export class EventHubsImpl implements EventHubs { + private readonly client: EventHubManagementClient; /** - * Create a EventHubs. - * @param {EventHubManagementClientContext} client Reference to the service client. + * Initialize a new instance of the class EventHubs class. + * @param client Reference to the service client */ - constructor(client: EventHubManagementClientContext) { + constructor(client: EventHubManagementClient) { this.client = client; } @@ -31,69 +58,189 @@ export class EventHubs { * @param resourceGroupName Name of the resource group within the azure subscription. * @param namespaceName The Namespace name * @param eventHubName The Event Hub name - * @param [options] The optional parameters - * @returns Promise - */ - listAuthorizationRules(resourceGroupName: string, namespaceName: string, eventHubName: string, options?: msRest.RequestOptionsBase): Promise; - /** - * @param resourceGroupName Name of the resource group within the azure subscription. - * @param namespaceName The Namespace name - * @param eventHubName The Event Hub name - * @param callback The callback - */ - listAuthorizationRules(resourceGroupName: string, namespaceName: string, eventHubName: string, callback: msRest.ServiceCallback): void; - /** - * @param resourceGroupName Name of the resource group within the azure subscription. - * @param namespaceName The Namespace name - * @param eventHubName The Event Hub name - * @param options The optional parameters - * @param callback The callback - */ - listAuthorizationRules(resourceGroupName: string, namespaceName: string, eventHubName: string, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; - listAuthorizationRules(resourceGroupName: string, namespaceName: string, eventHubName: string, options?: msRest.RequestOptionsBase | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { - return this.client.sendOperationRequest( - { + * @param options The options parameters. + */ + public listAuthorizationRules( + resourceGroupName: string, + namespaceName: string, + eventHubName: string, + options?: EventHubsListAuthorizationRulesOptionalParams + ): PagedAsyncIterableIterator { + const iter = this.listAuthorizationRulesPagingAll( + resourceGroupName, + namespaceName, + eventHubName, + options + ); + return { + next() { + return iter.next(); + }, + [Symbol.asyncIterator]() { + return this; + }, + byPage: () => { + return this.listAuthorizationRulesPagingPage( + resourceGroupName, + namespaceName, + eventHubName, + options + ); + } + }; + } + + private async *listAuthorizationRulesPagingPage( + resourceGroupName: string, + namespaceName: string, + eventHubName: string, + options?: EventHubsListAuthorizationRulesOptionalParams + ): AsyncIterableIterator { + let result = await this._listAuthorizationRules( + resourceGroupName, + namespaceName, + eventHubName, + options + ); + yield result.value || []; + let continuationToken = result.nextLink; + while (continuationToken) { + result = await this._listAuthorizationRulesNext( resourceGroupName, namespaceName, eventHubName, + continuationToken, options - }, - listAuthorizationRulesOperationSpec, - callback) as Promise; + ); + continuationToken = result.nextLink; + yield result.value || []; + } + } + + private async *listAuthorizationRulesPagingAll( + resourceGroupName: string, + namespaceName: string, + eventHubName: string, + options?: EventHubsListAuthorizationRulesOptionalParams + ): AsyncIterableIterator { + for await (const page of this.listAuthorizationRulesPagingPage( + resourceGroupName, + namespaceName, + eventHubName, + options + )) { + yield* page; + } } /** - * Creates or updates an AuthorizationRule for the specified Event Hub. Creation/update of the - * AuthorizationRule will take a few seconds to take effect. + * Gets all the Event Hubs in a Namespace. * @param resourceGroupName Name of the resource group within the azure subscription. * @param namespaceName The Namespace name - * @param eventHubName The Event Hub name - * @param authorizationRuleName The authorization rule name. - * @param parameters The shared access AuthorizationRule. - * @param [options] The optional parameters - * @returns Promise - */ - createOrUpdateAuthorizationRule(resourceGroupName: string, namespaceName: string, eventHubName: string, authorizationRuleName: string, parameters: Models.AuthorizationRule, options?: msRest.RequestOptionsBase): Promise; + * @param options The options parameters. + */ + public listByNamespace( + resourceGroupName: string, + namespaceName: string, + options?: EventHubsListByNamespaceOptionalParams + ): PagedAsyncIterableIterator { + const iter = this.listByNamespacePagingAll( + resourceGroupName, + namespaceName, + options + ); + return { + next() { + return iter.next(); + }, + [Symbol.asyncIterator]() { + return this; + }, + byPage: () => { + return this.listByNamespacePagingPage( + resourceGroupName, + namespaceName, + options + ); + } + }; + } + + private async *listByNamespacePagingPage( + resourceGroupName: string, + namespaceName: string, + options?: EventHubsListByNamespaceOptionalParams + ): AsyncIterableIterator { + let result = await this._listByNamespace( + resourceGroupName, + namespaceName, + options + ); + yield result.value || []; + let continuationToken = result.nextLink; + while (continuationToken) { + result = await this._listByNamespaceNext( + resourceGroupName, + namespaceName, + continuationToken, + options + ); + continuationToken = result.nextLink; + yield result.value || []; + } + } + + private async *listByNamespacePagingAll( + resourceGroupName: string, + namespaceName: string, + options?: EventHubsListByNamespaceOptionalParams + ): AsyncIterableIterator { + for await (const page of this.listByNamespacePagingPage( + resourceGroupName, + namespaceName, + options + )) { + yield* page; + } + } + /** + * Gets the authorization rules for an Event Hub. * @param resourceGroupName Name of the resource group within the azure subscription. * @param namespaceName The Namespace name * @param eventHubName The Event Hub name - * @param authorizationRuleName The authorization rule name. - * @param parameters The shared access AuthorizationRule. - * @param callback The callback - */ - createOrUpdateAuthorizationRule(resourceGroupName: string, namespaceName: string, eventHubName: string, authorizationRuleName: string, parameters: Models.AuthorizationRule, callback: msRest.ServiceCallback): void; + * @param options The options parameters. + */ + private _listAuthorizationRules( + resourceGroupName: string, + namespaceName: string, + eventHubName: string, + options?: EventHubsListAuthorizationRulesOptionalParams + ): Promise { + return this.client.sendOperationRequest( + { resourceGroupName, namespaceName, eventHubName, options }, + listAuthorizationRulesOperationSpec + ); + } + /** + * Creates or updates an AuthorizationRule for the specified Event Hub. Creation/update of the + * AuthorizationRule will take a few seconds to take effect. * @param resourceGroupName Name of the resource group within the azure subscription. * @param namespaceName The Namespace name * @param eventHubName The Event Hub name * @param authorizationRuleName The authorization rule name. * @param parameters The shared access AuthorizationRule. - * @param options The optional parameters - * @param callback The callback - */ - createOrUpdateAuthorizationRule(resourceGroupName: string, namespaceName: string, eventHubName: string, authorizationRuleName: string, parameters: Models.AuthorizationRule, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; - createOrUpdateAuthorizationRule(resourceGroupName: string, namespaceName: string, eventHubName: string, authorizationRuleName: string, parameters: Models.AuthorizationRule, options?: msRest.RequestOptionsBase | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { + * @param options The options parameters. + */ + createOrUpdateAuthorizationRule( + resourceGroupName: string, + namespaceName: string, + eventHubName: string, + authorizationRuleName: string, + parameters: AuthorizationRule, + options?: EventHubsCreateOrUpdateAuthorizationRuleOptionalParams + ): Promise { return this.client.sendOperationRequest( { resourceGroupName, @@ -103,8 +250,8 @@ export class EventHubs { parameters, options }, - createOrUpdateAuthorizationRuleOperationSpec, - callback) as Promise; + createOrUpdateAuthorizationRuleOperationSpec + ); } /** @@ -113,28 +260,15 @@ export class EventHubs { * @param namespaceName The Namespace name * @param eventHubName The Event Hub name * @param authorizationRuleName The authorization rule name. - * @param [options] The optional parameters - * @returns Promise - */ - getAuthorizationRule(resourceGroupName: string, namespaceName: string, eventHubName: string, authorizationRuleName: string, options?: msRest.RequestOptionsBase): Promise; - /** - * @param resourceGroupName Name of the resource group within the azure subscription. - * @param namespaceName The Namespace name - * @param eventHubName The Event Hub name - * @param authorizationRuleName The authorization rule name. - * @param callback The callback - */ - getAuthorizationRule(resourceGroupName: string, namespaceName: string, eventHubName: string, authorizationRuleName: string, callback: msRest.ServiceCallback): void; - /** - * @param resourceGroupName Name of the resource group within the azure subscription. - * @param namespaceName The Namespace name - * @param eventHubName The Event Hub name - * @param authorizationRuleName The authorization rule name. - * @param options The optional parameters - * @param callback The callback - */ - getAuthorizationRule(resourceGroupName: string, namespaceName: string, eventHubName: string, authorizationRuleName: string, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; - getAuthorizationRule(resourceGroupName: string, namespaceName: string, eventHubName: string, authorizationRuleName: string, options?: msRest.RequestOptionsBase | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { + * @param options The options parameters. + */ + getAuthorizationRule( + resourceGroupName: string, + namespaceName: string, + eventHubName: string, + authorizationRuleName: string, + options?: EventHubsGetAuthorizationRuleOptionalParams + ): Promise { return this.client.sendOperationRequest( { resourceGroupName, @@ -143,8 +277,8 @@ export class EventHubs { authorizationRuleName, options }, - getAuthorizationRuleOperationSpec, - callback) as Promise; + getAuthorizationRuleOperationSpec + ); } /** @@ -153,28 +287,15 @@ export class EventHubs { * @param namespaceName The Namespace name * @param eventHubName The Event Hub name * @param authorizationRuleName The authorization rule name. - * @param [options] The optional parameters - * @returns Promise - */ - deleteAuthorizationRule(resourceGroupName: string, namespaceName: string, eventHubName: string, authorizationRuleName: string, options?: msRest.RequestOptionsBase): Promise; - /** - * @param resourceGroupName Name of the resource group within the azure subscription. - * @param namespaceName The Namespace name - * @param eventHubName The Event Hub name - * @param authorizationRuleName The authorization rule name. - * @param callback The callback - */ - deleteAuthorizationRule(resourceGroupName: string, namespaceName: string, eventHubName: string, authorizationRuleName: string, callback: msRest.ServiceCallback): void; - /** - * @param resourceGroupName Name of the resource group within the azure subscription. - * @param namespaceName The Namespace name - * @param eventHubName The Event Hub name - * @param authorizationRuleName The authorization rule name. - * @param options The optional parameters - * @param callback The callback - */ - deleteAuthorizationRule(resourceGroupName: string, namespaceName: string, eventHubName: string, authorizationRuleName: string, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; - deleteAuthorizationRule(resourceGroupName: string, namespaceName: string, eventHubName: string, authorizationRuleName: string, options?: msRest.RequestOptionsBase | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { + * @param options The options parameters. + */ + deleteAuthorizationRule( + resourceGroupName: string, + namespaceName: string, + eventHubName: string, + authorizationRuleName: string, + options?: EventHubsDeleteAuthorizationRuleOptionalParams + ): Promise { return this.client.sendOperationRequest( { resourceGroupName, @@ -183,8 +304,8 @@ export class EventHubs { authorizationRuleName, options }, - deleteAuthorizationRuleOperationSpec, - callback); + deleteAuthorizationRuleOperationSpec + ); } /** @@ -193,28 +314,15 @@ export class EventHubs { * @param namespaceName The Namespace name * @param eventHubName The Event Hub name * @param authorizationRuleName The authorization rule name. - * @param [options] The optional parameters - * @returns Promise - */ - listKeys(resourceGroupName: string, namespaceName: string, eventHubName: string, authorizationRuleName: string, options?: msRest.RequestOptionsBase): Promise; - /** - * @param resourceGroupName Name of the resource group within the azure subscription. - * @param namespaceName The Namespace name - * @param eventHubName The Event Hub name - * @param authorizationRuleName The authorization rule name. - * @param callback The callback - */ - listKeys(resourceGroupName: string, namespaceName: string, eventHubName: string, authorizationRuleName: string, callback: msRest.ServiceCallback): void; - /** - * @param resourceGroupName Name of the resource group within the azure subscription. - * @param namespaceName The Namespace name - * @param eventHubName The Event Hub name - * @param authorizationRuleName The authorization rule name. - * @param options The optional parameters - * @param callback The callback - */ - listKeys(resourceGroupName: string, namespaceName: string, eventHubName: string, authorizationRuleName: string, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; - listKeys(resourceGroupName: string, namespaceName: string, eventHubName: string, authorizationRuleName: string, options?: msRest.RequestOptionsBase | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { + * @param options The options parameters. + */ + listKeys( + resourceGroupName: string, + namespaceName: string, + eventHubName: string, + authorizationRuleName: string, + options?: EventHubsListKeysOptionalParams + ): Promise { return this.client.sendOperationRequest( { resourceGroupName, @@ -223,8 +331,8 @@ export class EventHubs { authorizationRuleName, options }, - listKeysOperationSpec, - callback) as Promise; + listKeysOperationSpec + ); } /** @@ -234,33 +342,17 @@ export class EventHubs { * @param eventHubName The Event Hub name * @param authorizationRuleName The authorization rule name. * @param parameters Parameters supplied to regenerate the AuthorizationRule Keys - * (PrimaryKey/SecondaryKey). - * @param [options] The optional parameters - * @returns Promise - */ - regenerateKeys(resourceGroupName: string, namespaceName: string, eventHubName: string, authorizationRuleName: string, parameters: Models.RegenerateAccessKeyParameters, options?: msRest.RequestOptionsBase): Promise; - /** - * @param resourceGroupName Name of the resource group within the azure subscription. - * @param namespaceName The Namespace name - * @param eventHubName The Event Hub name - * @param authorizationRuleName The authorization rule name. - * @param parameters Parameters supplied to regenerate the AuthorizationRule Keys - * (PrimaryKey/SecondaryKey). - * @param callback The callback - */ - regenerateKeys(resourceGroupName: string, namespaceName: string, eventHubName: string, authorizationRuleName: string, parameters: Models.RegenerateAccessKeyParameters, callback: msRest.ServiceCallback): void; - /** - * @param resourceGroupName Name of the resource group within the azure subscription. - * @param namespaceName The Namespace name - * @param eventHubName The Event Hub name - * @param authorizationRuleName The authorization rule name. - * @param parameters Parameters supplied to regenerate the AuthorizationRule Keys - * (PrimaryKey/SecondaryKey). - * @param options The optional parameters - * @param callback The callback - */ - regenerateKeys(resourceGroupName: string, namespaceName: string, eventHubName: string, authorizationRuleName: string, parameters: Models.RegenerateAccessKeyParameters, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; - regenerateKeys(resourceGroupName: string, namespaceName: string, eventHubName: string, authorizationRuleName: string, parameters: Models.RegenerateAccessKeyParameters, options?: msRest.RequestOptionsBase | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { + * (PrimaryKey/SecondaryKey). + * @param options The options parameters. + */ + regenerateKeys( + resourceGroupName: string, + namespaceName: string, + eventHubName: string, + authorizationRuleName: string, + parameters: RegenerateAccessKeyParameters, + options?: EventHubsRegenerateKeysOptionalParams + ): Promise { return this.client.sendOperationRequest( { resourceGroupName, @@ -270,40 +362,25 @@ export class EventHubs { parameters, options }, - regenerateKeysOperationSpec, - callback) as Promise; + regenerateKeysOperationSpec + ); } /** * Gets all the Event Hubs in a Namespace. * @param resourceGroupName Name of the resource group within the azure subscription. * @param namespaceName The Namespace name - * @param [options] The optional parameters - * @returns Promise - */ - listByNamespace(resourceGroupName: string, namespaceName: string, options?: Models.EventHubsListByNamespaceOptionalParams): Promise; - /** - * @param resourceGroupName Name of the resource group within the azure subscription. - * @param namespaceName The Namespace name - * @param callback The callback + * @param options The options parameters. */ - listByNamespace(resourceGroupName: string, namespaceName: string, callback: msRest.ServiceCallback): void; - /** - * @param resourceGroupName Name of the resource group within the azure subscription. - * @param namespaceName The Namespace name - * @param options The optional parameters - * @param callback The callback - */ - listByNamespace(resourceGroupName: string, namespaceName: string, options: Models.EventHubsListByNamespaceOptionalParams, callback: msRest.ServiceCallback): void; - listByNamespace(resourceGroupName: string, namespaceName: string, options?: Models.EventHubsListByNamespaceOptionalParams | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { + private _listByNamespace( + resourceGroupName: string, + namespaceName: string, + options?: EventHubsListByNamespaceOptionalParams + ): Promise { return this.client.sendOperationRequest( - { - resourceGroupName, - namespaceName, - options - }, - listByNamespaceOperationSpec, - callback) as Promise; + { resourceGroupName, namespaceName, options }, + listByNamespaceOperationSpec + ); } /** @@ -312,38 +389,19 @@ export class EventHubs { * @param namespaceName The Namespace name * @param eventHubName The Event Hub name * @param parameters Parameters supplied to create an Event Hub resource. - * @param [options] The optional parameters - * @returns Promise - */ - createOrUpdate(resourceGroupName: string, namespaceName: string, eventHubName: string, parameters: Models.Eventhub, options?: msRest.RequestOptionsBase): Promise; - /** - * @param resourceGroupName Name of the resource group within the azure subscription. - * @param namespaceName The Namespace name - * @param eventHubName The Event Hub name - * @param parameters Parameters supplied to create an Event Hub resource. - * @param callback The callback - */ - createOrUpdate(resourceGroupName: string, namespaceName: string, eventHubName: string, parameters: Models.Eventhub, callback: msRest.ServiceCallback): void; - /** - * @param resourceGroupName Name of the resource group within the azure subscription. - * @param namespaceName The Namespace name - * @param eventHubName The Event Hub name - * @param parameters Parameters supplied to create an Event Hub resource. - * @param options The optional parameters - * @param callback The callback - */ - createOrUpdate(resourceGroupName: string, namespaceName: string, eventHubName: string, parameters: Models.Eventhub, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; - createOrUpdate(resourceGroupName: string, namespaceName: string, eventHubName: string, parameters: Models.Eventhub, options?: msRest.RequestOptionsBase | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { + * @param options The options parameters. + */ + createOrUpdate( + resourceGroupName: string, + namespaceName: string, + eventHubName: string, + parameters: Eventhub, + options?: EventHubsCreateOrUpdateOptionalParams + ): Promise { return this.client.sendOperationRequest( - { - resourceGroupName, - namespaceName, - eventHubName, - parameters, - options - }, - createOrUpdateOperationSpec, - callback) as Promise; + { resourceGroupName, namespaceName, eventHubName, parameters, options }, + createOrUpdateOperationSpec + ); } /** @@ -351,35 +409,18 @@ export class EventHubs { * @param resourceGroupName Name of the resource group within the azure subscription. * @param namespaceName The Namespace name * @param eventHubName The Event Hub name - * @param [options] The optional parameters - * @returns Promise - */ - deleteMethod(resourceGroupName: string, namespaceName: string, eventHubName: string, options?: msRest.RequestOptionsBase): Promise; - /** - * @param resourceGroupName Name of the resource group within the azure subscription. - * @param namespaceName The Namespace name - * @param eventHubName The Event Hub name - * @param callback The callback - */ - deleteMethod(resourceGroupName: string, namespaceName: string, eventHubName: string, callback: msRest.ServiceCallback): void; - /** - * @param resourceGroupName Name of the resource group within the azure subscription. - * @param namespaceName The Namespace name - * @param eventHubName The Event Hub name - * @param options The optional parameters - * @param callback The callback - */ - deleteMethod(resourceGroupName: string, namespaceName: string, eventHubName: string, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; - deleteMethod(resourceGroupName: string, namespaceName: string, eventHubName: string, options?: msRest.RequestOptionsBase | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { + * @param options The options parameters. + */ + delete( + resourceGroupName: string, + namespaceName: string, + eventHubName: string, + options?: EventHubsDeleteOptionalParams + ): Promise { return this.client.sendOperationRequest( - { - resourceGroupName, - namespaceName, - eventHubName, - options - }, - deleteMethodOperationSpec, - callback); + { resourceGroupName, namespaceName, eventHubName, options }, + deleteOperationSpec + ); } /** @@ -387,111 +428,67 @@ export class EventHubs { * @param resourceGroupName Name of the resource group within the azure subscription. * @param namespaceName The Namespace name * @param eventHubName The Event Hub name - * @param [options] The optional parameters - * @returns Promise - */ - get(resourceGroupName: string, namespaceName: string, eventHubName: string, options?: msRest.RequestOptionsBase): Promise; - /** - * @param resourceGroupName Name of the resource group within the azure subscription. - * @param namespaceName The Namespace name - * @param eventHubName The Event Hub name - * @param callback The callback - */ - get(resourceGroupName: string, namespaceName: string, eventHubName: string, callback: msRest.ServiceCallback): void; - /** - * @param resourceGroupName Name of the resource group within the azure subscription. - * @param namespaceName The Namespace name - * @param eventHubName The Event Hub name - * @param options The optional parameters - * @param callback The callback - */ - get(resourceGroupName: string, namespaceName: string, eventHubName: string, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; - get(resourceGroupName: string, namespaceName: string, eventHubName: string, options?: msRest.RequestOptionsBase | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { + * @param options The options parameters. + */ + get( + resourceGroupName: string, + namespaceName: string, + eventHubName: string, + options?: EventHubsGetOptionalParams + ): Promise { return this.client.sendOperationRequest( - { - resourceGroupName, - namespaceName, - eventHubName, - options - }, - getOperationSpec, - callback) as Promise; + { resourceGroupName, namespaceName, eventHubName, options }, + getOperationSpec + ); } /** - * Gets the authorization rules for an Event Hub. - * @param nextPageLink The NextLink from the previous successful call to List operation. - * @param [options] The optional parameters - * @returns Promise - */ - listAuthorizationRulesNext(nextPageLink: string, options?: msRest.RequestOptionsBase): Promise; - /** - * @param nextPageLink The NextLink from the previous successful call to List operation. - * @param callback The callback - */ - listAuthorizationRulesNext(nextPageLink: string, callback: msRest.ServiceCallback): void; - /** - * @param nextPageLink The NextLink from the previous successful call to List operation. - * @param options The optional parameters - * @param callback The callback - */ - listAuthorizationRulesNext(nextPageLink: string, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; - listAuthorizationRulesNext(nextPageLink: string, options?: msRest.RequestOptionsBase | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { + * ListAuthorizationRulesNext + * @param resourceGroupName Name of the resource group within the azure subscription. + * @param namespaceName The Namespace name + * @param eventHubName The Event Hub name + * @param nextLink The nextLink from the previous successful call to the ListAuthorizationRules method. + * @param options The options parameters. + */ + private _listAuthorizationRulesNext( + resourceGroupName: string, + namespaceName: string, + eventHubName: string, + nextLink: string, + options?: EventHubsListAuthorizationRulesNextOptionalParams + ): Promise { return this.client.sendOperationRequest( - { - nextPageLink, - options - }, - listAuthorizationRulesNextOperationSpec, - callback) as Promise; + { resourceGroupName, namespaceName, eventHubName, nextLink, options }, + listAuthorizationRulesNextOperationSpec + ); } /** - * Gets all the Event Hubs in a Namespace. - * @param nextPageLink The NextLink from the previous successful call to List operation. - * @param [options] The optional parameters - * @returns Promise - */ - listByNamespaceNext(nextPageLink: string, options?: msRest.RequestOptionsBase): Promise; - /** - * @param nextPageLink The NextLink from the previous successful call to List operation. - * @param callback The callback - */ - listByNamespaceNext(nextPageLink: string, callback: msRest.ServiceCallback): void; - /** - * @param nextPageLink The NextLink from the previous successful call to List operation. - * @param options The optional parameters - * @param callback The callback - */ - listByNamespaceNext(nextPageLink: string, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; - listByNamespaceNext(nextPageLink: string, options?: msRest.RequestOptionsBase | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { + * ListByNamespaceNext + * @param resourceGroupName Name of the resource group within the azure subscription. + * @param namespaceName The Namespace name + * @param nextLink The nextLink from the previous successful call to the ListByNamespace method. + * @param options The options parameters. + */ + private _listByNamespaceNext( + resourceGroupName: string, + namespaceName: string, + nextLink: string, + options?: EventHubsListByNamespaceNextOptionalParams + ): Promise { return this.client.sendOperationRequest( - { - nextPageLink, - options - }, - listByNamespaceNextOperationSpec, - callback) as Promise; + { resourceGroupName, namespaceName, nextLink, options }, + listByNamespaceNextOperationSpec + ); } } - // Operation Specifications -const serializer = new msRest.Serializer(Mappers); -const listAuthorizationRulesOperationSpec: msRest.OperationSpec = { +const serializer = coreClient.createSerializer(Mappers, /* isXml */ false); + +const listAuthorizationRulesOperationSpec: coreClient.OperationSpec = { + path: + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventHub/namespaces/{namespaceName}/eventhubs/{eventHubName}/authorizationRules", httpMethod: "GET", - path: "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventHub/namespaces/{namespaceName}/eventhubs/{eventHubName}/authorizationRules", - urlParameters: [ - Parameters.resourceGroupName, - Parameters.namespaceName, - Parameters.eventHubName, - Parameters.subscriptionId - ], - queryParameters: [ - Parameters.apiVersion1 - ], - headerParameters: [ - Parameters.acceptLanguage - ], responses: { 200: { bodyMapper: Mappers.AuthorizationRuleListResult @@ -500,32 +497,21 @@ const listAuthorizationRulesOperationSpec: msRest.OperationSpec = { bodyMapper: Mappers.ErrorResponse } }, - serializer -}; - -const createOrUpdateAuthorizationRuleOperationSpec: msRest.OperationSpec = { - httpMethod: "PUT", - path: "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventHub/namespaces/{namespaceName}/eventhubs/{eventHubName}/authorizationRules/{authorizationRuleName}", + queryParameters: [Parameters.apiVersion1], urlParameters: [ + Parameters.$host, + Parameters.subscriptionId, Parameters.resourceGroupName, Parameters.namespaceName, - Parameters.eventHubName, - Parameters.authorizationRuleName, - Parameters.subscriptionId + Parameters.eventHubName ], - queryParameters: [ - Parameters.apiVersion1 - ], - headerParameters: [ - Parameters.acceptLanguage - ], - requestBody: { - parameterPath: "parameters", - mapper: { - ...Mappers.AuthorizationRule, - required: true - } - }, + headerParameters: [Parameters.accept], + serializer +}; +const createOrUpdateAuthorizationRuleOperationSpec: coreClient.OperationSpec = { + path: + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventHub/namespaces/{namespaceName}/eventhubs/{eventHubName}/authorizationRules/{authorizationRuleName}", + httpMethod: "PUT", responses: { 200: { bodyMapper: Mappers.AuthorizationRule @@ -534,25 +520,24 @@ const createOrUpdateAuthorizationRuleOperationSpec: msRest.OperationSpec = { bodyMapper: Mappers.ErrorResponse } }, - serializer -}; - -const getAuthorizationRuleOperationSpec: msRest.OperationSpec = { - httpMethod: "GET", - path: "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventHub/namespaces/{namespaceName}/eventhubs/{eventHubName}/authorizationRules/{authorizationRuleName}", + requestBody: Parameters.parameters2, + queryParameters: [Parameters.apiVersion1], urlParameters: [ + Parameters.$host, + Parameters.subscriptionId, Parameters.resourceGroupName, Parameters.namespaceName, - Parameters.eventHubName, Parameters.authorizationRuleName, - Parameters.subscriptionId - ], - queryParameters: [ - Parameters.apiVersion1 - ], - headerParameters: [ - Parameters.acceptLanguage + Parameters.eventHubName ], + headerParameters: [Parameters.accept, Parameters.contentType], + mediaType: "json", + serializer +}; +const getAuthorizationRuleOperationSpec: coreClient.OperationSpec = { + path: + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventHub/namespaces/{namespaceName}/eventhubs/{eventHubName}/authorizationRules/{authorizationRuleName}", + httpMethod: "GET", responses: { 200: { bodyMapper: Mappers.AuthorizationRule @@ -561,25 +546,22 @@ const getAuthorizationRuleOperationSpec: msRest.OperationSpec = { bodyMapper: Mappers.ErrorResponse } }, - serializer -}; - -const deleteAuthorizationRuleOperationSpec: msRest.OperationSpec = { - httpMethod: "DELETE", - path: "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventHub/namespaces/{namespaceName}/eventhubs/{eventHubName}/authorizationRules/{authorizationRuleName}", + queryParameters: [Parameters.apiVersion1], urlParameters: [ + Parameters.$host, + Parameters.subscriptionId, Parameters.resourceGroupName, Parameters.namespaceName, - Parameters.eventHubName, Parameters.authorizationRuleName, - Parameters.subscriptionId - ], - queryParameters: [ - Parameters.apiVersion1 - ], - headerParameters: [ - Parameters.acceptLanguage + Parameters.eventHubName ], + headerParameters: [Parameters.accept], + serializer +}; +const deleteAuthorizationRuleOperationSpec: coreClient.OperationSpec = { + path: + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventHub/namespaces/{namespaceName}/eventhubs/{eventHubName}/authorizationRules/{authorizationRuleName}", + httpMethod: "DELETE", responses: { 200: {}, 204: {}, @@ -587,25 +569,22 @@ const deleteAuthorizationRuleOperationSpec: msRest.OperationSpec = { bodyMapper: Mappers.ErrorResponse } }, - serializer -}; - -const listKeysOperationSpec: msRest.OperationSpec = { - httpMethod: "POST", - path: "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventHub/namespaces/{namespaceName}/eventhubs/{eventHubName}/authorizationRules/{authorizationRuleName}/listKeys", + queryParameters: [Parameters.apiVersion1], urlParameters: [ + Parameters.$host, + Parameters.subscriptionId, Parameters.resourceGroupName, Parameters.namespaceName, - Parameters.eventHubName, Parameters.authorizationRuleName, - Parameters.subscriptionId - ], - queryParameters: [ - Parameters.apiVersion1 - ], - headerParameters: [ - Parameters.acceptLanguage + Parameters.eventHubName ], + headerParameters: [Parameters.accept], + serializer +}; +const listKeysOperationSpec: coreClient.OperationSpec = { + path: + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventHub/namespaces/{namespaceName}/eventhubs/{eventHubName}/authorizationRules/{authorizationRuleName}/listKeys", + httpMethod: "POST", responses: { 200: { bodyMapper: Mappers.AccessKeys @@ -614,32 +593,22 @@ const listKeysOperationSpec: msRest.OperationSpec = { bodyMapper: Mappers.ErrorResponse } }, - serializer -}; - -const regenerateKeysOperationSpec: msRest.OperationSpec = { - httpMethod: "POST", - path: "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventHub/namespaces/{namespaceName}/eventhubs/{eventHubName}/authorizationRules/{authorizationRuleName}/regenerateKeys", + queryParameters: [Parameters.apiVersion1], urlParameters: [ + Parameters.$host, + Parameters.subscriptionId, Parameters.resourceGroupName, Parameters.namespaceName, - Parameters.eventHubName, Parameters.authorizationRuleName, - Parameters.subscriptionId - ], - queryParameters: [ - Parameters.apiVersion1 + Parameters.eventHubName ], - headerParameters: [ - Parameters.acceptLanguage - ], - requestBody: { - parameterPath: "parameters", - mapper: { - ...Mappers.RegenerateAccessKeyParameters, - required: true - } - }, + headerParameters: [Parameters.accept], + serializer +}; +const regenerateKeysOperationSpec: coreClient.OperationSpec = { + path: + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventHub/namespaces/{namespaceName}/eventhubs/{eventHubName}/authorizationRules/{authorizationRuleName}/regenerateKeys", + httpMethod: "POST", responses: { 200: { bodyMapper: Mappers.AccessKeys @@ -648,25 +617,24 @@ const regenerateKeysOperationSpec: msRest.OperationSpec = { bodyMapper: Mappers.ErrorResponse } }, - serializer -}; - -const listByNamespaceOperationSpec: msRest.OperationSpec = { - httpMethod: "GET", - path: "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventHub/namespaces/{namespaceName}/eventhubs", + requestBody: Parameters.parameters3, + queryParameters: [Parameters.apiVersion1], urlParameters: [ + Parameters.$host, + Parameters.subscriptionId, Parameters.resourceGroupName, Parameters.namespaceName, - Parameters.subscriptionId - ], - queryParameters: [ - Parameters.apiVersion1, - Parameters.skip, - Parameters.top - ], - headerParameters: [ - Parameters.acceptLanguage + Parameters.authorizationRuleName, + Parameters.eventHubName ], + headerParameters: [Parameters.accept, Parameters.contentType], + mediaType: "json", + serializer +}; +const listByNamespaceOperationSpec: coreClient.OperationSpec = { + path: + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventHub/namespaces/{namespaceName}/eventhubs", + httpMethod: "GET", responses: { 200: { bodyMapper: Mappers.EventHubListResult @@ -675,31 +643,20 @@ const listByNamespaceOperationSpec: msRest.OperationSpec = { bodyMapper: Mappers.ErrorResponse } }, - serializer -}; - -const createOrUpdateOperationSpec: msRest.OperationSpec = { - httpMethod: "PUT", - path: "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventHub/namespaces/{namespaceName}/eventhubs/{eventHubName}", + queryParameters: [Parameters.apiVersion1, Parameters.skip, Parameters.top], urlParameters: [ + Parameters.$host, + Parameters.subscriptionId, Parameters.resourceGroupName, - Parameters.namespaceName, - Parameters.eventHubName, - Parameters.subscriptionId - ], - queryParameters: [ - Parameters.apiVersion1 - ], - headerParameters: [ - Parameters.acceptLanguage + Parameters.namespaceName ], - requestBody: { - parameterPath: "parameters", - mapper: { - ...Mappers.Eventhub, - required: true - } - }, + headerParameters: [Parameters.accept], + serializer +}; +const createOrUpdateOperationSpec: coreClient.OperationSpec = { + path: + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventHub/namespaces/{namespaceName}/eventhubs/{eventHubName}", + httpMethod: "PUT", responses: { 200: { bodyMapper: Mappers.Eventhub @@ -708,24 +665,23 @@ const createOrUpdateOperationSpec: msRest.OperationSpec = { bodyMapper: Mappers.ErrorResponse } }, - serializer -}; - -const deleteMethodOperationSpec: msRest.OperationSpec = { - httpMethod: "DELETE", - path: "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventHub/namespaces/{namespaceName}/eventhubs/{eventHubName}", + requestBody: Parameters.parameters6, + queryParameters: [Parameters.apiVersion1], urlParameters: [ + Parameters.$host, + Parameters.subscriptionId, Parameters.resourceGroupName, Parameters.namespaceName, - Parameters.eventHubName, - Parameters.subscriptionId - ], - queryParameters: [ - Parameters.apiVersion1 - ], - headerParameters: [ - Parameters.acceptLanguage + Parameters.eventHubName ], + headerParameters: [Parameters.accept, Parameters.contentType], + mediaType: "json", + serializer +}; +const deleteOperationSpec: coreClient.OperationSpec = { + path: + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventHub/namespaces/{namespaceName}/eventhubs/{eventHubName}", + httpMethod: "DELETE", responses: { 200: {}, 204: {}, @@ -733,24 +689,21 @@ const deleteMethodOperationSpec: msRest.OperationSpec = { bodyMapper: Mappers.ErrorResponse } }, - serializer -}; - -const getOperationSpec: msRest.OperationSpec = { - httpMethod: "GET", - path: "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventHub/namespaces/{namespaceName}/eventhubs/{eventHubName}", + queryParameters: [Parameters.apiVersion1], urlParameters: [ + Parameters.$host, + Parameters.subscriptionId, Parameters.resourceGroupName, Parameters.namespaceName, - Parameters.eventHubName, - Parameters.subscriptionId - ], - queryParameters: [ - Parameters.apiVersion1 - ], - headerParameters: [ - Parameters.acceptLanguage + Parameters.eventHubName ], + headerParameters: [Parameters.accept], + serializer +}; +const getOperationSpec: coreClient.OperationSpec = { + path: + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventHub/namespaces/{namespaceName}/eventhubs/{eventHubName}", + httpMethod: "GET", responses: { 200: { bodyMapper: Mappers.Eventhub @@ -759,19 +712,20 @@ const getOperationSpec: msRest.OperationSpec = { bodyMapper: Mappers.ErrorResponse } }, + queryParameters: [Parameters.apiVersion1], + urlParameters: [ + Parameters.$host, + Parameters.subscriptionId, + Parameters.resourceGroupName, + Parameters.namespaceName, + Parameters.eventHubName + ], + headerParameters: [Parameters.accept], serializer }; - -const listAuthorizationRulesNextOperationSpec: msRest.OperationSpec = { - httpMethod: "GET", - baseUrl: "https://management.azure.com", +const listAuthorizationRulesNextOperationSpec: coreClient.OperationSpec = { path: "{nextLink}", - urlParameters: [ - Parameters.nextPageLink - ], - headerParameters: [ - Parameters.acceptLanguage - ], + httpMethod: "GET", responses: { 200: { bodyMapper: Mappers.AuthorizationRuleListResult @@ -780,19 +734,21 @@ const listAuthorizationRulesNextOperationSpec: msRest.OperationSpec = { bodyMapper: Mappers.ErrorResponse } }, + queryParameters: [Parameters.apiVersion1], + urlParameters: [ + Parameters.$host, + Parameters.subscriptionId, + Parameters.resourceGroupName, + Parameters.nextLink, + Parameters.namespaceName, + Parameters.eventHubName + ], + headerParameters: [Parameters.accept], serializer }; - -const listByNamespaceNextOperationSpec: msRest.OperationSpec = { - httpMethod: "GET", - baseUrl: "https://management.azure.com", +const listByNamespaceNextOperationSpec: coreClient.OperationSpec = { path: "{nextLink}", - urlParameters: [ - Parameters.nextPageLink - ], - headerParameters: [ - Parameters.acceptLanguage - ], + httpMethod: "GET", responses: { 200: { bodyMapper: Mappers.EventHubListResult @@ -801,5 +757,14 @@ const listByNamespaceNextOperationSpec: msRest.OperationSpec = { bodyMapper: Mappers.ErrorResponse } }, + queryParameters: [Parameters.apiVersion1, Parameters.skip, Parameters.top], + urlParameters: [ + Parameters.$host, + Parameters.subscriptionId, + Parameters.resourceGroupName, + Parameters.nextLink, + Parameters.namespaceName + ], + headerParameters: [Parameters.accept], serializer }; diff --git a/sdk/eventhub/arm-eventhub-profile-2020-09-01-hybrid/src/operations/index.ts b/sdk/eventhub/arm-eventhub-profile-2020-09-01-hybrid/src/operations/index.ts index 5a458ee8222b..7bae75aa702a 100644 --- a/sdk/eventhub/arm-eventhub-profile-2020-09-01-hybrid/src/operations/index.ts +++ b/sdk/eventhub/arm-eventhub-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 "./clusters"; diff --git a/sdk/eventhub/arm-eventhub-profile-2020-09-01-hybrid/src/operations/namespaces.ts b/sdk/eventhub/arm-eventhub-profile-2020-09-01-hybrid/src/operations/namespaces.ts index 9164cf25d917..ffd847d2dc97 100644 --- a/sdk/eventhub/arm-eventhub-profile-2020-09-01-hybrid/src/operations/namespaces.ts +++ b/sdk/eventhub/arm-eventhub-profile-2020-09-01-hybrid/src/operations/namespaces.ts @@ -1,210 +1,486 @@ /* - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for - * license information. + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. * * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is - * regenerated. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. */ -import * as msRest from "@azure/ms-rest-js"; -import * as msRestAzure from "@azure/ms-rest-azure-js"; -import * as Models from "../models"; -import * as Mappers from "../models/namespacesMappers"; +import { PagedAsyncIterableIterator } from "@azure/core-paging"; +import { Namespaces } from "../operationsInterfaces"; +import * as coreClient from "@azure/core-client"; +import * as Mappers from "../models/mappers"; import * as Parameters from "../models/parameters"; -import { EventHubManagementClientContext } from "../eventHubManagementClientContext"; +import { EventHubManagementClient } from "../eventHubManagementClient"; +import { PollerLike, PollOperationState, LroEngine } from "@azure/core-lro"; +import { LroImpl } from "../lroImpl"; +import { + EHNamespace, + NamespacesListNextOptionalParams, + NamespacesListOptionalParams, + NamespacesListByResourceGroupNextOptionalParams, + NamespacesListByResourceGroupOptionalParams, + AuthorizationRule, + NamespacesListAuthorizationRulesNextOptionalParams, + NamespacesListAuthorizationRulesOptionalParams, + NamespacesListResponse, + NamespacesListByResourceGroupResponse, + NamespacesCreateOrUpdateOptionalParams, + NamespacesCreateOrUpdateResponse, + NamespacesDeleteOptionalParams, + NamespacesGetOptionalParams, + NamespacesGetResponse, + NamespacesUpdateOptionalParams, + NamespacesUpdateResponse, + NamespacesListAuthorizationRulesResponse, + NamespacesCreateOrUpdateAuthorizationRuleOptionalParams, + NamespacesCreateOrUpdateAuthorizationRuleResponse, + NamespacesDeleteAuthorizationRuleOptionalParams, + NamespacesGetAuthorizationRuleOptionalParams, + NamespacesGetAuthorizationRuleResponse, + NamespacesListKeysOptionalParams, + NamespacesListKeysResponse, + RegenerateAccessKeyParameters, + NamespacesRegenerateKeysOptionalParams, + NamespacesRegenerateKeysResponse, + CheckNameAvailabilityParameter, + NamespacesCheckNameAvailabilityOptionalParams, + NamespacesCheckNameAvailabilityResponse, + NamespacesListNextResponse, + NamespacesListByResourceGroupNextResponse, + NamespacesListAuthorizationRulesNextResponse +} from "../models"; -/** Class representing a Namespaces. */ -export class Namespaces { - private readonly client: EventHubManagementClientContext; +/// +/** Class containing Namespaces operations. */ +export class NamespacesImpl implements Namespaces { + private readonly client: EventHubManagementClient; /** - * Create a Namespaces. - * @param {EventHubManagementClientContext} client Reference to the service client. + * Initialize a new instance of the class Namespaces class. + * @param client Reference to the service client */ - constructor(client: EventHubManagementClientContext) { + constructor(client: EventHubManagementClient) { this.client = client; } /** * Lists all the available Namespaces within a subscription, irrespective of the resource groups. - * @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?: NamespacesListOptionalParams + ): PagedAsyncIterableIterator { + const iter = this.listPagingAll(options); + return { + next() { + return iter.next(); }, - listOperationSpec, - callback) as Promise; + [Symbol.asyncIterator]() { + return this; + }, + byPage: () => { + return this.listPagingPage(options); + } + }; + } + + private async *listPagingPage( + options?: NamespacesListOptionalParams + ): AsyncIterableIterator { + let result = await this._list(options); + yield result.value || []; + let continuationToken = result.nextLink; + while (continuationToken) { + result = await this._listNext(continuationToken, options); + continuationToken = result.nextLink; + yield result.value || []; + } + } + + private async *listPagingAll( + options?: NamespacesListOptionalParams + ): AsyncIterableIterator { + for await (const page of this.listPagingPage(options)) { + yield* page; + } } /** * Lists the available Namespaces within a resource group. * @param resourceGroupName Name of the resource group within the azure subscription. - * @param [options] The optional parameters - * @returns Promise + * @param options The options parameters. */ - listByResourceGroup(resourceGroupName: string, options?: msRest.RequestOptionsBase): Promise; - /** - * @param resourceGroupName Name of the resource group within the azure subscription. - * @param callback The callback - */ - listByResourceGroup(resourceGroupName: string, callback: msRest.ServiceCallback): void; + public listByResourceGroup( + resourceGroupName: string, + options?: NamespacesListByResourceGroupOptionalParams + ): PagedAsyncIterableIterator { + const iter = this.listByResourceGroupPagingAll(resourceGroupName, options); + return { + next() { + return iter.next(); + }, + [Symbol.asyncIterator]() { + return this; + }, + byPage: () => { + return this.listByResourceGroupPagingPage(resourceGroupName, options); + } + }; + } + + private async *listByResourceGroupPagingPage( + resourceGroupName: string, + options?: NamespacesListByResourceGroupOptionalParams + ): AsyncIterableIterator { + let result = await this._listByResourceGroup(resourceGroupName, options); + yield result.value || []; + let continuationToken = result.nextLink; + while (continuationToken) { + result = await this._listByResourceGroupNext( + resourceGroupName, + continuationToken, + options + ); + continuationToken = result.nextLink; + yield result.value || []; + } + } + + private async *listByResourceGroupPagingAll( + resourceGroupName: string, + options?: NamespacesListByResourceGroupOptionalParams + ): AsyncIterableIterator { + for await (const page of this.listByResourceGroupPagingPage( + resourceGroupName, + options + )) { + yield* page; + } + } + /** + * Gets a list of authorization rules for a Namespace. * @param resourceGroupName Name of the resource group within the azure subscription. - * @param options The optional parameters - * @param callback The callback + * @param namespaceName The Namespace name + * @param options The options parameters. */ - listByResourceGroup(resourceGroupName: string, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; - listByResourceGroup(resourceGroupName: string, options?: msRest.RequestOptionsBase | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { - return this.client.sendOperationRequest( - { + public listAuthorizationRules( + resourceGroupName: string, + namespaceName: string, + options?: NamespacesListAuthorizationRulesOptionalParams + ): PagedAsyncIterableIterator { + const iter = this.listAuthorizationRulesPagingAll( + resourceGroupName, + namespaceName, + options + ); + return { + next() { + return iter.next(); + }, + [Symbol.asyncIterator]() { + return this; + }, + byPage: () => { + return this.listAuthorizationRulesPagingPage( + resourceGroupName, + namespaceName, + options + ); + } + }; + } + + private async *listAuthorizationRulesPagingPage( + resourceGroupName: string, + namespaceName: string, + options?: NamespacesListAuthorizationRulesOptionalParams + ): AsyncIterableIterator { + let result = await this._listAuthorizationRules( + resourceGroupName, + namespaceName, + options + ); + yield result.value || []; + let continuationToken = result.nextLink; + while (continuationToken) { + result = await this._listAuthorizationRulesNext( resourceGroupName, + namespaceName, + continuationToken, options - }, - listByResourceGroupOperationSpec, - callback) as Promise; + ); + continuationToken = result.nextLink; + yield result.value || []; + } + } + + private async *listAuthorizationRulesPagingAll( + resourceGroupName: string, + namespaceName: string, + options?: NamespacesListAuthorizationRulesOptionalParams + ): AsyncIterableIterator { + for await (const page of this.listAuthorizationRulesPagingPage( + resourceGroupName, + namespaceName, + options + )) { + yield* page; + } } /** - * Creates or updates a namespace. Once created, this namespace's resource manifest is immutable. - * This operation is idempotent. - * @param resourceGroupName Name of the resource group within the azure subscription. - * @param namespaceName The Namespace name - * @param parameters Parameters for creating a namespace resource. - * @param [options] The optional parameters - * @returns Promise + * Lists all the available Namespaces within a subscription, irrespective of the resource groups. + * @param options The options parameters. */ - createOrUpdate(resourceGroupName: string, namespaceName: string, parameters: Models.EHNamespace, options?: msRest.RequestOptionsBase): Promise { - return this.beginCreateOrUpdate(resourceGroupName,namespaceName,parameters,options) - .then(lroPoller => lroPoller.pollUntilFinished()) as Promise; + private _list( + options?: NamespacesListOptionalParams + ): Promise { + return this.client.sendOperationRequest({ options }, listOperationSpec); } /** - * Deletes an existing namespace. This operation also removes all associated resources under the - * namespace. + * Lists the available Namespaces within a resource group. * @param resourceGroupName Name of the resource group within the azure subscription. - * @param namespaceName The Namespace name - * @param [options] The optional parameters - * @returns Promise + * @param options The options parameters. */ - deleteMethod(resourceGroupName: string, namespaceName: string, options?: msRest.RequestOptionsBase): Promise { - return this.beginDeleteMethod(resourceGroupName,namespaceName,options) - .then(lroPoller => lroPoller.pollUntilFinished()); + private _listByResourceGroup( + resourceGroupName: string, + options?: NamespacesListByResourceGroupOptionalParams + ): Promise { + return this.client.sendOperationRequest( + { resourceGroupName, options }, + listByResourceGroupOperationSpec + ); } /** - * Gets the description of the specified namespace. + * Creates or updates a namespace. Once created, this namespace's resource manifest is immutable. This + * operation is idempotent. * @param resourceGroupName Name of the resource group within the azure subscription. * @param namespaceName The Namespace name - * @param [options] The optional parameters - * @returns Promise + * @param parameters Parameters for creating a namespace resource. + * @param options The options parameters. */ - get(resourceGroupName: string, namespaceName: string, options?: msRest.RequestOptionsBase): Promise; + async beginCreateOrUpdate( + resourceGroupName: string, + namespaceName: string, + parameters: EHNamespace, + options?: NamespacesCreateOrUpdateOptionalParams + ): Promise< + PollerLike< + PollOperationState, + NamespacesCreateOrUpdateResponse + > + > { + const directSendOperation = async ( + args: coreClient.OperationArguments, + spec: coreClient.OperationSpec + ): Promise => { + return this.client.sendOperationRequest(args, spec); + }; + const sendOperation = async ( + args: coreClient.OperationArguments, + spec: coreClient.OperationSpec + ) => { + let currentRawResponse: + | coreClient.FullOperationResponse + | undefined = undefined; + const providedCallback = args.options?.onResponse; + const callback: coreClient.RawResponseCallback = ( + rawResponse: coreClient.FullOperationResponse, + flatResponse: unknown + ) => { + currentRawResponse = rawResponse; + providedCallback?.(rawResponse, flatResponse); + }; + const updatedArgs = { + ...args, + options: { + ...args.options, + onResponse: callback + } + }; + const flatResponse = await directSendOperation(updatedArgs, spec); + return { + flatResponse, + rawResponse: { + statusCode: currentRawResponse!.status, + body: currentRawResponse!.parsedBody, + headers: currentRawResponse!.headers.toJSON() + } + }; + }; + + const lro = new LroImpl( + sendOperation, + { resourceGroupName, namespaceName, parameters, options }, + createOrUpdateOperationSpec + ); + return new LroEngine(lro, { + resumeFrom: options?.resumeFrom, + intervalInMs: options?.updateIntervalInMs + }); + } + /** + * Creates or updates a namespace. Once created, this namespace's resource manifest is immutable. This + * operation is idempotent. * @param resourceGroupName Name of the resource group within the azure subscription. * @param namespaceName The Namespace name - * @param callback The callback + * @param parameters Parameters for creating a namespace resource. + * @param options The options parameters. */ - get(resourceGroupName: string, namespaceName: string, callback: msRest.ServiceCallback): void; + async beginCreateOrUpdateAndWait( + resourceGroupName: string, + namespaceName: string, + parameters: EHNamespace, + options?: NamespacesCreateOrUpdateOptionalParams + ): Promise { + const poller = await this.beginCreateOrUpdate( + resourceGroupName, + namespaceName, + parameters, + options + ); + return poller.pollUntilDone(); + } + /** + * Deletes an existing namespace. This operation also removes all associated resources under the + * namespace. * @param resourceGroupName Name of the resource group within the azure subscription. * @param namespaceName The Namespace name - * @param options The optional parameters - * @param callback The callback + * @param options The options parameters. */ - get(resourceGroupName: string, namespaceName: string, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; - get(resourceGroupName: string, namespaceName: string, options?: msRest.RequestOptionsBase | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { - return this.client.sendOperationRequest( - { - resourceGroupName, - namespaceName, - options - }, - getOperationSpec, - callback) as Promise; + async beginDelete( + resourceGroupName: string, + namespaceName: string, + options?: NamespacesDeleteOptionalParams + ): Promise, void>> { + const directSendOperation = async ( + args: coreClient.OperationArguments, + spec: coreClient.OperationSpec + ): Promise => { + return this.client.sendOperationRequest(args, spec); + }; + const sendOperation = async ( + args: coreClient.OperationArguments, + spec: coreClient.OperationSpec + ) => { + let currentRawResponse: + | coreClient.FullOperationResponse + | undefined = undefined; + const providedCallback = args.options?.onResponse; + const callback: coreClient.RawResponseCallback = ( + rawResponse: coreClient.FullOperationResponse, + flatResponse: unknown + ) => { + currentRawResponse = rawResponse; + providedCallback?.(rawResponse, flatResponse); + }; + const updatedArgs = { + ...args, + options: { + ...args.options, + onResponse: callback + } + }; + const flatResponse = await directSendOperation(updatedArgs, spec); + return { + flatResponse, + rawResponse: { + statusCode: currentRawResponse!.status, + body: currentRawResponse!.parsedBody, + headers: currentRawResponse!.headers.toJSON() + } + }; + }; + + const lro = new LroImpl( + sendOperation, + { resourceGroupName, namespaceName, options }, + deleteOperationSpec + ); + return new LroEngine(lro, { + resumeFrom: options?.resumeFrom, + intervalInMs: options?.updateIntervalInMs + }); } /** - * Creates or updates a namespace. Once created, this namespace's resource manifest is immutable. - * This operation is idempotent. + * Deletes an existing namespace. This operation also removes all associated resources under the + * namespace. * @param resourceGroupName Name of the resource group within the azure subscription. * @param namespaceName The Namespace name - * @param parameters Parameters for updating a namespace resource. - * @param [options] The optional parameters - * @returns Promise + * @param options The options parameters. */ - update(resourceGroupName: string, namespaceName: string, parameters: Models.EHNamespace, options?: msRest.RequestOptionsBase): Promise; + async beginDeleteAndWait( + resourceGroupName: string, + namespaceName: string, + options?: NamespacesDeleteOptionalParams + ): Promise { + const poller = await this.beginDelete( + resourceGroupName, + namespaceName, + options + ); + return poller.pollUntilDone(); + } + /** + * Gets the description of the specified namespace. * @param resourceGroupName Name of the resource group within the azure subscription. * @param namespaceName The Namespace name - * @param parameters Parameters for updating a namespace resource. - * @param callback The callback + * @param options The options parameters. */ - update(resourceGroupName: string, namespaceName: string, parameters: Models.EHNamespace, callback: msRest.ServiceCallback): void; + get( + resourceGroupName: string, + namespaceName: string, + options?: NamespacesGetOptionalParams + ): Promise { + return this.client.sendOperationRequest( + { resourceGroupName, namespaceName, options }, + getOperationSpec + ); + } + /** + * Creates or updates a namespace. Once created, this namespace's resource manifest is immutable. This + * operation is idempotent. * @param resourceGroupName Name of the resource group within the azure subscription. * @param namespaceName The Namespace name * @param parameters Parameters for updating a namespace resource. - * @param options The optional parameters - * @param callback The callback + * @param options The options parameters. */ - update(resourceGroupName: string, namespaceName: string, parameters: Models.EHNamespace, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; - update(resourceGroupName: string, namespaceName: string, parameters: Models.EHNamespace, options?: msRest.RequestOptionsBase | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { + update( + resourceGroupName: string, + namespaceName: string, + parameters: EHNamespace, + options?: NamespacesUpdateOptionalParams + ): Promise { return this.client.sendOperationRequest( - { - resourceGroupName, - namespaceName, - parameters, - options - }, - updateOperationSpec, - callback) as Promise; + { resourceGroupName, namespaceName, parameters, options }, + updateOperationSpec + ); } /** * Gets a list of authorization rules for a Namespace. * @param resourceGroupName Name of the resource group within the azure subscription. * @param namespaceName The Namespace name - * @param [options] The optional parameters - * @returns Promise - */ - listAuthorizationRules(resourceGroupName: string, namespaceName: string, options?: msRest.RequestOptionsBase): Promise; - /** - * @param resourceGroupName Name of the resource group within the azure subscription. - * @param namespaceName The Namespace name - * @param callback The callback + * @param options The options parameters. */ - listAuthorizationRules(resourceGroupName: string, namespaceName: string, callback: msRest.ServiceCallback): void; - /** - * @param resourceGroupName Name of the resource group within the azure subscription. - * @param namespaceName The Namespace name - * @param options The optional parameters - * @param callback The callback - */ - listAuthorizationRules(resourceGroupName: string, namespaceName: string, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; - listAuthorizationRules(resourceGroupName: string, namespaceName: string, options?: msRest.RequestOptionsBase | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { + private _listAuthorizationRules( + resourceGroupName: string, + namespaceName: string, + options?: NamespacesListAuthorizationRulesOptionalParams + ): Promise { return this.client.sendOperationRequest( - { - resourceGroupName, - namespaceName, - options - }, - listAuthorizationRulesOperationSpec, - callback) as Promise; + { resourceGroupName, namespaceName, options }, + listAuthorizationRulesOperationSpec + ); } /** @@ -213,28 +489,15 @@ export class Namespaces { * @param namespaceName The Namespace name * @param authorizationRuleName The authorization rule name. * @param parameters The shared access AuthorizationRule. - * @param [options] The optional parameters - * @returns Promise + * @param options The options parameters. */ - createOrUpdateAuthorizationRule(resourceGroupName: string, namespaceName: string, authorizationRuleName: string, parameters: Models.AuthorizationRule, options?: msRest.RequestOptionsBase): Promise; - /** - * @param resourceGroupName Name of the resource group within the azure subscription. - * @param namespaceName The Namespace name - * @param authorizationRuleName The authorization rule name. - * @param parameters The shared access AuthorizationRule. - * @param callback The callback - */ - createOrUpdateAuthorizationRule(resourceGroupName: string, namespaceName: string, authorizationRuleName: string, parameters: Models.AuthorizationRule, callback: msRest.ServiceCallback): void; - /** - * @param resourceGroupName Name of the resource group within the azure subscription. - * @param namespaceName The Namespace name - * @param authorizationRuleName The authorization rule name. - * @param parameters The shared access AuthorizationRule. - * @param options The optional parameters - * @param callback The callback - */ - createOrUpdateAuthorizationRule(resourceGroupName: string, namespaceName: string, authorizationRuleName: string, parameters: Models.AuthorizationRule, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; - createOrUpdateAuthorizationRule(resourceGroupName: string, namespaceName: string, authorizationRuleName: string, parameters: Models.AuthorizationRule, options?: msRest.RequestOptionsBase | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { + createOrUpdateAuthorizationRule( + resourceGroupName: string, + namespaceName: string, + authorizationRuleName: string, + parameters: AuthorizationRule, + options?: NamespacesCreateOrUpdateAuthorizationRuleOptionalParams + ): Promise { return this.client.sendOperationRequest( { resourceGroupName, @@ -243,8 +506,8 @@ export class Namespaces { parameters, options }, - createOrUpdateAuthorizationRuleOperationSpec, - callback) as Promise; + createOrUpdateAuthorizationRuleOperationSpec + ); } /** @@ -252,35 +515,18 @@ export class Namespaces { * @param resourceGroupName Name of the resource group within the azure subscription. * @param namespaceName The Namespace name * @param authorizationRuleName The authorization rule name. - * @param [options] The optional parameters - * @returns Promise - */ - deleteAuthorizationRule(resourceGroupName: string, namespaceName: string, authorizationRuleName: string, options?: msRest.RequestOptionsBase): Promise; - /** - * @param resourceGroupName Name of the resource group within the azure subscription. - * @param namespaceName The Namespace name - * @param authorizationRuleName The authorization rule name. - * @param callback The callback + * @param options The options parameters. */ - deleteAuthorizationRule(resourceGroupName: string, namespaceName: string, authorizationRuleName: string, callback: msRest.ServiceCallback): void; - /** - * @param resourceGroupName Name of the resource group within the azure subscription. - * @param namespaceName The Namespace name - * @param authorizationRuleName The authorization rule name. - * @param options The optional parameters - * @param callback The callback - */ - deleteAuthorizationRule(resourceGroupName: string, namespaceName: string, authorizationRuleName: string, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; - deleteAuthorizationRule(resourceGroupName: string, namespaceName: string, authorizationRuleName: string, options?: msRest.RequestOptionsBase | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { + deleteAuthorizationRule( + resourceGroupName: string, + namespaceName: string, + authorizationRuleName: string, + options?: NamespacesDeleteAuthorizationRuleOptionalParams + ): Promise { return this.client.sendOperationRequest( - { - resourceGroupName, - namespaceName, - authorizationRuleName, - options - }, - deleteAuthorizationRuleOperationSpec, - callback); + { resourceGroupName, namespaceName, authorizationRuleName, options }, + deleteAuthorizationRuleOperationSpec + ); } /** @@ -288,35 +534,18 @@ export class Namespaces { * @param resourceGroupName Name of the resource group within the azure subscription. * @param namespaceName The Namespace name * @param authorizationRuleName The authorization rule name. - * @param [options] The optional parameters - * @returns Promise - */ - getAuthorizationRule(resourceGroupName: string, namespaceName: string, authorizationRuleName: string, options?: msRest.RequestOptionsBase): Promise; - /** - * @param resourceGroupName Name of the resource group within the azure subscription. - * @param namespaceName The Namespace name - * @param authorizationRuleName The authorization rule name. - * @param callback The callback - */ - getAuthorizationRule(resourceGroupName: string, namespaceName: string, authorizationRuleName: string, callback: msRest.ServiceCallback): void; - /** - * @param resourceGroupName Name of the resource group within the azure subscription. - * @param namespaceName The Namespace name - * @param authorizationRuleName The authorization rule name. - * @param options The optional parameters - * @param callback The callback + * @param options The options parameters. */ - getAuthorizationRule(resourceGroupName: string, namespaceName: string, authorizationRuleName: string, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; - getAuthorizationRule(resourceGroupName: string, namespaceName: string, authorizationRuleName: string, options?: msRest.RequestOptionsBase | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { + getAuthorizationRule( + resourceGroupName: string, + namespaceName: string, + authorizationRuleName: string, + options?: NamespacesGetAuthorizationRuleOptionalParams + ): Promise { return this.client.sendOperationRequest( - { - resourceGroupName, - namespaceName, - authorizationRuleName, - options - }, - getAuthorizationRuleOperationSpec, - callback) as Promise; + { resourceGroupName, namespaceName, authorizationRuleName, options }, + getAuthorizationRuleOperationSpec + ); } /** @@ -324,35 +553,18 @@ export class Namespaces { * @param resourceGroupName Name of the resource group within the azure subscription. * @param namespaceName The Namespace name * @param authorizationRuleName The authorization rule name. - * @param [options] The optional parameters - * @returns Promise + * @param options The options parameters. */ - listKeys(resourceGroupName: string, namespaceName: string, authorizationRuleName: string, options?: msRest.RequestOptionsBase): Promise; - /** - * @param resourceGroupName Name of the resource group within the azure subscription. - * @param namespaceName The Namespace name - * @param authorizationRuleName The authorization rule name. - * @param callback The callback - */ - listKeys(resourceGroupName: string, namespaceName: string, authorizationRuleName: string, callback: msRest.ServiceCallback): void; - /** - * @param resourceGroupName Name of the resource group within the azure subscription. - * @param namespaceName The Namespace name - * @param authorizationRuleName The authorization rule name. - * @param options The optional parameters - * @param callback The callback - */ - listKeys(resourceGroupName: string, namespaceName: string, authorizationRuleName: string, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; - listKeys(resourceGroupName: string, namespaceName: string, authorizationRuleName: string, options?: msRest.RequestOptionsBase | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { + listKeys( + resourceGroupName: string, + namespaceName: string, + authorizationRuleName: string, + options?: NamespacesListKeysOptionalParams + ): Promise { return this.client.sendOperationRequest( - { - resourceGroupName, - namespaceName, - authorizationRuleName, - options - }, - listKeysOperationSpec, - callback) as Promise; + { resourceGroupName, namespaceName, authorizationRuleName, options }, + listKeysOperationSpec + ); } /** @@ -361,28 +573,15 @@ export class Namespaces { * @param namespaceName The Namespace name * @param authorizationRuleName The authorization rule name. * @param parameters Parameters required to regenerate the connection string. - * @param [options] The optional parameters - * @returns Promise + * @param options The options parameters. */ - regenerateKeys(resourceGroupName: string, namespaceName: string, authorizationRuleName: string, parameters: Models.RegenerateAccessKeyParameters, options?: msRest.RequestOptionsBase): Promise; - /** - * @param resourceGroupName Name of the resource group within the azure subscription. - * @param namespaceName The Namespace name - * @param authorizationRuleName The authorization rule name. - * @param parameters Parameters required to regenerate the connection string. - * @param callback The callback - */ - regenerateKeys(resourceGroupName: string, namespaceName: string, authorizationRuleName: string, parameters: Models.RegenerateAccessKeyParameters, callback: msRest.ServiceCallback): void; - /** - * @param resourceGroupName Name of the resource group within the azure subscription. - * @param namespaceName The Namespace name - * @param authorizationRuleName The authorization rule name. - * @param parameters Parameters required to regenerate the connection string. - * @param options The optional parameters - * @param callback The callback - */ - regenerateKeys(resourceGroupName: string, namespaceName: string, authorizationRuleName: string, parameters: Models.RegenerateAccessKeyParameters, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; - regenerateKeys(resourceGroupName: string, namespaceName: string, authorizationRuleName: string, parameters: Models.RegenerateAccessKeyParameters, options?: msRest.RequestOptionsBase | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { + regenerateKeys( + resourceGroupName: string, + namespaceName: string, + authorizationRuleName: string, + parameters: RegenerateAccessKeyParameters, + options?: NamespacesRegenerateKeysOptionalParams + ): Promise { return this.client.sendOperationRequest( { resourceGroupName, @@ -391,177 +590,83 @@ export class Namespaces { parameters, options }, - regenerateKeysOperationSpec, - callback) as Promise; + regenerateKeysOperationSpec + ); } /** * Check the give Namespace name availability. * @param parameters Parameters to check availability of the given Namespace name - * @param [options] The optional parameters - * @returns Promise - */ - checkNameAvailability(parameters: Models.CheckNameAvailabilityParameter, options?: msRest.RequestOptionsBase): Promise; - /** - * @param parameters Parameters to check availability of the given Namespace name - * @param callback The callback - */ - checkNameAvailability(parameters: Models.CheckNameAvailabilityParameter, callback: msRest.ServiceCallback): void; - /** - * @param parameters Parameters to check availability of the given Namespace name - * @param options The optional parameters - * @param callback The callback + * @param options The options parameters. */ - checkNameAvailability(parameters: Models.CheckNameAvailabilityParameter, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; - checkNameAvailability(parameters: Models.CheckNameAvailabilityParameter, options?: msRest.RequestOptionsBase | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { + checkNameAvailability( + parameters: CheckNameAvailabilityParameter, + options?: NamespacesCheckNameAvailabilityOptionalParams + ): Promise { return this.client.sendOperationRequest( - { - parameters, - options - }, - checkNameAvailabilityOperationSpec, - callback) as Promise; + { parameters, options }, + checkNameAvailabilityOperationSpec + ); } /** - * Creates or updates a namespace. Once created, this namespace's resource manifest is immutable. - * This operation is idempotent. - * @param resourceGroupName Name of the resource group within the azure subscription. - * @param namespaceName The Namespace name - * @param parameters Parameters for creating a namespace resource. - * @param [options] The optional parameters - * @returns Promise + * ListNext + * @param nextLink The nextLink from the previous successful call to the List method. + * @param options The options parameters. */ - beginCreateOrUpdate(resourceGroupName: string, namespaceName: string, parameters: Models.EHNamespace, options?: msRest.RequestOptionsBase): Promise { - return this.client.sendLRORequest( - { - resourceGroupName, - namespaceName, - parameters, - options - }, - beginCreateOrUpdateOperationSpec, - options); - } - - /** - * Deletes an existing namespace. This operation also removes all associated resources under the - * namespace. - * @param resourceGroupName Name of the resource group within the azure subscription. - * @param namespaceName The Namespace name - * @param [options] The optional parameters - * @returns Promise - */ - beginDeleteMethod(resourceGroupName: string, namespaceName: string, options?: msRest.RequestOptionsBase): Promise { - return this.client.sendLRORequest( - { - resourceGroupName, - namespaceName, - options - }, - beginDeleteMethodOperationSpec, - options); - } - - /** - * Lists all the available Namespaces within a subscription, irrespective of the resource groups. - * @param nextPageLink The NextLink from the previous successful call to List operation. - * @param [options] The optional parameters - * @returns Promise - */ - listNext(nextPageLink: string, options?: msRest.RequestOptionsBase): Promise; - /** - * @param nextPageLink The NextLink from the previous successful call to List operation. - * @param callback The callback - */ - listNext(nextPageLink: string, callback: msRest.ServiceCallback): void; - /** - * @param nextPageLink The NextLink from the previous successful call to List operation. - * @param options The optional parameters - * @param callback The callback - */ - listNext(nextPageLink: string, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; - listNext(nextPageLink: string, options?: msRest.RequestOptionsBase | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { + private _listNext( + nextLink: string, + options?: NamespacesListNextOptionalParams + ): Promise { return this.client.sendOperationRequest( - { - nextPageLink, - options - }, - listNextOperationSpec, - callback) as Promise; + { nextLink, options }, + listNextOperationSpec + ); } /** - * Lists the available Namespaces within a resource group. - * @param nextPageLink The NextLink from the previous successful call to List operation. - * @param [options] The optional parameters - * @returns Promise - */ - listByResourceGroupNext(nextPageLink: string, options?: msRest.RequestOptionsBase): Promise; - /** - * @param nextPageLink The NextLink from the previous successful call to List operation. - * @param callback The callback - */ - listByResourceGroupNext(nextPageLink: string, callback: msRest.ServiceCallback): void; - /** - * @param nextPageLink The NextLink from the previous successful call to List operation. - * @param options The optional parameters - * @param callback The callback + * ListByResourceGroupNext + * @param resourceGroupName Name of the resource group within the azure subscription. + * @param nextLink The nextLink from the previous successful call to the ListByResourceGroup method. + * @param options The options parameters. */ - listByResourceGroupNext(nextPageLink: string, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; - listByResourceGroupNext(nextPageLink: string, options?: msRest.RequestOptionsBase | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { + private _listByResourceGroupNext( + resourceGroupName: string, + nextLink: string, + options?: NamespacesListByResourceGroupNextOptionalParams + ): Promise { return this.client.sendOperationRequest( - { - nextPageLink, - options - }, - listByResourceGroupNextOperationSpec, - callback) as Promise; + { resourceGroupName, nextLink, options }, + listByResourceGroupNextOperationSpec + ); } /** - * Gets a list of authorization rules for a Namespace. - * @param nextPageLink The NextLink from the previous successful call to List operation. - * @param [options] The optional parameters - * @returns Promise - */ - listAuthorizationRulesNext(nextPageLink: string, options?: msRest.RequestOptionsBase): Promise; - /** - * @param nextPageLink The NextLink from the previous successful call to List operation. - * @param callback The callback - */ - listAuthorizationRulesNext(nextPageLink: string, callback: msRest.ServiceCallback): void; - /** - * @param nextPageLink The NextLink from the previous successful call to List operation. - * @param options The optional parameters - * @param callback The callback + * ListAuthorizationRulesNext + * @param resourceGroupName Name of the resource group within the azure subscription. + * @param namespaceName The Namespace name + * @param nextLink The nextLink from the previous successful call to the ListAuthorizationRules method. + * @param options The options parameters. */ - listAuthorizationRulesNext(nextPageLink: string, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; - listAuthorizationRulesNext(nextPageLink: string, options?: msRest.RequestOptionsBase | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { + private _listAuthorizationRulesNext( + resourceGroupName: string, + namespaceName: string, + nextLink: string, + options?: NamespacesListAuthorizationRulesNextOptionalParams + ): Promise { return this.client.sendOperationRequest( - { - nextPageLink, - options - }, - listAuthorizationRulesNextOperationSpec, - callback) as Promise; + { resourceGroupName, namespaceName, nextLink, options }, + listAuthorizationRulesNextOperationSpec + ); } } - // Operation Specifications -const serializer = new msRest.Serializer(Mappers); -const listOperationSpec: msRest.OperationSpec = { +const serializer = coreClient.createSerializer(Mappers, /* isXml */ false); + +const listOperationSpec: coreClient.OperationSpec = { + path: + "/subscriptions/{subscriptionId}/providers/Microsoft.EventHub/namespaces", httpMethod: "GET", - path: "subscriptions/{subscriptionId}/providers/Microsoft.EventHub/namespaces", - urlParameters: [ - Parameters.subscriptionId - ], - queryParameters: [ - Parameters.apiVersion0 - ], - headerParameters: [ - Parameters.acceptLanguage - ], responses: { 200: { bodyMapper: Mappers.EHNamespaceListResult @@ -570,22 +675,15 @@ const listOperationSpec: msRest.OperationSpec = { bodyMapper: Mappers.ErrorResponse } }, + queryParameters: [Parameters.apiVersion], + urlParameters: [Parameters.$host, Parameters.subscriptionId], + headerParameters: [Parameters.accept], serializer }; - -const listByResourceGroupOperationSpec: msRest.OperationSpec = { +const listByResourceGroupOperationSpec: coreClient.OperationSpec = { + path: + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventHub/namespaces", httpMethod: "GET", - path: "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventHub/namespaces", - urlParameters: [ - Parameters.resourceGroupName, - Parameters.subscriptionId - ], - queryParameters: [ - Parameters.apiVersion0 - ], - headerParameters: [ - Parameters.acceptLanguage - ], responses: { 200: { bodyMapper: Mappers.EHNamespaceListResult @@ -594,23 +692,19 @@ const listByResourceGroupOperationSpec: msRest.OperationSpec = { bodyMapper: Mappers.ErrorResponse } }, - serializer -}; - -const getOperationSpec: msRest.OperationSpec = { - httpMethod: "GET", - path: "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventHub/namespaces/{namespaceName}", + queryParameters: [Parameters.apiVersion], urlParameters: [ - Parameters.resourceGroupName, - Parameters.namespaceName, - Parameters.subscriptionId - ], - queryParameters: [ - Parameters.apiVersion0 - ], - headerParameters: [ - Parameters.acceptLanguage + Parameters.$host, + Parameters.subscriptionId, + Parameters.resourceGroupName ], + headerParameters: [Parameters.accept], + serializer +}; +const createOrUpdateOperationSpec: coreClient.OperationSpec = { + path: + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventHub/namespaces/{namespaceName}", + httpMethod: "PUT", responses: { 200: { bodyMapper: Mappers.EHNamespace @@ -618,34 +712,80 @@ const getOperationSpec: msRest.OperationSpec = { 201: { bodyMapper: Mappers.EHNamespace }, + 202: { + bodyMapper: Mappers.EHNamespace + }, + 204: { + bodyMapper: Mappers.EHNamespace + }, default: { bodyMapper: Mappers.ErrorResponse } }, + requestBody: Parameters.parameters1, + queryParameters: [Parameters.apiVersion], + urlParameters: [ + Parameters.$host, + Parameters.subscriptionId, + Parameters.resourceGroupName, + Parameters.namespaceName + ], + headerParameters: [Parameters.accept, Parameters.contentType], + mediaType: "json", serializer }; - -const updateOperationSpec: msRest.OperationSpec = { - httpMethod: "PATCH", - path: "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventHub/namespaces/{namespaceName}", +const deleteOperationSpec: coreClient.OperationSpec = { + path: + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventHub/namespaces/{namespaceName}", + httpMethod: "DELETE", + responses: { + 200: {}, + 201: {}, + 202: {}, + 204: {}, + default: { + bodyMapper: Mappers.ErrorResponse + } + }, + queryParameters: [Parameters.apiVersion], urlParameters: [ + Parameters.$host, + Parameters.subscriptionId, Parameters.resourceGroupName, - Parameters.namespaceName, - Parameters.subscriptionId - ], - queryParameters: [ - Parameters.apiVersion0 + Parameters.namespaceName ], - headerParameters: [ - Parameters.acceptLanguage - ], - requestBody: { - parameterPath: "parameters", - mapper: { - ...Mappers.EHNamespace, - required: true + headerParameters: [Parameters.accept], + serializer +}; +const getOperationSpec: coreClient.OperationSpec = { + path: + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventHub/namespaces/{namespaceName}", + httpMethod: "GET", + responses: { + 200: { + bodyMapper: Mappers.EHNamespace + }, + 201: { + bodyMapper: Mappers.EHNamespace + }, + default: { + bodyMapper: Mappers.ErrorResponse } }, + queryParameters: [Parameters.apiVersion], + urlParameters: [ + Parameters.$host, + Parameters.subscriptionId, + Parameters.resourceGroupName, + Parameters.namespaceName + ], + headerParameters: [Parameters.accept], + serializer +}; +const updateOperationSpec: coreClient.OperationSpec = { + path: + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventHub/namespaces/{namespaceName}", + httpMethod: "PATCH", responses: { 200: { bodyMapper: Mappers.EHNamespace @@ -658,23 +798,22 @@ const updateOperationSpec: msRest.OperationSpec = { bodyMapper: Mappers.ErrorResponse } }, - serializer -}; - -const listAuthorizationRulesOperationSpec: msRest.OperationSpec = { - httpMethod: "GET", - path: "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventHub/namespaces/{namespaceName}/authorizationRules", + requestBody: Parameters.parameters1, + queryParameters: [Parameters.apiVersion], urlParameters: [ + Parameters.$host, + Parameters.subscriptionId, Parameters.resourceGroupName, - Parameters.namespaceName, - Parameters.subscriptionId - ], - queryParameters: [ - Parameters.apiVersion1 - ], - headerParameters: [ - Parameters.acceptLanguage + Parameters.namespaceName ], + headerParameters: [Parameters.accept, Parameters.contentType], + mediaType: "json", + serializer +}; +const listAuthorizationRulesOperationSpec: coreClient.OperationSpec = { + path: + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventHub/namespaces/{namespaceName}/authorizationRules", + httpMethod: "GET", responses: { 200: { bodyMapper: Mappers.AuthorizationRuleListResult @@ -683,31 +822,20 @@ const listAuthorizationRulesOperationSpec: msRest.OperationSpec = { bodyMapper: Mappers.ErrorResponse } }, - serializer -}; - -const createOrUpdateAuthorizationRuleOperationSpec: msRest.OperationSpec = { - httpMethod: "PUT", - path: "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventHub/namespaces/{namespaceName}/authorizationRules/{authorizationRuleName}", + queryParameters: [Parameters.apiVersion1], urlParameters: [ + Parameters.$host, + Parameters.subscriptionId, Parameters.resourceGroupName, - Parameters.namespaceName, - Parameters.authorizationRuleName, - Parameters.subscriptionId + Parameters.namespaceName ], - queryParameters: [ - Parameters.apiVersion1 - ], - headerParameters: [ - Parameters.acceptLanguage - ], - requestBody: { - parameterPath: "parameters", - mapper: { - ...Mappers.AuthorizationRule, - required: true - } - }, + headerParameters: [Parameters.accept], + serializer +}; +const createOrUpdateAuthorizationRuleOperationSpec: coreClient.OperationSpec = { + path: + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventHub/namespaces/{namespaceName}/authorizationRules/{authorizationRuleName}", + httpMethod: "PUT", responses: { 200: { bodyMapper: Mappers.AuthorizationRule @@ -716,24 +844,23 @@ const createOrUpdateAuthorizationRuleOperationSpec: msRest.OperationSpec = { bodyMapper: Mappers.ErrorResponse } }, - serializer -}; - -const deleteAuthorizationRuleOperationSpec: msRest.OperationSpec = { - httpMethod: "DELETE", - path: "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventHub/namespaces/{namespaceName}/authorizationRules/{authorizationRuleName}", + requestBody: Parameters.parameters2, + queryParameters: [Parameters.apiVersion1], urlParameters: [ + Parameters.$host, + Parameters.subscriptionId, Parameters.resourceGroupName, Parameters.namespaceName, - Parameters.authorizationRuleName, - Parameters.subscriptionId - ], - queryParameters: [ - Parameters.apiVersion1 - ], - headerParameters: [ - Parameters.acceptLanguage + Parameters.authorizationRuleName ], + headerParameters: [Parameters.accept, Parameters.contentType], + mediaType: "json", + serializer +}; +const deleteAuthorizationRuleOperationSpec: coreClient.OperationSpec = { + path: + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventHub/namespaces/{namespaceName}/authorizationRules/{authorizationRuleName}", + httpMethod: "DELETE", responses: { 200: {}, 204: {}, @@ -741,24 +868,21 @@ const deleteAuthorizationRuleOperationSpec: msRest.OperationSpec = { bodyMapper: Mappers.ErrorResponse } }, - serializer -}; - -const getAuthorizationRuleOperationSpec: msRest.OperationSpec = { - httpMethod: "GET", - path: "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventHub/namespaces/{namespaceName}/authorizationRules/{authorizationRuleName}", + queryParameters: [Parameters.apiVersion1], urlParameters: [ + Parameters.$host, + Parameters.subscriptionId, Parameters.resourceGroupName, Parameters.namespaceName, - Parameters.authorizationRuleName, - Parameters.subscriptionId - ], - queryParameters: [ - Parameters.apiVersion1 - ], - headerParameters: [ - Parameters.acceptLanguage + Parameters.authorizationRuleName ], + headerParameters: [Parameters.accept], + serializer +}; +const getAuthorizationRuleOperationSpec: coreClient.OperationSpec = { + path: + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventHub/namespaces/{namespaceName}/authorizationRules/{authorizationRuleName}", + httpMethod: "GET", responses: { 200: { bodyMapper: Mappers.AuthorizationRule @@ -767,24 +891,21 @@ const getAuthorizationRuleOperationSpec: msRest.OperationSpec = { bodyMapper: Mappers.ErrorResponse } }, - serializer -}; - -const listKeysOperationSpec: msRest.OperationSpec = { - httpMethod: "POST", - path: "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventHub/namespaces/{namespaceName}/authorizationRules/{authorizationRuleName}/listKeys", + queryParameters: [Parameters.apiVersion1], urlParameters: [ + Parameters.$host, + Parameters.subscriptionId, Parameters.resourceGroupName, Parameters.namespaceName, - Parameters.authorizationRuleName, - Parameters.subscriptionId - ], - queryParameters: [ - Parameters.apiVersion1 - ], - headerParameters: [ - Parameters.acceptLanguage + Parameters.authorizationRuleName ], + headerParameters: [Parameters.accept], + serializer +}; +const listKeysOperationSpec: coreClient.OperationSpec = { + path: + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventHub/namespaces/{namespaceName}/authorizationRules/{authorizationRuleName}/listKeys", + httpMethod: "POST", responses: { 200: { bodyMapper: Mappers.AccessKeys @@ -793,143 +914,64 @@ const listKeysOperationSpec: msRest.OperationSpec = { bodyMapper: Mappers.ErrorResponse } }, - serializer -}; - -const regenerateKeysOperationSpec: msRest.OperationSpec = { - httpMethod: "POST", - path: "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventHub/namespaces/{namespaceName}/authorizationRules/{authorizationRuleName}/regenerateKeys", + queryParameters: [Parameters.apiVersion1], urlParameters: [ + Parameters.$host, + Parameters.subscriptionId, Parameters.resourceGroupName, Parameters.namespaceName, - Parameters.authorizationRuleName, - Parameters.subscriptionId - ], - queryParameters: [ - Parameters.apiVersion1 - ], - headerParameters: [ - Parameters.acceptLanguage + Parameters.authorizationRuleName ], - requestBody: { - parameterPath: "parameters", - mapper: { - ...Mappers.RegenerateAccessKeyParameters, - required: true - } - }, - responses: { - 200: { - bodyMapper: Mappers.AccessKeys - }, - default: { - bodyMapper: Mappers.ErrorResponse - } - }, + headerParameters: [Parameters.accept], serializer }; - -const checkNameAvailabilityOperationSpec: msRest.OperationSpec = { +const regenerateKeysOperationSpec: coreClient.OperationSpec = { + path: + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventHub/namespaces/{namespaceName}/authorizationRules/{authorizationRuleName}/regenerateKeys", httpMethod: "POST", - path: "subscriptions/{subscriptionId}/providers/Microsoft.EventHub/checkNameAvailability", - urlParameters: [ - Parameters.subscriptionId - ], - queryParameters: [ - Parameters.apiVersion1 - ], - headerParameters: [ - Parameters.acceptLanguage - ], - requestBody: { - parameterPath: "parameters", - mapper: { - ...Mappers.CheckNameAvailabilityParameter, - required: true - } - }, responses: { 200: { - bodyMapper: Mappers.CheckNameAvailabilityResult + bodyMapper: Mappers.AccessKeys }, default: { bodyMapper: Mappers.ErrorResponse } }, - serializer -}; - -const beginCreateOrUpdateOperationSpec: msRest.OperationSpec = { - httpMethod: "PUT", - path: "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventHub/namespaces/{namespaceName}", + requestBody: Parameters.parameters3, + queryParameters: [Parameters.apiVersion1], urlParameters: [ + Parameters.$host, + Parameters.subscriptionId, Parameters.resourceGroupName, Parameters.namespaceName, - Parameters.subscriptionId - ], - queryParameters: [ - Parameters.apiVersion0 + Parameters.authorizationRuleName ], - headerParameters: [ - Parameters.acceptLanguage - ], - requestBody: { - parameterPath: "parameters", - mapper: { - ...Mappers.EHNamespace, - required: true - } - }, - responses: { - 200: { - bodyMapper: Mappers.EHNamespace - }, - 201: { - bodyMapper: Mappers.EHNamespace - }, - 202: {}, - default: { - bodyMapper: Mappers.ErrorResponse - } - }, + headerParameters: [Parameters.accept, Parameters.contentType], + mediaType: "json", serializer }; - -const beginDeleteMethodOperationSpec: msRest.OperationSpec = { - httpMethod: "DELETE", - path: "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventHub/namespaces/{namespaceName}", - urlParameters: [ - Parameters.resourceGroupName, - Parameters.namespaceName, - Parameters.subscriptionId - ], - queryParameters: [ - Parameters.apiVersion0 - ], - headerParameters: [ - Parameters.acceptLanguage - ], +const checkNameAvailabilityOperationSpec: coreClient.OperationSpec = { + path: + "/subscriptions/{subscriptionId}/providers/Microsoft.EventHub/checkNameAvailability", + httpMethod: "POST", responses: { - 200: {}, - 202: {}, - 204: {}, + 200: { + bodyMapper: Mappers.CheckNameAvailabilityResult + }, default: { bodyMapper: Mappers.ErrorResponse } }, + requestBody: Parameters.parameters4, + queryParameters: [Parameters.apiVersion1], + urlParameters: [Parameters.$host, Parameters.subscriptionId], + headerParameters: [Parameters.accept, Parameters.contentType], + mediaType: "json", serializer }; - -const listNextOperationSpec: msRest.OperationSpec = { - httpMethod: "GET", - baseUrl: "https://management.azure.com", +const listNextOperationSpec: coreClient.OperationSpec = { path: "{nextLink}", - urlParameters: [ - Parameters.nextPageLink - ], - headerParameters: [ - Parameters.acceptLanguage - ], + httpMethod: "GET", responses: { 200: { bodyMapper: Mappers.EHNamespaceListResult @@ -938,19 +980,18 @@ const listNextOperationSpec: msRest.OperationSpec = { bodyMapper: Mappers.ErrorResponse } }, + queryParameters: [Parameters.apiVersion], + urlParameters: [ + Parameters.$host, + Parameters.subscriptionId, + Parameters.nextLink + ], + 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.EHNamespaceListResult @@ -959,19 +1000,19 @@ const listByResourceGroupNextOperationSpec: msRest.OperationSpec = { bodyMapper: Mappers.ErrorResponse } }, + queryParameters: [Parameters.apiVersion], + urlParameters: [ + Parameters.$host, + Parameters.subscriptionId, + Parameters.resourceGroupName, + Parameters.nextLink + ], + headerParameters: [Parameters.accept], serializer }; - -const listAuthorizationRulesNextOperationSpec: msRest.OperationSpec = { - httpMethod: "GET", - baseUrl: "https://management.azure.com", +const listAuthorizationRulesNextOperationSpec: coreClient.OperationSpec = { path: "{nextLink}", - urlParameters: [ - Parameters.nextPageLink - ], - headerParameters: [ - Parameters.acceptLanguage - ], + httpMethod: "GET", responses: { 200: { bodyMapper: Mappers.AuthorizationRuleListResult @@ -980,5 +1021,14 @@ const listAuthorizationRulesNextOperationSpec: msRest.OperationSpec = { bodyMapper: Mappers.ErrorResponse } }, + queryParameters: [Parameters.apiVersion1], + urlParameters: [ + Parameters.$host, + Parameters.subscriptionId, + Parameters.resourceGroupName, + Parameters.nextLink, + Parameters.namespaceName + ], + headerParameters: [Parameters.accept], serializer }; diff --git a/sdk/eventhub/arm-eventhub-profile-2020-09-01-hybrid/src/operations/operations.ts b/sdk/eventhub/arm-eventhub-profile-2020-09-01-hybrid/src/operations/operations.ts index 3771a25aeef7..e2b482426cc9 100644 --- a/sdk/eventhub/arm-eventhub-profile-2020-09-01-hybrid/src/operations/operations.ts +++ b/sdk/eventhub/arm-eventhub-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 { EventHubManagementClientContext } from "../eventHubManagementClientContext"; +import { EventHubManagementClient } from "../eventHubManagementClient"; +import { + Operation, + OperationsListNextOptionalParams, + OperationsListOptionalParams, + OperationsListResponse, + OperationsListNextResponse +} from "../models"; -/** Class representing a Operations. */ -export class Operations { - private readonly client: EventHubManagementClientContext; +/// +/** Class containing Operations operations. */ +export class OperationsImpl implements Operations { + private readonly client: EventHubManagementClient; /** - * Create a Operations. - * @param {EventHubManagementClientContext} client Reference to the service client. + * Initialize a new instance of the class Operations class. + * @param client Reference to the service client */ - constructor(client: EventHubManagementClientContext) { + constructor(client: EventHubManagementClient) { this.client = client; } /** * Lists all of the available Event 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 Event 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.EventHub/operations", httpMethod: "GET", - path: "providers/Microsoft.EventHub/operations", - queryParameters: [ - Parameters.apiVersion1 - ], - headerParameters: [ - Parameters.acceptLanguage - ], responses: { 200: { bodyMapper: Mappers.OperationListResult @@ -98,19 +114,14 @@ const listOperationSpec: msRest.OperationSpec = { bodyMapper: Mappers.ErrorResponse } }, + queryParameters: [Parameters.apiVersion1], + urlParameters: [Parameters.$host], + headerParameters: [Parameters.accept], serializer }; - -const listNextOperationSpec: msRest.OperationSpec = { - httpMethod: "GET", - baseUrl: "https://management.azure.com", +const listNextOperationSpec: coreClient.OperationSpec = { path: "{nextLink}", - urlParameters: [ - Parameters.nextPageLink - ], - headerParameters: [ - Parameters.acceptLanguage - ], + httpMethod: "GET", responses: { 200: { bodyMapper: Mappers.OperationListResult @@ -119,5 +130,8 @@ const listNextOperationSpec: msRest.OperationSpec = { bodyMapper: Mappers.ErrorResponse } }, + queryParameters: [Parameters.apiVersion1], + urlParameters: [Parameters.$host, Parameters.nextLink], + headerParameters: [Parameters.accept], serializer }; diff --git a/sdk/eventhub/arm-eventhub-profile-2020-09-01-hybrid/src/operations/privateEndpointConnections.ts b/sdk/eventhub/arm-eventhub-profile-2020-09-01-hybrid/src/operations/privateEndpointConnections.ts index 7b453e4dcf31..611ab473039e 100644 --- a/sdk/eventhub/arm-eventhub-profile-2020-09-01-hybrid/src/operations/privateEndpointConnections.ts +++ b/sdk/eventhub/arm-eventhub-profile-2020-09-01-hybrid/src/operations/privateEndpointConnections.ts @@ -1,29 +1,43 @@ /* - * 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/privateEndpointConnectionsMappers"; +import { PagedAsyncIterableIterator } from "@azure/core-paging"; +import { PrivateEndpointConnections } from "../operationsInterfaces"; +import * as coreClient from "@azure/core-client"; +import * as Mappers from "../models/mappers"; import * as Parameters from "../models/parameters"; -import { EventHubManagementClientContext } from "../eventHubManagementClientContext"; +import { EventHubManagementClient } from "../eventHubManagementClient"; +import { PollerLike, PollOperationState, LroEngine } from "@azure/core-lro"; +import { LroImpl } from "../lroImpl"; +import { + PrivateEndpointConnection, + PrivateEndpointConnectionsListNextOptionalParams, + PrivateEndpointConnectionsListOptionalParams, + PrivateEndpointConnectionsListResponse, + PrivateEndpointConnectionsCreateOrUpdateOptionalParams, + PrivateEndpointConnectionsCreateOrUpdateResponse, + PrivateEndpointConnectionsDeleteOptionalParams, + PrivateEndpointConnectionsGetOptionalParams, + PrivateEndpointConnectionsGetResponse, + PrivateEndpointConnectionsListNextResponse +} from "../models"; -/** Class representing a PrivateEndpointConnections. */ -export class PrivateEndpointConnections { - private readonly client: EventHubManagementClientContext; +/// +/** Class containing PrivateEndpointConnections operations. */ +export class PrivateEndpointConnectionsImpl + implements PrivateEndpointConnections { + private readonly client: EventHubManagementClient; /** - * Create a PrivateEndpointConnections. - * @param {EventHubManagementClientContext} client Reference to the service client. + * Initialize a new instance of the class PrivateEndpointConnections class. + * @param client Reference to the service client */ - constructor(client: EventHubManagementClientContext) { + constructor(client: EventHubManagementClient) { this.client = client; } @@ -31,65 +45,94 @@ export class PrivateEndpointConnections { * Gets the available PrivateEndpointConnections within a namespace. * @param resourceGroupName Name of the resource group within the azure subscription. * @param namespaceName The Namespace name - * @param [options] The optional parameters - * @returns Promise + * @param options The options parameters. */ - list(resourceGroupName: string, namespaceName: string, options?: msRest.RequestOptionsBase): Promise; - /** - * @param resourceGroupName Name of the resource group within the azure subscription. - * @param namespaceName The Namespace name - * @param callback The callback - */ - list(resourceGroupName: string, namespaceName: string, callback: msRest.ServiceCallback): void; - /** - * @param resourceGroupName Name of the resource group within the azure subscription. - * @param namespaceName The Namespace name - * @param options The optional parameters - * @param callback The callback - */ - list(resourceGroupName: string, namespaceName: string, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; - list(resourceGroupName: string, namespaceName: string, options?: msRest.RequestOptionsBase | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { - return this.client.sendOperationRequest( - { + public list( + resourceGroupName: string, + namespaceName: string, + options?: PrivateEndpointConnectionsListOptionalParams + ): PagedAsyncIterableIterator { + const iter = this.listPagingAll(resourceGroupName, namespaceName, options); + return { + next() { + return iter.next(); + }, + [Symbol.asyncIterator]() { + return this; + }, + byPage: () => { + return this.listPagingPage(resourceGroupName, namespaceName, options); + } + }; + } + + private async *listPagingPage( + resourceGroupName: string, + namespaceName: string, + options?: PrivateEndpointConnectionsListOptionalParams + ): AsyncIterableIterator { + let result = await this._list(resourceGroupName, namespaceName, options); + yield result.value || []; + let continuationToken = result.nextLink; + while (continuationToken) { + result = await this._listNext( resourceGroupName, namespaceName, + continuationToken, options - }, - listOperationSpec, - callback) as Promise; + ); + continuationToken = result.nextLink; + yield result.value || []; + } + } + + private async *listPagingAll( + resourceGroupName: string, + namespaceName: string, + options?: PrivateEndpointConnectionsListOptionalParams + ): AsyncIterableIterator { + for await (const page of this.listPagingPage( + resourceGroupName, + namespaceName, + options + )) { + yield* page; + } } /** - * Creates or updates PrivateEndpointConnections of service namespace. - * @param resourceGroupName Name of the resource group within the azure subscription. - * @param namespaceName The Namespace name - * @param privateEndpointConnectionName The PrivateEndpointConnection name - * @param parameters Parameters supplied to update Status of PrivateEndPoint Connection to - * namespace resource. - * @param [options] The optional parameters - * @returns Promise - */ - createOrUpdate(resourceGroupName: string, namespaceName: string, privateEndpointConnectionName: string, parameters: Models.PrivateEndpointConnection, options?: msRest.RequestOptionsBase): Promise; - /** + * Gets the available PrivateEndpointConnections within a namespace. * @param resourceGroupName Name of the resource group within the azure subscription. * @param namespaceName The Namespace name - * @param privateEndpointConnectionName The PrivateEndpointConnection name - * @param parameters Parameters supplied to update Status of PrivateEndPoint Connection to - * namespace resource. - * @param callback The callback + * @param options The options parameters. */ - createOrUpdate(resourceGroupName: string, namespaceName: string, privateEndpointConnectionName: string, parameters: Models.PrivateEndpointConnection, callback: msRest.ServiceCallback): void; + private _list( + resourceGroupName: string, + namespaceName: string, + options?: PrivateEndpointConnectionsListOptionalParams + ): Promise { + return this.client.sendOperationRequest( + { resourceGroupName, namespaceName, options }, + listOperationSpec + ); + } + /** + * Creates or updates PrivateEndpointConnections of service namespace. * @param resourceGroupName Name of the resource group within the azure subscription. * @param namespaceName The Namespace name * @param privateEndpointConnectionName The PrivateEndpointConnection name - * @param parameters Parameters supplied to update Status of PrivateEndPoint Connection to - * namespace resource. - * @param options The optional parameters - * @param callback The callback + * @param parameters Parameters supplied to update Status of PrivateEndPoint Connection to namespace + * resource. + * @param options The options parameters. */ - createOrUpdate(resourceGroupName: string, namespaceName: string, privateEndpointConnectionName: string, parameters: Models.PrivateEndpointConnection, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; - createOrUpdate(resourceGroupName: string, namespaceName: string, privateEndpointConnectionName: string, parameters: Models.PrivateEndpointConnection, options?: msRest.RequestOptionsBase | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { + createOrUpdate( + resourceGroupName: string, + namespaceName: string, + privateEndpointConnectionName: string, + parameters: PrivateEndpointConnection, + options?: PrivateEndpointConnectionsCreateOrUpdateOptionalParams + ): Promise { return this.client.sendOperationRequest( { resourceGroupName, @@ -98,8 +141,8 @@ export class PrivateEndpointConnections { parameters, options }, - createOrUpdateOperationSpec, - callback) as Promise; + createOrUpdateOperationSpec + ); } /** @@ -108,48 +151,67 @@ export class PrivateEndpointConnections { * @param resourceGroupName Name of the resource group within the azure subscription. * @param namespaceName The Namespace name * @param privateEndpointConnectionName The PrivateEndpointConnection name - * @param [options] The optional parameters - * @returns Promise + * @param options The options parameters. */ - deleteMethod(resourceGroupName: string, namespaceName: string, privateEndpointConnectionName: string, options?: msRest.RequestOptionsBase): Promise { - return this.beginDeleteMethod(resourceGroupName,namespaceName,privateEndpointConnectionName,options) - .then(lroPoller => lroPoller.pollUntilFinished()); - } + async beginDelete( + resourceGroupName: string, + namespaceName: string, + privateEndpointConnectionName: string, + options?: PrivateEndpointConnectionsDeleteOptionalParams + ): 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() + } + }; + }; - /** - * Gets a description for the specified Private Endpoint Connection name. - * @param resourceGroupName Name of the resource group within the azure subscription. - * @param namespaceName The Namespace name - * @param privateEndpointConnectionName The PrivateEndpointConnection name - * @param [options] The optional parameters - * @returns Promise - */ - get(resourceGroupName: string, namespaceName: string, privateEndpointConnectionName: string, options?: msRest.RequestOptionsBase): Promise; - /** - * @param resourceGroupName Name of the resource group within the azure subscription. - * @param namespaceName The Namespace name - * @param privateEndpointConnectionName The PrivateEndpointConnection name - * @param callback The callback - */ - get(resourceGroupName: string, namespaceName: string, privateEndpointConnectionName: string, callback: msRest.ServiceCallback): void; - /** - * @param resourceGroupName Name of the resource group within the azure subscription. - * @param namespaceName The Namespace name - * @param privateEndpointConnectionName The PrivateEndpointConnection name - * @param options The optional parameters - * @param callback The callback - */ - get(resourceGroupName: string, namespaceName: string, privateEndpointConnectionName: string, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; - get(resourceGroupName: string, namespaceName: string, privateEndpointConnectionName: string, options?: msRest.RequestOptionsBase | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { - return this.client.sendOperationRequest( + const lro = new LroImpl( + sendOperation, { resourceGroupName, namespaceName, privateEndpointConnectionName, options }, - getOperationSpec, - callback) as Promise; + deleteOperationSpec + ); + return new LroEngine(lro, { + resumeFrom: options?.resumeFrom, + intervalInMs: options?.updateIntervalInMs + }); } /** @@ -158,66 +220,73 @@ export class PrivateEndpointConnections { * @param resourceGroupName Name of the resource group within the azure subscription. * @param namespaceName The Namespace name * @param privateEndpointConnectionName The PrivateEndpointConnection name - * @param [options] The optional parameters - * @returns Promise + * @param options The options parameters. */ - beginDeleteMethod(resourceGroupName: string, namespaceName: string, privateEndpointConnectionName: string, options?: msRest.RequestOptionsBase): Promise { - return this.client.sendLRORequest( + async beginDeleteAndWait( + resourceGroupName: string, + namespaceName: string, + privateEndpointConnectionName: string, + options?: PrivateEndpointConnectionsDeleteOptionalParams + ): Promise { + const poller = await this.beginDelete( + resourceGroupName, + namespaceName, + privateEndpointConnectionName, + options + ); + return poller.pollUntilDone(); + } + + /** + * Gets a description for the specified Private Endpoint Connection name. + * @param resourceGroupName Name of the resource group within the azure subscription. + * @param namespaceName The Namespace name + * @param privateEndpointConnectionName The PrivateEndpointConnection name + * @param options The options parameters. + */ + get( + resourceGroupName: string, + namespaceName: string, + privateEndpointConnectionName: string, + options?: PrivateEndpointConnectionsGetOptionalParams + ): Promise { + return this.client.sendOperationRequest( { resourceGroupName, namespaceName, privateEndpointConnectionName, options }, - beginDeleteMethodOperationSpec, - options); + getOperationSpec + ); } /** - * Gets the available PrivateEndpointConnections within a namespace. - * @param nextPageLink The NextLink from the previous successful call to List operation. - * @param [options] The optional parameters - * @returns Promise - */ - listNext(nextPageLink: string, options?: msRest.RequestOptionsBase): Promise; - /** - * @param nextPageLink The NextLink from the previous successful call to List operation. - * @param callback The callback - */ - listNext(nextPageLink: string, callback: msRest.ServiceCallback): void; - /** - * @param nextPageLink The NextLink from the previous successful call to List operation. - * @param options The optional parameters - * @param callback The callback + * ListNext + * @param resourceGroupName Name of the resource group within the azure subscription. + * @param namespaceName The Namespace name + * @param nextLink The nextLink from the previous successful call to the 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( + resourceGroupName: string, + namespaceName: string, + nextLink: string, + options?: PrivateEndpointConnectionsListNextOptionalParams + ): Promise { return this.client.sendOperationRequest( - { - nextPageLink, - options - }, - listNextOperationSpec, - callback) as Promise; + { resourceGroupName, namespaceName, 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: + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventHub/namespaces/{namespaceName}/privateEndpointConnections", httpMethod: "GET", - path: "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventHub/namespaces/{namespaceName}/privateEndpointConnections", - urlParameters: [ - Parameters.resourceGroupName, - Parameters.namespaceName, - Parameters.subscriptionId - ], - queryParameters: [ - Parameters.apiVersion0 - ], - headerParameters: [ - Parameters.acceptLanguage - ], responses: { 200: { bodyMapper: Mappers.PrivateEndpointConnectionListResult @@ -226,31 +295,20 @@ const listOperationSpec: msRest.OperationSpec = { bodyMapper: Mappers.ErrorResponse } }, - serializer -}; - -const createOrUpdateOperationSpec: msRest.OperationSpec = { - httpMethod: "PUT", - path: "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventHub/namespaces/{namespaceName}/privateEndpointConnections/{privateEndpointConnectionName}", + queryParameters: [Parameters.apiVersion], urlParameters: [ + Parameters.$host, Parameters.subscriptionId, Parameters.resourceGroupName, - Parameters.namespaceName, - Parameters.privateEndpointConnectionName - ], - queryParameters: [ - Parameters.apiVersion0 - ], - headerParameters: [ - Parameters.acceptLanguage + Parameters.namespaceName ], - requestBody: { - parameterPath: "parameters", - mapper: { - ...Mappers.PrivateEndpointConnection, - required: true - } - }, + headerParameters: [Parameters.accept], + serializer +}; +const createOrUpdateOperationSpec: coreClient.OperationSpec = { + path: + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventHub/namespaces/{namespaceName}/privateEndpointConnections/{privateEndpointConnectionName}", + httpMethod: "PUT", responses: { 200: { bodyMapper: Mappers.PrivateEndpointConnection @@ -262,71 +320,69 @@ const createOrUpdateOperationSpec: msRest.OperationSpec = { bodyMapper: Mappers.ErrorResponse } }, - serializer -}; - -const getOperationSpec: msRest.OperationSpec = { - httpMethod: "GET", - path: "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventHub/namespaces/{namespaceName}/privateEndpointConnections/{privateEndpointConnectionName}", + requestBody: Parameters.parameters5, + queryParameters: [Parameters.apiVersion], urlParameters: [ + Parameters.$host, + Parameters.subscriptionId, Parameters.resourceGroupName, Parameters.namespaceName, - Parameters.privateEndpointConnectionName, - Parameters.subscriptionId - ], - queryParameters: [ - Parameters.apiVersion0 - ], - headerParameters: [ - Parameters.acceptLanguage + Parameters.privateEndpointConnectionName ], + headerParameters: [Parameters.accept, Parameters.contentType], + mediaType: "json", + serializer +}; +const deleteOperationSpec: coreClient.OperationSpec = { + path: + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventHub/namespaces/{namespaceName}/privateEndpointConnections/{privateEndpointConnectionName}", + httpMethod: "DELETE", responses: { - 200: { - bodyMapper: Mappers.PrivateEndpointConnection - }, + 200: {}, + 201: {}, + 202: {}, + 204: {}, default: { bodyMapper: Mappers.ErrorResponse } }, - serializer -}; - -const beginDeleteMethodOperationSpec: msRest.OperationSpec = { - httpMethod: "DELETE", - path: "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventHub/namespaces/{namespaceName}/privateEndpointConnections/{privateEndpointConnectionName}", + queryParameters: [Parameters.apiVersion], urlParameters: [ + Parameters.$host, + Parameters.subscriptionId, Parameters.resourceGroupName, Parameters.namespaceName, - Parameters.subscriptionId, Parameters.privateEndpointConnectionName ], - queryParameters: [ - Parameters.apiVersion0 - ], - headerParameters: [ - Parameters.acceptLanguage - ], + headerParameters: [Parameters.accept], + serializer +}; +const getOperationSpec: coreClient.OperationSpec = { + path: + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventHub/namespaces/{namespaceName}/privateEndpointConnections/{privateEndpointConnectionName}", + httpMethod: "GET", responses: { - 200: {}, - 202: {}, - 204: {}, + 200: { + bodyMapper: Mappers.PrivateEndpointConnection + }, default: { bodyMapper: Mappers.ErrorResponse } }, + queryParameters: [Parameters.apiVersion], + urlParameters: [ + Parameters.$host, + Parameters.subscriptionId, + Parameters.resourceGroupName, + Parameters.namespaceName, + Parameters.privateEndpointConnectionName + ], + 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.PrivateEndpointConnectionListResult @@ -335,5 +391,14 @@ const listNextOperationSpec: msRest.OperationSpec = { bodyMapper: Mappers.ErrorResponse } }, + queryParameters: [Parameters.apiVersion], + urlParameters: [ + Parameters.$host, + Parameters.subscriptionId, + Parameters.resourceGroupName, + Parameters.nextLink, + Parameters.namespaceName + ], + headerParameters: [Parameters.accept], serializer }; diff --git a/sdk/eventhub/arm-eventhub-profile-2020-09-01-hybrid/src/operations/privateLinkResources.ts b/sdk/eventhub/arm-eventhub-profile-2020-09-01-hybrid/src/operations/privateLinkResources.ts index d2bb8545f800..115bafb567c4 100644 --- a/sdk/eventhub/arm-eventhub-profile-2020-09-01-hybrid/src/operations/privateLinkResources.ts +++ b/sdk/eventhub/arm-eventhub-profile-2020-09-01-hybrid/src/operations/privateLinkResources.ts @@ -1,28 +1,30 @@ /* - * 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/privateLinkResourcesMappers"; +import { PrivateLinkResources } from "../operationsInterfaces"; +import * as coreClient from "@azure/core-client"; +import * as Mappers from "../models/mappers"; import * as Parameters from "../models/parameters"; -import { EventHubManagementClientContext } from "../eventHubManagementClientContext"; +import { EventHubManagementClient } from "../eventHubManagementClient"; +import { + PrivateLinkResourcesGetOptionalParams, + PrivateLinkResourcesGetResponse +} from "../models"; -/** Class representing a PrivateLinkResources. */ -export class PrivateLinkResources { - private readonly client: EventHubManagementClientContext; +/** Class containing PrivateLinkResources operations. */ +export class PrivateLinkResourcesImpl implements PrivateLinkResources { + private readonly client: EventHubManagementClient; /** - * Create a PrivateLinkResources. - * @param {EventHubManagementClientContext} client Reference to the service client. + * Initialize a new instance of the class PrivateLinkResources class. + * @param client Reference to the service client */ - constructor(client: EventHubManagementClientContext) { + constructor(client: EventHubManagementClient) { this.client = client; } @@ -30,51 +32,26 @@ export class PrivateLinkResources { * Gets lists of resources that supports Privatelinks. * @param resourceGroupName Name of the resource group within the azure subscription. * @param namespaceName The Namespace name - * @param [options] The optional parameters - * @returns Promise + * @param options The options parameters. */ - get(resourceGroupName: string, namespaceName: string, options?: msRest.RequestOptionsBase): Promise; - /** - * @param resourceGroupName Name of the resource group within the azure subscription. - * @param namespaceName The Namespace name - * @param callback The callback - */ - get(resourceGroupName: string, namespaceName: string, callback: msRest.ServiceCallback): void; - /** - * @param resourceGroupName Name of the resource group within the azure subscription. - * @param namespaceName The Namespace name - * @param options The optional parameters - * @param callback The callback - */ - get(resourceGroupName: string, namespaceName: string, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; - get(resourceGroupName: string, namespaceName: string, options?: msRest.RequestOptionsBase | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { + get( + resourceGroupName: string, + namespaceName: string, + options?: PrivateLinkResourcesGetOptionalParams + ): Promise { return this.client.sendOperationRequest( - { - resourceGroupName, - namespaceName, - options - }, - getOperationSpec, - callback) as Promise; + { resourceGroupName, namespaceName, options }, + getOperationSpec + ); } } - // 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.EventHub/namespaces/{namespaceName}/privateLinkResources", httpMethod: "GET", - path: "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventHub/namespaces/{namespaceName}/privateLinkResources", - urlParameters: [ - Parameters.resourceGroupName, - Parameters.namespaceName, - Parameters.subscriptionId - ], - queryParameters: [ - Parameters.apiVersion0 - ], - headerParameters: [ - Parameters.acceptLanguage - ], responses: { 200: { bodyMapper: Mappers.PrivateLinkResourcesListResult @@ -83,5 +60,13 @@ const getOperationSpec: msRest.OperationSpec = { bodyMapper: Mappers.ErrorResponse } }, + queryParameters: [Parameters.apiVersion], + urlParameters: [ + Parameters.$host, + Parameters.subscriptionId, + Parameters.resourceGroupName, + Parameters.namespaceName + ], + headerParameters: [Parameters.accept], serializer }; diff --git a/sdk/eventhub/arm-eventhub-profile-2020-09-01-hybrid/src/operations/regions.ts b/sdk/eventhub/arm-eventhub-profile-2020-09-01-hybrid/src/operations/regions.ts index 94231aa5d139..41910f4712c6 100644 --- a/sdk/eventhub/arm-eventhub-profile-2020-09-01-hybrid/src/operations/regions.ts +++ b/sdk/eventhub/arm-eventhub-profile-2020-09-01-hybrid/src/operations/regions.ts @@ -1,103 +1,123 @@ /* - * 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/regionsMappers"; +import { PagedAsyncIterableIterator } from "@azure/core-paging"; +import { Regions } from "../operationsInterfaces"; +import * as coreClient from "@azure/core-client"; +import * as Mappers from "../models/mappers"; import * as Parameters from "../models/parameters"; -import { EventHubManagementClientContext } from "../eventHubManagementClientContext"; +import { EventHubManagementClient } from "../eventHubManagementClient"; +import { + MessagingRegions, + RegionsListBySkuNextOptionalParams, + RegionsListBySkuOptionalParams, + RegionsListBySkuResponse, + RegionsListBySkuNextResponse +} from "../models"; -/** Class representing a Regions. */ -export class Regions { - private readonly client: EventHubManagementClientContext; +/// +/** Class containing Regions operations. */ +export class RegionsImpl implements Regions { + private readonly client: EventHubManagementClient; /** - * Create a Regions. - * @param {EventHubManagementClientContext} client Reference to the service client. + * Initialize a new instance of the class Regions class. + * @param client Reference to the service client */ - constructor(client: EventHubManagementClientContext) { + constructor(client: EventHubManagementClient) { this.client = client; } /** * Gets the available Regions for a given sku * @param sku The sku type. - * @param [options] The optional parameters - * @returns Promise + * @param options The options parameters. */ - listBySku(sku: string, options?: msRest.RequestOptionsBase): Promise; - /** - * @param sku The sku type. - * @param callback The callback - */ - listBySku(sku: string, callback: msRest.ServiceCallback): void; - /** - * @param sku The sku type. - * @param options The optional parameters - * @param callback The callback - */ - listBySku(sku: string, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; - listBySku(sku: string, options?: msRest.RequestOptionsBase | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { - return this.client.sendOperationRequest( - { - sku, - options + public listBySku( + sku: string, + options?: RegionsListBySkuOptionalParams + ): PagedAsyncIterableIterator { + const iter = this.listBySkuPagingAll(sku, options); + return { + next() { + return iter.next(); + }, + [Symbol.asyncIterator]() { + return this; }, - listBySkuOperationSpec, - callback) as Promise; + byPage: () => { + return this.listBySkuPagingPage(sku, options); + } + }; + } + + private async *listBySkuPagingPage( + sku: string, + options?: RegionsListBySkuOptionalParams + ): AsyncIterableIterator { + let result = await this._listBySku(sku, options); + yield result.value || []; + let continuationToken = result.nextLink; + while (continuationToken) { + result = await this._listBySkuNext(sku, continuationToken, options); + continuationToken = result.nextLink; + yield result.value || []; + } + } + + private async *listBySkuPagingAll( + sku: string, + options?: RegionsListBySkuOptionalParams + ): AsyncIterableIterator { + for await (const page of this.listBySkuPagingPage(sku, options)) { + yield* page; + } } /** * Gets the available Regions for a given sku - * @param nextPageLink The NextLink from the previous successful call to List operation. - * @param [options] The optional parameters - * @returns Promise - */ - listBySkuNext(nextPageLink: string, options?: msRest.RequestOptionsBase): Promise; - /** - * @param nextPageLink The NextLink from the previous successful call to List operation. - * @param callback The callback + * @param sku The sku type. + * @param options The options parameters. */ - listBySkuNext(nextPageLink: string, callback: msRest.ServiceCallback): void; + private _listBySku( + sku: string, + options?: RegionsListBySkuOptionalParams + ): Promise { + return this.client.sendOperationRequest( + { sku, options }, + listBySkuOperationSpec + ); + } + /** - * @param nextPageLink The NextLink from the previous successful call to List operation. - * @param options The optional parameters - * @param callback The callback + * ListBySkuNext + * @param sku The sku type. + * @param nextLink The nextLink from the previous successful call to the ListBySku method. + * @param options The options parameters. */ - listBySkuNext(nextPageLink: string, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; - listBySkuNext(nextPageLink: string, options?: msRest.RequestOptionsBase | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { + private _listBySkuNext( + sku: string, + nextLink: string, + options?: RegionsListBySkuNextOptionalParams + ): Promise { return this.client.sendOperationRequest( - { - nextPageLink, - options - }, - listBySkuNextOperationSpec, - callback) as Promise; + { sku, nextLink, options }, + listBySkuNextOperationSpec + ); } } - // Operation Specifications -const serializer = new msRest.Serializer(Mappers); -const listBySkuOperationSpec: msRest.OperationSpec = { +const serializer = coreClient.createSerializer(Mappers, /* isXml */ false); + +const listBySkuOperationSpec: coreClient.OperationSpec = { + path: + "/subscriptions/{subscriptionId}/providers/Microsoft.EventHub/sku/{sku}/regions", httpMethod: "GET", - path: "subscriptions/{subscriptionId}/providers/Microsoft.EventHub/sku/{sku}/regions", - urlParameters: [ - Parameters.subscriptionId, - Parameters.sku - ], - queryParameters: [ - Parameters.apiVersion1 - ], - headerParameters: [ - Parameters.acceptLanguage - ], responses: { 200: { bodyMapper: Mappers.MessagingRegionsListResult @@ -106,19 +126,14 @@ const listBySkuOperationSpec: msRest.OperationSpec = { bodyMapper: Mappers.ErrorResponse } }, + queryParameters: [Parameters.apiVersion1], + urlParameters: [Parameters.$host, Parameters.subscriptionId, Parameters.sku], + headerParameters: [Parameters.accept], serializer }; - -const listBySkuNextOperationSpec: msRest.OperationSpec = { - httpMethod: "GET", - baseUrl: "https://management.azure.com", +const listBySkuNextOperationSpec: coreClient.OperationSpec = { path: "{nextLink}", - urlParameters: [ - Parameters.nextPageLink - ], - headerParameters: [ - Parameters.acceptLanguage - ], + httpMethod: "GET", responses: { 200: { bodyMapper: Mappers.MessagingRegionsListResult @@ -127,5 +142,13 @@ const listBySkuNextOperationSpec: msRest.OperationSpec = { bodyMapper: Mappers.ErrorResponse } }, + queryParameters: [Parameters.apiVersion1], + urlParameters: [ + Parameters.$host, + Parameters.subscriptionId, + Parameters.nextLink, + Parameters.sku + ], + headerParameters: [Parameters.accept], serializer }; diff --git a/sdk/eventhub/arm-eventhub-profile-2020-09-01-hybrid/src/operationsInterfaces/clusters.ts b/sdk/eventhub/arm-eventhub-profile-2020-09-01-hybrid/src/operationsInterfaces/clusters.ts new file mode 100644 index 000000000000..daf155757e99 --- /dev/null +++ b/sdk/eventhub/arm-eventhub-profile-2020-09-01-hybrid/src/operationsInterfaces/clusters.ts @@ -0,0 +1,152 @@ +/* + * 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 { + Cluster, + ClustersListByResourceGroupOptionalParams, + ClustersListAvailableClusterRegionOptionalParams, + ClustersListAvailableClusterRegionResponse, + ClustersGetOptionalParams, + ClustersGetResponse, + ClustersCreateOrUpdateOptionalParams, + ClustersCreateOrUpdateResponse, + ClustersUpdateOptionalParams, + ClustersUpdateResponse, + ClustersDeleteOptionalParams, + ClustersListNamespacesOptionalParams, + ClustersListNamespacesResponse +} from "../models"; + +/// +/** Interface representing a Clusters. */ +export interface Clusters { + /** + * Lists the available Event Hubs Clusters within an ARM resource group + * @param resourceGroupName Name of the resource group within the azure subscription. + * @param options The options parameters. + */ + listByResourceGroup( + resourceGroupName: string, + options?: ClustersListByResourceGroupOptionalParams + ): PagedAsyncIterableIterator; + /** + * List the quantity of available pre-provisioned Event Hubs Clusters, indexed by Azure region. + * @param options The options parameters. + */ + listAvailableClusterRegion( + options?: ClustersListAvailableClusterRegionOptionalParams + ): Promise; + /** + * Gets the resource description of the specified Event Hubs Cluster. + * @param resourceGroupName Name of the resource group within the azure subscription. + * @param clusterName The name of the Event Hubs Cluster. + * @param options The options parameters. + */ + get( + resourceGroupName: string, + clusterName: string, + options?: ClustersGetOptionalParams + ): Promise; + /** + * Creates or updates an instance of an Event Hubs Cluster. + * @param resourceGroupName Name of the resource group within the azure subscription. + * @param clusterName The name of the Event Hubs Cluster. + * @param parameters Parameters for creating a eventhub cluster resource. + * @param options The options parameters. + */ + beginCreateOrUpdate( + resourceGroupName: string, + clusterName: string, + parameters: Cluster, + options?: ClustersCreateOrUpdateOptionalParams + ): Promise< + PollerLike< + PollOperationState, + ClustersCreateOrUpdateResponse + > + >; + /** + * Creates or updates an instance of an Event Hubs Cluster. + * @param resourceGroupName Name of the resource group within the azure subscription. + * @param clusterName The name of the Event Hubs Cluster. + * @param parameters Parameters for creating a eventhub cluster resource. + * @param options The options parameters. + */ + beginCreateOrUpdateAndWait( + resourceGroupName: string, + clusterName: string, + parameters: Cluster, + options?: ClustersCreateOrUpdateOptionalParams + ): Promise; + /** + * Modifies mutable properties on the Event Hubs Cluster. This operation is idempotent. + * @param resourceGroupName Name of the resource group within the azure subscription. + * @param clusterName The name of the Event Hubs Cluster. + * @param parameters The properties of the Event Hubs Cluster which should be updated. + * @param options The options parameters. + */ + beginUpdate( + resourceGroupName: string, + clusterName: string, + parameters: Cluster, + options?: ClustersUpdateOptionalParams + ): Promise< + PollerLike< + PollOperationState, + ClustersUpdateResponse + > + >; + /** + * Modifies mutable properties on the Event Hubs Cluster. This operation is idempotent. + * @param resourceGroupName Name of the resource group within the azure subscription. + * @param clusterName The name of the Event Hubs Cluster. + * @param parameters The properties of the Event Hubs Cluster which should be updated. + * @param options The options parameters. + */ + beginUpdateAndWait( + resourceGroupName: string, + clusterName: string, + parameters: Cluster, + options?: ClustersUpdateOptionalParams + ): Promise; + /** + * Deletes an existing Event Hubs Cluster. This operation is idempotent. + * @param resourceGroupName Name of the resource group within the azure subscription. + * @param clusterName The name of the Event Hubs Cluster. + * @param options The options parameters. + */ + beginDelete( + resourceGroupName: string, + clusterName: string, + options?: ClustersDeleteOptionalParams + ): Promise, void>>; + /** + * Deletes an existing Event Hubs Cluster. This operation is idempotent. + * @param resourceGroupName Name of the resource group within the azure subscription. + * @param clusterName The name of the Event Hubs Cluster. + * @param options The options parameters. + */ + beginDeleteAndWait( + resourceGroupName: string, + clusterName: string, + options?: ClustersDeleteOptionalParams + ): Promise; + /** + * List all Event Hubs Namespace IDs in an Event Hubs Dedicated Cluster. + * @param resourceGroupName Name of the resource group within the azure subscription. + * @param clusterName The name of the Event Hubs Cluster. + * @param options The options parameters. + */ + listNamespaces( + resourceGroupName: string, + clusterName: string, + options?: ClustersListNamespacesOptionalParams + ): Promise; +} diff --git a/sdk/eventhub/arm-eventhub-profile-2020-09-01-hybrid/src/operationsInterfaces/consumerGroups.ts b/sdk/eventhub/arm-eventhub-profile-2020-09-01-hybrid/src/operationsInterfaces/consumerGroups.ts new file mode 100644 index 000000000000..d0ee2f0c893f --- /dev/null +++ b/sdk/eventhub/arm-eventhub-profile-2020-09-01-hybrid/src/operationsInterfaces/consumerGroups.ts @@ -0,0 +1,84 @@ +/* + * 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 { + ConsumerGroup, + ConsumerGroupsListByEventHubOptionalParams, + ConsumerGroupsCreateOrUpdateOptionalParams, + ConsumerGroupsCreateOrUpdateResponse, + ConsumerGroupsDeleteOptionalParams, + ConsumerGroupsGetOptionalParams, + ConsumerGroupsGetResponse +} from "../models"; + +/// +/** Interface representing a ConsumerGroups. */ +export interface ConsumerGroups { + /** + * Gets all the consumer groups in a Namespace. An empty feed is returned if no consumer group exists + * in the Namespace. + * @param resourceGroupName Name of the resource group within the azure subscription. + * @param namespaceName The Namespace name + * @param eventHubName The Event Hub name + * @param options The options parameters. + */ + listByEventHub( + resourceGroupName: string, + namespaceName: string, + eventHubName: string, + options?: ConsumerGroupsListByEventHubOptionalParams + ): PagedAsyncIterableIterator; + /** + * Creates or updates an Event Hubs consumer group as a nested resource within a Namespace. + * @param resourceGroupName Name of the resource group within the azure subscription. + * @param namespaceName The Namespace name + * @param eventHubName The Event Hub name + * @param consumerGroupName The consumer group name + * @param parameters Parameters supplied to create or update a consumer group resource. + * @param options The options parameters. + */ + createOrUpdate( + resourceGroupName: string, + namespaceName: string, + eventHubName: string, + consumerGroupName: string, + parameters: ConsumerGroup, + options?: ConsumerGroupsCreateOrUpdateOptionalParams + ): Promise; + /** + * Deletes a consumer group from the specified Event Hub and resource group. + * @param resourceGroupName Name of the resource group within the azure subscription. + * @param namespaceName The Namespace name + * @param eventHubName The Event Hub name + * @param consumerGroupName The consumer group name + * @param options The options parameters. + */ + delete( + resourceGroupName: string, + namespaceName: string, + eventHubName: string, + consumerGroupName: string, + options?: ConsumerGroupsDeleteOptionalParams + ): Promise; + /** + * Gets a description for the specified consumer group. + * @param resourceGroupName Name of the resource group within the azure subscription. + * @param namespaceName The Namespace name + * @param eventHubName The Event Hub name + * @param consumerGroupName The consumer group name + * @param options The options parameters. + */ + get( + resourceGroupName: string, + namespaceName: string, + eventHubName: string, + consumerGroupName: string, + options?: ConsumerGroupsGetOptionalParams + ): Promise; +} diff --git a/sdk/eventhub/arm-eventhub-profile-2020-09-01-hybrid/src/operationsInterfaces/disasterRecoveryConfigs.ts b/sdk/eventhub/arm-eventhub-profile-2020-09-01-hybrid/src/operationsInterfaces/disasterRecoveryConfigs.ts new file mode 100644 index 000000000000..6b1afa052cac --- /dev/null +++ b/sdk/eventhub/arm-eventhub-profile-2020-09-01-hybrid/src/operationsInterfaces/disasterRecoveryConfigs.ts @@ -0,0 +1,65 @@ +/* + * 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 { + AuthorizationRule, + DisasterRecoveryConfigsListAuthorizationRulesOptionalParams, + DisasterRecoveryConfigsGetAuthorizationRuleOptionalParams, + DisasterRecoveryConfigsGetAuthorizationRuleResponse, + DisasterRecoveryConfigsListKeysOptionalParams, + DisasterRecoveryConfigsListKeysResponse +} from "../models"; + +/// +/** Interface representing a DisasterRecoveryConfigs. */ +export interface DisasterRecoveryConfigs { + /** + * Gets a list of authorization rules for a Namespace. + * @param resourceGroupName Name of the resource group within the azure subscription. + * @param namespaceName The Namespace name + * @param alias The Disaster Recovery configuration name + * @param options The options parameters. + */ + listAuthorizationRules( + resourceGroupName: string, + namespaceName: string, + alias: string, + options?: DisasterRecoveryConfigsListAuthorizationRulesOptionalParams + ): PagedAsyncIterableIterator; + /** + * Gets an AuthorizationRule for a Namespace by rule name. + * @param resourceGroupName Name of the resource group within the azure subscription. + * @param namespaceName The Namespace name + * @param alias The Disaster Recovery configuration name + * @param authorizationRuleName The authorization rule name. + * @param options The options parameters. + */ + getAuthorizationRule( + resourceGroupName: string, + namespaceName: string, + alias: string, + authorizationRuleName: string, + options?: DisasterRecoveryConfigsGetAuthorizationRuleOptionalParams + ): Promise; + /** + * Gets the primary and secondary connection strings for the Namespace. + * @param resourceGroupName Name of the resource group within the azure subscription. + * @param namespaceName The Namespace name + * @param alias The Disaster Recovery configuration name + * @param authorizationRuleName The authorization rule name. + * @param options The options parameters. + */ + listKeys( + resourceGroupName: string, + namespaceName: string, + alias: string, + authorizationRuleName: string, + options?: DisasterRecoveryConfigsListKeysOptionalParams + ): Promise; +} diff --git a/sdk/eventhub/arm-eventhub-profile-2020-09-01-hybrid/src/operationsInterfaces/eventHubs.ts b/sdk/eventhub/arm-eventhub-profile-2020-09-01-hybrid/src/operationsInterfaces/eventHubs.ts new file mode 100644 index 000000000000..07f6d801c161 --- /dev/null +++ b/sdk/eventhub/arm-eventhub-profile-2020-09-01-hybrid/src/operationsInterfaces/eventHubs.ts @@ -0,0 +1,181 @@ +/* + * 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 { + AuthorizationRule, + EventHubsListAuthorizationRulesOptionalParams, + Eventhub, + EventHubsListByNamespaceOptionalParams, + EventHubsCreateOrUpdateAuthorizationRuleOptionalParams, + EventHubsCreateOrUpdateAuthorizationRuleResponse, + EventHubsGetAuthorizationRuleOptionalParams, + EventHubsGetAuthorizationRuleResponse, + EventHubsDeleteAuthorizationRuleOptionalParams, + EventHubsListKeysOptionalParams, + EventHubsListKeysResponse, + RegenerateAccessKeyParameters, + EventHubsRegenerateKeysOptionalParams, + EventHubsRegenerateKeysResponse, + EventHubsCreateOrUpdateOptionalParams, + EventHubsCreateOrUpdateResponse, + EventHubsDeleteOptionalParams, + EventHubsGetOptionalParams, + EventHubsGetResponse +} from "../models"; + +/// +/** Interface representing a EventHubs. */ +export interface EventHubs { + /** + * Gets the authorization rules for an Event Hub. + * @param resourceGroupName Name of the resource group within the azure subscription. + * @param namespaceName The Namespace name + * @param eventHubName The Event Hub name + * @param options The options parameters. + */ + listAuthorizationRules( + resourceGroupName: string, + namespaceName: string, + eventHubName: string, + options?: EventHubsListAuthorizationRulesOptionalParams + ): PagedAsyncIterableIterator; + /** + * Gets all the Event Hubs in a Namespace. + * @param resourceGroupName Name of the resource group within the azure subscription. + * @param namespaceName The Namespace name + * @param options The options parameters. + */ + listByNamespace( + resourceGroupName: string, + namespaceName: string, + options?: EventHubsListByNamespaceOptionalParams + ): PagedAsyncIterableIterator; + /** + * Creates or updates an AuthorizationRule for the specified Event Hub. Creation/update of the + * AuthorizationRule will take a few seconds to take effect. + * @param resourceGroupName Name of the resource group within the azure subscription. + * @param namespaceName The Namespace name + * @param eventHubName The Event Hub name + * @param authorizationRuleName The authorization rule name. + * @param parameters The shared access AuthorizationRule. + * @param options The options parameters. + */ + createOrUpdateAuthorizationRule( + resourceGroupName: string, + namespaceName: string, + eventHubName: string, + authorizationRuleName: string, + parameters: AuthorizationRule, + options?: EventHubsCreateOrUpdateAuthorizationRuleOptionalParams + ): Promise; + /** + * Gets an AuthorizationRule for an Event Hub by rule name. + * @param resourceGroupName Name of the resource group within the azure subscription. + * @param namespaceName The Namespace name + * @param eventHubName The Event Hub name + * @param authorizationRuleName The authorization rule name. + * @param options The options parameters. + */ + getAuthorizationRule( + resourceGroupName: string, + namespaceName: string, + eventHubName: string, + authorizationRuleName: string, + options?: EventHubsGetAuthorizationRuleOptionalParams + ): Promise; + /** + * Deletes an Event Hub AuthorizationRule. + * @param resourceGroupName Name of the resource group within the azure subscription. + * @param namespaceName The Namespace name + * @param eventHubName The Event Hub name + * @param authorizationRuleName The authorization rule name. + * @param options The options parameters. + */ + deleteAuthorizationRule( + resourceGroupName: string, + namespaceName: string, + eventHubName: string, + authorizationRuleName: string, + options?: EventHubsDeleteAuthorizationRuleOptionalParams + ): Promise; + /** + * Gets the ACS and SAS connection strings for the Event Hub. + * @param resourceGroupName Name of the resource group within the azure subscription. + * @param namespaceName The Namespace name + * @param eventHubName The Event Hub name + * @param authorizationRuleName The authorization rule name. + * @param options The options parameters. + */ + listKeys( + resourceGroupName: string, + namespaceName: string, + eventHubName: string, + authorizationRuleName: string, + options?: EventHubsListKeysOptionalParams + ): Promise; + /** + * Regenerates the ACS and SAS connection strings for the Event Hub. + * @param resourceGroupName Name of the resource group within the azure subscription. + * @param namespaceName The Namespace name + * @param eventHubName The Event Hub name + * @param authorizationRuleName The authorization rule name. + * @param parameters Parameters supplied to regenerate the AuthorizationRule Keys + * (PrimaryKey/SecondaryKey). + * @param options The options parameters. + */ + regenerateKeys( + resourceGroupName: string, + namespaceName: string, + eventHubName: string, + authorizationRuleName: string, + parameters: RegenerateAccessKeyParameters, + options?: EventHubsRegenerateKeysOptionalParams + ): Promise; + /** + * Creates or updates a new Event Hub as a nested resource within a Namespace. + * @param resourceGroupName Name of the resource group within the azure subscription. + * @param namespaceName The Namespace name + * @param eventHubName The Event Hub name + * @param parameters Parameters supplied to create an Event Hub resource. + * @param options The options parameters. + */ + createOrUpdate( + resourceGroupName: string, + namespaceName: string, + eventHubName: string, + parameters: Eventhub, + options?: EventHubsCreateOrUpdateOptionalParams + ): Promise; + /** + * Deletes an Event Hub from the specified Namespace and resource group. + * @param resourceGroupName Name of the resource group within the azure subscription. + * @param namespaceName The Namespace name + * @param eventHubName The Event Hub name + * @param options The options parameters. + */ + delete( + resourceGroupName: string, + namespaceName: string, + eventHubName: string, + options?: EventHubsDeleteOptionalParams + ): Promise; + /** + * Gets an Event Hubs description for the specified Event Hub. + * @param resourceGroupName Name of the resource group within the azure subscription. + * @param namespaceName The Namespace name + * @param eventHubName The Event Hub name + * @param options The options parameters. + */ + get( + resourceGroupName: string, + namespaceName: string, + eventHubName: string, + options?: EventHubsGetOptionalParams + ): Promise; +} diff --git a/sdk/eventhub/arm-eventhub-profile-2020-09-01-hybrid/src/operationsInterfaces/index.ts b/sdk/eventhub/arm-eventhub-profile-2020-09-01-hybrid/src/operationsInterfaces/index.ts new file mode 100644 index 000000000000..7bae75aa702a --- /dev/null +++ b/sdk/eventhub/arm-eventhub-profile-2020-09-01-hybrid/src/operationsInterfaces/index.ts @@ -0,0 +1,17 @@ +/* + * 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 "./clusters"; +export * from "./namespaces"; +export * from "./privateEndpointConnections"; +export * from "./privateLinkResources"; +export * from "./disasterRecoveryConfigs"; +export * from "./eventHubs"; +export * from "./consumerGroups"; +export * from "./operations"; +export * from "./regions"; diff --git a/sdk/eventhub/arm-eventhub-profile-2020-09-01-hybrid/src/operationsInterfaces/namespaces.ts b/sdk/eventhub/arm-eventhub-profile-2020-09-01-hybrid/src/operationsInterfaces/namespaces.ts new file mode 100644 index 000000000000..d69fa5071969 --- /dev/null +++ b/sdk/eventhub/arm-eventhub-profile-2020-09-01-hybrid/src/operationsInterfaces/namespaces.ts @@ -0,0 +1,229 @@ +/* + * 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 { + EHNamespace, + NamespacesListOptionalParams, + NamespacesListByResourceGroupOptionalParams, + AuthorizationRule, + NamespacesListAuthorizationRulesOptionalParams, + NamespacesCreateOrUpdateOptionalParams, + NamespacesCreateOrUpdateResponse, + NamespacesDeleteOptionalParams, + NamespacesGetOptionalParams, + NamespacesGetResponse, + NamespacesUpdateOptionalParams, + NamespacesUpdateResponse, + NamespacesCreateOrUpdateAuthorizationRuleOptionalParams, + NamespacesCreateOrUpdateAuthorizationRuleResponse, + NamespacesDeleteAuthorizationRuleOptionalParams, + NamespacesGetAuthorizationRuleOptionalParams, + NamespacesGetAuthorizationRuleResponse, + NamespacesListKeysOptionalParams, + NamespacesListKeysResponse, + RegenerateAccessKeyParameters, + NamespacesRegenerateKeysOptionalParams, + NamespacesRegenerateKeysResponse, + CheckNameAvailabilityParameter, + NamespacesCheckNameAvailabilityOptionalParams, + NamespacesCheckNameAvailabilityResponse +} from "../models"; + +/// +/** Interface representing a Namespaces. */ +export interface Namespaces { + /** + * Lists all the available Namespaces within a subscription, irrespective of the resource groups. + * @param options The options parameters. + */ + list( + options?: NamespacesListOptionalParams + ): PagedAsyncIterableIterator; + /** + * Lists the available Namespaces within a resource group. + * @param resourceGroupName Name of the resource group within the azure subscription. + * @param options The options parameters. + */ + listByResourceGroup( + resourceGroupName: string, + options?: NamespacesListByResourceGroupOptionalParams + ): PagedAsyncIterableIterator; + /** + * Gets a list of authorization rules for a Namespace. + * @param resourceGroupName Name of the resource group within the azure subscription. + * @param namespaceName The Namespace name + * @param options The options parameters. + */ + listAuthorizationRules( + resourceGroupName: string, + namespaceName: string, + options?: NamespacesListAuthorizationRulesOptionalParams + ): PagedAsyncIterableIterator; + /** + * Creates or updates a namespace. Once created, this namespace's resource manifest is immutable. This + * operation is idempotent. + * @param resourceGroupName Name of the resource group within the azure subscription. + * @param namespaceName The Namespace name + * @param parameters Parameters for creating a namespace resource. + * @param options The options parameters. + */ + beginCreateOrUpdate( + resourceGroupName: string, + namespaceName: string, + parameters: EHNamespace, + options?: NamespacesCreateOrUpdateOptionalParams + ): Promise< + PollerLike< + PollOperationState, + NamespacesCreateOrUpdateResponse + > + >; + /** + * Creates or updates a namespace. Once created, this namespace's resource manifest is immutable. This + * operation is idempotent. + * @param resourceGroupName Name of the resource group within the azure subscription. + * @param namespaceName The Namespace name + * @param parameters Parameters for creating a namespace resource. + * @param options The options parameters. + */ + beginCreateOrUpdateAndWait( + resourceGroupName: string, + namespaceName: string, + parameters: EHNamespace, + options?: NamespacesCreateOrUpdateOptionalParams + ): Promise; + /** + * Deletes an existing namespace. This operation also removes all associated resources under the + * namespace. + * @param resourceGroupName Name of the resource group within the azure subscription. + * @param namespaceName The Namespace name + * @param options The options parameters. + */ + beginDelete( + resourceGroupName: string, + namespaceName: string, + options?: NamespacesDeleteOptionalParams + ): Promise, void>>; + /** + * Deletes an existing namespace. This operation also removes all associated resources under the + * namespace. + * @param resourceGroupName Name of the resource group within the azure subscription. + * @param namespaceName The Namespace name + * @param options The options parameters. + */ + beginDeleteAndWait( + resourceGroupName: string, + namespaceName: string, + options?: NamespacesDeleteOptionalParams + ): Promise; + /** + * Gets the description of the specified namespace. + * @param resourceGroupName Name of the resource group within the azure subscription. + * @param namespaceName The Namespace name + * @param options The options parameters. + */ + get( + resourceGroupName: string, + namespaceName: string, + options?: NamespacesGetOptionalParams + ): Promise; + /** + * Creates or updates a namespace. Once created, this namespace's resource manifest is immutable. This + * operation is idempotent. + * @param resourceGroupName Name of the resource group within the azure subscription. + * @param namespaceName The Namespace name + * @param parameters Parameters for updating a namespace resource. + * @param options The options parameters. + */ + update( + resourceGroupName: string, + namespaceName: string, + parameters: EHNamespace, + options?: NamespacesUpdateOptionalParams + ): Promise; + /** + * Creates or updates an AuthorizationRule for a Namespace. + * @param resourceGroupName Name of the resource group within the azure subscription. + * @param namespaceName The Namespace name + * @param authorizationRuleName The authorization rule name. + * @param parameters The shared access AuthorizationRule. + * @param options The options parameters. + */ + createOrUpdateAuthorizationRule( + resourceGroupName: string, + namespaceName: string, + authorizationRuleName: string, + parameters: AuthorizationRule, + options?: NamespacesCreateOrUpdateAuthorizationRuleOptionalParams + ): Promise; + /** + * Deletes an AuthorizationRule for a Namespace. + * @param resourceGroupName Name of the resource group within the azure subscription. + * @param namespaceName The Namespace name + * @param authorizationRuleName The authorization rule name. + * @param options The options parameters. + */ + deleteAuthorizationRule( + resourceGroupName: string, + namespaceName: string, + authorizationRuleName: string, + options?: NamespacesDeleteAuthorizationRuleOptionalParams + ): Promise; + /** + * Gets an AuthorizationRule for a Namespace by rule name. + * @param resourceGroupName Name of the resource group within the azure subscription. + * @param namespaceName The Namespace name + * @param authorizationRuleName The authorization rule name. + * @param options The options parameters. + */ + getAuthorizationRule( + resourceGroupName: string, + namespaceName: string, + authorizationRuleName: string, + options?: NamespacesGetAuthorizationRuleOptionalParams + ): Promise; + /** + * Gets the primary and secondary connection strings for the Namespace. + * @param resourceGroupName Name of the resource group within the azure subscription. + * @param namespaceName The Namespace name + * @param authorizationRuleName The authorization rule name. + * @param options The options parameters. + */ + listKeys( + resourceGroupName: string, + namespaceName: string, + authorizationRuleName: string, + options?: NamespacesListKeysOptionalParams + ): Promise; + /** + * Regenerates the primary or secondary connection strings for the specified Namespace. + * @param resourceGroupName Name of the resource group within the azure subscription. + * @param namespaceName The Namespace name + * @param authorizationRuleName The authorization rule name. + * @param parameters Parameters required to regenerate the connection string. + * @param options The options parameters. + */ + regenerateKeys( + resourceGroupName: string, + namespaceName: string, + authorizationRuleName: string, + parameters: RegenerateAccessKeyParameters, + options?: NamespacesRegenerateKeysOptionalParams + ): Promise; + /** + * Check the give Namespace name availability. + * @param parameters Parameters to check availability of the given Namespace name + * @param options The options parameters. + */ + checkNameAvailability( + parameters: CheckNameAvailabilityParameter, + options?: NamespacesCheckNameAvailabilityOptionalParams + ): Promise; +} diff --git a/sdk/eventhub/arm-eventhub-profile-2020-09-01-hybrid/src/operationsInterfaces/operations.ts b/sdk/eventhub/arm-eventhub-profile-2020-09-01-hybrid/src/operationsInterfaces/operations.ts new file mode 100644 index 000000000000..d17b96f02fe7 --- /dev/null +++ b/sdk/eventhub/arm-eventhub-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 Event Hub REST API operations. + * @param options The options parameters. + */ + list( + options?: OperationsListOptionalParams + ): PagedAsyncIterableIterator; +} diff --git a/sdk/eventhub/arm-eventhub-profile-2020-09-01-hybrid/src/operationsInterfaces/privateEndpointConnections.ts b/sdk/eventhub/arm-eventhub-profile-2020-09-01-hybrid/src/operationsInterfaces/privateEndpointConnections.ts new file mode 100644 index 000000000000..37ba1ad4cc36 --- /dev/null +++ b/sdk/eventhub/arm-eventhub-profile-2020-09-01-hybrid/src/operationsInterfaces/privateEndpointConnections.ts @@ -0,0 +1,92 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +import { PagedAsyncIterableIterator } from "@azure/core-paging"; +import { PollerLike, PollOperationState } from "@azure/core-lro"; +import { + PrivateEndpointConnection, + PrivateEndpointConnectionsListOptionalParams, + PrivateEndpointConnectionsCreateOrUpdateOptionalParams, + PrivateEndpointConnectionsCreateOrUpdateResponse, + PrivateEndpointConnectionsDeleteOptionalParams, + PrivateEndpointConnectionsGetOptionalParams, + PrivateEndpointConnectionsGetResponse +} from "../models"; + +/// +/** Interface representing a PrivateEndpointConnections. */ +export interface PrivateEndpointConnections { + /** + * Gets the available PrivateEndpointConnections within a namespace. + * @param resourceGroupName Name of the resource group within the azure subscription. + * @param namespaceName The Namespace name + * @param options The options parameters. + */ + list( + resourceGroupName: string, + namespaceName: string, + options?: PrivateEndpointConnectionsListOptionalParams + ): PagedAsyncIterableIterator; + /** + * Creates or updates PrivateEndpointConnections of service namespace. + * @param resourceGroupName Name of the resource group within the azure subscription. + * @param namespaceName The Namespace name + * @param privateEndpointConnectionName The PrivateEndpointConnection name + * @param parameters Parameters supplied to update Status of PrivateEndPoint Connection to namespace + * resource. + * @param options The options parameters. + */ + createOrUpdate( + resourceGroupName: string, + namespaceName: string, + privateEndpointConnectionName: string, + parameters: PrivateEndpointConnection, + options?: PrivateEndpointConnectionsCreateOrUpdateOptionalParams + ): Promise; + /** + * Deletes an existing namespace. This operation also removes all associated resources under the + * namespace. + * @param resourceGroupName Name of the resource group within the azure subscription. + * @param namespaceName The Namespace name + * @param privateEndpointConnectionName The PrivateEndpointConnection name + * @param options The options parameters. + */ + beginDelete( + resourceGroupName: string, + namespaceName: string, + privateEndpointConnectionName: string, + options?: PrivateEndpointConnectionsDeleteOptionalParams + ): Promise, void>>; + /** + * Deletes an existing namespace. This operation also removes all associated resources under the + * namespace. + * @param resourceGroupName Name of the resource group within the azure subscription. + * @param namespaceName The Namespace name + * @param privateEndpointConnectionName The PrivateEndpointConnection name + * @param options The options parameters. + */ + beginDeleteAndWait( + resourceGroupName: string, + namespaceName: string, + privateEndpointConnectionName: string, + options?: PrivateEndpointConnectionsDeleteOptionalParams + ): Promise; + /** + * Gets a description for the specified Private Endpoint Connection name. + * @param resourceGroupName Name of the resource group within the azure subscription. + * @param namespaceName The Namespace name + * @param privateEndpointConnectionName The PrivateEndpointConnection name + * @param options The options parameters. + */ + get( + resourceGroupName: string, + namespaceName: string, + privateEndpointConnectionName: string, + options?: PrivateEndpointConnectionsGetOptionalParams + ): Promise; +} diff --git a/sdk/eventhub/arm-eventhub-profile-2020-09-01-hybrid/src/operationsInterfaces/privateLinkResources.ts b/sdk/eventhub/arm-eventhub-profile-2020-09-01-hybrid/src/operationsInterfaces/privateLinkResources.ts new file mode 100644 index 000000000000..b1092fad65fb --- /dev/null +++ b/sdk/eventhub/arm-eventhub-profile-2020-09-01-hybrid/src/operationsInterfaces/privateLinkResources.ts @@ -0,0 +1,27 @@ +/* + * 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 { + PrivateLinkResourcesGetOptionalParams, + PrivateLinkResourcesGetResponse +} from "../models"; + +/** Interface representing a PrivateLinkResources. */ +export interface PrivateLinkResources { + /** + * Gets lists of resources that supports Privatelinks. + * @param resourceGroupName Name of the resource group within the azure subscription. + * @param namespaceName The Namespace name + * @param options The options parameters. + */ + get( + resourceGroupName: string, + namespaceName: string, + options?: PrivateLinkResourcesGetOptionalParams + ): Promise; +} diff --git a/sdk/eventhub/arm-eventhub-profile-2020-09-01-hybrid/src/operationsInterfaces/regions.ts b/sdk/eventhub/arm-eventhub-profile-2020-09-01-hybrid/src/operationsInterfaces/regions.ts new file mode 100644 index 000000000000..49d33063aac4 --- /dev/null +++ b/sdk/eventhub/arm-eventhub-profile-2020-09-01-hybrid/src/operationsInterfaces/regions.ts @@ -0,0 +1,24 @@ +/* + * 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 { MessagingRegions, RegionsListBySkuOptionalParams } from "../models"; + +/// +/** Interface representing a Regions. */ +export interface Regions { + /** + * Gets the available Regions for a given sku + * @param sku The sku type. + * @param options The options parameters. + */ + listBySku( + sku: string, + options?: RegionsListBySkuOptionalParams + ): PagedAsyncIterableIterator; +} diff --git a/sdk/eventhub/arm-eventhub-profile-2020-09-01-hybrid/test/sampleTest.ts b/sdk/eventhub/arm-eventhub-profile-2020-09-01-hybrid/test/sampleTest.ts new file mode 100644 index 000000000000..7ed89b043e1b --- /dev/null +++ b/sdk/eventhub/arm-eventhub-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/eventhub/arm-eventhub-profile-2020-09-01-hybrid/tsconfig.json b/sdk/eventhub/arm-eventhub-profile-2020-09-01-hybrid/tsconfig.json index 422b584abd5e..3e6ae96443f3 100644 --- a/sdk/eventhub/arm-eventhub-profile-2020-09-01-hybrid/tsconfig.json +++ b/sdk/eventhub/arm-eventhub-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/eventhub/ci.mgmt.yml b/sdk/eventhub/ci.mgmt.yml index 2eef9cbc0942..a39b3069f73c 100644 --- a/sdk/eventhub/ci.mgmt.yml +++ b/sdk/eventhub/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/eventhub/ci.mgmt.yml - sdk/eventhub/arm-eventhub/ + - sdk/eventhub/arm-eventhub-profile-2020-09-01-hybrid pr: branches: include: @@ -23,7 +24,7 @@ pr: include: - sdk/eventhub/ci.mgmt.yml - sdk/eventhub/arm-eventhub/ - + - sdk/eventhub/arm-eventhub-profile-2020-09-01-hybrid extends: template: /eng/pipelines/templates/stages/archetype-sdk-client.yml parameters: @@ -31,4 +32,6 @@ extends: RunUnitTests: true Artifacts: - name: azure-arm-eventhub - safeName: azurearmeventhub \ No newline at end of file + safeName: azurearmeventhub + - name: azure-arm-eventhub-profile-2020-09-01-hybrid + safeName: azurearmeventhubprofile20200901hybrid diff --git a/sdk/eventhub/ci.yml b/sdk/eventhub/ci.yml index 65728e8f5fbe..f1ccbd0f3913 100644 --- a/sdk/eventhub/ci.yml +++ b/sdk/eventhub/ci.yml @@ -1,4 +1,5 @@ # NOTE: Please refer to https://aka.ms/azsdk/engsys/ci-yaml before editing this file. + trigger: branches: include: @@ -11,6 +12,7 @@ trigger: exclude: - sdk/eventhub/ci.mgmt.yml - sdk/eventhub/arm-eventhub/ + - sdk/eventhub/arm-eventhub-profile-2020-09-01-hybrid pr: branches: include: @@ -26,7 +28,7 @@ pr: exclude: - sdk/eventhub/ci.mgmt.yml - sdk/eventhub/arm-eventhub/ - + - sdk/eventhub/arm-eventhub-profile-2020-09-01-hybrid extends: template: ../../eng/pipelines/templates/stages/archetype-sdk-client.yml parameters: @@ -38,4 +40,4 @@ extends: - name: azure-eventhubs-checkpointstore-blob safeName: azureeventhubscheckpointstoreblob - name: azure-eventhubs-checkpointstore-table - safeName: azureeventhubscheckpointstoretable \ No newline at end of file + safeName: azureeventhubscheckpointstoretable