From 15fbbf5e6a0e1342c891beb82d9ee6b1c0bd7bc6 Mon Sep 17 00:00:00 2001 From: Azure SDK for Python bot Date: Tue, 16 Oct 2018 21:30:56 +0000 Subject: [PATCH] Generated from 9bda7330f3302a3aca9893b278456f3b3b81fc45 moved VNet, IpFilter rules and Kafka from 2018-preview to 2017 API version --- .../lib/models/eHNamespace.js | 9 + .../eventHubManagement/lib/models/index.d.ts | 58 + .../eventHubManagement/lib/models/index.js | 4 + .../lib/models/ipFilterRule.js | 97 + .../lib/models/ipFilterRuleListResult.js | 68 + .../lib/models/virtualNetworkRule.js | 80 + .../models/virtualNetworkRuleListResult.js | 68 + .../lib/operations/index.d.ts | 870 +++- .../lib/operations/namespaces.js | 3723 ++++++++++++++--- 9 files changed, 4339 insertions(+), 638 deletions(-) create mode 100644 lib/services/eventHubManagement/lib/models/ipFilterRule.js create mode 100644 lib/services/eventHubManagement/lib/models/ipFilterRuleListResult.js create mode 100644 lib/services/eventHubManagement/lib/models/virtualNetworkRule.js create mode 100644 lib/services/eventHubManagement/lib/models/virtualNetworkRuleListResult.js diff --git a/lib/services/eventHubManagement/lib/models/eHNamespace.js b/lib/services/eventHubManagement/lib/models/eHNamespace.js index 16adfbc73f..5dfab37ad4 100644 --- a/lib/services/eventHubManagement/lib/models/eHNamespace.js +++ b/lib/services/eventHubManagement/lib/models/eHNamespace.js @@ -38,6 +38,8 @@ class EHNamespace extends models['TrackedResource'] { * @member {number} [maximumThroughputUnits] Upper limit of throughput units * when AutoInflate is enabled, vaule should be within 0 to 20 throughput * units. ( '0' if AutoInflateEnabled = true) + * @member {boolean} [kafkaEnabled] Value that indicates whether Kafka is + * enabled for eventhub namespace. */ constructor() { super(); @@ -167,6 +169,13 @@ class EHNamespace extends models['TrackedResource'] { type: { name: 'Number' } + }, + kafkaEnabled: { + required: false, + serializedName: 'properties.kafkaEnabled', + type: { + name: 'Boolean' + } } } } diff --git a/lib/services/eventHubManagement/lib/models/index.d.ts b/lib/services/eventHubManagement/lib/models/index.d.ts index 00572de4e0..49143f6713 100644 --- a/lib/services/eventHubManagement/lib/models/index.d.ts +++ b/lib/services/eventHubManagement/lib/models/index.d.ts @@ -89,6 +89,8 @@ export interface Sku { * @member {number} [maximumThroughputUnits] Upper limit of throughput units * when AutoInflate is enabled, vaule should be within 0 to 20 throughput * units. ( '0' if AutoInflateEnabled = true) + * @member {boolean} [kafkaEnabled] Value that indicates whether Kafka is + * enabled for eventhub namespace. */ export interface EHNamespace extends TrackedResource { sku?: Sku; @@ -99,6 +101,7 @@ export interface EHNamespace extends TrackedResource { readonly metricId?: string; isAutoInflateEnabled?: boolean; maximumThroughputUnits?: number; + kafkaEnabled?: boolean; } /** @@ -449,6 +452,35 @@ 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 @@ -490,6 +522,32 @@ 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 04a95dd33d..063fde9aed 100644 --- a/lib/services/eventHubManagement/lib/models/index.js +++ b/lib/services/eventHubManagement/lib/models/index.js @@ -38,9 +38,13 @@ 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/models/ipFilterRule.js b/lib/services/eventHubManagement/lib/models/ipFilterRule.js new file mode 100644 index 0000000000..494ec96024 --- /dev/null +++ b/lib/services/eventHubManagement/lib/models/ipFilterRule.js @@ -0,0 +1,97 @@ +/* + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +'use strict'; + +const models = require('./index'); + +/** + * Single item in a List or Get IpFilterRules operation + * + * @extends models['Resource'] + */ +class IpFilterRule extends models['Resource'] { + /** + * Create a IpFilterRule. + * @member {string} [ipMask] IP Mask + * @member {string} [action] The IP Filter Action. Possible values include: + * 'Accept', 'Reject' + * @member {string} [filterName] IP Filter name + */ + constructor() { + super(); + } + + /** + * Defines the metadata of IpFilterRule + * + * @returns {object} metadata of IpFilterRule + * + */ + mapper() { + return { + required: false, + serializedName: 'IpFilterRule', + type: { + name: 'Composite', + className: 'IpFilterRule', + modelProperties: { + id: { + required: false, + readOnly: true, + serializedName: 'id', + type: { + name: 'String' + } + }, + name: { + required: false, + readOnly: true, + serializedName: 'name', + type: { + name: 'String' + } + }, + type: { + required: false, + readOnly: true, + serializedName: 'type', + type: { + name: 'String' + } + }, + ipMask: { + required: false, + serializedName: 'properties.ipMask', + type: { + name: 'String' + } + }, + action: { + required: false, + serializedName: 'properties.action', + type: { + name: 'String' + } + }, + filterName: { + required: false, + serializedName: 'properties.filterName', + type: { + name: 'String' + } + } + } + } + }; + } +} + +module.exports = IpFilterRule; diff --git a/lib/services/eventHubManagement/lib/models/ipFilterRuleListResult.js b/lib/services/eventHubManagement/lib/models/ipFilterRuleListResult.js new file mode 100644 index 0000000000..5983c58f19 --- /dev/null +++ b/lib/services/eventHubManagement/lib/models/ipFilterRuleListResult.js @@ -0,0 +1,68 @@ +/* + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +'use strict'; + +/** + * The response from the List namespace operation. + */ +class IpFilterRuleListResult extends Array { + /** + * Create a IpFilterRuleListResult. + * @member {string} [nextLink] Link to the next set of results. Not empty if + * Value contains an incomplete list of IpFilter Rules + */ + constructor() { + super(); + } + + /** + * Defines the metadata of IpFilterRuleListResult + * + * @returns {object} metadata of IpFilterRuleListResult + * + */ + mapper() { + return { + required: false, + serializedName: 'IpFilterRuleListResult', + type: { + name: 'Composite', + className: 'IpFilterRuleListResult', + modelProperties: { + value: { + required: false, + serializedName: '', + type: { + name: 'Sequence', + element: { + required: false, + serializedName: 'IpFilterRuleElementType', + type: { + name: 'Composite', + className: 'IpFilterRule' + } + } + } + }, + nextLink: { + required: false, + serializedName: 'nextLink', + type: { + name: 'String' + } + } + } + } + }; + } +} + +module.exports = IpFilterRuleListResult; diff --git a/lib/services/eventHubManagement/lib/models/virtualNetworkRule.js b/lib/services/eventHubManagement/lib/models/virtualNetworkRule.js new file mode 100644 index 0000000000..fa8f1966d9 --- /dev/null +++ b/lib/services/eventHubManagement/lib/models/virtualNetworkRule.js @@ -0,0 +1,80 @@ +/* + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +'use strict'; + +const models = require('./index'); + +/** + * Single item in a List or Get VirtualNetworkRules operation + * + * @extends models['Resource'] + */ +class VirtualNetworkRule extends models['Resource'] { + /** + * Create a VirtualNetworkRule. + * @member {string} [virtualNetworkSubnetId] ARM ID of Virtual Network Subnet + */ + constructor() { + super(); + } + + /** + * Defines the metadata of VirtualNetworkRule + * + * @returns {object} metadata of VirtualNetworkRule + * + */ + mapper() { + return { + required: false, + serializedName: 'VirtualNetworkRule', + type: { + name: 'Composite', + className: 'VirtualNetworkRule', + modelProperties: { + id: { + required: false, + readOnly: true, + serializedName: 'id', + type: { + name: 'String' + } + }, + name: { + required: false, + readOnly: true, + serializedName: 'name', + type: { + name: 'String' + } + }, + type: { + required: false, + readOnly: true, + serializedName: 'type', + type: { + name: 'String' + } + }, + virtualNetworkSubnetId: { + required: false, + serializedName: 'properties.virtualNetworkSubnetId', + type: { + name: 'String' + } + } + } + } + }; + } +} + +module.exports = VirtualNetworkRule; diff --git a/lib/services/eventHubManagement/lib/models/virtualNetworkRuleListResult.js b/lib/services/eventHubManagement/lib/models/virtualNetworkRuleListResult.js new file mode 100644 index 0000000000..753996590a --- /dev/null +++ b/lib/services/eventHubManagement/lib/models/virtualNetworkRuleListResult.js @@ -0,0 +1,68 @@ +/* + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +'use strict'; + +/** + * The response from the List namespace operation. + */ +class VirtualNetworkRuleListResult extends Array { + /** + * Create a VirtualNetworkRuleListResult. + * @member {string} [nextLink] Link to the next set of results. Not empty if + * Value contains an incomplete list of VirtualNetwork Rules + */ + constructor() { + super(); + } + + /** + * Defines the metadata of VirtualNetworkRuleListResult + * + * @returns {object} metadata of VirtualNetworkRuleListResult + * + */ + mapper() { + return { + required: false, + serializedName: 'VirtualNetworkRuleListResult', + type: { + name: 'Composite', + className: 'VirtualNetworkRuleListResult', + modelProperties: { + value: { + required: false, + serializedName: '', + type: { + name: 'Sequence', + element: { + required: false, + serializedName: 'VirtualNetworkRuleElementType', + type: { + name: 'Composite', + className: 'VirtualNetworkRule' + } + } + } + }, + nextLink: { + required: false, + serializedName: 'nextLink', + type: { + name: 'String' + } + } + } + } + }; + } +} + +module.exports = VirtualNetworkRuleListResult; diff --git a/lib/services/eventHubManagement/lib/operations/index.d.ts b/lib/services/eventHubManagement/lib/operations/index.d.ts index ac9f86d7ee..bddb95a190 100644 --- a/lib/services/eventHubManagement/lib/operations/index.d.ts +++ b/lib/services/eventHubManagement/lib/operations/index.d.ts @@ -341,6 +341,9 @@ export interface Namespaces { * 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 @@ -387,6 +390,9 @@ export interface Namespaces { * 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 @@ -575,6 +581,9 @@ export interface Namespaces { * 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 @@ -621,6 +630,9 @@ export interface Namespaces { * 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 @@ -1133,37 +1145,85 @@ export interface Namespaces { /** - * Creates or updates a namespace. Once created, this namespace's resource - * manifest is immutable. This operation is idempotent. + * 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} parameters Parameters for creating a namespace resource. + * @param {object} [options] Optional Parameters. * - * @param {object} [parameters.sku] Properties of sku resource + * @param {object} [options.customHeaders] Headers that will be added to the + * request * - * @param {string} parameters.sku.name Name of this SKU. Possible values - * include: 'Basic', 'Standard' + * @returns {Promise} A promise is returned * - * @param {string} [parameters.sku.tier] The billing tier of this particular - * SKU. Possible values include: 'Basic', 'Standard' + * @resolve {HttpOperationResponse} - The deserialized result object. * - * @param {number} [parameters.sku.capacity] The Event Hubs throughput units, - * vaule should be 0 to 20 throughput units. + * @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 {boolean} [parameters.isAutoInflateEnabled] Value that indicates - * whether AutoInflate is enabled for eventhub namespace. + * @param {string} resourceGroupName Name of the resource group within the + * azure subscription. * - * @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 {string} namespaceName The Namespace name * - * @param {string} [parameters.location] Resource location + * @param {object} [options] Optional Parameters. * - * @param {object} [parameters.tags] Resource tags + * @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. * @@ -1172,44 +1232,95 @@ export interface Namespaces { * * @returns {Promise} A promise is returned * - * @resolve {HttpOperationResponse} - The deserialized result object. + * @resolve {HttpOperationResponse} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. */ - beginCreateOrUpdateWithHttpOperationResponse(resourceGroupName: string, namespaceName: string, parameters: models.EHNamespace, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + createOrUpdateIpFilterRuleWithHttpOperationResponse(resourceGroupName: string, namespaceName: string, ipFilterRuleName: string, parameters: models.IpFilterRule, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; /** - * Creates or updates a namespace. Once created, this namespace's resource - * manifest is immutable. This operation is idempotent. + * 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 {object} parameters Parameters for creating a namespace resource. + * @param {string} ipFilterRuleName The IP Filter Rule name. * - * @param {object} [parameters.sku] Properties of sku resource + * @param {object} parameters The Namespace IpFilterRule. * - * @param {string} parameters.sku.name Name of this SKU. Possible values - * include: 'Basic', 'Standard' + * @param {string} [parameters.ipMask] IP Mask * - * @param {string} [parameters.sku.tier] The billing tier of this particular - * SKU. Possible values include: 'Basic', 'Standard' + * @param {string} [parameters.action] The IP Filter Action. Possible values + * include: 'Accept', 'Reject' * - * @param {number} [parameters.sku.capacity] The Event Hubs throughput units, - * vaule should be 0 to 20 throughput units. + * @param {string} [parameters.filterName] IP Filter name * - * @param {boolean} [parameters.isAutoInflateEnabled] Value that indicates - * whether AutoInflate is enabled for eventhub namespace. + * @param {object} [options] Optional Parameters. * - * @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 {object} [options.customHeaders] Headers that will be added to the + * request * - * @param {string} [parameters.location] Resource location + * @param {ServiceCallback} [optionalCallback] - The optional callback. * - * @param {object} [parameters.tags] Resource tags + * @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. * @@ -1223,7 +1334,7 @@ export interface Namespaces { * * {Promise} A promise is returned. * - * @resolve {EHNamespace} - The deserialized result object. + * @resolve {null} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. * @@ -1231,27 +1342,27 @@ export interface Namespaces { * * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. * - * {EHNamespace} [result] - The deserialized result object if an error did not occur. - * See {@link EHNamespace} for more information. + * {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. */ - beginCreateOrUpdate(resourceGroupName: string, namespaceName: string, parameters: models.EHNamespace, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - beginCreateOrUpdate(resourceGroupName: string, namespaceName: string, parameters: models.EHNamespace, callback: ServiceCallback): void; - beginCreateOrUpdate(resourceGroupName: string, namespaceName: string, parameters: models.EHNamespace, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + 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; /** - * Deletes an existing namespace. This operation also removes all associated - * resources under the namespace. + * 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 @@ -1259,21 +1370,22 @@ export interface Namespaces { * * @returns {Promise} A promise is returned * - * @resolve {HttpOperationResponse} - The deserialized result object. + * @resolve {HttpOperationResponse} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. */ - beginDeleteMethodWithHttpOperationResponse(resourceGroupName: string, namespaceName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + getIpFilterRuleWithHttpOperationResponse(resourceGroupName: string, namespaceName: string, ipFilterRuleName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; /** - * Deletes an existing namespace. This operation also removes all associated - * resources under the namespace. + * 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 @@ -1286,7 +1398,7 @@ export interface Namespaces { * * {Promise} A promise is returned. * - * @resolve {null} - The deserialized result object. + * @resolve {IpFilterRule} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. * @@ -1294,23 +1406,25 @@ export interface Namespaces { * * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. * - * {null} [result] - The deserialized result object if an error did not occur. + * {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. */ - beginDeleteMethod(resourceGroupName: string, namespaceName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - beginDeleteMethod(resourceGroupName: string, namespaceName: string, callback: ServiceCallback): void; - beginDeleteMethod(resourceGroupName: string, namespaceName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + 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; /** - * Lists all the available Namespaces within a subscription, irrespective of - * the resource groups. + * Gets a list of VirtualNetwork rules for a Namespace. * - * @param {string} nextPageLink The NextLink from the previous successful call - * to List operation. + * @param {string} resourceGroupName Name of the resource group within the + * azure subscription. + * + * @param {string} namespaceName The Namespace name * * @param {object} [options] Optional Parameters. * @@ -1319,18 +1433,19 @@ export interface Namespaces { * * @returns {Promise} A promise is returned * - * @resolve {HttpOperationResponse} - The deserialized result object. + * @resolve {HttpOperationResponse} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. */ - listNextWithHttpOperationResponse(nextPageLink: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + listVirtualNetworkRulesWithHttpOperationResponse(resourceGroupName: string, namespaceName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; /** - * Lists all the available Namespaces within a subscription, irrespective of - * the resource groups. + * Gets a list of VirtualNetwork rules for a Namespace. * - * @param {string} nextPageLink The NextLink from the previous successful call - * to List operation. + * @param {string} resourceGroupName Name of the resource group within the + * azure subscription. + * + * @param {string} namespaceName The Namespace name * * @param {object} [options] Optional Parameters. * @@ -1344,7 +1459,7 @@ export interface Namespaces { * * {Promise} A promise is returned. * - * @resolve {EHNamespaceListResult} - The deserialized result object. + * @resolve {VirtualNetworkRuleListResult} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. * @@ -1352,23 +1467,33 @@ export interface Namespaces { * * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. * - * {EHNamespaceListResult} [result] - The deserialized result object if an error did not occur. - * See {@link EHNamespaceListResult} for more information. + * {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. */ - listNext(nextPageLink: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - listNext(nextPageLink: string, callback: ServiceCallback): void; - listNext(nextPageLink: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + 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; /** - * Lists the available Namespaces within a resource group. + * Creates or updates an VirtualNetworkRule for a Namespace. * - * @param {string} nextPageLink The NextLink from the previous successful call - * to List operation. + * @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. * @@ -1377,17 +1502,26 @@ export interface Namespaces { * * @returns {Promise} A promise is returned * - * @resolve {HttpOperationResponse} - The deserialized result object. + * @resolve {HttpOperationResponse} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. */ - listByResourceGroupNextWithHttpOperationResponse(nextPageLink: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + createOrUpdateVirtualNetworkRuleWithHttpOperationResponse(resourceGroupName: string, namespaceName: string, virtualNetworkRuleName: string, parameters: models.VirtualNetworkRule, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; /** - * Lists the available Namespaces within a resource group. + * Creates or updates an VirtualNetworkRule for a Namespace. * - * @param {string} nextPageLink The NextLink from the previous successful call - * to List operation. + * @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. * @@ -1401,7 +1535,7 @@ export interface Namespaces { * * {Promise} A promise is returned. * - * @resolve {EHNamespaceListResult} - The deserialized result object. + * @resolve {VirtualNetworkRule} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. * @@ -1409,23 +1543,27 @@ export interface Namespaces { * * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. * - * {EHNamespaceListResult} [result] - The deserialized result object if an error did not occur. - * See {@link EHNamespaceListResult} for more information. + * {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. */ - listByResourceGroupNext(nextPageLink: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - listByResourceGroupNext(nextPageLink: string, callback: ServiceCallback): void; - listByResourceGroupNext(nextPageLink: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + 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; /** - * Gets a list of authorization rules for a Namespace. + * Deletes an VirtualNetworkRule for a Namespace. * - * @param {string} nextPageLink The NextLink from the previous successful call - * to List operation. + * @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. * @@ -1434,17 +1572,21 @@ export interface Namespaces { * * @returns {Promise} A promise is returned * - * @resolve {HttpOperationResponse} - The deserialized result object. + * @resolve {HttpOperationResponse} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. */ - listAuthorizationRulesNextWithHttpOperationResponse(nextPageLink: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + deleteVirtualNetworkRuleWithHttpOperationResponse(resourceGroupName: string, namespaceName: string, virtualNetworkRuleName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; /** - * Gets a list of authorization rules for a Namespace. + * Deletes an VirtualNetworkRule for a Namespace. * - * @param {string} nextPageLink The NextLink from the previous successful call - * to List operation. + * @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. * @@ -1458,7 +1600,7 @@ export interface Namespaces { * * {Promise} A promise is returned. * - * @resolve {AuthorizationRuleListResult} - The deserialized result object. + * @resolve {null} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. * @@ -1466,17 +1608,549 @@ export interface Namespaces { * * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. * - * {AuthorizationRuleListResult} [result] - The deserialized result object if an error did not occur. - * See {@link AuthorizationRuleListResult} for more - * information. + * {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. */ - 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; + 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. + * + * @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|ServiceError} - The error object. + */ + beginCreateOrUpdateWithHttpOperationResponse(resourceGroupName: string, namespaceName: string, parameters: models.EHNamespace, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * 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 {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 {EHNamespace} - 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. + * + * {EHNamespace} [result] - The deserialized result object if an error did not occur. + * See {@link EHNamespace} 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. + */ + beginCreateOrUpdate(resourceGroupName: string, namespaceName: string, parameters: models.EHNamespace, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + beginCreateOrUpdate(resourceGroupName: string, namespaceName: string, parameters: models.EHNamespace, callback: ServiceCallback): void; + beginCreateOrUpdate(resourceGroupName: string, namespaceName: string, parameters: models.EHNamespace, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * 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|ServiceError} - The error object. + */ + beginDeleteMethodWithHttpOperationResponse(resourceGroupName: string, namespaceName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * 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 {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. + */ + beginDeleteMethod(resourceGroupName: string, namespaceName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + beginDeleteMethod(resourceGroupName: string, namespaceName: string, callback: ServiceCallback): void; + beginDeleteMethod(resourceGroupName: string, namespaceName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * 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 + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error|ServiceError} - The error object. + */ + listNextWithHttpOperationResponse(nextPageLink: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * 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 {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 {EHNamespaceListResult} - 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. + * + * {EHNamespaceListResult} [result] - The deserialized result object if an error did not occur. + * See {@link EHNamespaceListResult} 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. + */ + listNext(nextPageLink: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + listNext(nextPageLink: string, callback: ServiceCallback): void; + listNext(nextPageLink: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * 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 + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error|ServiceError} - The error object. + */ + listByResourceGroupNextWithHttpOperationResponse(nextPageLink: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * 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 {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 {EHNamespaceListResult} - 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. + * + * {EHNamespaceListResult} [result] - The deserialized result object if an error did not occur. + * See {@link EHNamespaceListResult} 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. + */ + listByResourceGroupNext(nextPageLink: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + listByResourceGroupNext(nextPageLink: string, callback: ServiceCallback): void; + listByResourceGroupNext(nextPageLink: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * 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 + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error|ServiceError} - The error object. + */ + listAuthorizationRulesNextWithHttpOperationResponse(nextPageLink: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * 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 {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 {AuthorizationRuleListResult} - 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. + * + * {AuthorizationRuleListResult} [result] - The deserialized result object if an error did not occur. + * See {@link AuthorizationRuleListResult} 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. + */ + 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 e85f6de588..6842ca24ba 100644 --- a/lib/services/eventHubManagement/lib/operations/namespaces.js +++ b/lib/services/eventHubManagement/lib/operations/namespaces.js @@ -488,6 +488,9 @@ function _listByResourceGroup(resourceGroupName, options, callback) { * 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 @@ -840,6 +843,9 @@ function _get(resourceGroupName, namespaceName, options, callback) { * 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 @@ -2298,38 +2304,13 @@ function _regenerateKeys(resourceGroupName, namespaceName, authorizationRuleName } /** - * Creates or updates a namespace. Once created, this namespace's resource - * manifest is immutable. This operation is idempotent. + * 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} 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 {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 @@ -2342,13 +2323,14 @@ 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 EHNamespace} for more information. + * 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 _beginCreateOrUpdate(resourceGroupName, namespaceName, parameters, options, callback) { +function _listIPFilterRules(resourceGroupName, namespaceName, options, callback) { /* jshint validthis: true */ let client = this.client; if(!callback && typeof options === 'function') { @@ -2386,9 +2368,6 @@ function _beginCreateOrUpdate(resourceGroupName, namespaceName, parameters, opti 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.'); } @@ -2404,7 +2383,7 @@ function _beginCreateOrUpdate(resourceGroupName, namespaceName, parameters, opti // Construct URL let baseUrl = this.client.baseUri; - let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventHub/namespaces/{namespaceName}'; + let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventHub/namespaces/{namespaceName}/ipfilterrules'; requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); requestUrl = requestUrl.replace('{namespaceName}', encodeURIComponent(namespaceName)); requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); @@ -2416,7 +2395,7 @@ function _beginCreateOrUpdate(resourceGroupName, namespaceName, parameters, opti // Create HTTP transport objects let httpRequest = new WebResource(); - httpRequest.method = 'PUT'; + httpRequest.method = 'GET'; httpRequest.url = requestUrl; httpRequest.headers = {}; // Set Headers @@ -2434,28 +2413,14 @@ function _beginCreateOrUpdate(resourceGroupName, namespaceName, parameters, opti } } } - // 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; + 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 !== 201 && statusCode !== 202) { + if (statusCode !== 200) { let error = new Error(responseBody); error.statusCode = response.statusCode; error.request = msRest.stripRequest(httpRequest); @@ -2491,7 +2456,7 @@ function _beginCreateOrUpdate(resourceGroupName, namespaceName, parameters, opti parsedResponse = JSON.parse(responseBody); result = JSON.parse(responseBody); if (parsedResponse !== null && parsedResponse !== undefined) { - let resultMapper = new client.models['EHNamespace']().mapper(); + let resultMapper = new client.models['IpFilterRuleListResult']().mapper(); result = client.deserialize(resultMapper, parsedResponse, 'result'); } } catch (error) { @@ -2501,37 +2466,30 @@ function _beginCreateOrUpdate(resourceGroupName, namespaceName, parameters, opti 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. + * 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 @@ -2543,13 +2501,14 @@ function _beginCreateOrUpdate(resourceGroupName, namespaceName, parameters, opti * * {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 IpFilterRule} 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 _beginDeleteMethod(resourceGroupName, namespaceName, options, callback) { +function _createOrUpdateIpFilterRule(resourceGroupName, namespaceName, ipFilterRuleName, parameters, options, callback) { /* jshint validthis: true */ let client = this.client; if(!callback && typeof options === 'function') { @@ -2587,6 +2546,18 @@ function _beginDeleteMethod(resourceGroupName, namespaceName, options, callback) 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.'); } @@ -2602,9 +2573,10 @@ function _beginDeleteMethod(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}'; + 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)); @@ -2614,7 +2586,7 @@ function _beginDeleteMethod(resourceGroupName, namespaceName, options, callback) // Create HTTP transport objects let httpRequest = new WebResource(); - httpRequest.method = 'DELETE'; + httpRequest.method = 'PUT'; httpRequest.url = requestUrl; httpRequest.headers = {}; // Set Headers @@ -2632,14 +2604,28 @@ function _beginDeleteMethod(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['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; // 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) { + if (statusCode !== 200) { let error = new Error(responseBody); error.statusCode = response.statusCode; error.request = msRest.stripRequest(httpRequest); @@ -2668,17 +2654,37 @@ function _beginDeleteMethod(resourceGroupName, namespaceName, options, callback) // 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); }); } /** - * Lists all the available Namespaces within a subscription, irrespective of - * the resource groups. + * Deletes an IpFilterRule for a Namespace. * - * @param {string} nextPageLink The NextLink from the previous successful call - * to List operation. + * @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. * @@ -2691,14 +2697,13 @@ function _beginDeleteMethod(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 EHNamespaceListResult} 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 _listNext(nextPageLink, options, callback) { +function _deleteIpFilterRule(resourceGroupName, namespaceName, ipFilterRuleName, options, callback) { /* jshint validthis: true */ let client = this.client; if(!callback && typeof options === 'function') { @@ -2710,8 +2715,46 @@ function _listNext(nextPageLink, options, callback) { } // 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 (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 (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.'); @@ -2721,12 +2764,21 @@ function _listNext(nextPageLink, options, callback) { } // Construct URL - let requestUrl = '{nextLink}'; - requestUrl = requestUrl.replace('{nextLink}', nextPageLink); + 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('&'); + } // Create HTTP transport objects let httpRequest = new WebResource(); - httpRequest.method = 'GET'; + httpRequest.method = 'DELETE'; httpRequest.url = requestUrl; httpRequest.headers = {}; // Set Headers @@ -2751,7 +2803,7 @@ function _listNext(nextPageLink, options, callback) { return callback(err); } let statusCode = response.statusCode; - if (statusCode !== 200) { + if (statusCode !== 200 && statusCode !== 204) { let error = new Error(responseBody); error.statusCode = response.statusCode; error.request = msRest.stripRequest(httpRequest); @@ -2780,33 +2832,20 @@ function _listNext(nextPageLink, options, callback) { // 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. + * Gets an IpFilterRule for a Namespace by rule name. * - * @param {string} nextPageLink The NextLink from the previous successful call - * to List operation. + * @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. * @@ -2820,13 +2859,13 @@ function _listNext(nextPageLink, 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 EHNamespaceListResult} for more information. + * See {@link IpFilterRule} 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) { +function _getIpFilterRule(resourceGroupName, namespaceName, ipFilterRuleName, options, callback) { /* jshint validthis: true */ let client = this.client; if(!callback && typeof options === 'function') { @@ -2838,8 +2877,46 @@ function _listByResourceGroupNext(nextPageLink, options, callback) { } // 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 (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 (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.'); @@ -2849,8 +2926,17 @@ function _listByResourceGroupNext(nextPageLink, options, callback) { } // Construct URL - let requestUrl = '{nextLink}'; - requestUrl = requestUrl.replace('{nextLink}', nextPageLink); + 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('&'); + } // Create HTTP transport objects let httpRequest = new WebResource(); @@ -2915,7 +3001,7 @@ function _listByResourceGroupNext(nextPageLink, options, callback) { parsedResponse = JSON.parse(responseBody); result = JSON.parse(responseBody); if (parsedResponse !== null && parsedResponse !== undefined) { - let resultMapper = new client.models['EHNamespaceListResult']().mapper(); + let resultMapper = new client.models['IpFilterRule']().mapper(); result = client.deserialize(resultMapper, parsedResponse, 'result'); } } catch (error) { @@ -2931,10 +3017,12 @@ function _listByResourceGroupNext(nextPageLink, options, callback) { } /** - * Gets a list of authorization rules for a Namespace. + * Gets a list of VirtualNetwork rules for a Namespace. * - * @param {string} nextPageLink The NextLink from the previous successful call - * to List operation. + * @param {string} resourceGroupName Name of the resource group within the + * azure subscription. + * + * @param {string} namespaceName The Namespace name * * @param {object} [options] Optional Parameters. * @@ -2948,14 +3036,14 @@ function _listByResourceGroupNext(nextPageLink, 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 AuthorizationRuleListResult} for more + * 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 _listAuthorizationRulesNext(nextPageLink, options, callback) { +function _listVirtualNetworkRules(resourceGroupName, namespaceName, options, callback) { /* jshint validthis: true */ let client = this.client; if(!callback && typeof options === 'function') { @@ -2967,8 +3055,37 @@ function _listAuthorizationRulesNext(nextPageLink, options, callback) { } // 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 (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.'); @@ -2978,8 +3095,16 @@ function _listAuthorizationRulesNext(nextPageLink, options, callback) { } // Construct URL - let requestUrl = '{nextLink}'; - requestUrl = requestUrl.replace('{nextLink}', nextPageLink); + 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('&'); + } // Create HTTP transport objects let httpRequest = new WebResource(); @@ -3044,7 +3169,7 @@ function _listAuthorizationRulesNext(nextPageLink, options, callback) { parsedResponse = JSON.parse(responseBody); result = JSON.parse(responseBody); if (parsedResponse !== null && parsedResponse !== undefined) { - let resultMapper = new client.models['AuthorizationRuleListResult']().mapper(); + let resultMapper = new client.models['VirtualNetworkRuleListResult']().mapper(); result = client.deserialize(resultMapper, parsedResponse, 'result'); } } catch (error) { @@ -3059,158 +3184,2369 @@ function _listAuthorizationRulesNext(nextPageLink, options, callback) { }); } -/** 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; +/** + * 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; } - - /** - * 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; - }); - }); + if (!callback) { + throw new Error('callback cannot be null.'); } - - /** - * 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; + // 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 (!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); + 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'); + } } - } - - /** - * 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; - }); - }); - } + 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); + } + + // 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); + } + } /** - * Lists all the available Namespaces within a subscription, irrespective of - * the resource groups. + * 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. * @@ -3224,7 +5560,7 @@ class Namespaces { * * {Promise} A promise is returned * - * @resolve {EHNamespaceListResult} - The deserialized result object. + * @resolve {MessagingPlan} - The deserialized result object. * * @reject {Error} - The error object. * @@ -3233,13 +5569,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 EHNamespaceListResult} 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. */ - list(options, optionalCallback) { + getMessagingPlan(resourceGroupName, namespaceName, options, optionalCallback) { let client = this.client; let self = this; if (!optionalCallback && typeof options === 'function') { @@ -3248,23 +5584,25 @@ class Namespaces { } if (!optionalCallback) { return new Promise((resolve, reject) => { - self._list(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._list(options, optionalCallback); + return self._getMessagingPlan(resourceGroupName, namespaceName, options, optionalCallback); } } /** - * Lists the available Namespaces within a resource group. + * 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 @@ -3272,15 +5610,206 @@ 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. + */ + 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; + }); + }); + } + + /** + * 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 + * + * @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 {AuthorizationRuleListResult} - 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 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. + */ + listAuthorizationRules(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._listAuthorizationRules(resourceGroupName, namespaceName, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._listAuthorizationRules(resourceGroupName, namespaceName, 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. + * + * @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. + */ + createOrUpdateAuthorizationRuleWithHttpOperationResponse(resourceGroupName, namespaceName, authorizationRuleName, parameters, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + 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); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * 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. + * + * @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 {AuthorizationRule} - 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 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. + */ + createOrUpdateAuthorizationRule(resourceGroupName, namespaceName, authorizationRuleName, 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._createOrUpdateAuthorizationRule(resourceGroupName, namespaceName, authorizationRuleName, parameters, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._createOrUpdateAuthorizationRule(resourceGroupName, namespaceName, authorizationRuleName, parameters, options, optionalCallback); + } + } + + /** + * 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 + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. * * @reject {Error} - The error object. */ - listByResourceGroupWithHttpOperationResponse(resourceGroupName, options) { + deleteAuthorizationRuleWithHttpOperationResponse(resourceGroupName, namespaceName, authorizationRuleName, options) { let client = this.client; let self = this; return new Promise((resolve, reject) => { - self._listByResourceGroup(resourceGroupName, 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); } @@ -3291,11 +5820,15 @@ class Namespaces { } /** - * Lists the available Namespaces within a resource group. + * 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 @@ -3308,7 +5841,7 @@ class Namespaces { * * {Promise} A promise is returned * - * @resolve {EHNamespaceListResult} - The deserialized result object. + * @resolve {null} - The deserialized result object. * * @reject {Error} - The error object. * @@ -3316,14 +5849,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 EHNamespaceListResult} 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. */ - listByResourceGroup(resourceGroupName, options, optionalCallback) { + deleteAuthorizationRule(resourceGroupName, namespaceName, authorizationRuleName, options, optionalCallback) { let client = this.client; let self = this; if (!optionalCallback && typeof options === 'function') { @@ -3332,49 +5864,26 @@ class Namespaces { } if (!optionalCallback) { return new Promise((resolve, reject) => { - self._listByResourceGroup(resourceGroupName, 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._listByResourceGroup(resourceGroupName, options, optionalCallback); + return self._deleteAuthorizationRule(resourceGroupName, namespaceName, authorizationRuleName, options, optionalCallback); } } /** - * Creates or updates a namespace. Once created, this namespace's resource - * manifest is immutable. This operation is idempotent. + * 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 {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 {string} [parameters.location] Resource location - * - * @param {object} [parameters.tags] Resource tags + * @param {string} authorizationRuleName The authorization rule name. * * @param {object} [options] Optional Parameters. * @@ -3383,15 +5892,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. */ - createOrUpdateWithHttpOperationResponse(resourceGroupName, namespaceName, parameters, options) { + getAuthorizationRuleWithHttpOperationResponse(resourceGroupName, namespaceName, authorizationRuleName, options) { let client = this.client; let self = this; return new Promise((resolve, reject) => { - self._createOrUpdate(resourceGroupName, namespaceName, 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); } @@ -3402,37 +5911,14 @@ class Namespaces { } /** - * Creates or updates a namespace. Once created, this namespace's resource - * manifest is immutable. This operation is idempotent. + * 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 {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 {string} [parameters.location] Resource location - * - * @param {object} [parameters.tags] Resource tags + * @param {string} authorizationRuleName The authorization rule name. * * @param {object} [options] Optional Parameters. * @@ -3446,7 +5932,7 @@ class Namespaces { * * {Promise} A promise is returned * - * @resolve {EHNamespace} - The deserialized result object. + * @resolve {AuthorizationRule} - The deserialized result object. * * @reject {Error} - The error object. * @@ -3455,13 +5941,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 EHNamespace} 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. */ - createOrUpdate(resourceGroupName, namespaceName, parameters, options, optionalCallback) { + getAuthorizationRule(resourceGroupName, namespaceName, authorizationRuleName, options, optionalCallback) { let client = this.client; let self = this; if (!optionalCallback && typeof options === 'function') { @@ -3470,26 +5956,27 @@ class Namespaces { } if (!optionalCallback) { return new Promise((resolve, reject) => { - self._createOrUpdate(resourceGroupName, namespaceName, 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._createOrUpdate(resourceGroupName, namespaceName, parameters, options, optionalCallback); + return self._getAuthorizationRule(resourceGroupName, namespaceName, authorizationRuleName, options, optionalCallback); } } /** - * Deletes an existing namespace. This operation also removes all associated - * resources under the 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} authorizationRuleName The authorization rule name. + * * @param {object} [options] Optional Parameters. * * @param {object} [options.customHeaders] Headers that will be added to the @@ -3497,15 +5984,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. */ - deleteMethodWithHttpOperationResponse(resourceGroupName, namespaceName, options) { + listKeysWithHttpOperationResponse(resourceGroupName, namespaceName, authorizationRuleName, options) { let client = this.client; let self = this; return new Promise((resolve, reject) => { - self._deleteMethod(resourceGroupName, namespaceName, 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); } @@ -3516,14 +6003,15 @@ class Namespaces { } /** - * Deletes an existing namespace. This operation also removes all associated - * resources under the 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} authorizationRuleName The authorization rule name. + * * @param {object} [options] Optional Parameters. * * @param {object} [options.customHeaders] Headers that will be added to the @@ -3536,7 +6024,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. * @@ -3544,13 +6032,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. */ - deleteMethod(resourceGroupName, namespaceName, options, optionalCallback) { + listKeys(resourceGroupName, namespaceName, authorizationRuleName, options, optionalCallback) { let client = this.client; let self = this; if (!optionalCallback && typeof options === 'function') { @@ -3559,25 +6048,37 @@ class Namespaces { } if (!optionalCallback) { return new Promise((resolve, reject) => { - self._deleteMethod(resourceGroupName, namespaceName, 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._deleteMethod(resourceGroupName, namespaceName, options, optionalCallback); + return self._listKeys(resourceGroupName, namespaceName, authorizationRuleName, options, optionalCallback); } } /** - * Gets the description of the specified namespace. + * 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} 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 @@ -3585,15 +6086,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. */ - getWithHttpOperationResponse(resourceGroupName, namespaceName, options) { + regenerateKeysWithHttpOperationResponse(resourceGroupName, namespaceName, authorizationRuleName, parameters, options) { let client = this.client; let self = this; return new Promise((resolve, reject) => { - self._get(resourceGroupName, namespaceName, 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); } @@ -3604,13 +6105,25 @@ class Namespaces { } /** - * Gets the description of the specified namespace. + * 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} 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 @@ -3623,7 +6136,7 @@ class Namespaces { * * {Promise} A promise is returned * - * @resolve {EHNamespace} - The deserialized result object. + * @resolve {AccessKeys} - The deserialized result object. * * @reject {Error} - The error object. * @@ -3632,13 +6145,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 EHNamespace} 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. */ - get(resourceGroupName, namespaceName, options, optionalCallback) { + regenerateKeys(resourceGroupName, namespaceName, authorizationRuleName, parameters, options, optionalCallback) { let client = this.client; let self = this; if (!optionalCallback && typeof options === 'function') { @@ -3647,50 +6160,25 @@ class Namespaces { } if (!optionalCallback) { return new Promise((resolve, reject) => { - self._get(resourceGroupName, namespaceName, 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._get(resourceGroupName, namespaceName, options, optionalCallback); + return self._regenerateKeys(resourceGroupName, namespaceName, authorizationRuleName, parameters, options, optionalCallback); } } /** - * Creates or updates a namespace. Once created, this namespace's resource - * manifest is immutable. This operation is idempotent. + * 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} 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 {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 @@ -3698,15 +6186,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. */ - updateWithHttpOperationResponse(resourceGroupName, namespaceName, parameters, options) { + listIPFilterRulesWithHttpOperationResponse(resourceGroupName, namespaceName, options) { let client = this.client; let self = this; return new Promise((resolve, reject) => { - self._update(resourceGroupName, namespaceName, parameters, options, (err, result, request, response) => { + self._listIPFilterRules(resourceGroupName, namespaceName, options, (err, result, request, response) => { let httpOperationResponse = new msRest.HttpOperationResponse(request, response); httpOperationResponse.body = result; if (err) { reject(err); } @@ -3717,38 +6205,13 @@ class Namespaces { } /** - * Creates or updates a namespace. Once created, this namespace's resource - * manifest is immutable. This operation is idempotent. + * 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} 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 {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 @@ -3761,7 +6224,7 @@ class Namespaces { * * {Promise} A promise is returned * - * @resolve {EHNamespace} - The deserialized result object. + * @resolve {IpFilterRuleListResult} - The deserialized result object. * * @reject {Error} - The error object. * @@ -3770,13 +6233,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 EHNamespace} for more information. + * 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. */ - update(resourceGroupName, namespaceName, parameters, options, optionalCallback) { + listIPFilterRules(resourceGroupName, namespaceName, options, optionalCallback) { let client = this.client; let self = this; if (!optionalCallback && typeof options === 'function') { @@ -3785,25 +6249,36 @@ class Namespaces { } if (!optionalCallback) { return new Promise((resolve, reject) => { - self._update(resourceGroupName, namespaceName, parameters, options, (err, result, request, response) => { + self._listIPFilterRules(resourceGroupName, namespaceName, options, (err, result, request, response) => { if (err) { reject(err); } else { resolve(result); } return; }); }); } else { - return self._update(resourceGroupName, namespaceName, parameters, options, optionalCallback); + return self._listIPFilterRules(resourceGroupName, namespaceName, options, optionalCallback); } } /** - * Gets messaging plan for specified namespace. + * 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 @@ -3811,15 +6286,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. */ - getMessagingPlanWithHttpOperationResponse(resourceGroupName, namespaceName, options) { + createOrUpdateIpFilterRuleWithHttpOperationResponse(resourceGroupName, namespaceName, ipFilterRuleName, parameters, options) { let client = this.client; let self = this; return new Promise((resolve, reject) => { - self._getMessagingPlan(resourceGroupName, namespaceName, options, (err, result, request, response) => { + self._createOrUpdateIpFilterRule(resourceGroupName, namespaceName, ipFilterRuleName, parameters, options, (err, result, request, response) => { let httpOperationResponse = new msRest.HttpOperationResponse(request, response); httpOperationResponse.body = result; if (err) { reject(err); } @@ -3830,13 +6305,24 @@ class Namespaces { } /** - * Gets messaging plan for specified namespace. + * 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 @@ -3849,7 +6335,7 @@ class Namespaces { * * {Promise} A promise is returned * - * @resolve {MessagingPlan} - The deserialized result object. + * @resolve {IpFilterRule} - The deserialized result object. * * @reject {Error} - The error object. * @@ -3858,13 +6344,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 MessagingPlan} for more information. + * See {@link IpFilterRule} 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) { + createOrUpdateIpFilterRule(resourceGroupName, namespaceName, ipFilterRuleName, parameters, options, optionalCallback) { let client = this.client; let self = this; if (!optionalCallback && typeof options === 'function') { @@ -3873,25 +6359,27 @@ class Namespaces { } if (!optionalCallback) { return new Promise((resolve, reject) => { - self._getMessagingPlan(resourceGroupName, namespaceName, options, (err, result, request, response) => { + self._createOrUpdateIpFilterRule(resourceGroupName, namespaceName, ipFilterRuleName, parameters, options, (err, result, request, response) => { if (err) { reject(err); } else { resolve(result); } return; }); }); } else { - return self._getMessagingPlan(resourceGroupName, namespaceName, options, optionalCallback); + return self._createOrUpdateIpFilterRule(resourceGroupName, namespaceName, ipFilterRuleName, parameters, options, optionalCallback); } } /** - * Gets a list of authorization rules for a Namespace. + * 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 @@ -3899,15 +6387,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. */ - listAuthorizationRulesWithHttpOperationResponse(resourceGroupName, namespaceName, options) { + deleteIpFilterRuleWithHttpOperationResponse(resourceGroupName, namespaceName, ipFilterRuleName, options) { let client = this.client; let self = this; return new Promise((resolve, reject) => { - self._listAuthorizationRules(resourceGroupName, namespaceName, options, (err, result, request, response) => { + self._deleteIpFilterRule(resourceGroupName, namespaceName, ipFilterRuleName, options, (err, result, request, response) => { let httpOperationResponse = new msRest.HttpOperationResponse(request, response); httpOperationResponse.body = result; if (err) { reject(err); } @@ -3918,13 +6406,15 @@ class Namespaces { } /** - * Gets a list of authorization rules for a Namespace. + * 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 @@ -3937,7 +6427,7 @@ class Namespaces { * * {Promise} A promise is returned * - * @resolve {AuthorizationRuleListResult} - The deserialized result object. + * @resolve {null} - The deserialized result object. * * @reject {Error} - The error object. * @@ -3945,15 +6435,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 AuthorizationRuleListResult} 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. */ - listAuthorizationRules(resourceGroupName, namespaceName, options, optionalCallback) { + deleteIpFilterRule(resourceGroupName, namespaceName, ipFilterRuleName, options, optionalCallback) { let client = this.client; let self = this; if (!optionalCallback && typeof options === 'function') { @@ -3962,30 +6450,26 @@ class Namespaces { } if (!optionalCallback) { return new Promise((resolve, reject) => { - self._listAuthorizationRules(resourceGroupName, namespaceName, options, (err, result, request, response) => { + self._deleteIpFilterRule(resourceGroupName, namespaceName, ipFilterRuleName, options, (err, result, request, response) => { if (err) { reject(err); } else { resolve(result); } return; }); }); } else { - return self._listAuthorizationRules(resourceGroupName, namespaceName, options, optionalCallback); + return self._deleteIpFilterRule(resourceGroupName, namespaceName, ipFilterRuleName, options, optionalCallback); } } /** - * Creates or updates an AuthorizationRule for a Namespace. + * 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} authorizationRuleName The authorization rule name. - * - * @param {object} parameters The shared access AuthorizationRule. - * - * @param {array} parameters.rights The rights associated with the rule. + * @param {string} ipFilterRuleName The IP Filter Rule name. * * @param {object} [options] Optional Parameters. * @@ -3994,15 +6478,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) { + getIpFilterRuleWithHttpOperationResponse(resourceGroupName, namespaceName, ipFilterRuleName, 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._getIpFilterRule(resourceGroupName, namespaceName, ipFilterRuleName, options, (err, result, request, response) => { let httpOperationResponse = new msRest.HttpOperationResponse(request, response); httpOperationResponse.body = result; if (err) { reject(err); } @@ -4013,18 +6497,14 @@ class Namespaces { } /** - * Creates or updates an AuthorizationRule for a Namespace. + * 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} authorizationRuleName The authorization rule name. - * - * @param {object} parameters The shared access AuthorizationRule. - * - * @param {array} parameters.rights The rights associated with the rule. + * @param {string} ipFilterRuleName The IP Filter Rule name. * * @param {object} [options] Optional Parameters. * @@ -4038,7 +6518,7 @@ class Namespaces { * * {Promise} A promise is returned * - * @resolve {AuthorizationRule} - The deserialized result object. + * @resolve {IpFilterRule} - The deserialized result object. * * @reject {Error} - The error object. * @@ -4047,13 +6527,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 IpFilterRule} 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) { + getIpFilterRule(resourceGroupName, namespaceName, ipFilterRuleName, options, optionalCallback) { let client = this.client; let self = this; if (!optionalCallback && typeof options === 'function') { @@ -4062,27 +6542,25 @@ class Namespaces { } if (!optionalCallback) { return new Promise((resolve, reject) => { - self._createOrUpdateAuthorizationRule(resourceGroupName, namespaceName, authorizationRuleName, parameters, options, (err, result, request, response) => { + self._getIpFilterRule(resourceGroupName, namespaceName, ipFilterRuleName, 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._getIpFilterRule(resourceGroupName, namespaceName, ipFilterRuleName, options, optionalCallback); } } /** - * Deletes an AuthorizationRule for a Namespace. + * 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 {string} authorizationRuleName The authorization rule name. - * * @param {object} [options] Optional Parameters. * * @param {object} [options.customHeaders] Headers that will be added to the @@ -4090,15 +6568,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) { + listVirtualNetworkRulesWithHttpOperationResponse(resourceGroupName, namespaceName, options) { let client = this.client; let self = this; return new Promise((resolve, reject) => { - self._deleteAuthorizationRule(resourceGroupName, namespaceName, authorizationRuleName, options, (err, result, request, response) => { + self._listVirtualNetworkRules(resourceGroupName, namespaceName, options, (err, result, request, response) => { let httpOperationResponse = new msRest.HttpOperationResponse(request, response); httpOperationResponse.body = result; if (err) { reject(err); } @@ -4109,15 +6587,13 @@ class Namespaces { } /** - * Deletes an AuthorizationRule for a Namespace. + * 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 {string} authorizationRuleName The authorization rule name. - * * @param {object} [options] Optional Parameters. * * @param {object} [options.customHeaders] Headers that will be added to the @@ -4130,7 +6606,7 @@ class Namespaces { * * {Promise} A promise is returned * - * @resolve {null} - The deserialized result object. + * @resolve {VirtualNetworkRuleListResult} - The deserialized result object. * * @reject {Error} - The error object. * @@ -4138,13 +6614,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 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. */ - deleteAuthorizationRule(resourceGroupName, namespaceName, authorizationRuleName, options, optionalCallback) { + listVirtualNetworkRules(resourceGroupName, namespaceName, options, optionalCallback) { let client = this.client; let self = this; if (!optionalCallback && typeof options === 'function') { @@ -4153,26 +6631,31 @@ class Namespaces { } if (!optionalCallback) { return new Promise((resolve, reject) => { - self._deleteAuthorizationRule(resourceGroupName, namespaceName, authorizationRuleName, options, (err, result, request, response) => { + self._listVirtualNetworkRules(resourceGroupName, namespaceName, options, (err, result, request, response) => { if (err) { reject(err); } else { resolve(result); } return; }); }); } else { - return self._deleteAuthorizationRule(resourceGroupName, namespaceName, authorizationRuleName, options, optionalCallback); + return self._listVirtualNetworkRules(resourceGroupName, namespaceName, options, optionalCallback); } } /** - * Gets an AuthorizationRule for a Namespace by rule name. + * 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} authorizationRuleName The authorization rule 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. * @@ -4181,15 +6664,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) { + createOrUpdateVirtualNetworkRuleWithHttpOperationResponse(resourceGroupName, namespaceName, virtualNetworkRuleName, 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._createOrUpdateVirtualNetworkRule(resourceGroupName, namespaceName, virtualNetworkRuleName, parameters, options, (err, result, request, response) => { let httpOperationResponse = new msRest.HttpOperationResponse(request, response); httpOperationResponse.body = result; if (err) { reject(err); } @@ -4200,14 +6683,19 @@ class Namespaces { } /** - * Gets an AuthorizationRule for a Namespace by rule name. + * 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} authorizationRuleName The authorization rule 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. * @@ -4221,7 +6709,7 @@ class Namespaces { * * {Promise} A promise is returned * - * @resolve {AuthorizationRule} - The deserialized result object. + * @resolve {VirtualNetworkRule} - The deserialized result object. * * @reject {Error} - The error object. * @@ -4230,13 +6718,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 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. */ - getAuthorizationRule(resourceGroupName, namespaceName, authorizationRuleName, options, optionalCallback) { + createOrUpdateVirtualNetworkRule(resourceGroupName, namespaceName, virtualNetworkRuleName, parameters, options, optionalCallback) { let client = this.client; let self = this; if (!optionalCallback && typeof options === 'function') { @@ -4245,26 +6733,26 @@ class Namespaces { } if (!optionalCallback) { return new Promise((resolve, reject) => { - self._getAuthorizationRule(resourceGroupName, namespaceName, authorizationRuleName, options, (err, result, request, response) => { + self._createOrUpdateVirtualNetworkRule(resourceGroupName, namespaceName, virtualNetworkRuleName, 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._createOrUpdateVirtualNetworkRule(resourceGroupName, namespaceName, virtualNetworkRuleName, parameters, options, optionalCallback); } } /** - * Gets the primary and secondary connection strings for the Namespace. + * 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} authorizationRuleName The authorization rule name. + * @param {string} virtualNetworkRuleName The Virtual Network Rule name. * * @param {object} [options] Optional Parameters. * @@ -4273,15 +6761,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) { + deleteVirtualNetworkRuleWithHttpOperationResponse(resourceGroupName, namespaceName, virtualNetworkRuleName, options) { let client = this.client; let self = this; return new Promise((resolve, reject) => { - self._listKeys(resourceGroupName, namespaceName, authorizationRuleName, options, (err, result, request, response) => { + self._deleteVirtualNetworkRule(resourceGroupName, namespaceName, virtualNetworkRuleName, options, (err, result, request, response) => { let httpOperationResponse = new msRest.HttpOperationResponse(request, response); httpOperationResponse.body = result; if (err) { reject(err); } @@ -4292,14 +6780,14 @@ class Namespaces { } /** - * Gets the primary and secondary connection strings for the Namespace. + * 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} authorizationRuleName The authorization rule name. + * @param {string} virtualNetworkRuleName The Virtual Network Rule name. * * @param {object} [options] Optional Parameters. * @@ -4313,7 +6801,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. * @@ -4321,14 +6809,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) { + deleteVirtualNetworkRule(resourceGroupName, namespaceName, virtualNetworkRuleName, options, optionalCallback) { let client = this.client; let self = this; if (!optionalCallback && typeof options === 'function') { @@ -4337,36 +6824,26 @@ class Namespaces { } if (!optionalCallback) { return new Promise((resolve, reject) => { - self._listKeys(resourceGroupName, namespaceName, authorizationRuleName, options, (err, result, request, response) => { + self._deleteVirtualNetworkRule(resourceGroupName, namespaceName, virtualNetworkRuleName, options, (err, result, request, response) => { if (err) { reject(err); } else { resolve(result); } return; }); }); } else { - return self._listKeys(resourceGroupName, namespaceName, authorizationRuleName, options, optionalCallback); + return self._deleteVirtualNetworkRule(resourceGroupName, namespaceName, virtualNetworkRuleName, options, optionalCallback); } } /** - * Regenerates the primary or secondary connection strings for the specified - * Namespace. + * 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} 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 {string} virtualNetworkRuleName The Virtual Network Rule name. * * @param {object} [options] Optional Parameters. * @@ -4375,15 +6852,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) { + getVirtualNetworkRuleWithHttpOperationResponse(resourceGroupName, namespaceName, virtualNetworkRuleName, 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._getVirtualNetworkRule(resourceGroupName, namespaceName, virtualNetworkRuleName, options, (err, result, request, response) => { let httpOperationResponse = new msRest.HttpOperationResponse(request, response); httpOperationResponse.body = result; if (err) { reject(err); } @@ -4394,24 +6871,14 @@ class Namespaces { } /** - * Regenerates the primary or secondary connection strings for the specified - * Namespace. + * 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} 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 {string} virtualNetworkRuleName The Virtual Network Rule name. * * @param {object} [options] Optional Parameters. * @@ -4425,7 +6892,7 @@ class Namespaces { * * {Promise} A promise is returned * - * @resolve {AccessKeys} - The deserialized result object. + * @resolve {VirtualNetworkRule} - The deserialized result object. * * @reject {Error} - The error object. * @@ -4434,13 +6901,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 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. */ - regenerateKeys(resourceGroupName, namespaceName, authorizationRuleName, parameters, options, optionalCallback) { + getVirtualNetworkRule(resourceGroupName, namespaceName, virtualNetworkRuleName, options, optionalCallback) { let client = this.client; let self = this; if (!optionalCallback && typeof options === 'function') { @@ -4449,14 +6916,14 @@ class Namespaces { } if (!optionalCallback) { return new Promise((resolve, reject) => { - self._regenerateKeys(resourceGroupName, namespaceName, authorizationRuleName, parameters, options, (err, result, request, response) => { + self._getVirtualNetworkRule(resourceGroupName, namespaceName, virtualNetworkRuleName, 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._getVirtualNetworkRule(resourceGroupName, namespaceName, virtualNetworkRuleName, options, optionalCallback); } } @@ -4489,6 +6956,9 @@ class Namespaces { * 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 @@ -4547,6 +7017,9 @@ class Namespaces { * 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 @@ -4942,6 +7415,176 @@ 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;