diff --git a/sdk/eventhub/arm-eventhub/LICENSE.txt b/sdk/eventhub/arm-eventhub/LICENSE.txt index b73b4a1293c3..ea8fb1516028 100644 --- a/sdk/eventhub/arm-eventhub/LICENSE.txt +++ b/sdk/eventhub/arm-eventhub/LICENSE.txt @@ -1,6 +1,6 @@ The MIT License (MIT) -Copyright (c) 2019 Microsoft +Copyright (c) 2020 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 diff --git a/sdk/eventhub/arm-eventhub/README.md b/sdk/eventhub/arm-eventhub/README.md index fe5d41679544..0c0f82e56ed0 100644 --- a/sdk/eventhub/arm-eventhub/README.md +++ b/sdk/eventhub/arm-eventhub/README.md @@ -19,8 +19,9 @@ npm install @azure/arm-eventhub ##### Install @azure/ms-rest-nodeauth +- Please install minimum version of `"@azure/ms-rest-nodeauth": "^3.0.0"`. ```bash -npm install @azure/ms-rest-nodeauth +npm install @azure/ms-rest-nodeauth@"^3.0.0" ``` ##### Sample code @@ -95,5 +96,4 @@ See https://github.com/Azure/ms-rest-browserauth to learn how to authenticate to - [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) diff --git a/sdk/eventhub/arm-eventhub/package.json b/sdk/eventhub/arm-eventhub/package.json index ae01a90bb580..5c190d6c8c20 100644 --- a/sdk/eventhub/arm-eventhub/package.json +++ b/sdk/eventhub/arm-eventhub/package.json @@ -4,9 +4,9 @@ "description": "EventHubManagementClient Library with typescript type definitions for node.js and browser.", "version": "3.2.0", "dependencies": { - "@azure/ms-rest-azure-js": "^1.3.2", - "@azure/ms-rest-js": "^1.8.1", - "tslib": "^1.9.3" + "@azure/ms-rest-azure-js": "^2.0.1", + "@azure/ms-rest-js": "^2.0.4", + "tslib": "^1.10.0" }, "keywords": [ "node", @@ -20,19 +20,19 @@ "module": "./esm/eventHubManagementClient.js", "types": "./esm/eventHubManagementClient.d.ts", "devDependencies": { - "typescript": "^3.1.1", - "rollup": "^0.66.2", - "rollup-plugin-node-resolve": "^3.4.0", + "typescript": "^3.5.3", + "rollup": "^1.18.0", + "rollup-plugin-node-resolve": "^5.2.0", "rollup-plugin-sourcemaps": "^0.4.2", - "uglify-js": "^3.4.9" + "uglify-js": "^3.6.0" }, - "homepage": "https://github.com/azure/azure-sdk-for-js/tree/master/sdk/eventhub/arm-eventhub", + "homepage": "https://github.com/Azure/azure-sdk-for-js/tree/master/sdk/eventhub/arm-eventhub", "repository": { "type": "git", - "url": "https://github.com/azure/azure-sdk-for-js.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/issues" }, "files": [ "dist/**/*.js", diff --git a/sdk/eventhub/arm-eventhub/rollup.config.js b/sdk/eventhub/arm-eventhub/rollup.config.js index bede107e529e..88ae3daf1473 100644 --- a/sdk/eventhub/arm-eventhub/rollup.config.js +++ b/sdk/eventhub/arm-eventhub/rollup.config.js @@ -29,7 +29,7 @@ const config = { */` }, plugins: [ - nodeResolve({ module: true }), + nodeResolve({ mainFields: ['module', 'main'] }), sourcemaps() ] }; diff --git a/sdk/eventhub/arm-eventhub/src/models/index.ts b/sdk/eventhub/arm-eventhub/src/models/index.ts index c8d10779d2b4..df621ee75677 100644 --- a/sdk/eventhub/arm-eventhub/src/models/index.ts +++ b/sdk/eventhub/arm-eventhub/src/models/index.ts @@ -595,6 +595,19 @@ export interface AuthorizationRuleListResult extends Array { nextLink?: string; } +/** + * @interface + * The response of the List NetworkRuleSet operation + * @extends Array + */ +export interface NetworkRuleSetListResult extends Array { + /** + * Link to the next set of results. Not empty if Value contains incomplete list of + * NetworkRuleSet. + */ + nextLink?: string; +} + /** * @interface * The result of the List Alias(Disaster Recovery configuration) operation. @@ -1057,6 +1070,26 @@ export type NamespacesGetNetworkRuleSetResponse = NetworkRuleSet & { }; }; +/** + * Contains response data for the listNetworkRuleSets operation. + */ +export type NamespacesListNetworkRuleSetsResponse = NetworkRuleSetListResult & { + /** + * 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: NetworkRuleSetListResult; + }; +}; + /** * Contains response data for the beginCreateOrUpdate operation. */ @@ -1137,6 +1170,26 @@ export type NamespacesListAuthorizationRulesNextResponse = AuthorizationRuleList }; }; +/** + * Contains response data for the listNetworkRuleSetsNext operation. + */ +export type NamespacesListNetworkRuleSetsNextResponse = NetworkRuleSetListResult & { + /** + * 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: NetworkRuleSetListResult; + }; +}; + /** * Contains response data for the checkNameAvailability operation. */ diff --git a/sdk/eventhub/arm-eventhub/src/models/mappers.ts b/sdk/eventhub/arm-eventhub/src/models/mappers.ts index 8b1ee80373e4..a33d54995c9c 100644 --- a/sdk/eventhub/arm-eventhub/src/models/mappers.ts +++ b/sdk/eventhub/arm-eventhub/src/models/mappers.ts @@ -947,6 +947,34 @@ export const AuthorizationRuleListResult: msRest.CompositeMapper = { } }; +export const NetworkRuleSetListResult: msRest.CompositeMapper = { + serializedName: "NetworkRuleSetListResult", + type: { + name: "Composite", + className: "NetworkRuleSetListResult", + modelProperties: { + value: { + serializedName: "", + type: { + name: "Sequence", + element: { + type: { + name: "Composite", + className: "NetworkRuleSet" + } + } + } + }, + nextLink: { + serializedName: "nextLink", + type: { + name: "String" + } + } + } + } +}; + export const ArmDisasterRecoveryListResult: msRest.CompositeMapper = { serializedName: "ArmDisasterRecoveryListResult", type: { diff --git a/sdk/eventhub/arm-eventhub/src/models/namespacesMappers.ts b/sdk/eventhub/arm-eventhub/src/models/namespacesMappers.ts index 9d58d74dc72c..448a6284fb8c 100644 --- a/sdk/eventhub/arm-eventhub/src/models/namespacesMappers.ts +++ b/sdk/eventhub/arm-eventhub/src/models/namespacesMappers.ts @@ -25,6 +25,7 @@ export { MessagingRegions, MessagingRegionsProperties, NetworkRuleSet, + NetworkRuleSetListResult, NWRuleSetIpRules, NWRuleSetVirtualNetworkRules, RegenerateAccessKeyParameters, diff --git a/sdk/eventhub/arm-eventhub/src/models/parameters.ts b/sdk/eventhub/arm-eventhub/src/models/parameters.ts index f3cc023b3e66..3bd448b17473 100644 --- a/sdk/eventhub/arm-eventhub/src/models/parameters.ts +++ b/sdk/eventhub/arm-eventhub/src/models/parameters.ts @@ -77,6 +77,7 @@ export const eventHubName: msRest.OperationURLParameter = { required: true, serializedName: "eventHubName", constraints: { + MaxLength: 50, MinLength: 1 }, type: { diff --git a/sdk/eventhub/arm-eventhub/src/operations/eventHubs.ts b/sdk/eventhub/arm-eventhub/src/operations/eventHubs.ts index ffd4672511f1..0ba0686ba502 100644 --- a/sdk/eventhub/arm-eventhub/src/operations/eventHubs.ts +++ b/sdk/eventhub/arm-eventhub/src/operations/eventHubs.ts @@ -207,7 +207,8 @@ export class EventHubs { } /** - * Creates or updates an AuthorizationRule for the specified Event Hub. + * 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 diff --git a/sdk/eventhub/arm-eventhub/src/operations/namespaces.ts b/sdk/eventhub/arm-eventhub/src/operations/namespaces.ts index 99a8372ff15f..7bf47a0f3cd7 100644 --- a/sdk/eventhub/arm-eventhub/src/operations/namespaces.ts +++ b/sdk/eventhub/arm-eventhub/src/operations/namespaces.ts @@ -523,6 +523,38 @@ export class Namespaces { callback) as Promise; } + /** + * Gets list of 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 + */ + listNetworkRuleSets(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 + */ + listNetworkRuleSets(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 + */ + listNetworkRuleSets(resourceGroupName: string, namespaceName: string, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; + listNetworkRuleSets(resourceGroupName: string, namespaceName: string, options?: msRest.RequestOptionsBase | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { + return this.client.sendOperationRequest( + { + resourceGroupName, + namespaceName, + options + }, + listNetworkRuleSetsOperationSpec, + callback) as Promise; + } + /** * Creates or updates a namespace. Once created, this namespace's resource manifest is immutable. * This operation is idempotent. @@ -646,6 +678,34 @@ export class Namespaces { listAuthorizationRulesNextOperationSpec, callback) as Promise; } + + /** + * Gets list of NetworkRuleSet for a Namespace. + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @param [options] The optional parameters + * @returns Promise + */ + listNetworkRuleSetsNext(nextPageLink: string, options?: msRest.RequestOptionsBase): Promise; + /** + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @param callback The callback + */ + listNetworkRuleSetsNext(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 + */ + listNetworkRuleSetsNext(nextPageLink: string, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; + listNetworkRuleSetsNext(nextPageLink: string, options?: msRest.RequestOptionsBase | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { + return this.client.sendOperationRequest( + { + nextPageLink, + options + }, + listNetworkRuleSetsNextOperationSpec, + callback) as Promise; + } } // Operation Specifications @@ -1041,6 +1101,31 @@ const getNetworkRuleSetOperationSpec: msRest.OperationSpec = { serializer }; +const listNetworkRuleSetsOperationSpec: msRest.OperationSpec = { + httpMethod: "GET", + path: "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventHub/namespaces/{namespaceName}/networkRuleSets", + urlParameters: [ + Parameters.resourceGroupName, + Parameters.namespaceName, + Parameters.subscriptionId + ], + queryParameters: [ + Parameters.apiVersion + ], + headerParameters: [ + Parameters.acceptLanguage + ], + responses: { + 200: { + bodyMapper: Mappers.NetworkRuleSetListResult + }, + default: { + bodyMapper: Mappers.ErrorResponse + } + }, + serializer +}; + const beginCreateOrUpdateOperationSpec: msRest.OperationSpec = { httpMethod: "PUT", path: "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventHub/namespaces/{namespaceName}", @@ -1164,3 +1249,24 @@ const listAuthorizationRulesNextOperationSpec: msRest.OperationSpec = { }, serializer }; + +const listNetworkRuleSetsNextOperationSpec: msRest.OperationSpec = { + httpMethod: "GET", + baseUrl: "https://management.azure.com", + path: "{nextLink}", + urlParameters: [ + Parameters.nextPageLink + ], + headerParameters: [ + Parameters.acceptLanguage + ], + responses: { + 200: { + bodyMapper: Mappers.NetworkRuleSetListResult + }, + default: { + bodyMapper: Mappers.ErrorResponse + } + }, + serializer +}; diff --git a/sdk/eventhub/arm-eventhub/tsconfig.json b/sdk/eventhub/arm-eventhub/tsconfig.json index 87bbf5b5fa49..422b584abd5e 100644 --- a/sdk/eventhub/arm-eventhub/tsconfig.json +++ b/sdk/eventhub/arm-eventhub/tsconfig.json @@ -9,7 +9,7 @@ "esModuleInterop": true, "allowSyntheticDefaultImports": true, "forceConsistentCasingInFileNames": true, - "lib": ["es6"], + "lib": ["es6", "dom"], "declaration": true, "outDir": "./esm", "importHelpers": true