diff --git a/lib/services/eventHubManagement/lib/models/index.d.ts b/lib/services/eventHubManagement/lib/models/index.d.ts index 49143f6713..7449e3f50f 100644 --- a/lib/services/eventHubManagement/lib/models/index.d.ts +++ b/lib/services/eventHubManagement/lib/models/index.d.ts @@ -452,35 +452,6 @@ export interface MessagingPlan extends TrackedResource { readonly revision?: number; } -/** - * @class - * Initializes a new instance of the IpFilterRule class. - * @constructor - * Single item in a List or Get IpFilterRules operation - * - * @member {string} [ipMask] IP Mask - * @member {string} [action] The IP Filter Action. Possible values include: - * 'Accept', 'Reject' - * @member {string} [filterName] IP Filter name - */ -export interface IpFilterRule extends Resource { - ipMask?: string; - action?: string; - filterName?: string; -} - -/** - * @class - * Initializes a new instance of the VirtualNetworkRule class. - * @constructor - * Single item in a List or Get VirtualNetworkRules operation - * - * @member {string} [virtualNetworkSubnetId] ARM ID of Virtual Network Subnet - */ -export interface VirtualNetworkRule extends Resource { - virtualNetworkSubnetId?: string; -} - /** * @class @@ -522,32 +493,6 @@ export interface AuthorizationRuleListResult extends Array { nextLink?: string; } -/** - * @class - * Initializes a new instance of the IpFilterRuleListResult class. - * @constructor - * The response from the List namespace operation. - * - * @member {string} [nextLink] Link to the next set of results. Not empty if - * Value contains an incomplete list of IpFilter Rules - */ -export interface IpFilterRuleListResult extends Array { - nextLink?: string; -} - -/** - * @class - * Initializes a new instance of the VirtualNetworkRuleListResult class. - * @constructor - * The response from the List namespace operation. - * - * @member {string} [nextLink] Link to the next set of results. Not empty if - * Value contains an incomplete list of VirtualNetwork Rules - */ -export interface VirtualNetworkRuleListResult extends Array { - nextLink?: string; -} - /** * @class * Initializes a new instance of the ArmDisasterRecoveryListResult class. diff --git a/lib/services/eventHubManagement/lib/models/index.js b/lib/services/eventHubManagement/lib/models/index.js index 063fde9aed..04a95dd33d 100644 --- a/lib/services/eventHubManagement/lib/models/index.js +++ b/lib/services/eventHubManagement/lib/models/index.js @@ -38,13 +38,9 @@ exports.ArmDisasterRecovery = require('./armDisasterRecovery'); exports.MessagingRegionsProperties = require('./messagingRegionsProperties'); exports.MessagingRegions = require('./messagingRegions'); exports.MessagingPlan = require('./messagingPlan'); -exports.IpFilterRule = require('./ipFilterRule'); -exports.VirtualNetworkRule = require('./virtualNetworkRule'); exports.OperationListResult = require('./operationListResult'); exports.EHNamespaceListResult = require('./eHNamespaceListResult'); exports.AuthorizationRuleListResult = require('./authorizationRuleListResult'); -exports.IpFilterRuleListResult = require('./ipFilterRuleListResult'); -exports.VirtualNetworkRuleListResult = require('./virtualNetworkRuleListResult'); exports.ArmDisasterRecoveryListResult = require('./armDisasterRecoveryListResult'); exports.EventHubListResult = require('./eventHubListResult'); exports.ConsumerGroupListResult = require('./consumerGroupListResult'); diff --git a/lib/services/eventHubManagement/lib/operations/index.d.ts b/lib/services/eventHubManagement/lib/operations/index.d.ts index bddb95a190..a5c329d48a 100644 --- a/lib/services/eventHubManagement/lib/operations/index.d.ts +++ b/lib/services/eventHubManagement/lib/operations/index.d.ts @@ -1144,546 +1144,6 @@ export interface Namespaces { regenerateKeys(resourceGroupName: string, namespaceName: string, authorizationRuleName: string, parameters: models.RegenerateAccessKeyParameters, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; - /** - * Gets a list of IP Filter rules for a 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. - */ - listIPFilterRulesWithHttpOperationResponse(resourceGroupName: string, namespaceName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; - - /** - * Gets a list of IP Filter rules for a 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 {IpFilterRuleListResult} - 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. - * - * {IpFilterRuleListResult} [result] - The deserialized result object if an error did not occur. - * See {@link IpFilterRuleListResult} 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. - */ - listIPFilterRules(resourceGroupName: string, namespaceName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - listIPFilterRules(resourceGroupName: string, namespaceName: string, callback: ServiceCallback): void; - listIPFilterRules(resourceGroupName: string, namespaceName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; - - - /** - * Creates or updates an IpFilterRule for a Namespace. - * - * @param {string} resourceGroupName Name of the resource group within the - * azure subscription. - * - * @param {string} namespaceName The Namespace name - * - * @param {string} ipFilterRuleName The IP Filter Rule name. - * - * @param {object} parameters The Namespace IpFilterRule. - * - * @param {string} [parameters.ipMask] IP Mask - * - * @param {string} [parameters.action] The IP Filter Action. Possible values - * include: 'Accept', 'Reject' - * - * @param {string} [parameters.filterName] IP Filter 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. - */ - createOrUpdateIpFilterRuleWithHttpOperationResponse(resourceGroupName: string, namespaceName: string, ipFilterRuleName: string, parameters: models.IpFilterRule, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; - - /** - * Creates or updates an IpFilterRule for a Namespace. - * - * @param {string} resourceGroupName Name of the resource group within the - * azure subscription. - * - * @param {string} namespaceName The Namespace name - * - * @param {string} ipFilterRuleName The IP Filter Rule name. - * - * @param {object} parameters The Namespace IpFilterRule. - * - * @param {string} [parameters.ipMask] IP Mask - * - * @param {string} [parameters.action] The IP Filter Action. Possible values - * include: 'Accept', 'Reject' - * - * @param {string} [parameters.filterName] IP Filter 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 {IpFilterRule} - 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. - * - * {IpFilterRule} [result] - The deserialized result object if an error did not occur. - * See {@link IpFilterRule} 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. - */ - createOrUpdateIpFilterRule(resourceGroupName: string, namespaceName: string, ipFilterRuleName: string, parameters: models.IpFilterRule, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - createOrUpdateIpFilterRule(resourceGroupName: string, namespaceName: string, ipFilterRuleName: string, parameters: models.IpFilterRule, callback: ServiceCallback): void; - createOrUpdateIpFilterRule(resourceGroupName: string, namespaceName: string, ipFilterRuleName: string, parameters: models.IpFilterRule, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; - - - /** - * Deletes an IpFilterRule for a Namespace. - * - * @param {string} resourceGroupName Name of the resource group within the - * azure subscription. - * - * @param {string} namespaceName The Namespace name - * - * @param {string} ipFilterRuleName The IP Filter Rule 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. - */ - deleteIpFilterRuleWithHttpOperationResponse(resourceGroupName: string, namespaceName: string, ipFilterRuleName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; - - /** - * Deletes an IpFilterRule for a Namespace. - * - * @param {string} resourceGroupName Name of the resource group within the - * azure subscription. - * - * @param {string} namespaceName The Namespace name - * - * @param {string} ipFilterRuleName The IP Filter Rule 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 {null} - 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. - * - * {null} [result] - The deserialized result object if an error did not occur. - * - * {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. - */ - deleteIpFilterRule(resourceGroupName: string, namespaceName: string, ipFilterRuleName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - deleteIpFilterRule(resourceGroupName: string, namespaceName: string, ipFilterRuleName: string, callback: ServiceCallback): void; - deleteIpFilterRule(resourceGroupName: string, namespaceName: string, ipFilterRuleName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; - - - /** - * Gets an IpFilterRule for a Namespace by rule name. - * - * @param {string} resourceGroupName Name of the resource group within the - * azure subscription. - * - * @param {string} namespaceName The Namespace name - * - * @param {string} ipFilterRuleName The IP Filter Rule 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. - */ - getIpFilterRuleWithHttpOperationResponse(resourceGroupName: string, namespaceName: string, ipFilterRuleName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; - - /** - * Gets an IpFilterRule for a Namespace by rule name. - * - * @param {string} resourceGroupName Name of the resource group within the - * azure subscription. - * - * @param {string} namespaceName The Namespace name - * - * @param {string} ipFilterRuleName The IP Filter Rule 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 {IpFilterRule} - 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. - * - * {IpFilterRule} [result] - The deserialized result object if an error did not occur. - * See {@link IpFilterRule} 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. - */ - getIpFilterRule(resourceGroupName: string, namespaceName: string, ipFilterRuleName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - getIpFilterRule(resourceGroupName: string, namespaceName: string, ipFilterRuleName: string, callback: ServiceCallback): void; - getIpFilterRule(resourceGroupName: string, namespaceName: string, ipFilterRuleName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; - - - /** - * Gets a list of VirtualNetwork rules for a 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. - */ - listVirtualNetworkRulesWithHttpOperationResponse(resourceGroupName: string, namespaceName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; - - /** - * Gets a list of VirtualNetwork rules for a 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 {VirtualNetworkRuleListResult} - 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. - * - * {VirtualNetworkRuleListResult} [result] - The deserialized result object if an error did not occur. - * See {@link VirtualNetworkRuleListResult} 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. - */ - listVirtualNetworkRules(resourceGroupName: string, namespaceName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - listVirtualNetworkRules(resourceGroupName: string, namespaceName: string, callback: ServiceCallback): void; - listVirtualNetworkRules(resourceGroupName: string, namespaceName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; - - - /** - * Creates or updates an VirtualNetworkRule for a Namespace. - * - * @param {string} resourceGroupName Name of the resource group within the - * azure subscription. - * - * @param {string} namespaceName The Namespace name - * - * @param {string} virtualNetworkRuleName The Virtual Network Rule name. - * - * @param {object} parameters The Namespace VirtualNetworkRule. - * - * @param {string} [parameters.virtualNetworkSubnetId] ARM ID of Virtual - * Network Subnet - * - * @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. - */ - createOrUpdateVirtualNetworkRuleWithHttpOperationResponse(resourceGroupName: string, namespaceName: string, virtualNetworkRuleName: string, parameters: models.VirtualNetworkRule, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; - - /** - * Creates or updates an VirtualNetworkRule for a Namespace. - * - * @param {string} resourceGroupName Name of the resource group within the - * azure subscription. - * - * @param {string} namespaceName The Namespace name - * - * @param {string} virtualNetworkRuleName The Virtual Network Rule name. - * - * @param {object} parameters The Namespace VirtualNetworkRule. - * - * @param {string} [parameters.virtualNetworkSubnetId] ARM ID of Virtual - * Network Subnet - * - * @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 {VirtualNetworkRule} - 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. - * - * {VirtualNetworkRule} [result] - The deserialized result object if an error did not occur. - * See {@link VirtualNetworkRule} 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. - */ - createOrUpdateVirtualNetworkRule(resourceGroupName: string, namespaceName: string, virtualNetworkRuleName: string, parameters: models.VirtualNetworkRule, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - createOrUpdateVirtualNetworkRule(resourceGroupName: string, namespaceName: string, virtualNetworkRuleName: string, parameters: models.VirtualNetworkRule, callback: ServiceCallback): void; - createOrUpdateVirtualNetworkRule(resourceGroupName: string, namespaceName: string, virtualNetworkRuleName: string, parameters: models.VirtualNetworkRule, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; - - - /** - * Deletes an VirtualNetworkRule for a Namespace. - * - * @param {string} resourceGroupName Name of the resource group within the - * azure subscription. - * - * @param {string} namespaceName The Namespace name - * - * @param {string} virtualNetworkRuleName The Virtual Network Rule 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. - */ - deleteVirtualNetworkRuleWithHttpOperationResponse(resourceGroupName: string, namespaceName: string, virtualNetworkRuleName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; - - /** - * Deletes an VirtualNetworkRule for a Namespace. - * - * @param {string} resourceGroupName Name of the resource group within the - * azure subscription. - * - * @param {string} namespaceName The Namespace name - * - * @param {string} virtualNetworkRuleName The Virtual Network Rule 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 {null} - 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. - * - * {null} [result] - The deserialized result object if an error did not occur. - * - * {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. - */ - deleteVirtualNetworkRule(resourceGroupName: string, namespaceName: string, virtualNetworkRuleName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - deleteVirtualNetworkRule(resourceGroupName: string, namespaceName: string, virtualNetworkRuleName: string, callback: ServiceCallback): void; - deleteVirtualNetworkRule(resourceGroupName: string, namespaceName: string, virtualNetworkRuleName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; - - - /** - * Gets an VirtualNetworkRule for a Namespace by rule name. - * - * @param {string} resourceGroupName Name of the resource group within the - * azure subscription. - * - * @param {string} namespaceName The Namespace name - * - * @param {string} virtualNetworkRuleName The Virtual Network Rule 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. - */ - getVirtualNetworkRuleWithHttpOperationResponse(resourceGroupName: string, namespaceName: string, virtualNetworkRuleName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; - - /** - * Gets an VirtualNetworkRule for a Namespace by rule name. - * - * @param {string} resourceGroupName Name of the resource group within the - * azure subscription. - * - * @param {string} namespaceName The Namespace name - * - * @param {string} virtualNetworkRuleName The Virtual Network Rule 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 {VirtualNetworkRule} - 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. - * - * {VirtualNetworkRule} [result] - The deserialized result object if an error did not occur. - * See {@link VirtualNetworkRule} 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. - */ - getVirtualNetworkRule(resourceGroupName: string, namespaceName: string, virtualNetworkRuleName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - getVirtualNetworkRule(resourceGroupName: string, namespaceName: string, virtualNetworkRuleName: string, callback: ServiceCallback): void; - getVirtualNetworkRule(resourceGroupName: string, namespaceName: string, virtualNetworkRuleName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; - - /** * Creates or updates a namespace. Once created, this namespace's resource * manifest is immutable. This operation is idempotent. @@ -2035,122 +1495,6 @@ export interface Namespaces { listAuthorizationRulesNext(nextPageLink: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; listAuthorizationRulesNext(nextPageLink: string, callback: ServiceCallback): void; listAuthorizationRulesNext(nextPageLink: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; - - - /** - * Gets a list of IP Filter rules for a Namespace. - * - * @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. - */ - listIPFilterRulesNextWithHttpOperationResponse(nextPageLink: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; - - /** - * Gets a list of IP Filter rules for a Namespace. - * - * @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 {IpFilterRuleListResult} - 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. - * - * {IpFilterRuleListResult} [result] - The deserialized result object if an error did not occur. - * See {@link IpFilterRuleListResult} 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. - */ - listIPFilterRulesNext(nextPageLink: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - listIPFilterRulesNext(nextPageLink: string, callback: ServiceCallback): void; - listIPFilterRulesNext(nextPageLink: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; - - - /** - * Gets a list of VirtualNetwork rules for a Namespace. - * - * @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. - */ - listVirtualNetworkRulesNextWithHttpOperationResponse(nextPageLink: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; - - /** - * Gets a list of VirtualNetwork rules for a Namespace. - * - * @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 {VirtualNetworkRuleListResult} - 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. - * - * {VirtualNetworkRuleListResult} [result] - The deserialized result object if an error did not occur. - * See {@link VirtualNetworkRuleListResult} 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. - */ - listVirtualNetworkRulesNext(nextPageLink: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - listVirtualNetworkRulesNext(nextPageLink: string, callback: ServiceCallback): void; - listVirtualNetworkRulesNext(nextPageLink: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; } /** diff --git a/lib/services/eventHubManagement/lib/operations/namespaces.js b/lib/services/eventHubManagement/lib/operations/namespaces.js index 6842ca24ba..60f36aef10 100644 --- a/lib/services/eventHubManagement/lib/operations/namespaces.js +++ b/lib/services/eventHubManagement/lib/operations/namespaces.js @@ -2304,13 +2304,41 @@ function _regenerateKeys(resourceGroupName, namespaceName, authorizationRuleName } /** - * Gets a list of IP Filter rules for a Namespace. + * Creates or updates a namespace. Once created, this namespace's resource + * manifest is immutable. This operation is idempotent. * * @param {string} resourceGroupName Name of the resource group within the * azure subscription. * * @param {string} namespaceName The Namespace name * + * @param {object} parameters Parameters for creating a namespace resource. + * + * @param {object} [parameters.sku] Properties of sku resource + * + * @param {string} parameters.sku.name Name of this SKU. Possible values + * include: 'Basic', 'Standard' + * + * @param {string} [parameters.sku.tier] The billing tier of this particular + * SKU. Possible values include: 'Basic', 'Standard' + * + * @param {number} [parameters.sku.capacity] The Event Hubs throughput units, + * vaule should be 0 to 20 throughput units. + * + * @param {boolean} [parameters.isAutoInflateEnabled] Value that indicates + * whether AutoInflate is enabled for eventhub namespace. + * + * @param {number} [parameters.maximumThroughputUnits] Upper limit of + * throughput units when AutoInflate is enabled, vaule should be within 0 to 20 + * throughput units. ( '0' if AutoInflateEnabled = true) + * + * @param {boolean} [parameters.kafkaEnabled] Value that indicates whether + * Kafka is enabled for eventhub namespace. + * + * @param {string} [parameters.location] Resource location + * + * @param {object} [parameters.tags] Resource tags + * * @param {object} [options] Optional Parameters. * * @param {object} [options.customHeaders] Headers that will be added to the @@ -2323,14 +2351,13 @@ function _regenerateKeys(resourceGroupName, namespaceName, authorizationRuleName * {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 IpFilterRuleListResult} for more - * information. + * See {@link EHNamespace} 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 _listIPFilterRules(resourceGroupName, namespaceName, options, callback) { +function _beginCreateOrUpdate(resourceGroupName, namespaceName, parameters, options, callback) { /* jshint validthis: true */ let client = this.client; if(!callback && typeof options === 'function') { @@ -2368,6 +2395,9 @@ function _listIPFilterRules(resourceGroupName, namespaceName, options, callback) throw new Error('"namespaceName" should satisfy the constraint - "MinLength": 6'); } } + if (parameters === null || parameters === undefined) { + throw new Error('parameters cannot be null or undefined.'); + } 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.'); } @@ -2383,7 +2413,7 @@ function _listIPFilterRules(resourceGroupName, namespaceName, options, callback) // Construct URL let baseUrl = this.client.baseUri; - let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventHub/namespaces/{namespaceName}/ipfilterrules'; + let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventHub/namespaces/{namespaceName}'; requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); requestUrl = requestUrl.replace('{namespaceName}', encodeURIComponent(namespaceName)); requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); @@ -2395,7 +2425,7 @@ function _listIPFilterRules(resourceGroupName, namespaceName, options, callback) // Create HTTP transport objects let httpRequest = new WebResource(); - httpRequest.method = 'GET'; + httpRequest.method = 'PUT'; httpRequest.url = requestUrl; httpRequest.headers = {}; // Set Headers @@ -2413,14 +2443,28 @@ function _listIPFilterRules(resourceGroupName, namespaceName, options, callback) } } } - httpRequest.body = null; + // Serialize Request + let requestContent = null; + let requestModel = null; + try { + if (parameters !== null && parameters !== undefined) { + let requestModelMapper = new client.models['EHNamespace']().mapper(); + requestModel = client.serialize(requestModelMapper, parameters, 'parameters'); + requestContent = JSON.stringify(requestModel); + } + } catch (error) { + let serializationError = new Error(`Error "${error.message}" occurred in serializing the ` + + `payload - ${JSON.stringify(parameters, null, 2)}.`); + return callback(serializationError); + } + httpRequest.body = requestContent; // Send Request return client.pipeline(httpRequest, (err, response, responseBody) => { if (err) { return callback(err); } let statusCode = response.statusCode; - if (statusCode !== 200) { + if (statusCode !== 200 && statusCode !== 201 && statusCode !== 202) { let error = new Error(responseBody); error.statusCode = response.statusCode; error.request = msRest.stripRequest(httpRequest); @@ -2456,7 +2500,7 @@ function _listIPFilterRules(resourceGroupName, namespaceName, options, callback) parsedResponse = JSON.parse(responseBody); result = JSON.parse(responseBody); if (parsedResponse !== null && parsedResponse !== undefined) { - let resultMapper = new client.models['IpFilterRuleListResult']().mapper(); + let resultMapper = new client.models['EHNamespace']().mapper(); result = client.deserialize(resultMapper, parsedResponse, 'result'); } } catch (error) { @@ -2466,30 +2510,37 @@ function _listIPFilterRules(resourceGroupName, namespaceName, options, callback) return callback(deserializationError); } } + // Deserialize Response + if (statusCode === 201) { + let parsedResponse = null; + try { + parsedResponse = JSON.parse(responseBody); + result = JSON.parse(responseBody); + if (parsedResponse !== null && parsedResponse !== undefined) { + let resultMapper = new client.models['EHNamespace']().mapper(); + result = client.deserialize(resultMapper, parsedResponse, 'result'); + } + } catch (error) { + let deserializationError1 = new Error(`Error ${error} occurred in deserializing the responseBody - ${responseBody}`); + deserializationError1.request = msRest.stripRequest(httpRequest); + deserializationError1.response = msRest.stripResponse(response); + return callback(deserializationError1); + } + } return callback(null, result, httpRequest, response); }); } /** - * Creates or updates an IpFilterRule for a Namespace. + * Deletes an existing namespace. This operation also removes all associated + * resources under the namespace. * * @param {string} resourceGroupName Name of the resource group within the * azure subscription. * * @param {string} namespaceName The Namespace name * - * @param {string} ipFilterRuleName The IP Filter Rule name. - * - * @param {object} parameters The Namespace IpFilterRule. - * - * @param {string} [parameters.ipMask] IP Mask - * - * @param {string} [parameters.action] The IP Filter Action. Possible values - * include: 'Accept', 'Reject' - * - * @param {string} [parameters.filterName] IP Filter name - * * @param {object} [options] Optional Parameters. * * @param {object} [options.customHeaders] Headers that will be added to the @@ -2501,14 +2552,13 @@ function _listIPFilterRules(resourceGroupName, namespaceName, options, callback) * * {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 IpFilterRule} for more information. + * {null} [result] - The deserialized result object if an error did not occur. * * {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 _createOrUpdateIpFilterRule(resourceGroupName, namespaceName, ipFilterRuleName, parameters, options, callback) { +function _beginDeleteMethod(resourceGroupName, namespaceName, options, callback) { /* jshint validthis: true */ let client = this.client; if(!callback && typeof options === 'function') { @@ -2546,18 +2596,6 @@ function _createOrUpdateIpFilterRule(resourceGroupName, namespaceName, ipFilterR throw new Error('"namespaceName" should satisfy the constraint - "MinLength": 6'); } } - if (ipFilterRuleName === null || ipFilterRuleName === undefined || typeof ipFilterRuleName.valueOf() !== 'string') { - throw new Error('ipFilterRuleName cannot be null or undefined and it must be of type string.'); - } - if (ipFilterRuleName !== null && ipFilterRuleName !== undefined) { - if (ipFilterRuleName.length < 1) - { - throw new Error('"ipFilterRuleName" should satisfy the constraint - "MinLength": 1'); - } - } - if (parameters === null || parameters === undefined) { - throw new Error('parameters cannot be null or undefined.'); - } 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.'); } @@ -2573,10 +2611,9 @@ function _createOrUpdateIpFilterRule(resourceGroupName, namespaceName, ipFilterR // Construct URL let baseUrl = this.client.baseUri; - let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventHub/namespaces/{namespaceName}/ipfilterrules/{ipFilterRuleName}'; + let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventHub/namespaces/{namespaceName}'; requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); requestUrl = requestUrl.replace('{namespaceName}', encodeURIComponent(namespaceName)); - requestUrl = requestUrl.replace('{ipFilterRuleName}', encodeURIComponent(ipFilterRuleName)); requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); let queryParameters = []; queryParameters.push('api-version=' + encodeURIComponent(this.client.apiVersion)); @@ -2586,7 +2623,7 @@ function _createOrUpdateIpFilterRule(resourceGroupName, namespaceName, ipFilterR // Create HTTP transport objects let httpRequest = new WebResource(); - httpRequest.method = 'PUT'; + httpRequest.method = 'DELETE'; httpRequest.url = requestUrl; httpRequest.headers = {}; // Set Headers @@ -2604,28 +2641,14 @@ function _createOrUpdateIpFilterRule(resourceGroupName, namespaceName, ipFilterR } } } - // Serialize Request - let requestContent = null; - let requestModel = null; - try { - if (parameters !== null && parameters !== undefined) { - let requestModelMapper = new client.models['IpFilterRule']().mapper(); - requestModel = client.serialize(requestModelMapper, parameters, 'parameters'); - requestContent = JSON.stringify(requestModel); - } - } catch (error) { - let serializationError = new Error(`Error "${error.message}" occurred in serializing the ` + - `payload - ${JSON.stringify(parameters, null, 2)}.`); - return callback(serializationError); - } - httpRequest.body = requestContent; + httpRequest.body = null; // Send Request return client.pipeline(httpRequest, (err, response, responseBody) => { if (err) { return callback(err); } let statusCode = response.statusCode; - if (statusCode !== 200) { + if (statusCode !== 200 && statusCode !== 202 && statusCode !== 204) { let error = new Error(responseBody); error.statusCode = response.statusCode; error.request = msRest.stripRequest(httpRequest); @@ -2654,37 +2677,17 @@ function _createOrUpdateIpFilterRule(resourceGroupName, namespaceName, ipFilterR // 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['IpFilterRule']().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); }); } /** - * Deletes an IpFilterRule for a Namespace. - * - * @param {string} resourceGroupName Name of the resource group within the - * azure subscription. - * - * @param {string} namespaceName The Namespace name + * Lists all the available Namespaces within a subscription, irrespective of + * the resource groups. * - * @param {string} ipFilterRuleName The IP Filter Rule name. + * @param {string} nextPageLink The NextLink from the previous successful call + * to List operation. * * @param {object} [options] Optional Parameters. * @@ -2697,13 +2700,14 @@ function _createOrUpdateIpFilterRule(resourceGroupName, namespaceName, ipFilterR * * {Error} err - The Error object if an error occurred, null otherwise. * - * {null} [result] - The deserialized result object if an error did not occur. + * {object} [result] - The deserialized result object if an error did not occur. + * See {@link EHNamespaceListResult} 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 _deleteIpFilterRule(resourceGroupName, namespaceName, ipFilterRuleName, options, callback) { +function _listNext(nextPageLink, options, callback) { /* jshint validthis: true */ let client = this.client; if(!callback && typeof options === 'function') { @@ -2715,46 +2719,8 @@ function _deleteIpFilterRule(resourceGroupName, namespaceName, ipFilterRuleName, } // 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 (ipFilterRuleName === null || ipFilterRuleName === undefined || typeof ipFilterRuleName.valueOf() !== 'string') { - throw new Error('ipFilterRuleName cannot be null or undefined and it must be of type string.'); - } - if (ipFilterRuleName !== null && ipFilterRuleName !== undefined) { - if (ipFilterRuleName.length < 1) - { - throw new Error('"ipFilterRuleName" should satisfy the constraint - "MinLength": 1'); - } - } - 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 (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.'); @@ -2764,21 +2730,12 @@ function _deleteIpFilterRule(resourceGroupName, namespaceName, ipFilterRuleName, } // Construct URL - let baseUrl = this.client.baseUri; - let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventHub/namespaces/{namespaceName}/ipfilterrules/{ipFilterRuleName}'; - requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); - requestUrl = requestUrl.replace('{namespaceName}', encodeURIComponent(namespaceName)); - requestUrl = requestUrl.replace('{ipFilterRuleName}', encodeURIComponent(ipFilterRuleName)); - 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('&'); - } + let requestUrl = '{nextLink}'; + requestUrl = requestUrl.replace('{nextLink}', nextPageLink); // Create HTTP transport objects let httpRequest = new WebResource(); - httpRequest.method = 'DELETE'; + httpRequest.method = 'GET'; httpRequest.url = requestUrl; httpRequest.headers = {}; // Set Headers @@ -2803,7 +2760,7 @@ function _deleteIpFilterRule(resourceGroupName, namespaceName, ipFilterRuleName, return callback(err); } let statusCode = response.statusCode; - if (statusCode !== 200 && statusCode !== 204) { + if (statusCode !== 200) { let error = new Error(responseBody); error.statusCode = response.statusCode; error.request = msRest.stripRequest(httpRequest); @@ -2832,20 +2789,33 @@ function _deleteIpFilterRule(resourceGroupName, namespaceName, ipFilterRuleName, // 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['EHNamespaceListResult']().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 an IpFilterRule for a Namespace by rule name. - * - * @param {string} resourceGroupName Name of the resource group within the - * azure subscription. - * - * @param {string} namespaceName The Namespace name + * Lists the available Namespaces within a resource group. * - * @param {string} ipFilterRuleName The IP Filter Rule name. + * @param {string} nextPageLink The NextLink from the previous successful call + * to List operation. * * @param {object} [options] Optional Parameters. * @@ -2859,13 +2829,13 @@ function _deleteIpFilterRule(resourceGroupName, namespaceName, ipFilterRuleName, * {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 IpFilterRule} for more information. + * See {@link EHNamespaceListResult} 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 _getIpFilterRule(resourceGroupName, namespaceName, ipFilterRuleName, options, callback) { +function _listByResourceGroupNext(nextPageLink, options, callback) { /* jshint validthis: true */ let client = this.client; if(!callback && typeof options === 'function') { @@ -2877,46 +2847,8 @@ function _getIpFilterRule(resourceGroupName, namespaceName, ipFilterRuleName, op } // 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 (ipFilterRuleName === null || ipFilterRuleName === undefined || typeof ipFilterRuleName.valueOf() !== 'string') { - throw new Error('ipFilterRuleName cannot be null or undefined and it must be of type string.'); - } - if (ipFilterRuleName !== null && ipFilterRuleName !== undefined) { - if (ipFilterRuleName.length < 1) - { - throw new Error('"ipFilterRuleName" should satisfy the constraint - "MinLength": 1'); - } - } - 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 (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.'); @@ -2926,17 +2858,8 @@ function _getIpFilterRule(resourceGroupName, namespaceName, ipFilterRuleName, op } // Construct URL - let baseUrl = this.client.baseUri; - let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventHub/namespaces/{namespaceName}/ipfilterrules/{ipFilterRuleName}'; - requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); - requestUrl = requestUrl.replace('{namespaceName}', encodeURIComponent(namespaceName)); - requestUrl = requestUrl.replace('{ipFilterRuleName}', encodeURIComponent(ipFilterRuleName)); - 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('&'); - } + let requestUrl = '{nextLink}'; + requestUrl = requestUrl.replace('{nextLink}', nextPageLink); // Create HTTP transport objects let httpRequest = new WebResource(); @@ -3001,7 +2924,7 @@ function _getIpFilterRule(resourceGroupName, namespaceName, ipFilterRuleName, op parsedResponse = JSON.parse(responseBody); result = JSON.parse(responseBody); if (parsedResponse !== null && parsedResponse !== undefined) { - let resultMapper = new client.models['IpFilterRule']().mapper(); + let resultMapper = new client.models['EHNamespaceListResult']().mapper(); result = client.deserialize(resultMapper, parsedResponse, 'result'); } } catch (error) { @@ -3017,12 +2940,10 @@ function _getIpFilterRule(resourceGroupName, namespaceName, ipFilterRuleName, op } /** - * Gets a list of VirtualNetwork rules for a Namespace. - * - * @param {string} resourceGroupName Name of the resource group within the - * azure subscription. + * Gets a list of authorization rules for a Namespace. * - * @param {string} namespaceName The Namespace name + * @param {string} nextPageLink The NextLink from the previous successful call + * to List operation. * * @param {object} [options] Optional Parameters. * @@ -3036,14 +2957,14 @@ function _getIpFilterRule(resourceGroupName, namespaceName, ipFilterRuleName, op * {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 VirtualNetworkRuleListResult} for more + * See {@link AuthorizationRuleListResult} 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 _listVirtualNetworkRules(resourceGroupName, namespaceName, options, callback) { +function _listAuthorizationRulesNext(nextPageLink, options, callback) { /* jshint validthis: true */ let client = this.client; if(!callback && typeof options === 'function') { @@ -3055,37 +2976,8 @@ function _listVirtualNetworkRules(resourceGroupName, namespaceName, options, cal } // 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 (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.'); @@ -3095,16 +2987,8 @@ function _listVirtualNetworkRules(resourceGroupName, namespaceName, options, cal } // Construct URL - let baseUrl = this.client.baseUri; - let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventHub/namespaces/{namespaceName}/virtualnetworkrules'; - 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('&'); - } + let requestUrl = '{nextLink}'; + requestUrl = requestUrl.replace('{nextLink}', nextPageLink); // Create HTTP transport objects let httpRequest = new WebResource(); @@ -3169,7 +3053,7 @@ function _listVirtualNetworkRules(resourceGroupName, namespaceName, options, cal parsedResponse = JSON.parse(responseBody); result = JSON.parse(responseBody); if (parsedResponse !== null && parsedResponse !== undefined) { - let resultMapper = new client.models['VirtualNetworkRuleListResult']().mapper(); + let resultMapper = new client.models['AuthorizationRuleListResult']().mapper(); result = client.deserialize(resultMapper, parsedResponse, 'result'); } } catch (error) { @@ -3184,2457 +3068,77 @@ function _listVirtualNetworkRules(resourceGroupName, namespaceName, options, cal }); } -/** - * Creates or updates an VirtualNetworkRule for a Namespace. - * - * @param {string} resourceGroupName Name of the resource group within the - * azure subscription. - * - * @param {string} namespaceName The Namespace name - * - * @param {string} virtualNetworkRuleName The Virtual Network Rule name. - * - * @param {object} parameters The Namespace VirtualNetworkRule. - * - * @param {string} [parameters.virtualNetworkSubnetId] ARM ID of Virtual - * Network Subnet - * - * @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 VirtualNetworkRule} 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 _createOrUpdateVirtualNetworkRule(resourceGroupName, namespaceName, virtualNetworkRuleName, parameters, 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 (virtualNetworkRuleName === null || virtualNetworkRuleName === undefined || typeof virtualNetworkRuleName.valueOf() !== 'string') { - throw new Error('virtualNetworkRuleName cannot be null or undefined and it must be of type string.'); - } - if (virtualNetworkRuleName !== null && virtualNetworkRuleName !== undefined) { - if (virtualNetworkRuleName.length < 1) - { - throw new Error('"virtualNetworkRuleName" should satisfy the constraint - "MinLength": 1'); - } - } - if (parameters === null || parameters === undefined) { - throw new Error('parameters cannot be null or undefined.'); - } - 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); +/** Class representing a Namespaces. */ +class Namespaces { + /** + * Create a Namespaces. + * @param {EventHubManagementClient} client Reference to the service client. + */ + constructor(client) { + this.client = client; + this._checkNameAvailability = _checkNameAvailability; + this._list = _list; + this._listByResourceGroup = _listByResourceGroup; + this._createOrUpdate = _createOrUpdate; + this._deleteMethod = _deleteMethod; + this._get = _get; + this._update = _update; + this._getMessagingPlan = _getMessagingPlan; + this._listAuthorizationRules = _listAuthorizationRules; + this._createOrUpdateAuthorizationRule = _createOrUpdateAuthorizationRule; + this._deleteAuthorizationRule = _deleteAuthorizationRule; + this._getAuthorizationRule = _getAuthorizationRule; + this._listKeys = _listKeys; + this._regenerateKeys = _regenerateKeys; + this._beginCreateOrUpdate = _beginCreateOrUpdate; + this._beginDeleteMethod = _beginDeleteMethod; + this._listNext = _listNext; + this._listByResourceGroupNext = _listByResourceGroupNext; + this._listAuthorizationRulesNext = _listAuthorizationRulesNext; } - // Construct URL - let baseUrl = this.client.baseUri; - let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventHub/namespaces/{namespaceName}/virtualnetworkrules/{virtualNetworkRuleName}'; - requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); - requestUrl = requestUrl.replace('{namespaceName}', encodeURIComponent(namespaceName)); - requestUrl = requestUrl.replace('{virtualNetworkRuleName}', encodeURIComponent(virtualNetworkRuleName)); - 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 = 'PUT'; - 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]; - } - } - } - // Serialize Request - let requestContent = null; - let requestModel = null; - try { - if (parameters !== null && parameters !== undefined) { - let requestModelMapper = new client.models['VirtualNetworkRule']().mapper(); - requestModel = client.serialize(requestModelMapper, parameters, 'parameters'); - requestContent = JSON.stringify(requestModel); - } - } catch (error) { - let serializationError = new Error(`Error "${error.message}" occurred in serializing the ` + - `payload - ${JSON.stringify(parameters, null, 2)}.`); - return callback(serializationError); - } - httpRequest.body = requestContent; - // 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['VirtualNetworkRule']().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); - }); -} - -/** - * Deletes an VirtualNetworkRule for a Namespace. - * - * @param {string} resourceGroupName Name of the resource group within the - * azure subscription. - * - * @param {string} namespaceName The Namespace name - * - * @param {string} virtualNetworkRuleName The Virtual Network Rule 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. - * - * {null} [result] - The deserialized result object if an error did not occur. - * - * {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 _deleteVirtualNetworkRule(resourceGroupName, namespaceName, virtualNetworkRuleName, 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 (virtualNetworkRuleName === null || virtualNetworkRuleName === undefined || typeof virtualNetworkRuleName.valueOf() !== 'string') { - throw new Error('virtualNetworkRuleName cannot be null or undefined and it must be of type string.'); - } - if (virtualNetworkRuleName !== null && virtualNetworkRuleName !== undefined) { - if (virtualNetworkRuleName.length < 1) - { - throw new Error('"virtualNetworkRuleName" should satisfy the constraint - "MinLength": 1'); - } - } - 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}/virtualnetworkrules/{virtualNetworkRuleName}'; - requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); - requestUrl = requestUrl.replace('{namespaceName}', encodeURIComponent(namespaceName)); - requestUrl = requestUrl.replace('{virtualNetworkRuleName}', encodeURIComponent(virtualNetworkRuleName)); - 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 = 'DELETE'; - 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 && statusCode !== 204) { - 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; - - return callback(null, result, httpRequest, response); - }); -} - -/** - * Gets an VirtualNetworkRule for a Namespace by rule name. - * - * @param {string} resourceGroupName Name of the resource group within the - * azure subscription. - * - * @param {string} namespaceName The Namespace name - * - * @param {string} virtualNetworkRuleName The Virtual Network Rule 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 VirtualNetworkRule} 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 _getVirtualNetworkRule(resourceGroupName, namespaceName, virtualNetworkRuleName, 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 (virtualNetworkRuleName === null || virtualNetworkRuleName === undefined || typeof virtualNetworkRuleName.valueOf() !== 'string') { - throw new Error('virtualNetworkRuleName cannot be null or undefined and it must be of type string.'); - } - if (virtualNetworkRuleName !== null && virtualNetworkRuleName !== undefined) { - if (virtualNetworkRuleName.length < 1) - { - throw new Error('"virtualNetworkRuleName" should satisfy the constraint - "MinLength": 1'); - } - } - 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}/virtualnetworkrules/{virtualNetworkRuleName}'; - requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); - requestUrl = requestUrl.replace('{namespaceName}', encodeURIComponent(namespaceName)); - requestUrl = requestUrl.replace('{virtualNetworkRuleName}', encodeURIComponent(virtualNetworkRuleName)); - 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) { - 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['VirtualNetworkRule']().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); - }); -} - -/** - * Creates or updates a namespace. Once created, this namespace's resource - * manifest is immutable. This operation is idempotent. - * - * @param {string} resourceGroupName Name of the resource group within the - * azure subscription. - * - * @param {string} namespaceName The Namespace name - * - * @param {object} parameters Parameters for creating a namespace resource. - * - * @param {object} [parameters.sku] Properties of sku resource - * - * @param {string} parameters.sku.name Name of this SKU. Possible values - * include: 'Basic', 'Standard' - * - * @param {string} [parameters.sku.tier] The billing tier of this particular - * SKU. Possible values include: 'Basic', 'Standard' - * - * @param {number} [parameters.sku.capacity] The Event Hubs throughput units, - * vaule should be 0 to 20 throughput units. - * - * @param {boolean} [parameters.isAutoInflateEnabled] Value that indicates - * whether AutoInflate is enabled for eventhub namespace. - * - * @param {number} [parameters.maximumThroughputUnits] Upper limit of - * throughput units when AutoInflate is enabled, vaule should be within 0 to 20 - * throughput units. ( '0' if AutoInflateEnabled = true) - * - * @param {boolean} [parameters.kafkaEnabled] Value that indicates whether - * Kafka is enabled for eventhub namespace. - * - * @param {string} [parameters.location] Resource location - * - * @param {object} [parameters.tags] Resource tags - * - * @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 EHNamespace} 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 _beginCreateOrUpdate(resourceGroupName, namespaceName, parameters, 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 (parameters === null || parameters === undefined) { - throw new Error('parameters cannot be null or undefined.'); - } - 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}'; - 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 = 'PUT'; - 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]; - } - } - } - // Serialize Request - let requestContent = null; - let requestModel = null; - try { - if (parameters !== null && parameters !== undefined) { - let requestModelMapper = new client.models['EHNamespace']().mapper(); - requestModel = client.serialize(requestModelMapper, parameters, 'parameters'); - requestContent = JSON.stringify(requestModel); - } - } catch (error) { - let serializationError = new Error(`Error "${error.message}" occurred in serializing the ` + - `payload - ${JSON.stringify(parameters, null, 2)}.`); - return callback(serializationError); - } - httpRequest.body = requestContent; - // Send Request - return client.pipeline(httpRequest, (err, response, responseBody) => { - if (err) { - return callback(err); - } - let statusCode = response.statusCode; - if (statusCode !== 200 && statusCode !== 201 && statusCode !== 202) { - 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['EHNamespace']().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); - } - } - // Deserialize Response - if (statusCode === 201) { - let parsedResponse = null; - try { - parsedResponse = JSON.parse(responseBody); - result = JSON.parse(responseBody); - if (parsedResponse !== null && parsedResponse !== undefined) { - let resultMapper = new client.models['EHNamespace']().mapper(); - result = client.deserialize(resultMapper, parsedResponse, 'result'); - } - } catch (error) { - let deserializationError1 = new Error(`Error ${error} occurred in deserializing the responseBody - ${responseBody}`); - deserializationError1.request = msRest.stripRequest(httpRequest); - deserializationError1.response = msRest.stripResponse(response); - return callback(deserializationError1); - } - } - - return callback(null, result, httpRequest, response); - }); -} - -/** - * Deletes an existing namespace. This operation also removes all associated - * resources under the 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. - * - * {null} [result] - The deserialized result object if an error did not occur. - * - * {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 _beginDeleteMethod(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}'; - 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 = 'DELETE'; - 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 && statusCode !== 202 && statusCode !== 204) { - 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; - - return callback(null, result, httpRequest, response); - }); -} - -/** - * Lists all the available Namespaces within a subscription, irrespective of - * the resource groups. - * - * @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 EHNamespaceListResult} 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 _listNext(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['EHNamespaceListResult']().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); - }); -} - -/** - * Lists the available Namespaces within a resource group. - * - * @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 EHNamespaceListResult} 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 _listByResourceGroupNext(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['EHNamespaceListResult']().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 a list of authorization rules for a Namespace. - * - * @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 AuthorizationRuleListResult} 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 _listAuthorizationRulesNext(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['AuthorizationRuleListResult']().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 a list of IP Filter rules for a Namespace. - * - * @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 IpFilterRuleListResult} 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 _listIPFilterRulesNext(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['IpFilterRuleListResult']().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 a list of VirtualNetwork rules for a Namespace. - * - * @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 VirtualNetworkRuleListResult} 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 _listVirtualNetworkRulesNext(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['VirtualNetworkRuleListResult']().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 Namespaces. */ -class Namespaces { - /** - * Create a Namespaces. - * @param {EventHubManagementClient} client Reference to the service client. - */ - constructor(client) { - this.client = client; - this._checkNameAvailability = _checkNameAvailability; - this._list = _list; - this._listByResourceGroup = _listByResourceGroup; - this._createOrUpdate = _createOrUpdate; - this._deleteMethod = _deleteMethod; - this._get = _get; - this._update = _update; - this._getMessagingPlan = _getMessagingPlan; - this._listAuthorizationRules = _listAuthorizationRules; - this._createOrUpdateAuthorizationRule = _createOrUpdateAuthorizationRule; - this._deleteAuthorizationRule = _deleteAuthorizationRule; - this._getAuthorizationRule = _getAuthorizationRule; - this._listKeys = _listKeys; - this._regenerateKeys = _regenerateKeys; - this._listIPFilterRules = _listIPFilterRules; - this._createOrUpdateIpFilterRule = _createOrUpdateIpFilterRule; - this._deleteIpFilterRule = _deleteIpFilterRule; - this._getIpFilterRule = _getIpFilterRule; - this._listVirtualNetworkRules = _listVirtualNetworkRules; - this._createOrUpdateVirtualNetworkRule = _createOrUpdateVirtualNetworkRule; - this._deleteVirtualNetworkRule = _deleteVirtualNetworkRule; - this._getVirtualNetworkRule = _getVirtualNetworkRule; - this._beginCreateOrUpdate = _beginCreateOrUpdate; - this._beginDeleteMethod = _beginDeleteMethod; - this._listNext = _listNext; - this._listByResourceGroupNext = _listByResourceGroupNext; - this._listAuthorizationRulesNext = _listAuthorizationRulesNext; - this._listIPFilterRulesNext = _listIPFilterRulesNext; - this._listVirtualNetworkRulesNext = _listVirtualNetworkRulesNext; - } - - /** - * Check the give Namespace name availability. - * - * @param {object} parameters Parameters to check availability of the given - * Namespace name - * - * @param {string} parameters.name Name to check the namespace name - * availability - * - * @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. - */ - checkNameAvailabilityWithHttpOperationResponse(parameters, options) { - let client = this.client; - let self = this; - return new Promise((resolve, reject) => { - self._checkNameAvailability(parameters, options, (err, result, request, response) => { - let httpOperationResponse = new msRest.HttpOperationResponse(request, response); - httpOperationResponse.body = result; - if (err) { reject(err); } - else { resolve(httpOperationResponse); } - return; - }); - }); - } - - /** - * Check the give Namespace name availability. - * - * @param {object} parameters Parameters to check availability of the given - * Namespace name - * - * @param {string} parameters.name Name to check the namespace name - * availability - * - * @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 {CheckNameAvailabilityResult} - 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 CheckNameAvailabilityResult} 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. - */ - checkNameAvailability(parameters, 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._checkNameAvailability(parameters, options, (err, result, request, response) => { - if (err) { reject(err); } - else { resolve(result); } - return; - }); - }); - } else { - return self._checkNameAvailability(parameters, options, optionalCallback); - } - } - - /** - * Lists all the available Namespaces within a subscription, irrespective of - * the resource groups. - * - * @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. - */ - listWithHttpOperationResponse(options) { - let client = this.client; - let self = this; - return new Promise((resolve, reject) => { - self._list(options, (err, result, request, response) => { - let httpOperationResponse = new msRest.HttpOperationResponse(request, response); - httpOperationResponse.body = result; - if (err) { reject(err); } - else { resolve(httpOperationResponse); } - return; - }); - }); - } - - /** - * Lists all the available Namespaces within a subscription, irrespective of - * the resource groups. - * - * @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 {EHNamespaceListResult} - 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 EHNamespaceListResult} 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. - */ - list(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._list(options, (err, result, request, response) => { - if (err) { reject(err); } - else { resolve(result); } - return; - }); - }); - } else { - return self._list(options, optionalCallback); - } - } - - /** - * Lists the available Namespaces within a resource group. - * - * @param {string} resourceGroupName Name of the resource group within the - * azure subscription. - * - * @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. - */ - listByResourceGroupWithHttpOperationResponse(resourceGroupName, options) { - let client = this.client; - let self = this; - return new Promise((resolve, reject) => { - self._listByResourceGroup(resourceGroupName, options, (err, result, request, response) => { - let httpOperationResponse = new msRest.HttpOperationResponse(request, response); - httpOperationResponse.body = result; - if (err) { reject(err); } - else { resolve(httpOperationResponse); } - return; - }); - }); - } - - /** - * Lists the available Namespaces within a resource group. - * - * @param {string} resourceGroupName Name of the resource group within the - * azure subscription. - * - * @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 {EHNamespaceListResult} - 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 EHNamespaceListResult} 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. - */ - listByResourceGroup(resourceGroupName, 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._listByResourceGroup(resourceGroupName, options, (err, result, request, response) => { - if (err) { reject(err); } - else { resolve(result); } - return; - }); - }); - } else { - return self._listByResourceGroup(resourceGroupName, options, optionalCallback); - } - } - - /** - * Creates or updates a namespace. Once created, this namespace's resource - * manifest is immutable. This operation is idempotent. - * - * @param {string} resourceGroupName Name of the resource group within the - * azure subscription. - * - * @param {string} namespaceName The Namespace name - * - * @param {object} parameters Parameters for creating a namespace resource. - * - * @param {object} [parameters.sku] Properties of sku resource - * - * @param {string} parameters.sku.name Name of this SKU. Possible values - * include: 'Basic', 'Standard' - * - * @param {string} [parameters.sku.tier] The billing tier of this particular - * SKU. Possible values include: 'Basic', 'Standard' - * - * @param {number} [parameters.sku.capacity] The Event Hubs throughput units, - * vaule should be 0 to 20 throughput units. - * - * @param {boolean} [parameters.isAutoInflateEnabled] Value that indicates - * whether AutoInflate is enabled for eventhub namespace. - * - * @param {number} [parameters.maximumThroughputUnits] Upper limit of - * throughput units when AutoInflate is enabled, vaule should be within 0 to 20 - * throughput units. ( '0' if AutoInflateEnabled = true) - * - * @param {boolean} [parameters.kafkaEnabled] Value that indicates whether - * Kafka is enabled for eventhub namespace. - * - * @param {string} [parameters.location] Resource location - * - * @param {object} [parameters.tags] Resource tags - * - * @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. - */ - createOrUpdateWithHttpOperationResponse(resourceGroupName, namespaceName, parameters, options) { - let client = this.client; - let self = this; - return new Promise((resolve, reject) => { - self._createOrUpdate(resourceGroupName, namespaceName, parameters, options, (err, result, request, response) => { - let httpOperationResponse = new msRest.HttpOperationResponse(request, response); - httpOperationResponse.body = result; - if (err) { reject(err); } - else { resolve(httpOperationResponse); } - return; - }); - }); - } - - /** - * Creates or updates a namespace. Once created, this namespace's resource - * manifest is immutable. This operation is idempotent. - * - * @param {string} resourceGroupName Name of the resource group within the - * azure subscription. - * - * @param {string} namespaceName The Namespace name - * - * @param {object} parameters Parameters for creating a namespace resource. - * - * @param {object} [parameters.sku] Properties of sku resource - * - * @param {string} parameters.sku.name Name of this SKU. Possible values - * include: 'Basic', 'Standard' - * - * @param {string} [parameters.sku.tier] The billing tier of this particular - * SKU. Possible values include: 'Basic', 'Standard' - * - * @param {number} [parameters.sku.capacity] The Event Hubs throughput units, - * vaule should be 0 to 20 throughput units. - * - * @param {boolean} [parameters.isAutoInflateEnabled] Value that indicates - * whether AutoInflate is enabled for eventhub namespace. - * - * @param {number} [parameters.maximumThroughputUnits] Upper limit of - * throughput units when AutoInflate is enabled, vaule should be within 0 to 20 - * throughput units. ( '0' if AutoInflateEnabled = true) - * - * @param {boolean} [parameters.kafkaEnabled] Value that indicates whether - * Kafka is enabled for eventhub namespace. - * - * @param {string} [parameters.location] Resource location - * - * @param {object} [parameters.tags] Resource tags - * - * @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 {EHNamespace} - 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 EHNamespace} 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. - */ - createOrUpdate(resourceGroupName, namespaceName, parameters, 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._createOrUpdate(resourceGroupName, namespaceName, parameters, options, (err, result, request, response) => { - if (err) { reject(err); } - else { resolve(result); } - return; - }); - }); - } else { - return self._createOrUpdate(resourceGroupName, namespaceName, parameters, options, optionalCallback); - } - } - - /** - * Deletes an existing namespace. This operation also removes all associated - * resources under the 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. - */ - deleteMethodWithHttpOperationResponse(resourceGroupName, namespaceName, options) { - let client = this.client; - let self = this; - return new Promise((resolve, reject) => { - self._deleteMethod(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; - }); - }); - } - - /** - * Deletes an existing namespace. This operation also removes all associated - * resources under the 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 {null} - 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. - * - * {null} [result] - The deserialized result object if an error did not occur. - * - * {object} [request] - The HTTP Request object if an error did not occur. - * - * {stream} [response] - The HTTP Response stream if an error did not occur. - */ - deleteMethod(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._deleteMethod(resourceGroupName, namespaceName, options, (err, result, request, response) => { - if (err) { reject(err); } - else { resolve(result); } - return; - }); - }); - } else { - return self._deleteMethod(resourceGroupName, namespaceName, options, optionalCallback); - } - } - - /** - * Gets the description of 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 the description of 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 {EHNamespace} - 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 EHNamespace} 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); - } - } - - /** - * Creates or updates a namespace. Once created, this namespace's resource - * manifest is immutable. This operation is idempotent. - * - * @param {string} resourceGroupName Name of the resource group within the - * azure subscription. - * - * @param {string} namespaceName The Namespace name - * - * @param {object} parameters Parameters for updating a namespace resource. - * - * @param {object} [parameters.sku] Properties of sku resource - * - * @param {string} parameters.sku.name Name of this SKU. Possible values - * include: 'Basic', 'Standard' - * - * @param {string} [parameters.sku.tier] The billing tier of this particular - * SKU. Possible values include: 'Basic', 'Standard' - * - * @param {number} [parameters.sku.capacity] The Event Hubs throughput units, - * vaule should be 0 to 20 throughput units. - * - * @param {boolean} [parameters.isAutoInflateEnabled] Value that indicates - * whether AutoInflate is enabled for eventhub namespace. - * - * @param {number} [parameters.maximumThroughputUnits] Upper limit of - * throughput units when AutoInflate is enabled, vaule should be within 0 to 20 - * throughput units. ( '0' if AutoInflateEnabled = true) - * - * @param {boolean} [parameters.kafkaEnabled] Value that indicates whether - * Kafka is enabled for eventhub namespace. - * - * @param {string} [parameters.location] Resource location - * - * @param {object} [parameters.tags] Resource tags - * - * @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. - */ - updateWithHttpOperationResponse(resourceGroupName, namespaceName, parameters, options) { - let client = this.client; - let self = this; - return new Promise((resolve, reject) => { - self._update(resourceGroupName, namespaceName, parameters, options, (err, result, request, response) => { - let httpOperationResponse = new msRest.HttpOperationResponse(request, response); - httpOperationResponse.body = result; - if (err) { reject(err); } - else { resolve(httpOperationResponse); } - return; - }); - }); - } - - /** - * Creates or updates a namespace. Once created, this namespace's resource - * manifest is immutable. This operation is idempotent. - * - * @param {string} resourceGroupName Name of the resource group within the - * azure subscription. - * - * @param {string} namespaceName The Namespace name - * - * @param {object} parameters Parameters for updating a namespace resource. - * - * @param {object} [parameters.sku] Properties of sku resource - * - * @param {string} parameters.sku.name Name of this SKU. Possible values - * include: 'Basic', 'Standard' - * - * @param {string} [parameters.sku.tier] The billing tier of this particular - * SKU. Possible values include: 'Basic', 'Standard' - * - * @param {number} [parameters.sku.capacity] The Event Hubs throughput units, - * vaule should be 0 to 20 throughput units. - * - * @param {boolean} [parameters.isAutoInflateEnabled] Value that indicates - * whether AutoInflate is enabled for eventhub namespace. - * - * @param {number} [parameters.maximumThroughputUnits] Upper limit of - * throughput units when AutoInflate is enabled, vaule should be within 0 to 20 - * throughput units. ( '0' if AutoInflateEnabled = true) - * - * @param {boolean} [parameters.kafkaEnabled] Value that indicates whether - * Kafka is enabled for eventhub namespace. - * - * @param {string} [parameters.location] Resource location - * - * @param {object} [parameters.tags] Resource tags - * - * @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 {EHNamespace} - 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 EHNamespace} 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. - */ - update(resourceGroupName, namespaceName, parameters, 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._update(resourceGroupName, namespaceName, parameters, options, (err, result, request, response) => { - if (err) { reject(err); } - else { resolve(result); } - return; - }); - }); - } else { - return self._update(resourceGroupName, namespaceName, parameters, options, optionalCallback); - } - } - - /** - * Gets messaging plan for 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. - */ - getMessagingPlanWithHttpOperationResponse(resourceGroupName, namespaceName, options) { - let client = this.client; - let self = this; - return new Promise((resolve, reject) => { - self._getMessagingPlan(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 messaging plan for 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. - */ - getMessagingPlan(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._getMessagingPlan(resourceGroupName, namespaceName, options, (err, result, request, response) => { - if (err) { reject(err); } - else { resolve(result); } - return; - }); - }); - } else { - return self._getMessagingPlan(resourceGroupName, namespaceName, options, optionalCallback); - } - } - - /** - * Gets a list of authorization rules for a 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. - */ - listAuthorizationRulesWithHttpOperationResponse(resourceGroupName, namespaceName, options) { - let client = this.client; - let self = this; - return new Promise((resolve, reject) => { - self._listAuthorizationRules(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; - }); - }); + /** + * Check the give Namespace name availability. + * + * @param {object} parameters Parameters to check availability of the given + * Namespace name + * + * @param {string} parameters.name Name to check the namespace name + * availability + * + * @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. + */ + checkNameAvailabilityWithHttpOperationResponse(parameters, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._checkNameAvailability(parameters, 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 list of authorization rules for a Namespace. + * Check the give Namespace name availability. * - * @param {string} resourceGroupName Name of the resource group within the - * azure subscription. + * @param {object} parameters Parameters to check availability of the given + * Namespace name * - * @param {string} namespaceName The Namespace name + * @param {string} parameters.name Name to check the namespace name + * availability * * @param {object} [options] Optional Parameters. * @@ -5648,7 +3152,7 @@ class Namespaces { * * {Promise} A promise is returned * - * @resolve {AuthorizationRuleListResult} - The deserialized result object. + * @resolve {CheckNameAvailabilityResult} - The deserialized result object. * * @reject {Error} - The error object. * @@ -5657,14 +3161,14 @@ class Namespaces { * {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 AuthorizationRuleListResult} for more + * See {@link CheckNameAvailabilityResult} 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. */ - listAuthorizationRules(resourceGroupName, namespaceName, options, optionalCallback) { + checkNameAvailability(parameters, options, optionalCallback) { let client = this.client; let self = this; if (!optionalCallback && typeof options === 'function') { @@ -5673,30 +3177,20 @@ class Namespaces { } if (!optionalCallback) { return new Promise((resolve, reject) => { - self._listAuthorizationRules(resourceGroupName, namespaceName, options, (err, result, request, response) => { + self._checkNameAvailability(parameters, options, (err, result, request, response) => { if (err) { reject(err); } else { resolve(result); } return; }); }); } else { - return self._listAuthorizationRules(resourceGroupName, namespaceName, options, optionalCallback); + return self._checkNameAvailability(parameters, options, optionalCallback); } } /** - * Creates or updates an AuthorizationRule for a Namespace. - * - * @param {string} resourceGroupName Name of the resource group within the - * azure subscription. - * - * @param {string} namespaceName The Namespace name - * - * @param {string} authorizationRuleName The authorization rule name. - * - * @param {object} parameters The shared access AuthorizationRule. - * - * @param {array} parameters.rights The rights associated with the rule. + * Lists all the available Namespaces within a subscription, irrespective of + * the resource groups. * * @param {object} [options] Optional Parameters. * @@ -5705,15 +3199,15 @@ class Namespaces { * * @returns {Promise} A promise is returned * - * @resolve {HttpOperationResponse} - The deserialized result object. + * @resolve {HttpOperationResponse} - The deserialized result object. * * @reject {Error} - The error object. */ - createOrUpdateAuthorizationRuleWithHttpOperationResponse(resourceGroupName, namespaceName, authorizationRuleName, parameters, options) { + listWithHttpOperationResponse(options) { let client = this.client; let self = this; return new Promise((resolve, reject) => { - self._createOrUpdateAuthorizationRule(resourceGroupName, namespaceName, authorizationRuleName, parameters, options, (err, result, request, response) => { + self._list(options, (err, result, request, response) => { let httpOperationResponse = new msRest.HttpOperationResponse(request, response); httpOperationResponse.body = result; if (err) { reject(err); } @@ -5724,18 +3218,8 @@ class Namespaces { } /** - * Creates or updates an AuthorizationRule for a Namespace. - * - * @param {string} resourceGroupName Name of the resource group within the - * azure subscription. - * - * @param {string} namespaceName The Namespace name - * - * @param {string} authorizationRuleName The authorization rule name. - * - * @param {object} parameters The shared access AuthorizationRule. - * - * @param {array} parameters.rights The rights associated with the rule. + * Lists all the available Namespaces within a subscription, irrespective of + * the resource groups. * * @param {object} [options] Optional Parameters. * @@ -5749,7 +3233,7 @@ class Namespaces { * * {Promise} A promise is returned * - * @resolve {AuthorizationRule} - The deserialized result object. + * @resolve {EHNamespaceListResult} - The deserialized result object. * * @reject {Error} - The error object. * @@ -5758,13 +3242,13 @@ class Namespaces { * {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 AuthorizationRule} for more information. + * See {@link EHNamespaceListResult} 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. */ - createOrUpdateAuthorizationRule(resourceGroupName, namespaceName, authorizationRuleName, parameters, options, optionalCallback) { + list(options, optionalCallback) { let client = this.client; let self = this; if (!optionalCallback && typeof options === 'function') { @@ -5773,27 +3257,23 @@ class Namespaces { } if (!optionalCallback) { return new Promise((resolve, reject) => { - self._createOrUpdateAuthorizationRule(resourceGroupName, namespaceName, authorizationRuleName, parameters, options, (err, result, request, response) => { + self._list(options, (err, result, request, response) => { if (err) { reject(err); } else { resolve(result); } return; }); }); } else { - return self._createOrUpdateAuthorizationRule(resourceGroupName, namespaceName, authorizationRuleName, parameters, options, optionalCallback); + return self._list(options, optionalCallback); } } /** - * Deletes an AuthorizationRule for a Namespace. + * Lists the available Namespaces within a resource group. * * @param {string} resourceGroupName Name of the resource group within the * azure subscription. * - * @param {string} namespaceName The Namespace name - * - * @param {string} authorizationRuleName The authorization rule name. - * * @param {object} [options] Optional Parameters. * * @param {object} [options.customHeaders] Headers that will be added to the @@ -5801,15 +3281,15 @@ class Namespaces { * * @returns {Promise} A promise is returned * - * @resolve {HttpOperationResponse} - The deserialized result object. + * @resolve {HttpOperationResponse} - The deserialized result object. * * @reject {Error} - The error object. */ - deleteAuthorizationRuleWithHttpOperationResponse(resourceGroupName, namespaceName, authorizationRuleName, options) { + listByResourceGroupWithHttpOperationResponse(resourceGroupName, options) { let client = this.client; let self = this; return new Promise((resolve, reject) => { - self._deleteAuthorizationRule(resourceGroupName, namespaceName, authorizationRuleName, options, (err, result, request, response) => { + self._listByResourceGroup(resourceGroupName, options, (err, result, request, response) => { let httpOperationResponse = new msRest.HttpOperationResponse(request, response); httpOperationResponse.body = result; if (err) { reject(err); } @@ -5820,15 +3300,11 @@ class Namespaces { } /** - * Deletes an AuthorizationRule for a Namespace. + * Lists the available Namespaces within a resource group. * * @param {string} resourceGroupName Name of the resource group within the * azure subscription. * - * @param {string} namespaceName The Namespace name - * - * @param {string} authorizationRuleName The authorization rule name. - * * @param {object} [options] Optional Parameters. * * @param {object} [options.customHeaders] Headers that will be added to the @@ -5841,7 +3317,7 @@ class Namespaces { * * {Promise} A promise is returned * - * @resolve {null} - The deserialized result object. + * @resolve {EHNamespaceListResult} - The deserialized result object. * * @reject {Error} - The error object. * @@ -5849,13 +3325,14 @@ class Namespaces { * * {Error} err - The Error object if an error occurred, null otherwise. * - * {null} [result] - The deserialized result object if an error did not occur. + * {object} [result] - The deserialized result object if an error did not occur. + * See {@link EHNamespaceListResult} 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. */ - deleteAuthorizationRule(resourceGroupName, namespaceName, authorizationRuleName, options, optionalCallback) { + listByResourceGroup(resourceGroupName, options, optionalCallback) { let client = this.client; let self = this; if (!optionalCallback && typeof options === 'function') { @@ -5864,26 +3341,52 @@ class Namespaces { } if (!optionalCallback) { return new Promise((resolve, reject) => { - self._deleteAuthorizationRule(resourceGroupName, namespaceName, authorizationRuleName, options, (err, result, request, response) => { + self._listByResourceGroup(resourceGroupName, options, (err, result, request, response) => { if (err) { reject(err); } else { resolve(result); } return; }); }); } else { - return self._deleteAuthorizationRule(resourceGroupName, namespaceName, authorizationRuleName, options, optionalCallback); + return self._listByResourceGroup(resourceGroupName, options, optionalCallback); } } /** - * Gets an AuthorizationRule for a Namespace by rule name. + * Creates or updates a namespace. Once created, this namespace's resource + * manifest is immutable. This operation is idempotent. * * @param {string} resourceGroupName Name of the resource group within the * azure subscription. * * @param {string} namespaceName The Namespace name * - * @param {string} authorizationRuleName The authorization rule name. + * @param {object} parameters Parameters for creating a namespace resource. + * + * @param {object} [parameters.sku] Properties of sku resource + * + * @param {string} parameters.sku.name Name of this SKU. Possible values + * include: 'Basic', 'Standard' + * + * @param {string} [parameters.sku.tier] The billing tier of this particular + * SKU. Possible values include: 'Basic', 'Standard' + * + * @param {number} [parameters.sku.capacity] The Event Hubs throughput units, + * vaule should be 0 to 20 throughput units. + * + * @param {boolean} [parameters.isAutoInflateEnabled] Value that indicates + * whether AutoInflate is enabled for eventhub namespace. + * + * @param {number} [parameters.maximumThroughputUnits] Upper limit of + * throughput units when AutoInflate is enabled, vaule should be within 0 to 20 + * throughput units. ( '0' if AutoInflateEnabled = true) + * + * @param {boolean} [parameters.kafkaEnabled] Value that indicates whether + * Kafka is enabled for eventhub namespace. + * + * @param {string} [parameters.location] Resource location + * + * @param {object} [parameters.tags] Resource tags * * @param {object} [options] Optional Parameters. * @@ -5892,15 +3395,15 @@ class Namespaces { * * @returns {Promise} A promise is returned * - * @resolve {HttpOperationResponse} - The deserialized result object. + * @resolve {HttpOperationResponse} - The deserialized result object. * * @reject {Error} - The error object. */ - getAuthorizationRuleWithHttpOperationResponse(resourceGroupName, namespaceName, authorizationRuleName, options) { + createOrUpdateWithHttpOperationResponse(resourceGroupName, namespaceName, parameters, options) { let client = this.client; let self = this; return new Promise((resolve, reject) => { - self._getAuthorizationRule(resourceGroupName, namespaceName, authorizationRuleName, options, (err, result, request, response) => { + self._createOrUpdate(resourceGroupName, namespaceName, parameters, options, (err, result, request, response) => { let httpOperationResponse = new msRest.HttpOperationResponse(request, response); httpOperationResponse.body = result; if (err) { reject(err); } @@ -5911,14 +3414,40 @@ class Namespaces { } /** - * Gets an AuthorizationRule for a Namespace by rule name. + * Creates or updates a namespace. Once created, this namespace's resource + * manifest is immutable. This operation is idempotent. * * @param {string} resourceGroupName Name of the resource group within the * azure subscription. * * @param {string} namespaceName The Namespace name * - * @param {string} authorizationRuleName The authorization rule name. + * @param {object} parameters Parameters for creating a namespace resource. + * + * @param {object} [parameters.sku] Properties of sku resource + * + * @param {string} parameters.sku.name Name of this SKU. Possible values + * include: 'Basic', 'Standard' + * + * @param {string} [parameters.sku.tier] The billing tier of this particular + * SKU. Possible values include: 'Basic', 'Standard' + * + * @param {number} [parameters.sku.capacity] The Event Hubs throughput units, + * vaule should be 0 to 20 throughput units. + * + * @param {boolean} [parameters.isAutoInflateEnabled] Value that indicates + * whether AutoInflate is enabled for eventhub namespace. + * + * @param {number} [parameters.maximumThroughputUnits] Upper limit of + * throughput units when AutoInflate is enabled, vaule should be within 0 to 20 + * throughput units. ( '0' if AutoInflateEnabled = true) + * + * @param {boolean} [parameters.kafkaEnabled] Value that indicates whether + * Kafka is enabled for eventhub namespace. + * + * @param {string} [parameters.location] Resource location + * + * @param {object} [parameters.tags] Resource tags * * @param {object} [options] Optional Parameters. * @@ -5932,7 +3461,7 @@ class Namespaces { * * {Promise} A promise is returned * - * @resolve {AuthorizationRule} - The deserialized result object. + * @resolve {EHNamespace} - The deserialized result object. * * @reject {Error} - The error object. * @@ -5941,13 +3470,13 @@ class Namespaces { * {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 AuthorizationRule} for more information. + * See {@link EHNamespace} 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. */ - getAuthorizationRule(resourceGroupName, namespaceName, authorizationRuleName, options, optionalCallback) { + createOrUpdate(resourceGroupName, namespaceName, parameters, options, optionalCallback) { let client = this.client; let self = this; if (!optionalCallback && typeof options === 'function') { @@ -5956,27 +3485,26 @@ class Namespaces { } if (!optionalCallback) { return new Promise((resolve, reject) => { - self._getAuthorizationRule(resourceGroupName, namespaceName, authorizationRuleName, options, (err, result, request, response) => { + self._createOrUpdate(resourceGroupName, namespaceName, parameters, options, (err, result, request, response) => { if (err) { reject(err); } else { resolve(result); } return; }); }); } else { - return self._getAuthorizationRule(resourceGroupName, namespaceName, authorizationRuleName, options, optionalCallback); + return self._createOrUpdate(resourceGroupName, namespaceName, parameters, options, optionalCallback); } } /** - * Gets the primary and secondary connection strings for the Namespace. + * Deletes an existing namespace. This operation also removes all associated + * resources under the namespace. * * @param {string} resourceGroupName Name of the resource group within the * azure subscription. * * @param {string} namespaceName The Namespace name * - * @param {string} authorizationRuleName The authorization rule name. - * * @param {object} [options] Optional Parameters. * * @param {object} [options.customHeaders] Headers that will be added to the @@ -5984,15 +3512,15 @@ class Namespaces { * * @returns {Promise} A promise is returned * - * @resolve {HttpOperationResponse} - The deserialized result object. + * @resolve {HttpOperationResponse} - The deserialized result object. * * @reject {Error} - The error object. */ - listKeysWithHttpOperationResponse(resourceGroupName, namespaceName, authorizationRuleName, options) { + deleteMethodWithHttpOperationResponse(resourceGroupName, namespaceName, options) { let client = this.client; let self = this; return new Promise((resolve, reject) => { - self._listKeys(resourceGroupName, namespaceName, authorizationRuleName, options, (err, result, request, response) => { + self._deleteMethod(resourceGroupName, namespaceName, options, (err, result, request, response) => { let httpOperationResponse = new msRest.HttpOperationResponse(request, response); httpOperationResponse.body = result; if (err) { reject(err); } @@ -6003,15 +3531,14 @@ class Namespaces { } /** - * Gets the primary and secondary connection strings for the Namespace. + * Deletes an existing namespace. This operation also removes all associated + * resources under the namespace. * * @param {string} resourceGroupName Name of the resource group within the * azure subscription. * * @param {string} namespaceName The Namespace name * - * @param {string} authorizationRuleName The authorization rule name. - * * @param {object} [options] Optional Parameters. * * @param {object} [options.customHeaders] Headers that will be added to the @@ -6024,7 +3551,7 @@ class Namespaces { * * {Promise} A promise is returned * - * @resolve {AccessKeys} - The deserialized result object. + * @resolve {null} - The deserialized result object. * * @reject {Error} - The error object. * @@ -6032,14 +3559,13 @@ class Namespaces { * * {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 AccessKeys} for more information. + * {null} [result] - The deserialized result object if an error did not occur. * * {object} [request] - The HTTP Request object if an error did not occur. * * {stream} [response] - The HTTP Response stream if an error did not occur. */ - listKeys(resourceGroupName, namespaceName, authorizationRuleName, options, optionalCallback) { + deleteMethod(resourceGroupName, namespaceName, options, optionalCallback) { let client = this.client; let self = this; if (!optionalCallback && typeof options === 'function') { @@ -6048,37 +3574,25 @@ class Namespaces { } if (!optionalCallback) { return new Promise((resolve, reject) => { - self._listKeys(resourceGroupName, namespaceName, authorizationRuleName, options, (err, result, request, response) => { + self._deleteMethod(resourceGroupName, namespaceName, options, (err, result, request, response) => { if (err) { reject(err); } else { resolve(result); } return; }); }); } else { - return self._listKeys(resourceGroupName, namespaceName, authorizationRuleName, options, optionalCallback); + return self._deleteMethod(resourceGroupName, namespaceName, options, optionalCallback); } } /** - * Regenerates the primary or secondary connection strings for the specified - * Namespace. + * Gets the description of the specified namespace. * * @param {string} resourceGroupName Name of the resource group within the * azure subscription. * * @param {string} namespaceName The Namespace name * - * @param {string} authorizationRuleName The authorization rule name. - * - * @param {object} parameters Parameters required to regenerate the connection - * string. - * - * @param {string} parameters.keyType The access key to regenerate. Possible - * values include: 'PrimaryKey', 'SecondaryKey' - * - * @param {string} [parameters.key] Optional, if the key value provided, is set - * for KeyType or autogenerated Key value set for keyType - * * @param {object} [options] Optional Parameters. * * @param {object} [options.customHeaders] Headers that will be added to the @@ -6086,15 +3600,15 @@ class Namespaces { * * @returns {Promise} A promise is returned * - * @resolve {HttpOperationResponse} - The deserialized result object. + * @resolve {HttpOperationResponse} - The deserialized result object. * * @reject {Error} - The error object. */ - regenerateKeysWithHttpOperationResponse(resourceGroupName, namespaceName, authorizationRuleName, parameters, options) { + getWithHttpOperationResponse(resourceGroupName, namespaceName, options) { let client = this.client; let self = this; return new Promise((resolve, reject) => { - self._regenerateKeys(resourceGroupName, namespaceName, authorizationRuleName, parameters, options, (err, result, request, response) => { + self._get(resourceGroupName, namespaceName, options, (err, result, request, response) => { let httpOperationResponse = new msRest.HttpOperationResponse(request, response); httpOperationResponse.body = result; if (err) { reject(err); } @@ -6105,25 +3619,13 @@ class Namespaces { } /** - * Regenerates the primary or secondary connection strings for the specified - * Namespace. + * Gets the description of the specified namespace. * * @param {string} resourceGroupName Name of the resource group within the * azure subscription. * * @param {string} namespaceName The Namespace name * - * @param {string} authorizationRuleName The authorization rule name. - * - * @param {object} parameters Parameters required to regenerate the connection - * string. - * - * @param {string} parameters.keyType The access key to regenerate. Possible - * values include: 'PrimaryKey', 'SecondaryKey' - * - * @param {string} [parameters.key] Optional, if the key value provided, is set - * for KeyType or autogenerated Key value set for keyType - * * @param {object} [options] Optional Parameters. * * @param {object} [options.customHeaders] Headers that will be added to the @@ -6136,7 +3638,7 @@ class Namespaces { * * {Promise} A promise is returned * - * @resolve {AccessKeys} - The deserialized result object. + * @resolve {EHNamespace} - The deserialized result object. * * @reject {Error} - The error object. * @@ -6145,13 +3647,13 @@ class Namespaces { * {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 AccessKeys} for more information. + * See {@link EHNamespace} 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. */ - regenerateKeys(resourceGroupName, namespaceName, authorizationRuleName, parameters, options, optionalCallback) { + get(resourceGroupName, namespaceName, options, optionalCallback) { let client = this.client; let self = this; if (!optionalCallback && typeof options === 'function') { @@ -6160,25 +3662,53 @@ class Namespaces { } if (!optionalCallback) { return new Promise((resolve, reject) => { - self._regenerateKeys(resourceGroupName, namespaceName, authorizationRuleName, parameters, options, (err, result, request, response) => { + self._get(resourceGroupName, namespaceName, options, (err, result, request, response) => { if (err) { reject(err); } else { resolve(result); } return; }); }); } else { - return self._regenerateKeys(resourceGroupName, namespaceName, authorizationRuleName, parameters, options, optionalCallback); + return self._get(resourceGroupName, namespaceName, options, optionalCallback); } } /** - * Gets a list of IP Filter rules for a Namespace. + * Creates or updates a namespace. Once created, this namespace's resource + * manifest is immutable. This operation is idempotent. * * @param {string} resourceGroupName Name of the resource group within the * azure subscription. * * @param {string} namespaceName The Namespace name * + * @param {object} parameters Parameters for updating a namespace resource. + * + * @param {object} [parameters.sku] Properties of sku resource + * + * @param {string} parameters.sku.name Name of this SKU. Possible values + * include: 'Basic', 'Standard' + * + * @param {string} [parameters.sku.tier] The billing tier of this particular + * SKU. Possible values include: 'Basic', 'Standard' + * + * @param {number} [parameters.sku.capacity] The Event Hubs throughput units, + * vaule should be 0 to 20 throughput units. + * + * @param {boolean} [parameters.isAutoInflateEnabled] Value that indicates + * whether AutoInflate is enabled for eventhub namespace. + * + * @param {number} [parameters.maximumThroughputUnits] Upper limit of + * throughput units when AutoInflate is enabled, vaule should be within 0 to 20 + * throughput units. ( '0' if AutoInflateEnabled = true) + * + * @param {boolean} [parameters.kafkaEnabled] Value that indicates whether + * Kafka is enabled for eventhub namespace. + * + * @param {string} [parameters.location] Resource location + * + * @param {object} [parameters.tags] Resource tags + * * @param {object} [options] Optional Parameters. * * @param {object} [options.customHeaders] Headers that will be added to the @@ -6186,15 +3716,15 @@ class Namespaces { * * @returns {Promise} A promise is returned * - * @resolve {HttpOperationResponse} - The deserialized result object. + * @resolve {HttpOperationResponse} - The deserialized result object. * * @reject {Error} - The error object. */ - listIPFilterRulesWithHttpOperationResponse(resourceGroupName, namespaceName, options) { + updateWithHttpOperationResponse(resourceGroupName, namespaceName, parameters, options) { let client = this.client; let self = this; return new Promise((resolve, reject) => { - self._listIPFilterRules(resourceGroupName, namespaceName, options, (err, result, request, response) => { + self._update(resourceGroupName, namespaceName, parameters, options, (err, result, request, response) => { let httpOperationResponse = new msRest.HttpOperationResponse(request, response); httpOperationResponse.body = result; if (err) { reject(err); } @@ -6205,13 +3735,41 @@ class Namespaces { } /** - * Gets a list of IP Filter rules for a Namespace. + * Creates or updates a namespace. Once created, this namespace's resource + * manifest is immutable. This operation is idempotent. * * @param {string} resourceGroupName Name of the resource group within the * azure subscription. * * @param {string} namespaceName The Namespace name * + * @param {object} parameters Parameters for updating a namespace resource. + * + * @param {object} [parameters.sku] Properties of sku resource + * + * @param {string} parameters.sku.name Name of this SKU. Possible values + * include: 'Basic', 'Standard' + * + * @param {string} [parameters.sku.tier] The billing tier of this particular + * SKU. Possible values include: 'Basic', 'Standard' + * + * @param {number} [parameters.sku.capacity] The Event Hubs throughput units, + * vaule should be 0 to 20 throughput units. + * + * @param {boolean} [parameters.isAutoInflateEnabled] Value that indicates + * whether AutoInflate is enabled for eventhub namespace. + * + * @param {number} [parameters.maximumThroughputUnits] Upper limit of + * throughput units when AutoInflate is enabled, vaule should be within 0 to 20 + * throughput units. ( '0' if AutoInflateEnabled = true) + * + * @param {boolean} [parameters.kafkaEnabled] Value that indicates whether + * Kafka is enabled for eventhub namespace. + * + * @param {string} [parameters.location] Resource location + * + * @param {object} [parameters.tags] Resource tags + * * @param {object} [options] Optional Parameters. * * @param {object} [options.customHeaders] Headers that will be added to the @@ -6224,7 +3782,7 @@ class Namespaces { * * {Promise} A promise is returned * - * @resolve {IpFilterRuleListResult} - The deserialized result object. + * @resolve {EHNamespace} - The deserialized result object. * * @reject {Error} - The error object. * @@ -6233,14 +3791,13 @@ class Namespaces { * {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 IpFilterRuleListResult} for more - * information. + * See {@link EHNamespace} 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. */ - listIPFilterRules(resourceGroupName, namespaceName, options, optionalCallback) { + update(resourceGroupName, namespaceName, parameters, options, optionalCallback) { let client = this.client; let self = this; if (!optionalCallback && typeof options === 'function') { @@ -6249,36 +3806,25 @@ class Namespaces { } if (!optionalCallback) { return new Promise((resolve, reject) => { - self._listIPFilterRules(resourceGroupName, namespaceName, options, (err, result, request, response) => { + self._update(resourceGroupName, namespaceName, parameters, options, (err, result, request, response) => { if (err) { reject(err); } else { resolve(result); } return; }); }); } else { - return self._listIPFilterRules(resourceGroupName, namespaceName, options, optionalCallback); + return self._update(resourceGroupName, namespaceName, parameters, options, optionalCallback); } } /** - * Creates or updates an IpFilterRule for a Namespace. + * Gets messaging plan for specified namespace. * * @param {string} resourceGroupName Name of the resource group within the * azure subscription. * * @param {string} namespaceName The Namespace name * - * @param {string} ipFilterRuleName The IP Filter Rule name. - * - * @param {object} parameters The Namespace IpFilterRule. - * - * @param {string} [parameters.ipMask] IP Mask - * - * @param {string} [parameters.action] The IP Filter Action. Possible values - * include: 'Accept', 'Reject' - * - * @param {string} [parameters.filterName] IP Filter name - * * @param {object} [options] Optional Parameters. * * @param {object} [options.customHeaders] Headers that will be added to the @@ -6286,15 +3832,15 @@ class Namespaces { * * @returns {Promise} A promise is returned * - * @resolve {HttpOperationResponse} - The deserialized result object. + * @resolve {HttpOperationResponse} - The deserialized result object. * * @reject {Error} - The error object. */ - createOrUpdateIpFilterRuleWithHttpOperationResponse(resourceGroupName, namespaceName, ipFilterRuleName, parameters, options) { + getMessagingPlanWithHttpOperationResponse(resourceGroupName, namespaceName, options) { let client = this.client; let self = this; return new Promise((resolve, reject) => { - self._createOrUpdateIpFilterRule(resourceGroupName, namespaceName, ipFilterRuleName, parameters, options, (err, result, request, response) => { + self._getMessagingPlan(resourceGroupName, namespaceName, options, (err, result, request, response) => { let httpOperationResponse = new msRest.HttpOperationResponse(request, response); httpOperationResponse.body = result; if (err) { reject(err); } @@ -6305,24 +3851,13 @@ class Namespaces { } /** - * Creates or updates an IpFilterRule for a Namespace. + * Gets messaging plan for specified namespace. * * @param {string} resourceGroupName Name of the resource group within the * azure subscription. * * @param {string} namespaceName The Namespace name * - * @param {string} ipFilterRuleName The IP Filter Rule name. - * - * @param {object} parameters The Namespace IpFilterRule. - * - * @param {string} [parameters.ipMask] IP Mask - * - * @param {string} [parameters.action] The IP Filter Action. Possible values - * include: 'Accept', 'Reject' - * - * @param {string} [parameters.filterName] IP Filter name - * * @param {object} [options] Optional Parameters. * * @param {object} [options.customHeaders] Headers that will be added to the @@ -6335,7 +3870,7 @@ class Namespaces { * * {Promise} A promise is returned * - * @resolve {IpFilterRule} - The deserialized result object. + * @resolve {MessagingPlan} - The deserialized result object. * * @reject {Error} - The error object. * @@ -6344,13 +3879,13 @@ class Namespaces { * {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 IpFilterRule} for more information. + * 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. */ - createOrUpdateIpFilterRule(resourceGroupName, namespaceName, ipFilterRuleName, parameters, options, optionalCallback) { + getMessagingPlan(resourceGroupName, namespaceName, options, optionalCallback) { let client = this.client; let self = this; if (!optionalCallback && typeof options === 'function') { @@ -6359,27 +3894,25 @@ class Namespaces { } if (!optionalCallback) { return new Promise((resolve, reject) => { - self._createOrUpdateIpFilterRule(resourceGroupName, namespaceName, ipFilterRuleName, parameters, options, (err, result, request, response) => { + self._getMessagingPlan(resourceGroupName, namespaceName, options, (err, result, request, response) => { if (err) { reject(err); } else { resolve(result); } return; }); }); } else { - return self._createOrUpdateIpFilterRule(resourceGroupName, namespaceName, ipFilterRuleName, parameters, options, optionalCallback); + return self._getMessagingPlan(resourceGroupName, namespaceName, options, optionalCallback); } } /** - * Deletes an IpFilterRule for a Namespace. + * Gets a list of authorization rules for a Namespace. * * @param {string} resourceGroupName Name of the resource group within the * azure subscription. * * @param {string} namespaceName The Namespace name * - * @param {string} ipFilterRuleName The IP Filter Rule name. - * * @param {object} [options] Optional Parameters. * * @param {object} [options.customHeaders] Headers that will be added to the @@ -6387,15 +3920,15 @@ class Namespaces { * * @returns {Promise} A promise is returned * - * @resolve {HttpOperationResponse} - The deserialized result object. + * @resolve {HttpOperationResponse} - The deserialized result object. * * @reject {Error} - The error object. */ - deleteIpFilterRuleWithHttpOperationResponse(resourceGroupName, namespaceName, ipFilterRuleName, options) { + listAuthorizationRulesWithHttpOperationResponse(resourceGroupName, namespaceName, options) { let client = this.client; let self = this; return new Promise((resolve, reject) => { - self._deleteIpFilterRule(resourceGroupName, namespaceName, ipFilterRuleName, options, (err, result, request, response) => { + self._listAuthorizationRules(resourceGroupName, namespaceName, options, (err, result, request, response) => { let httpOperationResponse = new msRest.HttpOperationResponse(request, response); httpOperationResponse.body = result; if (err) { reject(err); } @@ -6406,15 +3939,13 @@ class Namespaces { } /** - * Deletes an IpFilterRule for a Namespace. + * Gets a list of authorization rules for a Namespace. * * @param {string} resourceGroupName Name of the resource group within the * azure subscription. * * @param {string} namespaceName The Namespace name * - * @param {string} ipFilterRuleName The IP Filter Rule name. - * * @param {object} [options] Optional Parameters. * * @param {object} [options.customHeaders] Headers that will be added to the @@ -6427,7 +3958,7 @@ class Namespaces { * * {Promise} A promise is returned * - * @resolve {null} - The deserialized result object. + * @resolve {AuthorizationRuleListResult} - The deserialized result object. * * @reject {Error} - The error object. * @@ -6435,13 +3966,15 @@ class Namespaces { * * {Error} err - The Error object if an error occurred, null otherwise. * - * {null} [result] - The deserialized result object if an error did not occur. + * {object} [result] - The deserialized result object if an error did not occur. + * See {@link AuthorizationRuleListResult} 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. */ - deleteIpFilterRule(resourceGroupName, namespaceName, ipFilterRuleName, options, optionalCallback) { + listAuthorizationRules(resourceGroupName, namespaceName, options, optionalCallback) { let client = this.client; let self = this; if (!optionalCallback && typeof options === 'function') { @@ -6450,26 +3983,30 @@ class Namespaces { } if (!optionalCallback) { return new Promise((resolve, reject) => { - self._deleteIpFilterRule(resourceGroupName, namespaceName, ipFilterRuleName, options, (err, result, request, response) => { + self._listAuthorizationRules(resourceGroupName, namespaceName, options, (err, result, request, response) => { if (err) { reject(err); } else { resolve(result); } return; }); }); } else { - return self._deleteIpFilterRule(resourceGroupName, namespaceName, ipFilterRuleName, options, optionalCallback); + return self._listAuthorizationRules(resourceGroupName, namespaceName, options, optionalCallback); } } /** - * Gets an IpFilterRule for a Namespace by rule name. + * Creates or updates an AuthorizationRule for a Namespace. * * @param {string} resourceGroupName Name of the resource group within the * azure subscription. * * @param {string} namespaceName The Namespace name * - * @param {string} ipFilterRuleName The IP Filter Rule name. + * @param {string} authorizationRuleName The authorization rule name. + * + * @param {object} parameters The shared access AuthorizationRule. + * + * @param {array} parameters.rights The rights associated with the rule. * * @param {object} [options] Optional Parameters. * @@ -6478,15 +4015,15 @@ class Namespaces { * * @returns {Promise} A promise is returned * - * @resolve {HttpOperationResponse} - The deserialized result object. + * @resolve {HttpOperationResponse} - The deserialized result object. * * @reject {Error} - The error object. */ - getIpFilterRuleWithHttpOperationResponse(resourceGroupName, namespaceName, ipFilterRuleName, options) { + createOrUpdateAuthorizationRuleWithHttpOperationResponse(resourceGroupName, namespaceName, authorizationRuleName, parameters, options) { let client = this.client; let self = this; return new Promise((resolve, reject) => { - self._getIpFilterRule(resourceGroupName, namespaceName, ipFilterRuleName, options, (err, result, request, response) => { + self._createOrUpdateAuthorizationRule(resourceGroupName, namespaceName, authorizationRuleName, parameters, options, (err, result, request, response) => { let httpOperationResponse = new msRest.HttpOperationResponse(request, response); httpOperationResponse.body = result; if (err) { reject(err); } @@ -6497,14 +4034,18 @@ class Namespaces { } /** - * Gets an IpFilterRule for a Namespace by rule name. + * Creates or updates an AuthorizationRule for a Namespace. * * @param {string} resourceGroupName Name of the resource group within the * azure subscription. * * @param {string} namespaceName The Namespace name * - * @param {string} ipFilterRuleName The IP Filter Rule name. + * @param {string} authorizationRuleName The authorization rule name. + * + * @param {object} parameters The shared access AuthorizationRule. + * + * @param {array} parameters.rights The rights associated with the rule. * * @param {object} [options] Optional Parameters. * @@ -6518,7 +4059,7 @@ class Namespaces { * * {Promise} A promise is returned * - * @resolve {IpFilterRule} - The deserialized result object. + * @resolve {AuthorizationRule} - The deserialized result object. * * @reject {Error} - The error object. * @@ -6527,13 +4068,13 @@ class Namespaces { * {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 IpFilterRule} for more information. + * See {@link AuthorizationRule} 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. */ - getIpFilterRule(resourceGroupName, namespaceName, ipFilterRuleName, options, optionalCallback) { + createOrUpdateAuthorizationRule(resourceGroupName, namespaceName, authorizationRuleName, parameters, options, optionalCallback) { let client = this.client; let self = this; if (!optionalCallback && typeof options === 'function') { @@ -6542,25 +4083,27 @@ class Namespaces { } if (!optionalCallback) { return new Promise((resolve, reject) => { - self._getIpFilterRule(resourceGroupName, namespaceName, ipFilterRuleName, options, (err, result, request, response) => { + self._createOrUpdateAuthorizationRule(resourceGroupName, namespaceName, authorizationRuleName, parameters, options, (err, result, request, response) => { if (err) { reject(err); } else { resolve(result); } return; }); }); } else { - return self._getIpFilterRule(resourceGroupName, namespaceName, ipFilterRuleName, options, optionalCallback); + return self._createOrUpdateAuthorizationRule(resourceGroupName, namespaceName, authorizationRuleName, parameters, options, optionalCallback); } } /** - * Gets a list of VirtualNetwork rules for a Namespace. + * Deletes an AuthorizationRule for a Namespace. * * @param {string} resourceGroupName Name of the resource group within the * azure subscription. * * @param {string} namespaceName The Namespace name * + * @param {string} authorizationRuleName The authorization rule name. + * * @param {object} [options] Optional Parameters. * * @param {object} [options.customHeaders] Headers that will be added to the @@ -6568,15 +4111,15 @@ class Namespaces { * * @returns {Promise} A promise is returned * - * @resolve {HttpOperationResponse} - The deserialized result object. + * @resolve {HttpOperationResponse} - The deserialized result object. * * @reject {Error} - The error object. */ - listVirtualNetworkRulesWithHttpOperationResponse(resourceGroupName, namespaceName, options) { + deleteAuthorizationRuleWithHttpOperationResponse(resourceGroupName, namespaceName, authorizationRuleName, options) { let client = this.client; let self = this; return new Promise((resolve, reject) => { - self._listVirtualNetworkRules(resourceGroupName, namespaceName, options, (err, result, request, response) => { + self._deleteAuthorizationRule(resourceGroupName, namespaceName, authorizationRuleName, options, (err, result, request, response) => { let httpOperationResponse = new msRest.HttpOperationResponse(request, response); httpOperationResponse.body = result; if (err) { reject(err); } @@ -6587,13 +4130,15 @@ class Namespaces { } /** - * Gets a list of VirtualNetwork rules for a Namespace. + * Deletes an AuthorizationRule for a Namespace. * * @param {string} resourceGroupName Name of the resource group within the * azure subscription. * * @param {string} namespaceName The Namespace name * + * @param {string} authorizationRuleName The authorization rule name. + * * @param {object} [options] Optional Parameters. * * @param {object} [options.customHeaders] Headers that will be added to the @@ -6606,7 +4151,7 @@ class Namespaces { * * {Promise} A promise is returned * - * @resolve {VirtualNetworkRuleListResult} - The deserialized result object. + * @resolve {null} - The deserialized result object. * * @reject {Error} - The error object. * @@ -6614,15 +4159,13 @@ class Namespaces { * * {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 VirtualNetworkRuleListResult} for more - * information. + * {null} [result] - The deserialized result object if an error did not occur. * * {object} [request] - The HTTP Request object if an error did not occur. * * {stream} [response] - The HTTP Response stream if an error did not occur. */ - listVirtualNetworkRules(resourceGroupName, namespaceName, options, optionalCallback) { + deleteAuthorizationRule(resourceGroupName, namespaceName, authorizationRuleName, options, optionalCallback) { let client = this.client; let self = this; if (!optionalCallback && typeof options === 'function') { @@ -6631,31 +4174,26 @@ class Namespaces { } if (!optionalCallback) { return new Promise((resolve, reject) => { - self._listVirtualNetworkRules(resourceGroupName, namespaceName, options, (err, result, request, response) => { + self._deleteAuthorizationRule(resourceGroupName, namespaceName, authorizationRuleName, options, (err, result, request, response) => { if (err) { reject(err); } else { resolve(result); } return; }); }); } else { - return self._listVirtualNetworkRules(resourceGroupName, namespaceName, options, optionalCallback); + return self._deleteAuthorizationRule(resourceGroupName, namespaceName, authorizationRuleName, options, optionalCallback); } } /** - * Creates or updates an VirtualNetworkRule for a Namespace. + * Gets an AuthorizationRule for a Namespace by rule name. * * @param {string} resourceGroupName Name of the resource group within the * azure subscription. * * @param {string} namespaceName The Namespace name * - * @param {string} virtualNetworkRuleName The Virtual Network Rule name. - * - * @param {object} parameters The Namespace VirtualNetworkRule. - * - * @param {string} [parameters.virtualNetworkSubnetId] ARM ID of Virtual - * Network Subnet + * @param {string} authorizationRuleName The authorization rule name. * * @param {object} [options] Optional Parameters. * @@ -6664,15 +4202,15 @@ class Namespaces { * * @returns {Promise} A promise is returned * - * @resolve {HttpOperationResponse} - The deserialized result object. + * @resolve {HttpOperationResponse} - The deserialized result object. * * @reject {Error} - The error object. */ - createOrUpdateVirtualNetworkRuleWithHttpOperationResponse(resourceGroupName, namespaceName, virtualNetworkRuleName, parameters, options) { + getAuthorizationRuleWithHttpOperationResponse(resourceGroupName, namespaceName, authorizationRuleName, options) { let client = this.client; let self = this; return new Promise((resolve, reject) => { - self._createOrUpdateVirtualNetworkRule(resourceGroupName, namespaceName, virtualNetworkRuleName, parameters, options, (err, result, request, response) => { + self._getAuthorizationRule(resourceGroupName, namespaceName, authorizationRuleName, options, (err, result, request, response) => { let httpOperationResponse = new msRest.HttpOperationResponse(request, response); httpOperationResponse.body = result; if (err) { reject(err); } @@ -6683,19 +4221,14 @@ class Namespaces { } /** - * Creates or updates an VirtualNetworkRule for a Namespace. + * Gets an AuthorizationRule for a Namespace by rule name. * * @param {string} resourceGroupName Name of the resource group within the * azure subscription. * * @param {string} namespaceName The Namespace name * - * @param {string} virtualNetworkRuleName The Virtual Network Rule name. - * - * @param {object} parameters The Namespace VirtualNetworkRule. - * - * @param {string} [parameters.virtualNetworkSubnetId] ARM ID of Virtual - * Network Subnet + * @param {string} authorizationRuleName The authorization rule name. * * @param {object} [options] Optional Parameters. * @@ -6709,7 +4242,7 @@ class Namespaces { * * {Promise} A promise is returned * - * @resolve {VirtualNetworkRule} - The deserialized result object. + * @resolve {AuthorizationRule} - The deserialized result object. * * @reject {Error} - The error object. * @@ -6718,13 +4251,13 @@ class Namespaces { * {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 VirtualNetworkRule} for more information. + * See {@link AuthorizationRule} 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. */ - createOrUpdateVirtualNetworkRule(resourceGroupName, namespaceName, virtualNetworkRuleName, parameters, options, optionalCallback) { + getAuthorizationRule(resourceGroupName, namespaceName, authorizationRuleName, options, optionalCallback) { let client = this.client; let self = this; if (!optionalCallback && typeof options === 'function') { @@ -6733,26 +4266,26 @@ class Namespaces { } if (!optionalCallback) { return new Promise((resolve, reject) => { - self._createOrUpdateVirtualNetworkRule(resourceGroupName, namespaceName, virtualNetworkRuleName, parameters, options, (err, result, request, response) => { + self._getAuthorizationRule(resourceGroupName, namespaceName, authorizationRuleName, options, (err, result, request, response) => { if (err) { reject(err); } else { resolve(result); } return; }); }); } else { - return self._createOrUpdateVirtualNetworkRule(resourceGroupName, namespaceName, virtualNetworkRuleName, parameters, options, optionalCallback); + return self._getAuthorizationRule(resourceGroupName, namespaceName, authorizationRuleName, options, optionalCallback); } } /** - * Deletes an VirtualNetworkRule for a Namespace. + * Gets the primary and secondary connection strings for the Namespace. * * @param {string} resourceGroupName Name of the resource group within the * azure subscription. * * @param {string} namespaceName The Namespace name * - * @param {string} virtualNetworkRuleName The Virtual Network Rule name. + * @param {string} authorizationRuleName The authorization rule name. * * @param {object} [options] Optional Parameters. * @@ -6761,15 +4294,15 @@ class Namespaces { * * @returns {Promise} A promise is returned * - * @resolve {HttpOperationResponse} - The deserialized result object. + * @resolve {HttpOperationResponse} - The deserialized result object. * * @reject {Error} - The error object. */ - deleteVirtualNetworkRuleWithHttpOperationResponse(resourceGroupName, namespaceName, virtualNetworkRuleName, options) { + listKeysWithHttpOperationResponse(resourceGroupName, namespaceName, authorizationRuleName, options) { let client = this.client; let self = this; return new Promise((resolve, reject) => { - self._deleteVirtualNetworkRule(resourceGroupName, namespaceName, virtualNetworkRuleName, options, (err, result, request, response) => { + self._listKeys(resourceGroupName, namespaceName, authorizationRuleName, options, (err, result, request, response) => { let httpOperationResponse = new msRest.HttpOperationResponse(request, response); httpOperationResponse.body = result; if (err) { reject(err); } @@ -6780,14 +4313,14 @@ class Namespaces { } /** - * Deletes an VirtualNetworkRule for a Namespace. + * Gets the primary and secondary connection strings for the Namespace. * * @param {string} resourceGroupName Name of the resource group within the * azure subscription. * * @param {string} namespaceName The Namespace name * - * @param {string} virtualNetworkRuleName The Virtual Network Rule name. + * @param {string} authorizationRuleName The authorization rule name. * * @param {object} [options] Optional Parameters. * @@ -6801,7 +4334,7 @@ class Namespaces { * * {Promise} A promise is returned * - * @resolve {null} - The deserialized result object. + * @resolve {AccessKeys} - The deserialized result object. * * @reject {Error} - The error object. * @@ -6809,13 +4342,14 @@ class Namespaces { * * {Error} err - The Error object if an error occurred, null otherwise. * - * {null} [result] - The deserialized result object if an error did not occur. + * {object} [result] - The deserialized result object if an error did not occur. + * See {@link AccessKeys} 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. */ - deleteVirtualNetworkRule(resourceGroupName, namespaceName, virtualNetworkRuleName, options, optionalCallback) { + listKeys(resourceGroupName, namespaceName, authorizationRuleName, options, optionalCallback) { let client = this.client; let self = this; if (!optionalCallback && typeof options === 'function') { @@ -6824,26 +4358,36 @@ class Namespaces { } if (!optionalCallback) { return new Promise((resolve, reject) => { - self._deleteVirtualNetworkRule(resourceGroupName, namespaceName, virtualNetworkRuleName, options, (err, result, request, response) => { + self._listKeys(resourceGroupName, namespaceName, authorizationRuleName, options, (err, result, request, response) => { if (err) { reject(err); } else { resolve(result); } return; }); }); } else { - return self._deleteVirtualNetworkRule(resourceGroupName, namespaceName, virtualNetworkRuleName, options, optionalCallback); + return self._listKeys(resourceGroupName, namespaceName, authorizationRuleName, options, optionalCallback); } } /** - * Gets an VirtualNetworkRule for a Namespace by rule name. + * Regenerates the primary or secondary connection strings for the specified + * Namespace. * * @param {string} resourceGroupName Name of the resource group within the * azure subscription. * * @param {string} namespaceName The Namespace name * - * @param {string} virtualNetworkRuleName The Virtual Network Rule name. + * @param {string} authorizationRuleName The authorization rule name. + * + * @param {object} parameters Parameters required to regenerate the connection + * string. + * + * @param {string} parameters.keyType The access key to regenerate. Possible + * values include: 'PrimaryKey', 'SecondaryKey' + * + * @param {string} [parameters.key] Optional, if the key value provided, is set + * for KeyType or autogenerated Key value set for keyType * * @param {object} [options] Optional Parameters. * @@ -6852,15 +4396,15 @@ class Namespaces { * * @returns {Promise} A promise is returned * - * @resolve {HttpOperationResponse} - The deserialized result object. + * @resolve {HttpOperationResponse} - The deserialized result object. * * @reject {Error} - The error object. */ - getVirtualNetworkRuleWithHttpOperationResponse(resourceGroupName, namespaceName, virtualNetworkRuleName, options) { + regenerateKeysWithHttpOperationResponse(resourceGroupName, namespaceName, authorizationRuleName, parameters, options) { let client = this.client; let self = this; return new Promise((resolve, reject) => { - self._getVirtualNetworkRule(resourceGroupName, namespaceName, virtualNetworkRuleName, options, (err, result, request, response) => { + self._regenerateKeys(resourceGroupName, namespaceName, authorizationRuleName, parameters, options, (err, result, request, response) => { let httpOperationResponse = new msRest.HttpOperationResponse(request, response); httpOperationResponse.body = result; if (err) { reject(err); } @@ -6871,14 +4415,24 @@ class Namespaces { } /** - * Gets an VirtualNetworkRule for a Namespace by rule name. + * Regenerates the primary or secondary connection strings for the specified + * Namespace. * * @param {string} resourceGroupName Name of the resource group within the * azure subscription. * * @param {string} namespaceName The Namespace name * - * @param {string} virtualNetworkRuleName The Virtual Network Rule name. + * @param {string} authorizationRuleName The authorization rule name. + * + * @param {object} parameters Parameters required to regenerate the connection + * string. + * + * @param {string} parameters.keyType The access key to regenerate. Possible + * values include: 'PrimaryKey', 'SecondaryKey' + * + * @param {string} [parameters.key] Optional, if the key value provided, is set + * for KeyType or autogenerated Key value set for keyType * * @param {object} [options] Optional Parameters. * @@ -6892,7 +4446,7 @@ class Namespaces { * * {Promise} A promise is returned * - * @resolve {VirtualNetworkRule} - The deserialized result object. + * @resolve {AccessKeys} - The deserialized result object. * * @reject {Error} - The error object. * @@ -6901,13 +4455,13 @@ class Namespaces { * {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 VirtualNetworkRule} for more information. + * See {@link AccessKeys} 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. */ - getVirtualNetworkRule(resourceGroupName, namespaceName, virtualNetworkRuleName, options, optionalCallback) { + regenerateKeys(resourceGroupName, namespaceName, authorizationRuleName, parameters, options, optionalCallback) { let client = this.client; let self = this; if (!optionalCallback && typeof options === 'function') { @@ -6916,14 +4470,14 @@ class Namespaces { } if (!optionalCallback) { return new Promise((resolve, reject) => { - self._getVirtualNetworkRule(resourceGroupName, namespaceName, virtualNetworkRuleName, options, (err, result, request, response) => { + self._regenerateKeys(resourceGroupName, namespaceName, authorizationRuleName, parameters, options, (err, result, request, response) => { if (err) { reject(err); } else { resolve(result); } return; }); }); } else { - return self._getVirtualNetworkRule(resourceGroupName, namespaceName, virtualNetworkRuleName, options, optionalCallback); + return self._regenerateKeys(resourceGroupName, namespaceName, authorizationRuleName, parameters, options, optionalCallback); } } @@ -7415,176 +4969,6 @@ class Namespaces { } } - /** - * Gets a list of IP Filter rules for a Namespace. - * - * @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. - */ - listIPFilterRulesNextWithHttpOperationResponse(nextPageLink, options) { - let client = this.client; - let self = this; - return new Promise((resolve, reject) => { - self._listIPFilterRulesNext(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 a list of IP Filter rules for a Namespace. - * - * @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 {IpFilterRuleListResult} - 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 IpFilterRuleListResult} 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. - */ - listIPFilterRulesNext(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._listIPFilterRulesNext(nextPageLink, options, (err, result, request, response) => { - if (err) { reject(err); } - else { resolve(result); } - return; - }); - }); - } else { - return self._listIPFilterRulesNext(nextPageLink, options, optionalCallback); - } - } - - /** - * Gets a list of VirtualNetwork rules for a Namespace. - * - * @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. - */ - listVirtualNetworkRulesNextWithHttpOperationResponse(nextPageLink, options) { - let client = this.client; - let self = this; - return new Promise((resolve, reject) => { - self._listVirtualNetworkRulesNext(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 a list of VirtualNetwork rules for a Namespace. - * - * @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 {VirtualNetworkRuleListResult} - 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 VirtualNetworkRuleListResult} 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. - */ - listVirtualNetworkRulesNext(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._listVirtualNetworkRulesNext(nextPageLink, options, (err, result, request, response) => { - if (err) { reject(err); } - else { resolve(result); } - return; - }); - }); - } else { - return self._listVirtualNetworkRulesNext(nextPageLink, options, optionalCallback); - } - } - } module.exports = Namespaces; diff --git a/lib/services/eventHubManagement/package.json b/lib/services/eventHubManagement/package.json index 6ab3556f21..d7754b5758 100644 --- a/lib/services/eventHubManagement/package.json +++ b/lib/services/eventHubManagement/package.json @@ -2,7 +2,7 @@ "name": "azure-arm-eventhub", "author": "Microsoft Corporation", "description": "EventHubManagementClient Library with typescript type definitions for node", - "version": "2.1.0", + "version": "3.0.0", "dependencies": { "ms-rest": "^2.3.3", "ms-rest-azure": "^2.5.5"