From a1b2dd0b7e6e364749812ae9683ec37cd7359085 Mon Sep 17 00:00:00 2001 From: Dan Schulte Date: Wed, 4 Apr 2018 15:12:19 -0700 Subject: [PATCH] Regenerate eventHubManagement and change version to 1.3.0 --- lib/services/eventHubManagement/LICENSE.txt | 4 +- lib/services/eventHubManagement/README.md | 58 +-- .../lib/eventHubManagementClient.d.ts | 7 +- .../lib/eventHubManagementClient.js | 5 + .../eventHubManagement/lib/models/index.d.ts | 57 +++ .../eventHubManagement/lib/models/index.js | 4 + .../lib/models/messagingPlan.js | 126 +++++ .../lib/models/messagingRegions.js | 104 ++++ .../lib/models/messagingRegionsListResult.js | 69 +++ .../lib/models/messagingRegionsProperties.js | 61 +++ .../lib/operations/index.d.ts | 193 +++++++ .../lib/operations/index.js | 2 + .../lib/operations/messagingPlanOperations.js | 284 +++++++++++ .../lib/operations/regions.js | 479 ++++++++++++++++++ lib/services/eventHubManagement/package.json | 31 +- 15 files changed, 1430 insertions(+), 54 deletions(-) create mode 100644 lib/services/eventHubManagement/lib/models/messagingPlan.js create mode 100644 lib/services/eventHubManagement/lib/models/messagingRegions.js create mode 100644 lib/services/eventHubManagement/lib/models/messagingRegionsListResult.js create mode 100644 lib/services/eventHubManagement/lib/models/messagingRegionsProperties.js create mode 100644 lib/services/eventHubManagement/lib/operations/messagingPlanOperations.js create mode 100644 lib/services/eventHubManagement/lib/operations/regions.js diff --git a/lib/services/eventHubManagement/LICENSE.txt b/lib/services/eventHubManagement/LICENSE.txt index 0313a903d7..a70e8cf660 100644 --- a/lib/services/eventHubManagement/LICENSE.txt +++ b/lib/services/eventHubManagement/LICENSE.txt @@ -1,6 +1,6 @@ The MIT License (MIT) -Copyright (c) 2017 Microsoft +Copyright (c) 2018 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. \ No newline at end of file +SOFTWARE. diff --git a/lib/services/eventHubManagement/README.md b/lib/services/eventHubManagement/README.md index 8c9ad4f356..655f2211bd 100644 --- a/lib/services/eventHubManagement/README.md +++ b/lib/services/eventHubManagement/README.md @@ -1,7 +1,14 @@ -# Microsoft Azure SDK for Node.js - EventHubManagement +--- +uid: azure-arm-eventhub +summary: *content + +--- +# Microsoft Azure SDK for Node.js - EventHubManagementClient +This project provides a Node.js package for accessing Azure. Right now it supports: +- **Node.js version 6.x.x or higher** + +## Features -This project provides a Node.js package that makes it easy to manage Azure EventHub Resources. Right now it supports: -- **Node.js version: 6.0.0 or higher** ## How to Install @@ -9,32 +16,25 @@ This project provides a Node.js package that makes it easy to manage Azure Event npm install azure-arm-eventhub ``` -## How to Use - -### Authentication, client creation and getting information about an eventhub as an example - - ```javascript - var msRestAzure = require('ms-rest-azure'); - var EventHubManagement = require('azure-arm-eventhub'); - - // Interactive Login - msRestAzure.interactiveLogin(function(err, credentials) { - var client = new EventHubManagement(credentials, 'your-subscription-id'); - var resourceGroupName = 'testRG'; - var namespaceName = 'testNS'; - var eventHubName = 'testEH'; - client.eventHubs.get(resourceGroupName, namespaceName, eventHubName, function(err, eventHubs, request, response) { - if (err) { - console.log(err); - } else { - eventHubs.map(function (hub, index, array) { - console.log('found hub :' + hub.name); - })); - } - }); - }); - ``` +## How to use + +### Authentication, client creation and list operations as an example. + +```javascript +const msRestAzure = require("ms-rest-azure"); +const EventHubManagementClient = require("azure-arm-eventhub"); +msRestAzure.interactiveLogin().then((creds) => { + const subscriptionId = ""; + const client = new EventHubManagementClient(creds, subscriptionId); + return client.operations.list().then((result) => { + console.log("The result is:"); + console.log(result); + }); +}).catch((err) => { + console.log('An error ocurred:'); + console.dir(err, {depth: null, colors: true}); +}); ## Related projects -- [Microsoft Azure SDK for Node.js - All-up](https://github.com/WindowsAzure/azure-sdk-for-node) +- [Microsoft Azure SDK for Node.js](https://github.com/Azure/azure-sdk-for-node) diff --git a/lib/services/eventHubManagement/lib/eventHubManagementClient.d.ts b/lib/services/eventHubManagement/lib/eventHubManagementClient.d.ts index 0a7c071df5..63e5d8c430 100644 --- a/lib/services/eventHubManagement/lib/eventHubManagementClient.d.ts +++ b/lib/services/eventHubManagement/lib/eventHubManagementClient.d.ts @@ -10,9 +10,10 @@ import { ServiceClientCredentials } from 'ms-rest'; import { AzureServiceClient, AzureServiceClientOptions } from 'ms-rest-azure'; +import * as models from "./models"; import * as operations from "./operations"; -declare class EventHubManagementClient extends AzureServiceClient { +export default class EventHubManagementClient extends AzureServiceClient { /** * Initializes a new instance of the EventHubManagementClient class. * @constructor @@ -57,9 +58,11 @@ declare class EventHubManagementClient extends AzureServiceClient { // Operation groups operations: operations.Operations; namespaces: operations.Namespaces; + messagingPlanOperations: operations.MessagingPlanOperations; disasterRecoveryConfigs: operations.DisasterRecoveryConfigs; eventHubs: operations.EventHubs; consumerGroups: operations.ConsumerGroups; + regions: operations.Regions; } -export = EventHubManagementClient; +export { EventHubManagementClient, models as EventHubManagementModels }; diff --git a/lib/services/eventHubManagement/lib/eventHubManagementClient.js b/lib/services/eventHubManagement/lib/eventHubManagementClient.js index 68a978fe25..9208b44513 100644 --- a/lib/services/eventHubManagement/lib/eventHubManagementClient.js +++ b/lib/services/eventHubManagement/lib/eventHubManagementClient.js @@ -74,9 +74,11 @@ class EventHubManagementClient extends ServiceClient { } this.operations = new operations.Operations(this); this.namespaces = new operations.Namespaces(this); + this.messagingPlanOperations = new operations.MessagingPlanOperations(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.models = models; msRest.addSerializationMixin(this); } @@ -84,3 +86,6 @@ class EventHubManagementClient extends ServiceClient { } module.exports = EventHubManagementClient; +module.exports['default'] = EventHubManagementClient; +module.exports.EventHubManagementClient = EventHubManagementClient; +module.exports.EventHubManagementModels = models; diff --git a/lib/services/eventHubManagement/lib/models/index.d.ts b/lib/services/eventHubManagement/lib/models/index.d.ts index 3a93a1489c..8ffec2aa32 100644 --- a/lib/services/eventHubManagement/lib/models/index.d.ts +++ b/lib/services/eventHubManagement/lib/models/index.d.ts @@ -402,6 +402,50 @@ export interface ArmDisasterRecovery extends Resource { readonly role?: string; } +/** + * @class + * Initializes a new instance of the MessagingRegionsProperties class. + * @constructor + * @member {string} [code] Region code + * @member {string} [fullName] Full name of the region + */ +export interface MessagingRegionsProperties { + readonly code?: string; + readonly fullName?: string; +} + +/** + * @class + * Initializes a new instance of the MessagingRegions class. + * @constructor + * Messaging Region + * + * @member {object} [properties] + * @member {string} [properties.code] Region code + * @member {string} [properties.fullName] Full name of the region + */ +export interface MessagingRegions extends TrackedResource { + properties?: MessagingRegionsProperties; +} + +/** + * @class + * Initializes a new instance of the MessagingPlan class. + * @constructor + * Messaging + * + * @member {number} [sku] Sku type + * @member {number} [selectedEventHubUnit] Selected event hub unit + * @member {date} [updatedAt] The exact time the messaging plan was updated. + * @member {number} [revision] revision number + */ +export interface MessagingPlan extends TrackedResource { + sku?: number; + selectedEventHubUnit?: number; + readonly updatedAt?: Date; + revision?: number; +} + /** * @class @@ -481,3 +525,16 @@ export interface EventHubListResult extends Array { export interface ConsumerGroupListResult extends Array { nextLink?: string; } + +/** + * @class + * Initializes a new instance of the MessagingRegionsListResult class. + * @constructor + * The response of the List MessagingRegions operation. + * + * @member {string} [nextLink] Link to the next set of results. Not empty if + * Value contains incomplete list of MessagingRegions. + */ +export interface MessagingRegionsListResult extends Array { + readonly nextLink?: string; +} diff --git a/lib/services/eventHubManagement/lib/models/index.js b/lib/services/eventHubManagement/lib/models/index.js index 3fa815aa62..04a95dd33d 100644 --- a/lib/services/eventHubManagement/lib/models/index.js +++ b/lib/services/eventHubManagement/lib/models/index.js @@ -35,9 +35,13 @@ exports.OperationDisplay = require('./operationDisplay'); exports.Operation = require('./operation'); exports.ErrorResponse = require('./errorResponse'); exports.ArmDisasterRecovery = require('./armDisasterRecovery'); +exports.MessagingRegionsProperties = require('./messagingRegionsProperties'); +exports.MessagingRegions = require('./messagingRegions'); +exports.MessagingPlan = require('./messagingPlan'); exports.OperationListResult = require('./operationListResult'); exports.EHNamespaceListResult = require('./eHNamespaceListResult'); exports.AuthorizationRuleListResult = require('./authorizationRuleListResult'); exports.ArmDisasterRecoveryListResult = require('./armDisasterRecoveryListResult'); exports.EventHubListResult = require('./eventHubListResult'); exports.ConsumerGroupListResult = require('./consumerGroupListResult'); +exports.MessagingRegionsListResult = require('./messagingRegionsListResult'); diff --git a/lib/services/eventHubManagement/lib/models/messagingPlan.js b/lib/services/eventHubManagement/lib/models/messagingPlan.js new file mode 100644 index 0000000000..1321858b63 --- /dev/null +++ b/lib/services/eventHubManagement/lib/models/messagingPlan.js @@ -0,0 +1,126 @@ +/* + * 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. + */ + +'use strict'; + +const models = require('./index'); + +/** + * Messaging + * + * @extends models['TrackedResource'] + */ +class MessagingPlan extends models['TrackedResource'] { + /** + * Create a MessagingPlan. + * @member {number} [sku] Sku type + * @member {number} [selectedEventHubUnit] Selected event hub unit + * @member {date} [updatedAt] The exact time the messaging plan was updated. + * @member {number} [revision] revision number + */ + constructor() { + super(); + } + + /** + * Defines the metadata of MessagingPlan + * + * @returns {object} metadata of MessagingPlan + * + */ + mapper() { + return { + required: false, + serializedName: 'MessagingPlan', + type: { + name: 'Composite', + className: 'MessagingPlan', + modelProperties: { + id: { + required: false, + readOnly: true, + serializedName: 'id', + type: { + name: 'String' + } + }, + name: { + required: false, + readOnly: true, + serializedName: 'name', + type: { + name: 'String' + } + }, + type: { + required: false, + readOnly: true, + serializedName: 'type', + type: { + name: 'String' + } + }, + location: { + required: false, + serializedName: 'location', + type: { + name: 'String' + } + }, + tags: { + required: false, + serializedName: 'tags', + type: { + name: 'Dictionary', + value: { + required: false, + serializedName: 'StringElementType', + type: { + name: 'String' + } + } + } + }, + sku: { + required: false, + serializedName: 'properties.sku', + type: { + name: 'Number' + } + }, + selectedEventHubUnit: { + required: false, + serializedName: 'properties.selectedEventHubUnit', + type: { + name: 'Number' + } + }, + updatedAt: { + required: false, + readOnly: true, + serializedName: 'properties.updatedAt', + type: { + name: 'DateTime' + } + }, + revision: { + required: false, + serializedName: 'properties.revision', + type: { + name: 'Number' + } + } + } + } + }; + } +} + +module.exports = MessagingPlan; diff --git a/lib/services/eventHubManagement/lib/models/messagingRegions.js b/lib/services/eventHubManagement/lib/models/messagingRegions.js new file mode 100644 index 0000000000..a0dd9f3e6f --- /dev/null +++ b/lib/services/eventHubManagement/lib/models/messagingRegions.js @@ -0,0 +1,104 @@ +/* + * 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. + */ + +'use strict'; + +const models = require('./index'); + +/** + * Messaging Region + * + * @extends models['TrackedResource'] + */ +class MessagingRegions extends models['TrackedResource'] { + /** + * Create a MessagingRegions. + * @member {object} [properties] + * @member {string} [properties.code] Region code + * @member {string} [properties.fullName] Full name of the region + */ + constructor() { + super(); + } + + /** + * Defines the metadata of MessagingRegions + * + * @returns {object} metadata of MessagingRegions + * + */ + mapper() { + return { + required: false, + serializedName: 'MessagingRegions', + type: { + name: 'Composite', + className: 'MessagingRegions', + modelProperties: { + id: { + required: false, + readOnly: true, + serializedName: 'id', + type: { + name: 'String' + } + }, + name: { + required: false, + readOnly: true, + serializedName: 'name', + type: { + name: 'String' + } + }, + type: { + required: false, + readOnly: true, + serializedName: 'type', + type: { + name: 'String' + } + }, + location: { + required: false, + serializedName: 'location', + type: { + name: 'String' + } + }, + tags: { + required: false, + serializedName: 'tags', + type: { + name: 'Dictionary', + value: { + required: false, + serializedName: 'StringElementType', + type: { + name: 'String' + } + } + } + }, + properties: { + required: false, + serializedName: 'properties', + type: { + name: 'Composite', + className: 'MessagingRegionsProperties' + } + } + } + } + }; + } +} + +module.exports = MessagingRegions; diff --git a/lib/services/eventHubManagement/lib/models/messagingRegionsListResult.js b/lib/services/eventHubManagement/lib/models/messagingRegionsListResult.js new file mode 100644 index 0000000000..9cf897ab11 --- /dev/null +++ b/lib/services/eventHubManagement/lib/models/messagingRegionsListResult.js @@ -0,0 +1,69 @@ +/* + * 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. + */ + +'use strict'; + +/** + * The response of the List MessagingRegions operation. + */ +class MessagingRegionsListResult extends Array { + /** + * Create a MessagingRegionsListResult. + * @member {string} [nextLink] Link to the next set of results. Not empty if + * Value contains incomplete list of MessagingRegions. + */ + constructor() { + super(); + } + + /** + * Defines the metadata of MessagingRegionsListResult + * + * @returns {object} metadata of MessagingRegionsListResult + * + */ + mapper() { + return { + required: false, + serializedName: 'MessagingRegionsListResult', + type: { + name: 'Composite', + className: 'MessagingRegionsListResult', + modelProperties: { + value: { + required: false, + serializedName: '', + type: { + name: 'Sequence', + element: { + required: false, + serializedName: 'MessagingRegionsElementType', + type: { + name: 'Composite', + className: 'MessagingRegions' + } + } + } + }, + nextLink: { + required: false, + readOnly: true, + serializedName: 'nextLink', + type: { + name: 'String' + } + } + } + } + }; + } +} + +module.exports = MessagingRegionsListResult; diff --git a/lib/services/eventHubManagement/lib/models/messagingRegionsProperties.js b/lib/services/eventHubManagement/lib/models/messagingRegionsProperties.js new file mode 100644 index 0000000000..fa59c1be04 --- /dev/null +++ b/lib/services/eventHubManagement/lib/models/messagingRegionsProperties.js @@ -0,0 +1,61 @@ +/* + * 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. + */ + +'use strict'; + +/** + * Class representing a MessagingRegionsProperties. + */ +class MessagingRegionsProperties { + /** + * Create a MessagingRegionsProperties. + * @member {string} [code] Region code + * @member {string} [fullName] Full name of the region + */ + constructor() { + } + + /** + * Defines the metadata of MessagingRegionsProperties + * + * @returns {object} metadata of MessagingRegionsProperties + * + */ + mapper() { + return { + required: false, + serializedName: 'MessagingRegions_properties', + type: { + name: 'Composite', + className: 'MessagingRegionsProperties', + modelProperties: { + code: { + required: false, + readOnly: true, + serializedName: 'code', + type: { + name: 'String' + } + }, + fullName: { + required: false, + readOnly: true, + serializedName: 'fullName', + type: { + name: 'String' + } + } + } + } + }; + } +} + +module.exports = MessagingRegionsProperties; diff --git a/lib/services/eventHubManagement/lib/operations/index.d.ts b/lib/services/eventHubManagement/lib/operations/index.d.ts index b84782b9a8..aaa030cb89 100644 --- a/lib/services/eventHubManagement/lib/operations/index.d.ts +++ b/lib/services/eventHubManagement/lib/operations/index.d.ts @@ -1418,6 +1418,76 @@ export interface Namespaces { listAuthorizationRulesNext(nextPageLink: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; } +/** + * @class + * MessagingPlanOperations + * __NOTE__: An instance of this class is automatically created for an + * instance of the EventHubManagementClient. + */ +export interface MessagingPlanOperations { + + + /** + * Gets a description for the specified namespace. + * + * @param {string} resourceGroupName Name of the resource group within the + * azure subscription. + * + * @param {string} namespaceName The Namespace name + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error|ServiceError} - The error object. + */ + getWithHttpOperationResponse(resourceGroupName: string, namespaceName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * Gets a description for the specified namespace. + * + * @param {string} resourceGroupName Name of the resource group within the + * azure subscription. + * + * @param {string} namespaceName The Namespace name + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {ServiceCallback} [optionalCallback] - The optional callback. + * + * @returns {ServiceCallback|Promise} If a callback was passed as the last + * parameter then it returns the callback else returns a Promise. + * + * {Promise} A promise is returned. + * + * @resolve {MessagingPlan} - The deserialized result object. + * + * @reject {Error|ServiceError} - The error object. + * + * {ServiceCallback} optionalCallback(err, result, request, response) + * + * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. + * + * {MessagingPlan} [result] - The deserialized result object if an error did not occur. + * See {@link MessagingPlan} for more information. + * + * {WebResource} [request] - The HTTP Request object if an error did not occur. + * + * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. + */ + get(resourceGroupName: string, namespaceName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + get(resourceGroupName: string, namespaceName: string, callback: ServiceCallback): void; + get(resourceGroupName: string, namespaceName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; +} + /** * @class * DisasterRecoveryConfigs @@ -3510,3 +3580,126 @@ export interface ConsumerGroups { listByEventHubNext(nextPageLink: string, callback: ServiceCallback): void; listByEventHubNext(nextPageLink: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; } + +/** + * @class + * Regions + * __NOTE__: An instance of this class is automatically created for an + * instance of the EventHubManagementClient. + */ +export interface Regions { + + + /** + * Gets the available Regions for a given sku + * + * @param {string} sku The sku type. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error|ServiceError} - The error object. + */ + listBySkuWithHttpOperationResponse(sku: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * Gets the available Regions for a given sku + * + * @param {string} sku The sku type. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {ServiceCallback} [optionalCallback] - The optional callback. + * + * @returns {ServiceCallback|Promise} If a callback was passed as the last + * parameter then it returns the callback else returns a Promise. + * + * {Promise} A promise is returned. + * + * @resolve {MessagingRegionsListResult} - The deserialized result object. + * + * @reject {Error|ServiceError} - The error object. + * + * {ServiceCallback} optionalCallback(err, result, request, response) + * + * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. + * + * {MessagingRegionsListResult} [result] - The deserialized result object if an error did not occur. + * See {@link MessagingRegionsListResult} for more + * information. + * + * {WebResource} [request] - The HTTP Request object if an error did not occur. + * + * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. + */ + listBySku(sku: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + listBySku(sku: string, callback: ServiceCallback): void; + listBySku(sku: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * Gets the available Regions for a given sku + * + * @param {string} nextPageLink The NextLink from the previous successful call + * to List operation. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error|ServiceError} - The error object. + */ + listBySkuNextWithHttpOperationResponse(nextPageLink: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * Gets the available Regions for a given sku + * + * @param {string} nextPageLink The NextLink from the previous successful call + * to List operation. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {ServiceCallback} [optionalCallback] - The optional callback. + * + * @returns {ServiceCallback|Promise} If a callback was passed as the last + * parameter then it returns the callback else returns a Promise. + * + * {Promise} A promise is returned. + * + * @resolve {MessagingRegionsListResult} - The deserialized result object. + * + * @reject {Error|ServiceError} - The error object. + * + * {ServiceCallback} optionalCallback(err, result, request, response) + * + * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. + * + * {MessagingRegionsListResult} [result] - The deserialized result object if an error did not occur. + * See {@link MessagingRegionsListResult} for more + * information. + * + * {WebResource} [request] - The HTTP Request object if an error did not occur. + * + * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. + */ + listBySkuNext(nextPageLink: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + listBySkuNext(nextPageLink: string, callback: ServiceCallback): void; + listBySkuNext(nextPageLink: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; +} diff --git a/lib/services/eventHubManagement/lib/operations/index.js b/lib/services/eventHubManagement/lib/operations/index.js index 522db33075..c24bf99693 100644 --- a/lib/services/eventHubManagement/lib/operations/index.js +++ b/lib/services/eventHubManagement/lib/operations/index.js @@ -16,6 +16,8 @@ exports.Operations = require('./operations'); exports.Namespaces = require('./namespaces'); +exports.MessagingPlanOperations = require('./messagingPlanOperations'); exports.DisasterRecoveryConfigs = require('./disasterRecoveryConfigs'); exports.EventHubs = require('./eventHubs'); exports.ConsumerGroups = require('./consumerGroups'); +exports.Regions = require('./regions'); diff --git a/lib/services/eventHubManagement/lib/operations/messagingPlanOperations.js b/lib/services/eventHubManagement/lib/operations/messagingPlanOperations.js new file mode 100644 index 0000000000..161bbe1552 --- /dev/null +++ b/lib/services/eventHubManagement/lib/operations/messagingPlanOperations.js @@ -0,0 +1,284 @@ +/* + * 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. + */ + +'use strict'; + +const msRest = require('ms-rest'); +const msRestAzure = require('ms-rest-azure'); +const WebResource = msRest.WebResource; + +/** + * Gets a description for the specified namespace. + * + * @param {string} resourceGroupName Name of the resource group within the + * azure subscription. + * + * @param {string} namespaceName The Namespace name + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {function} callback - The callback. + * + * @returns {function} callback(err, result, request, response) + * + * {Error} err - The Error object if an error occurred, null otherwise. + * + * {object} [result] - The deserialized result object if an error did not occur. + * See {@link MessagingPlan} for more information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ +function _get(resourceGroupName, namespaceName, options, callback) { + /* jshint validthis: true */ + let client = this.client; + if(!callback && typeof options === 'function') { + callback = options; + options = null; + } + if (!callback) { + throw new Error('callback cannot be null.'); + } + // Validate + try { + if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { + throw new Error('resourceGroupName cannot be null or undefined and it must be of type string.'); + } + if (resourceGroupName !== null && resourceGroupName !== undefined) { + if (resourceGroupName.length > 90) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); + } + if (resourceGroupName.length < 1) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MinLength": 1'); + } + } + if (namespaceName === null || namespaceName === undefined || typeof namespaceName.valueOf() !== 'string') { + throw new Error('namespaceName cannot be null or undefined and it must be of type string.'); + } + if (namespaceName !== null && namespaceName !== undefined) { + if (namespaceName.length > 50) + { + throw new Error('"namespaceName" should satisfy the constraint - "MaxLength": 50'); + } + if (namespaceName.length < 6) + { + throw new Error('"namespaceName" should satisfy the constraint - "MinLength": 6'); + } + } + if (this.client.apiVersion === null || this.client.apiVersion === undefined || typeof this.client.apiVersion.valueOf() !== 'string') { + throw new Error('this.client.apiVersion cannot be null or undefined and it must be of type string.'); + } + if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') { + throw new Error('this.client.subscriptionId cannot be null or undefined and it must be of type string.'); + } + if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage must be of type string.'); + } + } catch (error) { + return callback(error); + } + + // Construct URL + let baseUrl = this.client.baseUri; + let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventHub/namespaces/{namespaceName}/messagingplan'; + requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); + requestUrl = requestUrl.replace('{namespaceName}', encodeURIComponent(namespaceName)); + requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); + let queryParameters = []; + queryParameters.push('api-version=' + encodeURIComponent(this.client.apiVersion)); + if (queryParameters.length > 0) { + requestUrl += '?' + queryParameters.join('&'); + } + + // Create HTTP transport objects + let httpRequest = new WebResource(); + httpRequest.method = 'GET'; + httpRequest.url = requestUrl; + httpRequest.headers = {}; + // Set Headers + httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; + if (this.client.generateClientRequestId) { + httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid(); + } + if (this.client.acceptLanguage !== undefined && this.client.acceptLanguage !== null) { + httpRequest.headers['accept-language'] = this.client.acceptLanguage; + } + if(options) { + for(let headerName in options['customHeaders']) { + if (options['customHeaders'].hasOwnProperty(headerName)) { + httpRequest.headers[headerName] = options['customHeaders'][headerName]; + } + } + } + httpRequest.body = null; + // Send Request + return client.pipeline(httpRequest, (err, response, responseBody) => { + if (err) { + return callback(err); + } + let statusCode = response.statusCode; + if (statusCode !== 200) { + let error = new Error(responseBody); + error.statusCode = response.statusCode; + error.request = msRest.stripRequest(httpRequest); + error.response = msRest.stripResponse(response); + if (responseBody === '') responseBody = null; + let parsedErrorResponse; + try { + parsedErrorResponse = JSON.parse(responseBody); + if (parsedErrorResponse) { + if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; + if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; + if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['CloudError']().mapper(); + error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); + } + } catch (defaultError) { + error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + + `- "${responseBody}" for the default response.`; + return callback(error); + } + return callback(error); + } + // Create Result + let result = null; + if (responseBody === '') responseBody = null; + // Deserialize Response + if (statusCode === 200) { + let parsedResponse = null; + try { + parsedResponse = JSON.parse(responseBody); + result = JSON.parse(responseBody); + if (parsedResponse !== null && parsedResponse !== undefined) { + let resultMapper = new client.models['MessagingPlan']().mapper(); + result = client.deserialize(resultMapper, parsedResponse, 'result'); + } + } catch (error) { + let deserializationError = new Error(`Error ${error} occurred in deserializing the responseBody - ${responseBody}`); + deserializationError.request = msRest.stripRequest(httpRequest); + deserializationError.response = msRest.stripResponse(response); + return callback(deserializationError); + } + } + + return callback(null, result, httpRequest, response); + }); +} + +/** Class representing a MessagingPlanOperations. */ +class MessagingPlanOperations { + /** + * Create a MessagingPlanOperations. + * @param {EventHubManagementClient} client Reference to the service client. + */ + constructor(client) { + this.client = client; + this._get = _get; + } + + /** + * Gets a description for the specified namespace. + * + * @param {string} resourceGroupName Name of the resource group within the + * azure subscription. + * + * @param {string} namespaceName The Namespace name + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error} - The error object. + */ + getWithHttpOperationResponse(resourceGroupName, namespaceName, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._get(resourceGroupName, namespaceName, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * Gets a description for the specified namespace. + * + * @param {string} resourceGroupName Name of the resource group within the + * azure subscription. + * + * @param {string} namespaceName The Namespace name + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {function} [optionalCallback] - The optional callback. + * + * @returns {function|Promise} If a callback was passed as the last parameter + * then it returns the callback else returns a Promise. + * + * {Promise} A promise is returned + * + * @resolve {MessagingPlan} - The deserialized result object. + * + * @reject {Error} - The error object. + * + * {function} optionalCallback(err, result, request, response) + * + * {Error} err - The Error object if an error occurred, null otherwise. + * + * {object} [result] - The deserialized result object if an error did not occur. + * See {@link MessagingPlan} for more information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ + get(resourceGroupName, namespaceName, options, optionalCallback) { + let client = this.client; + let self = this; + if (!optionalCallback && typeof options === 'function') { + optionalCallback = options; + options = null; + } + if (!optionalCallback) { + return new Promise((resolve, reject) => { + self._get(resourceGroupName, namespaceName, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._get(resourceGroupName, namespaceName, options, optionalCallback); + } + } + +} + +module.exports = MessagingPlanOperations; diff --git a/lib/services/eventHubManagement/lib/operations/regions.js b/lib/services/eventHubManagement/lib/operations/regions.js new file mode 100644 index 0000000000..d55b88f1c6 --- /dev/null +++ b/lib/services/eventHubManagement/lib/operations/regions.js @@ -0,0 +1,479 @@ +/* + * 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. + */ + +'use strict'; + +const msRest = require('ms-rest'); +const msRestAzure = require('ms-rest-azure'); +const WebResource = msRest.WebResource; + +/** + * Gets the available Regions for a given sku + * + * @param {string} sku The sku type. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {function} callback - The callback. + * + * @returns {function} callback(err, result, request, response) + * + * {Error} err - The Error object if an error occurred, null otherwise. + * + * {object} [result] - The deserialized result object if an error did not occur. + * See {@link MessagingRegionsListResult} for more + * information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ +function _listBySku(sku, options, callback) { + /* jshint validthis: true */ + let client = this.client; + if(!callback && typeof options === 'function') { + callback = options; + options = null; + } + if (!callback) { + throw new Error('callback cannot be null.'); + } + // Validate + try { + if (this.client.apiVersion === null || this.client.apiVersion === undefined || typeof this.client.apiVersion.valueOf() !== 'string') { + throw new Error('this.client.apiVersion cannot be null or undefined and it must be of type string.'); + } + if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') { + throw new Error('this.client.subscriptionId cannot be null or undefined and it must be of type string.'); + } + if (sku === null || sku === undefined || typeof sku.valueOf() !== 'string') { + throw new Error('sku cannot be null or undefined and it must be of type string.'); + } + if (sku !== null && sku !== undefined) { + if (sku.length > 50) + { + throw new Error('"sku" should satisfy the constraint - "MaxLength": 50'); + } + if (sku.length < 1) + { + throw new Error('"sku" should satisfy the constraint - "MinLength": 1'); + } + } + if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage must be of type string.'); + } + } catch (error) { + return callback(error); + } + + // Construct URL + let baseUrl = this.client.baseUri; + let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/providers/Microsoft.EventHub/sku/{sku}/regions'; + requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); + requestUrl = requestUrl.replace('{sku}', encodeURIComponent(sku)); + let queryParameters = []; + queryParameters.push('api-version=' + encodeURIComponent(this.client.apiVersion)); + if (queryParameters.length > 0) { + requestUrl += '?' + queryParameters.join('&'); + } + + // Create HTTP transport objects + let httpRequest = new WebResource(); + httpRequest.method = 'GET'; + httpRequest.url = requestUrl; + httpRequest.headers = {}; + // Set Headers + httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; + if (this.client.generateClientRequestId) { + httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid(); + } + if (this.client.acceptLanguage !== undefined && this.client.acceptLanguage !== null) { + httpRequest.headers['accept-language'] = this.client.acceptLanguage; + } + if(options) { + for(let headerName in options['customHeaders']) { + if (options['customHeaders'].hasOwnProperty(headerName)) { + httpRequest.headers[headerName] = options['customHeaders'][headerName]; + } + } + } + httpRequest.body = null; + // Send Request + return client.pipeline(httpRequest, (err, response, responseBody) => { + if (err) { + return callback(err); + } + let statusCode = response.statusCode; + if (statusCode !== 200) { + let error = new Error(responseBody); + error.statusCode = response.statusCode; + error.request = msRest.stripRequest(httpRequest); + error.response = msRest.stripResponse(response); + if (responseBody === '') responseBody = null; + let parsedErrorResponse; + try { + parsedErrorResponse = JSON.parse(responseBody); + if (parsedErrorResponse) { + let internalError = null; + if (parsedErrorResponse.error) internalError = parsedErrorResponse.error; + error.code = internalError ? internalError.code : parsedErrorResponse.code; + error.message = internalError ? internalError.message : parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['ErrorResponse']().mapper(); + error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); + } + } catch (defaultError) { + error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + + `- "${responseBody}" for the default response.`; + return callback(error); + } + return callback(error); + } + // Create Result + let result = null; + if (responseBody === '') responseBody = null; + // Deserialize Response + if (statusCode === 200) { + let parsedResponse = null; + try { + parsedResponse = JSON.parse(responseBody); + result = JSON.parse(responseBody); + if (parsedResponse !== null && parsedResponse !== undefined) { + let resultMapper = new client.models['MessagingRegionsListResult']().mapper(); + result = client.deserialize(resultMapper, parsedResponse, 'result'); + } + } catch (error) { + let deserializationError = new Error(`Error ${error} occurred in deserializing the responseBody - ${responseBody}`); + deserializationError.request = msRest.stripRequest(httpRequest); + deserializationError.response = msRest.stripResponse(response); + return callback(deserializationError); + } + } + + return callback(null, result, httpRequest, response); + }); +} + +/** + * Gets the available Regions for a given sku + * + * @param {string} nextPageLink The NextLink from the previous successful call + * to List operation. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {function} callback - The callback. + * + * @returns {function} callback(err, result, request, response) + * + * {Error} err - The Error object if an error occurred, null otherwise. + * + * {object} [result] - The deserialized result object if an error did not occur. + * See {@link MessagingRegionsListResult} for more + * information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ +function _listBySkuNext(nextPageLink, options, callback) { + /* jshint validthis: true */ + let client = this.client; + if(!callback && typeof options === 'function') { + callback = options; + options = null; + } + if (!callback) { + throw new Error('callback cannot be null.'); + } + // Validate + try { + if (nextPageLink === null || nextPageLink === undefined || typeof nextPageLink.valueOf() !== 'string') { + throw new Error('nextPageLink cannot be null or undefined and it must be of type string.'); + } + if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage must be of type string.'); + } + } catch (error) { + return callback(error); + } + + // Construct URL + let requestUrl = '{nextLink}'; + requestUrl = requestUrl.replace('{nextLink}', nextPageLink); + + // Create HTTP transport objects + let httpRequest = new WebResource(); + httpRequest.method = 'GET'; + httpRequest.url = requestUrl; + httpRequest.headers = {}; + // Set Headers + httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; + if (this.client.generateClientRequestId) { + httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid(); + } + if (this.client.acceptLanguage !== undefined && this.client.acceptLanguage !== null) { + httpRequest.headers['accept-language'] = this.client.acceptLanguage; + } + if(options) { + for(let headerName in options['customHeaders']) { + if (options['customHeaders'].hasOwnProperty(headerName)) { + httpRequest.headers[headerName] = options['customHeaders'][headerName]; + } + } + } + httpRequest.body = null; + // Send Request + return client.pipeline(httpRequest, (err, response, responseBody) => { + if (err) { + return callback(err); + } + let statusCode = response.statusCode; + if (statusCode !== 200) { + let error = new Error(responseBody); + error.statusCode = response.statusCode; + error.request = msRest.stripRequest(httpRequest); + error.response = msRest.stripResponse(response); + if (responseBody === '') responseBody = null; + let parsedErrorResponse; + try { + parsedErrorResponse = JSON.parse(responseBody); + if (parsedErrorResponse) { + let internalError = null; + if (parsedErrorResponse.error) internalError = parsedErrorResponse.error; + error.code = internalError ? internalError.code : parsedErrorResponse.code; + error.message = internalError ? internalError.message : parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['ErrorResponse']().mapper(); + error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); + } + } catch (defaultError) { + error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + + `- "${responseBody}" for the default response.`; + return callback(error); + } + return callback(error); + } + // Create Result + let result = null; + if (responseBody === '') responseBody = null; + // Deserialize Response + if (statusCode === 200) { + let parsedResponse = null; + try { + parsedResponse = JSON.parse(responseBody); + result = JSON.parse(responseBody); + if (parsedResponse !== null && parsedResponse !== undefined) { + let resultMapper = new client.models['MessagingRegionsListResult']().mapper(); + result = client.deserialize(resultMapper, parsedResponse, 'result'); + } + } catch (error) { + let deserializationError = new Error(`Error ${error} occurred in deserializing the responseBody - ${responseBody}`); + deserializationError.request = msRest.stripRequest(httpRequest); + deserializationError.response = msRest.stripResponse(response); + return callback(deserializationError); + } + } + + return callback(null, result, httpRequest, response); + }); +} + +/** Class representing a Regions. */ +class Regions { + /** + * Create a Regions. + * @param {EventHubManagementClient} client Reference to the service client. + */ + constructor(client) { + this.client = client; + this._listBySku = _listBySku; + this._listBySkuNext = _listBySkuNext; + } + + /** + * Gets the available Regions for a given sku + * + * @param {string} sku The sku type. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error} - The error object. + */ + listBySkuWithHttpOperationResponse(sku, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._listBySku(sku, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * Gets the available Regions for a given sku + * + * @param {string} sku The sku type. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {function} [optionalCallback] - The optional callback. + * + * @returns {function|Promise} If a callback was passed as the last parameter + * then it returns the callback else returns a Promise. + * + * {Promise} A promise is returned + * + * @resolve {MessagingRegionsListResult} - The deserialized result object. + * + * @reject {Error} - The error object. + * + * {function} optionalCallback(err, result, request, response) + * + * {Error} err - The Error object if an error occurred, null otherwise. + * + * {object} [result] - The deserialized result object if an error did not occur. + * See {@link MessagingRegionsListResult} for more + * information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ + listBySku(sku, options, optionalCallback) { + let client = this.client; + let self = this; + if (!optionalCallback && typeof options === 'function') { + optionalCallback = options; + options = null; + } + if (!optionalCallback) { + return new Promise((resolve, reject) => { + self._listBySku(sku, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._listBySku(sku, options, optionalCallback); + } + } + + /** + * Gets the available Regions for a given sku + * + * @param {string} nextPageLink The NextLink from the previous successful call + * to List operation. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error} - The error object. + */ + listBySkuNextWithHttpOperationResponse(nextPageLink, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._listBySkuNext(nextPageLink, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * Gets the available Regions for a given sku + * + * @param {string} nextPageLink The NextLink from the previous successful call + * to List operation. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {function} [optionalCallback] - The optional callback. + * + * @returns {function|Promise} If a callback was passed as the last parameter + * then it returns the callback else returns a Promise. + * + * {Promise} A promise is returned + * + * @resolve {MessagingRegionsListResult} - The deserialized result object. + * + * @reject {Error} - The error object. + * + * {function} optionalCallback(err, result, request, response) + * + * {Error} err - The Error object if an error occurred, null otherwise. + * + * {object} [result] - The deserialized result object if an error did not occur. + * See {@link MessagingRegionsListResult} for more + * information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ + listBySkuNext(nextPageLink, options, optionalCallback) { + let client = this.client; + let self = this; + if (!optionalCallback && typeof options === 'function') { + optionalCallback = options; + options = null; + } + if (!optionalCallback) { + return new Promise((resolve, reject) => { + self._listBySkuNext(nextPageLink, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._listBySkuNext(nextPageLink, options, optionalCallback); + } + } + +} + +module.exports = Regions; diff --git a/lib/services/eventHubManagement/package.json b/lib/services/eventHubManagement/package.json index f818f67490..005d1bec1a 100644 --- a/lib/services/eventHubManagement/package.json +++ b/lib/services/eventHubManagement/package.json @@ -1,31 +1,20 @@ { "name": "azure-arm-eventhub", "author": "Microsoft Corporation", - "contributors": [ - "Zeeshan Sayed ", - "Amar Zavery " - ], - "version": "1.2.0-preview", - "description": "Microsoft EventHub Management Client Library for node", - "tags": [ - "azure", - "sdk" - ], - "keywords": [ - "node", - "azure" - ], - "main": "./lib/eventHubManagementClient.js", - "types": "./lib/eventHubManagementClient.d.ts", - "license": "MIT", + "description": "EventHubManagementClient Library with typescript type definitions for node", + "version": "1.3.0", "dependencies": { - "ms-rest-azure": "^2.5.3", - "ms-rest": "^2.3.0" + "ms-rest": "^2.3.2", + "ms-rest-azure": "^2.5.5" }, - "homepage": "http://github.com/Azure/azure-sdk-for-node", + "keywords": [ "node", "azure" ], + "license": "MIT", + "main": "./lib/eventHubManagementClient.js", + "types": "./lib/eventHubManagementClient.d.ts", + "homepage": "http://github.com/azure/azure-sdk-for-node", "repository": { "type": "git", - "url": "git@github.com:Azure/azure-sdk-for-node.git" + "url": "https://github.com/azure/azure-sdk-for-node.git" }, "bugs": { "url": "http://github.com/Azure/azure-sdk-for-node/issues"