diff --git a/common/config/rush/pnpm-lock.yaml b/common/config/rush/pnpm-lock.yaml index 2e5e5dd43054..9b68df11ee94 100644 --- a/common/config/rush/pnpm-lock.yaml +++ b/common/config/rush/pnpm-lock.yaml @@ -10,6 +10,7 @@ dependencies: '@rush-temp/arm-appservice': file:projects/arm-appservice.tgz '@rush-temp/arm-authorization': file:projects/arm-authorization.tgz '@rush-temp/arm-compute': file:projects/arm-compute.tgz + '@rush-temp/arm-eventhub': file:projects/arm-eventhub.tgz '@rush-temp/arm-features': file:projects/arm-features.tgz '@rush-temp/arm-keyvault': file:projects/arm-keyvault.tgz '@rush-temp/arm-links': file:projects/arm-links.tgz @@ -8543,6 +8544,25 @@ packages: integrity: sha512-T3UFCbTMY/dds1j8CFcJLUkkyV3oR9pnPcpbK3DvLauxAZGylmQbuZv36iTLpGpMO0cxKIdgGm1G6EdgfgMOPw== tarball: file:projects/arm-compute.tgz version: 0.0.0 + file:projects/arm-eventhub.tgz: + dependencies: + '@microsoft/api-extractor': 7.7.11 + '@rollup/plugin-commonjs': 11.0.2_rollup@1.32.1 + '@rollup/plugin-json': 4.1.0_rollup@1.32.1 + '@rollup/plugin-multi-entry': 3.0.1_rollup@1.32.1 + '@rollup/plugin-node-resolve': 8.4.0_rollup@1.32.1 + mkdirp: 1.0.4 + rollup: 1.32.1 + rollup-plugin-sourcemaps: 0.4.2_rollup@1.32.1 + tslib: 2.3.1 + typescript: 4.2.4 + uglify-js: 3.14.1 + dev: false + name: '@rush-temp/arm-eventhub' + resolution: + integrity: sha512-prxNN24vp5ndwaqivPOFLkNF0Id6m0zm5YL0Azqgv6PoZzThFLxEkgaWtsUxFQicLGqXWB7XomzA0EUyPHyDbQ== + tarball: file:projects/arm-eventhub.tgz + version: 0.0.0 file:projects/arm-features.tgz: dependencies: '@microsoft/api-extractor': 7.7.11 @@ -12655,6 +12675,7 @@ specifiers: '@rush-temp/arm-appservice': file:./projects/arm-appservice.tgz '@rush-temp/arm-authorization': file:./projects/arm-authorization.tgz '@rush-temp/arm-compute': file:./projects/arm-compute.tgz + '@rush-temp/arm-eventhub': file:./projects/arm-eventhub.tgz '@rush-temp/arm-features': file:./projects/arm-features.tgz '@rush-temp/arm-keyvault': file:./projects/arm-keyvault.tgz '@rush-temp/arm-links': file:./projects/arm-links.tgz diff --git a/rush.json b/rush.json index 35e12a037d59..a65b1a2dfa0b 100644 --- a/rush.json +++ b/rush.json @@ -905,6 +905,11 @@ "packageName": "@azure/arm-authorization", "projectFolder": "sdk/authorization/arm-authorization", "versionPolicyName": "management" + }, + { + "packageName": "@azure/arm-eventhub", + "projectFolder": "sdk/eventhub/arm-eventhub", + "versionPolicyName": "management" } ] } \ No newline at end of file diff --git a/sdk/eventhub/arm-eventhub/CHANGELOG.md b/sdk/eventhub/arm-eventhub/CHANGELOG.md new file mode 100644 index 000000000000..9ac87d2a803c --- /dev/null +++ b/sdk/eventhub/arm-eventhub/CHANGELOG.md @@ -0,0 +1,14 @@ +## 30.0.0-beta.1 (2021-09-07) + +This is the first preview for the new version of the `@azure/arm-eventhub` package that follows the new [guidelines for TypeScript SDKs](https://azure.github.io/azure-sdk/typescript_introduction.html) for Azure services. + +While this package remains auto generated, the SDK generator itself has undergone changes to comply with the above guidelines in order to generate packages that are idiomatic to the JavaScript/TypeScript ecosystem and consistent with other packages for Azure services. For more on this, please see [State of the Azure SDK 2021](https://devblogs.microsoft.com/azure-sdk/state-of-the-azure-sdk-2021/). + +Please note that this version has breaking changes, all of which were made after careful consideration during the authoring of the guidelines and user studies. + +**Noteworthy changes and features** +- Authentication: The packages `@azure/ms-rest-nodeauth` or `@azure/ms-rest-browserauth` are no longer supported. Use package [@azure/identity](https://www.npmjs.com/package/@azure/identity) instead. Select a credential from Azure Identity examples based on the authentication method of your choice. +- Callbacks: Method overloads that used callbacks have been removed and the use of promises is encouraged instead. +- List operations now return an iterable result that follows the `PagedAsyncIterableIterator` interface as opposed to the previous model where you had to make a new request using the link to the next page. +- Long running operations i.e. the Lro related object returned by methods whose names started with `begin`, now uses `pollUntilDone` to check whether the request is finished, instead of `pollUntilFinished`. To get the final result, use the corresponding method that will have the suffix `AndWait`. +- The SDK only supports ECMAScript 2015 (ES6) and beyond, all projects that referenced this SDK should be upgraded to use ES6. diff --git a/sdk/eventhub/arm-eventhub/LICENSE.txt b/sdk/eventhub/arm-eventhub/LICENSE similarity index 96% rename from sdk/eventhub/arm-eventhub/LICENSE.txt rename to sdk/eventhub/arm-eventhub/LICENSE index b73b4a1293c3..ccb63b166732 100644 --- a/sdk/eventhub/arm-eventhub/LICENSE.txt +++ b/sdk/eventhub/arm-eventhub/LICENSE @@ -1,6 +1,6 @@ The MIT License (MIT) -Copyright (c) 2019 Microsoft +Copyright (c) 2021 Microsoft Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal @@ -18,4 +18,4 @@ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE -SOFTWARE. +SOFTWARE. \ No newline at end of file diff --git a/sdk/eventhub/arm-eventhub/README.md b/sdk/eventhub/arm-eventhub/README.md index 1bebe8ce0919..c168d241a910 100644 --- a/sdk/eventhub/arm-eventhub/README.md +++ b/sdk/eventhub/arm-eventhub/README.md @@ -1,109 +1,93 @@ -## 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) | +[Package (NPM)](https://www.npmjs.com/package/@azure/arm-eventhub) | +[API reference documentation](https://docs.microsoft.com/javascript/api/@azure/arm-eventhub) | +[Samples](https://github.com/Azure-Samples/azure-samples-js-management) + +## Getting started ### Currently supported environments - [LTS versions of Node.js](https://nodejs.org/about/releases/) -- Latest versions of Safari, Chrome, Edge, and Firefox. +- Latest versions of Safari, Chrome, Edge and Firefox. ### Prerequisites -You must have an [Azure subscription](https://azure.microsoft.com/free/). +- An [Azure subscription][azure_sub]. -### How to install +### Install the `@azure/arm-eventhub` package -To use this SDK in your project, you will need to install two packages. -- `@azure/arm-eventhub` 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 @azure/identity +npm install @azure/arm-eventhub ``` -> **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. +#### Using an Azure Active Directory Credential -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. +You can authenticate with Azure Active Directory using the [Azure Identity library][azure_identity]. To use the [DefaultAzureCredential][defaultazurecredential] provider shown below, or other credential providers provided with the Azure SDK, please install the `@azure/identity` package: -#### nodejs - Authentication, client creation, and list operations as an example written in JavaScript. +```bash +npm install @azure/identity +``` -##### Sample code +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`. +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"); -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.operations.list().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"); +const subscriptionId = "00000000-0000-0000-0000-000000000000"; +const client = new EventHubManagementClient(new DefaultAzureCredential(), subscriptionId); ``` -#### browser - Authentication, client creation, and list operations 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 sample - - - - - - - +## 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%2FREADME.png) -![Impressions](https://azure-sdk-impressions.azurewebsites.net/api/impressions/azure-sdk-for-js/.\sdk\eventhub\arm-eventhub\/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/_meta.json b/sdk/eventhub/arm-eventhub/_meta.json new file mode 100644 index 000000000000..445c171dc130 --- /dev/null +++ b/sdk/eventhub/arm-eventhub/_meta.json @@ -0,0 +1,7 @@ +{ + "commit": "5d09c12c024fa7efbaca6a95b9741a46a886fe6f", + "readme": "specification/eventhub/resource-manager/readme.md", + "autorest_command": "autorest --version=3.1.3 --typescript --modelerfour.lenient-model-deduplication --head-as-boolean=true --license-header=MICROSOFT_MIT_NO_VERSION --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.12", + "repository_url": "https://github.com/Azure/azure-rest-api-specs.git", + "use": "@autorest/typescript@6.0.0-beta.12" +} \ No newline at end of file diff --git a/sdk/eventhub/arm-eventhub/api-extractor.json b/sdk/eventhub/arm-eventhub/api-extractor.json new file mode 100644 index 000000000000..3c9d4b6efa33 --- /dev/null +++ b/sdk/eventhub/arm-eventhub/api-extractor.json @@ -0,0 +1,18 @@ +{ + "$schema": "https://developer.microsoft.com/json-schemas/api-extractor/v7/api-extractor.schema.json", + "mainEntryPointFilePath": "./dist-esm/index.d.ts", + "docModel": { "enabled": true }, + "apiReport": { "enabled": true, "reportFolder": "./review" }, + "dtsRollup": { + "enabled": true, + "untrimmedFilePath": "", + "publicTrimmedFilePath": "./types/arm-eventhub.d.ts" + }, + "messages": { + "tsdocMessageReporting": { "default": { "logLevel": "none" } }, + "extractorMessageReporting": { + "ae-missing-release-tag": { "logLevel": "none" }, + "ae-unresolved-link": { "logLevel": "none" } + } + } +} diff --git a/sdk/eventhub/arm-eventhub/package.json b/sdk/eventhub/arm-eventhub/package.json index 74625440a88b..36d7b38adf31 100644 --- a/sdk/eventhub/arm-eventhub/package.json +++ b/sdk/eventhub/arm-eventhub/package.json @@ -1,58 +1,87 @@ { "name": "@azure/arm-eventhub", + "sdk-type": "mgmt", "author": "Microsoft Corporation", - "description": "EventHubManagementClient Library with typescript type definitions for node.js and browser.", - "version": "3.3.0", + "description": "A generated SDK for EventHubManagementClient.", + "version": "30.0.0-beta.1", + "engines": { "node": ">=12.0.0" }, "dependencies": { - "@azure/ms-rest-azure-js": "^1.4.0", - "@azure/ms-rest-js": "^1.11.0", - "@azure/core-auth": "^1.1.4", - "tslib": "^1.9.3" + "@azure/core-lro": "^2.2.0", + "@azure/abort-controller": "^1.0.0", + "@azure/core-paging": "^1.1.1", + "@azure/core-client": "^1.0.0", + "@azure/core-auth": "^1.3.0", + "@azure/core-rest-pipeline": "^1.1.0", + "tslib": "^2.2.0" }, - "keywords": [ - "node", - "azure", - "typescript", - "browser", - "isomorphic" - ], + "keywords": ["node", "azure", "typescript", "browser", "isomorphic"], "license": "MIT", - "main": "./dist/arm-eventhub.js", - "module": "./esm/eventHubManagementClient.js", - "types": "./esm/eventHubManagementClient.d.ts", + "main": "./dist/index.js", + "module": "./dist-esm/index.js", + "types": "./types/arm-eventhub.d.ts", "devDependencies": { - "typescript": "^3.6.0", - "rollup": "^0.66.2", - "rollup-plugin-node-resolve": "^3.4.0", + "@microsoft/api-extractor": "7.7.11", + "@rollup/plugin-commonjs": "11.0.2", + "@rollup/plugin-json": "^4.0.0", + "@rollup/plugin-multi-entry": "^3.0.0", + "@rollup/plugin-node-resolve": "^8.0.0", + "mkdirp": "^1.0.4", + "rollup": "^1.16.3", "rollup-plugin-sourcemaps": "^0.4.2", + "typescript": "~4.2.0", "uglify-js": "^3.4.9" }, - "homepage": "https://github.com/azure/azure-sdk-for-js/tree/main/sdk/eventhub/arm-eventhub", + "homepage": "https://github.com/Azure/azure-sdk-for-js/tree/main/sdk/eventhub/arm-eventhub", "repository": { "type": "git", - "url": "https://github.com/azure/azure-sdk-for-js.git" - }, - "bugs": { - "url": "https://github.com/azure/azure-sdk-for-js/issues" + "url": "https://github.com/Azure/azure-sdk-for-js.git" }, + "bugs": { "url": "https://github.com/Azure/azure-sdk-for-js/issues" }, "files": [ "dist/**/*.js", "dist/**/*.js.map", "dist/**/*.d.ts", "dist/**/*.d.ts.map", - "esm/**/*.js", - "esm/**/*.js.map", - "esm/**/*.d.ts", - "esm/**/*.d.ts.map", + "dist-esm/**/*.js", + "dist-esm/**/*.js.map", + "dist-esm/**/*.d.ts", + "dist-esm/**/*.d.ts.map", "src/**/*.ts", "README.md", + "LICENSE", "rollup.config.js", - "tsconfig.json" + "tsconfig.json", + "review/*", + "CHANGELOG.md", + "types/*" ], "scripts": { - "build": "tsc && rollup -c rollup.config.js && npm run minify", - "minify": "uglifyjs -c -m --comments --source-map \"content='./dist/arm-eventhub.js.map'\" -o ./dist/arm-eventhub.min.js ./dist/arm-eventhub.js", - "prepack": "npm install && npm run build" + "build": "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": "echo skipped", + "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": "echo skipped", + "prebuild": "echo skipped", + "test:node": "echo skipped", + "test:browser": "echo skipped", + "unit-test": "echo skipped", + "unit-test:node": "echo skipped", + "unit-test:browser": "echo skipped", + "integration-test:browser": "echo skipped", + "integration-test:node": "echo skipped", + "integration-test": "echo skipped", + "docs": "echo skipped" }, "sideEffects": false, "autoPublish": true diff --git a/sdk/eventhub/arm-eventhub/review/arm-eventhub.api.md b/sdk/eventhub/arm-eventhub/review/arm-eventhub.api.md new file mode 100644 index 000000000000..4f3f0f964e5a --- /dev/null +++ b/sdk/eventhub/arm-eventhub/review/arm-eventhub.api.md @@ -0,0 +1,1166 @@ +## API Report File for "@azure/arm-eventhub" + +> 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 ArmDisasterRecovery = Resource & { + readonly provisioningState?: ProvisioningStateDR; + partnerNamespace?: string; + alternateName?: string; + readonly role?: RoleDisasterRecovery; + readonly pendingReplicationOperationsCount?: number; +}; + +// @public +export interface ArmDisasterRecoveryListResult { + readonly nextLink?: string; + value?: ArmDisasterRecovery[]; +} + +// @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 ClusterQuotaConfigurationProperties { + settings?: { + [propertyName: string]: string; + }; +} + +// @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 Configuration { + get(resourceGroupName: string, clusterName: string, options?: ConfigurationGetOptionalParams): Promise; + patch(resourceGroupName: string, clusterName: string, parameters: ClusterQuotaConfigurationProperties, options?: ConfigurationPatchOptionalParams): Promise; +} + +// @public +export interface ConfigurationGetOptionalParams extends coreClient.OperationOptions { +} + +// @public +export type ConfigurationGetResponse = ClusterQuotaConfigurationProperties; + +// @public +export interface ConfigurationPatchOptionalParams extends coreClient.OperationOptions { +} + +// @public +export type ConfigurationPatchResponse = ClusterQuotaConfigurationProperties; + +// @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 type DefaultAction = string; + +// @public +export interface Destination { + archiveNameFormat?: string; + blobContainer?: string; + name?: string; + storageAccountResourceId?: string; +} + +// @public +export interface DisasterRecoveryConfigs { + breakPairing(resourceGroupName: string, namespaceName: string, alias: string, options?: DisasterRecoveryConfigsBreakPairingOptionalParams): Promise; + checkNameAvailability(resourceGroupName: string, namespaceName: string, parameters: CheckNameAvailabilityParameter, options?: DisasterRecoveryConfigsCheckNameAvailabilityOptionalParams): Promise; + createOrUpdate(resourceGroupName: string, namespaceName: string, alias: string, parameters: ArmDisasterRecovery, options?: DisasterRecoveryConfigsCreateOrUpdateOptionalParams): Promise; + delete(resourceGroupName: string, namespaceName: string, alias: string, options?: DisasterRecoveryConfigsDeleteOptionalParams): Promise; + failOver(resourceGroupName: string, namespaceName: string, alias: string, options?: DisasterRecoveryConfigsFailOverOptionalParams): Promise; + get(resourceGroupName: string, namespaceName: string, alias: string, options?: DisasterRecoveryConfigsGetOptionalParams): Promise; + getAuthorizationRule(resourceGroupName: string, namespaceName: string, alias: string, authorizationRuleName: string, options?: DisasterRecoveryConfigsGetAuthorizationRuleOptionalParams): Promise; + list(resourceGroupName: string, namespaceName: string, options?: DisasterRecoveryConfigsListOptionalParams): PagedAsyncIterableIterator; + 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 DisasterRecoveryConfigsBreakPairingOptionalParams extends coreClient.OperationOptions { +} + +// @public +export interface DisasterRecoveryConfigsCheckNameAvailabilityOptionalParams extends coreClient.OperationOptions { +} + +// @public +export type DisasterRecoveryConfigsCheckNameAvailabilityResponse = CheckNameAvailabilityResult; + +// @public +export interface DisasterRecoveryConfigsCreateOrUpdateOptionalParams extends coreClient.OperationOptions { +} + +// @public +export type DisasterRecoveryConfigsCreateOrUpdateResponse = ArmDisasterRecovery; + +// @public +export interface DisasterRecoveryConfigsDeleteOptionalParams extends coreClient.OperationOptions { +} + +// @public +export interface DisasterRecoveryConfigsFailOverOptionalParams extends coreClient.OperationOptions { +} + +// @public +export interface DisasterRecoveryConfigsGetAuthorizationRuleOptionalParams extends coreClient.OperationOptions { +} + +// @public +export type DisasterRecoveryConfigsGetAuthorizationRuleResponse = AuthorizationRule; + +// @public +export interface DisasterRecoveryConfigsGetOptionalParams extends coreClient.OperationOptions { +} + +// @public +export type DisasterRecoveryConfigsGetResponse = ArmDisasterRecovery; + +// @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 interface DisasterRecoveryConfigsListNextOptionalParams extends coreClient.OperationOptions { +} + +// @public +export type DisasterRecoveryConfigsListNextResponse = ArmDisasterRecoveryListResult; + +// @public +export interface DisasterRecoveryConfigsListOptionalParams extends coreClient.OperationOptions { +} + +// @public +export type DisasterRecoveryConfigsListResponse = ArmDisasterRecoveryListResult; + +// @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 EventHubManagementClientContext { + constructor(credentials: coreAuth.TokenCredential, subscriptionId: string, options?: EventHubManagementClientOptionalParams); + // (undocumented) + clusters: Clusters; + // (undocumented) + configuration: Configuration; + // (undocumented) + consumerGroups: ConsumerGroups; + // (undocumented) + disasterRecoveryConfigs: DisasterRecoveryConfigs; + // (undocumented) + eventHubs: EventHubs; + // (undocumented) + namespaces: Namespaces; + // (undocumented) + operations: Operations; + // (undocumented) + privateEndpointConnections: PrivateEndpointConnections; + // (undocumented) + privateLinkResources: PrivateLinkResources; + // (undocumented) + regions: Regions; +} + +// @public (undocumented) +export class EventHubManagementClientContext extends coreClient.ServiceClient { + // (undocumented) + $host: string; + constructor(credentials: coreAuth.TokenCredential, subscriptionId: string, options?: EventHubManagementClientOptionalParams); + // (undocumented) + apiVersion: string; + // (undocumented) + subscriptionId: string; +} + +// @public +export interface EventHubManagementClientOptionalParams extends coreClient.ServiceClientOptions { + $host?: string; + apiVersion?: 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 +export type IPAction = string; + +// @public +export type IpFilterRule = Resource & { + ipMask?: string; + action?: IPAction; + filterName?: string; +}; + +// @public +export interface IpFilterRuleListResult { + nextLink?: string; + value?: IpFilterRule[]; +} + +// @public +export type KeyType = "PrimaryKey" | "SecondaryKey"; + +// @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 KnownDefaultAction { + // (undocumented) + Allow = "Allow", + // (undocumented) + Deny = "Deny" +} + +// @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 KnownIPAction { + // (undocumented) + Accept = "Accept", + // (undocumented) + Reject = "Reject" +} + +// @public +export enum KnownNetworkRuleIPAction { + // (undocumented) + Allow = "Allow" +} + +// @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; + createOrUpdateIpFilterRule(resourceGroupName: string, namespaceName: string, ipFilterRuleName: string, parameters: IpFilterRule, options?: NamespacesCreateOrUpdateIpFilterRuleOptionalParams): Promise; + createOrUpdateNetworkRuleSet(resourceGroupName: string, namespaceName: string, parameters: NetworkRuleSet, options?: NamespacesCreateOrUpdateNetworkRuleSetOptionalParams): Promise; + createOrUpdateVirtualNetworkRule(resourceGroupName: string, namespaceName: string, virtualNetworkRuleName: string, parameters: VirtualNetworkRule, options?: NamespacesCreateOrUpdateVirtualNetworkRuleOptionalParams): Promise; + deleteAuthorizationRule(resourceGroupName: string, namespaceName: string, authorizationRuleName: string, options?: NamespacesDeleteAuthorizationRuleOptionalParams): Promise; + deleteIpFilterRule(resourceGroupName: string, namespaceName: string, ipFilterRuleName: string, options?: NamespacesDeleteIpFilterRuleOptionalParams): Promise; + deleteVirtualNetworkRule(resourceGroupName: string, namespaceName: string, virtualNetworkRuleName: string, options?: NamespacesDeleteVirtualNetworkRuleOptionalParams): Promise; + get(resourceGroupName: string, namespaceName: string, options?: NamespacesGetOptionalParams): Promise; + getAuthorizationRule(resourceGroupName: string, namespaceName: string, authorizationRuleName: string, options?: NamespacesGetAuthorizationRuleOptionalParams): Promise; + getIpFilterRule(resourceGroupName: string, namespaceName: string, ipFilterRuleName: string, options?: NamespacesGetIpFilterRuleOptionalParams): Promise; + getNetworkRuleSet(resourceGroupName: string, namespaceName: string, options?: NamespacesGetNetworkRuleSetOptionalParams): Promise; + getVirtualNetworkRule(resourceGroupName: string, namespaceName: string, virtualNetworkRuleName: string, options?: NamespacesGetVirtualNetworkRuleOptionalParams): Promise; + list(options?: NamespacesListOptionalParams): PagedAsyncIterableIterator; + listAuthorizationRules(resourceGroupName: string, namespaceName: string, options?: NamespacesListAuthorizationRulesOptionalParams): PagedAsyncIterableIterator; + listByResourceGroup(resourceGroupName: string, options?: NamespacesListByResourceGroupOptionalParams): PagedAsyncIterableIterator; + listIPFilterRules(resourceGroupName: string, namespaceName: string, options?: NamespacesListIPFilterRulesOptionalParams): PagedAsyncIterableIterator; + listKeys(resourceGroupName: string, namespaceName: string, authorizationRuleName: string, options?: NamespacesListKeysOptionalParams): Promise; + listVirtualNetworkRules(resourceGroupName: string, namespaceName: string, options?: NamespacesListVirtualNetworkRulesOptionalParams): PagedAsyncIterableIterator; + 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 NamespacesCreateOrUpdateIpFilterRuleOptionalParams extends coreClient.OperationOptions { +} + +// @public +export type NamespacesCreateOrUpdateIpFilterRuleResponse = IpFilterRule; + +// @public +export interface NamespacesCreateOrUpdateNetworkRuleSetOptionalParams extends coreClient.OperationOptions { +} + +// @public +export type NamespacesCreateOrUpdateNetworkRuleSetResponse = NetworkRuleSet; + +// @public +export interface NamespacesCreateOrUpdateOptionalParams extends coreClient.OperationOptions { + resumeFrom?: string; + updateIntervalInMs?: number; +} + +// @public +export type NamespacesCreateOrUpdateResponse = EHNamespace; + +// @public +export interface NamespacesCreateOrUpdateVirtualNetworkRuleOptionalParams extends coreClient.OperationOptions { +} + +// @public +export type NamespacesCreateOrUpdateVirtualNetworkRuleResponse = VirtualNetworkRule; + +// @public +export interface NamespacesDeleteAuthorizationRuleOptionalParams extends coreClient.OperationOptions { +} + +// @public +export interface NamespacesDeleteIpFilterRuleOptionalParams extends coreClient.OperationOptions { +} + +// @public +export interface NamespacesDeleteOptionalParams extends coreClient.OperationOptions { + resumeFrom?: string; + updateIntervalInMs?: number; +} + +// @public +export interface NamespacesDeleteVirtualNetworkRuleOptionalParams extends coreClient.OperationOptions { +} + +// @public +export interface NamespacesGetAuthorizationRuleOptionalParams extends coreClient.OperationOptions { +} + +// @public +export type NamespacesGetAuthorizationRuleResponse = AuthorizationRule; + +// @public +export interface NamespacesGetIpFilterRuleOptionalParams extends coreClient.OperationOptions { +} + +// @public +export type NamespacesGetIpFilterRuleResponse = IpFilterRule; + +// @public +export interface NamespacesGetNetworkRuleSetOptionalParams extends coreClient.OperationOptions { +} + +// @public +export type NamespacesGetNetworkRuleSetResponse = NetworkRuleSet; + +// @public +export interface NamespacesGetOptionalParams extends coreClient.OperationOptions { +} + +// @public +export type NamespacesGetResponse = EHNamespace; + +// @public +export interface NamespacesGetVirtualNetworkRuleOptionalParams extends coreClient.OperationOptions { +} + +// @public +export type NamespacesGetVirtualNetworkRuleResponse = VirtualNetworkRule; + +// @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 NamespacesListIPFilterRulesNextOptionalParams extends coreClient.OperationOptions { +} + +// @public +export type NamespacesListIPFilterRulesNextResponse = IpFilterRuleListResult; + +// @public +export interface NamespacesListIPFilterRulesOptionalParams extends coreClient.OperationOptions { +} + +// @public +export type NamespacesListIPFilterRulesResponse = IpFilterRuleListResult; + +// @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 NamespacesListVirtualNetworkRulesNextOptionalParams extends coreClient.OperationOptions { +} + +// @public +export type NamespacesListVirtualNetworkRulesNextResponse = VirtualNetworkRuleListResult; + +// @public +export interface NamespacesListVirtualNetworkRulesOptionalParams extends coreClient.OperationOptions { +} + +// @public +export type NamespacesListVirtualNetworkRulesResponse = VirtualNetworkRuleListResult; + +// @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 type NetworkRuleIPAction = string; + +// @public +export type NetworkRuleSet = Resource & { + trustedServiceAccessEnabled?: boolean; + defaultAction?: DefaultAction; + virtualNetworkRules?: NWRuleSetVirtualNetworkRules[]; + ipRules?: NWRuleSetIpRules[]; +}; + +// @public +export interface NWRuleSetIpRules { + action?: NetworkRuleIPAction; + ipMask?: string; +} + +// @public +export interface NWRuleSetVirtualNetworkRules { + ignoreMissingVnetServiceEndpoint?: boolean; + subnet?: Subnet; +} + +// @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 type ProvisioningStateDR = "Accepted" | "Succeeded" | "Failed"; + +// @public +export interface RegenerateAccessKeyParameters { + key?: string; + keyType: KeyType; +} + +// @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 type RoleDisasterRecovery = "Primary" | "PrimaryNotReplicating" | "Secondary"; + +// @public +export interface Sku { + capacity?: number; + name: SkuName; + tier?: SkuTier; +} + +// @public +export type SkuName = string; + +// @public +export type SkuTier = string; + +// @public +export interface Subnet { + id?: string; +} + +// @public +export type TrackedResource = Resource & { + location?: string; + tags?: { + [propertyName: string]: string; + }; +}; + +// @public +export type UnavailableReason = "None" | "InvalidName" | "SubscriptionIsDisabled" | "NameInUse" | "NameInLockdown" | "TooManyNamespaceInCurrentSubscription"; + +// @public +export type VirtualNetworkRule = Resource & { + virtualNetworkSubnetId?: string; +}; + +// @public +export interface VirtualNetworkRuleListResult { + nextLink?: string; + value?: VirtualNetworkRule[]; +} + + +// (No @packageDocumentation comment for this package) + +``` diff --git a/sdk/eventhub/arm-eventhub/rollup.config.js b/sdk/eventhub/arm-eventhub/rollup.config.js index bede107e529e..9be1955eb7f1 100644 --- a/sdk/eventhub/arm-eventhub/rollup.config.js +++ b/sdk/eventhub/arm-eventhub/rollup.config.js @@ -1,37 +1,188 @@ -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"; + +/** + * Gets the proper configuration needed for rollup's commonJS plugin for @opentelemetry/api. + * + * NOTE: this manual configuration is only needed because OpenTelemetry uses an + * __exportStar downleveled helper function to declare its exports which confuses + * rollup's automatic discovery mechanism. + * + * @returns an object reference that can be `...`'d into your cjs() configuration. + */ +export function openTelemetryCommonJs() { + const namedExports = {}; + + for (const key of [ + "@opentelemetry/api", + "@azure/core-tracing/node_modules/@opentelemetry/api" + ]) { + namedExports[key] = [ + "SpanKind", + "TraceFlags", + "getSpan", + "setSpan", + "SpanStatusCode", + "getSpanContext", + "setSpanContext" + ]; + } + + const releasedOpenTelemetryVersions = ["0.10.2", "1.0.0-rc.0"]; + + for (const version of releasedOpenTelemetryVersions) { + namedExports[ + // working around a limitation in the rollup common.js plugin - it's not able to resolve these modules so the named exports listed above will not get applied. We have to drill down to the actual path. + `../../../common/temp/node_modules/.pnpm/@opentelemetry/api@${version}/node_modules/@opentelemetry/api/build/src/index.js` + ] = [ + "SpanKind", + "TraceFlags", + "getSpan", + "setSpan", + "StatusCode", + "CanonicalCode", + "getSpanContext", + "setSpanContext" + ]; + } + + return namedExports; +} + +// #region Warning Handler /** - * @type {rollup.RollupFileOptions} + * A function that can determine whether a rollupwarning should be ignored. If + * the function returns `true`, then the warning will not be displayed. */ -const config = { - input: "./esm/eventHubManagementClient.js", - external: [ - "@azure/ms-rest-js", - "@azure/ms-rest-azure-js" - ], - output: { - file: "./dist/arm-eventhub.js", - format: "umd", - name: "Azure.ArmEventhub", - sourcemap: true, - globals: { - "@azure/ms-rest-js": "msRest", - "@azure/ms-rest-azure-js": "msRestAzure" + +function ignoreNiseSinonEvalWarnings(warning) { + return ( + warning.code === "EVAL" && + warning.id && + (warning.id.includes("node_modules/nise") || + warning.id.includes("node_modules/sinon")) === true + ); +} + +function ignoreChaiCircularDependencyWarnings(warning) { + return ( + warning.code === "CIRCULAR_DEPENDENCY" && + warning.importer && warning.importer.includes("node_modules/chai") === true + ); +} + +const warningInhibitors = [ + ignoreChaiCircularDependencyWarnings, + ignoreNiseSinonEvalWarnings +]; + +/** + * Construct a warning handler for the shared rollup configuration + * that ignores certain warnings that are not relevant to testing. + */ +function makeOnWarnForTesting() { + return (warning, warn) => { + // If every inhibitor returns false (i.e. no inhibitors), then show the warning + if (warningInhibitors.every((inhib) => !inhib(warning))) { + warn(warning); + } + }; +} + +// #endregion + +function makeBrowserTestConfig() { + const config = { + input: { + include: ["dist-esm/test/**/*.spec.js"], + exclude: ["dist-esm/test/**/node/**"] }, - banner: `/* - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for license information. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */` - }, - plugins: [ - nodeResolve({ module: true }), - sourcemaps() - ] + output: { + file: `dist-test/index.browser.js`, + format: "umd", + sourcemap: true + }, + preserveSymlinks: false, + plugins: [ + multiEntry({ exports: false }), + nodeResolve({ + mainFields: ["module", "browser"] + }), + cjs({ + namedExports: { + // Chai's strange internal architecture makes it impossible to statically + // analyze its exports. + chai: [ + "version", + "use", + "util", + "config", + "expect", + "should", + "assert" + ], + ...openTelemetryCommonJs() + } + }), + json(), + sourcemaps() + //viz({ filename: "dist-test/browser-stats.html", sourcemap: true }) + ], + onwarn: makeOnWarnForTesting(), + // Disable tree-shaking of test code. In rollup-plugin-node-resolve@5.0.0, + // rollup started respecting the "sideEffects" field in package.json. Since + // our package.json sets "sideEffects=false", this also applies to test + // code, which causes all tests to be removed by tree-shaking. + treeshake: false + }; + + return config; +} + +const defaultConfigurationOptions = { + disableBrowserBundle: false }; -export default config; +export function makeConfig(pkg, options) { + options = { + ...defaultConfigurationOptions, + ...(options || {}) + }; + + const baseConfig = { + // Use the package's module field if it has one + input: pkg["module"] || "dist-esm/src/index.js", + external: [ + ...nodeBuiltins, + ...Object.keys(pkg.dependencies), + ...Object.keys(pkg.devDependencies) + ], + output: { file: "dist/index.js", format: "cjs", sourcemap: true }, + preserveSymlinks: false, + plugins: [sourcemaps(), nodeResolve(), cjs()] + }; + + const config = [baseConfig]; + + if (!options.disableBrowserBundle) { + config.push(makeBrowserTestConfig()); + } + + return config; +} + +export default makeConfig(require("./package.json")); diff --git a/sdk/eventhub/arm-eventhub/src/eventHubManagementClient.ts b/sdk/eventhub/arm-eventhub/src/eventHubManagementClient.ts index 60c29f68416d..f9f3fcb01f1b 100644 --- a/sdk/eventhub/arm-eventhub/src/eventHubManagementClient.ts +++ b/sdk/eventhub/arm-eventhub/src/eventHubManagementClient.ts @@ -1,59 +1,73 @@ /* - * 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 * as coreAuth from "@azure/core-auth"; +import { + ClustersImpl, + NamespacesImpl, + PrivateEndpointConnectionsImpl, + PrivateLinkResourcesImpl, + ConfigurationImpl, + DisasterRecoveryConfigsImpl, + EventHubsImpl, + ConsumerGroupsImpl, + OperationsImpl, + RegionsImpl +} from "./operations"; +import { + Clusters, + Namespaces, + PrivateEndpointConnections, + PrivateLinkResources, + Configuration, + DisasterRecoveryConfigs, + EventHubs, + ConsumerGroups, + Operations, + Regions +} from "./operationsInterfaces"; import { EventHubManagementClientContext } from "./eventHubManagementClientContext"; +import { EventHubManagementClientOptionalParams } from "./models"; - -class EventHubManagementClient extends EventHubManagementClientContext { - // Operation groups - operations: operations.Operations; - namespaces: operations.Namespaces; - disasterRecoveryConfigs: operations.DisasterRecoveryConfigs; - eventHubs: operations.EventHubs; - consumerGroups: operations.ConsumerGroups; - regions: operations.Regions; - +export class EventHubManagementClient extends EventHubManagementClientContext { /** * 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) { + constructor( + credentials: coreAuth.TokenCredential, + subscriptionId: string, + options?: EventHubManagementClientOptionalParams + ) { super(credentials, subscriptionId, options); - this.operations = new operations.Operations(this); - this.namespaces = new operations.Namespaces(this); - this.disasterRecoveryConfigs = new operations.DisasterRecoveryConfigs(this); - this.eventHubs = new operations.EventHubs(this); - this.consumerGroups = new operations.ConsumerGroups(this); - this.regions = new operations.Regions(this); + this.clusters = new ClustersImpl(this); + this.namespaces = new NamespacesImpl(this); + this.privateEndpointConnections = new PrivateEndpointConnectionsImpl(this); + this.privateLinkResources = new PrivateLinkResourcesImpl(this); + this.configuration = new ConfigurationImpl(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); } -} -// Operation Specifications - -export { - EventHubManagementClient, - EventHubManagementClientContext, - Models as EventHubManagementModels, - Mappers as EventHubManagementMappers -}; -export * from "./operations"; + clusters: Clusters; + namespaces: Namespaces; + privateEndpointConnections: PrivateEndpointConnections; + privateLinkResources: PrivateLinkResources; + configuration: Configuration; + disasterRecoveryConfigs: DisasterRecoveryConfigs; + eventHubs: EventHubs; + consumerGroups: ConsumerGroups; + operations: Operations; + regions: Regions; +} diff --git a/sdk/eventhub/arm-eventhub/src/eventHubManagementClientContext.ts b/sdk/eventhub/arm-eventhub/src/eventHubManagementClientContext.ts index 725ecd04dcfa..60a0193d6bc2 100644 --- a/sdk/eventhub/arm-eventhub/src/eventHubManagementClientContext.ts +++ b/sdk/eventhub/arm-eventhub/src/eventHubManagementClientContext.ts @@ -1,69 +1,71 @@ /* - * 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 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"; +import * as coreClient from "@azure/core-client"; +import * as coreAuth from "@azure/core-auth"; +import { EventHubManagementClientOptionalParams } from "./models"; -const packageName = "@azure/arm-eventhub"; -const packageVersion = "3.3.0"; - -export class EventHubManagementClientContext extends msRestAzure.AzureServiceClient { - credentials: msRest.ServiceClientCredentials | TokenCredential; +export class EventHubManagementClientContext extends coreClient.ServiceClient { + $host: string; subscriptionId: string; - apiVersion?: string; + apiVersion: 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. + * Initializes a new instance of the EventHubManagementClientContext class. + * @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) { - if (credentials == undefined) { - throw new Error('\'credentials\' cannot be null.'); + 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.'); + if (subscriptionId === undefined) { + throw new Error("'subscriptionId' cannot be null"); } + // Initializing default values for options if (!options) { options = {}; } - if(!options.userAgent) { - const defaultUserAgent = msRestAzure.getDefaultUserAgentValue(); - options.userAgent = `${packageName}/${packageVersion} ${defaultUserAgent}`; - } + const defaults: EventHubManagementClientOptionalParams = { + requestContentType: "application/json; charset=utf-8", + credential: credentials + }; - super(credentials, options); + const packageDetails = `azsdk-js-arm-eventhub/30.0.0-beta.1`; + const userAgentPrefix = + options.userAgentOptions && options.userAgentOptions.userAgentPrefix + ? `${options.userAgentOptions.userAgentPrefix} ${packageDetails}` + : `${packageDetails}`; - this.apiVersion = '2017-04-01'; - this.acceptLanguage = 'en-US'; - this.longRunningOperationRetryTimeout = 30; - this.baseUri = options.baseUri || this.baseUri || "https://management.azure.com"; - this.requestContentType = "application/json; charset=utf-8"; - this.credentials = credentials; + 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; - if(options.acceptLanguage !== null && options.acceptLanguage !== undefined) { - this.acceptLanguage = options.acceptLanguage; - } - if(options.longRunningOperationRetryTimeout !== null && options.longRunningOperationRetryTimeout !== undefined) { - this.longRunningOperationRetryTimeout = options.longRunningOperationRetryTimeout; - } + // Assigning values to Constant parameters + this.$host = options.$host || "https://management.azure.com"; + this.apiVersion = options.apiVersion || "2018-01-01-preview"; } } diff --git a/sdk/eventhub/arm-eventhub/src/index.ts b/sdk/eventhub/arm-eventhub/src/index.ts new file mode 100644 index 000000000000..be04947cb611 --- /dev/null +++ b/sdk/eventhub/arm-eventhub/src/index.ts @@ -0,0 +1,13 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +/// +export * from "./models"; +export { EventHubManagementClient } from "./eventHubManagementClient"; +export { EventHubManagementClientContext } from "./eventHubManagementClientContext"; +export * from "./operationsInterfaces"; diff --git a/sdk/eventhub/arm-eventhub/src/lroImpl.ts b/sdk/eventhub/arm-eventhub/src/lroImpl.ts new file mode 100644 index 000000000000..518d5f053b4e --- /dev/null +++ b/sdk/eventhub/arm-eventhub/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/src/models/consumerGroupsMappers.ts b/sdk/eventhub/arm-eventhub/src/models/consumerGroupsMappers.ts deleted file mode 100644 index 09b82cfb47dc..000000000000 --- a/sdk/eventhub/arm-eventhub/src/models/consumerGroupsMappers.ts +++ /dev/null @@ -1,30 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for license information. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -export { - ArmDisasterRecovery, - AuthorizationRule, - BaseResource, - CaptureDescription, - ConsumerGroup, - ConsumerGroupListResult, - Destination, - EHNamespace, - ErrorResponse, - Eventhub, - MessagingPlan, - MessagingRegions, - MessagingRegionsProperties, - NetworkRuleSet, - NWRuleSetIpRules, - NWRuleSetVirtualNetworkRules, - Resource, - Sku, - Subnet, - TrackedResource -} from "../models/mappers"; diff --git a/sdk/eventhub/arm-eventhub/src/models/disasterRecoveryConfigsMappers.ts b/sdk/eventhub/arm-eventhub/src/models/disasterRecoveryConfigsMappers.ts deleted file mode 100644 index 789b8d96c703..000000000000 --- a/sdk/eventhub/arm-eventhub/src/models/disasterRecoveryConfigsMappers.ts +++ /dev/null @@ -1,34 +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, - ArmDisasterRecovery, - ArmDisasterRecoveryListResult, - AuthorizationRule, - AuthorizationRuleListResult, - BaseResource, - CaptureDescription, - CheckNameAvailabilityParameter, - CheckNameAvailabilityResult, - ConsumerGroup, - Destination, - EHNamespace, - ErrorResponse, - Eventhub, - MessagingPlan, - MessagingRegions, - MessagingRegionsProperties, - NetworkRuleSet, - NWRuleSetIpRules, - NWRuleSetVirtualNetworkRules, - Resource, - Sku, - Subnet, - TrackedResource -} from "../models/mappers"; diff --git a/sdk/eventhub/arm-eventhub/src/models/eventHubsMappers.ts b/sdk/eventhub/arm-eventhub/src/models/eventHubsMappers.ts deleted file mode 100644 index 253f160c7742..000000000000 --- a/sdk/eventhub/arm-eventhub/src/models/eventHubsMappers.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, - ArmDisasterRecovery, - AuthorizationRule, - AuthorizationRuleListResult, - BaseResource, - CaptureDescription, - ConsumerGroup, - Destination, - EHNamespace, - ErrorResponse, - Eventhub, - EventHubListResult, - MessagingPlan, - MessagingRegions, - MessagingRegionsProperties, - NetworkRuleSet, - NWRuleSetIpRules, - NWRuleSetVirtualNetworkRules, - RegenerateAccessKeyParameters, - Resource, - Sku, - Subnet, - TrackedResource -} from "../models/mappers"; diff --git a/sdk/eventhub/arm-eventhub/src/models/index.ts b/sdk/eventhub/arm-eventhub/src/models/index.ts index c8d10779d2b4..fcace8754478 100644 --- a/sdk/eventhub/arm-eventhub/src/models/index.ts +++ b/sdk/eventhub/arm-eventhub/src/models/index.ts @@ -1,1638 +1,1358 @@ /* - * 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[]; +} -/** - * The Resource definition - */ -export interface Resource extends BaseResource { +/** Pre-provisioned and readily available Event Hubs Cluster count per region. */ +export interface AvailableCluster { + /** Location fo the Available Cluster */ + location?: string; +} + +/** 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. */ + code?: string; + /** Error message indicating why the operation failed. */ + message?: string; +} + +/** 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; +} + +/** The resource definition. */ +export interface Resource { /** - * Resource Id - * **NOTE: This property will not be serialized. It can only be populated by the server.** + * Resource ID. + * NOTE: This property will not be serialized. It can only be populated by the server. */ readonly id?: string; /** - * Resource name - * **NOTE: This property will not be serialized. It can only be populated by the server.** + * Resource name. + * NOTE: This property will not be serialized. It can only be populated by the server. */ readonly name?: string; /** - * Resource type - * **NOTE: This property will not be serialized. It can only be populated by the server.** + * Resource type. + * NOTE: This property will not be serialized. It can only be populated by the server. */ readonly type?: string; } -/** - * Definition of Resource - */ -export interface TrackedResource extends Resource { - /** - * Resource location - */ - location?: string; - /** - * Resource tags - */ - tags?: { [propertyName: string]: string }; +/** SKU parameters particular to a cluster instance. */ +export interface ClusterSku { + /** Name of this SKU. */ + name: ClusterSkuName; + /** The quantity of Event Hubs Cluster Capacity Units contained in this cluster. */ + capacity?: number; } -/** - * SKU parameters supplied to the create namespace operation - */ +/** 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 */ +export interface EHNamespaceIdContainer { + /** id parameter */ + id?: string; +} + +/** The response from the List namespace operation. */ +export interface IpFilterRuleListResult { + /** Result of the List IpFilter Rules operation. */ + value?: IpFilterRule[]; + /** Link to the next set of results. Not empty if Value contains an incomplete list of IpFilter Rules */ + nextLink?: string; +} + +/** 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 */ 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; } -/** - * Single Namespace item in List or Get Operation - */ -export interface EHNamespace extends TrackedResource { - /** - * Properties of sku resource - */ - sku?: Sku; - /** - * 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; - /** - * 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; +/** Properties to configure Identity for Bring your Own Keys */ +export interface Identity { + /** ObjectId from the KeyVault */ + principalId?: string; + /** TenantId from the KeyVault */ + tenantId?: string; + /** Enumerates the possible value Identity type, which currently supports only 'SystemAssigned' */ + type?: "SystemAssigned"; } -/** - * Single item in a List or Get AuthorizationRule operation - */ -export interface AuthorizationRule extends Resource { - /** - * The rights associated with the rule. - */ - rights: AccessRights[]; +/** Properties to configure Encryption */ +export interface Encryption { + /** Properties of KeyVault */ + keyVaultProperties?: KeyVaultProperties[]; + /** Enumerates the possible value of keySource for Encryption */ + keySource?: "Microsoft.KeyVault"; } -/** - * Namespace/EventHub Connection String - */ +/** Properties to configure keyVault Properties */ +export interface KeyVaultProperties { + /** Name of the Key from KeyVault */ + keyName?: string; + /** Uri of KeyVault */ + keyVaultUri?: string; + /** Key Version */ + keyVersion?: string; +} + +/** 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. */ +export interface PrivateEndpoint { + /** The ARM identifier for Private Endpoint. */ + id?: string; +} + +/** ConnectionState information. */ +export interface ConnectionState { + /** Status of the connection. */ + status?: PrivateLinkConnectionStatus; + /** Description of the connection state. */ + description?: 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. */ + nextLink?: string; +} + +/** Information of the private link resource. */ +export interface PrivateLinkResource { + /** Fully qualified identifier of the resource. */ + id?: string; + /** Name of the resource */ + name?: string; + /** 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[]; +} + +/** Contains all settings for the cluster. */ +export interface ClusterQuotaConfigurationProperties { + /** All possible Cluster settings - a collection of key/value paired settings which apply to quotas and configurations imposed on the cluster. */ + settings?: { [propertyName: string]: string }; +} + +/** The response from the List namespace operation. */ +export interface VirtualNetworkRuleListResult { + /** Result of the List VirtualNetwork Rules operation. */ + value?: VirtualNetworkRule[]; + /** Link to the next set of results. Not empty if Value contains an incomplete list of VirtualNetwork Rules */ + nextLink?: string; +} + +/** The response from the List namespace operation. */ +export interface NWRuleSetVirtualNetworkRules { + /** Subnet properties */ + subnet?: Subnet; + /** Value that indicates whether to ignore missing Vnet Service Endpoint */ + ignoreMissingVnetServiceEndpoint?: boolean; +} + +/** Properties supplied for Subnet */ +export interface Subnet { + /** Resource ID of Virtual Network Subnet */ + id?: string; +} + +/** The response from the List namespace operation. */ +export interface NWRuleSetIpRules { + /** IP Mask */ + ipMask?: string; + /** The IP Filter Action */ + action?: NetworkRuleIPAction; +} + +/** 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; +} + +/** 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; } -/** - * Capture storage details for capture description - */ -export interface Destination { +/** Parameter supplied to check Namespace name availability operation */ +export interface CheckNameAvailabilityParameter { + /** Name to check the namespace name availability */ + name: string; +} + +/** The Result of the CheckNameAvailability operation */ +export interface CheckNameAvailabilityResult { /** - * Name for capture destination + * 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. */ - name?: string; + readonly message?: string; + /** Value indicating Namespace is availability, true if the Namespace is available; otherwise, false. */ + nameAvailable?: boolean; + /** The reason for unavailability of a Namespace. */ + reason?: UnavailableReason; +} + +/** 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; +} + +/** The result of the List Alias(Disaster Recovery configuration) operation. */ +export interface ArmDisasterRecoveryListResult { + /** List of Alias(Disaster Recovery configurations) */ + value?: ArmDisasterRecovery[]; /** - * Resource id of the storage account to be used to create the blobs + * Link to the next set of results. Not empty if Value contains incomplete list of Alias(Disaster Recovery configuration) + * NOTE: This property will not be serialized. It can only be populated by the server. */ - storageAccountResourceId?: string; + readonly 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 { /** - * Blob container Name + * 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. */ - blobContainer?: string; + readonly value?: Operation[]; /** - * 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 + * 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. */ - archiveNameFormat?: string; + readonly nextLink?: string; } -/** - * Properties to configure capture description for eventhub - */ -export interface CaptureDescription { +/** A Event Hub REST API operation */ +export interface Operation { /** - * A value that indicates whether capture description is enabled. + * Operation name: {provider}/{resource}/{operation} + * NOTE: This property will not be serialized. It can only be populated by the server. */ - enabled?: boolean; + readonly name?: string; + /** The object that represents the operation. */ + display?: OperationDisplay; +} + +/** The object that represents the operation. */ +export interface OperationDisplay { /** - * 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' + * Service provider: Microsoft.EventHub + * NOTE: This property will not be serialized. It can only be populated by the server. */ - encoding?: EncodingCaptureDescription; + readonly provider?: string; /** - * 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 + * Resource on which the operation is performed: Invoice, etc. + * NOTE: This property will not be serialized. It can only be populated by the server. */ - intervalInSeconds?: number; + readonly resource?: 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 + * Operation type: Read, write, delete, etc. + * NOTE: This property will not be serialized. It can only be populated by the server. */ + readonly operation?: string; +} + +/** 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; +} + +/** 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) - */ + /** 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?: string; + /** Resource id of the storage account to be used to create the blobs */ + storageAccountResourceId?: string; + /** 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 */ + archiveNameFormat?: string; +} + +/** The response of the List MessagingRegions operation. */ +export interface MessagingRegionsListResult { + /** Result of the List MessagingRegions type. */ + value?: MessagingRegions[]; /** - * A value that indicates whether to Skip Empty Archives + * 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. */ - skipEmptyArchives?: boolean; + readonly nextLink?: string; } -/** - * Single item in List or Get Event Hub operation - */ -export interface Eventhub extends Resource { +/** Properties of Messaging Region */ +export interface MessagingRegionsProperties { /** - * Current number of shards on the Event Hub. - * **NOTE: This property will not be serialized. It can only be populated by the server.** + * Region code + * NOTE: This property will not be serialized. It can only be populated by the server. */ - readonly partitionIds?: string[]; + readonly code?: string; /** - * Exact time the Event Hub was created. - * **NOTE: This property will not be serialized. It can only be populated by the server.** + * Full name of the region + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly fullName?: string; +} + +/** Definition of resource. */ +export type TrackedResource = Resource & { + /** Resource location. */ + location?: string; + /** Resource tags. */ + tags?: { [propertyName: string]: string }; +}; + +/** Single item in a List or Get IpFilterRules operation */ +export type IpFilterRule = Resource & { + /** IP Mask */ + ipMask?: string; + /** The IP Filter Action */ + action?: IPAction; + /** IP Filter name */ + filterName?: 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 VirtualNetworkRules operation */ +export type VirtualNetworkRule = Resource & { + /** ARM ID of Virtual Network Subnet */ + virtualNetworkSubnetId?: string; +}; + +/** Description of topic resource. */ +export type NetworkRuleSet = Resource & { + /** Value that indicates whether Trusted Service Access is Enabled or not. */ + trustedServiceAccessEnabled?: boolean; + /** Default Action for Network Rule Set */ + defaultAction?: DefaultAction; + /** List VirtualNetwork Rules */ + virtualNetworkRules?: NWRuleSetVirtualNetworkRules[]; + /** List of IpRules */ + ipRules?: NWRuleSetIpRules[]; +}; + +/** 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 & { + /** + * Exact time the message was created. + * 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; + /** 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 Alias(Disaster Recovery configuration) operation */ +export type ArmDisasterRecovery = Resource & { /** - * Number of days to retain the events for this Event Hub, value should be 1 to 7 days + * Provisioning state of the Alias(Disaster Recovery configuration) - possible values 'Accepted' or 'Succeeded' or 'Failed' + * NOTE: This property will not be serialized. It can only be populated by the server. */ - messageRetentionInDays?: number; + readonly provisioningState?: ProvisioningStateDR; + /** ARM Id of the Primary/Secondary eventhub namespace name, which is part of GEO DR pairing */ + partnerNamespace?: string; + /** Alternate name specified when alias and namespace names are same. */ + alternateName?: string; /** - * Number of partitions created for the Event Hub, allowed values are from 1 to 32 partitions. + * role of namespace in GEO DR - possible values 'Primary' or 'PrimaryNotReplicating' or 'Secondary' + * NOTE: This property will not be serialized. It can only be populated by the server. */ - partitionCount?: number; + readonly role?: RoleDisasterRecovery; /** - * Enumerates the possible values for the status of the Event Hub. Possible values include: - * 'Active', 'Disabled', 'Restoring', 'SendDisabled', 'ReceiveDisabled', 'Creating', 'Deleting', - * 'Renaming', 'Unknown' + * Number of entities pending to be replicated. + * NOTE: This property will not be serialized. It can only be populated by the server. */ - status?: EntityStatus; + readonly pendingReplicationOperationsCount?: number; +}; + +/** Single item in List or Get Event Hub operation */ +export type Eventhub = Resource & { /** - * Properties of capture description + * Current number of shards on the Event Hub. + * NOTE: This property will not be serialized. It can only be populated by the server. */ - captureDescription?: CaptureDescription; -} - -/** - * Single item in List or Get Consumer group operation - */ -export interface ConsumerGroup extends Resource { + readonly partitionIds?: string[]; /** - * Exact time the message was created. - * **NOTE: This property will not be serialized. It can only be populated by the server.** + * Exact time the Event Hub was created. + * 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 */ + messageRetentionInDays?: number; + /** 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; /** - * 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. + * 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. */ - userMetadata?: string; -} - -/** - * Parameter supplied to check Namespace name availability operation - */ -export interface CheckNameAvailabilityParameter { - /** - * Name to check the namespace name availability - */ - name: string; -} - -/** - * The Result of the CheckNameAvailability operation - */ -export interface CheckNameAvailabilityResult { + readonly createdAt?: string; /** - * 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.** + * 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 message?: string; + readonly updatedAt?: string; /** - * Value indicating Namespace is availability, true if the Namespace is available; otherwise, - * false. + * 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. */ - nameAvailable?: boolean; + readonly metricId?: string; /** - * The reason for unavailability of a Namespace. Possible values include: 'None', 'InvalidName', - * 'SubscriptionIsDisabled', 'NameInUse', 'NameInLockdown', - * 'TooManyNamespaceInCurrentSubscription' + * Status of the Cluster resource + * NOTE: This property will not be serialized. It can only be populated by the server. */ - reason?: UnavailableReason; -} + readonly status?: string; +}; -/** - * 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.** - */ - readonly provider?: string; +/** 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; /** - * Resource on which the operation is performed: Invoice, etc. - * **NOTE: This property will not be serialized. It can only be populated by the server.** + * Provisioning state of the Namespace. + * NOTE: This property will not be serialized. It can only be populated by the server. */ - readonly resource?: string; + readonly provisioningState?: string; /** - * Operation type: Read, write, delete, etc. - * **NOTE: This property will not be serialized. It can only be populated by the server.** + * Status of the Namespace. + * 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 { + readonly status?: string; /** - * Operation name: {provider}/{resource}/{operation} - * **NOTE: This property will not be serialized. It can only be populated by the server.** + * The time the Namespace was created. + * NOTE: This property will not be serialized. It can only be populated by the server. */ - readonly name?: string; + readonly createdAt?: Date; /** - * The object that represents the operation. + * The time the Namespace was updated. + * NOTE: This property will not be serialized. It can only be populated by the server. */ - display?: OperationDisplay; -} - -/** - * Error response indicates EventHub service is not able to process the incoming request. The - * reason is provided in the error message. - */ -export interface ErrorResponse { + readonly updatedAt?: Date; /** - * Error code. + * Endpoint you can use to perform Service Bus operations. + * NOTE: This property will not be serialized. It can only be populated by the server. */ - code?: string; + readonly serviceBusEndpoint?: string; + /** Cluster ARM ID of the Namespace. */ + clusterArmId?: string; /** - * Error message indicating why the operation failed. + * Identifier for Azure Insights metrics. + * NOTE: This property will not be serialized. It can only be populated by the server. */ - message?: string; -} + 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; +}; -/** - * Single item in List or Get Alias(Disaster Recovery configuration) operation - */ -export interface ArmDisasterRecovery extends Resource { - /** - * Provisioning state of the Alias(Disaster Recovery configuration) - possible values 'Accepted' - * or 'Succeeded' or 'Failed'. Possible values include: 'Accepted', 'Succeeded', 'Failed' - * **NOTE: This property will not be serialized. It can only be populated by the server.** - */ - readonly provisioningState?: ProvisioningStateDR; - /** - * ARM Id of the Primary/Secondary eventhub namespace name, which is part of GEO DR pairing - */ - partnerNamespace?: string; - /** - * Alternate name specified when alias and namespace names are same. - */ - alternateName?: string; - /** - * role of namespace in GEO DR - possible values 'Primary' or 'PrimaryNotReplicating' or - * 'Secondary'. Possible values include: 'Primary', 'PrimaryNotReplicating', 'Secondary' - * **NOTE: This property will not be serialized. It can only be populated by the server.** - */ - readonly role?: RoleDisasterRecovery; - /** - * Number of entities pending to be replicated. - * **NOTE: This property will not be serialized. It can only be populated by the server.** - */ - readonly pendingReplicationOperationsCount?: number; -} +/** Messaging Region */ +export type MessagingRegions = TrackedResource & { + /** Properties of Messaging Region */ + properties?: MessagingRegionsProperties; +}; -/** - * An interface representing MessagingRegionsProperties. - */ -export interface MessagingRegionsProperties { - /** - * Region code - * **NOTE: This property will not be serialized. It can only be populated by the server.** - */ - readonly code?: string; - /** - * Full name of the region - * **NOTE: This property will not be serialized. It can only be populated by the server.** - */ - readonly fullName?: string; +/** Known values of {@link ClusterSkuName} that the service accepts. */ +export enum KnownClusterSkuName { + Dedicated = "Dedicated" } /** - * Messaging Region + * 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 MessagingRegions extends TrackedResource { - properties?: MessagingRegionsProperties; -} +export type ClusterSkuName = string; -/** - * Messaging Plan for the namespace - */ -export interface MessagingPlan extends TrackedResource { - /** - * Sku type - * **NOTE: This property will not be serialized. It can only be populated by the server.** - */ - readonly sku?: number; - /** - * Selected event hub unit - * **NOTE: This property will not be serialized. It can only be populated by the server.** - */ - readonly selectedEventHubUnit?: number; - /** - * The exact time the messaging plan was updated. - * **NOTE: This property will not be serialized. It can only be populated by the server.** - */ - readonly updatedAt?: Date; - /** - * revision number - * **NOTE: This property will not be serialized. It can only be populated by the server.** - */ - readonly revision?: number; +/** Known values of {@link IPAction} that the service accepts. */ +export enum KnownIPAction { + Accept = "Accept", + Reject = "Reject" } /** - * Properties supplied for Subnet + * Defines values for IPAction. \ + * {@link KnownIPAction} can be used interchangeably with IPAction, + * this enum contains the known values that the service supports. + * ### Known values supported by the service + * **Accept** \ + * **Reject** */ -export interface Subnet { - /** - * Resource ID of Virtual Network Subnet - */ - id: string; -} +export type IPAction = string; -/** - * Description of NetWorkRuleSet - IpRules resource. - */ -export interface NWRuleSetIpRules { - /** - * IP Mask - */ - ipMask?: string; - /** - * The IP Filter Action. Possible values include: 'Allow'. Default value: 'Allow'. - */ - action?: NetworkRuleIPAction; +/** Known values of {@link SkuName} that the service accepts. */ +export enum KnownSkuName { + Basic = "Basic", + Standard = "Standard" } /** - * Description of VirtualNetworkRules - NetworkRules resource. + * 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 NWRuleSetVirtualNetworkRules { - /** - * Subnet properties - */ - subnet?: Subnet; - /** - * Value that indicates whether to ignore missing VNet Service Endpoint - */ - ignoreMissingVnetServiceEndpoint?: boolean; -} +export type SkuName = string; -/** - * Description of NetworkRuleSet resource. - */ -export interface NetworkRuleSet extends Resource { - /** - * Default Action for Network Rule Set. Possible values include: 'Allow', 'Deny' - */ - defaultAction?: DefaultAction; - /** - * List VirtualNetwork Rules - */ - virtualNetworkRules?: NWRuleSetVirtualNetworkRules[]; - /** - * List of IpRules - */ - ipRules?: NWRuleSetIpRules[]; +/** Known values of {@link SkuTier} that the service accepts. */ +export enum KnownSkuTier { + Basic = "Basic", + Standard = "Standard" } /** - * Optional Parameters. + * 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 EventHubsListByNamespaceOptionalParams extends msRest.RequestOptionsBase { - /** - * 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; -} +export type SkuTier = string; -/** - * Optional Parameters. - */ -export interface ConsumerGroupsListByEventHubOptionalParams extends msRest.RequestOptionsBase { - /** - * 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; +/** Known values of {@link PrivateLinkConnectionStatus} that the service accepts. */ +export enum KnownPrivateLinkConnectionStatus { + Pending = "Pending", + Approved = "Approved", + Rejected = "Rejected", + Disconnected = "Disconnected" } /** - * An interface representing EventHubManagementClientOptions. - */ -export interface EventHubManagementClientOptions extends AzureServiceClientOptions { - baseUri?: 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 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 + * 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 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; -} +export type EndPointProvisioningState = string; -/** - * @interface - * The response of the List Namespace operation - * @extends Array - */ -export interface EHNamespaceListResult extends Array { - /** - * Link to the next set of results. Not empty if Value contains incomplete list of namespaces. - */ - nextLink?: string; +/** Known values of {@link DefaultAction} that the service accepts. */ +export enum KnownDefaultAction { + Allow = "Allow", + Deny = "Deny" } /** - * @interface - * The response from the List namespace operation. - * @extends Array + * Defines values for DefaultAction. \ + * {@link KnownDefaultAction} can be used interchangeably with DefaultAction, + * this enum contains the known values that the service supports. + * ### Known values supported by the service + * **Allow** \ + * **Deny** */ -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; +export type DefaultAction = string; + +/** Known values of {@link NetworkRuleIPAction} that the service accepts. */ +export enum KnownNetworkRuleIPAction { + Allow = "Allow" } /** - * @interface - * The result of the List Alias(Disaster Recovery configuration) operation. - * @extends Array + * Defines values for NetworkRuleIPAction. \ + * {@link KnownNetworkRuleIPAction} can be used interchangeably with NetworkRuleIPAction, + * this enum contains the known values that the service supports. + * ### Known values supported by the service + * **Allow** */ -export interface ArmDisasterRecoveryListResult extends Array { - /** - * Link to the next set of results. Not empty if Value contains incomplete list of Alias(Disaster - * Recovery configuration) - * **NOTE: This property will not be serialized. It can only be populated by the server.** - */ - readonly nextLink?: string; +export type NetworkRuleIPAction = 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 ProvisioningStateDR. */ +export type ProvisioningStateDR = "Accepted" | "Succeeded" | "Failed"; +/** Defines values for RoleDisasterRecovery. */ +export type RoleDisasterRecovery = + | "Primary" + | "PrimaryNotReplicating" + | "Secondary"; +/** 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 - * 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; +/** 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; } -/** - * Defines values for SkuName. - * Possible values include: 'Basic', 'Standard' - * @readonly - * @enum {string} - */ -export type SkuName = 'Basic' | 'Standard'; +/** Optional parameters. */ +export interface ClustersListNamespacesOptionalParams + extends coreClient.OperationOptions {} -/** - * Defines values for SkuTier. - * Possible values include: 'Basic', 'Standard' - * @readonly - * @enum {string} - */ -export type SkuTier = 'Basic' | 'Standard'; +/** Contains response data for the listNamespaces operation. */ +export type ClustersListNamespacesResponse = EHNamespaceIdListResult; -/** - * Defines values for AccessRights. - * Possible values include: 'Manage', 'Send', 'Listen' - * @readonly - * @enum {string} - */ -export type AccessRights = 'Manage' | 'Send' | 'Listen'; +/** Optional parameters. */ +export interface ClustersListByResourceGroupNextOptionalParams + 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 listByResourceGroupNext operation. */ +export type ClustersListByResourceGroupNextResponse = ClusterListResult; -/** - * 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 NamespacesListIPFilterRulesOptionalParams + 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 listIPFilterRules operation. */ +export type NamespacesListIPFilterRulesResponse = IpFilterRuleListResult; -/** - * 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 NamespacesCreateOrUpdateIpFilterRuleOptionalParams + extends coreClient.OperationOptions {} -/** - * Defines values for ProvisioningStateDR. - * Possible values include: 'Accepted', 'Succeeded', 'Failed' - * @readonly - * @enum {string} - */ -export type ProvisioningStateDR = 'Accepted' | 'Succeeded' | 'Failed'; +/** Contains response data for the createOrUpdateIpFilterRule operation. */ +export type NamespacesCreateOrUpdateIpFilterRuleResponse = IpFilterRule; -/** - * Defines values for RoleDisasterRecovery. - * Possible values include: 'Primary', 'PrimaryNotReplicating', 'Secondary' - * @readonly - * @enum {string} - */ -export type RoleDisasterRecovery = 'Primary' | 'PrimaryNotReplicating' | 'Secondary'; +/** Optional parameters. */ +export interface NamespacesDeleteIpFilterRuleOptionalParams + extends coreClient.OperationOptions {} -/** - * Defines values for NetworkRuleIPAction. - * Possible values include: 'Allow' - * @readonly - * @enum {string} - */ -export type NetworkRuleIPAction = 'Allow'; +/** Optional parameters. */ +export interface NamespacesGetIpFilterRuleOptionalParams + extends coreClient.OperationOptions {} -/** - * Defines values for DefaultAction. - * Possible values include: 'Allow', 'Deny' - * @readonly - * @enum {string} - */ -export type DefaultAction = 'Allow' | 'Deny'; +/** Contains response data for the getIpFilterRule operation. */ +export type NamespacesGetIpFilterRuleResponse = IpFilterRule; -/** - * 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; - }; -}; +/** Optional parameters. */ +export interface NamespacesListOptionalParams + extends coreClient.OperationOptions {} -/** - * Contains response data for the listNext operation. - */ -export type OperationsListNextResponse = OperationListResult & { - /** - * The underlying HTTP response. - */ - _response: msRest.HttpResponse & { - /** - * The response body as text (string format) - */ - bodyAsText: string; - - /** - * The response body as parsed JSON or XML - */ - parsedBody: OperationListResult; - }; -}; +/** Contains response data for the list operation. */ +export type NamespacesListResponse = EHNamespaceListResult; -/** - * 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 NamespacesListByResourceGroupOptionalParams + 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 listByResourceGroup operation. */ +export type NamespacesListByResourceGroupResponse = 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 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; +} -/** - * 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 createOrUpdate operation. */ +export type NamespacesCreateOrUpdateResponse = EHNamespace; -/** - * 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 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; +} -/** - * 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; - }; -}; +/** Optional parameters. */ +export interface NamespacesGetOptionalParams + extends coreClient.OperationOptions {} -/** - * Contains response data for the getMessagingPlan operation. - */ -export type NamespacesGetMessagingPlanResponse = MessagingPlan & { - /** - * 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: MessagingPlan; - }; -}; +/** Contains response data for the get operation. */ +export type NamespacesGetResponse = EHNamespace; -/** - * 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 NamespacesUpdateOptionalParams + 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 update operation. */ +export type NamespacesUpdateResponse = EHNamespace; -/** - * 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 NamespacesListVirtualNetworkRulesOptionalParams + 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 listVirtualNetworkRules operation. */ +export type NamespacesListVirtualNetworkRulesResponse = VirtualNetworkRuleListResult; -/** - * 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 NamespacesCreateOrUpdateVirtualNetworkRuleOptionalParams + extends coreClient.OperationOptions {} -/** - * Contains response data for the createOrUpdateNetworkRuleSet operation. - */ -export type NamespacesCreateOrUpdateNetworkRuleSetResponse = NetworkRuleSet & { - /** - * 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: NetworkRuleSet; - }; -}; +/** Contains response data for the createOrUpdateVirtualNetworkRule operation. */ +export type NamespacesCreateOrUpdateVirtualNetworkRuleResponse = VirtualNetworkRule; -/** - * Contains response data for the getNetworkRuleSet operation. - */ -export type NamespacesGetNetworkRuleSetResponse = NetworkRuleSet & { - /** - * 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: NetworkRuleSet; - }; -}; +/** Optional parameters. */ +export interface NamespacesDeleteVirtualNetworkRuleOptionalParams + 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; - }; -}; +/** Optional parameters. */ +export interface NamespacesGetVirtualNetworkRuleOptionalParams + extends coreClient.OperationOptions {} -/** - * 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; - }; -}; +/** Contains response data for the getVirtualNetworkRule operation. */ +export type NamespacesGetVirtualNetworkRuleResponse = VirtualNetworkRule; -/** - * 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; - }; -}; +/** Optional parameters. */ +export interface NamespacesCreateOrUpdateNetworkRuleSetOptionalParams + extends coreClient.OperationOptions {} -/** - * Contains response data for the listAuthorizationRulesNext operation. - */ -export type NamespacesListAuthorizationRulesNextResponse = AuthorizationRuleListResult & { - /** - * The underlying HTTP response. - */ - _response: msRest.HttpResponse & { - /** - * The response body as text (string format) - */ - bodyAsText: string; - - /** - * The response body as parsed JSON or XML - */ - parsedBody: AuthorizationRuleListResult; - }; -}; +/** Contains response data for the createOrUpdateNetworkRuleSet operation. */ +export type NamespacesCreateOrUpdateNetworkRuleSetResponse = NetworkRuleSet; -/** - * Contains response data for the checkNameAvailability operation. - */ -export type DisasterRecoveryConfigsCheckNameAvailabilityResponse = 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 NamespacesGetNetworkRuleSetOptionalParams + extends coreClient.OperationOptions {} -/** - * Contains response data for the list operation. - */ -export type DisasterRecoveryConfigsListResponse = ArmDisasterRecoveryListResult & { - /** - * 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: ArmDisasterRecoveryListResult; - }; -}; +/** Contains response data for the getNetworkRuleSet operation. */ +export type NamespacesGetNetworkRuleSetResponse = NetworkRuleSet; -/** - * Contains response data for the createOrUpdate operation. - */ -export type DisasterRecoveryConfigsCreateOrUpdateResponse = ArmDisasterRecovery & { - /** - * 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: ArmDisasterRecovery; - }; -}; +/** Optional parameters. */ +export interface NamespacesListAuthorizationRulesOptionalParams + extends coreClient.OperationOptions {} -/** - * Contains response data for the get operation. - */ -export type DisasterRecoveryConfigsGetResponse = ArmDisasterRecovery & { - /** - * 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: ArmDisasterRecovery; - }; -}; +/** Contains response data for the listAuthorizationRules operation. */ +export type NamespacesListAuthorizationRulesResponse = AuthorizationRuleListResult; -/** - * 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 NamespacesCreateOrUpdateAuthorizationRuleOptionalParams + 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 createOrUpdateAuthorizationRule operation. */ +export type NamespacesCreateOrUpdateAuthorizationRuleResponse = AuthorizationRule; -/** - * 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 NamespacesDeleteAuthorizationRuleOptionalParams + extends coreClient.OperationOptions {} -/** - * Contains response data for the listNext operation. - */ -export type DisasterRecoveryConfigsListNextResponse = ArmDisasterRecoveryListResult & { - /** - * 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: ArmDisasterRecoveryListResult; - }; -}; +/** Optional parameters. */ +export interface NamespacesGetAuthorizationRuleOptionalParams + 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 getAuthorizationRule operation. */ +export type NamespacesGetAuthorizationRuleResponse = AuthorizationRule; -/** - * 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; - }; -}; +/** Optional parameters. */ +export interface NamespacesListKeysOptionalParams + extends coreClient.OperationOptions {} -/** - * 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; - }; -}; +/** Contains response data for the listKeys operation. */ +export type NamespacesListKeysResponse = AccessKeys; -/** - * 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 NamespacesRegenerateKeysOptionalParams + extends coreClient.OperationOptions {} -/** - * 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; - }; -}; +/** Contains response data for the regenerateKeys operation. */ +export type NamespacesRegenerateKeysResponse = AccessKeys; -/** - * 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; - }; -}; +/** Optional parameters. */ +export interface NamespacesCheckNameAvailabilityOptionalParams + extends coreClient.OperationOptions {} -/** - * 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; - }; -}; +/** Contains response data for the checkNameAvailability operation. */ +export type NamespacesCheckNameAvailabilityResponse = CheckNameAvailabilityResult; -/** - * 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; - }; -}; +/** Optional parameters. */ +export interface NamespacesListIPFilterRulesNextOptionalParams + extends coreClient.OperationOptions {} -/** - * 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; - }; -}; +/** Contains response data for the listIPFilterRulesNext operation. */ +export type NamespacesListIPFilterRulesNextResponse = IpFilterRuleListResult; -/** - * 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 NamespacesListNextOptionalParams + 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 listNext operation. */ +export type NamespacesListNextResponse = EHNamespaceListResult; -/** - * 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; - }; -}; +/** Optional parameters. */ +export interface NamespacesListByResourceGroupNextOptionalParams + extends coreClient.OperationOptions {} -/** - * 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; - }; -}; +/** Contains response data for the listByResourceGroupNext operation. */ +export type NamespacesListByResourceGroupNextResponse = EHNamespaceListResult; -/** - * 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; - }; -}; +/** Optional parameters. */ +export interface NamespacesListVirtualNetworkRulesNextOptionalParams + extends coreClient.OperationOptions {} -/** - * 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; - }; -}; +/** Contains response data for the listVirtualNetworkRulesNext operation. */ +export type NamespacesListVirtualNetworkRulesNextResponse = VirtualNetworkRuleListResult; -/** - * 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 NamespacesListAuthorizationRulesNextOptionalParams + 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 listAuthorizationRulesNext operation. */ +export type NamespacesListAuthorizationRulesNextResponse = AuthorizationRuleListResult; + +/** Optional parameters. */ +export interface PrivateEndpointConnectionsListOptionalParams + extends coreClient.OperationOptions {} + +/** Contains response data for the list operation. */ +export type PrivateEndpointConnectionsListResponse = PrivateEndpointConnectionListResult; + +/** Optional parameters. */ +export interface PrivateEndpointConnectionsCreateOrUpdateOptionalParams + extends coreClient.OperationOptions {} + +/** Contains response data for the createOrUpdate operation. */ +export type PrivateEndpointConnectionsCreateOrUpdateResponse = PrivateEndpointConnection; + +/** Optional parameters. */ +export interface PrivateEndpointConnectionsDeleteOptionalParams + extends coreClient.OperationOptions { + /** Delay to wait until next poll, in milliseconds. */ + updateIntervalInMs?: number; + /** A serialized poller which can be used to resume an existing paused Long-Running-Operation. */ + resumeFrom?: string; +} + +/** Optional parameters. */ +export interface PrivateEndpointConnectionsGetOptionalParams + extends coreClient.OperationOptions {} + +/** Contains response data for the get operation. */ +export type PrivateEndpointConnectionsGetResponse = PrivateEndpointConnection; + +/** Optional parameters. */ +export interface PrivateEndpointConnectionsListNextOptionalParams + extends coreClient.OperationOptions {} + +/** Contains response data for the listNext operation. */ +export type PrivateEndpointConnectionsListNextResponse = PrivateEndpointConnectionListResult; + +/** Optional parameters. */ +export interface PrivateLinkResourcesGetOptionalParams + extends coreClient.OperationOptions {} + +/** Contains response data for the get operation. */ +export type PrivateLinkResourcesGetResponse = PrivateLinkResourcesListResult; + +/** Optional parameters. */ +export interface ConfigurationPatchOptionalParams + extends coreClient.OperationOptions {} + +/** Contains response data for the patch operation. */ +export type ConfigurationPatchResponse = ClusterQuotaConfigurationProperties; + +/** Optional parameters. */ +export interface ConfigurationGetOptionalParams + extends coreClient.OperationOptions {} + +/** Contains response data for the get operation. */ +export type ConfigurationGetResponse = ClusterQuotaConfigurationProperties; + +/** Optional parameters. */ +export interface DisasterRecoveryConfigsListAuthorizationRulesOptionalParams + extends coreClient.OperationOptions {} + +/** Contains response data for the listAuthorizationRules operation. */ +export type DisasterRecoveryConfigsListAuthorizationRulesResponse = AuthorizationRuleListResult; + +/** Optional parameters. */ +export interface DisasterRecoveryConfigsGetAuthorizationRuleOptionalParams + extends coreClient.OperationOptions {} + +/** Contains response data for the getAuthorizationRule operation. */ +export type DisasterRecoveryConfigsGetAuthorizationRuleResponse = AuthorizationRule; + +/** Optional parameters. */ +export interface DisasterRecoveryConfigsListKeysOptionalParams + extends coreClient.OperationOptions {} + +/** Contains response data for the listKeys operation. */ +export type DisasterRecoveryConfigsListKeysResponse = AccessKeys; + +/** Optional parameters. */ +export interface DisasterRecoveryConfigsCheckNameAvailabilityOptionalParams + extends coreClient.OperationOptions {} + +/** Contains response data for the checkNameAvailability operation. */ +export type DisasterRecoveryConfigsCheckNameAvailabilityResponse = CheckNameAvailabilityResult; + +/** Optional parameters. */ +export interface DisasterRecoveryConfigsListOptionalParams + extends coreClient.OperationOptions {} + +/** Contains response data for the list operation. */ +export type DisasterRecoveryConfigsListResponse = ArmDisasterRecoveryListResult; + +/** Optional parameters. */ +export interface DisasterRecoveryConfigsCreateOrUpdateOptionalParams + extends coreClient.OperationOptions {} + +/** Contains response data for the createOrUpdate operation. */ +export type DisasterRecoveryConfigsCreateOrUpdateResponse = ArmDisasterRecovery; + +/** Optional parameters. */ +export interface DisasterRecoveryConfigsDeleteOptionalParams + extends coreClient.OperationOptions {} + +/** Optional parameters. */ +export interface DisasterRecoveryConfigsGetOptionalParams + extends coreClient.OperationOptions {} + +/** Contains response data for the get operation. */ +export type DisasterRecoveryConfigsGetResponse = ArmDisasterRecovery; + +/** Optional parameters. */ +export interface DisasterRecoveryConfigsBreakPairingOptionalParams + extends coreClient.OperationOptions {} + +/** Optional parameters. */ +export interface DisasterRecoveryConfigsFailOverOptionalParams + extends coreClient.OperationOptions {} + +/** Optional parameters. */ +export interface DisasterRecoveryConfigsListAuthorizationRulesNextOptionalParams + extends coreClient.OperationOptions {} + +/** Contains response data for the listAuthorizationRulesNext operation. */ +export type DisasterRecoveryConfigsListAuthorizationRulesNextResponse = AuthorizationRuleListResult; + +/** Optional parameters. */ +export interface DisasterRecoveryConfigsListNextOptionalParams + extends coreClient.OperationOptions {} + +/** Contains response data for the listNext operation. */ +export type DisasterRecoveryConfigsListNextResponse = ArmDisasterRecoveryListResult; + +/** Optional parameters. */ +export interface EventHubsListAuthorizationRulesOptionalParams + extends coreClient.OperationOptions {} + +/** Contains response data for the listAuthorizationRules operation. */ +export type EventHubsListAuthorizationRulesResponse = AuthorizationRuleListResult; + +/** Optional parameters. */ +export interface EventHubsCreateOrUpdateAuthorizationRuleOptionalParams + extends coreClient.OperationOptions {} + +/** Contains response data for the createOrUpdateAuthorizationRule operation. */ +export type EventHubsCreateOrUpdateAuthorizationRuleResponse = AuthorizationRule; + +/** Optional parameters. */ +export interface EventHubsGetAuthorizationRuleOptionalParams + extends coreClient.OperationOptions {} + +/** Contains response data for the getAuthorizationRule operation. */ +export type EventHubsGetAuthorizationRuleResponse = AuthorizationRule; + +/** Optional parameters. */ +export interface EventHubsDeleteAuthorizationRuleOptionalParams + extends coreClient.OperationOptions {} + +/** Optional parameters. */ +export interface EventHubsListKeysOptionalParams + extends coreClient.OperationOptions {} + +/** Contains response data for the listKeys operation. */ +export type EventHubsListKeysResponse = AccessKeys; + +/** Optional parameters. */ +export interface EventHubsRegenerateKeysOptionalParams + extends coreClient.OperationOptions {} + +/** Contains response data for the regenerateKeys operation. */ +export type EventHubsRegenerateKeysResponse = AccessKeys; + +/** 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 listByNamespace operation. */ +export type EventHubsListByNamespaceResponse = EventHubListResult; + +/** Optional parameters. */ +export interface EventHubsCreateOrUpdateOptionalParams + extends coreClient.OperationOptions {} + +/** Contains response data for the createOrUpdate operation. */ +export type EventHubsCreateOrUpdateResponse = Eventhub; + +/** Optional parameters. */ +export interface EventHubsDeleteOptionalParams + extends coreClient.OperationOptions {} + +/** Optional parameters. */ +export interface EventHubsGetOptionalParams + extends coreClient.OperationOptions {} + +/** 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; + /** Api Version */ + apiVersion?: string; + /** Overrides client endpoint. */ + endpoint?: string; +} diff --git a/sdk/eventhub/arm-eventhub/src/models/mappers.ts b/sdk/eventhub/arm-eventhub/src/models/mappers.ts index 8b1ee80373e4..67a187ffcb90 100644 --- a/sdk/eventhub/arm-eventhub/src/models/mappers.ts +++ b/sdk/eventhub/arm-eventhub/src/models/mappers.ts @@ -1,199 +1,165 @@ /* - * 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 Resource: msRest.CompositeMapper = { - serializedName: "Resource", +export const AvailableClustersList: coreClient.CompositeMapper = { type: { name: "Composite", - className: "Resource", + className: "AvailableClustersList", modelProperties: { - id: { - readOnly: true, - serializedName: "id", - type: { - name: "String" - } - }, - name: { - readOnly: true, - serializedName: "name", - type: { - name: "String" - } - }, - type: { - readOnly: true, - serializedName: "type", + value: { + serializedName: "value", type: { - name: "String" + name: "Sequence", + element: { + type: { + name: "Composite", + className: "AvailableCluster" + } + } } } } } }; -export const TrackedResource: msRest.CompositeMapper = { - serializedName: "TrackedResource", +export const AvailableCluster: coreClient.CompositeMapper = { type: { name: "Composite", - className: "TrackedResource", + className: "AvailableCluster", modelProperties: { - ...Resource.type.modelProperties, location: { serializedName: "location", type: { name: "String" } - }, - tags: { - serializedName: "tags", - type: { - name: "Dictionary", - value: { - type: { - name: "String" - } - } - } } } } }; -export const Sku: msRest.CompositeMapper = { - serializedName: "Sku", +export const ErrorResponse: coreClient.CompositeMapper = { type: { name: "Composite", - className: "Sku", + className: "ErrorResponse", modelProperties: { - name: { - required: true, - serializedName: "name", + code: { + serializedName: "code", type: { name: "String" } }, - tier: { - serializedName: "tier", + message: { + serializedName: "message", type: { name: "String" } - }, - capacity: { - serializedName: "capacity", - constraints: { - InclusiveMaximum: 20, - InclusiveMinimum: 0 - }, - type: { - name: "Number" - } } } } }; -export const EHNamespace: msRest.CompositeMapper = { - serializedName: "EHNamespace", +export const ClusterListResult: coreClient.CompositeMapper = { type: { name: "Composite", - className: "EHNamespace", + className: "ClusterListResult", modelProperties: { - ...TrackedResource.type.modelProperties, - sku: { - serializedName: "sku", + value: { + serializedName: "value", type: { - name: "Composite", - className: "Sku" + name: "Sequence", + element: { + type: { + name: "Composite", + className: "Cluster" + } + } } }, - provisioningState: { - readOnly: true, - serializedName: "properties.provisioningState", + nextLink: { + serializedName: "nextLink", type: { name: "String" } - }, - createdAt: { - readOnly: true, - serializedName: "properties.createdAt", - type: { - name: "DateTime" - } - }, - updatedAt: { + } + } + } +}; + +export const Resource: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "Resource", + modelProperties: { + id: { + serializedName: "id", readOnly: true, - serializedName: "properties.updatedAt", type: { - name: "DateTime" + name: "String" } }, - serviceBusEndpoint: { + name: { + serializedName: "name", readOnly: true, - serializedName: "properties.serviceBusEndpoint", type: { name: "String" } }, - metricId: { + type: { + serializedName: "type", readOnly: true, - serializedName: "properties.metricId", type: { name: "String" } - }, - isAutoInflateEnabled: { - serializedName: "properties.isAutoInflateEnabled", + } + } + } +}; + +export const ClusterSku: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "ClusterSku", + modelProperties: { + name: { + serializedName: "name", + required: true, type: { - name: "Boolean" + name: "String" } }, - maximumThroughputUnits: { - serializedName: "properties.maximumThroughputUnits", + capacity: { constraints: { - InclusiveMaximum: 20, - InclusiveMinimum: 0 + InclusiveMinimum: 1 }, + serializedName: "capacity", type: { name: "Number" } - }, - kafkaEnabled: { - serializedName: "properties.kafkaEnabled", - type: { - name: "Boolean" - } } } } }; -export const AuthorizationRule: msRest.CompositeMapper = { - serializedName: "AuthorizationRule", +export const EHNamespaceIdListResult: coreClient.CompositeMapper = { type: { name: "Composite", - className: "AuthorizationRule", + className: "EHNamespaceIdListResult", modelProperties: { - ...Resource.type.modelProperties, - rights: { - required: true, - serializedName: "properties.rights", + value: { + serializedName: "value", type: { name: "Sequence", element: { type: { - name: "String" + name: "Composite", + className: "EHNamespaceIdContainer" } } } @@ -202,57 +168,67 @@ export const AuthorizationRule: msRest.CompositeMapper = { } }; -export const AccessKeys: msRest.CompositeMapper = { - serializedName: "AccessKeys", +export const EHNamespaceIdContainer: coreClient.CompositeMapper = { type: { name: "Composite", - className: "AccessKeys", + className: "EHNamespaceIdContainer", modelProperties: { - primaryConnectionString: { - readOnly: true, - serializedName: "primaryConnectionString", - type: { - name: "String" - } - }, - secondaryConnectionString: { - readOnly: true, - serializedName: "secondaryConnectionString", - type: { - name: "String" - } - }, - aliasPrimaryConnectionString: { - readOnly: true, - serializedName: "aliasPrimaryConnectionString", + id: { + serializedName: "id", type: { name: "String" } - }, - aliasSecondaryConnectionString: { - readOnly: true, - serializedName: "aliasSecondaryConnectionString", + } + } + } +}; + +export const IpFilterRuleListResult: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "IpFilterRuleListResult", + modelProperties: { + value: { + serializedName: "value", type: { - name: "String" + name: "Sequence", + element: { + type: { + name: "Composite", + className: "IpFilterRule" + } + } } }, - primaryKey: { - readOnly: true, - serializedName: "primaryKey", + nextLink: { + serializedName: "nextLink", type: { name: "String" } - }, - secondaryKey: { - readOnly: true, - serializedName: "secondaryKey", + } + } + } +}; + +export const EHNamespaceListResult: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "EHNamespaceListResult", + modelProperties: { + value: { + serializedName: "value", type: { - name: "String" + name: "Sequence", + element: { + type: { + name: "Composite", + className: "EHNamespace" + } + } } }, - keyName: { - readOnly: true, - serializedName: "keyName", + nextLink: { + serializedName: "nextLink", type: { name: "String" } @@ -261,59 +237,58 @@ export const AccessKeys: msRest.CompositeMapper = { } }; -export const RegenerateAccessKeyParameters: msRest.CompositeMapper = { - serializedName: "RegenerateAccessKeyParameters", +export const Sku: coreClient.CompositeMapper = { type: { name: "Composite", - className: "RegenerateAccessKeyParameters", + className: "Sku", modelProperties: { - keyType: { + name: { + serializedName: "name", required: true, - serializedName: "keyType", type: { - name: "Enum", - allowedValues: [ - "PrimaryKey", - "SecondaryKey" - ] + name: "String" } }, - key: { - serializedName: "key", + tier: { + serializedName: "tier", type: { name: "String" } + }, + capacity: { + constraints: { + InclusiveMinimum: 0 + }, + serializedName: "capacity", + type: { + name: "Number" + } } } } }; -export const Destination: msRest.CompositeMapper = { - serializedName: "Destination", +export const Identity: coreClient.CompositeMapper = { type: { name: "Composite", - className: "Destination", + className: "Identity", modelProperties: { - name: { - serializedName: "name", - type: { - name: "String" - } - }, - storageAccountResourceId: { - serializedName: "properties.storageAccountResourceId", + principalId: { + serializedName: "principalId", type: { name: "String" } }, - blobContainer: { - serializedName: "properties.blobContainer", + tenantId: { + serializedName: "tenantId", type: { name: "String" } }, - archiveNameFormat: { - serializedName: "properties.archiveNameFormat", + type: { + defaultValue: "SystemAssigned", + isConstant: true, + serializedName: "type", type: { name: "String" } @@ -322,167 +297,96 @@ export const Destination: msRest.CompositeMapper = { } }; -export const CaptureDescription: msRest.CompositeMapper = { - serializedName: "CaptureDescription", +export const Encryption: coreClient.CompositeMapper = { type: { name: "Composite", - className: "CaptureDescription", + className: "Encryption", modelProperties: { - enabled: { - serializedName: "enabled", - type: { - name: "Boolean" - } - }, - encoding: { - serializedName: "encoding", + keyVaultProperties: { + serializedName: "keyVaultProperties", type: { - name: "Enum", - allowedValues: [ - "Avro", - "AvroDeflate" - ] + name: "Sequence", + element: { + type: { + name: "Composite", + className: "KeyVaultProperties" + } + } } }, - intervalInSeconds: { - serializedName: "intervalInSeconds", - constraints: { - InclusiveMaximum: 900, - InclusiveMinimum: 60 - }, + keySource: { + defaultValue: "Microsoft.KeyVault", + isConstant: true, + serializedName: "keySource", type: { - name: "Number" + name: "String" } - }, - sizeLimitInBytes: { - serializedName: "sizeLimitInBytes", - constraints: { - InclusiveMaximum: 524288000, - InclusiveMinimum: 10485760 - }, + } + } + } +}; + +export const KeyVaultProperties: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "KeyVaultProperties", + modelProperties: { + keyName: { + serializedName: "keyName", type: { - name: "Number" + name: "String" } }, - destination: { - serializedName: "destination", + keyVaultUri: { + serializedName: "keyVaultUri", type: { - name: "Composite", - className: "Destination" + name: "String" } }, - skipEmptyArchives: { - serializedName: "skipEmptyArchives", + keyVersion: { + serializedName: "keyVersion", type: { - name: "Boolean" + name: "String" } } } } }; -export const Eventhub: msRest.CompositeMapper = { - serializedName: "Eventhub", +export const PrivateEndpointConnectionListResult: coreClient.CompositeMapper = { type: { name: "Composite", - className: "Eventhub", + className: "PrivateEndpointConnectionListResult", modelProperties: { - ...Resource.type.modelProperties, - partitionIds: { - readOnly: true, - serializedName: "properties.partitionIds", + value: { + serializedName: "value", type: { name: "Sequence", element: { type: { - name: "String" + name: "Composite", + className: "PrivateEndpointConnection" } } } }, - createdAt: { - readOnly: true, - serializedName: "properties.createdAt", - type: { - name: "DateTime" - } - }, - updatedAt: { - readOnly: true, - serializedName: "properties.updatedAt", - type: { - name: "DateTime" - } - }, - messageRetentionInDays: { - serializedName: "properties.messageRetentionInDays", - constraints: { - InclusiveMinimum: 1 - }, - type: { - name: "Number" - } - }, - partitionCount: { - serializedName: "properties.partitionCount", - constraints: { - InclusiveMinimum: 1 - }, - type: { - name: "Number" - } - }, - status: { - serializedName: "properties.status", - type: { - name: "Enum", - allowedValues: [ - "Active", - "Disabled", - "Restoring", - "SendDisabled", - "ReceiveDisabled", - "Creating", - "Deleting", - "Renaming", - "Unknown" - ] - } - }, - captureDescription: { - serializedName: "properties.captureDescription", + nextLink: { + serializedName: "nextLink", type: { - name: "Composite", - className: "CaptureDescription" + name: "String" } } } } }; -export const ConsumerGroup: msRest.CompositeMapper = { - serializedName: "ConsumerGroup", +export const PrivateEndpoint: coreClient.CompositeMapper = { type: { name: "Composite", - className: "ConsumerGroup", + className: "PrivateEndpoint", modelProperties: { - ...Resource.type.modelProperties, - createdAt: { - readOnly: true, - serializedName: "properties.createdAt", - type: { - name: "DateTime" - } - }, - updatedAt: { - readOnly: true, - serializedName: "properties.updatedAt", - type: { - name: "DateTime" - } - }, - userMetadata: { - serializedName: "properties.userMetadata", + id: { + serializedName: "id", type: { name: "String" } @@ -491,15 +395,19 @@ export const ConsumerGroup: msRest.CompositeMapper = { } }; -export const CheckNameAvailabilityParameter: msRest.CompositeMapper = { - serializedName: "CheckNameAvailabilityParameter", +export const ConnectionState: coreClient.CompositeMapper = { type: { name: "Composite", - className: "CheckNameAvailabilityParameter", + className: "ConnectionState", modelProperties: { - name: { - required: true, - serializedName: "name", + status: { + serializedName: "status", + type: { + name: "String" + } + }, + description: { + serializedName: "description", type: { name: "String" } @@ -508,112 +416,123 @@ export const CheckNameAvailabilityParameter: msRest.CompositeMapper = { } }; -export const CheckNameAvailabilityResult: msRest.CompositeMapper = { - serializedName: "CheckNameAvailabilityResult", +export const PrivateLinkResourcesListResult: coreClient.CompositeMapper = { type: { name: "Composite", - className: "CheckNameAvailabilityResult", + className: "PrivateLinkResourcesListResult", modelProperties: { - message: { - readOnly: true, - serializedName: "message", - type: { - name: "String" - } - }, - nameAvailable: { - serializedName: "nameAvailable", + value: { + serializedName: "value", type: { - name: "Boolean" + name: "Sequence", + element: { + type: { + name: "Composite", + className: "PrivateLinkResource" + } + } } }, - reason: { - serializedName: "reason", + nextLink: { + serializedName: "nextLink", type: { - name: "Enum", - allowedValues: [ - "None", - "InvalidName", - "SubscriptionIsDisabled", - "NameInUse", - "NameInLockdown", - "TooManyNamespaceInCurrentSubscription" - ] + name: "String" } } } } }; -export const OperationDisplay: msRest.CompositeMapper = { - serializedName: "Operation_display", +export const PrivateLinkResource: coreClient.CompositeMapper = { type: { name: "Composite", - className: "OperationDisplay", + className: "PrivateLinkResource", modelProperties: { - provider: { - readOnly: true, - serializedName: "provider", + id: { + serializedName: "id", type: { name: "String" } }, - resource: { - readOnly: true, - serializedName: "resource", + name: { + serializedName: "name", type: { name: "String" } }, - operation: { - readOnly: true, - serializedName: "operation", + type: { + serializedName: "type", + type: { + name: "String" + } + }, + groupId: { + serializedName: "properties.groupId", type: { name: "String" } + }, + requiredMembers: { + serializedName: "properties.requiredMembers", + type: { + name: "Sequence", + element: { + type: { + name: "String" + } + } + } + }, + requiredZoneNames: { + serializedName: "properties.requiredZoneNames", + type: { + name: "Sequence", + element: { + type: { + name: "String" + } + } + } } } } }; -export const Operation: msRest.CompositeMapper = { - serializedName: "Operation", +export const ClusterQuotaConfigurationProperties: coreClient.CompositeMapper = { type: { name: "Composite", - className: "Operation", + className: "ClusterQuotaConfigurationProperties", modelProperties: { - name: { - readOnly: true, - serializedName: "name", - type: { - name: "String" - } - }, - display: { - serializedName: "display", + settings: { + serializedName: "settings", type: { - name: "Composite", - className: "OperationDisplay" + name: "Dictionary", + value: { type: { name: "String" } } } } } } }; -export const ErrorResponse: msRest.CompositeMapper = { - serializedName: "ErrorResponse", +export const VirtualNetworkRuleListResult: coreClient.CompositeMapper = { type: { name: "Composite", - className: "ErrorResponse", + className: "VirtualNetworkRuleListResult", modelProperties: { - code: { - serializedName: "code", + value: { + serializedName: "value", type: { - name: "String" + name: "Sequence", + element: { + type: { + name: "Composite", + className: "VirtualNetworkRule" + } + } } }, - message: { - serializedName: "message", + nextLink: { + serializedName: "nextLink", type: { name: "String" } @@ -622,76 +541,56 @@ export const ErrorResponse: msRest.CompositeMapper = { } }; -export const ArmDisasterRecovery: msRest.CompositeMapper = { - serializedName: "ArmDisasterRecovery", +export const NWRuleSetVirtualNetworkRules: coreClient.CompositeMapper = { type: { name: "Composite", - className: "ArmDisasterRecovery", + className: "NWRuleSetVirtualNetworkRules", modelProperties: { - ...Resource.type.modelProperties, - provisioningState: { - readOnly: true, - serializedName: "properties.provisioningState", + subnet: { + serializedName: "subnet", type: { - name: "Enum", - allowedValues: [ - "Accepted", - "Succeeded", - "Failed" - ] + name: "Composite", + className: "Subnet" } }, - partnerNamespace: { - serializedName: "properties.partnerNamespace", + ignoreMissingVnetServiceEndpoint: { + serializedName: "ignoreMissingVnetServiceEndpoint", type: { - name: "String" + name: "Boolean" } - }, - alternateName: { - serializedName: "properties.alternateName", + } + } + } +}; + +export const Subnet: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "Subnet", + modelProperties: { + id: { + serializedName: "id", type: { name: "String" } - }, - role: { - readOnly: true, - serializedName: "properties.role", - type: { - name: "Enum", - allowedValues: [ - "Primary", - "PrimaryNotReplicating", - "Secondary" - ] - } - }, - pendingReplicationOperationsCount: { - readOnly: true, - serializedName: "properties.pendingReplicationOperationsCount", - type: { - name: "Number" - } } } } }; -export const MessagingRegionsProperties: msRest.CompositeMapper = { - serializedName: "MessagingRegions_properties", +export const NWRuleSetIpRules: coreClient.CompositeMapper = { type: { name: "Composite", - className: "MessagingRegionsProperties", + className: "NWRuleSetIpRules", modelProperties: { - code: { - readOnly: true, - serializedName: "code", + ipMask: { + serializedName: "ipMask", type: { name: "String" } }, - fullName: { - readOnly: true, - serializedName: "fullName", + action: { + serializedName: "action", type: { name: "String" } @@ -700,72 +599,106 @@ export const MessagingRegionsProperties: msRest.CompositeMapper = { } }; -export const MessagingRegions: msRest.CompositeMapper = { - serializedName: "MessagingRegions", +export const AuthorizationRuleListResult: coreClient.CompositeMapper = { type: { name: "Composite", - className: "MessagingRegions", + className: "AuthorizationRuleListResult", modelProperties: { - ...TrackedResource.type.modelProperties, - properties: { - serializedName: "properties", + value: { + serializedName: "value", type: { - name: "Composite", - className: "MessagingRegionsProperties" + name: "Sequence", + element: { + type: { + name: "Composite", + className: "AuthorizationRule" + } + } + } + }, + nextLink: { + serializedName: "nextLink", + type: { + name: "String" } } } } }; -export const MessagingPlan: msRest.CompositeMapper = { - serializedName: "MessagingPlan", +export const AccessKeys: coreClient.CompositeMapper = { type: { name: "Composite", - className: "MessagingPlan", + className: "AccessKeys", modelProperties: { - ...TrackedResource.type.modelProperties, - sku: { + primaryConnectionString: { + serializedName: "primaryConnectionString", readOnly: true, - serializedName: "properties.sku", type: { - name: "Number" + name: "String" } }, - selectedEventHubUnit: { + secondaryConnectionString: { + serializedName: "secondaryConnectionString", readOnly: true, - serializedName: "properties.selectedEventHubUnit", type: { - name: "Number" + name: "String" } }, - updatedAt: { + aliasPrimaryConnectionString: { + serializedName: "aliasPrimaryConnectionString", readOnly: true, - serializedName: "properties.updatedAt", type: { - name: "DateTime" + name: "String" } }, - revision: { + aliasSecondaryConnectionString: { + serializedName: "aliasSecondaryConnectionString", readOnly: true, - serializedName: "properties.revision", type: { - name: "Number" + name: "String" + } + }, + primaryKey: { + serializedName: "primaryKey", + readOnly: true, + type: { + name: "String" + } + }, + secondaryKey: { + serializedName: "secondaryKey", + readOnly: true, + type: { + name: "String" + } + }, + keyName: { + serializedName: "keyName", + readOnly: true, + type: { + name: "String" } } } } }; -export const Subnet: msRest.CompositeMapper = { - serializedName: "Subnet", +export const RegenerateAccessKeyParameters: coreClient.CompositeMapper = { type: { name: "Composite", - className: "Subnet", + className: "RegenerateAccessKeyParameters", modelProperties: { - id: { + keyType: { + serializedName: "keyType", required: true, - serializedName: "id", + type: { + name: "Enum", + allowedValues: ["PrimaryKey", "SecondaryKey"] + } + }, + key: { + serializedName: "key", type: { name: "String" } @@ -774,21 +707,14 @@ export const Subnet: msRest.CompositeMapper = { } }; -export const NWRuleSetIpRules: msRest.CompositeMapper = { - serializedName: "NWRuleSetIpRules", +export const CheckNameAvailabilityParameter: coreClient.CompositeMapper = { type: { name: "Composite", - className: "NWRuleSetIpRules", + className: "CheckNameAvailabilityParameter", modelProperties: { - ipMask: { - serializedName: "ipMask", - type: { - name: "String" - } - }, - action: { - serializedName: "action", - defaultValue: 'Allow', + name: { + serializedName: "name", + required: true, type: { name: "String" } @@ -797,92 +723,89 @@ export const NWRuleSetIpRules: msRest.CompositeMapper = { } }; -export const NWRuleSetVirtualNetworkRules: msRest.CompositeMapper = { - serializedName: "NWRuleSetVirtualNetworkRules", +export const CheckNameAvailabilityResult: coreClient.CompositeMapper = { type: { name: "Composite", - className: "NWRuleSetVirtualNetworkRules", + className: "CheckNameAvailabilityResult", modelProperties: { - subnet: { - serializedName: "subnet", + message: { + serializedName: "message", + readOnly: true, type: { - name: "Composite", - className: "Subnet" + name: "String" } }, - ignoreMissingVnetServiceEndpoint: { - serializedName: "ignoreMissingVnetServiceEndpoint", + nameAvailable: { + serializedName: "nameAvailable", type: { name: "Boolean" } + }, + reason: { + serializedName: "reason", + type: { + name: "Enum", + allowedValues: [ + "None", + "InvalidName", + "SubscriptionIsDisabled", + "NameInUse", + "NameInLockdown", + "TooManyNamespaceInCurrentSubscription" + ] + } } } } }; -export const NetworkRuleSet: msRest.CompositeMapper = { - serializedName: "NetworkRuleSet", +export const ConsumerGroupListResult: coreClient.CompositeMapper = { type: { name: "Composite", - className: "NetworkRuleSet", + className: "ConsumerGroupListResult", modelProperties: { - ...Resource.type.modelProperties, - defaultAction: { - serializedName: "properties.defaultAction", - type: { - name: "String" - } - }, - virtualNetworkRules: { - serializedName: "properties.virtualNetworkRules", + value: { + serializedName: "value", type: { name: "Sequence", element: { type: { name: "Composite", - className: "NWRuleSetVirtualNetworkRules" + className: "ConsumerGroup" } } } }, - ipRules: { - serializedName: "properties.ipRules", + nextLink: { + serializedName: "nextLink", type: { - name: "Sequence", - element: { - type: { - name: "Composite", - className: "NWRuleSetIpRules" - } - } + name: "String" } } } } }; -export const OperationListResult: msRest.CompositeMapper = { - serializedName: "OperationListResult", +export const ArmDisasterRecoveryListResult: coreClient.CompositeMapper = { type: { name: "Composite", - className: "OperationListResult", + className: "ArmDisasterRecoveryListResult", modelProperties: { value: { - readOnly: true, - serializedName: "", + serializedName: "value", type: { name: "Sequence", element: { type: { name: "Composite", - className: "Operation" + className: "ArmDisasterRecovery" } } } }, nextLink: { - readOnly: true, serializedName: "nextLink", + readOnly: true, type: { name: "String" } @@ -891,26 +814,27 @@ export const OperationListResult: msRest.CompositeMapper = { } }; -export const EHNamespaceListResult: msRest.CompositeMapper = { - serializedName: "EHNamespaceListResult", +export const OperationListResult: coreClient.CompositeMapper = { type: { name: "Composite", - className: "EHNamespaceListResult", + className: "OperationListResult", modelProperties: { value: { - serializedName: "", + serializedName: "value", + readOnly: true, type: { name: "Sequence", element: { type: { name: "Composite", - className: "EHNamespace" + className: "Operation" } } } }, nextLink: { serializedName: "nextLink", + readOnly: true, type: { name: "String" } @@ -919,55 +843,51 @@ export const EHNamespaceListResult: msRest.CompositeMapper = { } }; -export const AuthorizationRuleListResult: msRest.CompositeMapper = { - serializedName: "AuthorizationRuleListResult", +export const Operation: coreClient.CompositeMapper = { type: { name: "Composite", - className: "AuthorizationRuleListResult", + className: "Operation", modelProperties: { - value: { - serializedName: "", + name: { + serializedName: "name", + readOnly: true, type: { - name: "Sequence", - element: { - type: { - name: "Composite", - className: "AuthorizationRule" - } - } + name: "String" } }, - nextLink: { - serializedName: "nextLink", + display: { + serializedName: "display", type: { - name: "String" + name: "Composite", + className: "OperationDisplay" } } } } }; -export const ArmDisasterRecoveryListResult: msRest.CompositeMapper = { - serializedName: "ArmDisasterRecoveryListResult", +export const OperationDisplay: coreClient.CompositeMapper = { type: { name: "Composite", - className: "ArmDisasterRecoveryListResult", + className: "OperationDisplay", modelProperties: { - value: { - serializedName: "", + provider: { + serializedName: "provider", + readOnly: true, type: { - name: "Sequence", - element: { - type: { - name: "Composite", - className: "ArmDisasterRecovery" - } - } + name: "String" } }, - nextLink: { + resource: { + serializedName: "resource", + readOnly: true, + type: { + name: "String" + } + }, + operation: { + serializedName: "operation", readOnly: true, - serializedName: "nextLink", type: { name: "String" } @@ -976,14 +896,13 @@ export const ArmDisasterRecoveryListResult: msRest.CompositeMapper = { } }; -export const EventHubListResult: msRest.CompositeMapper = { - serializedName: "EventHubListResult", +export const EventHubListResult: coreClient.CompositeMapper = { type: { name: "Composite", className: "EventHubListResult", modelProperties: { value: { - serializedName: "", + serializedName: "value", type: { name: "Sequence", element: { @@ -1004,26 +923,114 @@ export const EventHubListResult: msRest.CompositeMapper = { } }; -export const ConsumerGroupListResult: msRest.CompositeMapper = { - serializedName: "ConsumerGroupListResult", +export const CaptureDescription: coreClient.CompositeMapper = { type: { name: "Composite", - className: "ConsumerGroupListResult", + className: "CaptureDescription", modelProperties: { - value: { - serializedName: "", + enabled: { + serializedName: "enabled", + type: { + name: "Boolean" + } + }, + encoding: { + serializedName: "encoding", + type: { + name: "Enum", + allowedValues: ["Avro", "AvroDeflate"] + } + }, + intervalInSeconds: { + constraints: { + InclusiveMaximum: 900, + InclusiveMinimum: 60 + }, + serializedName: "intervalInSeconds", + type: { + name: "Number" + } + }, + sizeLimitInBytes: { + constraints: { + InclusiveMaximum: 524288000, + InclusiveMinimum: 10485760 + }, + serializedName: "sizeLimitInBytes", + type: { + name: "Number" + } + }, + destination: { + serializedName: "destination", + type: { + name: "Composite", + className: "Destination" + } + }, + skipEmptyArchives: { + serializedName: "skipEmptyArchives", + type: { + name: "Boolean" + } + } + } + } +}; + +export const Destination: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "Destination", + modelProperties: { + name: { + serializedName: "name", + type: { + name: "String" + } + }, + storageAccountResourceId: { + serializedName: "properties.storageAccountResourceId", + type: { + name: "String" + } + }, + blobContainer: { + serializedName: "properties.blobContainer", + type: { + name: "String" + } + }, + archiveNameFormat: { + serializedName: "properties.archiveNameFormat", + type: { + name: "String" + } + } + } + } +}; + +export const MessagingRegionsListResult: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "MessagingRegionsListResult", + modelProperties: { + value: { + serializedName: "value", type: { name: "Sequence", element: { type: { name: "Composite", - className: "ConsumerGroup" + className: "MessagingRegions" } } } }, nextLink: { serializedName: "nextLink", + readOnly: true, type: { name: "String" } @@ -1032,29 +1039,509 @@ export const ConsumerGroupListResult: msRest.CompositeMapper = { } }; -export const MessagingRegionsListResult: msRest.CompositeMapper = { - serializedName: "MessagingRegionsListResult", +export const MessagingRegionsProperties: coreClient.CompositeMapper = { type: { name: "Composite", - className: "MessagingRegionsListResult", + className: "MessagingRegionsProperties", modelProperties: { - value: { - serializedName: "", + code: { + serializedName: "code", + readOnly: true, + type: { + name: "String" + } + }, + fullName: { + serializedName: "fullName", + readOnly: true, + type: { + name: "String" + } + } + } + } +}; + +export const TrackedResource: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "TrackedResource", + modelProperties: { + ...Resource.type.modelProperties, + location: { + serializedName: "location", + type: { + name: "String" + } + }, + tags: { + serializedName: "tags", + type: { + name: "Dictionary", + value: { type: { name: "String" } } + } + } + } + } +}; + +export const IpFilterRule: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "IpFilterRule", + modelProperties: { + ...Resource.type.modelProperties, + ipMask: { + serializedName: "properties.ipMask", + type: { + name: "String" + } + }, + action: { + serializedName: "properties.action", + type: { + name: "String" + } + }, + filterName: { + serializedName: "properties.filterName", + type: { + name: "String" + } + } + } + } +}; + +export const PrivateEndpointConnection: coreClient.CompositeMapper = { + 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: { + name: "String" + } + } + } + } +}; + +export const VirtualNetworkRule: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "VirtualNetworkRule", + modelProperties: { + ...Resource.type.modelProperties, + virtualNetworkSubnetId: { + serializedName: "properties.virtualNetworkSubnetId", + type: { + name: "String" + } + } + } + } +}; + +export const NetworkRuleSet: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "NetworkRuleSet", + modelProperties: { + ...Resource.type.modelProperties, + trustedServiceAccessEnabled: { + serializedName: "properties.trustedServiceAccessEnabled", + type: { + name: "Boolean" + } + }, + defaultAction: { + serializedName: "properties.defaultAction", + type: { + name: "String" + } + }, + virtualNetworkRules: { + serializedName: "properties.virtualNetworkRules", type: { name: "Sequence", element: { type: { name: "Composite", - className: "MessagingRegions" + className: "NWRuleSetVirtualNetworkRules" } } } }, - nextLink: { + ipRules: { + serializedName: "properties.ipRules", + type: { + name: "Sequence", + element: { + type: { + name: "Composite", + className: "NWRuleSetIpRules" + } + } + } + } + } + } +}; + +export const AuthorizationRule: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "AuthorizationRule", + modelProperties: { + ...Resource.type.modelProperties, + rights: { + serializedName: "properties.rights", + type: { + name: "Sequence", + element: { + type: { + name: "String" + } + } + } + } + } + } +}; + +export const ConsumerGroup: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "ConsumerGroup", + modelProperties: { + ...Resource.type.modelProperties, + createdAt: { + serializedName: "properties.createdAt", readOnly: true, - serializedName: "nextLink", type: { - name: "String" + name: "DateTime" + } + }, + updatedAt: { + serializedName: "properties.updatedAt", + readOnly: true, + type: { + name: "DateTime" + } + }, + userMetadata: { + serializedName: "properties.userMetadata", + type: { + name: "String" + } + } + } + } +}; + +export const ArmDisasterRecovery: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "ArmDisasterRecovery", + modelProperties: { + ...Resource.type.modelProperties, + provisioningState: { + serializedName: "properties.provisioningState", + readOnly: true, + type: { + name: "Enum", + allowedValues: ["Accepted", "Succeeded", "Failed"] + } + }, + partnerNamespace: { + serializedName: "properties.partnerNamespace", + type: { + name: "String" + } + }, + alternateName: { + serializedName: "properties.alternateName", + type: { + name: "String" + } + }, + role: { + serializedName: "properties.role", + readOnly: true, + type: { + name: "Enum", + allowedValues: ["Primary", "PrimaryNotReplicating", "Secondary"] + } + }, + pendingReplicationOperationsCount: { + serializedName: "properties.pendingReplicationOperationsCount", + readOnly: true, + type: { + name: "Number" + } + } + } + } +}; + +export const Eventhub: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "Eventhub", + modelProperties: { + ...Resource.type.modelProperties, + partitionIds: { + serializedName: "properties.partitionIds", + readOnly: true, + type: { + name: "Sequence", + element: { + type: { + name: "String" + } + } + } + }, + createdAt: { + serializedName: "properties.createdAt", + readOnly: true, + type: { + 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 Cluster: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "Cluster", + modelProperties: { + ...TrackedResource.type.modelProperties, + sku: { + serializedName: "sku", + type: { + name: "Composite", + className: "ClusterSku" + } + }, + createdAt: { + serializedName: "properties.createdAt", + readOnly: true, + type: { + name: "String" + } + }, + updatedAt: { + serializedName: "properties.updatedAt", + readOnly: true, + type: { + name: "String" + } + }, + metricId: { + serializedName: "properties.metricId", + readOnly: true, + type: { + name: "String" + } + }, + status: { + serializedName: "properties.status", + readOnly: true, + type: { + name: "String" + } + } + } + } +}; + +export const EHNamespace: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "EHNamespace", + modelProperties: { + ...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, + type: { + name: "String" + } + }, + status: { + serializedName: "properties.status", + readOnly: true, + 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 MessagingRegions: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "MessagingRegions", + modelProperties: { + ...TrackedResource.type.modelProperties, + properties: { + serializedName: "properties", + type: { + name: "Composite", + className: "MessagingRegionsProperties" } } } diff --git a/sdk/eventhub/arm-eventhub/src/models/namespacesMappers.ts b/sdk/eventhub/arm-eventhub/src/models/namespacesMappers.ts deleted file mode 100644 index 9d58d74dc72c..000000000000 --- a/sdk/eventhub/arm-eventhub/src/models/namespacesMappers.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, - ArmDisasterRecovery, - AuthorizationRule, - AuthorizationRuleListResult, - BaseResource, - CaptureDescription, - CheckNameAvailabilityParameter, - CheckNameAvailabilityResult, - ConsumerGroup, - Destination, - EHNamespace, - EHNamespaceListResult, - ErrorResponse, - Eventhub, - MessagingPlan, - MessagingRegions, - MessagingRegionsProperties, - NetworkRuleSet, - NWRuleSetIpRules, - NWRuleSetVirtualNetworkRules, - RegenerateAccessKeyParameters, - Resource, - Sku, - Subnet, - TrackedResource -} from "../models/mappers"; diff --git a/sdk/eventhub/arm-eventhub/src/models/operationsMappers.ts b/sdk/eventhub/arm-eventhub/src/models/operationsMappers.ts deleted file mode 100644 index b8de8606cf9d..000000000000 --- a/sdk/eventhub/arm-eventhub/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/src/models/parameters.ts b/sdk/eventhub/arm-eventhub/src/models/parameters.ts index f3cc023b3e66..82ec35645187 100644 --- a/sdk/eventhub/arm-eventhub/src/models/parameters.ts +++ b/sdk/eventhub/arm-eventhub/src/models/parameters.ts @@ -1,181 +1,350 @@ /* - * 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, + IpFilterRule as IpFilterRuleMapper, + EHNamespace as EHNamespaceMapper, + VirtualNetworkRule as VirtualNetworkRuleMapper, + NetworkRuleSet as NetworkRuleSetMapper, + AuthorizationRule as AuthorizationRuleMapper, + RegenerateAccessKeyParameters as RegenerateAccessKeyParametersMapper, + CheckNameAvailabilityParameter as CheckNameAvailabilityParameterMapper, + PrivateEndpointConnection as PrivateEndpointConnectionMapper, + ClusterQuotaConfigurationProperties as ClusterQuotaConfigurationPropertiesMapper, + ArmDisasterRecovery as ArmDisasterRecoveryMapper, + 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, + type: { + name: "String" + } + }, + skipEncoding: true +}; + +export const subscriptionId: OperationURLParameter = { + parameterPath: "subscriptionId", + mapper: { + serializedName: "subscriptionId", required: true, - serializedName: "alias", - constraints: { - MaxLength: 50, - MinLength: 1 - }, type: { name: "String" } } }; -export const apiVersion: msRest.OperationQueryParameter = { + +export const apiVersion: OperationQueryParameter = { parameterPath: "apiVersion", mapper: { - required: true, + defaultValue: "2018-01-01-preview", + isConstant: true, serializedName: "api-version", 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 consumerGroupName: msRest.OperationURLParameter = { - parameterPath: "consumerGroupName", + +export const clusterName: OperationURLParameter = { + parameterPath: "clusterName", mapper: { - required: true, - serializedName: "consumerGroupName", constraints: { MaxLength: 50, - MinLength: 1 + MinLength: 6 }, + serializedName: "clusterName", + required: true, type: { name: "String" } } }; -export const eventHubName: msRest.OperationURLParameter = { - parameterPath: "eventHubName", + +export const contentType: OperationParameter = { + parameterPath: ["options", "contentType"], mapper: { - required: true, - serializedName: "eventHubName", - constraints: { - MinLength: 1 - }, + defaultValue: "application/json", + isConstant: true, + serializedName: "Content-Type", type: { name: "String" } } }; -export const namespaceName: msRest.OperationURLParameter = { - parameterPath: "namespaceName", + +export const parameters: OperationParameter = { + parameterPath: "parameters", + mapper: ClusterMapper +}; + +export const nextLink: OperationURLParameter = { + parameterPath: "nextLink", mapper: { + serializedName: "nextLink", required: true, - serializedName: "namespaceName", + type: { + name: "String" + } + }, + skipEncoding: true +}; + +export const namespaceName: OperationURLParameter = { + parameterPath: "namespaceName", + mapper: { constraints: { MaxLength: 50, MinLength: 6 }, + serializedName: "namespaceName", + required: true, type: { name: "String" } } }; -export const nextPageLink: msRest.OperationURLParameter = { - parameterPath: "nextPageLink", + +export const parameters1: OperationParameter = { + parameterPath: "parameters", + mapper: IpFilterRuleMapper +}; + +export const ipFilterRuleName: OperationURLParameter = { + parameterPath: "ipFilterRuleName", mapper: { + constraints: { + MinLength: 1 + }, + serializedName: "ipFilterRuleName", required: true, - serializedName: "nextLink", type: { name: "String" } - }, - skipEncoding: true + } }; -export const resourceGroupName: msRest.OperationURLParameter = { - parameterPath: "resourceGroupName", + +export const parameters2: OperationParameter = { + parameterPath: "parameters", + mapper: EHNamespaceMapper +}; + +export const parameters3: OperationParameter = { + parameterPath: "parameters", + mapper: VirtualNetworkRuleMapper +}; + +export const virtualNetworkRuleName: OperationURLParameter = { + parameterPath: "virtualNetworkRuleName", mapper: { - required: true, - serializedName: "resourceGroupName", constraints: { - MaxLength: 90, MinLength: 1 }, + serializedName: "virtualNetworkRuleName", + required: true, type: { name: "String" } } }; -export const skip: msRest.OperationQueryParameter = { - parameterPath: [ - "options", - "skip" - ], + +export const parameters4: OperationParameter = { + parameterPath: "parameters", + mapper: NetworkRuleSetMapper +}; + +export const parameters5: OperationParameter = { + parameterPath: "parameters", + mapper: AuthorizationRuleMapper +}; + +export const authorizationRuleName: OperationURLParameter = { + parameterPath: "authorizationRuleName", mapper: { - serializedName: "$skip", constraints: { - InclusiveMaximum: 1000, - InclusiveMinimum: 0 + MinLength: 1 }, + serializedName: "authorizationRuleName", + required: true, type: { - name: "Number" + name: "String" } } }; -export const sku: msRest.OperationURLParameter = { - parameterPath: "sku", + +export const parameters6: OperationParameter = { + parameterPath: "parameters", + mapper: RegenerateAccessKeyParametersMapper +}; + +export const parameters7: OperationParameter = { + parameterPath: "parameters", + mapper: CheckNameAvailabilityParameterMapper +}; + +export const parameters8: OperationParameter = { + parameterPath: "parameters", + mapper: PrivateEndpointConnectionMapper +}; + +export const privateEndpointConnectionName: OperationURLParameter = { + parameterPath: "privateEndpointConnectionName", mapper: { + serializedName: "privateEndpointConnectionName", required: true, - serializedName: "sku", + type: { + name: "String" + } + } +}; + +export const parameters9: OperationParameter = { + parameterPath: "parameters", + mapper: ClusterQuotaConfigurationPropertiesMapper +}; + +export const alias: OperationURLParameter = { + parameterPath: "alias", + mapper: { constraints: { MaxLength: 50, MinLength: 1 }, + serializedName: "alias", + required: true, type: { name: "String" } } }; -export const subscriptionId: msRest.OperationURLParameter = { - parameterPath: "subscriptionId", + +export const parameters10: OperationParameter = { + parameterPath: "parameters", + mapper: ArmDisasterRecoveryMapper +}; + +export const eventHubName: OperationURLParameter = { + parameterPath: "eventHubName", mapper: { + constraints: { + MaxLength: 256, + MinLength: 1 + }, + serializedName: "eventHubName", required: true, - serializedName: "subscriptionId", type: { name: "String" } } }; -export const top: msRest.OperationQueryParameter = { - parameterPath: [ - "options", - "top" - ], + +export const skip: OperationQueryParameter = { + parameterPath: ["options", "skip"], + mapper: { + constraints: { + InclusiveMaximum: 1000, + InclusiveMinimum: 0 + }, + serializedName: "$skip", + type: { + name: "Number" + } + } +}; + +export const top: OperationQueryParameter = { + parameterPath: ["options", "top"], mapper: { - serializedName: "$top", constraints: { InclusiveMaximum: 1000, InclusiveMinimum: 1 }, + serializedName: "$top", type: { name: "Number" } } }; + +export const parameters11: OperationParameter = { + parameterPath: "parameters", + mapper: EventhubMapper +}; + +export const parameters12: OperationParameter = { + parameterPath: "parameters", + mapper: ConsumerGroupMapper +}; + +export const consumerGroupName: OperationURLParameter = { + parameterPath: "consumerGroupName", + mapper: { + constraints: { + MaxLength: 50, + MinLength: 1 + }, + serializedName: "consumerGroupName", + required: true, + type: { + name: "String" + } + } +}; + +export const sku: OperationURLParameter = { + parameterPath: "sku", + mapper: { + constraints: { + MaxLength: 50, + MinLength: 1 + }, + serializedName: "sku", + required: true, + type: { + name: "String" + } + } +}; diff --git a/sdk/eventhub/arm-eventhub/src/models/regionsMappers.ts b/sdk/eventhub/arm-eventhub/src/models/regionsMappers.ts deleted file mode 100644 index c1fafeae471f..000000000000 --- a/sdk/eventhub/arm-eventhub/src/models/regionsMappers.ts +++ /dev/null @@ -1,30 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for license information. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -export { - ArmDisasterRecovery, - AuthorizationRule, - BaseResource, - CaptureDescription, - ConsumerGroup, - Destination, - EHNamespace, - ErrorResponse, - Eventhub, - MessagingPlan, - MessagingRegions, - MessagingRegionsListResult, - MessagingRegionsProperties, - NetworkRuleSet, - NWRuleSetIpRules, - NWRuleSetVirtualNetworkRules, - Resource, - Sku, - Subnet, - TrackedResource -} from "../models/mappers"; diff --git a/sdk/eventhub/arm-eventhub/src/operations/clusters.ts b/sdk/eventhub/arm-eventhub/src/operations/clusters.ts new file mode 100644 index 000000000000..e67062a55a41 --- /dev/null +++ b/sdk/eventhub/arm-eventhub/src/operations/clusters.ts @@ -0,0 +1,636 @@ +/* + * 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 "@azure/core-paging"; +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 { 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 containing Clusters operations. */ +export class ClustersImpl implements Clusters { + private readonly client: EventHubManagementClientContext; + + /** + * Initialize a new instance of the class Clusters class. + * @param client Reference to the service client + */ + constructor(client: EventHubManagementClientContext) { + this.client = client; + } + + /** + * 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. + */ + 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; + } + } + + /** + * List the quantity of available pre-provisioned Event Hubs Clusters, indexed by Azure region. + * @param options The options parameters. + */ + listAvailableClusterRegion( + options?: ClustersListAvailableClusterRegionOptionalParams + ): Promise { + return this.client.sendOperationRequest( + { 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 options parameters. + */ + private _listByResourceGroup( + resourceGroupName: string, + options?: ClustersListByResourceGroupOptionalParams + ): Promise { + return this.client.sendOperationRequest( + { 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 options parameters. + */ + get( + resourceGroupName: string, + clusterName: string, + options?: ClustersGetOptionalParams + ): Promise { + return this.client.sendOperationRequest( + { resourceGroupName, clusterName, options }, + getOperationSpec + ); + } + + /** + * 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. + */ + 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 + }); + } + + /** + * 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. + */ + async beginCreateOrUpdateAndWait( + resourceGroupName: string, + clusterName: string, + parameters: Cluster, + options?: ClustersCreateOrUpdateOptionalParams + ): Promise { + const poller = await this.beginCreateOrUpdate( + resourceGroupName, + clusterName, + parameters, + options + ); + return poller.pollUntilDone(); + } + + /** + * 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. + */ + 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 + }); + } + + /** + * 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. + */ + async beginUpdateAndWait( + resourceGroupName: string, + clusterName: string, + parameters: Cluster, + options?: ClustersUpdateOptionalParams + ): Promise { + const poller = await this.beginUpdate( + resourceGroupName, + clusterName, + parameters, + options + ); + return poller.pollUntilDone(); + } + + /** + * 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. + */ + 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 + }); + } + + /** + * 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. + */ + async beginDeleteAndWait( + resourceGroupName: string, + clusterName: string, + options?: ClustersDeleteOptionalParams + ): Promise { + const poller = await this.beginDelete( + resourceGroupName, + clusterName, + options + ); + return poller.pollUntilDone(); + } + + /** + * 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 { + return this.client.sendOperationRequest( + { resourceGroupName, clusterName, options }, + listNamespacesOperationSpec + ); + } + + /** + * 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. + */ + private _listByResourceGroupNext( + resourceGroupName: string, + nextLink: string, + options?: ClustersListByResourceGroupNextOptionalParams + ): Promise { + return this.client.sendOperationRequest( + { resourceGroupName, nextLink, options }, + listByResourceGroupNextOperationSpec + ); + } +} +// Operation Specifications +const serializer = coreClient.createSerializer(Mappers, /* isXml */ false); + +const listAvailableClusterRegionOperationSpec: coreClient.OperationSpec = { + path: + "/subscriptions/{subscriptionId}/providers/Microsoft.EventHub/availableClusterRegions", + httpMethod: "GET", + responses: { + 200: { + bodyMapper: Mappers.AvailableClustersList + }, + default: { + bodyMapper: Mappers.ErrorResponse + } + }, + queryParameters: [Parameters.apiVersion], + urlParameters: [Parameters.$host, Parameters.subscriptionId], + headerParameters: [Parameters.accept], + serializer +}; +const listByResourceGroupOperationSpec: coreClient.OperationSpec = { + path: + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventHub/clusters", + httpMethod: "GET", + responses: { + 200: { + bodyMapper: Mappers.ClusterListResult + }, + default: { + bodyMapper: Mappers.ErrorResponse + } + }, + queryParameters: [Parameters.apiVersion], + urlParameters: [ + Parameters.$host, + Parameters.subscriptionId, + 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 + }, + default: { + bodyMapper: Mappers.ErrorResponse + } + }, + queryParameters: [Parameters.apiVersion], + urlParameters: [ + Parameters.$host, + Parameters.subscriptionId, + Parameters.resourceGroupName, + Parameters.clusterName + ], + headerParameters: [Parameters.accept], + serializer +}; +const createOrUpdateOperationSpec: coreClient.OperationSpec = { + path: + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventHub/clusters/{clusterName}", + httpMethod: "PUT", + responses: { + 200: { + bodyMapper: Mappers.Cluster + }, + 201: { + bodyMapper: Mappers.Cluster + }, + 202: { + bodyMapper: Mappers.Cluster + }, + 204: { + bodyMapper: Mappers.Cluster + }, + default: { + bodyMapper: Mappers.ErrorResponse + } + }, + requestBody: Parameters.parameters, + queryParameters: [Parameters.apiVersion], + urlParameters: [ + Parameters.$host, + Parameters.subscriptionId, + Parameters.resourceGroupName, + Parameters.clusterName + ], + 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 + }, + 201: { + bodyMapper: Mappers.Cluster + }, + 202: { + bodyMapper: Mappers.Cluster + }, + 204: { + bodyMapper: Mappers.Cluster + }, + default: { + bodyMapper: Mappers.ErrorResponse + } + }, + requestBody: Parameters.parameters, + queryParameters: [Parameters.apiVersion], + urlParameters: [ + Parameters.$host, + Parameters.subscriptionId, + Parameters.resourceGroupName, + Parameters.clusterName + ], + 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 listNamespacesOperationSpec: coreClient.OperationSpec = { + path: + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventHub/clusters/{clusterName}/namespaces", + httpMethod: "GET", + responses: { + 200: { + bodyMapper: Mappers.EHNamespaceIdListResult + }, + default: { + bodyMapper: Mappers.ErrorResponse + } + }, + queryParameters: [Parameters.apiVersion], + urlParameters: [ + 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 + }, + default: { + 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/src/operations/configuration.ts b/sdk/eventhub/arm-eventhub/src/operations/configuration.ts new file mode 100644 index 000000000000..be644583296c --- /dev/null +++ b/sdk/eventhub/arm-eventhub/src/operations/configuration.ts @@ -0,0 +1,124 @@ +/* + * 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 { Configuration } 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 { + ClusterQuotaConfigurationProperties, + ConfigurationPatchOptionalParams, + ConfigurationPatchResponse, + ConfigurationGetOptionalParams, + ConfigurationGetResponse +} from "../models"; + +/** Class containing Configuration operations. */ +export class ConfigurationImpl implements Configuration { + private readonly client: EventHubManagementClientContext; + + /** + * Initialize a new instance of the class Configuration class. + * @param client Reference to the service client + */ + constructor(client: EventHubManagementClientContext) { + this.client = client; + } + + /** + * Replace all specified Event Hubs Cluster settings with those contained in the request body. Leaves + * the settings not specified in the request body unmodified. + * @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 an Event Hubs Cluster resource. + * @param options The options parameters. + */ + patch( + resourceGroupName: string, + clusterName: string, + parameters: ClusterQuotaConfigurationProperties, + options?: ConfigurationPatchOptionalParams + ): Promise { + return this.client.sendOperationRequest( + { resourceGroupName, clusterName, parameters, options }, + patchOperationSpec + ); + } + + /** + * Get all Event Hubs Cluster settings - a collection of key/value pairs which represent the quotas and + * settings imposed on the 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?: ConfigurationGetOptionalParams + ): Promise { + return this.client.sendOperationRequest( + { resourceGroupName, clusterName, options }, + getOperationSpec + ); + } +} +// Operation Specifications +const serializer = coreClient.createSerializer(Mappers, /* isXml */ false); + +const patchOperationSpec: coreClient.OperationSpec = { + path: + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventHub/clusters/{clusterName}/quotaConfiguration/default", + httpMethod: "PATCH", + responses: { + 200: { + bodyMapper: Mappers.ClusterQuotaConfigurationProperties + }, + 201: { + bodyMapper: Mappers.ClusterQuotaConfigurationProperties + }, + 202: {}, + default: { + bodyMapper: Mappers.ErrorResponse + } + }, + requestBody: Parameters.parameters9, + queryParameters: [Parameters.apiVersion], + urlParameters: [ + Parameters.$host, + Parameters.subscriptionId, + Parameters.resourceGroupName, + Parameters.clusterName + ], + headerParameters: [Parameters.accept, Parameters.contentType], + mediaType: "json", + serializer +}; +const getOperationSpec: coreClient.OperationSpec = { + path: + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventHub/clusters/{clusterName}/quotaConfiguration/default", + httpMethod: "GET", + responses: { + 200: { + bodyMapper: Mappers.ClusterQuotaConfigurationProperties + }, + default: { + bodyMapper: Mappers.ErrorResponse + } + }, + queryParameters: [Parameters.apiVersion], + urlParameters: [ + Parameters.$host, + Parameters.subscriptionId, + Parameters.resourceGroupName, + Parameters.clusterName + ], + headerParameters: [Parameters.accept], + serializer +}; diff --git a/sdk/eventhub/arm-eventhub/src/operations/consumerGroups.ts b/sdk/eventhub/arm-eventhub/src/operations/consumerGroups.ts index fe20df49c3b8..36d5549d3fb1 100644 --- a/sdk/eventhub/arm-eventhub/src/operations/consumerGroups.ts +++ b/sdk/eventhub/arm-eventhub/src/operations/consumerGroups.ts @@ -1,62 +1,142 @@ /* - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for - * license information. + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. * * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is - * regenerated. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. */ -import * as msRest from "@azure/ms-rest-js"; -import * as Models from "../models"; -import * as Mappers from "../models/consumerGroupsMappers"; +import "@azure/core-paging"; +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 { + ConsumerGroup, + ConsumerGroupsListByEventHubNextOptionalParams, + ConsumerGroupsListByEventHubOptionalParams, + ConsumerGroupsCreateOrUpdateOptionalParams, + ConsumerGroupsCreateOrUpdateResponse, + ConsumerGroupsDeleteOptionalParams, + ConsumerGroupsGetOptionalParams, + ConsumerGroupsGetResponse, + ConsumerGroupsListByEventHubResponse, + ConsumerGroupsListByEventHubNextResponse +} from "../models"; -/** Class representing a ConsumerGroups. */ -export class ConsumerGroups { +/// +/** Class containing ConsumerGroups operations. */ +export class ConsumerGroupsImpl implements ConsumerGroups { private readonly client: EventHubManagementClientContext; /** - * 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) { 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 +146,8 @@ export class ConsumerGroups { parameters, options }, - createOrUpdateOperationSpec, - callback) as Promise; + createOrUpdateOperationSpec + ); } /** @@ -76,28 +156,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 +173,8 @@ export class ConsumerGroups { consumerGroupName, options }, - deleteMethodOperationSpec, - callback); + deleteOperationSpec + ); } /** @@ -116,28 +183,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 +200,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.apiVersion - ], - headerParameters: [ - Parameters.acceptLanguage - ], - requestBody: { - parameterPath: "parameters", - mapper: { - ...Mappers.ConsumerGroup, - required: true - } - }, responses: { 200: { bodyMapper: Mappers.ConsumerGroup @@ -250,25 +260,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.parameters12, + queryParameters: [Parameters.apiVersion], urlParameters: [ + Parameters.$host, + Parameters.subscriptionId, Parameters.resourceGroupName, Parameters.namespaceName, Parameters.eventHubName, - Parameters.consumerGroupName, - Parameters.subscriptionId - ], - queryParameters: [ - Parameters.apiVersion - ], - 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 +285,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.apiVersion], urlParameters: [ + Parameters.$host, + Parameters.subscriptionId, Parameters.resourceGroupName, Parameters.namespaceName, Parameters.eventHubName, - Parameters.consumerGroupName, - Parameters.subscriptionId - ], - queryParameters: [ - Parameters.apiVersion - ], - 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 +309,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.apiVersion], urlParameters: [ + Parameters.$host, + Parameters.subscriptionId, Parameters.resourceGroupName, Parameters.namespaceName, Parameters.eventHubName, - Parameters.subscriptionId - ], - queryParameters: [ - Parameters.apiVersion, - 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 +333,20 @@ const listByEventHubOperationSpec: msRest.OperationSpec = { bodyMapper: Mappers.ErrorResponse } }, + queryParameters: [Parameters.apiVersion, 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 +355,15 @@ const listByEventHubNextOperationSpec: msRest.OperationSpec = { bodyMapper: Mappers.ErrorResponse } }, + queryParameters: [Parameters.apiVersion, 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/src/operations/disasterRecoveryConfigs.ts b/sdk/eventhub/arm-eventhub/src/operations/disasterRecoveryConfigs.ts index 1e51ac33ae15..e5c1cb6747fd 100644 --- a/sdk/eventhub/arm-eventhub/src/operations/disasterRecoveryConfigs.ts +++ b/sdk/eventhub/arm-eventhub/src/operations/disasterRecoveryConfigs.ts @@ -1,766 +1,718 @@ /* - * 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 "@azure/core-paging"; +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 { + AuthorizationRule, + DisasterRecoveryConfigsListAuthorizationRulesNextOptionalParams, + DisasterRecoveryConfigsListAuthorizationRulesOptionalParams, + ArmDisasterRecovery, + DisasterRecoveryConfigsListNextOptionalParams, + DisasterRecoveryConfigsListOptionalParams, + DisasterRecoveryConfigsListAuthorizationRulesResponse, + DisasterRecoveryConfigsGetAuthorizationRuleOptionalParams, + DisasterRecoveryConfigsGetAuthorizationRuleResponse, + DisasterRecoveryConfigsListKeysOptionalParams, + DisasterRecoveryConfigsListKeysResponse, + CheckNameAvailabilityParameter, + DisasterRecoveryConfigsCheckNameAvailabilityOptionalParams, + DisasterRecoveryConfigsCheckNameAvailabilityResponse, + DisasterRecoveryConfigsListResponse, + DisasterRecoveryConfigsCreateOrUpdateOptionalParams, + DisasterRecoveryConfigsCreateOrUpdateResponse, + DisasterRecoveryConfigsDeleteOptionalParams, + DisasterRecoveryConfigsGetOptionalParams, + DisasterRecoveryConfigsGetResponse, + DisasterRecoveryConfigsBreakPairingOptionalParams, + DisasterRecoveryConfigsFailOverOptionalParams, + DisasterRecoveryConfigsListAuthorizationRulesNextResponse, + DisasterRecoveryConfigsListNextResponse +} from "../models"; -/** Class representing a DisasterRecoveryConfigs. */ -export class DisasterRecoveryConfigs { +/// +/** Class containing DisasterRecoveryConfigs operations. */ +export class DisasterRecoveryConfigsImpl implements DisasterRecoveryConfigs { private readonly client: EventHubManagementClientContext; /** - * 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) { this.client = client; } /** - * Check the give Namespace name availability. - * @param resourceGroupName Name of the resource group within the azure subscription. - * @param namespaceName The Namespace name - * @param parameters Parameters to check availability of the given Alias name - * @param [options] The optional parameters - * @returns Promise - */ - checkNameAvailability(resourceGroupName: string, namespaceName: string, parameters: Models.CheckNameAvailabilityParameter, options?: msRest.RequestOptionsBase): Promise; - /** - * @param resourceGroupName Name of the resource group within the azure subscription. - * @param namespaceName The Namespace name - * @param parameters Parameters to check availability of the given Alias name - * @param callback The callback - */ - checkNameAvailability(resourceGroupName: string, namespaceName: string, parameters: Models.CheckNameAvailabilityParameter, callback: msRest.ServiceCallback): void; - /** + * 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 parameters Parameters to check availability of the given Alias name - * @param options The optional parameters - * @param callback The callback - */ - checkNameAvailability(resourceGroupName: string, namespaceName: string, parameters: Models.CheckNameAvailabilityParameter, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; - checkNameAvailability(resourceGroupName: string, namespaceName: string, parameters: Models.CheckNameAvailabilityParameter, options?: msRest.RequestOptionsBase | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { - return this.client.sendOperationRequest( - { + * @param alias The Disaster Recovery configuration name + * @param options The options parameters. + */ + 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, - parameters, + alias, + continuationToken, options - }, - checkNameAvailabilityOperationSpec, - 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 all Alias(Disaster Recovery configurations) * @param resourceGroupName Name of the resource group within the azure subscription. * @param namespaceName The Namespace name - * @param [options] The optional parameters - * @returns Promise - */ - 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( - { - resourceGroupName, - namespaceName, - options + * @param options The options parameters. + */ + public list( + resourceGroupName: string, + namespaceName: string, + options?: DisasterRecoveryConfigsListOptionalParams + ): PagedAsyncIterableIterator { + const iter = this.listPagingAll(resourceGroupName, namespaceName, options); + return { + next() { + return iter.next(); + }, + [Symbol.asyncIterator]() { + return this; }, - listOperationSpec, - callback) as Promise; + byPage: () => { + return this.listPagingPage(resourceGroupName, namespaceName, options); + } + }; } - /** - * Creates or updates a new Alias(Disaster Recovery configuration) - * @param resourceGroupName Name of the resource group within the azure subscription. - * @param namespaceName The Namespace name - * @param alias The Disaster Recovery configuration name - * @param parameters Parameters required to create an Alias(Disaster Recovery configuration) - * @param [options] The optional parameters - * @returns Promise - */ - createOrUpdate(resourceGroupName: string, namespaceName: string, alias: string, parameters: Models.ArmDisasterRecovery, 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 parameters Parameters required to create an Alias(Disaster Recovery configuration) - * @param callback The callback - */ - createOrUpdate(resourceGroupName: string, namespaceName: string, alias: string, parameters: Models.ArmDisasterRecovery, 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 parameters Parameters required to create an Alias(Disaster Recovery configuration) - * @param options The optional parameters - * @param callback The callback - */ - createOrUpdate(resourceGroupName: string, namespaceName: string, alias: string, parameters: Models.ArmDisasterRecovery, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; - createOrUpdate(resourceGroupName: string, namespaceName: string, alias: string, parameters: Models.ArmDisasterRecovery, options?: msRest.RequestOptionsBase | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { - return this.client.sendOperationRequest( - { + private async *listPagingPage( + resourceGroupName: string, + namespaceName: string, + options?: DisasterRecoveryConfigsListOptionalParams + ): AsyncIterableIterator { + let result = await this._list(resourceGroupName, namespaceName, options); + yield result.value || []; + let continuationToken = result.nextLink; + while (continuationToken) { + result = await this._listNext( resourceGroupName, namespaceName, - alias, - parameters, + continuationToken, options - }, - createOrUpdateOperationSpec, - callback) as Promise; + ); + continuationToken = result.nextLink; + yield result.value || []; + } + } + + private async *listPagingAll( + resourceGroupName: string, + namespaceName: string, + options?: DisasterRecoveryConfigsListOptionalParams + ): AsyncIterableIterator { + for await (const page of this.listPagingPage( + resourceGroupName, + namespaceName, + options + )) { + yield* page; + } } /** - * Deletes an Alias(Disaster Recovery configuration) - * @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 - */ - deleteMethod(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 - */ - deleteMethod(resourceGroupName: string, namespaceName: string, alias: string, callback: msRest.ServiceCallback): void; - /** + * 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 optional parameters - * @param callback The callback - */ - deleteMethod(resourceGroupName: string, namespaceName: string, alias: string, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; - deleteMethod(resourceGroupName: string, namespaceName: string, alias: string, options?: msRest.RequestOptionsBase | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { + * @param options The options parameters. + */ + private _listAuthorizationRules( + resourceGroupName: string, + namespaceName: string, + alias: string, + options?: DisasterRecoveryConfigsListAuthorizationRulesOptionalParams + ): Promise { return this.client.sendOperationRequest( - { - resourceGroupName, - namespaceName, - alias, - options - }, - deleteMethodOperationSpec, - callback); + { resourceGroupName, namespaceName, alias, options }, + listAuthorizationRulesOperationSpec + ); } /** - * Retrieves Alias(Disaster Recovery configuration) for primary or secondary 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 optional parameters - * @returns Promise - */ - get(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 - */ - get(resourceGroupName: string, namespaceName: string, alias: string, callback: msRest.ServiceCallback): void; - /** + * 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 options The optional parameters - * @param callback The callback - */ - get(resourceGroupName: string, namespaceName: string, alias: string, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; - get(resourceGroupName: string, namespaceName: string, alias: string, options?: msRest.RequestOptionsBase | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { + * @param authorizationRuleName The authorization rule name. + * @param options The options parameters. + */ + getAuthorizationRule( + resourceGroupName: string, + namespaceName: string, + alias: string, + authorizationRuleName: string, + options?: DisasterRecoveryConfigsGetAuthorizationRuleOptionalParams + ): Promise { return this.client.sendOperationRequest( { resourceGroupName, namespaceName, alias, + authorizationRuleName, options }, - getOperationSpec, - callback) as Promise; + getAuthorizationRuleOperationSpec + ); } /** - * This operation disables the Disaster Recovery and stops replicating changes from primary to - * secondary namespaces - * @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 - */ - breakPairing(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 - */ - breakPairing(resourceGroupName: string, namespaceName: string, alias: string, callback: msRest.ServiceCallback): void; - /** + * 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 options The optional parameters - * @param callback The callback - */ - breakPairing(resourceGroupName: string, namespaceName: string, alias: string, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; - breakPairing(resourceGroupName: string, namespaceName: string, alias: string, options?: msRest.RequestOptionsBase | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { + * @param authorizationRuleName The authorization rule name. + * @param options The options parameters. + */ + listKeys( + resourceGroupName: string, + namespaceName: string, + alias: string, + authorizationRuleName: string, + options?: DisasterRecoveryConfigsListKeysOptionalParams + ): Promise { return this.client.sendOperationRequest( { resourceGroupName, namespaceName, alias, + authorizationRuleName, options }, - breakPairingOperationSpec, - callback); + listKeysOperationSpec + ); } /** - * Invokes GEO DR failover and reconfigure the alias to point to the secondary 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 optional parameters - * @returns Promise - */ - failOver(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 - */ - failOver(resourceGroupName: string, namespaceName: string, alias: string, callback: msRest.ServiceCallback): void; - /** + * Check the give Namespace name availability. * @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 - */ - failOver(resourceGroupName: string, namespaceName: string, alias: string, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; - failOver(resourceGroupName: string, namespaceName: string, alias: string, options?: msRest.RequestOptionsBase | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { + * @param parameters Parameters to check availability of the given Alias name + * @param options The options parameters. + */ + checkNameAvailability( + resourceGroupName: string, + namespaceName: string, + parameters: CheckNameAvailabilityParameter, + options?: DisasterRecoveryConfigsCheckNameAvailabilityOptionalParams + ): Promise { return this.client.sendOperationRequest( - { - resourceGroupName, - namespaceName, - alias, - options - }, - failOverOperationSpec, - callback); + { resourceGroupName, namespaceName, parameters, options }, + checkNameAvailabilityOperationSpec + ); } /** - * 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 optional parameters - * @returns Promise - */ - 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; - /** + * Gets all Alias(Disaster Recovery configurations) * @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 + * @param options The options parameters. */ - 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 { + private _list( + resourceGroupName: string, + namespaceName: string, + options?: DisasterRecoveryConfigsListOptionalParams + ): Promise { return this.client.sendOperationRequest( - { - resourceGroupName, - namespaceName, - alias, - options - }, - listAuthorizationRulesOperationSpec, - callback) as Promise; + { resourceGroupName, namespaceName, options }, + listOperationSpec + ); } /** - * 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; - /** + * Creates or updates a new Alias(Disaster Recovery configuration) * @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 - */ - getAuthorizationRule(resourceGroupName: string, namespaceName: string, alias: string, authorizationRuleName: string, callback: msRest.ServiceCallback): void; + * @param parameters Parameters required to create an Alias(Disaster Recovery configuration) + * @param options The options parameters. + */ + createOrUpdate( + resourceGroupName: string, + namespaceName: string, + alias: string, + parameters: ArmDisasterRecovery, + options?: DisasterRecoveryConfigsCreateOrUpdateOptionalParams + ): Promise { + return this.client.sendOperationRequest( + { resourceGroupName, namespaceName, alias, parameters, options }, + createOrUpdateOperationSpec + ); + } + /** + * Deletes an Alias(Disaster Recovery configuration) * @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 - */ - 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 { + * @param options The options parameters. + */ + delete( + resourceGroupName: string, + namespaceName: string, + alias: string, + options?: DisasterRecoveryConfigsDeleteOptionalParams + ): Promise { return this.client.sendOperationRequest( - { - resourceGroupName, - namespaceName, - alias, - authorizationRuleName, - options - }, - getAuthorizationRuleOperationSpec, - callback) as Promise; + { resourceGroupName, namespaceName, alias, options }, + deleteOperationSpec + ); } /** - * Gets the primary and secondary connection strings for the Namespace. + * Retrieves Alias(Disaster Recovery configuration) for primary or secondary 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 optional parameters - * @returns Promise - */ - listKeys(resourceGroupName: string, namespaceName: string, alias: string, authorizationRuleName: string, options?: msRest.RequestOptionsBase): Promise; + * @param options The options parameters. + */ + get( + resourceGroupName: string, + namespaceName: string, + alias: string, + options?: DisasterRecoveryConfigsGetOptionalParams + ): Promise { + return this.client.sendOperationRequest( + { resourceGroupName, namespaceName, alias, options }, + getOperationSpec + ); + } + /** + * This operation disables the Disaster Recovery and stops replicating changes from primary to + * secondary namespaces * @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 options The options parameters. + */ + breakPairing( + resourceGroupName: string, + namespaceName: string, + alias: string, + options?: DisasterRecoveryConfigsBreakPairingOptionalParams + ): Promise { + return this.client.sendOperationRequest( + { resourceGroupName, namespaceName, alias, options }, + breakPairingOperationSpec + ); + } + /** + * Invokes GEO DR failover and reconfigure the alias to point to the secondary 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 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 { + * @param options The options parameters. + */ + failOver( + resourceGroupName: string, + namespaceName: string, + alias: string, + options?: DisasterRecoveryConfigsFailOverOptionalParams + ): Promise { return this.client.sendOperationRequest( - { - resourceGroupName, - namespaceName, - alias, - authorizationRuleName, - options - }, - listKeysOperationSpec, - callback) as Promise; + { resourceGroupName, namespaceName, alias, options }, + failOverOperationSpec + ); } /** - * Gets all Alias(Disaster Recovery configurations) - * @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 { + * 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. + */ + private _listAuthorizationRulesNext( + resourceGroupName: string, + namespaceName: string, + alias: string, + nextLink: string, + options?: DisasterRecoveryConfigsListAuthorizationRulesNextOptionalParams + ): Promise { return this.client.sendOperationRequest( - { - nextPageLink, - options - }, - listNextOperationSpec, - callback) as Promise; + { resourceGroupName, namespaceName, alias, nextLink, options }, + listAuthorizationRulesNextOperationSpec + ); } /** - * 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(nextPageLink: string, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; - listAuthorizationRulesNext(nextPageLink: string, options?: msRest.RequestOptionsBase | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { + * 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. + */ + private _listNext( + resourceGroupName: string, + namespaceName: string, + nextLink: string, + options?: DisasterRecoveryConfigsListNextOptionalParams + ): Promise { return this.client.sendOperationRequest( - { - nextPageLink, - options - }, - listAuthorizationRulesNextOperationSpec, - callback) as Promise; + { resourceGroupName, namespaceName, nextLink, options }, + listNextOperationSpec + ); } } - // Operation Specifications -const serializer = new msRest.Serializer(Mappers); -const checkNameAvailabilityOperationSpec: msRest.OperationSpec = { - httpMethod: "POST", - path: "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventHub/namespaces/{namespaceName}/disasterRecoveryConfigs/CheckNameAvailability", - urlParameters: [ - Parameters.subscriptionId, - Parameters.resourceGroupName, - Parameters.namespaceName - ], - queryParameters: [ - Parameters.apiVersion - ], - headerParameters: [ - Parameters.acceptLanguage - ], - requestBody: { - parameterPath: "parameters", - mapper: { - ...Mappers.CheckNameAvailabilityParameter, - required: true - } - }, +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", responses: { 200: { - bodyMapper: Mappers.CheckNameAvailabilityResult + bodyMapper: Mappers.AuthorizationRuleListResult }, default: { bodyMapper: Mappers.ErrorResponse } }, - serializer -}; - -const listOperationSpec: msRest.OperationSpec = { - httpMethod: "GET", - path: "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventHub/namespaces/{namespaceName}/disasterRecoveryConfigs", + queryParameters: [Parameters.apiVersion], urlParameters: [ + Parameters.$host, + Parameters.subscriptionId, Parameters.resourceGroupName, Parameters.namespaceName, - Parameters.subscriptionId - ], - queryParameters: [ - Parameters.apiVersion - ], - 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.ArmDisasterRecoveryListResult + bodyMapper: Mappers.AuthorizationRule }, default: { bodyMapper: Mappers.ErrorResponse } }, - serializer -}; - -const createOrUpdateOperationSpec: msRest.OperationSpec = { - httpMethod: "PUT", - path: "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventHub/namespaces/{namespaceName}/disasterRecoveryConfigs/{alias}", + queryParameters: [Parameters.apiVersion], urlParameters: [ + Parameters.$host, + Parameters.subscriptionId, Parameters.resourceGroupName, Parameters.namespaceName, - Parameters.alias, - Parameters.subscriptionId - ], - queryParameters: [ - Parameters.apiVersion - ], - headerParameters: [ - Parameters.acceptLanguage + Parameters.authorizationRuleName, + Parameters.alias ], - requestBody: { - parameterPath: "parameters", - mapper: { - ...Mappers.ArmDisasterRecovery, - required: true - } - }, + 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.ArmDisasterRecovery + bodyMapper: Mappers.AccessKeys }, - 201: {}, default: { bodyMapper: Mappers.ErrorResponse } }, - serializer -}; - -const deleteMethodOperationSpec: msRest.OperationSpec = { - httpMethod: "DELETE", - path: "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventHub/namespaces/{namespaceName}/disasterRecoveryConfigs/{alias}", + queryParameters: [Parameters.apiVersion], urlParameters: [ + Parameters.$host, + Parameters.subscriptionId, Parameters.resourceGroupName, Parameters.namespaceName, - Parameters.alias, - Parameters.subscriptionId - ], - queryParameters: [ - Parameters.apiVersion - ], - headerParameters: [ - Parameters.acceptLanguage + Parameters.authorizationRuleName, + Parameters.alias ], + headerParameters: [Parameters.accept], + serializer +}; +const checkNameAvailabilityOperationSpec: coreClient.OperationSpec = { + path: + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventHub/namespaces/{namespaceName}/disasterRecoveryConfigs/checkNameAvailability", + httpMethod: "POST", responses: { - 200: {}, + 200: { + bodyMapper: Mappers.CheckNameAvailabilityResult + }, default: { bodyMapper: Mappers.ErrorResponse } }, - serializer -}; - -const getOperationSpec: msRest.OperationSpec = { - httpMethod: "GET", - path: "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventHub/namespaces/{namespaceName}/disasterRecoveryConfigs/{alias}", + requestBody: Parameters.parameters7, + queryParameters: [Parameters.apiVersion], urlParameters: [ + Parameters.$host, + Parameters.subscriptionId, Parameters.resourceGroupName, - Parameters.namespaceName, - Parameters.alias, - Parameters.subscriptionId - ], - queryParameters: [ - Parameters.apiVersion - ], - headerParameters: [ - Parameters.acceptLanguage + Parameters.namespaceName ], + headerParameters: [Parameters.accept, Parameters.contentType], + mediaType: "json", + serializer +}; +const listOperationSpec: coreClient.OperationSpec = { + path: + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventHub/namespaces/{namespaceName}/disasterRecoveryConfigs", + httpMethod: "GET", responses: { 200: { - bodyMapper: Mappers.ArmDisasterRecovery + bodyMapper: Mappers.ArmDisasterRecoveryListResult }, default: { bodyMapper: Mappers.ErrorResponse } }, - serializer -}; - -const breakPairingOperationSpec: msRest.OperationSpec = { - httpMethod: "POST", - path: "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventHub/namespaces/{namespaceName}/disasterRecoveryConfigs/{alias}/breakPairing", + queryParameters: [Parameters.apiVersion], urlParameters: [ + Parameters.$host, + Parameters.subscriptionId, Parameters.resourceGroupName, - Parameters.namespaceName, - Parameters.alias, - Parameters.subscriptionId - ], - queryParameters: [ - Parameters.apiVersion - ], - headerParameters: [ - Parameters.acceptLanguage + Parameters.namespaceName ], + headerParameters: [Parameters.accept], + serializer +}; +const createOrUpdateOperationSpec: coreClient.OperationSpec = { + path: + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventHub/namespaces/{namespaceName}/disasterRecoveryConfigs/{alias}", + httpMethod: "PUT", responses: { - 200: {}, + 200: { + bodyMapper: Mappers.ArmDisasterRecovery + }, + 201: {}, default: { bodyMapper: Mappers.ErrorResponse } }, - serializer -}; - -const failOverOperationSpec: msRest.OperationSpec = { - httpMethod: "POST", - path: "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventHub/namespaces/{namespaceName}/disasterRecoveryConfigs/{alias}/failover", + requestBody: Parameters.parameters10, + queryParameters: [Parameters.apiVersion], urlParameters: [ + Parameters.$host, + Parameters.subscriptionId, Parameters.resourceGroupName, Parameters.namespaceName, - Parameters.alias, - Parameters.subscriptionId - ], - queryParameters: [ - Parameters.apiVersion - ], - headerParameters: [ - Parameters.acceptLanguage + Parameters.alias ], + headerParameters: [Parameters.accept, Parameters.contentType], + mediaType: "json", + serializer +}; +const deleteOperationSpec: coreClient.OperationSpec = { + path: + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventHub/namespaces/{namespaceName}/disasterRecoveryConfigs/{alias}", + httpMethod: "DELETE", responses: { 200: {}, default: { bodyMapper: Mappers.ErrorResponse } }, - serializer -}; - -const listAuthorizationRulesOperationSpec: msRest.OperationSpec = { - httpMethod: "GET", - path: "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventHub/namespaces/{namespaceName}/disasterRecoveryConfigs/{alias}/AuthorizationRules", + queryParameters: [Parameters.apiVersion], urlParameters: [ + Parameters.$host, + Parameters.subscriptionId, Parameters.resourceGroupName, Parameters.namespaceName, - Parameters.alias, - Parameters.subscriptionId - ], - queryParameters: [ - Parameters.apiVersion - ], - headerParameters: [ - Parameters.acceptLanguage + Parameters.alias ], + headerParameters: [Parameters.accept], + serializer +}; +const getOperationSpec: coreClient.OperationSpec = { + path: + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventHub/namespaces/{namespaceName}/disasterRecoveryConfigs/{alias}", + httpMethod: "GET", responses: { 200: { - bodyMapper: Mappers.AuthorizationRuleListResult + bodyMapper: Mappers.ArmDisasterRecovery }, default: { 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.apiVersion], urlParameters: [ + Parameters.$host, + Parameters.subscriptionId, Parameters.resourceGroupName, Parameters.namespaceName, - Parameters.alias, - Parameters.authorizationRuleName, - Parameters.subscriptionId - ], - queryParameters: [ - Parameters.apiVersion - ], - headerParameters: [ - Parameters.acceptLanguage + Parameters.alias ], + headerParameters: [Parameters.accept], + serializer +}; +const breakPairingOperationSpec: coreClient.OperationSpec = { + path: + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventHub/namespaces/{namespaceName}/disasterRecoveryConfigs/{alias}/breakPairing", + httpMethod: "POST", responses: { - 200: { - bodyMapper: Mappers.AuthorizationRule - }, + 200: {}, default: { 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.apiVersion], urlParameters: [ + Parameters.$host, + Parameters.subscriptionId, Parameters.resourceGroupName, Parameters.namespaceName, - Parameters.alias, - Parameters.authorizationRuleName, - Parameters.subscriptionId - ], - queryParameters: [ - Parameters.apiVersion - ], - headerParameters: [ - Parameters.acceptLanguage + Parameters.alias ], + headerParameters: [Parameters.accept], + serializer +}; +const failOverOperationSpec: coreClient.OperationSpec = { + path: + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventHub/namespaces/{namespaceName}/disasterRecoveryConfigs/{alias}/failover", + httpMethod: "POST", responses: { - 200: { - bodyMapper: Mappers.AccessKeys - }, + 200: {}, default: { bodyMapper: Mappers.ErrorResponse } }, + queryParameters: [Parameters.apiVersion], + urlParameters: [ + Parameters.$host, + Parameters.subscriptionId, + Parameters.resourceGroupName, + Parameters.namespaceName, + Parameters.alias + ], + headerParameters: [Parameters.accept], serializer }; - -const listNextOperationSpec: 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.ArmDisasterRecoveryListResult + bodyMapper: Mappers.AuthorizationRuleListResult }, default: { bodyMapper: Mappers.ErrorResponse } }, + queryParameters: [Parameters.apiVersion], + urlParameters: [ + Parameters.$host, + Parameters.subscriptionId, + Parameters.resourceGroupName, + Parameters.nextLink, + Parameters.namespaceName, + Parameters.alias + ], + headerParameters: [Parameters.accept], serializer }; - -const listAuthorizationRulesNextOperationSpec: 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.AuthorizationRuleListResult + bodyMapper: Mappers.ArmDisasterRecoveryListResult }, default: { 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/src/operations/eventHubs.ts b/sdk/eventhub/arm-eventhub/src/operations/eventHubs.ts index ffd4672511f1..6a6b1320fe8c 100644 --- a/sdk/eventhub/arm-eventhub/src/operations/eventHubs.ts +++ b/sdk/eventhub/arm-eventhub/src/operations/eventHubs.ts @@ -1,173 +1,208 @@ /* - * 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 "@azure/core-paging"; +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 { + 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 { +/// +/** Class containing EventHubs operations. */ +export class EventHubsImpl implements EventHubs { private readonly client: EventHubManagementClientContext; /** - * 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) { this.client = client; } /** - * 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 - */ - listByNamespace(resourceGroupName: string, namespaceName: string, callback: msRest.ServiceCallback): void; - /** + * 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 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 { - return this.client.sendOperationRequest( - { - resourceGroupName, - namespaceName, - options + * @param eventHubName The Event Hub name + * @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; }, - listByNamespaceOperationSpec, - callback) as Promise; + byPage: () => { + return this.listAuthorizationRulesPagingPage( + resourceGroupName, + namespaceName, + eventHubName, + options + ); + } + }; } - /** - * 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 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 { - return this.client.sendOperationRequest( - { + 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, - parameters, + continuationToken, options - }, - createOrUpdateOperationSpec, - 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; + } } /** - * 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 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; - /** + * 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 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 { - return this.client.sendOperationRequest( - { - resourceGroupName, - namespaceName, - eventHubName, - options + * @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(); }, - deleteMethodOperationSpec, - callback); + [Symbol.asyncIterator]() { + return this; + }, + byPage: () => { + return this.listByNamespacePagingPage( + resourceGroupName, + namespaceName, + options + ); + } + }; } - /** - * 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 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 { - return this.client.sendOperationRequest( - { + 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, - eventHubName, + continuationToken, options - }, - getOperationSpec, - callback) as Promise; + ); + 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; + } } /** @@ -175,68 +210,38 @@ 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 { + * @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, - callback) as Promise; + { resourceGroupName, namespaceName, eventHubName, options }, + listAuthorizationRulesOperationSpec + ); } /** - * Creates or updates an AuthorizationRule 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 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; - /** + * 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 callback The callback - */ - createOrUpdateAuthorizationRule(resourceGroupName: string, namespaceName: string, eventHubName: 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 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, @@ -246,8 +251,8 @@ export class EventHubs { parameters, options }, - createOrUpdateAuthorizationRuleOperationSpec, - callback) as Promise; + createOrUpdateAuthorizationRuleOperationSpec + ); } /** @@ -256,28 +261,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, @@ -286,8 +278,8 @@ export class EventHubs { authorizationRuleName, options }, - getAuthorizationRuleOperationSpec, - callback) as Promise; + getAuthorizationRuleOperationSpec + ); } /** @@ -296,28 +288,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, @@ -326,8 +305,8 @@ export class EventHubs { authorizationRuleName, options }, - deleteAuthorizationRuleOperationSpec, - callback); + deleteAuthorizationRuleOperationSpec + ); } /** @@ -336,28 +315,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, @@ -366,8 +332,8 @@ export class EventHubs { authorizationRuleName, options }, - listKeysOperationSpec, - callback) as Promise; + listKeysOperationSpec + ); } /** @@ -377,33 +343,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, @@ -413,144 +363,206 @@ export class EventHubs { parameters, options }, - regenerateKeysOperationSpec, - callback) as Promise; + regenerateKeysOperationSpec + ); } /** * 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 + * @param resourceGroupName Name of the resource group within the azure subscription. + * @param namespaceName The Namespace name + * @param options The options parameters. */ - listByNamespaceNext(nextPageLink: string, options?: msRest.RequestOptionsBase): Promise; + private _listByNamespace( + resourceGroupName: string, + namespaceName: string, + options?: EventHubsListByNamespaceOptionalParams + ): Promise { + return this.client.sendOperationRequest( + { resourceGroupName, namespaceName, options }, + listByNamespaceOperationSpec + ); + } + /** - * @param nextPageLink The NextLink from the previous successful call to List operation. - * @param callback The callback - */ - listByNamespaceNext(nextPageLink: string, callback: msRest.ServiceCallback): void; + * 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 { + return this.client.sendOperationRequest( + { resourceGroupName, namespaceName, eventHubName, parameters, options }, + createOrUpdateOperationSpec + ); + } + /** - * @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 { + * 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 { return this.client.sendOperationRequest( - { - nextPageLink, - options - }, - listByNamespaceNextOperationSpec, - callback) as Promise; + { resourceGroupName, namespaceName, eventHubName, options }, + deleteOperationSpec + ); } /** - * 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; + * 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 { + return this.client.sendOperationRequest( + { resourceGroupName, namespaceName, eventHubName, options }, + getOperationSpec + ); + } + /** - * @param nextPageLink The NextLink from the previous successful call to List operation. - * @param callback The callback - */ - listAuthorizationRulesNext(nextPageLink: string, callback: msRest.ServiceCallback): void; + * 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( + { resourceGroupName, namespaceName, eventHubName, nextLink, options }, + listAuthorizationRulesNextOperationSpec + ); + } + /** - * @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 { + * 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 - }, - listAuthorizationRulesNextOperationSpec, - callback) as Promise; + { resourceGroupName, namespaceName, nextLink, options }, + listByNamespaceNextOperationSpec + ); } } - // Operation Specifications -const serializer = new msRest.Serializer(Mappers); -const listByNamespaceOperationSpec: 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", + responses: { + 200: { + bodyMapper: Mappers.AuthorizationRuleListResult + }, + default: { + bodyMapper: Mappers.ErrorResponse + } + }, + queryParameters: [Parameters.apiVersion], urlParameters: [ + Parameters.$host, + Parameters.subscriptionId, Parameters.resourceGroupName, Parameters.namespaceName, - Parameters.subscriptionId - ], - queryParameters: [ - Parameters.apiVersion, - Parameters.skip, - Parameters.top - ], - headerParameters: [ - Parameters.acceptLanguage + Parameters.eventHubName ], + 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.EventHubListResult + bodyMapper: Mappers.AuthorizationRule }, default: { bodyMapper: Mappers.ErrorResponse } }, - serializer -}; - -const createOrUpdateOperationSpec: msRest.OperationSpec = { - httpMethod: "PUT", - path: "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventHub/namespaces/{namespaceName}/eventhubs/{eventHubName}", + requestBody: Parameters.parameters5, + queryParameters: [Parameters.apiVersion], urlParameters: [ + Parameters.$host, + Parameters.subscriptionId, Parameters.resourceGroupName, Parameters.namespaceName, - Parameters.eventHubName, - Parameters.subscriptionId - ], - queryParameters: [ - Parameters.apiVersion - ], - headerParameters: [ - Parameters.acceptLanguage + Parameters.authorizationRuleName, + Parameters.eventHubName ], - requestBody: { - parameterPath: "parameters", - mapper: { - ...Mappers.Eventhub, - required: true - } - }, + 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.Eventhub + bodyMapper: Mappers.AuthorizationRule }, default: { bodyMapper: Mappers.ErrorResponse } }, - serializer -}; - -const deleteMethodOperationSpec: msRest.OperationSpec = { - httpMethod: "DELETE", - path: "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventHub/namespaces/{namespaceName}/eventhubs/{eventHubName}", + queryParameters: [Parameters.apiVersion], urlParameters: [ + Parameters.$host, + Parameters.subscriptionId, Parameters.resourceGroupName, Parameters.namespaceName, - Parameters.eventHubName, - Parameters.subscriptionId - ], - queryParameters: [ - Parameters.apiVersion - ], - headerParameters: [ - Parameters.acceptLanguage + Parameters.authorizationRuleName, + 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: {}, @@ -558,138 +570,119 @@ 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.apiVersion], urlParameters: [ + Parameters.$host, + Parameters.subscriptionId, Parameters.resourceGroupName, Parameters.namespaceName, - Parameters.eventHubName, - Parameters.subscriptionId - ], - queryParameters: [ - Parameters.apiVersion - ], - headerParameters: [ - Parameters.acceptLanguage + Parameters.authorizationRuleName, + 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.Eventhub + bodyMapper: Mappers.AccessKeys }, default: { bodyMapper: Mappers.ErrorResponse } }, - serializer -}; - -const listAuthorizationRulesOperationSpec: msRest.OperationSpec = { - httpMethod: "GET", - path: "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventHub/namespaces/{namespaceName}/eventhubs/{eventHubName}/authorizationRules", + queryParameters: [Parameters.apiVersion], urlParameters: [ + Parameters.$host, + Parameters.subscriptionId, Parameters.resourceGroupName, Parameters.namespaceName, - Parameters.eventHubName, - Parameters.subscriptionId - ], - queryParameters: [ - Parameters.apiVersion - ], - headerParameters: [ - Parameters.acceptLanguage + Parameters.authorizationRuleName, + Parameters.eventHubName ], + 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.AuthorizationRuleListResult + bodyMapper: Mappers.AccessKeys }, default: { bodyMapper: Mappers.ErrorResponse } }, - serializer -}; - -const createOrUpdateAuthorizationRuleOperationSpec: msRest.OperationSpec = { - httpMethod: "PUT", - path: "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventHub/namespaces/{namespaceName}/eventhubs/{eventHubName}/authorizationRules/{authorizationRuleName}", + requestBody: Parameters.parameters6, + queryParameters: [Parameters.apiVersion], urlParameters: [ + Parameters.$host, + Parameters.subscriptionId, Parameters.resourceGroupName, Parameters.namespaceName, - Parameters.eventHubName, Parameters.authorizationRuleName, - Parameters.subscriptionId + Parameters.eventHubName ], - queryParameters: [ - Parameters.apiVersion - ], - headerParameters: [ - Parameters.acceptLanguage - ], - requestBody: { - parameterPath: "parameters", - mapper: { - ...Mappers.AuthorizationRule, - required: true - } - }, + 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.AuthorizationRule + bodyMapper: Mappers.EventHubListResult }, default: { bodyMapper: Mappers.ErrorResponse } }, - serializer -}; - -const getAuthorizationRuleOperationSpec: msRest.OperationSpec = { - httpMethod: "GET", - path: "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventHub/namespaces/{namespaceName}/eventhubs/{eventHubName}/authorizationRules/{authorizationRuleName}", + queryParameters: [Parameters.apiVersion, Parameters.skip, Parameters.top], urlParameters: [ + Parameters.$host, + Parameters.subscriptionId, Parameters.resourceGroupName, - Parameters.namespaceName, - Parameters.eventHubName, - Parameters.authorizationRuleName, - Parameters.subscriptionId - ], - queryParameters: [ - Parameters.apiVersion - ], - headerParameters: [ - Parameters.acceptLanguage + Parameters.namespaceName ], + 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.AuthorizationRule + bodyMapper: Mappers.Eventhub }, default: { bodyMapper: Mappers.ErrorResponse } }, - serializer -}; - -const deleteAuthorizationRuleOperationSpec: msRest.OperationSpec = { - httpMethod: "DELETE", - path: "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventHub/namespaces/{namespaceName}/eventhubs/{eventHubName}/authorizationRules/{authorizationRuleName}", + requestBody: Parameters.parameters11, + queryParameters: [Parameters.apiVersion], urlParameters: [ + Parameters.$host, + Parameters.subscriptionId, Parameters.resourceGroupName, Parameters.namespaceName, - Parameters.eventHubName, - Parameters.authorizationRuleName, - Parameters.subscriptionId - ], - queryParameters: [ - Parameters.apiVersion - ], - 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: {}, @@ -697,108 +690,82 @@ 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.apiVersion], urlParameters: [ + Parameters.$host, + Parameters.subscriptionId, Parameters.resourceGroupName, Parameters.namespaceName, - Parameters.eventHubName, - Parameters.authorizationRuleName, - Parameters.subscriptionId - ], - queryParameters: [ - Parameters.apiVersion - ], - 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.AccessKeys + bodyMapper: Mappers.Eventhub }, default: { 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.apiVersion], urlParameters: [ + Parameters.$host, + Parameters.subscriptionId, Parameters.resourceGroupName, Parameters.namespaceName, - Parameters.eventHubName, - Parameters.authorizationRuleName, - Parameters.subscriptionId - ], - queryParameters: [ - Parameters.apiVersion + Parameters.eventHubName ], - headerParameters: [ - Parameters.acceptLanguage - ], - requestBody: { - parameterPath: "parameters", - mapper: { - ...Mappers.RegenerateAccessKeyParameters, - required: true - } - }, - responses: { - 200: { - bodyMapper: Mappers.AccessKeys - }, - default: { - bodyMapper: Mappers.ErrorResponse - } - }, + headerParameters: [Parameters.accept], serializer }; - -const listByNamespaceNextOperationSpec: 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.EventHubListResult + bodyMapper: Mappers.AuthorizationRuleListResult }, default: { bodyMapper: Mappers.ErrorResponse } }, + queryParameters: [Parameters.apiVersion], + urlParameters: [ + Parameters.$host, + Parameters.subscriptionId, + Parameters.resourceGroupName, + Parameters.nextLink, + Parameters.namespaceName, + Parameters.eventHubName + ], + headerParameters: [Parameters.accept], serializer }; - -const listAuthorizationRulesNextOperationSpec: 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.AuthorizationRuleListResult + bodyMapper: Mappers.EventHubListResult }, default: { bodyMapper: Mappers.ErrorResponse } }, + queryParameters: [Parameters.apiVersion, 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/src/operations/index.ts b/sdk/eventhub/arm-eventhub/src/operations/index.ts index 8c9523f44191..81bf8f142252 100644 --- a/sdk/eventhub/arm-eventhub/src/operations/index.ts +++ b/sdk/eventhub/arm-eventhub/src/operations/index.ts @@ -1,16 +1,18 @@ /* - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for - * license information. + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. * * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is - * regenerated. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. */ -export * from "./operations"; +export * from "./clusters"; export * from "./namespaces"; +export * from "./privateEndpointConnections"; +export * from "./privateLinkResources"; +export * from "./configuration"; export * from "./disasterRecoveryConfigs"; export * from "./eventHubs"; export * from "./consumerGroups"; +export * from "./operations"; export * from "./regions"; diff --git a/sdk/eventhub/arm-eventhub/src/operations/namespaces.ts b/sdk/eventhub/arm-eventhub/src/operations/namespaces.ts index 99a8372ff15f..a69c62122db0 100644 --- a/sdk/eventhub/arm-eventhub/src/operations/namespaces.ts +++ b/sdk/eventhub/arm-eventhub/src/operations/namespaces.ts @@ -1,418 +1,938 @@ /* - * 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 "@azure/core-paging"; +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 { PollerLike, PollOperationState, LroEngine } from "@azure/core-lro"; +import { LroImpl } from "../lroImpl"; +import { + IpFilterRule, + NamespacesListIPFilterRulesNextOptionalParams, + NamespacesListIPFilterRulesOptionalParams, + EHNamespace, + NamespacesListNextOptionalParams, + NamespacesListOptionalParams, + NamespacesListByResourceGroupNextOptionalParams, + NamespacesListByResourceGroupOptionalParams, + VirtualNetworkRule, + NamespacesListVirtualNetworkRulesNextOptionalParams, + NamespacesListVirtualNetworkRulesOptionalParams, + AuthorizationRule, + NamespacesListAuthorizationRulesNextOptionalParams, + NamespacesListAuthorizationRulesOptionalParams, + NamespacesListIPFilterRulesResponse, + NamespacesCreateOrUpdateIpFilterRuleOptionalParams, + NamespacesCreateOrUpdateIpFilterRuleResponse, + NamespacesDeleteIpFilterRuleOptionalParams, + NamespacesGetIpFilterRuleOptionalParams, + NamespacesGetIpFilterRuleResponse, + NamespacesListResponse, + NamespacesListByResourceGroupResponse, + NamespacesCreateOrUpdateOptionalParams, + NamespacesCreateOrUpdateResponse, + NamespacesDeleteOptionalParams, + NamespacesGetOptionalParams, + NamespacesGetResponse, + NamespacesUpdateOptionalParams, + NamespacesUpdateResponse, + NamespacesListVirtualNetworkRulesResponse, + NamespacesCreateOrUpdateVirtualNetworkRuleOptionalParams, + NamespacesCreateOrUpdateVirtualNetworkRuleResponse, + NamespacesDeleteVirtualNetworkRuleOptionalParams, + NamespacesGetVirtualNetworkRuleOptionalParams, + NamespacesGetVirtualNetworkRuleResponse, + NetworkRuleSet, + NamespacesCreateOrUpdateNetworkRuleSetOptionalParams, + NamespacesCreateOrUpdateNetworkRuleSetResponse, + NamespacesGetNetworkRuleSetOptionalParams, + NamespacesGetNetworkRuleSetResponse, + NamespacesListAuthorizationRulesResponse, + NamespacesCreateOrUpdateAuthorizationRuleOptionalParams, + NamespacesCreateOrUpdateAuthorizationRuleResponse, + NamespacesDeleteAuthorizationRuleOptionalParams, + NamespacesGetAuthorizationRuleOptionalParams, + NamespacesGetAuthorizationRuleResponse, + NamespacesListKeysOptionalParams, + NamespacesListKeysResponse, + RegenerateAccessKeyParameters, + NamespacesRegenerateKeysOptionalParams, + NamespacesRegenerateKeysResponse, + CheckNameAvailabilityParameter, + NamespacesCheckNameAvailabilityOptionalParams, + NamespacesCheckNameAvailabilityResponse, + NamespacesListIPFilterRulesNextResponse, + NamespacesListNextResponse, + NamespacesListByResourceGroupNextResponse, + NamespacesListVirtualNetworkRulesNextResponse, + NamespacesListAuthorizationRulesNextResponse +} from "../models"; -/** Class representing a Namespaces. */ -export class Namespaces { +/// +/** Class containing Namespaces operations. */ +export class NamespacesImpl implements Namespaces { private readonly client: EventHubManagementClientContext; /** - * 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) { this.client = client; } /** - * 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 + * Gets a list of IP Filter 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. */ - checkNameAvailability(parameters: Models.CheckNameAvailabilityParameter, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; - checkNameAvailability(parameters: Models.CheckNameAvailabilityParameter, options?: msRest.RequestOptionsBase | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { - return this.client.sendOperationRequest( - { - parameters, - options + public listIPFilterRules( + resourceGroupName: string, + namespaceName: string, + options?: NamespacesListIPFilterRulesOptionalParams + ): PagedAsyncIterableIterator { + const iter = this.listIPFilterRulesPagingAll( + resourceGroupName, + namespaceName, + options + ); + return { + next() { + return iter.next(); }, - checkNameAvailabilityOperationSpec, - callback) as Promise; + [Symbol.asyncIterator]() { + return this; + }, + byPage: () => { + return this.listIPFilterRulesPagingPage( + resourceGroupName, + namespaceName, + options + ); + } + }; + } + + private async *listIPFilterRulesPagingPage( + resourceGroupName: string, + namespaceName: string, + options?: NamespacesListIPFilterRulesOptionalParams + ): AsyncIterableIterator { + let result = await this._listIPFilterRules( + resourceGroupName, + namespaceName, + options + ); + yield result.value || []; + let continuationToken = result.nextLink; + while (continuationToken) { + result = await this._listIPFilterRulesNext( + resourceGroupName, + namespaceName, + continuationToken, + options + ); + continuationToken = result.nextLink; + yield result.value || []; + } + } + + private async *listIPFilterRulesPagingAll( + resourceGroupName: string, + namespaceName: string, + options?: NamespacesListIPFilterRulesOptionalParams + ): AsyncIterableIterator { + for await (const page of this.listIPFilterRulesPagingPage( + resourceGroupName, + namespaceName, + options + )) { + yield* page; + } } /** * 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(); + }, + [Symbol.asyncIterator]() { + return this; }, - listOperationSpec, - callback) as Promise; + byPage: () => { + return this.listPagingPage(options); + } + }; + } + + private async *listPagingPage( + options?: NamespacesListOptionalParams + ): AsyncIterableIterator { + let result = await this._list(options); + yield result.value || []; + let continuationToken = result.nextLink; + while (continuationToken) { + result = await this._listNext(continuationToken, options); + continuationToken = result.nextLink; + yield result.value || []; + } + } + + private async *listPagingAll( + options?: NamespacesListOptionalParams + ): AsyncIterableIterator { + for await (const page of this.listPagingPage(options)) { + yield* page; + } } /** * Lists 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 - */ - 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 { - return this.client.sendOperationRequest( - { + 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 - }, - listByResourceGroupOperationSpec, - callback) as Promise; + ); + continuationToken = result.nextLink; + yield result.value || []; + } } - /** - * 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 - */ - 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 async *listByResourceGroupPagingAll( + resourceGroupName: string, + options?: NamespacesListByResourceGroupOptionalParams + ): AsyncIterableIterator { + for await (const page of this.listByResourceGroupPagingPage( + resourceGroupName, + options + )) { + yield* page; + } } /** - * Deletes an existing namespace. This operation also removes all associated resources under the - * namespace. + * Gets a list of VirtualNetwork rules for a Namespace. * @param resourceGroupName Name of the resource group within the azure subscription. * @param namespaceName The Namespace name - * @param [options] The optional parameters - * @returns Promise + * @param options The options parameters. */ - deleteMethod(resourceGroupName: string, namespaceName: string, options?: msRest.RequestOptionsBase): Promise { - return this.beginDeleteMethod(resourceGroupName,namespaceName,options) - .then(lroPoller => lroPoller.pollUntilFinished()); + public listVirtualNetworkRules( + resourceGroupName: string, + namespaceName: string, + options?: NamespacesListVirtualNetworkRulesOptionalParams + ): PagedAsyncIterableIterator { + const iter = this.listVirtualNetworkRulesPagingAll( + resourceGroupName, + namespaceName, + options + ); + return { + next() { + return iter.next(); + }, + [Symbol.asyncIterator]() { + return this; + }, + byPage: () => { + return this.listVirtualNetworkRulesPagingPage( + resourceGroupName, + namespaceName, + options + ); + } + }; + } + + private async *listVirtualNetworkRulesPagingPage( + resourceGroupName: string, + namespaceName: string, + options?: NamespacesListVirtualNetworkRulesOptionalParams + ): AsyncIterableIterator { + let result = await this._listVirtualNetworkRules( + resourceGroupName, + namespaceName, + options + ); + yield result.value || []; + let continuationToken = result.nextLink; + while (continuationToken) { + result = await this._listVirtualNetworkRulesNext( + resourceGroupName, + namespaceName, + continuationToken, + options + ); + continuationToken = result.nextLink; + yield result.value || []; + } + } + + private async *listVirtualNetworkRulesPagingAll( + resourceGroupName: string, + namespaceName: string, + options?: NamespacesListVirtualNetworkRulesOptionalParams + ): AsyncIterableIterator { + for await (const page of this.listVirtualNetworkRulesPagingPage( + resourceGroupName, + namespaceName, + options + )) { + yield* page; + } } /** - * Gets the description of the specified namespace. + * 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 + * @param options The options parameters. */ - get(resourceGroupName: string, namespaceName: string, options?: msRest.RequestOptionsBase): Promise; + 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 + ); + 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; + } + } + /** + * Gets a list of IP Filter rules for a Namespace. * @param resourceGroupName Name of the resource group within the azure subscription. * @param namespaceName The Namespace name - * @param callback The callback + * @param options The options parameters. */ - get(resourceGroupName: string, namespaceName: string, callback: msRest.ServiceCallback): void; + private _listIPFilterRules( + resourceGroupName: string, + namespaceName: string, + options?: NamespacesListIPFilterRulesOptionalParams + ): Promise { + return this.client.sendOperationRequest( + { resourceGroupName, namespaceName, options }, + listIPFilterRulesOperationSpec + ); + } + /** + * Creates or updates an IpFilterRule for a 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 ipFilterRuleName The IP Filter Rule name. + * @param parameters The Namespace IpFilterRule. + * @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 { + createOrUpdateIpFilterRule( + resourceGroupName: string, + namespaceName: string, + ipFilterRuleName: string, + parameters: IpFilterRule, + options?: NamespacesCreateOrUpdateIpFilterRuleOptionalParams + ): Promise { return this.client.sendOperationRequest( { resourceGroupName, namespaceName, + ipFilterRuleName, + parameters, options }, - getOperationSpec, - callback) as Promise; + createOrUpdateIpFilterRuleOperationSpec + ); } /** - * Creates or updates a namespace. Once created, this namespace's resource manifest is immutable. - * This operation is idempotent. + * Deletes an IpFilterRule for a 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 ipFilterRuleName The IP Filter Rule name. + * @param options The options parameters. */ - update(resourceGroupName: string, namespaceName: string, parameters: Models.EHNamespace, options?: msRest.RequestOptionsBase): Promise; + deleteIpFilterRule( + resourceGroupName: string, + namespaceName: string, + ipFilterRuleName: string, + options?: NamespacesDeleteIpFilterRuleOptionalParams + ): Promise { + return this.client.sendOperationRequest( + { resourceGroupName, namespaceName, ipFilterRuleName, options }, + deleteIpFilterRuleOperationSpec + ); + } + /** + * Gets an IpFilterRule for a Namespace by rule name. * @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 ipFilterRuleName The IP Filter Rule name. + * @param options The options parameters. */ - update(resourceGroupName: string, namespaceName: string, parameters: Models.EHNamespace, callback: msRest.ServiceCallback): void; + getIpFilterRule( + resourceGroupName: string, + namespaceName: string, + ipFilterRuleName: string, + options?: NamespacesGetIpFilterRuleOptionalParams + ): Promise { + return this.client.sendOperationRequest( + { resourceGroupName, namespaceName, ipFilterRuleName, options }, + getIpFilterRuleOperationSpec + ); + } + /** - * @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 + * Lists all the available Namespaces within a subscription, irrespective of the resource groups. + * @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 { - return this.client.sendOperationRequest( - { - resourceGroupName, - namespaceName, - parameters, - options - }, - updateOperationSpec, - callback) as Promise; + private _list( + options?: NamespacesListOptionalParams + ): Promise { + return this.client.sendOperationRequest({ options }, listOperationSpec); } /** - * Gets messaging plan for specified 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. */ - getMessagingPlan(resourceGroupName: string, namespaceName: string, options?: msRest.RequestOptionsBase): Promise; + private _listByResourceGroup( + resourceGroupName: string, + options?: NamespacesListByResourceGroupOptionalParams + ): Promise { + return this.client.sendOperationRequest( + { resourceGroupName, options }, + listByResourceGroupOperationSpec + ); + } + /** + * 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. */ - getMessagingPlan(resourceGroupName: string, namespaceName: string, callback: msRest.ServiceCallback): void; + 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 options The optional parameters - * @param callback The callback + * @param parameters Parameters for creating a namespace resource. + * @param options The options parameters. */ - getMessagingPlan(resourceGroupName: string, namespaceName: string, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; - getMessagingPlan(resourceGroupName: string, namespaceName: string, options?: msRest.RequestOptionsBase | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { - return this.client.sendOperationRequest( - { - resourceGroupName, - namespaceName, - options - }, - getMessagingPlanOperationSpec, - callback) as Promise; + async beginCreateOrUpdateAndWait( + resourceGroupName: string, + namespaceName: string, + parameters: EHNamespace, + options?: NamespacesCreateOrUpdateOptionalParams + ): Promise { + const poller = await this.beginCreateOrUpdate( + resourceGroupName, + namespaceName, + parameters, + options + ); + return poller.pollUntilDone(); } /** - * Gets a list of authorization rules for a Namespace. + * Deletes an existing namespace. This operation also removes all associated resources under the + * namespace. * @param resourceGroupName Name of the resource group within the azure subscription. * @param namespaceName The Namespace name - * @param [options] The optional parameters - * @returns Promise + * @param options The options parameters. */ - listAuthorizationRules(resourceGroupName: string, namespaceName: string, options?: msRest.RequestOptionsBase): Promise; + async beginDelete( + resourceGroupName: string, + namespaceName: string, + options?: NamespacesDeleteOptionalParams + ): Promise, void>> { + const directSendOperation = async ( + args: coreClient.OperationArguments, + spec: coreClient.OperationSpec + ): Promise => { + return this.client.sendOperationRequest(args, spec); + }; + const sendOperation = async ( + args: coreClient.OperationArguments, + spec: coreClient.OperationSpec + ) => { + let currentRawResponse: + | coreClient.FullOperationResponse + | undefined = undefined; + const providedCallback = args.options?.onResponse; + const callback: coreClient.RawResponseCallback = ( + rawResponse: coreClient.FullOperationResponse, + flatResponse: unknown + ) => { + currentRawResponse = rawResponse; + providedCallback?.(rawResponse, flatResponse); + }; + const updatedArgs = { + ...args, + options: { + ...args.options, + onResponse: callback + } + }; + const flatResponse = await directSendOperation(updatedArgs, spec); + return { + flatResponse, + rawResponse: { + statusCode: currentRawResponse!.status, + body: currentRawResponse!.parsedBody, + headers: currentRawResponse!.headers.toJSON() + } + }; + }; + + const lro = new LroImpl( + sendOperation, + { resourceGroupName, namespaceName, options }, + deleteOperationSpec + ); + return new LroEngine(lro, { + resumeFrom: options?.resumeFrom, + intervalInMs: options?.updateIntervalInMs + }); + } + /** + * Deletes an existing namespace. This operation also removes all associated resources under the + * namespace. * @param resourceGroupName Name of the resource group within the azure subscription. * @param namespaceName The Namespace name - * @param callback The callback + * @param options The options parameters. */ - listAuthorizationRules(resourceGroupName: string, namespaceName: string, callback: msRest.ServiceCallback): void; + async beginDeleteAndWait( + resourceGroupName: string, + namespaceName: string, + options?: NamespacesDeleteOptionalParams + ): Promise { + const poller = await this.beginDelete( + resourceGroupName, + namespaceName, + options + ); + return poller.pollUntilDone(); + } + /** + * 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 optional parameters - * @param callback The callback + * @param options The options parameters. */ - 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 { + get( + resourceGroupName: string, + namespaceName: string, + options?: NamespacesGetOptionalParams + ): Promise { return this.client.sendOperationRequest( - { - resourceGroupName, - namespaceName, - options - }, - listAuthorizationRulesOperationSpec, - callback) as Promise; + { resourceGroupName, namespaceName, options }, + getOperationSpec + ); } /** - * Creates or updates an AuthorizationRule for a 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 authorizationRuleName The authorization rule name. - * @param parameters The shared access AuthorizationRule. - * @param [options] The optional parameters - * @returns Promise + * @param parameters Parameters for updating a namespace resource. + * @param options The options parameters. */ - createOrUpdateAuthorizationRule(resourceGroupName: string, namespaceName: string, authorizationRuleName: string, parameters: Models.AuthorizationRule, options?: msRest.RequestOptionsBase): Promise; + update( + resourceGroupName: string, + namespaceName: string, + parameters: EHNamespace, + options?: NamespacesUpdateOptionalParams + ): Promise { + return this.client.sendOperationRequest( + { resourceGroupName, namespaceName, parameters, options }, + updateOperationSpec + ); + } + /** + * Gets a list of VirtualNetwork rules 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 callback The callback + * @param options The options parameters. */ - createOrUpdateAuthorizationRule(resourceGroupName: string, namespaceName: string, authorizationRuleName: string, parameters: Models.AuthorizationRule, callback: msRest.ServiceCallback): void; + private _listVirtualNetworkRules( + resourceGroupName: string, + namespaceName: string, + options?: NamespacesListVirtualNetworkRulesOptionalParams + ): Promise { + return this.client.sendOperationRequest( + { resourceGroupName, namespaceName, options }, + listVirtualNetworkRulesOperationSpec + ); + } + /** + * Creates or updates an VirtualNetworkRule 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 optional parameters - * @param callback The callback + * @param virtualNetworkRuleName The Virtual Network Rule name. + * @param parameters The Namespace VirtualNetworkRule. + * @param options The options parameters. */ - createOrUpdateAuthorizationRule(resourceGroupName: string, namespaceName: string, authorizationRuleName: string, parameters: Models.AuthorizationRule, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; - createOrUpdateAuthorizationRule(resourceGroupName: string, namespaceName: string, authorizationRuleName: string, parameters: Models.AuthorizationRule, options?: msRest.RequestOptionsBase | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { + createOrUpdateVirtualNetworkRule( + resourceGroupName: string, + namespaceName: string, + virtualNetworkRuleName: string, + parameters: VirtualNetworkRule, + options?: NamespacesCreateOrUpdateVirtualNetworkRuleOptionalParams + ): Promise { return this.client.sendOperationRequest( { resourceGroupName, namespaceName, - authorizationRuleName, + virtualNetworkRuleName, parameters, options }, - createOrUpdateAuthorizationRuleOperationSpec, - callback) as Promise; + createOrUpdateVirtualNetworkRuleOperationSpec + ); } /** - * Deletes an AuthorizationRule for a Namespace. + * Deletes an VirtualNetworkRule 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 optional parameters - * @returns Promise + * @param virtualNetworkRuleName The Virtual Network Rule name. + * @param options The options parameters. */ - deleteAuthorizationRule(resourceGroupName: string, namespaceName: string, authorizationRuleName: string, options?: msRest.RequestOptionsBase): Promise; + deleteVirtualNetworkRule( + resourceGroupName: string, + namespaceName: string, + virtualNetworkRuleName: string, + options?: NamespacesDeleteVirtualNetworkRuleOptionalParams + ): Promise { + return this.client.sendOperationRequest( + { resourceGroupName, namespaceName, virtualNetworkRuleName, options }, + deleteVirtualNetworkRuleOperationSpec + ); + } + /** + * Gets an VirtualNetworkRule 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 callback The callback + * @param virtualNetworkRuleName The Virtual Network Rule name. + * @param options The options parameters. */ - deleteAuthorizationRule(resourceGroupName: string, namespaceName: string, authorizationRuleName: string, callback: msRest.ServiceCallback): void; + getVirtualNetworkRule( + resourceGroupName: string, + namespaceName: string, + virtualNetworkRuleName: string, + options?: NamespacesGetVirtualNetworkRuleOptionalParams + ): Promise { + return this.client.sendOperationRequest( + { resourceGroupName, namespaceName, virtualNetworkRuleName, options }, + getVirtualNetworkRuleOperationSpec + ); + } + /** + * Create or update NetworkRuleSet 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 optional parameters - * @param callback The callback + * @param parameters The Namespace IpFilterRule. + * @param options The options parameters. */ - deleteAuthorizationRule(resourceGroupName: string, namespaceName: string, authorizationRuleName: string, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; - deleteAuthorizationRule(resourceGroupName: string, namespaceName: string, authorizationRuleName: string, options?: msRest.RequestOptionsBase | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { + createOrUpdateNetworkRuleSet( + resourceGroupName: string, + namespaceName: string, + parameters: NetworkRuleSet, + options?: NamespacesCreateOrUpdateNetworkRuleSetOptionalParams + ): Promise { return this.client.sendOperationRequest( - { - resourceGroupName, - namespaceName, - authorizationRuleName, - options - }, - deleteAuthorizationRuleOperationSpec, - callback); + { resourceGroupName, namespaceName, parameters, options }, + createOrUpdateNetworkRuleSetOperationSpec + ); } /** - * Gets an AuthorizationRule for a Namespace by rule name. + * Gets NetworkRuleSet 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 optional parameters - * @returns Promise + * @param options The options parameters. */ - getAuthorizationRule(resourceGroupName: string, namespaceName: string, authorizationRuleName: string, options?: msRest.RequestOptionsBase): Promise; + getNetworkRuleSet( + resourceGroupName: string, + namespaceName: string, + options?: NamespacesGetNetworkRuleSetOptionalParams + ): Promise { + return this.client.sendOperationRequest( + { resourceGroupName, namespaceName, options }, + getNetworkRuleSetOperationSpec + ); + } + /** + * 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 authorizationRuleName The authorization rule name. - * @param callback The callback + * @param options The options parameters. */ - getAuthorizationRule(resourceGroupName: string, namespaceName: string, authorizationRuleName: string, callback: msRest.ServiceCallback): void; + private _listAuthorizationRules( + resourceGroupName: string, + namespaceName: string, + options?: NamespacesListAuthorizationRulesOptionalParams + ): Promise { + return this.client.sendOperationRequest( + { resourceGroupName, namespaceName, options }, + listAuthorizationRulesOperationSpec + ); + } + /** + * 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 options The optional parameters - * @param callback The callback + * @param parameters The shared access AuthorizationRule. + * @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 { + createOrUpdateAuthorizationRule( + resourceGroupName: string, + namespaceName: string, + authorizationRuleName: string, + parameters: AuthorizationRule, + options?: NamespacesCreateOrUpdateAuthorizationRuleOptionalParams + ): Promise { return this.client.sendOperationRequest( { resourceGroupName, namespaceName, authorizationRuleName, + parameters, options }, - getAuthorizationRuleOperationSpec, - callback) as Promise; + createOrUpdateAuthorizationRuleOperationSpec + ); } /** - * Gets the primary and secondary connection strings for the Namespace. + * 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 optional parameters - * @returns Promise + * @param options The options parameters. */ - listKeys(resourceGroupName: string, namespaceName: string, authorizationRuleName: string, options?: msRest.RequestOptionsBase): Promise; + deleteAuthorizationRule( + resourceGroupName: string, + namespaceName: string, + authorizationRuleName: string, + options?: NamespacesDeleteAuthorizationRuleOptionalParams + ): Promise { + return this.client.sendOperationRequest( + { resourceGroupName, namespaceName, authorizationRuleName, options }, + deleteAuthorizationRuleOperationSpec + ); + } + /** + * 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 callback The callback + * @param options The options parameters. */ - listKeys(resourceGroupName: string, namespaceName: string, authorizationRuleName: string, callback: msRest.ServiceCallback): void; + getAuthorizationRule( + resourceGroupName: string, + namespaceName: string, + authorizationRuleName: string, + options?: NamespacesGetAuthorizationRuleOptionalParams + ): Promise { + return this.client.sendOperationRequest( + { resourceGroupName, namespaceName, authorizationRuleName, options }, + getAuthorizationRuleOperationSpec + ); + } + /** + * 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 optional parameters - * @param callback The callback + * @param options The options parameters. */ - 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 + ); } /** @@ -421,28 +941,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 - */ - 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 + * @param options The options parameters. */ - regenerateKeys(resourceGroupName: string, namespaceName: string, authorizationRuleName: string, parameters: Models.RegenerateAccessKeyParameters, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; - regenerateKeys(resourceGroupName: string, namespaceName: string, authorizationRuleName: string, parameters: Models.RegenerateAccessKeyParameters, options?: msRest.RequestOptionsBase | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { + regenerateKeys( + resourceGroupName: string, + namespaceName: string, + authorizationRuleName: string, + parameters: RegenerateAccessKeyParameters, + options?: NamespacesRegenerateKeysOptionalParams + ): Promise { return this.client.sendOperationRequest( { resourceGroupName, @@ -451,271 +958,214 @@ export class Namespaces { parameters, options }, - regenerateKeysOperationSpec, - callback) as Promise; + regenerateKeysOperationSpec + ); } /** - * Create or update NetworkRuleSet for a Namespace. - * @param resourceGroupName Name of the resource group within the azure subscription. - * @param namespaceName The Namespace name - * @param parameters The Namespace IpFilterRule. - * @param [options] The optional parameters - * @returns Promise - */ - createOrUpdateNetworkRuleSet(resourceGroupName: string, namespaceName: string, parameters: Models.NetworkRuleSet, options?: msRest.RequestOptionsBase): Promise; - /** - * @param resourceGroupName Name of the resource group within the azure subscription. - * @param namespaceName The Namespace name - * @param parameters The Namespace IpFilterRule. - * @param callback The callback + * Check the give Namespace name availability. + * @param parameters Parameters to check availability of the given Namespace name + * @param options The options parameters. */ - createOrUpdateNetworkRuleSet(resourceGroupName: string, namespaceName: string, parameters: Models.NetworkRuleSet, callback: msRest.ServiceCallback): void; + checkNameAvailability( + parameters: CheckNameAvailabilityParameter, + options?: NamespacesCheckNameAvailabilityOptionalParams + ): Promise { + return this.client.sendOperationRequest( + { parameters, options }, + checkNameAvailabilityOperationSpec + ); + } + /** + * ListIPFilterRulesNext * @param resourceGroupName Name of the resource group within the azure subscription. * @param namespaceName The Namespace name - * @param parameters The Namespace IpFilterRule. - * @param options The optional parameters - * @param callback The callback + * @param nextLink The nextLink from the previous successful call to the ListIPFilterRules method. + * @param options The options parameters. */ - createOrUpdateNetworkRuleSet(resourceGroupName: string, namespaceName: string, parameters: Models.NetworkRuleSet, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; - createOrUpdateNetworkRuleSet(resourceGroupName: string, namespaceName: string, parameters: Models.NetworkRuleSet, options?: msRest.RequestOptionsBase | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { + private _listIPFilterRulesNext( + resourceGroupName: string, + namespaceName: string, + nextLink: string, + options?: NamespacesListIPFilterRulesNextOptionalParams + ): Promise { return this.client.sendOperationRequest( - { - resourceGroupName, - namespaceName, - parameters, - options - }, - createOrUpdateNetworkRuleSetOperationSpec, - callback) as Promise; + { resourceGroupName, namespaceName, nextLink, options }, + listIPFilterRulesNextOperationSpec + ); } /** - * Gets NetworkRuleSet 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 + * ListNext + * @param nextLink The nextLink from the previous successful call to the List method. + * @param options The options parameters. */ - getNetworkRuleSet(resourceGroupName: string, namespaceName: string, options?: msRest.RequestOptionsBase): Promise; + private _listNext( + nextLink: string, + options?: NamespacesListNextOptionalParams + ): Promise { + return this.client.sendOperationRequest( + { nextLink, options }, + listNextOperationSpec + ); + } + /** + * ListByResourceGroupNext * @param resourceGroupName Name of the resource group within the azure subscription. - * @param namespaceName The Namespace name - * @param callback The callback + * @param nextLink The nextLink from the previous successful call to the ListByResourceGroup method. + * @param options The options parameters. */ - getNetworkRuleSet(resourceGroupName: string, namespaceName: string, callback: msRest.ServiceCallback): void; + private _listByResourceGroupNext( + resourceGroupName: string, + nextLink: string, + options?: NamespacesListByResourceGroupNextOptionalParams + ): Promise { + return this.client.sendOperationRequest( + { resourceGroupName, nextLink, options }, + listByResourceGroupNextOperationSpec + ); + } + /** + * ListVirtualNetworkRulesNext * @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 nextLink The nextLink from the previous successful call to the ListVirtualNetworkRules + * method. + * @param options The options parameters. */ - getNetworkRuleSet(resourceGroupName: string, namespaceName: string, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; - getNetworkRuleSet(resourceGroupName: string, namespaceName: string, options?: msRest.RequestOptionsBase | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { + private _listVirtualNetworkRulesNext( + resourceGroupName: string, + namespaceName: string, + nextLink: string, + options?: NamespacesListVirtualNetworkRulesNextOptionalParams + ): Promise { return this.client.sendOperationRequest( - { - resourceGroupName, - namespaceName, - options - }, - getNetworkRuleSetOperationSpec, - callback) as Promise; + { resourceGroupName, namespaceName, nextLink, options }, + listVirtualNetworkRulesNextOperationSpec + ); } /** - * Creates or updates a namespace. Once created, this namespace's resource manifest is immutable. - * This operation is idempotent. + * ListAuthorizationRulesNext * @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 + * @param nextLink The nextLink from the previous successful call to the ListAuthorizationRules 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 _listAuthorizationRulesNext( + resourceGroupName: string, + namespaceName: string, + nextLink: string, + options?: NamespacesListAuthorizationRulesNextOptionalParams + ): Promise { return this.client.sendOperationRequest( - { - nextPageLink, - options - }, - listNextOperationSpec, - callback) as Promise; - } - - /** - * 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(nextPageLink: string, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; - listByResourceGroupNext(nextPageLink: string, options?: msRest.RequestOptionsBase | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { - return this.client.sendOperationRequest( - { - nextPageLink, - options - }, - listByResourceGroupNextOperationSpec, - callback) as Promise; - } - - /** - * 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(nextPageLink: string, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; - listAuthorizationRulesNext(nextPageLink: string, options?: msRest.RequestOptionsBase | msRest.ServiceCallback, callback?: msRest.ServiceCallback): 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 checkNameAvailabilityOperationSpec: msRest.OperationSpec = { - httpMethod: "POST", - path: "subscriptions/{subscriptionId}/providers/Microsoft.EventHub/CheckNameAvailability", - urlParameters: [ - Parameters.subscriptionId - ], - queryParameters: [ - Parameters.apiVersion - ], - headerParameters: [ - Parameters.acceptLanguage - ], - requestBody: { - parameterPath: "parameters", - mapper: { - ...Mappers.CheckNameAvailabilityParameter, - required: true +const serializer = coreClient.createSerializer(Mappers, /* isXml */ false); + +const listIPFilterRulesOperationSpec: coreClient.OperationSpec = { + path: + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventHub/namespaces/{namespaceName}/ipfilterrules", + httpMethod: "GET", + responses: { + 200: { + bodyMapper: Mappers.IpFilterRuleListResult + }, + default: { + bodyMapper: Mappers.ErrorResponse } }, + queryParameters: [Parameters.apiVersion], + urlParameters: [ + Parameters.$host, + Parameters.subscriptionId, + Parameters.resourceGroupName, + Parameters.namespaceName + ], + headerParameters: [Parameters.accept], + serializer +}; +const createOrUpdateIpFilterRuleOperationSpec: coreClient.OperationSpec = { + path: + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventHub/namespaces/{namespaceName}/ipfilterrules/{ipFilterRuleName}", + httpMethod: "PUT", responses: { 200: { - bodyMapper: Mappers.CheckNameAvailabilityResult + bodyMapper: Mappers.IpFilterRule }, default: { bodyMapper: Mappers.ErrorResponse } }, + requestBody: Parameters.parameters1, + queryParameters: [Parameters.apiVersion], + urlParameters: [ + Parameters.$host, + Parameters.subscriptionId, + Parameters.resourceGroupName, + Parameters.namespaceName, + Parameters.ipFilterRuleName + ], + headerParameters: [Parameters.accept, Parameters.contentType], + mediaType: "json", serializer }; - -const listOperationSpec: msRest.OperationSpec = { - httpMethod: "GET", - path: "subscriptions/{subscriptionId}/providers/Microsoft.EventHub/namespaces", +const deleteIpFilterRuleOperationSpec: coreClient.OperationSpec = { + path: + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventHub/namespaces/{namespaceName}/ipfilterrules/{ipFilterRuleName}", + httpMethod: "DELETE", + responses: { + 200: {}, + 204: {}, + default: { + bodyMapper: Mappers.ErrorResponse + } + }, + queryParameters: [Parameters.apiVersion], urlParameters: [ - Parameters.subscriptionId - ], - queryParameters: [ - Parameters.apiVersion - ], - headerParameters: [ - Parameters.acceptLanguage + Parameters.$host, + Parameters.subscriptionId, + Parameters.resourceGroupName, + Parameters.namespaceName, + Parameters.ipFilterRuleName ], + headerParameters: [Parameters.accept], + serializer +}; +const getIpFilterRuleOperationSpec: coreClient.OperationSpec = { + path: + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventHub/namespaces/{namespaceName}/ipfilterrules/{ipFilterRuleName}", + httpMethod: "GET", responses: { 200: { - bodyMapper: Mappers.EHNamespaceListResult + bodyMapper: Mappers.IpFilterRule }, default: { bodyMapper: Mappers.ErrorResponse } }, - serializer -}; - -const listByResourceGroupOperationSpec: msRest.OperationSpec = { - httpMethod: "GET", - path: "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventHub/namespaces", + queryParameters: [Parameters.apiVersion], urlParameters: [ + Parameters.$host, + Parameters.subscriptionId, Parameters.resourceGroupName, - Parameters.subscriptionId - ], - queryParameters: [ - Parameters.apiVersion - ], - headerParameters: [ - Parameters.acceptLanguage + Parameters.namespaceName, + Parameters.ipFilterRuleName ], + headerParameters: [Parameters.accept], + serializer +}; +const listOperationSpec: coreClient.OperationSpec = { + path: + "/subscriptions/{subscriptionId}/providers/Microsoft.EventHub/namespaces", + httpMethod: "GET", responses: { 200: { bodyMapper: Mappers.EHNamespaceListResult @@ -724,23 +1174,36 @@ const listByResourceGroupOperationSpec: msRest.OperationSpec = { bodyMapper: Mappers.ErrorResponse } }, + queryParameters: [Parameters.apiVersion], + urlParameters: [Parameters.$host, Parameters.subscriptionId], + headerParameters: [Parameters.accept], serializer }; - -const getOperationSpec: 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/{namespaceName}", + responses: { + 200: { + bodyMapper: Mappers.EHNamespaceListResult + }, + default: { + bodyMapper: Mappers.ErrorResponse + } + }, + queryParameters: [Parameters.apiVersion], urlParameters: [ - Parameters.resourceGroupName, - Parameters.namespaceName, - Parameters.subscriptionId - ], - queryParameters: [ - Parameters.apiVersion - ], - headerParameters: [ - Parameters.acceptLanguage + Parameters.$host, + Parameters.subscriptionId, + Parameters.resourceGroupName ], + headerParameters: [Parameters.accept], + serializer +}; +const createOrUpdateOperationSpec: coreClient.OperationSpec = { + path: + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventHub/namespaces/{namespaceName}", + httpMethod: "PUT", responses: { 200: { bodyMapper: Mappers.EHNamespace @@ -748,34 +1211,55 @@ const getOperationSpec: msRest.OperationSpec = { 201: { bodyMapper: Mappers.EHNamespace }, + 202: { + bodyMapper: Mappers.EHNamespace + }, + 204: { + bodyMapper: Mappers.EHNamespace + }, default: { bodyMapper: Mappers.ErrorResponse } }, - serializer -}; - -const updateOperationSpec: msRest.OperationSpec = { - httpMethod: "PATCH", - path: "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventHub/namespaces/{namespaceName}", + requestBody: Parameters.parameters2, + queryParameters: [Parameters.apiVersion], urlParameters: [ + Parameters.$host, + Parameters.subscriptionId, Parameters.resourceGroupName, - Parameters.namespaceName, - Parameters.subscriptionId + Parameters.namespaceName ], - queryParameters: [ - Parameters.apiVersion - ], - headerParameters: [ - Parameters.acceptLanguage - ], - requestBody: { - parameterPath: "parameters", - mapper: { - ...Mappers.EHNamespace, - required: true + headerParameters: [Parameters.accept, Parameters.contentType], + mediaType: "json", + serializer +}; +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 + ], + 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 @@ -783,112 +1267,99 @@ const updateOperationSpec: msRest.OperationSpec = { 201: { bodyMapper: Mappers.EHNamespace }, - 202: {}, default: { bodyMapper: Mappers.ErrorResponse } }, - serializer -}; - -const getMessagingPlanOperationSpec: msRest.OperationSpec = { - httpMethod: "GET", - path: "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventHub/namespaces/{namespaceName}/messagingplan", + queryParameters: [Parameters.apiVersion], urlParameters: [ + Parameters.$host, + Parameters.subscriptionId, Parameters.resourceGroupName, - Parameters.namespaceName, - Parameters.subscriptionId - ], - queryParameters: [ - Parameters.apiVersion - ], - headerParameters: [ - Parameters.acceptLanguage + Parameters.namespaceName ], + headerParameters: [Parameters.accept], + serializer +}; +const updateOperationSpec: coreClient.OperationSpec = { + path: + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventHub/namespaces/{namespaceName}", + httpMethod: "PATCH", responses: { 200: { - bodyMapper: Mappers.MessagingPlan + bodyMapper: Mappers.EHNamespace + }, + 201: { + bodyMapper: Mappers.EHNamespace }, + 202: {}, default: { bodyMapper: Mappers.ErrorResponse } }, - serializer -}; - -const listAuthorizationRulesOperationSpec: msRest.OperationSpec = { - httpMethod: "GET", - path: "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventHub/namespaces/{namespaceName}/AuthorizationRules", + requestBody: Parameters.parameters2, + queryParameters: [Parameters.apiVersion], urlParameters: [ + Parameters.$host, + Parameters.subscriptionId, Parameters.resourceGroupName, - Parameters.namespaceName, - Parameters.subscriptionId - ], - queryParameters: [ - Parameters.apiVersion - ], - headerParameters: [ - Parameters.acceptLanguage + Parameters.namespaceName ], + headerParameters: [Parameters.accept, Parameters.contentType], + mediaType: "json", + serializer +}; +const listVirtualNetworkRulesOperationSpec: coreClient.OperationSpec = { + path: + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventHub/namespaces/{namespaceName}/virtualnetworkrules", + httpMethod: "GET", responses: { 200: { - bodyMapper: Mappers.AuthorizationRuleListResult + bodyMapper: Mappers.VirtualNetworkRuleListResult }, default: { bodyMapper: Mappers.ErrorResponse } }, - serializer -}; - -const createOrUpdateAuthorizationRuleOperationSpec: msRest.OperationSpec = { - httpMethod: "PUT", - path: "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventHub/namespaces/{namespaceName}/AuthorizationRules/{authorizationRuleName}", + queryParameters: [Parameters.apiVersion], urlParameters: [ + Parameters.$host, + Parameters.subscriptionId, Parameters.resourceGroupName, - Parameters.namespaceName, - Parameters.authorizationRuleName, - Parameters.subscriptionId - ], - queryParameters: [ - Parameters.apiVersion + Parameters.namespaceName ], - headerParameters: [ - Parameters.acceptLanguage - ], - requestBody: { - parameterPath: "parameters", - mapper: { - ...Mappers.AuthorizationRule, - required: true - } - }, + headerParameters: [Parameters.accept], + serializer +}; +const createOrUpdateVirtualNetworkRuleOperationSpec: coreClient.OperationSpec = { + path: + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventHub/namespaces/{namespaceName}/virtualnetworkrules/{virtualNetworkRuleName}", + httpMethod: "PUT", responses: { 200: { - bodyMapper: Mappers.AuthorizationRule + bodyMapper: Mappers.VirtualNetworkRule }, default: { bodyMapper: Mappers.ErrorResponse } }, - serializer -}; - -const deleteAuthorizationRuleOperationSpec: msRest.OperationSpec = { - httpMethod: "DELETE", - path: "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventHub/namespaces/{namespaceName}/AuthorizationRules/{authorizationRuleName}", + requestBody: Parameters.parameters3, + queryParameters: [Parameters.apiVersion], urlParameters: [ + Parameters.$host, + Parameters.subscriptionId, Parameters.resourceGroupName, Parameters.namespaceName, - Parameters.authorizationRuleName, - Parameters.subscriptionId - ], - queryParameters: [ - Parameters.apiVersion - ], - headerParameters: [ - Parameters.acceptLanguage + Parameters.virtualNetworkRuleName ], + headerParameters: [Parameters.accept, Parameters.contentType], + mediaType: "json", + serializer +}; +const deleteVirtualNetworkRuleOperationSpec: coreClient.OperationSpec = { + path: + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventHub/namespaces/{namespaceName}/virtualnetworkrules/{virtualNetworkRuleName}", + httpMethod: "DELETE", responses: { 200: {}, 204: {}, @@ -896,222 +1367,270 @@ 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.apiVersion], urlParameters: [ + Parameters.$host, + Parameters.subscriptionId, Parameters.resourceGroupName, Parameters.namespaceName, - Parameters.authorizationRuleName, - Parameters.subscriptionId - ], - queryParameters: [ - Parameters.apiVersion - ], - headerParameters: [ - Parameters.acceptLanguage + Parameters.virtualNetworkRuleName ], + headerParameters: [Parameters.accept], + serializer +}; +const getVirtualNetworkRuleOperationSpec: coreClient.OperationSpec = { + path: + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventHub/namespaces/{namespaceName}/virtualnetworkrules/{virtualNetworkRuleName}", + httpMethod: "GET", responses: { 200: { - bodyMapper: Mappers.AuthorizationRule + bodyMapper: Mappers.VirtualNetworkRule }, default: { 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.apiVersion], urlParameters: [ + Parameters.$host, + Parameters.subscriptionId, Parameters.resourceGroupName, Parameters.namespaceName, - Parameters.authorizationRuleName, - Parameters.subscriptionId - ], - queryParameters: [ - Parameters.apiVersion - ], - headerParameters: [ - Parameters.acceptLanguage + Parameters.virtualNetworkRuleName ], + headerParameters: [Parameters.accept], + serializer +}; +const createOrUpdateNetworkRuleSetOperationSpec: coreClient.OperationSpec = { + path: + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventHub/namespaces/{namespaceName}/networkRuleSets/default", + httpMethod: "PUT", responses: { 200: { - bodyMapper: Mappers.AccessKeys + bodyMapper: Mappers.NetworkRuleSet }, default: { bodyMapper: Mappers.ErrorResponse } }, - serializer -}; - -const regenerateKeysOperationSpec: msRest.OperationSpec = { - httpMethod: "POST", - path: "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventHub/namespaces/{namespaceName}/AuthorizationRules/{authorizationRuleName}/regenerateKeys", + requestBody: Parameters.parameters4, + queryParameters: [Parameters.apiVersion], urlParameters: [ + Parameters.$host, + Parameters.subscriptionId, Parameters.resourceGroupName, - Parameters.namespaceName, - Parameters.authorizationRuleName, - Parameters.subscriptionId - ], - queryParameters: [ - Parameters.apiVersion - ], - headerParameters: [ - Parameters.acceptLanguage + Parameters.namespaceName ], - requestBody: { - parameterPath: "parameters", - mapper: { - ...Mappers.RegenerateAccessKeyParameters, - required: true + headerParameters: [Parameters.accept, Parameters.contentType], + mediaType: "json", + serializer +}; +const getNetworkRuleSetOperationSpec: coreClient.OperationSpec = { + path: + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventHub/namespaces/{namespaceName}/networkRuleSets/default", + httpMethod: "GET", + responses: { + 200: { + bodyMapper: Mappers.NetworkRuleSet + }, + default: { + bodyMapper: Mappers.ErrorResponse } }, + queryParameters: [Parameters.apiVersion], + urlParameters: [ + Parameters.$host, + Parameters.subscriptionId, + Parameters.resourceGroupName, + Parameters.namespaceName + ], + headerParameters: [Parameters.accept], + serializer +}; +const listAuthorizationRulesOperationSpec: coreClient.OperationSpec = { + path: + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventHub/namespaces/{namespaceName}/authorizationRules", + httpMethod: "GET", responses: { 200: { - bodyMapper: Mappers.AccessKeys + bodyMapper: Mappers.AuthorizationRuleListResult }, default: { bodyMapper: Mappers.ErrorResponse } }, + queryParameters: [Parameters.apiVersion], + urlParameters: [ + Parameters.$host, + Parameters.subscriptionId, + Parameters.resourceGroupName, + Parameters.namespaceName + ], + headerParameters: [Parameters.accept], serializer }; - -const createOrUpdateNetworkRuleSetOperationSpec: msRest.OperationSpec = { +const createOrUpdateAuthorizationRuleOperationSpec: coreClient.OperationSpec = { + path: + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventHub/namespaces/{namespaceName}/authorizationRules/{authorizationRuleName}", httpMethod: "PUT", - path: "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventHub/namespaces/{namespaceName}/networkRuleSets/default", + responses: { + 200: { + bodyMapper: Mappers.AuthorizationRule + }, + default: { + bodyMapper: Mappers.ErrorResponse + } + }, + requestBody: Parameters.parameters5, + queryParameters: [Parameters.apiVersion], urlParameters: [ + Parameters.$host, + Parameters.subscriptionId, Parameters.resourceGroupName, Parameters.namespaceName, - Parameters.subscriptionId - ], - queryParameters: [ - Parameters.apiVersion - ], - headerParameters: [ - Parameters.acceptLanguage + Parameters.authorizationRuleName ], - requestBody: { - parameterPath: "parameters", - mapper: { - ...Mappers.NetworkRuleSet, - required: true + 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: {}, + default: { + bodyMapper: Mappers.ErrorResponse } }, + queryParameters: [Parameters.apiVersion], + urlParameters: [ + Parameters.$host, + Parameters.subscriptionId, + Parameters.resourceGroupName, + Parameters.namespaceName, + 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.NetworkRuleSet + bodyMapper: Mappers.AuthorizationRule }, default: { bodyMapper: Mappers.ErrorResponse } }, - serializer -}; - -const getNetworkRuleSetOperationSpec: msRest.OperationSpec = { - httpMethod: "GET", - path: "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventHub/namespaces/{namespaceName}/networkRuleSets/default", + queryParameters: [Parameters.apiVersion], urlParameters: [ + Parameters.$host, + Parameters.subscriptionId, Parameters.resourceGroupName, Parameters.namespaceName, - Parameters.subscriptionId - ], - queryParameters: [ - Parameters.apiVersion - ], - 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.NetworkRuleSet + bodyMapper: Mappers.AccessKeys }, default: { bodyMapper: Mappers.ErrorResponse } }, - serializer -}; - -const beginCreateOrUpdateOperationSpec: msRest.OperationSpec = { - httpMethod: "PUT", - path: "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventHub/namespaces/{namespaceName}", + queryParameters: [Parameters.apiVersion], urlParameters: [ + Parameters.$host, + Parameters.subscriptionId, Parameters.resourceGroupName, Parameters.namespaceName, - Parameters.subscriptionId - ], - queryParameters: [ - Parameters.apiVersion - ], - headerParameters: [ - Parameters.acceptLanguage + Parameters.authorizationRuleName ], - requestBody: { - parameterPath: "parameters", - mapper: { - ...Mappers.EHNamespace, - required: true - } - }, + headerParameters: [Parameters.accept], + serializer +}; +const regenerateKeysOperationSpec: coreClient.OperationSpec = { + path: + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventHub/namespaces/{namespaceName}/authorizationRules/{authorizationRuleName}/regenerateKeys", + httpMethod: "POST", responses: { 200: { - bodyMapper: Mappers.EHNamespace - }, - 201: { - bodyMapper: Mappers.EHNamespace + bodyMapper: Mappers.AccessKeys }, - 202: {}, default: { bodyMapper: Mappers.ErrorResponse } }, - serializer -}; - -const beginDeleteMethodOperationSpec: msRest.OperationSpec = { - httpMethod: "DELETE", - path: "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventHub/namespaces/{namespaceName}", + requestBody: Parameters.parameters6, + queryParameters: [Parameters.apiVersion], urlParameters: [ + Parameters.$host, + Parameters.subscriptionId, Parameters.resourceGroupName, Parameters.namespaceName, - Parameters.subscriptionId - ], - queryParameters: [ - Parameters.apiVersion - ], - headerParameters: [ - Parameters.acceptLanguage + Parameters.authorizationRuleName ], + headerParameters: [Parameters.accept, Parameters.contentType], + mediaType: "json", + serializer +}; +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.parameters7, + queryParameters: [Parameters.apiVersion], + 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 listIPFilterRulesNextOperationSpec: coreClient.OperationSpec = { path: "{nextLink}", + httpMethod: "GET", + responses: { + 200: { + bodyMapper: Mappers.IpFilterRuleListResult + }, + default: { + bodyMapper: Mappers.ErrorResponse + } + }, + queryParameters: [Parameters.apiVersion], urlParameters: [ - Parameters.nextPageLink - ], - headerParameters: [ - Parameters.acceptLanguage + Parameters.$host, + Parameters.subscriptionId, + Parameters.resourceGroupName, + Parameters.nextLink, + Parameters.namespaceName ], + headerParameters: [Parameters.accept], + serializer +}; +const listNextOperationSpec: coreClient.OperationSpec = { + path: "{nextLink}", + httpMethod: "GET", responses: { 200: { bodyMapper: Mappers.EHNamespaceListResult @@ -1120,19 +1639,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 @@ -1141,19 +1659,41 @@ 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 listVirtualNetworkRulesNextOperationSpec: coreClient.OperationSpec = { path: "{nextLink}", + httpMethod: "GET", + responses: { + 200: { + bodyMapper: Mappers.VirtualNetworkRuleListResult + }, + default: { + bodyMapper: Mappers.ErrorResponse + } + }, + queryParameters: [Parameters.apiVersion], urlParameters: [ - Parameters.nextPageLink - ], - headerParameters: [ - Parameters.acceptLanguage + Parameters.$host, + Parameters.subscriptionId, + Parameters.resourceGroupName, + Parameters.nextLink, + Parameters.namespaceName ], + headerParameters: [Parameters.accept], + serializer +}; +const listAuthorizationRulesNextOperationSpec: coreClient.OperationSpec = { + path: "{nextLink}", + httpMethod: "GET", responses: { 200: { bodyMapper: Mappers.AuthorizationRuleListResult @@ -1162,5 +1702,14 @@ const listAuthorizationRulesNextOperationSpec: 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/src/operations/operations.ts b/sdk/eventhub/arm-eventhub/src/operations/operations.ts index 6597c772dd23..9d148737170d 100644 --- a/sdk/eventhub/arm-eventhub/src/operations/operations.ts +++ b/sdk/eventhub/arm-eventhub/src/operations/operations.ts @@ -1,26 +1,34 @@ /* - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for - * license information. + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. * * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is - * regenerated. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. */ -import * as msRest from "@azure/ms-rest-js"; -import * as Models from "../models"; -import * as Mappers from "../models/operationsMappers"; +import "@azure/core-paging"; +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 { + Operation, + OperationsListNextOptionalParams, + OperationsListOptionalParams, + OperationsListResponse, + OperationsListNextResponse +} from "../models"; -/** Class representing a Operations. */ -export class Operations { +/// +/** Class containing Operations operations. */ +export class OperationsImpl implements Operations { private readonly client: EventHubManagementClientContext; /** - * 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) { this.client = client; @@ -28,68 +36,77 @@ export class Operations { /** * 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.apiVersion - ], - headerParameters: [ - Parameters.acceptLanguage - ], responses: { 200: { bodyMapper: Mappers.OperationListResult @@ -98,19 +115,14 @@ const listOperationSpec: msRest.OperationSpec = { bodyMapper: Mappers.ErrorResponse } }, + queryParameters: [Parameters.apiVersion], + urlParameters: [Parameters.$host], + headerParameters: [Parameters.accept], serializer }; - -const listNextOperationSpec: msRest.OperationSpec = { - httpMethod: "GET", - baseUrl: "https://management.azure.com", +const listNextOperationSpec: coreClient.OperationSpec = { path: "{nextLink}", - urlParameters: [ - Parameters.nextPageLink - ], - headerParameters: [ - Parameters.acceptLanguage - ], + httpMethod: "GET", responses: { 200: { bodyMapper: Mappers.OperationListResult @@ -119,5 +131,8 @@ const listNextOperationSpec: msRest.OperationSpec = { bodyMapper: Mappers.ErrorResponse } }, + queryParameters: [Parameters.apiVersion], + urlParameters: [Parameters.$host, Parameters.nextLink], + headerParameters: [Parameters.accept], serializer }; diff --git a/sdk/eventhub/arm-eventhub/src/operations/privateEndpointConnections.ts b/sdk/eventhub/arm-eventhub/src/operations/privateEndpointConnections.ts new file mode 100644 index 000000000000..3cfb78374e85 --- /dev/null +++ b/sdk/eventhub/arm-eventhub/src/operations/privateEndpointConnections.ts @@ -0,0 +1,405 @@ +/* + * 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 "@azure/core-paging"; +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 { 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 containing PrivateEndpointConnections operations. */ +export class PrivateEndpointConnectionsImpl + implements PrivateEndpointConnections { + private readonly client: EventHubManagementClientContext; + + /** + * Initialize a new instance of the class PrivateEndpointConnections class. + * @param client Reference to the service client + */ + constructor(client: EventHubManagementClientContext) { + this.client = client; + } + + /** + * 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. + */ + 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 + ); + 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; + } + } + + /** + * 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. + */ + 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 options parameters. + */ + createOrUpdate( + resourceGroupName: string, + namespaceName: string, + privateEndpointConnectionName: string, + parameters: PrivateEndpointConnection, + options?: PrivateEndpointConnectionsCreateOrUpdateOptionalParams + ): Promise { + return this.client.sendOperationRequest( + { + resourceGroupName, + namespaceName, + privateEndpointConnectionName, + parameters, + options + }, + createOrUpdateOperationSpec + ); + } + + /** + * 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. + */ + 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() + } + }; + }; + + const lro = new LroImpl( + sendOperation, + { + resourceGroupName, + namespaceName, + privateEndpointConnectionName, + options + }, + deleteOperationSpec + ); + return new LroEngine(lro, { + resumeFrom: options?.resumeFrom, + intervalInMs: options?.updateIntervalInMs + }); + } + + /** + * Deletes an existing namespace. This operation also removes all associated resources under the + * namespace. + * @param resourceGroupName Name of the resource group within the azure subscription. + * @param namespaceName The Namespace name + * @param privateEndpointConnectionName The PrivateEndpointConnection name + * @param options The options parameters. + */ + 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 + }, + getOperationSpec + ); + } + + /** + * 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. + */ + private _listNext( + resourceGroupName: string, + namespaceName: string, + nextLink: string, + options?: PrivateEndpointConnectionsListNextOptionalParams + ): Promise { + return this.client.sendOperationRequest( + { resourceGroupName, namespaceName, nextLink, options }, + listNextOperationSpec + ); + } +} +// Operation Specifications +const serializer = coreClient.createSerializer(Mappers, /* isXml */ false); + +const listOperationSpec: coreClient.OperationSpec = { + path: + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventHub/namespaces/{namespaceName}/privateEndpointConnections", + httpMethod: "GET", + responses: { + 200: { + bodyMapper: Mappers.PrivateEndpointConnectionListResult + }, + default: { + bodyMapper: Mappers.ErrorResponse + } + }, + queryParameters: [Parameters.apiVersion], + urlParameters: [ + Parameters.$host, + Parameters.subscriptionId, + Parameters.resourceGroupName, + Parameters.namespaceName + ], + 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 + }, + 201: { + bodyMapper: Mappers.PrivateEndpointConnection + }, + default: { + bodyMapper: Mappers.ErrorResponse + } + }, + requestBody: Parameters.parameters8, + queryParameters: [Parameters.apiVersion], + urlParameters: [ + Parameters.$host, + Parameters.subscriptionId, + Parameters.resourceGroupName, + Parameters.namespaceName, + 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: {}, + 201: {}, + 202: {}, + 204: {}, + default: { + bodyMapper: Mappers.ErrorResponse + } + }, + queryParameters: [Parameters.apiVersion], + urlParameters: [ + Parameters.$host, + Parameters.subscriptionId, + Parameters.resourceGroupName, + Parameters.namespaceName, + Parameters.privateEndpointConnectionName + ], + headerParameters: [Parameters.accept], + serializer +}; +const getOperationSpec: coreClient.OperationSpec = { + path: + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventHub/namespaces/{namespaceName}/privateEndpointConnections/{privateEndpointConnectionName}", + httpMethod: "GET", + responses: { + 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: coreClient.OperationSpec = { + path: "{nextLink}", + httpMethod: "GET", + responses: { + 200: { + bodyMapper: Mappers.PrivateEndpointConnectionListResult + }, + default: { + 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/src/operations/privateLinkResources.ts b/sdk/eventhub/arm-eventhub/src/operations/privateLinkResources.ts new file mode 100644 index 000000000000..aee952f2856c --- /dev/null +++ b/sdk/eventhub/arm-eventhub/src/operations/privateLinkResources.ts @@ -0,0 +1,72 @@ +/* + * 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 { 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 { + PrivateLinkResourcesGetOptionalParams, + PrivateLinkResourcesGetResponse +} from "../models"; + +/** Class containing PrivateLinkResources operations. */ +export class PrivateLinkResourcesImpl implements PrivateLinkResources { + private readonly client: EventHubManagementClientContext; + + /** + * Initialize a new instance of the class PrivateLinkResources class. + * @param client Reference to the service client + */ + constructor(client: EventHubManagementClientContext) { + this.client = client; + } + + /** + * 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 { + return this.client.sendOperationRequest( + { resourceGroupName, namespaceName, options }, + getOperationSpec + ); + } +} +// Operation Specifications +const serializer = coreClient.createSerializer(Mappers, /* isXml */ false); + +const getOperationSpec: coreClient.OperationSpec = { + path: + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventHub/namespaces/{namespaceName}/privateLinkResources", + httpMethod: "GET", + responses: { + 200: { + bodyMapper: Mappers.PrivateLinkResourcesListResult + }, + default: { + 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/src/operations/regions.ts b/sdk/eventhub/arm-eventhub/src/operations/regions.ts index ef0fb7026bd9..91caf392b4b9 100644 --- a/sdk/eventhub/arm-eventhub/src/operations/regions.ts +++ b/sdk/eventhub/arm-eventhub/src/operations/regions.ts @@ -1,26 +1,34 @@ /* - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for - * license information. + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. * * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is - * regenerated. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. */ -import * as msRest from "@azure/ms-rest-js"; -import * as Models from "../models"; -import * as Mappers from "../models/regionsMappers"; +import "@azure/core-paging"; +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 { + MessagingRegions, + RegionsListBySkuNextOptionalParams, + RegionsListBySkuOptionalParams, + RegionsListBySkuResponse, + RegionsListBySkuNextResponse +} from "../models"; -/** Class representing a Regions. */ -export class Regions { +/// +/** Class containing Regions operations. */ +export class RegionsImpl implements Regions { private readonly client: EventHubManagementClientContext; /** - * 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) { this.client = client; @@ -29,75 +37,88 @@ export class Regions { /** * 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.apiVersion - ], - headerParameters: [ - Parameters.acceptLanguage - ], responses: { 200: { bodyMapper: Mappers.MessagingRegionsListResult @@ -106,19 +127,14 @@ const listBySkuOperationSpec: msRest.OperationSpec = { bodyMapper: Mappers.ErrorResponse } }, + queryParameters: [Parameters.apiVersion], + 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 +143,13 @@ const listBySkuNextOperationSpec: msRest.OperationSpec = { bodyMapper: Mappers.ErrorResponse } }, + queryParameters: [Parameters.apiVersion], + urlParameters: [ + Parameters.$host, + Parameters.subscriptionId, + Parameters.nextLink, + Parameters.sku + ], + headerParameters: [Parameters.accept], serializer }; diff --git a/sdk/eventhub/arm-eventhub/src/operationsInterfaces/clusters.ts b/sdk/eventhub/arm-eventhub/src/operationsInterfaces/clusters.ts new file mode 100644 index 000000000000..b4ac499a9e7c --- /dev/null +++ b/sdk/eventhub/arm-eventhub/src/operationsInterfaces/clusters.ts @@ -0,0 +1,153 @@ +/* + * 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 "@azure/core-paging"; +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/src/operationsInterfaces/configuration.ts b/sdk/eventhub/arm-eventhub/src/operationsInterfaces/configuration.ts new file mode 100644 index 000000000000..024da8b7a85d --- /dev/null +++ b/sdk/eventhub/arm-eventhub/src/operationsInterfaces/configuration.ts @@ -0,0 +1,45 @@ +/* + * 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 { + ClusterQuotaConfigurationProperties, + ConfigurationPatchOptionalParams, + ConfigurationPatchResponse, + ConfigurationGetOptionalParams, + ConfigurationGetResponse +} from "../models"; + +/** Interface representing a Configuration. */ +export interface Configuration { + /** + * Replace all specified Event Hubs Cluster settings with those contained in the request body. Leaves + * the settings not specified in the request body unmodified. + * @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 an Event Hubs Cluster resource. + * @param options The options parameters. + */ + patch( + resourceGroupName: string, + clusterName: string, + parameters: ClusterQuotaConfigurationProperties, + options?: ConfigurationPatchOptionalParams + ): Promise; + /** + * Get all Event Hubs Cluster settings - a collection of key/value pairs which represent the quotas and + * settings imposed on the 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?: ConfigurationGetOptionalParams + ): Promise; +} diff --git a/sdk/eventhub/arm-eventhub/src/operationsInterfaces/consumerGroups.ts b/sdk/eventhub/arm-eventhub/src/operationsInterfaces/consumerGroups.ts new file mode 100644 index 000000000000..82b70a2043ff --- /dev/null +++ b/sdk/eventhub/arm-eventhub/src/operationsInterfaces/consumerGroups.ts @@ -0,0 +1,85 @@ +/* + * 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 "@azure/core-paging"; +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/src/operationsInterfaces/disasterRecoveryConfigs.ts b/sdk/eventhub/arm-eventhub/src/operationsInterfaces/disasterRecoveryConfigs.ts new file mode 100644 index 000000000000..4c770fd1e4c6 --- /dev/null +++ b/sdk/eventhub/arm-eventhub/src/operationsInterfaces/disasterRecoveryConfigs.ts @@ -0,0 +1,170 @@ +/* + * 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 "@azure/core-paging"; +import { PagedAsyncIterableIterator } from "@azure/core-paging"; +import { + AuthorizationRule, + DisasterRecoveryConfigsListAuthorizationRulesOptionalParams, + ArmDisasterRecovery, + DisasterRecoveryConfigsListOptionalParams, + DisasterRecoveryConfigsGetAuthorizationRuleOptionalParams, + DisasterRecoveryConfigsGetAuthorizationRuleResponse, + DisasterRecoveryConfigsListKeysOptionalParams, + DisasterRecoveryConfigsListKeysResponse, + CheckNameAvailabilityParameter, + DisasterRecoveryConfigsCheckNameAvailabilityOptionalParams, + DisasterRecoveryConfigsCheckNameAvailabilityResponse, + DisasterRecoveryConfigsCreateOrUpdateOptionalParams, + DisasterRecoveryConfigsCreateOrUpdateResponse, + DisasterRecoveryConfigsDeleteOptionalParams, + DisasterRecoveryConfigsGetOptionalParams, + DisasterRecoveryConfigsGetResponse, + DisasterRecoveryConfigsBreakPairingOptionalParams, + DisasterRecoveryConfigsFailOverOptionalParams +} 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 all Alias(Disaster Recovery configurations) + * @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?: DisasterRecoveryConfigsListOptionalParams + ): 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; + /** + * Check the give Namespace name availability. + * @param resourceGroupName Name of the resource group within the azure subscription. + * @param namespaceName The Namespace name + * @param parameters Parameters to check availability of the given Alias name + * @param options The options parameters. + */ + checkNameAvailability( + resourceGroupName: string, + namespaceName: string, + parameters: CheckNameAvailabilityParameter, + options?: DisasterRecoveryConfigsCheckNameAvailabilityOptionalParams + ): Promise; + /** + * Creates or updates a new Alias(Disaster Recovery configuration) + * @param resourceGroupName Name of the resource group within the azure subscription. + * @param namespaceName The Namespace name + * @param alias The Disaster Recovery configuration name + * @param parameters Parameters required to create an Alias(Disaster Recovery configuration) + * @param options The options parameters. + */ + createOrUpdate( + resourceGroupName: string, + namespaceName: string, + alias: string, + parameters: ArmDisasterRecovery, + options?: DisasterRecoveryConfigsCreateOrUpdateOptionalParams + ): Promise; + /** + * Deletes an Alias(Disaster Recovery configuration) + * @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. + */ + delete( + resourceGroupName: string, + namespaceName: string, + alias: string, + options?: DisasterRecoveryConfigsDeleteOptionalParams + ): Promise; + /** + * Retrieves Alias(Disaster Recovery configuration) for primary or secondary 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. + */ + get( + resourceGroupName: string, + namespaceName: string, + alias: string, + options?: DisasterRecoveryConfigsGetOptionalParams + ): Promise; + /** + * This operation disables the Disaster Recovery and stops replicating changes from primary to + * secondary namespaces + * @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. + */ + breakPairing( + resourceGroupName: string, + namespaceName: string, + alias: string, + options?: DisasterRecoveryConfigsBreakPairingOptionalParams + ): Promise; + /** + * Invokes GEO DR failover and reconfigure the alias to point to the secondary 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. + */ + failOver( + resourceGroupName: string, + namespaceName: string, + alias: string, + options?: DisasterRecoveryConfigsFailOverOptionalParams + ): Promise; +} diff --git a/sdk/eventhub/arm-eventhub/src/operationsInterfaces/eventHubs.ts b/sdk/eventhub/arm-eventhub/src/operationsInterfaces/eventHubs.ts new file mode 100644 index 000000000000..03347dd71ae4 --- /dev/null +++ b/sdk/eventhub/arm-eventhub/src/operationsInterfaces/eventHubs.ts @@ -0,0 +1,182 @@ +/* + * 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 "@azure/core-paging"; +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/src/operationsInterfaces/index.ts b/sdk/eventhub/arm-eventhub/src/operationsInterfaces/index.ts new file mode 100644 index 000000000000..81bf8f142252 --- /dev/null +++ b/sdk/eventhub/arm-eventhub/src/operationsInterfaces/index.ts @@ -0,0 +1,18 @@ +/* + * 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 "./configuration"; +export * from "./disasterRecoveryConfigs"; +export * from "./eventHubs"; +export * from "./consumerGroups"; +export * from "./operations"; +export * from "./regions"; diff --git a/sdk/eventhub/arm-eventhub/src/operationsInterfaces/namespaces.ts b/sdk/eventhub/arm-eventhub/src/operationsInterfaces/namespaces.ts new file mode 100644 index 000000000000..d235b46eadb6 --- /dev/null +++ b/sdk/eventhub/arm-eventhub/src/operationsInterfaces/namespaces.ts @@ -0,0 +1,377 @@ +/* + * 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 "@azure/core-paging"; +import { PagedAsyncIterableIterator } from "@azure/core-paging"; +import { PollerLike, PollOperationState } from "@azure/core-lro"; +import { + IpFilterRule, + NamespacesListIPFilterRulesOptionalParams, + EHNamespace, + NamespacesListOptionalParams, + NamespacesListByResourceGroupOptionalParams, + VirtualNetworkRule, + NamespacesListVirtualNetworkRulesOptionalParams, + AuthorizationRule, + NamespacesListAuthorizationRulesOptionalParams, + NamespacesCreateOrUpdateIpFilterRuleOptionalParams, + NamespacesCreateOrUpdateIpFilterRuleResponse, + NamespacesDeleteIpFilterRuleOptionalParams, + NamespacesGetIpFilterRuleOptionalParams, + NamespacesGetIpFilterRuleResponse, + NamespacesCreateOrUpdateOptionalParams, + NamespacesCreateOrUpdateResponse, + NamespacesDeleteOptionalParams, + NamespacesGetOptionalParams, + NamespacesGetResponse, + NamespacesUpdateOptionalParams, + NamespacesUpdateResponse, + NamespacesCreateOrUpdateVirtualNetworkRuleOptionalParams, + NamespacesCreateOrUpdateVirtualNetworkRuleResponse, + NamespacesDeleteVirtualNetworkRuleOptionalParams, + NamespacesGetVirtualNetworkRuleOptionalParams, + NamespacesGetVirtualNetworkRuleResponse, + NetworkRuleSet, + NamespacesCreateOrUpdateNetworkRuleSetOptionalParams, + NamespacesCreateOrUpdateNetworkRuleSetResponse, + NamespacesGetNetworkRuleSetOptionalParams, + NamespacesGetNetworkRuleSetResponse, + NamespacesCreateOrUpdateAuthorizationRuleOptionalParams, + NamespacesCreateOrUpdateAuthorizationRuleResponse, + NamespacesDeleteAuthorizationRuleOptionalParams, + NamespacesGetAuthorizationRuleOptionalParams, + NamespacesGetAuthorizationRuleResponse, + NamespacesListKeysOptionalParams, + NamespacesListKeysResponse, + RegenerateAccessKeyParameters, + NamespacesRegenerateKeysOptionalParams, + NamespacesRegenerateKeysResponse, + CheckNameAvailabilityParameter, + NamespacesCheckNameAvailabilityOptionalParams, + NamespacesCheckNameAvailabilityResponse +} from "../models"; + +/// +/** Interface representing a Namespaces. */ +export interface Namespaces { + /** + * Gets a list of IP Filter 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. + */ + listIPFilterRules( + resourceGroupName: string, + namespaceName: string, + options?: NamespacesListIPFilterRulesOptionalParams + ): PagedAsyncIterableIterator; + /** + * 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 VirtualNetwork 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. + */ + listVirtualNetworkRules( + resourceGroupName: string, + namespaceName: string, + options?: NamespacesListVirtualNetworkRulesOptionalParams + ): 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 an IpFilterRule for a Namespace. + * @param resourceGroupName Name of the resource group within the azure subscription. + * @param namespaceName The Namespace name + * @param ipFilterRuleName The IP Filter Rule name. + * @param parameters The Namespace IpFilterRule. + * @param options The options parameters. + */ + createOrUpdateIpFilterRule( + resourceGroupName: string, + namespaceName: string, + ipFilterRuleName: string, + parameters: IpFilterRule, + options?: NamespacesCreateOrUpdateIpFilterRuleOptionalParams + ): Promise; + /** + * Deletes an IpFilterRule for a Namespace. + * @param resourceGroupName Name of the resource group within the azure subscription. + * @param namespaceName The Namespace name + * @param ipFilterRuleName The IP Filter Rule name. + * @param options The options parameters. + */ + deleteIpFilterRule( + resourceGroupName: string, + namespaceName: string, + ipFilterRuleName: string, + options?: NamespacesDeleteIpFilterRuleOptionalParams + ): Promise; + /** + * Gets an IpFilterRule for a Namespace by rule name. + * @param resourceGroupName Name of the resource group within the azure subscription. + * @param namespaceName The Namespace name + * @param ipFilterRuleName The IP Filter Rule name. + * @param options The options parameters. + */ + getIpFilterRule( + resourceGroupName: string, + namespaceName: string, + ipFilterRuleName: string, + options?: NamespacesGetIpFilterRuleOptionalParams + ): 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 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 VirtualNetworkRule for a Namespace. + * @param resourceGroupName Name of the resource group within the azure subscription. + * @param namespaceName The Namespace name + * @param virtualNetworkRuleName The Virtual Network Rule name. + * @param parameters The Namespace VirtualNetworkRule. + * @param options The options parameters. + */ + createOrUpdateVirtualNetworkRule( + resourceGroupName: string, + namespaceName: string, + virtualNetworkRuleName: string, + parameters: VirtualNetworkRule, + options?: NamespacesCreateOrUpdateVirtualNetworkRuleOptionalParams + ): Promise; + /** + * Deletes an VirtualNetworkRule for a Namespace. + * @param resourceGroupName Name of the resource group within the azure subscription. + * @param namespaceName The Namespace name + * @param virtualNetworkRuleName The Virtual Network Rule name. + * @param options The options parameters. + */ + deleteVirtualNetworkRule( + resourceGroupName: string, + namespaceName: string, + virtualNetworkRuleName: string, + options?: NamespacesDeleteVirtualNetworkRuleOptionalParams + ): Promise; + /** + * Gets an VirtualNetworkRule for a Namespace by rule name. + * @param resourceGroupName Name of the resource group within the azure subscription. + * @param namespaceName The Namespace name + * @param virtualNetworkRuleName The Virtual Network Rule name. + * @param options The options parameters. + */ + getVirtualNetworkRule( + resourceGroupName: string, + namespaceName: string, + virtualNetworkRuleName: string, + options?: NamespacesGetVirtualNetworkRuleOptionalParams + ): Promise; + /** + * Create or update NetworkRuleSet for a Namespace. + * @param resourceGroupName Name of the resource group within the azure subscription. + * @param namespaceName The Namespace name + * @param parameters The Namespace IpFilterRule. + * @param options The options parameters. + */ + createOrUpdateNetworkRuleSet( + resourceGroupName: string, + namespaceName: string, + parameters: NetworkRuleSet, + options?: NamespacesCreateOrUpdateNetworkRuleSetOptionalParams + ): Promise; + /** + * Gets NetworkRuleSet for a Namespace. + * @param resourceGroupName Name of the resource group within the azure subscription. + * @param namespaceName The Namespace name + * @param options The options parameters. + */ + getNetworkRuleSet( + resourceGroupName: string, + namespaceName: string, + options?: NamespacesGetNetworkRuleSetOptionalParams + ): 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/src/operationsInterfaces/operations.ts b/sdk/eventhub/arm-eventhub/src/operationsInterfaces/operations.ts new file mode 100644 index 000000000000..4fe027d7d2f3 --- /dev/null +++ b/sdk/eventhub/arm-eventhub/src/operationsInterfaces/operations.ts @@ -0,0 +1,23 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +import "@azure/core-paging"; +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/src/operationsInterfaces/privateEndpointConnections.ts b/sdk/eventhub/arm-eventhub/src/operationsInterfaces/privateEndpointConnections.ts new file mode 100644 index 000000000000..163221fbccde --- /dev/null +++ b/sdk/eventhub/arm-eventhub/src/operationsInterfaces/privateEndpointConnections.ts @@ -0,0 +1,93 @@ +/* + * 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 "@azure/core-paging"; +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/src/operationsInterfaces/privateLinkResources.ts b/sdk/eventhub/arm-eventhub/src/operationsInterfaces/privateLinkResources.ts new file mode 100644 index 000000000000..b1092fad65fb --- /dev/null +++ b/sdk/eventhub/arm-eventhub/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/src/operationsInterfaces/regions.ts b/sdk/eventhub/arm-eventhub/src/operationsInterfaces/regions.ts new file mode 100644 index 000000000000..760020bd1d62 --- /dev/null +++ b/sdk/eventhub/arm-eventhub/src/operationsInterfaces/regions.ts @@ -0,0 +1,25 @@ +/* + * 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 "@azure/core-paging"; +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/tsconfig.json b/sdk/eventhub/arm-eventhub/tsconfig.json index 87bbf5b5fa49..603440b3a359 100644 --- a/sdk/eventhub/arm-eventhub/tsconfig.json +++ b/sdk/eventhub/arm-eventhub/tsconfig.json @@ -3,15 +3,15 @@ "module": "es6", "moduleResolution": "node", "strict": true, - "target": "es5", + "target": "es6", "sourceMap": true, "declarationMap": true, "esModuleInterop": true, "allowSyntheticDefaultImports": true, "forceConsistentCasingInFileNames": true, - "lib": ["es6"], + "lib": ["es6", "dom"], "declaration": true, - "outDir": "./esm", + "outDir": "./dist-esm", "importHelpers": true }, "include": ["./src/**/*.ts"], diff --git a/sdk/eventhub/ci.yml b/sdk/eventhub/ci.yml index a69b21231e96..6ec10b06521b 100644 --- a/sdk/eventhub/ci.yml +++ b/sdk/eventhub/ci.yml @@ -1,5 +1,4 @@ # NOTE: Please refer to https://aka.ms/azsdk/engsys/ci-yaml before editing this file. - trigger: branches: include: @@ -9,7 +8,6 @@ trigger: paths: include: - sdk/eventhub/ - pr: branches: include: @@ -17,10 +15,11 @@ pr: - feature/* - release/* - hotfix/* + exclude: + - feature/v4 paths: include: - sdk/eventhub/ - extends: template: ../../eng/pipelines/templates/stages/archetype-sdk-client.yml parameters: @@ -35,4 +34,5 @@ extends: safename: azureeventprocessorhost - name: azure-eventhubs-checkpointstore-table safeName: azureeventhubscheckpointstoretable - + - name: azure-arm-eventhub + safeName: azurearmeventhub